"use strict";
(self["webpackChunkclimb_onyx_gui_extension"] = self["webpackChunkclimb_onyx_gui_extension"] || []).push([["vendors-node_modules_climb-onyx-gui_dist_climb-onyx-gui_js"],{

/***/ "./node_modules/climb-onyx-gui/dist/climb-onyx-gui.js":
/*!************************************************************!*\
  !*** ./node_modules/climb-onyx-gui/dist/climb-onyx-gui.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Gre)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);



function jh(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var kx = { exports: {} }, oC = { exports: {} }, Wi = {};
/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var aD;
function X9() {
  if (aD) return Wi;
  aD = 1;
  var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, a = e ? Symbol.for("react.strict_mode") : 60108, u = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, c = e ? Symbol.for("react.context") : 60110, i = e ? Symbol.for("react.async_mode") : 60111, l = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, f = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, g = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, C = e ? Symbol.for("react.block") : 60121, m = e ? Symbol.for("react.fundamental") : 60117, h = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119;
  function S(x) {
    if (typeof x == "object" && x !== null) {
      var T = x.$$typeof;
      switch (T) {
        case t:
          switch (x = x.type, x) {
            case i:
            case l:
            case n:
            case u:
            case a:
            case f:
              return x;
            default:
              switch (x = x && x.$$typeof, x) {
                case c:
                case v:
                case y:
                case g:
                case s:
                  return x;
                default:
                  return T;
              }
          }
        case r:
          return T;
      }
    }
  }
  function E(x) {
    return S(x) === l;
  }
  return Wi.AsyncMode = i, Wi.ConcurrentMode = l, Wi.ContextConsumer = c, Wi.ContextProvider = s, Wi.Element = t, Wi.ForwardRef = v, Wi.Fragment = n, Wi.Lazy = y, Wi.Memo = g, Wi.Portal = r, Wi.Profiler = u, Wi.StrictMode = a, Wi.Suspense = f, Wi.isAsyncMode = function(x) {
    return E(x) || S(x) === i;
  }, Wi.isConcurrentMode = E, Wi.isContextConsumer = function(x) {
    return S(x) === c;
  }, Wi.isContextProvider = function(x) {
    return S(x) === s;
  }, Wi.isElement = function(x) {
    return typeof x == "object" && x !== null && x.$$typeof === t;
  }, Wi.isForwardRef = function(x) {
    return S(x) === v;
  }, Wi.isFragment = function(x) {
    return S(x) === n;
  }, Wi.isLazy = function(x) {
    return S(x) === y;
  }, Wi.isMemo = function(x) {
    return S(x) === g;
  }, Wi.isPortal = function(x) {
    return S(x) === r;
  }, Wi.isProfiler = function(x) {
    return S(x) === u;
  }, Wi.isStrictMode = function(x) {
    return S(x) === a;
  }, Wi.isSuspense = function(x) {
    return S(x) === f;
  }, Wi.isValidElementType = function(x) {
    return typeof x == "string" || typeof x == "function" || x === n || x === l || x === u || x === a || x === f || x === p || typeof x == "object" && x !== null && (x.$$typeof === y || x.$$typeof === g || x.$$typeof === s || x.$$typeof === c || x.$$typeof === v || x.$$typeof === m || x.$$typeof === h || x.$$typeof === w || x.$$typeof === C);
  }, Wi.typeOf = S, Wi;
}
var _i = {};
/** @license React v16.13.1
 * react-is.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var oD;
function $9() {
  return oD || (oD = 1,  true && function() {
    var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, a = e ? Symbol.for("react.strict_mode") : 60108, u = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, c = e ? Symbol.for("react.context") : 60110, i = e ? Symbol.for("react.async_mode") : 60111, l = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, f = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, g = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, C = e ? Symbol.for("react.block") : 60121, m = e ? Symbol.for("react.fundamental") : 60117, h = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119;
    function S(be) {
      return typeof be == "string" || typeof be == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
      be === n || be === l || be === u || be === a || be === f || be === p || typeof be == "object" && be !== null && (be.$$typeof === y || be.$$typeof === g || be.$$typeof === s || be.$$typeof === c || be.$$typeof === v || be.$$typeof === m || be.$$typeof === h || be.$$typeof === w || be.$$typeof === C);
    }
    function E(be) {
      if (typeof be == "object" && be !== null) {
        var Me = be.$$typeof;
        switch (Me) {
          case t:
            var Ge = be.type;
            switch (Ge) {
              case i:
              case l:
              case n:
              case u:
              case a:
              case f:
                return Ge;
              default:
                var we = Ge && Ge.$$typeof;
                switch (we) {
                  case c:
                  case v:
                  case y:
                  case g:
                  case s:
                    return we;
                  default:
                    return Me;
                }
            }
          case r:
            return Me;
        }
      }
    }
    var x = i, T = l, F = c, P = s, k = t, I = v, L = n, A = y, O = g, N = r, Y = u, j = a, te = f, re = !1;
    function z(be) {
      return re || (re = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), Z(be) || E(be) === i;
    }
    function Z(be) {
      return E(be) === l;
    }
    function W(be) {
      return E(be) === c;
    }
    function q(be) {
      return E(be) === s;
    }
    function ie(be) {
      return typeof be == "object" && be !== null && be.$$typeof === t;
    }
    function ce(be) {
      return E(be) === v;
    }
    function X(be) {
      return E(be) === n;
    }
    function U(be) {
      return E(be) === y;
    }
    function ne(be) {
      return E(be) === g;
    }
    function se(be) {
      return E(be) === r;
    }
    function le(be) {
      return E(be) === u;
    }
    function ue(be) {
      return E(be) === a;
    }
    function ve(be) {
      return E(be) === f;
    }
    _i.AsyncMode = x, _i.ConcurrentMode = T, _i.ContextConsumer = F, _i.ContextProvider = P, _i.Element = k, _i.ForwardRef = I, _i.Fragment = L, _i.Lazy = A, _i.Memo = O, _i.Portal = N, _i.Profiler = Y, _i.StrictMode = j, _i.Suspense = te, _i.isAsyncMode = z, _i.isConcurrentMode = Z, _i.isContextConsumer = W, _i.isContextProvider = q, _i.isElement = ie, _i.isForwardRef = ce, _i.isFragment = X, _i.isLazy = U, _i.isMemo = ne, _i.isPortal = se, _i.isProfiler = le, _i.isStrictMode = ue, _i.isSuspense = ve, _i.isValidElementType = S, _i.typeOf = E;
  }()), _i;
}
var sD;
function DT() {
  return sD || (sD = 1,  false ? 0 : oC.exports = $9()), oC.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var VS, lD;
function FT() {
  if (lD) return VS;
  lD = 1;
  var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
  function n(u) {
    if (u == null)
      throw new TypeError("Object.assign cannot be called with null or undefined");
    return Object(u);
  }
  function a() {
    try {
      if (!Object.assign)
        return !1;
      var u = new String("abc");
      if (u[5] = "de", Object.getOwnPropertyNames(u)[0] === "5")
        return !1;
      for (var s = {}, c = 0; c < 10; c++)
        s["_" + String.fromCharCode(c)] = c;
      var i = Object.getOwnPropertyNames(s).map(function(v) {
        return s[v];
      });
      if (i.join("") !== "0123456789")
        return !1;
      var l = {};
      return "abcdefghijklmnopqrst".split("").forEach(function(v) {
        l[v] = v;
      }), Object.keys(Object.assign({}, l)).join("") === "abcdefghijklmnopqrst";
    } catch {
      return !1;
    }
  }
  return VS = a() ? Object.assign : function(u, s) {
    for (var c, i = n(u), l, v = 1; v < arguments.length; v++) {
      c = Object(arguments[v]);
      for (var f in c)
        t.call(c, f) && (i[f] = c[f]);
      if (e) {
        l = e(c);
        for (var p = 0; p < l.length; p++)
          r.call(c, l[p]) && (i[l[p]] = c[l[p]]);
      }
    }
    return i;
  }, VS;
}
var zS, uD;
function PT() {
  if (uD) return zS;
  uD = 1;
  var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
  return zS = e, zS;
}
var WS, cD;
function OF() {
  return cD || (cD = 1, WS = Function.call.bind(Object.prototype.hasOwnProperty)), WS;
}
var _S, dD;
function Z9() {
  if (dD) return _S;
  dD = 1;
  var e = function() {
  };
  if (true) {
    var t = PT(), r = {}, n = OF();
    e = function(u) {
      var s = "Warning: " + u;
      typeof console < "u" && console.error(s);
      try {
        throw new Error(s);
      } catch {
      }
    };
  }
  function a(u, s, c, i, l) {
    if (true) {
      for (var v in u)
        if (n(u, v)) {
          var f;
          try {
            if (typeof u[v] != "function") {
              var p = Error(
                (i || "React class") + ": " + c + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof u[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
              );
              throw p.name = "Invariant Violation", p;
            }
            f = u[v](s, v, i, c, null, t);
          } catch (y) {
            f = y;
          }
          if (f && !(f instanceof Error) && e(
            (i || "React class") + ": type specification of " + c + " `" + v + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof f + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
          ), f instanceof Error && !(f.message in r)) {
            r[f.message] = !0;
            var g = l ? l() : "";
            e(
              "Failed " + c + " type: " + f.message + (g ?? "")
            );
          }
        }
    }
  }
  return a.resetWarningCache = function() {
     true && (r = {});
  }, _S = a, _S;
}
var US, fD;
function K9() {
  if (fD) return US;
  fD = 1;
  var e = DT(), t = FT(), r = PT(), n = OF(), a = Z9(), u = function() {
  };
   true && (u = function(c) {
    var i = "Warning: " + c;
    typeof console < "u" && console.error(i);
    try {
      throw new Error(i);
    } catch {
    }
  });
  function s() {
    return null;
  }
  return US = function(c, i) {
    var l = typeof Symbol == "function" && Symbol.iterator, v = "@@iterator";
    function f(Z) {
      var W = Z && (l && Z[l] || Z[v]);
      if (typeof W == "function")
        return W;
    }
    var p = "<<anonymous>>", g = {
      array: h("array"),
      bigint: h("bigint"),
      bool: h("boolean"),
      func: h("function"),
      number: h("number"),
      object: h("object"),
      string: h("string"),
      symbol: h("symbol"),
      any: w(),
      arrayOf: S,
      element: E(),
      elementType: x(),
      instanceOf: T,
      node: I(),
      objectOf: P,
      oneOf: F,
      oneOfType: k,
      shape: A,
      exact: O
    };
    function y(Z, W) {
      return Z === W ? Z !== 0 || 1 / Z === 1 / W : Z !== Z && W !== W;
    }
    function C(Z, W) {
      this.message = Z, this.data = W && typeof W == "object" ? W : {}, this.stack = "";
    }
    C.prototype = Error.prototype;
    function m(Z) {
      if (true)
        var W = {}, q = 0;
      function ie(X, U, ne, se, le, ue, ve) {
        if (se = se || p, ue = ue || ne, ve !== r) {
          if (i) {
            var be = new Error(
              "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
            );
            throw be.name = "Invariant Violation", be;
          } else if ( true && typeof console < "u") {
            var Me = se + ":" + ne;
            !W[Me] && // Avoid spamming the console because they are often not actionable except for lib authors
            q < 3 && (u(
              "You are manually calling a React.PropTypes validation function for the `" + ue + "` prop on `" + se + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
            ), W[Me] = !0, q++);
          }
        }
        return U[ne] == null ? X ? U[ne] === null ? new C("The " + le + " `" + ue + "` is marked as required " + ("in `" + se + "`, but its value is `null`.")) : new C("The " + le + " `" + ue + "` is marked as required in " + ("`" + se + "`, but its value is `undefined`.")) : null : Z(U, ne, se, le, ue);
      }
      var ce = ie.bind(null, !1);
      return ce.isRequired = ie.bind(null, !0), ce;
    }
    function h(Z) {
      function W(q, ie, ce, X, U, ne) {
        var se = q[ie], le = j(se);
        if (le !== Z) {
          var ue = te(se);
          return new C(
            "Invalid " + X + " `" + U + "` of type " + ("`" + ue + "` supplied to `" + ce + "`, expected ") + ("`" + Z + "`."),
            { expectedType: Z }
          );
        }
        return null;
      }
      return m(W);
    }
    function w() {
      return m(s);
    }
    function S(Z) {
      function W(q, ie, ce, X, U) {
        if (typeof Z != "function")
          return new C("Property `" + U + "` of component `" + ce + "` has invalid PropType notation inside arrayOf.");
        var ne = q[ie];
        if (!Array.isArray(ne)) {
          var se = j(ne);
          return new C("Invalid " + X + " `" + U + "` of type " + ("`" + se + "` supplied to `" + ce + "`, expected an array."));
        }
        for (var le = 0; le < ne.length; le++) {
          var ue = Z(ne, le, ce, X, U + "[" + le + "]", r);
          if (ue instanceof Error)
            return ue;
        }
        return null;
      }
      return m(W);
    }
    function E() {
      function Z(W, q, ie, ce, X) {
        var U = W[q];
        if (!c(U)) {
          var ne = j(U);
          return new C("Invalid " + ce + " `" + X + "` of type " + ("`" + ne + "` supplied to `" + ie + "`, expected a single ReactElement."));
        }
        return null;
      }
      return m(Z);
    }
    function x() {
      function Z(W, q, ie, ce, X) {
        var U = W[q];
        if (!e.isValidElementType(U)) {
          var ne = j(U);
          return new C("Invalid " + ce + " `" + X + "` of type " + ("`" + ne + "` supplied to `" + ie + "`, expected a single ReactElement type."));
        }
        return null;
      }
      return m(Z);
    }
    function T(Z) {
      function W(q, ie, ce, X, U) {
        if (!(q[ie] instanceof Z)) {
          var ne = Z.name || p, se = z(q[ie]);
          return new C("Invalid " + X + " `" + U + "` of type " + ("`" + se + "` supplied to `" + ce + "`, expected ") + ("instance of `" + ne + "`."));
        }
        return null;
      }
      return m(W);
    }
    function F(Z) {
      if (!Array.isArray(Z))
        return  true && (arguments.length > 1 ? u(
          "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
        ) : u("Invalid argument supplied to oneOf, expected an array.")), s;
      function W(q, ie, ce, X, U) {
        for (var ne = q[ie], se = 0; se < Z.length; se++)
          if (y(ne, Z[se]))
            return null;
        var le = JSON.stringify(Z, function(ve, be) {
          var Me = te(be);
          return Me === "symbol" ? String(be) : be;
        });
        return new C("Invalid " + X + " `" + U + "` of value `" + String(ne) + "` " + ("supplied to `" + ce + "`, expected one of " + le + "."));
      }
      return m(W);
    }
    function P(Z) {
      function W(q, ie, ce, X, U) {
        if (typeof Z != "function")
          return new C("Property `" + U + "` of component `" + ce + "` has invalid PropType notation inside objectOf.");
        var ne = q[ie], se = j(ne);
        if (se !== "object")
          return new C("Invalid " + X + " `" + U + "` of type " + ("`" + se + "` supplied to `" + ce + "`, expected an object."));
        for (var le in ne)
          if (n(ne, le)) {
            var ue = Z(ne, le, ce, X, U + "." + le, r);
            if (ue instanceof Error)
              return ue;
          }
        return null;
      }
      return m(W);
    }
    function k(Z) {
      if (!Array.isArray(Z))
        return  true && u("Invalid argument supplied to oneOfType, expected an instance of array."), s;
      for (var W = 0; W < Z.length; W++) {
        var q = Z[W];
        if (typeof q != "function")
          return u(
            "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + re(q) + " at index " + W + "."
          ), s;
      }
      function ie(ce, X, U, ne, se) {
        for (var le = [], ue = 0; ue < Z.length; ue++) {
          var ve = Z[ue], be = ve(ce, X, U, ne, se, r);
          if (be == null)
            return null;
          be.data && n(be.data, "expectedType") && le.push(be.data.expectedType);
        }
        var Me = le.length > 0 ? ", expected one of type [" + le.join(", ") + "]" : "";
        return new C("Invalid " + ne + " `" + se + "` supplied to " + ("`" + U + "`" + Me + "."));
      }
      return m(ie);
    }
    function I() {
      function Z(W, q, ie, ce, X) {
        return N(W[q]) ? null : new C("Invalid " + ce + " `" + X + "` supplied to " + ("`" + ie + "`, expected a ReactNode."));
      }
      return m(Z);
    }
    function L(Z, W, q, ie, ce) {
      return new C(
        (Z || "React class") + ": " + W + " type `" + q + "." + ie + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + ce + "`."
      );
    }
    function A(Z) {
      function W(q, ie, ce, X, U) {
        var ne = q[ie], se = j(ne);
        if (se !== "object")
          return new C("Invalid " + X + " `" + U + "` of type `" + se + "` " + ("supplied to `" + ce + "`, expected `object`."));
        for (var le in Z) {
          var ue = Z[le];
          if (typeof ue != "function")
            return L(ce, X, U, le, te(ue));
          var ve = ue(ne, le, ce, X, U + "." + le, r);
          if (ve)
            return ve;
        }
        return null;
      }
      return m(W);
    }
    function O(Z) {
      function W(q, ie, ce, X, U) {
        var ne = q[ie], se = j(ne);
        if (se !== "object")
          return new C("Invalid " + X + " `" + U + "` of type `" + se + "` " + ("supplied to `" + ce + "`, expected `object`."));
        var le = t({}, q[ie], Z);
        for (var ue in le) {
          var ve = Z[ue];
          if (n(Z, ue) && typeof ve != "function")
            return L(ce, X, U, ue, te(ve));
          if (!ve)
            return new C(
              "Invalid " + X + " `" + U + "` key `" + ue + "` supplied to `" + ce + "`.\nBad object: " + JSON.stringify(q[ie], null, "  ") + `
Valid keys: ` + JSON.stringify(Object.keys(Z), null, "  ")
            );
          var be = ve(ne, ue, ce, X, U + "." + ue, r);
          if (be)
            return be;
        }
        return null;
      }
      return m(W);
    }
    function N(Z) {
      switch (typeof Z) {
        case "number":
        case "string":
        case "undefined":
          return !0;
        case "boolean":
          return !Z;
        case "object":
          if (Array.isArray(Z))
            return Z.every(N);
          if (Z === null || c(Z))
            return !0;
          var W = f(Z);
          if (W) {
            var q = W.call(Z), ie;
            if (W !== Z.entries) {
              for (; !(ie = q.next()).done; )
                if (!N(ie.value))
                  return !1;
            } else
              for (; !(ie = q.next()).done; ) {
                var ce = ie.value;
                if (ce && !N(ce[1]))
                  return !1;
              }
          } else
            return !1;
          return !0;
        default:
          return !1;
      }
    }
    function Y(Z, W) {
      return Z === "symbol" ? !0 : W ? W["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && W instanceof Symbol : !1;
    }
    function j(Z) {
      var W = typeof Z;
      return Array.isArray(Z) ? "array" : Z instanceof RegExp ? "object" : Y(W, Z) ? "symbol" : W;
    }
    function te(Z) {
      if (typeof Z > "u" || Z === null)
        return "" + Z;
      var W = j(Z);
      if (W === "object") {
        if (Z instanceof Date)
          return "date";
        if (Z instanceof RegExp)
          return "regexp";
      }
      return W;
    }
    function re(Z) {
      var W = te(Z);
      switch (W) {
        case "array":
        case "object":
          return "an " + W;
        case "boolean":
        case "date":
        case "regexp":
          return "a " + W;
        default:
          return W;
      }
    }
    function z(Z) {
      return !Z.constructor || !Z.constructor.name ? p : Z.constructor.name;
    }
    return g.checkPropTypes = a, g.resetWarningCache = a.resetWarningCache, g.PropTypes = g, g;
  }, US;
}
var jS, hD;
function J9() {
  if (hD) return jS;
  hD = 1;
  var e = PT();
  function t() {
  }
  function r() {
  }
  return r.resetWarningCache = t, jS = function() {
    function n(s, c, i, l, v, f) {
      if (f !== e) {
        var p = new Error(
          "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
        );
        throw p.name = "Invariant Violation", p;
      }
    }
    n.isRequired = n;
    function a() {
      return n;
    }
    var u = {
      array: n,
      bigint: n,
      bool: n,
      func: n,
      number: n,
      object: n,
      string: n,
      symbol: n,
      any: n,
      arrayOf: a,
      element: n,
      elementType: n,
      instanceOf: a,
      node: n,
      objectOf: a,
      oneOf: a,
      oneOfType: a,
      shape: a,
      exact: a,
      checkPropTypes: r,
      resetWarningCache: t
    };
    return u.PropTypes = u, u;
  }, jS;
}
if (true) {
  var Q9 = DT(), q9 = !0;
  kx.exports = K9()(Q9.isElement, q9);
} else
  {}
var NF = kx.exports;
const hn = /* @__PURE__ */ jh(NF);
function GF(e, t, r) {
  const n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e !== void 0), [a, u] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(t), s = e !== void 0, c = n.current;
  return n.current = s, !s && c && a !== t && u(t), [s ? e : a, (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((...i) => {
    const [l, ...v] = i;
    let f = r == null ? void 0 : r(l, ...v);
    return u(l), f;
  }, [r])];
}
const BC = {
  prefix: String(Math.round(Math.random() * 1e10)),
  current: 0
}, HF = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createContext(BC), eG = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createContext(!1);
let tG = !!(typeof window < "u" && window.document && window.document.createElement), YS = /* @__PURE__ */ new WeakMap();
function rG(e = !1) {
  let t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(HF), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  if (r.current === null && !e) {
    var n, a;
    let u = (a = (react__WEBPACK_IMPORTED_MODULE_1___default().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)) === null || a === void 0 || (n = a.ReactCurrentOwner) === null || n === void 0 ? void 0 : n.current;
    if (u) {
      let s = YS.get(u);
      s == null ? YS.set(u, {
        id: t.current,
        state: u.memoizedState
      }) : u.memoizedState !== s.state && (t.current = s.id, YS.delete(u));
    }
    r.current = ++t.current;
  }
  return r.current;
}
function nG(e) {
  let t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(HF);
  t === BC && !tG && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
  let r = rG(!!e), n = t === BC && "development" === "test" ? 0 : `react-aria${t.prefix}`;
  return e || `${n}-${r}`;
}
function iG(e) {
  let t = react__WEBPACK_IMPORTED_MODULE_1___default().useId(), [r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(lG()), n = r || "development" === "test" ? "react-aria" : `react-aria${BC.prefix}`;
  return e || `${n}-${t}`;
}
const BF = typeof (react__WEBPACK_IMPORTED_MODULE_1___default().useId) == "function" ? iG : nG;
function aG() {
  return !1;
}
function oG() {
  return !0;
}
function sG(e) {
  return () => {
  };
}
function lG() {
  return typeof (react__WEBPACK_IMPORTED_MODULE_1___default().useSyncExternalStore) == "function" ? react__WEBPACK_IMPORTED_MODULE_1___default().useSyncExternalStore(sG, aG, oG) : (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(eG);
}
const Pv = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null), oc = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null), Hh = (e, t = null) => e != null ? String(e) : t || null;
function uG(e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    t.current = e;
  }, [e]), t;
}
function wa(e) {
  const t = uG(e);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(...r) {
    return t.current && t.current(...r);
  }, [t]);
}
const pD = (e) => !e || typeof e == "function" ? e : (t) => {
  e.current = t;
};
function cG(e, t) {
  const r = pD(e), n = pD(t);
  return (a) => {
    r && r(a), n && n(a);
  };
}
function ad(e, t) {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => cG(e, t), [e, t]);
}
function IT({
  children: e,
  in: t,
  onExited: r,
  mountOnEnter: n,
  unmountOnExit: a
}) {
  const u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(t), c = wa(r);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    t ? s.current = !0 : c(u.current);
  }, [t, c]);
  const i = ad(u, e.ref), l = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(e, {
    ref: i
  });
  return t ? l : a || !s.current && n ? null : l;
}
const dG = ["active", "eventKey", "mountOnEnter", "transition", "unmountOnExit", "role", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"], fG = ["activeKey", "getControlledId", "getControllerId"], hG = ["as"];
function Ox(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
function VF(e) {
  let {
    active: t,
    eventKey: r,
    mountOnEnter: n,
    transition: a,
    unmountOnExit: u,
    role: s = "tabpanel",
    onEnter: c,
    onEntering: i,
    onEntered: l,
    onExit: v,
    onExiting: f,
    onExited: p
  } = e, g = Ox(e, dG);
  const y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Pv);
  if (!y) return [Object.assign({}, g, {
    role: s
  }), {
    eventKey: r,
    isActive: t,
    mountOnEnter: n,
    transition: a,
    unmountOnExit: u,
    onEnter: c,
    onEntering: i,
    onEntered: l,
    onExit: v,
    onExiting: f,
    onExited: p
  }];
  const {
    activeKey: C,
    getControlledId: m,
    getControllerId: h
  } = y, w = Ox(y, fG), S = Hh(r);
  return [Object.assign({}, g, {
    role: s,
    id: m(r),
    "aria-labelledby": h(r)
  }), {
    eventKey: r,
    isActive: t == null && S != null ? Hh(C) === S : t,
    transition: a || w.transition,
    mountOnEnter: n ?? w.mountOnEnter,
    unmountOnExit: u ?? w.unmountOnExit,
    onEnter: c,
    onEntering: i,
    onEntered: l,
    onExit: v,
    onExiting: f,
    onExited: p
  }];
}
const zF = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  (e, t) => {
    let {
      as: r = "div"
    } = e, n = Ox(e, hG);
    const [a, {
      isActive: u,
      onEnter: s,
      onEntering: c,
      onEntered: i,
      onExit: l,
      onExiting: v,
      onExited: f,
      mountOnEnter: p,
      unmountOnExit: g,
      transition: y = IT
    }] = VF(n);
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pv.Provider, {
      value: null,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(oc.Provider, {
        value: null,
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(y, {
          in: u,
          onEnter: s,
          onEntering: c,
          onEntered: i,
          onExit: l,
          onExiting: v,
          onExited: f,
          mountOnEnter: p,
          unmountOnExit: g,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, Object.assign({}, a, {
            ref: t,
            hidden: !u,
            "aria-hidden": !u
          }))
        })
      })
    });
  }
);
zF.displayName = "TabPanel";
const LT = (e) => {
  const {
    id: t,
    generateChildId: r,
    onSelect: n,
    activeKey: a,
    defaultActiveKey: u,
    transition: s,
    mountOnEnter: c,
    unmountOnExit: i,
    children: l
  } = e, [v, f] = GF(a, u, n), p = BF(t), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => r || ((C, m) => p ? `${p}-${m}-${C}` : null), [p, r]), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    onSelect: f,
    activeKey: v,
    transition: s,
    mountOnEnter: c || !1,
    unmountOnExit: i || !1,
    getControlledId: (C) => g(C, "tabpane"),
    getControllerId: (C) => g(C, "tab")
  }), [f, v, s, c, i, g]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pv.Provider, {
    value: y,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(oc.Provider, {
      value: f || null,
      children: l
    })
  });
};
LT.Panel = zF;
var WF = { exports: {} };
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
(function(e) {
  (function() {
    var t = {}.hasOwnProperty;
    function r() {
      for (var u = "", s = 0; s < arguments.length; s++) {
        var c = arguments[s];
        c && (u = a(u, n(c)));
      }
      return u;
    }
    function n(u) {
      if (typeof u == "string" || typeof u == "number")
        return u;
      if (typeof u != "object")
        return "";
      if (Array.isArray(u))
        return r.apply(null, u);
      if (u.toString !== Object.prototype.toString && !u.toString.toString().includes("[native code]"))
        return u.toString();
      var s = "";
      for (var c in u)
        t.call(u, c) && u[c] && (s = a(s, c));
      return s;
    }
    function a(u, s) {
      return s ? u ? u + " " + s : u + s : u;
    }
    e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
  })();
})(WF);
var pG = WF.exports;
const ln = /* @__PURE__ */ jh(pG);
function kT(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e)
    if (Object.prototype.hasOwnProperty.call(e, n)) {
      if (t.indexOf(n) >= 0) continue;
      r[n] = e[n];
    }
  return r;
}
function VC(e, t) {
  return VC = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, a) {
    return n.__proto__ = a, n;
  }, VC(e, t);
}
function vG(e, t) {
  e.prototype = Object.create(t.prototype), e.prototype.constructor = e, VC(e, t);
}
var Nx = { exports: {} }, Ys = {}, sC = { exports: {} }, XS = {};
/** @license React v0.20.2
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var vD;
function gG() {
  return vD || (vD = 1, function(e) {
    var t, r, n, a;
    if (typeof performance == "object" && typeof performance.now == "function") {
      var u = performance;
      e.unstable_now = function() {
        return u.now();
      };
    } else {
      var s = Date, c = s.now();
      e.unstable_now = function() {
        return s.now() - c;
      };
    }
    if (typeof window > "u" || typeof MessageChannel != "function") {
      var i = null, l = null, v = function() {
        if (i !== null) try {
          var W = e.unstable_now();
          i(!0, W), i = null;
        } catch (q) {
          throw setTimeout(v, 0), q;
        }
      };
      t = function(W) {
        i !== null ? setTimeout(t, 0, W) : (i = W, setTimeout(v, 0));
      }, r = function(W, q) {
        l = setTimeout(W, q);
      }, n = function() {
        clearTimeout(l);
      }, e.unstable_shouldYield = function() {
        return !1;
      }, a = e.unstable_forceFrameRate = function() {
      };
    } else {
      var f = window.setTimeout, p = window.clearTimeout;
      if (typeof console < "u") {
        var g = window.cancelAnimationFrame;
        typeof window.requestAnimationFrame != "function" && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), typeof g != "function" && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
      }
      var y = !1, C = null, m = -1, h = 5, w = 0;
      e.unstable_shouldYield = function() {
        return e.unstable_now() >= w;
      }, a = function() {
      }, e.unstable_forceFrameRate = function(W) {
        0 > W || 125 < W ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : h = 0 < W ? Math.floor(1e3 / W) : 5;
      };
      var S = new MessageChannel(), E = S.port2;
      S.port1.onmessage = function() {
        if (C !== null) {
          var W = e.unstable_now();
          w = W + h;
          try {
            C(!0, W) ? E.postMessage(null) : (y = !1, C = null);
          } catch (q) {
            throw E.postMessage(null), q;
          }
        } else y = !1;
      }, t = function(W) {
        C = W, y || (y = !0, E.postMessage(null));
      }, r = function(W, q) {
        m = f(function() {
          W(e.unstable_now());
        }, q);
      }, n = function() {
        p(m), m = -1;
      };
    }
    function x(W, q) {
      var ie = W.length;
      W.push(q);
      e: for (; ; ) {
        var ce = ie - 1 >>> 1, X = W[ce];
        if (X !== void 0 && 0 < P(X, q)) W[ce] = q, W[ie] = X, ie = ce;
        else break e;
      }
    }
    function T(W) {
      return W = W[0], W === void 0 ? null : W;
    }
    function F(W) {
      var q = W[0];
      if (q !== void 0) {
        var ie = W.pop();
        if (ie !== q) {
          W[0] = ie;
          e: for (var ce = 0, X = W.length; ce < X; ) {
            var U = 2 * (ce + 1) - 1, ne = W[U], se = U + 1, le = W[se];
            if (ne !== void 0 && 0 > P(ne, ie)) le !== void 0 && 0 > P(le, ne) ? (W[ce] = le, W[se] = ie, ce = se) : (W[ce] = ne, W[U] = ie, ce = U);
            else if (le !== void 0 && 0 > P(le, ie)) W[ce] = le, W[se] = ie, ce = se;
            else break e;
          }
        }
        return q;
      }
      return null;
    }
    function P(W, q) {
      var ie = W.sortIndex - q.sortIndex;
      return ie !== 0 ? ie : W.id - q.id;
    }
    var k = [], I = [], L = 1, A = null, O = 3, N = !1, Y = !1, j = !1;
    function te(W) {
      for (var q = T(I); q !== null; ) {
        if (q.callback === null) F(I);
        else if (q.startTime <= W) F(I), q.sortIndex = q.expirationTime, x(k, q);
        else break;
        q = T(I);
      }
    }
    function re(W) {
      if (j = !1, te(W), !Y) if (T(k) !== null) Y = !0, t(z);
      else {
        var q = T(I);
        q !== null && r(re, q.startTime - W);
      }
    }
    function z(W, q) {
      Y = !1, j && (j = !1, n()), N = !0;
      var ie = O;
      try {
        for (te(q), A = T(k); A !== null && (!(A.expirationTime > q) || W && !e.unstable_shouldYield()); ) {
          var ce = A.callback;
          if (typeof ce == "function") {
            A.callback = null, O = A.priorityLevel;
            var X = ce(A.expirationTime <= q);
            q = e.unstable_now(), typeof X == "function" ? A.callback = X : A === T(k) && F(k), te(q);
          } else F(k);
          A = T(k);
        }
        if (A !== null) var U = !0;
        else {
          var ne = T(I);
          ne !== null && r(re, ne.startTime - q), U = !1;
        }
        return U;
      } finally {
        A = null, O = ie, N = !1;
      }
    }
    var Z = a;
    e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function(W) {
      W.callback = null;
    }, e.unstable_continueExecution = function() {
      Y || N || (Y = !0, t(z));
    }, e.unstable_getCurrentPriorityLevel = function() {
      return O;
    }, e.unstable_getFirstCallbackNode = function() {
      return T(k);
    }, e.unstable_next = function(W) {
      switch (O) {
        case 1:
        case 2:
        case 3:
          var q = 3;
          break;
        default:
          q = O;
      }
      var ie = O;
      O = q;
      try {
        return W();
      } finally {
        O = ie;
      }
    }, e.unstable_pauseExecution = function() {
    }, e.unstable_requestPaint = Z, e.unstable_runWithPriority = function(W, q) {
      switch (W) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          W = 3;
      }
      var ie = O;
      O = W;
      try {
        return q();
      } finally {
        O = ie;
      }
    }, e.unstable_scheduleCallback = function(W, q, ie) {
      var ce = e.unstable_now();
      switch (typeof ie == "object" && ie !== null ? (ie = ie.delay, ie = typeof ie == "number" && 0 < ie ? ce + ie : ce) : ie = ce, W) {
        case 1:
          var X = -1;
          break;
        case 2:
          X = 250;
          break;
        case 5:
          X = 1073741823;
          break;
        case 4:
          X = 1e4;
          break;
        default:
          X = 5e3;
      }
      return X = ie + X, W = { id: L++, callback: q, priorityLevel: W, startTime: ie, expirationTime: X, sortIndex: -1 }, ie > ce ? (W.sortIndex = ie, x(I, W), T(k) === null && W === T(I) && (j ? n() : j = !0, r(re, ie - ce))) : (W.sortIndex = X, x(k, W), Y || N || (Y = !0, t(z))), W;
    }, e.unstable_wrapCallback = function(W) {
      var q = O;
      return function() {
        var ie = O;
        O = q;
        try {
          return W.apply(this, arguments);
        } finally {
          O = ie;
        }
      };
    };
  }(XS)), XS;
}
var $S = {};
/** @license React v0.20.2
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var gD;
function mG() {
  return gD || (gD = 1, function(e) {
     true && function() {
      var t = !1, r = !1, n, a, u, s, c = typeof performance == "object" && typeof performance.now == "function";
      if (c) {
        var i = performance;
        e.unstable_now = function() {
          return i.now();
        };
      } else {
        var l = Date, v = l.now();
        e.unstable_now = function() {
          return l.now() - v;
        };
      }
      if (
        // If Scheduler runs in a non-DOM environment, it falls back to a naive
        // implementation using setTimeout.
        typeof window > "u" || // Check if MessageChannel is supported, too.
        typeof MessageChannel != "function"
      ) {
        var f = null, p = null, g = function() {
          if (f !== null)
            try {
              var Je = e.unstable_now(), et = !0;
              f(et, Je), f = null;
            } catch (at) {
              throw setTimeout(g, 0), at;
            }
        };
        n = function(Je) {
          f !== null ? setTimeout(n, 0, Je) : (f = Je, setTimeout(g, 0));
        }, a = function(Je, et) {
          p = setTimeout(Je, et);
        }, u = function() {
          clearTimeout(p);
        }, e.unstable_shouldYield = function() {
          return !1;
        }, s = e.unstable_forceFrameRate = function() {
        };
      } else {
        var y = window.setTimeout, C = window.clearTimeout;
        if (typeof console < "u") {
          var m = window.requestAnimationFrame, h = window.cancelAnimationFrame;
          typeof m != "function" && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), typeof h != "function" && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
        }
        var w = !1, S = null, E = -1, x = 5, T = 0;
        e.unstable_shouldYield = function() {
          return e.unstable_now() >= T;
        }, s = function() {
        }, e.unstable_forceFrameRate = function(Je) {
          if (Je < 0 || Je > 125) {
            console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
            return;
          }
          Je > 0 ? x = Math.floor(1e3 / Je) : x = 5;
        };
        var F = function() {
          if (S !== null) {
            var Je = e.unstable_now();
            T = Je + x;
            var et = !0;
            try {
              var at = S(et, Je);
              at ? k.postMessage(null) : (w = !1, S = null);
            } catch (De) {
              throw k.postMessage(null), De;
            }
          } else
            w = !1;
        }, P = new MessageChannel(), k = P.port2;
        P.port1.onmessage = F, n = function(Je) {
          S = Je, w || (w = !0, k.postMessage(null));
        }, a = function(Je, et) {
          E = y(function() {
            Je(e.unstable_now());
          }, et);
        }, u = function() {
          C(E), E = -1;
        };
      }
      function I(Je, et) {
        var at = Je.length;
        Je.push(et), O(Je, et, at);
      }
      function L(Je) {
        var et = Je[0];
        return et === void 0 ? null : et;
      }
      function A(Je) {
        var et = Je[0];
        if (et !== void 0) {
          var at = Je.pop();
          return at !== et && (Je[0] = at, N(Je, at, 0)), et;
        } else
          return null;
      }
      function O(Je, et, at) {
        for (var De = at; ; ) {
          var Ne = De - 1 >>> 1, Ie = Je[Ne];
          if (Ie !== void 0 && Y(Ie, et) > 0)
            Je[Ne] = et, Je[De] = Ie, De = Ne;
          else
            return;
        }
      }
      function N(Je, et, at) {
        for (var De = at, Ne = Je.length; De < Ne; ) {
          var Ie = (De + 1) * 2 - 1, Ue = Je[Ie], ot = Ie + 1, ct = Je[ot];
          if (Ue !== void 0 && Y(Ue, et) < 0)
            ct !== void 0 && Y(ct, Ue) < 0 ? (Je[De] = ct, Je[ot] = et, De = ot) : (Je[De] = Ue, Je[Ie] = et, De = Ie);
          else if (ct !== void 0 && Y(ct, et) < 0)
            Je[De] = ct, Je[ot] = et, De = ot;
          else
            return;
        }
      }
      function Y(Je, et) {
        var at = Je.sortIndex - et.sortIndex;
        return at !== 0 ? at : Je.id - et.id;
      }
      var j = 1, te = 2, re = 3, z = 4, Z = 5;
      function W(Je, et) {
      }
      var q = 1073741823, ie = -1, ce = 250, X = 5e3, U = 1e4, ne = q, se = [], le = [], ue = 1, ve = null, be = re, Me = !1, Ge = !1, we = !1;
      function Re(Je) {
        for (var et = L(le); et !== null; ) {
          if (et.callback === null)
            A(le);
          else if (et.startTime <= Je)
            A(le), et.sortIndex = et.expirationTime, I(se, et);
          else
            return;
          et = L(le);
        }
      }
      function Ae(Je) {
        if (we = !1, Re(Je), !Ge)
          if (L(se) !== null)
            Ge = !0, n(K);
          else {
            var et = L(le);
            et !== null && a(Ae, et.startTime - Je);
          }
      }
      function K(Je, et) {
        Ge = !1, we && (we = !1, u()), Me = !0;
        var at = be;
        try {
          var De;
          if (!r) return ee(Je, et);
        } finally {
          ve = null, be = at, Me = !1;
        }
      }
      function ee(Je, et) {
        var at = et;
        for (Re(at), ve = L(se); ve !== null && !t && !(ve.expirationTime > at && (!Je || e.unstable_shouldYield())); ) {
          var De = ve.callback;
          if (typeof De == "function") {
            ve.callback = null, be = ve.priorityLevel;
            var Ne = ve.expirationTime <= at, Ie = De(Ne);
            at = e.unstable_now(), typeof Ie == "function" ? ve.callback = Ie : ve === L(se) && A(se), Re(at);
          } else
            A(se);
          ve = L(se);
        }
        if (ve !== null)
          return !0;
        var Ue = L(le);
        return Ue !== null && a(Ae, Ue.startTime - at), !1;
      }
      function oe(Je, et) {
        switch (Je) {
          case j:
          case te:
          case re:
          case z:
          case Z:
            break;
          default:
            Je = re;
        }
        var at = be;
        be = Je;
        try {
          return et();
        } finally {
          be = at;
        }
      }
      function _(Je) {
        var et;
        switch (be) {
          case j:
          case te:
          case re:
            et = re;
            break;
          default:
            et = be;
            break;
        }
        var at = be;
        be = et;
        try {
          return Je();
        } finally {
          be = at;
        }
      }
      function V(Je) {
        var et = be;
        return function() {
          var at = be;
          be = et;
          try {
            return Je.apply(this, arguments);
          } finally {
            be = at;
          }
        };
      }
      function fe(Je, et, at) {
        var De = e.unstable_now(), Ne;
        if (typeof at == "object" && at !== null) {
          var Ie = at.delay;
          typeof Ie == "number" && Ie > 0 ? Ne = De + Ie : Ne = De;
        } else
          Ne = De;
        var Ue;
        switch (Je) {
          case j:
            Ue = ie;
            break;
          case te:
            Ue = ce;
            break;
          case Z:
            Ue = ne;
            break;
          case z:
            Ue = U;
            break;
          case re:
          default:
            Ue = X;
            break;
        }
        var ot = Ne + Ue, ct = {
          id: ue++,
          callback: et,
          priorityLevel: Je,
          startTime: Ne,
          expirationTime: ot,
          sortIndex: -1
        };
        return Ne > De ? (ct.sortIndex = Ne, I(le, ct), L(se) === null && ct === L(le) && (we ? u() : we = !0, a(Ae, Ne - De))) : (ct.sortIndex = ot, I(se, ct), !Ge && !Me && (Ge = !0, n(K))), ct;
      }
      function $() {
      }
      function he() {
        !Ge && !Me && (Ge = !0, n(K));
      }
      function me() {
        return L(se);
      }
      function xe(Je) {
        Je.callback = null;
      }
      function Fe() {
        return be;
      }
      var Ve = s, Be = null;
      e.unstable_IdlePriority = Z, e.unstable_ImmediatePriority = j, e.unstable_LowPriority = z, e.unstable_NormalPriority = re, e.unstable_Profiling = Be, e.unstable_UserBlockingPriority = te, e.unstable_cancelCallback = xe, e.unstable_continueExecution = he, e.unstable_getCurrentPriorityLevel = Fe, e.unstable_getFirstCallbackNode = me, e.unstable_next = _, e.unstable_pauseExecution = $, e.unstable_requestPaint = Ve, e.unstable_runWithPriority = oe, e.unstable_scheduleCallback = fe, e.unstable_wrapCallback = V;
    }();
  }($S)), $S;
}
var mD;
function _F() {
  return mD || (mD = 1,  false ? 0 : sC.exports = mG()), sC.exports;
}
/** @license React v17.0.2
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var yD;
function yG() {
  if (yD) return Ys;
  yD = 1;
  var e = (react__WEBPACK_IMPORTED_MODULE_1___default()), t = FT(), r = _F();
  function n(b) {
    for (var D = "https://reactjs.org/docs/error-decoder.html?invariant=" + b, H = 1; H < arguments.length; H++) D += "&args[]=" + encodeURIComponent(arguments[H]);
    return "Minified React error #" + b + "; visit " + D + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  if (!e) throw Error(n(227));
  var a = /* @__PURE__ */ new Set(), u = {};
  function s(b, D) {
    c(b, D), c(b + "Capture", D);
  }
  function c(b, D) {
    for (u[b] = D, b = 0; b < D.length; b++) a.add(D[b]);
  }
  var i = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), l = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, v = Object.prototype.hasOwnProperty, f = {}, p = {};
  function g(b) {
    return v.call(p, b) ? !0 : v.call(f, b) ? !1 : l.test(b) ? p[b] = !0 : (f[b] = !0, !1);
  }
  function y(b, D, H, ge) {
    if (H !== null && H.type === 0) return !1;
    switch (typeof D) {
      case "function":
      case "symbol":
        return !0;
      case "boolean":
        return ge ? !1 : H !== null ? !H.acceptsBooleans : (b = b.toLowerCase().slice(0, 5), b !== "data-" && b !== "aria-");
      default:
        return !1;
    }
  }
  function C(b, D, H, ge) {
    if (D === null || typeof D > "u" || y(b, D, H, ge)) return !0;
    if (ge) return !1;
    if (H !== null) switch (H.type) {
      case 3:
        return !D;
      case 4:
        return D === !1;
      case 5:
        return isNaN(D);
      case 6:
        return isNaN(D) || 1 > D;
    }
    return !1;
  }
  function m(b, D, H, ge, Pe, $e, ht) {
    this.acceptsBooleans = D === 2 || D === 3 || D === 4, this.attributeName = ge, this.attributeNamespace = Pe, this.mustUseProperty = H, this.propertyName = b, this.type = D, this.sanitizeURL = $e, this.removeEmptyString = ht;
  }
  var h = {};
  "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(b) {
    h[b] = new m(b, 0, !1, b, null, !1, !1);
  }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(b) {
    var D = b[0];
    h[D] = new m(D, 1, !1, b[1], null, !1, !1);
  }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(b) {
    h[b] = new m(b, 2, !1, b.toLowerCase(), null, !1, !1);
  }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(b) {
    h[b] = new m(b, 2, !1, b, null, !1, !1);
  }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(b) {
    h[b] = new m(b, 3, !1, b.toLowerCase(), null, !1, !1);
  }), ["checked", "multiple", "muted", "selected"].forEach(function(b) {
    h[b] = new m(b, 3, !0, b, null, !1, !1);
  }), ["capture", "download"].forEach(function(b) {
    h[b] = new m(b, 4, !1, b, null, !1, !1);
  }), ["cols", "rows", "size", "span"].forEach(function(b) {
    h[b] = new m(b, 6, !1, b, null, !1, !1);
  }), ["rowSpan", "start"].forEach(function(b) {
    h[b] = new m(b, 5, !1, b.toLowerCase(), null, !1, !1);
  });
  var w = /[\-:]([a-z])/g;
  function S(b) {
    return b[1].toUpperCase();
  }
  "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(b) {
    var D = b.replace(
      w,
      S
    );
    h[D] = new m(D, 1, !1, b, null, !1, !1);
  }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(b) {
    var D = b.replace(w, S);
    h[D] = new m(D, 1, !1, b, "http://www.w3.org/1999/xlink", !1, !1);
  }), ["xml:base", "xml:lang", "xml:space"].forEach(function(b) {
    var D = b.replace(w, S);
    h[D] = new m(D, 1, !1, b, "http://www.w3.org/XML/1998/namespace", !1, !1);
  }), ["tabIndex", "crossOrigin"].forEach(function(b) {
    h[b] = new m(b, 1, !1, b.toLowerCase(), null, !1, !1);
  }), h.xlinkHref = new m("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(b) {
    h[b] = new m(b, 1, !1, b.toLowerCase(), null, !0, !0);
  });
  function E(b, D, H, ge) {
    var Pe = h.hasOwnProperty(D) ? h[D] : null, $e = Pe !== null ? Pe.type === 0 : ge ? !1 : !(!(2 < D.length) || D[0] !== "o" && D[0] !== "O" || D[1] !== "n" && D[1] !== "N");
    $e || (C(D, H, Pe, ge) && (H = null), ge || Pe === null ? g(D) && (H === null ? b.removeAttribute(D) : b.setAttribute(D, "" + H)) : Pe.mustUseProperty ? b[Pe.propertyName] = H === null ? Pe.type === 3 ? !1 : "" : H : (D = Pe.attributeName, ge = Pe.attributeNamespace, H === null ? b.removeAttribute(D) : (Pe = Pe.type, H = Pe === 3 || Pe === 4 && H === !0 ? "" : "" + H, ge ? b.setAttributeNS(ge, D, H) : b.setAttribute(D, H))));
  }
  var x = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, T = 60103, F = 60106, P = 60107, k = 60108, I = 60114, L = 60109, A = 60110, O = 60112, N = 60113, Y = 60120, j = 60115, te = 60116, re = 60121, z = 60128, Z = 60129, W = 60130, q = 60131;
  if (typeof Symbol == "function" && Symbol.for) {
    var ie = Symbol.for;
    T = ie("react.element"), F = ie("react.portal"), P = ie("react.fragment"), k = ie("react.strict_mode"), I = ie("react.profiler"), L = ie("react.provider"), A = ie("react.context"), O = ie("react.forward_ref"), N = ie("react.suspense"), Y = ie("react.suspense_list"), j = ie("react.memo"), te = ie("react.lazy"), re = ie("react.block"), ie("react.scope"), z = ie("react.opaque.id"), Z = ie("react.debug_trace_mode"), W = ie("react.offscreen"), q = ie("react.legacy_hidden");
  }
  var ce = typeof Symbol == "function" && Symbol.iterator;
  function X(b) {
    return b === null || typeof b != "object" ? null : (b = ce && b[ce] || b["@@iterator"], typeof b == "function" ? b : null);
  }
  var U;
  function ne(b) {
    if (U === void 0) try {
      throw Error();
    } catch (H) {
      var D = H.stack.trim().match(/\n( *(at )?)/);
      U = D && D[1] || "";
    }
    return `
` + U + b;
  }
  var se = !1;
  function le(b, D) {
    if (!b || se) return "";
    se = !0;
    var H = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      if (D) if (D = function() {
        throw Error();
      }, Object.defineProperty(D.prototype, "props", { set: function() {
        throw Error();
      } }), typeof Reflect == "object" && Reflect.construct) {
        try {
          Reflect.construct(D, []);
        } catch (Jt) {
          var ge = Jt;
        }
        Reflect.construct(b, [], D);
      } else {
        try {
          D.call();
        } catch (Jt) {
          ge = Jt;
        }
        b.call(D.prototype);
      }
      else {
        try {
          throw Error();
        } catch (Jt) {
          ge = Jt;
        }
        b();
      }
    } catch (Jt) {
      if (Jt && ge && typeof Jt.stack == "string") {
        for (var Pe = Jt.stack.split(`
`), $e = ge.stack.split(`
`), ht = Pe.length - 1, Mt = $e.length - 1; 1 <= ht && 0 <= Mt && Pe[ht] !== $e[Mt]; ) Mt--;
        for (; 1 <= ht && 0 <= Mt; ht--, Mt--) if (Pe[ht] !== $e[Mt]) {
          if (ht !== 1 || Mt !== 1)
            do
              if (ht--, Mt--, 0 > Mt || Pe[ht] !== $e[Mt]) return `
` + Pe[ht].replace(" at new ", " at ");
            while (1 <= ht && 0 <= Mt);
          break;
        }
      }
    } finally {
      se = !1, Error.prepareStackTrace = H;
    }
    return (b = b ? b.displayName || b.name : "") ? ne(b) : "";
  }
  function ue(b) {
    switch (b.tag) {
      case 5:
        return ne(b.type);
      case 16:
        return ne("Lazy");
      case 13:
        return ne("Suspense");
      case 19:
        return ne("SuspenseList");
      case 0:
      case 2:
      case 15:
        return b = le(b.type, !1), b;
      case 11:
        return b = le(b.type.render, !1), b;
      case 22:
        return b = le(b.type._render, !1), b;
      case 1:
        return b = le(b.type, !0), b;
      default:
        return "";
    }
  }
  function ve(b) {
    if (b == null) return null;
    if (typeof b == "function") return b.displayName || b.name || null;
    if (typeof b == "string") return b;
    switch (b) {
      case P:
        return "Fragment";
      case F:
        return "Portal";
      case I:
        return "Profiler";
      case k:
        return "StrictMode";
      case N:
        return "Suspense";
      case Y:
        return "SuspenseList";
    }
    if (typeof b == "object") switch (b.$$typeof) {
      case A:
        return (b.displayName || "Context") + ".Consumer";
      case L:
        return (b._context.displayName || "Context") + ".Provider";
      case O:
        var D = b.render;
        return D = D.displayName || D.name || "", b.displayName || (D !== "" ? "ForwardRef(" + D + ")" : "ForwardRef");
      case j:
        return ve(b.type);
      case re:
        return ve(b._render);
      case te:
        D = b._payload, b = b._init;
        try {
          return ve(b(D));
        } catch {
        }
    }
    return null;
  }
  function be(b) {
    switch (typeof b) {
      case "boolean":
      case "number":
      case "object":
      case "string":
      case "undefined":
        return b;
      default:
        return "";
    }
  }
  function Me(b) {
    var D = b.type;
    return (b = b.nodeName) && b.toLowerCase() === "input" && (D === "checkbox" || D === "radio");
  }
  function Ge(b) {
    var D = Me(b) ? "checked" : "value", H = Object.getOwnPropertyDescriptor(b.constructor.prototype, D), ge = "" + b[D];
    if (!b.hasOwnProperty(D) && typeof H < "u" && typeof H.get == "function" && typeof H.set == "function") {
      var Pe = H.get, $e = H.set;
      return Object.defineProperty(b, D, { configurable: !0, get: function() {
        return Pe.call(this);
      }, set: function(ht) {
        ge = "" + ht, $e.call(this, ht);
      } }), Object.defineProperty(b, D, { enumerable: H.enumerable }), { getValue: function() {
        return ge;
      }, setValue: function(ht) {
        ge = "" + ht;
      }, stopTracking: function() {
        b._valueTracker = null, delete b[D];
      } };
    }
  }
  function we(b) {
    b._valueTracker || (b._valueTracker = Ge(b));
  }
  function Re(b) {
    if (!b) return !1;
    var D = b._valueTracker;
    if (!D) return !0;
    var H = D.getValue(), ge = "";
    return b && (ge = Me(b) ? b.checked ? "true" : "false" : b.value), b = ge, b !== H ? (D.setValue(b), !0) : !1;
  }
  function Ae(b) {
    if (b = b || (typeof document < "u" ? document : void 0), typeof b > "u") return null;
    try {
      return b.activeElement || b.body;
    } catch {
      return b.body;
    }
  }
  function K(b, D) {
    var H = D.checked;
    return t({}, D, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: H ?? b._wrapperState.initialChecked });
  }
  function ee(b, D) {
    var H = D.defaultValue == null ? "" : D.defaultValue, ge = D.checked != null ? D.checked : D.defaultChecked;
    H = be(D.value != null ? D.value : H), b._wrapperState = { initialChecked: ge, initialValue: H, controlled: D.type === "checkbox" || D.type === "radio" ? D.checked != null : D.value != null };
  }
  function oe(b, D) {
    D = D.checked, D != null && E(b, "checked", D, !1);
  }
  function _(b, D) {
    oe(b, D);
    var H = be(D.value), ge = D.type;
    if (H != null) ge === "number" ? (H === 0 && b.value === "" || b.value != H) && (b.value = "" + H) : b.value !== "" + H && (b.value = "" + H);
    else if (ge === "submit" || ge === "reset") {
      b.removeAttribute("value");
      return;
    }
    D.hasOwnProperty("value") ? fe(b, D.type, H) : D.hasOwnProperty("defaultValue") && fe(b, D.type, be(D.defaultValue)), D.checked == null && D.defaultChecked != null && (b.defaultChecked = !!D.defaultChecked);
  }
  function V(b, D, H) {
    if (D.hasOwnProperty("value") || D.hasOwnProperty("defaultValue")) {
      var ge = D.type;
      if (!(ge !== "submit" && ge !== "reset" || D.value !== void 0 && D.value !== null)) return;
      D = "" + b._wrapperState.initialValue, H || D === b.value || (b.value = D), b.defaultValue = D;
    }
    H = b.name, H !== "" && (b.name = ""), b.defaultChecked = !!b._wrapperState.initialChecked, H !== "" && (b.name = H);
  }
  function fe(b, D, H) {
    (D !== "number" || Ae(b.ownerDocument) !== b) && (H == null ? b.defaultValue = "" + b._wrapperState.initialValue : b.defaultValue !== "" + H && (b.defaultValue = "" + H));
  }
  function $(b) {
    var D = "";
    return e.Children.forEach(b, function(H) {
      H != null && (D += H);
    }), D;
  }
  function he(b, D) {
    return b = t({ children: void 0 }, D), (D = $(D.children)) && (b.children = D), b;
  }
  function me(b, D, H, ge) {
    if (b = b.options, D) {
      D = {};
      for (var Pe = 0; Pe < H.length; Pe++) D["$" + H[Pe]] = !0;
      for (H = 0; H < b.length; H++) Pe = D.hasOwnProperty("$" + b[H].value), b[H].selected !== Pe && (b[H].selected = Pe), Pe && ge && (b[H].defaultSelected = !0);
    } else {
      for (H = "" + be(H), D = null, Pe = 0; Pe < b.length; Pe++) {
        if (b[Pe].value === H) {
          b[Pe].selected = !0, ge && (b[Pe].defaultSelected = !0);
          return;
        }
        D !== null || b[Pe].disabled || (D = b[Pe]);
      }
      D !== null && (D.selected = !0);
    }
  }
  function xe(b, D) {
    if (D.dangerouslySetInnerHTML != null) throw Error(n(91));
    return t({}, D, { value: void 0, defaultValue: void 0, children: "" + b._wrapperState.initialValue });
  }
  function Fe(b, D) {
    var H = D.value;
    if (H == null) {
      if (H = D.children, D = D.defaultValue, H != null) {
        if (D != null) throw Error(n(92));
        if (Array.isArray(H)) {
          if (!(1 >= H.length)) throw Error(n(93));
          H = H[0];
        }
        D = H;
      }
      D == null && (D = ""), H = D;
    }
    b._wrapperState = { initialValue: be(H) };
  }
  function Ve(b, D) {
    var H = be(D.value), ge = be(D.defaultValue);
    H != null && (H = "" + H, H !== b.value && (b.value = H), D.defaultValue == null && b.defaultValue !== H && (b.defaultValue = H)), ge != null && (b.defaultValue = "" + ge);
  }
  function Be(b) {
    var D = b.textContent;
    D === b._wrapperState.initialValue && D !== "" && D !== null && (b.value = D);
  }
  var Je = { html: "http://www.w3.org/1999/xhtml", mathml: "http://www.w3.org/1998/Math/MathML", svg: "http://www.w3.org/2000/svg" };
  function et(b) {
    switch (b) {
      case "svg":
        return "http://www.w3.org/2000/svg";
      case "math":
        return "http://www.w3.org/1998/Math/MathML";
      default:
        return "http://www.w3.org/1999/xhtml";
    }
  }
  function at(b, D) {
    return b == null || b === "http://www.w3.org/1999/xhtml" ? et(D) : b === "http://www.w3.org/2000/svg" && D === "foreignObject" ? "http://www.w3.org/1999/xhtml" : b;
  }
  var De, Ne = function(b) {
    return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(D, H, ge, Pe) {
      MSApp.execUnsafeLocalFunction(function() {
        return b(D, H, ge, Pe);
      });
    } : b;
  }(function(b, D) {
    if (b.namespaceURI !== Je.svg || "innerHTML" in b) b.innerHTML = D;
    else {
      for (De = De || document.createElement("div"), De.innerHTML = "<svg>" + D.valueOf().toString() + "</svg>", D = De.firstChild; b.firstChild; ) b.removeChild(b.firstChild);
      for (; D.firstChild; ) b.appendChild(D.firstChild);
    }
  });
  function Ie(b, D) {
    if (D) {
      var H = b.firstChild;
      if (H && H === b.lastChild && H.nodeType === 3) {
        H.nodeValue = D;
        return;
      }
    }
    b.textContent = D;
  }
  var Ue = {
    animationIterationCount: !0,
    borderImageOutset: !0,
    borderImageSlice: !0,
    borderImageWidth: !0,
    boxFlex: !0,
    boxFlexGroup: !0,
    boxOrdinalGroup: !0,
    columnCount: !0,
    columns: !0,
    flex: !0,
    flexGrow: !0,
    flexPositive: !0,
    flexShrink: !0,
    flexNegative: !0,
    flexOrder: !0,
    gridArea: !0,
    gridRow: !0,
    gridRowEnd: !0,
    gridRowSpan: !0,
    gridRowStart: !0,
    gridColumn: !0,
    gridColumnEnd: !0,
    gridColumnSpan: !0,
    gridColumnStart: !0,
    fontWeight: !0,
    lineClamp: !0,
    lineHeight: !0,
    opacity: !0,
    order: !0,
    orphans: !0,
    tabSize: !0,
    widows: !0,
    zIndex: !0,
    zoom: !0,
    fillOpacity: !0,
    floodOpacity: !0,
    stopOpacity: !0,
    strokeDasharray: !0,
    strokeDashoffset: !0,
    strokeMiterlimit: !0,
    strokeOpacity: !0,
    strokeWidth: !0
  }, ot = ["Webkit", "ms", "Moz", "O"];
  Object.keys(Ue).forEach(function(b) {
    ot.forEach(function(D) {
      D = D + b.charAt(0).toUpperCase() + b.substring(1), Ue[D] = Ue[b];
    });
  });
  function ct(b, D, H) {
    return D == null || typeof D == "boolean" || D === "" ? "" : H || typeof D != "number" || D === 0 || Ue.hasOwnProperty(b) && Ue[b] ? ("" + D).trim() : D + "px";
  }
  function Tt(b, D) {
    b = b.style;
    for (var H in D) if (D.hasOwnProperty(H)) {
      var ge = H.indexOf("--") === 0, Pe = ct(H, D[H], ge);
      H === "float" && (H = "cssFloat"), ge ? b.setProperty(H, Pe) : b[H] = Pe;
    }
  }
  var kt = t({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
  function Ot(b, D) {
    if (D) {
      if (kt[b] && (D.children != null || D.dangerouslySetInnerHTML != null)) throw Error(n(137, b));
      if (D.dangerouslySetInnerHTML != null) {
        if (D.children != null) throw Error(n(60));
        if (!(typeof D.dangerouslySetInnerHTML == "object" && "__html" in D.dangerouslySetInnerHTML)) throw Error(n(61));
      }
      if (D.style != null && typeof D.style != "object") throw Error(n(62));
    }
  }
  function Rt(b, D) {
    if (b.indexOf("-") === -1) return typeof D.is == "string";
    switch (b) {
      case "annotation-xml":
      case "color-profile":
      case "font-face":
      case "font-face-src":
      case "font-face-uri":
      case "font-face-format":
      case "font-face-name":
      case "missing-glyph":
        return !1;
      default:
        return !0;
    }
  }
  function xt(b) {
    return b = b.target || b.srcElement || window, b.correspondingUseElement && (b = b.correspondingUseElement), b.nodeType === 3 ? b.parentNode : b;
  }
  var Wt = null, bt = null, jt = null;
  function qt(b) {
    if (b = go(b)) {
      if (typeof Wt != "function") throw Error(n(280));
      var D = b.stateNode;
      D && (D = os(D), Wt(b.stateNode, b.type, D));
    }
  }
  function Yt(b) {
    bt ? jt ? jt.push(b) : jt = [b] : bt = b;
  }
  function Ut() {
    if (bt) {
      var b = bt, D = jt;
      if (jt = bt = null, qt(b), D) for (b = 0; b < D.length; b++) qt(D[b]);
    }
  }
  function tt(b, D) {
    return b(D);
  }
  function ze(b, D, H, ge, Pe) {
    return b(D, H, ge, Pe);
  }
  function _e() {
  }
  var Ye = tt, lt = !1, Te = !1;
  function Oe() {
    (bt !== null || jt !== null) && (_e(), Ut());
  }
  function je(b, D, H) {
    if (Te) return b(D, H);
    Te = !0;
    try {
      return Ye(b, D, H);
    } finally {
      Te = !1, Oe();
    }
  }
  function Xe(b, D) {
    var H = b.stateNode;
    if (H === null) return null;
    var ge = os(H);
    if (ge === null) return null;
    H = ge[D];
    e: switch (D) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        (ge = !ge.disabled) || (b = b.type, ge = !(b === "button" || b === "input" || b === "select" || b === "textarea")), b = !ge;
        break e;
      default:
        b = !1;
    }
    if (b) return null;
    if (H && typeof H != "function") throw Error(n(231, D, typeof H));
    return H;
  }
  var nt = !1;
  if (i) try {
    var it = {};
    Object.defineProperty(it, "passive", { get: function() {
      nt = !0;
    } }), window.addEventListener("test", it, it), window.removeEventListener("test", it, it);
  } catch {
    nt = !1;
  }
  function Nt(b, D, H, ge, Pe, $e, ht, Mt, Jt) {
    var vr = Array.prototype.slice.call(arguments, 3);
    try {
      D.apply(H, vr);
    } catch (vn) {
      this.onError(vn);
    }
  }
  var At = !1, vt = null, ut = !1, Pt = null, rr = { onError: function(b) {
    At = !0, vt = b;
  } };
  function lr(b, D, H, ge, Pe, $e, ht, Mt, Jt) {
    At = !1, vt = null, Nt.apply(rr, arguments);
  }
  function Mr(b, D, H, ge, Pe, $e, ht, Mt, Jt) {
    if (lr.apply(this, arguments), At) {
      if (At) {
        var vr = vt;
        At = !1, vt = null;
      } else throw Error(n(198));
      ut || (ut = !0, Pt = vr);
    }
  }
  function Rr(b) {
    var D = b, H = b;
    if (b.alternate) for (; D.return; ) D = D.return;
    else {
      b = D;
      do
        D = b, D.flags & 1026 && (H = D.return), b = D.return;
      while (b);
    }
    return D.tag === 3 ? H : null;
  }
  function Pr(b) {
    if (b.tag === 13) {
      var D = b.memoizedState;
      if (D === null && (b = b.alternate, b !== null && (D = b.memoizedState)), D !== null) return D.dehydrated;
    }
    return null;
  }
  function ir(b) {
    if (Rr(b) !== b) throw Error(n(188));
  }
  function Lr(b) {
    var D = b.alternate;
    if (!D) {
      if (D = Rr(b), D === null) throw Error(n(188));
      return D !== b ? null : b;
    }
    for (var H = b, ge = D; ; ) {
      var Pe = H.return;
      if (Pe === null) break;
      var $e = Pe.alternate;
      if ($e === null) {
        if (ge = Pe.return, ge !== null) {
          H = ge;
          continue;
        }
        break;
      }
      if (Pe.child === $e.child) {
        for ($e = Pe.child; $e; ) {
          if ($e === H) return ir(Pe), b;
          if ($e === ge) return ir(Pe), D;
          $e = $e.sibling;
        }
        throw Error(n(188));
      }
      if (H.return !== ge.return) H = Pe, ge = $e;
      else {
        for (var ht = !1, Mt = Pe.child; Mt; ) {
          if (Mt === H) {
            ht = !0, H = Pe, ge = $e;
            break;
          }
          if (Mt === ge) {
            ht = !0, ge = Pe, H = $e;
            break;
          }
          Mt = Mt.sibling;
        }
        if (!ht) {
          for (Mt = $e.child; Mt; ) {
            if (Mt === H) {
              ht = !0, H = $e, ge = Pe;
              break;
            }
            if (Mt === ge) {
              ht = !0, ge = $e, H = Pe;
              break;
            }
            Mt = Mt.sibling;
          }
          if (!ht) throw Error(n(189));
        }
      }
      if (H.alternate !== ge) throw Error(n(190));
    }
    if (H.tag !== 3) throw Error(n(188));
    return H.stateNode.current === H ? b : D;
  }
  function yr(b) {
    if (b = Lr(b), !b) return null;
    for (var D = b; ; ) {
      if (D.tag === 5 || D.tag === 6) return D;
      if (D.child) D.child.return = D, D = D.child;
      else {
        if (D === b) break;
        for (; !D.sibling; ) {
          if (!D.return || D.return === b) return null;
          D = D.return;
        }
        D.sibling.return = D.return, D = D.sibling;
      }
    }
    return null;
  }
  function Sr(b, D) {
    for (var H = b.alternate; D !== null; ) {
      if (D === b || D === H) return !0;
      D = D.return;
    }
    return !1;
  }
  var Yr, Ar, pr, kr, br = !1, Gr = [], rn = null, cn = null, Dr = null, Se = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map(), ft = [], rt = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
  function gt(b, D, H, ge, Pe) {
    return { blockedOn: b, domEventName: D, eventSystemFlags: H | 16, nativeEvent: Pe, targetContainers: [ge] };
  }
  function wt(b, D) {
    switch (b) {
      case "focusin":
      case "focusout":
        rn = null;
        break;
      case "dragenter":
      case "dragleave":
        cn = null;
        break;
      case "mouseover":
      case "mouseout":
        Dr = null;
        break;
      case "pointerover":
      case "pointerout":
        Se.delete(D.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        ae.delete(D.pointerId);
    }
  }
  function Ct(b, D, H, ge, Pe, $e) {
    return b === null || b.nativeEvent !== $e ? (b = gt(D, H, ge, Pe, $e), D !== null && (D = go(D), D !== null && Ar(D)), b) : (b.eventSystemFlags |= ge, D = b.targetContainers, Pe !== null && D.indexOf(Pe) === -1 && D.push(Pe), b);
  }
  function pt(b, D, H, ge, Pe) {
    switch (D) {
      case "focusin":
        return rn = Ct(rn, b, D, H, ge, Pe), !0;
      case "dragenter":
        return cn = Ct(cn, b, D, H, ge, Pe), !0;
      case "mouseover":
        return Dr = Ct(Dr, b, D, H, ge, Pe), !0;
      case "pointerover":
        var $e = Pe.pointerId;
        return Se.set($e, Ct(Se.get($e) || null, b, D, H, ge, Pe)), !0;
      case "gotpointercapture":
        return $e = Pe.pointerId, ae.set($e, Ct(ae.get($e) || null, b, D, H, ge, Pe)), !0;
    }
    return !1;
  }
  function dt(b) {
    var D = Xl(b.target);
    if (D !== null) {
      var H = Rr(D);
      if (H !== null) {
        if (D = H.tag, D === 13) {
          if (D = Pr(H), D !== null) {
            b.blockedOn = D, kr(b.lanePriority, function() {
              r.unstable_runWithPriority(b.priority, function() {
                pr(H);
              });
            });
            return;
          }
        } else if (D === 3 && H.stateNode.hydrate) {
          b.blockedOn = H.tag === 3 ? H.stateNode.containerInfo : null;
          return;
        }
      }
    }
    b.blockedOn = null;
  }
  function St(b) {
    if (b.blockedOn !== null) return !1;
    for (var D = b.targetContainers; 0 < D.length; ) {
      var H = Ui(b.domEventName, b.eventSystemFlags, D[0], b.nativeEvent);
      if (H !== null) return D = go(H), D !== null && Ar(D), b.blockedOn = H, !1;
      D.shift();
    }
    return !0;
  }
  function Ft(b, D, H) {
    St(b) && H.delete(D);
  }
  function Gt() {
    for (br = !1; 0 < Gr.length; ) {
      var b = Gr[0];
      if (b.blockedOn !== null) {
        b = go(b.blockedOn), b !== null && Yr(b);
        break;
      }
      for (var D = b.targetContainers; 0 < D.length; ) {
        var H = Ui(b.domEventName, b.eventSystemFlags, D[0], b.nativeEvent);
        if (H !== null) {
          b.blockedOn = H;
          break;
        }
        D.shift();
      }
      b.blockedOn === null && Gr.shift();
    }
    rn !== null && St(rn) && (rn = null), cn !== null && St(cn) && (cn = null), Dr !== null && St(Dr) && (Dr = null), Se.forEach(Ft), ae.forEach(Ft);
  }
  function Lt(b, D) {
    b.blockedOn === D && (b.blockedOn = null, br || (br = !0, r.unstable_scheduleCallback(r.unstable_NormalPriority, Gt)));
  }
  function $t(b) {
    function D(Pe) {
      return Lt(Pe, b);
    }
    if (0 < Gr.length) {
      Lt(Gr[0], b);
      for (var H = 1; H < Gr.length; H++) {
        var ge = Gr[H];
        ge.blockedOn === b && (ge.blockedOn = null);
      }
    }
    for (rn !== null && Lt(rn, b), cn !== null && Lt(cn, b), Dr !== null && Lt(Dr, b), Se.forEach(D), ae.forEach(D), H = 0; H < ft.length; H++) ge = ft[H], ge.blockedOn === b && (ge.blockedOn = null);
    for (; 0 < ft.length && (H = ft[0], H.blockedOn === null); ) dt(H), H.blockedOn === null && ft.shift();
  }
  function _t(b, D) {
    var H = {};
    return H[b.toLowerCase()] = D.toLowerCase(), H["Webkit" + b] = "webkit" + D, H["Moz" + b] = "moz" + D, H;
  }
  var zt = { animationend: _t("Animation", "AnimationEnd"), animationiteration: _t("Animation", "AnimationIteration"), animationstart: _t("Animation", "AnimationStart"), transitionend: _t("Transition", "TransitionEnd") }, tr = {}, nr = {};
  i && (nr = document.createElement("div").style, "AnimationEvent" in window || (delete zt.animationend.animation, delete zt.animationiteration.animation, delete zt.animationstart.animation), "TransitionEvent" in window || delete zt.transitionend.transition);
  function xr(b) {
    if (tr[b]) return tr[b];
    if (!zt[b]) return b;
    var D = zt[b], H;
    for (H in D) if (D.hasOwnProperty(H) && H in nr) return tr[b] = D[H];
    return b;
  }
  var Er = xr("animationend"), Jr = xr("animationiteration"), Ur = xr("animationstart"), Br = xr("transitionend"), dn = /* @__PURE__ */ new Map(), nn = /* @__PURE__ */ new Map(), Sn = [
    "abort",
    "abort",
    Er,
    "animationEnd",
    Jr,
    "animationIteration",
    Ur,
    "animationStart",
    "canplay",
    "canPlay",
    "canplaythrough",
    "canPlayThrough",
    "durationchange",
    "durationChange",
    "emptied",
    "emptied",
    "encrypted",
    "encrypted",
    "ended",
    "ended",
    "error",
    "error",
    "gotpointercapture",
    "gotPointerCapture",
    "load",
    "load",
    "loadeddata",
    "loadedData",
    "loadedmetadata",
    "loadedMetadata",
    "loadstart",
    "loadStart",
    "lostpointercapture",
    "lostPointerCapture",
    "playing",
    "playing",
    "progress",
    "progress",
    "seeking",
    "seeking",
    "stalled",
    "stalled",
    "suspend",
    "suspend",
    "timeupdate",
    "timeUpdate",
    Br,
    "transitionEnd",
    "waiting",
    "waiting"
  ];
  function ai(b, D) {
    for (var H = 0; H < b.length; H += 2) {
      var ge = b[H], Pe = b[H + 1];
      Pe = "on" + (Pe[0].toUpperCase() + Pe.slice(1)), nn.set(ge, D), dn.set(ge, Pe), s(Pe, [ge]);
    }
  }
  var Dn = r.unstable_now;
  Dn();
  var on = 8;
  function ri(b) {
    if (1 & b) return on = 15, 1;
    if (2 & b) return on = 14, 2;
    if (4 & b) return on = 13, 4;
    var D = 24 & b;
    return D !== 0 ? (on = 12, D) : b & 32 ? (on = 11, 32) : (D = 192 & b, D !== 0 ? (on = 10, D) : b & 256 ? (on = 9, 256) : (D = 3584 & b, D !== 0 ? (on = 8, D) : b & 4096 ? (on = 7, 4096) : (D = 4186112 & b, D !== 0 ? (on = 6, D) : (D = 62914560 & b, D !== 0 ? (on = 5, D) : b & 67108864 ? (on = 4, 67108864) : b & 134217728 ? (on = 3, 134217728) : (D = 805306368 & b, D !== 0 ? (on = 2, D) : 1073741824 & b ? (on = 1, 1073741824) : (on = 8, b))))));
  }
  function Fi(b) {
    switch (b) {
      case 99:
        return 15;
      case 98:
        return 10;
      case 97:
      case 96:
        return 8;
      case 95:
        return 2;
      default:
        return 0;
    }
  }
  function Pi(b) {
    switch (b) {
      case 15:
      case 14:
        return 99;
      case 13:
      case 12:
      case 11:
      case 10:
        return 98;
      case 9:
      case 8:
      case 7:
      case 6:
      case 4:
      case 5:
        return 97;
      case 3:
      case 2:
      case 1:
        return 95;
      case 0:
        return 90;
      default:
        throw Error(n(358, b));
    }
  }
  function pn(b, D) {
    var H = b.pendingLanes;
    if (H === 0) return on = 0;
    var ge = 0, Pe = 0, $e = b.expiredLanes, ht = b.suspendedLanes, Mt = b.pingedLanes;
    if ($e !== 0) ge = $e, Pe = on = 15;
    else if ($e = H & 134217727, $e !== 0) {
      var Jt = $e & ~ht;
      Jt !== 0 ? (ge = ri(Jt), Pe = on) : (Mt &= $e, Mt !== 0 && (ge = ri(Mt), Pe = on));
    } else $e = H & ~ht, $e !== 0 ? (ge = ri($e), Pe = on) : Mt !== 0 && (ge = ri(Mt), Pe = on);
    if (ge === 0) return 0;
    if (ge = 31 - Ln(ge), ge = H & ((0 > ge ? 0 : 1 << ge) << 1) - 1, D !== 0 && D !== ge && !(D & ht)) {
      if (ri(D), Pe <= on) return D;
      on = Pe;
    }
    if (D = b.entangledLanes, D !== 0) for (b = b.entanglements, D &= ge; 0 < D; ) H = 31 - Ln(D), Pe = 1 << H, ge |= b[H], D &= ~Pe;
    return ge;
  }
  function hi(b) {
    return b = b.pendingLanes & -1073741825, b !== 0 ? b : b & 1073741824 ? 1073741824 : 0;
  }
  function yn(b, D) {
    switch (b) {
      case 15:
        return 1;
      case 14:
        return 2;
      case 12:
        return b = Pn(24 & ~D), b === 0 ? yn(10, D) : b;
      case 10:
        return b = Pn(192 & ~D), b === 0 ? yn(8, D) : b;
      case 8:
        return b = Pn(3584 & ~D), b === 0 && (b = Pn(4186112 & ~D), b === 0 && (b = 512)), b;
      case 2:
        return D = Pn(805306368 & ~D), D === 0 && (D = 268435456), D;
    }
    throw Error(n(358, b));
  }
  function Pn(b) {
    return b & -b;
  }
  function kn(b) {
    for (var D = [], H = 0; 31 > H; H++) D.push(b);
    return D;
  }
  function Wn(b, D, H) {
    b.pendingLanes |= D;
    var ge = D - 1;
    b.suspendedLanes &= ge, b.pingedLanes &= ge, b = b.eventTimes, D = 31 - Ln(D), b[D] = H;
  }
  var Ln = Math.clz32 ? Math.clz32 : ci, li = Math.log, Bn = Math.LN2;
  function ci(b) {
    return b === 0 ? 32 : 31 - (li(b) / Bn | 0) | 0;
  }
  var Gi = r.unstable_UserBlockingPriority, pi = r.unstable_runWithPriority, ei = !0;
  function fa(b, D, H, ge) {
    lt || _e();
    var Pe = Ti, $e = lt;
    lt = !0;
    try {
      ze(Pe, b, D, H, ge);
    } finally {
      (lt = $e) || Oe();
    }
  }
  function Hi(b, D, H, ge) {
    pi(Gi, Ti.bind(null, b, D, H, ge));
  }
  function Ti(b, D, H, ge) {
    if (ei) {
      var Pe;
      if ((Pe = (D & 4) === 0) && 0 < Gr.length && -1 < rt.indexOf(b)) b = gt(null, b, D, H, ge), Gr.push(b);
      else {
        var $e = Ui(b, D, H, ge);
        if ($e === null) Pe && wt(b, ge);
        else {
          if (Pe) {
            if (-1 < rt.indexOf(b)) {
              b = gt($e, b, D, H, ge), Gr.push(b);
              return;
            }
            if (pt($e, b, D, H, ge)) return;
            wt(b, ge);
          }
          wu(b, D, ge, null, H);
        }
      }
    }
  }
  function Ui(b, D, H, ge) {
    var Pe = xt(ge);
    if (Pe = Xl(Pe), Pe !== null) {
      var $e = Rr(Pe);
      if ($e === null) Pe = null;
      else {
        var ht = $e.tag;
        if (ht === 13) {
          if (Pe = Pr($e), Pe !== null) return Pe;
          Pe = null;
        } else if (ht === 3) {
          if ($e.stateNode.hydrate) return $e.tag === 3 ? $e.stateNode.containerInfo : null;
          Pe = null;
        } else $e !== Pe && (Pe = null);
      }
    }
    return wu(b, D, ge, Pe, H), null;
  }
  var la = null, za = null, ia = null;
  function aa() {
    if (ia) return ia;
    var b, D = za, H = D.length, ge, Pe = "value" in la ? la.value : la.textContent, $e = Pe.length;
    for (b = 0; b < H && D[b] === Pe[b]; b++) ;
    var ht = H - b;
    for (ge = 1; ge <= ht && D[H - ge] === Pe[$e - ge]; ge++) ;
    return ia = Pe.slice(b, 1 < ge ? 1 - ge : void 0);
  }
  function ao(b) {
    var D = b.keyCode;
    return "charCode" in b ? (b = b.charCode, b === 0 && D === 13 && (b = 13)) : b = D, b === 10 && (b = 13), 32 <= b || b === 13 ? b : 0;
  }
  function _o() {
    return !0;
  }
  function ji() {
    return !1;
  }
  function Bi(b) {
    function D(H, ge, Pe, $e, ht) {
      this._reactName = H, this._targetInst = Pe, this.type = ge, this.nativeEvent = $e, this.target = ht, this.currentTarget = null;
      for (var Mt in b) b.hasOwnProperty(Mt) && (H = b[Mt], this[Mt] = H ? H($e) : $e[Mt]);
      return this.isDefaultPrevented = ($e.defaultPrevented != null ? $e.defaultPrevented : $e.returnValue === !1) ? _o : ji, this.isPropagationStopped = ji, this;
    }
    return t(D.prototype, { preventDefault: function() {
      this.defaultPrevented = !0;
      var H = this.nativeEvent;
      H && (H.preventDefault ? H.preventDefault() : typeof H.returnValue != "unknown" && (H.returnValue = !1), this.isDefaultPrevented = _o);
    }, stopPropagation: function() {
      var H = this.nativeEvent;
      H && (H.stopPropagation ? H.stopPropagation() : typeof H.cancelBubble != "unknown" && (H.cancelBubble = !0), this.isPropagationStopped = _o);
    }, persist: function() {
    }, isPersistent: _o }), D;
  }
  var ha = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(b) {
    return b.timeStamp || Date.now();
  }, defaultPrevented: 0, isTrusted: 0 }, pa = Bi(ha), oi = t({}, ha, { view: 0, detail: 0 }), Ii = Bi(oi), Qa, vo, oo, tl = t({}, oi, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: pf, button: 0, buttons: 0, relatedTarget: function(b) {
    return b.relatedTarget === void 0 ? b.fromElement === b.srcElement ? b.toElement : b.fromElement : b.relatedTarget;
  }, movementX: function(b) {
    return "movementX" in b ? b.movementX : (b !== oo && (oo && b.type === "mousemove" ? (Qa = b.screenX - oo.screenX, vo = b.screenY - oo.screenY) : vo = Qa = 0, oo = b), Qa);
  }, movementY: function(b) {
    return "movementY" in b ? b.movementY : vo;
  } }), so = Bi(tl), rl = t({}, tl, { dataTransfer: 0 }), Oa = Bi(rl), qa = t({}, oi, { relatedTarget: 0 }), oa = Bi(qa), eo = t({}, ha, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), ff = Bi(eo), gu = t({}, ha, { clipboardData: function(b) {
    return "clipboardData" in b ? b.clipboardData : window.clipboardData;
  } }), jv = Bi(gu), nl = t({}, ha, { data: 0 }), Jh = Bi(nl), Yv = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified"
  }, hf = {
    8: "Backspace",
    9: "Tab",
    12: "Clear",
    13: "Enter",
    16: "Shift",
    17: "Control",
    18: "Alt",
    19: "Pause",
    20: "CapsLock",
    27: "Escape",
    32: " ",
    33: "PageUp",
    34: "PageDown",
    35: "End",
    36: "Home",
    37: "ArrowLeft",
    38: "ArrowUp",
    39: "ArrowRight",
    40: "ArrowDown",
    45: "Insert",
    46: "Delete",
    112: "F1",
    113: "F2",
    114: "F3",
    115: "F4",
    116: "F5",
    117: "F6",
    118: "F7",
    119: "F8",
    120: "F9",
    121: "F10",
    122: "F11",
    123: "F12",
    144: "NumLock",
    145: "ScrollLock",
    224: "Meta"
  }, Qh = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
  function fc(b) {
    var D = this.nativeEvent;
    return D.getModifierState ? D.getModifierState(b) : (b = Qh[b]) ? !!D[b] : !1;
  }
  function pf() {
    return fc;
  }
  var ud = t({}, oi, { key: function(b) {
    if (b.key) {
      var D = Yv[b.key] || b.key;
      if (D !== "Unidentified") return D;
    }
    return b.type === "keypress" ? (b = ao(b), b === 13 ? "Enter" : String.fromCharCode(b)) : b.type === "keydown" || b.type === "keyup" ? hf[b.keyCode] || "Unidentified" : "";
  }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: pf, charCode: function(b) {
    return b.type === "keypress" ? ao(b) : 0;
  }, keyCode: function(b) {
    return b.type === "keydown" || b.type === "keyup" ? b.keyCode : 0;
  }, which: function(b) {
    return b.type === "keypress" ? ao(b) : b.type === "keydown" || b.type === "keyup" ? b.keyCode : 0;
  } }), qh = Bi(ud), Ms = t({}, tl, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), vf = Bi(Ms), cd = t({}, oi, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: pf }), il = Bi(cd), Ds = t({}, ha, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), hc = Bi(Ds), gf = t({}, tl, {
    deltaX: function(b) {
      return "deltaX" in b ? b.deltaX : "wheelDeltaX" in b ? -b.wheelDeltaX : 0;
    },
    deltaY: function(b) {
      return "deltaY" in b ? b.deltaY : "wheelDeltaY" in b ? -b.wheelDeltaY : "wheelDelta" in b ? -b.wheelDelta : 0;
    },
    deltaZ: 0,
    deltaMode: 0
  }), Xv = Bi(gf), $v = [9, 13, 27, 32], mf = i && "CompositionEvent" in window, mu = null;
  i && "documentMode" in document && (mu = document.documentMode);
  var ep = i && "TextEvent" in window && !mu, tp = i && (!mf || mu && 8 < mu && 11 >= mu), rp = " ", np = !1;
  function yf(b, D) {
    switch (b) {
      case "keyup":
        return $v.indexOf(D.keyCode) !== -1;
      case "keydown":
        return D.keyCode !== 229;
      case "keypress":
      case "mousedown":
      case "focusout":
        return !0;
      default:
        return !1;
    }
  }
  function ip(b) {
    return b = b.detail, typeof b == "object" && "data" in b ? b.data : null;
  }
  var Ul = !1;
  function Zv(b, D) {
    switch (b) {
      case "compositionend":
        return ip(D);
      case "keypress":
        return D.which !== 32 ? null : (np = !0, rp);
      case "textInput":
        return b = D.data, b === rp && np ? null : b;
      default:
        return null;
    }
  }
  function Kv(b, D) {
    if (Ul) return b === "compositionend" || !mf && yf(b, D) ? (b = aa(), ia = za = la = null, Ul = !1, b) : null;
    switch (b) {
      case "paste":
        return null;
      case "keypress":
        if (!(D.ctrlKey || D.altKey || D.metaKey) || D.ctrlKey && D.altKey) {
          if (D.char && 1 < D.char.length) return D.char;
          if (D.which) return String.fromCharCode(D.which);
        }
        return null;
      case "compositionend":
        return tp && D.locale !== "ko" ? null : D.data;
      default:
        return null;
    }
  }
  var Jv = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 };
  function ap(b) {
    var D = b && b.nodeName && b.nodeName.toLowerCase();
    return D === "input" ? !!Jv[b.type] : D === "textarea";
  }
  function dd(b, D, H, ge) {
    Yt(ge), D = gd(D, "onChange"), 0 < D.length && (H = new pa("onChange", "change", null, H, ge), b.push({ event: H, listeners: D }));
  }
  var Uo = null, al = null;
  function Cf(b) {
    pd(b, 0);
  }
  function as(b) {
    var D = Ua(b);
    if (Re(D)) return b;
  }
  function op(b, D) {
    if (b === "change") return D;
  }
  var bf = !1;
  if (i) {
    var wf;
    if (i) {
      var Sf = "oninput" in document;
      if (!Sf) {
        var jl = document.createElement("div");
        jl.setAttribute("oninput", "return;"), Sf = typeof jl.oninput == "function";
      }
      wf = Sf;
    } else wf = !1;
    bf = wf && (!document.documentMode || 9 < document.documentMode);
  }
  function sp() {
    Uo && (Uo.detachEvent("onpropertychange", xf), al = Uo = null);
  }
  function xf(b) {
    if (b.propertyName === "value" && as(al)) {
      var D = [];
      if (dd(D, al, b, xt(b)), b = Cf, lt) b(D);
      else {
        lt = !0;
        try {
          tt(b, D);
        } finally {
          lt = !1, Oe();
        }
      }
    }
  }
  function Qv(b, D, H) {
    b === "focusin" ? (sp(), Uo = D, al = H, Uo.attachEvent("onpropertychange", xf)) : b === "focusout" && sp();
  }
  function lp(b) {
    if (b === "selectionchange" || b === "keyup" || b === "keydown") return as(al);
  }
  function Wa(b, D) {
    if (b === "click") return as(D);
  }
  function qv(b, D) {
    if (b === "input" || b === "change") return as(D);
  }
  function up(b, D) {
    return b === D && (b !== 0 || 1 / b === 1 / D) || b !== b && D !== D;
  }
  var Eo = typeof Object.is == "function" ? Object.is : up, cp = Object.prototype.hasOwnProperty;
  function pc(b, D) {
    if (Eo(b, D)) return !0;
    if (typeof b != "object" || b === null || typeof D != "object" || D === null) return !1;
    var H = Object.keys(b), ge = Object.keys(D);
    if (H.length !== ge.length) return !1;
    for (ge = 0; ge < H.length; ge++) if (!cp.call(D, H[ge]) || !Eo(b[H[ge]], D[H[ge]])) return !1;
    return !0;
  }
  function dp(b) {
    for (; b && b.firstChild; ) b = b.firstChild;
    return b;
  }
  function fp(b, D) {
    var H = dp(b);
    b = 0;
    for (var ge; H; ) {
      if (H.nodeType === 3) {
        if (ge = b + H.textContent.length, b <= D && ge >= D) return { node: H, offset: D - b };
        b = ge;
      }
      e: {
        for (; H; ) {
          if (H.nextSibling) {
            H = H.nextSibling;
            break e;
          }
          H = H.parentNode;
        }
        H = void 0;
      }
      H = dp(H);
    }
  }
  function Tf(b, D) {
    return b && D ? b === D ? !0 : b && b.nodeType === 3 ? !1 : D && D.nodeType === 3 ? Tf(b, D.parentNode) : "contains" in b ? b.contains(D) : b.compareDocumentPosition ? !!(b.compareDocumentPosition(D) & 16) : !1 : !1;
  }
  function fd() {
    for (var b = window, D = Ae(); D instanceof b.HTMLIFrameElement; ) {
      try {
        var H = typeof D.contentWindow.location.href == "string";
      } catch {
        H = !1;
      }
      if (H) b = D.contentWindow;
      else break;
      D = Ae(b.document);
    }
    return D;
  }
  function ol(b) {
    var D = b && b.nodeName && b.nodeName.toLowerCase();
    return D && (D === "input" && (b.type === "text" || b.type === "search" || b.type === "tel" || b.type === "url" || b.type === "password") || D === "textarea" || b.contentEditable === "true");
  }
  var hp = i && "documentMode" in document && 11 >= document.documentMode, yu = null, vc = null, jo = null, Mo = !1;
  function _a(b, D, H) {
    var ge = H.window === H ? H.document : H.nodeType === 9 ? H : H.ownerDocument;
    Mo || yu == null || yu !== Ae(ge) || (ge = yu, "selectionStart" in ge && ol(ge) ? ge = { start: ge.selectionStart, end: ge.selectionEnd } : (ge = (ge.ownerDocument && ge.ownerDocument.defaultView || window).getSelection(), ge = { anchorNode: ge.anchorNode, anchorOffset: ge.anchorOffset, focusNode: ge.focusNode, focusOffset: ge.focusOffset }), jo && pc(jo, ge) || (jo = ge, ge = gd(vc, "onSelect"), 0 < ge.length && (D = new pa("onSelect", "select", null, D, H), b.push({ event: D, listeners: ge }), D.target = yu)));
  }
  ai(
    "cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),
    0
  ), ai("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "), 1), ai(Sn, 2);
  for (var Rf = "change selectionchange textInput compositionstart compositionend compositionupdate".split(" "), Af = 0; Af < Rf.length; Af++) nn.set(Rf[Af], 0);
  c("onMouseEnter", ["mouseout", "mouseover"]), c("onMouseLeave", ["mouseout", "mouseover"]), c("onPointerEnter", ["pointerout", "pointerover"]), c("onPointerLeave", ["pointerout", "pointerover"]), s("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), s("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), s("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), s("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), s("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), s("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
  var Cu = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), eg = new Set("cancel close invalid load scroll toggle".split(" ").concat(Cu));
  function hd(b, D, H) {
    var ge = b.type || "unknown-event";
    b.currentTarget = H, Mr(ge, D, void 0, b), b.currentTarget = null;
  }
  function pd(b, D) {
    D = (D & 4) !== 0;
    for (var H = 0; H < b.length; H++) {
      var ge = b[H], Pe = ge.event;
      ge = ge.listeners;
      e: {
        var $e = void 0;
        if (D) for (var ht = ge.length - 1; 0 <= ht; ht--) {
          var Mt = ge[ht], Jt = Mt.instance, vr = Mt.currentTarget;
          if (Mt = Mt.listener, Jt !== $e && Pe.isPropagationStopped()) break e;
          hd(Pe, Mt, vr), $e = Jt;
        }
        else for (ht = 0; ht < ge.length; ht++) {
          if (Mt = ge[ht], Jt = Mt.instance, vr = Mt.currentTarget, Mt = Mt.listener, Jt !== $e && Pe.isPropagationStopped()) break e;
          hd(Pe, Mt, vr), $e = Jt;
        }
      }
    }
    if (ut) throw b = Pt, ut = !1, Pt = null, b;
  }
  function Vi(b, D) {
    var H = Cd(D), ge = b + "__bubble";
    H.has(ge) || (bu(D, b, 2, !1), H.add(ge));
  }
  var vd = "_reactListening" + Math.random().toString(36).slice(2);
  function Ef(b) {
    b[vd] || (b[vd] = !0, a.forEach(function(D) {
      eg.has(D) || Fs(D, !1, b, null), Fs(D, !0, b, null);
    }));
  }
  function Fs(b, D, H, ge) {
    var Pe = 4 < arguments.length && arguments[4] !== void 0 ? arguments[4] : 0, $e = H;
    b === "selectionchange" && H.nodeType !== 9 && ($e = H.ownerDocument);
    var ht = Cd($e), Mt = b + "__" + (D ? "capture" : "bubble");
    ht.has(Mt) || (D && (Pe |= 4), bu($e, b, Pe, D), ht.add(Mt));
  }
  function bu(b, D, H, ge) {
    var Pe = nn.get(D);
    switch (Pe === void 0 ? 2 : Pe) {
      case 0:
        Pe = fa;
        break;
      case 1:
        Pe = Hi;
        break;
      default:
        Pe = Ti;
    }
    H = Pe.bind(null, D, H, b), Pe = void 0, !nt || D !== "touchstart" && D !== "touchmove" && D !== "wheel" || (Pe = !0), ge ? Pe !== void 0 ? b.addEventListener(D, H, { capture: !0, passive: Pe }) : b.addEventListener(D, H, !0) : Pe !== void 0 ? b.addEventListener(D, H, { passive: Pe }) : b.addEventListener(D, H, !1);
  }
  function wu(b, D, H, ge, Pe) {
    var $e = ge;
    if (!(D & 1) && !(D & 2) && ge !== null) e: for (; ; ) {
      if (ge === null) return;
      var ht = ge.tag;
      if (ht === 3 || ht === 4) {
        var Mt = ge.stateNode.containerInfo;
        if (Mt === Pe || Mt.nodeType === 8 && Mt.parentNode === Pe) break;
        if (ht === 4) for (ht = ge.return; ht !== null; ) {
          var Jt = ht.tag;
          if ((Jt === 3 || Jt === 4) && (Jt = ht.stateNode.containerInfo, Jt === Pe || Jt.nodeType === 8 && Jt.parentNode === Pe)) return;
          ht = ht.return;
        }
        for (; Mt !== null; ) {
          if (ht = Xl(Mt), ht === null) return;
          if (Jt = ht.tag, Jt === 5 || Jt === 6) {
            ge = $e = ht;
            continue e;
          }
          Mt = Mt.parentNode;
        }
      }
      ge = ge.return;
    }
    je(function() {
      var vr = $e, vn = xt(H), Kn = [];
      e: {
        var jr = dn.get(b);
        if (jr !== void 0) {
          var Mn = pa, Xn = b;
          switch (b) {
            case "keypress":
              if (ao(H) === 0) break e;
            case "keydown":
            case "keyup":
              Mn = qh;
              break;
            case "focusin":
              Xn = "focus", Mn = oa;
              break;
            case "focusout":
              Xn = "blur", Mn = oa;
              break;
            case "beforeblur":
            case "afterblur":
              Mn = oa;
              break;
            case "click":
              if (H.button === 2) break e;
            case "auxclick":
            case "dblclick":
            case "mousedown":
            case "mousemove":
            case "mouseup":
            case "mouseout":
            case "mouseover":
            case "contextmenu":
              Mn = so;
              break;
            case "drag":
            case "dragend":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "dragstart":
            case "drop":
              Mn = Oa;
              break;
            case "touchcancel":
            case "touchend":
            case "touchmove":
            case "touchstart":
              Mn = il;
              break;
            case Er:
            case Jr:
            case Ur:
              Mn = ff;
              break;
            case Br:
              Mn = hc;
              break;
            case "scroll":
              Mn = Ii;
              break;
            case "wheel":
              Mn = Xv;
              break;
            case "copy":
            case "cut":
            case "paste":
              Mn = jv;
              break;
            case "gotpointercapture":
            case "lostpointercapture":
            case "pointercancel":
            case "pointerdown":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "pointerup":
              Mn = vf;
          }
          var Vn = (D & 4) !== 0, ur = !Vn && b === "scroll", er = Vn ? jr !== null ? jr + "Capture" : null : jr;
          Vn = [];
          for (var or = vr, Or; or !== null; ) {
            Or = or;
            var Hr = Or.stateNode;
            if (Or.tag === 5 && Hr !== null && (Or = Hr, er !== null && (Hr = Xe(or, er), Hr != null && Vn.push(gc(or, Hr, Or)))), ur) break;
            or = or.return;
          }
          0 < Vn.length && (jr = new Mn(jr, Xn, null, H, vn), Kn.push({ event: jr, listeners: Vn }));
        }
      }
      if (!(D & 7)) {
        e: {
          if (jr = b === "mouseover" || b === "pointerover", Mn = b === "mouseout" || b === "pointerout", jr && !(D & 16) && (Xn = H.relatedTarget || H.fromElement) && (Xl(Xn) || Xn[to])) break e;
          if ((Mn || jr) && (jr = vn.window === vn ? vn : (jr = vn.ownerDocument) ? jr.defaultView || jr.parentWindow : window, Mn ? (Xn = H.relatedTarget || H.toElement, Mn = vr, Xn = Xn ? Xl(Xn) : null, Xn !== null && (ur = Rr(Xn), Xn !== ur || Xn.tag !== 5 && Xn.tag !== 6) && (Xn = null)) : (Mn = null, Xn = vr), Mn !== Xn)) {
            if (Vn = so, Hr = "onMouseLeave", er = "onMouseEnter", or = "mouse", (b === "pointerout" || b === "pointerover") && (Vn = vf, Hr = "onPointerLeave", er = "onPointerEnter", or = "pointer"), ur = Mn == null ? jr : Ua(Mn), Or = Xn == null ? jr : Ua(Xn), jr = new Vn(Hr, or + "leave", Mn, H, vn), jr.target = ur, jr.relatedTarget = Or, Hr = null, Xl(vn) === vr && (Vn = new Vn(er, or + "enter", Xn, H, vn), Vn.target = Or, Vn.relatedTarget = ur, Hr = Vn), ur = Hr, Mn && Xn) t: {
              for (Vn = Mn, er = Xn, or = 0, Or = Vn; Or; Or = Su(Or)) or++;
              for (Or = 0, Hr = er; Hr; Hr = Su(Hr)) Or++;
              for (; 0 < or - Or; ) Vn = Su(Vn), or--;
              for (; 0 < Or - or; ) er = Su(er), Or--;
              for (; or--; ) {
                if (Vn === er || er !== null && Vn === er.alternate) break t;
                Vn = Su(Vn), er = Su(er);
              }
              Vn = null;
            }
            else Vn = null;
            Mn !== null && pp(Kn, jr, Mn, Vn, !1), Xn !== null && ur !== null && pp(Kn, ur, Xn, Vn, !0);
          }
        }
        e: {
          if (jr = vr ? Ua(vr) : window, Mn = jr.nodeName && jr.nodeName.toLowerCase(), Mn === "select" || Mn === "input" && jr.type === "file") var Qn = op;
          else if (ap(jr)) if (bf) Qn = qv;
          else {
            Qn = lp;
            var bn = Qv;
          }
          else (Mn = jr.nodeName) && Mn.toLowerCase() === "input" && (jr.type === "checkbox" || jr.type === "radio") && (Qn = Wa);
          if (Qn && (Qn = Qn(b, vr))) {
            dd(Kn, Qn, H, vn);
            break e;
          }
          bn && bn(b, jr, vr), b === "focusout" && (bn = jr._wrapperState) && bn.controlled && jr.type === "number" && fe(jr, "number", jr.value);
        }
        switch (bn = vr ? Ua(vr) : window, b) {
          case "focusin":
            (ap(bn) || bn.contentEditable === "true") && (yu = bn, vc = vr, jo = null);
            break;
          case "focusout":
            jo = vc = yu = null;
            break;
          case "mousedown":
            Mo = !0;
            break;
          case "contextmenu":
          case "mouseup":
          case "dragend":
            Mo = !1, _a(Kn, H, vn);
            break;
          case "selectionchange":
            if (hp) break;
          case "keydown":
          case "keyup":
            _a(Kn, H, vn);
        }
        var Jn;
        if (mf) e: {
          switch (b) {
            case "compositionstart":
              var ni = "onCompositionStart";
              break e;
            case "compositionend":
              ni = "onCompositionEnd";
              break e;
            case "compositionupdate":
              ni = "onCompositionUpdate";
              break e;
          }
          ni = void 0;
        }
        else Ul ? yf(b, H) && (ni = "onCompositionEnd") : b === "keydown" && H.keyCode === 229 && (ni = "onCompositionStart");
        ni && (tp && H.locale !== "ko" && (Ul || ni !== "onCompositionStart" ? ni === "onCompositionEnd" && Ul && (Jn = aa()) : (la = vn, za = "value" in la ? la.value : la.textContent, Ul = !0)), bn = gd(vr, ni), 0 < bn.length && (ni = new Jh(ni, b, null, H, vn), Kn.push({ event: ni, listeners: bn }), Jn ? ni.data = Jn : (Jn = ip(H), Jn !== null && (ni.data = Jn)))), (Jn = ep ? Zv(b, H) : Kv(b, H)) && (vr = gd(vr, "onBeforeInput"), 0 < vr.length && (vn = new Jh(
          "onBeforeInput",
          "beforeinput",
          null,
          H,
          vn
        ), Kn.push({ event: vn, listeners: vr }), vn.data = Jn));
      }
      pd(Kn, D);
    });
  }
  function gc(b, D, H) {
    return { instance: b, listener: D, currentTarget: H };
  }
  function gd(b, D) {
    for (var H = D + "Capture", ge = []; b !== null; ) {
      var Pe = b, $e = Pe.stateNode;
      Pe.tag === 5 && $e !== null && (Pe = $e, $e = Xe(b, H), $e != null && ge.unshift(gc(b, $e, Pe)), $e = Xe(b, D), $e != null && ge.push(gc(b, $e, Pe))), b = b.return;
    }
    return ge;
  }
  function Su(b) {
    if (b === null) return null;
    do
      b = b.return;
    while (b && b.tag !== 5);
    return b || null;
  }
  function pp(b, D, H, ge, Pe) {
    for (var $e = D._reactName, ht = []; H !== null && H !== ge; ) {
      var Mt = H, Jt = Mt.alternate, vr = Mt.stateNode;
      if (Jt !== null && Jt === ge) break;
      Mt.tag === 5 && vr !== null && (Mt = vr, Pe ? (Jt = Xe(H, $e), Jt != null && ht.unshift(gc(H, Jt, Mt))) : Pe || (Jt = Xe(H, $e), Jt != null && ht.push(gc(H, Jt, Mt)))), H = H.return;
    }
    ht.length !== 0 && b.push({ event: D, listeners: ht });
  }
  function mc() {
  }
  var Mf = null, Df = null;
  function sl(b, D) {
    switch (b) {
      case "button":
      case "input":
      case "select":
      case "textarea":
        return !!D.autoFocus;
    }
    return !1;
  }
  function xu(b, D) {
    return b === "textarea" || b === "option" || b === "noscript" || typeof D.children == "string" || typeof D.children == "number" || typeof D.dangerouslySetInnerHTML == "object" && D.dangerouslySetInnerHTML !== null && D.dangerouslySetInnerHTML.__html != null;
  }
  var Yl = typeof setTimeout == "function" ? setTimeout : void 0, Ff = typeof clearTimeout == "function" ? clearTimeout : void 0;
  function md(b) {
    b.nodeType === 1 ? b.textContent = "" : b.nodeType === 9 && (b = b.body, b != null && (b.textContent = ""));
  }
  function ll(b) {
    for (; b != null; b = b.nextSibling) {
      var D = b.nodeType;
      if (D === 1 || D === 3) break;
    }
    return b;
  }
  function Pf(b) {
    b = b.previousSibling;
    for (var D = 0; b; ) {
      if (b.nodeType === 8) {
        var H = b.data;
        if (H === "$" || H === "$!" || H === "$?") {
          if (D === 0) return b;
          D--;
        } else H === "/$" && D++;
      }
      b = b.previousSibling;
    }
    return null;
  }
  var Ps = 0;
  function yc(b) {
    return { $$typeof: z, toString: b, valueOf: b };
  }
  var Is = Math.random().toString(36).slice(2), Do = "__reactFiber$" + Is, yd = "__reactProps$" + Is, to = "__reactContainer$" + Is, vp = "__reactEvents$" + Is;
  function Xl(b) {
    var D = b[Do];
    if (D) return D;
    for (var H = b.parentNode; H; ) {
      if (D = H[to] || H[Do]) {
        if (H = D.alternate, D.child !== null || H !== null && H.child !== null) for (b = Pf(b); b !== null; ) {
          if (H = b[Do]) return H;
          b = Pf(b);
        }
        return D;
      }
      b = H, H = b.parentNode;
    }
    return null;
  }
  function go(b) {
    return b = b[Do] || b[to], !b || b.tag !== 5 && b.tag !== 6 && b.tag !== 13 && b.tag !== 3 ? null : b;
  }
  function Ua(b) {
    if (b.tag === 5 || b.tag === 6) return b.stateNode;
    throw Error(n(33));
  }
  function os(b) {
    return b[yd] || null;
  }
  function Cd(b) {
    var D = b[vp];
    return D === void 0 && (D = b[vp] = /* @__PURE__ */ new Set()), D;
  }
  var bd = [], Ci = -1;
  function xa(b) {
    return { current: b };
  }
  function Yn(b) {
    0 > Ci || (b.current = bd[Ci], bd[Ci] = null, Ci--);
  }
  function On(b, D) {
    Ci++, bd[Ci] = b.current, b.current = D;
  }
  var Ls = {}, Ji = xa(Ls), Na = xa(!1), ks = Ls;
  function bi(b, D) {
    var H = b.type.contextTypes;
    if (!H) return Ls;
    var ge = b.stateNode;
    if (ge && ge.__reactInternalMemoizedUnmaskedChildContext === D) return ge.__reactInternalMemoizedMaskedChildContext;
    var Pe = {}, $e;
    for ($e in H) Pe[$e] = D[$e];
    return ge && (b = b.stateNode, b.__reactInternalMemoizedUnmaskedChildContext = D, b.__reactInternalMemoizedMaskedChildContext = Pe), Pe;
  }
  function Ta(b) {
    return b = b.childContextTypes, b != null;
  }
  function Fo() {
    Yn(Na), Yn(Ji);
  }
  function ul(b, D, H) {
    if (Ji.current !== Ls) throw Error(n(168));
    On(Ji, D), On(Na, H);
  }
  function $l(b, D, H) {
    var ge = b.stateNode;
    if (b = D.childContextTypes, typeof ge.getChildContext != "function") return H;
    ge = ge.getChildContext();
    for (var Pe in ge) if (!(Pe in b)) throw Error(n(108, ve(D) || "Unknown", Pe));
    return t({}, H, ge);
  }
  function Po(b) {
    return b = (b = b.stateNode) && b.__reactInternalMemoizedMergedChildContext || Ls, ks = Ji.current, On(Ji, b), On(Na, Na.current), !0;
  }
  function If(b, D, H) {
    var ge = b.stateNode;
    if (!ge) throw Error(n(169));
    H ? (b = $l(b, D, ks), ge.__reactInternalMemoizedMergedChildContext = b, Yn(Na), Yn(Ji), On(Ji, b)) : Yn(Na), On(Na, H);
  }
  var Tu = null, cl = null, Cc = r.unstable_runWithPriority, Yo = r.unstable_scheduleCallback, bc = r.unstable_cancelCallback, tg = r.unstable_shouldYield, Os = r.unstable_requestPaint, wc = r.unstable_now, Lf = r.unstable_getCurrentPriorityLevel, Sc = r.unstable_ImmediatePriority, gp = r.unstable_UserBlockingPriority, Ru = r.unstable_NormalPriority, kf = r.unstable_LowPriority, Of = r.unstable_IdlePriority, wd = {}, Nf = Os !== void 0 ? Os : function() {
  }, ss = null, Zl = null, dl = !1, Gf = wc(), Ra = 1e4 > Gf ? wc : function() {
    return wc() - Gf;
  };
  function fl() {
    switch (Lf()) {
      case Sc:
        return 99;
      case gp:
        return 98;
      case Ru:
        return 97;
      case kf:
        return 96;
      case Of:
        return 95;
      default:
        throw Error(n(332));
    }
  }
  function mo(b) {
    switch (b) {
      case 99:
        return Sc;
      case 98:
        return gp;
      case 97:
        return Ru;
      case 96:
        return kf;
      case 95:
        return Of;
      default:
        throw Error(n(332));
    }
  }
  function hl(b, D) {
    return b = mo(b), Cc(b, D);
  }
  function Kl(b, D, H) {
    return b = mo(b), Yo(b, D, H);
  }
  function va() {
    if (Zl !== null) {
      var b = Zl;
      Zl = null, bc(b);
    }
    Xo();
  }
  function Xo() {
    if (!dl && ss !== null) {
      dl = !0;
      var b = 0;
      try {
        var D = ss;
        hl(99, function() {
          for (; b < D.length; b++) {
            var H = D[b];
            do
              H = H(!0);
            while (H !== null);
          }
        }), ss = null;
      } catch (H) {
        throw ss !== null && (ss = ss.slice(b + 1)), Yo(Sc, va), H;
      } finally {
        dl = !1;
      }
    }
  }
  var pl = x.ReactCurrentBatchConfig;
  function Aa(b, D) {
    if (b && b.defaultProps) {
      D = t({}, D), b = b.defaultProps;
      for (var H in b) D[H] === void 0 && (D[H] = b[H]);
      return D;
    }
    return D;
  }
  var vl = xa(null), $o = null, Io = null, xc = null;
  function Hf() {
    xc = Io = $o = null;
  }
  function Sd(b) {
    var D = vl.current;
    Yn(vl), b.type._context._currentValue = D;
  }
  function Bf(b, D) {
    for (; b !== null; ) {
      var H = b.alternate;
      if ((b.childLanes & D) === D) {
        if (H === null || (H.childLanes & D) === D) break;
        H.childLanes |= D;
      } else b.childLanes |= D, H !== null && (H.childLanes |= D);
      b = b.return;
    }
  }
  function Ea(b, D) {
    $o = b, xc = Io = null, b = b.dependencies, b !== null && b.firstContext !== null && (b.lanes & D && (Ri = !0), b.firstContext = null);
  }
  function lo(b, D) {
    if (xc !== b && D !== !1 && D !== 0)
      if ((typeof D != "number" || D === 1073741823) && (xc = b, D = 1073741823), D = { context: b, observedBits: D, next: null }, Io === null) {
        if ($o === null) throw Error(n(308));
        Io = D, $o.dependencies = { lanes: 0, firstContext: D, responders: null };
      } else Io = Io.next = D;
    return b._currentValue;
  }
  var yo = !1;
  function ls(b) {
    b.updateQueue = { baseState: b.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null }, effects: null };
  }
  function xd(b, D) {
    b = b.updateQueue, D.updateQueue === b && (D.updateQueue = { baseState: b.baseState, firstBaseUpdate: b.firstBaseUpdate, lastBaseUpdate: b.lastBaseUpdate, shared: b.shared, effects: b.effects });
  }
  function Co(b, D) {
    return { eventTime: b, lane: D, tag: 0, payload: null, callback: null, next: null };
  }
  function Ns(b, D) {
    if (b = b.updateQueue, b !== null) {
      b = b.shared;
      var H = b.pending;
      H === null ? D.next = D : (D.next = H.next, H.next = D), b.pending = D;
    }
  }
  function mp(b, D) {
    var H = b.updateQueue, ge = b.alternate;
    if (ge !== null && (ge = ge.updateQueue, H === ge)) {
      var Pe = null, $e = null;
      if (H = H.firstBaseUpdate, H !== null) {
        do {
          var ht = { eventTime: H.eventTime, lane: H.lane, tag: H.tag, payload: H.payload, callback: H.callback, next: null };
          $e === null ? Pe = $e = ht : $e = $e.next = ht, H = H.next;
        } while (H !== null);
        $e === null ? Pe = $e = D : $e = $e.next = D;
      } else Pe = $e = D;
      H = { baseState: ge.baseState, firstBaseUpdate: Pe, lastBaseUpdate: $e, shared: ge.shared, effects: ge.effects }, b.updateQueue = H;
      return;
    }
    b = H.lastBaseUpdate, b === null ? H.firstBaseUpdate = D : b.next = D, H.lastBaseUpdate = D;
  }
  function Gs(b, D, H, ge) {
    var Pe = b.updateQueue;
    yo = !1;
    var $e = Pe.firstBaseUpdate, ht = Pe.lastBaseUpdate, Mt = Pe.shared.pending;
    if (Mt !== null) {
      Pe.shared.pending = null;
      var Jt = Mt, vr = Jt.next;
      Jt.next = null, ht === null ? $e = vr : ht.next = vr, ht = Jt;
      var vn = b.alternate;
      if (vn !== null) {
        vn = vn.updateQueue;
        var Kn = vn.lastBaseUpdate;
        Kn !== ht && (Kn === null ? vn.firstBaseUpdate = vr : Kn.next = vr, vn.lastBaseUpdate = Jt);
      }
    }
    if ($e !== null) {
      Kn = Pe.baseState, ht = 0, vn = vr = Jt = null;
      do {
        Mt = $e.lane;
        var jr = $e.eventTime;
        if ((ge & Mt) === Mt) {
          vn !== null && (vn = vn.next = {
            eventTime: jr,
            lane: 0,
            tag: $e.tag,
            payload: $e.payload,
            callback: $e.callback,
            next: null
          });
          e: {
            var Mn = b, Xn = $e;
            switch (Mt = D, jr = H, Xn.tag) {
              case 1:
                if (Mn = Xn.payload, typeof Mn == "function") {
                  Kn = Mn.call(jr, Kn, Mt);
                  break e;
                }
                Kn = Mn;
                break e;
              case 3:
                Mn.flags = Mn.flags & -4097 | 64;
              case 0:
                if (Mn = Xn.payload, Mt = typeof Mn == "function" ? Mn.call(jr, Kn, Mt) : Mn, Mt == null) break e;
                Kn = t({}, Kn, Mt);
                break e;
              case 2:
                yo = !0;
            }
          }
          $e.callback !== null && (b.flags |= 32, Mt = Pe.effects, Mt === null ? Pe.effects = [$e] : Mt.push($e));
        } else jr = { eventTime: jr, lane: Mt, tag: $e.tag, payload: $e.payload, callback: $e.callback, next: null }, vn === null ? (vr = vn = jr, Jt = Kn) : vn = vn.next = jr, ht |= Mt;
        if ($e = $e.next, $e === null) {
          if (Mt = Pe.shared.pending, Mt === null) break;
          $e = Mt.next, Mt.next = null, Pe.lastBaseUpdate = Mt, Pe.shared.pending = null;
        }
      } while (!0);
      vn === null && (Jt = Kn), Pe.baseState = Jt, Pe.firstBaseUpdate = vr, Pe.lastBaseUpdate = vn, Dc |= ht, b.lanes = ht, b.memoizedState = Kn;
    }
  }
  function Td(b, D, H) {
    if (b = D.effects, D.effects = null, b !== null) for (D = 0; D < b.length; D++) {
      var ge = b[D], Pe = ge.callback;
      if (Pe !== null) {
        if (ge.callback = null, ge = H, typeof Pe != "function") throw Error(n(191, Pe));
        Pe.call(ge);
      }
    }
  }
  var Tc = new e.Component().refs;
  function Au(b, D, H, ge) {
    D = b.memoizedState, H = H(ge, D), H = H == null ? D : t({}, D, H), b.memoizedState = H, b.lanes === 0 && (b.updateQueue.baseState = H);
  }
  var Jl = { isMounted: function(b) {
    return (b = b._reactInternals) ? Rr(b) === b : !1;
  }, enqueueSetState: function(b, D, H) {
    b = b._reactInternals;
    var ge = Ko(), Pe = Al(b), $e = Co(ge, Pe);
    $e.payload = D, H != null && ($e.callback = H), Ns(b, $e), Ou(b, Pe, ge);
  }, enqueueReplaceState: function(b, D, H) {
    b = b._reactInternals;
    var ge = Ko(), Pe = Al(b), $e = Co(ge, Pe);
    $e.tag = 1, $e.payload = D, H != null && ($e.callback = H), Ns(b, $e), Ou(b, Pe, ge);
  }, enqueueForceUpdate: function(b, D) {
    b = b._reactInternals;
    var H = Ko(), ge = Al(b), Pe = Co(H, ge);
    Pe.tag = 2, D != null && (Pe.callback = D), Ns(b, Pe), Ou(b, ge, H);
  } };
  function Rc(b, D, H, ge, Pe, $e, ht) {
    return b = b.stateNode, typeof b.shouldComponentUpdate == "function" ? b.shouldComponentUpdate(ge, $e, ht) : D.prototype && D.prototype.isPureReactComponent ? !pc(H, ge) || !pc(Pe, $e) : !0;
  }
  function gl(b, D, H) {
    var ge = !1, Pe = Ls, $e = D.contextType;
    return typeof $e == "object" && $e !== null ? $e = lo($e) : (Pe = Ta(D) ? ks : Ji.current, ge = D.contextTypes, $e = (ge = ge != null) ? bi(b, Pe) : Ls), D = new D(H, $e), b.memoizedState = D.state !== null && D.state !== void 0 ? D.state : null, D.updater = Jl, b.stateNode = D, D._reactInternals = b, ge && (b = b.stateNode, b.__reactInternalMemoizedUnmaskedChildContext = Pe, b.__reactInternalMemoizedMaskedChildContext = $e), D;
  }
  function Rd(b, D, H, ge) {
    b = D.state, typeof D.componentWillReceiveProps == "function" && D.componentWillReceiveProps(H, ge), typeof D.UNSAFE_componentWillReceiveProps == "function" && D.UNSAFE_componentWillReceiveProps(H, ge), D.state !== b && Jl.enqueueReplaceState(D, D.state, null);
  }
  function Ad(b, D, H, ge) {
    var Pe = b.stateNode;
    Pe.props = H, Pe.state = b.memoizedState, Pe.refs = Tc, ls(b);
    var $e = D.contextType;
    typeof $e == "object" && $e !== null ? Pe.context = lo($e) : ($e = Ta(D) ? ks : Ji.current, Pe.context = bi(b, $e)), Gs(b, H, Pe, ge), Pe.state = b.memoizedState, $e = D.getDerivedStateFromProps, typeof $e == "function" && (Au(b, D, $e, H), Pe.state = b.memoizedState), typeof D.getDerivedStateFromProps == "function" || typeof Pe.getSnapshotBeforeUpdate == "function" || typeof Pe.UNSAFE_componentWillMount != "function" && typeof Pe.componentWillMount != "function" || (D = Pe.state, typeof Pe.componentWillMount == "function" && Pe.componentWillMount(), typeof Pe.UNSAFE_componentWillMount == "function" && Pe.UNSAFE_componentWillMount(), D !== Pe.state && Jl.enqueueReplaceState(Pe, Pe.state, null), Gs(b, H, Pe, ge), Pe.state = b.memoizedState), typeof Pe.componentDidMount == "function" && (b.flags |= 4);
  }
  var Ql = Array.isArray;
  function ql(b, D, H) {
    if (b = H.ref, b !== null && typeof b != "function" && typeof b != "object") {
      if (H._owner) {
        if (H = H._owner, H) {
          if (H.tag !== 1) throw Error(n(309));
          var ge = H.stateNode;
        }
        if (!ge) throw Error(n(147, b));
        var Pe = "" + b;
        return D !== null && D.ref !== null && typeof D.ref == "function" && D.ref._stringRef === Pe ? D.ref : (D = function($e) {
          var ht = ge.refs;
          ht === Tc && (ht = ge.refs = {}), $e === null ? delete ht[Pe] : ht[Pe] = $e;
        }, D._stringRef = Pe, D);
      }
      if (typeof b != "string") throw Error(n(284));
      if (!H._owner) throw Error(n(290, b));
    }
    return b;
  }
  function Eu(b, D) {
    if (b.type !== "textarea") throw Error(n(31, Object.prototype.toString.call(D) === "[object Object]" ? "object with keys {" + Object.keys(D).join(", ") + "}" : D));
  }
  function Mu(b) {
    function D(ur, er) {
      if (b) {
        var or = ur.lastEffect;
        or !== null ? (or.nextEffect = er, ur.lastEffect = er) : ur.firstEffect = ur.lastEffect = er, er.nextEffect = null, er.flags = 8;
      }
    }
    function H(ur, er) {
      if (!b) return null;
      for (; er !== null; ) D(ur, er), er = er.sibling;
      return null;
    }
    function ge(ur, er) {
      for (ur = /* @__PURE__ */ new Map(); er !== null; ) er.key !== null ? ur.set(er.key, er) : ur.set(er.index, er), er = er.sibling;
      return ur;
    }
    function Pe(ur, er) {
      return ur = Bu(ur, er), ur.index = 0, ur.sibling = null, ur;
    }
    function $e(ur, er, or) {
      return ur.index = or, b ? (or = ur.alternate, or !== null ? (or = or.index, or < er ? (ur.flags = 2, er) : or) : (ur.flags = 2, er)) : er;
    }
    function ht(ur) {
      return b && ur.alternate === null && (ur.flags = 2), ur;
    }
    function Mt(ur, er, or, Or) {
      return er === null || er.tag !== 6 ? (er = mg(or, ur.mode, Or), er.return = ur, er) : (er = Pe(er, or), er.return = ur, er);
    }
    function Jt(ur, er, or, Or) {
      return er !== null && er.elementType === or.type ? (Or = Pe(er, or.props), Or.ref = ql(ur, er, or), Or.return = ur, Or) : (Or = eh(or.type, or.key, or.props, null, ur.mode, Or), Or.ref = ql(ur, er, or), Or.return = ur, Or);
    }
    function vr(ur, er, or, Or) {
      return er === null || er.tag !== 4 || er.stateNode.containerInfo !== or.containerInfo || er.stateNode.implementation !== or.implementation ? (er = yg(or, ur.mode, Or), er.return = ur, er) : (er = Pe(er, or.children || []), er.return = ur, er);
    }
    function vn(ur, er, or, Or, Hr) {
      return er === null || er.tag !== 7 ? (er = El(or, ur.mode, Or, Hr), er.return = ur, er) : (er = Pe(er, or), er.return = ur, er);
    }
    function Kn(ur, er, or) {
      if (typeof er == "string" || typeof er == "number") return er = mg("" + er, ur.mode, or), er.return = ur, er;
      if (typeof er == "object" && er !== null) {
        switch (er.$$typeof) {
          case T:
            return or = eh(er.type, er.key, er.props, null, ur.mode, or), or.ref = ql(ur, null, er), or.return = ur, or;
          case F:
            return er = yg(er, ur.mode, or), er.return = ur, er;
        }
        if (Ql(er) || X(er)) return er = El(
          er,
          ur.mode,
          or,
          null
        ), er.return = ur, er;
        Eu(ur, er);
      }
      return null;
    }
    function jr(ur, er, or, Or) {
      var Hr = er !== null ? er.key : null;
      if (typeof or == "string" || typeof or == "number") return Hr !== null ? null : Mt(ur, er, "" + or, Or);
      if (typeof or == "object" && or !== null) {
        switch (or.$$typeof) {
          case T:
            return or.key === Hr ? or.type === P ? vn(ur, er, or.props.children, Or, Hr) : Jt(ur, er, or, Or) : null;
          case F:
            return or.key === Hr ? vr(ur, er, or, Or) : null;
        }
        if (Ql(or) || X(or)) return Hr !== null ? null : vn(ur, er, or, Or, null);
        Eu(ur, or);
      }
      return null;
    }
    function Mn(ur, er, or, Or, Hr) {
      if (typeof Or == "string" || typeof Or == "number") return ur = ur.get(or) || null, Mt(er, ur, "" + Or, Hr);
      if (typeof Or == "object" && Or !== null) {
        switch (Or.$$typeof) {
          case T:
            return ur = ur.get(Or.key === null ? or : Or.key) || null, Or.type === P ? vn(er, ur, Or.props.children, Hr, Or.key) : Jt(er, ur, Or, Hr);
          case F:
            return ur = ur.get(Or.key === null ? or : Or.key) || null, vr(er, ur, Or, Hr);
        }
        if (Ql(Or) || X(Or)) return ur = ur.get(or) || null, vn(er, ur, Or, Hr, null);
        Eu(er, Or);
      }
      return null;
    }
    function Xn(ur, er, or, Or) {
      for (var Hr = null, Qn = null, bn = er, Jn = er = 0, ni = null; bn !== null && Jn < or.length; Jn++) {
        bn.index > Jn ? (ni = bn, bn = null) : ni = bn.sibling;
        var qn = jr(ur, bn, or[Jn], Or);
        if (qn === null) {
          bn === null && (bn = ni);
          break;
        }
        b && bn && qn.alternate === null && D(ur, bn), er = $e(qn, er, Jn), Qn === null ? Hr = qn : Qn.sibling = qn, Qn = qn, bn = ni;
      }
      if (Jn === or.length) return H(ur, bn), Hr;
      if (bn === null) {
        for (; Jn < or.length; Jn++) bn = Kn(ur, or[Jn], Or), bn !== null && (er = $e(bn, er, Jn), Qn === null ? Hr = bn : Qn.sibling = bn, Qn = bn);
        return Hr;
      }
      for (bn = ge(ur, bn); Jn < or.length; Jn++) ni = Mn(bn, ur, Jn, or[Jn], Or), ni !== null && (b && ni.alternate !== null && bn.delete(ni.key === null ? Jn : ni.key), er = $e(ni, er, Jn), Qn === null ? Hr = ni : Qn.sibling = ni, Qn = ni);
      return b && bn.forEach(function(Vu) {
        return D(ur, Vu);
      }), Hr;
    }
    function Vn(ur, er, or, Or) {
      var Hr = X(or);
      if (typeof Hr != "function") throw Error(n(150));
      if (or = Hr.call(or), or == null) throw Error(n(151));
      for (var Qn = Hr = null, bn = er, Jn = er = 0, ni = null, qn = or.next(); bn !== null && !qn.done; Jn++, qn = or.next()) {
        bn.index > Jn ? (ni = bn, bn = null) : ni = bn.sibling;
        var Vu = jr(ur, bn, qn.value, Or);
        if (Vu === null) {
          bn === null && (bn = ni);
          break;
        }
        b && bn && Vu.alternate === null && D(ur, bn), er = $e(Vu, er, Jn), Qn === null ? Hr = Vu : Qn.sibling = Vu, Qn = Vu, bn = ni;
      }
      if (qn.done) return H(ur, bn), Hr;
      if (bn === null) {
        for (; !qn.done; Jn++, qn = or.next()) qn = Kn(ur, qn.value, Or), qn !== null && (er = $e(qn, er, Jn), Qn === null ? Hr = qn : Qn.sibling = qn, Qn = qn);
        return Hr;
      }
      for (bn = ge(ur, bn); !qn.done; Jn++, qn = or.next()) qn = Mn(bn, ur, Jn, qn.value, Or), qn !== null && (b && qn.alternate !== null && bn.delete(qn.key === null ? Jn : qn.key), er = $e(qn, er, Jn), Qn === null ? Hr = qn : Qn.sibling = qn, Qn = qn);
      return b && bn.forEach(function(mb) {
        return D(ur, mb);
      }), Hr;
    }
    return function(ur, er, or, Or) {
      var Hr = typeof or == "object" && or !== null && or.type === P && or.key === null;
      Hr && (or = or.props.children);
      var Qn = typeof or == "object" && or !== null;
      if (Qn) switch (or.$$typeof) {
        case T:
          e: {
            for (Qn = or.key, Hr = er; Hr !== null; ) {
              if (Hr.key === Qn) {
                switch (Hr.tag) {
                  case 7:
                    if (or.type === P) {
                      H(ur, Hr.sibling), er = Pe(Hr, or.props.children), er.return = ur, ur = er;
                      break e;
                    }
                    break;
                  default:
                    if (Hr.elementType === or.type) {
                      H(ur, Hr.sibling), er = Pe(Hr, or.props), er.ref = ql(ur, Hr, or), er.return = ur, ur = er;
                      break e;
                    }
                }
                H(ur, Hr);
                break;
              } else D(ur, Hr);
              Hr = Hr.sibling;
            }
            or.type === P ? (er = El(or.props.children, ur.mode, Or, or.key), er.return = ur, ur = er) : (Or = eh(or.type, or.key, or.props, null, ur.mode, Or), Or.ref = ql(ur, er, or), Or.return = ur, ur = Or);
          }
          return ht(ur);
        case F:
          e: {
            for (Hr = or.key; er !== null; ) {
              if (er.key === Hr) if (er.tag === 4 && er.stateNode.containerInfo === or.containerInfo && er.stateNode.implementation === or.implementation) {
                H(ur, er.sibling), er = Pe(er, or.children || []), er.return = ur, ur = er;
                break e;
              } else {
                H(ur, er);
                break;
              }
              else D(ur, er);
              er = er.sibling;
            }
            er = yg(or, ur.mode, Or), er.return = ur, ur = er;
          }
          return ht(ur);
      }
      if (typeof or == "string" || typeof or == "number") return or = "" + or, er !== null && er.tag === 6 ? (H(ur, er.sibling), er = Pe(er, or), er.return = ur, ur = er) : (H(ur, er), er = mg(or, ur.mode, Or), er.return = ur, ur = er), ht(ur);
      if (Ql(or)) return Xn(ur, er, or, Or);
      if (X(or)) return Vn(ur, er, or, Or);
      if (Qn && Eu(ur, or), typeof or > "u" && !Hr) switch (ur.tag) {
        case 1:
        case 22:
        case 0:
        case 11:
        case 15:
          throw Error(n(152, ve(ur.type) || "Component"));
      }
      return H(ur, er);
    };
  }
  var Du = Mu(!0), Fu = Mu(!1), ml = {}, uo = xa(ml), Yi = xa(ml), Pu = xa(ml);
  function bo(b) {
    if (b === ml) throw Error(n(174));
    return b;
  }
  function yl(b, D) {
    switch (On(Pu, D), On(Yi, b), On(uo, ml), b = D.nodeType, b) {
      case 9:
      case 11:
        D = (D = D.documentElement) ? D.namespaceURI : at(null, "");
        break;
      default:
        b = b === 8 ? D.parentNode : D, D = b.namespaceURI || null, b = b.tagName, D = at(D, b);
    }
    Yn(uo), On(uo, D);
  }
  function Cl() {
    Yn(uo), Yn(Yi), Yn(Pu);
  }
  function yp(b) {
    bo(Pu.current);
    var D = bo(uo.current), H = at(D, b.type);
    D !== H && (On(Yi, b), On(uo, H));
  }
  function Ac(b) {
    Yi.current === b && (Yn(uo), Yn(Yi));
  }
  var Xi = xa(0);
  function Iu(b) {
    for (var D = b; D !== null; ) {
      if (D.tag === 13) {
        var H = D.memoizedState;
        if (H !== null && (H = H.dehydrated, H === null || H.data === "$?" || H.data === "$!")) return D;
      } else if (D.tag === 19 && D.memoizedProps.revealOrder !== void 0) {
        if (D.flags & 64) return D;
      } else if (D.child !== null) {
        D.child.return = D, D = D.child;
        continue;
      }
      if (D === b) break;
      for (; D.sibling === null; ) {
        if (D.return === null || D.return === b) return null;
        D = D.return;
      }
      D.sibling.return = D.return, D = D.sibling;
    }
    return null;
  }
  var us = null, Hs = null, cs = !1;
  function Vf(b, D) {
    var H = fs(5, null, null, 0);
    H.elementType = "DELETED", H.type = "DELETED", H.stateNode = D, H.return = b, H.flags = 8, b.lastEffect !== null ? (b.lastEffect.nextEffect = H, b.lastEffect = H) : b.firstEffect = b.lastEffect = H;
  }
  function Ed(b, D) {
    switch (b.tag) {
      case 5:
        var H = b.type;
        return D = D.nodeType !== 1 || H.toLowerCase() !== D.nodeName.toLowerCase() ? null : D, D !== null ? (b.stateNode = D, !0) : !1;
      case 6:
        return D = b.pendingProps === "" || D.nodeType !== 3 ? null : D, D !== null ? (b.stateNode = D, !0) : !1;
      case 13:
        return !1;
      default:
        return !1;
    }
  }
  function bl(b) {
    if (cs) {
      var D = Hs;
      if (D) {
        var H = D;
        if (!Ed(b, D)) {
          if (D = ll(H.nextSibling), !D || !Ed(b, D)) {
            b.flags = b.flags & -1025 | 2, cs = !1, us = b;
            return;
          }
          Vf(us, H);
        }
        us = b, Hs = ll(D.firstChild);
      } else b.flags = b.flags & -1025 | 2, cs = !1, us = b;
    }
  }
  function Ec(b) {
    for (b = b.return; b !== null && b.tag !== 5 && b.tag !== 3 && b.tag !== 13; ) b = b.return;
    us = b;
  }
  function R(b) {
    if (b !== us) return !1;
    if (!cs) return Ec(b), cs = !0, !1;
    var D = b.type;
    if (b.tag !== 5 || D !== "head" && D !== "body" && !xu(D, b.memoizedProps)) for (D = Hs; D; ) Vf(b, D), D = ll(D.nextSibling);
    if (Ec(b), b.tag === 13) {
      if (b = b.memoizedState, b = b !== null ? b.dehydrated : null, !b) throw Error(n(317));
      e: {
        for (b = b.nextSibling, D = 0; b; ) {
          if (b.nodeType === 8) {
            var H = b.data;
            if (H === "/$") {
              if (D === 0) {
                Hs = ll(b.nextSibling);
                break e;
              }
              D--;
            } else H !== "$" && H !== "$!" && H !== "$?" || D++;
          }
          b = b.nextSibling;
        }
        Hs = null;
      }
    } else Hs = us ? ll(b.stateNode.nextSibling) : null;
    return !0;
  }
  function B() {
    Hs = us = null, cs = !1;
  }
  var J = [];
  function de() {
    for (var b = 0; b < J.length; b++) J[b]._workInProgressVersionPrimary = null;
    J.length = 0;
  }
  var pe = x.ReactCurrentDispatcher, ye = x.ReactCurrentBatchConfig, ke = 0, Ee = null, He = null, Ke = null, Qe = !1, yt = !1;
  function mt() {
    throw Error(n(321));
  }
  function Bt(b, D) {
    if (D === null) return !1;
    for (var H = 0; H < D.length && H < b.length; H++) if (!Eo(b[H], D[H])) return !1;
    return !0;
  }
  function Zt(b, D, H, ge, Pe, $e) {
    if (ke = $e, Ee = D, D.memoizedState = null, D.updateQueue = null, D.lanes = 0, pe.current = b === null || b.memoizedState === null ? ga : ro, b = H(ge, Pe), yt) {
      $e = 0;
      do {
        if (yt = !1, !(25 > $e)) throw Error(n(301));
        $e += 1, Ke = He = null, D.updateQueue = null, pe.current = ja, b = H(ge, Pe);
      } while (yt);
    }
    if (pe.current = ua, D = He !== null && He.next !== null, ke = 0, Ke = He = Ee = null, Qe = !1, D) throw Error(n(300));
    return b;
  }
  function qe() {
    var b = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
    return Ke === null ? Ee.memoizedState = Ke = b : Ke = Ke.next = b, Ke;
  }
  function Et() {
    if (He === null) {
      var b = Ee.alternate;
      b = b !== null ? b.memoizedState : null;
    } else b = He.next;
    var D = Ke === null ? Ee.memoizedState : Ke.next;
    if (D !== null) Ke = D, He = b;
    else {
      if (b === null) throw Error(n(310));
      He = b, b = { memoizedState: He.memoizedState, baseState: He.baseState, baseQueue: He.baseQueue, queue: He.queue, next: null }, Ke === null ? Ee.memoizedState = Ke = b : Ke = Ke.next = b;
    }
    return Ke;
  }
  function Dt(b, D) {
    return typeof D == "function" ? D(b) : D;
  }
  function Xt(b) {
    var D = Et(), H = D.queue;
    if (H === null) throw Error(n(311));
    H.lastRenderedReducer = b;
    var ge = He, Pe = ge.baseQueue, $e = H.pending;
    if ($e !== null) {
      if (Pe !== null) {
        var ht = Pe.next;
        Pe.next = $e.next, $e.next = ht;
      }
      ge.baseQueue = Pe = $e, H.pending = null;
    }
    if (Pe !== null) {
      Pe = Pe.next, ge = ge.baseState;
      var Mt = ht = $e = null, Jt = Pe;
      do {
        var vr = Jt.lane;
        if ((ke & vr) === vr) Mt !== null && (Mt = Mt.next = { lane: 0, action: Jt.action, eagerReducer: Jt.eagerReducer, eagerState: Jt.eagerState, next: null }), ge = Jt.eagerReducer === b ? Jt.eagerState : b(ge, Jt.action);
        else {
          var vn = {
            lane: vr,
            action: Jt.action,
            eagerReducer: Jt.eagerReducer,
            eagerState: Jt.eagerState,
            next: null
          };
          Mt === null ? (ht = Mt = vn, $e = ge) : Mt = Mt.next = vn, Ee.lanes |= vr, Dc |= vr;
        }
        Jt = Jt.next;
      } while (Jt !== null && Jt !== Pe);
      Mt === null ? $e = ge : Mt.next = ht, Eo(ge, D.memoizedState) || (Ri = !0), D.memoizedState = ge, D.baseState = $e, D.baseQueue = Mt, H.lastRenderedState = ge;
    }
    return [D.memoizedState, H.dispatch];
  }
  function Kt(b) {
    var D = Et(), H = D.queue;
    if (H === null) throw Error(n(311));
    H.lastRenderedReducer = b;
    var ge = H.dispatch, Pe = H.pending, $e = D.memoizedState;
    if (Pe !== null) {
      H.pending = null;
      var ht = Pe = Pe.next;
      do
        $e = b($e, ht.action), ht = ht.next;
      while (ht !== Pe);
      Eo($e, D.memoizedState) || (Ri = !0), D.memoizedState = $e, D.baseQueue === null && (D.baseState = $e), H.lastRenderedState = $e;
    }
    return [$e, ge];
  }
  function Vt(b, D, H) {
    var ge = D._getVersion;
    ge = ge(D._source);
    var Pe = D._workInProgressVersionPrimary;
    if (Pe !== null ? b = Pe === ge : (b = b.mutableReadLanes, (b = (ke & b) === b) && (D._workInProgressVersionPrimary = ge, J.push(D))), b) return H(D._source);
    throw J.push(D), Error(n(350));
  }
  function wr(b, D, H, ge) {
    var Pe = xo;
    if (Pe === null) throw Error(n(349));
    var $e = D._getVersion, ht = $e(D._source), Mt = pe.current, Jt = Mt.useState(function() {
      return Vt(Pe, D, H);
    }), vr = Jt[1], vn = Jt[0];
    Jt = Ke;
    var Kn = b.memoizedState, jr = Kn.refs, Mn = jr.getSnapshot, Xn = Kn.source;
    Kn = Kn.subscribe;
    var Vn = Ee;
    return b.memoizedState = { refs: jr, source: D, subscribe: ge }, Mt.useEffect(function() {
      jr.getSnapshot = H, jr.setSnapshot = vr;
      var ur = $e(D._source);
      if (!Eo(ht, ur)) {
        ur = H(D._source), Eo(vn, ur) || (vr(ur), ur = Al(Vn), Pe.mutableReadLanes |= ur & Pe.pendingLanes), ur = Pe.mutableReadLanes, Pe.entangledLanes |= ur;
        for (var er = Pe.entanglements, or = ur; 0 < or; ) {
          var Or = 31 - Ln(or), Hr = 1 << Or;
          er[Or] |= ur, or &= ~Hr;
        }
      }
    }, [H, D, ge]), Mt.useEffect(function() {
      return ge(D._source, function() {
        var ur = jr.getSnapshot, er = jr.setSnapshot;
        try {
          er(ur(D._source));
          var or = Al(Vn);
          Pe.mutableReadLanes |= or & Pe.pendingLanes;
        } catch (Or) {
          er(function() {
            throw Or;
          });
        }
      });
    }, [D, ge]), Eo(Mn, H) && Eo(Xn, D) && Eo(Kn, ge) || (b = { pending: null, dispatch: null, lastRenderedReducer: Dt, lastRenderedState: vn }, b.dispatch = vr = ea.bind(null, Ee, b), Jt.queue = b, Jt.baseQueue = null, vn = Vt(Pe, D, H), Jt.memoizedState = Jt.baseState = vn), vn;
  }
  function Wr(b, D, H) {
    var ge = Et();
    return wr(ge, b, D, H);
  }
  function Xr(b) {
    var D = qe();
    return typeof b == "function" && (b = b()), D.memoizedState = D.baseState = b, b = D.queue = { pending: null, dispatch: null, lastRenderedReducer: Dt, lastRenderedState: b }, b = b.dispatch = ea.bind(null, Ee, b), [D.memoizedState, b];
  }
  function _r(b, D, H, ge) {
    return b = { tag: b, create: D, destroy: H, deps: ge, next: null }, D = Ee.updateQueue, D === null ? (D = { lastEffect: null }, Ee.updateQueue = D, D.lastEffect = b.next = b) : (H = D.lastEffect, H === null ? D.lastEffect = b.next = b : (ge = H.next, H.next = b, b.next = ge, D.lastEffect = b)), b;
  }
  function en(b) {
    var D = qe();
    return b = { current: b }, D.memoizedState = b;
  }
  function Qr() {
    return Et().memoizedState;
  }
  function En(b, D, H, ge) {
    var Pe = qe();
    Ee.flags |= b, Pe.memoizedState = _r(1 | D, H, void 0, ge === void 0 ? null : ge);
  }
  function qr(b, D, H, ge) {
    var Pe = Et();
    ge = ge === void 0 ? null : ge;
    var $e = void 0;
    if (He !== null) {
      var ht = He.memoizedState;
      if ($e = ht.destroy, ge !== null && Bt(ge, ht.deps)) {
        _r(D, H, $e, ge);
        return;
      }
    }
    Ee.flags |= b, Pe.memoizedState = _r(1 | D, H, $e, ge);
  }
  function An(b, D) {
    return En(516, 4, b, D);
  }
  function ti(b, D) {
    return qr(516, 4, b, D);
  }
  function $i(b, D) {
    return qr(4, 2, b, D);
  }
  function ui(b, D) {
    if (typeof D == "function") return b = b(), D(b), function() {
      D(null);
    };
    if (D != null) return b = b(), D.current = b, function() {
      D.current = null;
    };
  }
  function Nr(b, D, H) {
    return H = H != null ? H.concat([b]) : null, qr(4, 2, ui.bind(null, D, b), H);
  }
  function un() {
  }
  function Nn(b, D) {
    var H = Et();
    D = D === void 0 ? null : D;
    var ge = H.memoizedState;
    return ge !== null && D !== null && Bt(D, ge[1]) ? ge[0] : (H.memoizedState = [b, D], b);
  }
  function xn(b, D) {
    var H = Et();
    D = D === void 0 ? null : D;
    var ge = H.memoizedState;
    return ge !== null && D !== null && Bt(D, ge[1]) ? ge[0] : (b = b(), H.memoizedState = [b, D], b);
  }
  function wi(b, D) {
    var H = fl();
    hl(98 > H ? 98 : H, function() {
      b(!0);
    }), hl(97 < H ? 97 : H, function() {
      var ge = ye.transition;
      ye.transition = 1;
      try {
        b(!1), D();
      } finally {
        ye.transition = ge;
      }
    });
  }
  function ea(b, D, H) {
    var ge = Ko(), Pe = Al(b), $e = { lane: Pe, action: H, eagerReducer: null, eagerState: null, next: null }, ht = D.pending;
    if (ht === null ? $e.next = $e : ($e.next = ht.next, ht.next = $e), D.pending = $e, ht = b.alternate, b === Ee || ht !== null && ht === Ee) yt = Qe = !0;
    else {
      if (b.lanes === 0 && (ht === null || ht.lanes === 0) && (ht = D.lastRenderedReducer, ht !== null)) try {
        var Mt = D.lastRenderedState, Jt = ht(Mt, H);
        if ($e.eagerReducer = ht, $e.eagerState = Jt, Eo(Jt, Mt)) return;
      } catch {
      } finally {
      }
      Ou(b, Pe, ge);
    }
  }
  var ua = { readContext: lo, useCallback: mt, useContext: mt, useEffect: mt, useImperativeHandle: mt, useLayoutEffect: mt, useMemo: mt, useReducer: mt, useRef: mt, useState: mt, useDebugValue: mt, useDeferredValue: mt, useTransition: mt, useMutableSource: mt, useOpaqueIdentifier: mt, unstable_isNewReconciler: !1 }, ga = { readContext: lo, useCallback: function(b, D) {
    return qe().memoizedState = [b, D === void 0 ? null : D], b;
  }, useContext: lo, useEffect: An, useImperativeHandle: function(b, D, H) {
    return H = H != null ? H.concat([b]) : null, En(4, 2, ui.bind(
      null,
      D,
      b
    ), H);
  }, useLayoutEffect: function(b, D) {
    return En(4, 2, b, D);
  }, useMemo: function(b, D) {
    var H = qe();
    return D = D === void 0 ? null : D, b = b(), H.memoizedState = [b, D], b;
  }, useReducer: function(b, D, H) {
    var ge = qe();
    return D = H !== void 0 ? H(D) : D, ge.memoizedState = ge.baseState = D, b = ge.queue = { pending: null, dispatch: null, lastRenderedReducer: b, lastRenderedState: D }, b = b.dispatch = ea.bind(null, Ee, b), [ge.memoizedState, b];
  }, useRef: en, useState: Xr, useDebugValue: un, useDeferredValue: function(b) {
    var D = Xr(b), H = D[0], ge = D[1];
    return An(function() {
      var Pe = ye.transition;
      ye.transition = 1;
      try {
        ge(b);
      } finally {
        ye.transition = Pe;
      }
    }, [b]), H;
  }, useTransition: function() {
    var b = Xr(!1), D = b[0];
    return b = wi.bind(null, b[1]), en(b), [b, D];
  }, useMutableSource: function(b, D, H) {
    var ge = qe();
    return ge.memoizedState = { refs: { getSnapshot: D, setSnapshot: null }, source: b, subscribe: H }, wr(ge, b, D, H);
  }, useOpaqueIdentifier: function() {
    if (cs) {
      var b = !1, D = yc(function() {
        throw b || (b = !0, H("r:" + (Ps++).toString(36))), Error(n(355));
      }), H = Xr(D)[1];
      return !(Ee.mode & 2) && (Ee.flags |= 516, _r(
        5,
        function() {
          H("r:" + (Ps++).toString(36));
        },
        void 0,
        null
      )), D;
    }
    return D = "r:" + (Ps++).toString(36), Xr(D), D;
  }, unstable_isNewReconciler: !1 }, ro = { readContext: lo, useCallback: Nn, useContext: lo, useEffect: ti, useImperativeHandle: Nr, useLayoutEffect: $i, useMemo: xn, useReducer: Xt, useRef: Qr, useState: function() {
    return Xt(Dt);
  }, useDebugValue: un, useDeferredValue: function(b) {
    var D = Xt(Dt), H = D[0], ge = D[1];
    return ti(function() {
      var Pe = ye.transition;
      ye.transition = 1;
      try {
        ge(b);
      } finally {
        ye.transition = Pe;
      }
    }, [b]), H;
  }, useTransition: function() {
    var b = Xt(Dt)[0];
    return [
      Qr().current,
      b
    ];
  }, useMutableSource: Wr, useOpaqueIdentifier: function() {
    return Xt(Dt)[0];
  }, unstable_isNewReconciler: !1 }, ja = { readContext: lo, useCallback: Nn, useContext: lo, useEffect: ti, useImperativeHandle: Nr, useLayoutEffect: $i, useMemo: xn, useReducer: Kt, useRef: Qr, useState: function() {
    return Kt(Dt);
  }, useDebugValue: un, useDeferredValue: function(b) {
    var D = Kt(Dt), H = D[0], ge = D[1];
    return ti(function() {
      var Pe = ye.transition;
      ye.transition = 1;
      try {
        ge(b);
      } finally {
        ye.transition = Pe;
      }
    }, [b]), H;
  }, useTransition: function() {
    var b = Kt(Dt)[0];
    return [
      Qr().current,
      b
    ];
  }, useMutableSource: Wr, useOpaqueIdentifier: function() {
    return Kt(Dt)[0];
  }, unstable_isNewReconciler: !1 }, co = x.ReactCurrentOwner, Ri = !1;
  function Li(b, D, H, ge) {
    D.child = b === null ? Fu(D, null, H, ge) : Du(D, b.child, H, ge);
  }
  function Bs(b, D, H, ge, Pe) {
    H = H.render;
    var $e = D.ref;
    return Ea(D, Pe), ge = Zt(b, D, H, ge, $e, Pe), b !== null && !Ri ? (D.updateQueue = b.updateQueue, D.flags &= -517, b.lanes &= ~Pe, eu(b, D, Pe)) : (D.flags |= 1, Li(b, D, ge, Pe), D.child);
  }
  function zf(b, D, H, ge, Pe, $e) {
    if (b === null) {
      var ht = H.type;
      return typeof ht == "function" && !Ep(ht) && ht.defaultProps === void 0 && H.compare === null && H.defaultProps === void 0 ? (D.tag = 15, D.type = ht, Lo(b, D, ht, ge, Pe, $e)) : (b = eh(H.type, null, ge, D, D.mode, $e), b.ref = D.ref, b.return = D, D.child = b);
    }
    return ht = b.child, !(Pe & $e) && (Pe = ht.memoizedProps, H = H.compare, H = H !== null ? H : pc, H(Pe, ge) && b.ref === D.ref) ? eu(b, D, $e) : (D.flags |= 1, b = Bu(ht, ge), b.ref = D.ref, b.return = D, D.child = b);
  }
  function Lo(b, D, H, ge, Pe, $e) {
    if (b !== null && pc(b.memoizedProps, ge) && b.ref === D.ref) if (Ri = !1, ($e & Pe) !== 0) b.flags & 16384 && (Ri = !0);
    else return D.lanes = b.lanes, eu(b, D, $e);
    return ko(b, D, H, ge, $e);
  }
  function ta(b, D, H) {
    var ge = D.pendingProps, Pe = ge.children, $e = b !== null ? b.memoizedState : null;
    if (ge.mode === "hidden" || ge.mode === "unstable-defer-without-hiding") if (!(D.mode & 4)) D.memoizedState = { baseLanes: 0 }, Rp(D, H);
    else if (H & 1073741824) D.memoizedState = { baseLanes: 0 }, Rp(D, $e !== null ? $e.baseLanes : H);
    else return b = $e !== null ? $e.baseLanes | H : H, D.lanes = D.childLanes = 1073741824, D.memoizedState = { baseLanes: b }, Rp(D, b), null;
    else $e !== null ? (ge = $e.baseLanes | H, D.memoizedState = null) : ge = H, Rp(D, ge);
    return Li(b, D, Pe, H), D.child;
  }
  function wo(b, D) {
    var H = D.ref;
    (b === null && H !== null || b !== null && b.ref !== H) && (D.flags |= 128);
  }
  function ko(b, D, H, ge, Pe) {
    var $e = Ta(H) ? ks : Ji.current;
    return $e = bi(D, $e), Ea(D, Pe), H = Zt(b, D, H, ge, $e, Pe), b !== null && !Ri ? (D.updateQueue = b.updateQueue, D.flags &= -517, b.lanes &= ~Pe, eu(b, D, Pe)) : (D.flags |= 1, Li(b, D, H, Pe), D.child);
  }
  function So(b, D, H, ge, Pe) {
    if (Ta(H)) {
      var $e = !0;
      Po(D);
    } else $e = !1;
    if (Ea(D, Pe), D.stateNode === null) b !== null && (b.alternate = null, D.alternate = null, D.flags |= 2), gl(D, H, ge), Ad(D, H, ge, Pe), ge = !0;
    else if (b === null) {
      var ht = D.stateNode, Mt = D.memoizedProps;
      ht.props = Mt;
      var Jt = ht.context, vr = H.contextType;
      typeof vr == "object" && vr !== null ? vr = lo(vr) : (vr = Ta(H) ? ks : Ji.current, vr = bi(D, vr));
      var vn = H.getDerivedStateFromProps, Kn = typeof vn == "function" || typeof ht.getSnapshotBeforeUpdate == "function";
      Kn || typeof ht.UNSAFE_componentWillReceiveProps != "function" && typeof ht.componentWillReceiveProps != "function" || (Mt !== ge || Jt !== vr) && Rd(D, ht, ge, vr), yo = !1;
      var jr = D.memoizedState;
      ht.state = jr, Gs(D, ge, ht, Pe), Jt = D.memoizedState, Mt !== ge || jr !== Jt || Na.current || yo ? (typeof vn == "function" && (Au(D, H, vn, ge), Jt = D.memoizedState), (Mt = yo || Rc(D, H, Mt, ge, jr, Jt, vr)) ? (Kn || typeof ht.UNSAFE_componentWillMount != "function" && typeof ht.componentWillMount != "function" || (typeof ht.componentWillMount == "function" && ht.componentWillMount(), typeof ht.UNSAFE_componentWillMount == "function" && ht.UNSAFE_componentWillMount()), typeof ht.componentDidMount == "function" && (D.flags |= 4)) : (typeof ht.componentDidMount == "function" && (D.flags |= 4), D.memoizedProps = ge, D.memoizedState = Jt), ht.props = ge, ht.state = Jt, ht.context = vr, ge = Mt) : (typeof ht.componentDidMount == "function" && (D.flags |= 4), ge = !1);
    } else {
      ht = D.stateNode, xd(b, D), Mt = D.memoizedProps, vr = D.type === D.elementType ? Mt : Aa(D.type, Mt), ht.props = vr, Kn = D.pendingProps, jr = ht.context, Jt = H.contextType, typeof Jt == "object" && Jt !== null ? Jt = lo(Jt) : (Jt = Ta(H) ? ks : Ji.current, Jt = bi(D, Jt));
      var Mn = H.getDerivedStateFromProps;
      (vn = typeof Mn == "function" || typeof ht.getSnapshotBeforeUpdate == "function") || typeof ht.UNSAFE_componentWillReceiveProps != "function" && typeof ht.componentWillReceiveProps != "function" || (Mt !== Kn || jr !== Jt) && Rd(D, ht, ge, Jt), yo = !1, jr = D.memoizedState, ht.state = jr, Gs(D, ge, ht, Pe);
      var Xn = D.memoizedState;
      Mt !== Kn || jr !== Xn || Na.current || yo ? (typeof Mn == "function" && (Au(D, H, Mn, ge), Xn = D.memoizedState), (vr = yo || Rc(D, H, vr, ge, jr, Xn, Jt)) ? (vn || typeof ht.UNSAFE_componentWillUpdate != "function" && typeof ht.componentWillUpdate != "function" || (typeof ht.componentWillUpdate == "function" && ht.componentWillUpdate(
        ge,
        Xn,
        Jt
      ), typeof ht.UNSAFE_componentWillUpdate == "function" && ht.UNSAFE_componentWillUpdate(ge, Xn, Jt)), typeof ht.componentDidUpdate == "function" && (D.flags |= 4), typeof ht.getSnapshotBeforeUpdate == "function" && (D.flags |= 256)) : (typeof ht.componentDidUpdate != "function" || Mt === b.memoizedProps && jr === b.memoizedState || (D.flags |= 4), typeof ht.getSnapshotBeforeUpdate != "function" || Mt === b.memoizedProps && jr === b.memoizedState || (D.flags |= 256), D.memoizedProps = ge, D.memoizedState = Xn), ht.props = ge, ht.state = Xn, ht.context = Jt, ge = vr) : (typeof ht.componentDidUpdate != "function" || Mt === b.memoizedProps && jr === b.memoizedState || (D.flags |= 4), typeof ht.getSnapshotBeforeUpdate != "function" || Mt === b.memoizedProps && jr === b.memoizedState || (D.flags |= 256), ge = !1);
    }
    return wl(b, D, H, ge, $e, Pe);
  }
  function wl(b, D, H, ge, Pe, $e) {
    wo(b, D);
    var ht = (D.flags & 64) !== 0;
    if (!ge && !ht) return Pe && If(D, H, !1), eu(b, D, $e);
    ge = D.stateNode, co.current = D;
    var Mt = ht && typeof H.getDerivedStateFromError != "function" ? null : ge.render();
    return D.flags |= 1, b !== null && ht ? (D.child = Du(D, b.child, null, $e), D.child = Du(D, null, Mt, $e)) : Li(b, D, Mt, $e), D.memoizedState = ge.state, Pe && If(D, H, !0), D.child;
  }
  function Sl(b) {
    var D = b.stateNode;
    D.pendingContext ? ul(b, D.pendingContext, D.pendingContext !== D.context) : D.context && ul(b, D.context, !1), yl(b, D.containerInfo);
  }
  var Zi = { dehydrated: null, retryLane: 0 };
  function Zo(b, D, H) {
    var ge = D.pendingProps, Pe = Xi.current, $e = !1, ht;
    return (ht = (D.flags & 64) !== 0) || (ht = b !== null && b.memoizedState === null ? !1 : (Pe & 2) !== 0), ht ? ($e = !0, D.flags &= -65) : b !== null && b.memoizedState === null || ge.fallback === void 0 || ge.unstable_avoidThisFallback === !0 || (Pe |= 1), On(Xi, Pe & 1), b === null ? (ge.fallback !== void 0 && bl(D), b = ge.children, Pe = ge.fallback, $e ? (b = Wf(D, b, Pe, H), D.child.memoizedState = { baseLanes: H }, D.memoizedState = Zi, b) : typeof ge.unstable_expectedLoadTime == "number" ? (b = Wf(D, b, Pe, H), D.child.memoizedState = { baseLanes: H }, D.memoizedState = Zi, D.lanes = 33554432, b) : (H = kc({ mode: "visible", children: b }, D.mode, H, null), H.return = D, D.child = H)) : b.memoizedState !== null ? $e ? (ge = Lu(b, D, ge.children, ge.fallback, H), $e = D.child, Pe = b.child.memoizedState, $e.memoizedState = Pe === null ? { baseLanes: H } : { baseLanes: Pe.baseLanes | H }, $e.childLanes = b.childLanes & ~H, D.memoizedState = Zi, ge) : (H = no(b, D, ge.children, H), D.memoizedState = null, H) : $e ? (ge = Lu(b, D, ge.children, ge.fallback, H), $e = D.child, Pe = b.child.memoizedState, $e.memoizedState = Pe === null ? { baseLanes: H } : { baseLanes: Pe.baseLanes | H }, $e.childLanes = b.childLanes & ~H, D.memoizedState = Zi, ge) : (H = no(b, D, ge.children, H), D.memoizedState = null, H);
  }
  function Wf(b, D, H, ge) {
    var Pe = b.mode, $e = b.child;
    return D = { mode: "hidden", children: D }, !(Pe & 2) && $e !== null ? ($e.childLanes = 0, $e.pendingProps = D) : $e = kc(D, Pe, 0, null), H = El(H, Pe, ge, null), $e.return = b, H.return = b, $e.sibling = H, b.child = $e, H;
  }
  function no(b, D, H, ge) {
    var Pe = b.child;
    return b = Pe.sibling, H = Bu(Pe, { mode: "visible", children: H }), !(D.mode & 2) && (H.lanes = ge), H.return = D, H.sibling = null, b !== null && (b.nextEffect = null, b.flags = 8, D.firstEffect = D.lastEffect = b), D.child = H;
  }
  function Lu(b, D, H, ge, Pe) {
    var $e = D.mode, ht = b.child;
    b = ht.sibling;
    var Mt = { mode: "hidden", children: H };
    return !($e & 2) && D.child !== ht ? (H = D.child, H.childLanes = 0, H.pendingProps = Mt, ht = H.lastEffect, ht !== null ? (D.firstEffect = H.firstEffect, D.lastEffect = ht, ht.nextEffect = null) : D.firstEffect = D.lastEffect = null) : H = Bu(ht, Mt), b !== null ? ge = Bu(b, ge) : (ge = El(ge, $e, Pe, null), ge.flags |= 2), ge.return = D, H.return = D, H.sibling = ge, D.child = H, ge;
  }
  function xi(b, D) {
    b.lanes |= D;
    var H = b.alternate;
    H !== null && (H.lanes |= D), Bf(b.return, D);
  }
  function Md(b, D, H, ge, Pe, $e) {
    var ht = b.memoizedState;
    ht === null ? b.memoizedState = { isBackwards: D, rendering: null, renderingStartTime: 0, last: ge, tail: H, tailMode: Pe, lastEffect: $e } : (ht.isBackwards = D, ht.rendering = null, ht.renderingStartTime = 0, ht.last = ge, ht.tail = H, ht.tailMode = Pe, ht.lastEffect = $e);
  }
  function tb(b, D, H) {
    var ge = D.pendingProps, Pe = ge.revealOrder, $e = ge.tail;
    if (Li(b, D, ge.children, H), ge = Xi.current, ge & 2) ge = ge & 1 | 2, D.flags |= 64;
    else {
      if (b !== null && b.flags & 64) e: for (b = D.child; b !== null; ) {
        if (b.tag === 13) b.memoizedState !== null && xi(b, H);
        else if (b.tag === 19) xi(b, H);
        else if (b.child !== null) {
          b.child.return = b, b = b.child;
          continue;
        }
        if (b === D) break e;
        for (; b.sibling === null; ) {
          if (b.return === null || b.return === D) break e;
          b = b.return;
        }
        b.sibling.return = b.return, b = b.sibling;
      }
      ge &= 1;
    }
    if (On(Xi, ge), !(D.mode & 2)) D.memoizedState = null;
    else switch (Pe) {
      case "forwards":
        for (H = D.child, Pe = null; H !== null; ) b = H.alternate, b !== null && Iu(b) === null && (Pe = H), H = H.sibling;
        H = Pe, H === null ? (Pe = D.child, D.child = null) : (Pe = H.sibling, H.sibling = null), Md(D, !1, Pe, H, $e, D.lastEffect);
        break;
      case "backwards":
        for (H = null, Pe = D.child, D.child = null; Pe !== null; ) {
          if (b = Pe.alternate, b !== null && Iu(b) === null) {
            D.child = Pe;
            break;
          }
          b = Pe.sibling, Pe.sibling = H, H = Pe, Pe = b;
        }
        Md(D, !0, H, null, $e, D.lastEffect);
        break;
      case "together":
        Md(D, !1, null, null, void 0, D.lastEffect);
        break;
      default:
        D.memoizedState = null;
    }
    return D.child;
  }
  function eu(b, D, H) {
    if (b !== null && (D.dependencies = b.dependencies), Dc |= D.lanes, H & D.childLanes) {
      if (b !== null && D.child !== b.child) throw Error(n(153));
      if (D.child !== null) {
        for (b = D.child, H = Bu(b, b.pendingProps), D.child = H, H.return = D; b.sibling !== null; ) b = b.sibling, H = H.sibling = Bu(b, b.pendingProps), H.return = D;
        H.sibling = null;
      }
      return D.child;
    }
    return null;
  }
  var Cp, Dd, uy, rg;
  Cp = function(b, D) {
    for (var H = D.child; H !== null; ) {
      if (H.tag === 5 || H.tag === 6) b.appendChild(H.stateNode);
      else if (H.tag !== 4 && H.child !== null) {
        H.child.return = H, H = H.child;
        continue;
      }
      if (H === D) break;
      for (; H.sibling === null; ) {
        if (H.return === null || H.return === D) return;
        H = H.return;
      }
      H.sibling.return = H.return, H = H.sibling;
    }
  }, Dd = function() {
  }, uy = function(b, D, H, ge) {
    var Pe = b.memoizedProps;
    if (Pe !== ge) {
      b = D.stateNode, bo(uo.current);
      var $e = null;
      switch (H) {
        case "input":
          Pe = K(b, Pe), ge = K(b, ge), $e = [];
          break;
        case "option":
          Pe = he(b, Pe), ge = he(b, ge), $e = [];
          break;
        case "select":
          Pe = t({}, Pe, { value: void 0 }), ge = t({}, ge, { value: void 0 }), $e = [];
          break;
        case "textarea":
          Pe = xe(b, Pe), ge = xe(b, ge), $e = [];
          break;
        default:
          typeof Pe.onClick != "function" && typeof ge.onClick == "function" && (b.onclick = mc);
      }
      Ot(H, ge);
      var ht;
      H = null;
      for (vr in Pe) if (!ge.hasOwnProperty(vr) && Pe.hasOwnProperty(vr) && Pe[vr] != null) if (vr === "style") {
        var Mt = Pe[vr];
        for (ht in Mt) Mt.hasOwnProperty(ht) && (H || (H = {}), H[ht] = "");
      } else vr !== "dangerouslySetInnerHTML" && vr !== "children" && vr !== "suppressContentEditableWarning" && vr !== "suppressHydrationWarning" && vr !== "autoFocus" && (u.hasOwnProperty(vr) ? $e || ($e = []) : ($e = $e || []).push(vr, null));
      for (vr in ge) {
        var Jt = ge[vr];
        if (Mt = Pe != null ? Pe[vr] : void 0, ge.hasOwnProperty(vr) && Jt !== Mt && (Jt != null || Mt != null)) if (vr === "style") if (Mt) {
          for (ht in Mt) !Mt.hasOwnProperty(ht) || Jt && Jt.hasOwnProperty(ht) || (H || (H = {}), H[ht] = "");
          for (ht in Jt) Jt.hasOwnProperty(ht) && Mt[ht] !== Jt[ht] && (H || (H = {}), H[ht] = Jt[ht]);
        } else H || ($e || ($e = []), $e.push(vr, H)), H = Jt;
        else vr === "dangerouslySetInnerHTML" ? (Jt = Jt ? Jt.__html : void 0, Mt = Mt ? Mt.__html : void 0, Jt != null && Mt !== Jt && ($e = $e || []).push(vr, Jt)) : vr === "children" ? typeof Jt != "string" && typeof Jt != "number" || ($e = $e || []).push(vr, "" + Jt) : vr !== "suppressContentEditableWarning" && vr !== "suppressHydrationWarning" && (u.hasOwnProperty(vr) ? (Jt != null && vr === "onScroll" && Vi("scroll", b), $e || Mt === Jt || ($e = [])) : typeof Jt == "object" && Jt !== null && Jt.$$typeof === z ? Jt.toString() : ($e = $e || []).push(vr, Jt));
      }
      H && ($e = $e || []).push(
        "style",
        H
      );
      var vr = $e;
      (D.updateQueue = vr) && (D.flags |= 4);
    }
  }, rg = function(b, D, H, ge) {
    H !== ge && (D.flags |= 4);
  };
  function _f(b, D) {
    if (!cs) switch (b.tailMode) {
      case "hidden":
        D = b.tail;
        for (var H = null; D !== null; ) D.alternate !== null && (H = D), D = D.sibling;
        H === null ? b.tail = null : H.sibling = null;
        break;
      case "collapsed":
        H = b.tail;
        for (var ge = null; H !== null; ) H.alternate !== null && (ge = H), H = H.sibling;
        ge === null ? D || b.tail === null ? b.tail = null : b.tail.sibling = null : ge.sibling = null;
    }
  }
  function rb(b, D, H) {
    var ge = D.pendingProps;
    switch (D.tag) {
      case 2:
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return null;
      case 1:
        return Ta(D.type) && Fo(), null;
      case 3:
        return Cl(), Yn(Na), Yn(Ji), de(), ge = D.stateNode, ge.pendingContext && (ge.context = ge.pendingContext, ge.pendingContext = null), (b === null || b.child === null) && (R(D) ? D.flags |= 4 : ge.hydrate || (D.flags |= 256)), Dd(D), null;
      case 5:
        Ac(D);
        var Pe = bo(Pu.current);
        if (H = D.type, b !== null && D.stateNode != null) uy(b, D, H, ge, Pe), b.ref !== D.ref && (D.flags |= 128);
        else {
          if (!ge) {
            if (D.stateNode === null) throw Error(n(166));
            return null;
          }
          if (b = bo(uo.current), R(D)) {
            ge = D.stateNode, H = D.type;
            var $e = D.memoizedProps;
            switch (ge[Do] = D, ge[yd] = $e, H) {
              case "dialog":
                Vi("cancel", ge), Vi("close", ge);
                break;
              case "iframe":
              case "object":
              case "embed":
                Vi("load", ge);
                break;
              case "video":
              case "audio":
                for (b = 0; b < Cu.length; b++) Vi(Cu[b], ge);
                break;
              case "source":
                Vi("error", ge);
                break;
              case "img":
              case "image":
              case "link":
                Vi("error", ge), Vi("load", ge);
                break;
              case "details":
                Vi("toggle", ge);
                break;
              case "input":
                ee(ge, $e), Vi("invalid", ge);
                break;
              case "select":
                ge._wrapperState = { wasMultiple: !!$e.multiple }, Vi("invalid", ge);
                break;
              case "textarea":
                Fe(ge, $e), Vi("invalid", ge);
            }
            Ot(H, $e), b = null;
            for (var ht in $e) $e.hasOwnProperty(ht) && (Pe = $e[ht], ht === "children" ? typeof Pe == "string" ? ge.textContent !== Pe && (b = ["children", Pe]) : typeof Pe == "number" && ge.textContent !== "" + Pe && (b = ["children", "" + Pe]) : u.hasOwnProperty(ht) && Pe != null && ht === "onScroll" && Vi("scroll", ge));
            switch (H) {
              case "input":
                we(ge), V(ge, $e, !0);
                break;
              case "textarea":
                we(ge), Be(ge);
                break;
              case "select":
              case "option":
                break;
              default:
                typeof $e.onClick == "function" && (ge.onclick = mc);
            }
            ge = b, D.updateQueue = ge, ge !== null && (D.flags |= 4);
          } else {
            switch (ht = Pe.nodeType === 9 ? Pe : Pe.ownerDocument, b === Je.html && (b = et(H)), b === Je.html ? H === "script" ? (b = ht.createElement("div"), b.innerHTML = "<script><\/script>", b = b.removeChild(b.firstChild)) : typeof ge.is == "string" ? b = ht.createElement(H, { is: ge.is }) : (b = ht.createElement(H), H === "select" && (ht = b, ge.multiple ? ht.multiple = !0 : ge.size && (ht.size = ge.size))) : b = ht.createElementNS(b, H), b[Do] = D, b[yd] = ge, Cp(b, D, !1, !1), D.stateNode = b, ht = Rt(H, ge), H) {
              case "dialog":
                Vi("cancel", b), Vi("close", b), Pe = ge;
                break;
              case "iframe":
              case "object":
              case "embed":
                Vi("load", b), Pe = ge;
                break;
              case "video":
              case "audio":
                for (Pe = 0; Pe < Cu.length; Pe++) Vi(Cu[Pe], b);
                Pe = ge;
                break;
              case "source":
                Vi("error", b), Pe = ge;
                break;
              case "img":
              case "image":
              case "link":
                Vi("error", b), Vi("load", b), Pe = ge;
                break;
              case "details":
                Vi("toggle", b), Pe = ge;
                break;
              case "input":
                ee(b, ge), Pe = K(b, ge), Vi("invalid", b);
                break;
              case "option":
                Pe = he(b, ge);
                break;
              case "select":
                b._wrapperState = { wasMultiple: !!ge.multiple }, Pe = t({}, ge, { value: void 0 }), Vi("invalid", b);
                break;
              case "textarea":
                Fe(b, ge), Pe = xe(b, ge), Vi("invalid", b);
                break;
              default:
                Pe = ge;
            }
            Ot(H, Pe);
            var Mt = Pe;
            for ($e in Mt) if (Mt.hasOwnProperty($e)) {
              var Jt = Mt[$e];
              $e === "style" ? Tt(b, Jt) : $e === "dangerouslySetInnerHTML" ? (Jt = Jt ? Jt.__html : void 0, Jt != null && Ne(b, Jt)) : $e === "children" ? typeof Jt == "string" ? (H !== "textarea" || Jt !== "") && Ie(b, Jt) : typeof Jt == "number" && Ie(b, "" + Jt) : $e !== "suppressContentEditableWarning" && $e !== "suppressHydrationWarning" && $e !== "autoFocus" && (u.hasOwnProperty($e) ? Jt != null && $e === "onScroll" && Vi("scroll", b) : Jt != null && E(b, $e, Jt, ht));
            }
            switch (H) {
              case "input":
                we(b), V(b, ge, !1);
                break;
              case "textarea":
                we(b), Be(b);
                break;
              case "option":
                ge.value != null && b.setAttribute("value", "" + be(ge.value));
                break;
              case "select":
                b.multiple = !!ge.multiple, $e = ge.value, $e != null ? me(b, !!ge.multiple, $e, !1) : ge.defaultValue != null && me(b, !!ge.multiple, ge.defaultValue, !0);
                break;
              default:
                typeof Pe.onClick == "function" && (b.onclick = mc);
            }
            sl(H, ge) && (D.flags |= 4);
          }
          D.ref !== null && (D.flags |= 128);
        }
        return null;
      case 6:
        if (b && D.stateNode != null) rg(b, D, b.memoizedProps, ge);
        else {
          if (typeof ge != "string" && D.stateNode === null) throw Error(n(166));
          H = bo(Pu.current), bo(uo.current), R(D) ? (ge = D.stateNode, H = D.memoizedProps, ge[Do] = D, ge.nodeValue !== H && (D.flags |= 4)) : (ge = (H.nodeType === 9 ? H : H.ownerDocument).createTextNode(ge), ge[Do] = D, D.stateNode = ge);
        }
        return null;
      case 13:
        return Yn(Xi), ge = D.memoizedState, D.flags & 64 ? (D.lanes = H, D) : (ge = ge !== null, H = !1, b === null ? D.memoizedProps.fallback !== void 0 && R(D) : H = b.memoizedState !== null, ge && !H && D.mode & 2 && (b === null && D.memoizedProps.unstable_avoidThisFallback !== !0 || Xi.current & 1 ? Ya === 0 && (Ya = 3) : ((Ya === 0 || Ya === 3) && (Ya = 4), xo === null || !(Dc & 134217727) && !(Tl & 134217727) || Ld(xo, io))), (ge || H) && (D.flags |= 4), null);
      case 4:
        return Cl(), Dd(D), b === null && Ef(D.stateNode.containerInfo), null;
      case 10:
        return Sd(D), null;
      case 17:
        return Ta(D.type) && Fo(), null;
      case 19:
        if (Yn(Xi), ge = D.memoizedState, ge === null) return null;
        if ($e = (D.flags & 64) !== 0, ht = ge.rendering, ht === null) if ($e) _f(ge, !1);
        else {
          if (Ya !== 0 || b !== null && b.flags & 64) for (b = D.child; b !== null; ) {
            if (ht = Iu(b), ht !== null) {
              for (D.flags |= 64, _f(ge, !1), $e = ht.updateQueue, $e !== null && (D.updateQueue = $e, D.flags |= 4), ge.lastEffect === null && (D.firstEffect = null), D.lastEffect = ge.lastEffect, ge = H, H = D.child; H !== null; ) $e = H, b = ge, $e.flags &= 2, $e.nextEffect = null, $e.firstEffect = null, $e.lastEffect = null, ht = $e.alternate, ht === null ? ($e.childLanes = 0, $e.lanes = b, $e.child = null, $e.memoizedProps = null, $e.memoizedState = null, $e.updateQueue = null, $e.dependencies = null, $e.stateNode = null) : ($e.childLanes = ht.childLanes, $e.lanes = ht.lanes, $e.child = ht.child, $e.memoizedProps = ht.memoizedProps, $e.memoizedState = ht.memoizedState, $e.updateQueue = ht.updateQueue, $e.type = ht.type, b = ht.dependencies, $e.dependencies = b === null ? null : { lanes: b.lanes, firstContext: b.firstContext }), H = H.sibling;
              return On(Xi, Xi.current & 1 | 2), D.child;
            }
            b = b.sibling;
          }
          ge.tail !== null && Ra() > Fc && (D.flags |= 64, $e = !0, _f(ge, !1), D.lanes = 33554432);
        }
        else {
          if (!$e) if (b = Iu(ht), b !== null) {
            if (D.flags |= 64, $e = !0, H = b.updateQueue, H !== null && (D.updateQueue = H, D.flags |= 4), _f(ge, !0), ge.tail === null && ge.tailMode === "hidden" && !ht.alternate && !cs) return D = D.lastEffect = ge.lastEffect, D !== null && (D.nextEffect = null), null;
          } else 2 * Ra() - ge.renderingStartTime > Fc && H !== 1073741824 && (D.flags |= 64, $e = !0, _f(ge, !1), D.lanes = 33554432);
          ge.isBackwards ? (ht.sibling = D.child, D.child = ht) : (H = ge.last, H !== null ? H.sibling = ht : D.child = ht, ge.last = ht);
        }
        return ge.tail !== null ? (H = ge.tail, ge.rendering = H, ge.tail = H.sibling, ge.lastEffect = D.lastEffect, ge.renderingStartTime = Ra(), H.sibling = null, D = Xi.current, On(Xi, $e ? D & 1 | 2 : D & 1), H) : null;
      case 23:
      case 24:
        return pg(), b !== null && b.memoizedState !== null != (D.memoizedState !== null) && ge.mode !== "unstable-defer-without-hiding" && (D.flags |= 4), null;
    }
    throw Error(n(156, D.tag));
  }
  function cy(b) {
    switch (b.tag) {
      case 1:
        Ta(b.type) && Fo();
        var D = b.flags;
        return D & 4096 ? (b.flags = D & -4097 | 64, b) : null;
      case 3:
        if (Cl(), Yn(Na), Yn(Ji), de(), D = b.flags, D & 64) throw Error(n(285));
        return b.flags = D & -4097 | 64, b;
      case 5:
        return Ac(b), null;
      case 13:
        return Yn(Xi), D = b.flags, D & 4096 ? (b.flags = D & -4097 | 64, b) : null;
      case 19:
        return Yn(Xi), null;
      case 4:
        return Cl(), null;
      case 10:
        return Sd(b), null;
      case 23:
      case 24:
        return pg(), null;
      default:
        return null;
    }
  }
  function ng(b, D) {
    try {
      var H = "", ge = D;
      do
        H += ue(ge), ge = ge.return;
      while (ge);
      var Pe = H;
    } catch ($e) {
      Pe = `
Error generating stack: ` + $e.message + `
` + $e.stack;
    }
    return { value: b, source: D, stack: Pe };
  }
  function ig(b, D) {
    try {
      console.error(D.value);
    } catch (H) {
      setTimeout(function() {
        throw H;
      });
    }
  }
  var dy = typeof WeakMap == "function" ? WeakMap : Map;
  function fy(b, D, H) {
    H = Co(-1, H), H.tag = 3, H.payload = { element: null };
    var ge = D.value;
    return H.callback = function() {
      Zf || (Zf = !0, ug = ge), ig(b, D);
    }, H;
  }
  function hy(b, D, H) {
    H = Co(-1, H), H.tag = 3;
    var ge = b.type.getDerivedStateFromError;
    if (typeof ge == "function") {
      var Pe = D.value;
      H.payload = function() {
        return ig(b, D), ge(Pe);
      };
    }
    var $e = b.stateNode;
    return $e !== null && typeof $e.componentDidCatch == "function" && (H.callback = function() {
      typeof ge != "function" && (Rl === null ? Rl = /* @__PURE__ */ new Set([this]) : Rl.add(this), ig(b, D));
      var ht = D.stack;
      this.componentDidCatch(D.value, { componentStack: ht !== null ? ht : "" });
    }), H;
  }
  var nb = typeof WeakSet == "function" ? WeakSet : Set;
  function py(b) {
    var D = b.ref;
    if (D !== null) if (typeof D == "function") try {
      D(null);
    } catch (H) {
      Hu(b, H);
    }
    else D.current = null;
  }
  function ib(b, D) {
    switch (D.tag) {
      case 0:
      case 11:
      case 15:
      case 22:
        return;
      case 1:
        if (D.flags & 256 && b !== null) {
          var H = b.memoizedProps, ge = b.memoizedState;
          b = D.stateNode, D = b.getSnapshotBeforeUpdate(D.elementType === D.type ? H : Aa(D.type, H), ge), b.__reactInternalSnapshotBeforeUpdate = D;
        }
        return;
      case 3:
        D.flags & 256 && md(D.stateNode.containerInfo);
        return;
      case 5:
      case 6:
      case 4:
      case 17:
        return;
    }
    throw Error(n(163));
  }
  function ag(b, D, H) {
    switch (H.tag) {
      case 0:
      case 11:
      case 15:
      case 22:
        if (D = H.updateQueue, D = D !== null ? D.lastEffect : null, D !== null) {
          b = D = D.next;
          do {
            if ((b.tag & 3) === 3) {
              var ge = b.create;
              b.destroy = ge();
            }
            b = b.next;
          } while (b !== D);
        }
        if (D = H.updateQueue, D = D !== null ? D.lastEffect : null, D !== null) {
          b = D = D.next;
          do {
            var Pe = b;
            ge = Pe.next, Pe = Pe.tag, Pe & 4 && Pe & 1 && (gg(H, b), Ay(H, b)), b = ge;
          } while (b !== D);
        }
        return;
      case 1:
        b = H.stateNode, H.flags & 4 && (D === null ? b.componentDidMount() : (ge = H.elementType === H.type ? D.memoizedProps : Aa(H.type, D.memoizedProps), b.componentDidUpdate(
          ge,
          D.memoizedState,
          b.__reactInternalSnapshotBeforeUpdate
        ))), D = H.updateQueue, D !== null && Td(H, D, b);
        return;
      case 3:
        if (D = H.updateQueue, D !== null) {
          if (b = null, H.child !== null) switch (H.child.tag) {
            case 5:
              b = H.child.stateNode;
              break;
            case 1:
              b = H.child.stateNode;
          }
          Td(H, D, b);
        }
        return;
      case 5:
        b = H.stateNode, D === null && H.flags & 4 && sl(H.type, H.memoizedProps) && b.focus();
        return;
      case 6:
        return;
      case 4:
        return;
      case 12:
        return;
      case 13:
        H.memoizedState === null && (H = H.alternate, H !== null && (H = H.memoizedState, H !== null && (H = H.dehydrated, H !== null && $t(H))));
        return;
      case 19:
      case 17:
      case 20:
      case 21:
      case 23:
      case 24:
        return;
    }
    throw Error(n(163));
  }
  function og(b, D) {
    for (var H = b; ; ) {
      if (H.tag === 5) {
        var ge = H.stateNode;
        if (D) ge = ge.style, typeof ge.setProperty == "function" ? ge.setProperty("display", "none", "important") : ge.display = "none";
        else {
          ge = H.stateNode;
          var Pe = H.memoizedProps.style;
          Pe = Pe != null && Pe.hasOwnProperty("display") ? Pe.display : null, ge.style.display = ct("display", Pe);
        }
      } else if (H.tag === 6) H.stateNode.nodeValue = D ? "" : H.memoizedProps;
      else if ((H.tag !== 23 && H.tag !== 24 || H.memoizedState === null || H === b) && H.child !== null) {
        H.child.return = H, H = H.child;
        continue;
      }
      if (H === b) break;
      for (; H.sibling === null; ) {
        if (H.return === null || H.return === b) return;
        H = H.return;
      }
      H.sibling.return = H.return, H = H.sibling;
    }
  }
  function vy(b, D) {
    if (cl && typeof cl.onCommitFiberUnmount == "function") try {
      cl.onCommitFiberUnmount(Tu, D);
    } catch {
    }
    switch (D.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
      case 22:
        if (b = D.updateQueue, b !== null && (b = b.lastEffect, b !== null)) {
          var H = b = b.next;
          do {
            var ge = H, Pe = ge.destroy;
            if (ge = ge.tag, Pe !== void 0) if (ge & 4) gg(D, H);
            else {
              ge = D;
              try {
                Pe();
              } catch ($e) {
                Hu(ge, $e);
              }
            }
            H = H.next;
          } while (H !== b);
        }
        break;
      case 1:
        if (py(D), b = D.stateNode, typeof b.componentWillUnmount == "function") try {
          b.props = D.memoizedProps, b.state = D.memoizedState, b.componentWillUnmount();
        } catch ($e) {
          Hu(
            D,
            $e
          );
        }
        break;
      case 5:
        py(D);
        break;
      case 4:
        Cy(b, D);
    }
  }
  function gy(b) {
    b.alternate = null, b.child = null, b.dependencies = null, b.firstEffect = null, b.lastEffect = null, b.memoizedProps = null, b.memoizedState = null, b.pendingProps = null, b.return = null, b.updateQueue = null;
  }
  function my(b) {
    return b.tag === 5 || b.tag === 3 || b.tag === 4;
  }
  function yy(b) {
    e: {
      for (var D = b.return; D !== null; ) {
        if (my(D)) break e;
        D = D.return;
      }
      throw Error(n(160));
    }
    var H = D;
    switch (D = H.stateNode, H.tag) {
      case 5:
        var ge = !1;
        break;
      case 3:
        D = D.containerInfo, ge = !0;
        break;
      case 4:
        D = D.containerInfo, ge = !0;
        break;
      default:
        throw Error(n(161));
    }
    H.flags & 16 && (Ie(D, ""), H.flags &= -17);
    e: t: for (H = b; ; ) {
      for (; H.sibling === null; ) {
        if (H.return === null || my(H.return)) {
          H = null;
          break e;
        }
        H = H.return;
      }
      for (H.sibling.return = H.return, H = H.sibling; H.tag !== 5 && H.tag !== 6 && H.tag !== 18; ) {
        if (H.flags & 2 || H.child === null || H.tag === 4) continue t;
        H.child.return = H, H = H.child;
      }
      if (!(H.flags & 2)) {
        H = H.stateNode;
        break e;
      }
    }
    ge ? Uf(b, H, D) : jf(b, H, D);
  }
  function Uf(b, D, H) {
    var ge = b.tag, Pe = ge === 5 || ge === 6;
    if (Pe) b = Pe ? b.stateNode : b.stateNode.instance, D ? H.nodeType === 8 ? H.parentNode.insertBefore(b, D) : H.insertBefore(b, D) : (H.nodeType === 8 ? (D = H.parentNode, D.insertBefore(b, H)) : (D = H, D.appendChild(b)), H = H._reactRootContainer, H != null || D.onclick !== null || (D.onclick = mc));
    else if (ge !== 4 && (b = b.child, b !== null)) for (Uf(b, D, H), b = b.sibling; b !== null; ) Uf(b, D, H), b = b.sibling;
  }
  function jf(b, D, H) {
    var ge = b.tag, Pe = ge === 5 || ge === 6;
    if (Pe) b = Pe ? b.stateNode : b.stateNode.instance, D ? H.insertBefore(b, D) : H.appendChild(b);
    else if (ge !== 4 && (b = b.child, b !== null)) for (jf(b, D, H), b = b.sibling; b !== null; ) jf(b, D, H), b = b.sibling;
  }
  function Cy(b, D) {
    for (var H = D, ge = !1, Pe, $e; ; ) {
      if (!ge) {
        ge = H.return;
        e: for (; ; ) {
          if (ge === null) throw Error(n(160));
          switch (Pe = ge.stateNode, ge.tag) {
            case 5:
              $e = !1;
              break e;
            case 3:
              Pe = Pe.containerInfo, $e = !0;
              break e;
            case 4:
              Pe = Pe.containerInfo, $e = !0;
              break e;
          }
          ge = ge.return;
        }
        ge = !0;
      }
      if (H.tag === 5 || H.tag === 6) {
        e: for (var ht = b, Mt = H, Jt = Mt; ; ) if (vy(ht, Jt), Jt.child !== null && Jt.tag !== 4) Jt.child.return = Jt, Jt = Jt.child;
        else {
          if (Jt === Mt) break e;
          for (; Jt.sibling === null; ) {
            if (Jt.return === null || Jt.return === Mt) break e;
            Jt = Jt.return;
          }
          Jt.sibling.return = Jt.return, Jt = Jt.sibling;
        }
        $e ? (ht = Pe, Mt = H.stateNode, ht.nodeType === 8 ? ht.parentNode.removeChild(Mt) : ht.removeChild(Mt)) : Pe.removeChild(H.stateNode);
      } else if (H.tag === 4) {
        if (H.child !== null) {
          Pe = H.stateNode.containerInfo, $e = !0, H.child.return = H, H = H.child;
          continue;
        }
      } else if (vy(b, H), H.child !== null) {
        H.child.return = H, H = H.child;
        continue;
      }
      if (H === D) break;
      for (; H.sibling === null; ) {
        if (H.return === null || H.return === D) return;
        H = H.return, H.tag === 4 && (ge = !1);
      }
      H.sibling.return = H.return, H = H.sibling;
    }
  }
  function sg(b, D) {
    switch (D.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
      case 22:
        var H = D.updateQueue;
        if (H = H !== null ? H.lastEffect : null, H !== null) {
          var ge = H = H.next;
          do
            (ge.tag & 3) === 3 && (b = ge.destroy, ge.destroy = void 0, b !== void 0 && b()), ge = ge.next;
          while (ge !== H);
        }
        return;
      case 1:
        return;
      case 5:
        if (H = D.stateNode, H != null) {
          ge = D.memoizedProps;
          var Pe = b !== null ? b.memoizedProps : ge;
          b = D.type;
          var $e = D.updateQueue;
          if (D.updateQueue = null, $e !== null) {
            for (H[yd] = ge, b === "input" && ge.type === "radio" && ge.name != null && oe(H, ge), Rt(b, Pe), D = Rt(b, ge), Pe = 0; Pe < $e.length; Pe += 2) {
              var ht = $e[Pe], Mt = $e[Pe + 1];
              ht === "style" ? Tt(H, Mt) : ht === "dangerouslySetInnerHTML" ? Ne(H, Mt) : ht === "children" ? Ie(H, Mt) : E(H, ht, Mt, D);
            }
            switch (b) {
              case "input":
                _(H, ge);
                break;
              case "textarea":
                Ve(H, ge);
                break;
              case "select":
                b = H._wrapperState.wasMultiple, H._wrapperState.wasMultiple = !!ge.multiple, $e = ge.value, $e != null ? me(H, !!ge.multiple, $e, !1) : b !== !!ge.multiple && (ge.defaultValue != null ? me(H, !!ge.multiple, ge.defaultValue, !0) : me(H, !!ge.multiple, ge.multiple ? [] : "", !1));
            }
          }
        }
        return;
      case 6:
        if (D.stateNode === null) throw Error(n(162));
        D.stateNode.nodeValue = D.memoizedProps;
        return;
      case 3:
        H = D.stateNode, H.hydrate && (H.hydrate = !1, $t(H.containerInfo));
        return;
      case 12:
        return;
      case 13:
        D.memoizedState !== null && ($f = Ra(), og(D.child, !0)), by(D);
        return;
      case 19:
        by(D);
        return;
      case 17:
        return;
      case 23:
      case 24:
        og(D, D.memoizedState !== null);
        return;
    }
    throw Error(n(163));
  }
  function by(b) {
    var D = b.updateQueue;
    if (D !== null) {
      b.updateQueue = null;
      var H = b.stateNode;
      H === null && (H = b.stateNode = new nb()), D.forEach(function(ge) {
        var Pe = cb.bind(null, b, ge);
        H.has(ge) || (H.add(ge), ge.then(Pe, Pe));
      });
    }
  }
  function ab(b, D) {
    return b !== null && (b = b.memoizedState, b === null || b.dehydrated !== null) ? (D = D.memoizedState, D !== null && D.dehydrated === null) : !1;
  }
  var Yf = Math.ceil, Fd = x.ReactCurrentDispatcher, Mc = x.ReactCurrentOwner, Zn = 0, xo = null, Ma = null, io = 0, xl = 0, Pd = xa(0), Ya = 0, fo = null, Vs = 0, Dc = 0, Tl = 0, lg = 0, Xf = null, $f = 0, Fc = 1 / 0;
  function Id() {
    Fc = Ra() + 500;
  }
  var Cn = null, Zf = !1, ug = null, Rl = null, ku = !1, Pc = null, Kf = 90, cg = [], dg = [], tu = null, Jf = 0, bp = null, wp = -1, ru = 0, Sp = 0, Qf = null, xp = !1;
  function Ko() {
    return Zn & 48 ? Ra() : wp !== -1 ? wp : wp = Ra();
  }
  function Al(b) {
    if (b = b.mode, !(b & 2)) return 1;
    if (!(b & 4)) return fl() === 99 ? 1 : 2;
    if (ru === 0 && (ru = Vs), pl.transition !== 0) {
      Sp !== 0 && (Sp = Xf !== null ? Xf.pendingLanes : 0), b = ru;
      var D = 4186112 & ~Sp;
      return D &= -D, D === 0 && (b = 4186112 & ~b, D = b & -b, D === 0 && (D = 8192)), D;
    }
    return b = fl(), Zn & 4 && b === 98 ? b = yn(12, ru) : (b = Fi(b), b = yn(b, ru)), b;
  }
  function Ou(b, D, H) {
    if (50 < Jf) throw Jf = 0, bp = null, Error(n(185));
    if (b = Tp(b, D), b === null) return null;
    Wn(b, D, H), b === xo && (Tl |= D, Ya === 4 && Ld(b, io));
    var ge = fl();
    D === 1 ? Zn & 8 && !(Zn & 48) ? hg(b) : (ds(b, H), Zn === 0 && (Id(), va())) : (!(Zn & 4) || ge !== 98 && ge !== 99 || (tu === null ? tu = /* @__PURE__ */ new Set([b]) : tu.add(b)), ds(b, H)), Xf = b;
  }
  function Tp(b, D) {
    b.lanes |= D;
    var H = b.alternate;
    for (H !== null && (H.lanes |= D), H = b, b = b.return; b !== null; ) b.childLanes |= D, H = b.alternate, H !== null && (H.childLanes |= D), H = b, b = b.return;
    return H.tag === 3 ? H.stateNode : null;
  }
  function ds(b, D) {
    for (var H = b.callbackNode, ge = b.suspendedLanes, Pe = b.pingedLanes, $e = b.expirationTimes, ht = b.pendingLanes; 0 < ht; ) {
      var Mt = 31 - Ln(ht), Jt = 1 << Mt, vr = $e[Mt];
      if (vr === -1) {
        if (!(Jt & ge) || Jt & Pe) {
          vr = D, ri(Jt);
          var vn = on;
          $e[Mt] = 10 <= vn ? vr + 250 : 6 <= vn ? vr + 5e3 : -1;
        }
      } else vr <= D && (b.expiredLanes |= Jt);
      ht &= ~Jt;
    }
    if (ge = pn(b, b === xo ? io : 0), D = on, ge === 0) H !== null && (H !== wd && bc(H), b.callbackNode = null, b.callbackPriority = 0);
    else {
      if (H !== null) {
        if (b.callbackPriority === D) return;
        H !== wd && bc(H);
      }
      D === 15 ? (H = hg.bind(null, b), ss === null ? (ss = [H], Zl = Yo(Sc, Xo)) : ss.push(H), H = wd) : D === 14 ? H = Kl(99, hg.bind(null, b)) : (H = Pi(D), H = Kl(H, fg.bind(null, b))), b.callbackPriority = D, b.callbackNode = H;
    }
  }
  function fg(b) {
    if (wp = -1, Sp = ru = 0, Zn & 48) throw Error(n(327));
    var D = b.callbackNode;
    if (Gu() && b.callbackNode !== D) return null;
    var H = pn(b, b === xo ? io : 0);
    if (H === 0) return null;
    var ge = H, Pe = Zn;
    Zn |= 16;
    var $e = kd();
    (xo !== b || io !== ge) && (Id(), Ic(b, ge));
    do
      try {
        Ty();
        break;
      } catch (Mt) {
        Ap(b, Mt);
      }
    while (!0);
    if (Hf(), Fd.current = $e, Zn = Pe, Ma !== null ? ge = 0 : (xo = null, io = 0, ge = Ya), Vs & Tl) Ic(b, 0);
    else if (ge !== 0) {
      if (ge === 2 && (Zn |= 64, b.hydrate && (b.hydrate = !1, md(b.containerInfo)), H = hi(b), H !== 0 && (ge = qf(b, H))), ge === 1) throw D = fo, Ic(b, 0), Ld(b, H), ds(b, Ra()), D;
      switch (b.finishedWork = b.current.alternate, b.finishedLanes = H, ge) {
        case 0:
        case 1:
          throw Error(n(345));
        case 2:
          Nu(b);
          break;
        case 3:
          if (Ld(b, H), (H & 62914560) === H && (ge = $f + 500 - Ra(), 10 < ge)) {
            if (pn(b, 0) !== 0) break;
            if (Pe = b.suspendedLanes, (Pe & H) !== H) {
              Ko(), b.pingedLanes |= b.suspendedLanes & Pe;
              break;
            }
            b.timeoutHandle = Yl(Nu.bind(null, b), ge);
            break;
          }
          Nu(b);
          break;
        case 4:
          if (Ld(b, H), (H & 4186112) === H) break;
          for (ge = b.eventTimes, Pe = -1; 0 < H; ) {
            var ht = 31 - Ln(H);
            $e = 1 << ht, ht = ge[ht], ht > Pe && (Pe = ht), H &= ~$e;
          }
          if (H = Pe, H = Ra() - H, H = (120 > H ? 120 : 480 > H ? 480 : 1080 > H ? 1080 : 1920 > H ? 1920 : 3e3 > H ? 3e3 : 4320 > H ? 4320 : 1960 * Yf(H / 1960)) - H, 10 < H) {
            b.timeoutHandle = Yl(Nu.bind(null, b), H);
            break;
          }
          Nu(b);
          break;
        case 5:
          Nu(b);
          break;
        default:
          throw Error(n(329));
      }
    }
    return ds(b, Ra()), b.callbackNode === D ? fg.bind(null, b) : null;
  }
  function Ld(b, D) {
    for (D &= ~lg, D &= ~Tl, b.suspendedLanes |= D, b.pingedLanes &= ~D, b = b.expirationTimes; 0 < D; ) {
      var H = 31 - Ln(D), ge = 1 << H;
      b[H] = -1, D &= ~ge;
    }
  }
  function hg(b) {
    if (Zn & 48) throw Error(n(327));
    if (Gu(), b === xo && b.expiredLanes & io) {
      var D = io, H = qf(b, D);
      Vs & Tl && (D = pn(b, D), H = qf(b, D));
    } else D = pn(b, 0), H = qf(b, D);
    if (b.tag !== 0 && H === 2 && (Zn |= 64, b.hydrate && (b.hydrate = !1, md(b.containerInfo)), D = hi(b), D !== 0 && (H = qf(b, D))), H === 1) throw H = fo, Ic(b, 0), Ld(b, D), ds(b, Ra()), H;
    return b.finishedWork = b.current.alternate, b.finishedLanes = D, Nu(b), ds(b, Ra()), null;
  }
  function ob() {
    if (tu !== null) {
      var b = tu;
      tu = null, b.forEach(function(D) {
        D.expiredLanes |= 24 & D.pendingLanes, ds(D, Ra());
      });
    }
    va();
  }
  function wy(b, D) {
    var H = Zn;
    Zn |= 1;
    try {
      return b(D);
    } finally {
      Zn = H, Zn === 0 && (Id(), va());
    }
  }
  function Sy(b, D) {
    var H = Zn;
    Zn &= -2, Zn |= 8;
    try {
      return b(D);
    } finally {
      Zn = H, Zn === 0 && (Id(), va());
    }
  }
  function Rp(b, D) {
    On(Pd, xl), xl |= D, Vs |= D;
  }
  function pg() {
    xl = Pd.current, Yn(Pd);
  }
  function Ic(b, D) {
    b.finishedWork = null, b.finishedLanes = 0;
    var H = b.timeoutHandle;
    if (H !== -1 && (b.timeoutHandle = -1, Ff(H)), Ma !== null) for (H = Ma.return; H !== null; ) {
      var ge = H;
      switch (ge.tag) {
        case 1:
          ge = ge.type.childContextTypes, ge != null && Fo();
          break;
        case 3:
          Cl(), Yn(Na), Yn(Ji), de();
          break;
        case 5:
          Ac(ge);
          break;
        case 4:
          Cl();
          break;
        case 13:
          Yn(Xi);
          break;
        case 19:
          Yn(Xi);
          break;
        case 10:
          Sd(ge);
          break;
        case 23:
        case 24:
          pg();
      }
      H = H.return;
    }
    xo = b, Ma = Bu(b.current, null), io = xl = Vs = D, Ya = 0, fo = null, lg = Tl = Dc = 0;
  }
  function Ap(b, D) {
    do {
      var H = Ma;
      try {
        if (Hf(), pe.current = ua, Qe) {
          for (var ge = Ee.memoizedState; ge !== null; ) {
            var Pe = ge.queue;
            Pe !== null && (Pe.pending = null), ge = ge.next;
          }
          Qe = !1;
        }
        if (ke = 0, Ke = He = Ee = null, yt = !1, Mc.current = null, H === null || H.return === null) {
          Ya = 1, fo = D, Ma = null;
          break;
        }
        e: {
          var $e = b, ht = H.return, Mt = H, Jt = D;
          if (D = io, Mt.flags |= 2048, Mt.firstEffect = Mt.lastEffect = null, Jt !== null && typeof Jt == "object" && typeof Jt.then == "function") {
            var vr = Jt;
            if (!(Mt.mode & 2)) {
              var vn = Mt.alternate;
              vn ? (Mt.updateQueue = vn.updateQueue, Mt.memoizedState = vn.memoizedState, Mt.lanes = vn.lanes) : (Mt.updateQueue = null, Mt.memoizedState = null);
            }
            var Kn = (Xi.current & 1) !== 0, jr = ht;
            do {
              var Mn;
              if (Mn = jr.tag === 13) {
                var Xn = jr.memoizedState;
                if (Xn !== null) Mn = Xn.dehydrated !== null;
                else {
                  var Vn = jr.memoizedProps;
                  Mn = Vn.fallback === void 0 ? !1 : Vn.unstable_avoidThisFallback !== !0 ? !0 : !Kn;
                }
              }
              if (Mn) {
                var ur = jr.updateQueue;
                if (ur === null) {
                  var er = /* @__PURE__ */ new Set();
                  er.add(vr), jr.updateQueue = er;
                } else ur.add(vr);
                if (!(jr.mode & 2)) {
                  if (jr.flags |= 64, Mt.flags |= 16384, Mt.flags &= -2981, Mt.tag === 1) if (Mt.alternate === null) Mt.tag = 17;
                  else {
                    var or = Co(-1, 1);
                    or.tag = 2, Ns(Mt, or);
                  }
                  Mt.lanes |= 1;
                  break e;
                }
                Jt = void 0, Mt = D;
                var Or = $e.pingCache;
                if (Or === null ? (Or = $e.pingCache = new dy(), Jt = /* @__PURE__ */ new Set(), Or.set(vr, Jt)) : (Jt = Or.get(vr), Jt === void 0 && (Jt = /* @__PURE__ */ new Set(), Or.set(vr, Jt))), !Jt.has(Mt)) {
                  Jt.add(Mt);
                  var Hr = ub.bind(null, $e, vr, Mt);
                  vr.then(Hr, Hr);
                }
                jr.flags |= 4096, jr.lanes = D;
                break e;
              }
              jr = jr.return;
            } while (jr !== null);
            Jt = Error((ve(Mt.type) || "A React component") + ` suspended while rendering, but no fallback UI was specified.

Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`);
          }
          Ya !== 5 && (Ya = 2), Jt = ng(Jt, Mt), jr = ht;
          do {
            switch (jr.tag) {
              case 3:
                $e = Jt, jr.flags |= 4096, D &= -D, jr.lanes |= D;
                var Qn = fy(jr, $e, D);
                mp(jr, Qn);
                break e;
              case 1:
                $e = Jt;
                var bn = jr.type, Jn = jr.stateNode;
                if (!(jr.flags & 64) && (typeof bn.getDerivedStateFromError == "function" || Jn !== null && typeof Jn.componentDidCatch == "function" && (Rl === null || !Rl.has(Jn)))) {
                  jr.flags |= 4096, D &= -D, jr.lanes |= D;
                  var ni = hy(jr, $e, D);
                  mp(jr, ni);
                  break e;
                }
            }
            jr = jr.return;
          } while (jr !== null);
        }
        Ry(H);
      } catch (qn) {
        D = qn, Ma === H && H !== null && (Ma = H = H.return);
        continue;
      }
      break;
    } while (!0);
  }
  function kd() {
    var b = Fd.current;
    return Fd.current = ua, b === null ? ua : b;
  }
  function qf(b, D) {
    var H = Zn;
    Zn |= 16;
    var ge = kd();
    xo === b && io === D || Ic(b, D);
    do
      try {
        xy();
        break;
      } catch (Pe) {
        Ap(b, Pe);
      }
    while (!0);
    if (Hf(), Zn = H, Fd.current = ge, Ma !== null) throw Error(n(261));
    return xo = null, io = 0, Ya;
  }
  function xy() {
    for (; Ma !== null; ) vg(Ma);
  }
  function Ty() {
    for (; Ma !== null && !tg(); ) vg(Ma);
  }
  function vg(b) {
    var D = My(b.alternate, b, xl);
    b.memoizedProps = b.pendingProps, D === null ? Ry(b) : Ma = D, Mc.current = null;
  }
  function Ry(b) {
    var D = b;
    do {
      var H = D.alternate;
      if (b = D.return, D.flags & 2048) {
        if (H = cy(D), H !== null) {
          H.flags &= 2047, Ma = H;
          return;
        }
        b !== null && (b.firstEffect = b.lastEffect = null, b.flags |= 2048);
      } else {
        if (H = rb(H, D, xl), H !== null) {
          Ma = H;
          return;
        }
        if (H = D, H.tag !== 24 && H.tag !== 23 || H.memoizedState === null || xl & 1073741824 || !(H.mode & 4)) {
          for (var ge = 0, Pe = H.child; Pe !== null; ) ge |= Pe.lanes | Pe.childLanes, Pe = Pe.sibling;
          H.childLanes = ge;
        }
        b !== null && !(b.flags & 2048) && (b.firstEffect === null && (b.firstEffect = D.firstEffect), D.lastEffect !== null && (b.lastEffect !== null && (b.lastEffect.nextEffect = D.firstEffect), b.lastEffect = D.lastEffect), 1 < D.flags && (b.lastEffect !== null ? b.lastEffect.nextEffect = D : b.firstEffect = D, b.lastEffect = D));
      }
      if (D = D.sibling, D !== null) {
        Ma = D;
        return;
      }
      Ma = D = b;
    } while (D !== null);
    Ya === 0 && (Ya = 5);
  }
  function Nu(b) {
    var D = fl();
    return hl(99, sb.bind(null, b, D)), null;
  }
  function sb(b, D) {
    do
      Gu();
    while (Pc !== null);
    if (Zn & 48) throw Error(n(327));
    var H = b.finishedWork;
    if (H === null) return null;
    if (b.finishedWork = null, b.finishedLanes = 0, H === b.current) throw Error(n(177));
    b.callbackNode = null;
    var ge = H.lanes | H.childLanes, Pe = ge, $e = b.pendingLanes & ~Pe;
    b.pendingLanes = Pe, b.suspendedLanes = 0, b.pingedLanes = 0, b.expiredLanes &= Pe, b.mutableReadLanes &= Pe, b.entangledLanes &= Pe, Pe = b.entanglements;
    for (var ht = b.eventTimes, Mt = b.expirationTimes; 0 < $e; ) {
      var Jt = 31 - Ln($e), vr = 1 << Jt;
      Pe[Jt] = 0, ht[Jt] = -1, Mt[Jt] = -1, $e &= ~vr;
    }
    if (tu !== null && !(ge & 24) && tu.has(b) && tu.delete(b), b === xo && (Ma = xo = null, io = 0), 1 < H.flags ? H.lastEffect !== null ? (H.lastEffect.nextEffect = H, ge = H.firstEffect) : ge = H : ge = H.firstEffect, ge !== null) {
      if (Pe = Zn, Zn |= 32, Mc.current = null, Mf = ei, ht = fd(), ol(ht)) {
        if ("selectionStart" in ht) Mt = { start: ht.selectionStart, end: ht.selectionEnd };
        else e: if (Mt = (Mt = ht.ownerDocument) && Mt.defaultView || window, (vr = Mt.getSelection && Mt.getSelection()) && vr.rangeCount !== 0) {
          Mt = vr.anchorNode, $e = vr.anchorOffset, Jt = vr.focusNode, vr = vr.focusOffset;
          try {
            Mt.nodeType, Jt.nodeType;
          } catch {
            Mt = null;
            break e;
          }
          var vn = 0, Kn = -1, jr = -1, Mn = 0, Xn = 0, Vn = ht, ur = null;
          t: for (; ; ) {
            for (var er; Vn !== Mt || $e !== 0 && Vn.nodeType !== 3 || (Kn = vn + $e), Vn !== Jt || vr !== 0 && Vn.nodeType !== 3 || (jr = vn + vr), Vn.nodeType === 3 && (vn += Vn.nodeValue.length), (er = Vn.firstChild) !== null; )
              ur = Vn, Vn = er;
            for (; ; ) {
              if (Vn === ht) break t;
              if (ur === Mt && ++Mn === $e && (Kn = vn), ur === Jt && ++Xn === vr && (jr = vn), (er = Vn.nextSibling) !== null) break;
              Vn = ur, ur = Vn.parentNode;
            }
            Vn = er;
          }
          Mt = Kn === -1 || jr === -1 ? null : { start: Kn, end: jr };
        } else Mt = null;
        Mt = Mt || { start: 0, end: 0 };
      } else Mt = null;
      Df = { focusedElem: ht, selectionRange: Mt }, ei = !1, Qf = null, xp = !1, Cn = ge;
      do
        try {
          lb();
        } catch (qn) {
          if (Cn === null) throw Error(n(330));
          Hu(Cn, qn), Cn = Cn.nextEffect;
        }
      while (Cn !== null);
      Qf = null, Cn = ge;
      do
        try {
          for (ht = b; Cn !== null; ) {
            var or = Cn.flags;
            if (or & 16 && Ie(Cn.stateNode, ""), or & 128) {
              var Or = Cn.alternate;
              if (Or !== null) {
                var Hr = Or.ref;
                Hr !== null && (typeof Hr == "function" ? Hr(null) : Hr.current = null);
              }
            }
            switch (or & 1038) {
              case 2:
                yy(Cn), Cn.flags &= -3;
                break;
              case 6:
                yy(Cn), Cn.flags &= -3, sg(Cn.alternate, Cn);
                break;
              case 1024:
                Cn.flags &= -1025;
                break;
              case 1028:
                Cn.flags &= -1025, sg(Cn.alternate, Cn);
                break;
              case 4:
                sg(Cn.alternate, Cn);
                break;
              case 8:
                Mt = Cn, Cy(ht, Mt);
                var Qn = Mt.alternate;
                gy(Mt), Qn !== null && gy(Qn);
            }
            Cn = Cn.nextEffect;
          }
        } catch (qn) {
          if (Cn === null) throw Error(n(330));
          Hu(Cn, qn), Cn = Cn.nextEffect;
        }
      while (Cn !== null);
      if (Hr = Df, Or = fd(), or = Hr.focusedElem, ht = Hr.selectionRange, Or !== or && or && or.ownerDocument && Tf(or.ownerDocument.documentElement, or)) {
        for (ht !== null && ol(or) && (Or = ht.start, Hr = ht.end, Hr === void 0 && (Hr = Or), "selectionStart" in or ? (or.selectionStart = Or, or.selectionEnd = Math.min(Hr, or.value.length)) : (Hr = (Or = or.ownerDocument || document) && Or.defaultView || window, Hr.getSelection && (Hr = Hr.getSelection(), Mt = or.textContent.length, Qn = Math.min(ht.start, Mt), ht = ht.end === void 0 ? Qn : Math.min(ht.end, Mt), !Hr.extend && Qn > ht && (Mt = ht, ht = Qn, Qn = Mt), Mt = fp(or, Qn), $e = fp(or, ht), Mt && $e && (Hr.rangeCount !== 1 || Hr.anchorNode !== Mt.node || Hr.anchorOffset !== Mt.offset || Hr.focusNode !== $e.node || Hr.focusOffset !== $e.offset) && (Or = Or.createRange(), Or.setStart(Mt.node, Mt.offset), Hr.removeAllRanges(), Qn > ht ? (Hr.addRange(Or), Hr.extend($e.node, $e.offset)) : (Or.setEnd($e.node, $e.offset), Hr.addRange(Or)))))), Or = [], Hr = or; Hr = Hr.parentNode; ) Hr.nodeType === 1 && Or.push({ element: Hr, left: Hr.scrollLeft, top: Hr.scrollTop });
        for (typeof or.focus == "function" && or.focus(), or = 0; or < Or.length; or++) Hr = Or[or], Hr.element.scrollLeft = Hr.left, Hr.element.scrollTop = Hr.top;
      }
      ei = !!Mf, Df = Mf = null, b.current = H, Cn = ge;
      do
        try {
          for (or = b; Cn !== null; ) {
            var bn = Cn.flags;
            if (bn & 36 && ag(or, Cn.alternate, Cn), bn & 128) {
              Or = void 0;
              var Jn = Cn.ref;
              if (Jn !== null) {
                var ni = Cn.stateNode;
                switch (Cn.tag) {
                  case 5:
                    Or = ni;
                    break;
                  default:
                    Or = ni;
                }
                typeof Jn == "function" ? Jn(Or) : Jn.current = Or;
              }
            }
            Cn = Cn.nextEffect;
          }
        } catch (qn) {
          if (Cn === null) throw Error(n(330));
          Hu(Cn, qn), Cn = Cn.nextEffect;
        }
      while (Cn !== null);
      Cn = null, Nf(), Zn = Pe;
    } else b.current = H;
    if (ku) ku = !1, Pc = b, Kf = D;
    else for (Cn = ge; Cn !== null; ) D = Cn.nextEffect, Cn.nextEffect = null, Cn.flags & 8 && (bn = Cn, bn.sibling = null, bn.stateNode = null), Cn = D;
    if (ge = b.pendingLanes, ge === 0 && (Rl = null), ge === 1 ? b === bp ? Jf++ : (Jf = 0, bp = b) : Jf = 0, H = H.stateNode, cl && typeof cl.onCommitFiberRoot == "function") try {
      cl.onCommitFiberRoot(Tu, H, void 0, (H.current.flags & 64) === 64);
    } catch {
    }
    if (ds(b, Ra()), Zf) throw Zf = !1, b = ug, ug = null, b;
    return Zn & 8 || va(), null;
  }
  function lb() {
    for (; Cn !== null; ) {
      var b = Cn.alternate;
      xp || Qf === null || (Cn.flags & 8 ? Sr(Cn, Qf) && (xp = !0) : Cn.tag === 13 && ab(b, Cn) && Sr(Cn, Qf) && (xp = !0));
      var D = Cn.flags;
      D & 256 && ib(b, Cn), !(D & 512) || ku || (ku = !0, Kl(97, function() {
        return Gu(), null;
      })), Cn = Cn.nextEffect;
    }
  }
  function Gu() {
    if (Kf !== 90) {
      var b = 97 < Kf ? 97 : Kf;
      return Kf = 90, hl(b, Ey);
    }
    return !1;
  }
  function Ay(b, D) {
    cg.push(D, b), ku || (ku = !0, Kl(97, function() {
      return Gu(), null;
    }));
  }
  function gg(b, D) {
    dg.push(D, b), ku || (ku = !0, Kl(97, function() {
      return Gu(), null;
    }));
  }
  function Ey() {
    if (Pc === null) return !1;
    var b = Pc;
    if (Pc = null, Zn & 48) throw Error(n(331));
    var D = Zn;
    Zn |= 32;
    var H = dg;
    dg = [];
    for (var ge = 0; ge < H.length; ge += 2) {
      var Pe = H[ge], $e = H[ge + 1], ht = Pe.destroy;
      if (Pe.destroy = void 0, typeof ht == "function") try {
        ht();
      } catch (Jt) {
        if ($e === null) throw Error(n(330));
        Hu($e, Jt);
      }
    }
    for (H = cg, cg = [], ge = 0; ge < H.length; ge += 2) {
      Pe = H[ge], $e = H[ge + 1];
      try {
        var Mt = Pe.create;
        Pe.destroy = Mt();
      } catch (Jt) {
        if ($e === null) throw Error(n(330));
        Hu($e, Jt);
      }
    }
    for (Mt = b.current.firstEffect; Mt !== null; ) b = Mt.nextEffect, Mt.nextEffect = null, Mt.flags & 8 && (Mt.sibling = null, Mt.stateNode = null), Mt = b;
    return Zn = D, va(), !0;
  }
  function Lc(b, D, H) {
    D = ng(H, D), D = fy(b, D, 1), Ns(b, D), D = Ko(), b = Tp(b, 1), b !== null && (Wn(b, 1, D), ds(b, D));
  }
  function Hu(b, D) {
    if (b.tag === 3) Lc(b, b, D);
    else for (var H = b.return; H !== null; ) {
      if (H.tag === 3) {
        Lc(H, b, D);
        break;
      } else if (H.tag === 1) {
        var ge = H.stateNode;
        if (typeof H.type.getDerivedStateFromError == "function" || typeof ge.componentDidCatch == "function" && (Rl === null || !Rl.has(ge))) {
          b = ng(D, b);
          var Pe = hy(H, b, 1);
          if (Ns(H, Pe), Pe = Ko(), H = Tp(H, 1), H !== null) Wn(H, 1, Pe), ds(H, Pe);
          else if (typeof ge.componentDidCatch == "function" && (Rl === null || !Rl.has(ge))) try {
            ge.componentDidCatch(D, b);
          } catch {
          }
          break;
        }
      }
      H = H.return;
    }
  }
  function ub(b, D, H) {
    var ge = b.pingCache;
    ge !== null && ge.delete(D), D = Ko(), b.pingedLanes |= b.suspendedLanes & H, xo === b && (io & H) === H && (Ya === 4 || Ya === 3 && (io & 62914560) === io && 500 > Ra() - $f ? Ic(b, 0) : lg |= H), ds(b, D);
  }
  function cb(b, D) {
    var H = b.stateNode;
    H !== null && H.delete(D), D = 0, D === 0 && (D = b.mode, D & 2 ? D & 4 ? (ru === 0 && (ru = Vs), D = Pn(62914560 & ~ru), D === 0 && (D = 4194304)) : D = fl() === 99 ? 1 : 2 : D = 1), H = Ko(), b = Tp(b, D), b !== null && (Wn(b, D, H), ds(b, H));
  }
  var My;
  My = function(b, D, H) {
    var ge = D.lanes;
    if (b !== null) if (b.memoizedProps !== D.pendingProps || Na.current) Ri = !0;
    else if (H & ge) Ri = !!(b.flags & 16384);
    else {
      switch (Ri = !1, D.tag) {
        case 3:
          Sl(D), B();
          break;
        case 5:
          yp(D);
          break;
        case 1:
          Ta(D.type) && Po(D);
          break;
        case 4:
          yl(D, D.stateNode.containerInfo);
          break;
        case 10:
          ge = D.memoizedProps.value;
          var Pe = D.type._context;
          On(vl, Pe._currentValue), Pe._currentValue = ge;
          break;
        case 13:
          if (D.memoizedState !== null)
            return H & D.child.childLanes ? Zo(b, D, H) : (On(Xi, Xi.current & 1), D = eu(b, D, H), D !== null ? D.sibling : null);
          On(Xi, Xi.current & 1);
          break;
        case 19:
          if (ge = (H & D.childLanes) !== 0, b.flags & 64) {
            if (ge) return tb(b, D, H);
            D.flags |= 64;
          }
          if (Pe = D.memoizedState, Pe !== null && (Pe.rendering = null, Pe.tail = null, Pe.lastEffect = null), On(Xi, Xi.current), ge) break;
          return null;
        case 23:
        case 24:
          return D.lanes = 0, ta(b, D, H);
      }
      return eu(b, D, H);
    }
    else Ri = !1;
    switch (D.lanes = 0, D.tag) {
      case 2:
        if (ge = D.type, b !== null && (b.alternate = null, D.alternate = null, D.flags |= 2), b = D.pendingProps, Pe = bi(D, Ji.current), Ea(D, H), Pe = Zt(null, D, ge, b, Pe, H), D.flags |= 1, typeof Pe == "object" && Pe !== null && typeof Pe.render == "function" && Pe.$$typeof === void 0) {
          if (D.tag = 1, D.memoizedState = null, D.updateQueue = null, Ta(ge)) {
            var $e = !0;
            Po(D);
          } else $e = !1;
          D.memoizedState = Pe.state !== null && Pe.state !== void 0 ? Pe.state : null, ls(D);
          var ht = ge.getDerivedStateFromProps;
          typeof ht == "function" && Au(D, ge, ht, b), Pe.updater = Jl, D.stateNode = Pe, Pe._reactInternals = D, Ad(D, ge, b, H), D = wl(null, D, ge, !0, $e, H);
        } else D.tag = 0, Li(null, D, Pe, H), D = D.child;
        return D;
      case 16:
        Pe = D.elementType;
        e: {
          switch (b !== null && (b.alternate = null, D.alternate = null, D.flags |= 2), b = D.pendingProps, $e = Pe._init, Pe = $e(Pe._payload), D.type = Pe, $e = D.tag = fb(Pe), b = Aa(Pe, b), $e) {
            case 0:
              D = ko(null, D, Pe, b, H);
              break e;
            case 1:
              D = So(null, D, Pe, b, H);
              break e;
            case 11:
              D = Bs(null, D, Pe, b, H);
              break e;
            case 14:
              D = zf(null, D, Pe, Aa(Pe.type, b), ge, H);
              break e;
          }
          throw Error(n(306, Pe, ""));
        }
        return D;
      case 0:
        return ge = D.type, Pe = D.pendingProps, Pe = D.elementType === ge ? Pe : Aa(ge, Pe), ko(b, D, ge, Pe, H);
      case 1:
        return ge = D.type, Pe = D.pendingProps, Pe = D.elementType === ge ? Pe : Aa(ge, Pe), So(b, D, ge, Pe, H);
      case 3:
        if (Sl(D), ge = D.updateQueue, b === null || ge === null) throw Error(n(282));
        if (ge = D.pendingProps, Pe = D.memoizedState, Pe = Pe !== null ? Pe.element : null, xd(b, D), Gs(D, ge, null, H), ge = D.memoizedState.element, ge === Pe) B(), D = eu(b, D, H);
        else {
          if (Pe = D.stateNode, ($e = Pe.hydrate) && (Hs = ll(D.stateNode.containerInfo.firstChild), us = D, $e = cs = !0), $e) {
            if (b = Pe.mutableSourceEagerHydrationData, b != null) for (Pe = 0; Pe < b.length; Pe += 2) $e = b[Pe], $e._workInProgressVersionPrimary = b[Pe + 1], J.push($e);
            for (H = Fu(D, null, ge, H), D.child = H; H; ) H.flags = H.flags & -3 | 1024, H = H.sibling;
          } else Li(b, D, ge, H), B();
          D = D.child;
        }
        return D;
      case 5:
        return yp(D), b === null && bl(D), ge = D.type, Pe = D.pendingProps, $e = b !== null ? b.memoizedProps : null, ht = Pe.children, xu(ge, Pe) ? ht = null : $e !== null && xu(ge, $e) && (D.flags |= 16), wo(b, D), Li(b, D, ht, H), D.child;
      case 6:
        return b === null && bl(D), null;
      case 13:
        return Zo(b, D, H);
      case 4:
        return yl(D, D.stateNode.containerInfo), ge = D.pendingProps, b === null ? D.child = Du(D, null, ge, H) : Li(b, D, ge, H), D.child;
      case 11:
        return ge = D.type, Pe = D.pendingProps, Pe = D.elementType === ge ? Pe : Aa(ge, Pe), Bs(b, D, ge, Pe, H);
      case 7:
        return Li(b, D, D.pendingProps, H), D.child;
      case 8:
        return Li(
          b,
          D,
          D.pendingProps.children,
          H
        ), D.child;
      case 12:
        return Li(b, D, D.pendingProps.children, H), D.child;
      case 10:
        e: {
          ge = D.type._context, Pe = D.pendingProps, ht = D.memoizedProps, $e = Pe.value;
          var Mt = D.type._context;
          if (On(vl, Mt._currentValue), Mt._currentValue = $e, ht !== null) if (Mt = ht.value, $e = Eo(Mt, $e) ? 0 : (typeof ge._calculateChangedBits == "function" ? ge._calculateChangedBits(Mt, $e) : 1073741823) | 0, $e === 0) {
            if (ht.children === Pe.children && !Na.current) {
              D = eu(b, D, H);
              break e;
            }
          } else for (Mt = D.child, Mt !== null && (Mt.return = D); Mt !== null; ) {
            var Jt = Mt.dependencies;
            if (Jt !== null) {
              ht = Mt.child;
              for (var vr = Jt.firstContext; vr !== null; ) {
                if (vr.context === ge && vr.observedBits & $e) {
                  Mt.tag === 1 && (vr = Co(-1, H & -H), vr.tag = 2, Ns(Mt, vr)), Mt.lanes |= H, vr = Mt.alternate, vr !== null && (vr.lanes |= H), Bf(Mt.return, H), Jt.lanes |= H;
                  break;
                }
                vr = vr.next;
              }
            } else ht = Mt.tag === 10 && Mt.type === D.type ? null : Mt.child;
            if (ht !== null) ht.return = Mt;
            else for (ht = Mt; ht !== null; ) {
              if (ht === D) {
                ht = null;
                break;
              }
              if (Mt = ht.sibling, Mt !== null) {
                Mt.return = ht.return, ht = Mt;
                break;
              }
              ht = ht.return;
            }
            Mt = ht;
          }
          Li(b, D, Pe.children, H), D = D.child;
        }
        return D;
      case 9:
        return Pe = D.type, $e = D.pendingProps, ge = $e.children, Ea(D, H), Pe = lo(
          Pe,
          $e.unstable_observedBits
        ), ge = ge(Pe), D.flags |= 1, Li(b, D, ge, H), D.child;
      case 14:
        return Pe = D.type, $e = Aa(Pe, D.pendingProps), $e = Aa(Pe.type, $e), zf(b, D, Pe, $e, ge, H);
      case 15:
        return Lo(b, D, D.type, D.pendingProps, ge, H);
      case 17:
        return ge = D.type, Pe = D.pendingProps, Pe = D.elementType === ge ? Pe : Aa(ge, Pe), b !== null && (b.alternate = null, D.alternate = null, D.flags |= 2), D.tag = 1, Ta(ge) ? (b = !0, Po(D)) : b = !1, Ea(D, H), gl(D, ge, Pe), Ad(D, ge, Pe, H), wl(null, D, ge, !0, b, H);
      case 19:
        return tb(b, D, H);
      case 23:
        return ta(b, D, H);
      case 24:
        return ta(b, D, H);
    }
    throw Error(n(156, D.tag));
  };
  function db(b, D, H, ge) {
    this.tag = b, this.key = H, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = D, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = ge, this.flags = 0, this.lastEffect = this.firstEffect = this.nextEffect = null, this.childLanes = this.lanes = 0, this.alternate = null;
  }
  function fs(b, D, H, ge) {
    return new db(b, D, H, ge);
  }
  function Ep(b) {
    return b = b.prototype, !(!b || !b.isReactComponent);
  }
  function fb(b) {
    if (typeof b == "function") return Ep(b) ? 1 : 0;
    if (b != null) {
      if (b = b.$$typeof, b === O) return 11;
      if (b === j) return 14;
    }
    return 2;
  }
  function Bu(b, D) {
    var H = b.alternate;
    return H === null ? (H = fs(b.tag, D, b.key, b.mode), H.elementType = b.elementType, H.type = b.type, H.stateNode = b.stateNode, H.alternate = b, b.alternate = H) : (H.pendingProps = D, H.type = b.type, H.flags = 0, H.nextEffect = null, H.firstEffect = null, H.lastEffect = null), H.childLanes = b.childLanes, H.lanes = b.lanes, H.child = b.child, H.memoizedProps = b.memoizedProps, H.memoizedState = b.memoizedState, H.updateQueue = b.updateQueue, D = b.dependencies, H.dependencies = D === null ? null : { lanes: D.lanes, firstContext: D.firstContext }, H.sibling = b.sibling, H.index = b.index, H.ref = b.ref, H;
  }
  function eh(b, D, H, ge, Pe, $e) {
    var ht = 2;
    if (ge = b, typeof b == "function") Ep(b) && (ht = 1);
    else if (typeof b == "string") ht = 5;
    else e: switch (b) {
      case P:
        return El(H.children, Pe, $e, D);
      case Z:
        ht = 8, Pe |= 16;
        break;
      case k:
        ht = 8, Pe |= 1;
        break;
      case I:
        return b = fs(12, H, D, Pe | 8), b.elementType = I, b.type = I, b.lanes = $e, b;
      case N:
        return b = fs(13, H, D, Pe), b.type = N, b.elementType = N, b.lanes = $e, b;
      case Y:
        return b = fs(19, H, D, Pe), b.elementType = Y, b.lanes = $e, b;
      case W:
        return kc(H, Pe, $e, D);
      case q:
        return b = fs(24, H, D, Pe), b.elementType = q, b.lanes = $e, b;
      default:
        if (typeof b == "object" && b !== null) switch (b.$$typeof) {
          case L:
            ht = 10;
            break e;
          case A:
            ht = 9;
            break e;
          case O:
            ht = 11;
            break e;
          case j:
            ht = 14;
            break e;
          case te:
            ht = 16, ge = null;
            break e;
          case re:
            ht = 22;
            break e;
        }
        throw Error(n(130, b == null ? b : typeof b, ""));
    }
    return D = fs(ht, H, D, Pe), D.elementType = b, D.type = ge, D.lanes = $e, D;
  }
  function El(b, D, H, ge) {
    return b = fs(7, b, ge, D), b.lanes = H, b;
  }
  function kc(b, D, H, ge) {
    return b = fs(23, b, ge, D), b.elementType = W, b.lanes = H, b;
  }
  function mg(b, D, H) {
    return b = fs(6, b, null, D), b.lanes = H, b;
  }
  function yg(b, D, H) {
    return D = fs(4, b.children !== null ? b.children : [], b.key, D), D.lanes = H, D.stateNode = { containerInfo: b.containerInfo, pendingChildren: null, implementation: b.implementation }, D;
  }
  function hb(b, D, H) {
    this.tag = D, this.containerInfo = b, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.pendingContext = this.context = null, this.hydrate = H, this.callbackNode = null, this.callbackPriority = 0, this.eventTimes = kn(0), this.expirationTimes = kn(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = kn(0), this.mutableSourceEagerHydrationData = null;
  }
  function Mp(b, D, H) {
    var ge = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
    return { $$typeof: F, key: ge == null ? null : "" + ge, children: b, containerInfo: D, implementation: H };
  }
  function Dp(b, D, H, ge) {
    var Pe = D.current, $e = Ko(), ht = Al(Pe);
    e: if (H) {
      H = H._reactInternals;
      t: {
        if (Rr(H) !== H || H.tag !== 1) throw Error(n(170));
        var Mt = H;
        do {
          switch (Mt.tag) {
            case 3:
              Mt = Mt.stateNode.context;
              break t;
            case 1:
              if (Ta(Mt.type)) {
                Mt = Mt.stateNode.__reactInternalMemoizedMergedChildContext;
                break t;
              }
          }
          Mt = Mt.return;
        } while (Mt !== null);
        throw Error(n(171));
      }
      if (H.tag === 1) {
        var Jt = H.type;
        if (Ta(Jt)) {
          H = $l(H, Jt, Mt);
          break e;
        }
      }
      H = Mt;
    } else H = Ls;
    return D.context === null ? D.context = H : D.pendingContext = H, D = Co($e, ht), D.payload = { element: b }, ge = ge === void 0 ? null : ge, ge !== null && (D.callback = ge), Ns(Pe, D), Ou(Pe, ht, $e), ht;
  }
  function Fp(b) {
    if (b = b.current, !b.child) return null;
    switch (b.child.tag) {
      case 5:
        return b.child.stateNode;
      default:
        return b.child.stateNode;
    }
  }
  function Dy(b, D) {
    if (b = b.memoizedState, b !== null && b.dehydrated !== null) {
      var H = b.retryLane;
      b.retryLane = H !== 0 && H < D ? H : D;
    }
  }
  function Pp(b, D) {
    Dy(b, D), (b = b.alternate) && Dy(b, D);
  }
  function Fy() {
    return null;
  }
  function Cg(b, D, H) {
    var ge = H != null && H.hydrationOptions != null && H.hydrationOptions.mutableSources || null;
    if (H = new hb(b, D, H != null && H.hydrate === !0), D = fs(3, null, null, D === 2 ? 7 : D === 1 ? 3 : 0), H.current = D, D.stateNode = H, ls(D), b[to] = H.current, Ef(b.nodeType === 8 ? b.parentNode : b), ge) for (b = 0; b < ge.length; b++) {
      D = ge[b];
      var Pe = D._getVersion;
      Pe = Pe(D._source), H.mutableSourceEagerHydrationData == null ? H.mutableSourceEagerHydrationData = [D, Pe] : H.mutableSourceEagerHydrationData.push(D, Pe);
    }
    this._internalRoot = H;
  }
  Cg.prototype.render = function(b) {
    Dp(b, this._internalRoot, null, null);
  }, Cg.prototype.unmount = function() {
    var b = this._internalRoot, D = b.containerInfo;
    Dp(null, b, null, function() {
      D[to] = null;
    });
  };
  function th(b) {
    return !(!b || b.nodeType !== 1 && b.nodeType !== 9 && b.nodeType !== 11 && (b.nodeType !== 8 || b.nodeValue !== " react-mount-point-unstable "));
  }
  function pb(b, D) {
    if (D || (D = b ? b.nodeType === 9 ? b.documentElement : b.firstChild : null, D = !(!D || D.nodeType !== 1 || !D.hasAttribute("data-reactroot"))), !D) for (var H; H = b.lastChild; ) b.removeChild(H);
    return new Cg(b, 0, D ? { hydrate: !0 } : void 0);
  }
  function Ip(b, D, H, ge, Pe) {
    var $e = H._reactRootContainer;
    if ($e) {
      var ht = $e._internalRoot;
      if (typeof Pe == "function") {
        var Mt = Pe;
        Pe = function() {
          var vr = Fp(ht);
          Mt.call(vr);
        };
      }
      Dp(D, ht, b, Pe);
    } else {
      if ($e = H._reactRootContainer = pb(H, ge), ht = $e._internalRoot, typeof Pe == "function") {
        var Jt = Pe;
        Pe = function() {
          var vr = Fp(ht);
          Jt.call(vr);
        };
      }
      Sy(function() {
        Dp(D, ht, b, Pe);
      });
    }
    return Fp(ht);
  }
  Yr = function(b) {
    if (b.tag === 13) {
      var D = Ko();
      Ou(b, 4, D), Pp(b, 4);
    }
  }, Ar = function(b) {
    if (b.tag === 13) {
      var D = Ko();
      Ou(b, 67108864, D), Pp(b, 67108864);
    }
  }, pr = function(b) {
    if (b.tag === 13) {
      var D = Ko(), H = Al(b);
      Ou(b, H, D), Pp(b, H);
    }
  }, kr = function(b, D) {
    return D();
  }, Wt = function(b, D, H) {
    switch (D) {
      case "input":
        if (_(b, H), D = H.name, H.type === "radio" && D != null) {
          for (H = b; H.parentNode; ) H = H.parentNode;
          for (H = H.querySelectorAll("input[name=" + JSON.stringify("" + D) + '][type="radio"]'), D = 0; D < H.length; D++) {
            var ge = H[D];
            if (ge !== b && ge.form === b.form) {
              var Pe = os(ge);
              if (!Pe) throw Error(n(90));
              Re(ge), _(ge, Pe);
            }
          }
        }
        break;
      case "textarea":
        Ve(b, H);
        break;
      case "select":
        D = H.value, D != null && me(b, !!H.multiple, D, !1);
    }
  }, tt = wy, ze = function(b, D, H, ge, Pe) {
    var $e = Zn;
    Zn |= 4;
    try {
      return hl(98, b.bind(null, D, H, ge, Pe));
    } finally {
      Zn = $e, Zn === 0 && (Id(), va());
    }
  }, _e = function() {
    !(Zn & 49) && (ob(), Gu());
  }, Ye = function(b, D) {
    var H = Zn;
    Zn |= 2;
    try {
      return b(D);
    } finally {
      Zn = H, Zn === 0 && (Id(), va());
    }
  };
  function Py(b, D) {
    var H = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
    if (!th(D)) throw Error(n(200));
    return Mp(b, D, null, H);
  }
  var vb = { Events: [go, Ua, os, Yt, Ut, Gu, { current: !1 }] }, rh = { findFiberByHostInstance: Xl, bundleType: 0, version: "17.0.2", rendererPackageName: "react-dom" }, gb = { bundleType: rh.bundleType, version: rh.version, rendererPackageName: rh.rendererPackageName, rendererConfig: rh.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: x.ReactCurrentDispatcher, findHostInstanceByFiber: function(b) {
    return b = yr(b), b === null ? null : b.stateNode;
  }, findFiberByHostInstance: rh.findFiberByHostInstance || Fy, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null };
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
    var Lp = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!Lp.isDisabled && Lp.supportsFiber) try {
      Tu = Lp.inject(gb), cl = Lp;
    } catch {
    }
  }
  return Ys.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = vb, Ys.createPortal = Py, Ys.findDOMNode = function(b) {
    if (b == null) return null;
    if (b.nodeType === 1) return b;
    var D = b._reactInternals;
    if (D === void 0)
      throw typeof b.render == "function" ? Error(n(188)) : Error(n(268, Object.keys(b)));
    return b = yr(D), b = b === null ? null : b.stateNode, b;
  }, Ys.flushSync = function(b, D) {
    var H = Zn;
    if (H & 48) return b(D);
    Zn |= 1;
    try {
      if (b) return hl(99, b.bind(null, D));
    } finally {
      Zn = H, va();
    }
  }, Ys.hydrate = function(b, D, H) {
    if (!th(D)) throw Error(n(200));
    return Ip(null, b, D, !0, H);
  }, Ys.render = function(b, D, H) {
    if (!th(D)) throw Error(n(200));
    return Ip(null, b, D, !1, H);
  }, Ys.unmountComponentAtNode = function(b) {
    if (!th(b)) throw Error(n(40));
    return b._reactRootContainer ? (Sy(function() {
      Ip(null, null, b, !1, function() {
        b._reactRootContainer = null, b[to] = null;
      });
    }), !0) : !1;
  }, Ys.unstable_batchedUpdates = wy, Ys.unstable_createPortal = function(b, D) {
    return Py(b, D, 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null);
  }, Ys.unstable_renderSubtreeIntoContainer = function(b, D, H, ge) {
    if (!th(H)) throw Error(n(200));
    if (b == null || b._reactInternals === void 0) throw Error(n(38));
    return Ip(b, D, H, !1, ge);
  }, Ys.version = "17.0.2", Ys;
}
var Xs = {}, lC = { exports: {} }, lu = {};
/** @license React v0.20.2
 * scheduler-tracing.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var CD;
function CG() {
  if (CD) return lu;
  CD = 1;
  var e = 0;
  return lu.__interactionsRef = null, lu.__subscriberRef = null, lu.unstable_clear = function(t) {
    return t();
  }, lu.unstable_getCurrent = function() {
    return null;
  }, lu.unstable_getThreadID = function() {
    return ++e;
  }, lu.unstable_subscribe = function() {
  }, lu.unstable_trace = function(t, r, n) {
    return n();
  }, lu.unstable_unsubscribe = function() {
  }, lu.unstable_wrap = function(t) {
    return t;
  }, lu;
}
var ZS = {};
/** @license React v0.20.2
 * scheduler-tracing.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var bD;
function bG() {
  return bD || (bD = 1, function(e) {
     true && function() {
      var t = 0, r = 0, n = 0;
      e.__interactionsRef = null, e.__subscriberRef = null, e.__interactionsRef = {
        current: /* @__PURE__ */ new Set()
      }, e.__subscriberRef = {
        current: null
      };
      function a(w) {
        var S = e.__interactionsRef.current;
        e.__interactionsRef.current = /* @__PURE__ */ new Set();
        try {
          return w();
        } finally {
          e.__interactionsRef.current = S;
        }
      }
      function u() {
        return e.__interactionsRef.current;
      }
      function s() {
        return ++n;
      }
      function c(w, S, E) {
        var x = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : t, T = {
          __count: 1,
          id: r++,
          name: w,
          timestamp: S
        }, F = e.__interactionsRef.current, P = new Set(F);
        P.add(T), e.__interactionsRef.current = P;
        var k = e.__subscriberRef.current, I;
        try {
          k !== null && k.onInteractionTraced(T);
        } finally {
          try {
            k !== null && k.onWorkStarted(P, x);
          } finally {
            try {
              I = E();
            } finally {
              e.__interactionsRef.current = F;
              try {
                k !== null && k.onWorkStopped(P, x);
              } finally {
                T.__count--, k !== null && T.__count === 0 && k.onInteractionScheduledWorkCompleted(T);
              }
            }
          }
        }
        return I;
      }
      function i(w) {
        var S = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, E = e.__interactionsRef.current, x = e.__subscriberRef.current;
        x !== null && x.onWorkScheduled(E, S), E.forEach(function(P) {
          P.__count++;
        });
        var T = !1;
        function F() {
          var P = e.__interactionsRef.current;
          e.__interactionsRef.current = E, x = e.__subscriberRef.current;
          try {
            var k;
            try {
              x !== null && x.onWorkStarted(E, S);
            } finally {
              try {
                k = w.apply(void 0, arguments);
              } finally {
                e.__interactionsRef.current = P, x !== null && x.onWorkStopped(E, S);
              }
            }
            return k;
          } finally {
            T || (T = !0, E.forEach(function(I) {
              I.__count--, x !== null && I.__count === 0 && x.onInteractionScheduledWorkCompleted(I);
            }));
          }
        }
        return F.cancel = function() {
          x = e.__subscriberRef.current;
          try {
            x !== null && x.onWorkCanceled(E, S);
          } finally {
            E.forEach(function(k) {
              k.__count--, x && k.__count === 0 && x.onInteractionScheduledWorkCompleted(k);
            });
          }
        }, F;
      }
      var l = null;
      l = /* @__PURE__ */ new Set();
      function v(w) {
        l.add(w), l.size === 1 && (e.__subscriberRef.current = {
          onInteractionScheduledWorkCompleted: g,
          onInteractionTraced: p,
          onWorkCanceled: h,
          onWorkScheduled: y,
          onWorkStarted: C,
          onWorkStopped: m
        });
      }
      function f(w) {
        l.delete(w), l.size === 0 && (e.__subscriberRef.current = null);
      }
      function p(w) {
        var S = !1, E = null;
        if (l.forEach(function(x) {
          try {
            x.onInteractionTraced(w);
          } catch (T) {
            S || (S = !0, E = T);
          }
        }), S)
          throw E;
      }
      function g(w) {
        var S = !1, E = null;
        if (l.forEach(function(x) {
          try {
            x.onInteractionScheduledWorkCompleted(w);
          } catch (T) {
            S || (S = !0, E = T);
          }
        }), S)
          throw E;
      }
      function y(w, S) {
        var E = !1, x = null;
        if (l.forEach(function(T) {
          try {
            T.onWorkScheduled(w, S);
          } catch (F) {
            E || (E = !0, x = F);
          }
        }), E)
          throw x;
      }
      function C(w, S) {
        var E = !1, x = null;
        if (l.forEach(function(T) {
          try {
            T.onWorkStarted(w, S);
          } catch (F) {
            E || (E = !0, x = F);
          }
        }), E)
          throw x;
      }
      function m(w, S) {
        var E = !1, x = null;
        if (l.forEach(function(T) {
          try {
            T.onWorkStopped(w, S);
          } catch (F) {
            E || (E = !0, x = F);
          }
        }), E)
          throw x;
      }
      function h(w, S) {
        var E = !1, x = null;
        if (l.forEach(function(T) {
          try {
            T.onWorkCanceled(w, S);
          } catch (F) {
            E || (E = !0, x = F);
          }
        }), E)
          throw x;
      }
      e.unstable_clear = a, e.unstable_getCurrent = u, e.unstable_getThreadID = s, e.unstable_subscribe = v, e.unstable_trace = c, e.unstable_unsubscribe = f, e.unstable_wrap = i;
    }();
  }(ZS)), ZS;
}
var wD;
function wG() {
  return wD || (wD = 1,  false ? 0 : lC.exports = bG()), lC.exports;
}
/** @license React v17.0.2
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var SD;
function SG() {
  return SD || (SD = 1,  true && function() {
    var e = (react__WEBPACK_IMPORTED_MODULE_1___default()), t = FT(), r = _F(), n = wG(), a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function u(o) {
      {
        for (var d = arguments.length, M = new Array(d > 1 ? d - 1 : 0), G = 1; G < d; G++)
          M[G - 1] = arguments[G];
        c("warn", o, M);
      }
    }
    function s(o) {
      {
        for (var d = arguments.length, M = new Array(d > 1 ? d - 1 : 0), G = 1; G < d; G++)
          M[G - 1] = arguments[G];
        c("error", o, M);
      }
    }
    function c(o, d, M) {
      {
        var G = a.ReactDebugCurrentFrame, Q = G.getStackAddendum();
        Q !== "" && (d += "%s", M = M.concat([Q]));
        var Ce = M.map(function(Le) {
          return "" + Le;
        });
        Ce.unshift("Warning: " + d), Function.prototype.apply.call(console[o], console, Ce);
      }
    }
    if (!e)
      throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
    var i = 0, l = 1, v = 2, f = 3, p = 4, g = 5, y = 6, C = 7, m = 8, h = 9, w = 10, S = 11, E = 12, x = 13, T = 14, F = 15, P = 16, k = 17, I = 18, L = 19, A = 20, O = 21, N = 22, Y = 23, j = 24, te = !0, re = !1, z = !1, Z = !1, W = /* @__PURE__ */ new Set(), q = {}, ie = {};
    function ce(o, d) {
      X(o, d), X(o + "Capture", d);
    }
    function X(o, d) {
      q[o] && s("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", o), q[o] = d;
      {
        var M = o.toLowerCase();
        ie[M] = o, o === "onDoubleClick" && (ie.ondblclick = o);
      }
      for (var G = 0; G < d.length; G++)
        W.add(d[G]);
    }
    var U = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", ne = 0, se = 1, le = 2, ue = 3, ve = 4, be = 5, Me = 6, Ge = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", we = Ge + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", Re = "data-reactroot", Ae = new RegExp("^[" + Ge + "][" + we + "]*$"), K = Object.prototype.hasOwnProperty, ee = {}, oe = {};
    function _(o) {
      return K.call(oe, o) ? !0 : K.call(ee, o) ? !1 : Ae.test(o) ? (oe[o] = !0, !0) : (ee[o] = !0, s("Invalid attribute name: `%s`", o), !1);
    }
    function V(o, d, M) {
      return d !== null ? d.type === ne : M ? !1 : o.length > 2 && (o[0] === "o" || o[0] === "O") && (o[1] === "n" || o[1] === "N");
    }
    function fe(o, d, M, G) {
      if (M !== null && M.type === ne)
        return !1;
      switch (typeof d) {
        case "function":
        case "symbol":
          return !0;
        case "boolean": {
          if (G)
            return !1;
          if (M !== null)
            return !M.acceptsBooleans;
          var Q = o.toLowerCase().slice(0, 5);
          return Q !== "data-" && Q !== "aria-";
        }
        default:
          return !1;
      }
    }
    function $(o, d, M, G) {
      if (d === null || typeof d > "u" || fe(o, d, M, G))
        return !0;
      if (G)
        return !1;
      if (M !== null)
        switch (M.type) {
          case ue:
            return !d;
          case ve:
            return d === !1;
          case be:
            return isNaN(d);
          case Me:
            return isNaN(d) || d < 1;
        }
      return !1;
    }
    function he(o) {
      return xe.hasOwnProperty(o) ? xe[o] : null;
    }
    function me(o, d, M, G, Q, Ce, Le) {
      this.acceptsBooleans = d === le || d === ue || d === ve, this.attributeName = G, this.attributeNamespace = Q, this.mustUseProperty = M, this.propertyName = o, this.type = d, this.sanitizeURL = Ce, this.removeEmptyString = Le;
    }
    var xe = {}, Fe = [
      "children",
      "dangerouslySetInnerHTML",
      // TODO: This prevents the assignment of defaultValue to regular
      // elements (not just inputs). Now that ReactDOMInput assigns to the
      // defaultValue property -- do we need this?
      "defaultValue",
      "defaultChecked",
      "innerHTML",
      "suppressContentEditableWarning",
      "suppressHydrationWarning",
      "style"
    ];
    Fe.forEach(function(o) {
      xe[o] = new me(
        o,
        ne,
        !1,
        // mustUseProperty
        o,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(o) {
      var d = o[0], M = o[1];
      xe[d] = new me(
        d,
        se,
        !1,
        // mustUseProperty
        M,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(o) {
      xe[o] = new me(
        o,
        le,
        !1,
        // mustUseProperty
        o.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(o) {
      xe[o] = new me(
        o,
        le,
        !1,
        // mustUseProperty
        o,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "allowFullScreen",
      "async",
      // Note: there is a special case that prevents it from being written to the DOM
      // on the client side because the browsers are inconsistent. Instead we call focus().
      "autoFocus",
      "autoPlay",
      "controls",
      "default",
      "defer",
      "disabled",
      "disablePictureInPicture",
      "disableRemotePlayback",
      "formNoValidate",
      "hidden",
      "loop",
      "noModule",
      "noValidate",
      "open",
      "playsInline",
      "readOnly",
      "required",
      "reversed",
      "scoped",
      "seamless",
      // Microdata
      "itemScope"
    ].forEach(function(o) {
      xe[o] = new me(
        o,
        ue,
        !1,
        // mustUseProperty
        o.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "checked",
      // Note: `option.selected` is not updated if `select.multiple` is
      // disabled with `removeAttribute`. We have special logic for handling this.
      "multiple",
      "muted",
      "selected"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(o) {
      xe[o] = new me(
        o,
        ue,
        !0,
        // mustUseProperty
        o,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "capture",
      "download"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(o) {
      xe[o] = new me(
        o,
        ve,
        !1,
        // mustUseProperty
        o,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "cols",
      "rows",
      "size",
      "span"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(o) {
      xe[o] = new me(
        o,
        Me,
        !1,
        // mustUseProperty
        o,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["rowSpan", "start"].forEach(function(o) {
      xe[o] = new me(
        o,
        be,
        !1,
        // mustUseProperty
        o.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    });
    var Ve = /[\-\:]([a-z])/g, Be = function(o) {
      return o[1].toUpperCase();
    };
    [
      "accent-height",
      "alignment-baseline",
      "arabic-form",
      "baseline-shift",
      "cap-height",
      "clip-path",
      "clip-rule",
      "color-interpolation",
      "color-interpolation-filters",
      "color-profile",
      "color-rendering",
      "dominant-baseline",
      "enable-background",
      "fill-opacity",
      "fill-rule",
      "flood-color",
      "flood-opacity",
      "font-family",
      "font-size",
      "font-size-adjust",
      "font-stretch",
      "font-style",
      "font-variant",
      "font-weight",
      "glyph-name",
      "glyph-orientation-horizontal",
      "glyph-orientation-vertical",
      "horiz-adv-x",
      "horiz-origin-x",
      "image-rendering",
      "letter-spacing",
      "lighting-color",
      "marker-end",
      "marker-mid",
      "marker-start",
      "overline-position",
      "overline-thickness",
      "paint-order",
      "panose-1",
      "pointer-events",
      "rendering-intent",
      "shape-rendering",
      "stop-color",
      "stop-opacity",
      "strikethrough-position",
      "strikethrough-thickness",
      "stroke-dasharray",
      "stroke-dashoffset",
      "stroke-linecap",
      "stroke-linejoin",
      "stroke-miterlimit",
      "stroke-opacity",
      "stroke-width",
      "text-anchor",
      "text-decoration",
      "text-rendering",
      "underline-position",
      "underline-thickness",
      "unicode-bidi",
      "unicode-range",
      "units-per-em",
      "v-alphabetic",
      "v-hanging",
      "v-ideographic",
      "v-mathematical",
      "vector-effect",
      "vert-adv-y",
      "vert-origin-x",
      "vert-origin-y",
      "word-spacing",
      "writing-mode",
      "xmlns:xlink",
      "x-height"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(o) {
      var d = o.replace(Ve, Be);
      xe[d] = new me(
        d,
        se,
        !1,
        // mustUseProperty
        o,
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "xlink:actuate",
      "xlink:arcrole",
      "xlink:role",
      "xlink:show",
      "xlink:title",
      "xlink:type"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(o) {
      var d = o.replace(Ve, Be);
      xe[d] = new me(
        d,
        se,
        !1,
        // mustUseProperty
        o,
        "http://www.w3.org/1999/xlink",
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "xml:base",
      "xml:lang",
      "xml:space"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(o) {
      var d = o.replace(Ve, Be);
      xe[d] = new me(
        d,
        se,
        !1,
        // mustUseProperty
        o,
        "http://www.w3.org/XML/1998/namespace",
        !1,
        // sanitizeURL
        !1
      );
    }), ["tabIndex", "crossOrigin"].forEach(function(o) {
      xe[o] = new me(
        o,
        se,
        !1,
        // mustUseProperty
        o.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    });
    var Je = "xlinkHref";
    xe[Je] = new me(
      "xlinkHref",
      se,
      !1,
      // mustUseProperty
      "xlink:href",
      "http://www.w3.org/1999/xlink",
      !0,
      // sanitizeURL
      !1
    ), ["src", "href", "action", "formAction"].forEach(function(o) {
      xe[o] = new me(
        o,
        se,
        !1,
        // mustUseProperty
        o.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !0,
        // sanitizeURL
        !0
      );
    });
    var et = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i, at = !1;
    function De(o) {
      !at && et.test(o) && (at = !0, s("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(o)));
    }
    function Ne(o, d, M, G) {
      if (G.mustUseProperty) {
        var Q = G.propertyName;
        return o[Q];
      } else {
        G.sanitizeURL && De("" + M);
        var Ce = G.attributeName, Le = null;
        if (G.type === ve) {
          if (o.hasAttribute(Ce)) {
            var We = o.getAttribute(Ce);
            return We === "" ? !0 : $(d, M, G, !1) ? We : We === "" + M ? M : We;
          }
        } else if (o.hasAttribute(Ce)) {
          if ($(d, M, G, !1))
            return o.getAttribute(Ce);
          if (G.type === ue)
            return M;
          Le = o.getAttribute(Ce);
        }
        return $(d, M, G, !1) ? Le === null ? M : Le : Le === "" + M ? M : Le;
      }
    }
    function Ie(o, d, M) {
      {
        if (!_(d))
          return;
        if (m5(M))
          return M;
        if (!o.hasAttribute(d))
          return M === void 0 ? void 0 : null;
        var G = o.getAttribute(d);
        return G === "" + M ? M : G;
      }
    }
    function Ue(o, d, M, G) {
      var Q = he(d);
      if (!V(d, Q, G)) {
        if ($(d, M, Q, G) && (M = null), G || Q === null) {
          if (_(d)) {
            var Ce = d;
            M === null ? o.removeAttribute(Ce) : o.setAttribute(Ce, "" + M);
          }
          return;
        }
        var Le = Q.mustUseProperty;
        if (Le) {
          var We = Q.propertyName;
          if (M === null) {
            var st = Q.type;
            o[We] = st === ue ? !1 : "";
          } else
            o[We] = M;
          return;
        }
        var It = Q.attributeName, Ht = Q.attributeNamespace;
        if (M === null)
          o.removeAttribute(It);
        else {
          var cr = Q.type, Qt;
          cr === ue || cr === ve && M === !0 ? Qt = "" : (Qt = "" + M, Q.sanitizeURL && De(Qt.toString())), Ht ? o.setAttributeNS(Ht, It, Qt) : o.setAttribute(It, Qt);
        }
      }
    }
    var ot = 60103, ct = 60106, Tt = 60107, kt = 60108, Ot = 60114, Rt = 60109, xt = 60110, Wt = 60112, bt = 60113, jt = 60120, qt = 60115, Yt = 60116, Ut = 60121, tt = 60119, ze = 60128, _e = 60129, Ye = 60130, lt = 60131;
    if (typeof Symbol == "function" && Symbol.for) {
      var Te = Symbol.for;
      ot = Te("react.element"), ct = Te("react.portal"), Tt = Te("react.fragment"), kt = Te("react.strict_mode"), Ot = Te("react.profiler"), Rt = Te("react.provider"), xt = Te("react.context"), Wt = Te("react.forward_ref"), bt = Te("react.suspense"), jt = Te("react.suspense_list"), qt = Te("react.memo"), Yt = Te("react.lazy"), Ut = Te("react.block"), Te("react.server.block"), Te("react.fundamental"), tt = Te("react.scope"), ze = Te("react.opaque.id"), _e = Te("react.debug_trace_mode"), Ye = Te("react.offscreen"), lt = Te("react.legacy_hidden");
    }
    var Oe = typeof Symbol == "function" && Symbol.iterator, je = "@@iterator";
    function Xe(o) {
      if (o === null || typeof o != "object")
        return null;
      var d = Oe && o[Oe] || o[je];
      return typeof d == "function" ? d : null;
    }
    var nt = 0, it, Nt, At, vt, ut, Pt, rr;
    function lr() {
    }
    lr.__reactDisabledLog = !0;
    function Mr() {
      {
        if (nt === 0) {
          it = console.log, Nt = console.info, At = console.warn, vt = console.error, ut = console.group, Pt = console.groupCollapsed, rr = console.groupEnd;
          var o = {
            configurable: !0,
            enumerable: !0,
            value: lr,
            writable: !0
          };
          Object.defineProperties(console, {
            info: o,
            log: o,
            warn: o,
            error: o,
            group: o,
            groupCollapsed: o,
            groupEnd: o
          });
        }
        nt++;
      }
    }
    function Rr() {
      {
        if (nt--, nt === 0) {
          var o = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: t({}, o, {
              value: it
            }),
            info: t({}, o, {
              value: Nt
            }),
            warn: t({}, o, {
              value: At
            }),
            error: t({}, o, {
              value: vt
            }),
            group: t({}, o, {
              value: ut
            }),
            groupCollapsed: t({}, o, {
              value: Pt
            }),
            groupEnd: t({}, o, {
              value: rr
            })
          });
        }
        nt < 0 && s("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var Pr = a.ReactCurrentDispatcher, ir;
    function Lr(o, d, M) {
      {
        if (ir === void 0)
          try {
            throw Error();
          } catch (Q) {
            var G = Q.stack.trim().match(/\n( *(at )?)/);
            ir = G && G[1] || "";
          }
        return `
` + ir + o;
      }
    }
    var yr = !1, Sr;
    {
      var Yr = typeof WeakMap == "function" ? WeakMap : Map;
      Sr = new Yr();
    }
    function Ar(o, d) {
      if (!o || yr)
        return "";
      {
        var M = Sr.get(o);
        if (M !== void 0)
          return M;
      }
      var G;
      yr = !0;
      var Q = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var Ce;
      Ce = Pr.current, Pr.current = null, Mr();
      try {
        if (d) {
          var Le = function() {
            throw Error();
          };
          if (Object.defineProperty(Le.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(Le, []);
            } catch (Vr) {
              G = Vr;
            }
            Reflect.construct(o, [], Le);
          } else {
            try {
              Le.call();
            } catch (Vr) {
              G = Vr;
            }
            o.call(Le.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (Vr) {
            G = Vr;
          }
          o();
        }
      } catch (Vr) {
        if (Vr && G && typeof Vr.stack == "string") {
          for (var We = Vr.stack.split(`
`), st = G.stack.split(`
`), It = We.length - 1, Ht = st.length - 1; It >= 1 && Ht >= 0 && We[It] !== st[Ht]; )
            Ht--;
          for (; It >= 1 && Ht >= 0; It--, Ht--)
            if (We[It] !== st[Ht]) {
              if (It !== 1 || Ht !== 1)
                do
                  if (It--, Ht--, Ht < 0 || We[It] !== st[Ht]) {
                    var cr = `
` + We[It].replace(" at new ", " at ");
                    return typeof o == "function" && Sr.set(o, cr), cr;
                  }
                while (It >= 1 && Ht >= 0);
              break;
            }
        }
      } finally {
        yr = !1, Pr.current = Ce, Rr(), Error.prepareStackTrace = Q;
      }
      var Qt = o ? o.displayName || o.name : "", hr = Qt ? Lr(Qt) : "";
      return typeof o == "function" && Sr.set(o, hr), hr;
    }
    function pr(o, d, M) {
      return Ar(o, !0);
    }
    function kr(o, d, M) {
      return Ar(o, !1);
    }
    function br(o) {
      var d = o.prototype;
      return !!(d && d.isReactComponent);
    }
    function Gr(o, d, M) {
      if (o == null)
        return "";
      if (typeof o == "function")
        return Ar(o, br(o));
      if (typeof o == "string")
        return Lr(o);
      switch (o) {
        case bt:
          return Lr("Suspense");
        case jt:
          return Lr("SuspenseList");
      }
      if (typeof o == "object")
        switch (o.$$typeof) {
          case Wt:
            return kr(o.render);
          case qt:
            return Gr(o.type, d, M);
          case Ut:
            return kr(o._render);
          case Yt: {
            var G = o, Q = G._payload, Ce = G._init;
            try {
              return Gr(Ce(Q), d, M);
            } catch {
            }
          }
        }
      return "";
    }
    function rn(o) {
      switch (o._debugOwner && o._debugOwner.type, o._debugSource, o.tag) {
        case g:
          return Lr(o.type);
        case P:
          return Lr("Lazy");
        case x:
          return Lr("Suspense");
        case L:
          return Lr("SuspenseList");
        case i:
        case v:
        case F:
          return kr(o.type);
        case S:
          return kr(o.type.render);
        case N:
          return kr(o.type._render);
        case l:
          return pr(o.type);
        default:
          return "";
      }
    }
    function cn(o) {
      try {
        var d = "", M = o;
        do
          d += rn(M), M = M.return;
        while (M);
        return d;
      } catch (G) {
        return `
Error generating stack: ` + G.message + `
` + G.stack;
      }
    }
    function Dr(o, d, M) {
      var G = d.displayName || d.name || "";
      return o.displayName || (G !== "" ? M + "(" + G + ")" : M);
    }
    function Se(o) {
      return o.displayName || "Context";
    }
    function ae(o) {
      if (o == null)
        return null;
      if (typeof o.tag == "number" && s("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof o == "function")
        return o.displayName || o.name || null;
      if (typeof o == "string")
        return o;
      switch (o) {
        case Tt:
          return "Fragment";
        case ct:
          return "Portal";
        case Ot:
          return "Profiler";
        case kt:
          return "StrictMode";
        case bt:
          return "Suspense";
        case jt:
          return "SuspenseList";
      }
      if (typeof o == "object")
        switch (o.$$typeof) {
          case xt:
            var d = o;
            return Se(d) + ".Consumer";
          case Rt:
            var M = o;
            return Se(M._context) + ".Provider";
          case Wt:
            return Dr(o, o.render, "ForwardRef");
          case qt:
            return ae(o.type);
          case Ut:
            return ae(o._render);
          case Yt: {
            var G = o, Q = G._payload, Ce = G._init;
            try {
              return ae(Ce(Q));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    var ft = a.ReactDebugCurrentFrame, rt = null, gt = !1;
    function wt() {
      {
        if (rt === null)
          return null;
        var o = rt._debugOwner;
        if (o !== null && typeof o < "u")
          return ae(o.type);
      }
      return null;
    }
    function Ct() {
      return rt === null ? "" : cn(rt);
    }
    function pt() {
      ft.getCurrentStack = null, rt = null, gt = !1;
    }
    function dt(o) {
      ft.getCurrentStack = Ct, rt = o, gt = !1;
    }
    function St(o) {
      gt = o;
    }
    function Ft() {
      return gt;
    }
    function Gt(o) {
      return "" + o;
    }
    function Lt(o) {
      switch (typeof o) {
        case "boolean":
        case "number":
        case "object":
        case "string":
        case "undefined":
          return o;
        default:
          return "";
      }
    }
    var $t = {
      button: !0,
      checkbox: !0,
      image: !0,
      hidden: !0,
      radio: !0,
      reset: !0,
      submit: !0
    };
    function _t(o, d) {
      $t[d.type] || d.onChange || d.onInput || d.readOnly || d.disabled || d.value == null || s("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."), d.onChange || d.readOnly || d.disabled || d.checked == null || s("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
    }
    function zt(o) {
      var d = o.type, M = o.nodeName;
      return M && M.toLowerCase() === "input" && (d === "checkbox" || d === "radio");
    }
    function tr(o) {
      return o._valueTracker;
    }
    function nr(o) {
      o._valueTracker = null;
    }
    function xr(o) {
      var d = "";
      return o && (zt(o) ? d = o.checked ? "true" : "false" : d = o.value), d;
    }
    function Er(o) {
      var d = zt(o) ? "checked" : "value", M = Object.getOwnPropertyDescriptor(o.constructor.prototype, d), G = "" + o[d];
      if (!(o.hasOwnProperty(d) || typeof M > "u" || typeof M.get != "function" || typeof M.set != "function")) {
        var Q = M.get, Ce = M.set;
        Object.defineProperty(o, d, {
          configurable: !0,
          get: function() {
            return Q.call(this);
          },
          set: function(We) {
            G = "" + We, Ce.call(this, We);
          }
        }), Object.defineProperty(o, d, {
          enumerable: M.enumerable
        });
        var Le = {
          getValue: function() {
            return G;
          },
          setValue: function(We) {
            G = "" + We;
          },
          stopTracking: function() {
            nr(o), delete o[d];
          }
        };
        return Le;
      }
    }
    function Jr(o) {
      tr(o) || (o._valueTracker = Er(o));
    }
    function Ur(o) {
      if (!o)
        return !1;
      var d = tr(o);
      if (!d)
        return !0;
      var M = d.getValue(), G = xr(o);
      return G !== M ? (d.setValue(G), !0) : !1;
    }
    function Br(o) {
      if (o = o || (typeof document < "u" ? document : void 0), typeof o > "u")
        return null;
      try {
        return o.activeElement || o.body;
      } catch {
        return o.body;
      }
    }
    var dn = !1, nn = !1, Sn = !1, ai = !1;
    function Dn(o) {
      var d = o.type === "checkbox" || o.type === "radio";
      return d ? o.checked != null : o.value != null;
    }
    function on(o, d) {
      var M = o, G = d.checked, Q = t({}, d, {
        defaultChecked: void 0,
        defaultValue: void 0,
        value: void 0,
        checked: G ?? M._wrapperState.initialChecked
      });
      return Q;
    }
    function ri(o, d) {
      _t("input", d), d.checked !== void 0 && d.defaultChecked !== void 0 && !nn && (s("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", wt() || "A component", d.type), nn = !0), d.value !== void 0 && d.defaultValue !== void 0 && !dn && (s("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", wt() || "A component", d.type), dn = !0);
      var M = o, G = d.defaultValue == null ? "" : d.defaultValue;
      M._wrapperState = {
        initialChecked: d.checked != null ? d.checked : d.defaultChecked,
        initialValue: Lt(d.value != null ? d.value : G),
        controlled: Dn(d)
      };
    }
    function Fi(o, d) {
      var M = o, G = d.checked;
      G != null && Ue(M, "checked", G, !1);
    }
    function Pi(o, d) {
      var M = o;
      {
        var G = Dn(d);
        !M._wrapperState.controlled && G && !ai && (s("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), ai = !0), M._wrapperState.controlled && !G && !Sn && (s("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), Sn = !0);
      }
      Fi(o, d);
      var Q = Lt(d.value), Ce = d.type;
      if (Q != null)
        Ce === "number" ? (Q === 0 && M.value === "" || // We explicitly want to coerce to number here if possible.
        // eslint-disable-next-line
        M.value != Q) && (M.value = Gt(Q)) : M.value !== Gt(Q) && (M.value = Gt(Q));
      else if (Ce === "submit" || Ce === "reset") {
        M.removeAttribute("value");
        return;
      }
      d.hasOwnProperty("value") ? Pn(M, d.type, Q) : d.hasOwnProperty("defaultValue") && Pn(M, d.type, Lt(d.defaultValue)), d.checked == null && d.defaultChecked != null && (M.defaultChecked = !!d.defaultChecked);
    }
    function pn(o, d, M) {
      var G = o;
      if (d.hasOwnProperty("value") || d.hasOwnProperty("defaultValue")) {
        var Q = d.type, Ce = Q === "submit" || Q === "reset";
        if (Ce && (d.value === void 0 || d.value === null))
          return;
        var Le = Gt(G._wrapperState.initialValue);
        M || Le !== G.value && (G.value = Le), G.defaultValue = Le;
      }
      var We = G.name;
      We !== "" && (G.name = ""), G.defaultChecked = !G.defaultChecked, G.defaultChecked = !!G._wrapperState.initialChecked, We !== "" && (G.name = We);
    }
    function hi(o, d) {
      var M = o;
      Pi(M, d), yn(M, d);
    }
    function yn(o, d) {
      var M = d.name;
      if (d.type === "radio" && M != null) {
        for (var G = o; G.parentNode; )
          G = G.parentNode;
        for (var Q = G.querySelectorAll("input[name=" + JSON.stringify("" + M) + '][type="radio"]'), Ce = 0; Ce < Q.length; Ce++) {
          var Le = Q[Ce];
          if (!(Le === o || Le.form !== o.form)) {
            var We = _y(Le);
            if (!We)
              throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
            Ur(Le), Pi(Le, We);
          }
        }
      }
    }
    function Pn(o, d, M) {
      // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
      (d !== "number" || Br(o.ownerDocument) !== o) && (M == null ? o.defaultValue = Gt(o._wrapperState.initialValue) : o.defaultValue !== Gt(M) && (o.defaultValue = Gt(M)));
    }
    var kn = !1, Wn = !1;
    function Ln(o) {
      var d = "";
      return e.Children.forEach(o, function(M) {
        M != null && (d += M);
      }), d;
    }
    function li(o, d) {
      typeof d.children == "object" && d.children !== null && e.Children.forEach(d.children, function(M) {
        M != null && (typeof M == "string" || typeof M == "number" || typeof M.type == "string" && (Wn || (Wn = !0, s("Only strings and numbers are supported as <option> children."))));
      }), d.selected != null && !kn && (s("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."), kn = !0);
    }
    function Bn(o, d) {
      d.value != null && o.setAttribute("value", Gt(Lt(d.value)));
    }
    function ci(o, d) {
      var M = t({
        children: void 0
      }, d), G = Ln(d.children);
      return G && (M.children = G), M;
    }
    var Gi;
    Gi = !1;
    function pi() {
      var o = wt();
      return o ? `

Check the render method of \`` + o + "`." : "";
    }
    var ei = ["value", "defaultValue"];
    function fa(o) {
      {
        _t("select", o);
        for (var d = 0; d < ei.length; d++) {
          var M = ei[d];
          if (o[M] != null) {
            var G = Array.isArray(o[M]);
            o.multiple && !G ? s("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", M, pi()) : !o.multiple && G && s("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", M, pi());
          }
        }
      }
    }
    function Hi(o, d, M, G) {
      var Q = o.options;
      if (d) {
        for (var Ce = M, Le = {}, We = 0; We < Ce.length; We++)
          Le["$" + Ce[We]] = !0;
        for (var st = 0; st < Q.length; st++) {
          var It = Le.hasOwnProperty("$" + Q[st].value);
          Q[st].selected !== It && (Q[st].selected = It), It && G && (Q[st].defaultSelected = !0);
        }
      } else {
        for (var Ht = Gt(Lt(M)), cr = null, Qt = 0; Qt < Q.length; Qt++) {
          if (Q[Qt].value === Ht) {
            Q[Qt].selected = !0, G && (Q[Qt].defaultSelected = !0);
            return;
          }
          cr === null && !Q[Qt].disabled && (cr = Q[Qt]);
        }
        cr !== null && (cr.selected = !0);
      }
    }
    function Ti(o, d) {
      return t({}, d, {
        value: void 0
      });
    }
    function Ui(o, d) {
      var M = o;
      fa(d), M._wrapperState = {
        wasMultiple: !!d.multiple
      }, d.value !== void 0 && d.defaultValue !== void 0 && !Gi && (s("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"), Gi = !0);
    }
    function la(o, d) {
      var M = o;
      M.multiple = !!d.multiple;
      var G = d.value;
      G != null ? Hi(M, !!d.multiple, G, !1) : d.defaultValue != null && Hi(M, !!d.multiple, d.defaultValue, !0);
    }
    function za(o, d) {
      var M = o, G = M._wrapperState.wasMultiple;
      M._wrapperState.wasMultiple = !!d.multiple;
      var Q = d.value;
      Q != null ? Hi(M, !!d.multiple, Q, !1) : G !== !!d.multiple && (d.defaultValue != null ? Hi(M, !!d.multiple, d.defaultValue, !0) : Hi(M, !!d.multiple, d.multiple ? [] : "", !1));
    }
    function ia(o, d) {
      var M = o, G = d.value;
      G != null && Hi(M, !!d.multiple, G, !1);
    }
    var aa = !1;
    function ao(o, d) {
      var M = o;
      if (d.dangerouslySetInnerHTML != null)
        throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
      var G = t({}, d, {
        value: void 0,
        defaultValue: void 0,
        children: Gt(M._wrapperState.initialValue)
      });
      return G;
    }
    function _o(o, d) {
      var M = o;
      _t("textarea", d), d.value !== void 0 && d.defaultValue !== void 0 && !aa && (s("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", wt() || "A component"), aa = !0);
      var G = d.value;
      if (G == null) {
        var Q = d.children, Ce = d.defaultValue;
        if (Q != null) {
          s("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
          {
            if (Ce != null)
              throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
            if (Array.isArray(Q)) {
              if (!(Q.length <= 1))
                throw Error("<textarea> can only have at most one child.");
              Q = Q[0];
            }
            Ce = Q;
          }
        }
        Ce == null && (Ce = ""), G = Ce;
      }
      M._wrapperState = {
        initialValue: Lt(G)
      };
    }
    function ji(o, d) {
      var M = o, G = Lt(d.value), Q = Lt(d.defaultValue);
      if (G != null) {
        var Ce = Gt(G);
        Ce !== M.value && (M.value = Ce), d.defaultValue == null && M.defaultValue !== Ce && (M.defaultValue = Ce);
      }
      Q != null && (M.defaultValue = Gt(Q));
    }
    function Bi(o, d) {
      var M = o, G = M.textContent;
      G === M._wrapperState.initialValue && G !== "" && G !== null && (M.value = G);
    }
    function ha(o, d) {
      ji(o, d);
    }
    var pa = "http://www.w3.org/1999/xhtml", oi = "http://www.w3.org/1998/Math/MathML", Ii = "http://www.w3.org/2000/svg", Qa = {
      html: pa,
      mathml: oi,
      svg: Ii
    };
    function vo(o) {
      switch (o) {
        case "svg":
          return Ii;
        case "math":
          return oi;
        default:
          return pa;
      }
    }
    function oo(o, d) {
      return o == null || o === pa ? vo(d) : o === Ii && d === "foreignObject" ? pa : o;
    }
    var tl = function(o) {
      return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(d, M, G, Q) {
        MSApp.execUnsafeLocalFunction(function() {
          return o(d, M, G, Q);
        });
      } : o;
    }, so, rl = tl(function(o, d) {
      if (o.namespaceURI === Qa.svg && !("innerHTML" in o)) {
        so = so || document.createElement("div"), so.innerHTML = "<svg>" + d.valueOf().toString() + "</svg>";
        for (var M = so.firstChild; o.firstChild; )
          o.removeChild(o.firstChild);
        for (; M.firstChild; )
          o.appendChild(M.firstChild);
        return;
      }
      o.innerHTML = d;
    }), Oa = 1, qa = 3, oa = 8, eo = 9, ff = 11, gu = function(o, d) {
      if (d) {
        var M = o.firstChild;
        if (M && M === o.lastChild && M.nodeType === qa) {
          M.nodeValue = d;
          return;
        }
      }
      o.textContent = d;
    }, jv = {
      animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
      background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
      backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
      border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
      borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
      borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
      borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
      borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
      borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
      borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
      borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
      borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
      borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
      borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
      borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
      borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
      borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
      columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
      columns: ["columnCount", "columnWidth"],
      flex: ["flexBasis", "flexGrow", "flexShrink"],
      flexFlow: ["flexDirection", "flexWrap"],
      font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
      fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
      gap: ["columnGap", "rowGap"],
      grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
      gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
      gridColumn: ["gridColumnEnd", "gridColumnStart"],
      gridColumnGap: ["columnGap"],
      gridGap: ["columnGap", "rowGap"],
      gridRow: ["gridRowEnd", "gridRowStart"],
      gridRowGap: ["rowGap"],
      gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
      listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
      margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
      marker: ["markerEnd", "markerMid", "markerStart"],
      mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
      maskPosition: ["maskPositionX", "maskPositionY"],
      outline: ["outlineColor", "outlineStyle", "outlineWidth"],
      overflow: ["overflowX", "overflowY"],
      padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
      placeContent: ["alignContent", "justifyContent"],
      placeItems: ["alignItems", "justifyItems"],
      placeSelf: ["alignSelf", "justifySelf"],
      textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
      textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
      transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
      wordWrap: ["overflowWrap"]
    }, nl = {
      animationIterationCount: !0,
      borderImageOutset: !0,
      borderImageSlice: !0,
      borderImageWidth: !0,
      boxFlex: !0,
      boxFlexGroup: !0,
      boxOrdinalGroup: !0,
      columnCount: !0,
      columns: !0,
      flex: !0,
      flexGrow: !0,
      flexPositive: !0,
      flexShrink: !0,
      flexNegative: !0,
      flexOrder: !0,
      gridArea: !0,
      gridRow: !0,
      gridRowEnd: !0,
      gridRowSpan: !0,
      gridRowStart: !0,
      gridColumn: !0,
      gridColumnEnd: !0,
      gridColumnSpan: !0,
      gridColumnStart: !0,
      fontWeight: !0,
      lineClamp: !0,
      lineHeight: !0,
      opacity: !0,
      order: !0,
      orphans: !0,
      tabSize: !0,
      widows: !0,
      zIndex: !0,
      zoom: !0,
      // SVG-related properties
      fillOpacity: !0,
      floodOpacity: !0,
      stopOpacity: !0,
      strokeDasharray: !0,
      strokeDashoffset: !0,
      strokeMiterlimit: !0,
      strokeOpacity: !0,
      strokeWidth: !0
    };
    function Jh(o, d) {
      return o + d.charAt(0).toUpperCase() + d.substring(1);
    }
    var Yv = ["Webkit", "ms", "Moz", "O"];
    Object.keys(nl).forEach(function(o) {
      Yv.forEach(function(d) {
        nl[Jh(d, o)] = nl[o];
      });
    });
    function hf(o, d, M) {
      var G = d == null || typeof d == "boolean" || d === "";
      return G ? "" : !M && typeof d == "number" && d !== 0 && !(nl.hasOwnProperty(o) && nl[o]) ? d + "px" : ("" + d).trim();
    }
    var Qh = /([A-Z])/g, fc = /^ms-/;
    function pf(o) {
      return o.replace(Qh, "-$1").toLowerCase().replace(fc, "-ms-");
    }
    var ud = function() {
    };
    {
      var qh = /^(?:webkit|moz|o)[A-Z]/, Ms = /^-ms-/, vf = /-(.)/g, cd = /;\s*$/, il = {}, Ds = {}, hc = !1, gf = !1, Xv = function(o) {
        return o.replace(vf, function(d, M) {
          return M.toUpperCase();
        });
      }, $v = function(o) {
        il.hasOwnProperty(o) && il[o] || (il[o] = !0, s(
          "Unsupported style property %s. Did you mean %s?",
          o,
          // As Andi Smith suggests
          // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
          // is converted to lowercase `ms`.
          Xv(o.replace(Ms, "ms-"))
        ));
      }, mf = function(o) {
        il.hasOwnProperty(o) && il[o] || (il[o] = !0, s("Unsupported vendor-prefixed style property %s. Did you mean %s?", o, o.charAt(0).toUpperCase() + o.slice(1)));
      }, mu = function(o, d) {
        Ds.hasOwnProperty(d) && Ds[d] || (Ds[d] = !0, s(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, o, d.replace(cd, "")));
      }, ep = function(o, d) {
        hc || (hc = !0, s("`NaN` is an invalid value for the `%s` css style property.", o));
      }, tp = function(o, d) {
        gf || (gf = !0, s("`Infinity` is an invalid value for the `%s` css style property.", o));
      };
      ud = function(o, d) {
        o.indexOf("-") > -1 ? $v(o) : qh.test(o) ? mf(o) : cd.test(d) && mu(o, d), typeof d == "number" && (isNaN(d) ? ep(o, d) : isFinite(d) || tp(o, d));
      };
    }
    var rp = ud;
    function np(o) {
      {
        var d = "", M = "";
        for (var G in o)
          if (o.hasOwnProperty(G)) {
            var Q = o[G];
            if (Q != null) {
              var Ce = G.indexOf("--") === 0;
              d += M + (Ce ? G : pf(G)) + ":", d += hf(G, Q, Ce), M = ";";
            }
          }
        return d || null;
      }
    }
    function yf(o, d) {
      var M = o.style;
      for (var G in d)
        if (d.hasOwnProperty(G)) {
          var Q = G.indexOf("--") === 0;
          Q || rp(G, d[G]);
          var Ce = hf(G, d[G], Q);
          G === "float" && (G = "cssFloat"), Q ? M.setProperty(G, Ce) : M[G] = Ce;
        }
    }
    function ip(o) {
      return o == null || typeof o == "boolean" || o === "";
    }
    function Ul(o) {
      var d = {};
      for (var M in o)
        for (var G = jv[M] || [M], Q = 0; Q < G.length; Q++)
          d[G[Q]] = M;
      return d;
    }
    function Zv(o, d) {
      {
        if (!d)
          return;
        var M = Ul(o), G = Ul(d), Q = {};
        for (var Ce in M) {
          var Le = M[Ce], We = G[Ce];
          if (We && Le !== We) {
            var st = Le + "," + We;
            if (Q[st])
              continue;
            Q[st] = !0, s("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", ip(o[Le]) ? "Removing" : "Updating", Le, We);
          }
        }
      }
    }
    var Kv = {
      area: !0,
      base: !0,
      br: !0,
      col: !0,
      embed: !0,
      hr: !0,
      img: !0,
      input: !0,
      keygen: !0,
      link: !0,
      meta: !0,
      param: !0,
      source: !0,
      track: !0,
      wbr: !0
      // NOTE: menuitem's close tag should be omitted, but that causes problems.
    }, Jv = t({
      menuitem: !0
    }, Kv), ap = "__html";
    function dd(o, d) {
      if (d) {
        if (Jv[o] && !(d.children == null && d.dangerouslySetInnerHTML == null))
          throw Error(o + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
        if (d.dangerouslySetInnerHTML != null) {
          if (d.children != null)
            throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
          if (!(typeof d.dangerouslySetInnerHTML == "object" && ap in d.dangerouslySetInnerHTML))
            throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
        }
        if (!d.suppressContentEditableWarning && d.contentEditable && d.children != null && s("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."), !(d.style == null || typeof d.style == "object"))
          throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
      }
    }
    function Uo(o, d) {
      if (o.indexOf("-") === -1)
        return typeof d.is == "string";
      switch (o) {
        case "annotation-xml":
        case "color-profile":
        case "font-face":
        case "font-face-src":
        case "font-face-uri":
        case "font-face-format":
        case "font-face-name":
        case "missing-glyph":
          return !1;
        default:
          return !0;
      }
    }
    var al = {
      // HTML
      accept: "accept",
      acceptcharset: "acceptCharset",
      "accept-charset": "acceptCharset",
      accesskey: "accessKey",
      action: "action",
      allowfullscreen: "allowFullScreen",
      alt: "alt",
      as: "as",
      async: "async",
      autocapitalize: "autoCapitalize",
      autocomplete: "autoComplete",
      autocorrect: "autoCorrect",
      autofocus: "autoFocus",
      autoplay: "autoPlay",
      autosave: "autoSave",
      capture: "capture",
      cellpadding: "cellPadding",
      cellspacing: "cellSpacing",
      challenge: "challenge",
      charset: "charSet",
      checked: "checked",
      children: "children",
      cite: "cite",
      class: "className",
      classid: "classID",
      classname: "className",
      cols: "cols",
      colspan: "colSpan",
      content: "content",
      contenteditable: "contentEditable",
      contextmenu: "contextMenu",
      controls: "controls",
      controlslist: "controlsList",
      coords: "coords",
      crossorigin: "crossOrigin",
      dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
      data: "data",
      datetime: "dateTime",
      default: "default",
      defaultchecked: "defaultChecked",
      defaultvalue: "defaultValue",
      defer: "defer",
      dir: "dir",
      disabled: "disabled",
      disablepictureinpicture: "disablePictureInPicture",
      disableremoteplayback: "disableRemotePlayback",
      download: "download",
      draggable: "draggable",
      enctype: "encType",
      enterkeyhint: "enterKeyHint",
      for: "htmlFor",
      form: "form",
      formmethod: "formMethod",
      formaction: "formAction",
      formenctype: "formEncType",
      formnovalidate: "formNoValidate",
      formtarget: "formTarget",
      frameborder: "frameBorder",
      headers: "headers",
      height: "height",
      hidden: "hidden",
      high: "high",
      href: "href",
      hreflang: "hrefLang",
      htmlfor: "htmlFor",
      httpequiv: "httpEquiv",
      "http-equiv": "httpEquiv",
      icon: "icon",
      id: "id",
      innerhtml: "innerHTML",
      inputmode: "inputMode",
      integrity: "integrity",
      is: "is",
      itemid: "itemID",
      itemprop: "itemProp",
      itemref: "itemRef",
      itemscope: "itemScope",
      itemtype: "itemType",
      keyparams: "keyParams",
      keytype: "keyType",
      kind: "kind",
      label: "label",
      lang: "lang",
      list: "list",
      loop: "loop",
      low: "low",
      manifest: "manifest",
      marginwidth: "marginWidth",
      marginheight: "marginHeight",
      max: "max",
      maxlength: "maxLength",
      media: "media",
      mediagroup: "mediaGroup",
      method: "method",
      min: "min",
      minlength: "minLength",
      multiple: "multiple",
      muted: "muted",
      name: "name",
      nomodule: "noModule",
      nonce: "nonce",
      novalidate: "noValidate",
      open: "open",
      optimum: "optimum",
      pattern: "pattern",
      placeholder: "placeholder",
      playsinline: "playsInline",
      poster: "poster",
      preload: "preload",
      profile: "profile",
      radiogroup: "radioGroup",
      readonly: "readOnly",
      referrerpolicy: "referrerPolicy",
      rel: "rel",
      required: "required",
      reversed: "reversed",
      role: "role",
      rows: "rows",
      rowspan: "rowSpan",
      sandbox: "sandbox",
      scope: "scope",
      scoped: "scoped",
      scrolling: "scrolling",
      seamless: "seamless",
      selected: "selected",
      shape: "shape",
      size: "size",
      sizes: "sizes",
      span: "span",
      spellcheck: "spellCheck",
      src: "src",
      srcdoc: "srcDoc",
      srclang: "srcLang",
      srcset: "srcSet",
      start: "start",
      step: "step",
      style: "style",
      summary: "summary",
      tabindex: "tabIndex",
      target: "target",
      title: "title",
      type: "type",
      usemap: "useMap",
      value: "value",
      width: "width",
      wmode: "wmode",
      wrap: "wrap",
      // SVG
      about: "about",
      accentheight: "accentHeight",
      "accent-height": "accentHeight",
      accumulate: "accumulate",
      additive: "additive",
      alignmentbaseline: "alignmentBaseline",
      "alignment-baseline": "alignmentBaseline",
      allowreorder: "allowReorder",
      alphabetic: "alphabetic",
      amplitude: "amplitude",
      arabicform: "arabicForm",
      "arabic-form": "arabicForm",
      ascent: "ascent",
      attributename: "attributeName",
      attributetype: "attributeType",
      autoreverse: "autoReverse",
      azimuth: "azimuth",
      basefrequency: "baseFrequency",
      baselineshift: "baselineShift",
      "baseline-shift": "baselineShift",
      baseprofile: "baseProfile",
      bbox: "bbox",
      begin: "begin",
      bias: "bias",
      by: "by",
      calcmode: "calcMode",
      capheight: "capHeight",
      "cap-height": "capHeight",
      clip: "clip",
      clippath: "clipPath",
      "clip-path": "clipPath",
      clippathunits: "clipPathUnits",
      cliprule: "clipRule",
      "clip-rule": "clipRule",
      color: "color",
      colorinterpolation: "colorInterpolation",
      "color-interpolation": "colorInterpolation",
      colorinterpolationfilters: "colorInterpolationFilters",
      "color-interpolation-filters": "colorInterpolationFilters",
      colorprofile: "colorProfile",
      "color-profile": "colorProfile",
      colorrendering: "colorRendering",
      "color-rendering": "colorRendering",
      contentscripttype: "contentScriptType",
      contentstyletype: "contentStyleType",
      cursor: "cursor",
      cx: "cx",
      cy: "cy",
      d: "d",
      datatype: "datatype",
      decelerate: "decelerate",
      descent: "descent",
      diffuseconstant: "diffuseConstant",
      direction: "direction",
      display: "display",
      divisor: "divisor",
      dominantbaseline: "dominantBaseline",
      "dominant-baseline": "dominantBaseline",
      dur: "dur",
      dx: "dx",
      dy: "dy",
      edgemode: "edgeMode",
      elevation: "elevation",
      enablebackground: "enableBackground",
      "enable-background": "enableBackground",
      end: "end",
      exponent: "exponent",
      externalresourcesrequired: "externalResourcesRequired",
      fill: "fill",
      fillopacity: "fillOpacity",
      "fill-opacity": "fillOpacity",
      fillrule: "fillRule",
      "fill-rule": "fillRule",
      filter: "filter",
      filterres: "filterRes",
      filterunits: "filterUnits",
      floodopacity: "floodOpacity",
      "flood-opacity": "floodOpacity",
      floodcolor: "floodColor",
      "flood-color": "floodColor",
      focusable: "focusable",
      fontfamily: "fontFamily",
      "font-family": "fontFamily",
      fontsize: "fontSize",
      "font-size": "fontSize",
      fontsizeadjust: "fontSizeAdjust",
      "font-size-adjust": "fontSizeAdjust",
      fontstretch: "fontStretch",
      "font-stretch": "fontStretch",
      fontstyle: "fontStyle",
      "font-style": "fontStyle",
      fontvariant: "fontVariant",
      "font-variant": "fontVariant",
      fontweight: "fontWeight",
      "font-weight": "fontWeight",
      format: "format",
      from: "from",
      fx: "fx",
      fy: "fy",
      g1: "g1",
      g2: "g2",
      glyphname: "glyphName",
      "glyph-name": "glyphName",
      glyphorientationhorizontal: "glyphOrientationHorizontal",
      "glyph-orientation-horizontal": "glyphOrientationHorizontal",
      glyphorientationvertical: "glyphOrientationVertical",
      "glyph-orientation-vertical": "glyphOrientationVertical",
      glyphref: "glyphRef",
      gradienttransform: "gradientTransform",
      gradientunits: "gradientUnits",
      hanging: "hanging",
      horizadvx: "horizAdvX",
      "horiz-adv-x": "horizAdvX",
      horizoriginx: "horizOriginX",
      "horiz-origin-x": "horizOriginX",
      ideographic: "ideographic",
      imagerendering: "imageRendering",
      "image-rendering": "imageRendering",
      in2: "in2",
      in: "in",
      inlist: "inlist",
      intercept: "intercept",
      k1: "k1",
      k2: "k2",
      k3: "k3",
      k4: "k4",
      k: "k",
      kernelmatrix: "kernelMatrix",
      kernelunitlength: "kernelUnitLength",
      kerning: "kerning",
      keypoints: "keyPoints",
      keysplines: "keySplines",
      keytimes: "keyTimes",
      lengthadjust: "lengthAdjust",
      letterspacing: "letterSpacing",
      "letter-spacing": "letterSpacing",
      lightingcolor: "lightingColor",
      "lighting-color": "lightingColor",
      limitingconeangle: "limitingConeAngle",
      local: "local",
      markerend: "markerEnd",
      "marker-end": "markerEnd",
      markerheight: "markerHeight",
      markermid: "markerMid",
      "marker-mid": "markerMid",
      markerstart: "markerStart",
      "marker-start": "markerStart",
      markerunits: "markerUnits",
      markerwidth: "markerWidth",
      mask: "mask",
      maskcontentunits: "maskContentUnits",
      maskunits: "maskUnits",
      mathematical: "mathematical",
      mode: "mode",
      numoctaves: "numOctaves",
      offset: "offset",
      opacity: "opacity",
      operator: "operator",
      order: "order",
      orient: "orient",
      orientation: "orientation",
      origin: "origin",
      overflow: "overflow",
      overlineposition: "overlinePosition",
      "overline-position": "overlinePosition",
      overlinethickness: "overlineThickness",
      "overline-thickness": "overlineThickness",
      paintorder: "paintOrder",
      "paint-order": "paintOrder",
      panose1: "panose1",
      "panose-1": "panose1",
      pathlength: "pathLength",
      patterncontentunits: "patternContentUnits",
      patterntransform: "patternTransform",
      patternunits: "patternUnits",
      pointerevents: "pointerEvents",
      "pointer-events": "pointerEvents",
      points: "points",
      pointsatx: "pointsAtX",
      pointsaty: "pointsAtY",
      pointsatz: "pointsAtZ",
      prefix: "prefix",
      preservealpha: "preserveAlpha",
      preserveaspectratio: "preserveAspectRatio",
      primitiveunits: "primitiveUnits",
      property: "property",
      r: "r",
      radius: "radius",
      refx: "refX",
      refy: "refY",
      renderingintent: "renderingIntent",
      "rendering-intent": "renderingIntent",
      repeatcount: "repeatCount",
      repeatdur: "repeatDur",
      requiredextensions: "requiredExtensions",
      requiredfeatures: "requiredFeatures",
      resource: "resource",
      restart: "restart",
      result: "result",
      results: "results",
      rotate: "rotate",
      rx: "rx",
      ry: "ry",
      scale: "scale",
      security: "security",
      seed: "seed",
      shaperendering: "shapeRendering",
      "shape-rendering": "shapeRendering",
      slope: "slope",
      spacing: "spacing",
      specularconstant: "specularConstant",
      specularexponent: "specularExponent",
      speed: "speed",
      spreadmethod: "spreadMethod",
      startoffset: "startOffset",
      stddeviation: "stdDeviation",
      stemh: "stemh",
      stemv: "stemv",
      stitchtiles: "stitchTiles",
      stopcolor: "stopColor",
      "stop-color": "stopColor",
      stopopacity: "stopOpacity",
      "stop-opacity": "stopOpacity",
      strikethroughposition: "strikethroughPosition",
      "strikethrough-position": "strikethroughPosition",
      strikethroughthickness: "strikethroughThickness",
      "strikethrough-thickness": "strikethroughThickness",
      string: "string",
      stroke: "stroke",
      strokedasharray: "strokeDasharray",
      "stroke-dasharray": "strokeDasharray",
      strokedashoffset: "strokeDashoffset",
      "stroke-dashoffset": "strokeDashoffset",
      strokelinecap: "strokeLinecap",
      "stroke-linecap": "strokeLinecap",
      strokelinejoin: "strokeLinejoin",
      "stroke-linejoin": "strokeLinejoin",
      strokemiterlimit: "strokeMiterlimit",
      "stroke-miterlimit": "strokeMiterlimit",
      strokewidth: "strokeWidth",
      "stroke-width": "strokeWidth",
      strokeopacity: "strokeOpacity",
      "stroke-opacity": "strokeOpacity",
      suppresscontenteditablewarning: "suppressContentEditableWarning",
      suppresshydrationwarning: "suppressHydrationWarning",
      surfacescale: "surfaceScale",
      systemlanguage: "systemLanguage",
      tablevalues: "tableValues",
      targetx: "targetX",
      targety: "targetY",
      textanchor: "textAnchor",
      "text-anchor": "textAnchor",
      textdecoration: "textDecoration",
      "text-decoration": "textDecoration",
      textlength: "textLength",
      textrendering: "textRendering",
      "text-rendering": "textRendering",
      to: "to",
      transform: "transform",
      typeof: "typeof",
      u1: "u1",
      u2: "u2",
      underlineposition: "underlinePosition",
      "underline-position": "underlinePosition",
      underlinethickness: "underlineThickness",
      "underline-thickness": "underlineThickness",
      unicode: "unicode",
      unicodebidi: "unicodeBidi",
      "unicode-bidi": "unicodeBidi",
      unicoderange: "unicodeRange",
      "unicode-range": "unicodeRange",
      unitsperem: "unitsPerEm",
      "units-per-em": "unitsPerEm",
      unselectable: "unselectable",
      valphabetic: "vAlphabetic",
      "v-alphabetic": "vAlphabetic",
      values: "values",
      vectoreffect: "vectorEffect",
      "vector-effect": "vectorEffect",
      version: "version",
      vertadvy: "vertAdvY",
      "vert-adv-y": "vertAdvY",
      vertoriginx: "vertOriginX",
      "vert-origin-x": "vertOriginX",
      vertoriginy: "vertOriginY",
      "vert-origin-y": "vertOriginY",
      vhanging: "vHanging",
      "v-hanging": "vHanging",
      videographic: "vIdeographic",
      "v-ideographic": "vIdeographic",
      viewbox: "viewBox",
      viewtarget: "viewTarget",
      visibility: "visibility",
      vmathematical: "vMathematical",
      "v-mathematical": "vMathematical",
      vocab: "vocab",
      widths: "widths",
      wordspacing: "wordSpacing",
      "word-spacing": "wordSpacing",
      writingmode: "writingMode",
      "writing-mode": "writingMode",
      x1: "x1",
      x2: "x2",
      x: "x",
      xchannelselector: "xChannelSelector",
      xheight: "xHeight",
      "x-height": "xHeight",
      xlinkactuate: "xlinkActuate",
      "xlink:actuate": "xlinkActuate",
      xlinkarcrole: "xlinkArcrole",
      "xlink:arcrole": "xlinkArcrole",
      xlinkhref: "xlinkHref",
      "xlink:href": "xlinkHref",
      xlinkrole: "xlinkRole",
      "xlink:role": "xlinkRole",
      xlinkshow: "xlinkShow",
      "xlink:show": "xlinkShow",
      xlinktitle: "xlinkTitle",
      "xlink:title": "xlinkTitle",
      xlinktype: "xlinkType",
      "xlink:type": "xlinkType",
      xmlbase: "xmlBase",
      "xml:base": "xmlBase",
      xmllang: "xmlLang",
      "xml:lang": "xmlLang",
      xmlns: "xmlns",
      "xml:space": "xmlSpace",
      xmlnsxlink: "xmlnsXlink",
      "xmlns:xlink": "xmlnsXlink",
      xmlspace: "xmlSpace",
      y1: "y1",
      y2: "y2",
      y: "y",
      ychannelselector: "yChannelSelector",
      z: "z",
      zoomandpan: "zoomAndPan"
    }, Cf = {
      "aria-current": 0,
      // state
      "aria-details": 0,
      "aria-disabled": 0,
      // state
      "aria-hidden": 0,
      // state
      "aria-invalid": 0,
      // state
      "aria-keyshortcuts": 0,
      "aria-label": 0,
      "aria-roledescription": 0,
      // Widget Attributes
      "aria-autocomplete": 0,
      "aria-checked": 0,
      "aria-expanded": 0,
      "aria-haspopup": 0,
      "aria-level": 0,
      "aria-modal": 0,
      "aria-multiline": 0,
      "aria-multiselectable": 0,
      "aria-orientation": 0,
      "aria-placeholder": 0,
      "aria-pressed": 0,
      "aria-readonly": 0,
      "aria-required": 0,
      "aria-selected": 0,
      "aria-sort": 0,
      "aria-valuemax": 0,
      "aria-valuemin": 0,
      "aria-valuenow": 0,
      "aria-valuetext": 0,
      // Live Region Attributes
      "aria-atomic": 0,
      "aria-busy": 0,
      "aria-live": 0,
      "aria-relevant": 0,
      // Drag-and-Drop Attributes
      "aria-dropeffect": 0,
      "aria-grabbed": 0,
      // Relationship Attributes
      "aria-activedescendant": 0,
      "aria-colcount": 0,
      "aria-colindex": 0,
      "aria-colspan": 0,
      "aria-controls": 0,
      "aria-describedby": 0,
      "aria-errormessage": 0,
      "aria-flowto": 0,
      "aria-labelledby": 0,
      "aria-owns": 0,
      "aria-posinset": 0,
      "aria-rowcount": 0,
      "aria-rowindex": 0,
      "aria-rowspan": 0,
      "aria-setsize": 0
    }, as = {}, op = new RegExp("^(aria)-[" + we + "]*$"), bf = new RegExp("^(aria)[A-Z][" + we + "]*$"), wf = Object.prototype.hasOwnProperty;
    function Sf(o, d) {
      {
        if (wf.call(as, d) && as[d])
          return !0;
        if (bf.test(d)) {
          var M = "aria-" + d.slice(4).toLowerCase(), G = Cf.hasOwnProperty(M) ? M : null;
          if (G == null)
            return s("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", d), as[d] = !0, !0;
          if (d !== G)
            return s("Invalid ARIA attribute `%s`. Did you mean `%s`?", d, G), as[d] = !0, !0;
        }
        if (op.test(d)) {
          var Q = d.toLowerCase(), Ce = Cf.hasOwnProperty(Q) ? Q : null;
          if (Ce == null)
            return as[d] = !0, !1;
          if (d !== Ce)
            return s("Unknown ARIA attribute `%s`. Did you mean `%s`?", d, Ce), as[d] = !0, !0;
        }
      }
      return !0;
    }
    function jl(o, d) {
      {
        var M = [];
        for (var G in d) {
          var Q = Sf(o, G);
          Q || M.push(G);
        }
        var Ce = M.map(function(Le) {
          return "`" + Le + "`";
        }).join(", ");
        M.length === 1 ? s("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", Ce, o) : M.length > 1 && s("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", Ce, o);
      }
    }
    function sp(o, d) {
      Uo(o, d) || jl(o, d);
    }
    var xf = !1;
    function Qv(o, d) {
      {
        if (o !== "input" && o !== "textarea" && o !== "select")
          return;
        d != null && d.value === null && !xf && (xf = !0, o === "select" && d.multiple ? s("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", o) : s("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", o));
      }
    }
    var lp = function() {
    };
    {
      var Wa = {}, qv = Object.prototype.hasOwnProperty, up = /^on./, Eo = /^on[^A-Z]/, cp = new RegExp("^(aria)-[" + we + "]*$"), pc = new RegExp("^(aria)[A-Z][" + we + "]*$");
      lp = function(o, d, M, G) {
        if (qv.call(Wa, d) && Wa[d])
          return !0;
        var Q = d.toLowerCase();
        if (Q === "onfocusin" || Q === "onfocusout")
          return s("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."), Wa[d] = !0, !0;
        if (G != null) {
          var Ce = G.registrationNameDependencies, Le = G.possibleRegistrationNames;
          if (Ce.hasOwnProperty(d))
            return !0;
          var We = Le.hasOwnProperty(Q) ? Le[Q] : null;
          if (We != null)
            return s("Invalid event handler property `%s`. Did you mean `%s`?", d, We), Wa[d] = !0, !0;
          if (up.test(d))
            return s("Unknown event handler property `%s`. It will be ignored.", d), Wa[d] = !0, !0;
        } else if (up.test(d))
          return Eo.test(d) && s("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", d), Wa[d] = !0, !0;
        if (cp.test(d) || pc.test(d))
          return !0;
        if (Q === "innerhtml")
          return s("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."), Wa[d] = !0, !0;
        if (Q === "aria")
          return s("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."), Wa[d] = !0, !0;
        if (Q === "is" && M !== null && M !== void 0 && typeof M != "string")
          return s("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof M), Wa[d] = !0, !0;
        if (typeof M == "number" && isNaN(M))
          return s("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", d), Wa[d] = !0, !0;
        var st = he(d), It = st !== null && st.type === ne;
        if (al.hasOwnProperty(Q)) {
          var Ht = al[Q];
          if (Ht !== d)
            return s("Invalid DOM property `%s`. Did you mean `%s`?", d, Ht), Wa[d] = !0, !0;
        } else if (!It && d !== Q)
          return s("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", d, Q), Wa[d] = !0, !0;
        return typeof M == "boolean" && fe(d, M, st, !1) ? (M ? s('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', M, d, d, M, d) : s('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', M, d, d, M, d, d, d), Wa[d] = !0, !0) : It ? !0 : fe(d, M, st, !1) ? (Wa[d] = !0, !1) : ((M === "false" || M === "true") && st !== null && st.type === ue && (s("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", M, d, M === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', d, M), Wa[d] = !0), !0);
      };
    }
    var dp = function(o, d, M) {
      {
        var G = [];
        for (var Q in d) {
          var Ce = lp(o, Q, d[Q], M);
          Ce || G.push(Q);
        }
        var Le = G.map(function(We) {
          return "`" + We + "`";
        }).join(", ");
        G.length === 1 ? s("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", Le, o) : G.length > 1 && s("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", Le, o);
      }
    };
    function fp(o, d, M) {
      Uo(o, d) || dp(o, d, M);
    }
    var Tf = 1, fd = 2, ol = 4, hp = 16, yu = Tf | fd | ol;
    function vc(o) {
      var d = o.target || o.srcElement || window;
      return d.correspondingUseElement && (d = d.correspondingUseElement), d.nodeType === qa ? d.parentNode : d;
    }
    var jo = null, Mo = null, _a = null;
    function Rf(o) {
      var d = Od(o);
      if (d) {
        if (typeof jo != "function")
          throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
        var M = d.stateNode;
        if (M) {
          var G = _y(M);
          jo(d.stateNode, d.type, G);
        }
      }
    }
    function Af(o) {
      jo = o;
    }
    function Cu(o) {
      Mo ? _a ? _a.push(o) : _a = [o] : Mo = o;
    }
    function eg() {
      return Mo !== null || _a !== null;
    }
    function hd() {
      if (Mo) {
        var o = Mo, d = _a;
        if (Mo = null, _a = null, Rf(o), d)
          for (var M = 0; M < d.length; M++)
            Rf(d[M]);
      }
    }
    var pd = function(o, d) {
      return o(d);
    }, Vi = function(o, d, M, G, Q) {
      return o(d, M, G, Q);
    }, vd = function() {
    }, Ef = pd, Fs = !1, bu = !1;
    function wu() {
      var o = eg();
      o && (vd(), hd());
    }
    function gc(o, d) {
      if (Fs)
        return o(d);
      Fs = !0;
      try {
        return pd(o, d);
      } finally {
        Fs = !1, wu();
      }
    }
    function gd(o, d, M) {
      if (bu)
        return o(d, M);
      bu = !0;
      try {
        return Ef(o, d, M);
      } finally {
        bu = !1, wu();
      }
    }
    function Su(o, d, M, G, Q) {
      var Ce = Fs;
      Fs = !0;
      try {
        return Vi(o, d, M, G, Q);
      } finally {
        Fs = Ce, Fs || wu();
      }
    }
    function pp(o) {
      Fs || vd();
    }
    function mc(o, d, M, G) {
      pd = o, Vi = d, vd = M, Ef = G;
    }
    function Mf(o) {
      return o === "button" || o === "input" || o === "select" || o === "textarea";
    }
    function Df(o, d, M) {
      switch (o) {
        case "onClick":
        case "onClickCapture":
        case "onDoubleClick":
        case "onDoubleClickCapture":
        case "onMouseDown":
        case "onMouseDownCapture":
        case "onMouseMove":
        case "onMouseMoveCapture":
        case "onMouseUp":
        case "onMouseUpCapture":
        case "onMouseEnter":
          return !!(M.disabled && Mf(d));
        default:
          return !1;
      }
    }
    function sl(o, d) {
      var M = o.stateNode;
      if (M === null)
        return null;
      var G = _y(M);
      if (G === null)
        return null;
      var Q = G[d];
      if (Df(d, o.type, G))
        return null;
      if (!(!Q || typeof Q == "function"))
        throw Error("Expected `" + d + "` listener to be a function, instead got a value of `" + typeof Q + "` type.");
      return Q;
    }
    var xu = !1;
    if (U)
      try {
        var Yl = {};
        Object.defineProperty(Yl, "passive", {
          get: function() {
            xu = !0;
          }
        }), window.addEventListener("test", Yl, Yl), window.removeEventListener("test", Yl, Yl);
      } catch {
        xu = !1;
      }
    function Ff(o, d, M, G, Q, Ce, Le, We, st) {
      var It = Array.prototype.slice.call(arguments, 3);
      try {
        d.apply(M, It);
      } catch (Ht) {
        this.onError(Ht);
      }
    }
    var md = Ff;
    if (typeof window < "u" && typeof window.dispatchEvent == "function" && typeof document < "u" && typeof document.createEvent == "function") {
      var ll = document.createElement("react");
      md = function(d, M, G, Q, Ce, Le, We, st, It) {
        if (!(typeof document < "u"))
          throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
        var Ht = document.createEvent("Event"), cr = !1, Qt = !0, hr = window.event, Vr = Object.getOwnPropertyDescriptor(window, "event");
        function sn() {
          ll.removeEventListener(Ir, ii, !1), typeof window.event < "u" && window.hasOwnProperty("event") && (window.event = hr);
        }
        var Gn = Array.prototype.slice.call(arguments, 3);
        function ii() {
          cr = !0, sn(), M.apply(G, Gn), Qt = !1;
        }
        var jn, Si = !1, qi = !1;
        function fr(sr) {
          if (jn = sr.error, Si = !0, jn === null && sr.colno === 0 && sr.lineno === 0 && (qi = !0), sr.defaultPrevented && jn != null && typeof jn == "object")
            try {
              jn._suppressLogging = !0;
            } catch {
            }
        }
        var Ir = "react-" + (d || "invokeguardedcallback");
        if (window.addEventListener("error", fr), ll.addEventListener(Ir, ii, !1), Ht.initEvent(Ir, !1, !1), ll.dispatchEvent(Ht), Vr && Object.defineProperty(window, "event", Vr), cr && Qt && (Si ? qi && (jn = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")) : jn = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`), this.onError(jn)), window.removeEventListener("error", fr), !cr)
          return sn(), Ff.apply(this, arguments);
      };
    }
    var Pf = md, Ps = !1, yc = null, Is = !1, Do = null, yd = {
      onError: function(o) {
        Ps = !0, yc = o;
      }
    };
    function to(o, d, M, G, Q, Ce, Le, We, st) {
      Ps = !1, yc = null, Pf.apply(yd, arguments);
    }
    function vp(o, d, M, G, Q, Ce, Le, We, st) {
      if (to.apply(this, arguments), Ps) {
        var It = Ua();
        Is || (Is = !0, Do = It);
      }
    }
    function Xl() {
      if (Is) {
        var o = Do;
        throw Is = !1, Do = null, o;
      }
    }
    function go() {
      return Ps;
    }
    function Ua() {
      if (Ps) {
        var o = yc;
        return Ps = !1, yc = null, o;
      } else
        throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
    }
    function os(o) {
      return o._reactInternals;
    }
    function Cd(o) {
      return o._reactInternals !== void 0;
    }
    function bd(o, d) {
      o._reactInternals = d;
    }
    var Ci = (
      /*                      */
      0
    ), xa = (
      /*                */
      1
    ), Yn = (
      /*                    */
      2
    ), On = (
      /*                       */
      4
    ), Ls = (
      /*           */
      6
    ), Ji = (
      /*                     */
      8
    ), Na = (
      /*                 */
      16
    ), ks = (
      /*                     */
      32
    ), bi = (
      /*                   */
      64
    ), Ta = (
      /*                          */
      128
    ), Fo = (
      /*                     */
      256
    ), ul = (
      /*                      */
      512
    ), $l = (
      /*     */
      8192
    ), Po = (
      /*                    */
      1024
    ), If = (
      /*           */
      1028
    ), Tu = (
      /*          */
      932
    ), cl = (
      /*               */
      2047
    ), Cc = (
      /*                   */
      2048
    ), Yo = (
      /*                */
      4096
    ), bc = (
      /* */
      16384
    ), tg = a.ReactCurrentOwner;
    function Os(o) {
      var d = o, M = o;
      if (o.alternate)
        for (; d.return; )
          d = d.return;
      else {
        var G = d;
        do
          d = G, (d.flags & (Yn | Po)) !== Ci && (M = d.return), G = d.return;
        while (G);
      }
      return d.tag === f ? M : null;
    }
    function wc(o) {
      if (o.tag === x) {
        var d = o.memoizedState;
        if (d === null) {
          var M = o.alternate;
          M !== null && (d = M.memoizedState);
        }
        if (d !== null)
          return d.dehydrated;
      }
      return null;
    }
    function Lf(o) {
      return o.tag === f ? o.stateNode.containerInfo : null;
    }
    function Sc(o) {
      return Os(o) === o;
    }
    function gp(o) {
      {
        var d = tg.current;
        if (d !== null && d.tag === l) {
          var M = d, G = M.stateNode;
          G._warnedAboutRefsInRender || s("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", ae(M.type) || "A component"), G._warnedAboutRefsInRender = !0;
        }
      }
      var Q = os(o);
      return Q ? Os(Q) === Q : !1;
    }
    function Ru(o) {
      if (Os(o) !== o)
        throw Error("Unable to find node on an unmounted component.");
    }
    function kf(o) {
      var d = o.alternate;
      if (!d) {
        var M = Os(o);
        if (M === null)
          throw Error("Unable to find node on an unmounted component.");
        return M !== o ? null : o;
      }
      for (var G = o, Q = d; ; ) {
        var Ce = G.return;
        if (Ce === null)
          break;
        var Le = Ce.alternate;
        if (Le === null) {
          var We = Ce.return;
          if (We !== null) {
            G = Q = We;
            continue;
          }
          break;
        }
        if (Ce.child === Le.child) {
          for (var st = Ce.child; st; ) {
            if (st === G)
              return Ru(Ce), o;
            if (st === Q)
              return Ru(Ce), d;
            st = st.sibling;
          }
          throw Error("Unable to find node on an unmounted component.");
        }
        if (G.return !== Q.return)
          G = Ce, Q = Le;
        else {
          for (var It = !1, Ht = Ce.child; Ht; ) {
            if (Ht === G) {
              It = !0, G = Ce, Q = Le;
              break;
            }
            if (Ht === Q) {
              It = !0, Q = Ce, G = Le;
              break;
            }
            Ht = Ht.sibling;
          }
          if (!It) {
            for (Ht = Le.child; Ht; ) {
              if (Ht === G) {
                It = !0, G = Le, Q = Ce;
                break;
              }
              if (Ht === Q) {
                It = !0, Q = Le, G = Ce;
                break;
              }
              Ht = Ht.sibling;
            }
            if (!It)
              throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
          }
        }
        if (G.alternate !== Q)
          throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
      }
      if (G.tag !== f)
        throw Error("Unable to find node on an unmounted component.");
      return G.stateNode.current === G ? o : d;
    }
    function Of(o) {
      var d = kf(o);
      if (!d)
        return null;
      for (var M = d; ; ) {
        if (M.tag === g || M.tag === y)
          return M;
        if (M.child) {
          M.child.return = M, M = M.child;
          continue;
        }
        if (M === d)
          return null;
        for (; !M.sibling; ) {
          if (!M.return || M.return === d)
            return null;
          M = M.return;
        }
        M.sibling.return = M.return, M = M.sibling;
      }
      return null;
    }
    function wd(o) {
      var d = kf(o);
      if (!d)
        return null;
      for (var M = d; ; ) {
        if (M.tag === g || M.tag === y || re)
          return M;
        if (M.child && M.tag !== p) {
          M.child.return = M, M = M.child;
          continue;
        }
        if (M === d)
          return null;
        for (; !M.sibling; ) {
          if (!M.return || M.return === d)
            return null;
          M = M.return;
        }
        M.sibling.return = M.return, M = M.sibling;
      }
      return null;
    }
    function Nf(o, d) {
      for (var M = d, G = o.alternate; M !== null; ) {
        if (M === o || M === G)
          return !0;
        M = M.return;
      }
      return !1;
    }
    var ss;
    function Zl(o) {
      ss = o;
    }
    var dl;
    function Gf(o) {
      dl = o;
    }
    var Ra;
    function fl(o) {
      Ra = o;
    }
    var mo;
    function hl(o) {
      mo = o;
    }
    var Kl = !1, va = [], Xo = null, pl = null, Aa = null, vl = /* @__PURE__ */ new Map(), $o = /* @__PURE__ */ new Map(), Io = [];
    function xc() {
      return va.length > 0;
    }
    var Hf = [
      "mousedown",
      "mouseup",
      "touchcancel",
      "touchend",
      "touchstart",
      "auxclick",
      "dblclick",
      "pointercancel",
      "pointerdown",
      "pointerup",
      "dragend",
      "dragstart",
      "drop",
      "compositionend",
      "compositionstart",
      "keydown",
      "keypress",
      "keyup",
      "input",
      "textInput",
      // Intentionally camelCase
      "copy",
      "cut",
      "paste",
      "click",
      "change",
      "contextmenu",
      "reset",
      "submit"
    ];
    function Sd(o) {
      return Hf.indexOf(o) > -1;
    }
    function Bf(o, d, M, G, Q) {
      return {
        blockedOn: o,
        domEventName: d,
        eventSystemFlags: M | hp,
        nativeEvent: Q,
        targetContainers: [G]
      };
    }
    function Ea(o, d, M, G, Q) {
      var Ce = Bf(o, d, M, G, Q);
      va.push(Ce);
    }
    function lo(o, d) {
      switch (o) {
        case "focusin":
        case "focusout":
          Xo = null;
          break;
        case "dragenter":
        case "dragleave":
          pl = null;
          break;
        case "mouseover":
        case "mouseout":
          Aa = null;
          break;
        case "pointerover":
        case "pointerout": {
          var M = d.pointerId;
          vl.delete(M);
          break;
        }
        case "gotpointercapture":
        case "lostpointercapture": {
          var G = d.pointerId;
          $o.delete(G);
          break;
        }
      }
    }
    function yo(o, d, M, G, Q, Ce) {
      if (o === null || o.nativeEvent !== Ce) {
        var Le = Bf(d, M, G, Q, Ce);
        if (d !== null) {
          var We = Od(d);
          We !== null && dl(We);
        }
        return Le;
      }
      o.eventSystemFlags |= G;
      var st = o.targetContainers;
      return Q !== null && st.indexOf(Q) === -1 && st.push(Q), o;
    }
    function ls(o, d, M, G, Q) {
      switch (d) {
        case "focusin": {
          var Ce = Q;
          return Xo = yo(Xo, o, d, M, G, Ce), !0;
        }
        case "dragenter": {
          var Le = Q;
          return pl = yo(pl, o, d, M, G, Le), !0;
        }
        case "mouseover": {
          var We = Q;
          return Aa = yo(Aa, o, d, M, G, We), !0;
        }
        case "pointerover": {
          var st = Q, It = st.pointerId;
          return vl.set(It, yo(vl.get(It) || null, o, d, M, G, st)), !0;
        }
        case "gotpointercapture": {
          var Ht = Q, cr = Ht.pointerId;
          return $o.set(cr, yo($o.get(cr) || null, o, d, M, G, Ht)), !0;
        }
      }
      return !1;
    }
    function xd(o) {
      var d = ah(o.target);
      if (d !== null) {
        var M = Os(d);
        if (M !== null) {
          var G = M.tag;
          if (G === x) {
            var Q = wc(M);
            if (Q !== null) {
              o.blockedOn = Q, mo(o.lanePriority, function() {
                r.unstable_runWithPriority(o.priority, function() {
                  Ra(M);
                });
              });
              return;
            }
          } else if (G === f) {
            var Ce = M.stateNode;
            if (Ce.hydrate) {
              o.blockedOn = Lf(M);
              return;
            }
          }
        }
      }
      o.blockedOn = null;
    }
    function Co(o) {
      if (o.blockedOn !== null)
        return !1;
      for (var d = o.targetContainers; d.length > 0; ) {
        var M = d[0], G = jf(o.domEventName, o.eventSystemFlags, M, o.nativeEvent);
        if (G !== null) {
          var Q = Od(G);
          return Q !== null && dl(Q), o.blockedOn = G, !1;
        }
        d.shift();
      }
      return !0;
    }
    function Ns(o, d, M) {
      Co(o) && M.delete(d);
    }
    function mp() {
      for (Kl = !1; va.length > 0; ) {
        var o = va[0];
        if (o.blockedOn !== null) {
          var d = Od(o.blockedOn);
          d !== null && ss(d);
          break;
        }
        for (var M = o.targetContainers; M.length > 0; ) {
          var G = M[0], Q = jf(o.domEventName, o.eventSystemFlags, G, o.nativeEvent);
          if (Q !== null) {
            o.blockedOn = Q;
            break;
          }
          M.shift();
        }
        o.blockedOn === null && va.shift();
      }
      Xo !== null && Co(Xo) && (Xo = null), pl !== null && Co(pl) && (pl = null), Aa !== null && Co(Aa) && (Aa = null), vl.forEach(Ns), $o.forEach(Ns);
    }
    function Gs(o, d) {
      o.blockedOn === d && (o.blockedOn = null, Kl || (Kl = !0, r.unstable_scheduleCallback(r.unstable_NormalPriority, mp)));
    }
    function Td(o) {
      if (va.length > 0) {
        Gs(va[0], o);
        for (var d = 1; d < va.length; d++) {
          var M = va[d];
          M.blockedOn === o && (M.blockedOn = null);
        }
      }
      Xo !== null && Gs(Xo, o), pl !== null && Gs(pl, o), Aa !== null && Gs(Aa, o);
      var G = function(We) {
        return Gs(We, o);
      };
      vl.forEach(G), $o.forEach(G);
      for (var Q = 0; Q < Io.length; Q++) {
        var Ce = Io[Q];
        Ce.blockedOn === o && (Ce.blockedOn = null);
      }
      for (; Io.length > 0; ) {
        var Le = Io[0];
        if (Le.blockedOn !== null)
          break;
        xd(Le), Le.blockedOn === null && Io.shift();
      }
    }
    var Tc = 0, Au = 1, Jl = 2;
    function Rc(o, d) {
      var M = {};
      return M[o.toLowerCase()] = d.toLowerCase(), M["Webkit" + o] = "webkit" + d, M["Moz" + o] = "moz" + d, M;
    }
    var gl = {
      animationend: Rc("Animation", "AnimationEnd"),
      animationiteration: Rc("Animation", "AnimationIteration"),
      animationstart: Rc("Animation", "AnimationStart"),
      transitionend: Rc("Transition", "TransitionEnd")
    }, Rd = {}, Ad = {};
    U && (Ad = document.createElement("div").style, "AnimationEvent" in window || (delete gl.animationend.animation, delete gl.animationiteration.animation, delete gl.animationstart.animation), "TransitionEvent" in window || delete gl.transitionend.transition);
    function Ql(o) {
      if (Rd[o])
        return Rd[o];
      if (!gl[o])
        return o;
      var d = gl[o];
      for (var M in d)
        if (d.hasOwnProperty(M) && M in Ad)
          return Rd[o] = d[M];
      return o;
    }
    var ql = Ql("animationend"), Eu = Ql("animationiteration"), Mu = Ql("animationstart"), Du = Ql("transitionend"), Fu = /* @__PURE__ */ new Map(), ml = /* @__PURE__ */ new Map(), uo = [
      "cancel",
      "cancel",
      "click",
      "click",
      "close",
      "close",
      "contextmenu",
      "contextMenu",
      "copy",
      "copy",
      "cut",
      "cut",
      "auxclick",
      "auxClick",
      "dblclick",
      "doubleClick",
      // Careful!
      "dragend",
      "dragEnd",
      "dragstart",
      "dragStart",
      "drop",
      "drop",
      "focusin",
      "focus",
      // Careful!
      "focusout",
      "blur",
      // Careful!
      "input",
      "input",
      "invalid",
      "invalid",
      "keydown",
      "keyDown",
      "keypress",
      "keyPress",
      "keyup",
      "keyUp",
      "mousedown",
      "mouseDown",
      "mouseup",
      "mouseUp",
      "paste",
      "paste",
      "pause",
      "pause",
      "play",
      "play",
      "pointercancel",
      "pointerCancel",
      "pointerdown",
      "pointerDown",
      "pointerup",
      "pointerUp",
      "ratechange",
      "rateChange",
      "reset",
      "reset",
      "seeked",
      "seeked",
      "submit",
      "submit",
      "touchcancel",
      "touchCancel",
      "touchend",
      "touchEnd",
      "touchstart",
      "touchStart",
      "volumechange",
      "volumeChange"
    ], Yi = ["change", "selectionchange", "textInput", "compositionstart", "compositionend", "compositionupdate"], Pu = ["drag", "drag", "dragenter", "dragEnter", "dragexit", "dragExit", "dragleave", "dragLeave", "dragover", "dragOver", "mousemove", "mouseMove", "mouseout", "mouseOut", "mouseover", "mouseOver", "pointermove", "pointerMove", "pointerout", "pointerOut", "pointerover", "pointerOver", "scroll", "scroll", "toggle", "toggle", "touchmove", "touchMove", "wheel", "wheel"], bo = ["abort", "abort", ql, "animationEnd", Eu, "animationIteration", Mu, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", Du, "transitionEnd", "waiting", "waiting"];
    function yl(o, d) {
      for (var M = 0; M < o.length; M += 2) {
        var G = o[M], Q = o[M + 1], Ce = Q[0].toUpperCase() + Q.slice(1), Le = "on" + Ce;
        ml.set(G, d), Fu.set(G, Le), ce(Le, [G]);
      }
    }
    function Cl(o, d) {
      for (var M = 0; M < o.length; M++)
        ml.set(o[M], d);
    }
    function yp(o) {
      var d = ml.get(o);
      return d === void 0 ? Jl : d;
    }
    function Ac() {
      yl(uo, Tc), yl(Pu, Au), yl(bo, Jl), Cl(Yi, Tc);
    }
    var Xi = r.unstable_now;
    if (!(n.__interactionsRef != null && n.__interactionsRef.current != null))
      throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
    var Iu = 99, us = 98, Hs = 97, cs = 96, Vf = 95, Ed = 90;
    Xi();
    var bl = 15, Ec = 14, R = 13, B = 12, J = 11, de = 10, pe = 9, ye = 8, ke = 7, Ee = 6, He = 5, Ke = 4, Qe = 3, yt = 2, mt = 1, Bt = 0, Zt = 31, qe = (
      /*                        */
      0
    ), Et = (
      /*                          */
      0
    ), Dt = (
      /*                        */
      1
    ), Xt = (
      /*                 */
      2
    ), Kt = (
      /*      */
      4
    ), Vt = (
      /*                    */
      24
    ), wr = (
      /*           */
      32
    ), Wr = (
      /*                  */
      192
    ), Xr = (
      /*            */
      256
    ), _r = (
      /*                   */
      3584
    ), en = (
      /*                */
      4096
    ), Qr = (
      /*                       */
      4186112
    ), En = (
      /*                            */
      62914560
    ), qr = (
      /*                  */
      33554432
    ), An = (
      /*          */
      67108864
    ), ti = (
      /*                                 */
      134217727
    ), $i = (
      /*               */
      134217728
    ), ui = (
      /*                             */
      805306368
    ), Nr = (
      /*                   */
      1073741824
    ), un = -1;
    function Nn(o) {
    }
    var xn = ye;
    function wi(o) {
      if ((Dt & o) !== qe)
        return xn = bl, Dt;
      if ((Xt & o) !== qe)
        return xn = Ec, Xt;
      if ((Kt & o) !== qe)
        return xn = R, Kt;
      var d = Vt & o;
      if (d !== qe)
        return xn = B, d;
      if ((o & wr) !== qe)
        return xn = J, wr;
      var M = Wr & o;
      if (M !== qe)
        return xn = de, M;
      if ((o & Xr) !== qe)
        return xn = pe, Xr;
      var G = _r & o;
      if (G !== qe)
        return xn = ye, G;
      if ((o & en) !== qe)
        return xn = ke, en;
      var Q = Qr & o;
      if (Q !== qe)
        return xn = Ee, Q;
      var Ce = En & o;
      if (Ce !== qe)
        return xn = He, Ce;
      if (o & An)
        return xn = Ke, An;
      if ((o & $i) !== qe)
        return xn = Qe, $i;
      var Le = ui & o;
      return Le !== qe ? (xn = yt, Le) : (Nr & o) !== qe ? (xn = mt, Nr) : (s("Should have found matching lanes. This is a bug in React."), xn = ye, o);
    }
    function ea(o) {
      switch (o) {
        case Iu:
          return bl;
        case us:
          return de;
        case Hs:
        case cs:
          return ye;
        case Vf:
          return yt;
        default:
          return Bt;
      }
    }
    function ua(o) {
      switch (o) {
        case bl:
        case Ec:
          return Iu;
        case R:
        case B:
        case J:
        case de:
          return us;
        case pe:
        case ye:
        case ke:
        case Ee:
        case Ke:
        case He:
          return Hs;
        case Qe:
        case yt:
        case mt:
          return Vf;
        case Bt:
          return Ed;
        default:
          throw Error("Invalid update priority: " + o + ". This is a bug in React.");
      }
    }
    function ga(o, d) {
      var M = o.pendingLanes;
      if (M === qe)
        return xn = Bt, qe;
      var G = qe, Q = Bt, Ce = o.expiredLanes, Le = o.suspendedLanes, We = o.pingedLanes;
      if (Ce !== qe)
        G = Ce, Q = xn = bl;
      else {
        var st = M & ti;
        if (st !== qe) {
          var It = st & ~Le;
          if (It !== qe)
            G = wi(It), Q = xn;
          else {
            var Ht = st & We;
            Ht !== qe && (G = wi(Ht), Q = xn);
          }
        } else {
          var cr = M & ~Le;
          cr !== qe ? (G = wi(cr), Q = xn) : We !== qe && (G = wi(We), Q = xn);
        }
      }
      if (G === qe)
        return qe;
      if (G = M & Sl(G), d !== qe && d !== G && // If we already suspended with a delay, then interrupting is fine. Don't
      // bother waiting until the root is complete.
      (d & Le) === qe) {
        wi(d);
        var Qt = xn;
        if (Q <= Qt)
          return d;
        xn = Q;
      }
      var hr = o.entangledLanes;
      if (hr !== qe)
        for (var Vr = o.entanglements, sn = G & hr; sn > 0; ) {
          var Gn = Zo(sn), ii = 1 << Gn;
          G |= Vr[Gn], sn &= ~ii;
        }
      return G;
    }
    function ro(o, d) {
      for (var M = o.eventTimes, G = un; d > 0; ) {
        var Q = Zo(d), Ce = 1 << Q, Le = M[Q];
        Le > G && (G = Le), d &= ~Ce;
      }
      return G;
    }
    function ja(o, d) {
      wi(o);
      var M = xn;
      return M >= de ? d + 250 : M >= Ee ? d + 5e3 : un;
    }
    function co(o, d) {
      for (var M = o.pendingLanes, G = o.suspendedLanes, Q = o.pingedLanes, Ce = o.expirationTimes, Le = M; Le > 0; ) {
        var We = Zo(Le), st = 1 << We, It = Ce[We];
        It === un ? ((st & G) === qe || (st & Q) !== qe) && (Ce[We] = ja(st, d)) : It <= d && (o.expiredLanes |= st), Le &= ~st;
      }
    }
    function Ri(o) {
      var d = o.pendingLanes & ~Nr;
      return d !== qe ? d : d & Nr ? Nr : qe;
    }
    function Li() {
      return xn;
    }
    function Bs(o) {
      return (o & ti) !== qe;
    }
    function zf(o) {
      return (o & En) === o;
    }
    function Lo(o) {
      return (o & Qr) === o;
    }
    function ta(o, d) {
      switch (o) {
        case Bt:
          break;
        case bl:
          return Dt;
        case Ec:
          return Xt;
        case B: {
          var M = Zi(Vt & ~d);
          return M === Et ? ta(de, d) : M;
        }
        case de: {
          var G = Zi(Wr & ~d);
          return G === Et ? ta(ye, d) : G;
        }
        case ye: {
          var Q = Zi(_r & ~d);
          return Q === Et && (Q = Zi(Qr & ~d), Q === Et && (Q = Zi(_r))), Q;
        }
        case Ee:
        case He:
          break;
        case yt:
          var Ce = Zi(ui & ~d);
          return Ce === Et && (Ce = Zi(ui)), Ce;
      }
      throw Error("Invalid update priority: " + o + ". This is a bug in React.");
    }
    function wo(o, d) {
      var M = Zi(Qr & ~d);
      return M === Et && (M = Zi(Qr & ~o), M === Et && (M = Zi(Qr))), M;
    }
    function ko(o) {
      var d = Zi(En & ~o);
      return d === Et && (d = Zi(En)), d;
    }
    function So(o) {
      return o & -o;
    }
    function wl(o) {
      var d = 31 - dy(o);
      return d < 0 ? qe : 1 << d;
    }
    function Sl(o) {
      return (wl(o) << 1) - 1;
    }
    function Zi(o) {
      return So(o);
    }
    function Zo(o) {
      return 31 - dy(o);
    }
    function Wf(o) {
      return Zo(o);
    }
    function no(o, d) {
      return (o & d) !== qe;
    }
    function Lu(o, d) {
      return (o & d) === d;
    }
    function xi(o, d) {
      return o | d;
    }
    function Md(o, d) {
      return o & ~d;
    }
    function tb(o) {
      return o;
    }
    function eu(o, d) {
      return o !== Et && o < d ? o : d;
    }
    function Cp(o) {
      for (var d = [], M = 0; M < Zt; M++)
        d.push(o);
      return d;
    }
    function Dd(o, d, M) {
      o.pendingLanes |= d;
      var G = d - 1;
      o.suspendedLanes &= G, o.pingedLanes &= G;
      var Q = o.eventTimes, Ce = Wf(d);
      Q[Ce] = M;
    }
    function uy(o, d) {
      o.suspendedLanes |= d, o.pingedLanes &= ~d;
      for (var M = o.expirationTimes, G = d; G > 0; ) {
        var Q = Zo(G), Ce = 1 << Q;
        M[Q] = un, G &= ~Ce;
      }
    }
    function rg(o, d, M) {
      o.pingedLanes |= o.suspendedLanes & d;
    }
    function _f(o) {
      o.expiredLanes |= Vt & o.pendingLanes;
    }
    function rb(o) {
      return (o & Vt) !== qe;
    }
    function cy(o, d) {
      o.mutableReadLanes |= d & o.pendingLanes;
    }
    function ng(o, d) {
      var M = o.pendingLanes & ~d;
      o.pendingLanes = d, o.suspendedLanes = 0, o.pingedLanes = 0, o.expiredLanes &= d, o.mutableReadLanes &= d, o.entangledLanes &= d;
      for (var G = o.entanglements, Q = o.eventTimes, Ce = o.expirationTimes, Le = M; Le > 0; ) {
        var We = Zo(Le), st = 1 << We;
        G[We] = qe, Q[We] = un, Ce[We] = un, Le &= ~st;
      }
    }
    function ig(o, d) {
      o.entangledLanes |= d;
      for (var M = o.entanglements, G = d; G > 0; ) {
        var Q = Zo(G), Ce = 1 << Q;
        M[Q] |= d, G &= ~Ce;
      }
    }
    var dy = Math.clz32 ? Math.clz32 : nb, fy = Math.log, hy = Math.LN2;
    function nb(o) {
      return o === 0 ? 32 : 31 - (fy(o) / hy | 0) | 0;
    }
    var py = r.unstable_UserBlockingPriority, ib = r.unstable_runWithPriority, ag = !0;
    function og(o) {
      ag = !!o;
    }
    function vy() {
      return ag;
    }
    function gy(o, d, M) {
      var G = yp(d), Q;
      switch (G) {
        case Tc:
          Q = my;
          break;
        case Au:
          Q = yy;
          break;
        case Jl:
        default:
          Q = Uf;
          break;
      }
      return Q.bind(null, d, M, o);
    }
    function my(o, d, M, G) {
      pp(G.timeStamp), Su(Uf, o, d, M, G);
    }
    function yy(o, d, M, G) {
      ib(py, Uf.bind(null, o, d, M, G));
    }
    function Uf(o, d, M, G) {
      if (ag) {
        var Q = !0;
        if (Q = (d & ol) === 0, Q && xc() && Sd(o)) {
          Ea(
            null,
            // Flags that we're not actually blocked on anything as far as we know.
            o,
            d,
            M,
            G
          );
          return;
        }
        var Ce = jf(o, d, M, G);
        if (Ce === null) {
          Q && lo(o, G);
          return;
        }
        if (Q) {
          if (Sd(o)) {
            Ea(Ce, o, d, M, G);
            return;
          }
          if (ls(Ce, o, d, M, G))
            return;
          lo(o, G);
        }
        HR(o, d, G, null, M);
      }
    }
    function jf(o, d, M, G) {
      var Q = vc(G), Ce = ah(Q);
      if (Ce !== null) {
        var Le = Os(Ce);
        if (Le === null)
          Ce = null;
        else {
          var We = Le.tag;
          if (We === x) {
            var st = wc(Le);
            if (st !== null)
              return st;
            Ce = null;
          } else if (We === f) {
            var It = Le.stateNode;
            if (It.hydrate)
              return Lf(Le);
            Ce = null;
          } else Le !== Ce && (Ce = null);
        }
      }
      return HR(o, d, G, Ce, M), null;
    }
    function Cy(o, d, M) {
      return o.addEventListener(d, M, !1), M;
    }
    function sg(o, d, M) {
      return o.addEventListener(d, M, !0), M;
    }
    function by(o, d, M, G) {
      return o.addEventListener(d, M, {
        capture: !0,
        passive: G
      }), M;
    }
    function ab(o, d, M, G) {
      return o.addEventListener(d, M, {
        passive: G
      }), M;
    }
    var Yf = null, Fd = null, Mc = null;
    function Zn(o) {
      return Yf = o, Fd = io(), !0;
    }
    function xo() {
      Yf = null, Fd = null, Mc = null;
    }
    function Ma() {
      if (Mc)
        return Mc;
      var o, d = Fd, M = d.length, G, Q = io(), Ce = Q.length;
      for (o = 0; o < M && d[o] === Q[o]; o++)
        ;
      var Le = M - o;
      for (G = 1; G <= Le && d[M - G] === Q[Ce - G]; G++)
        ;
      var We = G > 1 ? 1 - G : void 0;
      return Mc = Q.slice(o, We), Mc;
    }
    function io() {
      return "value" in Yf ? Yf.value : Yf.textContent;
    }
    function xl(o) {
      var d, M = o.keyCode;
      return "charCode" in o ? (d = o.charCode, d === 0 && M === 13 && (d = 13)) : d = M, d === 10 && (d = 13), d >= 32 || d === 13 ? d : 0;
    }
    function Pd() {
      return !0;
    }
    function Ya() {
      return !1;
    }
    function fo(o) {
      function d(M, G, Q, Ce, Le) {
        this._reactName = M, this._targetInst = Q, this.type = G, this.nativeEvent = Ce, this.target = Le, this.currentTarget = null;
        for (var We in o)
          if (o.hasOwnProperty(We)) {
            var st = o[We];
            st ? this[We] = st(Ce) : this[We] = Ce[We];
          }
        var It = Ce.defaultPrevented != null ? Ce.defaultPrevented : Ce.returnValue === !1;
        return It ? this.isDefaultPrevented = Pd : this.isDefaultPrevented = Ya, this.isPropagationStopped = Ya, this;
      }
      return t(d.prototype, {
        preventDefault: function() {
          this.defaultPrevented = !0;
          var M = this.nativeEvent;
          M && (M.preventDefault ? M.preventDefault() : typeof M.returnValue != "unknown" && (M.returnValue = !1), this.isDefaultPrevented = Pd);
        },
        stopPropagation: function() {
          var M = this.nativeEvent;
          M && (M.stopPropagation ? M.stopPropagation() : typeof M.cancelBubble != "unknown" && (M.cancelBubble = !0), this.isPropagationStopped = Pd);
        },
        /**
         * We release all dispatched `SyntheticEvent`s after each event loop, adding
         * them back into the pool. This allows a way to hold onto a reference that
         * won't be added back into the pool.
         */
        persist: function() {
        },
        /**
         * Checks if this event should be released back into the pool.
         *
         * @return {boolean} True if this should not be released, false otherwise.
         */
        isPersistent: Pd
      }), d;
    }
    var Vs = {
      eventPhase: 0,
      bubbles: 0,
      cancelable: 0,
      timeStamp: function(o) {
        return o.timeStamp || Date.now();
      },
      defaultPrevented: 0,
      isTrusted: 0
    }, Dc = fo(Vs), Tl = t({}, Vs, {
      view: 0,
      detail: 0
    }), lg = fo(Tl), Xf, $f, Fc;
    function Id(o) {
      o !== Fc && (Fc && o.type === "mousemove" ? (Xf = o.screenX - Fc.screenX, $f = o.screenY - Fc.screenY) : (Xf = 0, $f = 0), Fc = o);
    }
    var Cn = t({}, Tl, {
      screenX: 0,
      screenY: 0,
      clientX: 0,
      clientY: 0,
      pageX: 0,
      pageY: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      getModifierState: Al,
      button: 0,
      buttons: 0,
      relatedTarget: function(o) {
        return o.relatedTarget === void 0 ? o.fromElement === o.srcElement ? o.toElement : o.fromElement : o.relatedTarget;
      },
      movementX: function(o) {
        return "movementX" in o ? o.movementX : (Id(o), Xf);
      },
      movementY: function(o) {
        return "movementY" in o ? o.movementY : $f;
      }
    }), Zf = fo(Cn), ug = t({}, Cn, {
      dataTransfer: 0
    }), Rl = fo(ug), ku = t({}, Tl, {
      relatedTarget: 0
    }), Pc = fo(ku), Kf = t({}, Vs, {
      animationName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), cg = fo(Kf), dg = t({}, Vs, {
      clipboardData: function(o) {
        return "clipboardData" in o ? o.clipboardData : window.clipboardData;
      }
    }), tu = fo(dg), Jf = t({}, Vs, {
      data: 0
    }), bp = fo(Jf), wp = bp, ru = {
      Esc: "Escape",
      Spacebar: " ",
      Left: "ArrowLeft",
      Up: "ArrowUp",
      Right: "ArrowRight",
      Down: "ArrowDown",
      Del: "Delete",
      Win: "OS",
      Menu: "ContextMenu",
      Apps: "ContextMenu",
      Scroll: "ScrollLock",
      MozPrintableKey: "Unidentified"
    }, Sp = {
      8: "Backspace",
      9: "Tab",
      12: "Clear",
      13: "Enter",
      16: "Shift",
      17: "Control",
      18: "Alt",
      19: "Pause",
      20: "CapsLock",
      27: "Escape",
      32: " ",
      33: "PageUp",
      34: "PageDown",
      35: "End",
      36: "Home",
      37: "ArrowLeft",
      38: "ArrowUp",
      39: "ArrowRight",
      40: "ArrowDown",
      45: "Insert",
      46: "Delete",
      112: "F1",
      113: "F2",
      114: "F3",
      115: "F4",
      116: "F5",
      117: "F6",
      118: "F7",
      119: "F8",
      120: "F9",
      121: "F10",
      122: "F11",
      123: "F12",
      144: "NumLock",
      145: "ScrollLock",
      224: "Meta"
    };
    function Qf(o) {
      if (o.key) {
        var d = ru[o.key] || o.key;
        if (d !== "Unidentified")
          return d;
      }
      if (o.type === "keypress") {
        var M = xl(o);
        return M === 13 ? "Enter" : String.fromCharCode(M);
      }
      return o.type === "keydown" || o.type === "keyup" ? Sp[o.keyCode] || "Unidentified" : "";
    }
    var xp = {
      Alt: "altKey",
      Control: "ctrlKey",
      Meta: "metaKey",
      Shift: "shiftKey"
    };
    function Ko(o) {
      var d = this, M = d.nativeEvent;
      if (M.getModifierState)
        return M.getModifierState(o);
      var G = xp[o];
      return G ? !!M[G] : !1;
    }
    function Al(o) {
      return Ko;
    }
    var Ou = t({}, Tl, {
      key: Qf,
      code: 0,
      location: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      repeat: 0,
      locale: 0,
      getModifierState: Al,
      // Legacy Interface
      charCode: function(o) {
        return o.type === "keypress" ? xl(o) : 0;
      },
      keyCode: function(o) {
        return o.type === "keydown" || o.type === "keyup" ? o.keyCode : 0;
      },
      which: function(o) {
        return o.type === "keypress" ? xl(o) : o.type === "keydown" || o.type === "keyup" ? o.keyCode : 0;
      }
    }), Tp = fo(Ou), ds = t({}, Cn, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0
    }), fg = fo(ds), Ld = t({}, Tl, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: Al
    }), hg = fo(Ld), ob = t({}, Vs, {
      propertyName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), wy = fo(ob), Sy = t({}, Cn, {
      deltaX: function(o) {
        return "deltaX" in o ? o.deltaX : (
          // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
          "wheelDeltaX" in o ? -o.wheelDeltaX : 0
        );
      },
      deltaY: function(o) {
        return "deltaY" in o ? o.deltaY : (
          // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
          "wheelDeltaY" in o ? -o.wheelDeltaY : (
            // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
            "wheelDelta" in o ? -o.wheelDelta : 0
          )
        );
      },
      deltaZ: 0,
      // Browsers without "deltaMode" is reporting in raw wheel delta where one
      // notch on the scroll is always +/- 120, roughly equivalent to pixels.
      // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
      // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
      deltaMode: 0
    }), Rp = fo(Sy), pg = [9, 13, 27, 32], Ic = 229, Ap = U && "CompositionEvent" in window, kd = null;
    U && "documentMode" in document && (kd = document.documentMode);
    var qf = U && "TextEvent" in window && !kd, xy = U && (!Ap || kd && kd > 8 && kd <= 11), Ty = 32, vg = String.fromCharCode(Ty);
    function Ry() {
      ce("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), ce("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]), ce("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]), ce("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
    }
    var Nu = !1;
    function sb(o) {
      return (o.ctrlKey || o.altKey || o.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
      !(o.ctrlKey && o.altKey);
    }
    function lb(o) {
      switch (o) {
        case "compositionstart":
          return "onCompositionStart";
        case "compositionend":
          return "onCompositionEnd";
        case "compositionupdate":
          return "onCompositionUpdate";
      }
    }
    function Gu(o, d) {
      return o === "keydown" && d.keyCode === Ic;
    }
    function Ay(o, d) {
      switch (o) {
        case "keyup":
          return pg.indexOf(d.keyCode) !== -1;
        case "keydown":
          return d.keyCode !== Ic;
        case "keypress":
        case "mousedown":
        case "focusout":
          return !0;
        default:
          return !1;
      }
    }
    function gg(o) {
      var d = o.detail;
      return typeof d == "object" && "data" in d ? d.data : null;
    }
    function Ey(o) {
      return o.locale === "ko";
    }
    var Lc = !1;
    function Hu(o, d, M, G, Q) {
      var Ce, Le;
      if (Ap ? Ce = lb(d) : Lc ? Ay(d, G) && (Ce = "onCompositionEnd") : Gu(d, G) && (Ce = "onCompositionStart"), !Ce)
        return null;
      xy && !Ey(G) && (!Lc && Ce === "onCompositionStart" ? Lc = Zn(Q) : Ce === "onCompositionEnd" && Lc && (Le = Ma()));
      var We = Iy(M, Ce);
      if (We.length > 0) {
        var st = new bp(Ce, d, null, G, Q);
        if (o.push({
          event: st,
          listeners: We
        }), Le)
          st.data = Le;
        else {
          var It = gg(G);
          It !== null && (st.data = It);
        }
      }
    }
    function ub(o, d) {
      switch (o) {
        case "compositionend":
          return gg(d);
        case "keypress":
          var M = d.which;
          return M !== Ty ? null : (Nu = !0, vg);
        case "textInput":
          var G = d.data;
          return G === vg && Nu ? null : G;
        default:
          return null;
      }
    }
    function cb(o, d) {
      if (Lc) {
        if (o === "compositionend" || !Ap && Ay(o, d)) {
          var M = Ma();
          return xo(), Lc = !1, M;
        }
        return null;
      }
      switch (o) {
        case "paste":
          return null;
        case "keypress":
          if (!sb(d)) {
            if (d.char && d.char.length > 1)
              return d.char;
            if (d.which)
              return String.fromCharCode(d.which);
          }
          return null;
        case "compositionend":
          return xy && !Ey(d) ? null : d.data;
        default:
          return null;
      }
    }
    function My(o, d, M, G, Q) {
      var Ce;
      if (qf ? Ce = ub(d, G) : Ce = cb(d, G), !Ce)
        return null;
      var Le = Iy(M, "onBeforeInput");
      if (Le.length > 0) {
        var We = new wp("onBeforeInput", "beforeinput", null, G, Q);
        o.push({
          event: We,
          listeners: Le
        }), We.data = Ce;
      }
    }
    function db(o, d, M, G, Q, Ce, Le) {
      Hu(o, d, M, G, Q), My(o, d, M, G, Q);
    }
    var fs = {
      color: !0,
      date: !0,
      datetime: !0,
      "datetime-local": !0,
      email: !0,
      month: !0,
      number: !0,
      password: !0,
      range: !0,
      search: !0,
      tel: !0,
      text: !0,
      time: !0,
      url: !0,
      week: !0
    };
    function Ep(o) {
      var d = o && o.nodeName && o.nodeName.toLowerCase();
      return d === "input" ? !!fs[o.type] : d === "textarea";
    }
    /**
     * Checks if an event is supported in the current execution environment.
     *
     * NOTE: This will not work correctly for non-generic events such as `change`,
     * `reset`, `load`, `error`, and `select`.
     *
     * Borrows from Modernizr.
     *
     * @param {string} eventNameSuffix Event name, e.g. "click".
     * @return {boolean} True if the event is supported.
     * @internal
     * @license Modernizr 3.0.0pre (Custom Build) | MIT
     */
    function fb(o) {
      if (!U)
        return !1;
      var d = "on" + o, M = d in document;
      if (!M) {
        var G = document.createElement("div");
        G.setAttribute(d, "return;"), M = typeof G[d] == "function";
      }
      return M;
    }
    function Bu() {
      ce("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
    }
    function eh(o, d, M, G) {
      Cu(G);
      var Q = Iy(d, "onChange");
      if (Q.length > 0) {
        var Ce = new Dc("onChange", "change", null, M, G);
        o.push({
          event: Ce,
          listeners: Q
        });
      }
    }
    var El = null, kc = null;
    function mg(o) {
      var d = o.nodeName && o.nodeName.toLowerCase();
      return d === "select" || d === "input" && o.type === "file";
    }
    function yg(o) {
      var d = [];
      eh(d, kc, o, vc(o)), gc(hb, d);
    }
    function hb(o) {
      IR(o, 0);
    }
    function Mp(o) {
      var d = Gp(o);
      if (Ur(d))
        return o;
    }
    function Dp(o, d) {
      if (o === "change")
        return d;
    }
    var Fp = !1;
    U && (Fp = fb("input") && (!document.documentMode || document.documentMode > 9));
    function Dy(o, d) {
      El = o, kc = d, El.attachEvent("onpropertychange", Fy);
    }
    function Pp() {
      El && (El.detachEvent("onpropertychange", Fy), El = null, kc = null);
    }
    function Fy(o) {
      o.propertyName === "value" && Mp(kc) && yg(o);
    }
    function Cg(o, d, M) {
      o === "focusin" ? (Pp(), Dy(d, M)) : o === "focusout" && Pp();
    }
    function th(o, d) {
      if (o === "selectionchange" || o === "keyup" || o === "keydown")
        return Mp(kc);
    }
    function pb(o) {
      var d = o.nodeName;
      return d && d.toLowerCase() === "input" && (o.type === "checkbox" || o.type === "radio");
    }
    function Ip(o, d) {
      if (o === "click")
        return Mp(d);
    }
    function Py(o, d) {
      if (o === "input" || o === "change")
        return Mp(d);
    }
    function vb(o) {
      var d = o._wrapperState;
      !d || !d.controlled || o.type !== "number" || Pn(o, "number", o.value);
    }
    function rh(o, d, M, G, Q, Ce, Le) {
      var We = M ? Gp(M) : window, st, It;
      if (mg(We) ? st = Dp : Ep(We) ? Fp ? st = Py : (st = th, It = Cg) : pb(We) && (st = Ip), st) {
        var Ht = st(d, M);
        if (Ht) {
          eh(o, Ht, G, Q);
          return;
        }
      }
      It && It(d, We, M), d === "focusout" && vb(We);
    }
    function gb() {
      X("onMouseEnter", ["mouseout", "mouseover"]), X("onMouseLeave", ["mouseout", "mouseover"]), X("onPointerEnter", ["pointerout", "pointerover"]), X("onPointerLeave", ["pointerout", "pointerover"]);
    }
    function Lp(o, d, M, G, Q, Ce, Le) {
      var We = d === "mouseover" || d === "pointerover", st = d === "mouseout" || d === "pointerout";
      if (We && !(Ce & hp)) {
        var It = G.relatedTarget || G.fromElement;
        if (It && (ah(It) || Wy(It)))
          return;
      }
      if (!(!st && !We)) {
        var Ht;
        if (Q.window === Q)
          Ht = Q;
        else {
          var cr = Q.ownerDocument;
          cr ? Ht = cr.defaultView || cr.parentWindow : Ht = window;
        }
        var Qt, hr;
        if (st) {
          var Vr = G.relatedTarget || G.toElement;
          if (Qt = M, hr = Vr ? ah(Vr) : null, hr !== null) {
            var sn = Os(hr);
            (hr !== sn || hr.tag !== g && hr.tag !== y) && (hr = null);
          }
        } else
          Qt = null, hr = M;
        if (Qt !== hr) {
          var Gn = Zf, ii = "onMouseLeave", jn = "onMouseEnter", Si = "mouse";
          (d === "pointerout" || d === "pointerover") && (Gn = fg, ii = "onPointerLeave", jn = "onPointerEnter", Si = "pointer");
          var qi = Qt == null ? Ht : Gp(Qt), fr = hr == null ? Ht : Gp(hr), Ir = new Gn(ii, Si + "leave", Qt, G, Q);
          Ir.target = qi, Ir.relatedTarget = fr;
          var sr = null, Zr = ah(Q);
          if (Zr === M) {
            var fn = new Gn(jn, Si + "enter", hr, G, Q);
            fn.target = fr, fn.relatedTarget = qi, sr = fn;
          }
          sO(o, Ir, sr, Qt, hr);
        }
      }
    }
    function b(o, d) {
      return o === d && (o !== 0 || 1 / o === 1 / d) || o !== o && d !== d;
    }
    var D = typeof Object.is == "function" ? Object.is : b, H = Object.prototype.hasOwnProperty;
    function ge(o, d) {
      if (D(o, d))
        return !0;
      if (typeof o != "object" || o === null || typeof d != "object" || d === null)
        return !1;
      var M = Object.keys(o), G = Object.keys(d);
      if (M.length !== G.length)
        return !1;
      for (var Q = 0; Q < M.length; Q++)
        if (!H.call(d, M[Q]) || !D(o[M[Q]], d[M[Q]]))
          return !1;
      return !0;
    }
    function Pe(o) {
      for (; o && o.firstChild; )
        o = o.firstChild;
      return o;
    }
    function $e(o) {
      for (; o; ) {
        if (o.nextSibling)
          return o.nextSibling;
        o = o.parentNode;
      }
    }
    function ht(o, d) {
      for (var M = Pe(o), G = 0, Q = 0; M; ) {
        if (M.nodeType === qa) {
          if (Q = G + M.textContent.length, G <= d && Q >= d)
            return {
              node: M,
              offset: d - G
            };
          G = Q;
        }
        M = Pe($e(M));
      }
    }
    function Mt(o) {
      var d = o.ownerDocument, M = d && d.defaultView || window, G = M.getSelection && M.getSelection();
      if (!G || G.rangeCount === 0)
        return null;
      var Q = G.anchorNode, Ce = G.anchorOffset, Le = G.focusNode, We = G.focusOffset;
      try {
        Q.nodeType, Le.nodeType;
      } catch {
        return null;
      }
      return Jt(o, Q, Ce, Le, We);
    }
    function Jt(o, d, M, G, Q) {
      var Ce = 0, Le = -1, We = -1, st = 0, It = 0, Ht = o, cr = null;
      e: for (; ; ) {
        for (var Qt = null; Ht === d && (M === 0 || Ht.nodeType === qa) && (Le = Ce + M), Ht === G && (Q === 0 || Ht.nodeType === qa) && (We = Ce + Q), Ht.nodeType === qa && (Ce += Ht.nodeValue.length), (Qt = Ht.firstChild) !== null; )
          cr = Ht, Ht = Qt;
        for (; ; ) {
          if (Ht === o)
            break e;
          if (cr === d && ++st === M && (Le = Ce), cr === G && ++It === Q && (We = Ce), (Qt = Ht.nextSibling) !== null)
            break;
          Ht = cr, cr = Ht.parentNode;
        }
        Ht = Qt;
      }
      return Le === -1 || We === -1 ? null : {
        start: Le,
        end: We
      };
    }
    function vr(o, d) {
      var M = o.ownerDocument || document, G = M && M.defaultView || window;
      if (G.getSelection) {
        var Q = G.getSelection(), Ce = o.textContent.length, Le = Math.min(d.start, Ce), We = d.end === void 0 ? Le : Math.min(d.end, Ce);
        if (!Q.extend && Le > We) {
          var st = We;
          We = Le, Le = st;
        }
        var It = ht(o, Le), Ht = ht(o, We);
        if (It && Ht) {
          if (Q.rangeCount === 1 && Q.anchorNode === It.node && Q.anchorOffset === It.offset && Q.focusNode === Ht.node && Q.focusOffset === Ht.offset)
            return;
          var cr = M.createRange();
          cr.setStart(It.node, It.offset), Q.removeAllRanges(), Le > We ? (Q.addRange(cr), Q.extend(Ht.node, Ht.offset)) : (cr.setEnd(Ht.node, Ht.offset), Q.addRange(cr));
        }
      }
    }
    function vn(o) {
      return o && o.nodeType === qa;
    }
    function Kn(o, d) {
      return !o || !d ? !1 : o === d ? !0 : vn(o) ? !1 : vn(d) ? Kn(o, d.parentNode) : "contains" in o ? o.contains(d) : o.compareDocumentPosition ? !!(o.compareDocumentPosition(d) & 16) : !1;
    }
    function jr(o) {
      return o && o.ownerDocument && Kn(o.ownerDocument.documentElement, o);
    }
    function Mn(o) {
      try {
        return typeof o.contentWindow.location.href == "string";
      } catch {
        return !1;
      }
    }
    function Xn() {
      for (var o = window, d = Br(); d instanceof o.HTMLIFrameElement; ) {
        if (Mn(d))
          o = d.contentWindow;
        else
          return d;
        d = Br(o.document);
      }
      return d;
    }
    function Vn(o) {
      var d = o && o.nodeName && o.nodeName.toLowerCase();
      return d && (d === "input" && (o.type === "text" || o.type === "search" || o.type === "tel" || o.type === "url" || o.type === "password") || d === "textarea" || o.contentEditable === "true");
    }
    function ur() {
      var o = Xn();
      return {
        focusedElem: o,
        selectionRange: Vn(o) ? or(o) : null
      };
    }
    function er(o) {
      var d = Xn(), M = o.focusedElem, G = o.selectionRange;
      if (d !== M && jr(M)) {
        G !== null && Vn(M) && Or(M, G);
        for (var Q = [], Ce = M; Ce = Ce.parentNode; )
          Ce.nodeType === Oa && Q.push({
            element: Ce,
            left: Ce.scrollLeft,
            top: Ce.scrollTop
          });
        typeof M.focus == "function" && M.focus();
        for (var Le = 0; Le < Q.length; Le++) {
          var We = Q[Le];
          We.element.scrollLeft = We.left, We.element.scrollTop = We.top;
        }
      }
    }
    function or(o) {
      var d;
      return "selectionStart" in o ? d = {
        start: o.selectionStart,
        end: o.selectionEnd
      } : d = Mt(o), d || {
        start: 0,
        end: 0
      };
    }
    function Or(o, d) {
      var M = d.start, G = d.end;
      G === void 0 && (G = M), "selectionStart" in o ? (o.selectionStart = M, o.selectionEnd = Math.min(G, o.value.length)) : vr(o, d);
    }
    var Hr = U && "documentMode" in document && document.documentMode <= 11;
    function Qn() {
      ce("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
    }
    var bn = null, Jn = null, ni = null, qn = !1;
    function Vu(o) {
      if ("selectionStart" in o && Vn(o))
        return {
          start: o.selectionStart,
          end: o.selectionEnd
        };
      var d = o.ownerDocument && o.ownerDocument.defaultView || window, M = d.getSelection();
      return {
        anchorNode: M.anchorNode,
        anchorOffset: M.anchorOffset,
        focusNode: M.focusNode,
        focusOffset: M.focusOffset
      };
    }
    function mb(o) {
      return o.window === o ? o.document : o.nodeType === eo ? o : o.ownerDocument;
    }
    function FR(o, d, M) {
      var G = mb(M);
      if (!(qn || bn == null || bn !== Br(G))) {
        var Q = Vu(bn);
        if (!ni || !ge(ni, Q)) {
          ni = Q;
          var Ce = Iy(Jn, "onSelect");
          if (Ce.length > 0) {
            var Le = new Dc("onSelect", "select", null, d, M);
            o.push({
              event: Le,
              listeners: Ce
            }), Le.target = bn;
          }
        }
      }
    }
    function q4(o, d, M, G, Q, Ce, Le) {
      var We = M ? Gp(M) : window;
      switch (d) {
        case "focusin":
          (Ep(We) || We.contentEditable === "true") && (bn = We, Jn = M, ni = null);
          break;
        case "focusout":
          bn = null, Jn = null, ni = null;
          break;
        case "mousedown":
          qn = !0;
          break;
        case "contextmenu":
        case "mouseup":
        case "dragend":
          qn = !1, FR(o, G, Q);
          break;
        case "selectionchange":
          if (Hr)
            break;
        case "keydown":
        case "keyup":
          FR(o, G, Q);
      }
    }
    function eO(o, d, M, G, Q, Ce, Le) {
      var We = Fu.get(d);
      if (We !== void 0) {
        var st = Dc, It = d;
        switch (d) {
          case "keypress":
            if (xl(G) === 0)
              return;
          case "keydown":
          case "keyup":
            st = Tp;
            break;
          case "focusin":
            It = "focus", st = Pc;
            break;
          case "focusout":
            It = "blur", st = Pc;
            break;
          case "beforeblur":
          case "afterblur":
            st = Pc;
            break;
          case "click":
            if (G.button === 2)
              return;
          case "auxclick":
          case "dblclick":
          case "mousedown":
          case "mousemove":
          case "mouseup":
          case "mouseout":
          case "mouseover":
          case "contextmenu":
            st = Zf;
            break;
          case "drag":
          case "dragend":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "dragstart":
          case "drop":
            st = Rl;
            break;
          case "touchcancel":
          case "touchend":
          case "touchmove":
          case "touchstart":
            st = hg;
            break;
          case ql:
          case Eu:
          case Mu:
            st = cg;
            break;
          case Du:
            st = wy;
            break;
          case "scroll":
            st = lg;
            break;
          case "wheel":
            st = Rp;
            break;
          case "copy":
          case "cut":
          case "paste":
            st = tu;
            break;
          case "gotpointercapture":
          case "lostpointercapture":
          case "pointercancel":
          case "pointerdown":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "pointerup":
            st = fg;
            break;
        }
        var Ht = (Ce & ol) !== 0;
        {
          var cr = !Ht && // TODO: ideally, we'd eventually add all events from
          // nonDelegatedEvents list in DOMPluginEventSystem.
          // Then we can remove this special list.
          // This is a breaking change that can wait until React 18.
          d === "scroll", Qt = aO(M, We, G.type, Ht, cr);
          if (Qt.length > 0) {
            var hr = new st(We, It, null, G, Q);
            o.push({
              event: hr,
              listeners: Qt
            });
          }
        }
      }
    }
    Ac(), gb(), Bu(), Qn(), Ry();
    function tO(o, d, M, G, Q, Ce, Le) {
      eO(o, d, M, G, Q, Ce);
      var We = (Ce & yu) === 0;
      We && (Lp(o, d, M, G, Q, Ce), rh(o, d, M, G, Q), q4(o, d, M, G, Q), db(o, d, M, G, Q));
    }
    var bg = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"], rO = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(bg));
    function PR(o, d, M) {
      var G = o.type || "unknown-event";
      o.currentTarget = M, vp(G, d, void 0, o), o.currentTarget = null;
    }
    function nO(o, d, M) {
      var G;
      if (M)
        for (var Q = d.length - 1; Q >= 0; Q--) {
          var Ce = d[Q], Le = Ce.instance, We = Ce.currentTarget, st = Ce.listener;
          if (Le !== G && o.isPropagationStopped())
            return;
          PR(o, st, We), G = Le;
        }
      else
        for (var It = 0; It < d.length; It++) {
          var Ht = d[It], cr = Ht.instance, Qt = Ht.currentTarget, hr = Ht.listener;
          if (cr !== G && o.isPropagationStopped())
            return;
          PR(o, hr, Qt), G = cr;
        }
    }
    function IR(o, d) {
      for (var M = (d & ol) !== 0, G = 0; G < o.length; G++) {
        var Q = o[G], Ce = Q.event, Le = Q.listeners;
        nO(Ce, Le, M);
      }
      Xl();
    }
    function iO(o, d, M, G, Q) {
      var Ce = vc(M), Le = [];
      tO(Le, o, G, M, Ce, d), IR(Le, d);
    }
    function ca(o, d) {
      var M = !1, G = dA(d), Q = VR(o, M);
      G.has(Q) || (NR(d, o, fd, M), G.add(Q));
    }
    var LR = "_reactListening" + Math.random().toString(36).slice(2);
    function kR(o) {
      {
        if (o[LR])
          return;
        o[LR] = !0, W.forEach(function(d) {
          rO.has(d) || OR(d, !1, o, null), OR(d, !0, o, null);
        });
      }
    }
    function OR(o, d, M, G) {
      var Q = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0, Ce = M;
      o === "selectionchange" && M.nodeType !== eo && (Ce = M.ownerDocument);
      var Le = dA(Ce), We = VR(o, d);
      Le.has(We) || (d && (Q |= ol), NR(Ce, o, Q, d), Le.add(We));
    }
    function NR(o, d, M, G, Q) {
      var Ce = gy(o, d, M), Le = void 0;
      xu && (d === "touchstart" || d === "touchmove" || d === "wheel") && (Le = !0), o = o, G ? Le !== void 0 ? by(o, d, Ce, Le) : sg(o, d, Ce) : Le !== void 0 ? ab(o, d, Ce, Le) : Cy(o, d, Ce);
    }
    function GR(o, d) {
      return o === d || o.nodeType === oa && o.parentNode === d;
    }
    function HR(o, d, M, G, Q) {
      var Ce = G;
      if (!(d & Tf) && !(d & fd)) {
        var Le = Q;
        if (G !== null) {
          var We = G;
          e: for (; ; ) {
            if (We === null)
              return;
            var st = We.tag;
            if (st === f || st === p) {
              var It = We.stateNode.containerInfo;
              if (GR(It, Le))
                break;
              if (st === p)
                for (var Ht = We.return; Ht !== null; ) {
                  var cr = Ht.tag;
                  if (cr === f || cr === p) {
                    var Qt = Ht.stateNode.containerInfo;
                    if (GR(Qt, Le))
                      return;
                  }
                  Ht = Ht.return;
                }
              for (; It !== null; ) {
                var hr = ah(It);
                if (hr === null)
                  return;
                var Vr = hr.tag;
                if (Vr === g || Vr === y) {
                  We = Ce = hr;
                  continue e;
                }
                It = It.parentNode;
              }
            }
            We = We.return;
          }
        }
      }
      gd(function() {
        return iO(o, d, M, Ce);
      });
    }
    function wg(o, d, M) {
      return {
        instance: o,
        listener: d,
        currentTarget: M
      };
    }
    function aO(o, d, M, G, Q) {
      for (var Ce = d !== null ? d + "Capture" : null, Le = G ? Ce : d, We = [], st = o, It = null; st !== null; ) {
        var Ht = st, cr = Ht.stateNode, Qt = Ht.tag;
        if (Qt === g && cr !== null && (It = cr, Le !== null)) {
          var hr = sl(st, Le);
          hr != null && We.push(wg(st, hr, It));
        }
        if (Q)
          break;
        st = st.return;
      }
      return We;
    }
    function Iy(o, d) {
      for (var M = d + "Capture", G = [], Q = o; Q !== null; ) {
        var Ce = Q, Le = Ce.stateNode, We = Ce.tag;
        if (We === g && Le !== null) {
          var st = Le, It = sl(Q, M);
          It != null && G.unshift(wg(Q, It, st));
          var Ht = sl(Q, d);
          Ht != null && G.push(wg(Q, Ht, st));
        }
        Q = Q.return;
      }
      return G;
    }
    function kp(o) {
      if (o === null)
        return null;
      do
        o = o.return;
      while (o && o.tag !== g);
      return o || null;
    }
    function oO(o, d) {
      for (var M = o, G = d, Q = 0, Ce = M; Ce; Ce = kp(Ce))
        Q++;
      for (var Le = 0, We = G; We; We = kp(We))
        Le++;
      for (; Q - Le > 0; )
        M = kp(M), Q--;
      for (; Le - Q > 0; )
        G = kp(G), Le--;
      for (var st = Q; st--; ) {
        if (M === G || G !== null && M === G.alternate)
          return M;
        M = kp(M), G = kp(G);
      }
      return null;
    }
    function BR(o, d, M, G, Q) {
      for (var Ce = d._reactName, Le = [], We = M; We !== null && We !== G; ) {
        var st = We, It = st.alternate, Ht = st.stateNode, cr = st.tag;
        if (It !== null && It === G)
          break;
        if (cr === g && Ht !== null) {
          var Qt = Ht;
          if (Q) {
            var hr = sl(We, Ce);
            hr != null && Le.unshift(wg(We, hr, Qt));
          } else if (!Q) {
            var Vr = sl(We, Ce);
            Vr != null && Le.push(wg(We, Vr, Qt));
          }
        }
        We = We.return;
      }
      Le.length !== 0 && o.push({
        event: d,
        listeners: Le
      });
    }
    function sO(o, d, M, G, Q) {
      var Ce = G && Q ? oO(G, Q) : null;
      G !== null && BR(o, d, G, Ce, !1), Q !== null && M !== null && BR(o, M, Q, Ce, !0);
    }
    function VR(o, d) {
      return o + "__" + (d ? "capture" : "bubble");
    }
    var hs = !1, Sg = "dangerouslySetInnerHTML", Ly = "suppressContentEditableWarning", xg = "suppressHydrationWarning", zR = "autoFocus", nh = "children", ih = "style", ky = "__html", Op = Qa.html, yb, Tg, Oy, Ny, Rg, WR, Gy, _R, Ag, UR;
    {
      yb = {
        // There are working polyfills for <dialog>. Let people use it.
        dialog: !0,
        // Electron ships a custom <webview> tag to display external web content in
        // an isolated frame and process.
        // This tag is not present in non Electron environments such as JSDom which
        // is often used for testing purposes.
        // @see https://electronjs.org/docs/api/webview-tag
        webview: !0
      }, Oy = function(o, d) {
        sp(o, d), Qv(o, d), fp(o, d, {
          registrationNameDependencies: q,
          possibleRegistrationNames: ie
        });
      }, _R = U && !document.documentMode;
      var lO = /\r\n?/g, uO = /\u0000|\uFFFD/g;
      Ag = function(o) {
        var d = typeof o == "string" ? o : "" + o;
        return d.replace(lO, `
`).replace(uO, "");
      }, Ny = function(o, d) {
        if (!hs) {
          var M = Ag(d), G = Ag(o);
          G !== M && (hs = !0, s('Text content did not match. Server: "%s" Client: "%s"', G, M));
        }
      }, Rg = function(o, d, M) {
        if (!hs) {
          var G = Ag(M), Q = Ag(d);
          Q !== G && (hs = !0, s("Prop `%s` did not match. Server: %s Client: %s", o, JSON.stringify(Q), JSON.stringify(G)));
        }
      }, WR = function(o) {
        if (!hs) {
          hs = !0;
          var d = [];
          o.forEach(function(M) {
            d.push(M);
          }), s("Extra attributes from the server: %s", d);
        }
      }, Gy = function(o, d) {
        d === !1 ? s("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", o, o, o) : s("Expected `%s` listener to be a function, instead got a value of `%s` type.", o, typeof d);
      }, UR = function(o, d) {
        var M = o.namespaceURI === Op ? o.ownerDocument.createElement(o.tagName) : o.ownerDocument.createElementNS(o.namespaceURI, o.tagName);
        return M.innerHTML = d, M.innerHTML;
      };
    }
    function jR(o) {
      return o.nodeType === eo ? o : o.ownerDocument;
    }
    function cO() {
    }
    function Hy(o) {
      o.onclick = cO;
    }
    function dO(o, d, M, G, Q) {
      for (var Ce in G)
        if (G.hasOwnProperty(Ce)) {
          var Le = G[Ce];
          if (Ce === ih)
            Le && Object.freeze(Le), yf(d, Le);
          else if (Ce === Sg) {
            var We = Le ? Le[ky] : void 0;
            We != null && rl(d, We);
          } else if (Ce === nh)
            if (typeof Le == "string") {
              var st = o !== "textarea" || Le !== "";
              st && gu(d, Le);
            } else typeof Le == "number" && gu(d, "" + Le);
          else Ce === Ly || Ce === xg || Ce === zR || (q.hasOwnProperty(Ce) ? Le != null && (typeof Le != "function" && Gy(Ce, Le), Ce === "onScroll" && ca("scroll", d)) : Le != null && Ue(d, Ce, Le, Q));
        }
    }
    function fO(o, d, M, G) {
      for (var Q = 0; Q < d.length; Q += 2) {
        var Ce = d[Q], Le = d[Q + 1];
        Ce === ih ? yf(o, Le) : Ce === Sg ? rl(o, Le) : Ce === nh ? gu(o, Le) : Ue(o, Ce, Le, G);
      }
    }
    function hO(o, d, M, G) {
      var Q, Ce = jR(M), Le, We = G;
      if (We === Op && (We = vo(o)), We === Op) {
        if (Q = Uo(o, d), !Q && o !== o.toLowerCase() && s("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", o), o === "script") {
          var st = Ce.createElement("div");
          st.innerHTML = "<script><\/script>";
          var It = st.firstChild;
          Le = st.removeChild(It);
        } else if (typeof d.is == "string")
          Le = Ce.createElement(o, {
            is: d.is
          });
        else if (Le = Ce.createElement(o), o === "select") {
          var Ht = Le;
          d.multiple ? Ht.multiple = !0 : d.size && (Ht.size = d.size);
        }
      } else
        Le = Ce.createElementNS(We, o);
      return We === Op && !Q && Object.prototype.toString.call(Le) === "[object HTMLUnknownElement]" && !Object.prototype.hasOwnProperty.call(yb, o) && (yb[o] = !0, s("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", o)), Le;
    }
    function pO(o, d) {
      return jR(d).createTextNode(o);
    }
    function vO(o, d, M, G) {
      var Q = Uo(d, M);
      Oy(d, M);
      var Ce;
      switch (d) {
        case "dialog":
          ca("cancel", o), ca("close", o), Ce = M;
          break;
        case "iframe":
        case "object":
        case "embed":
          ca("load", o), Ce = M;
          break;
        case "video":
        case "audio":
          for (var Le = 0; Le < bg.length; Le++)
            ca(bg[Le], o);
          Ce = M;
          break;
        case "source":
          ca("error", o), Ce = M;
          break;
        case "img":
        case "image":
        case "link":
          ca("error", o), ca("load", o), Ce = M;
          break;
        case "details":
          ca("toggle", o), Ce = M;
          break;
        case "input":
          ri(o, M), Ce = on(o, M), ca("invalid", o);
          break;
        case "option":
          li(o, M), Ce = ci(o, M);
          break;
        case "select":
          Ui(o, M), Ce = Ti(o, M), ca("invalid", o);
          break;
        case "textarea":
          _o(o, M), Ce = ao(o, M), ca("invalid", o);
          break;
        default:
          Ce = M;
      }
      switch (dd(d, Ce), dO(d, o, G, Ce, Q), d) {
        case "input":
          Jr(o), pn(o, M, !1);
          break;
        case "textarea":
          Jr(o), Bi(o);
          break;
        case "option":
          Bn(o, M);
          break;
        case "select":
          la(o, M);
          break;
        default:
          typeof Ce.onClick == "function" && Hy(o);
          break;
      }
    }
    function gO(o, d, M, G, Q) {
      Oy(d, G);
      var Ce = null, Le, We;
      switch (d) {
        case "input":
          Le = on(o, M), We = on(o, G), Ce = [];
          break;
        case "option":
          Le = ci(o, M), We = ci(o, G), Ce = [];
          break;
        case "select":
          Le = Ti(o, M), We = Ti(o, G), Ce = [];
          break;
        case "textarea":
          Le = ao(o, M), We = ao(o, G), Ce = [];
          break;
        default:
          Le = M, We = G, typeof Le.onClick != "function" && typeof We.onClick == "function" && Hy(o);
          break;
      }
      dd(d, We);
      var st, It, Ht = null;
      for (st in Le)
        if (!(We.hasOwnProperty(st) || !Le.hasOwnProperty(st) || Le[st] == null))
          if (st === ih) {
            var cr = Le[st];
            for (It in cr)
              cr.hasOwnProperty(It) && (Ht || (Ht = {}), Ht[It] = "");
          } else st === Sg || st === nh || st === Ly || st === xg || st === zR || (q.hasOwnProperty(st) ? Ce || (Ce = []) : (Ce = Ce || []).push(st, null));
      for (st in We) {
        var Qt = We[st], hr = Le != null ? Le[st] : void 0;
        if (!(!We.hasOwnProperty(st) || Qt === hr || Qt == null && hr == null))
          if (st === ih)
            if (Qt && Object.freeze(Qt), hr) {
              for (It in hr)
                hr.hasOwnProperty(It) && (!Qt || !Qt.hasOwnProperty(It)) && (Ht || (Ht = {}), Ht[It] = "");
              for (It in Qt)
                Qt.hasOwnProperty(It) && hr[It] !== Qt[It] && (Ht || (Ht = {}), Ht[It] = Qt[It]);
            } else
              Ht || (Ce || (Ce = []), Ce.push(st, Ht)), Ht = Qt;
          else if (st === Sg) {
            var Vr = Qt ? Qt[ky] : void 0, sn = hr ? hr[ky] : void 0;
            Vr != null && sn !== Vr && (Ce = Ce || []).push(st, Vr);
          } else st === nh ? (typeof Qt == "string" || typeof Qt == "number") && (Ce = Ce || []).push(st, "" + Qt) : st === Ly || st === xg || (q.hasOwnProperty(st) ? (Qt != null && (typeof Qt != "function" && Gy(st, Qt), st === "onScroll" && ca("scroll", o)), !Ce && hr !== Qt && (Ce = [])) : typeof Qt == "object" && Qt !== null && Qt.$$typeof === ze ? Qt.toString() : (Ce = Ce || []).push(st, Qt));
      }
      return Ht && (Zv(Ht, We[ih]), (Ce = Ce || []).push(ih, Ht)), Ce;
    }
    function mO(o, d, M, G, Q) {
      M === "input" && Q.type === "radio" && Q.name != null && Fi(o, Q);
      var Ce = Uo(M, G), Le = Uo(M, Q);
      switch (fO(o, d, Ce, Le), M) {
        case "input":
          Pi(o, Q);
          break;
        case "textarea":
          ji(o, Q);
          break;
        case "select":
          za(o, Q);
          break;
      }
    }
    function yO(o) {
      {
        var d = o.toLowerCase();
        return al.hasOwnProperty(d) && al[d] || null;
      }
    }
    function CO(o, d, M, G, Q) {
      var Ce, Le;
      switch (Tg = M[xg] === !0, Ce = Uo(d, M), Oy(d, M), d) {
        case "dialog":
          ca("cancel", o), ca("close", o);
          break;
        case "iframe":
        case "object":
        case "embed":
          ca("load", o);
          break;
        case "video":
        case "audio":
          for (var We = 0; We < bg.length; We++)
            ca(bg[We], o);
          break;
        case "source":
          ca("error", o);
          break;
        case "img":
        case "image":
        case "link":
          ca("error", o), ca("load", o);
          break;
        case "details":
          ca("toggle", o);
          break;
        case "input":
          ri(o, M), ca("invalid", o);
          break;
        case "option":
          li(o, M);
          break;
        case "select":
          Ui(o, M), ca("invalid", o);
          break;
        case "textarea":
          _o(o, M), ca("invalid", o);
          break;
      }
      dd(d, M);
      {
        Le = /* @__PURE__ */ new Set();
        for (var st = o.attributes, It = 0; It < st.length; It++) {
          var Ht = st[It].name.toLowerCase();
          switch (Ht) {
            case "data-reactroot":
              break;
            case "value":
              break;
            case "checked":
              break;
            case "selected":
              break;
            default:
              Le.add(st[It].name);
          }
        }
      }
      var cr = null;
      for (var Qt in M)
        if (M.hasOwnProperty(Qt)) {
          var hr = M[Qt];
          if (Qt === nh)
            typeof hr == "string" ? o.textContent !== hr && (Tg || Ny(o.textContent, hr), cr = [nh, hr]) : typeof hr == "number" && o.textContent !== "" + hr && (Tg || Ny(o.textContent, hr), cr = [nh, "" + hr]);
          else if (q.hasOwnProperty(Qt))
            hr != null && (typeof hr != "function" && Gy(Qt, hr), Qt === "onScroll" && ca("scroll", o));
          else if (
            // Convince Flow we've calculated it (it's DEV-only in this method.)
            typeof Ce == "boolean"
          ) {
            var Vr = void 0, sn = he(Qt);
            if (!Tg) {
              if (!(Qt === Ly || Qt === xg || // Controlled attributes are not validated
              // TODO: Only ignore them on controlled tags.
              Qt === "value" || Qt === "checked" || Qt === "selected")) {
                if (Qt === Sg) {
                  var Gn = o.innerHTML, ii = hr ? hr[ky] : void 0;
                  if (ii != null) {
                    var jn = UR(o, ii);
                    jn !== Gn && Rg(Qt, Gn, jn);
                  }
                } else if (Qt === ih) {
                  if (Le.delete(Qt), _R) {
                    var Si = np(hr);
                    Vr = o.getAttribute("style"), Si !== Vr && Rg(Qt, Vr, Si);
                  }
                } else if (Ce)
                  Le.delete(Qt.toLowerCase()), Vr = Ie(o, Qt, hr), hr !== Vr && Rg(Qt, Vr, hr);
                else if (!V(Qt, sn, Ce) && !$(Qt, hr, sn, Ce)) {
                  var qi = !1;
                  if (sn !== null)
                    Le.delete(sn.attributeName), Vr = Ne(o, Qt, hr, sn);
                  else {
                    var fr = G;
                    if (fr === Op && (fr = vo(d)), fr === Op)
                      Le.delete(Qt.toLowerCase());
                    else {
                      var Ir = yO(Qt);
                      Ir !== null && Ir !== Qt && (qi = !0, Le.delete(Ir)), Le.delete(Qt);
                    }
                    Vr = Ie(o, Qt, hr);
                  }
                  hr !== Vr && !qi && Rg(Qt, Vr, hr);
                }
              }
            }
          }
        }
      switch (Le.size > 0 && !Tg && WR(Le), d) {
        case "input":
          Jr(o), pn(o, M, !0);
          break;
        case "textarea":
          Jr(o), Bi(o);
          break;
        case "select":
        case "option":
          break;
        default:
          typeof M.onClick == "function" && Hy(o);
          break;
      }
      return cr;
    }
    function bO(o, d) {
      var M = o.nodeValue !== d;
      return M;
    }
    function YR(o, d) {
      Ny(o.nodeValue, d);
    }
    function XR(o, d) {
      {
        if (hs)
          return;
        hs = !0, s("Did not expect server HTML to contain a <%s> in <%s>.", d.nodeName.toLowerCase(), o.nodeName.toLowerCase());
      }
    }
    function $R(o, d) {
      {
        if (hs)
          return;
        hs = !0, s('Did not expect server HTML to contain the text node "%s" in <%s>.', d.nodeValue, o.nodeName.toLowerCase());
      }
    }
    function ZR(o, d, M) {
      {
        if (hs)
          return;
        hs = !0, s("Expected server HTML to contain a matching <%s> in <%s>.", d, o.nodeName.toLowerCase());
      }
    }
    function KR(o, d) {
      {
        if (d === "" || hs)
          return;
        hs = !0, s('Expected server HTML to contain a matching text node for "%s" in <%s>.', d, o.nodeName.toLowerCase());
      }
    }
    function wO(o, d, M) {
      switch (d) {
        case "input":
          hi(o, M);
          return;
        case "textarea":
          ha(o, M);
          return;
        case "select":
          ia(o, M);
          return;
      }
    }
    var Eg = function() {
    }, Mg = function() {
    };
    {
      var SO = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"], JR = [
        "applet",
        "caption",
        "html",
        "table",
        "td",
        "th",
        "marquee",
        "object",
        "template",
        // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
        // TODO: Distinguish by namespace here -- for <title>, including it here
        // errs on the side of fewer warnings
        "foreignObject",
        "desc",
        "title"
      ], xO = JR.concat(["button"]), TO = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"], QR = {
        current: null,
        formTag: null,
        aTagInScope: null,
        buttonTagInScope: null,
        nobrTagInScope: null,
        pTagInButtonScope: null,
        listItemTagAutoclosing: null,
        dlItemTagAutoclosing: null
      };
      Mg = function(o, d) {
        var M = t({}, o || QR), G = {
          tag: d
        };
        return JR.indexOf(d) !== -1 && (M.aTagInScope = null, M.buttonTagInScope = null, M.nobrTagInScope = null), xO.indexOf(d) !== -1 && (M.pTagInButtonScope = null), SO.indexOf(d) !== -1 && d !== "address" && d !== "div" && d !== "p" && (M.listItemTagAutoclosing = null, M.dlItemTagAutoclosing = null), M.current = G, d === "form" && (M.formTag = G), d === "a" && (M.aTagInScope = G), d === "button" && (M.buttonTagInScope = G), d === "nobr" && (M.nobrTagInScope = G), d === "p" && (M.pTagInButtonScope = G), d === "li" && (M.listItemTagAutoclosing = G), (d === "dd" || d === "dt") && (M.dlItemTagAutoclosing = G), M;
      };
      var RO = function(o, d) {
        switch (d) {
          case "select":
            return o === "option" || o === "optgroup" || o === "#text";
          case "optgroup":
            return o === "option" || o === "#text";
          case "option":
            return o === "#text";
          case "tr":
            return o === "th" || o === "td" || o === "style" || o === "script" || o === "template";
          case "tbody":
          case "thead":
          case "tfoot":
            return o === "tr" || o === "style" || o === "script" || o === "template";
          case "colgroup":
            return o === "col" || o === "template";
          case "table":
            return o === "caption" || o === "colgroup" || o === "tbody" || o === "tfoot" || o === "thead" || o === "style" || o === "script" || o === "template";
          case "head":
            return o === "base" || o === "basefont" || o === "bgsound" || o === "link" || o === "meta" || o === "title" || o === "noscript" || o === "noframes" || o === "style" || o === "script" || o === "template";
          case "html":
            return o === "head" || o === "body" || o === "frameset";
          case "frameset":
            return o === "frame";
          case "#document":
            return o === "html";
        }
        switch (o) {
          case "h1":
          case "h2":
          case "h3":
          case "h4":
          case "h5":
          case "h6":
            return d !== "h1" && d !== "h2" && d !== "h3" && d !== "h4" && d !== "h5" && d !== "h6";
          case "rp":
          case "rt":
            return TO.indexOf(d) === -1;
          case "body":
          case "caption":
          case "col":
          case "colgroup":
          case "frameset":
          case "frame":
          case "head":
          case "html":
          case "tbody":
          case "td":
          case "tfoot":
          case "th":
          case "thead":
          case "tr":
            return d == null;
        }
        return !0;
      }, AO = function(o, d) {
        switch (o) {
          case "address":
          case "article":
          case "aside":
          case "blockquote":
          case "center":
          case "details":
          case "dialog":
          case "dir":
          case "div":
          case "dl":
          case "fieldset":
          case "figcaption":
          case "figure":
          case "footer":
          case "header":
          case "hgroup":
          case "main":
          case "menu":
          case "nav":
          case "ol":
          case "p":
          case "section":
          case "summary":
          case "ul":
          case "pre":
          case "listing":
          case "table":
          case "hr":
          case "xmp":
          case "h1":
          case "h2":
          case "h3":
          case "h4":
          case "h5":
          case "h6":
            return d.pTagInButtonScope;
          case "form":
            return d.formTag || d.pTagInButtonScope;
          case "li":
            return d.listItemTagAutoclosing;
          case "dd":
          case "dt":
            return d.dlItemTagAutoclosing;
          case "button":
            return d.buttonTagInScope;
          case "a":
            return d.aTagInScope;
          case "nobr":
            return d.nobrTagInScope;
        }
        return null;
      }, qR = {};
      Eg = function(o, d, M) {
        M = M || QR;
        var G = M.current, Q = G && G.tag;
        d != null && (o != null && s("validateDOMNesting: when childText is passed, childTag should be null"), o = "#text");
        var Ce = RO(o, Q) ? null : G, Le = Ce ? null : AO(o, M), We = Ce || Le;
        if (We) {
          var st = We.tag, It = !!Ce + "|" + o + "|" + st;
          if (!qR[It]) {
            qR[It] = !0;
            var Ht = o, cr = "";
            if (o === "#text" ? /\S/.test(d) ? Ht = "Text nodes" : (Ht = "Whitespace text nodes", cr = " Make sure you don't have any extra whitespace between tags on each line of your source code.") : Ht = "<" + o + ">", Ce) {
              var Qt = "";
              st === "table" && o === "tr" && (Qt += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."), s("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", Ht, st, cr, Qt);
            } else
              s("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", Ht, st);
          }
        }
      };
    }
    var Np;
    Np = "suppressHydrationWarning";
    var eA = "$", tA = "/$", Cb = "$?", bb = "$!", EO = "style", wb = null, Sb = null;
    function rA(o, d) {
      switch (o) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          return !!d.autoFocus;
      }
      return !1;
    }
    function MO(o) {
      var d, M, G = o.nodeType;
      switch (G) {
        case eo:
        case ff: {
          d = G === eo ? "#document" : "#fragment";
          var Q = o.documentElement;
          M = Q ? Q.namespaceURI : oo(null, "");
          break;
        }
        default: {
          var Ce = G === oa ? o.parentNode : o, Le = Ce.namespaceURI || null;
          d = Ce.tagName, M = oo(Le, d);
          break;
        }
      }
      {
        var We = d.toLowerCase(), st = Mg(null, We);
        return {
          namespace: M,
          ancestorInfo: st
        };
      }
    }
    function DO(o, d, M) {
      {
        var G = o, Q = oo(G.namespace, d), Ce = Mg(G.ancestorInfo, d);
        return {
          namespace: Q,
          ancestorInfo: Ce
        };
      }
    }
    function Pre(o) {
      return o;
    }
    function FO(o) {
      wb = vy(), Sb = ur();
      var d = null;
      return og(!1), d;
    }
    function PO(o) {
      er(Sb), og(wb), wb = null, Sb = null;
    }
    function IO(o, d, M, G, Q) {
      var Ce;
      {
        var Le = G;
        if (Eg(o, null, Le.ancestorInfo), typeof d.children == "string" || typeof d.children == "number") {
          var We = "" + d.children, st = Mg(Le.ancestorInfo, o);
          Eg(null, We, st);
        }
        Ce = Le.namespace;
      }
      var It = hO(o, d, M, Ce);
      return zy(Q, It), Ab(It, d), It;
    }
    function LO(o, d) {
      o.appendChild(d);
    }
    function kO(o, d, M, G, Q) {
      return vO(o, d, M, G), rA(d, M);
    }
    function OO(o, d, M, G, Q, Ce) {
      {
        var Le = Ce;
        if (typeof G.children != typeof M.children && (typeof G.children == "string" || typeof G.children == "number")) {
          var We = "" + G.children, st = Mg(Le.ancestorInfo, d);
          Eg(null, We, st);
        }
      }
      return gO(o, d, M, G);
    }
    function xb(o, d) {
      return o === "textarea" || o === "option" || o === "noscript" || typeof d.children == "string" || typeof d.children == "number" || typeof d.dangerouslySetInnerHTML == "object" && d.dangerouslySetInnerHTML !== null && d.dangerouslySetInnerHTML.__html != null;
    }
    function NO(o, d, M, G) {
      {
        var Q = M;
        Eg(null, o, Q.ancestorInfo);
      }
      var Ce = pO(o, d);
      return zy(G, Ce), Ce;
    }
    var nA = typeof setTimeout == "function" ? setTimeout : void 0, GO = typeof clearTimeout == "function" ? clearTimeout : void 0, Tb = -1;
    function HO(o, d, M, G) {
      rA(d, M) && o.focus();
    }
    function BO(o, d, M, G, Q, Ce) {
      Ab(o, Q), mO(o, d, M, G, Q);
    }
    function iA(o) {
      gu(o, "");
    }
    function VO(o, d, M) {
      o.nodeValue = M;
    }
    function zO(o, d) {
      o.appendChild(d);
    }
    function WO(o, d) {
      var M;
      o.nodeType === oa ? (M = o.parentNode, M.insertBefore(d, o)) : (M = o, M.appendChild(d));
      var G = o._reactRootContainer;
      G == null && M.onclick === null && Hy(M);
    }
    function _O(o, d, M) {
      o.insertBefore(d, M);
    }
    function UO(o, d, M) {
      o.nodeType === oa ? o.parentNode.insertBefore(d, M) : o.insertBefore(d, M);
    }
    function jO(o, d) {
      o.removeChild(d);
    }
    function YO(o, d) {
      o.nodeType === oa ? o.parentNode.removeChild(d) : o.removeChild(d);
    }
    function XO(o) {
      o = o;
      var d = o.style;
      typeof d.setProperty == "function" ? d.setProperty("display", "none", "important") : d.display = "none";
    }
    function $O(o) {
      o.nodeValue = "";
    }
    function ZO(o, d) {
      o = o;
      var M = d[EO], G = M != null && M.hasOwnProperty("display") ? M.display : null;
      o.style.display = hf("display", G);
    }
    function KO(o, d) {
      o.nodeValue = d;
    }
    function Rb(o) {
      if (o.nodeType === Oa)
        o.textContent = "";
      else if (o.nodeType === eo) {
        var d = o.body;
        d != null && (d.textContent = "");
      }
    }
    function JO(o, d, M) {
      return o.nodeType !== Oa || d.toLowerCase() !== o.nodeName.toLowerCase() ? null : o;
    }
    function QO(o, d) {
      return d === "" || o.nodeType !== qa ? null : o;
    }
    function qO(o) {
      return o.data === Cb;
    }
    function e5(o) {
      return o.data === bb;
    }
    function aA(o) {
      for (; o != null; o = o.nextSibling) {
        var d = o.nodeType;
        if (d === Oa || d === qa)
          break;
      }
      return o;
    }
    function By(o) {
      return aA(o.nextSibling);
    }
    function oA(o) {
      return aA(o.firstChild);
    }
    function t5(o, d, M, G, Q, Ce) {
      zy(Ce, o), Ab(o, M);
      var Le;
      {
        var We = Q;
        Le = We.namespace;
      }
      return CO(o, d, M, Le);
    }
    function r5(o, d, M) {
      return zy(M, o), bO(o, d);
    }
    function n5(o) {
      for (var d = o.nextSibling, M = 0; d; ) {
        if (d.nodeType === oa) {
          var G = d.data;
          if (G === tA) {
            if (M === 0)
              return By(d);
            M--;
          } else (G === eA || G === bb || G === Cb) && M++;
        }
        d = d.nextSibling;
      }
      return null;
    }
    function sA(o) {
      for (var d = o.previousSibling, M = 0; d; ) {
        if (d.nodeType === oa) {
          var G = d.data;
          if (G === eA || G === bb || G === Cb) {
            if (M === 0)
              return d;
            M--;
          } else G === tA && M++;
        }
        d = d.previousSibling;
      }
      return null;
    }
    function i5(o) {
      Td(o);
    }
    function a5(o) {
      Td(o);
    }
    function o5(o, d, M) {
      YR(d, M);
    }
    function s5(o, d, M, G, Q) {
      d[Np] !== !0 && YR(G, Q);
    }
    function l5(o, d) {
      d.nodeType === Oa ? XR(o, d) : d.nodeType === oa || $R(o, d);
    }
    function u5(o, d, M, G) {
      d[Np] !== !0 && (G.nodeType === Oa ? XR(M, G) : G.nodeType === oa || $R(M, G));
    }
    function c5(o, d, M) {
      ZR(o, d);
    }
    function d5(o, d) {
      KR(o, d);
    }
    function f5(o, d, M, G, Q) {
      d[Np] !== !0 && ZR(M, G);
    }
    function h5(o, d, M, G) {
      d[Np] !== !0 && KR(M, G);
    }
    function p5(o, d, M) {
      d[Np];
    }
    var v5 = 0;
    function g5(o) {
      var d = "r:" + (v5++).toString(36);
      return {
        toString: function() {
          return o(), d;
        },
        valueOf: function() {
          return o(), d;
        }
      };
    }
    function m5(o) {
      return o !== null && typeof o == "object" && o.$$typeof === ze;
    }
    function y5(o) {
      return {
        $$typeof: ze,
        toString: o,
        valueOf: o
      };
    }
    function C5(o) {
      kR(o);
    }
    var Vy = Math.random().toString(36).slice(2), Dg = "__reactFiber$" + Vy, lA = "__reactProps$" + Vy, Fg = "__reactContainer$" + Vy, uA = "__reactEvents$" + Vy;
    function zy(o, d) {
      d[Dg] = o;
    }
    function b5(o, d) {
      d[Fg] = o;
    }
    function cA(o) {
      o[Fg] = null;
    }
    function Wy(o) {
      return !!o[Fg];
    }
    function ah(o) {
      var d = o[Dg];
      if (d)
        return d;
      for (var M = o.parentNode; M; ) {
        if (d = M[Fg] || M[Dg], d) {
          var G = d.alternate;
          if (d.child !== null || G !== null && G.child !== null)
            for (var Q = sA(o); Q !== null; ) {
              var Ce = Q[Dg];
              if (Ce)
                return Ce;
              Q = sA(Q);
            }
          return d;
        }
        o = M, M = o.parentNode;
      }
      return null;
    }
    function Od(o) {
      var d = o[Dg] || o[Fg];
      return d && (d.tag === g || d.tag === y || d.tag === x || d.tag === f) ? d : null;
    }
    function Gp(o) {
      if (o.tag === g || o.tag === y)
        return o.stateNode;
      throw Error("getNodeFromInstance: Invalid argument.");
    }
    function _y(o) {
      return o[lA] || null;
    }
    function Ab(o, d) {
      o[lA] = d;
    }
    function dA(o) {
      var d = o[uA];
      return d === void 0 && (d = o[uA] = /* @__PURE__ */ new Set()), d;
    }
    var fA = {}, hA = a.ReactDebugCurrentFrame;
    function Uy(o) {
      if (o) {
        var d = o._owner, M = Gr(o.type, o._source, d ? d.type : null);
        hA.setExtraStackFrame(M);
      } else
        hA.setExtraStackFrame(null);
    }
    function nu(o, d, M, G, Q) {
      {
        var Ce = Function.call.bind(Object.prototype.hasOwnProperty);
        for (var Le in o)
          if (Ce(o, Le)) {
            var We = void 0;
            try {
              if (typeof o[Le] != "function") {
                var st = Error((G || "React class") + ": " + M + " type `" + Le + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[Le] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw st.name = "Invariant Violation", st;
              }
              We = o[Le](d, Le, G, M, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (It) {
              We = It;
            }
            We && !(We instanceof Error) && (Uy(Q), s("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", G || "React class", M, Le, typeof We), Uy(null)), We instanceof Error && !(We.message in fA) && (fA[We.message] = !0, Uy(Q), s("Failed %s type: %s", M, We.message), Uy(null));
          }
      }
    }
    var Eb = [], jy;
    jy = [];
    var Oc = -1;
    function Nd(o) {
      return {
        current: o
      };
    }
    function Oo(o, d) {
      if (Oc < 0) {
        s("Unexpected pop.");
        return;
      }
      d !== jy[Oc] && s("Unexpected Fiber popped."), o.current = Eb[Oc], Eb[Oc] = null, jy[Oc] = null, Oc--;
    }
    function No(o, d, M) {
      Oc++, Eb[Oc] = o.current, jy[Oc] = M, o.current = d;
    }
    var Mb;
    Mb = {};
    var zs = {};
    Object.freeze(zs);
    var Nc = Nd(zs), zu = Nd(!1), Db = zs;
    function Hp(o, d, M) {
      return M && Wu(d) ? Db : Nc.current;
    }
    function pA(o, d, M) {
      {
        var G = o.stateNode;
        G.__reactInternalMemoizedUnmaskedChildContext = d, G.__reactInternalMemoizedMaskedChildContext = M;
      }
    }
    function Bp(o, d) {
      {
        var M = o.type, G = M.contextTypes;
        if (!G)
          return zs;
        var Q = o.stateNode;
        if (Q && Q.__reactInternalMemoizedUnmaskedChildContext === d)
          return Q.__reactInternalMemoizedMaskedChildContext;
        var Ce = {};
        for (var Le in G)
          Ce[Le] = d[Le];
        {
          var We = ae(M) || "Unknown";
          nu(G, Ce, "context", We);
        }
        return Q && pA(o, d, Ce), Ce;
      }
    }
    function Yy() {
      return zu.current;
    }
    function Wu(o) {
      {
        var d = o.childContextTypes;
        return d != null;
      }
    }
    function Xy(o) {
      Oo(zu, o), Oo(Nc, o);
    }
    function Fb(o) {
      Oo(zu, o), Oo(Nc, o);
    }
    function vA(o, d, M) {
      {
        if (Nc.current !== zs)
          throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
        No(Nc, d, o), No(zu, M, o);
      }
    }
    function gA(o, d, M) {
      {
        var G = o.stateNode, Q = d.childContextTypes;
        if (typeof G.getChildContext != "function") {
          {
            var Ce = ae(d) || "Unknown";
            Mb[Ce] || (Mb[Ce] = !0, s("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", Ce, Ce));
          }
          return M;
        }
        var Le = G.getChildContext();
        for (var We in Le)
          if (!(We in Q))
            throw Error((ae(d) || "Unknown") + '.getChildContext(): key "' + We + '" is not defined in childContextTypes.');
        {
          var st = ae(d) || "Unknown";
          nu(Q, Le, "child context", st);
        }
        return t({}, M, Le);
      }
    }
    function $y(o) {
      {
        var d = o.stateNode, M = d && d.__reactInternalMemoizedMergedChildContext || zs;
        return Db = Nc.current, No(Nc, M, o), No(zu, zu.current, o), !0;
      }
    }
    function mA(o, d, M) {
      {
        var G = o.stateNode;
        if (!G)
          throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
        if (M) {
          var Q = gA(o, d, Db);
          G.__reactInternalMemoizedMergedChildContext = Q, Oo(zu, o), Oo(Nc, o), No(Nc, Q, o), No(zu, M, o);
        } else
          Oo(zu, o), No(zu, M, o);
      }
    }
    function w5(o) {
      {
        if (!(Sc(o) && o.tag === l))
          throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
        var d = o;
        do {
          switch (d.tag) {
            case f:
              return d.stateNode.context;
            case l: {
              var M = d.type;
              if (Wu(M))
                return d.stateNode.__reactInternalMemoizedMergedChildContext;
              break;
            }
          }
          d = d.return;
        } while (d !== null);
        throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
      }
    }
    var Pb = 0, yA = 1, CA = 2, Zy = null, _u = null, Vp = !1, S5 = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u";
    function x5(o) {
      if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u")
        return !1;
      var d = __REACT_DEVTOOLS_GLOBAL_HOOK__;
      if (d.isDisabled)
        return !0;
      if (!d.supportsFiber)
        return s("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"), !0;
      try {
        Zy = d.inject(o), _u = d;
      } catch (M) {
        s("React instrumentation encountered an error: %s.", M);
      }
      return !0;
    }
    function T5(o, d) {
      if (_u && typeof _u.onScheduleFiberRoot == "function")
        try {
          _u.onScheduleFiberRoot(Zy, o, d);
        } catch (M) {
          Vp || (Vp = !0, s("React instrumentation encountered an error: %s", M));
        }
    }
    function R5(o, d) {
      if (_u && typeof _u.onCommitFiberRoot == "function")
        try {
          var M = (o.current.flags & bi) === bi;
          te && _u.onCommitFiberRoot(Zy, o, d, M);
        } catch (G) {
          Vp || (Vp = !0, s("React instrumentation encountered an error: %s", G));
        }
    }
    function A5(o) {
      if (_u && typeof _u.onCommitFiberUnmount == "function")
        try {
          _u.onCommitFiberUnmount(Zy, o);
        } catch (d) {
          Vp || (Vp = !0, s("React instrumentation encountered an error: %s", d));
        }
    }
    var E5 = r.unstable_runWithPriority, Ib = r.unstable_scheduleCallback, bA = r.unstable_cancelCallback, M5 = r.unstable_shouldYield, wA = r.unstable_requestPaint, Lb = r.unstable_now, D5 = r.unstable_getCurrentPriorityLevel, Ky = r.unstable_ImmediatePriority, SA = r.unstable_UserBlockingPriority, xA = r.unstable_NormalPriority, TA = r.unstable_LowPriority, RA = r.unstable_IdlePriority;
    if (!(n.__interactionsRef != null && n.__interactionsRef.current != null))
      throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
    var AA = {}, Ml = 99, oh = 98, Gc = 97, EA = 96, MA = 95, kb = 90, F5 = M5, P5 = (
      // Fall back gracefully if we're running an older version of Scheduler.
      wA !== void 0 ? wA : function() {
      }
    ), Hc = null, Jy = null, Ob = !1, DA = Lb(), Go = DA < 1e4 ? Lb : function() {
      return Lb() - DA;
    };
    function zp() {
      switch (D5()) {
        case Ky:
          return Ml;
        case SA:
          return oh;
        case xA:
          return Gc;
        case TA:
          return EA;
        case RA:
          return MA;
        default:
          throw Error("Unknown priority level.");
      }
    }
    function FA(o) {
      switch (o) {
        case Ml:
          return Ky;
        case oh:
          return SA;
        case Gc:
          return xA;
        case EA:
          return TA;
        case MA:
          return RA;
        default:
          throw Error("Unknown priority level.");
      }
    }
    function sh(o, d) {
      var M = FA(o);
      return E5(M, d);
    }
    function Gd(o, d, M) {
      var G = FA(o);
      return Ib(G, d, M);
    }
    function I5(o) {
      return Hc === null ? (Hc = [o], Jy = Ib(Ky, IA)) : Hc.push(o), AA;
    }
    function PA(o) {
      o !== AA && bA(o);
    }
    function Uu() {
      if (Jy !== null) {
        var o = Jy;
        Jy = null, bA(o);
      }
      IA();
    }
    function IA() {
      if (!Ob && Hc !== null) {
        Ob = !0;
        var o = 0;
        try {
          var d = !0, M = Hc;
          sh(Ml, function() {
            for (; o < M.length; o++) {
              var G = M[o];
              do
                G = G(d);
              while (G !== null);
            }
          }), Hc = null;
        } catch (G) {
          throw Hc !== null && (Hc = Hc.slice(o + 1)), Ib(Ky, Uu), G;
        } finally {
          Ob = !1;
        }
      }
    }
    var LA = "17.0.2", ma = 0, Da = 1, ps = 2, lh = 4, Ws = 8, L5 = 16, k5 = a.ReactCurrentBatchConfig, O5 = 0;
    function N5() {
      return k5.transition;
    }
    var iu = {
      recordUnsafeLifecycleWarnings: function(o, d) {
      },
      flushPendingUnsafeLifecycleWarnings: function() {
      },
      recordLegacyContextWarning: function(o, d) {
      },
      flushLegacyContextWarning: function() {
      },
      discardPendingWarnings: function() {
      }
    };
    {
      var G5 = function(o) {
        for (var d = null, M = o; M !== null; )
          M.mode & Da && (d = M), M = M.return;
        return d;
      }, uh = function(o) {
        var d = [];
        return o.forEach(function(M) {
          d.push(M);
        }), d.sort().join(", ");
      }, Pg = [], Ig = [], Lg = [], kg = [], Og = [], Ng = [], ch = /* @__PURE__ */ new Set();
      iu.recordUnsafeLifecycleWarnings = function(o, d) {
        ch.has(o.type) || (typeof d.componentWillMount == "function" && // Don't warn about react-lifecycles-compat polyfilled components.
        d.componentWillMount.__suppressDeprecationWarning !== !0 && Pg.push(o), o.mode & Da && typeof d.UNSAFE_componentWillMount == "function" && Ig.push(o), typeof d.componentWillReceiveProps == "function" && d.componentWillReceiveProps.__suppressDeprecationWarning !== !0 && Lg.push(o), o.mode & Da && typeof d.UNSAFE_componentWillReceiveProps == "function" && kg.push(o), typeof d.componentWillUpdate == "function" && d.componentWillUpdate.__suppressDeprecationWarning !== !0 && Og.push(o), o.mode & Da && typeof d.UNSAFE_componentWillUpdate == "function" && Ng.push(o));
      }, iu.flushPendingUnsafeLifecycleWarnings = function() {
        var o = /* @__PURE__ */ new Set();
        Pg.length > 0 && (Pg.forEach(function(Qt) {
          o.add(ae(Qt.type) || "Component"), ch.add(Qt.type);
        }), Pg = []);
        var d = /* @__PURE__ */ new Set();
        Ig.length > 0 && (Ig.forEach(function(Qt) {
          d.add(ae(Qt.type) || "Component"), ch.add(Qt.type);
        }), Ig = []);
        var M = /* @__PURE__ */ new Set();
        Lg.length > 0 && (Lg.forEach(function(Qt) {
          M.add(ae(Qt.type) || "Component"), ch.add(Qt.type);
        }), Lg = []);
        var G = /* @__PURE__ */ new Set();
        kg.length > 0 && (kg.forEach(function(Qt) {
          G.add(ae(Qt.type) || "Component"), ch.add(Qt.type);
        }), kg = []);
        var Q = /* @__PURE__ */ new Set();
        Og.length > 0 && (Og.forEach(function(Qt) {
          Q.add(ae(Qt.type) || "Component"), ch.add(Qt.type);
        }), Og = []);
        var Ce = /* @__PURE__ */ new Set();
        if (Ng.length > 0 && (Ng.forEach(function(Qt) {
          Ce.add(ae(Qt.type) || "Component"), ch.add(Qt.type);
        }), Ng = []), d.size > 0) {
          var Le = uh(d);
          s(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`, Le);
        }
        if (G.size > 0) {
          var We = uh(G);
          s(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state

Please update the following components: %s`, We);
        }
        if (Ce.size > 0) {
          var st = uh(Ce);
          s(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`, st);
        }
        if (o.size > 0) {
          var It = uh(o);
          u(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, It);
        }
        if (M.size > 0) {
          var Ht = uh(M);
          u(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, Ht);
        }
        if (Q.size > 0) {
          var cr = uh(Q);
          u(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, cr);
        }
      };
      var Qy = /* @__PURE__ */ new Map(), kA = /* @__PURE__ */ new Set();
      iu.recordLegacyContextWarning = function(o, d) {
        var M = G5(o);
        if (M === null) {
          s("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
          return;
        }
        if (!kA.has(o.type)) {
          var G = Qy.get(M);
          (o.type.contextTypes != null || o.type.childContextTypes != null || d !== null && typeof d.getChildContext == "function") && (G === void 0 && (G = [], Qy.set(M, G)), G.push(o));
        }
      }, iu.flushLegacyContextWarning = function() {
        Qy.forEach(function(o, d) {
          if (o.length !== 0) {
            var M = o[0], G = /* @__PURE__ */ new Set();
            o.forEach(function(Ce) {
              G.add(ae(Ce.type) || "Component"), kA.add(Ce.type);
            });
            var Q = uh(G);
            try {
              dt(M), s(`Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://reactjs.org/link/legacy-context`, Q);
            } finally {
              pt();
            }
          }
        });
      }, iu.discardPendingWarnings = function() {
        Pg = [], Ig = [], Lg = [], kg = [], Og = [], Ng = [], Qy = /* @__PURE__ */ new Map();
      };
    }
    function au(o, d) {
      if (o && o.defaultProps) {
        var M = t({}, d), G = o.defaultProps;
        for (var Q in G)
          M[Q] === void 0 && (M[Q] = G[Q]);
        return M;
      }
      return d;
    }
    var qy = 1073741823, Nb = Nd(null), Gb;
    Gb = {};
    var e0 = null, Wp = null, t0 = null, r0 = !1;
    function n0() {
      e0 = null, Wp = null, t0 = null, r0 = !1;
    }
    function OA() {
      r0 = !0;
    }
    function NA() {
      r0 = !1;
    }
    function GA(o, d) {
      var M = o.type._context;
      No(Nb, M._currentValue, o), M._currentValue = d, M._currentRenderer !== void 0 && M._currentRenderer !== null && M._currentRenderer !== Gb && s("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), M._currentRenderer = Gb;
    }
    function Hb(o) {
      var d = Nb.current;
      Oo(Nb, o);
      var M = o.type._context;
      M._currentValue = d;
    }
    function H5(o, d, M) {
      if (D(M, d))
        return 0;
      var G = typeof o._calculateChangedBits == "function" ? o._calculateChangedBits(M, d) : qy;
      return (G & qy) !== G && s("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s", G), G | 0;
    }
    function HA(o, d) {
      for (var M = o; M !== null; ) {
        var G = M.alternate;
        if (!Lu(M.childLanes, d))
          M.childLanes = xi(M.childLanes, d), G !== null && (G.childLanes = xi(G.childLanes, d));
        else if (G !== null && !Lu(G.childLanes, d))
          G.childLanes = xi(G.childLanes, d);
        else
          break;
        M = M.return;
      }
    }
    function B5(o, d, M, G) {
      var Q = o.child;
      for (Q !== null && (Q.return = o); Q !== null; ) {
        var Ce = void 0, Le = Q.dependencies;
        if (Le !== null) {
          Ce = Q.child;
          for (var We = Le.firstContext; We !== null; ) {
            if (We.context === d && We.observedBits & M) {
              if (Q.tag === l) {
                var st = Hd(un, Zi(G));
                st.tag = i0, Bd(Q, st);
              }
              Q.lanes = xi(Q.lanes, G);
              var It = Q.alternate;
              It !== null && (It.lanes = xi(It.lanes, G)), HA(Q.return, G), Le.lanes = xi(Le.lanes, G);
              break;
            }
            We = We.next;
          }
        } else Q.tag === w ? Ce = Q.type === o.type ? null : Q.child : Ce = Q.child;
        if (Ce !== null)
          Ce.return = Q;
        else
          for (Ce = Q; Ce !== null; ) {
            if (Ce === o) {
              Ce = null;
              break;
            }
            var Ht = Ce.sibling;
            if (Ht !== null) {
              Ht.return = Ce.return, Ce = Ht;
              break;
            }
            Ce = Ce.return;
          }
        Q = Ce;
      }
    }
    function _p(o, d) {
      e0 = o, Wp = null, t0 = null;
      var M = o.dependencies;
      if (M !== null) {
        var G = M.firstContext;
        G !== null && (no(M.lanes, d) && Yw(), M.firstContext = null);
      }
    }
    function Xa(o, d) {
      if (r0 && s("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."), t0 !== o) {
        if (!(d === !1 || d === 0)) {
          var M;
          typeof d != "number" || d === qy ? (t0 = o, M = qy) : M = d;
          var G = {
            context: o,
            observedBits: M,
            next: null
          };
          if (Wp === null) {
            if (e0 === null)
              throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
            Wp = G, e0.dependencies = {
              lanes: qe,
              firstContext: G,
              responders: null
            };
          } else
            Wp = Wp.next = G;
        }
      }
      return o._currentValue;
    }
    var BA = 0, VA = 1, i0 = 2, Bb = 3, a0 = !1, Vb, o0;
    Vb = !1, o0 = null;
    function zb(o) {
      var d = {
        baseState: o.memoizedState,
        firstBaseUpdate: null,
        lastBaseUpdate: null,
        shared: {
          pending: null
        },
        effects: null
      };
      o.updateQueue = d;
    }
    function zA(o, d) {
      var M = d.updateQueue, G = o.updateQueue;
      if (M === G) {
        var Q = {
          baseState: G.baseState,
          firstBaseUpdate: G.firstBaseUpdate,
          lastBaseUpdate: G.lastBaseUpdate,
          shared: G.shared,
          effects: G.effects
        };
        d.updateQueue = Q;
      }
    }
    function Hd(o, d) {
      var M = {
        eventTime: o,
        lane: d,
        tag: BA,
        payload: null,
        callback: null,
        next: null
      };
      return M;
    }
    function Bd(o, d) {
      var M = o.updateQueue;
      if (M !== null) {
        var G = M.shared, Q = G.pending;
        Q === null ? d.next = d : (d.next = Q.next, Q.next = d), G.pending = d, o0 === G && !Vb && (s("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."), Vb = !0);
      }
    }
    function WA(o, d) {
      var M = o.updateQueue, G = o.alternate;
      if (G !== null) {
        var Q = G.updateQueue;
        if (M === Q) {
          var Ce = null, Le = null, We = M.firstBaseUpdate;
          if (We !== null) {
            var st = We;
            do {
              var It = {
                eventTime: st.eventTime,
                lane: st.lane,
                tag: st.tag,
                payload: st.payload,
                callback: st.callback,
                next: null
              };
              Le === null ? Ce = Le = It : (Le.next = It, Le = It), st = st.next;
            } while (st !== null);
            Le === null ? Ce = Le = d : (Le.next = d, Le = d);
          } else
            Ce = Le = d;
          M = {
            baseState: Q.baseState,
            firstBaseUpdate: Ce,
            lastBaseUpdate: Le,
            shared: Q.shared,
            effects: Q.effects
          }, o.updateQueue = M;
          return;
        }
      }
      var Ht = M.lastBaseUpdate;
      Ht === null ? M.firstBaseUpdate = d : Ht.next = d, M.lastBaseUpdate = d;
    }
    function V5(o, d, M, G, Q, Ce) {
      switch (M.tag) {
        case VA: {
          var Le = M.payload;
          if (typeof Le == "function") {
            OA();
            var We = Le.call(Ce, G, Q);
            {
              if (o.mode & Da) {
                Mr();
                try {
                  Le.call(Ce, G, Q);
                } finally {
                  Rr();
                }
              }
              NA();
            }
            return We;
          }
          return Le;
        }
        case Bb:
          o.flags = o.flags & ~Yo | bi;
        case BA: {
          var st = M.payload, It;
          if (typeof st == "function") {
            OA(), It = st.call(Ce, G, Q);
            {
              if (o.mode & Da) {
                Mr();
                try {
                  st.call(Ce, G, Q);
                } finally {
                  Rr();
                }
              }
              NA();
            }
          } else
            It = st;
          return It == null ? G : t({}, G, It);
        }
        case i0:
          return a0 = !0, G;
      }
      return G;
    }
    function Gg(o, d, M, G) {
      var Q = o.updateQueue;
      a0 = !1, o0 = Q.shared;
      var Ce = Q.firstBaseUpdate, Le = Q.lastBaseUpdate, We = Q.shared.pending;
      if (We !== null) {
        Q.shared.pending = null;
        var st = We, It = st.next;
        st.next = null, Le === null ? Ce = It : Le.next = It, Le = st;
        var Ht = o.alternate;
        if (Ht !== null) {
          var cr = Ht.updateQueue, Qt = cr.lastBaseUpdate;
          Qt !== Le && (Qt === null ? cr.firstBaseUpdate = It : Qt.next = It, cr.lastBaseUpdate = st);
        }
      }
      if (Ce !== null) {
        var hr = Q.baseState, Vr = qe, sn = null, Gn = null, ii = null, jn = Ce;
        do {
          var Si = jn.lane, qi = jn.eventTime;
          if (Lu(G, Si)) {
            if (ii !== null) {
              var Ir = {
                eventTime: qi,
                // This update is going to be committed so we never want uncommit
                // it. Using NoLane works because 0 is a subset of all bitmasks, so
                // this will never be skipped by the check above.
                lane: Et,
                tag: jn.tag,
                payload: jn.payload,
                callback: jn.callback,
                next: null
              };
              ii = ii.next = Ir;
            }
            hr = V5(o, Q, jn, hr, d, M);
            var sr = jn.callback;
            if (sr !== null) {
              o.flags |= ks;
              var Zr = Q.effects;
              Zr === null ? Q.effects = [jn] : Zr.push(jn);
            }
          } else {
            var fr = {
              eventTime: qi,
              lane: Si,
              tag: jn.tag,
              payload: jn.payload,
              callback: jn.callback,
              next: null
            };
            ii === null ? (Gn = ii = fr, sn = hr) : ii = ii.next = fr, Vr = xi(Vr, Si);
          }
          if (jn = jn.next, jn === null) {
            if (We = Q.shared.pending, We === null)
              break;
            var fn = We, Rn = fn.next;
            fn.next = null, jn = Rn, Q.lastBaseUpdate = fn, Q.shared.pending = null;
          }
        } while (!0);
        ii === null && (sn = hr), Q.baseState = sn, Q.firstBaseUpdate = Gn, Q.lastBaseUpdate = ii, mS(Vr), o.lanes = Vr, o.memoizedState = hr;
      }
      o0 = null;
    }
    function z5(o, d) {
      if (typeof o != "function")
        throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + o);
      o.call(d);
    }
    function _A() {
      a0 = !1;
    }
    function s0() {
      return a0;
    }
    function UA(o, d, M) {
      var G = d.effects;
      if (d.effects = null, G !== null)
        for (var Q = 0; Q < G.length; Q++) {
          var Ce = G[Q], Le = Ce.callback;
          Le !== null && (Ce.callback = null, z5(Le, M));
        }
    }
    var Wb = {}, W5 = Array.isArray, jA = new e.Component().refs, _b, Ub, jb, Yb, Xb, YA, l0, $b, Zb, Kb;
    {
      _b = /* @__PURE__ */ new Set(), Ub = /* @__PURE__ */ new Set(), jb = /* @__PURE__ */ new Set(), Yb = /* @__PURE__ */ new Set(), $b = /* @__PURE__ */ new Set(), Xb = /* @__PURE__ */ new Set(), Zb = /* @__PURE__ */ new Set(), Kb = /* @__PURE__ */ new Set();
      var XA = /* @__PURE__ */ new Set();
      l0 = function(o, d) {
        if (!(o === null || typeof o == "function")) {
          var M = d + "_" + o;
          XA.has(M) || (XA.add(M), s("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", d, o));
        }
      }, YA = function(o, d) {
        if (d === void 0) {
          var M = ae(o) || "Component";
          Xb.has(M) || (Xb.add(M), s("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", M));
        }
      }, Object.defineProperty(Wb, "_processChildContext", {
        enumerable: !1,
        value: function() {
          throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
        }
      }), Object.freeze(Wb);
    }
    function u0(o, d, M, G) {
      var Q = o.memoizedState;
      if (o.mode & Da) {
        Mr();
        try {
          M(G, Q);
        } finally {
          Rr();
        }
      }
      var Ce = M(G, Q);
      YA(d, Ce);
      var Le = Ce == null ? Q : t({}, Q, Ce);
      if (o.memoizedState = Le, o.lanes === qe) {
        var We = o.updateQueue;
        We.baseState = Le;
      }
    }
    var Jb = {
      isMounted: gp,
      enqueueSetState: function(o, d, M) {
        var G = os(o), Q = Us(), Ce = _d(G), Le = Hd(Q, Ce);
        Le.payload = d, M != null && (l0(M, "setState"), Le.callback = M), Bd(G, Le), Bo(G, Ce, Q);
      },
      enqueueReplaceState: function(o, d, M) {
        var G = os(o), Q = Us(), Ce = _d(G), Le = Hd(Q, Ce);
        Le.tag = VA, Le.payload = d, M != null && (l0(M, "replaceState"), Le.callback = M), Bd(G, Le), Bo(G, Ce, Q);
      },
      enqueueForceUpdate: function(o, d) {
        var M = os(o), G = Us(), Q = _d(M), Ce = Hd(G, Q);
        Ce.tag = i0, d != null && (l0(d, "forceUpdate"), Ce.callback = d), Bd(M, Ce), Bo(M, Q, G);
      }
    };
    function $A(o, d, M, G, Q, Ce, Le) {
      var We = o.stateNode;
      if (typeof We.shouldComponentUpdate == "function") {
        if (o.mode & Da) {
          Mr();
          try {
            We.shouldComponentUpdate(G, Ce, Le);
          } finally {
            Rr();
          }
        }
        var st = We.shouldComponentUpdate(G, Ce, Le);
        return st === void 0 && s("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", ae(d) || "Component"), st;
      }
      return d.prototype && d.prototype.isPureReactComponent ? !ge(M, G) || !ge(Q, Ce) : !0;
    }
    function _5(o, d, M) {
      var G = o.stateNode;
      {
        var Q = ae(d) || "Component", Ce = G.render;
        Ce || (d.prototype && typeof d.prototype.render == "function" ? s("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", Q) : s("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", Q)), G.getInitialState && !G.getInitialState.isReactClassApproved && !G.state && s("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", Q), G.getDefaultProps && !G.getDefaultProps.isReactClassApproved && s("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", Q), G.propTypes && s("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", Q), G.contextType && s("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", Q), G.contextTypes && s("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", Q), d.contextType && d.contextTypes && !Zb.has(d) && (Zb.add(d), s("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", Q)), typeof G.componentShouldUpdate == "function" && s("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", Q), d.prototype && d.prototype.isPureReactComponent && typeof G.shouldComponentUpdate < "u" && s("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", ae(d) || "A pure component"), typeof G.componentDidUnmount == "function" && s("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", Q), typeof G.componentDidReceiveProps == "function" && s("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", Q), typeof G.componentWillRecieveProps == "function" && s("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", Q), typeof G.UNSAFE_componentWillRecieveProps == "function" && s("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", Q);
        var Le = G.props !== M;
        G.props !== void 0 && Le && s("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", Q, Q), G.defaultProps && s("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", Q, Q), typeof G.getSnapshotBeforeUpdate == "function" && typeof G.componentDidUpdate != "function" && !jb.has(d) && (jb.add(d), s("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", ae(d))), typeof G.getDerivedStateFromProps == "function" && s("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", Q), typeof G.getDerivedStateFromError == "function" && s("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", Q), typeof d.getSnapshotBeforeUpdate == "function" && s("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", Q);
        var We = G.state;
        We && (typeof We != "object" || W5(We)) && s("%s.state: must be set to an object or null", Q), typeof G.getChildContext == "function" && typeof d.childContextTypes != "object" && s("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", Q);
      }
    }
    function ZA(o, d) {
      d.updater = Jb, o.stateNode = d, bd(d, o), d._reactInternalInstance = Wb;
    }
    function KA(o, d, M) {
      var G = !1, Q = zs, Ce = zs, Le = d.contextType;
      if ("contextType" in d) {
        var We = (
          // Allow null for conditional declaration
          Le === null || Le !== void 0 && Le.$$typeof === xt && Le._context === void 0
        );
        if (!We && !Kb.has(d)) {
          Kb.add(d);
          var st = "";
          Le === void 0 ? st = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : typeof Le != "object" ? st = " However, it is set to a " + typeof Le + "." : Le.$$typeof === Rt ? st = " Did you accidentally pass the Context.Provider instead?" : Le._context !== void 0 ? st = " Did you accidentally pass the Context.Consumer instead?" : st = " However, it is set to an object with keys {" + Object.keys(Le).join(", ") + "}.", s("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", ae(d) || "Component", st);
        }
      }
      if (typeof Le == "object" && Le !== null)
        Ce = Xa(Le);
      else {
        Q = Hp(o, d, !0);
        var It = d.contextTypes;
        G = It != null, Ce = G ? Bp(o, Q) : zs;
      }
      if (o.mode & Da) {
        Mr();
        try {
          new d(M, Ce);
        } finally {
          Rr();
        }
      }
      var Ht = new d(M, Ce), cr = o.memoizedState = Ht.state !== null && Ht.state !== void 0 ? Ht.state : null;
      ZA(o, Ht);
      {
        if (typeof d.getDerivedStateFromProps == "function" && cr === null) {
          var Qt = ae(d) || "Component";
          Ub.has(Qt) || (Ub.add(Qt), s("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", Qt, Ht.state === null ? "null" : "undefined", Qt));
        }
        if (typeof d.getDerivedStateFromProps == "function" || typeof Ht.getSnapshotBeforeUpdate == "function") {
          var hr = null, Vr = null, sn = null;
          if (typeof Ht.componentWillMount == "function" && Ht.componentWillMount.__suppressDeprecationWarning !== !0 ? hr = "componentWillMount" : typeof Ht.UNSAFE_componentWillMount == "function" && (hr = "UNSAFE_componentWillMount"), typeof Ht.componentWillReceiveProps == "function" && Ht.componentWillReceiveProps.__suppressDeprecationWarning !== !0 ? Vr = "componentWillReceiveProps" : typeof Ht.UNSAFE_componentWillReceiveProps == "function" && (Vr = "UNSAFE_componentWillReceiveProps"), typeof Ht.componentWillUpdate == "function" && Ht.componentWillUpdate.__suppressDeprecationWarning !== !0 ? sn = "componentWillUpdate" : typeof Ht.UNSAFE_componentWillUpdate == "function" && (sn = "UNSAFE_componentWillUpdate"), hr !== null || Vr !== null || sn !== null) {
            var Gn = ae(d) || "Component", ii = typeof d.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
            Yb.has(Gn) || (Yb.add(Gn), s(`Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://reactjs.org/link/unsafe-component-lifecycles`, Gn, ii, hr !== null ? `
  ` + hr : "", Vr !== null ? `
  ` + Vr : "", sn !== null ? `
  ` + sn : ""));
          }
        }
      }
      return G && pA(o, Q, Ce), Ht;
    }
    function U5(o, d) {
      var M = d.state;
      typeof d.componentWillMount == "function" && d.componentWillMount(), typeof d.UNSAFE_componentWillMount == "function" && d.UNSAFE_componentWillMount(), M !== d.state && (s("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", ae(o.type) || "Component"), Jb.enqueueReplaceState(d, d.state, null));
    }
    function JA(o, d, M, G) {
      var Q = d.state;
      if (typeof d.componentWillReceiveProps == "function" && d.componentWillReceiveProps(M, G), typeof d.UNSAFE_componentWillReceiveProps == "function" && d.UNSAFE_componentWillReceiveProps(M, G), d.state !== Q) {
        {
          var Ce = ae(o.type) || "Component";
          _b.has(Ce) || (_b.add(Ce), s("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", Ce));
        }
        Jb.enqueueReplaceState(d, d.state, null);
      }
    }
    function Qb(o, d, M, G) {
      _5(o, d, M);
      var Q = o.stateNode;
      Q.props = M, Q.state = o.memoizedState, Q.refs = jA, zb(o);
      var Ce = d.contextType;
      if (typeof Ce == "object" && Ce !== null)
        Q.context = Xa(Ce);
      else {
        var Le = Hp(o, d, !0);
        Q.context = Bp(o, Le);
      }
      {
        if (Q.state === M) {
          var We = ae(d) || "Component";
          $b.has(We) || ($b.add(We), s("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", We));
        }
        o.mode & Da && iu.recordLegacyContextWarning(o, Q), iu.recordUnsafeLifecycleWarnings(o, Q);
      }
      Gg(o, M, Q, G), Q.state = o.memoizedState;
      var st = d.getDerivedStateFromProps;
      typeof st == "function" && (u0(o, d, st, M), Q.state = o.memoizedState), typeof d.getDerivedStateFromProps != "function" && typeof Q.getSnapshotBeforeUpdate != "function" && (typeof Q.UNSAFE_componentWillMount == "function" || typeof Q.componentWillMount == "function") && (U5(o, Q), Gg(o, M, Q, G), Q.state = o.memoizedState), typeof Q.componentDidMount == "function" && (o.flags |= On);
    }
    function j5(o, d, M, G) {
      var Q = o.stateNode, Ce = o.memoizedProps;
      Q.props = Ce;
      var Le = Q.context, We = d.contextType, st = zs;
      if (typeof We == "object" && We !== null)
        st = Xa(We);
      else {
        var It = Hp(o, d, !0);
        st = Bp(o, It);
      }
      var Ht = d.getDerivedStateFromProps, cr = typeof Ht == "function" || typeof Q.getSnapshotBeforeUpdate == "function";
      !cr && (typeof Q.UNSAFE_componentWillReceiveProps == "function" || typeof Q.componentWillReceiveProps == "function") && (Ce !== M || Le !== st) && JA(o, Q, M, st), _A();
      var Qt = o.memoizedState, hr = Q.state = Qt;
      if (Gg(o, M, Q, G), hr = o.memoizedState, Ce === M && Qt === hr && !Yy() && !s0())
        return typeof Q.componentDidMount == "function" && (o.flags |= On), !1;
      typeof Ht == "function" && (u0(o, d, Ht, M), hr = o.memoizedState);
      var Vr = s0() || $A(o, d, Ce, M, Qt, hr, st);
      return Vr ? (!cr && (typeof Q.UNSAFE_componentWillMount == "function" || typeof Q.componentWillMount == "function") && (typeof Q.componentWillMount == "function" && Q.componentWillMount(), typeof Q.UNSAFE_componentWillMount == "function" && Q.UNSAFE_componentWillMount()), typeof Q.componentDidMount == "function" && (o.flags |= On)) : (typeof Q.componentDidMount == "function" && (o.flags |= On), o.memoizedProps = M, o.memoizedState = hr), Q.props = M, Q.state = hr, Q.context = st, Vr;
    }
    function Y5(o, d, M, G, Q) {
      var Ce = d.stateNode;
      zA(o, d);
      var Le = d.memoizedProps, We = d.type === d.elementType ? Le : au(d.type, Le);
      Ce.props = We;
      var st = d.pendingProps, It = Ce.context, Ht = M.contextType, cr = zs;
      if (typeof Ht == "object" && Ht !== null)
        cr = Xa(Ht);
      else {
        var Qt = Hp(d, M, !0);
        cr = Bp(d, Qt);
      }
      var hr = M.getDerivedStateFromProps, Vr = typeof hr == "function" || typeof Ce.getSnapshotBeforeUpdate == "function";
      !Vr && (typeof Ce.UNSAFE_componentWillReceiveProps == "function" || typeof Ce.componentWillReceiveProps == "function") && (Le !== st || It !== cr) && JA(d, Ce, G, cr), _A();
      var sn = d.memoizedState, Gn = Ce.state = sn;
      if (Gg(d, G, Ce, Q), Gn = d.memoizedState, Le === st && sn === Gn && !Yy() && !s0())
        return typeof Ce.componentDidUpdate == "function" && (Le !== o.memoizedProps || sn !== o.memoizedState) && (d.flags |= On), typeof Ce.getSnapshotBeforeUpdate == "function" && (Le !== o.memoizedProps || sn !== o.memoizedState) && (d.flags |= Fo), !1;
      typeof hr == "function" && (u0(d, M, hr, G), Gn = d.memoizedState);
      var ii = s0() || $A(d, M, We, G, sn, Gn, cr);
      return ii ? (!Vr && (typeof Ce.UNSAFE_componentWillUpdate == "function" || typeof Ce.componentWillUpdate == "function") && (typeof Ce.componentWillUpdate == "function" && Ce.componentWillUpdate(G, Gn, cr), typeof Ce.UNSAFE_componentWillUpdate == "function" && Ce.UNSAFE_componentWillUpdate(G, Gn, cr)), typeof Ce.componentDidUpdate == "function" && (d.flags |= On), typeof Ce.getSnapshotBeforeUpdate == "function" && (d.flags |= Fo)) : (typeof Ce.componentDidUpdate == "function" && (Le !== o.memoizedProps || sn !== o.memoizedState) && (d.flags |= On), typeof Ce.getSnapshotBeforeUpdate == "function" && (Le !== o.memoizedProps || sn !== o.memoizedState) && (d.flags |= Fo), d.memoizedProps = G, d.memoizedState = Gn), Ce.props = G, Ce.state = Gn, Ce.context = cr, ii;
    }
    var qb, ew, tw, rw, nw, QA = function(o, d) {
    };
    qb = !1, ew = !1, tw = {}, rw = {}, nw = {}, QA = function(o, d) {
      if (!(o === null || typeof o != "object") && !(!o._store || o._store.validated || o.key != null)) {
        if (typeof o._store != "object")
          throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
        o._store.validated = !0;
        var M = ae(d.type) || "Component";
        rw[M] || (rw[M] = !0, s('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'));
      }
    };
    var c0 = Array.isArray;
    function Hg(o, d, M) {
      var G = M.ref;
      if (G !== null && typeof G != "function" && typeof G != "object") {
        if ((o.mode & Da || Z) && // We warn in ReactElement.js if owner and self are equal for string refs
        // because these cannot be automatically converted to an arrow function
        // using a codemod. Therefore, we don't have to warn about string refs again.
        !(M._owner && M._self && M._owner.stateNode !== M._self)) {
          var Q = ae(o.type) || "Component";
          tw[Q] || (s('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', G), tw[Q] = !0);
        }
        if (M._owner) {
          var Ce = M._owner, Le;
          if (Ce) {
            var We = Ce;
            if (We.tag !== l)
              throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
            Le = We.stateNode;
          }
          if (!Le)
            throw Error("Missing owner for string ref " + G + ". This error is likely caused by a bug in React. Please file an issue.");
          var st = "" + G;
          if (d !== null && d.ref !== null && typeof d.ref == "function" && d.ref._stringRef === st)
            return d.ref;
          var It = function(Ht) {
            var cr = Le.refs;
            cr === jA && (cr = Le.refs = {}), Ht === null ? delete cr[st] : cr[st] = Ht;
          };
          return It._stringRef = st, It;
        } else {
          if (typeof G != "string")
            throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
          if (!M._owner)
            throw Error("Element ref was specified as a string (" + G + `) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://reactjs.org/link/refs-must-have-owner for more information.`);
        }
      }
      return G;
    }
    function d0(o, d) {
      if (o.type !== "textarea")
        throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(d) === "[object Object]" ? "object with keys {" + Object.keys(d).join(", ") + "}" : d) + "). If you meant to render a collection of children, use an array instead.");
    }
    function f0(o) {
      {
        var d = ae(o.type) || "Component";
        if (nw[d])
          return;
        nw[d] = !0, s("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
      }
    }
    function qA(o) {
      function d(fr, Ir) {
        if (o) {
          var sr = fr.lastEffect;
          sr !== null ? (sr.nextEffect = Ir, fr.lastEffect = Ir) : fr.firstEffect = fr.lastEffect = Ir, Ir.nextEffect = null, Ir.flags = Ji;
        }
      }
      function M(fr, Ir) {
        if (!o)
          return null;
        for (var sr = Ir; sr !== null; )
          d(fr, sr), sr = sr.sibling;
        return null;
      }
      function G(fr, Ir) {
        for (var sr = /* @__PURE__ */ new Map(), Zr = Ir; Zr !== null; )
          Zr.key !== null ? sr.set(Zr.key, Zr) : sr.set(Zr.index, Zr), Zr = Zr.sibling;
        return sr;
      }
      function Q(fr, Ir) {
        var sr = wh(fr, Ir);
        return sr.index = 0, sr.sibling = null, sr;
      }
      function Ce(fr, Ir, sr) {
        if (fr.index = sr, !o)
          return Ir;
        var Zr = fr.alternate;
        if (Zr !== null) {
          var fn = Zr.index;
          return fn < Ir ? (fr.flags = Yn, Ir) : fn;
        } else
          return fr.flags = Yn, Ir;
      }
      function Le(fr) {
        return o && fr.alternate === null && (fr.flags = Yn), fr;
      }
      function We(fr, Ir, sr, Zr) {
        if (Ir === null || Ir.tag !== y) {
          var fn = PS(sr, fr.mode, Zr);
          return fn.return = fr, fn;
        } else {
          var Rn = Q(Ir, sr);
          return Rn.return = fr, Rn;
        }
      }
      function st(fr, Ir, sr, Zr) {
        if (Ir !== null && (Ir.elementType === sr.type || // Keep this check inline so it only runs on the false path:
        LM(Ir, sr))) {
          var fn = Q(Ir, sr.props);
          return fn.ref = Hg(fr, Ir, sr), fn.return = fr, fn._debugSource = sr._source, fn._debugOwner = sr._owner, fn;
        }
        var Rn = DS(sr, fr.mode, Zr);
        return Rn.ref = Hg(fr, Ir, sr), Rn.return = fr, Rn;
      }
      function It(fr, Ir, sr, Zr) {
        if (Ir === null || Ir.tag !== p || Ir.stateNode.containerInfo !== sr.containerInfo || Ir.stateNode.implementation !== sr.implementation) {
          var fn = IS(sr, fr.mode, Zr);
          return fn.return = fr, fn;
        } else {
          var Rn = Q(Ir, sr.children || []);
          return Rn.return = fr, Rn;
        }
      }
      function Ht(fr, Ir, sr, Zr, fn) {
        if (Ir === null || Ir.tag !== C) {
          var Rn = Sh(sr, fr.mode, Zr, fn);
          return Rn.return = fr, Rn;
        } else {
          var gi = Q(Ir, sr);
          return gi.return = fr, gi;
        }
      }
      function cr(fr, Ir, sr) {
        if (typeof Ir == "string" || typeof Ir == "number") {
          var Zr = PS("" + Ir, fr.mode, sr);
          return Zr.return = fr, Zr;
        }
        if (typeof Ir == "object" && Ir !== null) {
          switch (Ir.$$typeof) {
            case ot: {
              var fn = DS(Ir, fr.mode, sr);
              return fn.ref = Hg(fr, null, Ir), fn.return = fr, fn;
            }
            case ct: {
              var Rn = IS(Ir, fr.mode, sr);
              return Rn.return = fr, Rn;
            }
          }
          if (c0(Ir) || Xe(Ir)) {
            var gi = Sh(Ir, fr.mode, sr, null);
            return gi.return = fr, gi;
          }
          d0(fr, Ir);
        }
        return typeof Ir == "function" && f0(fr), null;
      }
      function Qt(fr, Ir, sr, Zr) {
        var fn = Ir !== null ? Ir.key : null;
        if (typeof sr == "string" || typeof sr == "number")
          return fn !== null ? null : We(fr, Ir, "" + sr, Zr);
        if (typeof sr == "object" && sr !== null) {
          switch (sr.$$typeof) {
            case ot:
              return sr.key === fn ? sr.type === Tt ? Ht(fr, Ir, sr.props.children, Zr, fn) : st(fr, Ir, sr, Zr) : null;
            case ct:
              return sr.key === fn ? It(fr, Ir, sr, Zr) : null;
          }
          if (c0(sr) || Xe(sr))
            return fn !== null ? null : Ht(fr, Ir, sr, Zr, null);
          d0(fr, sr);
        }
        return typeof sr == "function" && f0(fr), null;
      }
      function hr(fr, Ir, sr, Zr, fn) {
        if (typeof Zr == "string" || typeof Zr == "number") {
          var Rn = fr.get(sr) || null;
          return We(Ir, Rn, "" + Zr, fn);
        }
        if (typeof Zr == "object" && Zr !== null) {
          switch (Zr.$$typeof) {
            case ot: {
              var gi = fr.get(Zr.key === null ? sr : Zr.key) || null;
              return Zr.type === Tt ? Ht(Ir, gi, Zr.props.children, fn, Zr.key) : st(Ir, gi, Zr, fn);
            }
            case ct: {
              var sa = fr.get(Zr.key === null ? sr : Zr.key) || null;
              return It(Ir, sa, Zr, fn);
            }
          }
          if (c0(Zr) || Xe(Zr)) {
            var ya = fr.get(sr) || null;
            return Ht(Ir, ya, Zr, fn, null);
          }
          d0(Ir, Zr);
        }
        return typeof Zr == "function" && f0(Ir), null;
      }
      function Vr(fr, Ir, sr) {
        {
          if (typeof fr != "object" || fr === null)
            return Ir;
          switch (fr.$$typeof) {
            case ot:
            case ct:
              QA(fr, sr);
              var Zr = fr.key;
              if (typeof Zr != "string")
                break;
              if (Ir === null) {
                Ir = /* @__PURE__ */ new Set(), Ir.add(Zr);
                break;
              }
              if (!Ir.has(Zr)) {
                Ir.add(Zr);
                break;
              }
              s("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.", Zr);
              break;
          }
        }
        return Ir;
      }
      function sn(fr, Ir, sr, Zr) {
        for (var fn = null, Rn = 0; Rn < sr.length; Rn++) {
          var gi = sr[Rn];
          fn = Vr(gi, fn, fr);
        }
        for (var sa = null, ya = null, zi = Ir, $a = 0, Ai = 0, Ca = null; zi !== null && Ai < sr.length; Ai++) {
          zi.index > Ai ? (Ca = zi, zi = null) : Ca = zi.sibling;
          var po = Qt(fr, zi, sr[Ai], Zr);
          if (po === null) {
            zi === null && (zi = Ca);
            break;
          }
          o && zi && po.alternate === null && d(fr, zi), $a = Ce(po, $a, Ai), ya === null ? sa = po : ya.sibling = po, ya = po, zi = Ca;
        }
        if (Ai === sr.length)
          return M(fr, zi), sa;
        if (zi === null) {
          for (; Ai < sr.length; Ai++) {
            var Ga = cr(fr, sr[Ai], Zr);
            Ga !== null && ($a = Ce(Ga, $a, Ai), ya === null ? sa = Ga : ya.sibling = Ga, ya = Ga);
          }
          return sa;
        }
        for (var Ku = G(fr, zi); Ai < sr.length; Ai++) {
          var Ha = hr(Ku, fr, Ai, sr[Ai], Zr);
          Ha !== null && (o && Ha.alternate !== null && Ku.delete(Ha.key === null ? Ai : Ha.key), $a = Ce(Ha, $a, Ai), ya === null ? sa = Ha : ya.sibling = Ha, ya = Ha);
        }
        return o && Ku.forEach(function(Ju) {
          return d(fr, Ju);
        }), sa;
      }
      function Gn(fr, Ir, sr, Zr) {
        var fn = Xe(sr);
        if (typeof fn != "function")
          throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
        {
          typeof Symbol == "function" && // $FlowFixMe Flow doesn't know about toStringTag
          sr[Symbol.toStringTag] === "Generator" && (ew || s("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."), ew = !0), sr.entries === fn && (qb || s("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), qb = !0);
          var Rn = fn.call(sr);
          if (Rn)
            for (var gi = null, sa = Rn.next(); !sa.done; sa = Rn.next()) {
              var ya = sa.value;
              gi = Vr(ya, gi, fr);
            }
        }
        var zi = fn.call(sr);
        if (zi == null)
          throw Error("An iterable object provided no iterator.");
        for (var $a = null, Ai = null, Ca = Ir, po = 0, Ga = 0, Ku = null, Ha = zi.next(); Ca !== null && !Ha.done; Ga++, Ha = zi.next()) {
          Ca.index > Ga ? (Ku = Ca, Ca = null) : Ku = Ca.sibling;
          var Ju = Qt(fr, Ca, Ha.value, Zr);
          if (Ju === null) {
            Ca === null && (Ca = Ku);
            break;
          }
          o && Ca && Ju.alternate === null && d(fr, Ca), po = Ce(Ju, po, Ga), Ai === null ? $a = Ju : Ai.sibling = Ju, Ai = Ju, Ca = Ku;
        }
        if (Ha.done)
          return M(fr, Ca), $a;
        if (Ca === null) {
          for (; !Ha.done; Ga++, Ha = zi.next()) {
            var xh = cr(fr, Ha.value, Zr);
            xh !== null && (po = Ce(xh, po, Ga), Ai === null ? $a = xh : Ai.sibling = xh, Ai = xh);
          }
          return $a;
        }
        for (var BS = G(fr, Ca); !Ha.done; Ga++, Ha = zi.next()) {
          var Yd = hr(BS, fr, Ga, Ha.value, Zr);
          Yd !== null && (o && Yd.alternate !== null && BS.delete(Yd.key === null ? Ga : Yd.key), po = Ce(Yd, po, Ga), Ai === null ? $a = Yd : Ai.sibling = Yd, Ai = Yd);
        }
        return o && BS.forEach(function(j9) {
          return d(fr, j9);
        }), $a;
      }
      function ii(fr, Ir, sr, Zr) {
        if (Ir !== null && Ir.tag === y) {
          M(fr, Ir.sibling);
          var fn = Q(Ir, sr);
          return fn.return = fr, fn;
        }
        M(fr, Ir);
        var Rn = PS(sr, fr.mode, Zr);
        return Rn.return = fr, Rn;
      }
      function jn(fr, Ir, sr, Zr) {
        for (var fn = sr.key, Rn = Ir; Rn !== null; ) {
          if (Rn.key === fn) {
            switch (Rn.tag) {
              case C: {
                if (sr.type === Tt) {
                  M(fr, Rn.sibling);
                  var gi = Q(Rn, sr.props.children);
                  return gi.return = fr, gi._debugSource = sr._source, gi._debugOwner = sr._owner, gi;
                }
                break;
              }
              case N:
              default: {
                if (Rn.elementType === sr.type || // Keep this check inline so it only runs on the false path:
                LM(Rn, sr)) {
                  M(fr, Rn.sibling);
                  var sa = Q(Rn, sr.props);
                  return sa.ref = Hg(fr, Rn, sr), sa.return = fr, sa._debugSource = sr._source, sa._debugOwner = sr._owner, sa;
                }
                break;
              }
            }
            M(fr, Rn);
            break;
          } else
            d(fr, Rn);
          Rn = Rn.sibling;
        }
        if (sr.type === Tt) {
          var ya = Sh(sr.props.children, fr.mode, Zr, sr.key);
          return ya.return = fr, ya;
        } else {
          var zi = DS(sr, fr.mode, Zr);
          return zi.ref = Hg(fr, Ir, sr), zi.return = fr, zi;
        }
      }
      function Si(fr, Ir, sr, Zr) {
        for (var fn = sr.key, Rn = Ir; Rn !== null; ) {
          if (Rn.key === fn)
            if (Rn.tag === p && Rn.stateNode.containerInfo === sr.containerInfo && Rn.stateNode.implementation === sr.implementation) {
              M(fr, Rn.sibling);
              var gi = Q(Rn, sr.children || []);
              return gi.return = fr, gi;
            } else {
              M(fr, Rn);
              break;
            }
          else
            d(fr, Rn);
          Rn = Rn.sibling;
        }
        var sa = IS(sr, fr.mode, Zr);
        return sa.return = fr, sa;
      }
      function qi(fr, Ir, sr, Zr) {
        var fn = typeof sr == "object" && sr !== null && sr.type === Tt && sr.key === null;
        fn && (sr = sr.props.children);
        var Rn = typeof sr == "object" && sr !== null;
        if (Rn)
          switch (sr.$$typeof) {
            case ot:
              return Le(jn(fr, Ir, sr, Zr));
            case ct:
              return Le(Si(fr, Ir, sr, Zr));
          }
        if (typeof sr == "string" || typeof sr == "number")
          return Le(ii(fr, Ir, "" + sr, Zr));
        if (c0(sr))
          return sn(fr, Ir, sr, Zr);
        if (Xe(sr))
          return Gn(fr, Ir, sr, Zr);
        if (Rn && d0(fr, sr), typeof sr == "function" && f0(fr), typeof sr > "u" && !fn)
          switch (fr.tag) {
            case l: {
              var gi = fr.stateNode;
              if (gi.render._isMockFunction)
                break;
            }
            case N:
            case i:
            case S:
            case F:
              throw Error((ae(fr.type) || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
          }
        return M(fr, Ir);
      }
      return qi;
    }
    var h0 = qA(!0), eE = qA(!1);
    function X5(o, d) {
      if (!(o === null || d.child === o.child))
        throw Error("Resuming work not yet implemented.");
      if (d.child !== null) {
        var M = d.child, G = wh(M, M.pendingProps);
        for (d.child = G, G.return = d; M.sibling !== null; )
          M = M.sibling, G = G.sibling = wh(M, M.pendingProps), G.return = d;
        G.sibling = null;
      }
    }
    function $5(o, d) {
      for (var M = o.child; M !== null; )
        s9(M, d), M = M.sibling;
    }
    var Bg = {}, Vd = Nd(Bg), Vg = Nd(Bg), p0 = Nd(Bg);
    function v0(o) {
      if (o === Bg)
        throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
      return o;
    }
    function tE() {
      var o = v0(p0.current);
      return o;
    }
    function iw(o, d) {
      No(p0, d, o), No(Vg, o, o), No(Vd, Bg, o);
      var M = MO(d);
      Oo(Vd, o), No(Vd, M, o);
    }
    function Up(o) {
      Oo(Vd, o), Oo(Vg, o), Oo(p0, o);
    }
    function aw() {
      var o = v0(Vd.current);
      return o;
    }
    function rE(o) {
      v0(p0.current);
      var d = v0(Vd.current), M = DO(d, o.type);
      d !== M && (No(Vg, o, o), No(Vd, M, o));
    }
    function ow(o) {
      Vg.current === o && (Oo(Vd, o), Oo(Vg, o));
    }
    var Z5 = 0, nE = 1, sw = 1, zg = 2, ou = Nd(Z5);
    function g0(o, d) {
      return (o & d) !== 0;
    }
    function Wg(o) {
      return o & nE;
    }
    function lw(o, d) {
      return o & nE | d;
    }
    function K5(o, d) {
      return o | d;
    }
    function dh(o, d) {
      No(ou, d, o);
    }
    function jp(o) {
      Oo(ou, o);
    }
    function J5(o, d) {
      var M = o.memoizedState;
      if (M !== null)
        return M.dehydrated !== null;
      var G = o.memoizedProps;
      return G.fallback === void 0 ? !1 : G.unstable_avoidThisFallback !== !0 ? !0 : !d;
    }
    function m0(o) {
      for (var d = o; d !== null; ) {
        if (d.tag === x) {
          var M = d.memoizedState;
          if (M !== null) {
            var G = M.dehydrated;
            if (G === null || qO(G) || e5(G))
              return d;
          }
        } else if (d.tag === L && // revealOrder undefined can't be trusted because it don't
        // keep track of whether it suspended or not.
        d.memoizedProps.revealOrder !== void 0) {
          var Q = (d.flags & bi) !== Ci;
          if (Q)
            return d;
        } else if (d.child !== null) {
          d.child.return = d, d = d.child;
          continue;
        }
        if (d === o)
          return null;
        for (; d.sibling === null; ) {
          if (d.return === null || d.return === o)
            return null;
          d = d.return;
        }
        d.sibling.return = d.return, d = d.sibling;
      }
      return null;
    }
    var uw = (
      /*  */
      0
    ), Yp = (
      /* */
      1
    ), Xp = (
      /*    */
      2
    ), _g = (
      /*   */
      4
    ), Dl = null, fh = null, zd = !1;
    function Q5(o) {
      var d = o.stateNode.containerInfo;
      return fh = oA(d), Dl = o, zd = !0, !0;
    }
    function iE(o, d) {
      switch (o.tag) {
        case f:
          l5(o.stateNode.containerInfo, d);
          break;
        case g:
          u5(o.type, o.memoizedProps, o.stateNode, d);
          break;
      }
      var M = h9();
      M.stateNode = d, M.return = o, M.flags = Ji, o.lastEffect !== null ? (o.lastEffect.nextEffect = M, o.lastEffect = M) : o.firstEffect = o.lastEffect = M;
    }
    function aE(o, d) {
      switch (d.flags = d.flags & ~Po | Yn, o.tag) {
        case f: {
          var M = o.stateNode.containerInfo;
          switch (d.tag) {
            case g:
              var G = d.type;
              d.pendingProps, c5(M, G);
              break;
            case y:
              var Q = d.pendingProps;
              d5(M, Q);
              break;
          }
          break;
        }
        case g: {
          var Ce = o.type, Le = o.memoizedProps, We = o.stateNode;
          switch (d.tag) {
            case g:
              var st = d.type;
              d.pendingProps, f5(Ce, Le, We, st);
              break;
            case y:
              var It = d.pendingProps;
              h5(Ce, Le, We, It);
              break;
            case x:
              p5(Ce, Le);
              break;
          }
          break;
        }
        default:
          return;
      }
    }
    function oE(o, d) {
      switch (o.tag) {
        case g: {
          var M = o.type;
          o.pendingProps;
          var G = JO(d, M);
          return G !== null ? (o.stateNode = G, !0) : !1;
        }
        case y: {
          var Q = o.pendingProps, Ce = QO(d, Q);
          return Ce !== null ? (o.stateNode = Ce, !0) : !1;
        }
        case x:
          return !1;
        default:
          return !1;
      }
    }
    function cw(o) {
      if (zd) {
        var d = fh;
        if (!d) {
          aE(Dl, o), zd = !1, Dl = o;
          return;
        }
        var M = d;
        if (!oE(o, d)) {
          if (d = By(M), !d || !oE(o, d)) {
            aE(Dl, o), zd = !1, Dl = o;
            return;
          }
          iE(Dl, M);
        }
        Dl = o, fh = oA(d);
      }
    }
    function q5(o, d, M) {
      var G = o.stateNode, Q = t5(G, o.type, o.memoizedProps, d, M, o);
      return o.updateQueue = Q, Q !== null;
    }
    function eN(o) {
      var d = o.stateNode, M = o.memoizedProps, G = r5(d, M, o);
      if (G) {
        var Q = Dl;
        if (Q !== null)
          switch (Q.tag) {
            case f: {
              var Ce = Q.stateNode.containerInfo;
              o5(Ce, d, M);
              break;
            }
            case g: {
              var Le = Q.type, We = Q.memoizedProps, st = Q.stateNode;
              s5(Le, We, st, d, M);
              break;
            }
          }
      }
      return G;
    }
    function tN(o) {
      var d = o.memoizedState, M = d !== null ? d.dehydrated : null;
      if (!M)
        throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
      return n5(M);
    }
    function sE(o) {
      for (var d = o.return; d !== null && d.tag !== g && d.tag !== f && d.tag !== x; )
        d = d.return;
      Dl = d;
    }
    function y0(o) {
      if (o !== Dl)
        return !1;
      if (!zd)
        return sE(o), zd = !0, !1;
      var d = o.type;
      if (o.tag !== g || d !== "head" && d !== "body" && !xb(d, o.memoizedProps))
        for (var M = fh; M; )
          iE(o, M), M = By(M);
      return sE(o), o.tag === x ? fh = tN(o) : fh = Dl ? By(o.stateNode) : null, !0;
    }
    function dw() {
      Dl = null, fh = null, zd = !1;
    }
    function fw() {
      return zd;
    }
    var Ug = [], hw;
    hw = {};
    function rN(o) {
      Ug.push(o);
    }
    function pw() {
      for (var o = 0; o < Ug.length; o++) {
        var d = Ug[o];
        d._workInProgressVersionPrimary = null;
      }
      Ug.length = 0;
    }
    function nN(o) {
      return o._workInProgressVersionPrimary;
    }
    function lE(o, d) {
      o._workInProgressVersionPrimary = d, Ug.push(o);
    }
    function iN(o) {
      o._currentPrimaryRenderer == null ? o._currentPrimaryRenderer = hw : o._currentPrimaryRenderer !== hw && s("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.");
    }
    var gn = a.ReactCurrentDispatcher, Fl = a.ReactCurrentBatchConfig, vw, gw;
    gw = {}, vw = /* @__PURE__ */ new Set();
    var jg = qe, ra = null, Ho = null, ho = null, C0 = !1, Yg = !1, aN = 25, zr = null, Pl = null, Wd = -1, mw = !1;
    function Qi() {
      {
        var o = zr;
        Pl === null ? Pl = [o] : Pl.push(o);
      }
    }
    function wn() {
      {
        var o = zr;
        Pl !== null && (Wd++, Pl[Wd] !== o && oN(o));
      }
    }
    function Xg(o) {
      o != null && !Array.isArray(o) && s("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", zr, typeof o);
    }
    function oN(o) {
      {
        var d = ae(ra.type);
        if (!vw.has(d) && (vw.add(d), Pl !== null)) {
          for (var M = "", G = 30, Q = 0; Q <= Wd; Q++) {
            for (var Ce = Pl[Q], Le = Q === Wd ? o : Ce, We = Q + 1 + ". " + Ce; We.length < G; )
              We += " ";
            We += Le + `
`, M += We;
          }
          s(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`, d, M);
        }
      }
    }
    function vs() {
      throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);
    }
    function yw(o, d) {
      if (mw)
        return !1;
      if (d === null)
        return s("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", zr), !1;
      o.length !== d.length && s(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`, zr, "[" + d.join(", ") + "]", "[" + o.join(", ") + "]");
      for (var M = 0; M < d.length && M < o.length; M++)
        if (!D(o[M], d[M]))
          return !1;
      return !0;
    }
    function $p(o, d, M, G, Q, Ce) {
      jg = Ce, ra = d, Pl = o !== null ? o._debugHookTypes : null, Wd = -1, mw = o !== null && o.type !== d.type, d.memoizedState = null, d.updateQueue = null, d.lanes = qe, o !== null && o.memoizedState !== null ? gn.current = xE : Pl !== null ? gn.current = SE : gn.current = wE;
      var Le = M(G, Q);
      if (Yg) {
        var We = 0;
        do {
          if (Yg = !1, !(We < aN))
            throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
          We += 1, mw = !1, Ho = null, ho = null, d.updateQueue = null, Wd = -1, gn.current = TE, Le = M(G, Q);
        } while (Yg);
      }
      gn.current = P0, d._debugHookTypes = Pl;
      var st = Ho !== null && Ho.next !== null;
      if (jg = qe, ra = null, Ho = null, ho = null, zr = null, Pl = null, Wd = -1, C0 = !1, st)
        throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
      return Le;
    }
    function uE(o, d, M) {
      d.updateQueue = o.updateQueue, d.flags &= ~(ul | On), o.lanes = Md(o.lanes, M);
    }
    function cE() {
      if (gn.current = P0, C0) {
        for (var o = ra.memoizedState; o !== null; ) {
          var d = o.queue;
          d !== null && (d.pending = null), o = o.next;
        }
        C0 = !1;
      }
      jg = qe, ra = null, Ho = null, ho = null, Pl = null, Wd = -1, zr = null, F0 = !1, Yg = !1;
    }
    function hh() {
      var o = {
        memoizedState: null,
        baseState: null,
        baseQueue: null,
        queue: null,
        next: null
      };
      return ho === null ? ra.memoizedState = ho = o : ho = ho.next = o, ho;
    }
    function ph() {
      var o;
      if (Ho === null) {
        var d = ra.alternate;
        d !== null ? o = d.memoizedState : o = null;
      } else
        o = Ho.next;
      var M;
      if (ho === null ? M = ra.memoizedState : M = ho.next, M !== null)
        ho = M, M = ho.next, Ho = o;
      else {
        if (o === null)
          throw Error("Rendered more hooks than during the previous render.");
        Ho = o;
        var G = {
          memoizedState: Ho.memoizedState,
          baseState: Ho.baseState,
          baseQueue: Ho.baseQueue,
          queue: Ho.queue,
          next: null
        };
        ho === null ? ra.memoizedState = ho = G : ho = ho.next = G;
      }
      return ho;
    }
    function sN() {
      return {
        lastEffect: null
      };
    }
    function b0(o, d) {
      return typeof d == "function" ? d(o) : d;
    }
    function Cw(o, d, M) {
      var G = hh(), Q;
      M !== void 0 ? Q = M(d) : Q = d, G.memoizedState = G.baseState = Q;
      var Ce = G.queue = {
        pending: null,
        dispatch: null,
        lastRenderedReducer: o,
        lastRenderedState: Q
      }, Le = Ce.dispatch = Iw.bind(null, ra, Ce);
      return [G.memoizedState, Le];
    }
    function bw(o, d, M) {
      var G = ph(), Q = G.queue;
      if (Q === null)
        throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
      Q.lastRenderedReducer = o;
      var Ce = Ho, Le = Ce.baseQueue, We = Q.pending;
      if (We !== null) {
        if (Le !== null) {
          var st = Le.next, It = We.next;
          Le.next = It, We.next = st;
        }
        Ce.baseQueue !== Le && s("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."), Ce.baseQueue = Le = We, Q.pending = null;
      }
      if (Le !== null) {
        var Ht = Le.next, cr = Ce.baseState, Qt = null, hr = null, Vr = null, sn = Ht;
        do {
          var Gn = sn.lane;
          if (Lu(jg, Gn)) {
            if (Vr !== null) {
              var jn = {
                // This update is going to be committed so we never want uncommit
                // it. Using NoLane works because 0 is a subset of all bitmasks, so
                // this will never be skipped by the check above.
                lane: Et,
                action: sn.action,
                eagerReducer: sn.eagerReducer,
                eagerState: sn.eagerState,
                next: null
              };
              Vr = Vr.next = jn;
            }
            if (sn.eagerReducer === o)
              cr = sn.eagerState;
            else {
              var Si = sn.action;
              cr = o(cr, Si);
            }
          } else {
            var ii = {
              lane: Gn,
              action: sn.action,
              eagerReducer: sn.eagerReducer,
              eagerState: sn.eagerState,
              next: null
            };
            Vr === null ? (hr = Vr = ii, Qt = cr) : Vr = Vr.next = ii, ra.lanes = xi(ra.lanes, Gn), mS(Gn);
          }
          sn = sn.next;
        } while (sn !== null && sn !== Ht);
        Vr === null ? Qt = cr : Vr.next = hr, D(cr, G.memoizedState) || Yw(), G.memoizedState = cr, G.baseState = Qt, G.baseQueue = Vr, Q.lastRenderedState = cr;
      }
      var qi = Q.dispatch;
      return [G.memoizedState, qi];
    }
    function ww(o, d, M) {
      var G = ph(), Q = G.queue;
      if (Q === null)
        throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
      Q.lastRenderedReducer = o;
      var Ce = Q.dispatch, Le = Q.pending, We = G.memoizedState;
      if (Le !== null) {
        Q.pending = null;
        var st = Le.next, It = st;
        do {
          var Ht = It.action;
          We = o(We, Ht), It = It.next;
        } while (It !== st);
        D(We, G.memoizedState) || Yw(), G.memoizedState = We, G.baseQueue === null && (G.baseState = We), Q.lastRenderedState = We;
      }
      return [We, Ce];
    }
    function dE(o, d, M) {
      iN(d);
      var G = d._getVersion, Q = G(d._source), Ce = !1, Le = nN(d);
      if (Le !== null ? Ce = Le === Q : (Ce = Lu(jg, o.mutableReadLanes), Ce && lE(d, Q)), Ce) {
        var We = M(d._source);
        return typeof We == "function" && s("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."), We;
      } else
        throw rN(d), Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.");
    }
    function fE(o, d, M, G) {
      var Q = d6();
      if (Q === null)
        throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
      var Ce = d._getVersion, Le = Ce(d._source), We = gn.current, st = We.useState(function() {
        return dE(Q, d, M);
      }), It = st[0], Ht = st[1], cr = It, Qt = ho, hr = o.memoizedState, Vr = hr.refs, sn = Vr.getSnapshot, Gn = hr.source, ii = hr.subscribe, jn = ra;
      if (o.memoizedState = {
        refs: Vr,
        source: d,
        subscribe: G
      }, We.useEffect(function() {
        Vr.getSnapshot = M, Vr.setSnapshot = Ht;
        var qi = Ce(d._source);
        if (!D(Le, qi)) {
          var fr = M(d._source);
          if (typeof fr == "function" && s("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."), !D(cr, fr)) {
            Ht(fr);
            var Ir = _d(jn);
            cy(Q, Ir);
          }
          ig(Q, Q.mutableReadLanes);
        }
      }, [M, d, G]), We.useEffect(function() {
        var qi = function() {
          var Ir = Vr.getSnapshot, sr = Vr.setSnapshot;
          try {
            sr(Ir(d._source));
            var Zr = _d(jn);
            cy(Q, Zr);
          } catch (fn) {
            sr(function() {
              throw fn;
            });
          }
        }, fr = G(d._source, qi);
        return typeof fr != "function" && s("Mutable source subscribe function must return an unsubscribe function."), fr;
      }, [d, G]), !D(sn, M) || !D(Gn, d) || !D(ii, G)) {
        var Si = {
          pending: null,
          dispatch: null,
          lastRenderedReducer: b0,
          lastRenderedState: cr
        };
        Si.dispatch = Ht = Iw.bind(null, ra, Si), Qt.queue = Si, Qt.baseQueue = null, cr = dE(Q, d, M), Qt.memoizedState = Qt.baseState = cr;
      }
      return cr;
    }
    function Sw(o, d, M) {
      var G = hh();
      return G.memoizedState = {
        refs: {
          getSnapshot: d,
          setSnapshot: null
        },
        source: o,
        subscribe: M
      }, fE(G, o, d, M);
    }
    function w0(o, d, M) {
      var G = ph();
      return fE(G, o, d, M);
    }
    function vh(o) {
      var d = hh();
      typeof o == "function" && (o = o()), d.memoizedState = d.baseState = o;
      var M = d.queue = {
        pending: null,
        dispatch: null,
        lastRenderedReducer: b0,
        lastRenderedState: o
      }, G = M.dispatch = Iw.bind(null, ra, M);
      return [d.memoizedState, G];
    }
    function $g(o) {
      return bw(b0);
    }
    function Zg(o) {
      return ww(b0);
    }
    function S0(o, d, M, G) {
      var Q = {
        tag: o,
        create: d,
        destroy: M,
        deps: G,
        // Circular
        next: null
      }, Ce = ra.updateQueue;
      if (Ce === null)
        Ce = sN(), ra.updateQueue = Ce, Ce.lastEffect = Q.next = Q;
      else {
        var Le = Ce.lastEffect;
        if (Le === null)
          Ce.lastEffect = Q.next = Q;
        else {
          var We = Le.next;
          Le.next = Q, Q.next = We, Ce.lastEffect = Q;
        }
      }
      return Q;
    }
    function x0(o) {
      var d = hh(), M = {
        current: o
      };
      return Object.seal(M), d.memoizedState = M, M;
    }
    function Zp(o) {
      var d = ph();
      return d.memoizedState;
    }
    function xw(o, d, M, G) {
      var Q = hh(), Ce = G === void 0 ? null : G;
      ra.flags |= o, Q.memoizedState = S0(Yp | d, M, void 0, Ce);
    }
    function Tw(o, d, M, G) {
      var Q = ph(), Ce = G === void 0 ? null : G, Le = void 0;
      if (Ho !== null) {
        var We = Ho.memoizedState;
        if (Le = We.destroy, Ce !== null) {
          var st = We.deps;
          if (yw(Ce, st)) {
            S0(d, M, Le, Ce);
            return;
          }
        }
      }
      ra.flags |= o, Q.memoizedState = S0(Yp | d, M, Le, Ce);
    }
    function T0(o, d) {
      return typeof jest < "u" && EM(ra), xw(On | ul, _g, o, d);
    }
    function Kp(o, d) {
      return typeof jest < "u" && EM(ra), Tw(On | ul, _g, o, d);
    }
    function Rw(o, d) {
      return xw(On, Xp, o, d);
    }
    function R0(o, d) {
      return Tw(On, Xp, o, d);
    }
    function hE(o, d) {
      if (typeof d == "function") {
        var M = d, G = o();
        return M(G), function() {
          M(null);
        };
      } else if (d != null) {
        var Q = d;
        Q.hasOwnProperty("current") || s("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(Q).join(", ") + "}");
        var Ce = o();
        return Q.current = Ce, function() {
          Q.current = null;
        };
      }
    }
    function Aw(o, d, M) {
      typeof d != "function" && s("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", d !== null ? typeof d : "null");
      var G = M != null ? M.concat([o]) : null;
      return xw(On, Xp, hE.bind(null, d, o), G);
    }
    function A0(o, d, M) {
      typeof d != "function" && s("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", d !== null ? typeof d : "null");
      var G = M != null ? M.concat([o]) : null;
      return Tw(On, Xp, hE.bind(null, d, o), G);
    }
    function lN(o, d) {
    }
    var E0 = lN;
    function Ew(o, d) {
      var M = hh(), G = d === void 0 ? null : d;
      return M.memoizedState = [o, G], o;
    }
    function M0(o, d) {
      var M = ph(), G = d === void 0 ? null : d, Q = M.memoizedState;
      if (Q !== null && G !== null) {
        var Ce = Q[1];
        if (yw(G, Ce))
          return Q[0];
      }
      return M.memoizedState = [o, G], o;
    }
    function Mw(o, d) {
      var M = hh(), G = d === void 0 ? null : d, Q = o();
      return M.memoizedState = [Q, G], Q;
    }
    function D0(o, d) {
      var M = ph(), G = d === void 0 ? null : d, Q = M.memoizedState;
      if (Q !== null && G !== null) {
        var Ce = Q[1];
        if (yw(G, Ce))
          return Q[0];
      }
      var Le = o();
      return M.memoizedState = [Le, G], Le;
    }
    function Dw(o) {
      var d = vh(o), M = d[0], G = d[1];
      return T0(function() {
        var Q = Fl.transition;
        Fl.transition = 1;
        try {
          G(o);
        } finally {
          Fl.transition = Q;
        }
      }, [o]), M;
    }
    function pE(o) {
      var d = $g(), M = d[0], G = d[1];
      return Kp(function() {
        var Q = Fl.transition;
        Fl.transition = 1;
        try {
          G(o);
        } finally {
          Fl.transition = Q;
        }
      }, [o]), M;
    }
    function vE(o) {
      var d = Zg(), M = d[0], G = d[1];
      return Kp(function() {
        var Q = Fl.transition;
        Fl.transition = 1;
        try {
          G(o);
        } finally {
          Fl.transition = Q;
        }
      }, [o]), M;
    }
    function uN(o, d) {
      var M = zp();
      sh(M < oh ? oh : M, function() {
        o(!0);
      }), sh(M > Gc ? Gc : M, function() {
        var G = Fl.transition;
        Fl.transition = 1;
        try {
          o(!1), d();
        } finally {
          Fl.transition = G;
        }
      });
    }
    function Fw() {
      var o = vh(!1), d = o[0], M = o[1], G = uN.bind(null, M);
      return x0(G), [G, d];
    }
    function gE() {
      var o = $g(), d = o[0], M = Zp(), G = M.current;
      return [G, d];
    }
    function mE() {
      var o = Zg(), d = o[0], M = Zp(), G = M.current;
      return [G, d];
    }
    var F0 = !1;
    function cN() {
      return F0;
    }
    function yE(o) {
      {
        var d = ae(o.type) || "Unknown";
        Ft() && !gw[d] && (s("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly."), gw[d] = !0);
      }
    }
    function Pw() {
      var o = g5.bind(null, yE.bind(null, ra));
      if (fw()) {
        var d = !1, M = ra, G = function() {
          throw d || (d = !0, F0 = !0, Ce(o()), F0 = !1, yE(M)), Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
        }, Q = y5(G), Ce = vh(Q)[1];
        return (ra.mode & ps) === ma && (ra.flags |= On | ul, S0(Yp | _g, function() {
          Ce(o());
        }, void 0, null)), Q;
      } else {
        var Le = o();
        return vh(Le), Le;
      }
    }
    function CE() {
      var o = $g()[0];
      return o;
    }
    function bE() {
      var o = Zg()[0];
      return o;
    }
    function Iw(o, d, M) {
      typeof arguments[3] == "function" && s("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
      var G = Us(), Q = _d(o), Ce = {
        lane: Q,
        action: M,
        eagerReducer: null,
        eagerState: null,
        next: null
      }, Le = d.pending;
      Le === null ? Ce.next = Ce : (Ce.next = Le.next, Le.next = Ce), d.pending = Ce;
      var We = o.alternate;
      if (o === ra || We !== null && We === ra)
        Yg = C0 = !0;
      else {
        if (o.lanes === qe && (We === null || We.lanes === qe)) {
          var st = d.lastRenderedReducer;
          if (st !== null) {
            var It;
            It = gn.current, gn.current = su;
            try {
              var Ht = d.lastRenderedState, cr = st(Ht, M);
              if (Ce.eagerReducer = st, Ce.eagerState = cr, D(cr, Ht))
                return;
            } catch {
            } finally {
              gn.current = It;
            }
          }
        }
        typeof jest < "u" && (AM(o), X6(o)), Bo(o, Q, G);
      }
    }
    var P0 = {
      readContext: Xa,
      useCallback: vs,
      useContext: vs,
      useEffect: vs,
      useImperativeHandle: vs,
      useLayoutEffect: vs,
      useMemo: vs,
      useReducer: vs,
      useRef: vs,
      useState: vs,
      useDebugValue: vs,
      useDeferredValue: vs,
      useTransition: vs,
      useMutableSource: vs,
      useOpaqueIdentifier: vs,
      unstable_isNewReconciler: z
    }, wE = null, SE = null, xE = null, TE = null, ju = null, su = null, I0 = null;
    {
      var Lw = function() {
        s("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
      }, si = function() {
        s("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
      };
      wE = {
        readContext: function(o, d) {
          return Xa(o, d);
        },
        useCallback: function(o, d) {
          return zr = "useCallback", Qi(), Xg(d), Ew(o, d);
        },
        useContext: function(o, d) {
          return zr = "useContext", Qi(), Xa(o, d);
        },
        useEffect: function(o, d) {
          return zr = "useEffect", Qi(), Xg(d), T0(o, d);
        },
        useImperativeHandle: function(o, d, M) {
          return zr = "useImperativeHandle", Qi(), Xg(M), Aw(o, d, M);
        },
        useLayoutEffect: function(o, d) {
          return zr = "useLayoutEffect", Qi(), Xg(d), Rw(o, d);
        },
        useMemo: function(o, d) {
          zr = "useMemo", Qi(), Xg(d);
          var M = gn.current;
          gn.current = ju;
          try {
            return Mw(o, d);
          } finally {
            gn.current = M;
          }
        },
        useReducer: function(o, d, M) {
          zr = "useReducer", Qi();
          var G = gn.current;
          gn.current = ju;
          try {
            return Cw(o, d, M);
          } finally {
            gn.current = G;
          }
        },
        useRef: function(o) {
          return zr = "useRef", Qi(), x0(o);
        },
        useState: function(o) {
          zr = "useState", Qi();
          var d = gn.current;
          gn.current = ju;
          try {
            return vh(o);
          } finally {
            gn.current = d;
          }
        },
        useDebugValue: function(o, d) {
          return zr = "useDebugValue", Qi(), void 0;
        },
        useDeferredValue: function(o) {
          return zr = "useDeferredValue", Qi(), Dw(o);
        },
        useTransition: function() {
          return zr = "useTransition", Qi(), Fw();
        },
        useMutableSource: function(o, d, M) {
          return zr = "useMutableSource", Qi(), Sw(o, d, M);
        },
        useOpaqueIdentifier: function() {
          return zr = "useOpaqueIdentifier", Qi(), Pw();
        },
        unstable_isNewReconciler: z
      }, SE = {
        readContext: function(o, d) {
          return Xa(o, d);
        },
        useCallback: function(o, d) {
          return zr = "useCallback", wn(), Ew(o, d);
        },
        useContext: function(o, d) {
          return zr = "useContext", wn(), Xa(o, d);
        },
        useEffect: function(o, d) {
          return zr = "useEffect", wn(), T0(o, d);
        },
        useImperativeHandle: function(o, d, M) {
          return zr = "useImperativeHandle", wn(), Aw(o, d, M);
        },
        useLayoutEffect: function(o, d) {
          return zr = "useLayoutEffect", wn(), Rw(o, d);
        },
        useMemo: function(o, d) {
          zr = "useMemo", wn();
          var M = gn.current;
          gn.current = ju;
          try {
            return Mw(o, d);
          } finally {
            gn.current = M;
          }
        },
        useReducer: function(o, d, M) {
          zr = "useReducer", wn();
          var G = gn.current;
          gn.current = ju;
          try {
            return Cw(o, d, M);
          } finally {
            gn.current = G;
          }
        },
        useRef: function(o) {
          return zr = "useRef", wn(), x0(o);
        },
        useState: function(o) {
          zr = "useState", wn();
          var d = gn.current;
          gn.current = ju;
          try {
            return vh(o);
          } finally {
            gn.current = d;
          }
        },
        useDebugValue: function(o, d) {
          return zr = "useDebugValue", wn(), void 0;
        },
        useDeferredValue: function(o) {
          return zr = "useDeferredValue", wn(), Dw(o);
        },
        useTransition: function() {
          return zr = "useTransition", wn(), Fw();
        },
        useMutableSource: function(o, d, M) {
          return zr = "useMutableSource", wn(), Sw(o, d, M);
        },
        useOpaqueIdentifier: function() {
          return zr = "useOpaqueIdentifier", wn(), Pw();
        },
        unstable_isNewReconciler: z
      }, xE = {
        readContext: function(o, d) {
          return Xa(o, d);
        },
        useCallback: function(o, d) {
          return zr = "useCallback", wn(), M0(o, d);
        },
        useContext: function(o, d) {
          return zr = "useContext", wn(), Xa(o, d);
        },
        useEffect: function(o, d) {
          return zr = "useEffect", wn(), Kp(o, d);
        },
        useImperativeHandle: function(o, d, M) {
          return zr = "useImperativeHandle", wn(), A0(o, d, M);
        },
        useLayoutEffect: function(o, d) {
          return zr = "useLayoutEffect", wn(), R0(o, d);
        },
        useMemo: function(o, d) {
          zr = "useMemo", wn();
          var M = gn.current;
          gn.current = su;
          try {
            return D0(o, d);
          } finally {
            gn.current = M;
          }
        },
        useReducer: function(o, d, M) {
          zr = "useReducer", wn();
          var G = gn.current;
          gn.current = su;
          try {
            return bw(o, d, M);
          } finally {
            gn.current = G;
          }
        },
        useRef: function(o) {
          return zr = "useRef", wn(), Zp();
        },
        useState: function(o) {
          zr = "useState", wn();
          var d = gn.current;
          gn.current = su;
          try {
            return $g(o);
          } finally {
            gn.current = d;
          }
        },
        useDebugValue: function(o, d) {
          return zr = "useDebugValue", wn(), E0();
        },
        useDeferredValue: function(o) {
          return zr = "useDeferredValue", wn(), pE(o);
        },
        useTransition: function() {
          return zr = "useTransition", wn(), gE();
        },
        useMutableSource: function(o, d, M) {
          return zr = "useMutableSource", wn(), w0(o, d, M);
        },
        useOpaqueIdentifier: function() {
          return zr = "useOpaqueIdentifier", wn(), CE();
        },
        unstable_isNewReconciler: z
      }, TE = {
        readContext: function(o, d) {
          return Xa(o, d);
        },
        useCallback: function(o, d) {
          return zr = "useCallback", wn(), M0(o, d);
        },
        useContext: function(o, d) {
          return zr = "useContext", wn(), Xa(o, d);
        },
        useEffect: function(o, d) {
          return zr = "useEffect", wn(), Kp(o, d);
        },
        useImperativeHandle: function(o, d, M) {
          return zr = "useImperativeHandle", wn(), A0(o, d, M);
        },
        useLayoutEffect: function(o, d) {
          return zr = "useLayoutEffect", wn(), R0(o, d);
        },
        useMemo: function(o, d) {
          zr = "useMemo", wn();
          var M = gn.current;
          gn.current = I0;
          try {
            return D0(o, d);
          } finally {
            gn.current = M;
          }
        },
        useReducer: function(o, d, M) {
          zr = "useReducer", wn();
          var G = gn.current;
          gn.current = I0;
          try {
            return ww(o, d, M);
          } finally {
            gn.current = G;
          }
        },
        useRef: function(o) {
          return zr = "useRef", wn(), Zp();
        },
        useState: function(o) {
          zr = "useState", wn();
          var d = gn.current;
          gn.current = I0;
          try {
            return Zg(o);
          } finally {
            gn.current = d;
          }
        },
        useDebugValue: function(o, d) {
          return zr = "useDebugValue", wn(), E0();
        },
        useDeferredValue: function(o) {
          return zr = "useDeferredValue", wn(), vE(o);
        },
        useTransition: function() {
          return zr = "useTransition", wn(), mE();
        },
        useMutableSource: function(o, d, M) {
          return zr = "useMutableSource", wn(), w0(o, d, M);
        },
        useOpaqueIdentifier: function() {
          return zr = "useOpaqueIdentifier", wn(), bE();
        },
        unstable_isNewReconciler: z
      }, ju = {
        readContext: function(o, d) {
          return Lw(), Xa(o, d);
        },
        useCallback: function(o, d) {
          return zr = "useCallback", si(), Qi(), Ew(o, d);
        },
        useContext: function(o, d) {
          return zr = "useContext", si(), Qi(), Xa(o, d);
        },
        useEffect: function(o, d) {
          return zr = "useEffect", si(), Qi(), T0(o, d);
        },
        useImperativeHandle: function(o, d, M) {
          return zr = "useImperativeHandle", si(), Qi(), Aw(o, d, M);
        },
        useLayoutEffect: function(o, d) {
          return zr = "useLayoutEffect", si(), Qi(), Rw(o, d);
        },
        useMemo: function(o, d) {
          zr = "useMemo", si(), Qi();
          var M = gn.current;
          gn.current = ju;
          try {
            return Mw(o, d);
          } finally {
            gn.current = M;
          }
        },
        useReducer: function(o, d, M) {
          zr = "useReducer", si(), Qi();
          var G = gn.current;
          gn.current = ju;
          try {
            return Cw(o, d, M);
          } finally {
            gn.current = G;
          }
        },
        useRef: function(o) {
          return zr = "useRef", si(), Qi(), x0(o);
        },
        useState: function(o) {
          zr = "useState", si(), Qi();
          var d = gn.current;
          gn.current = ju;
          try {
            return vh(o);
          } finally {
            gn.current = d;
          }
        },
        useDebugValue: function(o, d) {
          return zr = "useDebugValue", si(), Qi(), void 0;
        },
        useDeferredValue: function(o) {
          return zr = "useDeferredValue", si(), Qi(), Dw(o);
        },
        useTransition: function() {
          return zr = "useTransition", si(), Qi(), Fw();
        },
        useMutableSource: function(o, d, M) {
          return zr = "useMutableSource", si(), Qi(), Sw(o, d, M);
        },
        useOpaqueIdentifier: function() {
          return zr = "useOpaqueIdentifier", si(), Qi(), Pw();
        },
        unstable_isNewReconciler: z
      }, su = {
        readContext: function(o, d) {
          return Lw(), Xa(o, d);
        },
        useCallback: function(o, d) {
          return zr = "useCallback", si(), wn(), M0(o, d);
        },
        useContext: function(o, d) {
          return zr = "useContext", si(), wn(), Xa(o, d);
        },
        useEffect: function(o, d) {
          return zr = "useEffect", si(), wn(), Kp(o, d);
        },
        useImperativeHandle: function(o, d, M) {
          return zr = "useImperativeHandle", si(), wn(), A0(o, d, M);
        },
        useLayoutEffect: function(o, d) {
          return zr = "useLayoutEffect", si(), wn(), R0(o, d);
        },
        useMemo: function(o, d) {
          zr = "useMemo", si(), wn();
          var M = gn.current;
          gn.current = su;
          try {
            return D0(o, d);
          } finally {
            gn.current = M;
          }
        },
        useReducer: function(o, d, M) {
          zr = "useReducer", si(), wn();
          var G = gn.current;
          gn.current = su;
          try {
            return bw(o, d, M);
          } finally {
            gn.current = G;
          }
        },
        useRef: function(o) {
          return zr = "useRef", si(), wn(), Zp();
        },
        useState: function(o) {
          zr = "useState", si(), wn();
          var d = gn.current;
          gn.current = su;
          try {
            return $g(o);
          } finally {
            gn.current = d;
          }
        },
        useDebugValue: function(o, d) {
          return zr = "useDebugValue", si(), wn(), E0();
        },
        useDeferredValue: function(o) {
          return zr = "useDeferredValue", si(), wn(), pE(o);
        },
        useTransition: function() {
          return zr = "useTransition", si(), wn(), gE();
        },
        useMutableSource: function(o, d, M) {
          return zr = "useMutableSource", si(), wn(), w0(o, d, M);
        },
        useOpaqueIdentifier: function() {
          return zr = "useOpaqueIdentifier", si(), wn(), CE();
        },
        unstable_isNewReconciler: z
      }, I0 = {
        readContext: function(o, d) {
          return Lw(), Xa(o, d);
        },
        useCallback: function(o, d) {
          return zr = "useCallback", si(), wn(), M0(o, d);
        },
        useContext: function(o, d) {
          return zr = "useContext", si(), wn(), Xa(o, d);
        },
        useEffect: function(o, d) {
          return zr = "useEffect", si(), wn(), Kp(o, d);
        },
        useImperativeHandle: function(o, d, M) {
          return zr = "useImperativeHandle", si(), wn(), A0(o, d, M);
        },
        useLayoutEffect: function(o, d) {
          return zr = "useLayoutEffect", si(), wn(), R0(o, d);
        },
        useMemo: function(o, d) {
          zr = "useMemo", si(), wn();
          var M = gn.current;
          gn.current = su;
          try {
            return D0(o, d);
          } finally {
            gn.current = M;
          }
        },
        useReducer: function(o, d, M) {
          zr = "useReducer", si(), wn();
          var G = gn.current;
          gn.current = su;
          try {
            return ww(o, d, M);
          } finally {
            gn.current = G;
          }
        },
        useRef: function(o) {
          return zr = "useRef", si(), wn(), Zp();
        },
        useState: function(o) {
          zr = "useState", si(), wn();
          var d = gn.current;
          gn.current = su;
          try {
            return Zg(o);
          } finally {
            gn.current = d;
          }
        },
        useDebugValue: function(o, d) {
          return zr = "useDebugValue", si(), wn(), E0();
        },
        useDeferredValue: function(o) {
          return zr = "useDeferredValue", si(), wn(), vE(o);
        },
        useTransition: function() {
          return zr = "useTransition", si(), wn(), mE();
        },
        useMutableSource: function(o, d, M) {
          return zr = "useMutableSource", si(), wn(), w0(o, d, M);
        },
        useOpaqueIdentifier: function() {
          return zr = "useOpaqueIdentifier", si(), wn(), bE();
        },
        unstable_isNewReconciler: z
      };
    }
    var L0 = r.unstable_now, RE = 0, Kg = -1;
    function dN() {
      return RE;
    }
    function AE() {
      RE = L0();
    }
    function kw(o) {
      Kg = L0(), o.actualStartTime < 0 && (o.actualStartTime = L0());
    }
    function EE(o) {
      Kg = -1;
    }
    function k0(o, d) {
      if (Kg >= 0) {
        var M = L0() - Kg;
        o.actualDuration += M, d && (o.selfBaseDuration = M), Kg = -1;
      }
    }
    function Ow(o) {
      for (var d = o.child; d; )
        o.actualDuration += d.actualDuration, d = d.sibling;
    }
    var Jg = a.ReactCurrentOwner, Yu = !1, Nw, Qg, Gw, Hw, Bw, gh, Vw, O0;
    Nw = {}, Qg = {}, Gw = {}, Hw = {}, Bw = {}, gh = !1, Vw = {}, O0 = {};
    function gs(o, d, M, G) {
      o === null ? d.child = eE(d, null, M, G) : d.child = h0(d, o.child, M, G);
    }
    function fN(o, d, M, G) {
      d.child = h0(d, o.child, null, G), d.child = h0(d, null, M, G);
    }
    function ME(o, d, M, G, Q) {
      if (d.type !== d.elementType) {
        var Ce = M.propTypes;
        Ce && nu(
          Ce,
          G,
          // Resolved props
          "prop",
          ae(M)
        );
      }
      var Le = M.render, We = d.ref, st;
      _p(d, Q);
      {
        if (Jg.current = d, St(!0), st = $p(o, d, Le, G, We, Q), d.mode & Da) {
          Mr();
          try {
            st = $p(o, d, Le, G, We, Q);
          } finally {
            Rr();
          }
        }
        St(!1);
      }
      return o !== null && !Yu ? (uE(o, d, Q), Bc(o, d, Q)) : (d.flags |= xa, gs(o, d, st, Q), d.child);
    }
    function DE(o, d, M, G, Q, Ce) {
      if (o === null) {
        var Le = M.type;
        if (a9(Le) && M.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
        M.defaultProps === void 0) {
          var We = Le;
          return We = iv(Le), d.tag = F, d.type = We, Uw(d, Le), FE(o, d, We, G, Q, Ce);
        }
        {
          var st = Le.propTypes;
          st && nu(
            st,
            G,
            // Resolved props
            "prop",
            ae(Le)
          );
        }
        var It = MS(M.type, null, G, d, d.mode, Ce);
        return It.ref = d.ref, It.return = d, d.child = It, It;
      }
      {
        var Ht = M.type, cr = Ht.propTypes;
        cr && nu(
          cr,
          G,
          // Resolved props
          "prop",
          ae(Ht)
        );
      }
      var Qt = o.child;
      if (!no(Q, Ce)) {
        var hr = Qt.memoizedProps, Vr = M.compare;
        if (Vr = Vr !== null ? Vr : ge, Vr(hr, G) && o.ref === d.ref)
          return Bc(o, d, Ce);
      }
      d.flags |= xa;
      var sn = wh(Qt, G);
      return sn.ref = d.ref, sn.return = d, d.child = sn, sn;
    }
    function FE(o, d, M, G, Q, Ce) {
      if (d.type !== d.elementType) {
        var Le = d.elementType;
        if (Le.$$typeof === Yt) {
          var We = Le, st = We._payload, It = We._init;
          try {
            Le = It(st);
          } catch {
            Le = null;
          }
          var Ht = Le && Le.propTypes;
          Ht && nu(
            Ht,
            G,
            // Resolved (SimpleMemoComponent has no defaultProps)
            "prop",
            ae(Le)
          );
        }
      }
      if (o !== null) {
        var cr = o.memoizedProps;
        if (ge(cr, G) && o.ref === d.ref && // Prevent bailout if the implementation changed due to hot reload.
        d.type === o.type)
          if (Yu = !1, no(Ce, Q))
            (o.flags & bc) !== Ci && (Yu = !0);
          else return d.lanes = o.lanes, Bc(o, d, Ce);
      }
      return Ww(o, d, M, G, Ce);
    }
    function zw(o, d, M) {
      var G = d.pendingProps, Q = G.children, Ce = o !== null ? o.memoizedState : null;
      if (G.mode === "hidden" || G.mode === "unstable-defer-without-hiding")
        if ((d.mode & lh) === ma) {
          var Le = {
            baseLanes: qe
          };
          d.memoizedState = Le, J0(d, M);
        } else if (no(M, Nr)) {
          var Ht = {
            baseLanes: qe
          };
          d.memoizedState = Ht;
          var cr = Ce !== null ? Ce.baseLanes : M;
          J0(d, cr);
        } else {
          var We;
          if (Ce !== null) {
            var st = Ce.baseLanes;
            We = xi(st, M);
          } else
            We = M;
          nC(Nr), d.lanes = d.childLanes = Nr;
          var It = {
            baseLanes: We
          };
          return d.memoizedState = It, J0(d, We), null;
        }
      else {
        var Qt;
        Ce !== null ? (Qt = xi(Ce.baseLanes, M), d.memoizedState = null) : Qt = M, J0(d, Qt);
      }
      return gs(o, d, Q, M), d.child;
    }
    var hN = zw;
    function pN(o, d, M) {
      var G = d.pendingProps;
      return gs(o, d, G, M), d.child;
    }
    function vN(o, d, M) {
      var G = d.pendingProps.children;
      return gs(o, d, G, M), d.child;
    }
    function gN(o, d, M) {
      {
        d.flags |= On;
        var G = d.stateNode;
        G.effectDuration = 0, G.passiveEffectDuration = 0;
      }
      var Q = d.pendingProps, Ce = Q.children;
      return gs(o, d, Ce, M), d.child;
    }
    function PE(o, d) {
      var M = d.ref;
      (o === null && M !== null || o !== null && o.ref !== M) && (d.flags |= Ta);
    }
    function Ww(o, d, M, G, Q) {
      if (d.type !== d.elementType) {
        var Ce = M.propTypes;
        Ce && nu(
          Ce,
          G,
          // Resolved props
          "prop",
          ae(M)
        );
      }
      var Le;
      {
        var We = Hp(d, M, !0);
        Le = Bp(d, We);
      }
      var st;
      _p(d, Q);
      {
        if (Jg.current = d, St(!0), st = $p(o, d, M, G, Le, Q), d.mode & Da) {
          Mr();
          try {
            st = $p(o, d, M, G, Le, Q);
          } finally {
            Rr();
          }
        }
        St(!1);
      }
      return o !== null && !Yu ? (uE(o, d, Q), Bc(o, d, Q)) : (d.flags |= xa, gs(o, d, st, Q), d.child);
    }
    function IE(o, d, M, G, Q) {
      if (d.type !== d.elementType) {
        var Ce = M.propTypes;
        Ce && nu(
          Ce,
          G,
          // Resolved props
          "prop",
          ae(M)
        );
      }
      var Le;
      Wu(M) ? (Le = !0, $y(d)) : Le = !1, _p(d, Q);
      var We = d.stateNode, st;
      We === null ? (o !== null && (o.alternate = null, d.alternate = null, d.flags |= Yn), KA(d, M, G), Qb(d, M, G, Q), st = !0) : o === null ? st = j5(d, M, G, Q) : st = Y5(o, d, M, G, Q);
      var It = _w(o, d, M, st, Le, Q);
      {
        var Ht = d.stateNode;
        st && Ht.props !== G && (gh || s("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", ae(d.type) || "a component"), gh = !0);
      }
      return It;
    }
    function _w(o, d, M, G, Q, Ce) {
      PE(o, d);
      var Le = (d.flags & bi) !== Ci;
      if (!G && !Le)
        return Q && mA(d, M, !1), Bc(o, d, Ce);
      var We = d.stateNode;
      Jg.current = d;
      var st;
      if (Le && typeof M.getDerivedStateFromError != "function")
        st = null, EE();
      else {
        if (St(!0), st = We.render(), d.mode & Da) {
          Mr();
          try {
            We.render();
          } finally {
            Rr();
          }
        }
        St(!1);
      }
      return d.flags |= xa, o !== null && Le ? fN(o, d, st, Ce) : gs(o, d, st, Ce), d.memoizedState = We.state, Q && mA(d, M, !0), d.child;
    }
    function LE(o) {
      var d = o.stateNode;
      d.pendingContext ? vA(o, d.pendingContext, d.pendingContext !== d.context) : d.context && vA(o, d.context, !1), iw(o, d.containerInfo);
    }
    function mN(o, d, M) {
      LE(d);
      var G = d.updateQueue;
      if (!(o !== null && G !== null))
        throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
      var Q = d.pendingProps, Ce = d.memoizedState, Le = Ce !== null ? Ce.element : null;
      zA(o, d), Gg(d, Q, null, M);
      var We = d.memoizedState, st = We.element;
      if (st === Le)
        return dw(), Bc(o, d, M);
      var It = d.stateNode;
      if (It.hydrate && Q5(d)) {
        {
          var Ht = It.mutableSourceEagerHydrationData;
          if (Ht != null)
            for (var cr = 0; cr < Ht.length; cr += 2) {
              var Qt = Ht[cr], hr = Ht[cr + 1];
              lE(Qt, hr);
            }
        }
        var Vr = eE(d, null, st, M);
        d.child = Vr;
        for (var sn = Vr; sn; )
          sn.flags = sn.flags & ~Yn | Po, sn = sn.sibling;
      } else
        gs(o, d, st, M), dw();
      return d.child;
    }
    function yN(o, d, M) {
      rE(d), o === null && cw(d);
      var G = d.type, Q = d.pendingProps, Ce = o !== null ? o.memoizedProps : null, Le = Q.children, We = xb(G, Q);
      return We ? Le = null : Ce !== null && xb(G, Ce) && (d.flags |= Na), PE(o, d), gs(o, d, Le, M), d.child;
    }
    function CN(o, d) {
      return o === null && cw(d), null;
    }
    function bN(o, d, M, G, Q) {
      o !== null && (o.alternate = null, d.alternate = null, d.flags |= Yn);
      var Ce = d.pendingProps, Le = M, We = Le._payload, st = Le._init, It = st(We);
      d.type = It;
      var Ht = d.tag = o9(It), cr = au(It, Ce), Qt;
      switch (Ht) {
        case i:
          return Uw(d, It), d.type = It = iv(It), Qt = Ww(null, d, It, cr, Q), Qt;
        case l:
          return d.type = It = SS(It), Qt = IE(null, d, It, cr, Q), Qt;
        case S:
          return d.type = It = xS(It), Qt = ME(null, d, It, cr, Q), Qt;
        case T: {
          if (d.type !== d.elementType) {
            var hr = It.propTypes;
            hr && nu(
              hr,
              cr,
              // Resolved for outer only
              "prop",
              ae(It)
            );
          }
          return Qt = DE(
            null,
            d,
            It,
            au(It.type, cr),
            // The inner type can have defaults too
            G,
            Q
          ), Qt;
        }
      }
      var Vr = "";
      throw It !== null && typeof It == "object" && It.$$typeof === Yt && (Vr = " Did you wrap a component in React.lazy() more than once?"), Error("Element type is invalid. Received a promise that resolves to: " + It + ". Lazy element type must resolve to a class or function." + Vr);
    }
    function wN(o, d, M, G, Q) {
      o !== null && (o.alternate = null, d.alternate = null, d.flags |= Yn), d.tag = l;
      var Ce;
      return Wu(M) ? (Ce = !0, $y(d)) : Ce = !1, _p(d, Q), KA(d, M, G), Qb(d, M, G, Q), _w(null, d, M, !0, Ce, Q);
    }
    function SN(o, d, M, G) {
      o !== null && (o.alternate = null, d.alternate = null, d.flags |= Yn);
      var Q = d.pendingProps, Ce;
      {
        var Le = Hp(d, M, !1);
        Ce = Bp(d, Le);
      }
      _p(d, G);
      var We;
      {
        if (M.prototype && typeof M.prototype.render == "function") {
          var st = ae(M) || "Unknown";
          Nw[st] || (s("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", st, st), Nw[st] = !0);
        }
        d.mode & Da && iu.recordLegacyContextWarning(d, null), St(!0), Jg.current = d, We = $p(null, d, M, Q, Ce, G), St(!1);
      }
      if (d.flags |= xa, typeof We == "object" && We !== null && typeof We.render == "function" && We.$$typeof === void 0) {
        var It = ae(M) || "Unknown";
        Qg[It] || (s("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", It, It, It), Qg[It] = !0);
      }
      if (
        // Run these checks in production only if the flag is off.
        // Eventually we'll delete this branch altogether.
        typeof We == "object" && We !== null && typeof We.render == "function" && We.$$typeof === void 0
      ) {
        {
          var Ht = ae(M) || "Unknown";
          Qg[Ht] || (s("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", Ht, Ht, Ht), Qg[Ht] = !0);
        }
        d.tag = l, d.memoizedState = null, d.updateQueue = null;
        var cr = !1;
        Wu(M) ? (cr = !0, $y(d)) : cr = !1, d.memoizedState = We.state !== null && We.state !== void 0 ? We.state : null, zb(d);
        var Qt = M.getDerivedStateFromProps;
        return typeof Qt == "function" && u0(d, M, Qt, Q), ZA(d, We), Qb(d, M, Q, G), _w(null, d, M, !0, cr, G);
      } else {
        if (d.tag = i, d.mode & Da) {
          Mr();
          try {
            We = $p(null, d, M, Q, Ce, G);
          } finally {
            Rr();
          }
        }
        return gs(null, d, We, G), Uw(d, M), d.child;
      }
    }
    function Uw(o, d) {
      {
        if (d && d.childContextTypes && s("%s(...): childContextTypes cannot be defined on a function component.", d.displayName || d.name || "Component"), o.ref !== null) {
          var M = "", G = wt();
          G && (M += `

Check the render method of \`` + G + "`.");
          var Q = G || o._debugID || "", Ce = o._debugSource;
          Ce && (Q = Ce.fileName + ":" + Ce.lineNumber), Bw[Q] || (Bw[Q] = !0, s("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", M));
        }
        if (typeof d.getDerivedStateFromProps == "function") {
          var Le = ae(d) || "Unknown";
          Hw[Le] || (s("%s: Function components do not support getDerivedStateFromProps.", Le), Hw[Le] = !0);
        }
        if (typeof d.contextType == "object" && d.contextType !== null) {
          var We = ae(d) || "Unknown";
          Gw[We] || (s("%s: Function components do not support contextType.", We), Gw[We] = !0);
        }
      }
    }
    var N0 = {
      dehydrated: null,
      retryLane: Et
    };
    function G0(o) {
      return {
        baseLanes: o
      };
    }
    function kE(o, d) {
      return {
        baseLanes: xi(o.baseLanes, d)
      };
    }
    function xN(o, d, M, G) {
      if (d !== null) {
        var Q = d.memoizedState;
        if (Q === null)
          return !1;
      }
      return g0(o, zg);
    }
    function OE(o, d) {
      return Md(o.childLanes, d);
    }
    function NE(o, d, M) {
      var G = d.pendingProps;
      R9(d) && (d.flags |= bi);
      var Q = ou.current, Ce = !1, Le = (d.flags & bi) !== Ci;
      if (Le || xN(Q, o) ? (Ce = !0, d.flags &= ~bi) : (o === null || o.memoizedState !== null) && G.fallback !== void 0 && G.unstable_avoidThisFallback !== !0 && (Q = K5(Q, sw)), Q = Wg(Q), dh(d, Q), o === null) {
        G.fallback !== void 0 && cw(d);
        var We = G.children, st = G.fallback;
        if (Ce) {
          var It = GE(d, We, st, M), Ht = d.child;
          return Ht.memoizedState = G0(M), d.memoizedState = N0, It;
        } else if (typeof G.unstable_expectedLoadTime == "number") {
          var cr = GE(d, We, st, M), Qt = d.child;
          return Qt.memoizedState = G0(M), d.memoizedState = N0, d.lanes = qr, nC(qr), cr;
        } else
          return TN(d, We, M);
      } else {
        var hr = o.memoizedState;
        if (hr !== null)
          if (Ce) {
            var Vr = G.fallback, sn = G.children, Gn = VE(o, d, sn, Vr, M), ii = d.child, jn = o.child.memoizedState;
            return ii.memoizedState = jn === null ? G0(M) : kE(jn, M), ii.childLanes = OE(o, M), d.memoizedState = N0, Gn;
          } else {
            var Si = G.children, qi = BE(o, d, Si, M);
            return d.memoizedState = null, qi;
          }
        else if (Ce) {
          var fr = G.fallback, Ir = G.children, sr = VE(o, d, Ir, fr, M), Zr = d.child, fn = o.child.memoizedState;
          return Zr.memoizedState = fn === null ? G0(M) : kE(fn, M), Zr.childLanes = OE(o, M), d.memoizedState = N0, sr;
        } else {
          var Rn = G.children, gi = BE(o, d, Rn, M);
          return d.memoizedState = null, gi;
        }
      }
    }
    function TN(o, d, M) {
      var G = o.mode, Q = {
        mode: "visible",
        children: d
      }, Ce = FS(Q, G, M, null);
      return Ce.return = o, o.child = Ce, Ce;
    }
    function GE(o, d, M, G) {
      var Q = o.mode, Ce = o.child, Le = {
        mode: "hidden",
        children: d
      }, We, st;
      return (Q & ps) === ma && Ce !== null ? (We = Ce, We.childLanes = qe, We.pendingProps = Le, o.mode & Ws && (We.actualDuration = 0, We.actualStartTime = -1, We.selfBaseDuration = 0, We.treeBaseDuration = 0), st = Sh(M, Q, G, null)) : (We = FS(Le, Q, qe, null), st = Sh(M, Q, G, null)), We.return = o, st.return = o, We.sibling = st, o.child = We, st;
    }
    function HE(o, d) {
      return wh(o, d);
    }
    function BE(o, d, M, G) {
      var Q = o.child, Ce = Q.sibling, Le = HE(Q, {
        mode: "visible",
        children: M
      });
      return (d.mode & ps) === ma && (Le.lanes = G), Le.return = d, Le.sibling = null, Ce !== null && (Ce.nextEffect = null, Ce.flags = Ji, d.firstEffect = d.lastEffect = Ce), d.child = Le, Le;
    }
    function VE(o, d, M, G, Q) {
      var Ce = d.mode, Le = o.child, We = Le.sibling, st = {
        mode: "hidden",
        children: M
      }, It;
      if (
        // In legacy mode, we commit the primary tree as if it successfully
        // completed, even though it's in an inconsistent state.
        (Ce & ps) === ma && // Make sure we're on the second pass, i.e. the primary child fragment was
        // already cloned. In legacy mode, the only case where this isn't true is
        // when DevTools forces us to display a fallback; we skip the first render
        // pass entirely and go straight to rendering the fallback. (In Concurrent
        // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
        // only codepath.)
        d.child !== Le
      ) {
        var Ht = d.child;
        It = Ht, It.childLanes = qe, It.pendingProps = st, d.mode & Ws && (It.actualDuration = 0, It.actualStartTime = -1, It.selfBaseDuration = Le.selfBaseDuration, It.treeBaseDuration = Le.treeBaseDuration);
        var cr = It.lastEffect;
        cr !== null ? (d.firstEffect = It.firstEffect, d.lastEffect = cr, cr.nextEffect = null) : d.firstEffect = d.lastEffect = null;
      } else
        It = HE(Le, st);
      var Qt;
      return We !== null ? Qt = wh(We, G) : (Qt = Sh(G, Ce, Q, null), Qt.flags |= Yn), Qt.return = d, It.return = d, It.sibling = Qt, d.child = It, Qt;
    }
    function zE(o, d) {
      o.lanes = xi(o.lanes, d);
      var M = o.alternate;
      M !== null && (M.lanes = xi(M.lanes, d)), HA(o.return, d);
    }
    function RN(o, d, M) {
      for (var G = d; G !== null; ) {
        if (G.tag === x) {
          var Q = G.memoizedState;
          Q !== null && zE(G, M);
        } else if (G.tag === L)
          zE(G, M);
        else if (G.child !== null) {
          G.child.return = G, G = G.child;
          continue;
        }
        if (G === o)
          return;
        for (; G.sibling === null; ) {
          if (G.return === null || G.return === o)
            return;
          G = G.return;
        }
        G.sibling.return = G.return, G = G.sibling;
      }
    }
    function AN(o) {
      for (var d = o, M = null; d !== null; ) {
        var G = d.alternate;
        G !== null && m0(G) === null && (M = d), d = d.sibling;
      }
      return M;
    }
    function EN(o) {
      if (o !== void 0 && o !== "forwards" && o !== "backwards" && o !== "together" && !Vw[o])
        if (Vw[o] = !0, typeof o == "string")
          switch (o.toLowerCase()) {
            case "together":
            case "forwards":
            case "backwards": {
              s('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', o, o.toLowerCase());
              break;
            }
            case "forward":
            case "backward": {
              s('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', o, o.toLowerCase());
              break;
            }
            default:
              s('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', o);
              break;
          }
        else
          s('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', o);
    }
    function MN(o, d) {
      o !== void 0 && !O0[o] && (o !== "collapsed" && o !== "hidden" ? (O0[o] = !0, s('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', o)) : d !== "forwards" && d !== "backwards" && (O0[o] = !0, s('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', o)));
    }
    function WE(o, d) {
      {
        var M = Array.isArray(o), G = !M && typeof Xe(o) == "function";
        if (M || G) {
          var Q = M ? "array" : "iterable";
          return s("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", Q, d, Q), !1;
        }
      }
      return !0;
    }
    function DN(o, d) {
      if ((d === "forwards" || d === "backwards") && o !== void 0 && o !== null && o !== !1)
        if (Array.isArray(o)) {
          for (var M = 0; M < o.length; M++)
            if (!WE(o[M], M))
              return;
        } else {
          var G = Xe(o);
          if (typeof G == "function") {
            var Q = G.call(o);
            if (Q)
              for (var Ce = Q.next(), Le = 0; !Ce.done; Ce = Q.next()) {
                if (!WE(Ce.value, Le))
                  return;
                Le++;
              }
          } else
            s('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', d);
        }
    }
    function jw(o, d, M, G, Q, Ce) {
      var Le = o.memoizedState;
      Le === null ? o.memoizedState = {
        isBackwards: d,
        rendering: null,
        renderingStartTime: 0,
        last: G,
        tail: M,
        tailMode: Q,
        lastEffect: Ce
      } : (Le.isBackwards = d, Le.rendering = null, Le.renderingStartTime = 0, Le.last = G, Le.tail = M, Le.tailMode = Q, Le.lastEffect = Ce);
    }
    function _E(o, d, M) {
      var G = d.pendingProps, Q = G.revealOrder, Ce = G.tail, Le = G.children;
      EN(Q), MN(Ce, Q), DN(Le, Q), gs(o, d, Le, M);
      var We = ou.current, st = g0(We, zg);
      if (st)
        We = lw(We, zg), d.flags |= bi;
      else {
        var It = o !== null && (o.flags & bi) !== Ci;
        It && RN(d, d.child, M), We = Wg(We);
      }
      if (dh(d, We), (d.mode & ps) === ma)
        d.memoizedState = null;
      else
        switch (Q) {
          case "forwards": {
            var Ht = AN(d.child), cr;
            Ht === null ? (cr = d.child, d.child = null) : (cr = Ht.sibling, Ht.sibling = null), jw(
              d,
              !1,
              // isBackwards
              cr,
              Ht,
              Ce,
              d.lastEffect
            );
            break;
          }
          case "backwards": {
            var Qt = null, hr = d.child;
            for (d.child = null; hr !== null; ) {
              var Vr = hr.alternate;
              if (Vr !== null && m0(Vr) === null) {
                d.child = hr;
                break;
              }
              var sn = hr.sibling;
              hr.sibling = Qt, Qt = hr, hr = sn;
            }
            jw(
              d,
              !0,
              // isBackwards
              Qt,
              null,
              // last
              Ce,
              d.lastEffect
            );
            break;
          }
          case "together": {
            jw(
              d,
              !1,
              // isBackwards
              null,
              // tail
              null,
              // last
              void 0,
              d.lastEffect
            );
            break;
          }
          default:
            d.memoizedState = null;
        }
      return d.child;
    }
    function FN(o, d, M) {
      iw(d, d.stateNode.containerInfo);
      var G = d.pendingProps;
      return o === null ? d.child = h0(d, null, G, M) : gs(o, d, G, M), d.child;
    }
    var UE = !1;
    function PN(o, d, M) {
      var G = d.type, Q = G._context, Ce = d.pendingProps, Le = d.memoizedProps, We = Ce.value;
      {
        "value" in Ce || UE || (UE = !0, s("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));
        var st = d.type.propTypes;
        st && nu(st, Ce, "prop", "Context.Provider");
      }
      if (GA(d, We), Le !== null) {
        var It = Le.value, Ht = H5(Q, We, It);
        if (Ht === 0) {
          if (Le.children === Ce.children && !Yy())
            return Bc(o, d, M);
        } else
          B5(d, Q, Ht, M);
      }
      var cr = Ce.children;
      return gs(o, d, cr, M), d.child;
    }
    var jE = !1;
    function IN(o, d, M) {
      var G = d.type;
      G._context === void 0 ? G !== G.Consumer && (jE || (jE = !0, s("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))) : G = G._context;
      var Q = d.pendingProps, Ce = Q.children;
      typeof Ce != "function" && s("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."), _p(d, M);
      var Le = Xa(G, Q.unstable_observedBits), We;
      return Jg.current = d, St(!0), We = Ce(Le), St(!1), d.flags |= xa, gs(o, d, We, M), d.child;
    }
    function Yw() {
      Yu = !0;
    }
    function Bc(o, d, M) {
      return o !== null && (d.dependencies = o.dependencies), EE(), mS(d.lanes), no(M, d.childLanes) ? (X5(o, d), d.child) : null;
    }
    function LN(o, d, M) {
      {
        var G = d.return;
        if (G === null)
          throw new Error("Cannot swap the root fiber.");
        if (o.alternate = null, d.alternate = null, M.index = d.index, M.sibling = d.sibling, M.return = d.return, M.ref = d.ref, d === G.child)
          G.child = M;
        else {
          var Q = G.child;
          if (Q === null)
            throw new Error("Expected parent to have a child.");
          for (; Q.sibling !== d; )
            if (Q = Q.sibling, Q === null)
              throw new Error("Expected to find the previous sibling.");
          Q.sibling = M;
        }
        var Ce = G.lastEffect;
        return Ce !== null ? (Ce.nextEffect = o, G.lastEffect = o) : G.firstEffect = G.lastEffect = o, o.nextEffect = null, o.flags = Ji, M.flags |= Yn, M;
      }
    }
    function YE(o, d, M) {
      var G = d.lanes;
      if (d._debugNeedsRemount && o !== null)
        return LN(o, d, MS(d.type, d.key, d.pendingProps, d._debugOwner || null, d.mode, d.lanes));
      if (o !== null) {
        var Q = o.memoizedProps, Ce = d.pendingProps;
        if (Q !== Ce || Yy() || // Force a re-render if the implementation changed due to hot reload:
        d.type !== o.type)
          Yu = !0;
        else if (no(M, G))
          (o.flags & bc) !== Ci ? Yu = !0 : Yu = !1;
        else {
          switch (Yu = !1, d.tag) {
            case f:
              LE(d), dw();
              break;
            case g:
              rE(d);
              break;
            case l: {
              var Le = d.type;
              Wu(Le) && $y(d);
              break;
            }
            case p:
              iw(d, d.stateNode.containerInfo);
              break;
            case w: {
              var We = d.memoizedProps.value;
              GA(d, We);
              break;
            }
            case E:
              {
                var st = no(M, d.childLanes);
                st && (d.flags |= On);
                var It = d.stateNode;
                It.effectDuration = 0, It.passiveEffectDuration = 0;
              }
              break;
            case x: {
              var Ht = d.memoizedState;
              if (Ht !== null) {
                var cr = d.child, Qt = cr.childLanes;
                if (no(M, Qt))
                  return NE(o, d, M);
                dh(d, Wg(ou.current));
                var hr = Bc(o, d, M);
                return hr !== null ? hr.sibling : null;
              } else
                dh(d, Wg(ou.current));
              break;
            }
            case L: {
              var Vr = (o.flags & bi) !== Ci, sn = no(M, d.childLanes);
              if (Vr) {
                if (sn)
                  return _E(o, d, M);
                d.flags |= bi;
              }
              var Gn = d.memoizedState;
              if (Gn !== null && (Gn.rendering = null, Gn.tail = null, Gn.lastEffect = null), dh(d, ou.current), sn)
                break;
              return null;
            }
            case Y:
            case j:
              return d.lanes = qe, zw(o, d, M);
          }
          return Bc(o, d, M);
        }
      } else
        Yu = !1;
      switch (d.lanes = qe, d.tag) {
        case v:
          return SN(o, d, d.type, M);
        case P: {
          var ii = d.elementType;
          return bN(o, d, ii, G, M);
        }
        case i: {
          var jn = d.type, Si = d.pendingProps, qi = d.elementType === jn ? Si : au(jn, Si);
          return Ww(o, d, jn, qi, M);
        }
        case l: {
          var fr = d.type, Ir = d.pendingProps, sr = d.elementType === fr ? Ir : au(fr, Ir);
          return IE(o, d, fr, sr, M);
        }
        case f:
          return mN(o, d, M);
        case g:
          return yN(o, d, M);
        case y:
          return CN(o, d);
        case x:
          return NE(o, d, M);
        case p:
          return FN(o, d, M);
        case S: {
          var Zr = d.type, fn = d.pendingProps, Rn = d.elementType === Zr ? fn : au(Zr, fn);
          return ME(o, d, Zr, Rn, M);
        }
        case C:
          return pN(o, d, M);
        case m:
          return vN(o, d, M);
        case E:
          return gN(o, d, M);
        case w:
          return PN(o, d, M);
        case h:
          return IN(o, d, M);
        case T: {
          var gi = d.type, sa = d.pendingProps, ya = au(gi, sa);
          if (d.type !== d.elementType) {
            var zi = gi.propTypes;
            zi && nu(
              zi,
              ya,
              // Resolved for outer only
              "prop",
              ae(gi)
            );
          }
          return ya = au(gi.type, ya), DE(o, d, gi, ya, G, M);
        }
        case F:
          return FE(o, d, d.type, d.pendingProps, G, M);
        case k: {
          var $a = d.type, Ai = d.pendingProps, Ca = d.elementType === $a ? Ai : au($a, Ai);
          return wN(o, d, $a, Ca, M);
        }
        case L:
          return _E(o, d, M);
        case A:
          break;
        case O:
          break;
        case N:
          break;
        case Y:
          return zw(o, d, M);
        case j:
          return hN(o, d, M);
      }
      throw Error("Unknown unit of work tag (" + d.tag + "). This error is likely caused by a bug in React. Please file an issue.");
    }
    function Jp(o) {
      o.flags |= On;
    }
    function XE(o) {
      o.flags |= Ta;
    }
    var $E, Xw, ZE, KE;
    $E = function(o, d, M, G) {
      for (var Q = d.child; Q !== null; ) {
        if (Q.tag === g || Q.tag === y)
          LO(o, Q.stateNode);
        else if (Q.tag !== p) {
          if (Q.child !== null) {
            Q.child.return = Q, Q = Q.child;
            continue;
          }
        }
        if (Q === d)
          return;
        for (; Q.sibling === null; ) {
          if (Q.return === null || Q.return === d)
            return;
          Q = Q.return;
        }
        Q.sibling.return = Q.return, Q = Q.sibling;
      }
    }, Xw = function(o) {
    }, ZE = function(o, d, M, G, Q) {
      var Ce = o.memoizedProps;
      if (Ce !== G) {
        var Le = d.stateNode, We = aw(), st = OO(Le, M, Ce, G, Q, We);
        d.updateQueue = st, st && Jp(d);
      }
    }, KE = function(o, d, M, G) {
      M !== G && Jp(d);
    };
    function qg(o, d) {
      if (!fw())
        switch (o.tailMode) {
          case "hidden": {
            for (var M = o.tail, G = null; M !== null; )
              M.alternate !== null && (G = M), M = M.sibling;
            G === null ? o.tail = null : G.sibling = null;
            break;
          }
          case "collapsed": {
            for (var Q = o.tail, Ce = null; Q !== null; )
              Q.alternate !== null && (Ce = Q), Q = Q.sibling;
            Ce === null ? !d && o.tail !== null ? o.tail.sibling = null : o.tail = null : Ce.sibling = null;
            break;
          }
        }
    }
    function JE(o, d, M) {
      var G = d.pendingProps;
      switch (d.tag) {
        case v:
        case P:
        case F:
        case i:
        case S:
        case C:
        case m:
        case E:
        case h:
        case T:
          return null;
        case l: {
          var Q = d.type;
          return Wu(Q) && Xy(d), null;
        }
        case f: {
          Up(d), Fb(d), pw();
          var Ce = d.stateNode;
          if (Ce.pendingContext && (Ce.context = Ce.pendingContext, Ce.pendingContext = null), o === null || o.child === null) {
            var Le = y0(d);
            Le ? Jp(d) : Ce.hydrate || (d.flags |= Fo);
          }
          return Xw(d), null;
        }
        case g: {
          ow(d);
          var We = tE(), st = d.type;
          if (o !== null && d.stateNode != null)
            ZE(o, d, st, G, We), o.ref !== d.ref && XE(d);
          else {
            if (!G) {
              if (d.stateNode === null)
                throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
              return null;
            }
            var It = aw(), Ht = y0(d);
            if (Ht)
              q5(d, We, It) && Jp(d);
            else {
              var cr = IO(st, G, We, It, d);
              $E(cr, d, !1, !1), d.stateNode = cr, kO(cr, st, G, We) && Jp(d);
            }
            d.ref !== null && XE(d);
          }
          return null;
        }
        case y: {
          var Qt = G;
          if (o && d.stateNode != null) {
            var hr = o.memoizedProps;
            KE(o, d, hr, Qt);
          } else {
            if (typeof Qt != "string" && d.stateNode === null)
              throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
            var Vr = tE(), sn = aw(), Gn = y0(d);
            Gn ? eN(d) && Jp(d) : d.stateNode = NO(Qt, Vr, sn, d);
          }
          return null;
        }
        case x: {
          jp(d);
          var ii = d.memoizedState;
          if ((d.flags & bi) !== Ci)
            return d.lanes = M, (d.mode & Ws) !== ma && Ow(d), d;
          var jn = ii !== null, Si = !1;
          if (o === null)
            d.memoizedProps.fallback !== void 0 && y0(d);
          else {
            var qi = o.memoizedState;
            Si = qi !== null;
          }
          if (jn && !Si && (d.mode & ps) !== ma) {
            var fr = o === null && d.memoizedProps.unstable_avoidThisFallback !== !0;
            fr || g0(ou.current, sw) ? C6() : b6();
          }
          return (jn || Si) && (d.flags |= On), null;
        }
        case p:
          return Up(d), Xw(d), o === null && C5(d.stateNode.containerInfo), null;
        case w:
          return Hb(d), null;
        case k: {
          var Ir = d.type;
          return Wu(Ir) && Xy(d), null;
        }
        case L: {
          jp(d);
          var sr = d.memoizedState;
          if (sr === null)
            return null;
          var Zr = (d.flags & bi) !== Ci, fn = sr.rendering;
          if (fn === null)
            if (Zr)
              qg(sr, !1);
            else {
              var Rn = S6() && (o === null || (o.flags & bi) === Ci);
              if (!Rn)
                for (var gi = d.child; gi !== null; ) {
                  var sa = m0(gi);
                  if (sa !== null) {
                    Zr = !0, d.flags |= bi, qg(sr, !1);
                    var ya = sa.updateQueue;
                    return ya !== null && (d.updateQueue = ya, d.flags |= On), sr.lastEffect === null && (d.firstEffect = null), d.lastEffect = sr.lastEffect, $5(d, M), dh(d, lw(ou.current, zg)), d.child;
                  }
                  gi = gi.sibling;
                }
              sr.tail !== null && Go() > hM() && (d.flags |= bi, Zr = !0, qg(sr, !1), d.lanes = qr, nC(qr));
            }
          else {
            if (!Zr) {
              var zi = m0(fn);
              if (zi !== null) {
                d.flags |= bi, Zr = !0;
                var $a = zi.updateQueue;
                if ($a !== null && (d.updateQueue = $a, d.flags |= On), qg(sr, !0), sr.tail === null && sr.tailMode === "hidden" && !fn.alternate && !fw()) {
                  var Ai = d.lastEffect = sr.lastEffect;
                  return Ai !== null && (Ai.nextEffect = null), null;
                }
              } else // The time it took to render last row is greater than the remaining
              // time we have to render. So rendering one more row would likely
              // exceed it.
              Go() * 2 - sr.renderingStartTime > hM() && M !== Nr && (d.flags |= bi, Zr = !0, qg(sr, !1), d.lanes = qr, nC(qr));
            }
            if (sr.isBackwards)
              fn.sibling = d.child, d.child = fn;
            else {
              var Ca = sr.last;
              Ca !== null ? Ca.sibling = fn : d.child = fn, sr.last = fn;
            }
          }
          if (sr.tail !== null) {
            var po = sr.tail;
            sr.rendering = po, sr.tail = po.sibling, sr.lastEffect = d.lastEffect, sr.renderingStartTime = Go(), po.sibling = null;
            var Ga = ou.current;
            return Zr ? Ga = lw(Ga, zg) : Ga = Wg(Ga), dh(d, Ga), po;
          }
          return null;
        }
        case A:
          break;
        case O:
          break;
        case N:
          break;
        case Y:
        case j: {
          if (gS(d), o !== null) {
            var Ku = d.memoizedState, Ha = o.memoizedState, Ju = Ha !== null, xh = Ku !== null;
            Ju !== xh && G.mode !== "unstable-defer-without-hiding" && (d.flags |= On);
          }
          return null;
        }
      }
      throw Error("Unknown unit of work tag (" + d.tag + "). This error is likely caused by a bug in React. Please file an issue.");
    }
    function kN(o, d) {
      switch (o.tag) {
        case l: {
          var M = o.type;
          Wu(M) && Xy(o);
          var G = o.flags;
          return G & Yo ? (o.flags = G & ~Yo | bi, (o.mode & Ws) !== ma && Ow(o), o) : null;
        }
        case f: {
          Up(o), Fb(o), pw();
          var Q = o.flags;
          if ((Q & bi) !== Ci)
            throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
          return o.flags = Q & ~Yo | bi, o;
        }
        case g:
          return ow(o), null;
        case x: {
          jp(o);
          var Ce = o.flags;
          return Ce & Yo ? (o.flags = Ce & ~Yo | bi, (o.mode & Ws) !== ma && Ow(o), o) : null;
        }
        case L:
          return jp(o), null;
        case p:
          return Up(o), null;
        case w:
          return Hb(o), null;
        case Y:
        case j:
          return gS(o), null;
        default:
          return null;
      }
    }
    function QE(o) {
      switch (o.tag) {
        case l: {
          var d = o.type.childContextTypes;
          d != null && Xy(o);
          break;
        }
        case f: {
          Up(o), Fb(o), pw();
          break;
        }
        case g: {
          ow(o);
          break;
        }
        case p:
          Up(o);
          break;
        case x:
          jp(o);
          break;
        case L:
          jp(o);
          break;
        case w:
          Hb(o);
          break;
        case Y:
        case j:
          gS(o);
          break;
      }
    }
    function $w(o, d) {
      return {
        value: o,
        source: d,
        stack: cn(d)
      };
    }
    function ON(o, d) {
      return !0;
    }
    function Zw(o, d) {
      try {
        var M = ON(o, d);
        if (M === !1)
          return;
        var G = d.value, Q = d.source, Ce = d.stack, Le = Ce !== null ? Ce : "";
        if (G != null && G._suppressLogging) {
          if (o.tag === l)
            return;
          console.error(G);
        }
        var We = Q ? ae(Q.type) : null, st = We ? "The above error occurred in the <" + We + "> component:" : "The above error occurred in one of your React components:", It, Ht = ae(o.type);
        Ht ? It = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + Ht + ".") : It = `Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;
        var cr = st + `
` + Le + `

` + ("" + It);
        console.error(cr);
      } catch (Qt) {
        setTimeout(function() {
          throw Qt;
        });
      }
    }
    var NN = typeof WeakMap == "function" ? WeakMap : Map;
    function qE(o, d, M) {
      var G = Hd(un, M);
      G.tag = Bb, G.payload = {
        element: null
      };
      var Q = d.value;
      return G.callback = function() {
        N6(Q), Zw(o, d);
      }, G;
    }
    function eM(o, d, M) {
      var G = Hd(un, M);
      G.tag = Bb;
      var Q = o.type.getDerivedStateFromError;
      if (typeof Q == "function") {
        var Ce = d.value;
        G.payload = function() {
          return Zw(o, d), Q(Ce);
        };
      }
      var Le = o.stateNode;
      return Le !== null && typeof Le.componentDidCatch == "function" ? G.callback = function() {
        kM(o), typeof Q != "function" && (k6(this), Zw(o, d));
        var st = d.value, It = d.stack;
        this.componentDidCatch(st, {
          componentStack: It !== null ? It : ""
        }), typeof Q != "function" && (no(o.lanes, Dt) || s("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", ae(o.type) || "Unknown"));
      } : G.callback = function() {
        kM(o);
      }, G;
    }
    function GN(o, d, M) {
      var G = o.pingCache, Q;
      if (G === null ? (G = o.pingCache = new NN(), Q = /* @__PURE__ */ new Set(), G.set(d, Q)) : (Q = G.get(d), Q === void 0 && (Q = /* @__PURE__ */ new Set(), G.set(d, Q))), !Q.has(M)) {
        Q.add(M);
        var Ce = G6.bind(null, o, d, M);
        d.then(Ce, Ce);
      }
    }
    function HN(o, d, M, G, Q) {
      if (M.flags |= Cc, M.firstEffect = M.lastEffect = null, G !== null && typeof G == "object" && typeof G.then == "function") {
        var Ce = G;
        if ((M.mode & ps) === ma) {
          var Le = M.alternate;
          Le ? (M.updateQueue = Le.updateQueue, M.memoizedState = Le.memoizedState, M.lanes = Le.lanes) : (M.updateQueue = null, M.memoizedState = null);
        }
        var We = g0(ou.current, sw), st = d;
        do {
          if (st.tag === x && J5(st, We)) {
            var It = st.updateQueue;
            if (It === null) {
              var Ht = /* @__PURE__ */ new Set();
              Ht.add(Ce), st.updateQueue = Ht;
            } else
              It.add(Ce);
            if ((st.mode & ps) === ma) {
              if (st.flags |= bi, M.flags |= bc, M.flags &= ~(Tu | Cc), M.tag === l) {
                var cr = M.alternate;
                if (cr === null)
                  M.tag = k;
                else {
                  var Qt = Hd(un, Dt);
                  Qt.tag = i0, Bd(M, Qt);
                }
              }
              M.lanes = xi(M.lanes, Dt);
              return;
            }
            GN(o, Ce, Q), st.flags |= Yo, st.lanes = Q;
            return;
          }
          st = st.return;
        } while (st !== null);
        G = new Error((ae(M.type) || "A React component") + ` suspended while rendering, but no fallback UI was specified.

Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`);
      }
      w6(), G = $w(G, M);
      var hr = d;
      do {
        switch (hr.tag) {
          case f: {
            var Vr = G;
            hr.flags |= Yo;
            var sn = Zi(Q);
            hr.lanes = xi(hr.lanes, sn);
            var Gn = qE(hr, Vr, sn);
            WA(hr, Gn);
            return;
          }
          case l:
            var ii = G, jn = hr.type, Si = hr.stateNode;
            if ((hr.flags & bi) === Ci && (typeof jn.getDerivedStateFromError == "function" || Si !== null && typeof Si.componentDidCatch == "function" && !yS(Si))) {
              hr.flags |= Yo;
              var qi = Zi(Q);
              hr.lanes = xi(hr.lanes, qi);
              var fr = eM(hr, ii, qi);
              WA(hr, fr);
              return;
            }
            break;
        }
        hr = hr.return;
      } while (hr !== null);
    }
    var tM = null;
    tM = /* @__PURE__ */ new Set();
    var BN = typeof WeakSet == "function" ? WeakSet : Set, VN = function(o, d) {
      d.props = o.memoizedProps, d.state = o.memoizedState, d.componentWillUnmount();
    };
    function zN(o, d) {
      if (to(null, VN, null, o, d), go()) {
        var M = Ua();
        Ud(o, M);
      }
    }
    function rM(o) {
      var d = o.ref;
      if (d !== null)
        if (typeof d == "function") {
          if (to(null, d, null, null), go()) {
            var M = Ua();
            Ud(o, M);
          }
        } else
          d.current = null;
    }
    function WN(o, d) {
      if (to(null, d, null), go()) {
        var M = Ua();
        Ud(o, M);
      }
    }
    function _N(o, d) {
      switch (d.tag) {
        case i:
        case S:
        case F:
        case N:
          return;
        case l: {
          if (d.flags & Fo && o !== null) {
            var M = o.memoizedProps, G = o.memoizedState, Q = d.stateNode;
            d.type === d.elementType && !gh && (Q.props !== d.memoizedProps && s("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", ae(d.type) || "instance"), Q.state !== d.memoizedState && s("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", ae(d.type) || "instance"));
            var Ce = Q.getSnapshotBeforeUpdate(d.elementType === d.type ? M : au(d.type, M), G);
            {
              var Le = tM;
              Ce === void 0 && !Le.has(d.type) && (Le.add(d.type), s("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", ae(d.type)));
            }
            Q.__reactInternalSnapshotBeforeUpdate = Ce;
          }
          return;
        }
        case f: {
          if (d.flags & Fo) {
            var We = d.stateNode;
            Rb(We.containerInfo);
          }
          return;
        }
        case g:
        case y:
        case p:
        case k:
          return;
      }
      throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
    }
    function UN(o, d) {
      var M = d.updateQueue, G = M !== null ? M.lastEffect : null;
      if (G !== null) {
        var Q = G.next, Ce = Q;
        do {
          if ((Ce.tag & o) === o) {
            var Le = Ce.destroy;
            Ce.destroy = void 0, Le !== void 0 && Le();
          }
          Ce = Ce.next;
        } while (Ce !== Q);
      }
    }
    function jN(o, d) {
      var M = d.updateQueue, G = M !== null ? M.lastEffect : null;
      if (G !== null) {
        var Q = G.next, Ce = Q;
        do {
          if ((Ce.tag & o) === o) {
            var Le = Ce.create;
            Ce.destroy = Le();
            {
              var We = Ce.destroy;
              if (We !== void 0 && typeof We != "function") {
                var st = void 0;
                We === null ? st = " You returned null. If your effect does not require clean up, return undefined (or nothing)." : typeof We.then == "function" ? st = `

It looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

useEffect(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching` : st = " You returned: " + We, s("An effect function must not return anything besides a function, which is used for clean-up.%s", st);
              }
            }
          }
          Ce = Ce.next;
        } while (Ce !== Q);
      }
    }
    function YN(o) {
      var d = o.updateQueue, M = d !== null ? d.lastEffect : null;
      if (M !== null) {
        var G = M.next, Q = G;
        do {
          var Ce = Q, Le = Ce.next, We = Ce.tag;
          (We & _g) !== uw && (We & Yp) !== uw && (SM(o, Q), P6(o, Q)), Q = Le;
        } while (Q !== G);
      }
    }
    function XN(o, d, M, G) {
      switch (M.tag) {
        case i:
        case S:
        case F:
        case N: {
          jN(Xp | Yp, M), YN(M);
          return;
        }
        case l: {
          var Q = M.stateNode;
          if (M.flags & On)
            if (d === null)
              M.type === M.elementType && !gh && (Q.props !== M.memoizedProps && s("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", ae(M.type) || "instance"), Q.state !== M.memoizedState && s("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", ae(M.type) || "instance")), Q.componentDidMount();
            else {
              var Ce = M.elementType === M.type ? d.memoizedProps : au(M.type, d.memoizedProps), Le = d.memoizedState;
              M.type === M.elementType && !gh && (Q.props !== M.memoizedProps && s("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", ae(M.type) || "instance"), Q.state !== M.memoizedState && s("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", ae(M.type) || "instance")), Q.componentDidUpdate(Ce, Le, Q.__reactInternalSnapshotBeforeUpdate);
            }
          var We = M.updateQueue;
          We !== null && (M.type === M.elementType && !gh && (Q.props !== M.memoizedProps && s("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", ae(M.type) || "instance"), Q.state !== M.memoizedState && s("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", ae(M.type) || "instance")), UA(M, We, Q));
          return;
        }
        case f: {
          var st = M.updateQueue;
          if (st !== null) {
            var It = null;
            if (M.child !== null)
              switch (M.child.tag) {
                case g:
                  It = M.child.stateNode;
                  break;
                case l:
                  It = M.child.stateNode;
                  break;
              }
            UA(M, st, It);
          }
          return;
        }
        case g: {
          var Ht = M.stateNode;
          if (d === null && M.flags & On) {
            var cr = M.type, Qt = M.memoizedProps;
            HO(Ht, cr, Qt);
          }
          return;
        }
        case y:
          return;
        case p:
          return;
        case E: {
          {
            var hr = M.memoizedProps;
            hr.onCommit;
            var Vr = hr.onRender;
            M.stateNode.effectDuration;
            var sn = dN();
            typeof Vr == "function" && Vr(M.memoizedProps.id, d === null ? "mount" : "update", M.actualDuration, M.treeBaseDuration, M.actualStartTime, sn, o.memoizedInteractions);
          }
          return;
        }
        case x: {
          t6(o, M);
          return;
        }
        case L:
        case k:
        case A:
        case O:
        case Y:
        case j:
          return;
      }
      throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
    }
    function nM(o, d) {
      for (var M = o; ; ) {
        if (M.tag === g) {
          var G = M.stateNode;
          d ? XO(G) : ZO(M.stateNode, M.memoizedProps);
        } else if (M.tag === y) {
          var Q = M.stateNode;
          d ? $O(Q) : KO(Q, M.memoizedProps);
        } else if (!((M.tag === Y || M.tag === j) && M.memoizedState !== null && M !== o)) {
          if (M.child !== null) {
            M.child.return = M, M = M.child;
            continue;
          }
        }
        if (M === o)
          return;
        for (; M.sibling === null; ) {
          if (M.return === null || M.return === o)
            return;
          M = M.return;
        }
        M.sibling.return = M.return, M = M.sibling;
      }
    }
    function $N(o) {
      var d = o.ref;
      if (d !== null) {
        var M = o.stateNode, G;
        switch (o.tag) {
          case g:
            G = M;
            break;
          default:
            G = M;
        }
        typeof d == "function" ? d(G) : (d.hasOwnProperty("current") || s("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", ae(o.type)), d.current = G);
      }
    }
    function ZN(o) {
      var d = o.ref;
      d !== null && (typeof d == "function" ? d(null) : d.current = null);
    }
    function iM(o, d, M) {
      switch (A5(d), d.tag) {
        case i:
        case S:
        case T:
        case F:
        case N: {
          var G = d.updateQueue;
          if (G !== null) {
            var Q = G.lastEffect;
            if (Q !== null) {
              var Ce = Q.next, Le = Ce;
              do {
                var We = Le, st = We.destroy, It = We.tag;
                st !== void 0 && ((It & _g) !== uw ? SM(d, Le) : WN(d, st)), Le = Le.next;
              } while (Le !== Ce);
            }
          }
          return;
        }
        case l: {
          rM(d);
          var Ht = d.stateNode;
          typeof Ht.componentWillUnmount == "function" && zN(d, Ht);
          return;
        }
        case g: {
          rM(d);
          return;
        }
        case p: {
          lM(o, d);
          return;
        }
        case A:
          return;
        case I:
          return;
        case O:
          return;
      }
    }
    function KN(o, d, M) {
      for (var G = d; ; ) {
        if (iM(o, G), G.child !== null && // If we use mutation we drill down into portals using commitUnmount above.
        // If we don't use mutation we drill down into portals here instead.
        G.tag !== p) {
          G.child.return = G, G = G.child;
          continue;
        }
        if (G === d)
          return;
        for (; G.sibling === null; ) {
          if (G.return === null || G.return === d)
            return;
          G = G.return;
        }
        G.sibling.return = G.return, G = G.sibling;
      }
    }
    function aM(o) {
      o.alternate = null, o.child = null, o.dependencies = null, o.firstEffect = null, o.lastEffect = null, o.memoizedProps = null, o.memoizedState = null, o.pendingProps = null, o.return = null, o.updateQueue = null, o._debugOwner = null;
    }
    function JN(o) {
      for (var d = o.return; d !== null; ) {
        if (oM(d))
          return d;
        d = d.return;
      }
      throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
    }
    function oM(o) {
      return o.tag === g || o.tag === f || o.tag === p;
    }
    function QN(o) {
      var d = o;
      e: for (; ; ) {
        for (; d.sibling === null; ) {
          if (d.return === null || oM(d.return))
            return null;
          d = d.return;
        }
        for (d.sibling.return = d.return, d = d.sibling; d.tag !== g && d.tag !== y && d.tag !== I; ) {
          if (d.flags & Yn || d.child === null || d.tag === p)
            continue e;
          d.child.return = d, d = d.child;
        }
        if (!(d.flags & Yn))
          return d.stateNode;
      }
    }
    function sM(o) {
      var d = JN(o), M, G, Q = d.stateNode;
      switch (d.tag) {
        case g:
          M = Q, G = !1;
          break;
        case f:
          M = Q.containerInfo, G = !0;
          break;
        case p:
          M = Q.containerInfo, G = !0;
          break;
        case A:
        default:
          throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
      }
      d.flags & Na && (iA(M), d.flags &= ~Na);
      var Ce = QN(o);
      G ? Kw(o, Ce, M) : Jw(o, Ce, M);
    }
    function Kw(o, d, M) {
      var G = o.tag, Q = G === g || G === y;
      if (Q || re) {
        var Ce = Q ? o.stateNode : o.stateNode.instance;
        d ? UO(M, Ce, d) : WO(M, Ce);
      } else if (G !== p) {
        var Le = o.child;
        if (Le !== null) {
          Kw(Le, d, M);
          for (var We = Le.sibling; We !== null; )
            Kw(We, d, M), We = We.sibling;
        }
      }
    }
    function Jw(o, d, M) {
      var G = o.tag, Q = G === g || G === y;
      if (Q || re) {
        var Ce = Q ? o.stateNode : o.stateNode.instance;
        d ? _O(M, Ce, d) : zO(M, Ce);
      } else if (G !== p) {
        var Le = o.child;
        if (Le !== null) {
          Jw(Le, d, M);
          for (var We = Le.sibling; We !== null; )
            Jw(We, d, M), We = We.sibling;
        }
      }
    }
    function lM(o, d, M) {
      for (var G = d, Q = !1, Ce, Le; ; ) {
        if (!Q) {
          var We = G.return;
          e: for (; ; ) {
            if (We === null)
              throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
            var st = We.stateNode;
            switch (We.tag) {
              case g:
                Ce = st, Le = !1;
                break e;
              case f:
                Ce = st.containerInfo, Le = !0;
                break e;
              case p:
                Ce = st.containerInfo, Le = !0;
                break e;
            }
            We = We.return;
          }
          Q = !0;
        }
        if (G.tag === g || G.tag === y)
          KN(o, G), Le ? YO(Ce, G.stateNode) : jO(Ce, G.stateNode);
        else if (G.tag === p) {
          if (G.child !== null) {
            Ce = G.stateNode.containerInfo, Le = !0, G.child.return = G, G = G.child;
            continue;
          }
        } else if (iM(o, G), G.child !== null) {
          G.child.return = G, G = G.child;
          continue;
        }
        if (G === d)
          return;
        for (; G.sibling === null; ) {
          if (G.return === null || G.return === d)
            return;
          G = G.return, G.tag === p && (Q = !1);
        }
        G.sibling.return = G.return, G = G.sibling;
      }
    }
    function qN(o, d, M) {
      lM(o, d);
      var G = d.alternate;
      aM(d), G !== null && aM(G);
    }
    function Qw(o, d) {
      switch (d.tag) {
        case i:
        case S:
        case T:
        case F:
        case N: {
          UN(Xp | Yp, d);
          return;
        }
        case l:
          return;
        case g: {
          var M = d.stateNode;
          if (M != null) {
            var G = d.memoizedProps, Q = o !== null ? o.memoizedProps : G, Ce = d.type, Le = d.updateQueue;
            d.updateQueue = null, Le !== null && BO(M, Le, Ce, Q, G);
          }
          return;
        }
        case y: {
          if (d.stateNode === null)
            throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
          var We = d.stateNode, st = d.memoizedProps, It = o !== null ? o.memoizedProps : st;
          VO(We, It, st);
          return;
        }
        case f: {
          {
            var Ht = d.stateNode;
            Ht.hydrate && (Ht.hydrate = !1, i5(Ht.containerInfo));
          }
          return;
        }
        case E:
          return;
        case x: {
          e6(d), uM(d);
          return;
        }
        case L: {
          uM(d);
          return;
        }
        case k:
          return;
        case A:
          break;
        case O:
          break;
        case Y:
        case j: {
          var cr = d.memoizedState, Qt = cr !== null;
          nM(d, Qt);
          return;
        }
      }
      throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
    }
    function e6(o) {
      var d = o.memoizedState;
      if (d !== null) {
        y6();
        {
          var M = o.child;
          nM(M, !0);
        }
      }
    }
    function t6(o, d) {
      var M = d.memoizedState;
      if (M === null) {
        var G = d.alternate;
        if (G !== null) {
          var Q = G.memoizedState;
          if (Q !== null) {
            var Ce = Q.dehydrated;
            Ce !== null && a5(Ce);
          }
        }
      }
    }
    function uM(o) {
      var d = o.updateQueue;
      if (d !== null) {
        o.updateQueue = null;
        var M = o.stateNode;
        M === null && (M = o.stateNode = new BN()), d.forEach(function(G) {
          var Q = B6.bind(null, o, G);
          M.has(G) || (G.__reactDoNotTraceInteractions !== !0 && (Q = n.unstable_wrap(Q)), M.add(G), G.then(Q, Q));
        });
      }
    }
    function r6(o, d) {
      if (o !== null) {
        var M = o.memoizedState;
        if (M === null || M.dehydrated !== null) {
          var G = d.memoizedState;
          return G !== null && G.dehydrated === null;
        }
      }
      return !1;
    }
    function n6(o) {
      iA(o.stateNode);
    }
    if (typeof Symbol == "function" && Symbol.for) {
      var em = Symbol.for;
      em("selector.component"), em("selector.has_pseudo_class"), em("selector.role"), em("selector.test_id"), em("selector.text");
    }
    var i6 = [];
    function a6() {
      i6.forEach(function(o) {
        return o();
      });
    }
    var o6 = Math.ceil, qw = a.ReactCurrentDispatcher, eS = a.ReactCurrentOwner, tS = a.IsSomeRendererActing, Fa = (
      /*             */
      0
    ), H0 = (
      /*               */
      1
    ), s6 = (
      /*                 */
      2
    ), rS = (
      /*         */
      4
    ), nS = (
      /*       */
      8
    ), _s = (
      /*                */
      16
    ), Xu = (
      /*                */
      32
    ), cM = (
      /*       */
      64
    ), Vc = 0, B0 = 1, V0 = 2, z0 = 3, W0 = 4, iS = 5, Un = Fa, Jo = null, Pa = null, Qo = qe, $u = qe, aS = Nd(qe), To = Vc, _0 = null, mh = qe, U0 = qe, yh = qe, j0 = qe, oS = null, sS = 0, dM = 500, fM = 1 / 0, l6 = 500;
    function Qp() {
      fM = Go() + l6;
    }
    function hM() {
      return fM;
    }
    var Tn = null, Y0 = !1, lS = null, qp = null, zc = !1, ev = null, tm = kb, uS = qe, cS = [], dS = [], Wc = null, u6 = 50, rm = 0, fS = null, c6 = 50, X0 = 0, Ch = null, nm = un, _c = qe, $0 = qe, hS = !1, im = null, Z0 = !1;
    function d6() {
      return Jo;
    }
    function Us() {
      return (Un & (_s | Xu)) !== Fa ? Go() : (nm !== un || (nm = Go()), nm);
    }
    function _d(o) {
      var d = o.mode;
      if ((d & ps) === ma)
        return Dt;
      if ((d & lh) === ma)
        return zp() === Ml ? Dt : Xt;
      _c === qe && (_c = mh);
      var M = N5() !== O5;
      if (M)
        return $0 !== qe && ($0 = oS !== null ? oS.pendingLanes : qe), wo(_c, $0);
      var G = zp(), Q;
      if (
        // TODO: Temporary. We're removing the concept of discrete updates.
        (Un & rS) !== Fa && G === oh
      )
        Q = ta(B, _c);
      else {
        var Ce = ea(G);
        Q = ta(Ce, _c);
      }
      return Q;
    }
    function f6(o) {
      var d = o.mode;
      return (d & ps) === ma ? Dt : (d & lh) === ma ? zp() === Ml ? Dt : Xt : (_c === qe && (_c = mh), ko(_c));
    }
    function Bo(o, d, M) {
      z6(), j6(o);
      var G = K0(o, d);
      if (G === null)
        return _6(o), null;
      Dd(G, d, M), G === Jo && (yh = xi(yh, d), To === W0 && tv(G, Qo));
      var Q = zp();
      d === Dt ? /* Check if we're inside unbatchedUpdates */ (Un & nS) !== Fa && // Check if we're not already rendering
      (Un & (_s | Xu)) === Fa ? (jd(G, d), pS(G)) : (Il(G, M), jd(G, d), Un === Fa && (Qp(), Uu())) : ((Un & rS) !== Fa && // Only updates at user-blocking priority or greater are considered
      // discrete, even inside a discrete event.
      (Q === oh || Q === Ml) && (Wc === null ? Wc = /* @__PURE__ */ new Set([G]) : Wc.add(G)), Il(G, M), jd(G, d)), oS = G;
    }
    function K0(o, d) {
      o.lanes = xi(o.lanes, d);
      var M = o.alternate;
      M !== null && (M.lanes = xi(M.lanes, d)), M === null && (o.flags & (Yn | Po)) !== Ci && TM(o);
      for (var G = o, Q = o.return; Q !== null; )
        Q.childLanes = xi(Q.childLanes, d), M = Q.alternate, M !== null ? M.childLanes = xi(M.childLanes, d) : (Q.flags & (Yn | Po)) !== Ci && TM(o), G = Q, Q = Q.return;
      if (G.tag === f) {
        var Ce = G.stateNode;
        return Ce;
      } else
        return null;
    }
    function Il(o, d) {
      var M = o.callbackNode;
      co(o, d);
      var G = ga(o, o === Jo ? Qo : qe), Q = Li();
      if (G === qe) {
        M !== null && (PA(M), o.callbackNode = null, o.callbackPriority = Bt);
        return;
      }
      if (M !== null) {
        var Ce = o.callbackPriority;
        if (Ce === Q)
          return;
        PA(M);
      }
      var Le;
      if (Q === bl)
        Le = I5(pS.bind(null, o));
      else if (Q === Ec)
        Le = Gd(Ml, pS.bind(null, o));
      else {
        var We = ua(Q);
        Le = Gd(We, pM.bind(null, o));
      }
      o.callbackPriority = Q, o.callbackNode = Le;
    }
    function pM(o) {
      if (nm = un, _c = qe, $0 = qe, (Un & (_s | Xu)) !== Fa)
        throw Error("Should not already be working.");
      var d = o.callbackNode, M = Zu();
      if (M && o.callbackNode !== d)
        return null;
      var G = ga(o, o === Jo ? Qo : qe);
      if (G === qe)
        return null;
      var Q = T6(o, G);
      if (no(mh, yh))
        rv(o, qe);
      else if (Q !== Vc) {
        if (Q === V0 && (Un |= cM, o.hydrate && (o.hydrate = !1, Rb(o.containerInfo)), G = Ri(o), G !== qe && (Q = am(o, G))), Q === B0) {
          var Ce = _0;
          throw rv(o, qe), tv(o, G), Il(o, Go()), Ce;
        }
        var Le = o.current.alternate;
        o.finishedWork = Le, o.finishedLanes = G, h6(o, Q, G);
      }
      return Il(o, Go()), o.callbackNode === d ? pM.bind(null, o) : null;
    }
    function h6(o, d, M) {
      switch (d) {
        case Vc:
        case B0:
          throw Error("Root did not complete. This is a bug in React.");
        case V0: {
          bh(o);
          break;
        }
        case z0: {
          if (tv(o, M), zf(M) && // do not delay if we're inside an act() scope
          !Z6()) {
            var G = sS + dM - Go();
            if (G > 10) {
              var Q = ga(o, qe);
              if (Q !== qe)
                break;
              var Ce = o.suspendedLanes;
              if (!Lu(Ce, M)) {
                Us(), rg(o, Ce);
                break;
              }
              o.timeoutHandle = nA(bh.bind(null, o), G);
              break;
            }
          }
          bh(o);
          break;
        }
        case W0: {
          if (tv(o, M), Lo(M))
            break;
          {
            var Le = ro(o, M), We = Le, st = Go() - We, It = V6(st) - st;
            if (It > 10) {
              o.timeoutHandle = nA(bh.bind(null, o), It);
              break;
            }
          }
          bh(o);
          break;
        }
        case iS: {
          bh(o);
          break;
        }
        default:
          throw Error("Unknown root exit status.");
      }
    }
    function tv(o, d) {
      d = Md(d, j0), d = Md(d, yh), uy(o, d);
    }
    function pS(o) {
      if ((Un & (_s | Xu)) !== Fa)
        throw Error("Should not already be working.");
      Zu();
      var d, M;
      if (o === Jo && no(o.expiredLanes, Qo) ? (d = Qo, M = am(o, d), no(mh, yh) && (d = ga(o, d), M = am(o, d))) : (d = ga(o, qe), M = am(o, d)), o.tag !== Pb && M === V0 && (Un |= cM, o.hydrate && (o.hydrate = !1, Rb(o.containerInfo)), d = Ri(o), d !== qe && (M = am(o, d))), M === B0) {
        var G = _0;
        throw rv(o, qe), tv(o, d), Il(o, Go()), G;
      }
      var Q = o.current.alternate;
      return o.finishedWork = Q, o.finishedLanes = d, bh(o), Il(o, Go()), null;
    }
    function p6() {
      if ((Un & (H0 | _s | Xu)) !== Fa) {
        (Un & _s) !== Fa && s("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");
        return;
      }
      v6(), Zu();
    }
    function v6() {
      if (Wc !== null) {
        var o = Wc;
        Wc = null, o.forEach(function(d) {
          _f(d), Il(d, Go());
        });
      }
      Uu();
    }
    function vM(o, d) {
      var M = Un;
      Un |= H0;
      try {
        return o(d);
      } finally {
        Un = M, Un === Fa && (Qp(), Uu());
      }
    }
    function g6(o, d) {
      var M = Un;
      Un |= s6;
      try {
        return o(d);
      } finally {
        Un = M, Un === Fa && (Qp(), Uu());
      }
    }
    function m6(o, d, M, G, Q) {
      var Ce = Un;
      Un |= rS;
      try {
        return sh(oh, o.bind(null, d, M, G, Q));
      } finally {
        Un = Ce, Un === Fa && (Qp(), Uu());
      }
    }
    function gM(o, d) {
      var M = Un;
      Un &= ~H0, Un |= nS;
      try {
        return o(d);
      } finally {
        Un = M, Un === Fa && (Qp(), Uu());
      }
    }
    function vS(o, d) {
      var M = Un;
      if ((M & (_s | Xu)) !== Fa)
        return s("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."), o(d);
      Un |= H0;
      try {
        return o ? sh(Ml, o.bind(null, d)) : void 0;
      } finally {
        Un = M, Uu();
      }
    }
    function J0(o, d) {
      No(aS, $u, o), $u = xi($u, d), mh = xi(mh, d);
    }
    function gS(o) {
      $u = aS.current, Oo(aS, o);
    }
    function rv(o, d) {
      o.finishedWork = null, o.finishedLanes = qe;
      var M = o.timeoutHandle;
      if (M !== Tb && (o.timeoutHandle = Tb, GO(M)), Pa !== null)
        for (var G = Pa.return; G !== null; )
          QE(G), G = G.return;
      Jo = o, Pa = wh(o.current, null), Qo = $u = mh = d, To = Vc, _0 = null, U0 = qe, yh = qe, j0 = qe, Ch = null, iu.discardPendingWarnings();
    }
    function mM(o, d) {
      do {
        var M = Pa;
        try {
          if (n0(), cE(), pt(), eS.current = null, M === null || M.return === null) {
            To = B0, _0 = d, Pa = null;
            return;
          }
          te && M.mode & Ws && k0(M, !0), HN(o, M.return, M, d, Qo), wM(M);
        } catch (G) {
          d = G, Pa === M && M !== null ? (M = M.return, Pa = M) : M = Pa;
          continue;
        }
        return;
      } while (!0);
    }
    function yM() {
      var o = qw.current;
      return qw.current = P0, o === null ? P0 : o;
    }
    function CM(o) {
      qw.current = o;
    }
    function Q0(o) {
      {
        var d = n.__interactionsRef.current;
        return n.__interactionsRef.current = o.memoizedInteractions, d;
      }
    }
    function q0(o) {
      n.__interactionsRef.current = o;
    }
    function y6() {
      sS = Go();
    }
    function mS(o) {
      U0 = xi(o, U0);
    }
    function C6() {
      To === Vc && (To = z0);
    }
    function b6() {
      (To === Vc || To === z0) && (To = W0), Jo !== null && (Bs(U0) || Bs(yh)) && tv(Jo, Qo);
    }
    function w6() {
      To !== iS && (To = V0);
    }
    function S6() {
      return To === Vc;
    }
    function am(o, d) {
      var M = Un;
      Un |= _s;
      var G = yM();
      (Jo !== o || Qo !== d) && (rv(o, d), FM(o, d));
      var Q = Q0(o);
      do
        try {
          x6();
          break;
        } catch (Ce) {
          mM(o, Ce);
        }
      while (!0);
      if (n0(), q0(Q), Un = M, CM(G), Pa !== null)
        throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
      return Jo = null, Qo = qe, To;
    }
    function x6() {
      for (; Pa !== null; )
        bM(Pa);
    }
    function T6(o, d) {
      var M = Un;
      Un |= _s;
      var G = yM();
      (Jo !== o || Qo !== d) && (Qp(), rv(o, d), FM(o, d));
      var Q = Q0(o);
      do
        try {
          R6();
          break;
        } catch (Ce) {
          mM(o, Ce);
        }
      while (!0);
      return n0(), q0(Q), CM(G), Un = M, Pa !== null ? Vc : (Jo = null, Qo = qe, To);
    }
    function R6() {
      for (; Pa !== null && !F5(); )
        bM(Pa);
    }
    function bM(o) {
      var d = o.alternate;
      dt(o);
      var M;
      (o.mode & Ws) !== ma ? (kw(o), M = CS(d, o, $u), k0(o, !0)) : M = CS(d, o, $u), pt(), o.memoizedProps = o.pendingProps, M === null ? wM(o) : Pa = M, eS.current = null;
    }
    function wM(o) {
      var d = o;
      do {
        var M = d.alternate, G = d.return;
        if ((d.flags & Cc) === Ci) {
          dt(d);
          var Q = void 0;
          if ((d.mode & Ws) === ma ? Q = JE(M, d, $u) : (kw(d), Q = JE(M, d, $u), k0(d, !1)), pt(), Q !== null) {
            Pa = Q;
            return;
          }
          if (A6(d), G !== null && // Do not append effects to parents if a sibling failed to complete
          (G.flags & Cc) === Ci) {
            G.firstEffect === null && (G.firstEffect = d.firstEffect), d.lastEffect !== null && (G.lastEffect !== null && (G.lastEffect.nextEffect = d.firstEffect), G.lastEffect = d.lastEffect);
            var Ce = d.flags;
            Ce > xa && (G.lastEffect !== null ? G.lastEffect.nextEffect = d : G.firstEffect = d, G.lastEffect = d);
          }
        } else {
          var Le = kN(d);
          if (Le !== null) {
            Le.flags &= cl, Pa = Le;
            return;
          }
          if ((d.mode & Ws) !== ma) {
            k0(d, !1);
            for (var We = d.actualDuration, st = d.child; st !== null; )
              We += st.actualDuration, st = st.sibling;
            d.actualDuration = We;
          }
          G !== null && (G.firstEffect = G.lastEffect = null, G.flags |= Cc);
        }
        var It = d.sibling;
        if (It !== null) {
          Pa = It;
          return;
        }
        d = G, Pa = d;
      } while (d !== null);
      To === Vc && (To = iS);
    }
    function A6(o) {
      if (
        // TODO: Move this check out of the hot path by moving `resetChildLanes`
        // to switch statement in `completeWork`.
        !((o.tag === j || o.tag === Y) && o.memoizedState !== null && !no($u, Nr) && (o.mode & lh) !== qe)
      ) {
        var d = qe;
        if ((o.mode & Ws) !== ma) {
          for (var M = o.actualDuration, G = o.selfBaseDuration, Q = o.alternate === null || o.child !== o.alternate.child, Ce = o.child; Ce !== null; )
            d = xi(d, xi(Ce.lanes, Ce.childLanes)), Q && (M += Ce.actualDuration), G += Ce.treeBaseDuration, Ce = Ce.sibling;
          var Le = o.tag === x && o.memoizedState !== null;
          if (Le) {
            var We = o.child;
            We !== null && (G -= We.treeBaseDuration);
          }
          o.actualDuration = M, o.treeBaseDuration = G;
        } else
          for (var st = o.child; st !== null; )
            d = xi(d, xi(st.lanes, st.childLanes)), st = st.sibling;
        o.childLanes = d;
      }
    }
    function bh(o) {
      var d = zp();
      return sh(Ml, E6.bind(null, o, d)), null;
    }
    function E6(o, d) {
      do
        Zu();
      while (ev !== null);
      if (W6(), (Un & (_s | Xu)) !== Fa)
        throw Error("Should not already be working.");
      var M = o.finishedWork, G = o.finishedLanes;
      if (M === null)
        return null;
      if (o.finishedWork = null, o.finishedLanes = qe, M === o.current)
        throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
      o.callbackNode = null;
      var Q = xi(M.lanes, M.childLanes);
      ng(o, Q), Wc !== null && !rb(Q) && Wc.has(o) && Wc.delete(o), o === Jo && (Jo = null, Pa = null, Qo = qe);
      var Ce;
      if (M.flags > xa ? M.lastEffect !== null ? (M.lastEffect.nextEffect = M, Ce = M.firstEffect) : Ce = M : Ce = M.firstEffect, Ce !== null) {
        var Le = Un;
        Un |= Xu;
        var We = Q0(o);
        eS.current = null, im = FO(o.containerInfo), Z0 = !1, Tn = Ce;
        do
          if (to(null, M6, null), go()) {
            if (Tn === null)
              throw Error("Should be working on an effect.");
            var st = Ua();
            Ud(Tn, st), Tn = Tn.nextEffect;
          }
        while (Tn !== null);
        im = null, AE(), Tn = Ce;
        do
          if (to(null, D6, null, o, d), go()) {
            if (Tn === null)
              throw Error("Should be working on an effect.");
            var It = Ua();
            Ud(Tn, It), Tn = Tn.nextEffect;
          }
        while (Tn !== null);
        PO(o.containerInfo), o.current = M, Tn = Ce;
        do
          if (to(null, F6, null, o, G), go()) {
            if (Tn === null)
              throw Error("Should be working on an effect.");
            var Ht = Ua();
            Ud(Tn, Ht), Tn = Tn.nextEffect;
          }
        while (Tn !== null);
        Tn = null, P5(), q0(We), Un = Le;
      } else
        o.current = M, AE();
      var cr = zc;
      if (zc)
        zc = !1, ev = o, uS = G, tm = d;
      else
        for (Tn = Ce; Tn !== null; ) {
          var Qt = Tn.nextEffect;
          Tn.nextEffect = null, Tn.flags & Ji && IM(Tn), Tn = Qt;
        }
      if (Q = o.pendingLanes, Q !== qe) {
        if (Ch !== null) {
          var hr = Ch;
          Ch = null;
          for (var Vr = 0; Vr < hr.length; Vr++)
            DM(o, hr[Vr], o.memoizedInteractions);
        }
        jd(o, Q);
      } else
        qp = null;
      if (cr || PM(o, G), Q === Dt ? o === fS ? rm++ : (rm = 0, fS = o) : rm = 0, R5(M.stateNode, d), a6(), Il(o, Go()), Y0) {
        Y0 = !1;
        var sn = lS;
        throw lS = null, sn;
      }
      return (Un & nS) !== Fa || Uu(), null;
    }
    function M6() {
      for (; Tn !== null; ) {
        var o = Tn.alternate;
        !Z0 && im !== null && ((Tn.flags & Ji) !== Ci ? Nf(Tn, im) && (Z0 = !0) : Tn.tag === x && r6(o, Tn) && Nf(Tn, im) && (Z0 = !0));
        var d = Tn.flags;
        (d & Fo) !== Ci && (dt(Tn), _N(o, Tn), pt()), (d & ul) !== Ci && (zc || (zc = !0, Gd(Gc, function() {
          return Zu(), null;
        }))), Tn = Tn.nextEffect;
      }
    }
    function D6(o, d) {
      for (; Tn !== null; ) {
        dt(Tn);
        var M = Tn.flags;
        if (M & Na && n6(Tn), M & Ta) {
          var G = Tn.alternate;
          G !== null && ZN(G);
        }
        var Q = M & (Yn | On | Ji | Po);
        switch (Q) {
          case Yn: {
            sM(Tn), Tn.flags &= ~Yn;
            break;
          }
          case Ls: {
            sM(Tn), Tn.flags &= ~Yn;
            var Ce = Tn.alternate;
            Qw(Ce, Tn);
            break;
          }
          case Po: {
            Tn.flags &= ~Po;
            break;
          }
          case If: {
            Tn.flags &= ~Po;
            var Le = Tn.alternate;
            Qw(Le, Tn);
            break;
          }
          case On: {
            var We = Tn.alternate;
            Qw(We, Tn);
            break;
          }
          case Ji: {
            qN(o, Tn);
            break;
          }
        }
        pt(), Tn = Tn.nextEffect;
      }
    }
    function F6(o, d) {
      for (; Tn !== null; ) {
        dt(Tn);
        var M = Tn.flags;
        if (M & (On | ks)) {
          var G = Tn.alternate;
          XN(o, G, Tn);
        }
        M & Ta && $N(Tn), pt(), Tn = Tn.nextEffect;
      }
    }
    function Zu() {
      if (tm !== kb) {
        var o = tm > Gc ? Gc : tm;
        return tm = kb, sh(o, L6);
      }
      return !1;
    }
    function P6(o, d) {
      cS.push(d, o), zc || (zc = !0, Gd(Gc, function() {
        return Zu(), null;
      }));
    }
    function SM(o, d) {
      dS.push(d, o);
      {
        o.flags |= $l;
        var M = o.alternate;
        M !== null && (M.flags |= $l);
      }
      zc || (zc = !0, Gd(Gc, function() {
        return Zu(), null;
      }));
    }
    function I6(o) {
      var d = o.create;
      o.destroy = d();
    }
    function L6() {
      if (ev === null)
        return !1;
      var o = ev, d = uS;
      if (ev = null, uS = qe, (Un & (_s | Xu)) !== Fa)
        throw Error("Cannot flush passive effects while already rendering.");
      hS = !0;
      var M = Un;
      Un |= Xu;
      var G = Q0(o), Q = dS;
      dS = [];
      for (var Ce = 0; Ce < Q.length; Ce += 2) {
        var Le = Q[Ce], We = Q[Ce + 1], st = Le.destroy;
        Le.destroy = void 0;
        {
          We.flags &= ~$l;
          var It = We.alternate;
          It !== null && (It.flags &= ~$l);
        }
        if (typeof st == "function") {
          if (dt(We), to(null, st, null), go()) {
            if (We === null)
              throw Error("Should be working on an effect.");
            var Ht = Ua();
            Ud(We, Ht);
          }
          pt();
        }
      }
      var cr = cS;
      cS = [];
      for (var Qt = 0; Qt < cr.length; Qt += 2) {
        var hr = cr[Qt], Vr = cr[Qt + 1];
        {
          if (dt(Vr), to(null, I6, null, hr), go()) {
            if (Vr === null)
              throw Error("Should be working on an effect.");
            var sn = Ua();
            Ud(Vr, sn);
          }
          pt();
        }
      }
      for (var Gn = o.current.firstEffect; Gn !== null; ) {
        var ii = Gn.nextEffect;
        Gn.nextEffect = null, Gn.flags & Ji && IM(Gn), Gn = ii;
      }
      return q0(G), PM(o, d), hS = !1, Un = M, Uu(), X0 = ev === null ? 0 : X0 + 1, !0;
    }
    function yS(o) {
      return qp !== null && qp.has(o);
    }
    function k6(o) {
      qp === null ? qp = /* @__PURE__ */ new Set([o]) : qp.add(o);
    }
    function O6(o) {
      Y0 || (Y0 = !0, lS = o);
    }
    var N6 = O6;
    function xM(o, d, M) {
      var G = $w(M, d), Q = qE(o, G, Dt);
      Bd(o, Q);
      var Ce = Us(), Le = K0(o, Dt);
      Le !== null && (Dd(Le, Dt, Ce), Il(Le, Ce), jd(Le, Dt));
    }
    function Ud(o, d) {
      if (o.tag === f) {
        xM(o, o, d);
        return;
      }
      for (var M = o.return; M !== null; ) {
        if (M.tag === f) {
          xM(M, o, d);
          return;
        } else if (M.tag === l) {
          var G = M.type, Q = M.stateNode;
          if (typeof G.getDerivedStateFromError == "function" || typeof Q.componentDidCatch == "function" && !yS(Q)) {
            var Ce = $w(d, o), Le = eM(M, Ce, Dt);
            Bd(M, Le);
            var We = Us(), st = K0(M, Dt);
            if (st !== null)
              Dd(st, Dt, We), Il(st, We), jd(st, Dt);
            else if (typeof Q.componentDidCatch == "function" && !yS(Q))
              try {
                Q.componentDidCatch(d, Ce);
              } catch {
              }
            return;
          }
        }
        M = M.return;
      }
    }
    function G6(o, d, M) {
      var G = o.pingCache;
      G !== null && G.delete(d);
      var Q = Us();
      rg(o, M), Jo === o && Lu(Qo, M) && (To === W0 || To === z0 && zf(Qo) && Go() - sS < dM ? rv(o, qe) : j0 = xi(j0, M)), Il(o, Q), jd(o, M);
    }
    function H6(o, d) {
      d === Et && (d = f6(o));
      var M = Us(), G = K0(o, d);
      G !== null && (Dd(G, d, M), Il(G, M), jd(G, d));
    }
    function B6(o, d) {
      var M = Et, G;
      G = o.stateNode, G !== null && G.delete(d), H6(o, M);
    }
    function V6(o) {
      return o < 120 ? 120 : o < 480 ? 480 : o < 1080 ? 1080 : o < 1920 ? 1920 : o < 3e3 ? 3e3 : o < 4320 ? 4320 : o6(o / 1960) * 1960;
    }
    function z6() {
      if (rm > u6)
        throw rm = 0, fS = null, Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
      X0 > c6 && (X0 = 0, s("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."));
    }
    function W6() {
      iu.flushLegacyContextWarning(), iu.flushPendingUnsafeLifecycleWarnings();
    }
    var eC = null;
    function TM(o) {
      {
        if ((Un & _s) !== Fa || !(o.mode & (ps | lh)))
          return;
        var d = o.tag;
        if (d !== v && d !== f && d !== l && d !== i && d !== S && d !== T && d !== F && d !== N)
          return;
        var M = ae(o.type) || "ReactComponent";
        if (eC !== null) {
          if (eC.has(M))
            return;
          eC.add(M);
        } else
          eC = /* @__PURE__ */ new Set([M]);
        var G = rt;
        try {
          dt(o), s("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
        } finally {
          G ? dt(o) : pt();
        }
      }
    }
    var tC = null;
    function _6(o) {
      {
        var d = o.tag;
        if (d !== f && d !== l && d !== i && d !== S && d !== T && d !== F && d !== N || (o.flags & $l) !== Ci)
          return;
        var M = ae(o.type) || "ReactComponent";
        if (tC !== null) {
          if (tC.has(M))
            return;
          tC.add(M);
        } else
          tC = /* @__PURE__ */ new Set([M]);
        if (!hS) {
          var G = rt;
          try {
            dt(o), s("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.", d === l ? "the componentWillUnmount method" : "a useEffect cleanup function");
          } finally {
            G ? dt(o) : pt();
          }
        }
      }
    }
    var CS;
    {
      var U6 = null;
      CS = function(o, d, M) {
        var G = NM(U6, d);
        try {
          return YE(o, d, M);
        } catch (Ce) {
          if (Ce !== null && typeof Ce == "object" && typeof Ce.then == "function")
            throw Ce;
          if (n0(), cE(), QE(d), NM(d, G), d.mode & Ws && kw(d), to(null, YE, null, o, d, M), go()) {
            var Q = Ua();
            throw Q;
          } else
            throw Ce;
        }
      };
    }
    var RM = !1, bS;
    bS = /* @__PURE__ */ new Set();
    function j6(o) {
      if (gt && (Un & _s) !== Fa && !cN())
        switch (o.tag) {
          case i:
          case S:
          case F: {
            var d = Pa && ae(Pa.type) || "Unknown", M = d;
            if (!bS.has(M)) {
              bS.add(M);
              var G = ae(o.type) || "Unknown";
              s("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", G, d, d);
            }
            break;
          }
          case l: {
            RM || (s("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."), RM = !0);
            break;
          }
        }
    }
    var rC = {
      current: !1
    };
    function AM(o) {
      if (tS.current === !0 && rC.current !== !0) {
        var d = rt;
        try {
          dt(o), s(`It looks like you're using the wrong act() around your test interactions.
Be sure to use the matching version of act() corresponding to your renderer:

// for react-dom:
import {act} from 'react-dom/test-utils';
// ...
act(() => ...);

// for react-test-renderer:
import TestRenderer from react-test-renderer';
const {act} = TestRenderer;
// ...
act(() => ...);`);
        } finally {
          d ? dt(o) : pt();
        }
      }
    }
    function EM(o) {
      (o.mode & Da) !== ma && tS.current === !1 && rC.current === !1 && s(`An update to %s ran an effect, but was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`, ae(o.type));
    }
    function Y6(o) {
      if (Un === Fa && tS.current === !1 && rC.current === !1) {
        var d = rt;
        try {
          dt(o), s(`An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`, ae(o.type));
        } finally {
          d ? dt(o) : pt();
        }
      }
    }
    var X6 = Y6, MM = !1;
    function $6(o) {
      MM === !1 && r.unstable_flushAllWithoutAsserting === void 0 && (o.mode & ps || o.mode & lh) && (MM = !0, s(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: 
jest.mock('scheduler', () => require('scheduler/unstable_mock'));

For more info, visit https://reactjs.org/link/mock-scheduler`));
    }
    function wS(o, d) {
      return d * 1e3 + o.interactionThreadID;
    }
    function nC(o) {
      Ch === null ? Ch = [o] : Ch.push(o);
    }
    function DM(o, d, M) {
      if (M.size > 0) {
        var G = o.pendingInteractionMap, Q = G.get(d);
        Q != null ? M.forEach(function(We) {
          Q.has(We) || We.__count++, Q.add(We);
        }) : (G.set(d, new Set(M)), M.forEach(function(We) {
          We.__count++;
        }));
        var Ce = n.__subscriberRef.current;
        if (Ce !== null) {
          var Le = wS(o, d);
          Ce.onWorkScheduled(M, Le);
        }
      }
    }
    function jd(o, d) {
      DM(o, d, n.__interactionsRef.current);
    }
    function FM(o, d) {
      var M = /* @__PURE__ */ new Set();
      if (o.pendingInteractionMap.forEach(function(Ce, Le) {
        no(d, Le) && Ce.forEach(function(We) {
          return M.add(We);
        });
      }), o.memoizedInteractions = M, M.size > 0) {
        var G = n.__subscriberRef.current;
        if (G !== null) {
          var Q = wS(o, d);
          try {
            G.onWorkStarted(M, Q);
          } catch (Ce) {
            Gd(Ml, function() {
              throw Ce;
            });
          }
        }
      }
    }
    function PM(o, d) {
      var M = o.pendingLanes, G;
      try {
        if (G = n.__subscriberRef.current, G !== null && o.memoizedInteractions.size > 0) {
          var Q = wS(o, d);
          G.onWorkStopped(o.memoizedInteractions, Q);
        }
      } catch (Le) {
        Gd(Ml, function() {
          throw Le;
        });
      } finally {
        var Ce = o.pendingInteractionMap;
        Ce.forEach(function(Le, We) {
          no(M, We) || (Ce.delete(We), Le.forEach(function(st) {
            if (st.__count--, G !== null && st.__count === 0)
              try {
                G.onInteractionScheduledWorkCompleted(st);
              } catch (It) {
                Gd(Ml, function() {
                  throw It;
                });
              }
          }));
        });
      }
    }
    function Z6() {
      return K6 > 0;
    }
    var K6 = 0;
    function IM(o) {
      o.sibling = null, o.stateNode = null;
    }
    var Ll = null, nv = null, J6 = function(o) {
      Ll = o;
    };
    function iv(o) {
      {
        if (Ll === null)
          return o;
        var d = Ll(o);
        return d === void 0 ? o : d.current;
      }
    }
    function SS(o) {
      return iv(o);
    }
    function xS(o) {
      {
        if (Ll === null)
          return o;
        var d = Ll(o);
        if (d === void 0) {
          if (o != null && typeof o.render == "function") {
            var M = iv(o.render);
            if (o.render !== M) {
              var G = {
                $$typeof: Wt,
                render: M
              };
              return o.displayName !== void 0 && (G.displayName = o.displayName), G;
            }
          }
          return o;
        }
        return d.current;
      }
    }
    function LM(o, d) {
      {
        if (Ll === null)
          return !1;
        var M = o.elementType, G = d.type, Q = !1, Ce = typeof G == "object" && G !== null ? G.$$typeof : null;
        switch (o.tag) {
          case l: {
            typeof G == "function" && (Q = !0);
            break;
          }
          case i: {
            (typeof G == "function" || Ce === Yt) && (Q = !0);
            break;
          }
          case S: {
            (Ce === Wt || Ce === Yt) && (Q = !0);
            break;
          }
          case T:
          case F: {
            (Ce === qt || Ce === Yt) && (Q = !0);
            break;
          }
          default:
            return !1;
        }
        if (Q) {
          var Le = Ll(M);
          if (Le !== void 0 && Le === Ll(G))
            return !0;
        }
        return !1;
      }
    }
    function kM(o) {
      {
        if (Ll === null || typeof WeakSet != "function")
          return;
        nv === null && (nv = /* @__PURE__ */ new WeakSet()), nv.add(o);
      }
    }
    var Q6 = function(o, d) {
      {
        if (Ll === null)
          return;
        var M = d.staleFamilies, G = d.updatedFamilies;
        Zu(), vS(function() {
          TS(o.current, G, M);
        });
      }
    }, q6 = function(o, d) {
      {
        if (o.context !== zs)
          return;
        Zu(), vS(function() {
          om(d, o, null, null);
        });
      }
    };
    function TS(o, d, M) {
      {
        var G = o.alternate, Q = o.child, Ce = o.sibling, Le = o.tag, We = o.type, st = null;
        switch (Le) {
          case i:
          case F:
          case l:
            st = We;
            break;
          case S:
            st = We.render;
            break;
        }
        if (Ll === null)
          throw new Error("Expected resolveFamily to be set during hot reload.");
        var It = !1, Ht = !1;
        if (st !== null) {
          var cr = Ll(st);
          cr !== void 0 && (M.has(cr) ? Ht = !0 : d.has(cr) && (Le === l ? Ht = !0 : It = !0));
        }
        nv !== null && (nv.has(o) || G !== null && nv.has(G)) && (Ht = !0), Ht && (o._debugNeedsRemount = !0), (Ht || It) && Bo(o, Dt, un), Q !== null && !Ht && TS(Q, d, M), Ce !== null && TS(Ce, d, M);
      }
    }
    var e9 = function(o, d) {
      {
        var M = /* @__PURE__ */ new Set(), G = new Set(d.map(function(Q) {
          return Q.current;
        }));
        return RS(o.current, G, M), M;
      }
    };
    function RS(o, d, M) {
      {
        var G = o.child, Q = o.sibling, Ce = o.tag, Le = o.type, We = null;
        switch (Ce) {
          case i:
          case F:
          case l:
            We = Le;
            break;
          case S:
            We = Le.render;
            break;
        }
        var st = !1;
        We !== null && d.has(We) && (st = !0), st ? t9(o, M) : G !== null && RS(G, d, M), Q !== null && RS(Q, d, M);
      }
    }
    function t9(o, d) {
      {
        var M = r9(o, d);
        if (M)
          return;
        for (var G = o; ; ) {
          switch (G.tag) {
            case g:
              d.add(G.stateNode);
              return;
            case p:
              d.add(G.stateNode.containerInfo);
              return;
            case f:
              d.add(G.stateNode.containerInfo);
              return;
          }
          if (G.return === null)
            throw new Error("Expected to reach root first.");
          G = G.return;
        }
      }
    }
    function r9(o, d) {
      for (var M = o, G = !1; ; ) {
        if (M.tag === g)
          G = !0, d.add(M.stateNode);
        else if (M.child !== null) {
          M.child.return = M, M = M.child;
          continue;
        }
        if (M === o)
          return G;
        for (; M.sibling === null; ) {
          if (M.return === null || M.return === o)
            return G;
          M = M.return;
        }
        M.sibling.return = M.return, M = M.sibling;
      }
      return !1;
    }
    var AS;
    {
      AS = !1;
      try {
        var OM = Object.preventExtensions({});
      } catch {
        AS = !0;
      }
    }
    var n9 = 1;
    function i9(o, d, M, G) {
      this.tag = o, this.key = M, this.elementType = null, this.type = null, this.stateNode = null, this.return = null, this.child = null, this.sibling = null, this.index = 0, this.ref = null, this.pendingProps = d, this.memoizedProps = null, this.updateQueue = null, this.memoizedState = null, this.dependencies = null, this.mode = G, this.flags = Ci, this.nextEffect = null, this.firstEffect = null, this.lastEffect = null, this.lanes = qe, this.childLanes = qe, this.alternate = null, this.actualDuration = Number.NaN, this.actualStartTime = Number.NaN, this.selfBaseDuration = Number.NaN, this.treeBaseDuration = Number.NaN, this.actualDuration = 0, this.actualStartTime = -1, this.selfBaseDuration = 0, this.treeBaseDuration = 0, this._debugID = n9++, this._debugSource = null, this._debugOwner = null, this._debugNeedsRemount = !1, this._debugHookTypes = null, !AS && typeof Object.preventExtensions == "function" && Object.preventExtensions(this);
    }
    var js = function(o, d, M, G) {
      return new i9(o, d, M, G);
    };
    function ES(o) {
      var d = o.prototype;
      return !!(d && d.isReactComponent);
    }
    function a9(o) {
      return typeof o == "function" && !ES(o) && o.defaultProps === void 0;
    }
    function o9(o) {
      if (typeof o == "function")
        return ES(o) ? l : i;
      if (o != null) {
        var d = o.$$typeof;
        if (d === Wt)
          return S;
        if (d === qt)
          return T;
      }
      return v;
    }
    function wh(o, d) {
      var M = o.alternate;
      M === null ? (M = js(o.tag, d, o.key, o.mode), M.elementType = o.elementType, M.type = o.type, M.stateNode = o.stateNode, M._debugID = o._debugID, M._debugSource = o._debugSource, M._debugOwner = o._debugOwner, M._debugHookTypes = o._debugHookTypes, M.alternate = o, o.alternate = M) : (M.pendingProps = d, M.type = o.type, M.flags = Ci, M.nextEffect = null, M.firstEffect = null, M.lastEffect = null, M.actualDuration = 0, M.actualStartTime = -1), M.childLanes = o.childLanes, M.lanes = o.lanes, M.child = o.child, M.memoizedProps = o.memoizedProps, M.memoizedState = o.memoizedState, M.updateQueue = o.updateQueue;
      var G = o.dependencies;
      switch (M.dependencies = G === null ? null : {
        lanes: G.lanes,
        firstContext: G.firstContext
      }, M.sibling = o.sibling, M.index = o.index, M.ref = o.ref, M.selfBaseDuration = o.selfBaseDuration, M.treeBaseDuration = o.treeBaseDuration, M._debugNeedsRemount = o._debugNeedsRemount, M.tag) {
        case v:
        case i:
        case F:
          M.type = iv(o.type);
          break;
        case l:
          M.type = SS(o.type);
          break;
        case S:
          M.type = xS(o.type);
          break;
      }
      return M;
    }
    function s9(o, d) {
      o.flags &= Yn, o.nextEffect = null, o.firstEffect = null, o.lastEffect = null;
      var M = o.alternate;
      if (M === null)
        o.childLanes = qe, o.lanes = d, o.child = null, o.memoizedProps = null, o.memoizedState = null, o.updateQueue = null, o.dependencies = null, o.stateNode = null, o.selfBaseDuration = 0, o.treeBaseDuration = 0;
      else {
        o.childLanes = M.childLanes, o.lanes = M.lanes, o.child = M.child, o.memoizedProps = M.memoizedProps, o.memoizedState = M.memoizedState, o.updateQueue = M.updateQueue, o.type = M.type;
        var G = M.dependencies;
        o.dependencies = G === null ? null : {
          lanes: G.lanes,
          firstContext: G.firstContext
        }, o.selfBaseDuration = M.selfBaseDuration, o.treeBaseDuration = M.treeBaseDuration;
      }
      return o;
    }
    function l9(o) {
      var d;
      return o === CA ? d = lh | ps | Da : o === yA ? d = ps | Da : d = ma, S5 && (d |= Ws), js(f, null, null, d);
    }
    function MS(o, d, M, G, Q, Ce) {
      var Le = v, We = o;
      if (typeof o == "function")
        ES(o) ? (Le = l, We = SS(We)) : We = iv(We);
      else if (typeof o == "string")
        Le = g;
      else
        e: switch (o) {
          case Tt:
            return Sh(M.children, Q, Ce, d);
          case _e:
            Le = m, Q |= L5;
            break;
          case kt:
            Le = m, Q |= Da;
            break;
          case Ot:
            return u9(M, Q, Ce, d);
          case bt:
            return c9(M, Q, Ce, d);
          case jt:
            return d9(M, Q, Ce, d);
          case Ye:
            return FS(M, Q, Ce, d);
          case lt:
            return f9(M, Q, Ce, d);
          case tt:
          default: {
            if (typeof o == "object" && o !== null)
              switch (o.$$typeof) {
                case Rt:
                  Le = w;
                  break e;
                case xt:
                  Le = h;
                  break e;
                case Wt:
                  Le = S, We = xS(We);
                  break e;
                case qt:
                  Le = T;
                  break e;
                case Yt:
                  Le = P, We = null;
                  break e;
                case Ut:
                  Le = N;
                  break e;
              }
            var st = "";
            {
              (o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (st += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
              var It = G ? ae(G.type) : null;
              It && (st += `

Check the render method of \`` + It + "`.");
            }
            throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (o == null ? o : typeof o) + "." + st);
          }
        }
      var Ht = js(Le, M, d, Q);
      return Ht.elementType = o, Ht.type = We, Ht.lanes = Ce, Ht._debugOwner = G, Ht;
    }
    function DS(o, d, M) {
      var G = null;
      G = o._owner;
      var Q = o.type, Ce = o.key, Le = o.props, We = MS(Q, Ce, Le, G, d, M);
      return We._debugSource = o._source, We._debugOwner = o._owner, We;
    }
    function Sh(o, d, M, G) {
      var Q = js(C, o, G, d);
      return Q.lanes = M, Q;
    }
    function u9(o, d, M, G) {
      typeof o.id != "string" && s('Profiler must specify an "id" as a prop');
      var Q = js(E, o, G, d | Ws);
      return Q.elementType = Ot, Q.type = Ot, Q.lanes = M, Q.stateNode = {
        effectDuration: 0,
        passiveEffectDuration: 0
      }, Q;
    }
    function c9(o, d, M, G) {
      var Q = js(x, o, G, d);
      return Q.type = bt, Q.elementType = bt, Q.lanes = M, Q;
    }
    function d9(o, d, M, G) {
      var Q = js(L, o, G, d);
      return Q.type = jt, Q.elementType = jt, Q.lanes = M, Q;
    }
    function FS(o, d, M, G) {
      var Q = js(Y, o, G, d);
      return Q.type = Ye, Q.elementType = Ye, Q.lanes = M, Q;
    }
    function f9(o, d, M, G) {
      var Q = js(j, o, G, d);
      return Q.type = lt, Q.elementType = lt, Q.lanes = M, Q;
    }
    function PS(o, d, M) {
      var G = js(y, o, null, d);
      return G.lanes = M, G;
    }
    function h9() {
      var o = js(g, null, null, ma);
      return o.elementType = "DELETED", o.type = "DELETED", o;
    }
    function IS(o, d, M) {
      var G = o.children !== null ? o.children : [], Q = js(p, G, o.key, d);
      return Q.lanes = M, Q.stateNode = {
        containerInfo: o.containerInfo,
        pendingChildren: null,
        // Used by persistent updates
        implementation: o.implementation
      }, Q;
    }
    function NM(o, d) {
      return o === null && (o = js(v, null, null, ma)), o.tag = d.tag, o.key = d.key, o.elementType = d.elementType, o.type = d.type, o.stateNode = d.stateNode, o.return = d.return, o.child = d.child, o.sibling = d.sibling, o.index = d.index, o.ref = d.ref, o.pendingProps = d.pendingProps, o.memoizedProps = d.memoizedProps, o.updateQueue = d.updateQueue, o.memoizedState = d.memoizedState, o.dependencies = d.dependencies, o.mode = d.mode, o.flags = d.flags, o.nextEffect = d.nextEffect, o.firstEffect = d.firstEffect, o.lastEffect = d.lastEffect, o.lanes = d.lanes, o.childLanes = d.childLanes, o.alternate = d.alternate, o.actualDuration = d.actualDuration, o.actualStartTime = d.actualStartTime, o.selfBaseDuration = d.selfBaseDuration, o.treeBaseDuration = d.treeBaseDuration, o._debugID = d._debugID, o._debugSource = d._debugSource, o._debugOwner = d._debugOwner, o._debugNeedsRemount = d._debugNeedsRemount, o._debugHookTypes = d._debugHookTypes, o;
    }
    function p9(o, d, M) {
      switch (this.tag = d, this.containerInfo = o, this.pendingChildren = null, this.current = null, this.pingCache = null, this.finishedWork = null, this.timeoutHandle = Tb, this.context = null, this.pendingContext = null, this.hydrate = M, this.callbackNode = null, this.callbackPriority = Bt, this.eventTimes = Cp(qe), this.expirationTimes = Cp(un), this.pendingLanes = qe, this.suspendedLanes = qe, this.pingedLanes = qe, this.expiredLanes = qe, this.mutableReadLanes = qe, this.finishedLanes = qe, this.entangledLanes = qe, this.entanglements = Cp(qe), this.mutableSourceEagerHydrationData = null, this.interactionThreadID = n.unstable_getThreadID(), this.memoizedInteractions = /* @__PURE__ */ new Set(), this.pendingInteractionMap = /* @__PURE__ */ new Map(), d) {
        case yA:
          this._debugRootType = "createBlockingRoot()";
          break;
        case CA:
          this._debugRootType = "createRoot()";
          break;
        case Pb:
          this._debugRootType = "createLegacyRoot()";
          break;
      }
    }
    function v9(o, d, M, G) {
      var Q = new p9(o, d, M), Ce = l9(d);
      return Q.current = Ce, Ce.stateNode = Q, zb(Ce), Q;
    }
    function g9(o, d) {
      var M = d._getVersion, G = M(d._source);
      o.mutableSourceEagerHydrationData == null ? o.mutableSourceEagerHydrationData = [d, G] : o.mutableSourceEagerHydrationData.push(d, G);
    }
    function m9(o, d, M) {
      var G = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
      return {
        // This tag allow us to uniquely identify this as a React Portal
        $$typeof: ct,
        key: G == null ? null : "" + G,
        children: o,
        containerInfo: d,
        implementation: M
      };
    }
    var LS, kS;
    LS = !1, kS = {};
    function y9(o) {
      if (!o)
        return zs;
      var d = os(o), M = w5(d);
      if (d.tag === l) {
        var G = d.type;
        if (Wu(G))
          return gA(d, G, M);
      }
      return M;
    }
    function C9(o, d) {
      {
        var M = os(o);
        if (M === void 0)
          throw typeof o.render == "function" ? Error("Unable to find node on an unmounted component.") : Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(o));
        var G = Of(M);
        if (G === null)
          return null;
        if (G.mode & Da) {
          var Q = ae(M.type) || "Component";
          if (!kS[Q]) {
            kS[Q] = !0;
            var Ce = rt;
            try {
              dt(G), M.mode & Da ? s("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", d, d, Q) : s("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", d, d, Q);
            } finally {
              Ce ? dt(Ce) : pt();
            }
          }
        }
        return G.stateNode;
      }
    }
    function b9(o, d, M, G) {
      return v9(o, d, M);
    }
    function om(o, d, M, G) {
      T5(d, o);
      var Q = d.current, Ce = Us();
      typeof jest < "u" && ($6(Q), AM(Q));
      var Le = _d(Q), We = y9(M);
      d.context === null ? d.context = We : d.pendingContext = We, gt && rt !== null && !LS && (LS = !0, s(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`, ae(rt.type) || "Unknown"));
      var st = Hd(Ce, Le);
      return st.payload = {
        element: o
      }, G = G === void 0 ? null : G, G !== null && (typeof G != "function" && s("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", G), st.callback = G), Bd(Q, st), Bo(Q, Le, Ce), Le;
    }
    function OS(o) {
      var d = o.current;
      if (!d.child)
        return null;
      switch (d.child.tag) {
        case g:
          return d.child.stateNode;
        default:
          return d.child.stateNode;
      }
    }
    function GM(o, d) {
      var M = o.memoizedState;
      M !== null && M.dehydrated !== null && (M.retryLane = eu(M.retryLane, d));
    }
    function NS(o, d) {
      GM(o, d);
      var M = o.alternate;
      M && GM(M, d);
    }
    function w9(o) {
      if (o.tag === x) {
        var d = Us(), M = Kt;
        Bo(o, M, d), NS(o, M);
      }
    }
    function S9(o) {
      if (o.tag === x) {
        var d = Us(), M = An;
        Bo(o, M, d), NS(o, M);
      }
    }
    function x9(o) {
      if (o.tag === x) {
        var d = Us(), M = _d(o);
        Bo(o, M, d), NS(o, M);
      }
    }
    function T9(o, d) {
      try {
        return d();
      } finally {
      }
    }
    function HM(o) {
      var d = wd(o);
      return d === null ? null : d.tag === A ? d.stateNode.instance : d.stateNode;
    }
    var BM = function(o) {
      return !1;
    };
    function R9(o) {
      return BM(o);
    }
    var VM = null, zM = null, WM = null, _M = null, UM = null, jM = null, YM = null, XM = null;
    {
      var $M = function(o, d, M) {
        var G = d[M], Q = Array.isArray(o) ? o.slice() : t({}, o);
        return M + 1 === d.length ? (Array.isArray(Q) ? Q.splice(G, 1) : delete Q[G], Q) : (Q[G] = $M(o[G], d, M + 1), Q);
      }, ZM = function(o, d) {
        return $M(o, d, 0);
      }, KM = function(o, d, M, G) {
        var Q = d[G], Ce = Array.isArray(o) ? o.slice() : t({}, o);
        if (G + 1 === d.length) {
          var Le = M[G];
          Ce[Le] = Ce[Q], Array.isArray(Ce) ? Ce.splice(Q, 1) : delete Ce[Q];
        } else
          Ce[Q] = KM(
            // $FlowFixMe number or string is fine here
            o[Q],
            d,
            M,
            G + 1
          );
        return Ce;
      }, JM = function(o, d, M) {
        if (d.length !== M.length) {
          u("copyWithRename() expects paths of the same length");
          return;
        } else
          for (var G = 0; G < M.length - 1; G++)
            if (d[G] !== M[G]) {
              u("copyWithRename() expects paths to be the same except for the deepest key");
              return;
            }
        return KM(o, d, M, 0);
      }, QM = function(o, d, M, G) {
        if (M >= d.length)
          return G;
        var Q = d[M], Ce = Array.isArray(o) ? o.slice() : t({}, o);
        return Ce[Q] = QM(o[Q], d, M + 1, G), Ce;
      }, qM = function(o, d, M) {
        return QM(o, d, 0, M);
      }, GS = function(o, d) {
        for (var M = o.memoizedState; M !== null && d > 0; )
          M = M.next, d--;
        return M;
      };
      VM = function(o, d, M, G) {
        var Q = GS(o, d);
        if (Q !== null) {
          var Ce = qM(Q.memoizedState, M, G);
          Q.memoizedState = Ce, Q.baseState = Ce, o.memoizedProps = t({}, o.memoizedProps), Bo(o, Dt, un);
        }
      }, zM = function(o, d, M) {
        var G = GS(o, d);
        if (G !== null) {
          var Q = ZM(G.memoizedState, M);
          G.memoizedState = Q, G.baseState = Q, o.memoizedProps = t({}, o.memoizedProps), Bo(o, Dt, un);
        }
      }, WM = function(o, d, M, G) {
        var Q = GS(o, d);
        if (Q !== null) {
          var Ce = JM(Q.memoizedState, M, G);
          Q.memoizedState = Ce, Q.baseState = Ce, o.memoizedProps = t({}, o.memoizedProps), Bo(o, Dt, un);
        }
      }, _M = function(o, d, M) {
        o.pendingProps = qM(o.memoizedProps, d, M), o.alternate && (o.alternate.pendingProps = o.pendingProps), Bo(o, Dt, un);
      }, UM = function(o, d) {
        o.pendingProps = ZM(o.memoizedProps, d), o.alternate && (o.alternate.pendingProps = o.pendingProps), Bo(o, Dt, un);
      }, jM = function(o, d, M) {
        o.pendingProps = JM(o.memoizedProps, d, M), o.alternate && (o.alternate.pendingProps = o.pendingProps), Bo(o, Dt, un);
      }, YM = function(o) {
        Bo(o, Dt, un);
      }, XM = function(o) {
        BM = o;
      };
    }
    function A9(o) {
      var d = Of(o);
      return d === null ? null : d.stateNode;
    }
    function E9(o) {
      return null;
    }
    function M9() {
      return rt;
    }
    function D9(o) {
      var d = o.findFiberByHostInstance, M = a.ReactCurrentDispatcher;
      return x5({
        bundleType: o.bundleType,
        version: o.version,
        rendererPackageName: o.rendererPackageName,
        rendererConfig: o.rendererConfig,
        overrideHookState: VM,
        overrideHookStateDeletePath: zM,
        overrideHookStateRenamePath: WM,
        overrideProps: _M,
        overridePropsDeletePath: UM,
        overridePropsRenamePath: jM,
        setSuspenseHandler: XM,
        scheduleUpdate: YM,
        currentDispatcherRef: M,
        findHostInstanceByFiber: A9,
        findFiberByHostInstance: d || E9,
        // React Refresh
        findHostInstancesForRefresh: e9,
        scheduleRefresh: Q6,
        scheduleRoot: q6,
        setRefreshHandler: J6,
        // Enables DevTools to append owner stacks to error messages in DEV mode.
        getCurrentFiber: M9
      });
    }
    function HS(o, d, M) {
      this._internalRoot = F9(o, d, M);
    }
    HS.prototype.render = function(o) {
      var d = this._internalRoot;
      {
        typeof arguments[1] == "function" && s("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
        var M = d.containerInfo;
        if (M.nodeType !== oa) {
          var G = HM(d.current);
          G && G.parentNode !== M && s("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
        }
      }
      om(o, d, null, null);
    }, HS.prototype.unmount = function() {
      typeof arguments[0] == "function" && s("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
      var o = this._internalRoot, d = o.containerInfo;
      om(null, o, null, function() {
        cA(d);
      });
    };
    function F9(o, d, M) {
      var G = M != null && M.hydrate === !0;
      M != null && M.hydrationOptions;
      var Q = M != null && M.hydrationOptions != null && M.hydrationOptions.mutableSources || null, Ce = b9(o, d, G);
      b5(Ce.current, o), o.nodeType;
      {
        var Le = o.nodeType === oa ? o.parentNode : o;
        kR(Le);
      }
      if (Q)
        for (var We = 0; We < Q.length; We++) {
          var st = Q[We];
          g9(Ce, st);
        }
      return Ce;
    }
    function P9(o, d) {
      return new HS(o, Pb, d);
    }
    function av(o) {
      return !!(o && (o.nodeType === Oa || o.nodeType === eo || o.nodeType === ff || o.nodeType === oa && o.nodeValue === " react-mount-point-unstable "));
    }
    var I9 = a.ReactCurrentOwner, eD, tD = !1;
    eD = function(o) {
      if (o._reactRootContainer && o.nodeType !== oa) {
        var d = HM(o._reactRootContainer._internalRoot.current);
        d && d.parentNode !== o && s("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
      }
      var M = !!o._reactRootContainer, G = iC(o), Q = !!(G && Od(G));
      Q && !M && s("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."), o.nodeType === Oa && o.tagName && o.tagName.toUpperCase() === "BODY" && s("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
    };
    function iC(o) {
      return o ? o.nodeType === eo ? o.documentElement : o.firstChild : null;
    }
    function L9(o) {
      var d = iC(o);
      return !!(d && d.nodeType === Oa && d.hasAttribute(Re));
    }
    function k9(o, d) {
      var M = d || L9(o);
      if (!M)
        for (var G = !1, Q; Q = o.lastChild; )
          !G && Q.nodeType === Oa && Q.hasAttribute(Re) && (G = !0, s("render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.")), o.removeChild(Q);
      return M && !d && !tD && (tD = !0, u("render(): Calling ReactDOM.render() to hydrate server-rendered markup will stop working in React v18. Replace the ReactDOM.render() call with ReactDOM.hydrate() if you want React to attach to the server HTML.")), P9(o, M ? {
        hydrate: !0
      } : void 0);
    }
    function O9(o, d) {
      o !== null && typeof o != "function" && s("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", d, o);
    }
    function aC(o, d, M, G, Q) {
      eD(M), O9(Q === void 0 ? null : Q, "render");
      var Ce = M._reactRootContainer, Le;
      if (Ce) {
        if (Le = Ce._internalRoot, typeof Q == "function") {
          var st = Q;
          Q = function() {
            var It = OS(Le);
            st.call(It);
          };
        }
        om(d, Le, o, Q);
      } else {
        if (Ce = M._reactRootContainer = k9(M, G), Le = Ce._internalRoot, typeof Q == "function") {
          var We = Q;
          Q = function() {
            var It = OS(Le);
            We.call(It);
          };
        }
        gM(function() {
          om(d, Le, o, Q);
        });
      }
      return OS(Le);
    }
    function N9(o) {
      {
        var d = I9.current;
        if (d !== null && d.stateNode !== null) {
          var M = d.stateNode._warnedAboutRefsInRender;
          M || s("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", ae(d.type) || "A component"), d.stateNode._warnedAboutRefsInRender = !0;
        }
      }
      return o == null ? null : o.nodeType === Oa ? o : C9(o, "findDOMNode");
    }
    function G9(o, d, M) {
      if (!av(d))
        throw Error("Target container is not a DOM element.");
      {
        var G = Wy(d) && d._reactRootContainer === void 0;
        G && s("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?");
      }
      return aC(null, o, d, !0, M);
    }
    function H9(o, d, M) {
      if (!av(d))
        throw Error("Target container is not a DOM element.");
      {
        var G = Wy(d) && d._reactRootContainer === void 0;
        G && s("You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?");
      }
      return aC(null, o, d, !1, M);
    }
    function B9(o, d, M, G) {
      if (!av(M))
        throw Error("Target container is not a DOM element.");
      if (!(o != null && Cd(o)))
        throw Error("parentComponent must be a valid React Component");
      return aC(o, d, M, !1, G);
    }
    function V9(o) {
      if (!av(o))
        throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
      {
        var d = Wy(o) && o._reactRootContainer === void 0;
        d && s("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?");
      }
      if (o._reactRootContainer) {
        {
          var M = iC(o), G = M && !Od(M);
          G && s("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
        }
        return gM(function() {
          aC(null, null, o, !1, function() {
            o._reactRootContainer = null, cA(o);
          });
        }), !0;
      } else {
        {
          var Q = iC(o), Ce = !!(Q && Od(Q)), Le = o.nodeType === Oa && av(o.parentNode) && !!o.parentNode._reactRootContainer;
          Ce && s("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", Le ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
        }
        return !1;
      }
    }
    Zl(w9), Gf(S9), fl(x9), hl(T9);
    var rD = !1;
    (typeof Map != "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
    Map.prototype == null || typeof Map.prototype.forEach != "function" || typeof Set != "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
    Set.prototype == null || typeof Set.prototype.clear != "function" || typeof Set.prototype.forEach != "function") && s("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), Af(wO), mc(vM, m6, p6, g6);
    function nD(o, d) {
      var M = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
      if (!av(d))
        throw Error("Target container is not a DOM element.");
      return m9(o, d, null, M);
    }
    function z9(o, d, M, G) {
      return B9(o, d, M, G);
    }
    function W9(o, d) {
      var M = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
      return rD || (rD = !0, u('The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 18+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.')), nD(o, d, M);
    }
    var _9 = {
      // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.
      // This is an array for better minification.
      Events: [
        Od,
        Gp,
        _y,
        Cu,
        hd,
        Zu,
        // TODO: This is related to `act`, not events. Move to separate key?
        rC
      ]
    }, U9 = D9({
      findFiberByHostInstance: ah,
      bundleType: 1,
      version: LA,
      rendererPackageName: "react-dom"
    });
    if (!U9 && U && window.top === window.self && (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1)) {
      var iD = window.location.protocol;
      /^(https?|file):$/.test(iD) && console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (iD === "file:" ? `
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq` : ""), "font-weight:bold");
    }
    Xs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = _9, Xs.createPortal = nD, Xs.findDOMNode = N9, Xs.flushSync = vS, Xs.hydrate = G9, Xs.render = H9, Xs.unmountComponentAtNode = V9, Xs.unstable_batchedUpdates = vM, Xs.unstable_createPortal = W9, Xs.unstable_renderSubtreeIntoContainer = z9, Xs.version = LA;
  }()), Xs;
}
function UF() {
  if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
    if (true)
      throw new Error("^_^");
    try {
      __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UF);
    } catch (e) {
      console.error(e);
    }
  }
}
 false ? (0) : Nx.exports = SG();
var A1 = Nx.exports;
const Dh = /* @__PURE__ */ jh(A1), xD = {
  disabled: !1
};
var xG =  true ? hn.oneOfType([hn.number, hn.shape({
  enter: hn.number,
  exit: hn.number,
  appear: hn.number
}).isRequired]) : 0;
 true && hn.oneOfType([hn.string, hn.shape({
  enter: hn.string,
  exit: hn.string,
  active: hn.string
}), hn.shape({
  enter: hn.string,
  enterDone: hn.string,
  enterActive: hn.string,
  exit: hn.string,
  exitDone: hn.string,
  exitActive: hn.string
})]);
const jF = react__WEBPACK_IMPORTED_MODULE_1___default().createContext(null);
var TG = function(t) {
  return t.scrollTop;
}, vm = "unmounted", Kd = "exited", cu = "entering", Xc = "entered", Pm = "exiting", od = /* @__PURE__ */ function(e) {
  vG(t, e);
  function t(n, a) {
    var u;
    u = e.call(this, n, a) || this;
    var s = a, c = s && !s.isMounting ? n.enter : n.appear, i;
    return u.appearStatus = null, n.in ? c ? (i = Kd, u.appearStatus = cu) : i = Xc : n.unmountOnExit || n.mountOnEnter ? i = vm : i = Kd, u.state = {
      status: i
    }, u.nextCallback = null, u;
  }
  t.getDerivedStateFromProps = function(a, u) {
    var s = a.in;
    return s && u.status === vm ? {
      status: Kd
    } : null;
  };
  var r = t.prototype;
  return r.componentDidMount = function() {
    this.updateStatus(!0, this.appearStatus);
  }, r.componentDidUpdate = function(a) {
    var u = null;
    if (a !== this.props) {
      var s = this.state.status;
      this.props.in ? s !== cu && s !== Xc && (u = cu) : (s === cu || s === Xc) && (u = Pm);
    }
    this.updateStatus(!1, u);
  }, r.componentWillUnmount = function() {
    this.cancelNextCallback();
  }, r.getTimeouts = function() {
    var a = this.props.timeout, u, s, c;
    return u = s = c = a, a != null && typeof a != "number" && (u = a.exit, s = a.enter, c = a.appear !== void 0 ? a.appear : s), {
      exit: u,
      enter: s,
      appear: c
    };
  }, r.updateStatus = function(a, u) {
    if (a === void 0 && (a = !1), u !== null)
      if (this.cancelNextCallback(), u === cu) {
        if (this.props.unmountOnExit || this.props.mountOnEnter) {
          var s = this.props.nodeRef ? this.props.nodeRef.current : Dh.findDOMNode(this);
          s && TG(s);
        }
        this.performEnter(a);
      } else
        this.performExit();
    else this.props.unmountOnExit && this.state.status === Kd && this.setState({
      status: vm
    });
  }, r.performEnter = function(a) {
    var u = this, s = this.props.enter, c = this.context ? this.context.isMounting : a, i = this.props.nodeRef ? [c] : [Dh.findDOMNode(this), c], l = i[0], v = i[1], f = this.getTimeouts(), p = c ? f.appear : f.enter;
    if (!a && !s || xD.disabled) {
      this.safeSetState({
        status: Xc
      }, function() {
        u.props.onEntered(l);
      });
      return;
    }
    this.props.onEnter(l, v), this.safeSetState({
      status: cu
    }, function() {
      u.props.onEntering(l, v), u.onTransitionEnd(p, function() {
        u.safeSetState({
          status: Xc
        }, function() {
          u.props.onEntered(l, v);
        });
      });
    });
  }, r.performExit = function() {
    var a = this, u = this.props.exit, s = this.getTimeouts(), c = this.props.nodeRef ? void 0 : Dh.findDOMNode(this);
    if (!u || xD.disabled) {
      this.safeSetState({
        status: Kd
      }, function() {
        a.props.onExited(c);
      });
      return;
    }
    this.props.onExit(c), this.safeSetState({
      status: Pm
    }, function() {
      a.props.onExiting(c), a.onTransitionEnd(s.exit, function() {
        a.safeSetState({
          status: Kd
        }, function() {
          a.props.onExited(c);
        });
      });
    });
  }, r.cancelNextCallback = function() {
    this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
  }, r.safeSetState = function(a, u) {
    u = this.setNextCallback(u), this.setState(a, u);
  }, r.setNextCallback = function(a) {
    var u = this, s = !0;
    return this.nextCallback = function(c) {
      s && (s = !1, u.nextCallback = null, a(c));
    }, this.nextCallback.cancel = function() {
      s = !1;
    }, this.nextCallback;
  }, r.onTransitionEnd = function(a, u) {
    this.setNextCallback(u);
    var s = this.props.nodeRef ? this.props.nodeRef.current : Dh.findDOMNode(this), c = a == null && !this.props.addEndListener;
    if (!s || c) {
      setTimeout(this.nextCallback, 0);
      return;
    }
    if (this.props.addEndListener) {
      var i = this.props.nodeRef ? [this.nextCallback] : [s, this.nextCallback], l = i[0], v = i[1];
      this.props.addEndListener(l, v);
    }
    a != null && setTimeout(this.nextCallback, a);
  }, r.render = function() {
    var a = this.state.status;
    if (a === vm)
      return null;
    var u = this.props, s = u.children;
    u.in, u.mountOnEnter, u.unmountOnExit, u.appear, u.enter, u.exit, u.timeout, u.addEndListener, u.onEnter, u.onEntering, u.onEntered, u.onExit, u.onExiting, u.onExited, u.nodeRef;
    var c = kT(u, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
    return (
      // allows for nested Transitions
      /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(jF.Provider, {
        value: null
      }, typeof s == "function" ? s(a, c) : react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(react__WEBPACK_IMPORTED_MODULE_1___default().Children.only(s), c))
    );
  }, t;
}((react__WEBPACK_IMPORTED_MODULE_1___default().Component));
od.contextType = jF;
od.propTypes =  true ? {
  /**
   * A React reference to DOM element that need to transition:
   * https://stackoverflow.com/a/51127130/4671932
   *
   *   - When `nodeRef` prop is used, `node` is not passed to callback functions
   *      (e.g. `onEnter`) because user already has direct access to the node.
   *   - When changing `key` prop of `Transition` in a `TransitionGroup` a new
   *     `nodeRef` need to be provided to `Transition` with changed `key` prop
   *     (see
   *     [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
   */
  nodeRef: hn.shape({
    current: typeof Element > "u" ? hn.any : function(e, t, r, n, a, u) {
      var s = e[t];
      return hn.instanceOf(s && "ownerDocument" in s ? s.ownerDocument.defaultView.Element : Element)(e, t, r, n, a, u);
    }
  }),
  /**
   * A `function` child can be used instead of a React element. This function is
   * called with the current transition status (`'entering'`, `'entered'`,
   * `'exiting'`, `'exited'`), which can be used to apply context
   * specific props to a component.
   *
   * ```jsx
   * <Transition in={this.state.in} timeout={150}>
   *   {state => (
   *     <MyComponent className={`fade fade-${state}`} />
   *   )}
   * </Transition>
   * ```
   */
  children: hn.oneOfType([hn.func.isRequired, hn.element.isRequired]).isRequired,
  /**
   * Show the component; triggers the enter or exit states
   */
  in: hn.bool,
  /**
   * By default the child component is mounted immediately along with
   * the parent `Transition` component. If you want to "lazy mount" the component on the
   * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
   * mounted, even on "exited", unless you also specify `unmountOnExit`.
   */
  mountOnEnter: hn.bool,
  /**
   * By default the child component stays mounted after it reaches the `'exited'` state.
   * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
   */
  unmountOnExit: hn.bool,
  /**
   * By default the child component does not perform the enter transition when
   * it first mounts, regardless of the value of `in`. If you want this
   * behavior, set both `appear` and `in` to `true`.
   *
   * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
   * > only adds an additional enter transition. However, in the
   * > `<CSSTransition>` component that first enter transition does result in
   * > additional `.appear-*` classes, that way you can choose to style it
   * > differently.
   */
  appear: hn.bool,
  /**
   * Enable or disable enter transitions.
   */
  enter: hn.bool,
  /**
   * Enable or disable exit transitions.
   */
  exit: hn.bool,
  /**
   * The duration of the transition, in milliseconds.
   * Required unless `addEndListener` is provided.
   *
   * You may specify a single timeout for all transitions:
   *
   * ```jsx
   * timeout={500}
   * ```
   *
   * or individually:
   *
   * ```jsx
   * timeout={{
   *  appear: 500,
   *  enter: 300,
   *  exit: 500,
   * }}
   * ```
   *
   * - `appear` defaults to the value of `enter`
   * - `enter` defaults to `0`
   * - `exit` defaults to `0`
   *
   * @type {number | { enter?: number, exit?: number, appear?: number }}
   */
  timeout: function(t) {
    var r = xG;
    t.addEndListener || (r = r.isRequired);
    for (var n = arguments.length, a = new Array(n > 1 ? n - 1 : 0), u = 1; u < n; u++)
      a[u - 1] = arguments[u];
    return r.apply(void 0, [t].concat(a));
  },
  /**
   * Add a custom transition end trigger. Called with the transitioning
   * DOM node and a `done` callback. Allows for more fine grained transition end
   * logic. Timeouts are still used as a fallback if provided.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * ```jsx
   * addEndListener={(node, done) => {
   *   // use the css transitionend event to mark the finish of a transition
   *   node.addEventListener('transitionend', done, false);
   * }}
   * ```
   */
  addEndListener: hn.func,
  /**
   * Callback fired before the "entering" status is applied. An extra parameter
   * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool) -> void
   */
  onEnter: hn.func,
  /**
   * Callback fired after the "entering" status is applied. An extra parameter
   * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool)
   */
  onEntering: hn.func,
  /**
   * Callback fired after the "entered" status is applied. An extra parameter
   * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool) -> void
   */
  onEntered: hn.func,
  /**
   * Callback fired before the "exiting" status is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement) -> void
   */
  onExit: hn.func,
  /**
   * Callback fired after the "exiting" status is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement) -> void
   */
  onExiting: hn.func,
  /**
   * Callback fired after the "exited" status is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed
   *
   * @type Function(node: HtmlElement) -> void
   */
  onExited: hn.func
} : 0;
function ov() {
}
od.defaultProps = {
  in: !1,
  mountOnEnter: !1,
  unmountOnExit: !1,
  appear: !1,
  enter: !0,
  exit: !0,
  onEnter: ov,
  onEntering: ov,
  onEntered: ov,
  onExit: ov,
  onExiting: ov,
  onExited: ov
};
od.UNMOUNTED = vm;
od.EXITED = Kd;
od.ENTERING = cu;
od.ENTERED = Xc;
od.EXITING = Pm;
function Ym(e) {
  return e && e.ownerDocument || document;
}
function RG(e) {
  var t = Ym(e);
  return t && t.defaultView || window;
}
function AG(e, t) {
  return RG(e).getComputedStyle(e, t);
}
var EG = /([A-Z])/g;
function MG(e) {
  return e.replace(EG, "-$1").toLowerCase();
}
var DG = /^ms-/;
function uC(e) {
  return MG(e).replace(DG, "-ms-");
}
var FG = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
function PG(e) {
  return !!(e && FG.test(e));
}
function Zc(e, t) {
  var r = "", n = "";
  if (typeof t == "string")
    return e.style.getPropertyValue(uC(t)) || AG(e).getPropertyValue(uC(t));
  Object.keys(t).forEach(function(a) {
    var u = t[a];
    !u && u !== 0 ? e.style.removeProperty(uC(a)) : PG(a) ? n += a + "(" + u + ") " : r += uC(a) + ": " + u + ";";
  }), n && (r += "transform: " + n + ";"), e.style.cssText += ";" + r;
}
const Iv = !!(typeof window < "u" && window.document && window.document.createElement);
var Gx = !1, Hx = !1;
try {
  var KS = {
    get passive() {
      return Gx = !0;
    },
    get once() {
      return Hx = Gx = !0;
    }
  };
  Iv && (window.addEventListener("test", KS, KS), window.removeEventListener("test", KS, !0));
} catch {
}
function OT(e, t, r, n) {
  if (n && typeof n != "boolean" && !Hx) {
    var a = n.once, u = n.capture, s = r;
    !Hx && a && (s = r.__once || function c(i) {
      this.removeEventListener(t, c, u), r.call(this, i);
    }, r.__once = s), e.addEventListener(t, s, Gx ? n : u);
  }
  e.addEventListener(t, r, n);
}
function Bx(e, t, r, n) {
  var a = n && typeof n != "boolean" ? n.capture : n;
  e.removeEventListener(t, r, a), r.__once && e.removeEventListener(t, r.__once, a);
}
function qd(e, t, r, n) {
  return OT(e, t, r, n), function() {
    Bx(e, t, r, n);
  };
}
function IG(e, t, r, n) {
  if (n === void 0 && (n = !0), e) {
    var a = document.createEvent("HTMLEvents");
    a.initEvent(t, r, n), e.dispatchEvent(a);
  }
}
function LG(e) {
  var t = Zc(e, "transitionDuration") || "", r = t.indexOf("ms") === -1 ? 1e3 : 1;
  return parseFloat(t) * r;
}
function kG(e, t, r) {
  r === void 0 && (r = 5);
  var n = !1, a = setTimeout(function() {
    n || IG(e, "transitionend", !0);
  }, t + r), u = qd(e, "transitionend", function() {
    n = !0;
  }, {
    once: !0
  });
  return function() {
    clearTimeout(a), u();
  };
}
function YF(e, t, r, n) {
  r == null && (r = LG(e) || 0);
  var a = kG(e, r, n), u = qd(e, "transitionend", t);
  return function() {
    a(), u();
  };
}
function TD(e, t) {
  const r = Zc(e, t) || "", n = r.indexOf("ms") === -1 ? 1e3 : 1;
  return parseFloat(r) * n;
}
function NT(e, t) {
  const r = TD(e, "transitionDuration"), n = TD(e, "transitionDelay"), a = YF(e, (u) => {
    u.target === e && (a(), t(u));
  }, r + n);
}
function XF(e) {
  e.offsetHeight;
}
function OG(e) {
  return e && "setState" in e ? Dh.findDOMNode(e) : e ?? null;
}
const GT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef(({
  onEnter: e,
  onEntering: t,
  onEntered: r,
  onExit: n,
  onExiting: a,
  onExited: u,
  addEndListener: s,
  children: c,
  childRef: i,
  ...l
}, v) => {
  const f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), p = ad(f, i), g = (T) => {
    p(OG(T));
  }, y = (T) => (F) => {
    T && f.current && T(f.current, F);
  }, C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(e), [e]), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(t), [t]), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(r), [r]), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(n), [n]), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(a), [a]), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(u), [u]), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(s), [s]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(od, {
    ref: v,
    ...l,
    onEnter: C,
    onEntered: h,
    onEntering: m,
    onExit: w,
    onExited: E,
    onExiting: S,
    addEndListener: x,
    nodeRef: f,
    children: typeof c == "function" ? (T, F) => (
      // TODO: Types for RTG missing innerProps, so need to cast.
      c(T, {
        ...F,
        ref: g
      })
    ) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(c, {
      ref: g
    })
  });
}), NG = {
  [cu]: "show",
  [Xc]: "show"
}, rf = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  children: t,
  transitionClasses: r = {},
  onEnter: n,
  ...a
}, u) => {
  const s = {
    in: !1,
    timeout: 300,
    mountOnEnter: !1,
    unmountOnExit: !1,
    appear: !1,
    ...a
  }, c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((i, l) => {
    XF(i), n == null || n(i, l);
  }, [n]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GT, {
    ref: u,
    addEndListener: NT,
    ...s,
    onEnter: c,
    childRef: t.ref,
    children: (i, l) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(t, {
      ...l,
      className: ln("fade", e, t.props.className, NG[i], r[i])
    })
  });
});
rf.displayName = "Fade";
function HT(e) {
  return typeof e == "boolean" ? e ? rf : IT : e;
}
const $F = ({
  transition: e,
  ...t
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LT, {
  ...t,
  transition: HT(e)
});
$F.displayName = "TabContainer";
const ZF = ["xxl", "xl", "lg", "md", "sm", "xs"], KF = "xs", E1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext({
  prefixes: {},
  breakpoints: ZF,
  minBreakpoint: KF
});
function mn(e, t) {
  const {
    prefixes: r
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(E1);
  return e || r[t] || t;
}
function BT() {
  const {
    breakpoints: e
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(E1);
  return e;
}
function VT() {
  const {
    minBreakpoint: e
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(E1);
  return e;
}
function JF() {
  const {
    dir: e
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(E1);
  return e === "rtl";
}
const zT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "tab-content"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
zT.displayName = "TabContent";
const WT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  transition: t,
  ...r
}, n) => {
  const [{
    className: a,
    // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
    as: u = "div",
    ...s
  }, {
    isActive: c,
    onEnter: i,
    onEntering: l,
    onEntered: v,
    onExit: f,
    onExiting: p,
    onExited: g,
    mountOnEnter: y,
    unmountOnExit: C,
    transition: m = rf
  }] = VF({
    ...r,
    transition: HT(t)
  }), h = mn(e, "tab-pane");
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pv.Provider, {
    value: null,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(oc.Provider, {
      value: null,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(m, {
        in: c,
        onEnter: i,
        onEntering: l,
        onEntered: v,
        onExit: f,
        onExiting: p,
        onExited: g,
        mountOnEnter: y,
        unmountOnExit: C,
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(u, {
          ...s,
          ref: n,
          className: ln(a, h, c && "active")
        })
      })
    })
  });
});
WT.displayName = "TabPane";
const GG = {
  eventKey: hn.oneOfType([hn.string, hn.number]),
  /**
   * Content for the tab title.
   */
  title: hn.node.isRequired,
  /**
   * The disabled state of the tab.
   */
  disabled: hn.bool,
  /**
   * Class to pass to the underlying nav link.
   */
  tabClassName: hn.string,
  /**
   * Object containing attributes to pass to underlying nav link.
   */
  tabAttrs: hn.object
}, QF = () => {
  throw new Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly");
};
QF.propTypes = GG;
const hu = Object.assign(QF, {
  Container: $F,
  Content: zT,
  Pane: WT
}), is = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  fluid: t = !1,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: r = "div",
  className: n,
  ...a
}, u) => {
  const s = mn(e, "container"), c = typeof t == "string" ? `-${t}` : "-fluid";
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
    ref: u,
    ...a,
    className: ln(n, t ? `${s}${c}` : s)
  });
});
is.displayName = "Container";
class Xm {
  constructor() {
    this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
  }
  subscribe(t) {
    const r = {
      listener: t
    };
    return this.listeners.add(r), this.onSubscribe(), () => {
      this.listeners.delete(r), this.onUnsubscribe();
    };
  }
  hasListeners() {
    return this.listeners.size > 0;
  }
  onSubscribe() {
  }
  onUnsubscribe() {
  }
}
const Im = typeof window > "u" || "Deno" in window;
function Ol() {
}
function HG(e, t) {
  return typeof e == "function" ? e(t) : e;
}
function Vx(e) {
  return typeof e == "number" && e >= 0 && e !== 1 / 0;
}
function qF(e, t) {
  return Math.max(e + (t || 0) - Date.now(), 0);
}
function gm(e, t, r) {
  return M1(e) ? typeof t == "function" ? {
    ...r,
    queryKey: e,
    queryFn: t
  } : {
    ...t,
    queryKey: e
  } : e;
}
function Jd(e, t, r) {
  return M1(e) ? [{
    ...t,
    queryKey: e
  }, r] : [e || {}, t];
}
function RD(e, t) {
  const {
    type: r = "all",
    exact: n,
    fetchStatus: a,
    predicate: u,
    queryKey: s,
    stale: c
  } = e;
  if (M1(s)) {
    if (n) {
      if (t.queryHash !== _T(s, t.options))
        return !1;
    } else if (!hv(t.queryKey, s))
      return !1;
  }
  if (r !== "all") {
    const i = t.isActive();
    if (r === "active" && !i || r === "inactive" && i)
      return !1;
  }
  return !(typeof c == "boolean" && t.isStale() !== c || typeof a < "u" && a !== t.state.fetchStatus || u && !u(t));
}
function AD(e, t) {
  const {
    exact: r,
    fetching: n,
    predicate: a,
    mutationKey: u
  } = e;
  if (M1(u)) {
    if (!t.options.mutationKey)
      return !1;
    if (r) {
      if (Fh(t.options.mutationKey) !== Fh(u))
        return !1;
    } else if (!hv(t.options.mutationKey, u))
      return !1;
  }
  return !(typeof n == "boolean" && t.state.status === "loading" !== n || a && !a(t));
}
function _T(e, t) {
  return ((t == null ? void 0 : t.queryKeyHashFn) || Fh)(e);
}
function Fh(e) {
  return JSON.stringify(e, (t, r) => Wx(r) ? Object.keys(r).sort().reduce((n, a) => (n[a] = r[a], n), {}) : r);
}
function hv(e, t) {
  return eP(e, t);
}
function eP(e, t) {
  return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((r) => !eP(e[r], t[r])) : !1;
}
function tP(e, t) {
  if (e === t)
    return e;
  const r = ED(e) && ED(t);
  if (r || Wx(e) && Wx(t)) {
    const n = r ? e.length : Object.keys(e).length, a = r ? t : Object.keys(t), u = a.length, s = r ? [] : {};
    let c = 0;
    for (let i = 0; i < u; i++) {
      const l = r ? i : a[i];
      s[l] = tP(e[l], t[l]), s[l] === e[l] && c++;
    }
    return n === u && c === n ? e : s;
  }
  return t;
}
function zx(e, t) {
  if (e && !t || t && !e)
    return !1;
  for (const r in e)
    if (e[r] !== t[r])
      return !1;
  return !0;
}
function ED(e) {
  return Array.isArray(e) && e.length === Object.keys(e).length;
}
function Wx(e) {
  if (!MD(e))
    return !1;
  const t = e.constructor;
  if (typeof t > "u")
    return !0;
  const r = t.prototype;
  return !(!MD(r) || !r.hasOwnProperty("isPrototypeOf"));
}
function MD(e) {
  return Object.prototype.toString.call(e) === "[object Object]";
}
function M1(e) {
  return Array.isArray(e);
}
function rP(e) {
  return new Promise((t) => {
    setTimeout(t, e);
  });
}
function DD(e) {
  rP(0).then(e);
}
function BG() {
  if (typeof AbortController == "function")
    return new AbortController();
}
function _x(e, t, r) {
  return r.isDataEqual != null && r.isDataEqual(e, t) ? e : typeof r.structuralSharing == "function" ? r.structuralSharing(e, t) : r.structuralSharing !== !1 ? tP(e, t) : t;
}
class VG extends Xm {
  constructor() {
    super(), this.setup = (t) => {
      if (!Im && window.addEventListener) {
        const r = () => t();
        return window.addEventListener("visibilitychange", r, !1), window.addEventListener("focus", r, !1), () => {
          window.removeEventListener("visibilitychange", r), window.removeEventListener("focus", r);
        };
      }
    };
  }
  onSubscribe() {
    this.cleanup || this.setEventListener(this.setup);
  }
  onUnsubscribe() {
    if (!this.hasListeners()) {
      var t;
      (t = this.cleanup) == null || t.call(this), this.cleanup = void 0;
    }
  }
  setEventListener(t) {
    var r;
    this.setup = t, (r = this.cleanup) == null || r.call(this), this.cleanup = t((n) => {
      typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
    });
  }
  setFocused(t) {
    this.focused !== t && (this.focused = t, this.onFocus());
  }
  onFocus() {
    this.listeners.forEach(({
      listener: t
    }) => {
      t();
    });
  }
  isFocused() {
    return typeof this.focused == "boolean" ? this.focused : typeof document > "u" ? !0 : [void 0, "visible", "prerender"].includes(document.visibilityState);
  }
}
const zC = new VG(), FD = ["online", "offline"];
class zG extends Xm {
  constructor() {
    super(), this.setup = (t) => {
      if (!Im && window.addEventListener) {
        const r = () => t();
        return FD.forEach((n) => {
          window.addEventListener(n, r, !1);
        }), () => {
          FD.forEach((n) => {
            window.removeEventListener(n, r);
          });
        };
      }
    };
  }
  onSubscribe() {
    this.cleanup || this.setEventListener(this.setup);
  }
  onUnsubscribe() {
    if (!this.hasListeners()) {
      var t;
      (t = this.cleanup) == null || t.call(this), this.cleanup = void 0;
    }
  }
  setEventListener(t) {
    var r;
    this.setup = t, (r = this.cleanup) == null || r.call(this), this.cleanup = t((n) => {
      typeof n == "boolean" ? this.setOnline(n) : this.onOnline();
    });
  }
  setOnline(t) {
    this.online !== t && (this.online = t, this.onOnline());
  }
  onOnline() {
    this.listeners.forEach(({
      listener: t
    }) => {
      t();
    });
  }
  isOnline() {
    return typeof this.online == "boolean" ? this.online : typeof navigator > "u" || typeof navigator.onLine > "u" ? !0 : navigator.onLine;
  }
}
const WC = new zG();
function WG(e) {
  return Math.min(1e3 * 2 ** e, 3e4);
}
function D1(e) {
  return (e ?? "online") === "online" ? WC.isOnline() : !0;
}
class nP {
  constructor(t) {
    this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
  }
}
function RC(e) {
  return e instanceof nP;
}
function iP(e) {
  let t = !1, r = 0, n = !1, a, u, s;
  const c = new Promise((m, h) => {
    u = m, s = h;
  }), i = (m) => {
    n || (g(new nP(m)), e.abort == null || e.abort());
  }, l = () => {
    t = !0;
  }, v = () => {
    t = !1;
  }, f = () => !zC.isFocused() || e.networkMode !== "always" && !WC.isOnline(), p = (m) => {
    n || (n = !0, e.onSuccess == null || e.onSuccess(m), a == null || a(), u(m));
  }, g = (m) => {
    n || (n = !0, e.onError == null || e.onError(m), a == null || a(), s(m));
  }, y = () => new Promise((m) => {
    a = (h) => {
      const w = n || !f();
      return w && m(h), w;
    }, e.onPause == null || e.onPause();
  }).then(() => {
    a = void 0, n || e.onContinue == null || e.onContinue();
  }), C = () => {
    if (n)
      return;
    let m;
    try {
      m = e.fn();
    } catch (h) {
      m = Promise.reject(h);
    }
    Promise.resolve(m).then(p).catch((h) => {
      var w, S;
      if (n)
        return;
      const E = (w = e.retry) != null ? w : 3, x = (S = e.retryDelay) != null ? S : WG, T = typeof x == "function" ? x(r, h) : x, F = E === !0 || typeof E == "number" && r < E || typeof E == "function" && E(r, h);
      if (t || !F) {
        g(h);
        return;
      }
      r++, e.onFail == null || e.onFail(r, h), rP(T).then(() => {
        if (f())
          return y();
      }).then(() => {
        t ? g(h) : C();
      });
    });
  };
  return D1(e.networkMode) ? C() : y().then(C), {
    promise: c,
    cancel: i,
    continue: () => (a == null ? void 0 : a()) ? c : Promise.resolve(),
    cancelRetry: l,
    continueRetry: v
  };
}
const UT = console;
function _G() {
  let e = [], t = 0, r = (v) => {
    v();
  }, n = (v) => {
    v();
  };
  const a = (v) => {
    let f;
    t++;
    try {
      f = v();
    } finally {
      t--, t || c();
    }
    return f;
  }, u = (v) => {
    t ? e.push(v) : DD(() => {
      r(v);
    });
  }, s = (v) => (...f) => {
    u(() => {
      v(...f);
    });
  }, c = () => {
    const v = e;
    e = [], v.length && DD(() => {
      n(() => {
        v.forEach((f) => {
          r(f);
        });
      });
    });
  };
  return {
    batch: a,
    batchCalls: s,
    schedule: u,
    setNotifyFunction: (v) => {
      r = v;
    },
    setBatchNotifyFunction: (v) => {
      n = v;
    }
  };
}
const Ka = _G();
class aP {
  destroy() {
    this.clearGcTimeout();
  }
  scheduleGc() {
    this.clearGcTimeout(), Vx(this.cacheTime) && (this.gcTimeout = setTimeout(() => {
      this.optionalRemove();
    }, this.cacheTime));
  }
  updateCacheTime(t) {
    this.cacheTime = Math.max(this.cacheTime || 0, t ?? (Im ? 1 / 0 : 5 * 60 * 1e3));
  }
  clearGcTimeout() {
    this.gcTimeout && (clearTimeout(this.gcTimeout), this.gcTimeout = void 0);
  }
}
class UG extends aP {
  constructor(t) {
    super(), this.abortSignalConsumed = !1, this.defaultOptions = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.cache = t.cache, this.logger = t.logger || UT, this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.initialState = t.state || jG(this.options), this.state = this.initialState, this.scheduleGc();
  }
  get meta() {
    return this.options.meta;
  }
  setOptions(t) {
    this.options = {
      ...this.defaultOptions,
      ...t
    }, this.updateCacheTime(this.options.cacheTime);
  }
  optionalRemove() {
    !this.observers.length && this.state.fetchStatus === "idle" && this.cache.remove(this);
  }
  setData(t, r) {
    const n = _x(this.state.data, t, this.options);
    return this.dispatch({
      data: n,
      type: "success",
      dataUpdatedAt: r == null ? void 0 : r.updatedAt,
      manual: r == null ? void 0 : r.manual
    }), n;
  }
  setState(t, r) {
    this.dispatch({
      type: "setState",
      state: t,
      setStateOptions: r
    });
  }
  cancel(t) {
    var r;
    const n = this.promise;
    return (r = this.retryer) == null || r.cancel(t), n ? n.then(Ol).catch(Ol) : Promise.resolve();
  }
  destroy() {
    super.destroy(), this.cancel({
      silent: !0
    });
  }
  reset() {
    this.destroy(), this.setState(this.initialState);
  }
  isActive() {
    return this.observers.some((t) => t.options.enabled !== !1);
  }
  isDisabled() {
    return this.getObserversCount() > 0 && !this.isActive();
  }
  isStale() {
    return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some((t) => t.getCurrentResult().isStale);
  }
  isStaleByTime(t = 0) {
    return this.state.isInvalidated || !this.state.dataUpdatedAt || !qF(this.state.dataUpdatedAt, t);
  }
  onFocus() {
    var t;
    const r = this.observers.find((n) => n.shouldFetchOnWindowFocus());
    r && r.refetch({
      cancelRefetch: !1
    }), (t = this.retryer) == null || t.continue();
  }
  onOnline() {
    var t;
    const r = this.observers.find((n) => n.shouldFetchOnReconnect());
    r && r.refetch({
      cancelRefetch: !1
    }), (t = this.retryer) == null || t.continue();
  }
  addObserver(t) {
    this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.cache.notify({
      type: "observerAdded",
      query: this,
      observer: t
    }));
  }
  removeObserver(t) {
    this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (this.retryer && (this.abortSignalConsumed ? this.retryer.cancel({
      revert: !0
    }) : this.retryer.cancelRetry()), this.scheduleGc()), this.cache.notify({
      type: "observerRemoved",
      query: this,
      observer: t
    }));
  }
  getObserversCount() {
    return this.observers.length;
  }
  invalidate() {
    this.state.isInvalidated || this.dispatch({
      type: "invalidate"
    });
  }
  fetch(t, r) {
    var n, a;
    if (this.state.fetchStatus !== "idle") {
      if (this.state.dataUpdatedAt && r != null && r.cancelRefetch)
        this.cancel({
          silent: !0
        });
      else if (this.promise) {
        var u;
        return (u = this.retryer) == null || u.continueRetry(), this.promise;
      }
    }
    if (t && this.setOptions(t), !this.options.queryFn) {
      const g = this.observers.find((y) => y.options.queryFn);
      g && this.setOptions(g.options);
    }
     true && (Array.isArray(this.options.queryKey) || this.logger.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));
    const s = BG(), c = {
      queryKey: this.queryKey,
      pageParam: void 0,
      meta: this.meta
    }, i = (g) => {
      Object.defineProperty(g, "signal", {
        enumerable: !0,
        get: () => {
          if (s)
            return this.abortSignalConsumed = !0, s.signal;
        }
      });
    };
    i(c);
    const l = () => this.options.queryFn ? (this.abortSignalConsumed = !1, this.options.queryFn(c)) : Promise.reject("Missing queryFn for queryKey '" + this.options.queryHash + "'"), v = {
      fetchOptions: r,
      options: this.options,
      queryKey: this.queryKey,
      state: this.state,
      fetchFn: l
    };
    if (i(v), (n = this.options.behavior) == null || n.onFetch(v), this.revertState = this.state, this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((a = v.fetchOptions) == null ? void 0 : a.meta)) {
      var f;
      this.dispatch({
        type: "fetch",
        meta: (f = v.fetchOptions) == null ? void 0 : f.meta
      });
    }
    const p = (g) => {
      if (RC(g) && g.silent || this.dispatch({
        type: "error",
        error: g
      }), !RC(g)) {
        var y, C, m, h;
        (y = (C = this.cache.config).onError) == null || y.call(C, g, this), (m = (h = this.cache.config).onSettled) == null || m.call(h, this.state.data, g, this),  true && this.logger.error(g);
      }
      this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
    };
    return this.retryer = iP({
      fn: v.fetchFn,
      abort: s == null ? void 0 : s.abort.bind(s),
      onSuccess: (g) => {
        var y, C, m, h;
        if (typeof g > "u") {
           true && this.logger.error("Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: " + this.queryHash), p(new Error(this.queryHash + " data is undefined"));
          return;
        }
        this.setData(g), (y = (C = this.cache.config).onSuccess) == null || y.call(C, g, this), (m = (h = this.cache.config).onSettled) == null || m.call(h, g, this.state.error, this), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
      },
      onError: p,
      onFail: (g, y) => {
        this.dispatch({
          type: "failed",
          failureCount: g,
          error: y
        });
      },
      onPause: () => {
        this.dispatch({
          type: "pause"
        });
      },
      onContinue: () => {
        this.dispatch({
          type: "continue"
        });
      },
      retry: v.options.retry,
      retryDelay: v.options.retryDelay,
      networkMode: v.options.networkMode
    }), this.promise = this.retryer.promise, this.promise;
  }
  dispatch(t) {
    const r = (n) => {
      var a, u;
      switch (t.type) {
        case "failed":
          return {
            ...n,
            fetchFailureCount: t.failureCount,
            fetchFailureReason: t.error
          };
        case "pause":
          return {
            ...n,
            fetchStatus: "paused"
          };
        case "continue":
          return {
            ...n,
            fetchStatus: "fetching"
          };
        case "fetch":
          return {
            ...n,
            fetchFailureCount: 0,
            fetchFailureReason: null,
            fetchMeta: (a = t.meta) != null ? a : null,
            fetchStatus: D1(this.options.networkMode) ? "fetching" : "paused",
            ...!n.dataUpdatedAt && {
              error: null,
              status: "loading"
            }
          };
        case "success":
          return {
            ...n,
            data: t.data,
            dataUpdateCount: n.dataUpdateCount + 1,
            dataUpdatedAt: (u = t.dataUpdatedAt) != null ? u : Date.now(),
            error: null,
            isInvalidated: !1,
            status: "success",
            ...!t.manual && {
              fetchStatus: "idle",
              fetchFailureCount: 0,
              fetchFailureReason: null
            }
          };
        case "error":
          const s = t.error;
          return RC(s) && s.revert && this.revertState ? {
            ...this.revertState,
            fetchStatus: "idle"
          } : {
            ...n,
            error: s,
            errorUpdateCount: n.errorUpdateCount + 1,
            errorUpdatedAt: Date.now(),
            fetchFailureCount: n.fetchFailureCount + 1,
            fetchFailureReason: s,
            fetchStatus: "idle",
            status: "error"
          };
        case "invalidate":
          return {
            ...n,
            isInvalidated: !0
          };
        case "setState":
          return {
            ...n,
            ...t.state
          };
      }
    };
    this.state = r(this.state), Ka.batch(() => {
      this.observers.forEach((n) => {
        n.onQueryUpdate(t);
      }), this.cache.notify({
        query: this,
        type: "updated",
        action: t
      });
    });
  }
}
function jG(e) {
  const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, r = typeof t < "u", n = r ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
  return {
    data: t,
    dataUpdateCount: 0,
    dataUpdatedAt: r ? n ?? Date.now() : 0,
    error: null,
    errorUpdateCount: 0,
    errorUpdatedAt: 0,
    fetchFailureCount: 0,
    fetchFailureReason: null,
    fetchMeta: null,
    isInvalidated: !1,
    status: r ? "success" : "loading",
    fetchStatus: "idle"
  };
}
class YG extends Xm {
  constructor(t) {
    super(), this.config = t || {}, this.queries = [], this.queriesMap = {};
  }
  build(t, r, n) {
    var a;
    const u = r.queryKey, s = (a = r.queryHash) != null ? a : _T(u, r);
    let c = this.get(s);
    return c || (c = new UG({
      cache: this,
      logger: t.getLogger(),
      queryKey: u,
      queryHash: s,
      options: t.defaultQueryOptions(r),
      state: n,
      defaultOptions: t.getQueryDefaults(u)
    }), this.add(c)), c;
  }
  add(t) {
    this.queriesMap[t.queryHash] || (this.queriesMap[t.queryHash] = t, this.queries.push(t), this.notify({
      type: "added",
      query: t
    }));
  }
  remove(t) {
    const r = this.queriesMap[t.queryHash];
    r && (t.destroy(), this.queries = this.queries.filter((n) => n !== t), r === t && delete this.queriesMap[t.queryHash], this.notify({
      type: "removed",
      query: t
    }));
  }
  clear() {
    Ka.batch(() => {
      this.queries.forEach((t) => {
        this.remove(t);
      });
    });
  }
  get(t) {
    return this.queriesMap[t];
  }
  getAll() {
    return this.queries;
  }
  find(t, r) {
    const [n] = Jd(t, r);
    return typeof n.exact > "u" && (n.exact = !0), this.queries.find((a) => RD(n, a));
  }
  findAll(t, r) {
    const [n] = Jd(t, r);
    return Object.keys(n).length > 0 ? this.queries.filter((a) => RD(n, a)) : this.queries;
  }
  notify(t) {
    Ka.batch(() => {
      this.listeners.forEach(({
        listener: r
      }) => {
        r(t);
      });
    });
  }
  onFocus() {
    Ka.batch(() => {
      this.queries.forEach((t) => {
        t.onFocus();
      });
    });
  }
  onOnline() {
    Ka.batch(() => {
      this.queries.forEach((t) => {
        t.onOnline();
      });
    });
  }
}
class XG extends aP {
  constructor(t) {
    super(), this.defaultOptions = t.defaultOptions, this.mutationId = t.mutationId, this.mutationCache = t.mutationCache, this.logger = t.logger || UT, this.observers = [], this.state = t.state || $G(), this.setOptions(t.options), this.scheduleGc();
  }
  setOptions(t) {
    this.options = {
      ...this.defaultOptions,
      ...t
    }, this.updateCacheTime(this.options.cacheTime);
  }
  get meta() {
    return this.options.meta;
  }
  setState(t) {
    this.dispatch({
      type: "setState",
      state: t
    });
  }
  addObserver(t) {
    this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.mutationCache.notify({
      type: "observerAdded",
      mutation: this,
      observer: t
    }));
  }
  removeObserver(t) {
    this.observers = this.observers.filter((r) => r !== t), this.scheduleGc(), this.mutationCache.notify({
      type: "observerRemoved",
      mutation: this,
      observer: t
    });
  }
  optionalRemove() {
    this.observers.length || (this.state.status === "loading" ? this.scheduleGc() : this.mutationCache.remove(this));
  }
  continue() {
    var t, r;
    return (t = (r = this.retryer) == null ? void 0 : r.continue()) != null ? t : this.execute();
  }
  async execute() {
    const t = () => {
      var F;
      return this.retryer = iP({
        fn: () => this.options.mutationFn ? this.options.mutationFn(this.state.variables) : Promise.reject("No mutationFn found"),
        onFail: (P, k) => {
          this.dispatch({
            type: "failed",
            failureCount: P,
            error: k
          });
        },
        onPause: () => {
          this.dispatch({
            type: "pause"
          });
        },
        onContinue: () => {
          this.dispatch({
            type: "continue"
          });
        },
        retry: (F = this.options.retry) != null ? F : 0,
        retryDelay: this.options.retryDelay,
        networkMode: this.options.networkMode
      }), this.retryer.promise;
    }, r = this.state.status === "loading";
    try {
      var n, a, u, s, c, i, l, v;
      if (!r) {
        var f, p, g, y;
        this.dispatch({
          type: "loading",
          variables: this.options.variables
        }), await ((f = (p = this.mutationCache.config).onMutate) == null ? void 0 : f.call(p, this.state.variables, this));
        const P = await ((g = (y = this.options).onMutate) == null ? void 0 : g.call(y, this.state.variables));
        P !== this.state.context && this.dispatch({
          type: "loading",
          context: P,
          variables: this.state.variables
        });
      }
      const F = await t();
      return await ((n = (a = this.mutationCache.config).onSuccess) == null ? void 0 : n.call(a, F, this.state.variables, this.state.context, this)), await ((u = (s = this.options).onSuccess) == null ? void 0 : u.call(s, F, this.state.variables, this.state.context)), await ((c = (i = this.mutationCache.config).onSettled) == null ? void 0 : c.call(i, F, null, this.state.variables, this.state.context, this)), await ((l = (v = this.options).onSettled) == null ? void 0 : l.call(v, F, null, this.state.variables, this.state.context)), this.dispatch({
        type: "success",
        data: F
      }), F;
    } catch (F) {
      try {
        var C, m, h, w, S, E, x, T;
        throw await ((C = (m = this.mutationCache.config).onError) == null ? void 0 : C.call(m, F, this.state.variables, this.state.context, this)),  true && this.logger.error(F), await ((h = (w = this.options).onError) == null ? void 0 : h.call(w, F, this.state.variables, this.state.context)), await ((S = (E = this.mutationCache.config).onSettled) == null ? void 0 : S.call(E, void 0, F, this.state.variables, this.state.context, this)), await ((x = (T = this.options).onSettled) == null ? void 0 : x.call(T, void 0, F, this.state.variables, this.state.context)), F;
      } finally {
        this.dispatch({
          type: "error",
          error: F
        });
      }
    }
  }
  dispatch(t) {
    const r = (n) => {
      switch (t.type) {
        case "failed":
          return {
            ...n,
            failureCount: t.failureCount,
            failureReason: t.error
          };
        case "pause":
          return {
            ...n,
            isPaused: !0
          };
        case "continue":
          return {
            ...n,
            isPaused: !1
          };
        case "loading":
          return {
            ...n,
            context: t.context,
            data: void 0,
            failureCount: 0,
            failureReason: null,
            error: null,
            isPaused: !D1(this.options.networkMode),
            status: "loading",
            variables: t.variables
          };
        case "success":
          return {
            ...n,
            data: t.data,
            failureCount: 0,
            failureReason: null,
            error: null,
            status: "success",
            isPaused: !1
          };
        case "error":
          return {
            ...n,
            data: void 0,
            error: t.error,
            failureCount: n.failureCount + 1,
            failureReason: t.error,
            isPaused: !1,
            status: "error"
          };
        case "setState":
          return {
            ...n,
            ...t.state
          };
      }
    };
    this.state = r(this.state), Ka.batch(() => {
      this.observers.forEach((n) => {
        n.onMutationUpdate(t);
      }), this.mutationCache.notify({
        mutation: this,
        type: "updated",
        action: t
      });
    });
  }
}
function $G() {
  return {
    context: void 0,
    data: void 0,
    error: null,
    failureCount: 0,
    failureReason: null,
    isPaused: !1,
    status: "idle",
    variables: void 0
  };
}
class ZG extends Xm {
  constructor(t) {
    super(), this.config = t || {}, this.mutations = [], this.mutationId = 0;
  }
  build(t, r, n) {
    const a = new XG({
      mutationCache: this,
      logger: t.getLogger(),
      mutationId: ++this.mutationId,
      options: t.defaultMutationOptions(r),
      state: n,
      defaultOptions: r.mutationKey ? t.getMutationDefaults(r.mutationKey) : void 0
    });
    return this.add(a), a;
  }
  add(t) {
    this.mutations.push(t), this.notify({
      type: "added",
      mutation: t
    });
  }
  remove(t) {
    this.mutations = this.mutations.filter((r) => r !== t), this.notify({
      type: "removed",
      mutation: t
    });
  }
  clear() {
    Ka.batch(() => {
      this.mutations.forEach((t) => {
        this.remove(t);
      });
    });
  }
  getAll() {
    return this.mutations;
  }
  find(t) {
    return typeof t.exact > "u" && (t.exact = !0), this.mutations.find((r) => AD(t, r));
  }
  findAll(t) {
    return this.mutations.filter((r) => AD(t, r));
  }
  notify(t) {
    Ka.batch(() => {
      this.listeners.forEach(({
        listener: r
      }) => {
        r(t);
      });
    });
  }
  resumePausedMutations() {
    var t;
    return this.resuming = ((t = this.resuming) != null ? t : Promise.resolve()).then(() => {
      const r = this.mutations.filter((n) => n.state.isPaused);
      return Ka.batch(() => r.reduce((n, a) => n.then(() => a.continue().catch(Ol)), Promise.resolve()));
    }).then(() => {
      this.resuming = void 0;
    }), this.resuming;
  }
}
function KG() {
  return {
    onFetch: (e) => {
      e.fetchFn = () => {
        var t, r, n, a, u, s;
        const c = (t = e.fetchOptions) == null || (r = t.meta) == null ? void 0 : r.refetchPage, i = (n = e.fetchOptions) == null || (a = n.meta) == null ? void 0 : a.fetchMore, l = i == null ? void 0 : i.pageParam, v = (i == null ? void 0 : i.direction) === "forward", f = (i == null ? void 0 : i.direction) === "backward", p = ((u = e.state.data) == null ? void 0 : u.pages) || [], g = ((s = e.state.data) == null ? void 0 : s.pageParams) || [];
        let y = g, C = !1;
        const m = (T) => {
          Object.defineProperty(T, "signal", {
            enumerable: !0,
            get: () => {
              var F;
              if ((F = e.signal) != null && F.aborted)
                C = !0;
              else {
                var P;
                (P = e.signal) == null || P.addEventListener("abort", () => {
                  C = !0;
                });
              }
              return e.signal;
            }
          });
        }, h = e.options.queryFn || (() => Promise.reject("Missing queryFn for queryKey '" + e.options.queryHash + "'")), w = (T, F, P, k) => (y = k ? [F, ...y] : [...y, F], k ? [P, ...T] : [...T, P]), S = (T, F, P, k) => {
          if (C)
            return Promise.reject("Cancelled");
          if (typeof P > "u" && !F && T.length)
            return Promise.resolve(T);
          const I = {
            queryKey: e.queryKey,
            pageParam: P,
            meta: e.options.meta
          };
          m(I);
          const L = h(I);
          return Promise.resolve(L).then((O) => w(T, P, O, k));
        };
        let E;
        if (!p.length)
          E = S([]);
        else if (v) {
          const T = typeof l < "u", F = T ? l : PD(e.options, p);
          E = S(p, T, F);
        } else if (f) {
          const T = typeof l < "u", F = T ? l : JG(e.options, p);
          E = S(p, T, F, !0);
        } else {
          y = [];
          const T = typeof e.options.getNextPageParam > "u";
          E = (c && p[0] ? c(p[0], 0, p) : !0) ? S([], T, g[0]) : Promise.resolve(w([], g[0], p[0]));
          for (let P = 1; P < p.length; P++)
            E = E.then((k) => {
              if (c && p[P] ? c(p[P], P, p) : !0) {
                const L = T ? g[P] : PD(e.options, k);
                return S(k, T, L);
              }
              return Promise.resolve(w(k, g[P], p[P]));
            });
        }
        return E.then((T) => ({
          pages: T,
          pageParams: y
        }));
      };
    }
  };
}
function PD(e, t) {
  return e.getNextPageParam == null ? void 0 : e.getNextPageParam(t[t.length - 1], t);
}
function JG(e, t) {
  return e.getPreviousPageParam == null ? void 0 : e.getPreviousPageParam(t[0], t);
}
class QG {
  constructor(t = {}) {
    this.queryCache = t.queryCache || new YG(), this.mutationCache = t.mutationCache || new ZG(), this.logger = t.logger || UT, this.defaultOptions = t.defaultOptions || {}, this.queryDefaults = [], this.mutationDefaults = [], this.mountCount = 0,  true && t.logger && this.logger.error("Passing a custom logger has been deprecated and will be removed in the next major version.");
  }
  mount() {
    this.mountCount++, this.mountCount === 1 && (this.unsubscribeFocus = zC.subscribe(() => {
      zC.isFocused() && (this.resumePausedMutations(), this.queryCache.onFocus());
    }), this.unsubscribeOnline = WC.subscribe(() => {
      WC.isOnline() && (this.resumePausedMutations(), this.queryCache.onOnline());
    }));
  }
  unmount() {
    var t, r;
    this.mountCount--, this.mountCount === 0 && ((t = this.unsubscribeFocus) == null || t.call(this), this.unsubscribeFocus = void 0, (r = this.unsubscribeOnline) == null || r.call(this), this.unsubscribeOnline = void 0);
  }
  isFetching(t, r) {
    const [n] = Jd(t, r);
    return n.fetchStatus = "fetching", this.queryCache.findAll(n).length;
  }
  isMutating(t) {
    return this.mutationCache.findAll({
      ...t,
      fetching: !0
    }).length;
  }
  getQueryData(t, r) {
    var n;
    return (n = this.queryCache.find(t, r)) == null ? void 0 : n.state.data;
  }
  ensureQueryData(t, r, n) {
    const a = gm(t, r, n), u = this.getQueryData(a.queryKey);
    return u ? Promise.resolve(u) : this.fetchQuery(a);
  }
  getQueriesData(t) {
    return this.getQueryCache().findAll(t).map(({
      queryKey: r,
      state: n
    }) => {
      const a = n.data;
      return [r, a];
    });
  }
  setQueryData(t, r, n) {
    const a = this.queryCache.find(t), u = a == null ? void 0 : a.state.data, s = HG(r, u);
    if (typeof s > "u")
      return;
    const c = gm(t), i = this.defaultQueryOptions(c);
    return this.queryCache.build(this, i).setData(s, {
      ...n,
      manual: !0
    });
  }
  setQueriesData(t, r, n) {
    return Ka.batch(() => this.getQueryCache().findAll(t).map(({
      queryKey: a
    }) => [a, this.setQueryData(a, r, n)]));
  }
  getQueryState(t, r) {
    var n;
    return (n = this.queryCache.find(t, r)) == null ? void 0 : n.state;
  }
  removeQueries(t, r) {
    const [n] = Jd(t, r), a = this.queryCache;
    Ka.batch(() => {
      a.findAll(n).forEach((u) => {
        a.remove(u);
      });
    });
  }
  resetQueries(t, r, n) {
    const [a, u] = Jd(t, r, n), s = this.queryCache, c = {
      type: "active",
      ...a
    };
    return Ka.batch(() => (s.findAll(a).forEach((i) => {
      i.reset();
    }), this.refetchQueries(c, u)));
  }
  cancelQueries(t, r, n) {
    const [a, u = {}] = Jd(t, r, n);
    typeof u.revert > "u" && (u.revert = !0);
    const s = Ka.batch(() => this.queryCache.findAll(a).map((c) => c.cancel(u)));
    return Promise.all(s).then(Ol).catch(Ol);
  }
  invalidateQueries(t, r, n) {
    const [a, u] = Jd(t, r, n);
    return Ka.batch(() => {
      var s, c;
      if (this.queryCache.findAll(a).forEach((l) => {
        l.invalidate();
      }), a.refetchType === "none")
        return Promise.resolve();
      const i = {
        ...a,
        type: (s = (c = a.refetchType) != null ? c : a.type) != null ? s : "active"
      };
      return this.refetchQueries(i, u);
    });
  }
  refetchQueries(t, r, n) {
    const [a, u] = Jd(t, r, n), s = Ka.batch(() => this.queryCache.findAll(a).filter((i) => !i.isDisabled()).map((i) => {
      var l;
      return i.fetch(void 0, {
        ...u,
        cancelRefetch: (l = u == null ? void 0 : u.cancelRefetch) != null ? l : !0,
        meta: {
          refetchPage: a.refetchPage
        }
      });
    }));
    let c = Promise.all(s).then(Ol);
    return u != null && u.throwOnError || (c = c.catch(Ol)), c;
  }
  fetchQuery(t, r, n) {
    const a = gm(t, r, n), u = this.defaultQueryOptions(a);
    typeof u.retry > "u" && (u.retry = !1);
    const s = this.queryCache.build(this, u);
    return s.isStaleByTime(u.staleTime) ? s.fetch(u) : Promise.resolve(s.state.data);
  }
  prefetchQuery(t, r, n) {
    return this.fetchQuery(t, r, n).then(Ol).catch(Ol);
  }
  fetchInfiniteQuery(t, r, n) {
    const a = gm(t, r, n);
    return a.behavior = KG(), this.fetchQuery(a);
  }
  prefetchInfiniteQuery(t, r, n) {
    return this.fetchInfiniteQuery(t, r, n).then(Ol).catch(Ol);
  }
  resumePausedMutations() {
    return this.mutationCache.resumePausedMutations();
  }
  getQueryCache() {
    return this.queryCache;
  }
  getMutationCache() {
    return this.mutationCache;
  }
  getLogger() {
    return this.logger;
  }
  getDefaultOptions() {
    return this.defaultOptions;
  }
  setDefaultOptions(t) {
    this.defaultOptions = t;
  }
  setQueryDefaults(t, r) {
    const n = this.queryDefaults.find((a) => Fh(t) === Fh(a.queryKey));
    n ? n.defaultOptions = r : this.queryDefaults.push({
      queryKey: t,
      defaultOptions: r
    });
  }
  getQueryDefaults(t) {
    if (!t)
      return;
    const r = this.queryDefaults.find((n) => hv(t, n.queryKey));
    return  true && this.queryDefaults.filter((a) => hv(t, a.queryKey)).length > 1 && this.logger.error("[QueryClient] Several query defaults match with key '" + JSON.stringify(t) + "'. The first matching query defaults are used. Please check how query defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydefaults."), r == null ? void 0 : r.defaultOptions;
  }
  setMutationDefaults(t, r) {
    const n = this.mutationDefaults.find((a) => Fh(t) === Fh(a.mutationKey));
    n ? n.defaultOptions = r : this.mutationDefaults.push({
      mutationKey: t,
      defaultOptions: r
    });
  }
  getMutationDefaults(t) {
    if (!t)
      return;
    const r = this.mutationDefaults.find((n) => hv(t, n.mutationKey));
    return  true && this.mutationDefaults.filter((a) => hv(t, a.mutationKey)).length > 1 && this.logger.error("[QueryClient] Several mutation defaults match with key '" + JSON.stringify(t) + "'. The first matching mutation defaults are used. Please check how mutation defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetmutationdefaults."), r == null ? void 0 : r.defaultOptions;
  }
  defaultQueryOptions(t) {
    if (t != null && t._defaulted)
      return t;
    const r = {
      ...this.defaultOptions.queries,
      ...this.getQueryDefaults(t == null ? void 0 : t.queryKey),
      ...t,
      _defaulted: !0
    };
    return !r.queryHash && r.queryKey && (r.queryHash = _T(r.queryKey, r)), typeof r.refetchOnReconnect > "u" && (r.refetchOnReconnect = r.networkMode !== "always"), typeof r.useErrorBoundary > "u" && (r.useErrorBoundary = !!r.suspense), r;
  }
  defaultMutationOptions(t) {
    return t != null && t._defaulted ? t : {
      ...this.defaultOptions.mutations,
      ...this.getMutationDefaults(t == null ? void 0 : t.mutationKey),
      ...t,
      _defaulted: !0
    };
  }
  clear() {
    this.queryCache.clear(), this.mutationCache.clear();
  }
}
class qG extends Xm {
  constructor(t, r) {
    super(), this.client = t, this.options = r, this.trackedProps = /* @__PURE__ */ new Set(), this.selectError = null, this.bindMethods(), this.setOptions(r);
  }
  bindMethods() {
    this.remove = this.remove.bind(this), this.refetch = this.refetch.bind(this);
  }
  onSubscribe() {
    this.listeners.size === 1 && (this.currentQuery.addObserver(this), ID(this.currentQuery, this.options) && this.executeFetch(), this.updateTimers());
  }
  onUnsubscribe() {
    this.hasListeners() || this.destroy();
  }
  shouldFetchOnReconnect() {
    return Ux(this.currentQuery, this.options, this.options.refetchOnReconnect);
  }
  shouldFetchOnWindowFocus() {
    return Ux(this.currentQuery, this.options, this.options.refetchOnWindowFocus);
  }
  destroy() {
    this.listeners = /* @__PURE__ */ new Set(), this.clearStaleTimeout(), this.clearRefetchInterval(), this.currentQuery.removeObserver(this);
  }
  setOptions(t, r) {
    const n = this.options, a = this.currentQuery;
    if (this.options = this.client.defaultQueryOptions(t),  true && typeof (t == null ? void 0 : t.isDataEqual) < "u" && this.client.getLogger().error("The isDataEqual option has been deprecated and will be removed in the next major version. You can achieve the same functionality by passing a function as the structuralSharing option"), zx(n, this.options) || this.client.getQueryCache().notify({
      type: "observerOptionsUpdated",
      query: this.currentQuery,
      observer: this
    }), typeof this.options.enabled < "u" && typeof this.options.enabled != "boolean")
      throw new Error("Expected enabled to be a boolean");
    this.options.queryKey || (this.options.queryKey = n.queryKey), this.updateQuery();
    const u = this.hasListeners();
    u && LD(this.currentQuery, a, this.options, n) && this.executeFetch(), this.updateResult(r), u && (this.currentQuery !== a || this.options.enabled !== n.enabled || this.options.staleTime !== n.staleTime) && this.updateStaleTimeout();
    const s = this.computeRefetchInterval();
    u && (this.currentQuery !== a || this.options.enabled !== n.enabled || s !== this.currentRefetchInterval) && this.updateRefetchInterval(s);
  }
  getOptimisticResult(t) {
    const r = this.client.getQueryCache().build(this.client, t), n = this.createResult(r, t);
    return t8(this, n, t) && (this.currentResult = n, this.currentResultOptions = this.options, this.currentResultState = this.currentQuery.state), n;
  }
  getCurrentResult() {
    return this.currentResult;
  }
  trackResult(t) {
    const r = {};
    return Object.keys(t).forEach((n) => {
      Object.defineProperty(r, n, {
        configurable: !1,
        enumerable: !0,
        get: () => (this.trackedProps.add(n), t[n])
      });
    }), r;
  }
  getCurrentQuery() {
    return this.currentQuery;
  }
  remove() {
    this.client.getQueryCache().remove(this.currentQuery);
  }
  refetch({
    refetchPage: t,
    ...r
  } = {}) {
    return this.fetch({
      ...r,
      meta: {
        refetchPage: t
      }
    });
  }
  fetchOptimistic(t) {
    const r = this.client.defaultQueryOptions(t), n = this.client.getQueryCache().build(this.client, r);
    return n.isFetchingOptimistic = !0, n.fetch().then(() => this.createResult(n, r));
  }
  fetch(t) {
    var r;
    return this.executeFetch({
      ...t,
      cancelRefetch: (r = t.cancelRefetch) != null ? r : !0
    }).then(() => (this.updateResult(), this.currentResult));
  }
  executeFetch(t) {
    this.updateQuery();
    let r = this.currentQuery.fetch(this.options, t);
    return t != null && t.throwOnError || (r = r.catch(Ol)), r;
  }
  updateStaleTimeout() {
    if (this.clearStaleTimeout(), Im || this.currentResult.isStale || !Vx(this.options.staleTime))
      return;
    const r = qF(this.currentResult.dataUpdatedAt, this.options.staleTime) + 1;
    this.staleTimeoutId = setTimeout(() => {
      this.currentResult.isStale || this.updateResult();
    }, r);
  }
  computeRefetchInterval() {
    var t;
    return typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (t = this.options.refetchInterval) != null ? t : !1;
  }
  updateRefetchInterval(t) {
    this.clearRefetchInterval(), this.currentRefetchInterval = t, !(Im || this.options.enabled === !1 || !Vx(this.currentRefetchInterval) || this.currentRefetchInterval === 0) && (this.refetchIntervalId = setInterval(() => {
      (this.options.refetchIntervalInBackground || zC.isFocused()) && this.executeFetch();
    }, this.currentRefetchInterval));
  }
  updateTimers() {
    this.updateStaleTimeout(), this.updateRefetchInterval(this.computeRefetchInterval());
  }
  clearStaleTimeout() {
    this.staleTimeoutId && (clearTimeout(this.staleTimeoutId), this.staleTimeoutId = void 0);
  }
  clearRefetchInterval() {
    this.refetchIntervalId && (clearInterval(this.refetchIntervalId), this.refetchIntervalId = void 0);
  }
  createResult(t, r) {
    const n = this.currentQuery, a = this.options, u = this.currentResult, s = this.currentResultState, c = this.currentResultOptions, i = t !== n, l = i ? t.state : this.currentQueryInitialState, v = i ? this.currentResult : this.previousQueryResult, {
      state: f
    } = t;
    let {
      dataUpdatedAt: p,
      error: g,
      errorUpdatedAt: y,
      fetchStatus: C,
      status: m
    } = f, h = !1, w = !1, S;
    if (r._optimisticResults) {
      const P = this.hasListeners(), k = !P && ID(t, r), I = P && LD(t, n, r, a);
      (k || I) && (C = D1(t.options.networkMode) ? "fetching" : "paused", p || (m = "loading")), r._optimisticResults === "isRestoring" && (C = "idle");
    }
    if (r.keepPreviousData && !f.dataUpdatedAt && v != null && v.isSuccess && m !== "error")
      S = v.data, p = v.dataUpdatedAt, m = v.status, h = !0;
    else if (r.select && typeof f.data < "u")
      if (u && f.data === (s == null ? void 0 : s.data) && r.select === this.selectFn)
        S = this.selectResult;
      else
        try {
          this.selectFn = r.select, S = r.select(f.data), S = _x(u == null ? void 0 : u.data, S, r), this.selectResult = S, this.selectError = null;
        } catch (P) {
           true && this.client.getLogger().error(P), this.selectError = P;
        }
    else
      S = f.data;
    if (typeof r.placeholderData < "u" && typeof S > "u" && m === "loading") {
      let P;
      if (u != null && u.isPlaceholderData && r.placeholderData === (c == null ? void 0 : c.placeholderData))
        P = u.data;
      else if (P = typeof r.placeholderData == "function" ? r.placeholderData() : r.placeholderData, r.select && typeof P < "u")
        try {
          P = r.select(P), this.selectError = null;
        } catch (k) {
           true && this.client.getLogger().error(k), this.selectError = k;
        }
      typeof P < "u" && (m = "success", S = _x(u == null ? void 0 : u.data, P, r), w = !0);
    }
    this.selectError && (g = this.selectError, S = this.selectResult, y = Date.now(), m = "error");
    const E = C === "fetching", x = m === "loading", T = m === "error";
    return {
      status: m,
      fetchStatus: C,
      isLoading: x,
      isSuccess: m === "success",
      isError: T,
      isInitialLoading: x && E,
      data: S,
      dataUpdatedAt: p,
      error: g,
      errorUpdatedAt: y,
      failureCount: f.fetchFailureCount,
      failureReason: f.fetchFailureReason,
      errorUpdateCount: f.errorUpdateCount,
      isFetched: f.dataUpdateCount > 0 || f.errorUpdateCount > 0,
      isFetchedAfterMount: f.dataUpdateCount > l.dataUpdateCount || f.errorUpdateCount > l.errorUpdateCount,
      isFetching: E,
      isRefetching: E && !x,
      isLoadingError: T && f.dataUpdatedAt === 0,
      isPaused: C === "paused",
      isPlaceholderData: w,
      isPreviousData: h,
      isRefetchError: T && f.dataUpdatedAt !== 0,
      isStale: jT(t, r),
      refetch: this.refetch,
      remove: this.remove
    };
  }
  updateResult(t) {
    const r = this.currentResult, n = this.createResult(this.currentQuery, this.options);
    if (this.currentResultState = this.currentQuery.state, this.currentResultOptions = this.options, zx(n, r))
      return;
    this.currentResult = n;
    const a = {
      cache: !0
    }, u = () => {
      if (!r)
        return !0;
      const {
        notifyOnChangeProps: s
      } = this.options, c = typeof s == "function" ? s() : s;
      if (c === "all" || !c && !this.trackedProps.size)
        return !0;
      const i = new Set(c ?? this.trackedProps);
      return this.options.useErrorBoundary && i.add("error"), Object.keys(this.currentResult).some((l) => {
        const v = l;
        return this.currentResult[v] !== r[v] && i.has(v);
      });
    };
    (t == null ? void 0 : t.listeners) !== !1 && u() && (a.listeners = !0), this.notify({
      ...a,
      ...t
    });
  }
  updateQuery() {
    const t = this.client.getQueryCache().build(this.client, this.options);
    if (t === this.currentQuery)
      return;
    const r = this.currentQuery;
    this.currentQuery = t, this.currentQueryInitialState = t.state, this.previousQueryResult = this.currentResult, this.hasListeners() && (r == null || r.removeObserver(this), t.addObserver(this));
  }
  onQueryUpdate(t) {
    const r = {};
    t.type === "success" ? r.onSuccess = !t.manual : t.type === "error" && !RC(t.error) && (r.onError = !0), this.updateResult(r), this.hasListeners() && this.updateTimers();
  }
  notify(t) {
    Ka.batch(() => {
      if (t.onSuccess) {
        var r, n, a, u;
        (r = (n = this.options).onSuccess) == null || r.call(n, this.currentResult.data), (a = (u = this.options).onSettled) == null || a.call(u, this.currentResult.data, null);
      } else if (t.onError) {
        var s, c, i, l;
        (s = (c = this.options).onError) == null || s.call(c, this.currentResult.error), (i = (l = this.options).onSettled) == null || i.call(l, void 0, this.currentResult.error);
      }
      t.listeners && this.listeners.forEach(({
        listener: v
      }) => {
        v(this.currentResult);
      }), t.cache && this.client.getQueryCache().notify({
        query: this.currentQuery,
        type: "observerResultsUpdated"
      });
    });
  }
}
function e8(e, t) {
  return t.enabled !== !1 && !e.state.dataUpdatedAt && !(e.state.status === "error" && t.retryOnMount === !1);
}
function ID(e, t) {
  return e8(e, t) || e.state.dataUpdatedAt > 0 && Ux(e, t, t.refetchOnMount);
}
function Ux(e, t, r) {
  if (t.enabled !== !1) {
    const n = typeof r == "function" ? r(e) : r;
    return n === "always" || n !== !1 && jT(e, t);
  }
  return !1;
}
function LD(e, t, r, n) {
  return r.enabled !== !1 && (e !== t || n.enabled === !1) && (!r.suspense || e.state.status !== "error") && jT(e, r);
}
function jT(e, t) {
  return e.isStaleByTime(t.staleTime);
}
function t8(e, t, r) {
  return r.keepPreviousData ? !1 : r.placeholderData !== void 0 ? t.isPlaceholderData : !zx(e.getCurrentResult(), t);
}
var jx = { exports: {} }, JS = {};
/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var kD;
function r8() {
  if (kD) return JS;
  kD = 1;
  var e = (react__WEBPACK_IMPORTED_MODULE_1___default());
  function t(f, p) {
    return f === p && (f !== 0 || 1 / f === 1 / p) || f !== f && p !== p;
  }
  var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, a = e.useEffect, u = e.useLayoutEffect, s = e.useDebugValue;
  function c(f, p) {
    var g = p(), y = n({ inst: { value: g, getSnapshot: p } }), C = y[0].inst, m = y[1];
    return u(function() {
      C.value = g, C.getSnapshot = p, i(C) && m({ inst: C });
    }, [f, g, p]), a(function() {
      return i(C) && m({ inst: C }), f(function() {
        i(C) && m({ inst: C });
      });
    }, [f]), s(g), g;
  }
  function i(f) {
    var p = f.getSnapshot;
    f = f.value;
    try {
      var g = p();
      return !r(f, g);
    } catch {
      return !0;
    }
  }
  function l(f, p) {
    return p();
  }
  var v = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? l : c;
  return JS.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : v, JS;
}
var QS = {};
/**
 * @license React
 * use-sync-external-store-shim.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var OD;
function n8() {
  return OD || (OD = 1,  true && function() {
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
    var e = (react__WEBPACK_IMPORTED_MODULE_1___default()), t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function r(S) {
      {
        for (var E = arguments.length, x = new Array(E > 1 ? E - 1 : 0), T = 1; T < E; T++)
          x[T - 1] = arguments[T];
        n("error", S, x);
      }
    }
    function n(S, E, x) {
      {
        var T = t.ReactDebugCurrentFrame, F = T.getStackAddendum();
        F !== "" && (E += "%s", x = x.concat([F]));
        var P = x.map(function(k) {
          return String(k);
        });
        P.unshift("Warning: " + E), Function.prototype.apply.call(console[S], console, P);
      }
    }
    function a(S, E) {
      return S === E && (S !== 0 || 1 / S === 1 / E) || S !== S && E !== E;
    }
    var u = typeof Object.is == "function" ? Object.is : a, s = e.useState, c = e.useEffect, i = e.useLayoutEffect, l = e.useDebugValue, v = !1, f = !1;
    function p(S, E, x) {
      v || e.startTransition !== void 0 && (v = !0, r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
      var T = E();
      if (!f) {
        var F = E();
        u(T, F) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), f = !0);
      }
      var P = s({
        inst: {
          value: T,
          getSnapshot: E
        }
      }), k = P[0].inst, I = P[1];
      return i(function() {
        k.value = T, k.getSnapshot = E, g(k) && I({
          inst: k
        });
      }, [S, T, E]), c(function() {
        g(k) && I({
          inst: k
        });
        var L = function() {
          g(k) && I({
            inst: k
          });
        };
        return S(L);
      }, [S]), l(T), T;
    }
    function g(S) {
      var E = S.getSnapshot, x = S.value;
      try {
        var T = E();
        return !u(x, T);
      } catch {
        return !0;
      }
    }
    function y(S, E, x) {
      return E();
    }
    var C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", m = !C, h = m ? y : p, w = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h;
    QS.useSyncExternalStore = w, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
  }()), QS;
}
 false ? 0 : jx.exports = n8();
var i8 = jx.exports;
const a8 = i8.useSyncExternalStore, ND = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(void 0), oP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(!1);
function sP(e, t) {
  return e || (t && typeof window < "u" ? (window.ReactQueryClientContext || (window.ReactQueryClientContext = ND), window.ReactQueryClientContext) : ND);
}
const o8 = ({
  context: e
} = {}) => {
  const t = react__WEBPACK_IMPORTED_MODULE_1__.useContext(sP(e, react__WEBPACK_IMPORTED_MODULE_1__.useContext(oP)));
  if (!t)
    throw new Error("No QueryClient set, use QueryClientProvider to set one");
  return t;
}, s8 = ({
  client: e,
  children: t,
  context: r,
  contextSharing: n = !1
}) => {
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => (e.mount(), () => {
    e.unmount();
  }), [e]),  true && n && e.getLogger().error("The contextSharing option has been deprecated and will be removed in the next major version");
  const a = sP(r, n);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(oP.Provider, {
    value: !r && n
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(a.Provider, {
    value: e
  }, t));
}, lP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(!1), l8 = () => react__WEBPACK_IMPORTED_MODULE_1__.useContext(lP);
lP.Provider;
function u8() {
  let e = !1;
  return {
    clearReset: () => {
      e = !1;
    },
    reset: () => {
      e = !0;
    },
    isReset: () => e
  };
}
const c8 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(u8()), d8 = () => react__WEBPACK_IMPORTED_MODULE_1__.useContext(c8);
function f8(e, t) {
  return typeof e == "function" ? e(...t) : !!e;
}
const h8 = (e, t) => {
  (e.suspense || e.useErrorBoundary) && (t.isReset() || (e.retryOnMount = !1));
}, p8 = (e) => {
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    e.clearReset();
  }, [e]);
}, v8 = ({
  result: e,
  errorResetBoundary: t,
  useErrorBoundary: r,
  query: n
}) => e.isError && !t.isReset() && !e.isFetching && f8(r, [e.error, n]), g8 = (e) => {
  e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3);
}, m8 = (e, t) => e.isLoading && e.isFetching && !t, y8 = (e, t, r) => (e == null ? void 0 : e.suspense) && m8(t, r), C8 = (e, t, r) => t.fetchOptimistic(e).then(({
  data: n
}) => {
  e.onSuccess == null || e.onSuccess(n), e.onSettled == null || e.onSettled(n, null);
}).catch((n) => {
  r.clearReset(), e.onError == null || e.onError(n), e.onSettled == null || e.onSettled(void 0, n);
});
function b8(e, t) {
  const r = o8({
    context: e.context
  }), n = l8(), a = d8(), u = r.defaultQueryOptions(e);
  u._optimisticResults = n ? "isRestoring" : "optimistic", u.onError && (u.onError = Ka.batchCalls(u.onError)), u.onSuccess && (u.onSuccess = Ka.batchCalls(u.onSuccess)), u.onSettled && (u.onSettled = Ka.batchCalls(u.onSettled)), g8(u), h8(u, a), p8(a);
  const [s] = react__WEBPACK_IMPORTED_MODULE_1__.useState(() => new t(r, u)), c = s.getOptimisticResult(u);
  if (a8(react__WEBPACK_IMPORTED_MODULE_1__.useCallback((i) => {
    const l = n ? () => {
    } : s.subscribe(Ka.batchCalls(i));
    return s.updateResult(), l;
  }, [s, n]), () => s.getCurrentResult(), () => s.getCurrentResult()), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    s.setOptions(u, {
      listeners: !1
    });
  }, [u, s]), y8(u, c, n))
    throw C8(u, s, a);
  if (v8({
    result: c,
    errorResetBoundary: a,
    useErrorBoundary: u.useErrorBoundary,
    query: s.getCurrentQuery()
  }))
    throw c.error;
  return u.notifyOnChangeProps ? c : s.trackResult(c);
}
function Nl(e, t, r) {
  const n = gm(e, t, r);
  return b8(n, qG);
}
function w8(e, t = ZF, r = KF) {
  const n = [];
  return Object.entries(e).forEach(([a, u]) => {
    u != null && (typeof u == "object" ? t.forEach((s) => {
      const c = u[s];
      if (c != null) {
        const i = s !== r ? `-${s}` : "";
        n.push(`${a}${i}-${c}`);
      }
    }) : n.push(`${a}-${u}`));
  }), n;
}
const La = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  as: e = "div",
  bsPrefix: t,
  className: r,
  direction: n,
  gap: a,
  ...u
}, s) => {
  t = mn(t, n === "horizontal" ? "hstack" : "vstack");
  const c = BT(), i = VT();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
    ...u,
    ref: s,
    className: ln(r, t, ...w8({
      gap: a
    }, c, i))
  });
});
La.displayName = "Stack";
const S8 = {
  /**
   * Specify whether the feedback is for valid or invalid fields
   *
   * @type {('valid'|'invalid')}
   */
  type: hn.string,
  /** Display feedback as a tooltip. */
  tooltip: hn.bool,
  as: hn.elementType
}, F1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  ({
    as: e = "div",
    className: t,
    type: r = "valid",
    tooltip: n = !1,
    ...a
  }, u) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
    ...a,
    ref: u,
    className: ln(t, `${r}-${n ? "tooltip" : "feedback"}`)
  })
);
F1.displayName = "Feedback";
F1.propTypes = S8;
const ed = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext({}), $m = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  id: e,
  bsPrefix: t,
  className: r,
  type: n = "checkbox",
  isValid: a = !1,
  isInvalid: u = !1,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: s = "input",
  ...c
}, i) => {
  const {
    controlId: l
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ed);
  return t = mn(t, "form-check-input"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s, {
    ...c,
    ref: i,
    type: n,
    id: e || l,
    className: ln(r, t, a && "is-valid", u && "is-invalid")
  });
});
$m.displayName = "FormCheckInput";
const _C = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  htmlFor: r,
  ...n
}, a) => {
  const {
    controlId: u
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ed);
  return e = mn(e, "form-check-label"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", {
    ...n,
    ref: a,
    htmlFor: r || u,
    className: ln(t, e)
  });
});
_C.displayName = "FormCheckLabel";
function Yx(e, t) {
  let r = 0;
  return react__WEBPACK_IMPORTED_MODULE_1__.Children.map(e, (n) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(n) ? t(n, r++) : n);
}
function x8(e, t) {
  let r = 0;
  react__WEBPACK_IMPORTED_MODULE_1__.Children.forEach(e, (n) => {
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(n) && t(n, r++);
  });
}
function T8(e, t) {
  return react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(e).some((r) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r) && r.type === t);
}
const uP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  id: e,
  bsPrefix: t,
  bsSwitchPrefix: r,
  inline: n = !1,
  reverse: a = !1,
  disabled: u = !1,
  isValid: s = !1,
  isInvalid: c = !1,
  feedbackTooltip: i = !1,
  feedback: l,
  feedbackType: v,
  className: f,
  style: p,
  title: g = "",
  type: y = "checkbox",
  label: C,
  children: m,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: h = "input",
  ...w
}, S) => {
  t = mn(t, "form-check"), r = mn(r, "form-switch");
  const {
    controlId: E
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ed), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    controlId: e || E
  }), [E, e]), T = !m && C != null && C !== !1 || T8(m, _C), F = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($m, {
    ...w,
    type: y === "switch" ? "checkbox" : y,
    ref: S,
    isValid: s,
    isInvalid: c,
    disabled: u,
    as: h
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ed.Provider, {
    value: x,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
      style: p,
      className: ln(f, T && t, n && `${t}-inline`, a && `${t}-reverse`, y === "switch" && r),
      children: m || /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [F, T && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_C, {
          title: g,
          children: C
        }), l && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(F1, {
          type: v,
          tooltip: i,
          children: l
        })]
      })
    })
  });
});
uP.displayName = "FormCheck";
const UC = Object.assign(uP, {
  Input: $m,
  Label: _C
});
var R8 = "development" !== "production", cP = function() {
};
if (R8) {
  var A8 = function(t, r) {
    var n = arguments.length;
    r = new Array(n > 1 ? n - 1 : 0);
    for (var a = 1; a < n; a++)
      r[a - 1] = arguments[a];
    var u = 0, s = "Warning: " + t.replace(/%s/g, function() {
      return r[u++];
    });
    typeof console < "u" && console.error(s);
    try {
      throw new Error(s);
    } catch {
    }
  };
  cP = function(e, t, r) {
    var n = arguments.length;
    r = new Array(n > 2 ? n - 2 : 0);
    for (var a = 2; a < n; a++)
      r[a - 2] = arguments[a];
    if (t === void 0)
      throw new Error(
        "`warning(condition, format, ...args)` requires a warning message argument"
      );
    e || A8.apply(null, [t].concat(r));
  };
}
var E8 = cP;
const P1 = /* @__PURE__ */ jh(E8), dP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  type: t,
  size: r,
  htmlSize: n,
  id: a,
  className: u,
  isValid: s = !1,
  isInvalid: c = !1,
  plaintext: i,
  readOnly: l,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: v = "input",
  ...f
}, p) => {
  const {
    controlId: g
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ed);
  return e = mn(e, "form-control"),  true && P1(g == null || !a, "`controlId` is ignored on `<FormControl>` when `id` is specified."), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(v, {
    ...f,
    type: t,
    size: n,
    ref: p,
    readOnly: l,
    id: a || g,
    className: ln(u, i ? `${e}-plaintext` : e, r && `${e}-${r}`, t === "color" && `${e}-color`, s && "is-valid", c && "is-invalid")
  });
});
dP.displayName = "FormControl";
const M8 = Object.assign(dP, {
  Feedback: F1
}), fP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "form-floating"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
fP.displayName = "FormFloating";
const YT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  controlId: e,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: t = "div",
  ...r
}, n) => {
  const a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    controlId: e
  }), [e]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ed.Provider, {
    value: a,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(t, {
      ...r,
      ref: n
    })
  });
});
YT.displayName = "FormGroup";
function D8({
  as: e,
  bsPrefix: t,
  className: r,
  ...n
}) {
  t = mn(t, "col");
  const a = BT(), u = VT(), s = [], c = [];
  return a.forEach((i) => {
    const l = n[i];
    delete n[i];
    let v, f, p;
    typeof l == "object" && l != null ? {
      span: v,
      offset: f,
      order: p
    } = l : v = l;
    const g = i !== u ? `-${i}` : "";
    v && s.push(v === !0 ? `${t}${g}` : `${t}${g}-${v}`), p != null && c.push(`order${g}-${p}`), f != null && c.push(`offset${g}-${f}`);
  }), [{
    ...n,
    className: ln(r, ...s, ...c)
  }, {
    as: e,
    bsPrefix: t,
    spans: s
  }];
}
const Ks = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  (e, t) => {
    const [{
      className: r,
      ...n
    }, {
      as: a = "div",
      bsPrefix: u,
      spans: s
    }] = D8(e);
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(a, {
      ...n,
      ref: t,
      className: ln(r, !s.length && u)
    });
  }
);
Ks.displayName = "Col";
const hP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: e = "label",
  bsPrefix: t,
  column: r = !1,
  visuallyHidden: n = !1,
  className: a,
  htmlFor: u,
  ...s
}, c) => {
  const {
    controlId: i
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ed);
  t = mn(t, "form-label");
  let l = "col-form-label";
  typeof r == "string" && (l = `${l} ${l}-${r}`);
  const v = ln(a, t, n && "visually-hidden", r && l);
  return  true && P1(i == null || !u, "`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified."), u = u || i, r ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, {
    ref: c,
    as: "label",
    className: v,
    htmlFor: u,
    ...s
  }) : (
    // eslint-disable-next-line jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
      ref: c,
      className: v,
      htmlFor: u,
      ...s
    })
  );
});
hP.displayName = "FormLabel";
const pP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  id: r,
  ...n
}, a) => {
  const {
    controlId: u
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ed);
  return e = mn(e, "form-range"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", {
    ...n,
    type: "range",
    ref: a,
    className: ln(t, e),
    id: r || u
  });
});
pP.displayName = "FormRange";
const vP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  size: t,
  htmlSize: r,
  className: n,
  isValid: a = !1,
  isInvalid: u = !1,
  id: s,
  ...c
}, i) => {
  const {
    controlId: l
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ed);
  return e = mn(e, "form-select"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", {
    ...c,
    size: r,
    ref: i,
    className: ln(n, e, t && `${e}-${t}`, a && "is-valid", u && "is-invalid"),
    id: s || l
  });
});
vP.displayName = "FormSelect";
const gP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  ({
    bsPrefix: e,
    className: t,
    as: r = "small",
    muted: n,
    ...a
  }, u) => (e = mn(e, "form-text"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
    ...a,
    ref: u,
    className: ln(t, e, n && "text-muted")
  }))
);
gP.displayName = "FormText";
const mP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(UC, {
  ...e,
  ref: t,
  type: "switch"
}));
mP.displayName = "Switch";
const F8 = Object.assign(mP, {
  Input: UC.Input,
  Label: UC.Label
}), yP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  children: r,
  controlId: n,
  label: a,
  ...u
}, s) => (e = mn(e, "form-floating"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(YT, {
  ref: s,
  className: ln(t, e),
  controlId: n,
  ...u,
  children: [r, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", {
    htmlFor: n,
    children: a
  })]
})));
yP.displayName = "FloatingLabel";
const P8 = {
  /**
   * The Form `ref` will be forwarded to the underlying element,
   * which means, unless it's rendered `as` a composite component,
   * it will be a DOM node, when resolved.
   *
   * @type {ReactRef}
   * @alias ref
   */
  _ref: hn.any,
  /**
   * Mark a form as having been validated. Setting it to `true` will
   * toggle any validation styles on the forms elements.
   */
  validated: hn.bool,
  as: hn.elementType
}, XT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  validated: t,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: r = "form",
  ...n
}, a) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ...n,
  ref: a,
  className: ln(e, t && "was-validated")
}));
XT.displayName = "Form";
XT.propTypes = P8;
const Di = Object.assign(XT, {
  Group: YT,
  Control: M8,
  Floating: fP,
  Check: UC,
  Switch: F8,
  Label: hP,
  Text: gP,
  Range: pP,
  Select: vP,
  FloatingLabel: yP
});
var GD = { exports: {} }, Xx = { exports: {} };
(function(e, t) {
  Object.defineProperty(t, "__esModule", {
    value: !0
  }), t.default = r;
  function r(n) {
    function a(s, c, i, l, v, f) {
      var p = l || "<<anonymous>>", g = f || i;
      if (c[i] == null)
        return s ? new Error("Required " + v + " `" + g + "` was not specified " + ("in `" + p + "`.")) : null;
      for (var y = arguments.length, C = Array(y > 6 ? y - 6 : 0), m = 6; m < y; m++)
        C[m - 6] = arguments[m];
      return n.apply(void 0, [c, i, p, v, g].concat(C));
    }
    var u = a.bind(null, !1);
    return u.isRequired = a.bind(null, !0), u;
  }
  e.exports = t.default;
})(Xx, Xx.exports);
var I8 = Xx.exports;
(function(e, t) {
  Object.defineProperty(t, "__esModule", {
    value: !0
  }), t.default = u;
  var r = I8, n = a(r);
  function a(s) {
    return s && s.__esModule ? s : { default: s };
  }
  function u() {
    for (var s = arguments.length, c = Array(s), i = 0; i < s; i++)
      c[i] = arguments[i];
    function l() {
      for (var v = arguments.length, f = Array(v), p = 0; p < v; p++)
        f[p] = arguments[p];
      var g = null;
      return c.forEach(function(y) {
        if (g == null) {
          var C = y.apply(void 0, f);
          C != null && (g = C);
        }
      }), g;
    }
    return (0, n.default)(l);
  }
  e.exports = t.default;
})(GD, GD.exports);
function _n() {
  return _n = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var r = arguments[t];
      for (var n in r)
        Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
    }
    return e;
  }, _n.apply(this, arguments);
}
var L8 = function(e, t, r, n, a, u, s, c) {
  if ( true && t === void 0)
    throw new Error("invariant requires an error message argument");
  if (!e) {
    var i;
    if (t === void 0)
      i = new Error(
        "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
      );
    else {
      var l = [r, n, a, u, s, c], v = 0;
      i = new Error(
        t.replace(/%s/g, function() {
          return l[v++];
        })
      ), i.name = "Invariant Violation";
    }
    throw i.framesToPop = 1, i;
  }
}, k8 = L8;
const HD = /* @__PURE__ */ jh(k8);
function BD(e) {
  return "default" + e.charAt(0).toUpperCase() + e.substr(1);
}
function O8(e) {
  var t = N8(e, "string");
  return typeof t == "symbol" ? t : String(t);
}
function N8(e, t) {
  if (typeof e != "object" || e === null) return e;
  var r = e[Symbol.toPrimitive];
  if (r !== void 0) {
    var n = r.call(e, t);
    if (typeof n != "object") return n;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return String(e);
}
function G8(e, t, r) {
  var n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e !== void 0), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(t), u = a[0], s = a[1], c = e !== void 0, i = n.current;
  return n.current = c, !c && i && u !== t && s(t), [c ? e : u, (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(l) {
    for (var v = arguments.length, f = new Array(v > 1 ? v - 1 : 0), p = 1; p < v; p++)
      f[p - 1] = arguments[p];
    r && r.apply(void 0, [l].concat(f)), s(l);
  }, [r])];
}
function Lv(e, t) {
  return Object.keys(t).reduce(function(r, n) {
    var a, u = r, s = u[BD(n)], c = u[n], i = kT(u, [BD(n), n].map(O8)), l = t[n], v = G8(c, s, e[l]), f = v[0], p = v[1];
    return _n({}, i, (a = {}, a[n] = f, a[l] = p, a));
  }, e);
}
var H8 = Function.prototype.bind.call(Function.prototype.call, [].slice);
function Uc(e, t) {
  return H8(e.querySelectorAll(t));
}
function CP() {
  const [, e] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useReducer)((t) => !t, !1);
  return e;
}
const I1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null);
I1.displayName = "NavContext";
const B8 = "data-rr-ui-", V8 = "rrUi";
function kv(e) {
  return `${B8}${e}`;
}
function z8(e) {
  return `${V8}${e}`;
}
const W8 = ["as", "disabled"];
function _8(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
function U8(e) {
  return !e || e.trim() === "#";
}
function $T({
  tagName: e,
  disabled: t,
  href: r,
  target: n,
  rel: a,
  role: u,
  onClick: s,
  tabIndex: c = 0,
  type: i
}) {
  e || (r != null || n != null || a != null ? e = "a" : e = "button");
  const l = {
    tagName: e
  };
  if (e === "button")
    return [{
      type: i || "button",
      disabled: t
    }, l];
  const v = (p) => {
    if ((t || e === "a" && U8(r)) && p.preventDefault(), t) {
      p.stopPropagation();
      return;
    }
    s == null || s(p);
  }, f = (p) => {
    p.key === " " && (p.preventDefault(), v(p));
  };
  return e === "a" && (r || (r = "#"), t && (r = void 0)), [{
    role: u ?? "button",
    // explicitly undefined so that it overrides the props disabled in a spread
    // e.g. <Tag {...props} {...hookProps} />
    disabled: void 0,
    tabIndex: t ? void 0 : c,
    href: r,
    target: e === "a" ? n : void 0,
    "aria-disabled": t || void 0,
    rel: e === "a" ? a : void 0,
    onClick: v,
    onKeyDown: f
  }, l];
}
const ZT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  let {
    as: r,
    disabled: n
  } = e, a = _8(e, W8);
  const [u, {
    tagName: s
  }] = $T(Object.assign({
    tagName: r,
    disabled: n
  }, a));
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s, Object.assign({}, a, u, {
    ref: t
  }));
});
ZT.displayName = "Button";
const j8 = ["as", "active", "eventKey"];
function Y8(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
function bP({
  key: e,
  onClick: t,
  active: r,
  id: n,
  role: a,
  disabled: u
}) {
  const s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(oc), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(I1), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Pv);
  let l = r;
  const v = {
    role: a
  };
  if (c) {
    !a && c.role === "tablist" && (v.role = "tab");
    const f = c.getControllerId(e ?? null), p = c.getControlledId(e ?? null);
    v[kv("event-key")] = e, v.id = f || n, l = r == null && e != null ? c.activeKey === e : r, (l || !(i != null && i.unmountOnExit) && !(i != null && i.mountOnEnter)) && (v["aria-controls"] = p);
  }
  return v.role === "tab" && (v["aria-selected"] = l, l || (v.tabIndex = -1), u && (v.tabIndex = -1, v["aria-disabled"] = !0)), v.onClick = wa((f) => {
    u || (t == null || t(f), e != null && s && !f.isPropagationStopped() && s(e, f));
  }), [v, {
    isActive: l
  }];
}
const wP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  let {
    as: r = ZT,
    active: n,
    eventKey: a
  } = e, u = Y8(e, j8);
  const [s, c] = bP(Object.assign({
    key: Hh(a, u.href),
    active: n
  }, u));
  return s[kv("active")] = c.isActive, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, Object.assign({}, u, s, {
    ref: t
  }));
});
wP.displayName = "NavItem";
const X8 = ["as", "onSelect", "activeKey", "role", "onKeyDown"];
function $8(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
const VD = () => {
}, zD = kv("event-key"), SP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  let {
    // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
    as: r = "div",
    onSelect: n,
    activeKey: a,
    role: u,
    onKeyDown: s
  } = e, c = $8(e, X8);
  const i = CP(), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(oc), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Pv);
  let p, g;
  f && (u = u || "tablist", a = f.activeKey, p = f.getControlledId, g = f.getControllerId);
  const y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), C = (S) => {
    const E = y.current;
    if (!E) return null;
    const x = Uc(E, `[${zD}]:not([aria-disabled=true])`), T = E.querySelector("[aria-selected=true]");
    if (!T || T !== document.activeElement) return null;
    const F = x.indexOf(T);
    if (F === -1) return null;
    let P = F + S;
    return P >= x.length && (P = 0), P < 0 && (P = x.length - 1), x[P];
  }, m = (S, E) => {
    S != null && (n == null || n(S, E), v == null || v(S, E));
  }, h = (S) => {
    if (s == null || s(S), !f)
      return;
    let E;
    switch (S.key) {
      case "ArrowLeft":
      case "ArrowUp":
        E = C(-1);
        break;
      case "ArrowRight":
      case "ArrowDown":
        E = C(1);
        break;
      default:
        return;
    }
    E && (S.preventDefault(), m(E.dataset[z8("EventKey")] || null, S), l.current = !0, i());
  };
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (y.current && l.current) {
      const S = y.current.querySelector(`[${zD}][aria-selected=true]`);
      S == null || S.focus();
    }
    l.current = !1;
  });
  const w = ad(t, y);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(oc.Provider, {
    value: m,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(I1.Provider, {
      value: {
        role: u,
        // used by NavLink to determine it's role
        activeKey: Hh(a),
        getControlledId: p || VD,
        getControllerId: g || VD
      },
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, Object.assign({}, c, {
        onKeyDown: h,
        ref: w,
        role: u
      }))
    })
  });
});
SP.displayName = "Nav";
const Z8 = Object.assign(SP, {
  Item: wP
}), sf = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null);
sf.displayName = "NavbarContext";
const KT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null);
KT.displayName = "CardHeaderContext";
const JT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "nav-item"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
JT.displayName = "NavItem";
function xP() {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
}
function K8(e, t, r, n = !1) {
  const a = wa(r);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const u = typeof e == "function" ? e() : e;
    return u.addEventListener(t, a, n), () => u.removeEventListener(t, a, n);
  }, [e]);
}
function TP() {
  const e = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0), t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(() => e.current);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => (e.current = !0, () => {
    e.current = !1;
  }), []), t.current;
}
function RP(e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    t.current = e;
  }), t.current;
}
const J8 = typeof __webpack_require__.g < "u" && // @ts-ignore
__webpack_require__.g.navigator && // @ts-ignore
__webpack_require__.g.navigator.product === "ReactNative", Q8 = typeof document < "u", jC = Q8 || J8 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect, q8 = ["onKeyDown"];
function eH(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
function tH(e) {
  return !e || e.trim() === "#";
}
const Zm = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  let {
    onKeyDown: r
  } = e, n = eH(e, q8);
  const [a] = $T(Object.assign({
    tagName: "a"
  }, n)), u = wa((s) => {
    a.onKeyDown(s), r == null || r(s);
  });
  return tH(n.href) || n.role === "button" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", Object.assign({
    ref: t
  }, n, a, {
    onKeyDown: u
  })) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", Object.assign({
    ref: t
  }, n, {
    onKeyDown: r
  }));
});
Zm.displayName = "Anchor";
const L1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  as: r = Zm,
  active: n,
  eventKey: a,
  disabled: u = !1,
  ...s
}, c) => {
  e = mn(e, "nav-link");
  const [i, l] = bP({
    key: Hh(a, s.href),
    active: n,
    disabled: u,
    ...s
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
    ...s,
    ...i,
    ref: c,
    disabled: u,
    className: ln(t, e, u && "disabled", l.isActive && "active")
  });
});
L1.displayName = "NavLink";
const AP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  const {
    as: r = "div",
    bsPrefix: n,
    variant: a,
    fill: u = !1,
    justify: s = !1,
    navbar: c,
    navbarScroll: i,
    className: l,
    activeKey: v,
    ...f
  } = Lv(e, {
    activeKey: "onSelect"
  }), p = mn(n, "nav");
  let g, y, C = !1;
  const m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(sf), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(KT);
  return m ? (g = m.bsPrefix, C = c ?? !0) : h && ({
    cardHeaderBsPrefix: y
  } = h), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Z8, {
    as: r,
    ref: t,
    activeKey: v,
    className: ln(l, {
      [p]: !C,
      [`${g}-nav`]: C,
      [`${g}-nav-scroll`]: C && i,
      [`${y}-${a}`]: !!y,
      [`${p}-${a}`]: !!a,
      [`${p}-fill`]: u,
      [`${p}-justified`]: s
    }),
    ...f
  });
});
AP.displayName = "Nav";
const ys = Object.assign(AP, {
  Item: JT,
  Link: L1
}), EP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  as: r,
  ...n
}, a) => {
  e = mn(e, "navbar-brand");
  const u = r || (n.href ? "a" : "span");
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(u, {
    ...n,
    ref: a,
    className: ln(t, e)
  });
});
EP.displayName = "NavbarBrand";
function sm(...e) {
  return e.filter((t) => t != null).reduce((t, r) => {
    if (typeof r != "function")
      throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");
    return t === null ? r : function(...a) {
      t.apply(this, a), r.apply(this, a);
    };
  }, null);
}
const rH = {
  height: ["marginTop", "marginBottom"],
  width: ["marginLeft", "marginRight"]
};
function nH(e, t) {
  const r = `offset${e[0].toUpperCase()}${e.slice(1)}`, n = t[r], a = rH[e];
  return n + // @ts-ignore
  parseInt(Zc(t, a[0]), 10) + // @ts-ignore
  parseInt(Zc(t, a[1]), 10);
}
const iH = {
  [Kd]: "collapse",
  [Pm]: "collapsing",
  [cu]: "collapsing",
  [Xc]: "collapse show"
}, MP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef(({
  onEnter: e,
  onEntering: t,
  onEntered: r,
  onExit: n,
  onExiting: a,
  className: u,
  children: s,
  dimension: c = "height",
  in: i = !1,
  timeout: l = 300,
  mountOnEnter: v = !1,
  unmountOnExit: f = !1,
  appear: p = !1,
  getDimensionValue: g = nH,
  ...y
}, C) => {
  const m = typeof c == "function" ? c() : c, h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => sm((T) => {
    T.style[m] = "0";
  }, e), [m, e]), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => sm((T) => {
    const F = `scroll${m[0].toUpperCase()}${m.slice(1)}`;
    T.style[m] = `${T[F]}px`;
  }, t), [m, t]), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => sm((T) => {
    T.style[m] = null;
  }, r), [m, r]), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => sm((T) => {
    T.style[m] = `${g(m, T)}px`, XF(T);
  }, n), [n, g, m]), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => sm((T) => {
    T.style[m] = null;
  }, a), [m, a]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GT, {
    ref: C,
    addEndListener: NT,
    ...y,
    "aria-expanded": y.role ? i : null,
    onEnter: h,
    onEntering: w,
    onEntered: S,
    onExit: E,
    onExiting: x,
    childRef: s.ref,
    in: i,
    timeout: l,
    mountOnEnter: v,
    unmountOnExit: f,
    appear: p,
    children: (T, F) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(s, {
      ...F,
      className: ln(u, s.props.className, iH[T], m === "width" && "collapse-horizontal")
    })
  });
}), DP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  children: e,
  bsPrefix: t,
  ...r
}, n) => {
  t = mn(t, "navbar-collapse");
  const a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(sf);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MP, {
    in: !!(a && a.expanded),
    ...r,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
      ref: n,
      className: t,
      children: e
    })
  });
});
DP.displayName = "NavbarCollapse";
const FP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  children: r,
  label: n = "Toggle navigation",
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: a = "button",
  onClick: u,
  ...s
}, c) => {
  e = mn(e, "navbar-toggler");
  const {
    onToggle: i,
    expanded: l
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(sf) || {}, v = wa((f) => {
    u && u(f), i && i();
  });
  return a === "button" && (s.type = "button"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(a, {
    ...s,
    ref: c,
    onClick: v,
    "aria-label": n,
    className: ln(t, e, !l && "collapsed"),
    children: r || /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", {
      className: `${e}-icon`
    })
  });
});
FP.displayName = "NavbarToggle";
const $x = /* @__PURE__ */ new WeakMap(), WD = (e, t) => {
  if (!e || !t) return;
  const r = $x.get(t) || /* @__PURE__ */ new Map();
  $x.set(t, r);
  let n = r.get(e);
  return n || (n = t.matchMedia(e), n.refCount = 0, r.set(n.media, n)), n;
};
function aH(e, t = typeof window > "u" ? void 0 : window) {
  const r = WD(e, t), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => r ? r.matches : !1);
  return jC(() => {
    let u = WD(e, t);
    if (!u)
      return a(!1);
    let s = $x.get(t);
    const c = () => {
      a(u.matches);
    };
    return u.refCount++, u.addListener(c), c(), () => {
      u.removeListener(c), u.refCount--, u.refCount <= 0 && (s == null || s.delete(u.media)), u = void 0;
    };
  }, [e]), n;
}
function oH(e) {
  const t = Object.keys(e);
  function r(c, i) {
    return c === i ? i : c ? `${c} and ${i}` : i;
  }
  function n(c) {
    return t[Math.min(t.indexOf(c) + 1, t.length - 1)];
  }
  function a(c) {
    const i = n(c);
    let l = e[i];
    return typeof l == "number" ? l = `${l - 0.2}px` : l = `calc(${l} - 0.2px)`, `(max-width: ${l})`;
  }
  function u(c) {
    let i = e[c];
    return typeof i == "number" && (i = `${i}px`), `(min-width: ${i})`;
  }
  function s(c, i, l) {
    let v;
    typeof c == "object" ? (v = c, l = i, i = !0) : (i = i || !0, v = {
      [c]: i
    });
    let f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => Object.entries(v).reduce((p, [g, y]) => ((y === "up" || y === !0) && (p = r(p, u(g))), (y === "down" || y === !0) && (p = r(p, a(g))), p), ""), [JSON.stringify(v)]);
    return aH(f, l);
  }
  return s;
}
const sH = oH({
  xs: 0,
  sm: 576,
  md: 768,
  lg: 992,
  xl: 1200,
  xxl: 1400
});
function qS(e) {
  e === void 0 && (e = Ym());
  try {
    var t = e.activeElement;
    return !t || !t.nodeName ? null : t;
  } catch {
    return e.body;
  }
}
function YC(e, t) {
  if (e.contains) return e.contains(t);
  if (e.compareDocumentPosition) return e === t || !!(e.compareDocumentPosition(t) & 16);
}
function lH(e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e);
  return t.current = e, t;
}
function PP(e) {
  const t = lH(e);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => () => t.current(), []);
}
function uH(e = document) {
  const t = e.defaultView;
  return Math.abs(t.innerWidth - e.documentElement.clientWidth);
}
const _D = kv("modal-open");
class QT {
  constructor({
    ownerDocument: t,
    handleContainerOverflow: r = !0,
    isRTL: n = !1
  } = {}) {
    this.handleContainerOverflow = r, this.isRTL = n, this.modals = [], this.ownerDocument = t;
  }
  getScrollbarWidth() {
    return uH(this.ownerDocument);
  }
  getElement() {
    return (this.ownerDocument || document).body;
  }
  setModalAttributes(t) {
  }
  removeModalAttributes(t) {
  }
  setContainerStyle(t) {
    const r = {
      overflow: "hidden"
    }, n = this.isRTL ? "paddingLeft" : "paddingRight", a = this.getElement();
    t.style = {
      overflow: a.style.overflow,
      [n]: a.style[n]
    }, t.scrollBarWidth && (r[n] = `${parseInt(Zc(a, n) || "0", 10) + t.scrollBarWidth}px`), a.setAttribute(_D, ""), Zc(a, r);
  }
  reset() {
    [...this.modals].forEach((t) => this.remove(t));
  }
  removeContainerStyle(t) {
    const r = this.getElement();
    r.removeAttribute(_D), Object.assign(r.style, t.style);
  }
  add(t) {
    let r = this.modals.indexOf(t);
    return r !== -1 || (r = this.modals.length, this.modals.push(t), this.setModalAttributes(t), r !== 0) || (this.state = {
      scrollBarWidth: this.getScrollbarWidth(),
      style: {}
    }, this.handleContainerOverflow && this.setContainerStyle(this.state)), r;
  }
  remove(t) {
    const r = this.modals.indexOf(t);
    r !== -1 && (this.modals.splice(r, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(t));
  }
  isTopModal(t) {
    return !!this.modals.length && this.modals[this.modals.length - 1] === t;
  }
}
const IP = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(Iv ? window : void 0);
IP.Provider;
function k1() {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(IP);
}
const ex = (e, t) => Iv ? e == null ? (t || Ym()).body : (typeof e == "function" && (e = e()), e && "current" in e && (e = e.current), e && ("nodeType" in e || e.getBoundingClientRect) ? e : null) : null;
function cH(e, t) {
  const r = k1(), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => ex(e, r == null ? void 0 : r.document));
  if (!n) {
    const u = ex(e);
    u && a(u);
  }
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
  }, [t, n]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const u = ex(e);
    u !== n && a(u);
  }, [e, n]), n;
}
function dH(e) {
  return e.code === "Escape" || e.keyCode === 27;
}
function fH() {
  const e = react__WEBPACK_IMPORTED_MODULE_1__.version.split(".");
  return {
    major: +e[0],
    minor: +e[1],
    patch: +e[2]
  };
}
const hH = ["onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "addEndListener", "children"];
function pH(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
function vH(e) {
  let {
    onEnter: t,
    onEntering: r,
    onEntered: n,
    onExit: a,
    onExiting: u,
    onExited: s,
    addEndListener: c,
    children: i
  } = e, l = pH(e, hH);
  const {
    major: v
  } = fH(), f = v >= 19 ? i.props.ref : i.ref, p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), g = ad(p, typeof i == "function" ? null : f), y = (T) => (F) => {
    T && p.current && T(p.current, F);
  }, C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(t), [t]), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(r), [r]), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(n), [n]), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(a), [a]), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(u), [u]), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(s), [s]), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(y(c), [c]);
  return Object.assign({}, l, {
    nodeRef: p
  }, t && {
    onEnter: C
  }, r && {
    onEntering: m
  }, n && {
    onEntered: h
  }, a && {
    onExit: w
  }, u && {
    onExiting: S
  }, s && {
    onExited: E
  }, c && {
    addEndListener: x
  }, {
    children: typeof i == "function" ? (T, F) => (
      // TODO: Types for RTG missing innerProps, so need to cast.
      i(T, Object.assign({}, F, {
        ref: g
      }))
    ) : /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(i, {
      ref: g
    })
  });
}
const gH = ["component"];
function mH(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
const yH = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  let {
    component: r
  } = e, n = mH(e, gH);
  const a = vH(n);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, Object.assign({
    ref: t
  }, a));
});
function CH({
  in: e,
  onTransition: t
}) {
  const r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0), a = wa(t);
  return jC(() => {
    if (!r.current)
      return;
    let u = !1;
    return a({
      in: e,
      element: r.current,
      initial: n.current,
      isStale: () => u
    }), () => {
      u = !0;
    };
  }, [e, a]), jC(() => (n.current = !1, () => {
    n.current = !0;
  }), []), r;
}
function bH({
  children: e,
  in: t,
  onExited: r,
  onEntered: n,
  transition: a
}) {
  const [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!t);
  t && u && s(!1);
  const c = CH({
    in: !!t,
    onTransition: (l) => {
      const v = () => {
        l.isStale() || (l.in ? n == null || n(l.element, l.initial) : (s(!0), r == null || r(l.element)));
      };
      Promise.resolve(a(l)).then(v, (f) => {
        throw l.in || s(!0), f;
      });
    }
  }), i = ad(c, e.ref);
  return u && !t ? null : /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(e, {
    ref: i
  });
}
function UD(e, t, r) {
  return e ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(yH, Object.assign({}, r, {
    component: e
  })) : t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(bH, Object.assign({}, r, {
    transition: t
  })) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IT, Object.assign({}, r));
}
const wH = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
function SH(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
let tx;
function xH(e) {
  return tx || (tx = new QT({
    ownerDocument: e == null ? void 0 : e.document
  })), tx;
}
function TH(e) {
  const t = k1(), r = e || xH(t), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)({
    dialog: null,
    backdrop: null
  });
  return Object.assign(n.current, {
    add: () => r.add(n.current),
    remove: () => r.remove(n.current),
    isTopModal: () => r.isTopModal(n.current),
    setDialogRef: (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((a) => {
      n.current.dialog = a;
    }, []),
    setBackdropRef: (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((a) => {
      n.current.backdrop = a;
    }, [])
  });
}
const LP = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((e, t) => {
  let {
    show: r = !1,
    role: n = "dialog",
    className: a,
    style: u,
    children: s,
    backdrop: c = !0,
    keyboard: i = !0,
    onBackdropClick: l,
    onEscapeKeyDown: v,
    transition: f,
    runTransition: p,
    backdropTransition: g,
    runBackdropTransition: y,
    autoFocus: C = !0,
    enforceFocus: m = !0,
    restoreFocus: h = !0,
    restoreFocusOptions: w,
    renderDialog: S,
    renderBackdrop: E = (we) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", Object.assign({}, we)),
    manager: x,
    container: T,
    onShow: F,
    onHide: P = () => {
    },
    onExit: k,
    onExited: I,
    onExiting: L,
    onEnter: A,
    onEntering: O,
    onEntered: N
  } = e, Y = SH(e, wH);
  const j = k1(), te = cH(T), re = TH(x), z = TP(), Z = RP(r), [W, q] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!r), ie = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(t, () => re, [re]), Iv && !Z && r && (ie.current = qS(j == null ? void 0 : j.document)), r && W && q(!1);
  const ce = wa(() => {
    if (re.add(), ue.current = qd(document, "keydown", se), le.current = qd(
      document,
      "focus",
      // the timeout is necessary b/c this will run before the new modal is mounted
      // and so steals focus from it
      () => setTimeout(U),
      !0
    ), F && F(), C) {
      var we, Re;
      const Ae = qS((we = (Re = re.dialog) == null ? void 0 : Re.ownerDocument) != null ? we : j == null ? void 0 : j.document);
      re.dialog && Ae && !YC(re.dialog, Ae) && (ie.current = Ae, re.dialog.focus());
    }
  }), X = wa(() => {
    if (re.remove(), ue.current == null || ue.current(), le.current == null || le.current(), h) {
      var we;
      (we = ie.current) == null || we.focus == null || we.focus(w), ie.current = null;
    }
  });
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    !r || !te || ce();
  }, [
    r,
    te,
    /* should never change: */
    ce
  ]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    W && X();
  }, [W, X]), PP(() => {
    X();
  });
  const U = wa(() => {
    if (!m || !z() || !re.isTopModal())
      return;
    const we = qS(j == null ? void 0 : j.document);
    re.dialog && we && !YC(re.dialog, we) && re.dialog.focus();
  }), ne = wa((we) => {
    we.target === we.currentTarget && (l == null || l(we), c === !0 && P());
  }), se = wa((we) => {
    i && dH(we) && re.isTopModal() && (v == null || v(we), we.defaultPrevented || P());
  }), le = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), ue = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), ve = (...we) => {
    q(!0), I == null || I(...we);
  };
  if (!te)
    return null;
  const be = Object.assign({
    role: n,
    ref: re.setDialogRef,
    // apparently only works on the dialog role element
    "aria-modal": n === "dialog" ? !0 : void 0
  }, Y, {
    style: u,
    className: a,
    tabIndex: -1
  });
  let Me = S ? S(be) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", Object.assign({}, be, {
    children: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(s, {
      role: "document"
    })
  }));
  Me = UD(f, p, {
    unmountOnExit: !0,
    mountOnEnter: !0,
    appear: !0,
    in: !!r,
    onExit: k,
    onExiting: L,
    onExited: ve,
    onEnter: A,
    onEntering: O,
    onEntered: N,
    children: Me
  });
  let Ge = null;
  return c && (Ge = E({
    ref: re.setBackdropRef,
    onClick: ne
  }), Ge = UD(g, y, {
    in: !!r,
    appear: !0,
    mountOnEnter: !0,
    unmountOnExit: !0,
    children: Ge
  })), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: /* @__PURE__ */ Dh.createPortal(/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
      children: [Ge, Me]
    }), te)
  });
});
LP.displayName = "Modal";
const kP = Object.assign(LP, {
  Manager: QT
}), OP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "offcanvas-body"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
OP.displayName = "OffcanvasBody";
const RH = {
  [cu]: "show",
  [Xc]: "show"
}, NP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  children: r,
  in: n = !1,
  mountOnEnter: a = !1,
  unmountOnExit: u = !1,
  appear: s = !1,
  ...c
}, i) => (e = mn(e, "offcanvas"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GT, {
  ref: i,
  addEndListener: NT,
  in: n,
  mountOnEnter: a,
  unmountOnExit: u,
  appear: s,
  ...c,
  childRef: r.ref,
  children: (l, v) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, {
    ...v,
    className: ln(t, r.props.className, (l === cu || l === Pm) && `${e}-toggling`, RH[l])
  })
})));
NP.displayName = "OffcanvasToggling";
const qT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext({
  // eslint-disable-next-line @typescript-eslint/no-empty-function
  onHide() {
  }
}), AH = {
  /** An accessible label indicating the relevant information about the Close Button. */
  "aria-label": hn.string,
  /** A callback fired after the Close Button is clicked. */
  onClick: hn.func,
  /**
   * Render different color variant for the button.
   *
   * Omitting this will render the default dark color.
   */
  variant: hn.oneOf(["white"])
}, Ov = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  variant: t,
  "aria-label": r = "Close",
  ...n
}, a) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", {
  ref: a,
  type: "button",
  className: ln("btn-close", t && `btn-close-${t}`, e),
  "aria-label": r,
  ...n
}));
Ov.displayName = "CloseButton";
Ov.propTypes = AH;
const GP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  closeLabel: e = "Close",
  closeVariant: t,
  closeButton: r = !1,
  onHide: n,
  children: a,
  ...u
}, s) => {
  const c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(qT), i = wa(() => {
    c == null || c.onHide(), n == null || n();
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
    ref: s,
    ...u,
    children: [a, r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ov, {
      "aria-label": e,
      variant: t,
      onClick: i
    })]
  });
}), HP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  closeLabel: r = "Close",
  closeButton: n = !1,
  ...a
}, u) => (e = mn(e, "offcanvas-header"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GP, {
  ref: u,
  ...a,
  className: ln(t, e),
  closeLabel: r,
  closeButton: n
})));
HP.displayName = "OffcanvasHeader";
const Km = (e) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((t, r) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
  ...t,
  ref: r,
  className: ln(t.className, e)
})), EH = Km("h5"), BP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = EH,
  ...n
}, a) => (t = mn(t, "offcanvas-title"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
BP.displayName = "OffcanvasTitle";
function MH(e, t) {
  return e.classList ? e.classList.contains(t) : (" " + (e.className.baseVal || e.className) + " ").indexOf(" " + t + " ") !== -1;
}
function DH(e, t) {
  e.classList ? e.classList.add(t) : MH(e, t) || (typeof e.className == "string" ? e.className = e.className + " " + t : e.setAttribute("class", (e.className && e.className.baseVal || "") + " " + t));
}
function jD(e, t) {
  return e.replace(new RegExp("(^|\\s)" + t + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
}
function FH(e, t) {
  e.classList ? e.classList.remove(t) : typeof e.className == "string" ? e.className = jD(e.className, t) : e.setAttribute("class", jD(e.className && e.className.baseVal || "", t));
}
const sv = {
  FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
  STICKY_CONTENT: ".sticky-top",
  NAVBAR_TOGGLER: ".navbar-toggler"
};
class VP extends QT {
  adjustAndStore(t, r, n) {
    const a = r.style[t];
    r.dataset[t] = a, Zc(r, {
      [t]: `${parseFloat(Zc(r, t)) + n}px`
    });
  }
  restore(t, r) {
    const n = r.dataset[t];
    n !== void 0 && (delete r.dataset[t], Zc(r, {
      [t]: n
    }));
  }
  setContainerStyle(t) {
    super.setContainerStyle(t);
    const r = this.getElement();
    if (DH(r, "modal-open"), !t.scrollBarWidth) return;
    const n = this.isRTL ? "paddingLeft" : "paddingRight", a = this.isRTL ? "marginLeft" : "marginRight";
    Uc(r, sv.FIXED_CONTENT).forEach((u) => this.adjustAndStore(n, u, t.scrollBarWidth)), Uc(r, sv.STICKY_CONTENT).forEach((u) => this.adjustAndStore(a, u, -t.scrollBarWidth)), Uc(r, sv.NAVBAR_TOGGLER).forEach((u) => this.adjustAndStore(a, u, t.scrollBarWidth));
  }
  removeContainerStyle(t) {
    super.removeContainerStyle(t);
    const r = this.getElement();
    FH(r, "modal-open");
    const n = this.isRTL ? "paddingLeft" : "paddingRight", a = this.isRTL ? "marginLeft" : "marginRight";
    Uc(r, sv.FIXED_CONTENT).forEach((u) => this.restore(n, u)), Uc(r, sv.STICKY_CONTENT).forEach((u) => this.restore(a, u)), Uc(r, sv.NAVBAR_TOGGLER).forEach((u) => this.restore(a, u));
  }
}
let rx;
function zP(e) {
  return rx || (rx = new VP(e)), rx;
}
function PH(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NP, {
    ...e
  });
}
function IH(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(rf, {
    ...e
  });
}
const WP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  children: r,
  "aria-labelledby": n,
  placement: a = "start",
  responsive: u,
  /* BaseModal props */
  show: s = !1,
  backdrop: c = !0,
  keyboard: i = !0,
  scroll: l = !1,
  onEscapeKeyDown: v,
  onShow: f,
  onHide: p,
  container: g,
  autoFocus: y = !0,
  enforceFocus: C = !0,
  restoreFocus: m = !0,
  restoreFocusOptions: h,
  onEntered: w,
  onExit: S,
  onExiting: E,
  onEnter: x,
  onEntering: T,
  onExited: F,
  backdropClassName: P,
  manager: k,
  renderStaticNode: I = !1,
  ...L
}, A) => {
  const O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  e = mn(e, "offcanvas");
  const {
    onToggle: N
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(sf) || {}, [Y, j] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), te = sH(u || "xs", "up");
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    j(u ? s && !te : s);
  }, [s, u, te]);
  const re = wa(() => {
    N == null || N(), p == null || p();
  }), z = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    onHide: re
  }), [re]);
  function Z() {
    return k || (l ? (O.current || (O.current = new VP({
      handleContainerOverflow: !1
    })), O.current) : zP());
  }
  const W = (X, ...U) => {
    X && (X.style.visibility = "visible"), x == null || x(X, ...U);
  }, q = (X, ...U) => {
    X && (X.style.visibility = ""), F == null || F(...U);
  }, ie = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((X) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    ...X,
    className: ln(`${e}-backdrop`, P)
  }), [P, e]), ce = (X) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    ...X,
    ...L,
    className: ln(t, u ? `${e}-${u}` : e, `${e}-${a}`),
    "aria-labelledby": n,
    children: r
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [!Y && (u || I) && ce({}), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(qT.Provider, {
      value: z,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(kP, {
        show: Y,
        ref: A,
        backdrop: c,
        container: g,
        keyboard: i,
        autoFocus: y,
        enforceFocus: C && !l,
        restoreFocus: m,
        restoreFocusOptions: h,
        onEscapeKeyDown: v,
        onShow: f,
        onHide: re,
        onEnter: W,
        onEntering: T,
        onEntered: w,
        onExit: S,
        onExiting: E,
        onExited: q,
        manager: Z(),
        transition: PH,
        backdropTransition: IH,
        renderBackdrop: ie,
        renderDialog: ce
      })
    })]
  });
});
WP.displayName = "Offcanvas";
const LH = Object.assign(WP, {
  Body: OP,
  Header: HP,
  Title: BP
}), _P = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  const r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(sf);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LH, {
    ref: t,
    show: !!(r != null && r.expanded),
    ...e,
    renderStaticNode: !0
  });
});
_P.displayName = "NavbarOffcanvas";
const UP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "span",
  ...n
}, a) => (t = mn(t, "navbar-text"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
UP.displayName = "NavbarText";
const jP = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  const {
    bsPrefix: r,
    expand: n = !0,
    variant: a = "light",
    bg: u,
    fixed: s,
    sticky: c,
    className: i,
    // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
    as: l = "nav",
    expanded: v,
    onToggle: f,
    onSelect: p,
    collapseOnSelect: g = !1,
    ...y
  } = Lv(e, {
    expanded: "onToggle"
  }), C = mn(r, "navbar"), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((...S) => {
    p == null || p(...S), g && v && (f == null || f(!1));
  }, [p, g, v, f]);
  y.role === void 0 && l !== "nav" && (y.role = "navigation");
  let h = `${C}-expand`;
  typeof n == "string" && (h = `${h}-${n}`);
  const w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    onToggle: () => f == null ? void 0 : f(!v),
    bsPrefix: C,
    expanded: !!v,
    expand: n
  }), [C, v, n, f]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(sf.Provider, {
    value: w,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(oc.Provider, {
      value: m,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(l, {
        ref: t,
        ...y,
        className: ln(i, C, n && h, a && `${C}-${a}`, u && `bg-${u}`, c && `sticky-${c}`, s && `fixed-${s}`)
      })
    })
  });
});
jP.displayName = "Navbar";
const pv = Object.assign(jP, {
  Brand: EP,
  Collapse: DP,
  Offcanvas: _P,
  Text: UP,
  Toggle: FP
}), O1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null);
var YD = Object.prototype.hasOwnProperty;
function XD(e, t, r) {
  for (r of e.keys())
    if (Sm(r, t)) return r;
}
function Sm(e, t) {
  var r, n, a;
  if (e === t) return !0;
  if (e && t && (r = e.constructor) === t.constructor) {
    if (r === Date) return e.getTime() === t.getTime();
    if (r === RegExp) return e.toString() === t.toString();
    if (r === Array) {
      if ((n = e.length) === t.length)
        for (; n-- && Sm(e[n], t[n]); ) ;
      return n === -1;
    }
    if (r === Set) {
      if (e.size !== t.size)
        return !1;
      for (n of e)
        if (a = n, a && typeof a == "object" && (a = XD(t, a), !a) || !t.has(a)) return !1;
      return !0;
    }
    if (r === Map) {
      if (e.size !== t.size)
        return !1;
      for (n of e)
        if (a = n[0], a && typeof a == "object" && (a = XD(t, a), !a) || !Sm(n[1], t.get(a)))
          return !1;
      return !0;
    }
    if (r === ArrayBuffer)
      e = new Uint8Array(e), t = new Uint8Array(t);
    else if (r === DataView) {
      if ((n = e.byteLength) === t.byteLength)
        for (; n-- && e.getInt8(n) === t.getInt8(n); ) ;
      return n === -1;
    }
    if (ArrayBuffer.isView(e)) {
      if ((n = e.byteLength) === t.byteLength)
        for (; n-- && e[n] === t[n]; ) ;
      return n === -1;
    }
    if (!r || typeof e == "object") {
      n = 0;
      for (r in e)
        if (YD.call(e, r) && ++n && !YD.call(t, r) || !(r in t) || !Sm(e[r], t[r])) return !1;
      return Object.keys(t).length === n;
    }
  }
  return e !== e && t !== t;
}
function kH(e) {
  const t = TP();
  return [e[0], (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((r) => {
    if (t())
      return e[1](r);
  }, [t, e[1]])];
}
var xs = "top", Wl = "bottom", _l = "right", Ts = "left", e2 = "auto", Jm = [xs, Wl, _l, Ts], wv = "start", Lm = "end", OH = "clippingParents", YP = "viewport", lm = "popper", NH = "reference", $D = /* @__PURE__ */ Jm.reduce(function(e, t) {
  return e.concat([t + "-" + wv, t + "-" + Lm]);
}, []), XP = /* @__PURE__ */ [].concat(Jm, [e2]).reduce(function(e, t) {
  return e.concat([t, t + "-" + wv, t + "-" + Lm]);
}, []), GH = "beforeRead", HH = "read", BH = "afterRead", VH = "beforeMain", zH = "main", WH = "afterMain", _H = "beforeWrite", UH = "write", jH = "afterWrite", YH = [GH, HH, BH, VH, zH, WH, _H, UH, jH];
function rc(e) {
  return e.split("-")[0];
}
function Js(e) {
  if (e == null)
    return window;
  if (e.toString() !== "[object Window]") {
    var t = e.ownerDocument;
    return t && t.defaultView || window;
  }
  return e;
}
function Bh(e) {
  var t = Js(e).Element;
  return e instanceof t || e instanceof Element;
}
function nc(e) {
  var t = Js(e).HTMLElement;
  return e instanceof t || e instanceof HTMLElement;
}
function t2(e) {
  if (typeof ShadowRoot > "u")
    return !1;
  var t = Js(e).ShadowRoot;
  return e instanceof t || e instanceof ShadowRoot;
}
var Ih = Math.max, XC = Math.min, Sv = Math.round;
function Zx() {
  var e = navigator.userAgentData;
  return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
    return t.brand + "/" + t.version;
  }).join(" ") : navigator.userAgent;
}
function $P() {
  return !/^((?!chrome|android).)*safari/i.test(Zx());
}
function xv(e, t, r) {
  t === void 0 && (t = !1), r === void 0 && (r = !1);
  var n = e.getBoundingClientRect(), a = 1, u = 1;
  t && nc(e) && (a = e.offsetWidth > 0 && Sv(n.width) / e.offsetWidth || 1, u = e.offsetHeight > 0 && Sv(n.height) / e.offsetHeight || 1);
  var s = Bh(e) ? Js(e) : window, c = s.visualViewport, i = !$P() && r, l = (n.left + (i && c ? c.offsetLeft : 0)) / a, v = (n.top + (i && c ? c.offsetTop : 0)) / u, f = n.width / a, p = n.height / u;
  return {
    width: f,
    height: p,
    top: v,
    right: l + f,
    bottom: v + p,
    left: l,
    x: l,
    y: v
  };
}
function r2(e) {
  var t = xv(e), r = e.offsetWidth, n = e.offsetHeight;
  return Math.abs(t.width - r) <= 1 && (r = t.width), Math.abs(t.height - n) <= 1 && (n = t.height), {
    x: e.offsetLeft,
    y: e.offsetTop,
    width: r,
    height: n
  };
}
function ZP(e, t) {
  var r = t.getRootNode && t.getRootNode();
  if (e.contains(t))
    return !0;
  if (r && t2(r)) {
    var n = t;
    do {
      if (n && e.isSameNode(n))
        return !0;
      n = n.parentNode || n.host;
    } while (n);
  }
  return !1;
}
function nf(e) {
  return e ? (e.nodeName || "").toLowerCase() : null;
}
function td(e) {
  return Js(e).getComputedStyle(e);
}
function XH(e) {
  return ["table", "td", "th"].indexOf(nf(e)) >= 0;
}
function lf(e) {
  return ((Bh(e) ? e.ownerDocument : (
    // $FlowFixMe[prop-missing]
    e.document
  )) || window.document).documentElement;
}
function N1(e) {
  return nf(e) === "html" ? e : (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    e.parentNode || // DOM Element detected
    (t2(e) ? e.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    lf(e)
  );
}
function ZD(e) {
  return !nc(e) || // https://github.com/popperjs/popper-core/issues/837
  td(e).position === "fixed" ? null : e.offsetParent;
}
function $H(e) {
  var t = /firefox/i.test(Zx()), r = /Trident/i.test(Zx());
  if (r && nc(e)) {
    var n = td(e);
    if (n.position === "fixed")
      return null;
  }
  var a = N1(e);
  for (t2(a) && (a = a.host); nc(a) && ["html", "body"].indexOf(nf(a)) < 0; ) {
    var u = td(a);
    if (u.transform !== "none" || u.perspective !== "none" || u.contain === "paint" || ["transform", "perspective"].indexOf(u.willChange) !== -1 || t && u.willChange === "filter" || t && u.filter && u.filter !== "none")
      return a;
    a = a.parentNode;
  }
  return null;
}
function Qm(e) {
  for (var t = Js(e), r = ZD(e); r && XH(r) && td(r).position === "static"; )
    r = ZD(r);
  return r && (nf(r) === "html" || nf(r) === "body" && td(r).position === "static") ? t : r || $H(e) || t;
}
function n2(e) {
  return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
}
function xm(e, t, r) {
  return Ih(e, XC(t, r));
}
function ZH(e, t, r) {
  var n = xm(e, t, r);
  return n > r ? r : n;
}
function KP() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}
function JP(e) {
  return Object.assign({}, KP(), e);
}
function QP(e, t) {
  return t.reduce(function(r, n) {
    return r[n] = e, r;
  }, {});
}
var KH = function(t, r) {
  return t = typeof t == "function" ? t(Object.assign({}, r.rects, {
    placement: r.placement
  })) : t, JP(typeof t != "number" ? t : QP(t, Jm));
};
function JH(e) {
  var t, r = e.state, n = e.name, a = e.options, u = r.elements.arrow, s = r.modifiersData.popperOffsets, c = rc(r.placement), i = n2(c), l = [Ts, _l].indexOf(c) >= 0, v = l ? "height" : "width";
  if (!(!u || !s)) {
    var f = KH(a.padding, r), p = r2(u), g = i === "y" ? xs : Ts, y = i === "y" ? Wl : _l, C = r.rects.reference[v] + r.rects.reference[i] - s[i] - r.rects.popper[v], m = s[i] - r.rects.reference[i], h = Qm(u), w = h ? i === "y" ? h.clientHeight || 0 : h.clientWidth || 0 : 0, S = C / 2 - m / 2, E = f[g], x = w - p[v] - f[y], T = w / 2 - p[v] / 2 + S, F = xm(E, T, x), P = i;
    r.modifiersData[n] = (t = {}, t[P] = F, t.centerOffset = F - T, t);
  }
}
function QH(e) {
  var t = e.state, r = e.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n;
  a != null && (typeof a == "string" && (a = t.elements.popper.querySelector(a), !a) || ZP(t.elements.popper, a) && (t.elements.arrow = a));
}
const qH = {
  name: "arrow",
  enabled: !0,
  phase: "main",
  fn: JH,
  effect: QH,
  requires: ["popperOffsets"],
  requiresIfExists: ["preventOverflow"]
};
function Tv(e) {
  return e.split("-")[1];
}
var e7 = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function t7(e, t) {
  var r = e.x, n = e.y, a = t.devicePixelRatio || 1;
  return {
    x: Sv(r * a) / a || 0,
    y: Sv(n * a) / a || 0
  };
}
function KD(e) {
  var t, r = e.popper, n = e.popperRect, a = e.placement, u = e.variation, s = e.offsets, c = e.position, i = e.gpuAcceleration, l = e.adaptive, v = e.roundOffsets, f = e.isFixed, p = s.x, g = p === void 0 ? 0 : p, y = s.y, C = y === void 0 ? 0 : y, m = typeof v == "function" ? v({
    x: g,
    y: C
  }) : {
    x: g,
    y: C
  };
  g = m.x, C = m.y;
  var h = s.hasOwnProperty("x"), w = s.hasOwnProperty("y"), S = Ts, E = xs, x = window;
  if (l) {
    var T = Qm(r), F = "clientHeight", P = "clientWidth";
    if (T === Js(r) && (T = lf(r), td(T).position !== "static" && c === "absolute" && (F = "scrollHeight", P = "scrollWidth")), T = T, a === xs || (a === Ts || a === _l) && u === Lm) {
      E = Wl;
      var k = f && T === x && x.visualViewport ? x.visualViewport.height : (
        // $FlowFixMe[prop-missing]
        T[F]
      );
      C -= k - n.height, C *= i ? 1 : -1;
    }
    if (a === Ts || (a === xs || a === Wl) && u === Lm) {
      S = _l;
      var I = f && T === x && x.visualViewport ? x.visualViewport.width : (
        // $FlowFixMe[prop-missing]
        T[P]
      );
      g -= I - n.width, g *= i ? 1 : -1;
    }
  }
  var L = Object.assign({
    position: c
  }, l && e7), A = v === !0 ? t7({
    x: g,
    y: C
  }, Js(r)) : {
    x: g,
    y: C
  };
  if (g = A.x, C = A.y, i) {
    var O;
    return Object.assign({}, L, (O = {}, O[E] = w ? "0" : "", O[S] = h ? "0" : "", O.transform = (x.devicePixelRatio || 1) <= 1 ? "translate(" + g + "px, " + C + "px)" : "translate3d(" + g + "px, " + C + "px, 0)", O));
  }
  return Object.assign({}, L, (t = {}, t[E] = w ? C + "px" : "", t[S] = h ? g + "px" : "", t.transform = "", t));
}
function r7(e) {
  var t = e.state, r = e.options, n = r.gpuAcceleration, a = n === void 0 ? !0 : n, u = r.adaptive, s = u === void 0 ? !0 : u, c = r.roundOffsets, i = c === void 0 ? !0 : c, l = {
    placement: rc(t.placement),
    variation: Tv(t.placement),
    popper: t.elements.popper,
    popperRect: t.rects.popper,
    gpuAcceleration: a,
    isFixed: t.options.strategy === "fixed"
  };
  t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, KD(Object.assign({}, l, {
    offsets: t.modifiersData.popperOffsets,
    position: t.options.strategy,
    adaptive: s,
    roundOffsets: i
  })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, KD(Object.assign({}, l, {
    offsets: t.modifiersData.arrow,
    position: "absolute",
    adaptive: !1,
    roundOffsets: i
  })))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
    "data-popper-placement": t.placement
  });
}
const n7 = {
  name: "computeStyles",
  enabled: !0,
  phase: "beforeWrite",
  fn: r7,
  data: {}
};
var cC = {
  passive: !0
};
function i7(e) {
  var t = e.state, r = e.instance, n = e.options, a = n.scroll, u = a === void 0 ? !0 : a, s = n.resize, c = s === void 0 ? !0 : s, i = Js(t.elements.popper), l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
  return u && l.forEach(function(v) {
    v.addEventListener("scroll", r.update, cC);
  }), c && i.addEventListener("resize", r.update, cC), function() {
    u && l.forEach(function(v) {
      v.removeEventListener("scroll", r.update, cC);
    }), c && i.removeEventListener("resize", r.update, cC);
  };
}
const a7 = {
  name: "eventListeners",
  enabled: !0,
  phase: "write",
  fn: function() {
  },
  effect: i7,
  data: {}
};
var o7 = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
};
function AC(e) {
  return e.replace(/left|right|bottom|top/g, function(t) {
    return o7[t];
  });
}
var s7 = {
  start: "end",
  end: "start"
};
function JD(e) {
  return e.replace(/start|end/g, function(t) {
    return s7[t];
  });
}
function i2(e) {
  var t = Js(e), r = t.pageXOffset, n = t.pageYOffset;
  return {
    scrollLeft: r,
    scrollTop: n
  };
}
function a2(e) {
  return xv(lf(e)).left + i2(e).scrollLeft;
}
function l7(e, t) {
  var r = Js(e), n = lf(e), a = r.visualViewport, u = n.clientWidth, s = n.clientHeight, c = 0, i = 0;
  if (a) {
    u = a.width, s = a.height;
    var l = $P();
    (l || !l && t === "fixed") && (c = a.offsetLeft, i = a.offsetTop);
  }
  return {
    width: u,
    height: s,
    x: c + a2(e),
    y: i
  };
}
function u7(e) {
  var t, r = lf(e), n = i2(e), a = (t = e.ownerDocument) == null ? void 0 : t.body, u = Ih(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), s = Ih(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), c = -n.scrollLeft + a2(e), i = -n.scrollTop;
  return td(a || r).direction === "rtl" && (c += Ih(r.clientWidth, a ? a.clientWidth : 0) - u), {
    width: u,
    height: s,
    x: c,
    y: i
  };
}
function o2(e) {
  var t = td(e), r = t.overflow, n = t.overflowX, a = t.overflowY;
  return /auto|scroll|overlay|hidden/.test(r + a + n);
}
function qP(e) {
  return ["html", "body", "#document"].indexOf(nf(e)) >= 0 ? e.ownerDocument.body : nc(e) && o2(e) ? e : qP(N1(e));
}
function Tm(e, t) {
  var r;
  t === void 0 && (t = []);
  var n = qP(e), a = n === ((r = e.ownerDocument) == null ? void 0 : r.body), u = Js(n), s = a ? [u].concat(u.visualViewport || [], o2(n) ? n : []) : n, c = t.concat(s);
  return a ? c : (
    // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
    c.concat(Tm(N1(s)))
  );
}
function Kx(e) {
  return Object.assign({}, e, {
    left: e.x,
    top: e.y,
    right: e.x + e.width,
    bottom: e.y + e.height
  });
}
function c7(e, t) {
  var r = xv(e, !1, t === "fixed");
  return r.top = r.top + e.clientTop, r.left = r.left + e.clientLeft, r.bottom = r.top + e.clientHeight, r.right = r.left + e.clientWidth, r.width = e.clientWidth, r.height = e.clientHeight, r.x = r.left, r.y = r.top, r;
}
function QD(e, t, r) {
  return t === YP ? Kx(l7(e, r)) : Bh(t) ? c7(t, r) : Kx(u7(lf(e)));
}
function d7(e) {
  var t = Tm(N1(e)), r = ["absolute", "fixed"].indexOf(td(e).position) >= 0, n = r && nc(e) ? Qm(e) : e;
  return Bh(n) ? t.filter(function(a) {
    return Bh(a) && ZP(a, n) && nf(a) !== "body";
  }) : [];
}
function f7(e, t, r, n) {
  var a = t === "clippingParents" ? d7(e) : [].concat(t), u = [].concat(a, [r]), s = u[0], c = u.reduce(function(i, l) {
    var v = QD(e, l, n);
    return i.top = Ih(v.top, i.top), i.right = XC(v.right, i.right), i.bottom = XC(v.bottom, i.bottom), i.left = Ih(v.left, i.left), i;
  }, QD(e, s, n));
  return c.width = c.right - c.left, c.height = c.bottom - c.top, c.x = c.left, c.y = c.top, c;
}
function eI(e) {
  var t = e.reference, r = e.element, n = e.placement, a = n ? rc(n) : null, u = n ? Tv(n) : null, s = t.x + t.width / 2 - r.width / 2, c = t.y + t.height / 2 - r.height / 2, i;
  switch (a) {
    case xs:
      i = {
        x: s,
        y: t.y - r.height
      };
      break;
    case Wl:
      i = {
        x: s,
        y: t.y + t.height
      };
      break;
    case _l:
      i = {
        x: t.x + t.width,
        y: c
      };
      break;
    case Ts:
      i = {
        x: t.x - r.width,
        y: c
      };
      break;
    default:
      i = {
        x: t.x,
        y: t.y
      };
  }
  var l = a ? n2(a) : null;
  if (l != null) {
    var v = l === "y" ? "height" : "width";
    switch (u) {
      case wv:
        i[l] = i[l] - (t[v] / 2 - r[v] / 2);
        break;
      case Lm:
        i[l] = i[l] + (t[v] / 2 - r[v] / 2);
        break;
    }
  }
  return i;
}
function km(e, t) {
  t === void 0 && (t = {});
  var r = t, n = r.placement, a = n === void 0 ? e.placement : n, u = r.strategy, s = u === void 0 ? e.strategy : u, c = r.boundary, i = c === void 0 ? OH : c, l = r.rootBoundary, v = l === void 0 ? YP : l, f = r.elementContext, p = f === void 0 ? lm : f, g = r.altBoundary, y = g === void 0 ? !1 : g, C = r.padding, m = C === void 0 ? 0 : C, h = JP(typeof m != "number" ? m : QP(m, Jm)), w = p === lm ? NH : lm, S = e.rects.popper, E = e.elements[y ? w : p], x = f7(Bh(E) ? E : E.contextElement || lf(e.elements.popper), i, v, s), T = xv(e.elements.reference), F = eI({
    reference: T,
    element: S,
    strategy: "absolute",
    placement: a
  }), P = Kx(Object.assign({}, S, F)), k = p === lm ? P : T, I = {
    top: x.top - k.top + h.top,
    bottom: k.bottom - x.bottom + h.bottom,
    left: x.left - k.left + h.left,
    right: k.right - x.right + h.right
  }, L = e.modifiersData.offset;
  if (p === lm && L) {
    var A = L[a];
    Object.keys(I).forEach(function(O) {
      var N = [_l, Wl].indexOf(O) >= 0 ? 1 : -1, Y = [xs, Wl].indexOf(O) >= 0 ? "y" : "x";
      I[O] += A[Y] * N;
    });
  }
  return I;
}
function h7(e, t) {
  t === void 0 && (t = {});
  var r = t, n = r.placement, a = r.boundary, u = r.rootBoundary, s = r.padding, c = r.flipVariations, i = r.allowedAutoPlacements, l = i === void 0 ? XP : i, v = Tv(n), f = v ? c ? $D : $D.filter(function(y) {
    return Tv(y) === v;
  }) : Jm, p = f.filter(function(y) {
    return l.indexOf(y) >= 0;
  });
  p.length === 0 && (p = f);
  var g = p.reduce(function(y, C) {
    return y[C] = km(e, {
      placement: C,
      boundary: a,
      rootBoundary: u,
      padding: s
    })[rc(C)], y;
  }, {});
  return Object.keys(g).sort(function(y, C) {
    return g[y] - g[C];
  });
}
function p7(e) {
  if (rc(e) === e2)
    return [];
  var t = AC(e);
  return [JD(e), t, JD(t)];
}
function v7(e) {
  var t = e.state, r = e.options, n = e.name;
  if (!t.modifiersData[n]._skip) {
    for (var a = r.mainAxis, u = a === void 0 ? !0 : a, s = r.altAxis, c = s === void 0 ? !0 : s, i = r.fallbackPlacements, l = r.padding, v = r.boundary, f = r.rootBoundary, p = r.altBoundary, g = r.flipVariations, y = g === void 0 ? !0 : g, C = r.allowedAutoPlacements, m = t.options.placement, h = rc(m), w = h === m, S = i || (w || !y ? [AC(m)] : p7(m)), E = [m].concat(S).reduce(function(ce, X) {
      return ce.concat(rc(X) === e2 ? h7(t, {
        placement: X,
        boundary: v,
        rootBoundary: f,
        padding: l,
        flipVariations: y,
        allowedAutoPlacements: C
      }) : X);
    }, []), x = t.rects.reference, T = t.rects.popper, F = /* @__PURE__ */ new Map(), P = !0, k = E[0], I = 0; I < E.length; I++) {
      var L = E[I], A = rc(L), O = Tv(L) === wv, N = [xs, Wl].indexOf(A) >= 0, Y = N ? "width" : "height", j = km(t, {
        placement: L,
        boundary: v,
        rootBoundary: f,
        altBoundary: p,
        padding: l
      }), te = N ? O ? _l : Ts : O ? Wl : xs;
      x[Y] > T[Y] && (te = AC(te));
      var re = AC(te), z = [];
      if (u && z.push(j[A] <= 0), c && z.push(j[te] <= 0, j[re] <= 0), z.every(function(ce) {
        return ce;
      })) {
        k = L, P = !1;
        break;
      }
      F.set(L, z);
    }
    if (P)
      for (var Z = y ? 3 : 1, W = function(X) {
        var U = E.find(function(ne) {
          var se = F.get(ne);
          if (se)
            return se.slice(0, X).every(function(le) {
              return le;
            });
        });
        if (U)
          return k = U, "break";
      }, q = Z; q > 0; q--) {
        var ie = W(q);
        if (ie === "break") break;
      }
    t.placement !== k && (t.modifiersData[n]._skip = !0, t.placement = k, t.reset = !0);
  }
}
const g7 = {
  name: "flip",
  enabled: !0,
  phase: "main",
  fn: v7,
  requiresIfExists: ["offset"],
  data: {
    _skip: !1
  }
};
function qD(e, t, r) {
  return r === void 0 && (r = {
    x: 0,
    y: 0
  }), {
    top: e.top - t.height - r.y,
    right: e.right - t.width + r.x,
    bottom: e.bottom - t.height + r.y,
    left: e.left - t.width - r.x
  };
}
function e3(e) {
  return [xs, _l, Wl, Ts].some(function(t) {
    return e[t] >= 0;
  });
}
function m7(e) {
  var t = e.state, r = e.name, n = t.rects.reference, a = t.rects.popper, u = t.modifiersData.preventOverflow, s = km(t, {
    elementContext: "reference"
  }), c = km(t, {
    altBoundary: !0
  }), i = qD(s, n), l = qD(c, a, u), v = e3(i), f = e3(l);
  t.modifiersData[r] = {
    referenceClippingOffsets: i,
    popperEscapeOffsets: l,
    isReferenceHidden: v,
    hasPopperEscaped: f
  }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
    "data-popper-reference-hidden": v,
    "data-popper-escaped": f
  });
}
const y7 = {
  name: "hide",
  enabled: !0,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: m7
};
function C7(e, t, r) {
  var n = rc(e), a = [Ts, xs].indexOf(n) >= 0 ? -1 : 1, u = typeof r == "function" ? r(Object.assign({}, t, {
    placement: e
  })) : r, s = u[0], c = u[1];
  return s = s || 0, c = (c || 0) * a, [Ts, _l].indexOf(n) >= 0 ? {
    x: c,
    y: s
  } : {
    x: s,
    y: c
  };
}
function b7(e) {
  var t = e.state, r = e.options, n = e.name, a = r.offset, u = a === void 0 ? [0, 0] : a, s = XP.reduce(function(v, f) {
    return v[f] = C7(f, t.rects, u), v;
  }, {}), c = s[t.placement], i = c.x, l = c.y;
  t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += i, t.modifiersData.popperOffsets.y += l), t.modifiersData[n] = s;
}
const w7 = {
  name: "offset",
  enabled: !0,
  phase: "main",
  requires: ["popperOffsets"],
  fn: b7
};
function S7(e) {
  var t = e.state, r = e.name;
  t.modifiersData[r] = eI({
    reference: t.rects.reference,
    element: t.rects.popper,
    strategy: "absolute",
    placement: t.placement
  });
}
const x7 = {
  name: "popperOffsets",
  enabled: !0,
  phase: "read",
  fn: S7,
  data: {}
};
function T7(e) {
  return e === "x" ? "y" : "x";
}
function R7(e) {
  var t = e.state, r = e.options, n = e.name, a = r.mainAxis, u = a === void 0 ? !0 : a, s = r.altAxis, c = s === void 0 ? !1 : s, i = r.boundary, l = r.rootBoundary, v = r.altBoundary, f = r.padding, p = r.tether, g = p === void 0 ? !0 : p, y = r.tetherOffset, C = y === void 0 ? 0 : y, m = km(t, {
    boundary: i,
    rootBoundary: l,
    padding: f,
    altBoundary: v
  }), h = rc(t.placement), w = Tv(t.placement), S = !w, E = n2(h), x = T7(E), T = t.modifiersData.popperOffsets, F = t.rects.reference, P = t.rects.popper, k = typeof C == "function" ? C(Object.assign({}, t.rects, {
    placement: t.placement
  })) : C, I = typeof k == "number" ? {
    mainAxis: k,
    altAxis: k
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, k), L = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, A = {
    x: 0,
    y: 0
  };
  if (T) {
    if (u) {
      var O, N = E === "y" ? xs : Ts, Y = E === "y" ? Wl : _l, j = E === "y" ? "height" : "width", te = T[E], re = te + m[N], z = te - m[Y], Z = g ? -P[j] / 2 : 0, W = w === wv ? F[j] : P[j], q = w === wv ? -P[j] : -F[j], ie = t.elements.arrow, ce = g && ie ? r2(ie) : {
        width: 0,
        height: 0
      }, X = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : KP(), U = X[N], ne = X[Y], se = xm(0, F[j], ce[j]), le = S ? F[j] / 2 - Z - se - U - I.mainAxis : W - se - U - I.mainAxis, ue = S ? -F[j] / 2 + Z + se + ne + I.mainAxis : q + se + ne + I.mainAxis, ve = t.elements.arrow && Qm(t.elements.arrow), be = ve ? E === "y" ? ve.clientTop || 0 : ve.clientLeft || 0 : 0, Me = (O = L == null ? void 0 : L[E]) != null ? O : 0, Ge = te + le - Me - be, we = te + ue - Me, Re = xm(g ? XC(re, Ge) : re, te, g ? Ih(z, we) : z);
      T[E] = Re, A[E] = Re - te;
    }
    if (c) {
      var Ae, K = E === "x" ? xs : Ts, ee = E === "x" ? Wl : _l, oe = T[x], _ = x === "y" ? "height" : "width", V = oe + m[K], fe = oe - m[ee], $ = [xs, Ts].indexOf(h) !== -1, he = (Ae = L == null ? void 0 : L[x]) != null ? Ae : 0, me = $ ? V : oe - F[_] - P[_] - he + I.altAxis, xe = $ ? oe + F[_] + P[_] - he - I.altAxis : fe, Fe = g && $ ? ZH(me, oe, xe) : xm(g ? me : V, oe, g ? xe : fe);
      T[x] = Fe, A[x] = Fe - oe;
    }
    t.modifiersData[n] = A;
  }
}
const A7 = {
  name: "preventOverflow",
  enabled: !0,
  phase: "main",
  fn: R7,
  requiresIfExists: ["offset"]
};
function E7(e) {
  return {
    scrollLeft: e.scrollLeft,
    scrollTop: e.scrollTop
  };
}
function M7(e) {
  return e === Js(e) || !nc(e) ? i2(e) : E7(e);
}
function D7(e) {
  var t = e.getBoundingClientRect(), r = Sv(t.width) / e.offsetWidth || 1, n = Sv(t.height) / e.offsetHeight || 1;
  return r !== 1 || n !== 1;
}
function F7(e, t, r) {
  r === void 0 && (r = !1);
  var n = nc(t), a = nc(t) && D7(t), u = lf(t), s = xv(e, a, r), c = {
    scrollLeft: 0,
    scrollTop: 0
  }, i = {
    x: 0,
    y: 0
  };
  return (n || !n && !r) && ((nf(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
  o2(u)) && (c = M7(t)), nc(t) ? (i = xv(t, !0), i.x += t.clientLeft, i.y += t.clientTop) : u && (i.x = a2(u))), {
    x: s.left + c.scrollLeft - i.x,
    y: s.top + c.scrollTop - i.y,
    width: s.width,
    height: s.height
  };
}
function P7(e) {
  var t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = [];
  e.forEach(function(u) {
    t.set(u.name, u);
  });
  function a(u) {
    r.add(u.name);
    var s = [].concat(u.requires || [], u.requiresIfExists || []);
    s.forEach(function(c) {
      if (!r.has(c)) {
        var i = t.get(c);
        i && a(i);
      }
    }), n.push(u);
  }
  return e.forEach(function(u) {
    r.has(u.name) || a(u);
  }), n;
}
function I7(e) {
  var t = P7(e);
  return YH.reduce(function(r, n) {
    return r.concat(t.filter(function(a) {
      return a.phase === n;
    }));
  }, []);
}
function L7(e) {
  var t;
  return function() {
    return t || (t = new Promise(function(r) {
      Promise.resolve().then(function() {
        t = void 0, r(e());
      });
    })), t;
  };
}
function k7(e) {
  var t = e.reduce(function(r, n) {
    var a = r[n.name];
    return r[n.name] = a ? Object.assign({}, a, n, {
      options: Object.assign({}, a.options, n.options),
      data: Object.assign({}, a.data, n.data)
    }) : n, r;
  }, {});
  return Object.keys(t).map(function(r) {
    return t[r];
  });
}
var t3 = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function r3() {
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
    t[r] = arguments[r];
  return !t.some(function(n) {
    return !(n && typeof n.getBoundingClientRect == "function");
  });
}
function O7(e) {
  e === void 0 && (e = {});
  var t = e, r = t.defaultModifiers, n = r === void 0 ? [] : r, a = t.defaultOptions, u = a === void 0 ? t3 : a;
  return function(c, i, l) {
    l === void 0 && (l = u);
    var v = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, t3, u),
      modifiersData: {},
      elements: {
        reference: c,
        popper: i
      },
      attributes: {},
      styles: {}
    }, f = [], p = !1, g = {
      state: v,
      setOptions: function(h) {
        var w = typeof h == "function" ? h(v.options) : h;
        C(), v.options = Object.assign({}, u, v.options, w), v.scrollParents = {
          reference: Bh(c) ? Tm(c) : c.contextElement ? Tm(c.contextElement) : [],
          popper: Tm(i)
        };
        var S = I7(k7([].concat(n, v.options.modifiers)));
        return v.orderedModifiers = S.filter(function(E) {
          return E.enabled;
        }), y(), g.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function() {
        if (!p) {
          var h = v.elements, w = h.reference, S = h.popper;
          if (r3(w, S)) {
            v.rects = {
              reference: F7(w, Qm(S), v.options.strategy === "fixed"),
              popper: r2(S)
            }, v.reset = !1, v.placement = v.options.placement, v.orderedModifiers.forEach(function(I) {
              return v.modifiersData[I.name] = Object.assign({}, I.data);
            });
            for (var E = 0; E < v.orderedModifiers.length; E++) {
              if (v.reset === !0) {
                v.reset = !1, E = -1;
                continue;
              }
              var x = v.orderedModifiers[E], T = x.fn, F = x.options, P = F === void 0 ? {} : F, k = x.name;
              typeof T == "function" && (v = T({
                state: v,
                options: P,
                name: k,
                instance: g
              }) || v);
            }
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: L7(function() {
        return new Promise(function(m) {
          g.forceUpdate(), m(v);
        });
      }),
      destroy: function() {
        C(), p = !0;
      }
    };
    if (!r3(c, i))
      return g;
    g.setOptions(l).then(function(m) {
      !p && l.onFirstUpdate && l.onFirstUpdate(m);
    });
    function y() {
      v.orderedModifiers.forEach(function(m) {
        var h = m.name, w = m.options, S = w === void 0 ? {} : w, E = m.effect;
        if (typeof E == "function") {
          var x = E({
            state: v,
            name: h,
            instance: g,
            options: S
          }), T = function() {
          };
          f.push(x || T);
        }
      });
    }
    function C() {
      f.forEach(function(m) {
        return m();
      }), f = [];
    }
    return g;
  };
}
const N7 = O7({
  defaultModifiers: [y7, x7, n7, a7, w7, g7, A7, qH]
}), G7 = ["enabled", "placement", "strategy", "modifiers"];
function H7(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
const B7 = {
  name: "applyStyles",
  enabled: !1,
  phase: "afterWrite",
  fn: () => {
  }
}, V7 = {
  name: "ariaDescribedBy",
  enabled: !0,
  phase: "afterWrite",
  effect: ({
    state: e
  }) => () => {
    const {
      reference: t,
      popper: r
    } = e.elements;
    if ("removeAttribute" in t) {
      const n = (t.getAttribute("aria-describedby") || "").split(",").filter((a) => a.trim() !== r.id);
      n.length ? t.setAttribute("aria-describedby", n.join(",")) : t.removeAttribute("aria-describedby");
    }
  },
  fn: ({
    state: e
  }) => {
    var t;
    const {
      popper: r,
      reference: n
    } = e.elements, a = (t = r.getAttribute("role")) == null ? void 0 : t.toLowerCase();
    if (r.id && a === "tooltip" && "setAttribute" in n) {
      const u = n.getAttribute("aria-describedby");
      if (u && u.split(",").indexOf(r.id) !== -1)
        return;
      n.setAttribute("aria-describedby", u ? `${u},${r.id}` : r.id);
    }
  }
}, z7 = [];
function W7(e, t, r = {}) {
  let {
    enabled: n = !0,
    placement: a = "bottom",
    strategy: u = "absolute",
    modifiers: s = z7
  } = r, c = H7(r, G7);
  const i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(s), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    var m;
    (m = l.current) == null || m.update();
  }, []), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    var m;
    (m = l.current) == null || m.forceUpdate();
  }, []), [p, g] = kH((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({
    placement: a,
    update: v,
    forceUpdate: f,
    attributes: {},
    styles: {
      popper: {},
      arrow: {}
    }
  })), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    name: "updateStateModifier",
    enabled: !0,
    phase: "write",
    requires: ["computeStyles"],
    fn: ({
      state: m
    }) => {
      const h = {}, w = {};
      Object.keys(m.elements).forEach((S) => {
        h[S] = m.styles[S], w[S] = m.attributes[S];
      }), g({
        state: m,
        styles: h,
        attributes: w,
        update: v,
        forceUpdate: f,
        placement: m.placement
      });
    }
  }), [v, f, g]), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => (Sm(i.current, s) || (i.current = s), i.current), [s]);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    !l.current || !n || l.current.setOptions({
      placement: a,
      strategy: u,
      modifiers: [...C, y, B7]
    });
  }, [u, a, y, n, C]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!(!n || e == null || t == null))
      return l.current = N7(e, t, Object.assign({}, c, {
        placement: a,
        strategy: u,
        modifiers: [...C, V7, y]
      })), () => {
        l.current != null && (l.current.destroy(), l.current = void 0, g((m) => Object.assign({}, m, {
          attributes: {},
          styles: {
            popper: {}
          }
        })));
      };
  }, [n, e, t]), p;
}
const n3 = () => {
};
function _7(e) {
  return e.button === 0;
}
function U7(e) {
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
}
const nx = (e) => e && ("current" in e ? e.current : e), i3 = {
  click: "mousedown",
  mouseup: "mousedown",
  pointerup: "pointerdown"
};
function j7(e, t = n3, {
  disabled: r,
  clickTrigger: n = "click"
} = {}) {
  const a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((l) => {
    const v = nx(e);
    P1(!!v, "ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"), a.current = !v || U7(l) || !_7(l) || !!YC(v, l.target) || u.current, u.current = !1;
  }, [e]), c = wa((l) => {
    const v = nx(e);
    v && YC(v, l.target) && (u.current = !0);
  }), i = wa((l) => {
    a.current || t(l);
  });
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var l, v;
    if (r || e == null) return;
    const f = Ym(nx(e)), p = f.defaultView || window;
    let g = (l = p.event) != null ? l : (v = p.parent) == null ? void 0 : v.event, y = null;
    i3[n] && (y = qd(f, i3[n], c, !0));
    const C = qd(f, n, s, !0), m = qd(f, n, (w) => {
      if (w === g) {
        g = void 0;
        return;
      }
      i(w);
    });
    let h = [];
    return "ontouchstart" in f.documentElement && (h = [].slice.call(f.body.children).map((w) => qd(w, "mousemove", n3))), () => {
      y == null || y(), C(), m(), h.forEach((w) => w());
    };
  }, [e, r, n, s, c, i]);
}
function Y7(e) {
  const t = {};
  return Array.isArray(e) ? (e == null || e.forEach((r) => {
    t[r.name] = r;
  }), t) : e || t;
}
function X7(e = {}) {
  return Array.isArray(e) ? e : Object.keys(e).map((t) => (e[t].name = t, e[t]));
}
function $7({
  enabled: e,
  enableEvents: t,
  placement: r,
  flip: n,
  offset: a,
  fixed: u,
  containerPadding: s,
  arrowElement: c,
  popperConfig: i = {}
}) {
  var l, v, f, p, g;
  const y = Y7(i.modifiers);
  return Object.assign({}, i, {
    placement: r,
    enabled: e,
    strategy: u ? "fixed" : i.strategy,
    modifiers: X7(Object.assign({}, y, {
      eventListeners: {
        enabled: t,
        options: (l = y.eventListeners) == null ? void 0 : l.options
      },
      preventOverflow: Object.assign({}, y.preventOverflow, {
        options: s ? Object.assign({
          padding: s
        }, (v = y.preventOverflow) == null ? void 0 : v.options) : (f = y.preventOverflow) == null ? void 0 : f.options
      }),
      offset: {
        options: Object.assign({
          offset: a
        }, (p = y.offset) == null ? void 0 : p.options)
      },
      arrow: Object.assign({}, y.arrow, {
        enabled: !!c,
        options: Object.assign({}, (g = y.arrow) == null ? void 0 : g.options, {
          element: c
        })
      }),
      flip: Object.assign({
        enabled: !!n
      }, y.flip)
    }))
  });
}
const Z7 = ["children", "usePopper"];
function K7(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
const J7 = () => {
};
function tI(e = {}) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(O1), [r, n] = xP(), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), {
    flip: u,
    offset: s,
    rootCloseEvent: c,
    fixed: i = !1,
    placement: l,
    popperConfig: v = {},
    enableEventListeners: f = !0,
    usePopper: p = !!t
  } = e, g = (t == null ? void 0 : t.show) == null ? !!e.show : t.show;
  g && !a.current && (a.current = !0);
  const y = (T) => {
    t == null || t.toggle(!1, T);
  }, {
    placement: C,
    setMenu: m,
    menuElement: h,
    toggleElement: w
  } = t || {}, S = W7(w, h, $7({
    placement: l || C || "bottom-start",
    enabled: p,
    enableEvents: f ?? g,
    offset: s,
    flip: u,
    fixed: i,
    arrowElement: r,
    popperConfig: v
  })), E = Object.assign({
    ref: m || J7,
    "aria-labelledby": w == null ? void 0 : w.id
  }, S.attributes.popper, {
    style: S.styles.popper
  }), x = {
    show: g,
    placement: C,
    hasShown: a.current,
    toggle: t == null ? void 0 : t.toggle,
    popper: p ? S : null,
    arrowProps: p ? Object.assign({
      ref: n
    }, S.attributes.arrow, {
      style: S.styles.arrow
    }) : {}
  };
  return j7(h, y, {
    clickTrigger: c,
    disabled: !g
  }), [E, x];
}
function rI(e) {
  let {
    children: t,
    usePopper: r = !0
  } = e, n = K7(e, Z7);
  const [a, u] = tI(Object.assign({}, n, {
    usePopper: r
  }));
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: t(a, u)
  });
}
rI.displayName = "DropdownMenu";
const nI = (e) => {
  var t;
  return ((t = e.getAttribute("role")) == null ? void 0 : t.toLowerCase()) === "menu";
}, a3 = () => {
};
function iI() {
  const e = BF(), {
    show: t = !1,
    toggle: r = a3,
    setToggle: n,
    menuElement: a
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(O1) || {}, u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((c) => {
    r(!t, c);
  }, [t, r]), s = {
    id: e,
    ref: n || a3,
    onClick: u,
    "aria-expanded": !!t
  };
  return a && nI(a) && (s["aria-haspopup"] = !0), [s, {
    show: t,
    toggle: r
  }];
}
function aI({
  children: e
}) {
  const [t, r] = iI();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: e(t, r)
  });
}
aI.displayName = "DropdownToggle";
const Q7 = ["eventKey", "disabled", "onClick", "active", "as"];
function q7(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
    if (t.indexOf(n) >= 0) continue;
    r[n] = e[n];
  }
  return r;
}
function oI({
  key: e,
  href: t,
  active: r,
  disabled: n,
  onClick: a
}) {
  const u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(oc), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(I1), {
    activeKey: c
  } = s || {}, i = Hh(e, t), l = r == null && e != null ? Hh(c) === i : r;
  return [{
    onClick: wa((f) => {
      n || (a == null || a(f), u && !f.isPropagationStopped() && u(i, f));
    }),
    "aria-disabled": n || void 0,
    "aria-selected": l,
    [kv("dropdown-item")]: ""
  }, {
    isActive: l
  }];
}
const sI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  let {
    eventKey: r,
    disabled: n,
    onClick: a,
    active: u,
    as: s = ZT
  } = e, c = q7(e, Q7);
  const [i] = oI({
    key: r,
    href: c.href,
    disabled: n,
    onClick: a,
    active: u
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s, Object.assign({}, c, {
    ref: t
  }, i));
});
sI.displayName = "DropdownItem";
function o3() {
  const e = CP(), t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((n) => {
    t.current = n, e();
  }, [e]);
  return [t, r];
}
function qm({
  defaultShow: e,
  show: t,
  onSelect: r,
  onToggle: n,
  itemSelector: a = `* [${kv("dropdown-item")}]`,
  focusFirstItemOnShow: u,
  placement: s = "bottom-start",
  children: c
}) {
  const i = k1(), [l, v] = GF(t, e, n), [f, p] = o3(), g = f.current, [y, C] = o3(), m = y.current, h = RP(l), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(oc), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((L, A, O = A == null ? void 0 : A.type) => {
    v(L, {
      originalEvent: A,
      source: O
    });
  }, [v]), T = wa((L, A) => {
    r == null || r(L, A), x(!1, A, "select"), A.isPropagationStopped() || E == null || E(L, A);
  }), F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    toggle: x,
    placement: s,
    show: l,
    menuElement: g,
    toggleElement: m,
    setMenu: p,
    setToggle: C
  }), [x, s, l, g, m, p, C]);
  g && h && !l && (S.current = g.contains(g.ownerDocument.activeElement));
  const P = wa(() => {
    m && m.focus && m.focus();
  }), k = wa(() => {
    const L = w.current;
    let A = u;
    if (A == null && (A = f.current && nI(f.current) ? "keyboard" : !1), A === !1 || A === "keyboard" && !/^key.+$/.test(L))
      return;
    const O = Uc(f.current, a)[0];
    O && O.focus && O.focus();
  });
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    l ? k() : S.current && (S.current = !1, P());
  }, [l, S, P, k]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    w.current = null;
  });
  const I = (L, A) => {
    if (!f.current) return null;
    const O = Uc(f.current, a);
    let N = O.indexOf(L) + A;
    return N = Math.max(0, Math.min(N, O.length)), O[N];
  };
  return K8((0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => i.document, [i]), "keydown", (L) => {
    var A, O;
    const {
      key: N
    } = L, Y = L.target, j = (A = f.current) == null ? void 0 : A.contains(Y), te = (O = y.current) == null ? void 0 : O.contains(Y);
    if (/input|textarea/i.test(Y.tagName) && (N === " " || N !== "Escape" && j || N === "Escape" && Y.type === "search") || !j && !te || N === "Tab" && (!f.current || !l))
      return;
    w.current = L.type;
    const z = {
      originalEvent: L,
      source: L.type
    };
    switch (N) {
      case "ArrowUp": {
        const Z = I(Y, -1);
        Z && Z.focus && Z.focus(), L.preventDefault();
        return;
      }
      case "ArrowDown":
        if (L.preventDefault(), !l)
          v(!0, z);
        else {
          const Z = I(Y, 1);
          Z && Z.focus && Z.focus();
        }
        return;
      case "Tab":
        OT(Y.ownerDocument, "keyup", (Z) => {
          var W;
          (Z.key === "Tab" && !Z.target || !((W = f.current) != null && W.contains(Z.target))) && v(!1, z);
        }, {
          once: !0
        });
        break;
      case "Escape":
        N === "Escape" && (L.preventDefault(), L.stopPropagation()), v(!1, z);
        break;
    }
  }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(oc.Provider, {
    value: T,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(O1.Provider, {
      value: F,
      children: c
    })
  });
}
qm.displayName = "Dropdown";
qm.Menu = rI;
qm.Toggle = aI;
qm.Item = sI;
const s2 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext({});
s2.displayName = "DropdownContext";
const $C = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "hr",
  role: n = "separator",
  ...a
}, u) => (t = mn(t, "dropdown-divider"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: u,
  className: ln(e, t),
  role: n,
  ...a
})));
$C.displayName = "DropdownDivider";
const lI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  role: n = "heading",
  ...a
}, u) => (t = mn(t, "dropdown-header"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: u,
  className: ln(e, t),
  role: n,
  ...a
})));
lI.displayName = "DropdownHeader";
const uI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  eventKey: r,
  disabled: n = !1,
  onClick: a,
  active: u,
  as: s = Zm,
  ...c
}, i) => {
  const l = mn(e, "dropdown-item"), [v, f] = oI({
    key: r,
    href: c.href,
    disabled: n,
    onClick: a,
    active: u
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s, {
    ...c,
    ...v,
    ref: i,
    className: ln(t, l, f.isActive && "active", n && "disabled")
  });
});
uI.displayName = "DropdownItem";
const cI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "span",
  ...n
}, a) => (t = mn(t, "dropdown-item-text"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
cI.displayName = "DropdownItemText";
const G1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null);
G1.displayName = "InputGroupContext";
function dI(e, t) {
  if (false) {}
  const r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((n) => {
    n == null || !n.isReactComponent || ( true ? HD(!1, `${t} injected a ref to a provided \`as\` component that resolved to a component instance instead of a DOM element. Use \`React.forwardRef\` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element`) : 0);
  }, [t]);
  return ad(r, e);
}
const lv = hn.oneOf(["start", "end"]), eB = hn.oneOfType([lv, hn.shape({
  sm: lv
}), hn.shape({
  md: lv
}), hn.shape({
  lg: lv
}), hn.shape({
  xl: lv
}), hn.shape({
  xxl: lv
}), hn.object]);
function fI(e, t, r) {
  const n = r ? "top-end" : "top-start", a = r ? "top-start" : "top-end", u = r ? "bottom-end" : "bottom-start", s = r ? "bottom-start" : "bottom-end", c = r ? "right-start" : "left-start", i = r ? "right-end" : "left-end", l = r ? "left-start" : "right-start", v = r ? "left-end" : "right-end";
  let f = e ? s : u;
  return t === "up" ? f = e ? a : n : t === "end" ? f = e ? v : l : t === "start" ? f = e ? i : c : t === "down-centered" ? f = "bottom" : t === "up-centered" && (f = "top"), f;
}
const l2 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  align: r,
  rootCloseEvent: n,
  flip: a = !0,
  show: u,
  renderOnMount: s,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: c = "div",
  popperConfig: i,
  variant: l,
  ...v
}, f) => {
  let p = !1;
  const g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(sf), y = mn(e, "dropdown-menu"), {
    align: C,
    drop: m,
    isRTL: h
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(s2);
  r = r || C;
  const w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(G1), S = [];
  if (r)
    if (typeof r == "object") {
      const L = Object.keys(r);
      if ( true && P1(L.length === 1, "There should only be 1 breakpoint when passing an object to `align`"), L.length) {
        const A = L[0], O = r[A];
        p = O === "start", S.push(`${y}-${A}-${O}`);
      }
    } else r === "end" && (p = !0);
  const E = fI(p, m, h), [x, {
    hasShown: T,
    popper: F,
    show: P,
    toggle: k
  }] = tI({
    flip: a,
    rootCloseEvent: n,
    show: u,
    usePopper: !g && S.length === 0,
    offset: [0, 2],
    popperConfig: i,
    placement: E
  });
  if (x.ref = ad(dI(f, "DropdownMenu"), x.ref), jC(() => {
    P && (F == null || F.update());
  }, [P]), !T && !s && !w) return null;
  typeof c != "string" && (x.show = P, x.close = () => k == null ? void 0 : k(!1), x.align = r);
  let I = v.style;
  return F != null && F.placement && (I = {
    ...v.style,
    ...x.style
  }, v["x-placement"] = F.placement), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(c, {
    ...v,
    ...x,
    style: I,
    ...(S.length || g) && {
      "data-bs-popper": "static"
    },
    className: ln(t, y, P && "show", p && `${y}-end`, l && `${y}-${l}`, ...S)
  });
});
l2.displayName = "DropdownMenu";
const Ki = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  as: e,
  bsPrefix: t,
  variant: r = "primary",
  size: n,
  active: a = !1,
  disabled: u = !1,
  className: s,
  ...c
}, i) => {
  const l = mn(t, "btn"), [v, {
    tagName: f
  }] = $T({
    tagName: e,
    disabled: u,
    ...c
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(f, {
    ...v,
    ...c,
    ref: i,
    disabled: u,
    className: ln(s, l, a && "active", r && `${l}-${r}`, n && `${l}-${n}`, c.href && u && "disabled")
  });
});
Ki.displayName = "Button";
const u2 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  split: t,
  className: r,
  childBsPrefix: n,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: a = Ki,
  ...u
}, s) => {
  const c = mn(e, "dropdown-toggle"), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(O1);
  n !== void 0 && (u.bsPrefix = n);
  const [l] = iI();
  return l.ref = ad(l.ref, dI(s, "DropdownToggle")), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(a, {
    className: ln(r, c, t && `${c}-split`, (i == null ? void 0 : i.show) && "show"),
    ...l,
    ...u
  });
});
u2.displayName = "DropdownToggle";
const hI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  const {
    bsPrefix: r,
    drop: n = "down",
    show: a,
    className: u,
    align: s = "start",
    onSelect: c,
    onToggle: i,
    focusFirstItemOnShow: l,
    // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
    as: v = "div",
    navbar: f,
    autoClose: p = !0,
    ...g
  } = Lv(e, {
    show: "onToggle"
  }), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(G1), C = mn(r, "dropdown"), m = JF(), h = (F) => p === !1 ? F === "click" : p === "inside" ? F !== "rootClose" : p === "outside" ? F !== "select" : !0, w = wa((F, P) => {
    var k, I;
    !((k = P.originalEvent) == null || (I = k.target) == null) && I.classList.contains("dropdown-toggle") && P.source === "mousedown" || (P.originalEvent.currentTarget === document && (P.source !== "keydown" || P.originalEvent.key === "Escape") && (P.source = "rootClose"), h(P.source) && (i == null || i(F, P)));
  }), E = fI(s === "end", n, m), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    align: s,
    drop: n,
    isRTL: m
  }), [s, n, m]), T = {
    down: C,
    "down-centered": `${C}-center`,
    up: "dropup",
    "up-centered": "dropup-center dropup",
    end: "dropend",
    start: "dropstart"
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s2.Provider, {
    value: x,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(qm, {
      placement: E,
      show: a,
      onSelect: c,
      onToggle: w,
      focusFirstItemOnShow: l,
      itemSelector: `.${C}-item:not(.disabled):not(:disabled)`,
      children: y ? g.children : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(v, {
        ...g,
        ref: t,
        className: ln(u, a && "show", T[n])
      })
    })
  });
});
hI.displayName = "Dropdown";
const Za = Object.assign(hI, {
  Toggle: u2,
  Menu: l2,
  Item: uI,
  ItemText: cI,
  Divider: $C,
  Header: lI
}), pI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  id: e,
  title: t,
  children: r,
  bsPrefix: n,
  className: a,
  rootCloseEvent: u,
  menuRole: s,
  disabled: c,
  active: i,
  renderMenuOnMount: l,
  menuVariant: v,
  ...f
}, p) => {
  const g = mn(void 0, "nav-item");
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Za, {
    ref: p,
    ...f,
    className: ln(a, g),
    children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Toggle, {
      id: e,
      eventKey: null,
      active: i,
      disabled: c,
      childBsPrefix: n,
      as: L1,
      children: t
    }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Menu, {
      role: s,
      renderOnMount: l,
      rootCloseEvent: u,
      variant: v,
      children: r
    })]
  });
});
pI.displayName = "NavDropdown";
const ZC = Object.assign(pI, {
  Item: Za.Item,
  ItemText: Za.ItemText,
  Divider: Za.Divider,
  Header: Za.Header
});
var vI = {
  color: void 0,
  size: void 0,
  className: void 0,
  style: void 0,
  attr: void 0
}, s3 = (react__WEBPACK_IMPORTED_MODULE_1___default().createContext) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createContext(vI), tB = ["attr", "size", "title"];
function rB(e, t) {
  if (e == null) return {};
  var r = nB(e, t), n, a;
  if (Object.getOwnPropertySymbols) {
    var u = Object.getOwnPropertySymbols(e);
    for (a = 0; a < u.length; a++)
      n = u[a], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
  }
  return r;
}
function nB(e, t) {
  if (e == null) return {};
  var r = {};
  for (var n in e)
    if (Object.prototype.hasOwnProperty.call(e, n)) {
      if (t.indexOf(n) >= 0) continue;
      r[n] = e[n];
    }
  return r;
}
function KC() {
  return KC = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var r = arguments[t];
      for (var n in r)
        Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
    }
    return e;
  }, KC.apply(this, arguments);
}
function l3(e, t) {
  var r = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(e);
    t && (n = n.filter(function(a) {
      return Object.getOwnPropertyDescriptor(e, a).enumerable;
    })), r.push.apply(r, n);
  }
  return r;
}
function JC(e) {
  for (var t = 1; t < arguments.length; t++) {
    var r = arguments[t] != null ? arguments[t] : {};
    t % 2 ? l3(Object(r), !0).forEach(function(n) {
      iB(e, n, r[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : l3(Object(r)).forEach(function(n) {
      Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
    });
  }
  return e;
}
function iB(e, t, r) {
  return t = aB(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
}
function aB(e) {
  var t = oB(e, "string");
  return typeof t == "symbol" ? t : t + "";
}
function oB(e, t) {
  if (typeof e != "object" || !e) return e;
  var r = e[Symbol.toPrimitive];
  if (r !== void 0) {
    var n = r.call(e, t || "default");
    if (typeof n != "object") return n;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function gI(e) {
  return e && e.map((t, r) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(t.tag, JC({
    key: r
  }, t.attr), gI(t.child)));
}
function el(e) {
  return (t) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(sB, KC({
    attr: JC({}, e.attr)
  }, t), gI(e.child));
}
function sB(e) {
  var t = (r) => {
    var {
      attr: n,
      size: a,
      title: u
    } = e, s = rB(e, tB), c = a || r.size || "1em", i;
    return r.className && (i = r.className), e.className && (i = (i ? i + " " : "") + e.className), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", KC({
      stroke: "currentColor",
      fill: "currentColor",
      strokeWidth: "0"
    }, r.attr, n, s, {
      className: i,
      style: JC(JC({
        color: e.color || r.color
      }, r.style), e.style),
      height: c,
      width: c,
      xmlns: "http://www.w3.org/2000/svg"
    }), u && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("title", null, u), e.children);
  };
  return s3 !== void 0 ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(s3.Consumer, null, (r) => t(r)) : t(vI);
}
function lB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "ellipse", attr: { cx: "12", cy: "12", rx: "3", ry: "5.74" }, child: [] }, { tag: "path", attr: { d: "M9.04 16.87c-.33.08-.68.13-1.04.13-2.76 0-5-2.24-5-5s2.24-5 5-5c.36 0 .71.05 1.04.13.39-.56.88-1.12 1.49-1.63C9.75 5.19 8.9 5 8 5c-3.86 0-7 3.14-7 7s3.14 7 7 7c.9 0 1.75-.19 2.53-.5-.61-.51-1.1-1.07-1.49-1.63zM16 5c-.9 0-1.75.19-2.53.5.61.51 1.1 1.07 1.49 1.63.33-.08.68-.13 1.04-.13 2.76 0 5 2.24 5 5s-2.24 5-5 5c-.36 0-.71-.05-1.04-.13-.39.56-.88 1.12-1.49 1.63.78.31 1.63.5 2.53.5 3.86 0 7-3.14 7-7s-3.14-7-7-7z" }, child: [] }] })(e);
}
function c2(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }, child: [] }] })(e);
}
function d2(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" }, child: [] }] })(e);
}
function uB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26 5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z" }, child: [] }] })(e);
}
function cB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z" }, child: [] }] })(e);
}
function dB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { fillRule: "evenodd" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M3 3v8h8V3H3zm6 6H5V5h4v4zm-6 4v8h8v-8H3zm6 6H5v-4h4v4zm4-16v8h8V3h-8zm6 6h-4V5h4v4zm-6 4v8h8v-8h-8zm6 6h-4v-4h4v4z" }, child: [] }] }] })(e);
}
function fB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M17.59 18 19 16.59 14.42 12 19 7.41 17.59 6l-6 6z" }, child: [] }, { tag: "path", attr: { d: "m11 18 1.41-1.41L7.83 12l4.58-4.59L11 6l-6 6z" }, child: [] }] })(e);
}
function hB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M6.41 6 5 7.41 9.58 12 5 16.59 6.41 18l6-6z" }, child: [] }, { tag: "path", attr: { d: "m13 6-1.41 1.41L16.17 12l-4.58 4.59L13 18l6-6z" }, child: [] }] })(e);
}
function pB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }, child: [] }] })(e);
}
function vB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z" }, child: [] }] })(e);
}
function gB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }, child: [] }] })(e);
}
function mB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" }, child: [] }] })(e);
}
function yB(e) {
  return el({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M18 4v5H6V4h12m0-2H6c-1.1 0-2 .9-2 2v5c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 13v5H6v-5h12m0-2H6c-1.1 0-2 .9-2 2v5c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-5c0-1.1-.9-2-2-2z" }, child: [] }] })(e);
}
function ix({ label: e, value: t }) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(pv.Text, { children: [
    e,
    ": ",
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-light", children: t || "None" })
  ] });
}
function u3({
  label: e,
  version: t
}) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(pv.Text, { children: [
    e,
    ":",
    " ",
    t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { style: { color: "var(--bs-pink)" }, children: `v${t}` }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-light", children: "None" })
  ] });
}
function CB(e) {
  const {
    isFetching: t,
    data: { username: r, site: n } = { username: "", site: "" }
  } = Nl({
    queryKey: ["profile"],
    queryFn: async () => e.httpPathHandler("accounts/profile/").then((a) => a.json()).then((a) => ({ username: a.data.username, site: a.data.site }))
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    pv,
    {
      style: { backgroundColor: "var(--bs-black)" },
      variant: "dark",
      collapseOnSelect: !0,
      expand: "lg",
      fixed: "top",
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(is, { fluid: !0, children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(pv.Brand, { children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(lB, { color: "var(--bs-pink)" }),
          " Onyx"
        ] }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(pv.Toggle, { "aria-controls": "navbarScroll" }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(pv.Collapse, { id: "navbarScroll", children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ys, { className: "me-auto", children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys, { style: { maxHeight: "200px" }, navbarScroll: !0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 2, children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                ZC,
                {
                  title: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ix, { label: "Project", value: e.projectName }),
                  id: "navbarScrollingDropdown",
                  style: { color: "white" },
                  children: e.projectList.map((a) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    ZC.Item,
                    {
                      onClick: () => e.handleProjectChange(a),
                      children: a
                    },
                    a
                  ))
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {})
            ] }) }),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 3, children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                ix,
                {
                  label: "User",
                  value: t ? "Loading..." : r
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                ix,
                {
                  label: "Site",
                  value: t ? "Loading..." : n
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(u3, { label: "GUI", version: e.guiVersion }),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(u3, { label: "Extension", version: e.extVersion })
            ] }) })
          ] }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            hu.Container,
            {
              activeKey: e.tabKey,
              onSelect: (a) => e.setTabKey(a || "data"),
              children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys, { variant: "underline", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 3, children: [
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Item, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Link, { eventKey: "data", children: "Data" }) }),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Item, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Link, { eventKey: "stats", children: "Statistics" }) }),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                  Di.Check,
                  {
                    type: "switch",
                    id: "theme-switch",
                    label: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-light", children: [
                      e.darkMode ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(uB, {}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(cB, {}),
                      " "
                    ] }),
                    title: `Switch to ${e.darkMode ? "light mode" : "dark mode"}`,
                    checked: e.darkMode,
                    onChange: e.handleThemeChange
                  }
                )
              ] }) })
            }
          )
        ] })
      ] })
    }
  );
}
function bB(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 2, children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Di.Control,
      {
        value: e.searchInput,
        placeholder: "Search records...",
        onChange: (t) => e.setSearchInput(t.target.value),
        onKeyUp: (t) => {
          t.key === "Enter" && e.handleSearch();
        }
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Ki,
      {
        variant: "primary",
        disabled: !e.project,
        onClick: e.handleSearch,
        children: "Search"
      }
    )
  ] });
}
const f2 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  size: t,
  vertical: r = !1,
  className: n,
  role: a = "group",
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: u = "div",
  ...s
}, c) => {
  const i = mn(e, "btn-group");
  let l = i;
  return r && (l = `${i}-vertical`), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(u, {
    ...s,
    ref: c,
    role: a,
    className: ln(n, l, t && `${i}-${t}`)
  });
});
f2.displayName = "ButtonGroup";
const h2 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "card-body"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
h2.displayName = "CardBody";
const mI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "card-footer"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
mI.displayName = "CardFooter";
const yI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: r = "div",
  ...n
}, a) => {
  const u = mn(e, "card-header"), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    cardHeaderBsPrefix: u
  }), [u]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(KT.Provider, {
    value: s,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
      ref: a,
      ...n,
      className: ln(t, u)
    })
  });
});
yI.displayName = "CardHeader";
const CI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  ({
    bsPrefix: e,
    className: t,
    variant: r,
    as: n = "img",
    ...a
  }, u) => {
    const s = mn(e, "card-img");
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(n, {
      ref: u,
      className: ln(r ? `${s}-${r}` : s, t),
      ...a
    });
  }
);
CI.displayName = "CardImg";
const bI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "card-img-overlay"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
bI.displayName = "CardImgOverlay";
const wI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "a",
  ...n
}, a) => (t = mn(t, "card-link"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
wI.displayName = "CardLink";
const wB = Km("h6"), SI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = wB,
  ...n
}, a) => (t = mn(t, "card-subtitle"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
SI.displayName = "CardSubtitle";
const xI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "p",
  ...n
}, a) => (t = mn(t, "card-text"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
xI.displayName = "CardText";
const SB = Km("h5"), TI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = SB,
  ...n
}, a) => (t = mn(t, "card-title"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
TI.displayName = "CardTitle";
const RI = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  bg: r,
  text: n,
  border: a,
  body: u = !1,
  children: s,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: c = "div",
  ...i
}, l) => {
  const v = mn(e, "card");
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(c, {
    ref: l,
    ...i,
    className: ln(t, v, r && `bg-${r}`, n && `text-${n}`, a && `border-${a}`),
    children: u ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(h2, {
      children: s
    }) : s
  });
});
RI.displayName = "Card";
const Gl = Object.assign(RI, {
  Img: CI,
  Title: TI,
  Subtitle: SI,
  Body: h2,
  Link: wI,
  Text: xI,
  Header: yI,
  Footer: mI,
  ImgOverlay: bI
}), Yh = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: r = "div",
  ...n
}, a) => {
  const u = mn(e, "row"), s = BT(), c = VT(), i = `${u}-cols`, l = [];
  return s.forEach((v) => {
    const f = n[v];
    delete n[v];
    let p;
    f != null && typeof f == "object" ? {
      cols: p
    } = f : p = f;
    const g = v !== c ? `-${v}` : "";
    p != null && l.push(`${i}${g}-${p}`);
  }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
    ref: a,
    ...n,
    className: ln(t, u, ...l)
  });
});
Yh.displayName = "Row";
function Vh(e) {
  "@babel/helpers - typeof";
  return Vh = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Vh(e);
}
function xB(e, t) {
  if (Vh(e) != "object" || !e) return e;
  var r = e[Symbol.toPrimitive];
  if (r !== void 0) {
    var n = r.call(e, t || "default");
    if (Vh(n) != "object") return n;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function AI(e) {
  var t = xB(e, "string");
  return Vh(t) == "symbol" ? t : t + "";
}
function mm(e, t, r) {
  return t = AI(t), t in e ? Object.defineProperty(e, t, {
    value: r,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[t] = r, e;
}
function c3(e, t) {
  var r = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(e);
    t && (n = n.filter(function(a) {
      return Object.getOwnPropertyDescriptor(e, a).enumerable;
    })), r.push.apply(r, n);
  }
  return r;
}
function Hn(e) {
  for (var t = 1; t < arguments.length; t++) {
    var r = arguments[t] != null ? arguments[t] : {};
    t % 2 ? c3(Object(r), !0).forEach(function(n) {
      mm(e, n, r[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : c3(Object(r)).forEach(function(n) {
      Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
    });
  }
  return e;
}
function TB(e) {
  if (Array.isArray(e)) return e;
}
function RB(e, t) {
  var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (r != null) {
    var n, a, u, s, c = [], i = !0, l = !1;
    try {
      if (u = (r = r.call(e)).next, t === 0) {
        if (Object(r) !== r) return;
        i = !1;
      } else for (; !(i = (n = u.call(r)).done) && (c.push(n.value), c.length !== t); i = !0) ;
    } catch (v) {
      l = !0, a = v;
    } finally {
      try {
        if (!i && r.return != null && (s = r.return(), Object(s) !== s)) return;
      } finally {
        if (l) throw a;
      }
    }
    return c;
  }
}
function Jx(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
  return n;
}
function EI(e, t) {
  if (e) {
    if (typeof e == "string") return Jx(e, t);
    var r = Object.prototype.toString.call(e).slice(8, -1);
    if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
    if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Jx(e, t);
  }
}
function AB() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Kc(e, t) {
  return TB(e) || RB(e, t) || EI(e, t) || AB();
}
function uc(e, t) {
  if (e == null) return {};
  var r = kT(e, t), n, a;
  if (Object.getOwnPropertySymbols) {
    var u = Object.getOwnPropertySymbols(e);
    for (a = 0; a < u.length; a++)
      n = u[a], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
  }
  return r;
}
var EB = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
function MI(e) {
  var t = e.defaultInputValue, r = t === void 0 ? "" : t, n = e.defaultMenuIsOpen, a = n === void 0 ? !1 : n, u = e.defaultValue, s = u === void 0 ? null : u, c = e.inputValue, i = e.menuIsOpen, l = e.onChange, v = e.onInputChange, f = e.onMenuClose, p = e.onMenuOpen, g = e.value, y = uc(e, EB), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(c !== void 0 ? c : r), m = Kc(C, 2), h = m[0], w = m[1], S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(i !== void 0 ? i : a), E = Kc(S, 2), x = E[0], T = E[1], F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(g !== void 0 ? g : s), P = Kc(F, 2), k = P[0], I = P[1], L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(re, z) {
    typeof l == "function" && l(re, z), I(re);
  }, [l]), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(re, z) {
    var Z;
    typeof v == "function" && (Z = v(re, z)), w(Z !== void 0 ? Z : re);
  }, [v]), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function() {
    typeof p == "function" && p(), T(!0);
  }, [p]), N = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function() {
    typeof f == "function" && f(), T(!1);
  }, [f]), Y = c !== void 0 ? c : h, j = i !== void 0 ? i : x, te = g !== void 0 ? g : k;
  return Hn(Hn({}, y), {}, {
    inputValue: Y,
    menuIsOpen: j,
    onChange: L,
    onInputChange: A,
    onMenuClose: N,
    onMenuOpen: O,
    value: te
  });
}
function MB(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function d3(e, t) {
  for (var r = 0; r < t.length; r++) {
    var n = t[r];
    n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, AI(n.key), n);
  }
}
function DB(e, t, r) {
  return t && d3(e.prototype, t), r && d3(e, r), Object.defineProperty(e, "prototype", {
    writable: !1
  }), e;
}
function FB(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, {
    constructor: {
      value: e,
      writable: !0,
      configurable: !0
    }
  }), Object.defineProperty(e, "prototype", {
    writable: !1
  }), t && VC(e, t);
}
function QC(e) {
  return QC = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
    return r.__proto__ || Object.getPrototypeOf(r);
  }, QC(e);
}
function DI() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (DI = function() {
    return !!e;
  })();
}
function PB(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function IB(e, t) {
  if (t && (Vh(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return PB(e);
}
function LB(e) {
  var t = DI();
  return function() {
    var n = QC(e), a;
    if (t) {
      var u = QC(this).constructor;
      a = Reflect.construct(n, arguments, u);
    } else
      a = n.apply(this, arguments);
    return IB(this, a);
  };
}
function kB(e) {
  if (Array.isArray(e)) return Jx(e);
}
function OB(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function NB() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function gv(e) {
  return kB(e) || OB(e) || EI(e) || NB();
}
function GB(e) {
  if (e.sheet)
    return e.sheet;
  for (var t = 0; t < document.styleSheets.length; t++)
    if (document.styleSheets[t].ownerNode === e)
      return document.styleSheets[t];
}
function HB(e) {
  var t = document.createElement("style");
  return t.setAttribute("data-emotion", e.key), e.nonce !== void 0 && t.setAttribute("nonce", e.nonce), t.appendChild(document.createTextNode("")), t.setAttribute("data-s", ""), t;
}
var BB = /* @__PURE__ */ function() {
  function e(r) {
    var n = this;
    this._insertTag = function(a) {
      var u;
      n.tags.length === 0 ? n.insertionPoint ? u = n.insertionPoint.nextSibling : n.prepend ? u = n.container.firstChild : u = n.before : u = n.tags[n.tags.length - 1].nextSibling, n.container.insertBefore(a, u), n.tags.push(a);
    }, this.isSpeedy = r.speedy === void 0 ? "development" === "production" : r.speedy, this.tags = [], this.ctr = 0, this.nonce = r.nonce, this.key = r.key, this.container = r.container, this.prepend = r.prepend, this.insertionPoint = r.insertionPoint, this.before = null;
  }
  var t = e.prototype;
  return t.hydrate = function(n) {
    n.forEach(this._insertTag);
  }, t.insert = function(n) {
    this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(HB(this));
    var a = this.tags[this.tags.length - 1];
    if (true) {
      var u = n.charCodeAt(0) === 64 && n.charCodeAt(1) === 105;
      u && this._alreadyInsertedOrderInsensitiveRule && console.error(`You're attempting to insert the following rule:
` + n + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."), this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !u;
    }
    if (this.isSpeedy) {
      var s = GB(a);
      try {
        s.insertRule(n, s.cssRules.length);
      } catch (c) {
         true && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(n) && console.error('There was a problem inserting the following rule: "' + n + '"', c);
      }
    } else
      a.appendChild(document.createTextNode(n));
    this.ctr++;
  }, t.flush = function() {
    this.tags.forEach(function(n) {
      return n.parentNode && n.parentNode.removeChild(n);
    }), this.tags = [], this.ctr = 0,  true && (this._alreadyInsertedOrderInsensitiveRule = !1);
  }, e;
}(), Vo = "-ms-", qC = "-moz-", ki = "-webkit-", p2 = "comm", v2 = "rule", g2 = "decl", VB = "@import", FI = "@keyframes", zB = "@layer", WB = Math.abs, H1 = String.fromCharCode, _B = Object.assign;
function UB(e, t) {
  return Ro(e, 0) ^ 45 ? (((t << 2 ^ Ro(e, 0)) << 2 ^ Ro(e, 1)) << 2 ^ Ro(e, 2)) << 2 ^ Ro(e, 3) : 0;
}
function PI(e) {
  return e.trim();
}
function jB(e, t) {
  return (e = t.exec(e)) ? e[0] : e;
}
function Oi(e, t, r) {
  return e.replace(t, r);
}
function Qx(e, t) {
  return e.indexOf(t);
}
function Ro(e, t) {
  return e.charCodeAt(t) | 0;
}
function Om(e, t, r) {
  return e.slice(t, r);
}
function qu(e) {
  return e.length;
}
function m2(e) {
  return e.length;
}
function dC(e, t) {
  return t.push(e), e;
}
function YB(e, t) {
  return e.map(t).join("");
}
var B1 = 1, Rv = 1, II = 0, As = 0, Ja = 0, Nv = "";
function V1(e, t, r, n, a, u, s) {
  return { value: e, root: t, parent: r, type: n, props: a, children: u, line: B1, column: Rv, length: s, return: "" };
}
function um(e, t) {
  return _B(V1("", null, null, "", null, null, 0), e, { length: -e.length }, t);
}
function XB() {
  return Ja;
}
function $B() {
  return Ja = As > 0 ? Ro(Nv, --As) : 0, Rv--, Ja === 10 && (Rv = 1, B1--), Ja;
}
function Zs() {
  return Ja = As < II ? Ro(Nv, As++) : 0, Rv++, Ja === 10 && (Rv = 1, B1++), Ja;
}
function ic() {
  return Ro(Nv, As);
}
function EC() {
  return As;
}
function ey(e, t) {
  return Om(Nv, e, t);
}
function Nm(e) {
  switch (e) {
    case 0:
    case 9:
    case 10:
    case 13:
    case 32:
      return 5;
    case 33:
    case 43:
    case 44:
    case 47:
    case 62:
    case 64:
    case 126:
    case 59:
    case 123:
    case 125:
      return 4;
    case 58:
      return 3;
    case 34:
    case 39:
    case 40:
    case 91:
      return 2;
    case 41:
    case 93:
      return 1;
  }
  return 0;
}
function LI(e) {
  return B1 = Rv = 1, II = qu(Nv = e), As = 0, [];
}
function kI(e) {
  return Nv = "", e;
}
function MC(e) {
  return PI(ey(As - 1, qx(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
}
function ZB(e) {
  for (; (Ja = ic()) && Ja < 33; )
    Zs();
  return Nm(e) > 2 || Nm(Ja) > 3 ? "" : " ";
}
function KB(e, t) {
  for (; --t && Zs() && !(Ja < 48 || Ja > 102 || Ja > 57 && Ja < 65 || Ja > 70 && Ja < 97); )
    ;
  return ey(e, EC() + (t < 6 && ic() == 32 && Zs() == 32));
}
function qx(e) {
  for (; Zs(); )
    switch (Ja) {
      case e:
        return As;
      case 34:
      case 39:
        e !== 34 && e !== 39 && qx(Ja);
        break;
      case 40:
        e === 41 && qx(e);
        break;
      case 92:
        Zs();
        break;
    }
  return As;
}
function JB(e, t) {
  for (; Zs() && e + Ja !== 57; )
    if (e + Ja === 84 && ic() === 47)
      break;
  return "/*" + ey(t, As - 1) + "*" + H1(e === 47 ? e : Zs());
}
function QB(e) {
  for (; !Nm(ic()); )
    Zs();
  return ey(e, As);
}
function qB(e) {
  return kI(DC("", null, null, null, [""], e = LI(e), 0, [0], e));
}
function DC(e, t, r, n, a, u, s, c, i) {
  for (var l = 0, v = 0, f = s, p = 0, g = 0, y = 0, C = 1, m = 1, h = 1, w = 0, S = "", E = a, x = u, T = n, F = S; m; )
    switch (y = w, w = Zs()) {
      case 40:
        if (y != 108 && Ro(F, f - 1) == 58) {
          Qx(F += Oi(MC(w), "&", "&\f"), "&\f") != -1 && (h = -1);
          break;
        }
      case 34:
      case 39:
      case 91:
        F += MC(w);
        break;
      case 9:
      case 10:
      case 13:
      case 32:
        F += ZB(y);
        break;
      case 92:
        F += KB(EC() - 1, 7);
        continue;
      case 47:
        switch (ic()) {
          case 42:
          case 47:
            dC(eV(JB(Zs(), EC()), t, r), i);
            break;
          default:
            F += "/";
        }
        break;
      case 123 * C:
        c[l++] = qu(F) * h;
      case 125 * C:
      case 59:
      case 0:
        switch (w) {
          case 0:
          case 125:
            m = 0;
          case 59 + v:
            h == -1 && (F = Oi(F, /\f/g, "")), g > 0 && qu(F) - f && dC(g > 32 ? h3(F + ";", n, r, f - 1) : h3(Oi(F, " ", "") + ";", n, r, f - 2), i);
            break;
          case 59:
            F += ";";
          default:
            if (dC(T = f3(F, t, r, l, v, a, c, S, E = [], x = [], f), u), w === 123)
              if (v === 0)
                DC(F, t, T, T, E, u, f, c, x);
              else
                switch (p === 99 && Ro(F, 3) === 110 ? 100 : p) {
                  case 100:
                  case 108:
                  case 109:
                  case 115:
                    DC(e, T, T, n && dC(f3(e, T, T, 0, 0, a, c, S, a, E = [], f), x), a, x, f, c, n ? E : x);
                    break;
                  default:
                    DC(F, T, T, T, [""], x, 0, c, x);
                }
        }
        l = v = g = 0, C = h = 1, S = F = "", f = s;
        break;
      case 58:
        f = 1 + qu(F), g = y;
      default:
        if (C < 1) {
          if (w == 123)
            --C;
          else if (w == 125 && C++ == 0 && $B() == 125)
            continue;
        }
        switch (F += H1(w), w * C) {
          case 38:
            h = v > 0 ? 1 : (F += "\f", -1);
            break;
          case 44:
            c[l++] = (qu(F) - 1) * h, h = 1;
            break;
          case 64:
            ic() === 45 && (F += MC(Zs())), p = ic(), v = f = qu(S = F += QB(EC())), w++;
            break;
          case 45:
            y === 45 && qu(F) == 2 && (C = 0);
        }
    }
  return u;
}
function f3(e, t, r, n, a, u, s, c, i, l, v) {
  for (var f = a - 1, p = a === 0 ? u : [""], g = m2(p), y = 0, C = 0, m = 0; y < n; ++y)
    for (var h = 0, w = Om(e, f + 1, f = WB(C = s[y])), S = e; h < g; ++h)
      (S = PI(C > 0 ? p[h] + " " + w : Oi(w, /&\f/g, p[h]))) && (i[m++] = S);
  return V1(e, t, r, a === 0 ? v2 : c, i, l, v);
}
function eV(e, t, r) {
  return V1(e, t, r, p2, H1(XB()), Om(e, 2, -2), 0);
}
function h3(e, t, r, n) {
  return V1(e, t, r, g2, Om(e, 0, n), Om(e, n + 1, -1), n);
}
function mv(e, t) {
  for (var r = "", n = m2(e), a = 0; a < n; a++)
    r += t(e[a], a, e, t) || "";
  return r;
}
function tV(e, t, r, n) {
  switch (e.type) {
    case zB:
      if (e.children.length) break;
    case VB:
    case g2:
      return e.return = e.return || e.value;
    case p2:
      return "";
    case FI:
      return e.return = e.value + "{" + mv(e.children, n) + "}";
    case v2:
      e.value = e.props.join(",");
  }
  return qu(r = mv(e.children, n)) ? e.return = e.value + "{" + r + "}" : "";
}
function rV(e) {
  var t = m2(e);
  return function(r, n, a, u) {
    for (var s = "", c = 0; c < t; c++)
      s += e[c](r, n, a, u) || "";
    return s;
  };
}
function nV(e) {
  return function(t) {
    t.root || (t = t.return) && e(t);
  };
}
function iV(e) {
  var t = /* @__PURE__ */ Object.create(null);
  return function(r) {
    return t[r] === void 0 && (t[r] = e(r)), t[r];
  };
}
var aV = function(t, r, n) {
  for (var a = 0, u = 0; a = u, u = ic(), a === 38 && u === 12 && (r[n] = 1), !Nm(u); )
    Zs();
  return ey(t, As);
}, oV = function(t, r) {
  var n = -1, a = 44;
  do
    switch (Nm(a)) {
      case 0:
        a === 38 && ic() === 12 && (r[n] = 1), t[n] += aV(As - 1, r, n);
        break;
      case 2:
        t[n] += MC(a);
        break;
      case 4:
        if (a === 44) {
          t[++n] = ic() === 58 ? "&\f" : "", r[n] = t[n].length;
          break;
        }
      default:
        t[n] += H1(a);
    }
  while (a = Zs());
  return t;
}, sV = function(t, r) {
  return kI(oV(LI(t), r));
}, p3 = /* @__PURE__ */ new WeakMap(), lV = function(t) {
  if (!(t.type !== "rule" || !t.parent || // positive .length indicates that this rule contains pseudo
  // negative .length indicates that this rule has been already prefixed
  t.length < 1)) {
    for (var r = t.value, n = t.parent, a = t.column === n.column && t.line === n.line; n.type !== "rule"; )
      if (n = n.parent, !n) return;
    if (!(t.props.length === 1 && r.charCodeAt(0) !== 58 && !p3.get(n)) && !a) {
      p3.set(t, !0);
      for (var u = [], s = sV(r, u), c = n.props, i = 0, l = 0; i < s.length; i++)
        for (var v = 0; v < c.length; v++, l++)
          t.props[l] = u[i] ? s[i].replace(/&\f/g, c[v]) : c[v] + " " + s[i];
    }
  }
}, uV = function(t) {
  if (t.type === "decl") {
    var r = t.value;
    // charcode for l
    r.charCodeAt(0) === 108 && // charcode for b
    r.charCodeAt(2) === 98 && (t.return = "", t.value = "");
  }
}, cV = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason", dV = function(t) {
  return t.type === "comm" && t.children.indexOf(cV) > -1;
}, fV = function(t) {
  return function(r, n, a) {
    if (!(r.type !== "rule" || t.compat)) {
      var u = r.value.match(/(:first|:nth|:nth-last)-child/g);
      if (u) {
        for (var s = !!r.parent, c = s ? r.parent.children : (
          // global rule at the root level
          a
        ), i = c.length - 1; i >= 0; i--) {
          var l = c[i];
          if (l.line < r.line)
            break;
          if (l.column < r.column) {
            if (dV(l))
              return;
            break;
          }
        }
        u.forEach(function(v) {
          console.error('The pseudo class "' + v + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + v.split("-child")[0] + '-of-type".');
        });
      }
    }
  };
}, OI = function(t) {
  return t.type.charCodeAt(1) === 105 && t.type.charCodeAt(0) === 64;
}, hV = function(t, r) {
  for (var n = t - 1; n >= 0; n--)
    if (!OI(r[n]))
      return !0;
  return !1;
}, v3 = function(t) {
  t.type = "", t.value = "", t.return = "", t.children = "", t.props = "";
}, pV = function(t, r, n) {
  OI(t) && (t.parent ? (console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."), v3(t)) : hV(r, n) && (console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."), v3(t)));
};
function NI(e, t) {
  switch (UB(e, t)) {
    case 5103:
      return ki + "print-" + e + e;
    case 5737:
    case 4201:
    case 3177:
    case 3433:
    case 1641:
    case 4457:
    case 2921:
    case 5572:
    case 6356:
    case 5844:
    case 3191:
    case 6645:
    case 3005:
    case 6391:
    case 5879:
    case 5623:
    case 6135:
    case 4599:
    case 4855:
    case 4215:
    case 6389:
    case 5109:
    case 5365:
    case 5621:
    case 3829:
      return ki + e + e;
    case 5349:
    case 4246:
    case 4810:
    case 6968:
    case 2756:
      return ki + e + qC + e + Vo + e + e;
    case 6828:
    case 4268:
      return ki + e + Vo + e + e;
    case 6165:
      return ki + e + Vo + "flex-" + e + e;
    case 5187:
      return ki + e + Oi(e, /(\w+).+(:[^]+)/, ki + "box-$1$2" + Vo + "flex-$1$2") + e;
    case 5443:
      return ki + e + Vo + "flex-item-" + Oi(e, /flex-|-self/, "") + e;
    case 4675:
      return ki + e + Vo + "flex-line-pack" + Oi(e, /align-content|flex-|-self/, "") + e;
    case 5548:
      return ki + e + Vo + Oi(e, "shrink", "negative") + e;
    case 5292:
      return ki + e + Vo + Oi(e, "basis", "preferred-size") + e;
    case 6060:
      return ki + "box-" + Oi(e, "-grow", "") + ki + e + Vo + Oi(e, "grow", "positive") + e;
    case 4554:
      return ki + Oi(e, /([^-])(transform)/g, "$1" + ki + "$2") + e;
    case 6187:
      return Oi(Oi(Oi(e, /(zoom-|grab)/, ki + "$1"), /(image-set)/, ki + "$1"), e, "") + e;
    case 5495:
    case 3959:
      return Oi(e, /(image-set\([^]*)/, ki + "$1$`$1");
    case 4968:
      return Oi(Oi(e, /(.+:)(flex-)?(.*)/, ki + "box-pack:$3" + Vo + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + ki + e + e;
    case 4095:
    case 3583:
    case 4068:
    case 2532:
      return Oi(e, /(.+)-inline(.+)/, ki + "$1$2") + e;
    case 8116:
    case 7059:
    case 5753:
    case 5535:
    case 5445:
    case 5701:
    case 4933:
    case 4677:
    case 5533:
    case 5789:
    case 5021:
    case 4765:
      if (qu(e) - 1 - t > 6) switch (Ro(e, t + 1)) {
        case 109:
          if (Ro(e, t + 4) !== 45) break;
        case 102:
          return Oi(e, /(.+:)(.+)-([^]+)/, "$1" + ki + "$2-$3$1" + qC + (Ro(e, t + 3) == 108 ? "$3" : "$2-$3")) + e;
        case 115:
          return ~Qx(e, "stretch") ? NI(Oi(e, "stretch", "fill-available"), t) + e : e;
      }
      break;
    case 4949:
      if (Ro(e, t + 1) !== 115) break;
    case 6444:
      switch (Ro(e, qu(e) - 3 - (~Qx(e, "!important") && 10))) {
        case 107:
          return Oi(e, ":", ":" + ki) + e;
        case 101:
          return Oi(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + ki + (Ro(e, 14) === 45 ? "inline-" : "") + "box$3$1" + ki + "$2$3$1" + Vo + "$2box$3") + e;
      }
      break;
    case 5936:
      switch (Ro(e, t + 11)) {
        case 114:
          return ki + e + Vo + Oi(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
        case 108:
          return ki + e + Vo + Oi(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
        case 45:
          return ki + e + Vo + Oi(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
      }
      return ki + e + Vo + e + e;
  }
  return e;
}
var vV = function(t, r, n, a) {
  if (t.length > -1 && !t.return) switch (t.type) {
    case g2:
      t.return = NI(t.value, t.length);
      break;
    case FI:
      return mv([um(t, {
        value: Oi(t.value, "@", "@" + ki)
      })], a);
    case v2:
      if (t.length) return YB(t.props, function(u) {
        switch (jB(u, /(::plac\w+|:read-\w+)/)) {
          case ":read-only":
          case ":read-write":
            return mv([um(t, {
              props: [Oi(u, /:(read-\w+)/, ":" + qC + "$1")]
            })], a);
          case "::placeholder":
            return mv([um(t, {
              props: [Oi(u, /:(plac\w+)/, ":" + ki + "input-$1")]
            }), um(t, {
              props: [Oi(u, /:(plac\w+)/, ":" + qC + "$1")]
            }), um(t, {
              props: [Oi(u, /:(plac\w+)/, Vo + "input-$1")]
            })], a);
        }
        return "";
      });
  }
}, gV = [vV], mV = function(t) {
  var r = t.key;
  if ( true && !r)
    throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
If multiple caches share the same key they might "fight" for each other's style elements.`);
  if (r === "css") {
    var n = document.querySelectorAll("style[data-emotion]:not([data-s])");
    Array.prototype.forEach.call(n, function(C) {
      var m = C.getAttribute("data-emotion");
      m.indexOf(" ") !== -1 && (document.head.appendChild(C), C.setAttribute("data-s", ""));
    });
  }
  var a = t.stylisPlugins || gV;
  if ( true && /[^a-z-]/.test(r))
    throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + r + '" was passed');
  var u = {}, s, c = [];
  s = t.container || document.head, Array.prototype.forEach.call(
    // this means we will ignore elements which don't have a space in them which
    // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
    document.querySelectorAll('style[data-emotion^="' + r + ' "]'),
    function(C) {
      for (var m = C.getAttribute("data-emotion").split(" "), h = 1; h < m.length; h++)
        u[m[h]] = !0;
      c.push(C);
    }
  );
  var i, l = [lV, uV];
   true && l.push(fV({
    get compat() {
      return y.compat;
    }
  }), pV);
  {
    var v, f = [tV,  true ? function(C) {
      C.root || (C.return ? v.insert(C.return) : C.value && C.type !== p2 && v.insert(C.value + "{}"));
    } : 0], p = rV(l.concat(a, f)), g = function(m) {
      return mv(qB(m), p);
    };
    i = function(m, h, w, S) {
      v = w,  true && h.map !== void 0 && (v = {
        insert: function(x) {
          w.insert(x + h.map);
        }
      }), g(m ? m + "{" + h.styles + "}" : h.styles), S && (y.inserted[h.name] = !0);
    };
  }
  var y = {
    key: r,
    sheet: new BB({
      key: r,
      container: s,
      nonce: t.nonce,
      speedy: t.speedy,
      prepend: t.prepend,
      insertionPoint: t.insertionPoint
    }),
    nonce: t.nonce,
    inserted: u,
    registered: {},
    insert: i
  };
  return y.sheet.hydrate(c), y;
}, GI = DT(), yV = {
  $$typeof: !0,
  render: !0,
  defaultProps: !0,
  displayName: !0,
  propTypes: !0
}, CV = {
  $$typeof: !0,
  compare: !0,
  defaultProps: !0,
  displayName: !0,
  propTypes: !0,
  type: !0
}, HI = {};
HI[GI.ForwardRef] = yV;
HI[GI.Memo] = CV;
var bV = !0;
function BI(e, t, r) {
  var n = "";
  return r.split(" ").forEach(function(a) {
    e[a] !== void 0 ? t.push(e[a] + ";") : n += a + " ";
  }), n;
}
var y2 = function(t, r, n) {
  var a = t.key + "-" + r.name;
  // we only need to add the styles to the registered cache if the
  // class name could be used further down
  // the tree but if it's a string tag, we know it won't
  // so we don't have to add it to registered cache.
  // this improves memory usage since we can avoid storing the whole style string
  (n === !1 || // we need to always store it if we're in compat mode and
  // in node since emotion-server relies on whether a style is in
  // the registered cache to know whether a style is global or not
  // also, note that this check will be dead code eliminated in the browser
  bV === !1) && t.registered[a] === void 0 && (t.registered[a] = r.styles);
}, C2 = function(t, r, n) {
  y2(t, r, n);
  var a = t.key + "-" + r.name;
  if (t.inserted[r.name] === void 0) {
    var u = r;
    do
      t.insert(r === u ? "." + a : "", u, t.sheet, !0), u = u.next;
    while (u !== void 0);
  }
};
function wV(e) {
  for (var t = 0, r, n = 0, a = e.length; a >= 4; ++n, a -= 4)
    r = e.charCodeAt(n) & 255 | (e.charCodeAt(++n) & 255) << 8 | (e.charCodeAt(++n) & 255) << 16 | (e.charCodeAt(++n) & 255) << 24, r = /* Math.imul(k, m): */
    (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), r ^= /* k >>> r: */
    r >>> 24, t = /* Math.imul(k, m): */
    (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
    (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
  switch (a) {
    case 3:
      t ^= (e.charCodeAt(n + 2) & 255) << 16;
    case 2:
      t ^= (e.charCodeAt(n + 1) & 255) << 8;
    case 1:
      t ^= e.charCodeAt(n) & 255, t = /* Math.imul(h, m): */
      (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
  }
  return t ^= t >>> 13, t = /* Math.imul(h, m): */
  (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), ((t ^ t >>> 15) >>> 0).toString(36);
}
var SV = {
  animationIterationCount: 1,
  aspectRatio: 1,
  borderImageOutset: 1,
  borderImageSlice: 1,
  borderImageWidth: 1,
  boxFlex: 1,
  boxFlexGroup: 1,
  boxOrdinalGroup: 1,
  columnCount: 1,
  columns: 1,
  flex: 1,
  flexGrow: 1,
  flexPositive: 1,
  flexShrink: 1,
  flexNegative: 1,
  flexOrder: 1,
  gridRow: 1,
  gridRowEnd: 1,
  gridRowSpan: 1,
  gridRowStart: 1,
  gridColumn: 1,
  gridColumnEnd: 1,
  gridColumnSpan: 1,
  gridColumnStart: 1,
  msGridRow: 1,
  msGridRowSpan: 1,
  msGridColumn: 1,
  msGridColumnSpan: 1,
  fontWeight: 1,
  lineHeight: 1,
  opacity: 1,
  order: 1,
  orphans: 1,
  tabSize: 1,
  widows: 1,
  zIndex: 1,
  zoom: 1,
  WebkitLineClamp: 1,
  // SVG-related properties
  fillOpacity: 1,
  floodOpacity: 1,
  stopOpacity: 1,
  strokeDasharray: 1,
  strokeDashoffset: 1,
  strokeMiterlimit: 1,
  strokeOpacity: 1,
  strokeWidth: 1
}, g3 = `You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
You can read more about this here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`, xV = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).", TV = /[A-Z]|^ms/g, VI = /_EMO_([^_]+?)_([^]*?)_EMO_/g, b2 = function(t) {
  return t.charCodeAt(1) === 45;
}, m3 = function(t) {
  return t != null && typeof t != "boolean";
}, ax = /* @__PURE__ */ iV(function(e) {
  return b2(e) ? e : e.replace(TV, "-$&").toLowerCase();
}), e1 = function(t, r) {
  switch (t) {
    case "animation":
    case "animationName":
      if (typeof r == "string")
        return r.replace(VI, function(n, a, u) {
          return du = {
            name: a,
            styles: u,
            next: du
          }, a;
        });
  }
  return SV[t] !== 1 && !b2(t) && typeof r == "number" && r !== 0 ? r + "px" : r;
};
if (true) {
  var RV = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/, AV = ["normal", "none", "initial", "inherit", "unset"], EV = e1, MV = /^-ms-/, DV = /-(.)/g, y3 = {};
  e1 = function(t, r) {
    if (t === "content" && (typeof r != "string" || AV.indexOf(r) === -1 && !RV.test(r) && (r.charAt(0) !== r.charAt(r.length - 1) || r.charAt(0) !== '"' && r.charAt(0) !== "'")))
      throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + r + "\"'`");
    var n = EV(t, r);
    return n !== "" && !b2(t) && t.indexOf("-") !== -1 && y3[t] === void 0 && (y3[t] = !0, console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + t.replace(MV, "ms-").replace(DV, function(a, u) {
      return u.toUpperCase();
    }) + "?")), n;
  };
}
var zI = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
function Gm(e, t, r) {
  if (r == null)
    return "";
  if (r.__emotion_styles !== void 0) {
    if ( true && r.toString() === "NO_COMPONENT_SELECTOR")
      throw new Error(zI);
    return r;
  }
  switch (typeof r) {
    case "boolean":
      return "";
    case "object": {
      if (r.anim === 1)
        return du = {
          name: r.name,
          styles: r.styles,
          next: du
        }, r.name;
      if (r.styles !== void 0) {
        var n = r.next;
        if (n !== void 0)
          for (; n !== void 0; )
            du = {
              name: n.name,
              styles: n.styles,
              next: du
            }, n = n.next;
        var a = r.styles + ";";
        return  true && r.map !== void 0 && (a += r.map), a;
      }
      return FV(e, t, r);
    }
    case "function": {
      if (e !== void 0) {
        var u = du, s = r(e);
        return du = u, Gm(e, t, s);
      } else  true && console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");
      break;
    }
    case "string":
      if (true) {
        var c = [], i = r.replace(VI, function(v, f, p) {
          var g = "animation" + c.length;
          return c.push("const " + g + " = keyframes`" + p.replace(/^@keyframes animation-\w+/, "") + "`"), "${" + g + "}";
        });
        c.length && console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(c, ["`" + i + "`"]).join(`
`) + `

You should wrap it with \`css\` like this:

` + ("css`" + i + "`"));
      }
      break;
  }
  if (t == null)
    return r;
  var l = t[r];
  return l !== void 0 ? l : r;
}
function FV(e, t, r) {
  var n = "";
  if (Array.isArray(r))
    for (var a = 0; a < r.length; a++)
      n += Gm(e, t, r[a]) + ";";
  else
    for (var u in r) {
      var s = r[u];
      if (typeof s != "object")
        t != null && t[s] !== void 0 ? n += u + "{" + t[s] + "}" : m3(s) && (n += ax(u) + ":" + e1(u, s) + ";");
      else {
        if (u === "NO_COMPONENT_SELECTOR" && "development" !== "production")
          throw new Error(zI);
        if (Array.isArray(s) && typeof s[0] == "string" && (t == null || t[s[0]] === void 0))
          for (var c = 0; c < s.length; c++)
            m3(s[c]) && (n += ax(u) + ":" + e1(u, s[c]) + ";");
        else {
          var i = Gm(e, t, s);
          switch (u) {
            case "animation":
            case "animationName": {
              n += ax(u) + ":" + i + ";";
              break;
            }
            default:
               true && u === "undefined" && console.error(xV), n += u + "{" + i + "}";
          }
        }
      }
    }
  return n;
}
var C3 = /label:\s*([^\s;\n{]+)\s*(;|$)/g, WI;
 true && (WI = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g);
var du, Hm = function(t, r, n) {
  if (t.length === 1 && typeof t[0] == "object" && t[0] !== null && t[0].styles !== void 0)
    return t[0];
  var a = !0, u = "";
  du = void 0;
  var s = t[0];
  s == null || s.raw === void 0 ? (a = !1, u += Gm(n, r, s)) : ( true && s[0] === void 0 && console.error(g3), u += s[0]);
  for (var c = 1; c < t.length; c++)
    u += Gm(n, r, t[c]), a && ( true && s[c] === void 0 && console.error(g3), u += s[c]);
  var i;
   true && (u = u.replace(WI, function(p) {
    return i = p, "";
  })), C3.lastIndex = 0;
  for (var l = "", v; (v = C3.exec(u)) !== null; )
    l += "-" + // $FlowFixMe we know it's not null
    v[1];
  var f = wV(u) + l;
  return  true ? {
    name: f,
    styles: u,
    map: i,
    next: du,
    toString: function() {
      return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
    }
  } : 0;
}, PV = function(t) {
  return t();
}, _I = react__WEBPACK_IMPORTED_MODULE_1__.useInsertionEffect ? react__WEBPACK_IMPORTED_MODULE_1__.useInsertionEffect : !1, UI = _I || PV, b3 = _I || react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect, w2 = {}.hasOwnProperty, S2 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(
  // we're doing this to avoid preconstruct's dead code elimination in this one case
  // because this module is primarily intended for the browser and node
  // but it's also required in react native and similar environments sometimes
  // and we could have a special build just for that
  // but this is much easier and the native packages
  // might use a different theme context in the future anyway
  typeof HTMLElement < "u" ? /* @__PURE__ */ mV({
    key: "css"
  }) : null
);
 true && (S2.displayName = "EmotionCacheContext");
S2.Provider;
var x2 = function(t) {
  return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function(r, n) {
    var a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(S2);
    return t(r, a, n);
  });
}, z1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext({});
 true && (z1.displayName = "EmotionThemeContext");
var w3 = function(t) {
  var r = t.split(".");
  return r[r.length - 1];
}, IV = function(t) {
  var r = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(t);
  if (r || (r = /^([A-Za-z0-9$.]+)@/.exec(t), r)) return w3(r[1]);
}, LV = /* @__PURE__ */ new Set(["renderWithHooks", "processChild", "finishClassComponent", "renderToString"]), kV = function(t) {
  return t.replace(/\$/g, "-");
}, OV = function(t) {
  if (t)
    for (var r = t.split(`
`), n = 0; n < r.length; n++) {
      var a = IV(r[n]);
      if (a) {
        if (LV.has(a)) break;
        if (/^[A-Z]/.test(a)) return kV(a);
      }
    }
}, eT = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", tT = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__", NV = function(t, r) {
  if ( true && typeof r.css == "string" && // check if there is a css declaration
  r.css.indexOf(":") !== -1)
    throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + r.css + "`");
  var n = {};
  for (var a in r)
    w2.call(r, a) && (n[a] = r[a]);
  if (n[eT] = t,  true && r.css && (typeof r.css != "object" || typeof r.css.name != "string" || r.css.name.indexOf("-") === -1)) {
    var u = OV(new Error().stack);
    u && (n[tT] = u);
  }
  return n;
}, GV = function(t) {
  var r = t.cache, n = t.serialized, a = t.isStringTag;
  return y2(r, n, a), UI(function() {
    return C2(r, n, a);
  }), null;
}, jI = /* @__PURE__ */ x2(function(e, t, r) {
  var n = e.css;
  typeof n == "string" && t.registered[n] !== void 0 && (n = t.registered[n]);
  var a = e[eT], u = [n], s = "";
  typeof e.className == "string" ? s = BI(t.registered, u, e.className) : e.className != null && (s = e.className + " ");
  var c = Hm(u, void 0, react__WEBPACK_IMPORTED_MODULE_1__.useContext(z1));
  if ( true && c.name.indexOf("-") === -1) {
    var i = e[tT];
    i && (c = Hm([c, "label:" + i + ";"]));
  }
  s += t.key + "-" + c.name;
  var l = {};
  for (var v in e)
    w2.call(e, v) && v !== "css" && v !== eT && ( false || v !== tT) && (l[v] = e[v]);
  return l.ref = r, l.className = s, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(GV, {
    cache: t,
    serialized: c,
    isStringTag: typeof a == "string"
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(a, l));
});
 true && (jI.displayName = "EmotionCssPropInternal");
var HV = jI, BV = {
  name: "@emotion/react",
  version: "11.11.4",
  main: "dist/emotion-react.cjs.js",
  module: "dist/emotion-react.esm.js",
  browser: {
    "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
  },
  exports: {
    ".": {
      module: {
        worker: "./dist/emotion-react.worker.esm.js",
        browser: "./dist/emotion-react.browser.esm.js",
        default: "./dist/emotion-react.esm.js"
      },
      import: "./dist/emotion-react.cjs.mjs",
      default: "./dist/emotion-react.cjs.js"
    },
    "./jsx-runtime": {
      module: {
        worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
        browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
        default: "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
      },
      import: "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
      default: "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
    },
    "./_isolated-hnrs": {
      module: {
        worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
        browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
        default: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
      },
      import: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
      default: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
    },
    "./jsx-dev-runtime": {
      module: {
        worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
        browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
        default: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
      },
      import: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
      default: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
    },
    "./package.json": "./package.json",
    "./types/css-prop": "./types/css-prop.d.ts",
    "./macro": {
      types: {
        import: "./macro.d.mts",
        default: "./macro.d.ts"
      },
      default: "./macro.js"
    }
  },
  types: "types/index.d.ts",
  files: [
    "src",
    "dist",
    "jsx-runtime",
    "jsx-dev-runtime",
    "_isolated-hnrs",
    "types/*.d.ts",
    "macro.*"
  ],
  sideEffects: !1,
  author: "Emotion Contributors",
  license: "MIT",
  scripts: {
    "test:typescript": "dtslint types"
  },
  dependencies: {
    "@babel/runtime": "^7.18.3",
    "@emotion/babel-plugin": "^11.11.0",
    "@emotion/cache": "^11.11.0",
    "@emotion/serialize": "^1.1.3",
    "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
    "@emotion/utils": "^1.2.1",
    "@emotion/weak-memoize": "^0.3.1",
    "hoist-non-react-statics": "^3.3.1"
  },
  peerDependencies: {
    react: ">=16.8.0"
  },
  peerDependenciesMeta: {
    "@types/react": {
      optional: !0
    }
  },
  devDependencies: {
    "@definitelytyped/dtslint": "0.0.112",
    "@emotion/css": "11.11.2",
    "@emotion/css-prettifier": "1.1.3",
    "@emotion/server": "11.11.0",
    "@emotion/styled": "11.11.0",
    "html-tag-names": "^1.1.2",
    react: "16.14.0",
    "svg-tag-names": "^1.1.1",
    typescript: "^4.5.5"
  },
  repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
  publishConfig: {
    access: "public"
  },
  "umd:main": "dist/emotion-react.umd.min.js",
  preconstruct: {
    entrypoints: [
      "./index.js",
      "./jsx-runtime.js",
      "./jsx-dev-runtime.js",
      "./_isolated-hnrs.js"
    ],
    umdName: "emotionReact",
    exports: {
      envConditions: [
        "browser",
        "worker"
      ],
      extra: {
        "./types/css-prop": "./types/css-prop.d.ts",
        "./macro": {
          types: {
            import: "./macro.d.mts",
            default: "./macro.d.ts"
          },
          default: "./macro.js"
        }
      }
    }
  }
}, zn = function(t, r) {
  var n = arguments;
  if (r == null || !w2.call(r, "css"))
    return react__WEBPACK_IMPORTED_MODULE_1__.createElement.apply(void 0, n);
  var a = n.length, u = new Array(a);
  u[0] = HV, u[1] = NV(t, r);
  for (var s = 2; s < a; s++)
    u[s] = n[s];
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement.apply(null, u);
}, S3 = !1, VV = /* @__PURE__ */ x2(function(e, t) {
   true && !S3 && // check for className as well since the user is
  // probably using the custom createElement which
  // means it will be turned into a className prop
  // $FlowFixMe I don't really want to add it to the type since it shouldn't be used
  (e.className || e.css) && (console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"), S3 = !0);
  var r = e.styles, n = Hm([r], void 0, react__WEBPACK_IMPORTED_MODULE_1__.useContext(z1)), a = react__WEBPACK_IMPORTED_MODULE_1__.useRef();
  return b3(function() {
    var u = t.key + "-global", s = new t.sheet.constructor({
      key: u,
      nonce: t.sheet.nonce,
      container: t.sheet.container,
      speedy: t.sheet.isSpeedy
    }), c = !1, i = document.querySelector('style[data-emotion="' + u + " " + n.name + '"]');
    return t.sheet.tags.length && (s.before = t.sheet.tags[0]), i !== null && (c = !0, i.setAttribute("data-emotion", u), s.hydrate([i])), a.current = [s, c], function() {
      s.flush();
    };
  }, [t]), b3(function() {
    var u = a.current, s = u[0], c = u[1];
    if (c) {
      u[1] = !1;
      return;
    }
    if (n.next !== void 0 && C2(t, n.next, !0), s.tags.length) {
      var i = s.tags[s.tags.length - 1].nextElementSibling;
      s.before = i, s.flush();
    }
    t.insert("", n, s, !1);
  }, [t, n.name]), null;
});
 true && (VV.displayName = "EmotionGlobal");
function T2() {
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
    t[r] = arguments[r];
  return Hm(t);
}
var zV = function() {
  var t = T2.apply(void 0, arguments), r = "animation-" + t.name;
  return {
    name: r,
    styles: "@keyframes " + r + "{" + t.styles + "}",
    anim: 1,
    toString: function() {
      return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
    }
  };
}, WV = function e(t) {
  for (var r = t.length, n = 0, a = ""; n < r; n++) {
    var u = t[n];
    if (u != null) {
      var s = void 0;
      switch (typeof u) {
        case "boolean":
          break;
        case "object": {
          if (Array.isArray(u))
            s = e(u);
          else {
             true && u.styles !== void 0 && u.name !== void 0 && console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component."), s = "";
            for (var c in u)
              u[c] && c && (s && (s += " "), s += c);
          }
          break;
        }
        default:
          s = u;
      }
      s && (a && (a += " "), a += s);
    }
  }
  return a;
};
function _V(e, t, r) {
  var n = [], a = BI(e, n, r);
  return n.length < 2 ? r : a + t(n);
}
var UV = function(t) {
  var r = t.cache, n = t.serializedArr;
  return UI(function() {
    for (var a = 0; a < n.length; a++)
      C2(r, n[a], !1);
  }), null;
}, jV = /* @__PURE__ */ x2(function(e, t) {
  var r = !1, n = [], a = function() {
    if (r && "development" !== "production")
      throw new Error("css can only be used during render");
    for (var l = arguments.length, v = new Array(l), f = 0; f < l; f++)
      v[f] = arguments[f];
    var p = Hm(v, t.registered);
    return n.push(p), y2(t, p, !1), t.key + "-" + p.name;
  }, u = function() {
    if (r && "development" !== "production")
      throw new Error("cx can only be used during render");
    for (var l = arguments.length, v = new Array(l), f = 0; f < l; f++)
      v[f] = arguments[f];
    return _V(t.registered, a, WV(v));
  }, s = {
    css: a,
    cx: u,
    theme: react__WEBPACK_IMPORTED_MODULE_1__.useContext(z1)
  }, c = e.children(s);
  return r = !0, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(UV, {
    cache: t,
    serializedArr: n
  }), c);
});
 true && (jV.displayName = "EmotionClassNames");
if (true) {
  var x3 = !0, YV = typeof jest < "u" || typeof vi < "u";
  if (x3 && !YV) {
    var T3 = (
      // $FlowIgnore
      typeof globalThis < "u" ? globalThis : x3 ? window : __webpack_require__.g
    ), R3 = "__EMOTION_REACT_" + BV.version.split(".")[0] + "__";
    T3[R3] && console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used."), T3[R3] = !0;
  }
}
function XV(e, t) {
  return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
    raw: {
      value: Object.freeze(t)
    }
  }));
}
const $V = Math.min, ZV = Math.max, t1 = Math.round, fC = Math.floor, r1 = (e) => ({
  x: e,
  y: e
});
function KV(e) {
  const {
    x: t,
    y: r,
    width: n,
    height: a
  } = e;
  return {
    width: n,
    height: a,
    top: r,
    left: t,
    right: t + n,
    bottom: r + a,
    x: t,
    y: r
  };
}
function YI(e) {
  return $I(e) ? (e.nodeName || "").toLowerCase() : "#document";
}
function rd(e) {
  var t;
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
}
function XI(e) {
  var t;
  return (t = ($I(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
}
function $I(e) {
  return e instanceof Node || e instanceof rd(e).Node;
}
function JV(e) {
  return e instanceof Element || e instanceof rd(e).Element;
}
function R2(e) {
  return e instanceof HTMLElement || e instanceof rd(e).HTMLElement;
}
function A3(e) {
  return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof rd(e).ShadowRoot;
}
function ZI(e) {
  const {
    overflow: t,
    overflowX: r,
    overflowY: n,
    display: a
  } = A2(e);
  return /auto|scroll|overlay|hidden|clip/.test(t + n + r) && !["inline", "contents"].includes(a);
}
function QV() {
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
function qV(e) {
  return ["html", "body", "#document"].includes(YI(e));
}
function A2(e) {
  return rd(e).getComputedStyle(e);
}
function ez(e) {
  if (YI(e) === "html")
    return e;
  const t = (
    // Step into the shadow DOM of the parent of a slotted node.
    e.assignedSlot || // DOM Element detected.
    e.parentNode || // ShadowRoot detected.
    A3(e) && e.host || // Fallback.
    XI(e)
  );
  return A3(t) ? t.host : t;
}
function KI(e) {
  const t = ez(e);
  return qV(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : R2(t) && ZI(t) ? t : KI(t);
}
function n1(e, t, r) {
  var n;
  t === void 0 && (t = []), r === void 0 && (r = !0);
  const a = KI(e), u = a === ((n = e.ownerDocument) == null ? void 0 : n.body), s = rd(a);
  return u ? t.concat(s, s.visualViewport || [], ZI(a) ? a : [], s.frameElement && r ? n1(s.frameElement) : []) : t.concat(a, n1(a, [], r));
}
function tz(e) {
  const t = A2(e);
  let r = parseFloat(t.width) || 0, n = parseFloat(t.height) || 0;
  const a = R2(e), u = a ? e.offsetWidth : r, s = a ? e.offsetHeight : n, c = t1(r) !== u || t1(n) !== s;
  return c && (r = u, n = s), {
    width: r,
    height: n,
    $: c
  };
}
function E2(e) {
  return JV(e) ? e : e.contextElement;
}
function E3(e) {
  const t = E2(e);
  if (!R2(t))
    return r1(1);
  const r = t.getBoundingClientRect(), {
    width: n,
    height: a,
    $: u
  } = tz(t);
  let s = (u ? t1(r.width) : r.width) / n, c = (u ? t1(r.height) : r.height) / a;
  return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
    x: s,
    y: c
  };
}
const rz = /* @__PURE__ */ r1(0);
function nz(e) {
  const t = rd(e);
  return !QV() || !t.visualViewport ? rz : {
    x: t.visualViewport.offsetLeft,
    y: t.visualViewport.offsetTop
  };
}
function iz(e, t, r) {
  return !1;
}
function M3(e, t, r, n) {
  t === void 0 && (t = !1);
  const a = e.getBoundingClientRect(), u = E2(e);
  let s = r1(1);
  t && (s = E3(e));
  const c = iz() ? nz(u) : r1(0);
  let i = (a.left + c.x) / s.x, l = (a.top + c.y) / s.y, v = a.width / s.x, f = a.height / s.y;
  if (u) {
    const p = rd(u), g = n;
    let y = p, C = y.frameElement;
    for (; C && n && g !== y; ) {
      const m = E3(C), h = C.getBoundingClientRect(), w = A2(C), S = h.left + (C.clientLeft + parseFloat(w.paddingLeft)) * m.x, E = h.top + (C.clientTop + parseFloat(w.paddingTop)) * m.y;
      i *= m.x, l *= m.y, v *= m.x, f *= m.y, i += S, l += E, y = rd(C), C = y.frameElement;
    }
  }
  return KV({
    width: v,
    height: f,
    x: i,
    y: l
  });
}
function az(e, t) {
  let r = null, n;
  const a = XI(e);
  function u() {
    var c;
    clearTimeout(n), (c = r) == null || c.disconnect(), r = null;
  }
  function s(c, i) {
    c === void 0 && (c = !1), i === void 0 && (i = 1), u();
    const {
      left: l,
      top: v,
      width: f,
      height: p
    } = e.getBoundingClientRect();
    if (c || t(), !f || !p)
      return;
    const g = fC(v), y = fC(a.clientWidth - (l + f)), C = fC(a.clientHeight - (v + p)), m = fC(l), w = {
      rootMargin: -g + "px " + -y + "px " + -C + "px " + -m + "px",
      threshold: ZV(0, $V(1, i)) || 1
    };
    let S = !0;
    function E(x) {
      const T = x[0].intersectionRatio;
      if (T !== i) {
        if (!S)
          return s();
        T ? s(!1, T) : n = setTimeout(() => {
          s(!1, 1e-7);
        }, 1e3);
      }
      S = !1;
    }
    try {
      r = new IntersectionObserver(E, {
        ...w,
        // Handle <iframe>s
        root: a.ownerDocument
      });
    } catch {
      r = new IntersectionObserver(E, w);
    }
    r.observe(e);
  }
  return s(!0), u;
}
function oz(e, t, r, n) {
  n === void 0 && (n = {});
  const {
    ancestorScroll: a = !0,
    ancestorResize: u = !0,
    elementResize: s = typeof ResizeObserver == "function",
    layoutShift: c = typeof IntersectionObserver == "function",
    animationFrame: i = !1
  } = n, l = E2(e), v = a || u ? [...l ? n1(l) : [], ...n1(t)] : [];
  v.forEach((h) => {
    a && h.addEventListener("scroll", r, {
      passive: !0
    }), u && h.addEventListener("resize", r);
  });
  const f = l && c ? az(l, r) : null;
  let p = -1, g = null;
  s && (g = new ResizeObserver((h) => {
    let [w] = h;
    w && w.target === l && g && (g.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
      var S;
      (S = g) == null || S.observe(t);
    })), r();
  }), l && !i && g.observe(l), g.observe(t));
  let y, C = i ? M3(e) : null;
  i && m();
  function m() {
    const h = M3(e);
    C && (h.x !== C.x || h.y !== C.y || h.width !== C.width || h.height !== C.height) && r(), C = h, y = requestAnimationFrame(m);
  }
  return r(), () => {
    var h;
    v.forEach((w) => {
      a && w.removeEventListener("scroll", r), u && w.removeEventListener("resize", r);
    }), f == null || f(), (h = g) == null || h.disconnect(), g = null, i && cancelAnimationFrame(y);
  };
}
var rT = react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect, sz = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"], i1 = function() {
};
function lz(e, t) {
  return t ? t[0] === "-" ? e + t : e + "__" + t : e;
}
function uz(e, t) {
  for (var r = arguments.length, n = new Array(r > 2 ? r - 2 : 0), a = 2; a < r; a++)
    n[a - 2] = arguments[a];
  var u = [].concat(n);
  if (t && e)
    for (var s in t)
      t.hasOwnProperty(s) && t[s] && u.push("".concat(lz(e, s)));
  return u.filter(function(c) {
    return c;
  }).map(function(c) {
    return String(c).trim();
  }).join(" ");
}
var a1 = function(t) {
  return yz(t) ? t.filter(Boolean) : Vh(t) === "object" && t !== null ? [t] : [];
}, JI = function(t) {
  t.className, t.clearValue, t.cx, t.getStyles, t.getClassNames, t.getValue, t.hasValue, t.isMulti, t.isRtl, t.options, t.selectOption, t.selectProps, t.setValue, t.theme;
  var r = uc(t, sz);
  return Hn({}, r);
}, ka = function(t, r, n) {
  var a = t.cx, u = t.getStyles, s = t.getClassNames, c = t.className;
  return {
    css: u(r, t),
    className: a(n ?? {}, s(r, t), c)
  };
};
function W1(e) {
  return [document.documentElement, document.body, window].indexOf(e) > -1;
}
function cz(e) {
  return W1(e) ? window.innerHeight : e.clientHeight;
}
function QI(e) {
  return W1(e) ? window.pageYOffset : e.scrollTop;
}
function o1(e, t) {
  if (W1(e)) {
    window.scrollTo(0, t);
    return;
  }
  e.scrollTop = t;
}
function dz(e) {
  var t = getComputedStyle(e), r = t.position === "absolute", n = /(auto|scroll)/;
  if (t.position === "fixed") return document.documentElement;
  for (var a = e; a = a.parentElement; )
    if (t = getComputedStyle(a), !(r && t.position === "static") && n.test(t.overflow + t.overflowY + t.overflowX))
      return a;
  return document.documentElement;
}
function fz(e, t, r, n) {
  return r * ((e = e / n - 1) * e * e + 1) + t;
}
function hC(e, t) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 200, n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : i1, a = QI(e), u = t - a, s = 10, c = 0;
  function i() {
    c += s;
    var l = fz(c, a, u, r);
    o1(e, l), c < r ? window.requestAnimationFrame(i) : n(e);
  }
  i();
}
function D3(e, t) {
  var r = e.getBoundingClientRect(), n = t.getBoundingClientRect(), a = t.offsetHeight / 3;
  n.bottom + a > r.bottom ? o1(e, Math.min(t.offsetTop + t.clientHeight - e.offsetHeight + a, e.scrollHeight)) : n.top - a < r.top && o1(e, Math.max(t.offsetTop - a, 0));
}
function hz(e) {
  var t = e.getBoundingClientRect();
  return {
    bottom: t.bottom,
    height: t.height,
    left: t.left,
    right: t.right,
    top: t.top,
    width: t.width
  };
}
function F3() {
  try {
    return document.createEvent("TouchEvent"), !0;
  } catch {
    return !1;
  }
}
function pz() {
  try {
    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  } catch {
    return !1;
  }
}
var qI = !1, vz = {
  get passive() {
    return qI = !0;
  }
}, pC = typeof window < "u" ? window : {};
pC.addEventListener && pC.removeEventListener && (pC.addEventListener("p", i1, vz), pC.removeEventListener("p", i1, !1));
var gz = qI;
function mz(e) {
  return e != null;
}
function yz(e) {
  return Array.isArray(e);
}
function ym(e, t, r) {
  return e ? t : r;
}
var Cz = function(t) {
  for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
    n[a - 1] = arguments[a];
  var u = Object.entries(t).filter(function(s) {
    var c = Kc(s, 1), i = c[0];
    return !n.includes(i);
  });
  return u.reduce(function(s, c) {
    var i = Kc(c, 2), l = i[0], v = i[1];
    return s[l] = v, s;
  }, {});
}, bz = ["children", "innerProps"], wz = ["children", "innerProps"];
function Sz(e) {
  var t = e.maxHeight, r = e.menuEl, n = e.minHeight, a = e.placement, u = e.shouldScroll, s = e.isFixedPosition, c = e.controlHeight, i = dz(r), l = {
    placement: "bottom",
    maxHeight: t
  };
  if (!r || !r.offsetParent) return l;
  var v = i.getBoundingClientRect(), f = v.height, p = r.getBoundingClientRect(), g = p.bottom, y = p.height, C = p.top, m = r.offsetParent.getBoundingClientRect(), h = m.top, w = s ? window.innerHeight : cz(i), S = QI(i), E = parseInt(getComputedStyle(r).marginBottom, 10), x = parseInt(getComputedStyle(r).marginTop, 10), T = h - x, F = w - C, P = T + S, k = f - S - C, I = g - w + S + E, L = S + C - x, A = 160;
  switch (a) {
    case "auto":
    case "bottom":
      if (F >= y)
        return {
          placement: "bottom",
          maxHeight: t
        };
      if (k >= y && !s)
        return u && hC(i, I, A), {
          placement: "bottom",
          maxHeight: t
        };
      if (!s && k >= n || s && F >= n) {
        u && hC(i, I, A);
        var O = s ? F - E : k - E;
        return {
          placement: "bottom",
          maxHeight: O
        };
      }
      if (a === "auto" || s) {
        var N = t, Y = s ? T : P;
        return Y >= n && (N = Math.min(Y - E - c, t)), {
          placement: "top",
          maxHeight: N
        };
      }
      if (a === "bottom")
        return u && o1(i, I), {
          placement: "bottom",
          maxHeight: t
        };
      break;
    case "top":
      if (T >= y)
        return {
          placement: "top",
          maxHeight: t
        };
      if (P >= y && !s)
        return u && hC(i, L, A), {
          placement: "top",
          maxHeight: t
        };
      if (!s && P >= n || s && T >= n) {
        var j = t;
        return (!s && P >= n || s && T >= n) && (j = s ? T - x : P - x), u && hC(i, L, A), {
          placement: "top",
          maxHeight: j
        };
      }
      return {
        placement: "bottom",
        maxHeight: t
      };
    default:
      throw new Error('Invalid placement provided "'.concat(a, '".'));
  }
  return l;
}
function xz(e) {
  var t = {
    bottom: "top",
    top: "bottom"
  };
  return e ? t[e] : "bottom";
}
var eL = function(t) {
  return t === "auto" ? "bottom" : t;
}, Tz = function(t, r) {
  var n, a = t.placement, u = t.theme, s = u.borderRadius, c = u.spacing, i = u.colors;
  return Hn((n = {
    label: "menu"
  }, mm(n, xz(a), "100%"), mm(n, "position", "absolute"), mm(n, "width", "100%"), mm(n, "zIndex", 1), n), r ? {} : {
    backgroundColor: i.neutral0,
    borderRadius: s,
    boxShadow: "0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",
    marginBottom: c.menuGutter,
    marginTop: c.menuGutter
  });
}, tL = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null), Rz = function(t) {
  var r = t.children, n = t.minMenuHeight, a = t.maxMenuHeight, u = t.menuPlacement, s = t.menuPosition, c = t.menuShouldScrollIntoView, i = t.theme, l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(tL) || {}, v = l.setPortalPlacement, f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(a), g = Kc(p, 2), y = g[0], C = g[1], m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), h = Kc(m, 2), w = h[0], S = h[1], E = i.spacing.controlHeight;
  return rT(function() {
    var x = f.current;
    if (x) {
      var T = s === "fixed", F = c && !T, P = Sz({
        maxHeight: a,
        menuEl: x,
        minHeight: n,
        placement: u,
        shouldScroll: F,
        isFixedPosition: T,
        controlHeight: E
      });
      C(P.maxHeight), S(P.placement), v == null || v(P.placement);
    }
  }, [a, u, s, c, n, v, E]), r({
    ref: f,
    placerProps: Hn(Hn({}, t), {}, {
      placement: w || eL(u),
      maxHeight: y
    })
  });
}, Az = function(t) {
  var r = t.children, n = t.innerRef, a = t.innerProps;
  return zn("div", _n({}, ka(t, "menu", {
    menu: !0
  }), {
    ref: n
  }, a), r);
}, Ez = Az, Mz = function(t, r) {
  var n = t.maxHeight, a = t.theme.spacing.baseUnit;
  return Hn({
    maxHeight: n,
    overflowY: "auto",
    position: "relative",
    // required for offset[Height, Top] > keyboard scroll
    WebkitOverflowScrolling: "touch"
  }, r ? {} : {
    paddingBottom: a,
    paddingTop: a
  });
}, Dz = function(t) {
  var r = t.children, n = t.innerProps, a = t.innerRef, u = t.isMulti;
  return zn("div", _n({}, ka(t, "menuList", {
    "menu-list": !0,
    "menu-list--is-multi": u
  }), {
    ref: a
  }, n), r);
}, rL = function(t, r) {
  var n = t.theme, a = n.spacing.baseUnit, u = n.colors;
  return Hn({
    textAlign: "center"
  }, r ? {} : {
    color: u.neutral40,
    padding: "".concat(a * 2, "px ").concat(a * 3, "px")
  });
}, Fz = rL, Pz = rL, Iz = function(t) {
  var r = t.children, n = r === void 0 ? "No options" : r, a = t.innerProps, u = uc(t, bz);
  return zn("div", _n({}, ka(Hn(Hn({}, u), {}, {
    children: n,
    innerProps: a
  }), "noOptionsMessage", {
    "menu-notice": !0,
    "menu-notice--no-options": !0
  }), a), n);
}, Lz = function(t) {
  var r = t.children, n = r === void 0 ? "Loading..." : r, a = t.innerProps, u = uc(t, wz);
  return zn("div", _n({}, ka(Hn(Hn({}, u), {}, {
    children: n,
    innerProps: a
  }), "loadingMessage", {
    "menu-notice": !0,
    "menu-notice--loading": !0
  }), a), n);
}, kz = function(t) {
  var r = t.rect, n = t.offset, a = t.position;
  return {
    left: r.left,
    position: a,
    top: n,
    width: r.width,
    zIndex: 1
  };
}, Oz = function(t) {
  var r = t.appendTo, n = t.children, a = t.controlElement, u = t.innerProps, s = t.menuPlacement, c = t.menuPosition, i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(eL(s)), f = Kc(v, 2), p = f[0], g = f[1], y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    return {
      setPortalPlacement: g
    };
  }, []), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), m = Kc(C, 2), h = m[0], w = m[1], S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function() {
    if (a) {
      var F = hz(a), P = c === "fixed" ? 0 : window.pageYOffset, k = F[p] + P;
      (k !== (h == null ? void 0 : h.offset) || F.left !== (h == null ? void 0 : h.rect.left) || F.width !== (h == null ? void 0 : h.rect.width)) && w({
        offset: k,
        rect: F
      });
    }
  }, [a, c, p, h == null ? void 0 : h.offset, h == null ? void 0 : h.rect.left, h == null ? void 0 : h.rect.width]);
  rT(function() {
    S();
  }, [S]);
  var E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function() {
    typeof l.current == "function" && (l.current(), l.current = null), a && i.current && (l.current = oz(a, i.current, S, {
      elementResize: "ResizeObserver" in window
    }));
  }, [a, S]);
  rT(function() {
    E();
  }, [E]);
  var x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(F) {
    i.current = F, E();
  }, [E]);
  if (!r && c !== "fixed" || !h) return null;
  var T = zn("div", _n({
    ref: x
  }, ka(Hn(Hn({}, t), {}, {
    offset: h.offset,
    position: c,
    rect: h.rect
  }), "menuPortal", {
    "menu-portal": !0
  }), u), n);
  return zn(tL.Provider, {
    value: y
  }, r ? /* @__PURE__ */ A1.createPortal(T, r) : T);
}, Nz = function(t) {
  var r = t.isDisabled, n = t.isRtl;
  return {
    label: "container",
    direction: n ? "rtl" : void 0,
    pointerEvents: r ? "none" : void 0,
    // cancel mouse events when disabled
    position: "relative"
  };
}, Gz = function(t) {
  var r = t.children, n = t.innerProps, a = t.isDisabled, u = t.isRtl;
  return zn("div", _n({}, ka(t, "container", {
    "--is-disabled": a,
    "--is-rtl": u
  }), n), r);
}, Hz = function(t, r) {
  var n = t.theme.spacing, a = t.isMulti, u = t.hasValue, s = t.selectProps.controlShouldRenderValue;
  return Hn({
    alignItems: "center",
    display: a && u && s ? "flex" : "grid",
    flex: 1,
    flexWrap: "wrap",
    WebkitOverflowScrolling: "touch",
    position: "relative",
    overflow: "hidden"
  }, r ? {} : {
    padding: "".concat(n.baseUnit / 2, "px ").concat(n.baseUnit * 2, "px")
  });
}, Bz = function(t) {
  var r = t.children, n = t.innerProps, a = t.isMulti, u = t.hasValue;
  return zn("div", _n({}, ka(t, "valueContainer", {
    "value-container": !0,
    "value-container--is-multi": a,
    "value-container--has-value": u
  }), n), r);
}, Vz = function() {
  return {
    alignItems: "center",
    alignSelf: "stretch",
    display: "flex",
    flexShrink: 0
  };
}, zz = function(t) {
  var r = t.children, n = t.innerProps;
  return zn("div", _n({}, ka(t, "indicatorsContainer", {
    indicators: !0
  }), n), r);
}, P3, Wz = ["size"], _z = ["innerProps", "isRtl", "size"];
function Uz() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var jz =  false ? 0 : {
  name: "tj5bde-Svg",
  styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: Uz
}, nL = function(t) {
  var r = t.size, n = uc(t, Wz);
  return zn("svg", _n({
    height: r,
    width: r,
    viewBox: "0 0 20 20",
    "aria-hidden": "true",
    focusable: "false",
    css: jz
  }, n));
}, M2 = function(t) {
  return zn(nL, _n({
    size: 20
  }, t), zn("path", {
    d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
  }));
}, iL = function(t) {
  return zn(nL, _n({
    size: 20
  }, t), zn("path", {
    d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
  }));
}, aL = function(t, r) {
  var n = t.isFocused, a = t.theme, u = a.spacing.baseUnit, s = a.colors;
  return Hn({
    label: "indicatorContainer",
    display: "flex",
    transition: "color 150ms"
  }, r ? {} : {
    color: n ? s.neutral60 : s.neutral20,
    padding: u * 2,
    ":hover": {
      color: n ? s.neutral80 : s.neutral40
    }
  });
}, Yz = aL, Xz = function(t) {
  var r = t.children, n = t.innerProps;
  return zn("div", _n({}, ka(t, "dropdownIndicator", {
    indicator: !0,
    "dropdown-indicator": !0
  }), n), r || zn(iL, null));
}, $z = aL, Zz = function(t) {
  var r = t.children, n = t.innerProps;
  return zn("div", _n({}, ka(t, "clearIndicator", {
    indicator: !0,
    "clear-indicator": !0
  }), n), r || zn(M2, null));
}, Kz = function(t, r) {
  var n = t.isDisabled, a = t.theme, u = a.spacing.baseUnit, s = a.colors;
  return Hn({
    label: "indicatorSeparator",
    alignSelf: "stretch",
    width: 1
  }, r ? {} : {
    backgroundColor: n ? s.neutral10 : s.neutral20,
    marginBottom: u * 2,
    marginTop: u * 2
  });
}, Jz = function(t) {
  var r = t.innerProps;
  return zn("span", _n({}, r, ka(t, "indicatorSeparator", {
    "indicator-separator": !0
  })));
}, Qz = zV(P3 || (P3 = XV([`
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
`]))), qz = function(t, r) {
  var n = t.isFocused, a = t.size, u = t.theme, s = u.colors, c = u.spacing.baseUnit;
  return Hn({
    label: "loadingIndicator",
    display: "flex",
    transition: "color 150ms",
    alignSelf: "center",
    fontSize: a,
    lineHeight: 1,
    marginRight: a,
    textAlign: "center",
    verticalAlign: "middle"
  }, r ? {} : {
    color: n ? s.neutral60 : s.neutral20,
    padding: c * 2
  });
}, ox = function(t) {
  var r = t.delay, n = t.offset;
  return zn("span", {
    css: /* @__PURE__ */ T2({
      animation: "".concat(Qz, " 1s ease-in-out ").concat(r, "ms infinite;"),
      backgroundColor: "currentColor",
      borderRadius: "1em",
      display: "inline-block",
      marginLeft: n ? "1em" : void 0,
      height: "1em",
      verticalAlign: "top",
      width: "1em"
    },  false ? 0 : ";label:LoadingDot;",  false ? 0 : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  });
}, eW = function(t) {
  var r = t.innerProps, n = t.isRtl, a = t.size, u = a === void 0 ? 4 : a, s = uc(t, _z);
  return zn("div", _n({}, ka(Hn(Hn({}, s), {}, {
    innerProps: r,
    isRtl: n,
    size: u
  }), "loadingIndicator", {
    indicator: !0,
    "loading-indicator": !0
  }), r), zn(ox, {
    delay: 0,
    offset: n
  }), zn(ox, {
    delay: 160,
    offset: !0
  }), zn(ox, {
    delay: 320,
    offset: !n
  }));
}, tW = function(t, r) {
  var n = t.isDisabled, a = t.isFocused, u = t.theme, s = u.colors, c = u.borderRadius, i = u.spacing;
  return Hn({
    label: "control",
    alignItems: "center",
    cursor: "default",
    display: "flex",
    flexWrap: "wrap",
    justifyContent: "space-between",
    minHeight: i.controlHeight,
    outline: "0 !important",
    position: "relative",
    transition: "all 100ms"
  }, r ? {} : {
    backgroundColor: n ? s.neutral5 : s.neutral0,
    borderColor: n ? s.neutral10 : a ? s.primary : s.neutral20,
    borderRadius: c,
    borderStyle: "solid",
    borderWidth: 1,
    boxShadow: a ? "0 0 0 1px ".concat(s.primary) : void 0,
    "&:hover": {
      borderColor: a ? s.primary : s.neutral30
    }
  });
}, rW = function(t) {
  var r = t.children, n = t.isDisabled, a = t.isFocused, u = t.innerRef, s = t.innerProps, c = t.menuIsOpen;
  return zn("div", _n({
    ref: u
  }, ka(t, "control", {
    control: !0,
    "control--is-disabled": n,
    "control--is-focused": a,
    "control--menu-is-open": c
  }), s, {
    "aria-disabled": n || void 0
  }), r);
}, nW = rW, iW = ["data"], aW = function(t, r) {
  var n = t.theme.spacing;
  return r ? {} : {
    paddingBottom: n.baseUnit * 2,
    paddingTop: n.baseUnit * 2
  };
}, oW = function(t) {
  var r = t.children, n = t.cx, a = t.getStyles, u = t.getClassNames, s = t.Heading, c = t.headingProps, i = t.innerProps, l = t.label, v = t.theme, f = t.selectProps;
  return zn("div", _n({}, ka(t, "group", {
    group: !0
  }), i), zn(s, _n({}, c, {
    selectProps: f,
    theme: v,
    getStyles: a,
    getClassNames: u,
    cx: n
  }), l), zn("div", null, r));
}, sW = function(t, r) {
  var n = t.theme, a = n.colors, u = n.spacing;
  return Hn({
    label: "group",
    cursor: "default",
    display: "block"
  }, r ? {} : {
    color: a.neutral40,
    fontSize: "75%",
    fontWeight: 500,
    marginBottom: "0.25em",
    paddingLeft: u.baseUnit * 3,
    paddingRight: u.baseUnit * 3,
    textTransform: "uppercase"
  });
}, lW = function(t) {
  var r = JI(t);
  r.data;
  var n = uc(r, iW);
  return zn("div", _n({}, ka(t, "groupHeading", {
    "group-heading": !0
  }), n));
}, uW = oW, cW = ["innerRef", "isDisabled", "isHidden", "inputClassName"], dW = function(t, r) {
  var n = t.isDisabled, a = t.value, u = t.theme, s = u.spacing, c = u.colors;
  return Hn(Hn({
    visibility: n ? "hidden" : "visible",
    // force css to recompute when value change due to @emotion bug.
    // We can remove it whenever the bug is fixed.
    transform: a ? "translateZ(0)" : ""
  }, fW), r ? {} : {
    margin: s.baseUnit / 2,
    paddingBottom: s.baseUnit / 2,
    paddingTop: s.baseUnit / 2,
    color: c.neutral80
  });
}, oL = {
  gridArea: "1 / 2",
  font: "inherit",
  minWidth: "2px",
  border: 0,
  margin: 0,
  outline: 0,
  padding: 0
}, fW = {
  flex: "1 1 auto",
  display: "inline-grid",
  gridArea: "1 / 1 / 2 / 3",
  gridTemplateColumns: "0 min-content",
  "&:after": Hn({
    content: 'attr(data-value) " "',
    visibility: "hidden",
    whiteSpace: "pre"
  }, oL)
}, hW = function(t) {
  return Hn({
    label: "input",
    color: "inherit",
    background: 0,
    opacity: t ? 0 : 1,
    width: "100%"
  }, oL);
}, pW = function(t) {
  var r = t.cx, n = t.value, a = JI(t), u = a.innerRef, s = a.isDisabled, c = a.isHidden, i = a.inputClassName, l = uc(a, cW);
  return zn("div", _n({}, ka(t, "input", {
    "input-container": !0
  }), {
    "data-value": n || ""
  }), zn("input", _n({
    className: r({
      input: !0
    }, i),
    ref: u,
    style: hW(c),
    disabled: s
  }, l)));
}, vW = pW, gW = function(t, r) {
  var n = t.theme, a = n.spacing, u = n.borderRadius, s = n.colors;
  return Hn({
    label: "multiValue",
    display: "flex",
    minWidth: 0
  }, r ? {} : {
    backgroundColor: s.neutral10,
    borderRadius: u / 2,
    margin: a.baseUnit / 2
  });
}, mW = function(t, r) {
  var n = t.theme, a = n.borderRadius, u = n.colors, s = t.cropWithEllipsis;
  return Hn({
    overflow: "hidden",
    textOverflow: s || s === void 0 ? "ellipsis" : void 0,
    whiteSpace: "nowrap"
  }, r ? {} : {
    borderRadius: a / 2,
    color: u.neutral80,
    fontSize: "85%",
    padding: 3,
    paddingLeft: 6
  });
}, yW = function(t, r) {
  var n = t.theme, a = n.spacing, u = n.borderRadius, s = n.colors, c = t.isFocused;
  return Hn({
    alignItems: "center",
    display: "flex"
  }, r ? {} : {
    borderRadius: u / 2,
    backgroundColor: c ? s.dangerLight : void 0,
    paddingLeft: a.baseUnit,
    paddingRight: a.baseUnit,
    ":hover": {
      backgroundColor: s.dangerLight,
      color: s.danger
    }
  });
}, sL = function(t) {
  var r = t.children, n = t.innerProps;
  return zn("div", n, r);
}, CW = sL, bW = sL;
function wW(e) {
  var t = e.children, r = e.innerProps;
  return zn("div", _n({
    role: "button"
  }, r), t || zn(M2, {
    size: 14
  }));
}
var SW = function(t) {
  var r = t.children, n = t.components, a = t.data, u = t.innerProps, s = t.isDisabled, c = t.removeProps, i = t.selectProps, l = n.Container, v = n.Label, f = n.Remove;
  return zn(l, {
    data: a,
    innerProps: Hn(Hn({}, ka(t, "multiValue", {
      "multi-value": !0,
      "multi-value--is-disabled": s
    })), u),
    selectProps: i
  }, zn(v, {
    data: a,
    innerProps: Hn({}, ka(t, "multiValueLabel", {
      "multi-value__label": !0
    })),
    selectProps: i
  }, r), zn(f, {
    data: a,
    innerProps: Hn(Hn({}, ka(t, "multiValueRemove", {
      "multi-value__remove": !0
    })), {}, {
      "aria-label": "Remove ".concat(r || "option")
    }, c),
    selectProps: i
  }));
}, xW = SW, TW = function(t, r) {
  var n = t.isDisabled, a = t.isFocused, u = t.isSelected, s = t.theme, c = s.spacing, i = s.colors;
  return Hn({
    label: "option",
    cursor: "default",
    display: "block",
    fontSize: "inherit",
    width: "100%",
    userSelect: "none",
    WebkitTapHighlightColor: "rgba(0, 0, 0, 0)"
  }, r ? {} : {
    backgroundColor: u ? i.primary : a ? i.primary25 : "transparent",
    color: n ? i.neutral20 : u ? i.neutral0 : "inherit",
    padding: "".concat(c.baseUnit * 2, "px ").concat(c.baseUnit * 3, "px"),
    // provide some affordance on touch devices
    ":active": {
      backgroundColor: n ? void 0 : u ? i.primary : i.primary50
    }
  });
}, RW = function(t) {
  var r = t.children, n = t.isDisabled, a = t.isFocused, u = t.isSelected, s = t.innerRef, c = t.innerProps;
  return zn("div", _n({}, ka(t, "option", {
    option: !0,
    "option--is-disabled": n,
    "option--is-focused": a,
    "option--is-selected": u
  }), {
    ref: s,
    "aria-disabled": n
  }, c), r);
}, AW = RW, EW = function(t, r) {
  var n = t.theme, a = n.spacing, u = n.colors;
  return Hn({
    label: "placeholder",
    gridArea: "1 / 1 / 2 / 3"
  }, r ? {} : {
    color: u.neutral50,
    marginLeft: a.baseUnit / 2,
    marginRight: a.baseUnit / 2
  });
}, MW = function(t) {
  var r = t.children, n = t.innerProps;
  return zn("div", _n({}, ka(t, "placeholder", {
    placeholder: !0
  }), n), r);
}, DW = MW, FW = function(t, r) {
  var n = t.isDisabled, a = t.theme, u = a.spacing, s = a.colors;
  return Hn({
    label: "singleValue",
    gridArea: "1 / 1 / 2 / 3",
    maxWidth: "100%",
    overflow: "hidden",
    textOverflow: "ellipsis",
    whiteSpace: "nowrap"
  }, r ? {} : {
    color: n ? s.neutral40 : s.neutral80,
    marginLeft: u.baseUnit / 2,
    marginRight: u.baseUnit / 2
  });
}, PW = function(t) {
  var r = t.children, n = t.isDisabled, a = t.innerProps;
  return zn("div", _n({}, ka(t, "singleValue", {
    "single-value": !0,
    "single-value--is-disabled": n
  }), a), r);
}, IW = PW, lL = {
  ClearIndicator: Zz,
  Control: nW,
  DropdownIndicator: Xz,
  DownChevron: iL,
  CrossIcon: M2,
  Group: uW,
  GroupHeading: lW,
  IndicatorsContainer: zz,
  IndicatorSeparator: Jz,
  Input: vW,
  LoadingIndicator: eW,
  Menu: Ez,
  MenuList: Dz,
  MenuPortal: Oz,
  LoadingMessage: Lz,
  NoOptionsMessage: Iz,
  MultiValue: xW,
  MultiValueContainer: CW,
  MultiValueLabel: bW,
  MultiValueRemove: wW,
  Option: AW,
  Placeholder: DW,
  SelectContainer: Gz,
  SingleValue: IW,
  ValueContainer: Bz
}, LW = function(t) {
  return Hn(Hn({}, lL), t.components);
}, I3 = Number.isNaN || function(t) {
  return typeof t == "number" && t !== t;
};
function kW(e, t) {
  return !!(e === t || I3(e) && I3(t));
}
function OW(e, t) {
  if (e.length !== t.length)
    return !1;
  for (var r = 0; r < e.length; r++)
    if (!kW(e[r], t[r]))
      return !1;
  return !0;
}
function NW(e, t) {
  t === void 0 && (t = OW);
  var r = null;
  function n() {
    for (var a = [], u = 0; u < arguments.length; u++)
      a[u] = arguments[u];
    if (r && r.lastThis === this && t(a, r.lastArgs))
      return r.lastResult;
    var s = e.apply(this, a);
    return r = {
      lastResult: s,
      lastArgs: a,
      lastThis: this
    }, s;
  }
  return n.clear = function() {
    r = null;
  }, n;
}
function GW() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var HW =  false ? 0 : {
  name: "1f43avz-a11yText-A11yText",
  styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",
  toString: GW
}, BW = function(t) {
  return zn("span", _n({
    css: HW
  }, t));
}, L3 = BW, VW = {
  guidance: function(t) {
    var r = t.isSearchable, n = t.isMulti, a = t.tabSelectsValue, u = t.context, s = t.isInitialFocus;
    switch (u) {
      case "menu":
        return "Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a ? ", press Tab to select the option and exit the menu" : "", ".");
      case "input":
        return s ? "".concat(t["aria-label"] || "Select", " is focused ").concat(r ? ",type to refine list" : "", ", press Down to open the menu, ").concat(n ? " press left to focus selected values" : "") : "";
      case "value":
        return "Use left and right to toggle between focused values, press Backspace to remove the currently focused value";
      default:
        return "";
    }
  },
  onChange: function(t) {
    var r = t.action, n = t.label, a = n === void 0 ? "" : n, u = t.labels, s = t.isDisabled;
    switch (r) {
      case "deselect-option":
      case "pop-value":
      case "remove-value":
        return "option ".concat(a, ", deselected.");
      case "clear":
        return "All selected options have been cleared.";
      case "initial-input-focus":
        return "option".concat(u.length > 1 ? "s" : "", " ").concat(u.join(","), ", selected.");
      case "select-option":
        return s ? "option ".concat(a, " is disabled. Select another option.") : "option ".concat(a, ", selected.");
      default:
        return "";
    }
  },
  onFocus: function(t) {
    var r = t.context, n = t.focused, a = t.options, u = t.label, s = u === void 0 ? "" : u, c = t.selectValue, i = t.isDisabled, l = t.isSelected, v = t.isAppleDevice, f = function(C, m) {
      return C && C.length ? "".concat(C.indexOf(m) + 1, " of ").concat(C.length) : "";
    };
    if (r === "value" && c)
      return "value ".concat(s, " focused, ").concat(f(c, n), ".");
    if (r === "menu" && v) {
      var p = i ? " disabled" : "", g = "".concat(l ? " selected" : "").concat(p);
      return "".concat(s).concat(g, ", ").concat(f(a, n), ".");
    }
    return "";
  },
  onFilter: function(t) {
    var r = t.inputValue, n = t.resultsMessage;
    return "".concat(n).concat(r ? " for search term " + r : "", ".");
  }
}, zW = function(t) {
  var r = t.ariaSelection, n = t.focusedOption, a = t.focusedValue, u = t.focusableOptions, s = t.isFocused, c = t.selectValue, i = t.selectProps, l = t.id, v = t.isAppleDevice, f = i.ariaLiveMessages, p = i.getOptionLabel, g = i.inputValue, y = i.isMulti, C = i.isOptionDisabled, m = i.isSearchable, h = i.menuIsOpen, w = i.options, S = i.screenReaderStatus, E = i.tabSelectsValue, x = i.isLoading, T = i["aria-label"], F = i["aria-live"], P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    return Hn(Hn({}, VW), f || {});
  }, [f]), k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    var Y = "";
    if (r && P.onChange) {
      var j = r.option, te = r.options, re = r.removedValue, z = r.removedValues, Z = r.value, W = function(se) {
        return Array.isArray(se) ? null : se;
      }, q = re || j || W(Z), ie = q ? p(q) : "", ce = te || z || void 0, X = ce ? ce.map(p) : [], U = Hn({
        // multiSelected items are usually items that have already been selected
        // or set by the user as a default value so we assume they are not disabled
        isDisabled: q && C(q, c),
        label: ie,
        labels: X
      }, r);
      Y = P.onChange(U);
    }
    return Y;
  }, [r, P, C, c, p]), I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    var Y = "", j = n || a, te = !!(n && c && c.includes(n));
    if (j && P.onFocus) {
      var re = {
        focused: j,
        label: p(j),
        isDisabled: C(j, c),
        isSelected: te,
        options: u,
        context: j === n ? "menu" : "value",
        selectValue: c,
        isAppleDevice: v
      };
      Y = P.onFocus(re);
    }
    return Y;
  }, [n, a, p, C, P, u, c, v]), L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    var Y = "";
    if (h && w.length && !x && P.onFilter) {
      var j = S({
        count: u.length
      });
      Y = P.onFilter({
        inputValue: g,
        resultsMessage: j
      });
    }
    return Y;
  }, [u, g, h, P, w, S, x]), A = (r == null ? void 0 : r.action) === "initial-input-focus", O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    var Y = "";
    if (P.guidance) {
      var j = a ? "value" : h ? "menu" : "input";
      Y = P.guidance({
        "aria-label": T,
        context: j,
        isDisabled: n && C(n, c),
        isMulti: y,
        isSearchable: m,
        tabSelectsValue: E,
        isInitialFocus: A
      });
    }
    return Y;
  }, [T, n, a, y, C, m, h, P, c, E, A]), N = zn(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, zn("span", {
    id: "aria-selection"
  }, k), zn("span", {
    id: "aria-focused"
  }, I), zn("span", {
    id: "aria-results"
  }, L), zn("span", {
    id: "aria-guidance"
  }, O));
  return zn(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, zn(L3, {
    id: l
  }, A && N), zn(L3, {
    "aria-live": F,
    "aria-atomic": "false",
    "aria-relevant": "additions text",
    role: "log"
  }, s && !A && N));
}, WW = zW, nT = [{
  base: "A",
  letters: "AⒶＡÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"
}, {
  base: "AA",
  letters: "Ꜳ"
}, {
  base: "AE",
  letters: "ÆǼǢ"
}, {
  base: "AO",
  letters: "Ꜵ"
}, {
  base: "AU",
  letters: "Ꜷ"
}, {
  base: "AV",
  letters: "ꜸꜺ"
}, {
  base: "AY",
  letters: "Ꜽ"
}, {
  base: "B",
  letters: "BⒷＢḂḄḆɃƂƁ"
}, {
  base: "C",
  letters: "CⒸＣĆĈĊČÇḈƇȻꜾ"
}, {
  base: "D",
  letters: "DⒹＤḊĎḌḐḒḎĐƋƊƉꝹ"
}, {
  base: "DZ",
  letters: "ǱǄ"
}, {
  base: "Dz",
  letters: "ǲǅ"
}, {
  base: "E",
  letters: "EⒺＥÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"
}, {
  base: "F",
  letters: "FⒻＦḞƑꝻ"
}, {
  base: "G",
  letters: "GⒼＧǴĜḠĞĠǦĢǤƓꞠꝽꝾ"
}, {
  base: "H",
  letters: "HⒽＨĤḢḦȞḤḨḪĦⱧⱵꞍ"
}, {
  base: "I",
  letters: "IⒾＩÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"
}, {
  base: "J",
  letters: "JⒿＪĴɈ"
}, {
  base: "K",
  letters: "KⓀＫḰǨḲĶḴƘⱩꝀꝂꝄꞢ"
}, {
  base: "L",
  letters: "LⓁＬĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"
}, {
  base: "LJ",
  letters: "Ǉ"
}, {
  base: "Lj",
  letters: "ǈ"
}, {
  base: "M",
  letters: "MⓂＭḾṀṂⱮƜ"
}, {
  base: "N",
  letters: "NⓃＮǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"
}, {
  base: "NJ",
  letters: "Ǌ"
}, {
  base: "Nj",
  letters: "ǋ"
}, {
  base: "O",
  letters: "OⓄＯÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"
}, {
  base: "OI",
  letters: "Ƣ"
}, {
  base: "OO",
  letters: "Ꝏ"
}, {
  base: "OU",
  letters: "Ȣ"
}, {
  base: "P",
  letters: "PⓅＰṔṖƤⱣꝐꝒꝔ"
}, {
  base: "Q",
  letters: "QⓆＱꝖꝘɊ"
}, {
  base: "R",
  letters: "RⓇＲŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"
}, {
  base: "S",
  letters: "SⓈＳẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"
}, {
  base: "T",
  letters: "TⓉＴṪŤṬȚŢṰṮŦƬƮȾꞆ"
}, {
  base: "TZ",
  letters: "Ꜩ"
}, {
  base: "U",
  letters: "UⓊＵÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"
}, {
  base: "V",
  letters: "VⓋＶṼṾƲꝞɅ"
}, {
  base: "VY",
  letters: "Ꝡ"
}, {
  base: "W",
  letters: "WⓌＷẀẂŴẆẄẈⱲ"
}, {
  base: "X",
  letters: "XⓍＸẊẌ"
}, {
  base: "Y",
  letters: "YⓎＹỲÝŶỸȲẎŸỶỴƳɎỾ"
}, {
  base: "Z",
  letters: "ZⓏＺŹẐŻŽẒẔƵȤⱿⱫꝢ"
}, {
  base: "a",
  letters: "aⓐａẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"
}, {
  base: "aa",
  letters: "ꜳ"
}, {
  base: "ae",
  letters: "æǽǣ"
}, {
  base: "ao",
  letters: "ꜵ"
}, {
  base: "au",
  letters: "ꜷ"
}, {
  base: "av",
  letters: "ꜹꜻ"
}, {
  base: "ay",
  letters: "ꜽ"
}, {
  base: "b",
  letters: "bⓑｂḃḅḇƀƃɓ"
}, {
  base: "c",
  letters: "cⓒｃćĉċčçḉƈȼꜿↄ"
}, {
  base: "d",
  letters: "dⓓｄḋďḍḑḓḏđƌɖɗꝺ"
}, {
  base: "dz",
  letters: "ǳǆ"
}, {
  base: "e",
  letters: "eⓔｅèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"
}, {
  base: "f",
  letters: "fⓕｆḟƒꝼ"
}, {
  base: "g",
  letters: "gⓖｇǵĝḡğġǧģǥɠꞡᵹꝿ"
}, {
  base: "h",
  letters: "hⓗｈĥḣḧȟḥḩḫẖħⱨⱶɥ"
}, {
  base: "hv",
  letters: "ƕ"
}, {
  base: "i",
  letters: "iⓘｉìíîĩīĭïḯỉǐȉȋịįḭɨı"
}, {
  base: "j",
  letters: "jⓙｊĵǰɉ"
}, {
  base: "k",
  letters: "kⓚｋḱǩḳķḵƙⱪꝁꝃꝅꞣ"
}, {
  base: "l",
  letters: "lⓛｌŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"
}, {
  base: "lj",
  letters: "ǉ"
}, {
  base: "m",
  letters: "mⓜｍḿṁṃɱɯ"
}, {
  base: "n",
  letters: "nⓝｎǹńñṅňṇņṋṉƞɲŉꞑꞥ"
}, {
  base: "nj",
  letters: "ǌ"
}, {
  base: "o",
  letters: "oⓞｏòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"
}, {
  base: "oi",
  letters: "ƣ"
}, {
  base: "ou",
  letters: "ȣ"
}, {
  base: "oo",
  letters: "ꝏ"
}, {
  base: "p",
  letters: "pⓟｐṕṗƥᵽꝑꝓꝕ"
}, {
  base: "q",
  letters: "qⓠｑɋꝗꝙ"
}, {
  base: "r",
  letters: "rⓡｒŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"
}, {
  base: "s",
  letters: "sⓢｓßśṥŝṡšṧṣṩșşȿꞩꞅẛ"
}, {
  base: "t",
  letters: "tⓣｔṫẗťṭțţṱṯŧƭʈⱦꞇ"
}, {
  base: "tz",
  letters: "ꜩ"
}, {
  base: "u",
  letters: "uⓤｕùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"
}, {
  base: "v",
  letters: "vⓥｖṽṿʋꝟʌ"
}, {
  base: "vy",
  letters: "ꝡ"
}, {
  base: "w",
  letters: "wⓦｗẁẃŵẇẅẘẉⱳ"
}, {
  base: "x",
  letters: "xⓧｘẋẍ"
}, {
  base: "y",
  letters: "yⓨｙỳýŷỹȳẏÿỷẙỵƴɏỿ"
}, {
  base: "z",
  letters: "zⓩｚźẑżžẓẕƶȥɀⱬꝣ"
}], _W = new RegExp("[" + nT.map(function(e) {
  return e.letters;
}).join("") + "]", "g"), uL = {};
for (var sx = 0; sx < nT.length; sx++)
  for (var lx = nT[sx], ux = 0; ux < lx.letters.length; ux++)
    uL[lx.letters[ux]] = lx.base;
var cL = function(t) {
  return t.replace(_W, function(r) {
    return uL[r];
  });
}, UW = NW(cL), k3 = function(t) {
  return t.replace(/^\s+|\s+$/g, "");
}, jW = function(t) {
  return "".concat(t.label, " ").concat(t.value);
}, YW = function(t) {
  return function(r, n) {
    if (r.data.__isNew__) return !0;
    var a = Hn({
      ignoreCase: !0,
      ignoreAccents: !0,
      stringify: jW,
      trim: !0,
      matchFrom: "any"
    }, t), u = a.ignoreCase, s = a.ignoreAccents, c = a.stringify, i = a.trim, l = a.matchFrom, v = i ? k3(n) : n, f = i ? k3(c(r)) : c(r);
    return u && (v = v.toLowerCase(), f = f.toLowerCase()), s && (v = UW(v), f = cL(f)), l === "start" ? f.substr(0, v.length) === v : f.indexOf(v) > -1;
  };
}, XW = ["innerRef"];
function $W(e) {
  var t = e.innerRef, r = uc(e, XW), n = Cz(r, "onExited", "in", "enter", "exit", "appear");
  return zn("input", _n({
    ref: t
  }, n, {
    css: /* @__PURE__ */ T2({
      label: "dummyInput",
      // get rid of any default styles
      background: 0,
      border: 0,
      // important! this hides the flashing cursor
      caretColor: "transparent",
      fontSize: "inherit",
      gridArea: "1 / 1 / 2 / 3",
      outline: 0,
      padding: 0,
      // important! without `width` browsers won't allow focus
      width: 1,
      // remove cursor on desktop
      color: "transparent",
      // remove cursor on mobile whilst maintaining "scroll into view" behaviour
      left: -100,
      opacity: 0,
      position: "relative",
      transform: "scale(.01)"
    },  false ? 0 : ";label:DummyInput;",  false ? 0 : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtb3ZlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIER1bW15SW5wdXQoe1xuICBpbm5lclJlZixcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snaW5wdXQnXSAmIHtcbiAgcmVhZG9ubHkgaW5uZXJSZWY6IFJlZjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0pIHtcbiAgLy8gUmVtb3ZlIGFuaW1hdGlvbiBwcm9wcyBub3QgbWVhbnQgZm9yIEhUTUwgZWxlbWVudHNcbiAgY29uc3QgZmlsdGVyZWRQcm9wcyA9IHJlbW92ZVByb3BzKFxuICAgIHByb3BzLFxuICAgICdvbkV4aXRlZCcsXG4gICAgJ2luJyxcbiAgICAnZW50ZXInLFxuICAgICdleGl0JyxcbiAgICAnYXBwZWFyJ1xuICApO1xuXG4gIHJldHVybiAoXG4gICAgPGlucHV0XG4gICAgICByZWY9e2lubmVyUmVmfVxuICAgICAgey4uLmZpbHRlcmVkUHJvcHN9XG4gICAgICBjc3M9e3tcbiAgICAgICAgbGFiZWw6ICdkdW1teUlucHV0JyxcbiAgICAgICAgLy8gZ2V0IHJpZCBvZiBhbnkgZGVmYXVsdCBzdHlsZXNcbiAgICAgICAgYmFja2dyb3VuZDogMCxcbiAgICAgICAgYm9yZGVyOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHRoaXMgaGlkZXMgdGhlIGZsYXNoaW5nIGN1cnNvclxuICAgICAgICBjYXJldENvbG9yOiAndHJhbnNwYXJlbnQnLFxuICAgICAgICBmb250U2l6ZTogJ2luaGVyaXQnLFxuICAgICAgICBncmlkQXJlYTogJzEgLyAxIC8gMiAvIDMnLFxuICAgICAgICBvdXRsaW5lOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHdpdGhvdXQgYHdpZHRoYCBicm93c2VycyB3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")
  }));
}
var ZW = function(t) {
  t.cancelable && t.preventDefault(), t.stopPropagation();
};
function KW(e) {
  var t = e.isEnabled, r = e.onBottomArrive, n = e.onBottomLeave, a = e.onTopArrive, u = e.onTopLeave, s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(m, h) {
    if (l.current !== null) {
      var w = l.current, S = w.scrollTop, E = w.scrollHeight, x = w.clientHeight, T = l.current, F = h > 0, P = E - x - S, k = !1;
      P > h && s.current && (n && n(m), s.current = !1), F && c.current && (u && u(m), c.current = !1), F && h > P ? (r && !s.current && r(m), T.scrollTop = E, k = !0, s.current = !0) : !F && -h > S && (a && !c.current && a(m), T.scrollTop = 0, k = !0, c.current = !0), k && ZW(m);
    }
  }, [r, n, a, u]), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(m) {
    v(m, m.deltaY);
  }, [v]), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(m) {
    i.current = m.changedTouches[0].clientY;
  }, []), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(m) {
    var h = i.current - m.changedTouches[0].clientY;
    v(m, h);
  }, [v]), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(m) {
    if (m) {
      var h = gz ? {
        passive: !1
      } : !1;
      m.addEventListener("wheel", f, h), m.addEventListener("touchstart", p, h), m.addEventListener("touchmove", g, h);
    }
  }, [g, p, f]), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(m) {
    m && (m.removeEventListener("wheel", f, !1), m.removeEventListener("touchstart", p, !1), m.removeEventListener("touchmove", g, !1));
  }, [g, p, f]);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function() {
    if (t) {
      var m = l.current;
      return y(m), function() {
        C(m);
      };
    }
  }, [t, y, C]), function(m) {
    l.current = m;
  };
}
var O3 = ["boxSizing", "height", "overflow", "paddingRight", "position"], N3 = {
  boxSizing: "border-box",
  // account for possible declaration `width: 100%;` on body
  overflow: "hidden",
  position: "relative",
  height: "100%"
};
function G3(e) {
  e.preventDefault();
}
function H3(e) {
  e.stopPropagation();
}
function B3() {
  var e = this.scrollTop, t = this.scrollHeight, r = e + this.offsetHeight;
  e === 0 ? this.scrollTop = 1 : r === t && (this.scrollTop = e - 1);
}
function V3() {
  return "ontouchstart" in window || navigator.maxTouchPoints;
}
var z3 = !!(typeof window < "u" && window.document && window.document.createElement), cm = 0, uv = {
  capture: !1,
  passive: !1
};
function JW(e) {
  var t = e.isEnabled, r = e.accountForScrollbars, n = r === void 0 ? !0 : r, a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)({}), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(i) {
    if (z3) {
      var l = document.body, v = l && l.style;
      if (n && O3.forEach(function(y) {
        var C = v && v[y];
        a.current[y] = C;
      }), n && cm < 1) {
        var f = parseInt(a.current.paddingRight, 10) || 0, p = document.body ? document.body.clientWidth : 0, g = window.innerWidth - p + f || 0;
        Object.keys(N3).forEach(function(y) {
          var C = N3[y];
          v && (v[y] = C);
        }), v && (v.paddingRight = "".concat(g, "px"));
      }
      l && V3() && (l.addEventListener("touchmove", G3, uv), i && (i.addEventListener("touchstart", B3, uv), i.addEventListener("touchmove", H3, uv))), cm += 1;
    }
  }, [n]), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(i) {
    if (z3) {
      var l = document.body, v = l && l.style;
      cm = Math.max(cm - 1, 0), n && cm < 1 && O3.forEach(function(f) {
        var p = a.current[f];
        v && (v[f] = p);
      }), l && V3() && (l.removeEventListener("touchmove", G3, uv), i && (i.removeEventListener("touchstart", B3, uv), i.removeEventListener("touchmove", H3, uv)));
    }
  }, [n]);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function() {
    if (t) {
      var i = u.current;
      return s(i), function() {
        c(i);
      };
    }
  }, [t, s, c]), function(i) {
    u.current = i;
  };
}
function QW() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var qW = function(t) {
  var r = t.target;
  return r.ownerDocument.activeElement && r.ownerDocument.activeElement.blur();
}, e_ =  false ? 0 : {
  name: "bp8cua-ScrollManager",
  styles: "position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9IChldmVudDogTW91c2VFdmVudDxIVE1MRGl2RWxlbWVudD4pID0+IHtcbiAgY29uc3QgZWxlbWVudCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MRGl2RWxlbWVudDtcbiAgcmV0dXJuIChcbiAgICBlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCAmJlxuICAgIChlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCBhcyBIVE1MRWxlbWVudCkuYmx1cigpXG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBTY3JvbGxNYW5hZ2VyKHtcbiAgY2hpbGRyZW4sXG4gIGxvY2tFbmFibGVkLFxuICBjYXB0dXJlRW5hYmxlZCA9IHRydWUsXG4gIG9uQm90dG9tQXJyaXZlLFxuICBvbkJvdHRvbUxlYXZlLFxuICBvblRvcEFycml2ZSxcbiAgb25Ub3BMZWF2ZSxcbn06IFByb3BzKSB7XG4gIGNvbnN0IHNldFNjcm9sbENhcHR1cmVUYXJnZXQgPSB1c2VTY3JvbGxDYXB0dXJlKHtcbiAgICBpc0VuYWJsZWQ6IGNhcHR1cmVFbmFibGVkLFxuICAgIG9uQm90dG9tQXJyaXZlLFxuICAgIG9uQm90dG9tTGVhdmUsXG4gICAgb25Ub3BBcnJpdmUsXG4gICAgb25Ub3BMZWF2ZSxcbiAgfSk7XG4gIGNvbnN0IHNldFNjcm9sbExvY2tUYXJnZXQgPSB1c2VTY3JvbGxMb2NrKHsgaXNFbmFibGVkOiBsb2NrRW5hYmxlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",
  toString: QW
};
function t_(e) {
  var t = e.children, r = e.lockEnabled, n = e.captureEnabled, a = n === void 0 ? !0 : n, u = e.onBottomArrive, s = e.onBottomLeave, c = e.onTopArrive, i = e.onTopLeave, l = KW({
    isEnabled: a,
    onBottomArrive: u,
    onBottomLeave: s,
    onTopArrive: c,
    onTopLeave: i
  }), v = JW({
    isEnabled: r
  }), f = function(g) {
    l(g), v(g);
  };
  return zn(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, r && zn("div", {
    onClick: qW,
    css: e_
  }), t(f));
}
function r_() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var n_ =  false ? 0 : {
  name: "5kkxb2-requiredInput-RequiredInput",
  styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",
  map: "",
  toString: r_
}, i_ = function(t) {
  var r = t.name, n = t.onFocus;
  return zn("input", {
    required: !0,
    name: r,
    tabIndex: -1,
    "aria-hidden": "true",
    onFocus: n,
    css: n_,
    value: "",
    onChange: function() {
    }
  });
}, a_ = i_;
function D2(e) {
  var t;
  return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
}
function o_() {
  return D2(/^iPhone/i);
}
function dL() {
  return D2(/^Mac/i);
}
function s_() {
  return D2(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
  dL() && navigator.maxTouchPoints > 1;
}
function l_() {
  return o_() || s_();
}
function u_() {
  return dL() || l_();
}
var c_ = function(t) {
  return t.label;
}, fL = function(t) {
  return t.label;
}, hL = function(t) {
  return t.value;
}, d_ = function(t) {
  return !!t.isDisabled;
}, f_ = {
  clearIndicator: $z,
  container: Nz,
  control: tW,
  dropdownIndicator: Yz,
  group: aW,
  groupHeading: sW,
  indicatorsContainer: Vz,
  indicatorSeparator: Kz,
  input: dW,
  loadingIndicator: qz,
  loadingMessage: Pz,
  menu: Tz,
  menuList: Mz,
  menuPortal: kz,
  multiValue: gW,
  multiValueLabel: mW,
  multiValueRemove: yW,
  noOptionsMessage: Fz,
  option: TW,
  placeholder: EW,
  singleValue: FW,
  valueContainer: Hz
}, h_ = {
  primary: "#2684FF",
  primary75: "#4C9AFF",
  primary50: "#B2D4FF",
  primary25: "#DEEBFF",
  danger: "#DE350B",
  dangerLight: "#FFBDAD",
  neutral0: "hsl(0, 0%, 100%)",
  neutral5: "hsl(0, 0%, 95%)",
  neutral10: "hsl(0, 0%, 90%)",
  neutral20: "hsl(0, 0%, 80%)",
  neutral30: "hsl(0, 0%, 70%)",
  neutral40: "hsl(0, 0%, 60%)",
  neutral50: "hsl(0, 0%, 50%)",
  neutral60: "hsl(0, 0%, 40%)",
  neutral70: "hsl(0, 0%, 30%)",
  neutral80: "hsl(0, 0%, 20%)",
  neutral90: "hsl(0, 0%, 10%)"
}, p_ = 4, pL = 4, v_ = 38, g_ = pL * 2, m_ = {
  baseUnit: pL,
  controlHeight: v_,
  menuGutter: g_
}, cx = {
  borderRadius: p_,
  colors: h_,
  spacing: m_
}, y_ = {
  "aria-live": "polite",
  backspaceRemovesValue: !0,
  blurInputOnSelect: F3(),
  captureMenuScroll: !F3(),
  classNames: {},
  closeMenuOnSelect: !0,
  closeMenuOnScroll: !1,
  components: {},
  controlShouldRenderValue: !0,
  escapeClearsValue: !1,
  filterOption: YW(),
  formatGroupLabel: c_,
  getOptionLabel: fL,
  getOptionValue: hL,
  isDisabled: !1,
  isLoading: !1,
  isMulti: !1,
  isRtl: !1,
  isSearchable: !0,
  isOptionDisabled: d_,
  loadingMessage: function() {
    return "Loading...";
  },
  maxMenuHeight: 300,
  minMenuHeight: 140,
  menuIsOpen: !1,
  menuPlacement: "bottom",
  menuPosition: "absolute",
  menuShouldBlockScroll: !1,
  menuShouldScrollIntoView: !pz(),
  noOptionsMessage: function() {
    return "No options";
  },
  openMenuOnFocus: !1,
  openMenuOnClick: !0,
  options: [],
  pageSize: 5,
  placeholder: "Select...",
  screenReaderStatus: function(t) {
    var r = t.count;
    return "".concat(r, " result").concat(r !== 1 ? "s" : "", " available");
  },
  styles: {},
  tabIndex: 0,
  tabSelectsValue: !0,
  unstyled: !1
};
function W3(e, t, r, n) {
  var a = mL(e, t, r), u = yL(e, t, r), s = gL(e, t), c = s1(e, t);
  return {
    type: "option",
    data: t,
    isDisabled: a,
    isSelected: u,
    label: s,
    value: c,
    index: n
  };
}
function FC(e, t) {
  return e.options.map(function(r, n) {
    if ("options" in r) {
      var a = r.options.map(function(s, c) {
        return W3(e, s, t, c);
      }).filter(function(s) {
        return U3(e, s);
      });
      return a.length > 0 ? {
        type: "group",
        data: r,
        options: a,
        index: n
      } : void 0;
    }
    var u = W3(e, r, t, n);
    return U3(e, u) ? u : void 0;
  }).filter(mz);
}
function vL(e) {
  return e.reduce(function(t, r) {
    return r.type === "group" ? t.push.apply(t, gv(r.options.map(function(n) {
      return n.data;
    }))) : t.push(r.data), t;
  }, []);
}
function _3(e, t) {
  return e.reduce(function(r, n) {
    return n.type === "group" ? r.push.apply(r, gv(n.options.map(function(a) {
      return {
        data: a.data,
        id: "".concat(t, "-").concat(n.index, "-").concat(a.index)
      };
    }))) : r.push({
      data: n.data,
      id: "".concat(t, "-").concat(n.index)
    }), r;
  }, []);
}
function C_(e, t) {
  return vL(FC(e, t));
}
function U3(e, t) {
  var r = e.inputValue, n = r === void 0 ? "" : r, a = t.data, u = t.isSelected, s = t.label, c = t.value;
  return (!bL(e) || !u) && CL(e, {
    label: s,
    value: c,
    data: a
  }, n);
}
function b_(e, t) {
  var r = e.focusedValue, n = e.selectValue, a = n.indexOf(r);
  if (a > -1) {
    var u = t.indexOf(r);
    if (u > -1)
      return r;
    if (a < t.length)
      return t[a];
  }
  return null;
}
function w_(e, t) {
  var r = e.focusedOption;
  return r && t.indexOf(r) > -1 ? r : t[0];
}
var dx = function(t, r) {
  var n, a = (n = t.find(function(u) {
    return u.data === r;
  })) === null || n === void 0 ? void 0 : n.id;
  return a || null;
}, gL = function(t, r) {
  return t.getOptionLabel(r);
}, s1 = function(t, r) {
  return t.getOptionValue(r);
};
function mL(e, t, r) {
  return typeof e.isOptionDisabled == "function" ? e.isOptionDisabled(t, r) : !1;
}
function yL(e, t, r) {
  if (r.indexOf(t) > -1) return !0;
  if (typeof e.isOptionSelected == "function")
    return e.isOptionSelected(t, r);
  var n = s1(e, t);
  return r.some(function(a) {
    return s1(e, a) === n;
  });
}
function CL(e, t, r) {
  return e.filterOption ? e.filterOption(t, r) : !0;
}
var bL = function(t) {
  var r = t.hideSelectedOptions, n = t.isMulti;
  return r === void 0 ? n : r;
}, S_ = 1, F2 = /* @__PURE__ */ function(e) {
  FB(r, e);
  var t = LB(r);
  function r(n) {
    var a;
    if (MB(this, r), a = t.call(this, n), a.state = {
      ariaSelection: null,
      focusedOption: null,
      focusedOptionId: null,
      focusableOptionsWithIds: [],
      focusedValue: null,
      inputIsHidden: !1,
      isFocused: !1,
      selectValue: [],
      clearFocusValueOnUpdate: !1,
      prevWasFocused: !1,
      inputIsHiddenAfterUpdate: void 0,
      prevProps: void 0,
      instancePrefix: ""
    }, a.blockOptionHover = !1, a.isComposing = !1, a.commonProps = void 0, a.initialTouchX = 0, a.initialTouchY = 0, a.openAfterFocus = !1, a.scrollToFocusedOptionOnUpdate = !1, a.userIsDragging = void 0, a.isAppleDevice = u_(), a.controlRef = null, a.getControlRef = function(i) {
      a.controlRef = i;
    }, a.focusedOptionRef = null, a.getFocusedOptionRef = function(i) {
      a.focusedOptionRef = i;
    }, a.menuListRef = null, a.getMenuListRef = function(i) {
      a.menuListRef = i;
    }, a.inputRef = null, a.getInputRef = function(i) {
      a.inputRef = i;
    }, a.focus = a.focusInput, a.blur = a.blurInput, a.onChange = function(i, l) {
      var v = a.props, f = v.onChange, p = v.name;
      l.name = p, a.ariaOnChange(i, l), f(i, l);
    }, a.setValue = function(i, l, v) {
      var f = a.props, p = f.closeMenuOnSelect, g = f.isMulti, y = f.inputValue;
      a.onInputChange("", {
        action: "set-value",
        prevInputValue: y
      }), p && (a.setState({
        inputIsHiddenAfterUpdate: !g
      }), a.onMenuClose()), a.setState({
        clearFocusValueOnUpdate: !0
      }), a.onChange(i, {
        action: l,
        option: v
      });
    }, a.selectOption = function(i) {
      var l = a.props, v = l.blurInputOnSelect, f = l.isMulti, p = l.name, g = a.state.selectValue, y = f && a.isOptionSelected(i, g), C = a.isOptionDisabled(i, g);
      if (y) {
        var m = a.getOptionValue(i);
        a.setValue(g.filter(function(h) {
          return a.getOptionValue(h) !== m;
        }), "deselect-option", i);
      } else if (!C)
        f ? a.setValue([].concat(gv(g), [i]), "select-option", i) : a.setValue(i, "select-option");
      else {
        a.ariaOnChange(i, {
          action: "select-option",
          option: i,
          name: p
        });
        return;
      }
      v && a.blurInput();
    }, a.removeValue = function(i) {
      var l = a.props.isMulti, v = a.state.selectValue, f = a.getOptionValue(i), p = v.filter(function(y) {
        return a.getOptionValue(y) !== f;
      }), g = ym(l, p, p[0] || null);
      a.onChange(g, {
        action: "remove-value",
        removedValue: i
      }), a.focusInput();
    }, a.clearValue = function() {
      var i = a.state.selectValue;
      a.onChange(ym(a.props.isMulti, [], null), {
        action: "clear",
        removedValues: i
      });
    }, a.popValue = function() {
      var i = a.props.isMulti, l = a.state.selectValue, v = l[l.length - 1], f = l.slice(0, l.length - 1), p = ym(i, f, f[0] || null);
      a.onChange(p, {
        action: "pop-value",
        removedValue: v
      });
    }, a.getFocusedOptionId = function(i) {
      return dx(a.state.focusableOptionsWithIds, i);
    }, a.getFocusableOptionsWithIds = function() {
      return _3(FC(a.props, a.state.selectValue), a.getElementId("option"));
    }, a.getValue = function() {
      return a.state.selectValue;
    }, a.cx = function() {
      for (var i = arguments.length, l = new Array(i), v = 0; v < i; v++)
        l[v] = arguments[v];
      return uz.apply(void 0, [a.props.classNamePrefix].concat(l));
    }, a.getOptionLabel = function(i) {
      return gL(a.props, i);
    }, a.getOptionValue = function(i) {
      return s1(a.props, i);
    }, a.getStyles = function(i, l) {
      var v = a.props.unstyled, f = f_[i](l, v);
      f.boxSizing = "border-box";
      var p = a.props.styles[i];
      return p ? p(f, l) : f;
    }, a.getClassNames = function(i, l) {
      var v, f;
      return (v = (f = a.props.classNames)[i]) === null || v === void 0 ? void 0 : v.call(f, l);
    }, a.getElementId = function(i) {
      return "".concat(a.state.instancePrefix, "-").concat(i);
    }, a.getComponents = function() {
      return LW(a.props);
    }, a.buildCategorizedOptions = function() {
      return FC(a.props, a.state.selectValue);
    }, a.getCategorizedOptions = function() {
      return a.props.menuIsOpen ? a.buildCategorizedOptions() : [];
    }, a.buildFocusableOptions = function() {
      return vL(a.buildCategorizedOptions());
    }, a.getFocusableOptions = function() {
      return a.props.menuIsOpen ? a.buildFocusableOptions() : [];
    }, a.ariaOnChange = function(i, l) {
      a.setState({
        ariaSelection: Hn({
          value: i
        }, l)
      });
    }, a.onMenuMouseDown = function(i) {
      i.button === 0 && (i.stopPropagation(), i.preventDefault(), a.focusInput());
    }, a.onMenuMouseMove = function(i) {
      a.blockOptionHover = !1;
    }, a.onControlMouseDown = function(i) {
      if (!i.defaultPrevented) {
        var l = a.props.openMenuOnClick;
        a.state.isFocused ? a.props.menuIsOpen ? i.target.tagName !== "INPUT" && i.target.tagName !== "TEXTAREA" && a.onMenuClose() : l && a.openMenu("first") : (l && (a.openAfterFocus = !0), a.focusInput()), i.target.tagName !== "INPUT" && i.target.tagName !== "TEXTAREA" && i.preventDefault();
      }
    }, a.onDropdownIndicatorMouseDown = function(i) {
      if (!(i && i.type === "mousedown" && i.button !== 0) && !a.props.isDisabled) {
        var l = a.props, v = l.isMulti, f = l.menuIsOpen;
        a.focusInput(), f ? (a.setState({
          inputIsHiddenAfterUpdate: !v
        }), a.onMenuClose()) : a.openMenu("first"), i.preventDefault();
      }
    }, a.onClearIndicatorMouseDown = function(i) {
      i && i.type === "mousedown" && i.button !== 0 || (a.clearValue(), i.preventDefault(), a.openAfterFocus = !1, i.type === "touchend" ? a.focusInput() : setTimeout(function() {
        return a.focusInput();
      }));
    }, a.onScroll = function(i) {
      typeof a.props.closeMenuOnScroll == "boolean" ? i.target instanceof HTMLElement && W1(i.target) && a.props.onMenuClose() : typeof a.props.closeMenuOnScroll == "function" && a.props.closeMenuOnScroll(i) && a.props.onMenuClose();
    }, a.onCompositionStart = function() {
      a.isComposing = !0;
    }, a.onCompositionEnd = function() {
      a.isComposing = !1;
    }, a.onTouchStart = function(i) {
      var l = i.touches, v = l && l.item(0);
      v && (a.initialTouchX = v.clientX, a.initialTouchY = v.clientY, a.userIsDragging = !1);
    }, a.onTouchMove = function(i) {
      var l = i.touches, v = l && l.item(0);
      if (v) {
        var f = Math.abs(v.clientX - a.initialTouchX), p = Math.abs(v.clientY - a.initialTouchY), g = 5;
        a.userIsDragging = f > g || p > g;
      }
    }, a.onTouchEnd = function(i) {
      a.userIsDragging || (a.controlRef && !a.controlRef.contains(i.target) && a.menuListRef && !a.menuListRef.contains(i.target) && a.blurInput(), a.initialTouchX = 0, a.initialTouchY = 0);
    }, a.onControlTouchEnd = function(i) {
      a.userIsDragging || a.onControlMouseDown(i);
    }, a.onClearIndicatorTouchEnd = function(i) {
      a.userIsDragging || a.onClearIndicatorMouseDown(i);
    }, a.onDropdownIndicatorTouchEnd = function(i) {
      a.userIsDragging || a.onDropdownIndicatorMouseDown(i);
    }, a.handleInputChange = function(i) {
      var l = a.props.inputValue, v = i.currentTarget.value;
      a.setState({
        inputIsHiddenAfterUpdate: !1
      }), a.onInputChange(v, {
        action: "input-change",
        prevInputValue: l
      }), a.props.menuIsOpen || a.onMenuOpen();
    }, a.onInputFocus = function(i) {
      a.props.onFocus && a.props.onFocus(i), a.setState({
        inputIsHiddenAfterUpdate: !1,
        isFocused: !0
      }), (a.openAfterFocus || a.props.openMenuOnFocus) && a.openMenu("first"), a.openAfterFocus = !1;
    }, a.onInputBlur = function(i) {
      var l = a.props.inputValue;
      if (a.menuListRef && a.menuListRef.contains(document.activeElement)) {
        a.inputRef.focus();
        return;
      }
      a.props.onBlur && a.props.onBlur(i), a.onInputChange("", {
        action: "input-blur",
        prevInputValue: l
      }), a.onMenuClose(), a.setState({
        focusedValue: null,
        isFocused: !1
      });
    }, a.onOptionHover = function(i) {
      if (!(a.blockOptionHover || a.state.focusedOption === i)) {
        var l = a.getFocusableOptions(), v = l.indexOf(i);
        a.setState({
          focusedOption: i,
          focusedOptionId: v > -1 ? a.getFocusedOptionId(i) : null
        });
      }
    }, a.shouldHideSelectedOptions = function() {
      return bL(a.props);
    }, a.onValueInputFocus = function(i) {
      i.preventDefault(), i.stopPropagation(), a.focus();
    }, a.onKeyDown = function(i) {
      var l = a.props, v = l.isMulti, f = l.backspaceRemovesValue, p = l.escapeClearsValue, g = l.inputValue, y = l.isClearable, C = l.isDisabled, m = l.menuIsOpen, h = l.onKeyDown, w = l.tabSelectsValue, S = l.openMenuOnFocus, E = a.state, x = E.focusedOption, T = E.focusedValue, F = E.selectValue;
      if (!C && !(typeof h == "function" && (h(i), i.defaultPrevented))) {
        switch (a.blockOptionHover = !0, i.key) {
          case "ArrowLeft":
            if (!v || g) return;
            a.focusValue("previous");
            break;
          case "ArrowRight":
            if (!v || g) return;
            a.focusValue("next");
            break;
          case "Delete":
          case "Backspace":
            if (g) return;
            if (T)
              a.removeValue(T);
            else {
              if (!f) return;
              v ? a.popValue() : y && a.clearValue();
            }
            break;
          case "Tab":
            if (a.isComposing || i.shiftKey || !m || !w || !x || // don't capture the event if the menu opens on focus and the focused
            // option is already selected; it breaks the flow of navigation
            S && a.isOptionSelected(x, F))
              return;
            a.selectOption(x);
            break;
          case "Enter":
            if (i.keyCode === 229)
              break;
            if (m) {
              if (!x || a.isComposing) return;
              a.selectOption(x);
              break;
            }
            return;
          case "Escape":
            m ? (a.setState({
              inputIsHiddenAfterUpdate: !1
            }), a.onInputChange("", {
              action: "menu-close",
              prevInputValue: g
            }), a.onMenuClose()) : y && p && a.clearValue();
            break;
          case " ":
            if (g)
              return;
            if (!m) {
              a.openMenu("first");
              break;
            }
            if (!x) return;
            a.selectOption(x);
            break;
          case "ArrowUp":
            m ? a.focusOption("up") : a.openMenu("last");
            break;
          case "ArrowDown":
            m ? a.focusOption("down") : a.openMenu("first");
            break;
          case "PageUp":
            if (!m) return;
            a.focusOption("pageup");
            break;
          case "PageDown":
            if (!m) return;
            a.focusOption("pagedown");
            break;
          case "Home":
            if (!m) return;
            a.focusOption("first");
            break;
          case "End":
            if (!m) return;
            a.focusOption("last");
            break;
          default:
            return;
        }
        i.preventDefault();
      }
    }, a.state.instancePrefix = "react-select-" + (a.props.instanceId || ++S_), a.state.selectValue = a1(n.value), n.menuIsOpen && a.state.selectValue.length) {
      var u = a.getFocusableOptionsWithIds(), s = a.buildFocusableOptions(), c = s.indexOf(a.state.selectValue[0]);
      a.state.focusableOptionsWithIds = u, a.state.focusedOption = s[c], a.state.focusedOptionId = dx(u, s[c]);
    }
    return a;
  }
  return DB(r, [{
    key: "componentDidMount",
    value: function() {
      this.startListeningComposition(), this.startListeningToTouch(), this.props.closeMenuOnScroll && document && document.addEventListener && document.addEventListener("scroll", this.onScroll, !0), this.props.autoFocus && this.focusInput(), this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef && D3(this.menuListRef, this.focusedOptionRef);
    }
  }, {
    key: "componentDidUpdate",
    value: function(a) {
      var u = this.props, s = u.isDisabled, c = u.menuIsOpen, i = this.state.isFocused;
      // ensure focus is restored correctly when the control becomes enabled
      (i && !s && a.isDisabled || // ensure focus is on the Input when the menu opens
      i && c && !a.menuIsOpen) && this.focusInput(), i && s && !a.isDisabled ? this.setState({
        isFocused: !1
      }, this.onMenuClose) : !i && !s && a.isDisabled && this.inputRef === document.activeElement && this.setState({
        isFocused: !0
      }), this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate && (D3(this.menuListRef, this.focusedOptionRef), this.scrollToFocusedOptionOnUpdate = !1);
    }
  }, {
    key: "componentWillUnmount",
    value: function() {
      this.stopListeningComposition(), this.stopListeningToTouch(), document.removeEventListener("scroll", this.onScroll, !0);
    }
    // ==============================
    // Consumer Handlers
    // ==============================
  }, {
    key: "onMenuOpen",
    value: function() {
      this.props.onMenuOpen();
    }
  }, {
    key: "onMenuClose",
    value: function() {
      this.onInputChange("", {
        action: "menu-close",
        prevInputValue: this.props.inputValue
      }), this.props.onMenuClose();
    }
  }, {
    key: "onInputChange",
    value: function(a, u) {
      this.props.onInputChange(a, u);
    }
    // ==============================
    // Methods
    // ==============================
  }, {
    key: "focusInput",
    value: function() {
      this.inputRef && this.inputRef.focus();
    }
  }, {
    key: "blurInput",
    value: function() {
      this.inputRef && this.inputRef.blur();
    }
    // aliased for consumers
  }, {
    key: "openMenu",
    value: function(a) {
      var u = this, s = this.state, c = s.selectValue, i = s.isFocused, l = this.buildFocusableOptions(), v = a === "first" ? 0 : l.length - 1;
      if (!this.props.isMulti) {
        var f = l.indexOf(c[0]);
        f > -1 && (v = f);
      }
      this.scrollToFocusedOptionOnUpdate = !(i && this.menuListRef), this.setState({
        inputIsHiddenAfterUpdate: !1,
        focusedValue: null,
        focusedOption: l[v],
        focusedOptionId: this.getFocusedOptionId(l[v])
      }, function() {
        return u.onMenuOpen();
      });
    }
  }, {
    key: "focusValue",
    value: function(a) {
      var u = this.state, s = u.selectValue, c = u.focusedValue;
      if (this.props.isMulti) {
        this.setState({
          focusedOption: null
        });
        var i = s.indexOf(c);
        c || (i = -1);
        var l = s.length - 1, v = -1;
        if (s.length) {
          switch (a) {
            case "previous":
              i === 0 ? v = 0 : i === -1 ? v = l : v = i - 1;
              break;
            case "next":
              i > -1 && i < l && (v = i + 1);
              break;
          }
          this.setState({
            inputIsHidden: v !== -1,
            focusedValue: s[v]
          });
        }
      }
    }
  }, {
    key: "focusOption",
    value: function() {
      var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "first", u = this.props.pageSize, s = this.state.focusedOption, c = this.getFocusableOptions();
      if (c.length) {
        var i = 0, l = c.indexOf(s);
        s || (l = -1), a === "up" ? i = l > 0 ? l - 1 : c.length - 1 : a === "down" ? i = (l + 1) % c.length : a === "pageup" ? (i = l - u, i < 0 && (i = 0)) : a === "pagedown" ? (i = l + u, i > c.length - 1 && (i = c.length - 1)) : a === "last" && (i = c.length - 1), this.scrollToFocusedOptionOnUpdate = !0, this.setState({
          focusedOption: c[i],
          focusedValue: null,
          focusedOptionId: this.getFocusedOptionId(c[i])
        });
      }
    }
  }, {
    key: "getTheme",
    value: (
      // ==============================
      // Getters
      // ==============================
      function() {
        return this.props.theme ? typeof this.props.theme == "function" ? this.props.theme(cx) : Hn(Hn({}, cx), this.props.theme) : cx;
      }
    )
  }, {
    key: "getCommonProps",
    value: function() {
      var a = this.clearValue, u = this.cx, s = this.getStyles, c = this.getClassNames, i = this.getValue, l = this.selectOption, v = this.setValue, f = this.props, p = f.isMulti, g = f.isRtl, y = f.options, C = this.hasValue();
      return {
        clearValue: a,
        cx: u,
        getStyles: s,
        getClassNames: c,
        getValue: i,
        hasValue: C,
        isMulti: p,
        isRtl: g,
        options: y,
        selectOption: l,
        selectProps: f,
        setValue: v,
        theme: this.getTheme()
      };
    }
  }, {
    key: "hasValue",
    value: function() {
      var a = this.state.selectValue;
      return a.length > 0;
    }
  }, {
    key: "hasOptions",
    value: function() {
      return !!this.getFocusableOptions().length;
    }
  }, {
    key: "isClearable",
    value: function() {
      var a = this.props, u = a.isClearable, s = a.isMulti;
      return u === void 0 ? s : u;
    }
  }, {
    key: "isOptionDisabled",
    value: function(a, u) {
      return mL(this.props, a, u);
    }
  }, {
    key: "isOptionSelected",
    value: function(a, u) {
      return yL(this.props, a, u);
    }
  }, {
    key: "filterOption",
    value: function(a, u) {
      return CL(this.props, a, u);
    }
  }, {
    key: "formatOptionLabel",
    value: function(a, u) {
      if (typeof this.props.formatOptionLabel == "function") {
        var s = this.props.inputValue, c = this.state.selectValue;
        return this.props.formatOptionLabel(a, {
          context: u,
          inputValue: s,
          selectValue: c
        });
      } else
        return this.getOptionLabel(a);
    }
  }, {
    key: "formatGroupLabel",
    value: function(a) {
      return this.props.formatGroupLabel(a);
    }
    // ==============================
    // Mouse Handlers
    // ==============================
  }, {
    key: "startListeningComposition",
    value: (
      // ==============================
      // Composition Handlers
      // ==============================
      function() {
        document && document.addEventListener && (document.addEventListener("compositionstart", this.onCompositionStart, !1), document.addEventListener("compositionend", this.onCompositionEnd, !1));
      }
    )
  }, {
    key: "stopListeningComposition",
    value: function() {
      document && document.removeEventListener && (document.removeEventListener("compositionstart", this.onCompositionStart), document.removeEventListener("compositionend", this.onCompositionEnd));
    }
  }, {
    key: "startListeningToTouch",
    value: (
      // ==============================
      // Touch Handlers
      // ==============================
      function() {
        document && document.addEventListener && (document.addEventListener("touchstart", this.onTouchStart, !1), document.addEventListener("touchmove", this.onTouchMove, !1), document.addEventListener("touchend", this.onTouchEnd, !1));
      }
    )
  }, {
    key: "stopListeningToTouch",
    value: function() {
      document && document.removeEventListener && (document.removeEventListener("touchstart", this.onTouchStart), document.removeEventListener("touchmove", this.onTouchMove), document.removeEventListener("touchend", this.onTouchEnd));
    }
  }, {
    key: "renderInput",
    value: (
      // ==============================
      // Renderers
      // ==============================
      function() {
        var a = this.props, u = a.isDisabled, s = a.isSearchable, c = a.inputId, i = a.inputValue, l = a.tabIndex, v = a.form, f = a.menuIsOpen, p = a.required, g = this.getComponents(), y = g.Input, C = this.state, m = C.inputIsHidden, h = C.ariaSelection, w = this.commonProps, S = c || this.getElementId("input"), E = Hn(Hn(Hn({
          "aria-autocomplete": "list",
          "aria-expanded": f,
          "aria-haspopup": !0,
          "aria-errormessage": this.props["aria-errormessage"],
          "aria-invalid": this.props["aria-invalid"],
          "aria-label": this.props["aria-label"],
          "aria-labelledby": this.props["aria-labelledby"],
          "aria-required": p,
          role: "combobox",
          "aria-activedescendant": this.isAppleDevice ? void 0 : this.state.focusedOptionId || ""
        }, f && {
          "aria-controls": this.getElementId("listbox")
        }), !s && {
          "aria-readonly": !0
        }), this.hasValue() ? (h == null ? void 0 : h.action) === "initial-input-focus" && {
          "aria-describedby": this.getElementId("live-region")
        } : {
          "aria-describedby": this.getElementId("placeholder")
        });
        return s ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(y, _n({}, w, {
          autoCapitalize: "none",
          autoComplete: "off",
          autoCorrect: "off",
          id: S,
          innerRef: this.getInputRef,
          isDisabled: u,
          isHidden: m,
          onBlur: this.onInputBlur,
          onChange: this.handleInputChange,
          onFocus: this.onInputFocus,
          spellCheck: "false",
          tabIndex: l,
          form: v,
          type: "text",
          value: i
        }, E)) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($W, _n({
          id: S,
          innerRef: this.getInputRef,
          onBlur: this.onInputBlur,
          onChange: i1,
          onFocus: this.onInputFocus,
          disabled: u,
          tabIndex: l,
          inputMode: "none",
          form: v,
          value: ""
        }, E));
      }
    )
  }, {
    key: "renderPlaceholderOrValue",
    value: function() {
      var a = this, u = this.getComponents(), s = u.MultiValue, c = u.MultiValueContainer, i = u.MultiValueLabel, l = u.MultiValueRemove, v = u.SingleValue, f = u.Placeholder, p = this.commonProps, g = this.props, y = g.controlShouldRenderValue, C = g.isDisabled, m = g.isMulti, h = g.inputValue, w = g.placeholder, S = this.state, E = S.selectValue, x = S.focusedValue, T = S.isFocused;
      if (!this.hasValue() || !y)
        return h ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(f, _n({}, p, {
          key: "placeholder",
          isDisabled: C,
          isFocused: T,
          innerProps: {
            id: this.getElementId("placeholder")
          }
        }), w);
      if (m)
        return E.map(function(P, k) {
          var I = P === x, L = "".concat(a.getOptionLabel(P), "-").concat(a.getOptionValue(P));
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(s, _n({}, p, {
            components: {
              Container: c,
              Label: i,
              Remove: l
            },
            isFocused: I,
            isDisabled: C,
            key: L,
            index: k,
            removeProps: {
              onClick: function() {
                return a.removeValue(P);
              },
              onTouchEnd: function() {
                return a.removeValue(P);
              },
              onMouseDown: function(O) {
                O.preventDefault();
              }
            },
            data: P
          }), a.formatOptionLabel(P, "value"));
        });
      if (h)
        return null;
      var F = E[0];
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(v, _n({}, p, {
        data: F,
        isDisabled: C
      }), this.formatOptionLabel(F, "value"));
    }
  }, {
    key: "renderClearIndicator",
    value: function() {
      var a = this.getComponents(), u = a.ClearIndicator, s = this.commonProps, c = this.props, i = c.isDisabled, l = c.isLoading, v = this.state.isFocused;
      if (!this.isClearable() || !u || i || !this.hasValue() || l)
        return null;
      var f = {
        onMouseDown: this.onClearIndicatorMouseDown,
        onTouchEnd: this.onClearIndicatorTouchEnd,
        "aria-hidden": "true"
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(u, _n({}, s, {
        innerProps: f,
        isFocused: v
      }));
    }
  }, {
    key: "renderLoadingIndicator",
    value: function() {
      var a = this.getComponents(), u = a.LoadingIndicator, s = this.commonProps, c = this.props, i = c.isDisabled, l = c.isLoading, v = this.state.isFocused;
      if (!u || !l) return null;
      var f = {
        "aria-hidden": "true"
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(u, _n({}, s, {
        innerProps: f,
        isDisabled: i,
        isFocused: v
      }));
    }
  }, {
    key: "renderIndicatorSeparator",
    value: function() {
      var a = this.getComponents(), u = a.DropdownIndicator, s = a.IndicatorSeparator;
      if (!u || !s) return null;
      var c = this.commonProps, i = this.props.isDisabled, l = this.state.isFocused;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(s, _n({}, c, {
        isDisabled: i,
        isFocused: l
      }));
    }
  }, {
    key: "renderDropdownIndicator",
    value: function() {
      var a = this.getComponents(), u = a.DropdownIndicator;
      if (!u) return null;
      var s = this.commonProps, c = this.props.isDisabled, i = this.state.isFocused, l = {
        onMouseDown: this.onDropdownIndicatorMouseDown,
        onTouchEnd: this.onDropdownIndicatorTouchEnd,
        "aria-hidden": "true"
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(u, _n({}, s, {
        innerProps: l,
        isDisabled: c,
        isFocused: i
      }));
    }
  }, {
    key: "renderMenu",
    value: function() {
      var a = this, u = this.getComponents(), s = u.Group, c = u.GroupHeading, i = u.Menu, l = u.MenuList, v = u.MenuPortal, f = u.LoadingMessage, p = u.NoOptionsMessage, g = u.Option, y = this.commonProps, C = this.state.focusedOption, m = this.props, h = m.captureMenuScroll, w = m.inputValue, S = m.isLoading, E = m.loadingMessage, x = m.minMenuHeight, T = m.maxMenuHeight, F = m.menuIsOpen, P = m.menuPlacement, k = m.menuPosition, I = m.menuPortalTarget, L = m.menuShouldBlockScroll, A = m.menuShouldScrollIntoView, O = m.noOptionsMessage, N = m.onMenuScrollToTop, Y = m.onMenuScrollToBottom;
      if (!F) return null;
      var j = function(ie, ce) {
        var X = ie.type, U = ie.data, ne = ie.isDisabled, se = ie.isSelected, le = ie.label, ue = ie.value, ve = C === U, be = ne ? void 0 : function() {
          return a.onOptionHover(U);
        }, Me = ne ? void 0 : function() {
          return a.selectOption(U);
        }, Ge = "".concat(a.getElementId("option"), "-").concat(ce), we = {
          id: Ge,
          onClick: Me,
          onMouseMove: be,
          onMouseOver: be,
          tabIndex: -1,
          role: "option",
          "aria-selected": a.isAppleDevice ? void 0 : se
          // is not supported on Apple devices
        };
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(g, _n({}, y, {
          innerProps: we,
          data: U,
          isDisabled: ne,
          isSelected: se,
          key: Ge,
          label: le,
          type: X,
          value: ue,
          isFocused: ve,
          innerRef: ve ? a.getFocusedOptionRef : void 0
        }), a.formatOptionLabel(ie.data, "menu"));
      }, te;
      if (this.hasOptions())
        te = this.getCategorizedOptions().map(function(q) {
          if (q.type === "group") {
            var ie = q.data, ce = q.options, X = q.index, U = "".concat(a.getElementId("group"), "-").concat(X), ne = "".concat(U, "-heading");
            return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(s, _n({}, y, {
              key: U,
              data: ie,
              options: ce,
              Heading: c,
              headingProps: {
                id: ne,
                data: q.data
              },
              label: a.formatGroupLabel(q.data)
            }), q.options.map(function(se) {
              return j(se, "".concat(X, "-").concat(se.index));
            }));
          } else if (q.type === "option")
            return j(q, "".concat(q.index));
        });
      else if (S) {
        var re = E({
          inputValue: w
        });
        if (re === null) return null;
        te = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(f, y, re);
      } else {
        var z = O({
          inputValue: w
        });
        if (z === null) return null;
        te = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(p, y, z);
      }
      var Z = {
        minMenuHeight: x,
        maxMenuHeight: T,
        menuPlacement: P,
        menuPosition: k,
        menuShouldScrollIntoView: A
      }, W = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Rz, _n({}, y, Z), function(q) {
        var ie = q.ref, ce = q.placerProps, X = ce.placement, U = ce.maxHeight;
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(i, _n({}, y, Z, {
          innerRef: ie,
          innerProps: {
            onMouseDown: a.onMenuMouseDown,
            onMouseMove: a.onMenuMouseMove
          },
          isLoading: S,
          placement: X
        }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(t_, {
          captureEnabled: h,
          onTopArrive: N,
          onBottomArrive: Y,
          lockEnabled: L
        }, function(ne) {
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(l, _n({}, y, {
            innerRef: function(le) {
              a.getMenuListRef(le), ne(le);
            },
            innerProps: {
              role: "listbox",
              "aria-multiselectable": y.isMulti,
              id: a.getElementId("listbox")
            },
            isLoading: S,
            maxHeight: U,
            focusedOption: C
          }), te);
        }));
      });
      return I || k === "fixed" ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(v, _n({}, y, {
        appendTo: I,
        controlElement: this.controlRef,
        menuPlacement: P,
        menuPosition: k
      }), W) : W;
    }
  }, {
    key: "renderFormField",
    value: function() {
      var a = this, u = this.props, s = u.delimiter, c = u.isDisabled, i = u.isMulti, l = u.name, v = u.required, f = this.state.selectValue;
      if (v && !this.hasValue() && !c)
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(a_, {
          name: l,
          onFocus: this.onValueInputFocus
        });
      if (!(!l || c))
        if (i)
          if (s) {
            var p = f.map(function(C) {
              return a.getOptionValue(C);
            }).join(s);
            return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("input", {
              name: l,
              type: "hidden",
              value: p
            });
          } else {
            var g = f.length > 0 ? f.map(function(C, m) {
              return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("input", {
                key: "i-".concat(m),
                name: l,
                type: "hidden",
                value: a.getOptionValue(C)
              });
            }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("input", {
              name: l,
              type: "hidden",
              value: ""
            });
            return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, g);
          }
        else {
          var y = f[0] ? this.getOptionValue(f[0]) : "";
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("input", {
            name: l,
            type: "hidden",
            value: y
          });
        }
    }
  }, {
    key: "renderLiveRegion",
    value: function() {
      var a = this.commonProps, u = this.state, s = u.ariaSelection, c = u.focusedOption, i = u.focusedValue, l = u.isFocused, v = u.selectValue, f = this.getFocusableOptions();
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(WW, _n({}, a, {
        id: this.getElementId("live-region"),
        ariaSelection: s,
        focusedOption: c,
        focusedValue: i,
        isFocused: l,
        selectValue: v,
        focusableOptions: f,
        isAppleDevice: this.isAppleDevice
      }));
    }
  }, {
    key: "render",
    value: function() {
      var a = this.getComponents(), u = a.Control, s = a.IndicatorsContainer, c = a.SelectContainer, i = a.ValueContainer, l = this.props, v = l.className, f = l.id, p = l.isDisabled, g = l.menuIsOpen, y = this.state.isFocused, C = this.commonProps = this.getCommonProps();
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(c, _n({}, C, {
        className: v,
        innerProps: {
          id: f,
          onKeyDown: this.onKeyDown
        },
        isDisabled: p,
        isFocused: y
      }), this.renderLiveRegion(), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(u, _n({}, C, {
        innerRef: this.getControlRef,
        innerProps: {
          onMouseDown: this.onControlMouseDown,
          onTouchEnd: this.onControlTouchEnd
        },
        isDisabled: p,
        isFocused: y,
        menuIsOpen: g
      }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(i, _n({}, C, {
        isDisabled: p
      }), this.renderPlaceholderOrValue(), this.renderInput()), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(s, _n({}, C, {
        isDisabled: p
      }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function(a, u) {
      var s = u.prevProps, c = u.clearFocusValueOnUpdate, i = u.inputIsHiddenAfterUpdate, l = u.ariaSelection, v = u.isFocused, f = u.prevWasFocused, p = u.instancePrefix, g = a.options, y = a.value, C = a.menuIsOpen, m = a.inputValue, h = a.isMulti, w = a1(y), S = {};
      if (s && (y !== s.value || g !== s.options || C !== s.menuIsOpen || m !== s.inputValue)) {
        var E = C ? C_(a, w) : [], x = C ? _3(FC(a, w), "".concat(p, "-option")) : [], T = c ? b_(u, w) : null, F = w_(u, E), P = dx(x, F);
        S = {
          selectValue: w,
          focusedOption: F,
          focusedOptionId: P,
          focusableOptionsWithIds: x,
          focusedValue: T,
          clearFocusValueOnUpdate: !1
        };
      }
      var k = i != null && a !== s ? {
        inputIsHidden: i,
        inputIsHiddenAfterUpdate: void 0
      } : {}, I = l, L = v && f;
      return v && !L && (I = {
        value: ym(h, w, w[0] || null),
        options: w,
        action: "initial-input-focus"
      }, L = !f), (l == null ? void 0 : l.action) === "initial-input-focus" && (I = null), Hn(Hn(Hn({}, S), k), {}, {
        prevProps: a,
        ariaSelection: I,
        prevWasFocused: L
      });
    }
  }]), r;
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
F2.defaultProps = y_;
var x_ = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function(e, t) {
  var r = MI(e);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(F2, _n({
    ref: t
  }, r));
}), wL = x_;
const P2 = {
  control: (e) => ({
    ...e,
    borderColor: "var(--onyx-dropdown-control-border-color)",
    backgroundColor: "var(--onyx-dropdown-control-background-color)"
  }),
  menuPortal: (e) => ({ ...e, zIndex: 9999 }),
  menu: (e) => ({
    ...e,
    width: "100%",
    backgroundColor: "var(--onyx-dropdown-menu-background-color)"
  }),
  option: (e, t) => ({
    ...e,
    color: "var(--onyx-dropdown-label-color)",
    backgroundColor: t.isFocused ? "var(--onyx-dropdown-option-hover-background-color)" : "var(--onyx-dropdown-option-background-color)"
  }),
  singleValue: (e) => ({
    ...e,
    color: "var(--onyx-dropdown-label-color)"
  }),
  input: (e) => ({ ...e, color: "var(--onyx-dropdown-label-color)" }),
  multiValue: (e) => ({
    ...e,
    backgroundColor: "var(--onyx-dropdown-multivalue-label-background-color)"
  }),
  multiValueLabel: (e) => ({
    ...e,
    color: "var(--onyx-dropdown-label-color)"
  }),
  multiValueRemove: (e) => ({
    ...e,
    ":hover": {
      backgroundColor: "var(--bs-red)",
      color: "var(--bs-white)"
    }
  }),
  placeholder: (e) => ({
    ...e,
    color: "var(--bs-secondary-color)"
  })
}, SL = (e) => {
  const t = e.label.split("|", 2);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(lL.Option, { ...e, children: [
    t.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: t[0] }),
    t.length > 1 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "div",
      {
        style: { color: "var(--onyx-dropdown-option-description-color)" },
        children: t[1]
      }
    )
  ] }) });
}, xL = (e, t) => e + (t != null && t.get(e) ? ` | ${t == null ? void 0 : t.get(e)}` : "");
function $c(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    wL,
    {
      menuPosition: "fixed",
      isClearable: e.isClearable,
      isDisabled: e.isDisabled,
      components: { Option: SL },
      menuPortalTarget: document.body,
      styles: P2,
      options: e.options.map((t) => ({
        value: t,
        label: xL(t, e.titles)
      })),
      value: e.value ? {
        value: e.value,
        label: e.value
      } : null,
      onChange: (t) => t ? e.onChange({
        target: {
          value: t.value
        }
      }) : e.onChange({
        target: {
          value: ""
        }
      }),
      placeholder: e.placeholder || "Select value..."
    }
  );
}
function TL(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    wL,
    {
      isMulti: !0,
      menuPosition: "fixed",
      closeMenuOnSelect: !1,
      components: { Option: SL },
      menuPortalTarget: document.body,
      styles: P2,
      options: e.options.map((t) => ({
        value: t,
        label: xL(t, e.titles)
      })),
      value: e.value.map((t) => ({
        value: t,
        label: t
      })),
      delimiter: ",",
      onChange: (t) => e.onChange({
        target: {
          value: t.map((r) => r.value).join(",")
        }
      }),
      placeholder: e.placeholder || "Select values..."
    }
  );
}
const RL = (e) => Nl({
  queryKey: ["choices", e.project, e.field],
  queryFn: async () => e.httpPathHandler(`projects/${e.project}/choices/${e.field}/`).then((t) => t.json()).then((t) => new Map(
    Object.entries(t.data).map(([n, a]) => [
      n,
      a.description
    ])
  )),
  staleTime: 5 * 60 * 1e3
});
function T_(e) {
  const { data: t } = RL(e);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($c, { ...e, titles: t });
}
function R_(e) {
  const { data: t } = RL(e);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TL, { ...e, titles: t });
}
var A_ = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"], j3 = function() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", r = arguments.length > 1 ? arguments[1] : void 0, n = arguments.length > 2 ? arguments[2] : void 0, a = String(t).toLowerCase(), u = String(n.getOptionValue(r)).toLowerCase(), s = String(n.getOptionLabel(r)).toLowerCase();
  return u === a || s === a;
}, fx = {
  formatCreateLabel: function(t) {
    return 'Create "'.concat(t, '"');
  },
  isValidNewOption: function(t, r, n, a) {
    return !(!t || r.some(function(u) {
      return j3(t, u, a);
    }) || n.some(function(u) {
      return j3(t, u, a);
    }));
  },
  getNewOptionData: function(t, r) {
    return {
      label: r,
      value: t,
      __isNew__: !0
    };
  }
};
function E_(e) {
  var t = e.allowCreateWhileLoading, r = t === void 0 ? !1 : t, n = e.createOptionPosition, a = n === void 0 ? "last" : n, u = e.formatCreateLabel, s = u === void 0 ? fx.formatCreateLabel : u, c = e.isValidNewOption, i = c === void 0 ? fx.isValidNewOption : c, l = e.getNewOptionData, v = l === void 0 ? fx.getNewOptionData : l, f = e.onCreateOption, p = e.options, g = p === void 0 ? [] : p, y = e.onChange, C = uc(e, A_), m = C.getOptionValue, h = m === void 0 ? hL : m, w = C.getOptionLabel, S = w === void 0 ? fL : w, E = C.inputValue, x = C.isLoading, T = C.isMulti, F = C.value, P = C.name, k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    return i(E, a1(F), g, {
      getOptionValue: h,
      getOptionLabel: S
    }) ? v(E, s(E)) : void 0;
  }, [s, v, S, h, E, i, g, F]), I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    return (r || !x) && k ? a === "first" ? [k].concat(gv(g)) : [].concat(gv(g), [k]) : g;
  }, [r, a, x, k, g]), L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(A, O) {
    if (O.action !== "select-option")
      return y(A, O);
    var N = Array.isArray(A) ? A : [A];
    if (N[N.length - 1] === k) {
      if (f) f(E);
      else {
        var Y = v(E, E), j = {
          action: "create-option",
          name: P,
          option: Y
        };
        y(ym(T, [].concat(gv(a1(F)), [Y]), Y), j);
      }
      return;
    }
    y(A, O);
  }, [v, E, T, P, k, f, y, F]);
  return Hn(Hn({}, C), {}, {
    options: I,
    onChange: L
  });
}
var M_ = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function(e, t) {
  var r = MI(e), n = E_(r);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(F2, _n({
    ref: t
  }, n));
}), D_ = M_;
function F_({
  value: e,
  placeholder: t,
  onChange: r
}) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Di.Control,
    {
      value: e,
      placeholder: t || "Enter value...",
      onChange: r
    }
  );
}
function Y3({
  value: e,
  placeholder: t,
  limit: r,
  onChange: n
}) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    D_,
    {
      isMulti: !0,
      menuPosition: "fixed",
      menuPortalTarget: document.body,
      styles: P2,
      value: e.map((a) => ({
        value: a,
        label: a
      })),
      delimiter: ",",
      onChange: (a) => n({
        target: {
          value: a.map((u) => u.value).join(",")
        }
      }),
      isOptionDisabled: () => !(r === void 0 || e.length < r),
      noOptionsMessage: () => "Create a new value...",
      placeholder: t || "Enter values..."
    }
  );
}
function P_(e) {
  var l, v, f, p, g;
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e.filterList[e.index]), n = (y) => {
    var m, h;
    const C = { ...t };
    C.field = y.target.value, C.lookup = ((h = e.typeLookups.get(
      ((m = e.projectFields.get(y.target.value)) == null ? void 0 : m.type) || ""
    )) == null ? void 0 : h[0]) || "", C.lookup === "isnull" ? C.value = "true" : C.value = "", r(C);
  }, a = (y) => {
    const C = { ...t };
    C.lookup = y.target.value, C.lookup === "isnull" ? C.value = "true" : C.value = "", r(C);
  }, u = (y) => {
    const C = { ...t };
    C.value = y.target.value, r(C);
  }, s = () => {
    e.setFilterList([
      ...e.filterList.slice(0, e.index),
      t,
      ...e.filterList.slice(e.index + 1)
    ]), e.setEditMode(!1);
  };
  let c;
  const i = (y) => y ? y.split(",") : [];
  return t.lookup === "isnull" ? c = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    $c,
    {
      options: ["true", "false"],
      value: t.value,
      onChange: u
    }
  ) : ((l = e.projectFields.get(t.field)) == null ? void 0 : l.type) === "choice" ? t.lookup.endsWith("in") ? c = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    R_,
    {
      project: e.project,
      field: t.field,
      httpPathHandler: e.httpPathHandler,
      options: ((v = e.projectFields.get(t.field)) == null ? void 0 : v.values) || [],
      value: i(t.value),
      onChange: u
    }
  ) : c = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    T_,
    {
      project: e.project,
      field: t.field,
      httpPathHandler: e.httpPathHandler,
      isClearable: !0,
      options: ((f = e.projectFields.get(t.field)) == null ? void 0 : f.values) || [],
      value: t.value,
      onChange: u
    }
  ) : t.lookup.endsWith("in") ? c = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Y3,
    {
      value: i(t.value),
      onChange: u
    }
  ) : t.lookup.endsWith("range") ? c = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Y3,
    {
      value: i(t.value),
      limit: 2,
      onChange: u
    }
  ) : ((p = e.projectFields.get(t.field)) == null ? void 0 : p.type) === "bool" ? c = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    $c,
    {
      isClearable: !0,
      options: ["true", "false"],
      value: t.value,
      onChange: u
    }
  ) : c = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(F_, { value: t.value, onChange: u }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { gap: 3, className: "p-1", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Yh, { children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h5", { children: "Edit Filter" }) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ov,
        {
          className: "float-end",
          onClick: () => e.setEditMode(!1)
        }
      ) })
    ] }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { gap: 1, children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        $c,
        {
          options: e.fieldList,
          titles: e.fieldDescriptions,
          value: t.field,
          placeholder: "Select field...",
          onChange: n
        }
      ),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        $c,
        {
          options: e.typeLookups.get(
            ((g = e.projectFields.get(t.field)) == null ? void 0 : g.type) || ""
          ) || [],
          titles: e.lookupDescriptions,
          value: t.lookup,
          placeholder: "Select lookup...",
          onChange: a
        }
      ),
      c
    ] }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 1, children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "me-auto" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ki,
        {
          size: "sm",
          variant: "dark",
          onClick: () => e.setEditMode(!1),
          children: "Cancel"
        }
      ),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { size: "sm", onClick: s, children: "Apply" })
    ] })
  ] });
}
function dv() {
  return Math.random().toString(16).slice(2);
}
function I_(e) {
  switch (e) {
    case "exact":
      return "==";
    case "ne":
      return "!=";
    case "lt":
      return "<";
    case "lte":
      return "<=";
    case "gt":
      return ">";
    case "gte":
      return ">=";
    default:
      return e.toUpperCase();
  }
}
function L_(e) {
  let t = e.split(",").map((r) => `"${r}"`);
  return t.length > 10 && (t = t.slice(0, 10).concat([`... [${(t.length - 10).toString()} more]`])), t.join(", ");
}
function k_(e) {
  return !e.field && !e.lookup && !e.value ? "Empty Filter" : !e.field || !e.lookup ? "Incomplete Filter" : `${e.field} ${I_(e.lookup)} ${L_(
    e.value
  )}`;
}
function O_(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    r(!1), a({}), s(0);
  }, [e.project]);
  const c = (v, f) => {
    r(!0), a(v), s(f);
  }, i = (v) => {
    r(!1), e.setFilterList([
      ...e.filterList.slice(0, v),
      {
        key: dv(),
        field: "",
        lookup: "",
        value: ""
      },
      ...e.filterList.slice(v)
    ]);
  }, l = (v) => {
    const f = [...e.filterList];
    f.splice(v, 1), e.setFilterList(f);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl, { className: "h-50", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl.Header, { children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "Filter" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ki,
        {
          className: "float-end",
          size: "sm",
          variant: "dark",
          title: "Add Filter",
          onClick: () => i(e.filterList.length),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(d2, {})
        }
      )
    ] }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "overflow-y-scroll p-2 h-100", children: t ? /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(
      P_,
      {
        ...e,
        key: n.key,
        index: u,
        fieldList: e.filterFieldOptions,
        setEditMode: r
      }
    ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(La, { gap: 2, children: e.filterList.map((v, f) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "g-0", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(f2, { size: "sm", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ki,
        {
          variant: "dark",
          onClick: () => c(v, f),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "onyx-text-pink font-monospace", children: k_(v) })
        }
      ),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ki,
        {
          variant: "dark",
          title: "Remove Filter",
          onClick: () => l(f),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(c2, {})
        }
      )
    ] }) }, v.key)) }) })
  ] });
}
function N_(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e.transformList), n = (u) => {
    r(u.target.value ? u.target.value.split(",") : []);
  }, a = () => {
    e.setTransformList(t), e.setEditMode(!1);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { gap: 3, className: "p-1", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Yh, { children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h5", { children: "Edit Fields" }) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ov,
        {
          className: "float-end",
          onClick: () => e.setEditMode(!1)
        }
      ) })
    ] }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      TL,
      {
        options: e.transform === "Summarise" ? e.filterFieldOptions : e.listFieldOptions,
        titles: e.fieldDescriptions,
        value: t,
        placeholder: `${e.transform} fields...`,
        onChange: n
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 1, children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "me-auto" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ki,
        {
          size: "sm",
          variant: "dark",
          onClick: () => e.setEditMode(!1),
          children: "Cancel"
        }
      ),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { size: "sm", onClick: a, children: "Apply" })
    ] })
  ] });
}
function G_(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    r(!1);
  }, [e.project]);
  const n = (u) => {
    e.setTransform(u), e.setTransformList([]);
  }, a = (u) => {
    const s = [...e.transformList];
    s.splice(u, 1), e.setTransformList(s);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl, { className: "h-50", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Gl.Header, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 1, children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ZC, { className: "me-auto", title: e.transform, children: ["Summarise", "Include", "Exclude"].map((u) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        ZC.Item,
        {
          onClick: () => n(u),
          children: u
        },
        u
      )) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ki,
        {
          size: "sm",
          variant: "dark",
          title: "Edit Fields",
          onClick: () => r(!0),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(d2, {})
        }
      )
    ] }) }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "overflow-y-scroll p-2 h-100", children: t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      N_,
      {
        ...e,
        transform: e.transform,
        transformList: e.transformList,
        setTransformList: e.setTransformList,
        filterFieldOptions: e.filterFieldOptions,
        listFieldOptions: e.listFieldOptions,
        setEditMode: r
      }
    ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(La, { gap: 2, children: e.transformList.map((u, s) => (
      // TODO: Use transform key
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "g-0", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(f2, { size: "sm", children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { variant: "dark", onClick: () => r(!0), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "onyx-text-pink font-monospace", children: u }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Ki,
          {
            variant: "dark",
            title: "Remove Field",
            onClick: () => a(s),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(c2, {})
          }
        )
      ] }) }, s)
    )) }) })
  ] });
}
var Gv = class {
  constructor() {
    this.allSyncListeners = /* @__PURE__ */ new Map(), this.allAsyncListeners = /* @__PURE__ */ new Map(), this.globalSyncListeners = /* @__PURE__ */ new Set(), this.globalAsyncListeners = /* @__PURE__ */ new Set(), this.asyncFunctionsQueue = [], this.scheduled = !1, this.firedEvents = {};
  }
  setFrameworkOverrides(e) {
    this.frameworkOverrides = e;
  }
  getListeners(e, t, r) {
    const n = t ? this.allAsyncListeners : this.allSyncListeners;
    let a = n.get(e);
    return !a && r && (a = /* @__PURE__ */ new Set(), n.set(e, a)), a;
  }
  noRegisteredListenersExist() {
    return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0;
  }
  addEventListener(e, t, r = !1) {
    this.getListeners(e, r, !0).add(t);
  }
  removeEventListener(e, t, r = !1) {
    const n = this.getListeners(e, r, !1);
    n && (n.delete(t), n.size === 0 && (r ? this.allAsyncListeners : this.allSyncListeners).delete(e));
  }
  addGlobalListener(e, t = !1) {
    (t ? this.globalAsyncListeners : this.globalSyncListeners).add(e);
  }
  removeGlobalListener(e, t = !1) {
    (t ? this.globalAsyncListeners : this.globalSyncListeners).delete(e);
  }
  dispatchEvent(e) {
    const t = e;
    this.dispatchToListeners(t, !0), this.dispatchToListeners(t, !1), this.firedEvents[t.type] = !0;
  }
  dispatchEventOnce(e) {
    this.firedEvents[e.type] || this.dispatchEvent(e);
  }
  dispatchToListeners(e, t) {
    const r = e.type;
    if (t && "event" in e) {
      const c = e.event;
      c instanceof Event && (e.eventPath = c.composedPath());
    }
    const n = (c, i) => c.forEach((l) => {
      if (!i.has(l))
        return;
      const v = this.frameworkOverrides ? () => this.frameworkOverrides.wrapIncoming(() => l(e)) : () => l(e);
      t ? this.dispatchAsync(v) : v();
    }), a = this.getListeners(r, t, !1) ?? /* @__PURE__ */ new Set(), u = new Set(a);
    u.size > 0 && n(u, a), new Set(
      t ? this.globalAsyncListeners : this.globalSyncListeners
    ).forEach((c) => {
      const i = this.frameworkOverrides ? () => this.frameworkOverrides.wrapIncoming(() => c(r, e)) : () => c(r, e);
      t ? this.dispatchAsync(i) : i();
    });
  }
  // this gets called inside the grid's thread, for each event that it
  // wants to set async. the grid then batches the events into one setTimeout()
  // because setTimeout() is an expensive operation. ideally we would have
  // each event in it's own setTimeout(), but we batch for performance.
  dispatchAsync(e) {
    if (this.asyncFunctionsQueue.push(e), !this.scheduled) {
      const t = () => {
        window.setTimeout(this.flushAsyncQueue.bind(this), 0);
      };
      this.frameworkOverrides ? this.frameworkOverrides.wrapIncoming(t) : t(), this.scheduled = !0;
    }
  }
  // this happens in the next VM turn only, and empties the queue of events
  flushAsyncQueue() {
    this.scheduled = !1;
    const e = this.asyncFunctionsQueue.slice();
    this.asyncFunctionsQueue = [], e.forEach((t) => t());
  }
}, uf = /* @__PURE__ */ ((e) => (e.CommunityCoreModule = "@ag-grid-community/core", e.InfiniteRowModelModule = "@ag-grid-community/infinite-row-model", e.ClientSideRowModelModule = "@ag-grid-community/client-side-row-model", e.CsvExportModule = "@ag-grid-community/csv-export", e.EnterpriseCoreModule = "@ag-grid-enterprise/core", e.RowGroupingModule = "@ag-grid-enterprise/row-grouping", e.ColumnsToolPanelModule = "@ag-grid-enterprise/column-tool-panel", e.FiltersToolPanelModule = "@ag-grid-enterprise/filter-tool-panel", e.MenuModule = "@ag-grid-enterprise/menu", e.SetFilterModule = "@ag-grid-enterprise/set-filter", e.MultiFilterModule = "@ag-grid-enterprise/multi-filter", e.StatusBarModule = "@ag-grid-enterprise/status-bar", e.SideBarModule = "@ag-grid-enterprise/side-bar", e.RangeSelectionModule = "@ag-grid-enterprise/range-selection", e.MasterDetailModule = "@ag-grid-enterprise/master-detail", e.RichSelectModule = "@ag-grid-enterprise/rich-select", e.GridChartsModule = "@ag-grid-enterprise/charts", e.ViewportRowModelModule = "@ag-grid-enterprise/viewport-row-model", e.ServerSideRowModelModule = "@ag-grid-enterprise/server-side-row-model", e.ExcelExportModule = "@ag-grid-enterprise/excel-export", e.ClipboardModule = "@ag-grid-enterprise/clipboard", e.SparklinesModule = "@ag-grid-enterprise/sparklines", e.AdvancedFilterModule = "@ag-grid-enterprise/advanced-filter", e.AngularModule = "@ag-grid-community/angular", e.ReactModule = "@ag-grid-community/react", e.VueModule = "@ag-grid-community/vue", e))(uf || {}), X3 = {};
function I2(e, t) {
  X3[t] || (e(), X3[t] = !0);
}
function ef(e, ...t) {
  console.log("AG Grid: " + e, ...t);
}
function Fr(e, ...t) {
  I2(() => console.warn("AG Grid: " + e, ...t), e + (t == null ? void 0 : t.join("")));
}
function Ni(e, ...t) {
  I2(() => console.error("AG Grid: " + e, ...t), e + (t == null ? void 0 : t.join("")));
}
function L2(e) {
  return !!(e && e.constructor && e.call && e.apply);
}
function H_(e) {
  B_(e, 400);
}
var hx = [], px = !1;
function $3(e) {
  hx.push(e), !px && (px = !0, window.setTimeout(() => {
    const t = hx.slice();
    hx.length = 0, px = !1, t.forEach((r) => r());
  }, 0));
}
function B_(e, t = 0) {
  e.length > 0 && window.setTimeout(() => e.forEach((r) => r()), t);
}
function Cs(e, t) {
  let r;
  return function(...n) {
    const a = this;
    window.clearTimeout(r), r = window.setTimeout(function() {
      e.apply(a, n);
    }, t);
  };
}
function Z3(e, t) {
  let r = 0;
  return function(...n) {
    const a = this, u = (/* @__PURE__ */ new Date()).getTime();
    u - r < t || (r = u, e.apply(a, n));
  };
}
function V_(e, t, r = 100, n) {
  const a = (/* @__PURE__ */ new Date()).getTime();
  let u = null, s = !1;
  const c = () => {
    const i = (/* @__PURE__ */ new Date()).getTime() - a > r;
    (e() || i) && (t(), s = !0, u != null && (window.clearInterval(u), u = null), i && n && Fr(n));
  };
  c(), s || (u = window.setInterval(c, 10));
}
function z_(...e) {
  return (t) => e.reduce((r, n) => n(r), t);
}
function Jc(e) {
  return e == null || e === "" ? null : e;
}
function $r(e, t = !1) {
  return e != null && (e !== "" || t);
}
function mi(e) {
  return !$r(e);
}
function Rs(e) {
  return e == null || e.length === 0;
}
function iT(e) {
  return e != null && typeof e.toString == "function" ? e.toString() : null;
}
function Lh(e) {
  if (e === void 0)
    return;
  if (e === null || e === "")
    return null;
  if (typeof e == "number")
    return isNaN(e) ? void 0 : e;
  const t = parseInt(e, 10);
  return isNaN(t) ? void 0 : t;
}
function aT(e) {
  if (e !== void 0)
    return e === null || e === "" ? !1 : oT(e);
}
function oT(e) {
  return typeof e == "boolean" ? e : typeof e == "string" ? e.toUpperCase() === "TRUE" || e == "" : !1;
}
function l1(e, t) {
  const r = e ? JSON.stringify(e) : null, n = t ? JSON.stringify(t) : null;
  return r === n;
}
function W_(e, t, r = !1) {
  const n = e == null, a = t == null;
  if (e && e.toNumber && (e = e.toNumber()), t && t.toNumber && (t = t.toNumber()), n && a)
    return 0;
  if (n)
    return -1;
  if (a)
    return 1;
  function u(s, c) {
    return s > c ? 1 : s < c ? -1 : 0;
  }
  if (typeof e != "string" || !r)
    return u(e, t);
  try {
    return e.localeCompare(t);
  } catch {
    return u(e, t);
  }
}
function PC(e) {
  if (e instanceof Set || e instanceof Map) {
    const t = [];
    return e.forEach((r) => t.push(r)), t;
  }
  return Object.values(e);
}
function AL(e, t) {
  return e.get("rowModelType") === t;
}
function da(e) {
  return AL(e, "clientSide");
}
function sd(e) {
  return AL(e, "serverSide");
}
function Ao(e, t) {
  return e.get("domLayout") === t;
}
function u1(e) {
  return f1(e) !== void 0;
}
function c1(e) {
  return !e.get("suppressAsyncEvents");
}
function EL(e) {
  return typeof e.get("getRowHeight") == "function";
}
function __(e, t) {
  return t ? !e.get("enableStrictPivotColumnOrder") : e.get("maintainColumnOrder");
}
function af(e, t, r = !1, n) {
  if (n == null && (n = e.environment.getDefaultRowHeight()), EL(e)) {
    if (r)
      return { height: n, estimated: !0 };
    const s = {
      node: t,
      data: t.data
    }, c = e.getCallback("getRowHeight")(s);
    if (sT(c))
      return c === 0 && Fr(
        "The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."
      ), { height: Math.max(1, c), estimated: !1 };
  }
  if (t.detail && e.get("masterDetail"))
    return U_(e);
  const a = e.get("rowHeight");
  return { height: a && sT(a) ? a : n, estimated: !1 };
}
function U_(e) {
  if (e.get("detailRowAutoHeight"))
    return { height: 1, estimated: !1 };
  const t = e.get("detailRowHeight");
  return sT(t) ? { height: t, estimated: !1 } : { height: 300, estimated: !1 };
}
function _1(e) {
  const { environment: t } = e, r = e.get("rowHeight");
  if (!r || mi(r))
    return t.getDefaultRowHeight();
  const n = t.refreshRowHeightVariable();
  return n !== -1 ? n : (Fr("row height must be a number if not using standard row model"), t.getDefaultRowHeight());
}
function sT(e) {
  return !isNaN(e) && typeof e == "number" && isFinite(e);
}
function Bm(e, t, r) {
  const n = t[e.getDomDataKey()];
  return n ? n[r] : void 0;
}
function zh(e, t, r, n) {
  const a = e.getDomDataKey();
  let u = t[a];
  mi(u) && (u = {}, t[a] = u), u[r] = n;
}
function Va(e) {
  let t = null;
  const r = e.get("getDocument");
  return r && $r(r) ? t = r() : e.eGridDiv && (t = e.eGridDiv.ownerDocument), t && $r(t) ? t : document;
}
function ML(e) {
  return Va(e).defaultView || window;
}
function Vm(e) {
  return e.eGridDiv.getRootNode();
}
function Sa(e) {
  return Vm(e).activeElement;
}
function DL(e) {
  const t = Va(e), r = Sa(e);
  return r === null || r === t.body;
}
function yv(e) {
  return e.get("ensureDomOrder") ? !1 : e.get("animateRows");
}
function U1(e) {
  return !(e.get("paginateChildRows") || e.get("groupHideOpenParents") || Ao(e, "print"));
}
function ec(e) {
  const t = e.get("autoGroupColumnDef");
  return !(t != null && t.comparator) && !e.get("treeData");
}
function lT(e) {
  const t = e.get("groupAggFiltering");
  if (typeof t == "function")
    return e.getCallback("groupAggFiltering");
  if (t === !0)
    return () => !0;
}
function FL(e) {
  const t = e.get("grandTotalRow");
  if (t)
    return t;
  if (e.get("groupIncludeTotalFooter"))
    return "bottom";
}
function PL(e) {
  const t = e.get("groupTotalRow");
  if (typeof t == "function")
    return e.getCallback("groupTotalRow");
  if (t)
    return () => t;
  const r = e.get("groupIncludeFooter");
  if (typeof r == "function") {
    const n = e.getCallback("groupIncludeFooter");
    return (a) => n(a) ? "bottom" : void 0;
  }
  return () => r ? "bottom" : void 0;
}
function IL(e) {
  return e.exists("groupDisplayType") ? e.get("groupDisplayType") === "multipleColumns" : e.get("groupHideOpenParents");
}
function j1(e, t) {
  return t ? !1 : e.get("groupDisplayType") === "groupRows";
}
function ty(e) {
  const t = e.getCallback("getRowId");
  return t === void 0 ? t : (r) => {
    let n = t(r);
    return typeof n != "string" && (Fr("The getRowId callback must return a string. The ID ", n, " is being cast to a string."), n = String(n)), n;
  };
}
function Av(e) {
  return (e == null ? void 0 : e.checkboxes) ?? !0;
}
function d1(e) {
  return (e == null ? void 0 : e.mode) === "multiRow" && (e.headerCheckbox ?? !0);
}
function j_(e) {
  return (e == null ? void 0 : e.hideDisabledCheckboxes) ?? !1;
}
function Y_(e) {
  return typeof e.get("rowSelection") != "string";
}
function X_(e) {
  return e.get("cellSelection") !== void 0;
}
function $_(e) {
  const t = e.get("cellSelection");
  return t !== void 0 ? typeof t != "boolean" ? (t == null ? void 0 : t.suppressMultiRanges) ?? !1 : !1 : e.get("suppressMultiRangeSelection");
}
function nd(e) {
  const t = e.get("cellSelection");
  return t !== void 0 ? !!t : e.get("enableRangeSelection");
}
function Z_(e) {
  var n;
  const t = e.get("cellSelection");
  return t !== void 0 ? typeof t != "boolean" ? ((n = t.handle) == null ? void 0 : n.mode) === "range" : !1 : e.get("enableRangeHandle");
}
function K3(e) {
  var n;
  const t = e.get("cellSelection");
  return t !== void 0 ? typeof t != "boolean" ? ((n = t.handle) == null ? void 0 : n.mode) === "fill" : !1 : e.get("enableFillHandle");
}
function LL(e) {
  const t = e.get("rowSelection") ?? "single";
  if (typeof t == "string") {
    const r = e.get("suppressRowClickSelection"), n = e.get("suppressRowDeselection");
    return r && n ? !1 : r ? "enableDeselection" : n ? "enableSelection" : !0;
  }
  return t.mode === "singleRow" || t.mode === "multiRow" ? t.enableClickSelection ?? !1 : !1;
}
function K_(e) {
  const t = LL(e);
  return t === !0 || t === "enableSelection";
}
function vx(e) {
  const t = LL(e);
  return t === !0 || t === "enableDeselection";
}
function k2(e) {
  const t = e.get("rowSelection");
  return typeof t == "string" ? e.get("isRowSelectable") : t == null ? void 0 : t.isRowSelectable;
}
function f1(e) {
  const t = e.get("rowSelection");
  if (typeof t == "string")
    switch (t) {
      case "multiple":
        return "multiRow";
      case "single":
        return "singleRow";
      default:
        return;
    }
  return t == null ? void 0 : t.mode;
}
function kL(e) {
  return f1(e) === "multiRow";
}
function J_(e) {
  const t = e.get("rowSelection");
  return typeof t == "string" ? e.get("rowMultiSelectWithClick") : (t == null ? void 0 : t.enableSelectionWithoutKeys) ?? !1;
}
function O2(e) {
  const t = e.get("rowSelection");
  if (typeof t == "string") {
    const r = e.get("groupSelectsChildren"), n = e.get("groupSelectsFiltered");
    return r && n ? "filteredDescendants" : r ? "descendants" : "self";
  }
  return (t == null ? void 0 : t.mode) === "multiRow" ? t.groupSelects : void 0;
}
function Wh(e) {
  const t = O2(e);
  return t === "descendants" || t === "filteredDescendants";
}
function gx(e) {
  return e.isModuleRegistered(
    "@ag-grid-enterprise/set-filter"
    /* SetFilterModule */
  ) && !e.get("suppressSetFilterByDefault");
}
function di(e) {
  if (!(!e || !e.length))
    return e[e.length - 1];
}
function cf(e, t, r) {
  return e == null && t == null ? !0 : e != null && t != null && e.length === t.length && e.every((n, a) => r ? r(n, t[a]) : t[a] === n);
}
function Q_(e) {
  return e.sort((t, r) => t - r);
}
function OL(e, t) {
  const r = e.indexOf(t);
  r >= 0 && (e[r] = e[e.length - 1], e.pop());
}
function bs(e, t) {
  const r = e.indexOf(t);
  r >= 0 && e.splice(r, 1);
}
function q_(e, t) {
  for (let r = 0; r < t.length; r++)
    OL(e, t[r]);
}
function eU(e, t) {
  for (let r = 0; r < t.length; r++)
    bs(e, t[r]);
}
function h1(e, t, r) {
  e.splice(r, 0, t);
}
function NL(e, t, r) {
  eU(e, t), t.slice().reverse().forEach((n) => h1(e, n, r));
}
function kh(e, t) {
  return e.indexOf(t) > -1;
}
function tU(e) {
  return (e == null ? void 0 : e.flatMap((t) => t)) ?? [];
}
function J3(e, t) {
  t == null || e == null || t.forEach((r) => e.push(r));
}
var GL = "__ag_Grid_Stop_Propagation", rU = ["touchstart", "touchend", "touchmove", "touchcancel", "scroll"], mx = {};
function Ev(e) {
  e[GL] = !0;
}
function Qc(e) {
  return e[GL] === !0;
}
var HL = /* @__PURE__ */ (() => {
  const e = {
    select: "input",
    change: "input",
    submit: "form",
    reset: "form",
    error: "img",
    load: "img",
    abort: "img"
  };
  return (r) => {
    if (typeof mx[r] == "boolean")
      return mx[r];
    const n = document.createElement(e[r] || "div");
    return r = "on" + r, mx[r] = r in n;
  };
})();
function uT(e, t, r) {
  let n = t;
  for (; n; ) {
    const a = Bm(e, n, r);
    if (a)
      return a;
    n = n.parentElement;
  }
  return null;
}
function nU(e, t) {
  return !t || !e ? !1 : aU(t).indexOf(e) >= 0;
}
function iU(e) {
  const t = [];
  let r = e.target;
  for (; r; )
    t.push(r), r = r.parentElement;
  return t;
}
function aU(e) {
  const t = e;
  return t.path ? t.path : t.composedPath ? t.composedPath() : iU(t);
}
function oU(e, t, r, n) {
  const u = kh(rU, r) ? { passive: !0 } : void 0;
  e && e.addEventListener && e.addEventListener(t, r, n, u);
}
var mr = class {
  constructor() {
    this.destroyFunctions = [], this.destroyed = !1, this.__v_skip = !0, this.propertyListenerId = 0, this.lastChangeSetIdLookup = {}, this.isAlive = () => !this.destroyed;
  }
  preWireBeans(e) {
    this.frameworkOverrides = e.frameworkOverrides, this.stubContext = e.context, this.eventService = e.eventService, this.gos = e.gos, this.localeService = e.localeService;
  }
  // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are
  // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed
  // points to a bean or component that was not properly disposed of.
  // constructor() {
  //     setTimeout(()=> {
  //         if (this.isAlive()) {
  //             let prototype: any = Object.getPrototypeOf(this);
  //             const constructor: any = prototype.constructor;
  //             const constructorString = constructor.toString();
  //             const beanName = constructorString.substring(9, constructorString.indexOf("("));
  //             console.log('is alive ' + beanName);
  //         }
  //     }, 5000);
  // }
  // CellComp and GridComp and override this because they get the FrameworkOverrides from the Beans bean
  getFrameworkOverrides() {
    return this.frameworkOverrides;
  }
  destroy() {
    for (let e = 0; e < this.destroyFunctions.length; e++)
      this.destroyFunctions[e]();
    this.destroyFunctions.length = 0, this.destroyed = !0, this.dispatchLocalEvent({ type: "destroyed" });
  }
  // The typing of AgEventListener<any, any, any> is not ideal, but it's the best we can do at the moment to enable
  // eventService to have the best typing at the expense of BeanStub local events
  /** Add a local event listener against this BeanStub */
  addEventListener(e, t, r) {
    this.localEventService || (this.localEventService = new Gv()), this.localEventService.addEventListener(e, t, r);
  }
  /** Remove a local event listener from this BeanStub */
  removeEventListener(e, t, r) {
    this.localEventService && this.localEventService.removeEventListener(e, t, r);
  }
  dispatchLocalEvent(e) {
    this.localEventService && this.localEventService.dispatchEvent(e);
  }
  addManagedElementListeners(e, t) {
    return this._setupListeners(e, t);
  }
  addManagedEventListeners(e) {
    return this._setupListeners(this.eventService, e);
  }
  addManagedListeners(e, t) {
    return this._setupListeners(e, t);
  }
  _setupListeners(e, t) {
    const r = [];
    for (const n in t) {
      const a = t[n];
      a && r.push(this._setupListener(e, n, a));
    }
    return r;
  }
  _setupListener(e, t, r) {
    if (this.destroyed)
      return () => null;
    e instanceof HTMLElement ? oU(this.getFrameworkOverrides(), e, t, r) : e.addEventListener(t, r);
    const n = () => (e.removeEventListener(t, r), null);
    return this.destroyFunctions.push(n), () => (n(), this.destroyFunctions = this.destroyFunctions.filter((a) => a !== n), null);
  }
  /**
   * Setup a managed property listener for the given GridOption property.
   * However, stores the destroy function in the beanStub so that if this bean
   * is a component the destroy function will be called when the component is destroyed
   * as opposed to being cleaned up only when the GridOptionsService is destroyed.
   */
  setupGridOptionListener(e, t) {
    this.gos.addPropertyEventListener(e, t);
    const r = () => (this.gos.removePropertyEventListener(e, t), null);
    return this.destroyFunctions.push(r), () => (r(), this.destroyFunctions = this.destroyFunctions.filter((n) => n !== r), null);
  }
  /**
   * Setup a managed property listener for the given GridOption property.
   * @param event GridOption property to listen to changes for.
   * @param listener Listener to run when property value changes
   */
  addManagedPropertyListener(e, t) {
    return this.destroyed ? () => null : this.setupGridOptionListener(e, t);
  }
  /**
   * Setup managed property listeners for the given set of GridOption properties.
   * The listener will be run if any of the property changes but will only run once if
   * multiple of the properties change within the same framework lifecycle event.
   * Works on the basis that GridOptionsService updates all properties *before* any property change events are fired.
   * @param events Array of GridOption properties to listen for changes too.
   * @param listener Shared listener to run if any of the properties change
   */
  addManagedPropertyListeners(e, t) {
    if (this.destroyed)
      return;
    const r = e.join("-") + this.propertyListenerId++, n = (a) => {
      if (a.changeSet) {
        if (a.changeSet && a.changeSet.id === this.lastChangeSetIdLookup[r])
          return;
        this.lastChangeSetIdLookup[r] = a.changeSet.id;
      }
      const u = {
        type: "gridPropertyChanged",
        changeSet: a.changeSet,
        source: a.source
      };
      t(u);
    };
    e.forEach((a) => this.setupGridOptionListener(a, n));
  }
  addDestroyFunc(e) {
    this.isAlive() ? this.destroyFunctions.push(e) : e();
  }
  createManagedBean(e, t) {
    const r = this.createBean(e, t);
    return this.addDestroyFunc(this.destroyBean.bind(this, e, t)), r;
  }
  createBean(e, t, r) {
    return (t || this.stubContext).createBean(e, r);
  }
  /**
   * Destroys a bean and returns undefined to support destruction and clean up in a single line.
   * this.dateComp = this.context.destroyBean(this.dateComp);
   */
  destroyBean(e, t) {
    return (t || this.stubContext).destroyBean(e);
  }
  /**
   * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line.
   * this.dateComps = this.context.destroyBeans(this.dateComps);
   */
  destroyBeans(e, t) {
    return (t || this.stubContext).destroyBeans(e);
  }
};
function ts(e) {
  return e instanceof IC;
}
var IC = class extends mr {
  constructor(e, t, r, n) {
    super(), this.isColumn = !1, this.expandable = !1, this.instanceId = zL(), this.expandableListenerRemoveCallback = null, this.colGroupDef = e, this.groupId = t, this.expanded = !!e && !!e.openByDefault, this.padding = r, this.level = n;
  }
  destroy() {
    this.expandableListenerRemoveCallback && this.reset(null, void 0), super.destroy();
  }
  reset(e, t) {
    this.colGroupDef = e, this.level = t, this.originalParent = null, this.expandableListenerRemoveCallback && this.expandableListenerRemoveCallback(), this.children = void 0, this.expandable = void 0;
  }
  getInstanceId() {
    return this.instanceId;
  }
  setOriginalParent(e) {
    this.originalParent = e;
  }
  getOriginalParent() {
    return this.originalParent;
  }
  getLevel() {
    return this.level;
  }
  isVisible() {
    return this.children ? this.children.some((e) => e.isVisible()) : !1;
  }
  isPadding() {
    return this.padding;
  }
  setExpanded(e) {
    this.expanded = e === void 0 ? !1 : e, this.dispatchLocalEvent({ type: "expandedChanged" });
  }
  isExpandable() {
    return this.expandable;
  }
  isExpanded() {
    return this.expanded;
  }
  getGroupId() {
    return this.groupId;
  }
  getId() {
    return this.getGroupId();
  }
  setChildren(e) {
    this.children = e;
  }
  getChildren() {
    return this.children;
  }
  getColGroupDef() {
    return this.colGroupDef;
  }
  getLeafColumns() {
    const e = [];
    return this.addLeafColumns(e), e;
  }
  addLeafColumns(e) {
    this.children && this.children.forEach((t) => {
      of(t) ? e.push(t) : ts(t) && t.addLeafColumns(e);
    });
  }
  getColumnGroupShow() {
    const e = this.colGroupDef;
    if (e)
      return e.columnGroupShow;
  }
  // need to check that this group has at least one col showing when both expanded and contracted.
  // if not, then we don't allow expanding and contracting on this group
  setupExpandable() {
    this.setExpandable(), this.expandableListenerRemoveCallback && this.expandableListenerRemoveCallback();
    const e = this.onColumnVisibilityChanged.bind(this);
    this.getLeafColumns().forEach((t) => t.addEventListener("visibleChanged", e)), this.expandableListenerRemoveCallback = () => {
      this.getLeafColumns().forEach((t) => t.removeEventListener("visibleChanged", e)), this.expandableListenerRemoveCallback = null;
    };
  }
  setExpandable() {
    if (this.isPadding())
      return;
    let e = !1, t = !1, r = !1;
    const n = this.findChildrenRemovingPadding();
    for (let u = 0, s = n.length; u < s; u++) {
      const c = n[u];
      if (!c.isVisible())
        continue;
      const i = c.getColumnGroupShow();
      i === "open" ? (e = !0, r = !0) : i === "closed" ? (t = !0, r = !0) : (e = !0, t = !0);
    }
    const a = e && t && r;
    this.expandable !== a && (this.expandable = a, this.dispatchLocalEvent({ type: "expandableChanged" }));
  }
  findChildrenRemovingPadding() {
    const e = [], t = (r) => {
      r.forEach((n) => {
        ts(n) && n.isPadding() ? t(n.children) : e.push(n);
      });
    };
    return t(this.children), e;
  }
  onColumnVisibilityChanged() {
    this.setExpandable();
  }
}, BL = "ag-Grid-ControlsColumn", sU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "controlsColService";
  }
  createControlsCols() {
    const e = this.gos.get("rowSelection");
    if (!e || typeof e == "string")
      return [];
    const t = Av(e), r = d1(e);
    if (t || r) {
      const n = this.gos.get("selectionColumnDef"), u = {
        // overridable properties
        maxWidth: 50,
        resizable: !1,
        suppressHeaderMenuButton: !0,
        sortable: !1,
        suppressMovable: !0,
        lockPosition: this.gos.get("enableRtl") ? "right" : "left",
        comparator(c, i, l, v) {
          const f = l.isSelected(), p = v.isSelected();
          return f && p ? 0 : f ? 1 : -1;
        },
        editable: !1,
        suppressFillHandle: !0,
        // overrides
        ...n,
        // non-overridable properties
        colId: `${BL}`
      }, s = new B2(u, null, u.colId, !1);
      return this.createBean(s), [s];
    }
    return [];
  }
}, Y1 = "ag-Grid-AutoColumn";
function N2(e) {
  const t = [], r = (n) => {
    for (let a = 0; a < n.length; a++) {
      const u = n[a];
      of(u) ? t.push(u) : ts(u) && r(u.getChildren());
    }
  };
  return r(e), t;
}
function jc(e) {
  return e.reduce((t, r) => t + r.getActualWidth(), 0);
}
function Qd(e, t, r) {
  const n = {};
  if (!t)
    return;
  id(null, t, (u) => {
    n[u.getInstanceId()] = u;
  }), r && id(null, r, (u) => {
    n[u.getInstanceId()] = null;
  });
  const a = Object.values(n).filter((u) => u != null);
  e.destroyBeans(a);
}
function cT(e) {
  return e.getId().startsWith(Y1);
}
function Mv(e) {
  return e.getColId().startsWith(BL);
}
function LC(e) {
  let t = [];
  return e instanceof Array ? e.some((n) => typeof n != "string") ? Fr("if colDef.type is supplied an array it should be of type 'string[]'") : t = e : typeof e == "string" ? t = e.split(",") : Fr("colDef.type should be of type 'string' | 'string[]'"), t;
}
var G2 = class {
  constructor(e) {
    this.frameworkOverrides = e, this.wrappedListeners = /* @__PURE__ */ new Map(), this.wrappedGlobalListeners = /* @__PURE__ */ new Map();
  }
  wrap(e) {
    let t = e;
    return this.frameworkOverrides.shouldWrapOutgoing && (t = (r) => {
      this.frameworkOverrides.wrapOutgoing(() => e(r));
    }, this.wrappedListeners.set(e, t)), t;
  }
  wrapGlobal(e) {
    let t = e;
    return this.frameworkOverrides.shouldWrapOutgoing && (t = (r, n) => {
      this.frameworkOverrides.wrapOutgoing(() => e(r, n));
    }, this.wrappedGlobalListeners.set(e, t)), t;
  }
  unwrap(e) {
    return this.wrappedListeners.get(e) ?? e;
  }
  unwrapGlobal(e) {
    return this.wrappedGlobalListeners.get(e) ?? e;
  }
}, H2 = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
function fu(e, t) {
  if (e != null) {
    if (Array.isArray(e)) {
      for (let r = 0; r < e.length; r++)
        t(r.toString(), e[r]);
      return;
    }
    for (const [r, n] of Object.entries(e))
      t(r, n);
  }
}
function VL(e) {
  const t = {}, r = Object.keys(e);
  for (let n = 0; n < r.length; n++) {
    if (H2.has(r[n]))
      continue;
    const a = r[n], u = e[a];
    t[a] = u;
  }
  return t;
}
function dT(e, t) {
  if (!e)
    return;
  const r = e, n = {};
  return Object.keys(r).forEach((a) => {
    if (t && t.indexOf(a) >= 0 || H2.has(a))
      return;
    const u = r[a];
    fT(u) && u.constructor === Object ? n[a] = dT(u) : n[a] = u;
  }), n;
}
function Q3(e) {
  if (!e)
    return [];
  const t = Object;
  if (typeof t.values == "function")
    return t.values(e);
  const r = [];
  for (const n in e)
    e.hasOwnProperty(n) && e.propertyIsEnumerable(n) && r.push(e[n]);
  return r;
}
function rs(e, t, r = !0, n = !1) {
  $r(t) && fu(t, (a, u) => {
    if (H2.has(a))
      return;
    let s = e[a];
    s !== u && (n && s == null && u != null && typeof u == "object" && u.constructor === Object && (s = {}, e[a] = s), fT(u) && fT(s) && !Array.isArray(s) ? rs(s, u, r, n) : (r || u !== void 0) && (e[a] = u));
  });
}
function Rm(e, t, r) {
  if (!t || !e)
    return;
  if (!r)
    return e[t];
  const n = t.split(".");
  let a = e;
  for (let u = 0; u < n.length; u++) {
    if (a == null)
      return;
    a = a[n[u]];
  }
  return a;
}
function fT(e) {
  return typeof e == "object" && e !== null;
}
var lU = {
  resizable: !0,
  sortable: !0
}, uU = 0;
function zL() {
  return uU++;
}
function of(e) {
  return e instanceof B2;
}
var B2 = class extends mr {
  constructor(e, t, r, n) {
    super(), this.isColumn = !0, this.instanceId = zL(), this.autoHeaderHeight = null, this.moving = !1, this.menuVisible = !1, this.lastLeftPinned = !1, this.firstRightPinned = !1, this.filterActive = !1, this.columnEventService = new Gv(), this.tooltipEnabled = !1, this.rowGroupActive = !1, this.pivotActive = !1, this.aggregationActive = !1, this.colDef = e, this.userProvidedColDef = t, this.colId = r, this.primary = n, this.setState(e);
  }
  wireBeans(e) {
    this.columnHoverService = e.columnHoverService;
  }
  getInstanceId() {
    return this.instanceId;
  }
  setState(e) {
    e.sort !== void 0 ? (e.sort === "asc" || e.sort === "desc") && (this.sort = e.sort) : (e.initialSort === "asc" || e.initialSort === "desc") && (this.sort = e.initialSort);
    const t = e.sortIndex, r = e.initialSortIndex;
    t !== void 0 ? t !== null && (this.sortIndex = t) : r !== null && (this.sortIndex = r);
    const n = e.hide, a = e.initialHide;
    n !== void 0 ? this.visible = !n : this.visible = !a, e.pinned !== void 0 ? this.setPinned(e.pinned) : this.setPinned(e.initialPinned);
    const u = e.flex, s = e.initialFlex;
    u !== void 0 ? this.flex = u : s !== void 0 && (this.flex = s);
  }
  // gets called when user provides an alternative colDef, eg
  setColDef(e, t, r) {
    this.colDef = e, this.userProvidedColDef = t, this.initMinAndMaxWidths(), this.initDotNotation(), this.initTooltip(), this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged", r));
  }
  getUserProvidedColDef() {
    return this.userProvidedColDef;
  }
  setParent(e) {
    this.parent = e;
  }
  getParent() {
    return this.parent;
  }
  setOriginalParent(e) {
    this.originalParent = e;
  }
  getOriginalParent() {
    return this.originalParent;
  }
  // this is done after constructor as it uses gridOptionsService
  postConstruct() {
    this.initMinAndMaxWidths(), this.resetActualWidth("gridInitializing"), this.initDotNotation(), this.initTooltip();
  }
  initDotNotation() {
    const e = this.gos.get("suppressFieldDotNotation");
    this.fieldContainsDots = $r(this.colDef.field) && this.colDef.field.indexOf(".") >= 0 && !e, this.tooltipFieldContainsDots = $r(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf(".") >= 0 && !e;
  }
  initMinAndMaxWidths() {
    const e = this.colDef;
    this.minWidth = e.minWidth ?? this.gos.environment.getDefaultColumnMinWidth(), this.maxWidth = e.maxWidth ?? Number.MAX_SAFE_INTEGER;
  }
  initTooltip() {
    this.tooltipEnabled = $r(this.colDef.tooltipField) || $r(this.colDef.tooltipValueGetter) || $r(this.colDef.tooltipComponent);
  }
  resetActualWidth(e) {
    const t = this.calculateColInitialWidth(this.colDef);
    this.setActualWidth(t, e, !0);
  }
  calculateColInitialWidth(e) {
    let t;
    const r = Lh(e.width), n = Lh(e.initialWidth);
    return r != null ? t = r : n != null ? t = n : t = 200, Math.max(Math.min(t, this.maxWidth), this.minWidth);
  }
  isEmptyGroup() {
    return !1;
  }
  isRowGroupDisplayed(e) {
    if (mi(this.colDef) || mi(this.colDef.showRowGroup))
      return !1;
    const t = this.colDef.showRowGroup === !0, r = this.colDef.showRowGroup === e;
    return t || r;
  }
  isPrimary() {
    return this.primary;
  }
  isFilterAllowed() {
    return !!this.colDef.filter;
  }
  isFieldContainsDots() {
    return this.fieldContainsDots;
  }
  isTooltipEnabled() {
    return this.tooltipEnabled;
  }
  isTooltipFieldContainsDots() {
    return this.tooltipFieldContainsDots;
  }
  getHighlighted() {
    return this.highlighted;
  }
  addEventListener(e, t) {
    var n;
    this.frameworkOverrides.shouldWrapOutgoing && !this.frameworkEventListenerService && (this.columnEventService.setFrameworkOverrides(this.frameworkOverrides), this.frameworkEventListenerService = new G2(this.frameworkOverrides));
    const r = ((n = this.frameworkEventListenerService) == null ? void 0 : n.wrap(t)) ?? t;
    this.columnEventService.addEventListener(e, r);
  }
  removeEventListener(e, t) {
    var n;
    const r = ((n = this.frameworkEventListenerService) == null ? void 0 : n.unwrap(t)) ?? t;
    this.columnEventService.removeEventListener(e, r);
  }
  createColumnFunctionCallbackParams(e) {
    return this.gos.addGridCommonParams({
      node: e,
      data: e.data,
      column: this,
      colDef: this.colDef
    });
  }
  isSuppressNavigable(e) {
    if (typeof this.colDef.suppressNavigable == "boolean")
      return this.colDef.suppressNavigable;
    if (typeof this.colDef.suppressNavigable == "function") {
      const t = this.createColumnFunctionCallbackParams(e), r = this.colDef.suppressNavigable;
      return r(t);
    }
    return !1;
  }
  isCellEditable(e) {
    if (e.group) {
      if (this.gos.get("treeData")) {
        if (!e.data && !this.gos.get("enableGroupEdit"))
          return !1;
      } else if (!this.gos.get("enableGroupEdit"))
        return !1;
    }
    return this.isColumnFunc(e, this.colDef.editable);
  }
  isSuppressFillHandle() {
    return !!this.colDef.suppressFillHandle;
  }
  isAutoHeight() {
    return !!this.colDef.autoHeight;
  }
  isAutoHeaderHeight() {
    return !!this.colDef.autoHeaderHeight;
  }
  isRowDrag(e) {
    return this.isColumnFunc(e, this.colDef.rowDrag);
  }
  isDndSource(e) {
    return this.isColumnFunc(e, this.colDef.dndSource);
  }
  isCellCheckboxSelection(e) {
    const t = this.gos.get("rowSelection");
    if (t && typeof t != "string") {
      const r = Mv(this) && Av(t);
      return this.isColumnFunc(e, r);
    } else
      return this.isColumnFunc(e, this.colDef.checkboxSelection);
  }
  isSuppressPaste(e) {
    return this.isColumnFunc(e, this.colDef ? this.colDef.suppressPaste : null);
  }
  isResizable() {
    return !!this.getColDefValue("resizable");
  }
  /** Get value from ColDef or default if it exists. */
  getColDefValue(e) {
    return this.colDef[e] ?? lU[e];
  }
  isColumnFunc(e, t) {
    if (typeof t == "boolean")
      return t;
    if (typeof t == "function") {
      const r = this.createColumnFunctionCallbackParams(e);
      return t(r);
    }
    return !1;
  }
  setHighlighted(e) {
    this.highlighted !== e && (this.highlighted = e, this.columnEventService.dispatchEvent(this.createColumnEvent("headerHighlightChanged", "uiColumnMoved")));
  }
  setMoving(e, t) {
    this.moving = e, this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged", t));
  }
  createColumnEvent(e, t) {
    return this.gos.addGridCommonParams({
      type: e,
      column: this,
      columns: [this],
      source: t
    });
  }
  isMoving() {
    return this.moving;
  }
  getSort() {
    return this.sort;
  }
  setSort(e, t) {
    this.sort !== e && (this.sort = e, this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged", t))), this.dispatchStateUpdatedEvent("sort");
  }
  isSortable() {
    return !!this.getColDefValue("sortable");
  }
  /** @deprecated v32 use col.getSort() === 'asc */
  isSortAscending() {
    return this.sort === "asc";
  }
  /** @deprecated v32 use col.getSort() === 'desc */
  isSortDescending() {
    return this.sort === "desc";
  }
  /** @deprecated v32 use col.getSort() === undefined */
  isSortNone() {
    return mi(this.sort);
  }
  /** @deprecated v32 use col.getSort() !== undefined */
  isSorting() {
    return $r(this.sort);
  }
  getSortIndex() {
    return this.sortIndex;
  }
  setSortIndex(e) {
    this.sortIndex = e, this.dispatchStateUpdatedEvent("sortIndex");
  }
  setMenuVisible(e, t) {
    this.menuVisible !== e && (this.menuVisible = e, this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged", t)));
  }
  isMenuVisible() {
    return this.menuVisible;
  }
  setAggFunc(e) {
    this.aggFunc = e, this.dispatchStateUpdatedEvent("aggFunc");
  }
  getAggFunc() {
    return this.aggFunc;
  }
  getLeft() {
    return this.left;
  }
  getOldLeft() {
    return this.oldLeft;
  }
  getRight() {
    return this.left + this.actualWidth;
  }
  setLeft(e, t) {
    this.oldLeft = this.left, this.left !== e && (this.left = e, this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged", t)));
  }
  isFilterActive() {
    return this.filterActive;
  }
  // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event
  setFilterActive(e, t, r) {
    this.filterActive !== e && (this.filterActive = e, this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged", t)));
    const n = this.createColumnEvent("filterChanged", t);
    r && rs(n, r), this.columnEventService.dispatchEvent(n);
  }
  isHovered() {
    return this.columnHoverService.isHovered(this);
  }
  setPinned(e) {
    e === !0 || e === "left" ? this.pinned = "left" : e === "right" ? this.pinned = "right" : this.pinned = null, this.dispatchStateUpdatedEvent("pinned");
  }
  setFirstRightPinned(e, t) {
    this.firstRightPinned !== e && (this.firstRightPinned = e, this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged", t)));
  }
  setLastLeftPinned(e, t) {
    this.lastLeftPinned !== e && (this.lastLeftPinned = e, this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged", t)));
  }
  isFirstRightPinned() {
    return this.firstRightPinned;
  }
  isLastLeftPinned() {
    return this.lastLeftPinned;
  }
  isPinned() {
    return this.pinned === "left" || this.pinned === "right";
  }
  isPinnedLeft() {
    return this.pinned === "left";
  }
  isPinnedRight() {
    return this.pinned === "right";
  }
  getPinned() {
    return this.pinned;
  }
  setVisible(e, t) {
    const r = e === !0;
    this.visible !== r && (this.visible = r, this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged", t))), this.dispatchStateUpdatedEvent("hide");
  }
  isVisible() {
    return this.visible;
  }
  isSpanHeaderHeight() {
    const e = this.getColDef();
    return !e.suppressSpanHeaderHeight && !e.autoHeaderHeight;
  }
  getColumnGroupPaddingInfo() {
    let e = this.getParent();
    if (!e || !e.isPadding())
      return { numberOfParents: 0, isSpanningTotal: !1 };
    const t = e.getPaddingLevel() + 1;
    let r = !0;
    for (; e; ) {
      if (!e.isPadding()) {
        r = !1;
        break;
      }
      e = e.getParent();
    }
    return { numberOfParents: t, isSpanningTotal: r };
  }
  getColDef() {
    return this.colDef;
  }
  getDefinition() {
    return this.colDef;
  }
  getColumnGroupShow() {
    return this.colDef.columnGroupShow;
  }
  getColId() {
    return this.colId;
  }
  getId() {
    return this.colId;
  }
  getUniqueId() {
    return this.colId;
  }
  getActualWidth() {
    return this.actualWidth;
  }
  getAutoHeaderHeight() {
    return this.autoHeaderHeight;
  }
  /** Returns true if the header height has changed */
  setAutoHeaderHeight(e) {
    const t = e !== this.autoHeaderHeight;
    return this.autoHeaderHeight = e, t;
  }
  createBaseColDefParams(e) {
    return this.gos.addGridCommonParams({
      node: e,
      data: e.data,
      colDef: this.colDef,
      column: this
    });
  }
  getColSpan(e) {
    if (mi(this.colDef.colSpan))
      return 1;
    const t = this.createBaseColDefParams(e), r = this.colDef.colSpan(t);
    return Math.max(r, 1);
  }
  getRowSpan(e) {
    if (mi(this.colDef.rowSpan))
      return 1;
    const t = this.createBaseColDefParams(e), r = this.colDef.rowSpan(t);
    return Math.max(r, 1);
  }
  setActualWidth(e, t, r = !1) {
    e = Math.max(e, this.minWidth), e = Math.min(e, this.maxWidth), this.actualWidth !== e && (this.actualWidth = e, this.flex && t !== "flex" && t !== "gridInitializing" && (this.flex = null), r || this.fireColumnWidthChangedEvent(t)), this.dispatchStateUpdatedEvent("width");
  }
  fireColumnWidthChangedEvent(e) {
    this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged", e));
  }
  isGreaterThanMax(e) {
    return e > this.maxWidth;
  }
  getMinWidth() {
    return this.minWidth;
  }
  getMaxWidth() {
    return this.maxWidth;
  }
  getFlex() {
    return this.flex || 0;
  }
  // this method should only be used by the columnModel to
  // change flex when required by the applyColumnState method.
  setFlex(e) {
    this.flex !== e && (this.flex = e), this.dispatchStateUpdatedEvent("flex");
  }
  setMinimum(e) {
    this.setActualWidth(this.minWidth, e);
  }
  setRowGroupActive(e, t) {
    this.rowGroupActive !== e && (this.rowGroupActive = e, this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged", t))), this.dispatchStateUpdatedEvent("rowGroup");
  }
  isRowGroupActive() {
    return this.rowGroupActive;
  }
  setPivotActive(e, t) {
    this.pivotActive !== e && (this.pivotActive = e, this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged", t))), this.dispatchStateUpdatedEvent("pivot");
  }
  isPivotActive() {
    return this.pivotActive;
  }
  isAnyFunctionActive() {
    return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();
  }
  isAnyFunctionAllowed() {
    return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();
  }
  setValueActive(e, t) {
    this.aggregationActive !== e && (this.aggregationActive = e, this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged", t)));
  }
  isValueActive() {
    return this.aggregationActive;
  }
  isAllowPivot() {
    return this.colDef.enablePivot === !0;
  }
  isAllowValue() {
    return this.colDef.enableValue === !0;
  }
  isAllowRowGroup() {
    return this.colDef.enableRowGroup === !0;
  }
  dispatchStateUpdatedEvent(e) {
    this.columnEventService.dispatchEvent({
      type: "columnStateUpdated",
      key: e
    });
  }
}, cU = {
  numericColumn: {
    headerClass: "ag-right-aligned-header",
    cellClass: "ag-right-aligned-cell"
  },
  rightAligned: {
    headerClass: "ag-right-aligned-header",
    cellClass: "ag-right-aligned-cell"
  }
}, dU = class {
  constructor() {
    this.existingKeys = {};
  }
  addExistingKeys(e) {
    for (let t = 0; t < e.length; t++)
      this.existingKeys[e[t]] = !0;
  }
  getUniqueKey(e, t) {
    e = iT(e);
    let r = 0;
    for (; ; ) {
      let n;
      if (e ? (n = e, r !== 0 && (n += "_" + r)) : t ? (n = t, r !== 0 && (n += "_" + r)) : n = r, !this.existingKeys[n])
        return this.existingKeys[n] = !0, String(n);
      r++;
    }
  }
}, fU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnFactory";
  }
  wireBeans(e) {
    this.dataTypeService = e.dataTypeService;
  }
  createColumnTree(e, t, r, n) {
    const a = new dU(), { existingCols: u, existingGroups: s, existingColKeys: c } = this.extractExistingTreeData(r);
    a.addExistingKeys(c);
    const i = this.recursivelyCreateColumns(
      e,
      0,
      t,
      u,
      a,
      s,
      n
    ), l = this.findMaxDept(i, 0), v = this.balanceColumnTree(i, 0, l, a);
    return id(null, v, (p, g) => {
      ts(p) && p.setupExpandable(), p.setOriginalParent(g);
    }), {
      columnTree: v,
      treeDept: l
    };
  }
  extractExistingTreeData(e) {
    const t = [], r = [], n = [];
    return e && id(null, e, (a) => {
      if (ts(a)) {
        const u = a;
        r.push(u);
      } else {
        const u = a;
        n.push(u.getId()), t.push(u);
      }
    }), { existingCols: t, existingGroups: r, existingColKeys: n };
  }
  /**
   * Inserts dummy group columns in the hierarchy above auto-generated columns
   * in order to ensure auto-generated columns are leaf nodes (and therefore are
   * displayed correctly)
   */
  balanceTreeForAutoCols(e, t) {
    const r = [], n = this.findDepth(t);
    return e.forEach((a) => {
      let u = a;
      for (let s = n - 1; s >= 0; s--) {
        const c = new IC(null, `FAKE_PATH_${a.getId()}}_${s}`, !0, s);
        this.createBean(c), c.setChildren([u]), u.setOriginalParent(c), u = c;
      }
      n === 0 && a.setOriginalParent(null), r.push(u);
    }), [r, n];
  }
  findDepth(e) {
    let t = 0, r = e;
    for (; r && r[0] && ts(r[0]); )
      t++, r = r[0].getChildren();
    return t;
  }
  balanceColumnTree(e, t, r, n) {
    const a = [];
    for (let u = 0; u < e.length; u++) {
      const s = e[u];
      if (ts(s)) {
        const c = s, i = this.balanceColumnTree(
          c.getChildren(),
          t + 1,
          r,
          n
        );
        c.setChildren(i), a.push(c);
      } else {
        let c, i;
        for (let l = r - 1; l >= t; l--) {
          const v = n.getUniqueKey(null, null), f = this.createMergedColGroupDef(null), p = new IC(f, v, !0, t);
          this.createBean(p), i && i.setChildren([p]), i = p, c || (c = i);
        }
        if (c && i)
          if (a.push(c), e.some((v) => ts(v))) {
            i.setChildren([s]);
            continue;
          } else {
            i.setChildren(e);
            break;
          }
        a.push(s);
      }
    }
    return a;
  }
  findMaxDept(e, t) {
    let r = t;
    for (let n = 0; n < e.length; n++) {
      const a = e[n];
      if (ts(a)) {
        const u = a, s = this.findMaxDept(u.getChildren(), t + 1);
        r < s && (r = s);
      }
    }
    return r;
  }
  recursivelyCreateColumns(e, t, r, n, a, u, s) {
    if (!e)
      return [];
    const c = new Array(e.length);
    for (let i = 0; i < c.length; i++) {
      const l = e[i];
      this.isColumnGroup(l) ? c[i] = this.createColumnGroup(
        r,
        l,
        t,
        n,
        a,
        u,
        s
      ) : c[i] = this.createColumn(
        r,
        l,
        n,
        a,
        s
      );
    }
    return c;
  }
  createColumnGroup(e, t, r, n, a, u, s) {
    const c = this.createMergedColGroupDef(t), i = a.getUniqueKey(c.groupId || null, null), l = new IC(c, i, !1, r);
    this.createBean(l);
    const v = this.findExistingGroup(t, u);
    v && u.splice(v.idx, 1);
    const f = v == null ? void 0 : v.group;
    f && l.setExpanded(f.isExpanded());
    const p = this.recursivelyCreateColumns(
      c.children,
      r + 1,
      e,
      n,
      a,
      u,
      s
    );
    return l.setChildren(p), l;
  }
  createMergedColGroupDef(e) {
    const t = {};
    return Object.assign(t, this.gos.get("defaultColGroupDef")), Object.assign(t, e), t;
  }
  createColumn(e, t, r, n, a) {
    var c;
    const u = this.findExistingColumn(t, r);
    u && (r == null || r.splice(u.idx, 1));
    let s = u == null ? void 0 : u.column;
    if (s) {
      const i = this.addColumnDefaultAndTypes(t, s.getColId());
      s.setColDef(i, t, a), this.applyColumnState(s, i, a);
    } else {
      const i = n.getUniqueKey(t.colId, t.field), l = this.addColumnDefaultAndTypes(t, i);
      s = new B2(l, t, i, e), this.createBean(s);
    }
    return (c = this.dataTypeService) == null || c.addColumnListeners(s), s;
  }
  applyColumnState(e, t, r) {
    const n = Lh(t.flex);
    if (n !== void 0 && e.setFlex(n), e.getFlex() <= 0) {
      const c = Lh(t.width);
      if (c != null)
        e.setActualWidth(c, r);
      else {
        const i = e.getActualWidth();
        e.setActualWidth(i, r);
      }
    }
    t.sort !== void 0 && (t.sort == "asc" || t.sort == "desc" ? e.setSort(t.sort, r) : e.setSort(void 0, r));
    const u = Lh(t.sortIndex);
    u !== void 0 && e.setSortIndex(u);
    const s = aT(t.hide);
    s !== void 0 && e.setVisible(!s, r), t.pinned !== void 0 && e.setPinned(t.pinned);
  }
  findExistingColumn(e, t) {
    if (t)
      for (let r = 0; r < t.length; r++) {
        const n = t[r].getUserProvidedColDef();
        if (!n)
          continue;
        if (e.colId != null) {
          if (t[r].getId() === e.colId)
            return { idx: r, column: t[r] };
          continue;
        }
        if (e.field != null) {
          if (n.field === e.field)
            return { idx: r, column: t[r] };
          continue;
        }
        if (n === e)
          return { idx: r, column: t[r] };
      }
  }
  findExistingGroup(e, t) {
    if (e.groupId != null)
      for (let n = 0; n < t.length; n++) {
        const a = t[n];
        if (a.getColGroupDef() && a.getId() === e.groupId)
          return { idx: n, group: a };
      }
  }
  addColumnDefaultAndTypes(e, t) {
    var c;
    const r = {}, n = this.gos.get("defaultColDef");
    rs(r, n, !1, !0);
    const a = this.updateColDefAndGetColumnType(r, e, t);
    a && this.assignColumnTypes(a, r), rs(r, e, !1, !0);
    const u = this.gos.get("autoGroupColumnDef"), s = ec(this.gos);
    return e.rowGroup && u && s && rs(
      r,
      { sort: u.sort, initialSort: u.initialSort },
      !1,
      !0
    ), (c = this.dataTypeService) == null || c.validateColDef(r), r;
  }
  updateColDefAndGetColumnType(e, t, r) {
    var u;
    const n = (u = this.dataTypeService) == null ? void 0 : u.updateColDefAndGetColumnType(
      e,
      t,
      r
    ), a = t.type ?? n ?? e.type;
    return e.type = a, a ? LC(a) : void 0;
  }
  assignColumnTypes(e, t) {
    if (!e.length)
      return;
    const r = Object.assign({}, cU), n = this.gos.get("columnTypes") || {};
    fu(n, (a, u) => {
      a in r ? Fr(`the column type '${a}' is a default column type and cannot be overridden.`) : (u.type && Fr(
        "Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."
      ), r[a] = u);
    }), e.forEach((a) => {
      const u = r[a.trim()];
      u ? rs(t, u, !1, !0) : Fr("colDef.type '" + a + "' does not correspond to defined gridOptions.columnTypes");
    });
  }
  // if object has children, we assume it's a group
  isColumnGroup(e) {
    return e.children !== void 0;
  }
};
function id(e, t, r) {
  if (t)
    for (let n = 0; n < t.length; n++) {
      const a = t[n];
      ts(a) && id(a, a.getChildren(), r), r(a, e);
    }
}
var hU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnModel", this.pivotMode = !1, this.autoHeightActiveAtLeastOnce = !1, this.ready = !1, this.changeEventsDispatching = !1, this.shouldQueueResizeOperations = !1, this.resizeOperationQueue = [];
  }
  wireBeans(e) {
    this.context = e.context, this.ctrlsService = e.ctrlsService, this.columnFactory = e.columnFactory, this.columnSizeService = e.columnSizeService, this.visibleColsService = e.visibleColsService, this.columnViewportService = e.columnViewportService, this.pivotResultColsService = e.pivotResultColsService, this.columnAnimationService = e.columnAnimationService, this.autoColService = e.autoColService, this.controlsColService = e.controlsColService, this.valueCache = e.valueCache, this.columnDefFactory = e.columnDefFactory, this.columnApplyStateService = e.columnApplyStateService, this.columnGroupStateService = e.columnGroupStateService, this.eventDispatcher = e.columnEventDispatcher, this.columnMoveService = e.columnMoveService, this.columnAutosizeService = e.columnAutosizeService, this.funcColsService = e.funcColsService, this.quickFilterService = e.quickFilterService, this.showRowGroupColsService = e.showRowGroupColsService, this.environment = e.environment;
  }
  postConstruct() {
    const e = this.gos.get("pivotMode");
    this.isPivotSettingAllowed(e) && (this.pivotMode = e), this.addManagedPropertyListeners(
      ["groupDisplayType", "treeData", "treeDataDisplayType", "groupHideOpenParents"],
      (t) => this.refreshAll(Ah(t.source))
    ), this.addManagedPropertyListener("rowSelection", (t) => {
      this.onSelectionOptionsChanged(t.currentValue, t.previousValue, Ah(t.source));
    }), this.addManagedPropertyListener(
      "autoGroupColumnDef",
      (t) => this.onAutoGroupColumnDefChanged(Ah(t.source))
    ), this.addManagedPropertyListeners(
      ["defaultColDef", "defaultColGroupDef", "columnTypes", "suppressFieldDotNotation"],
      (t) => this.recreateColumnDefs(Ah(t.source))
    ), this.addManagedPropertyListener(
      "pivotMode",
      (t) => this.setPivotMode(this.gos.get("pivotMode"), Ah(t.source))
    ), this.addManagedEventListeners({ firstDataRendered: () => this.onFirstDataRendered() });
  }
  // called from SyncService, when grid has finished initialising
  createColsFromColDefs(e) {
    var l, v, f;
    const t = this.colDefs ? this.columnApplyStateService.compareColumnStatesAndDispatchEvents(e) : void 0;
    this.valueCache.expire();
    const r = (l = this.colDefCols) == null ? void 0 : l.list, n = (v = this.colDefCols) == null ? void 0 : v.tree, a = this.columnFactory.createColumnTree(this.colDefs, !0, n, e);
    Qd(this.context, (f = this.colDefCols) == null ? void 0 : f.tree, a.columnTree);
    const u = a.columnTree, s = a.treeDept, c = N2(u), i = {};
    c.forEach((p) => i[p.getId()] = p), this.colDefCols = { tree: u, treeDepth: s, list: c, map: i }, this.funcColsService.extractCols(e, r), this.ready = !0, this.refreshCols(!0), this.visibleColsService.refresh(e), this.columnViewportService.checkViewportColumns(), this.eventDispatcher.everythingChanged(e), t && (this.changeEventsDispatching = !0, t(), this.changeEventsDispatching = !1), this.eventDispatcher.newColumnsLoaded(e), e === "gridInitializing" && this.columnSizeService.applyAutosizeStrategy();
  }
  // called from: buildAutoGroupColumns (events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents')
  // createColsFromColDefs (recreateColumnDefs, setColumnsDefs),
  // setPivotMode, applyColumnState,
  // functionColsService.setPrimaryColList, functionColsService.updatePrimaryColList,
  // pivotResultColsService.setPivotResultCols
  refreshCols(e) {
    var a, u, s;
    if (!this.colDefCols)
      return;
    const t = (a = this.cols) == null ? void 0 : a.tree;
    this.saveColOrder(), this.selectCols(), this.createAutoCols(), this.addAutoCols(), this.createControlsCols(), this.addControlsCols();
    const r = __(this.gos, this.showingPivotResult);
    (!e || r) && this.restoreColOrder(), this.positionLockedCols(), (u = this.showRowGroupColsService) == null || u.refresh(), (s = this.quickFilterService) == null || s.refreshQuickFilterCols(), this.setColSpanActive(), this.setAutoHeightActive(), this.visibleColsService.clear(), this.columnViewportService.clear(), !cf(t, this.cols.tree) && this.eventDispatcher.gridColumns();
  }
  selectCols() {
    const e = this.pivotResultColsService.getPivotResultCols();
    if (this.showingPivotResult = e != null, e) {
      const { map: t, list: r, tree: n, treeDepth: a } = e;
      this.cols = {
        list: r.slice(),
        map: { ...t },
        tree: n.slice(),
        treeDepth: a
      }, e.list.some((s) => {
        var c;
        return ((c = this.cols) == null ? void 0 : c.map[s.getColId()]) !== void 0;
      }) || (this.lastPivotOrder = null);
    } else {
      const { map: t, list: r, tree: n, treeDepth: a } = this.colDefCols;
      this.cols = {
        list: r.slice(),
        map: { ...t },
        tree: n.slice(),
        treeDepth: a
      };
    }
  }
  getColsToShow() {
    const e = this.isPivotMode() && !this.isShowingPivotResult(), t = this.funcColsService.getValueColumns();
    return this.cols.list.filter((n) => {
      const a = cT(n);
      if (e) {
        const u = t && kh(t, n);
        return a || u;
      } else
        return a || n.isVisible();
    });
  }
  addAutoCols() {
    this.autoCols != null && (this.cols.list = this.autoCols.list.concat(this.cols.list), this.cols.tree = this.autoCols.tree.concat(this.cols.tree), q3(this.cols));
  }
  createAutoCols() {
    var y, C;
    const e = j1(this.gos, this.pivotMode), t = this.pivotMode ? this.gos.get("pivotSuppressAutoColumn") : this.isSuppressAutoCol(), r = this.funcColsService.getRowGroupColumns(), a = !(r.length > 0 || this.gos.get("treeData")) || t || e, u = () => {
      this.autoCols && (Qd(this.context, this.autoCols.tree), this.autoCols = null);
    };
    if (a || !this.autoColService) {
      u();
      return;
    }
    const s = this.autoColService.createAutoCols(r) ?? [], c = pU(s, ((y = this.autoCols) == null ? void 0 : y.list) || null), i = this.cols.treeDepth, v = (this.autoCols ? this.autoCols.treeDepth : -1) == i;
    if (c && v)
      return;
    u();
    const [f, p] = this.columnFactory.balanceTreeForAutoCols(s, (C = this.cols) == null ? void 0 : C.tree);
    this.autoCols = {
      list: s,
      tree: f,
      treeDepth: p,
      map: {}
    };
    const g = (m) => {
      if (!m)
        return null;
      const h = m.filter((w) => !cT(w));
      return [...s, ...h];
    };
    this.lastOrder = g(this.lastOrder), this.lastPivotOrder = g(this.lastPivotOrder);
  }
  createControlsCols() {
    var a, u, s, c;
    Qd(this.context, (a = this.controlsCols) == null ? void 0 : a.tree), this.controlsCols = null;
    const e = ((u = this.controlsColService) == null ? void 0 : u.createControlsCols()) ?? [], [t, r] = this.columnFactory.balanceTreeForAutoCols(e, this.cols.tree);
    this.controlsCols = {
      list: e,
      tree: t,
      treeDepth: r,
      map: {}
    };
    function n(i, l) {
      const v = Mv(i), f = Mv(l);
      return v && !f ? -1 : !v && f ? 1 : 0;
    }
    (s = this.lastOrder) == null || s.sort(n), (c = this.lastPivotOrder) == null || c.sort(n);
  }
  addControlsCols() {
    this.controlsCols != null && (this.cols.list = this.controlsCols.list.concat(this.cols.list), this.cols.tree = this.controlsCols.tree.concat(this.cols.tree), q3(this.cols));
  }
  // on events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents'
  refreshAll(e) {
    this.isReady() && (this.refreshCols(!1), this.visibleColsService.refresh(e));
  }
  setColsVisible(e, t = !1, r) {
    this.columnApplyStateService.applyColumnState(
      {
        state: e.map((n) => ({
          colId: typeof n == "string" ? n : n.getColId(),
          hide: !t
        }))
      },
      r
    );
  }
  setColsPinned(e, t, r) {
    if (!this.cols || Rs(e))
      return;
    if (Ao(this.gos, "print")) {
      Fr("Changing the column pinning status is not allowed with domLayout='print'");
      return;
    }
    this.columnAnimationService.start();
    let n;
    t === !0 || t === "left" ? n = "left" : t === "right" ? n = "right" : n = null;
    const a = [];
    e.forEach((u) => {
      if (!u)
        return;
      const s = this.getCol(u);
      s && s.getPinned() !== n && (s.setPinned(n), a.push(s));
    }), a.length && (this.visibleColsService.refresh(r), this.eventDispatcher.columnPinned(a, r)), this.columnAnimationService.finish();
  }
  // called by headerRenderer - when a header is opened or closed
  setColumnGroupOpened(e, t, r) {
    let n;
    ts(e) ? n = e.getId() : n = e || "", this.columnGroupStateService.setColumnGroupState([{ groupId: n, open: t }], r);
  }
  getProvidedColGroup(e) {
    var r;
    let t = null;
    return id(null, (r = this.cols) == null ? void 0 : r.tree, (n) => {
      ts(n) && n.getId() === e && (t = n);
    }), t;
  }
  isColGroupLocked(e) {
    const t = this.gos.get("groupLockGroupColumns");
    if (!e.isRowGroupActive() || t === 0)
      return !1;
    if (t === -1)
      return !0;
    const n = this.funcColsService.getRowGroupColumns().findIndex((a) => a.getColId() === e.getColId());
    return t > n;
  }
  isSuppressAutoCol() {
    return this.gos.get("groupDisplayType") === "custom" ? !0 : this.gos.get("treeDataDisplayType") === "custom";
  }
  setAutoHeightActive() {
    this.autoHeightActive = this.cols.list.some((e) => e.isVisible() && e.isAutoHeight()), this.autoHeightActive && (this.autoHeightActiveAtLeastOnce = !0, da(this.gos) || sd(this.gos) || Fr("autoHeight columns only work with Client Side Row Model and Server Side Row Model."));
  }
  restoreColOrder() {
    const e = this.showingPivotResult ? this.lastPivotOrder : this.lastOrder;
    if (!e)
      return;
    const t = new Map(e.map((i, l) => [i, l]));
    if (!this.cols.list.some((i) => t.has(i)))
      return;
    const n = new Map(this.cols.list.map((i) => [i, !0])), a = e.filter((i) => n.has(i)), u = new Map(a.map((i) => [i, !0])), s = this.cols.list.filter((i) => !u.has(i)), c = a.slice();
    s.forEach((i) => {
      let l = i.getOriginalParent();
      if (!l) {
        c.push(i);
        return;
      }
      const v = [];
      for (; !v.length && l; )
        l.getLeafColumns().forEach((y) => {
          const C = c.indexOf(y) >= 0, m = v.indexOf(y) < 0;
          C && m && v.push(y);
        }), l = l.getOriginalParent();
      if (!v.length) {
        c.push(i);
        return;
      }
      const f = v.map((g) => c.indexOf(g)), p = Math.max(...f);
      h1(c, i, p + 1);
    }), this.cols.list = c;
  }
  sortColsLikeKeys(e) {
    if (this.cols == null)
      return;
    let t = [];
    const r = {};
    e.forEach((a) => {
      if (r[a])
        return;
      const u = this.cols.map[a];
      u && (t.push(u), r[a] = !0);
    });
    let n = 0;
    if (this.cols.list.forEach((a) => {
      const u = a.getColId();
      if (r[u] != null)
        return;
      u.startsWith(Y1) ? h1(t, a, n++) : t.push(a);
    }), t = this.columnMoveService.placeLockedColumns(t), !this.columnMoveService.doesMovePassMarryChildren(t)) {
      Fr(
        "Applying column order broke a group where columns should be married together. Applying new order has been discarded."
      );
      return;
    }
    this.cols.list = t;
  }
  // returns the provided cols sorted in same order as they appear in this.cols, eg if this.cols
  // contains [a,b,c,d,e] and col passed is [e,a] then the passed cols are sorted into [a,e]
  sortColsLikeCols(e) {
    !e || e.length <= 1 || e.filter((r) => this.cols.list.indexOf(r) < 0).length > 0 || e.sort((r, n) => {
      const a = this.cols.list.indexOf(r), u = this.cols.list.indexOf(n);
      return a - u;
    });
  }
  resetColDefIntoCol(e, t) {
    const r = e.getUserProvidedColDef();
    if (!r)
      return !1;
    const n = this.columnFactory.addColumnDefaultAndTypes(r, e.getColId());
    return e.setColDef(n, r, t), !0;
  }
  queueResizeOperations() {
    this.shouldQueueResizeOperations = !0;
  }
  isShouldQueueResizeOperations() {
    return this.shouldQueueResizeOperations;
  }
  processResizeOperations() {
    this.shouldQueueResizeOperations = !1, this.resizeOperationQueue.forEach((e) => e()), this.resizeOperationQueue = [];
  }
  pushResizeOperation(e) {
    this.resizeOperationQueue.push(e);
  }
  moveInCols(e, t, r) {
    var n;
    NL((n = this.cols) == null ? void 0 : n.list, e, t), this.visibleColsService.refresh(r);
  }
  positionLockedCols() {
    this.cols.list = this.columnMoveService.placeLockedColumns(this.cols.list);
  }
  saveColOrder() {
    var e, t;
    this.showingPivotResult ? this.lastPivotOrder = (e = this.cols) == null ? void 0 : e.list : this.lastOrder = (t = this.cols) == null ? void 0 : t.list;
  }
  getColumnDefs() {
    if (!this.colDefCols)
      return;
    const e = this.colDefCols.list.slice();
    this.showingPivotResult ? e.sort((n, a) => this.lastOrder.indexOf(n) - this.lastOrder.indexOf(a)) : this.lastOrder && e.sort((n, a) => this.cols.list.indexOf(n) - this.cols.list.indexOf(a));
    const t = this.funcColsService.getRowGroupColumns(), r = this.funcColsService.getPivotColumns();
    return this.columnDefFactory.buildColumnDefs(e, t, r);
  }
  isShowingPivotResult() {
    return this.showingPivotResult;
  }
  // called by clientSideRowModel.refreshModel
  isChangeEventsDispatching() {
    return this.changeEventsDispatching;
  }
  isColSpanActive() {
    return this.colSpanActive;
  }
  // used by Column Tool Panel
  isProvidedColGroupsPresent() {
    var e;
    return ((e = this.colDefCols) == null ? void 0 : e.treeDepth) > 0;
  }
  setColSpanActive() {
    this.colSpanActive = this.cols.list.some((e) => e.getColDef().colSpan != null);
  }
  isAutoRowHeightActive() {
    return this.autoHeightActive;
  }
  wasAutoRowHeightEverActive() {
    return this.autoHeightActiveAtLeastOnce;
  }
  // + gridPanel -> for resizing the body and setting top margin
  getHeaderRowCount() {
    return this.cols ? this.cols.treeDepth + 1 : -1;
  }
  isReady() {
    return this.ready;
  }
  isPivotMode() {
    return this.pivotMode;
  }
  setPivotMode(e, t) {
    e === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode) || (this.pivotMode = e, this.ready && (this.refreshCols(!1), this.visibleColsService.refresh(t), this.eventDispatcher.pivotModeChanged()));
  }
  isPivotSettingAllowed(e) {
    return e && this.gos.get("treeData") ? (Fr("Pivot mode not available with treeData."), !1) : !0;
  }
  // + clientSideRowModel
  isPivotActive() {
    const e = this.funcColsService.getPivotColumns();
    return this.pivotMode && !Rs(e);
  }
  // called when dataTypes change
  recreateColumnDefs(e) {
    this.cols && (this.autoCols && this.autoColService.updateAutoCols(this.autoCols.list, e), this.createColsFromColDefs(e));
  }
  setColumnDefs(e, t) {
    this.colDefs = e, this.createColsFromColDefs(t);
  }
  destroy() {
    var e, t, r;
    Qd(this.context, (e = this.colDefCols) == null ? void 0 : e.tree), Qd(this.context, (t = this.autoCols) == null ? void 0 : t.tree), Qd(this.context, (r = this.controlsCols) == null ? void 0 : r.tree), super.destroy();
  }
  getColTree() {
    return this.cols.tree;
  }
  // + columnSelectPanel
  getColDefColTree() {
    return this.colDefCols.tree;
  }
  // + clientSideRowController -> sorting, building quick filter text
  // + headerRenderer -> sorting (clearing icon)
  getColDefCols() {
    var e;
    return (e = this.colDefCols) != null && e.list ? this.colDefCols.list : null;
  }
  // + moveColumnController
  getCols() {
    var e;
    return ((e = this.cols) == null ? void 0 : e.list) ?? [];
  }
  // returns colDefCols, pivotResultCols and autoCols
  getAllCols() {
    var r, n, a;
    const e = this.pivotResultColsService.getPivotResultCols(), t = e == null ? void 0 : e.list;
    return [
      ((r = this.colDefCols) == null ? void 0 : r.list) ?? [],
      ((n = this.autoCols) == null ? void 0 : n.list) ?? [],
      ((a = this.controlsCols) == null ? void 0 : a.list) ?? [],
      t ?? []
    ].flat();
  }
  getColsForKeys(e) {
    return e ? e.map((t) => this.getCol(t)).filter((t) => t != null) : [];
  }
  getColDefCol(e) {
    var t;
    return (t = this.colDefCols) != null && t.list ? this.getColFromCollection(e, this.colDefCols) : null;
  }
  getCol(e) {
    return e == null ? null : this.getColFromCollection(e, this.cols);
  }
  getColFromCollection(e, t) {
    if (t == null)
      return null;
    const { map: r, list: n } = t;
    if (typeof e == "string" && r[e])
      return r[e];
    for (let a = 0; a < n.length; a++)
      if (eF(n[a], e))
        return n[a];
    return this.getAutoCol(e);
  }
  getAutoCol(e) {
    var t;
    return ((t = this.autoCols) == null ? void 0 : t.list.find((r) => eF(r, e))) ?? null;
  }
  getAutoCols() {
    var e;
    return ((e = this.autoCols) == null ? void 0 : e.list) ?? null;
  }
  setColHeaderHeight(e, t) {
    e.setAutoHeaderHeight(t) && (e.isColumn ? this.eventDispatcher.headerHeight(e) : this.eventDispatcher.groupHeaderHeight(e));
  }
  getGroupRowsHeight() {
    const e = [], t = this.ctrlsService.getHeaderRowContainerCtrls();
    for (const r of t) {
      if (!r)
        continue;
      const n = r.getGroupRowCount() || 0;
      for (let a = 0; a < n; a++) {
        const u = r.getGroupRowCtrlAtIndex(a), s = e[a];
        if (u) {
          const c = this.getColumnGroupHeaderRowHeight(u);
          (s == null || c > s) && (e[a] = c);
        }
      }
    }
    return e;
  }
  getColumnGroupHeaderRowHeight(e) {
    const t = this.isPivotMode() ? this.getPivotGroupHeaderHeight() : this.getGroupHeaderHeight();
    let r = 0;
    const n = e.getHeaderCtrls();
    for (const a of n) {
      const u = a.getColumn();
      if (u.isAutoHeaderHeight()) {
        const s = u.getAutoHeaderHeight();
        s != null && s > r && (r = s);
      }
    }
    return Math.max(t, r);
  }
  getColumnHeaderRowHeight() {
    const e = this.isPivotMode() ? this.getPivotHeaderHeight() : this.getHeaderHeight(), r = this.visibleColsService.getAllCols().filter((n) => n.isAutoHeaderHeight()).map((n) => n.getAutoHeaderHeight() || 0);
    return Math.max(e, ...r);
  }
  getHeaderHeight() {
    return this.gos.get("headerHeight") ?? this.environment.getDefaultHeaderHeight();
  }
  getFloatingFiltersHeight() {
    return this.gos.get("floatingFiltersHeight") ?? this.getHeaderHeight();
  }
  getGroupHeaderHeight() {
    return this.gos.get("groupHeaderHeight") ?? this.getHeaderHeight();
  }
  getPivotHeaderHeight() {
    return this.gos.get("pivotHeaderHeight") ?? this.getHeaderHeight();
  }
  getPivotGroupHeaderHeight() {
    return this.gos.get("pivotGroupHeaderHeight") ?? this.getGroupHeaderHeight();
  }
  onFirstDataRendered() {
    const e = this.gos.get("autoSizeStrategy");
    if ((e == null ? void 0 : e.type) !== "fitCellContents")
      return;
    const { colIds: t, skipHeader: r } = e;
    setTimeout(() => {
      t ? this.columnAutosizeService.autoSizeCols({
        colKeys: t,
        skipHeader: r,
        source: "autosizeColumns"
      }) : this.columnAutosizeService.autoSizeAllColumns("autosizeColumns", r);
    });
  }
  onAutoGroupColumnDefChanged(e) {
    this.autoCols && this.autoColService.updateAutoCols(this.autoCols.list, e);
  }
  onSelectionOptionsChanged(e, t, r) {
    if (typeof e == "string" || typeof t == "string")
      return;
    const n = t ? Av(t) : void 0, a = e ? Av(e) : void 0, u = n !== a, s = t ? d1(t) : void 0, c = e ? d1(e) : void 0;
    (u || s !== c) && this.refreshAll(r);
  }
};
function Ah(e) {
  return e === "gridOptionsUpdated" ? "gridOptionsChanged" : e;
}
function q3(e) {
  e.map = {}, e.list.forEach((t) => e.map[t.getId()] = t);
}
function eF(e, t) {
  const r = e === t, n = e.getColDef() === t, a = e.getColId() == t;
  return r || n || a;
}
function pU(e, t) {
  return cf(e, t, (r, n) => r.getColId() === n.getColId());
}
var vU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnAutosizeService", this.timesDelayed = 0;
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService, this.animationFrameService = e.animationFrameService, this.autoWidthCalculator = e.autoWidthCalculator, this.eventDispatcher = e.columnEventDispatcher, this.ctrlsService = e.ctrlsService, this.renderStatusService = e.renderStatusService;
  }
  autoSizeCols(e) {
    if (this.columnModel.isShouldQueueResizeOperations()) {
      this.columnModel.pushResizeOperation(() => this.autoSizeCols(e));
      return;
    }
    const { colKeys: t, skipHeader: r, skipHeaderGroups: n, stopAtGroup: a, source: u = "api" } = e;
    if (this.animationFrameService.flushAllFrames(), this.timesDelayed < 5 && this.renderStatusService && !this.renderStatusService.areHeaderCellsRendered()) {
      this.timesDelayed++, setTimeout(() => this.autoSizeCols(e));
      return;
    }
    this.timesDelayed = 0;
    const s = [];
    let c = -1;
    const i = r ?? this.gos.get("skipHeaderOnAutoSize"), l = n ?? i;
    for (; c !== 0; ) {
      c = 0;
      const v = [];
      t.forEach((f) => {
        if (!f)
          return;
        const p = this.columnModel.getCol(f);
        if (!p || s.indexOf(p) >= 0)
          return;
        const g = this.autoWidthCalculator.getPreferredWidthForColumn(p, i);
        if (g > 0) {
          const y = this.normaliseColumnWidth(p, g);
          p.setActualWidth(y, u), s.push(p), c++;
        }
        v.push(p);
      }), v.length && this.visibleColsService.refresh(u);
    }
    l || this.autoSizeColumnGroupsByColumns(t, u, a), this.eventDispatcher.columnResized(s, !0, "autosizeColumns");
  }
  autoSizeColumn(e, t, r) {
    e && this.autoSizeCols({ colKeys: [e], skipHeader: r, skipHeaderGroups: !0, source: t });
  }
  autoSizeColumnGroupsByColumns(e, t, r) {
    const n = /* @__PURE__ */ new Set();
    this.columnModel.getColsForKeys(e).forEach((c) => {
      let i = c.getParent();
      for (; i && i != r; )
        i.isPadding() || n.add(i), i = i.getParent();
    });
    let u;
    const s = [];
    for (const c of n) {
      for (const i of this.ctrlsService.getHeaderRowContainerCtrls())
        if (u = i.getHeaderCtrlForColumn(c), u)
          break;
      u && u.resizeLeafColumnsToFit(t);
    }
    return s;
  }
  autoSizeAllColumns(e, t) {
    if (this.columnModel.isShouldQueueResizeOperations()) {
      this.columnModel.pushResizeOperation(() => this.autoSizeAllColumns(e, t));
      return;
    }
    const r = this.visibleColsService.getAllCols();
    this.autoSizeCols({ colKeys: r, skipHeader: t, source: e });
  }
  // returns the width we can set to this col, taking into consideration min and max widths
  normaliseColumnWidth(e, t) {
    const r = e.getMinWidth();
    t < r && (t = r);
    const n = e.getMaxWidth();
    return e.isGreaterThanMax(t) && (t = n), t;
  }
}, gU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "funcColsService", this.rowGroupCols = [], this.valueCols = [], this.pivotCols = [];
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.eventDispatcher = e.columnEventDispatcher, this.aggFuncService = e.aggFuncService, this.visibleColsService = e.visibleColsService;
  }
  getModifyColumnsNoEventsCallbacks() {
    return {
      addGroupCol: (e) => this.rowGroupCols.push(e),
      removeGroupCol: (e) => bs(this.rowGroupCols, e),
      addPivotCol: (e) => this.pivotCols.push(e),
      removePivotCol: (e) => bs(this.pivotCols, e),
      addValueCol: (e) => this.valueCols.push(e),
      removeValueCol: (e) => bs(this.valueCols, e)
    };
  }
  getSourceColumnsForGroupColumn(e) {
    const t = e.getColDef().showRowGroup;
    if (!t)
      return null;
    if (t === !0)
      return this.rowGroupCols.slice(0);
    const r = this.columnModel.getColDefCol(t);
    return r ? [r] : null;
  }
  sortRowGroupColumns(e) {
    this.rowGroupCols.sort(e);
  }
  sortPivotColumns(e) {
    this.pivotCols.sort(e);
  }
  // + rowController
  getValueColumns() {
    return this.valueCols ? this.valueCols : [];
  }
  // + rowController
  getPivotColumns() {
    return this.pivotCols ? this.pivotCols : [];
  }
  // + toolPanel
  getRowGroupColumns() {
    return this.rowGroupCols ? this.rowGroupCols : [];
  }
  isRowGroupEmpty() {
    return Rs(this.rowGroupCols);
  }
  setColumnAggFunc(e, t, r) {
    if (!e)
      return;
    const n = this.columnModel.getColDefCol(e);
    n && (n.setAggFunc(t), this.eventDispatcher.columnChanged("columnValueChanged", [n], r));
  }
  setRowGroupColumns(e, t) {
    this.setColList(
      e,
      this.rowGroupCols,
      "columnRowGroupChanged",
      !0,
      !0,
      (r, n) => this.setRowGroupActive(r, n, t),
      t
    );
  }
  setRowGroupActive(e, t, r) {
    e !== t.isRowGroupActive() && (t.setRowGroupActive(e, r), e && !this.gos.get("suppressRowGroupHidesColumns") && this.columnModel.setColsVisible([t], !1, r), !e && !this.gos.get("suppressMakeColumnVisibleAfterUnGroup") && this.columnModel.setColsVisible([t], !0, r));
  }
  addRowGroupColumns(e, t) {
    this.updateColList(
      e,
      this.rowGroupCols,
      !0,
      !0,
      (r) => this.setRowGroupActive(!0, r, t),
      "columnRowGroupChanged",
      t
    );
  }
  removeRowGroupColumns(e, t) {
    this.updateColList(
      e,
      this.rowGroupCols,
      !1,
      !0,
      (r) => this.setRowGroupActive(!1, r, t),
      "columnRowGroupChanged",
      t
    );
  }
  addPivotColumns(e, t) {
    this.updateColList(
      e,
      this.pivotCols,
      !0,
      !1,
      (r) => r.setPivotActive(!0, t),
      "columnPivotChanged",
      t
    );
  }
  setPivotColumns(e, t) {
    this.setColList(
      e,
      this.pivotCols,
      "columnPivotChanged",
      !0,
      !1,
      (r, n) => {
        n.setPivotActive(r, t);
      },
      t
    );
  }
  removePivotColumns(e, t) {
    this.updateColList(
      e,
      this.pivotCols,
      !1,
      !1,
      (r) => r.setPivotActive(!1, t),
      "columnPivotChanged",
      t
    );
  }
  setValueColumns(e, t) {
    this.setColList(
      e,
      this.valueCols,
      "columnValueChanged",
      !1,
      !1,
      (r, n) => this.setValueActive(r, n, t),
      t
    );
  }
  setValueActive(e, t, r) {
    if (e !== t.isValueActive() && (t.setValueActive(e, r), e && !t.getAggFunc() && this.aggFuncService)) {
      const n = this.aggFuncService.getDefaultAggFunc(t);
      t.setAggFunc(n);
    }
  }
  addValueColumns(e, t) {
    this.updateColList(
      e,
      this.valueCols,
      !0,
      !1,
      (r) => this.setValueActive(!0, r, t),
      "columnValueChanged",
      t
    );
  }
  removeValueColumns(e, t) {
    this.updateColList(
      e,
      this.valueCols,
      !1,
      !1,
      (r) => this.setValueActive(!1, r, t),
      "columnValueChanged",
      t
    );
  }
  moveRowGroupColumn(e, t, r) {
    if (this.isRowGroupEmpty())
      return;
    const n = this.rowGroupCols[e], a = this.rowGroupCols.slice(e, t);
    this.rowGroupCols.splice(e, 1), this.rowGroupCols.splice(t, 0, n), this.eventDispatcher.rowGroupChanged(a, r);
  }
  setColList(e, t, r, n, a, u, s) {
    const c = this.columnModel.getCols();
    if (Rs(c))
      return;
    const i = /* @__PURE__ */ new Map();
    t.forEach((v, f) => i.set(v, f)), t.length = 0, $r(e) && e.forEach((v) => {
      const f = this.columnModel.getColDefCol(v);
      f && t.push(f);
    }), t.forEach((v, f) => {
      const p = i.get(v);
      if (p === void 0) {
        i.set(v, 0);
        return;
      }
      n && p !== f || i.delete(v);
    }), (this.columnModel.getColDefCols() || []).forEach((v) => {
      const f = t.indexOf(v) >= 0;
      u(f, v);
    }), a && this.columnModel.refreshCols(!1), this.visibleColsService.refresh(s), this.eventDispatcher.columnChanged(r, [...i.keys()], s);
  }
  updateColList(e, t, r, n, a, u, s) {
    if (!e || Rs(e))
      return;
    let c = !1;
    const i = /* @__PURE__ */ new Set();
    e.forEach((l) => {
      if (!l)
        return;
      const v = this.columnModel.getColDefCol(l);
      if (v) {
        if (i.add(v), r) {
          if (t.indexOf(v) >= 0)
            return;
          t.push(v);
        } else {
          const f = t.indexOf(v);
          if (f < 0)
            return;
          for (let p = f + 1; p < t.length; p++)
            i.add(t[p]);
          bs(t, v);
        }
        a(v), c = !0;
      }
    }), c && (n && this.columnModel.refreshCols(!1), this.visibleColsService.refresh(s), this.eventDispatcher.genericColumnEvent(u, Array.from(i), s));
  }
  extractCols(e, t) {
    this.extractRowGroupCols(e, t), this.extractPivotCols(e, t), this.extractValueCols(e, t);
  }
  extractValueCols(e, t) {
    this.valueCols = this.extractColsCommon(
      t,
      this.valueCols,
      (r, n) => r.setValueActive(n, e),
      // aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null
      () => {
      },
      () => {
      },
      // aggFunc is a string, so return it's existence
      (r) => {
        const n = r.aggFunc;
        if (n === null || n === "")
          return null;
        if (n !== void 0)
          return !!n;
      },
      (r) => r.initialAggFunc != null && r.initialAggFunc != ""
    ), this.valueCols.forEach((r) => {
      const n = r.getColDef();
      n.aggFunc != null && n.aggFunc != "" ? r.setAggFunc(n.aggFunc) : r.getAggFunc() || r.setAggFunc(n.initialAggFunc);
    });
  }
  extractRowGroupCols(e, t) {
    this.rowGroupCols = this.extractColsCommon(
      t,
      this.rowGroupCols,
      (r, n) => r.setRowGroupActive(n, e),
      (r) => r.rowGroupIndex,
      (r) => r.initialRowGroupIndex,
      (r) => r.rowGroup,
      (r) => r.initialRowGroup
    );
  }
  extractPivotCols(e, t) {
    this.pivotCols = this.extractColsCommon(
      t,
      this.pivotCols,
      (r, n) => r.setPivotActive(n, e),
      (r) => r.pivotIndex,
      (r) => r.initialPivotIndex,
      (r) => r.pivot,
      (r) => r.initialPivot
    );
  }
  extractColsCommon(e = [], t = [], r, n, a, u, s) {
    const c = [], i = [];
    (this.columnModel.getColDefCols() || []).forEach((p) => {
      const g = e.indexOf(p) < 0, y = p.getColDef(), C = aT(u(y)), m = aT(s(y)), h = Lh(n(y)), w = Lh(a(y));
      let S;
      C !== void 0 ? S = C : h !== void 0 ? h === null ? S = !1 : S = h >= 0 : g ? m !== void 0 ? S = m : w !== void 0 ? S = w != null && w >= 0 : S = !1 : S = t.indexOf(p) >= 0, S && ((g ? h != null || w != null : h != null) ? c.push(p) : i.push(p));
    });
    const v = (p) => {
      const g = n(p.getColDef()), y = a(p.getColDef());
      return g ?? y;
    };
    c.sort((p, g) => {
      const y = v(p), C = v(g);
      return y === C ? 0 : y < C ? -1 : 1;
    });
    const f = [].concat(c);
    return t.forEach((p) => {
      i.indexOf(p) >= 0 && f.push(p);
    }), i.forEach((p) => {
      f.indexOf(p) < 0 && f.push(p);
    }), t.forEach((p) => {
      f.indexOf(p) < 0 && r(p, !1);
    }), f.forEach((p) => {
      t.indexOf(p) < 0 && r(p, !0);
    }), f;
  }
  generateColumnStateForRowGroupAndPivotIndexes(e, t) {
    const r = {}, n = (a, u, s, c, i, l) => {
      const v = this.columnModel.getColDefCols();
      if (!u.length || !v)
        return [];
      const f = Object.keys(a), p = new Set(f), g = new Set(f), y = new Set(
        u.map((T) => {
          const F = T.getColId();
          return g.delete(F), F;
        }).concat(f)
      ), C = [], m = {};
      let h = 0;
      for (let T = 0; T < v.length; T++) {
        const F = v[T].getColId();
        y.has(F) && (C.push(F), m[F] = h++);
      }
      let w = 1e3, S = !1, E = 0;
      const x = (T) => {
        const F = m[T];
        for (let P = E; P < F; P++) {
          const k = C[P];
          g.has(k) && (a[k][i] = w++, g.delete(k));
        }
        E = F;
      };
      u.forEach((T) => {
        const F = T.getColId();
        if (p.has(F))
          x(F), a[F][i] = w++;
        else {
          const P = T.getColDef();
          (P[i] === null || P[i] === void 0 && P[l] == null) && (S || (P[s] || P[s] === void 0 && P[c] ? x(F) : (g.forEach((L) => {
            a[L][i] = w + m[L];
          }), w += C.length, S = !0)), r[F] || (r[F] = { colId: F }), r[F][i] = w++);
        }
      });
    };
    return n(
      e,
      this.rowGroupCols,
      "rowGroup",
      "initialRowGroup",
      "rowGroupIndex",
      "initialRowGroupIndex"
    ), n(
      t,
      this.pivotCols,
      "pivot",
      "initialPivot",
      "pivotIndex",
      "initialPivotIndex"
    ), Object.values(r);
  }
}, mU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnApplyStateService";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.eventDispatcher = e.columnEventDispatcher, this.sortController = e.sortController, this.columnGetStateService = e.columnGetStateService, this.funcColsService = e.funcColsService, this.visibleColsService = e.visibleColsService, this.columnAnimationService = e.columnAnimationService, this.pivotResultColsService = e.pivotResultColsService;
  }
  applyColumnState(e, t) {
    const r = this.columnModel.getColDefCols() || [];
    if (Rs(r))
      return !1;
    if (e && e.state && !e.state.forEach)
      return Fr(
        "applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."
      ), !1;
    const n = this.funcColsService.getModifyColumnsNoEventsCallbacks(), a = (c, i, l) => {
      const v = this.compareColumnStatesAndDispatchEvents(t), f = i.slice(), p = {}, g = {}, y = [], C = [];
      let m = 0;
      const h = this.funcColsService.getRowGroupColumns().slice(), w = this.funcColsService.getPivotColumns().slice();
      c.forEach((T) => {
        const F = T.colId || "";
        if (F.startsWith(Y1)) {
          y.push(T), C.push(T);
          return;
        }
        const k = l(F);
        k ? (this.syncColumnWithStateItem(
          k,
          T,
          e.defaultState,
          p,
          g,
          !1,
          t,
          n
        ), bs(f, k)) : (C.push(T), m += 1);
      });
      const S = (T) => this.syncColumnWithStateItem(
        T,
        null,
        e.defaultState,
        p,
        g,
        !1,
        t,
        n
      );
      f.forEach(S), this.funcColsService.sortRowGroupColumns(
        tF.bind(this, p, h)
      ), this.funcColsService.sortPivotColumns(tF.bind(this, g, w)), this.columnModel.refreshCols(!1);
      const x = (this.columnModel.getAutoCols() || []).slice();
      return y.forEach((T) => {
        const F = this.columnModel.getAutoCol(T.colId);
        bs(x, F), this.syncColumnWithStateItem(
          F,
          T,
          e.defaultState,
          null,
          null,
          !0,
          t,
          n
        );
      }), x.forEach(S), this.orderLiveColsLikeState(e), this.visibleColsService.refresh(t), this.eventDispatcher.everythingChanged(t), v(), { unmatchedAndAutoStates: C, unmatchedCount: m };
    };
    this.columnAnimationService.start();
    let { unmatchedAndAutoStates: u, unmatchedCount: s } = a(
      e.state || [],
      r,
      (c) => this.columnModel.getColDefCol(c)
    );
    if (u.length > 0 || $r(e.defaultState)) {
      const c = this.pivotResultColsService.getPivotResultCols(), i = c == null ? void 0 : c.list;
      s = a(
        u,
        i || [],
        (l) => this.pivotResultColsService.getPivotResultCol(l)
      ).unmatchedCount;
    }
    return this.columnAnimationService.finish(), s === 0;
  }
  resetColumnState(e) {
    const t = this.columnModel.getColDefCols();
    if (Rs(t))
      return;
    const r = this.columnModel.getColDefColTree(), n = N2(r), a = [];
    let u = 1e3, s = 1e3, c = [];
    const i = this.columnModel.getAutoCols();
    i && (c = c.concat(i)), n && (c = c.concat(n)), c.forEach((l) => {
      const v = this.getColumnStateFromColDef(l);
      mi(v.rowGroupIndex) && v.rowGroup && (v.rowGroupIndex = u++), mi(v.pivotIndex) && v.pivot && (v.pivotIndex = s++), a.push(v);
    }), this.applyColumnState({ state: a, applyOrder: !0 }, e);
  }
  getColumnStateFromColDef(e) {
    const t = (y, C) => y ?? C ?? null, r = e.getColDef(), n = t(r.sort, r.initialSort), a = t(r.sortIndex, r.initialSortIndex), u = t(r.hide, r.initialHide), s = t(r.pinned, r.initialPinned), c = t(r.width, r.initialWidth), i = t(r.flex, r.initialFlex);
    let l = t(
      r.rowGroupIndex,
      r.initialRowGroupIndex
    ), v = t(r.rowGroup, r.initialRowGroup);
    l == null && (v == null || v == !1) && (l = null, v = null);
    let f = t(r.pivotIndex, r.initialPivotIndex), p = t(r.pivot, r.initialPivot);
    f == null && (p == null || p == !1) && (f = null, p = null);
    const g = t(r.aggFunc, r.initialAggFunc);
    return {
      colId: e.getColId(),
      sort: n,
      sortIndex: a,
      hide: u,
      pinned: s,
      width: c,
      flex: i,
      rowGroup: v,
      rowGroupIndex: l,
      pivot: p,
      pivotIndex: f,
      aggFunc: g
    };
  }
  syncColumnWithStateItem(e, t, r, n, a, u, s, c) {
    if (!e)
      return;
    const i = (E, x) => {
      const T = {
        value1: void 0,
        value2: void 0
      };
      let F = !1;
      return t && (t[E] !== void 0 && (T.value1 = t[E], F = !0), $r(x) && t[x] !== void 0 && (T.value2 = t[x], F = !0)), !F && r && (r[E] !== void 0 && (T.value1 = r[E]), $r(x) && r[x] !== void 0 && (T.value2 = r[x])), T;
    }, l = i("hide").value1;
    l !== void 0 && e.setVisible(!l, s);
    const v = i("pinned").value1;
    v !== void 0 && e.setPinned(v);
    const f = e.getColDef().minWidth ?? this.gos.environment.getDefaultColumnMinWidth(), p = i("flex").value1;
    if (p !== void 0 && e.setFlex(p), p == null) {
      const E = i("width").value1;
      E != null && f != null && E >= f && e.setActualWidth(E, s);
    }
    const g = i("sort").value1;
    g !== void 0 && (g === "desc" || g === "asc" ? e.setSort(g, s) : e.setSort(void 0, s));
    const y = i("sortIndex").value1;
    if (y !== void 0 && e.setSortIndex(y), u || !e.isPrimary())
      return;
    const C = i("aggFunc").value1;
    C !== void 0 && (typeof C == "string" ? (e.setAggFunc(C), e.isValueActive() || (e.setValueActive(!0, s), c.addValueCol(e))) : ($r(C) && Fr(
      "stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."
    ), e.isValueActive() && (e.setValueActive(!1, s), c.removeValueCol(e))));
    const { value1: m, value2: h } = i("rowGroup", "rowGroupIndex");
    (m !== void 0 || h !== void 0) && (typeof h == "number" || m ? (e.isRowGroupActive() || (e.setRowGroupActive(!0, s), c.addGroupCol(e)), n && typeof h == "number" && (n[e.getId()] = h)) : e.isRowGroupActive() && (e.setRowGroupActive(!1, s), c.removeGroupCol(e)));
    const { value1: w, value2: S } = i("pivot", "pivotIndex");
    (w !== void 0 || S !== void 0) && (typeof S == "number" || w ? (e.isPivotActive() || (e.setPivotActive(!0, s), c.addPivotCol(e)), a && typeof S == "number" && (a[e.getId()] = S)) : e.isPivotActive() && (e.setPivotActive(!1, s), c.removePivotCol(e)));
  }
  orderLiveColsLikeState(e) {
    if (!e.applyOrder || !e.state)
      return;
    const t = [];
    e.state.forEach((r) => {
      r.colId != null && t.push(r.colId);
    }), this.columnModel.sortColsLikeKeys(t);
  }
  // calculates what events to fire between column state changes. gets used when:
  // a) apply column state
  // b) apply new column definitions (so changes from old cols)
  compareColumnStatesAndDispatchEvents(e) {
    const t = {
      rowGroupColumns: this.funcColsService.getRowGroupColumns().slice(),
      pivotColumns: this.funcColsService.getPivotColumns().slice(),
      valueColumns: this.funcColsService.getValueColumns().slice()
    }, r = this.columnGetStateService.getColumnState(), n = {};
    return r.forEach((a) => {
      n[a.colId] = a;
    }), () => {
      const a = this.columnModel.getAllCols(), u = (C, m, h, w) => {
        const S = m.map(w), E = h.map(w);
        if (cf(S, E))
          return;
        const T = new Set(m);
        h.forEach((P) => {
          T.delete(P) || T.add(P);
        });
        const F = [...T];
        this.eventService.dispatchEvent({
          type: C,
          columns: F,
          column: F.length === 1 ? F[0] : null,
          source: e
        });
      }, s = (C) => {
        const m = [];
        return a.forEach((h) => {
          const w = n[h.getColId()];
          w && C(w, h) && m.push(h);
        }), m;
      }, c = (C) => C.getColId();
      u(
        "columnRowGroupChanged",
        t.rowGroupColumns,
        this.funcColsService.getRowGroupColumns(),
        c
      ), u(
        "columnPivotChanged",
        t.pivotColumns,
        this.funcColsService.getPivotColumns(),
        c
      );
      const l = s((C, m) => {
        const h = C.aggFunc != null, w = h != m.isValueActive(), S = h && C.aggFunc != m.getAggFunc();
        return w || S;
      });
      l.length > 0 && this.eventDispatcher.columnChanged("columnValueChanged", l, e);
      const v = (C, m) => C.width != m.getActualWidth();
      this.eventDispatcher.columnResized(s(v), !0, e);
      const f = (C, m) => C.pinned != m.getPinned();
      this.eventDispatcher.columnPinned(s(f), e);
      const p = (C, m) => C.hide == m.isVisible();
      this.eventDispatcher.columnVisible(s(p), e);
      const y = s((C, m) => C.sort != m.getSort() || C.sortIndex != m.getSortIndex());
      y.length > 0 && this.sortController.dispatchSortChangedEvents(e, y), this.normaliseColumnMovedEventForColumnState(r, e);
    };
  }
  normaliseColumnMovedEventForColumnState(e, t) {
    const r = this.columnGetStateService.getColumnState(), n = {};
    r.forEach((i) => n[i.colId] = i);
    const a = {};
    e.forEach((i) => {
      n[i.colId] && (a[i.colId] = !0);
    });
    const u = e.filter((i) => a[i.colId]), s = r.filter((i) => a[i.colId]), c = [];
    s.forEach((i, l) => {
      const v = u && u[l];
      if (v && v.colId !== i.colId) {
        const f = this.columnModel.getCol(v.colId);
        f && c.push(f);
      }
    }), c.length && this.eventDispatcher.columnMoved({ movedColumns: c, source: t, finished: !0 });
  }
}, tF = (e, t, r, n) => {
  const a = e[r.getId()], u = e[n.getId()], s = a != null, c = u != null;
  if (s && c)
    return a - u;
  if (s)
    return -1;
  if (c)
    return 1;
  const i = t.indexOf(r), l = t.indexOf(n), v = i >= 0, f = l >= 0;
  return v && f ? i - l : v ? -1 : 1;
}, yU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnMoveService";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.columnAnimationService = e.columnAnimationService, this.eventDispatcher = e.columnEventDispatcher;
  }
  moveColumnByIndex(e, t, r) {
    const n = this.columnModel.getCols();
    if (!n)
      return;
    const a = n[e];
    this.moveColumns([a], t, r);
  }
  moveColumns(e, t, r, n = !0) {
    const a = this.columnModel.getCols();
    if (!a)
      return;
    if (t > a.length - e.length) {
      Fr("tried to insert columns in invalid location, toIndex = ", t), Fr("remember that you should not count the moving columns when calculating the new index");
      return;
    }
    this.columnAnimationService.start();
    const u = this.columnModel.getColsForKeys(e);
    this.doesMovePassRules(u, t) && (this.columnModel.moveInCols(u, t, r), this.eventDispatcher.columnMoved({ movedColumns: u, source: r, toIndex: t, finished: n })), this.columnAnimationService.finish();
  }
  doesMovePassRules(e, t) {
    const r = this.getProposedColumnOrder(e, t);
    return this.doesOrderPassRules(r);
  }
  doesOrderPassRules(e) {
    return !(!this.doesMovePassMarryChildren(e) || !this.doesMovePassLockedPositions(e));
  }
  getProposedColumnOrder(e, t) {
    const n = this.columnModel.getCols().slice();
    return NL(n, e, t), n;
  }
  doesMovePassLockedPositions(e) {
    const t = (u) => u ? u === "left" || u === !0 ? -1 : 1 : 0, r = this.gos.get("enableRtl");
    let n = r ? 1 : -1, a = !0;
    return e.forEach((u) => {
      const s = t(u.getColDef().lockPosition);
      r ? s > n && (a = !1) : s < n && (a = !1), n = s;
    }), a;
  }
  doesMovePassMarryChildren(e) {
    let t = !0;
    const r = this.columnModel.getColTree();
    return id(null, r, (n) => {
      if (!ts(n))
        return;
      const a = n, u = a.getColGroupDef();
      if (!(u && u.marryChildren))
        return;
      const c = [];
      a.getLeafColumns().forEach((p) => {
        const g = e.indexOf(p);
        c.push(g);
      });
      const i = Math.max.apply(Math, c), l = Math.min.apply(Math, c), v = i - l, f = a.getLeafColumns().length - 1;
      v > f && (t = !1);
    }), t;
  }
  placeLockedColumns(e) {
    const t = [], r = [], n = [];
    return e.forEach((u) => {
      const s = u.getColDef().lockPosition;
      s === "right" ? n.push(u) : s === "left" || s === !0 ? t.push(u) : r.push(u);
    }), this.gos.get("enableRtl") ? [...n, ...r, ...t] : [...t, ...r, ...n];
  }
}, CU = /[&<>"']/g, bU = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
};
function ac(e, t) {
  if (e == null)
    return null;
  const r = e.toString().toString();
  return t ? r : r.replace(CU, (n) => bU[n]);
}
function wU(e) {
  if (!e || e == null)
    return null;
  const t = /([a-z])([A-Z])/g, r = /([A-Z]+)([A-Z])([a-z])/g;
  return e.replace(t, "$1 $2").replace(r, "$1 $2$3").replace(/\./g, " ").split(" ").map((a) => a.substring(0, 1).toUpperCase() + (a.length > 1 ? a.substring(1, a.length) : "")).join(" ");
}
var SU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnNameService";
  }
  wireBeans(e) {
    this.expressionService = e.expressionService, this.funcColsService = e.funcColsService, this.columnModel = e.columnModel;
  }
  getDisplayNameForColumn(e, t, r = !1) {
    if (!e)
      return null;
    const n = this.getHeaderName(e.getColDef(), e, null, null, t);
    return r ? this.wrapHeaderNameWithAggFunc(e, n) : n;
  }
  getDisplayNameForProvidedColumnGroup(e, t, r) {
    const n = t ? t.getColGroupDef() : null;
    return n ? this.getHeaderName(n, null, e, t, r) : null;
  }
  getDisplayNameForColumnGroup(e, t) {
    return this.getDisplayNameForProvidedColumnGroup(e, e.getProvidedColumnGroup(), t);
  }
  // location is where the column is going to appear, ie who is calling us
  getHeaderName(e, t, r, n, a) {
    const u = e.headerValueGetter;
    if (u) {
      const s = this.gos.addGridCommonParams({
        colDef: e,
        column: t,
        columnGroup: r,
        providedColumnGroup: n,
        location: a
      });
      return typeof u == "function" ? u(s) : typeof u == "string" ? this.expressionService.evaluate(u, s) : (Fr("headerValueGetter must be a function or a string"), "");
    } else {
      if (e.headerName != null)
        return e.headerName;
      if (e.field)
        return wU(e.field);
    }
    return "";
  }
  wrapHeaderNameWithAggFunc(e, t) {
    if (this.gos.get("suppressAggFuncInHeader"))
      return t;
    const r = e.getColDef().pivotValueColumn, n = $r(r);
    let a = null, u;
    if (n) {
      const s = this.funcColsService.getValueColumns(), c = this.gos.get("removePivotHeaderRowWhenSingleValueColumn") && s.length === 1, i = e.getColDef().pivotTotalColumnIds !== void 0;
      if (c && !i)
        return t;
      a = r ? r.getAggFunc() : null, u = !0;
    } else {
      const s = e.isValueActive(), c = this.columnModel.isPivotMode() || !this.funcColsService.isRowGroupEmpty();
      s && c ? (a = e.getAggFunc(), u = !0) : u = !1;
    }
    if (u) {
      const s = typeof a == "string" ? a : "func";
      return `${this.localeService.getLocaleTextFunc()(s, s)}(${t})`;
    }
    return t;
  }
}, xU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "pivotResultColsService";
  }
  wireBeans(e) {
    this.context = e.context, this.columnModel = e.columnModel, this.columnFactory = e.columnFactory, this.visibleColsService = e.visibleColsService;
  }
  destroy() {
    var e;
    Qd(this.context, (e = this.pivotResultCols) == null ? void 0 : e.tree), super.destroy();
  }
  isPivotResultColsPresent() {
    return this.pivotResultCols != null;
  }
  lookupPivotResultCol(e, t) {
    if (this.pivotResultCols == null)
      return null;
    const r = this.columnModel.getColDefCol(t);
    let n = null;
    return this.pivotResultCols.list.forEach((a) => {
      const u = a.getColDef().pivotKeys, s = a.getColDef().pivotValueColumn;
      cf(u, e) && s === r && (n = a);
    }), n;
  }
  getPivotResultCols() {
    return this.pivotResultCols;
  }
  getPivotResultCol(e) {
    return this.pivotResultCols ? this.columnModel.getColFromCollection(e, this.pivotResultCols) : null;
  }
  setPivotResultCols(e, t) {
    var r, n;
    if (this.columnModel.isReady() && !(e == null && this.pivotResultCols == null)) {
      if (e) {
        this.processPivotResultColDef(e);
        const a = this.columnFactory.createColumnTree(
          e,
          !1,
          ((r = this.pivotResultCols) == null ? void 0 : r.tree) || this.previousPivotResultCols || void 0,
          t
        );
        Qd(this.context, (n = this.pivotResultCols) == null ? void 0 : n.tree, a.columnTree);
        const u = a.columnTree, s = a.treeDept, c = N2(u), i = {};
        this.pivotResultCols = { tree: u, treeDepth: s, list: c, map: i }, this.pivotResultCols.list.forEach((v) => this.pivotResultCols.map[v.getId()] = v);
        const l = !!this.previousPivotResultCols;
        this.previousPivotResultCols = null, this.columnModel.refreshCols(!l);
      } else
        this.previousPivotResultCols = this.pivotResultCols ? this.pivotResultCols.tree : null, this.pivotResultCols = null, this.columnModel.refreshCols(!1);
      this.visibleColsService.refresh(t);
    }
  }
  processPivotResultColDef(e) {
    const t = this.gos.get("processPivotResultColDef"), r = this.gos.get("processPivotResultColGroupDef");
    if (!t && !r)
      return;
    const n = (a) => {
      a.forEach((u) => {
        if ($r(u.children)) {
          const c = u;
          r && r(c), n(c.children);
        } else
          t && t(u);
      });
    };
    e && n(e);
  }
}, TU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnSizeService";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.columnViewportService = e.columnViewportService, this.eventDispatcher = e.columnEventDispatcher, this.visibleColsService = e.visibleColsService, this.ctrlsService = e.ctrlsService;
  }
  setColumnWidths(e, t, r, n) {
    const a = [];
    e.forEach((u) => {
      const s = this.columnModel.getColDefCol(u.key) || this.columnModel.getCol(u.key);
      if (!s)
        return;
      if (a.push({
        width: u.newWidth,
        ratios: [1],
        columns: [s]
      }), this.gos.get("colResizeDefault") === "shift" && (t = !t), t) {
        const i = this.visibleColsService.getColAfter(s);
        if (!i)
          return;
        const l = s.getActualWidth() - u.newWidth, v = i.getActualWidth() + l;
        a.push({
          width: v,
          ratios: [1],
          columns: [i]
        });
      }
    }), a.length !== 0 && this.resizeColumnSets({
      resizeSets: a,
      finished: r,
      source: n
    });
  }
  // method takes sets of columns and resizes them. either all sets will be resized, or nothing
  // be resized. this is used for example when user tries to resize a group and holds shift key,
  // then both the current group (grows), and the adjacent group (shrinks), will get resized,
  // so that's two sets for this method.
  resizeColumnSets(e) {
    const { resizeSets: t, finished: r, source: n } = e;
    if (!(!t || t.every((v) => this.checkMinAndMaxWidthsForSet(v)))) {
      if (r) {
        const v = t && t.length > 0 ? t[0].columns : null;
        this.eventDispatcher.columnResized(v, r, n);
      }
      return;
    }
    const u = [], s = [];
    t.forEach((v) => {
      const { width: f, columns: p, ratios: g } = v, y = {}, C = {};
      p.forEach((w) => s.push(w));
      let m = !0, h = 0;
      for (; m; ) {
        if (h++, h > 1e3) {
          Ni("infinite loop in resizeColumnSets");
          break;
        }
        m = !1;
        const w = [];
        let S = 0, E = f;
        p.forEach((T, F) => {
          if (C[T.getId()])
            E -= y[T.getId()];
          else {
            w.push(T);
            const k = g[F];
            S += k;
          }
        });
        const x = 1 / S;
        w.forEach((T, F) => {
          const P = F === w.length - 1;
          let k;
          P ? k = E : (k = Math.round(g[F] * f * x), E -= k);
          const I = T.getMinWidth(), L = T.getMaxWidth();
          k < I ? (k = I, C[T.getId()] = !0, m = !0) : L > 0 && k > L && (k = L, C[T.getId()] = !0, m = !0), y[T.getId()] = k;
        });
      }
      p.forEach((w) => {
        const S = y[w.getId()];
        w.getActualWidth() !== S && (w.setActualWidth(S, n), u.push(w));
      });
    });
    const c = u.length > 0;
    let i = [];
    c && (i = this.refreshFlexedColumns({ resizingCols: s, skipSetLeft: !0 }), this.visibleColsService.setLeftValues(n), this.visibleColsService.updateBodyWidths(), this.columnViewportService.checkViewportColumns());
    const l = s.concat(i);
    (c || r) && this.eventDispatcher.columnResized(l, r, n, i);
  }
  checkMinAndMaxWidthsForSet(e) {
    const { columns: t, width: r } = e;
    let n = 0, a = 0, u = !0;
    t.forEach((i) => {
      const l = i.getMinWidth();
      n += l || 0;
      const v = i.getMaxWidth();
      v > 0 ? a += v : u = !1;
    });
    const s = r >= n, c = !u || r <= a;
    return s && c;
  }
  refreshFlexedColumns(e = {}) {
    const t = e.source ? e.source : "flex";
    if (e.viewportWidth != null && (this.flexViewportWidth = e.viewportWidth), !this.flexViewportWidth)
      return [];
    const r = this.visibleColsService.getCenterCols();
    let n = -1;
    if (e.resizingCols) {
      const p = new Set(e.resizingCols);
      for (let g = r.length - 1; g >= 0; g--)
        if (p.has(r[g])) {
          n = g;
          break;
        }
    }
    let a = 0, u = [], s = 0, c = 0;
    for (let p = 0; p < r.length; p++)
      r[p].getFlex() && p > n ? (u.push(r[p]), c += r[p].getFlex(), s += r[p].getMinWidth()) : a += r[p].getActualWidth();
    if (!u.length)
      return [];
    let i = [];
    a + s > this.flexViewportWidth && (u.forEach((p) => p.setActualWidth(p.getMinWidth(), t)), i = u, u = []);
    const l = [];
    let v;
    e:
      for (; ; ) {
        v = this.flexViewportWidth - a;
        const p = v / c;
        for (let g = 0; g < u.length; g++) {
          const y = u[g], C = p * y.getFlex();
          let m = 0;
          const h = y.getMinWidth(), w = y.getMaxWidth();
          if (C < h ? m = h : C > w && (m = w), m) {
            y.setActualWidth(m, t), OL(u, y), c -= y.getFlex(), i.push(y), a += y.getActualWidth();
            continue e;
          }
          l[g] = Math.floor(C);
        }
        break;
      }
    let f = v;
    return u.forEach((p, g) => {
      const y = g < u.length - 1 ? Math.min(l[g], f) : (
        // ensure flex columns fill available width by growing the last column to fit available space if there is more available
        Math.max(l[g], f)
      );
      p.setActualWidth(y, t), i.push(p), f -= l[g];
    }), e.skipSetLeft || this.visibleColsService.setLeftValues(t), e.updateBodyWidths && this.visibleColsService.updateBodyWidths(), e.fireResizedEvent && this.eventDispatcher.columnResized(i, !0, t, u), u;
  }
  // called from api
  sizeColumnsToFit(e, t = "sizeColumnsToFit", r, n) {
    var p;
    if (this.columnModel.isShouldQueueResizeOperations()) {
      this.columnModel.pushResizeOperation(() => this.sizeColumnsToFit(e, t, r, n));
      return;
    }
    const a = {};
    n && ((p = n == null ? void 0 : n.columnLimits) == null || p.forEach(({ key: g, ...y }) => {
      a[typeof g == "string" ? g : g.getColId()] = y;
    }));
    const u = this.visibleColsService.getAllCols(), s = e === jc(u);
    if (e <= 0 || !u.length || s)
      return;
    const c = [], i = [];
    u.forEach((g) => {
      g.getColDef().suppressSizeToFit === !0 ? i.push(g) : c.push(g);
    });
    const l = c.slice(0);
    let v = !1;
    const f = (g) => {
      bs(c, g), i.push(g);
    };
    for (c.forEach((g) => {
      g.resetActualWidth(t);
      const y = a == null ? void 0 : a[g.getId()], C = (y == null ? void 0 : y.minWidth) ?? (n == null ? void 0 : n.defaultMinWidth), m = (y == null ? void 0 : y.maxWidth) ?? (n == null ? void 0 : n.defaultMaxWidth), h = g.getActualWidth();
      typeof C == "number" && h < C ? g.setActualWidth(C, t, !0) : typeof m == "number" && h > m && g.setActualWidth(m, t, !0);
    }); !v; ) {
      v = !0;
      const g = e - jc(i);
      if (g <= 0)
        c.forEach((y) => {
          var m;
          const C = ((m = a == null ? void 0 : a[y.getId()]) == null ? void 0 : m.minWidth) ?? (n == null ? void 0 : n.defaultMinWidth);
          if (typeof C == "number") {
            y.setActualWidth(C, t, !0);
            return;
          }
          y.setMinimum(t);
        });
      else {
        const y = g / jc(c);
        let C = g;
        for (let m = c.length - 1; m >= 0; m--) {
          const h = c[m], w = a == null ? void 0 : a[h.getId()], S = (w == null ? void 0 : w.minWidth) ?? (n == null ? void 0 : n.defaultMinWidth), E = (w == null ? void 0 : w.maxWidth) ?? (n == null ? void 0 : n.defaultMaxWidth), x = h.getMinWidth(), T = h.getMaxWidth(), F = typeof S == "number" && S > x ? S : x, P = typeof E == "number" && E < T ? E : T;
          let k = Math.round(h.getActualWidth() * y);
          k < F ? (k = F, f(h), v = !1) : k > P ? (k = P, f(h), v = !1) : m === 0 && (k = C), h.setActualWidth(k, t, !0), C -= k;
        }
      }
    }
    l.forEach((g) => {
      g.fireColumnWidthChangedEvent(t);
    }), this.visibleColsService.setLeftValues(t), this.visibleColsService.updateBodyWidths(), !r && this.eventDispatcher.columnResized(l, !0, t);
  }
  applyAutosizeStrategy() {
    const e = this.gos.get("autoSizeStrategy");
    if (!e)
      return;
    const { type: t } = e;
    setTimeout(() => {
      if (t === "fitGridWidth") {
        const { columnLimits: r, defaultMinWidth: n, defaultMaxWidth: a } = e, u = r == null ? void 0 : r.map(({ colId: s, minWidth: c, maxWidth: i }) => ({
          key: s,
          minWidth: c,
          maxWidth: i
        }));
        this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({
          defaultMinWidth: n,
          defaultMaxWidth: a,
          columnLimits: u
        });
      } else t === "fitProvidedWidth" && this.sizeColumnsToFit(e.width, "sizeColumnsToFit");
    });
  }
};
function WL(e, t) {
  return e + "_" + t;
}
function Ba(e) {
  return e instanceof _L;
}
var _L = class extends mr {
  constructor(e, t, r, n) {
    super(), this.isColumn = !1, this.displayedChildren = [], this.autoHeaderHeight = null, this.parent = null, this.groupId = t, this.partId = r, this.providedColumnGroup = e, this.pinned = n;
  }
  // as the user is adding and removing columns, the groups are recalculated.
  // this reset clears out all children, ready for children to be added again
  reset() {
    this.parent = null, this.children = null, this.displayedChildren = null;
  }
  getParent() {
    return this.parent;
  }
  setParent(e) {
    this.parent = e;
  }
  getUniqueId() {
    return WL(this.groupId, this.partId);
  }
  isEmptyGroup() {
    return this.displayedChildren.length === 0;
  }
  isMoving() {
    const e = this.getProvidedColumnGroup().getLeafColumns();
    return !e || e.length === 0 ? !1 : e.every((t) => t.isMoving());
  }
  checkLeft() {
    if (this.displayedChildren.forEach((e) => {
      Ba(e) && e.checkLeft();
    }), this.displayedChildren.length > 0)
      if (this.gos.get("enableRtl")) {
        const t = di(this.displayedChildren).getLeft();
        this.setLeft(t);
      } else {
        const e = this.displayedChildren[0].getLeft();
        this.setLeft(e);
      }
    else
      this.setLeft(null);
  }
  getLeft() {
    return this.left;
  }
  getOldLeft() {
    return this.oldLeft;
  }
  setLeft(e) {
    this.oldLeft = this.left, this.left !== e && (this.left = e, this.dispatchLocalEvent({ type: "leftChanged" }));
  }
  getPinned() {
    return this.pinned;
  }
  getGroupId() {
    return this.groupId;
  }
  getPartId() {
    return this.partId;
  }
  getActualWidth() {
    let e = 0;
    return this.displayedChildren && this.displayedChildren.forEach((t) => {
      e += t.getActualWidth();
    }), e;
  }
  isResizable() {
    if (!this.displayedChildren)
      return !1;
    let e = !1;
    return this.displayedChildren.forEach((t) => {
      t.isResizable() && (e = !0);
    }), e;
  }
  getMinWidth() {
    let e = 0;
    return this.displayedChildren.forEach((t) => {
      e += t.getMinWidth();
    }), e;
  }
  addChild(e) {
    this.children || (this.children = []), this.children.push(e);
  }
  getDisplayedChildren() {
    return this.displayedChildren;
  }
  getLeafColumns() {
    const e = [];
    return this.addLeafColumns(e), e;
  }
  getDisplayedLeafColumns() {
    const e = [];
    return this.addDisplayedLeafColumns(e), e;
  }
  getDefinition() {
    return this.providedColumnGroup.getColGroupDef();
  }
  getColGroupDef() {
    return this.providedColumnGroup.getColGroupDef();
  }
  isPadding() {
    return this.providedColumnGroup.isPadding();
  }
  isExpandable() {
    return this.providedColumnGroup.isExpandable();
  }
  isExpanded() {
    return this.providedColumnGroup.isExpanded();
  }
  setExpanded(e) {
    this.providedColumnGroup.setExpanded(e);
  }
  isAutoHeaderHeight() {
    var e;
    return !!((e = this.getColGroupDef()) != null && e.autoHeaderHeight);
  }
  getAutoHeaderHeight() {
    return this.autoHeaderHeight;
  }
  /** Returns true if the header height has changed */
  setAutoHeaderHeight(e) {
    const t = e !== this.autoHeaderHeight;
    return this.autoHeaderHeight = e, t;
  }
  addDisplayedLeafColumns(e) {
    this.displayedChildren.forEach((t) => {
      of(t) ? e.push(t) : Ba(t) && t.addDisplayedLeafColumns(e);
    });
  }
  addLeafColumns(e) {
    this.children.forEach((t) => {
      of(t) ? e.push(t) : Ba(t) && t.addLeafColumns(e);
    });
  }
  getChildren() {
    return this.children;
  }
  getColumnGroupShow() {
    return this.providedColumnGroup.getColumnGroupShow();
  }
  getProvidedColumnGroup() {
    return this.providedColumnGroup;
  }
  getPaddingLevel() {
    const e = this.getParent();
    return !this.isPadding() || !e || !e.isPadding() ? 0 : 1 + e.getPaddingLevel();
  }
  calculateDisplayedColumns() {
    this.displayedChildren = [];
    let e = this;
    for (; e != null && e.isPadding(); )
      e = e.getParent();
    if (!(e ? e.getProvidedColumnGroup().isExpandable() : !1)) {
      this.displayedChildren = this.children, this.dispatchLocalEvent({ type: "displayedChildrenChanged" });
      return;
    }
    this.children.forEach((r) => {
      if (Ba(r) && (!r.displayedChildren || !r.displayedChildren.length))
        return;
      switch (r.getColumnGroupShow()) {
        case "open":
          e.getProvidedColumnGroup().isExpanded() && this.displayedChildren.push(r);
          break;
        case "closed":
          e.getProvidedColumnGroup().isExpanded() || this.displayedChildren.push(r);
          break;
        default:
          this.displayedChildren.push(r);
          break;
      }
    }), this.dispatchLocalEvent({ type: "displayedChildrenChanged" });
  }
}, UL = class {
  constructor() {
    this.existingIds = {};
  }
  getInstanceIdForKey(e) {
    const t = this.existingIds[e];
    let r;
    return typeof t != "number" ? r = 0 : r = t + 1, this.existingIds[e] = r, r;
  }
}, RU = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "visibleColsService", this.colsAndGroupsMap = {}, this.columnsLeft = [], this.columnsRight = [], this.columnsCenter = [], this.columns = [], this.bodyWidth = 0, this.leftWidth = 0, this.rightWidth = 0, this.bodyWidthDirty = !0;
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.columnSizeService = e.columnSizeService, this.columnViewportService = e.columnViewportService, this.eventDispatcher = e.columnEventDispatcher;
  }
  refresh(e, t = !1) {
    t || this.buildTrees(), this.updateOpenClosedVisibilityInColumnGroups(), this.columnsLeft = yx(this.treeLeft), this.columnsCenter = yx(this.treeCenter), this.columnsRight = yx(this.treeRight), this.joinColsAriaOrder(), this.joinCols(), this.setLeftValues(e), this.autoHeightCols = this.columns.filter((r) => r.isAutoHeight()), this.columnSizeService.refreshFlexedColumns(), this.updateBodyWidths(), this.columnViewportService.checkViewportColumns(!1), this.setFirstRightAndLastLeftPinned(e), this.eventDispatcher.visibleCols(e);
  }
  // after setColumnWidth or updateGroupsAndPresentedCols
  updateBodyWidths() {
    const e = jc(this.columnsCenter), t = jc(this.columnsLeft), r = jc(this.columnsRight);
    this.bodyWidthDirty = this.bodyWidth !== e, (this.bodyWidth !== e || this.leftWidth !== t || this.rightWidth !== r) && (this.bodyWidth = e, this.leftWidth = t, this.rightWidth = r, this.eventService.dispatchEvent({
      type: "columnContainerWidthChanged"
    }), this.eventService.dispatchEvent({
      type: "displayedColumnsWidthChanged"
    }));
  }
  // sets the left pixel position of each column
  setLeftValues(e) {
    this.setLeftValuesOfCols(e), this.setLeftValuesOfGroups();
  }
  setFirstRightAndLastLeftPinned(e) {
    let t, r;
    this.gos.get("enableRtl") ? (t = this.columnsLeft ? this.columnsLeft[0] : null, r = this.columnsRight ? di(this.columnsRight) : null) : (t = this.columnsLeft ? di(this.columnsLeft) : null, r = this.columnsRight ? this.columnsRight[0] : null), this.columnModel.getCols().forEach((n) => {
      n.setLastLeftPinned(n === t, e), n.setFirstRightPinned(n === r, e);
    });
  }
  buildTrees() {
    const e = this.columnModel.getColsToShow(), t = e.filter((u) => u.getPinned() == "left"), r = e.filter((u) => u.getPinned() == "right"), n = e.filter((u) => u.getPinned() != "left" && u.getPinned() != "right"), a = new UL();
    this.treeLeft = this.createGroups({
      columns: t,
      idCreator: a,
      pinned: "left",
      oldDisplayedGroups: this.treeLeft
    }), this.treeRight = this.createGroups({
      columns: r,
      idCreator: a,
      pinned: "right",
      oldDisplayedGroups: this.treeRight
    }), this.treeCenter = this.createGroups({
      columns: n,
      idCreator: a,
      pinned: null,
      oldDisplayedGroups: this.treeCenter
    }), this.updateColsAndGroupsMap();
  }
  clear() {
    this.columnsLeft = [], this.columnsRight = [], this.columnsCenter = [], this.columns = [], this.ariaOrderColumns = [];
  }
  joinColsAriaOrder() {
    const e = this.columnModel.getCols(), t = [], r = [], n = [];
    for (const a of e) {
      const u = a.getPinned();
      u ? u === !0 || u === "left" ? t.push(a) : n.push(a) : r.push(a);
    }
    this.ariaOrderColumns = t.concat(r).concat(n);
  }
  getAriaColIndex(e) {
    let t;
    return Ba(e) ? t = e.getLeafColumns()[0] : t = e, this.ariaOrderColumns.indexOf(t) + 1;
  }
  getAllAutoHeightCols() {
    return this.autoHeightCols;
  }
  setLeftValuesOfGroups() {
    [this.treeLeft, this.treeRight, this.treeCenter].forEach((e) => {
      e.forEach((t) => {
        Ba(t) && t.checkLeft();
      });
    });
  }
  setLeftValuesOfCols(e) {
    if (!this.columnModel.getColDefCols())
      return;
    const r = this.columnModel.getCols().slice(0), n = this.gos.get("enableRtl");
    [this.columnsLeft, this.columnsRight, this.columnsCenter].forEach((a) => {
      if (n) {
        let u = jc(a);
        a.forEach((s) => {
          u -= s.getActualWidth(), s.setLeft(u, e);
        });
      } else {
        let u = 0;
        a.forEach((s) => {
          s.setLeft(u, e), u += s.getActualWidth();
        });
      }
      q_(r, a);
    }), r.forEach((a) => {
      a.setLeft(null, e);
    });
  }
  joinCols() {
    this.gos.get("enableRtl") ? this.columns = this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft) : this.columns = this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight);
  }
  getColsCenter() {
    return this.columnsCenter;
  }
  getAllTrees() {
    return this.treeLeft && this.treeRight && this.treeCenter ? this.treeLeft.concat(this.treeCenter).concat(this.treeRight) : null;
  }
  // + headerRenderer -> setting pinned body width
  getTreeLeft() {
    return this.treeLeft;
  }
  // + headerRenderer -> setting pinned body width
  getTreeRight() {
    return this.treeRight;
  }
  // + headerRenderer -> setting pinned body width
  getTreeCenter() {
    return this.treeCenter;
  }
  // + csvCreator
  getAllCols() {
    return this.columns;
  }
  // gridPanel -> ensureColumnVisible
  isColDisplayed(e) {
    return this.getAllCols().indexOf(e) >= 0;
  }
  getLeftColsForRow(e) {
    return this.columnModel.isColSpanActive() ? this.getColsForRow(e, this.columnsLeft) : this.columnsLeft;
  }
  getRightColsForRow(e) {
    return this.columnModel.isColSpanActive() ? this.getColsForRow(e, this.columnsRight) : this.columnsRight;
  }
  getColsForRow(e, t, r, n) {
    const a = [];
    let u = null;
    for (let s = 0; s < t.length; s++) {
      const c = t[s], i = t.length - s, l = Math.min(c.getColSpan(e), i), v = [c];
      if (l > 1) {
        const p = l - 1;
        for (let g = 1; g <= p; g++)
          v.push(t[s + g]);
        s += p;
      }
      let f;
      r ? (f = !1, v.forEach((p) => {
        r(p) && (f = !0);
      })) : f = !0, f && (a.length === 0 && u && (n && n(c)) && a.push(u), a.push(c)), u = c;
    }
    return a;
  }
  // used by:
  // + angularGrid -> for setting body width
  // + rowController -> setting main row widths (when inserting and resizing)
  // need to cache this
  getBodyContainerWidth() {
    return this.bodyWidth;
  }
  getContainerWidth(e) {
    switch (e) {
      case "left":
        return this.leftWidth;
      case "right":
        return this.rightWidth;
      default:
        return this.bodyWidth;
    }
  }
  // + rowController -> while inserting rows
  getCenterCols() {
    return this.columnsCenter;
  }
  // + rowController -> while inserting rows
  getLeftCols() {
    return this.columnsLeft;
  }
  getRightCols() {
    return this.columnsRight;
  }
  getColBefore(e) {
    const t = this.getAllCols(), r = t.indexOf(e);
    return r > 0 ? t[r - 1] : null;
  }
  getGroupAtDirection(e, t) {
    const r = e.getProvidedColumnGroup().getLevel() + e.getPaddingLevel(), n = e.getDisplayedLeafColumns(), a = t === "After" ? di(n) : n[0], u = `getCol${t}`;
    for (; ; ) {
      const s = this[u](a);
      if (!s)
        return null;
      const c = this.getColGroupAtLevel(s, r);
      if (c !== e)
        return c;
    }
  }
  getColGroupAtLevel(e, t) {
    let r = e.getParent(), n, a;
    for (; n = r.getProvidedColumnGroup().getLevel(), a = r.getPaddingLevel(), !(n + a <= t); )
      r = r.getParent();
    return r;
  }
  isPinningLeft() {
    return this.columnsLeft.length > 0;
  }
  isPinningRight() {
    return this.columnsRight.length > 0;
  }
  updateColsAndGroupsMap() {
    this.colsAndGroupsMap = {};
    const e = (t) => {
      this.colsAndGroupsMap[t.getUniqueId()] = t;
    };
    Eh(this.treeCenter, !1, e), Eh(this.treeLeft, !1, e), Eh(this.treeRight, !1, e);
  }
  isVisible(e) {
    return this.colsAndGroupsMap[e.getUniqueId()] === e;
  }
  updateOpenClosedVisibilityInColumnGroups() {
    const e = this.getAllTrees();
    Eh(e, !1, (t) => {
      Ba(t) && t.calculateDisplayedColumns();
    });
  }
  getFirstColumn() {
    const e = this.gos.get("enableRtl"), t = [
      "getLeftCols",
      "getCenterCols",
      "getRightCols"
    ];
    e && t.reverse();
    for (let r = 0; r < t.length; r++) {
      const n = this[t[r]]();
      if (n.length)
        return e ? di(n) : n[0];
    }
    return null;
  }
  // returns the group with matching colId and instanceId. If instanceId is missing,
  // matches only on the colId.
  getColumnGroup(e, t) {
    if (!e)
      return null;
    if (Ba(e))
      return e;
    const r = this.getAllTrees(), n = typeof t == "number";
    let a = null;
    return Eh(r, !1, (u) => {
      if (Ba(u)) {
        const s = u;
        let c;
        n ? c = e === s.getGroupId() && t === s.getPartId() : c = e === s.getGroupId(), c && (a = s);
      }
    }), a;
  }
  // used by:
  // + rowRenderer -> for navigation
  getColAfter(e) {
    const t = this.getAllCols(), r = t.indexOf(e);
    return r < t.length - 1 ? t[r + 1] : null;
  }
  isBodyWidthDirty() {
    return this.bodyWidthDirty;
  }
  setBodyWidthDirty() {
    this.bodyWidthDirty = !0;
  }
  // used by:
  // + angularGrid -> setting pinned body width
  // note: this should be cached
  getColsLeftWidth() {
    return jc(this.columnsLeft);
  }
  // note: this should be cached
  getDisplayedColumnsRightWidth() {
    return jc(this.columnsRight);
  }
  isColAtEdge(e, t) {
    const r = this.getAllCols();
    if (!r.length)
      return !1;
    const n = t === "first";
    let a;
    if (Ba(e)) {
      const u = e.getDisplayedLeafColumns();
      if (!u.length)
        return !1;
      a = n ? u[0] : di(u);
    } else
      a = e;
    return (n ? r[0] : di(r)) === a;
  }
  createGroups(e) {
    const { columns: t, idCreator: r, pinned: n, oldDisplayedGroups: a, isStandaloneStructure: u } = e, s = this.mapOldGroupsById(a), c = [];
    let i = t;
    for (; i.length; ) {
      const l = i;
      i = [];
      let v = 0;
      const f = (p) => {
        const g = v;
        v = p;
        const y = l[g], m = (Ba(y) ? y.getProvidedColumnGroup() : y).getOriginalParent();
        if (m == null) {
          for (let w = g; w < p; w++)
            c.push(l[w]);
          return;
        }
        const h = this.createColGroup(
          m,
          r,
          s,
          n,
          u
        );
        for (let w = g; w < p; w++)
          h.addChild(l[w]);
        i.push(h);
      };
      for (let p = 1; p < l.length; p++) {
        const g = l[p], C = (Ba(g) ? g.getProvidedColumnGroup() : g).getOriginalParent(), m = l[v], w = (Ba(m) ? m.getProvidedColumnGroup() : m).getOriginalParent();
        C !== w && f(p);
      }
      v < l.length && f(l.length);
    }
    return u || this.setupParentsIntoCols(c, null), c;
  }
  createColGroup(e, t, r, n, a) {
    const u = e.getGroupId(), s = t.getInstanceIdForKey(u), c = WL(u, s);
    let i = r[c];
    return i && i.getProvidedColumnGroup() !== e && (i = null), $r(i) ? i.reset() : (i = new _L(e, u, s, n), a || this.createBean(i)), i;
  }
  // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup
  mapOldGroupsById(e) {
    const t = {}, r = (n) => {
      n.forEach((a) => {
        if (Ba(a)) {
          const u = a;
          t[a.getUniqueId()] = u, r(u.getChildren());
        }
      });
    };
    return e && r(e), t;
  }
  setupParentsIntoCols(e, t) {
    e.forEach((r) => {
      if (r.setParent(t), Ba(r)) {
        const n = r;
        this.setupParentsIntoCols(n.getChildren(), n);
      }
    });
  }
};
function Eh(e, t, r) {
  if (e)
    for (let n = 0; n < e.length; n++) {
      const a = e[n];
      if (Ba(a)) {
        const u = t ? a.getDisplayedChildren() : a.getChildren();
        Eh(u, t, r);
      }
      r(a);
    }
}
function yx(e) {
  const t = [];
  return Eh(e, !0, (r) => {
    of(r) && t.push(r);
  }), t;
}
var jL = [
  "columnEverythingChanged",
  "newColumnsLoaded",
  "columnPivotModeChanged",
  "pivotMaxColumnsExceeded",
  "columnRowGroupChanged",
  "expandOrCollapseAll",
  "columnPivotChanged",
  "gridColumnsChanged",
  "columnValueChanged",
  "columnMoved",
  "columnVisible",
  "columnPinned",
  "columnGroupOpened",
  "columnResized",
  "displayedColumnsChanged",
  "virtualColumnsChanged",
  "columnHeaderMouseOver",
  "columnHeaderMouseLeave",
  "columnHeaderClicked",
  "columnHeaderContextMenu",
  "asyncTransactionsFlushed",
  "rowGroupOpened",
  "rowDataUpdated",
  "pinnedRowDataChanged",
  "rangeSelectionChanged",
  "cellSelectionChanged",
  "chartCreated",
  "chartRangeSelectionChanged",
  "chartOptionsChanged",
  "chartDestroyed",
  "toolPanelVisibleChanged",
  "toolPanelSizeChanged",
  "modelUpdated",
  "cutStart",
  "cutEnd",
  "pasteStart",
  "pasteEnd",
  "fillStart",
  "fillEnd",
  "cellSelectionDeleteStart",
  "cellSelectionDeleteEnd",
  "rangeDeleteStart",
  "rangeDeleteEnd",
  "undoStarted",
  "undoEnded",
  "redoStarted",
  "redoEnded",
  "cellClicked",
  "cellDoubleClicked",
  "cellMouseDown",
  "cellContextMenu",
  "cellValueChanged",
  "cellEditRequest",
  "rowValueChanged",
  "headerFocused",
  "cellFocused",
  "rowSelected",
  "selectionChanged",
  "tooltipShow",
  "tooltipHide",
  "cellKeyDown",
  "cellMouseOver",
  "cellMouseOut",
  "filterChanged",
  "filterModified",
  "filterOpened",
  "advancedFilterBuilderVisibleChanged",
  "sortChanged",
  "virtualRowRemoved",
  "rowClicked",
  "rowDoubleClicked",
  "gridReady",
  "gridPreDestroyed",
  "gridSizeChanged",
  "viewportChanged",
  "firstDataRendered",
  "dragStarted",
  "dragStopped",
  "dragCancelled",
  "rowEditingStarted",
  "rowEditingStopped",
  "cellEditingStarted",
  "cellEditingStopped",
  "bodyScroll",
  "bodyScrollEnd",
  "paginationChanged",
  "componentStateChanged",
  "storeRefreshed",
  "stateUpdated",
  "columnMenuVisibleChanged",
  "contextMenuVisibleChanged",
  "rowDragEnter",
  "rowDragMove",
  "rowDragLeave",
  "rowDragEnd",
  "rowDragCancel"
], AU = [
  "scrollbarWidthChanged",
  "keyShortcutChangedCellStart",
  "keyShortcutChangedCellEnd",
  "pinnedHeightChanged",
  "cellFocusCleared",
  "fullWidthRowFocused",
  "checkboxChanged",
  "heightScaleChanged",
  "suppressMovableColumns",
  "suppressMenuHide",
  "suppressFieldDotNotation",
  "columnPanelItemDragStart",
  "columnPanelItemDragEnd",
  "bodyHeightChanged",
  "columnContainerWidthChanged",
  "displayedColumnsWidthChanged",
  "scrollVisibilityChanged",
  "scrollGapChanged",
  "columnHoverChanged",
  "flashCells",
  "paginationPixelOffsetChanged",
  "displayedRowsChanged",
  "leftPinnedWidthChanged",
  "rightPinnedWidthChanged",
  "rowContainerHeightChanged",
  "headerHeightChanged",
  "columnGroupHeaderHeightChanged",
  "columnHeaderHeightChanged",
  "gridStylesChanged",
  "storeUpdated",
  "filterDestroyed",
  "rowDataUpdateStarted",
  "rowCountReady",
  "advancedFilterEnabledChanged",
  "dataTypesInferred",
  "fieldValueChanged",
  "fieldPickerValueSelected",
  "richSelectListRowSelected",
  "sideBarUpdated",
  "alignedGridScroll",
  "alignedGridColumn",
  "gridOptionsChanged",
  "chartTitleEdit",
  "recalculateRowBounds",
  "stickyTopOffsetChanged",
  "overlayExclusiveChanged"
], EU = [...jL, ...AU], MU = {
  enableBrowserTooltips: !0,
  tooltipTrigger: !0,
  tooltipMouseTrack: !0,
  tooltipShowMode: !0,
  tooltipInteraction: !0,
  defaultColGroupDef: !0,
  suppressAutoSize: !0,
  skipHeaderOnAutoSize: !0,
  autoSizeStrategy: !0,
  components: !0,
  stopEditingWhenCellsLoseFocus: !0,
  undoRedoCellEditing: !0,
  undoRedoCellEditingLimit: !0,
  excelStyles: !0,
  cacheQuickFilter: !0,
  advancedFilterModel: !0,
  customChartThemes: !0,
  chartThemeOverrides: !0,
  chartToolPanelsDef: !0,
  loadingCellRendererSelector: !0,
  localeText: !0,
  keepDetailRows: !0,
  keepDetailRowsCount: !0,
  detailRowHeight: !0,
  detailRowAutoHeight: !0,
  tabIndex: !0,
  valueCache: !0,
  valueCacheNeverExpires: !0,
  enableCellExpressions: !0,
  suppressTouch: !0,
  suppressAsyncEvents: !0,
  suppressBrowserResizeObserver: !0,
  suppressPropertyNamesCheck: !0,
  debug: !0,
  dragAndDropImageComponent: !0,
  loadingOverlayComponent: !0,
  suppressLoadingOverlay: !0,
  noRowsOverlayComponent: !0,
  paginationPageSizeSelector: !0,
  paginateChildRows: !0,
  pivotPanelShow: !0,
  pivotSuppressAutoColumn: !0,
  suppressExpandablePivotGroups: !0,
  aggFuncs: !0,
  suppressAggFuncInHeader: !0,
  allowShowChangeAfterFilter: !0,
  ensureDomOrder: !0,
  enableRtl: !0,
  suppressColumnVirtualisation: !0,
  suppressMaxRenderedRowRestriction: !0,
  suppressRowVirtualisation: !0,
  rowDragText: !0,
  suppressGroupMaintainValueType: !0,
  groupLockGroupColumns: !0,
  rowGroupPanelSuppressSort: !0,
  suppressGroupRowsSticky: !0,
  rowModelType: !0,
  cacheOverflowSize: !0,
  infiniteInitialRowCount: !0,
  serverSideInitialRowCount: !0,
  suppressServerSideInfiniteScroll: !0,
  maxBlocksInCache: !0,
  maxConcurrentDatasourceRequests: !0,
  blockLoadDebounceMillis: !0,
  serverSideOnlyRefreshFilteredGroups: !0,
  serverSidePivotResultFieldSeparator: !0,
  viewportRowModelPageSize: !0,
  viewportRowModelBufferSize: !0,
  debounceVerticalScrollbar: !0,
  suppressAnimationFrame: !0,
  suppressPreventDefaultOnMouseWheel: !0,
  scrollbarWidth: !0,
  icons: !0,
  suppressRowTransform: !0,
  gridId: !0,
  enableGroupEdit: !0,
  initialState: !0,
  processUnpinnedColumns: !0,
  createChartContainer: !0,
  getLocaleText: !0,
  getRowId: !0,
  reactiveCustomComponents: !0,
  columnMenu: !0,
  suppressSetFilterByDefault: !0
}, zo = class {
};
zo.STRING_PROPERTIES = [
  "overlayLoadingTemplate",
  "overlayNoRowsTemplate",
  "gridId",
  "quickFilterText",
  "rowModelType",
  "editType",
  "domLayout",
  "clipboardDelimiter",
  "rowGroupPanelShow",
  "multiSortKey",
  "pivotColumnGroupTotals",
  "pivotRowTotals",
  "pivotPanelShow",
  "fillHandleDirection",
  "groupDisplayType",
  "treeDataDisplayType",
  "colResizeDefault",
  "tooltipTrigger",
  "serverSidePivotResultFieldSeparator",
  "columnMenu",
  "tooltipShowMode",
  "grandTotalRow"
];
zo.OBJECT_PROPERTIES = [
  "components",
  "rowStyle",
  "context",
  "autoGroupColumnDef",
  "localeText",
  "icons",
  "datasource",
  "dragAndDropImageComponentParams",
  "serverSideDatasource",
  "viewportDatasource",
  "groupRowRendererParams",
  "aggFuncs",
  "fullWidthCellRendererParams",
  "defaultColGroupDef",
  "defaultColDef",
  "defaultCsvExportParams",
  "defaultExcelExportParams",
  "columnTypes",
  "rowClassRules",
  "detailCellRendererParams",
  "loadingCellRendererParams",
  "loadingOverlayComponentParams",
  "noRowsOverlayComponentParams",
  "popupParent",
  "statusBar",
  "sideBar",
  "theme",
  "chartThemeOverrides",
  "customChartThemes",
  "chartToolPanelsDef",
  "dataTypeDefinitions",
  "advancedFilterModel",
  "advancedFilterParent",
  "advancedFilterBuilderParams",
  "initialState",
  "autoSizeStrategy",
  "cellSelection",
  "selectionColumnDef"
];
zo.ARRAY_PROPERTIES = [
  "sortingOrder",
  "alignedGrids",
  "rowData",
  "columnDefs",
  "excelStyles",
  "pinnedTopRowData",
  "pinnedBottomRowData",
  "chartThemes",
  "rowClass",
  "paginationPageSizeSelector"
];
zo.NUMBER_PROPERTIES = [
  "rowHeight",
  "detailRowHeight",
  "rowBuffer",
  "headerHeight",
  "groupHeaderHeight",
  "groupLockGroupColumns",
  "floatingFiltersHeight",
  "pivotHeaderHeight",
  "pivotGroupHeaderHeight",
  "groupDefaultExpanded",
  "pivotDefaultExpanded",
  "viewportRowModelPageSize",
  "viewportRowModelBufferSize",
  "autoSizePadding",
  "maxBlocksInCache",
  "maxConcurrentDatasourceRequests",
  "tooltipShowDelay",
  "tooltipHideDelay",
  "cacheOverflowSize",
  "paginationPageSize",
  "cacheBlockSize",
  "infiniteInitialRowCount",
  "serverSideInitialRowCount",
  "scrollbarWidth",
  "asyncTransactionWaitMillis",
  "blockLoadDebounceMillis",
  "keepDetailRowsCount",
  "undoRedoCellEditingLimit",
  "cellFlashDelay",
  "cellFadeDelay",
  "cellFlashDuration",
  "cellFadeDuration",
  "tabIndex",
  "pivotMaxGeneratedColumns"
];
zo.BOOLEAN_PROPERTIES = [
  "suppressMakeColumnVisibleAfterUnGroup",
  "suppressRowClickSelection",
  "suppressCellFocus",
  "suppressHeaderFocus",
  "suppressHorizontalScroll",
  "groupSelectsChildren",
  "alwaysShowHorizontalScroll",
  "alwaysShowVerticalScroll",
  "debug",
  "enableBrowserTooltips",
  "enableCellExpressions",
  "groupIncludeTotalFooter",
  "groupSuppressBlankHeader",
  "suppressMenuHide",
  "suppressRowDeselection",
  "unSortIcon",
  "suppressMultiSort",
  "alwaysMultiSort",
  "singleClickEdit",
  "suppressLoadingOverlay",
  "suppressNoRowsOverlay",
  "suppressAutoSize",
  "skipHeaderOnAutoSize",
  "suppressColumnMoveAnimation",
  "suppressMoveWhenColumnDragging",
  "suppressMovableColumns",
  "suppressFieldDotNotation",
  "enableRangeSelection",
  "enableRangeHandle",
  "enableFillHandle",
  "suppressClearOnFillReduction",
  "deltaSort",
  "suppressTouch",
  "suppressAsyncEvents",
  "allowContextMenuWithControlKey",
  "suppressContextMenu",
  "enableCellChangeFlash",
  "suppressDragLeaveHidesColumns",
  "suppressRowGroupHidesColumns",
  "suppressMiddleClickScrolls",
  "suppressPreventDefaultOnMouseWheel",
  "suppressCopyRowsToClipboard",
  "copyHeadersToClipboard",
  "copyGroupHeadersToClipboard",
  "pivotMode",
  "suppressAggFuncInHeader",
  "suppressColumnVirtualisation",
  "alwaysAggregateAtRootLevel",
  "suppressFocusAfterRefresh",
  "functionsReadOnly",
  "animateRows",
  "groupSelectsFiltered",
  "groupRemoveSingleChildren",
  "groupRemoveLowestSingleChildren",
  "enableRtl",
  "suppressClickEdit",
  "rowDragEntireRow",
  "rowDragManaged",
  "suppressRowDrag",
  "suppressMoveWhenRowDragging",
  "rowDragMultiRow",
  "enableGroupEdit",
  "embedFullWidthRows",
  "suppressPaginationPanel",
  "groupHideOpenParents",
  "groupAllowUnbalanced",
  "pagination",
  "paginationAutoPageSize",
  "suppressScrollOnNewData",
  "suppressScrollWhenPopupsAreOpen",
  "purgeClosedRowNodes",
  "cacheQuickFilter",
  "includeHiddenColumnsInQuickFilter",
  "ensureDomOrder",
  "accentedSort",
  "suppressChangeDetection",
  "valueCache",
  "valueCacheNeverExpires",
  "aggregateOnlyChangedColumns",
  "suppressAnimationFrame",
  "suppressExcelExport",
  "suppressCsvExport",
  "includeHiddenColumnsInAdvancedFilter",
  "suppressMultiRangeSelection",
  "enterNavigatesVerticallyAfterEdit",
  "enterNavigatesVertically",
  "suppressPropertyNamesCheck",
  "rowMultiSelectWithClick",
  "suppressRowHoverHighlight",
  "suppressRowTransform",
  "suppressClipboardPaste",
  "suppressLastEmptyLineOnPaste",
  "enableCharts",
  "suppressMaintainUnsortedOrder",
  "enableCellTextSelection",
  "suppressBrowserResizeObserver",
  "suppressMaxRenderedRowRestriction",
  "excludeChildrenWhenTreeDataFiltering",
  "tooltipMouseTrack",
  "tooltipInteraction",
  "keepDetailRows",
  "paginateChildRows",
  "preventDefaultOnContextMenu",
  "undoRedoCellEditing",
  "allowDragFromColumnsToolPanel",
  "pivotSuppressAutoColumn",
  "suppressExpandablePivotGroups",
  "debounceVerticalScrollbar",
  "detailRowAutoHeight",
  "serverSideSortAllLevels",
  "serverSideEnableClientSideSort",
  "serverSideOnlyRefreshFilteredGroups",
  "serverSideSortOnServer",
  "serverSideFilterOnServer",
  "suppressAggFilteredOnly",
  "showOpenedGroup",
  "suppressClipboardApi",
  "suppressModelUpdateAfterUpdateTransaction",
  "stopEditingWhenCellsLoseFocus",
  "groupMaintainOrder",
  "columnHoverHighlight",
  "readOnlyEdit",
  "suppressRowVirtualisation",
  "enableCellEditingOnBackspace",
  "resetRowDataOnUpdate",
  "removePivotHeaderRowWhenSingleValueColumn",
  "suppressCopySingleCellRanges",
  "suppressGroupRowsSticky",
  "suppressCutToClipboard",
  "suppressServerSideInfiniteScroll",
  "rowGroupPanelSuppressSort",
  "allowShowChangeAfterFilter",
  "enableAdvancedFilter",
  "masterDetail",
  "treeData",
  "suppressGroupMaintainValueType",
  "reactiveCustomComponents",
  "applyQuickFilterBeforePivotOrAgg",
  "suppressServerSideFullWidthLoadingRow",
  "suppressAdvancedFilterEval",
  "loading",
  "maintainColumnOrder",
  "enableStrictPivotColumnOrder",
  "suppressSetFilterByDefault"
];
zo.OTHER_PROPERTIES = [
  "suppressStickyTotalRow",
  // needs avoid coercion to boolean so that we can warn if it's unset
  "loadThemeGoogleFonts",
  "rowSelection"
];
zo.FUNCTION_PROPERTIES = [
  "doesExternalFilterPass",
  "processPivotResultColDef",
  "processPivotResultColGroupDef",
  "getBusinessKeyForNode",
  "isRowSelectable",
  "rowDragText",
  "groupRowRenderer",
  "dragAndDropImageComponent",
  "fullWidthCellRenderer",
  "loadingCellRenderer",
  "loadingOverlayComponent",
  "noRowsOverlayComponent",
  "detailCellRenderer",
  "quickFilterParser",
  "quickFilterMatcher",
  "getLocaleText",
  "isExternalFilterPresent",
  "getRowHeight",
  "getRowClass",
  "getRowStyle",
  "getContextMenuItems",
  "getMainMenuItems",
  "processRowPostCreate",
  "processCellForClipboard",
  "getGroupRowAgg",
  "isFullWidthRow",
  "sendToClipboard",
  "focusGridInnerElement",
  "navigateToNextHeader",
  "tabToNextHeader",
  "navigateToNextCell",
  "tabToNextCell",
  "processCellFromClipboard",
  "getDocument",
  "postProcessPopup",
  "getChildCount",
  "getDataPath",
  "isRowMaster",
  "postSortRows",
  "processHeaderForClipboard",
  "processUnpinnedColumns",
  "processGroupHeaderForClipboard",
  "paginationNumberFormatter",
  "processDataFromClipboard",
  "getServerSideGroupKey",
  "isServerSideGroup",
  "createChartContainer",
  "getChartToolbarItems",
  "fillOperation",
  "isApplyServerSideTransaction",
  "getServerSideGroupLevelParams",
  "isServerSideGroupOpenByDefault",
  "isGroupOpenByDefault",
  "initialGroupOrderComparator",
  "groupIncludeFooter",
  "loadingCellRendererSelector",
  "getRowId",
  "groupAggFiltering",
  "chartMenuItems",
  "groupTotalRow"
];
zo.ALL_PROPERTIES = [
  ...zo.ARRAY_PROPERTIES,
  ...zo.OBJECT_PROPERTIES,
  ...zo.STRING_PROPERTIES,
  ...zo.NUMBER_PROPERTIES,
  ...zo.FUNCTION_PROPERTIES,
  ...zo.BOOLEAN_PROPERTIES,
  ...zo.OTHER_PROPERTIES
];
var zm = zo, Bl = class {
  static getCallbackForEvent(t) {
    return !t || t.length < 2 ? t : "on" + t[0].toUpperCase() + t.substring(1);
  }
};
Bl.VUE_OMITTED_PROPERTY = "AG-VUE-OMITTED-PROPERTY";
Bl.PUBLIC_EVENTS = jL;
Bl.EVENT_CALLBACKS = EU.map((e) => Bl.getCallbackForEvent(e));
Bl.BOOLEAN_PROPERTIES = zm.BOOLEAN_PROPERTIES;
Bl.ALL_PROPERTIES = zm.ALL_PROPERTIES;
Bl.ALL_PROPERTIES_AND_CALLBACKS = [...Bl.ALL_PROPERTIES, ...Bl.EVENT_CALLBACKS];
Bl.ALL_PROPERTIES_AND_CALLBACKS_SET = new Set(Bl.ALL_PROPERTIES_AND_CALLBACKS);
var Wm = Bl;
function DU(e, t) {
  typeof e != "object" && (e = {});
  const r = { ...e };
  return Wm.ALL_PROPERTIES_AND_CALLBACKS.forEach((a) => {
    const u = t[a];
    typeof u < "u" && u !== Wm.VUE_OMITTED_PROPERTY && (r[a] = u);
  }), r;
}
function FU(e, t) {
  if (!e)
    return;
  const r = {};
  let n = !1;
  if (Object.keys(e).filter((s) => Wm.ALL_PROPERTIES_AND_CALLBACKS_SET.has(s)).forEach((s) => {
    r[s] = e[s], n = !0;
  }), !n)
    return;
  const a = {
    type: "gridOptionsChanged",
    options: r
  };
  t.dispatchEvent(a);
  const u = {
    type: "componentStateChanged"
  };
  fu(r, (s, c) => {
    u[s] = c;
  }), t.dispatchEvent(u);
}
var Hv = class extends mr {
};
function ry(e, t, r) {
  return r && e.addDestroyFunc(() => t.destroyBean(r)), r ?? e;
}
var ny = class {
  constructor(e) {
    this.cssClassStates = {}, this.getGui = e;
  }
  addCssClass(e) {
    const t = (e || "").split(" ");
    if (t.length > 1) {
      t.forEach((n) => this.addCssClass(n));
      return;
    }
    if (this.cssClassStates[e] !== !0 && e.length) {
      const n = this.getGui();
      n && n.classList.add(e), this.cssClassStates[e] = !0;
    }
  }
  removeCssClass(e) {
    const t = (e || "").split(" ");
    if (t.length > 1) {
      t.forEach((n) => this.removeCssClass(n));
      return;
    }
    if (this.cssClassStates[e] !== !1 && e.length) {
      const n = this.getGui();
      n && n.classList.remove(e), this.cssClassStates[e] = !1;
    }
  }
  containsCssClass(e) {
    const t = this.getGui();
    return t ? t.classList.contains(e) : !1;
  }
  addOrRemoveCssClass(e, t) {
    if (!e)
      return;
    if (e.indexOf(" ") >= 0) {
      const n = (e || "").split(" ");
      if (n.length > 1) {
        n.forEach((a) => this.addOrRemoveCssClass(a, t));
        return;
      }
    }
    if (this.cssClassStates[e] !== t && e.length) {
      const n = this.getGui();
      n && n.classList.toggle(e, t), this.cssClassStates[e] = t;
    }
  }
};
function ld(e, t, r) {
  r == null || typeof r == "string" && r == "" ? YL(e, t) : cc(e, t, r);
}
function cc(e, t, r) {
  e.setAttribute(XL(t), r.toString());
}
function YL(e, t) {
  e.removeAttribute(XL(t));
}
function XL(e) {
  return `aria-${e}`;
}
function vu(e, t) {
  t ? e.setAttribute("role", t) : e.removeAttribute("role");
}
function PU(e) {
  let t;
  return e === "asc" ? t = "ascending" : e === "desc" ? t = "descending" : e === "mixed" ? t = "other" : t = "none", t;
}
function IU(e) {
  return e.getAttribute("aria-label");
}
function Dv(e, t) {
  ld(e, "label", t);
}
function _m(e, t) {
  ld(e, "labelledby", t);
}
function $L(e, t) {
  ld(e, "live", t);
}
function LU(e, t) {
  ld(e, "atomic", t);
}
function kU(e, t) {
  ld(e, "relevant", t);
}
function OU(e, t) {
  ld(e, "disabled", t);
}
function V2(e, t) {
  ld(e, "hidden", t);
}
function p1(e, t) {
  cc(e, "expanded", t);
}
function NU(e, t) {
  cc(e, "setsize", t);
}
function GU(e, t) {
  cc(e, "posinset", t);
}
function HU(e, t) {
  cc(e, "rowcount", t);
}
function BU(e, t) {
  cc(e, "rowindex", t);
}
function VU(e, t) {
  cc(e, "colcount", t);
}
function ZL(e, t) {
  cc(e, "colindex", t);
}
function zU(e, t) {
  cc(e, "colspan", t);
}
function WU(e, t) {
  cc(e, "sort", t);
}
function _U(e) {
  YL(e, "sort");
}
function v1(e, t) {
  ld(e, "selected", t);
}
function UU(e, t) {
  ld(e, "controls", t.id), _m(t, e.id);
}
function z2(e, t) {
  return t === void 0 ? e("ariaIndeterminate", "indeterminate") : t === !0 ? e("ariaChecked", "checked") : e("ariaUnchecked", "unchecked");
}
var Cx, vC, bx, wx, Sx, xx, hT, pT, Tx;
function sc() {
  return Cx === void 0 && (Cx = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), Cx;
}
function KL() {
  if (vC === void 0)
    if (sc()) {
      const e = navigator.userAgent.match(/version\/(\d+)/i);
      e && (vC = e[1] != null ? parseFloat(e[1]) : 0);
    } else
      vC = 0;
  return vC;
}
function W2() {
  if (bx === void 0) {
    const e = window;
    bx = !!e.chrome && (!!e.chrome.webstore || !!e.chrome.runtime) || /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
  }
  return bx;
}
function _2() {
  return wx === void 0 && (wx = /(firefox)/i.test(navigator.userAgent)), wx;
}
function JL() {
  return Sx === void 0 && (Sx = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)), Sx;
}
function df() {
  return xx === void 0 && (xx = /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), xx;
}
function rF() {
  return !sc() || KL() >= 15;
}
function vT(e) {
  if (!e)
    return null;
  const t = e.tabIndex, r = e.getAttribute("tabIndex");
  return t === -1 && (r === null || r === "" && !_2()) ? null : t.toString();
}
function jU() {
  if (Tx !== void 0)
    return Tx;
  if (!document.body)
    return -1;
  let e = 1e6;
  const t = _2() ? 6e6 : 1e9, r = document.createElement("div");
  for (document.body.appendChild(r); ; ) {
    const n = e * 2;
    if (r.style.height = n + "px", n > t || r.clientHeight !== n)
      break;
    e = n;
  }
  return document.body.removeChild(r), Tx = e, e;
}
function YU() {
  var e, t;
  return ((e = document.body) == null ? void 0 : e.clientWidth) ?? (window.innerHeight || ((t = document.documentElement) == null ? void 0 : t.clientWidth) || -1);
}
function XU() {
  var e, t;
  return ((e = document.body) == null ? void 0 : e.clientHeight) ?? (window.innerHeight || ((t = document.documentElement) == null ? void 0 : t.clientHeight) || -1);
}
function $U() {
  return pT == null && QL(), pT;
}
function QL() {
  const e = document.body, t = document.createElement("div");
  t.style.width = t.style.height = "100px", t.style.opacity = "0", t.style.overflow = "scroll", t.style.msOverflowStyle = "scrollbar", t.style.position = "absolute", e.appendChild(t);
  let r = t.offsetWidth - t.clientWidth;
  r === 0 && t.clientWidth === 0 && (r = null), t.parentNode && t.parentNode.removeChild(t), r != null && (pT = r, hT = r === 0);
}
function qL() {
  return hT == null && QL(), hT;
}
var gC, ZU = "[tabindex], input, select, button, textarea, [href]", ek = "[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";
function U2(e) {
  const t = Element.prototype.matches || Element.prototype.msMatchesSelector, n = t.call(e, "input, select, button, textarea"), a = t.call(e, ek), u = lc(e);
  return n && !a && u;
}
function ba(e, t, r = {}) {
  const { skipAriaHidden: n } = r;
  e.classList.toggle("ag-hidden", !t), n || V2(e, !t);
}
function KU(e, t, r = {}) {
  const { skipAriaHidden: n } = r;
  e.classList.toggle("ag-invisible", !t), n || V2(e, !t);
}
function Um(e, t) {
  const r = "disabled", n = t ? (a) => a.setAttribute(r, "") : (a) => a.removeAttribute(r);
  n(e), ik(e.querySelectorAll("input"), (a) => n(a));
}
function Cv(e, t, r) {
  let n = 0;
  for (; e; ) {
    if (e.classList.contains(t))
      return !0;
    if (e = e.parentElement, typeof r == "number") {
      if (++n > r)
        break;
    } else if (e === r)
      break;
  }
  return !1;
}
function Xh(e) {
  const {
    height: t,
    width: r,
    borderTopWidth: n,
    borderRightWidth: a,
    borderBottomWidth: u,
    borderLeftWidth: s,
    paddingTop: c,
    paddingRight: i,
    paddingBottom: l,
    paddingLeft: v,
    marginTop: f,
    marginRight: p,
    marginBottom: g,
    marginLeft: y,
    boxSizing: C
  } = window.getComputedStyle(e);
  return {
    height: parseFloat(t || "0"),
    width: parseFloat(r || "0"),
    borderTopWidth: parseFloat(n || "0"),
    borderRightWidth: parseFloat(a || "0"),
    borderBottomWidth: parseFloat(u || "0"),
    borderLeftWidth: parseFloat(s || "0"),
    paddingTop: parseFloat(c || "0"),
    paddingRight: parseFloat(i || "0"),
    paddingBottom: parseFloat(l || "0"),
    paddingLeft: parseFloat(v || "0"),
    marginTop: parseFloat(f || "0"),
    marginRight: parseFloat(p || "0"),
    marginBottom: parseFloat(g || "0"),
    marginLeft: parseFloat(y || "0"),
    boxSizing: C
  };
}
function j2(e) {
  const t = Xh(e);
  return t.boxSizing === "border-box" ? t.height - t.paddingTop - t.paddingBottom : t.height;
}
function iy(e) {
  const t = Xh(e);
  return t.boxSizing === "border-box" ? t.width - t.paddingLeft - t.paddingRight : t.width;
}
function tk(e) {
  const { height: t, marginBottom: r, marginTop: n } = Xh(e);
  return Math.floor(t + r + n);
}
function g1(e) {
  const { width: t, marginLeft: r, marginRight: n } = Xh(e);
  return Math.floor(t + r + n);
}
function rk(e) {
  const t = e.getBoundingClientRect(), { borderTopWidth: r, borderLeftWidth: n, borderRightWidth: a, borderBottomWidth: u } = Xh(e);
  return {
    top: t.top + (r || 0),
    left: t.left + (n || 0),
    right: t.right + (a || 0),
    bottom: t.bottom + (u || 0)
  };
}
function m1() {
  if (typeof gC == "boolean")
    return gC;
  const e = document.createElement("div");
  return e.style.direction = "rtl", e.style.width = "1px", e.style.height = "1px", e.style.position = "fixed", e.style.top = "0px", e.style.overflow = "hidden", e.dir = "rtl", e.innerHTML = /* html */
  `<div style="width: 2px">
            <span style="display: inline-block; width: 1px"></span>
            <span style="display: inline-block; width: 1px"></span>
        </div>`, document.body.appendChild(e), e.scrollLeft = 1, gC = Math.floor(e.scrollLeft) === 0, document.body.removeChild(e), gC;
}
function y1(e, t) {
  let r = e.scrollLeft;
  return t && (r = Math.abs(r), W2() && !m1() && (r = e.scrollWidth - e.clientWidth - r)), r;
}
function C1(e, t, r) {
  r && (m1() ? t *= -1 : (sc() || W2()) && (t = e.scrollWidth - e.clientWidth - t)), e.scrollLeft = t;
}
function Qs(e) {
  for (; e && e.firstChild; )
    e.removeChild(e.firstChild);
}
function _h(e) {
  e && e.parentNode && e.parentNode.removeChild(e);
}
function nk(e) {
  return !!e.offsetParent;
}
function lc(e) {
  const t = e;
  return t.checkVisibility ? t.checkVisibility({ checkVisibilityCSS: !0 }) : !(!nk(e) || window.getComputedStyle(e).visibility !== "visible");
}
function jm(e) {
  const t = document.createElement("div");
  return t.innerHTML = (e || "").trim(), t.firstChild;
}
function JU(e) {
  return e.clientWidth < e.scrollWidth;
}
function QU(e) {
  return e.clientHeight < e.scrollHeight;
}
function b1(e, t) {
  t === "flex" ? (e.style.removeProperty("width"), e.style.removeProperty("minWidth"), e.style.removeProperty("maxWidth"), e.style.flex = "1 1 auto") : pu(e, t);
}
function pu(e, t) {
  t = Y2(t), e.style.width = t.toString(), e.style.maxWidth = t.toString(), e.style.minWidth = t.toString();
}
function Am(e, t) {
  t = Y2(t), e.style.height = t.toString(), e.style.maxHeight = t.toString(), e.style.minHeight = t.toString();
}
function Y2(e) {
  return typeof e == "number" ? `${e}px` : e;
}
function X2(e) {
  return e instanceof Node || e instanceof HTMLElement;
}
function qU(e) {
  if (e == null)
    return [];
  const t = [];
  return ik(e, (r) => t.push(r)), t;
}
function ej(e, t) {
  if (e)
    for (let r = 0; r < e.length; r++) {
      const n = e[r];
      t(n.name, n.value);
    }
}
function Vl(e, t, r) {
  r == null || r === "" ? e.removeAttribute(t) : e.setAttribute(t, r.toString());
}
function ik(e, t) {
  if (e != null)
    for (let r = 0; r < e.length; r++)
      t(e[r]);
}
var $2 = class {
  constructor(e = 0, t = 1) {
    this.nextValue = e, this.step = t;
  }
  next() {
    const e = this.nextValue;
    return this.nextValue += this.step, e;
  }
  peek() {
    return this.nextValue;
  }
  skip(e) {
    this.nextValue += e;
  }
}, tj = 1e3, rj = 1e3, nF = 100, ak = class Th extends mr {
  constructor(t, r, n, a) {
    super(), this.parentComp = t, this.tooltipShowDelayOverride = r, this.tooltipHideDelayOverride = n, this.shouldDisplayTooltip = a, this.interactionEnabled = !1, this.isInteractingWithTooltip = !1, this.state = 0, this.tooltipInstanceCount = 0, this.tooltipMouseTrack = !1;
  }
  wireBeans(t) {
    this.popupService = t.popupService, this.userComponentFactory = t.userComponentFactory;
  }
  postConstruct() {
    this.gos.get("tooltipInteraction") && (this.interactionEnabled = !0), this.tooltipTrigger = this.getTooltipTrigger(), this.tooltipMouseTrack = this.gos.get("tooltipMouseTrack");
    const t = this.parentComp.getGui();
    this.tooltipTrigger === 0 && this.addManagedListeners(t, {
      mouseenter: this.onMouseEnter.bind(this),
      mouseleave: this.onMouseLeave.bind(this)
    }), this.tooltipTrigger === 1 && this.addManagedListeners(t, {
      focusin: this.onFocusIn.bind(this),
      focusout: this.onFocusOut.bind(this)
    }), this.addManagedListeners(t, { mousemove: this.onMouseMove.bind(this) }), this.interactionEnabled || this.addManagedListeners(t, {
      mousedown: this.onMouseDown.bind(this),
      keydown: this.onKeyDown.bind(this)
    });
  }
  getGridOptionsTooltipDelay(t) {
    const r = this.gos.get(t);
    return r < 0 && Fr(`${t} should not be lower than 0`), Math.max(200, r);
  }
  getTooltipDelay(t) {
    return t === "show" ? this.tooltipShowDelayOverride ?? this.getGridOptionsTooltipDelay("tooltipShowDelay") : this.tooltipHideDelayOverride ?? this.getGridOptionsTooltipDelay("tooltipHideDelay");
  }
  destroy() {
    this.setToDoNothing(), super.destroy();
  }
  getTooltipTrigger() {
    const t = this.gos.get("tooltipTrigger");
    return !t || t === "hover" ? 0 : 1;
  }
  onMouseEnter(t) {
    this.interactionEnabled && this.interactiveTooltipTimeoutId && (this.unlockService(), this.startHideTimeout()), !df() && (Th.isLocked ? this.showTooltipTimeoutId = window.setTimeout(() => {
      this.prepareToShowTooltip(t);
    }, nF) : this.prepareToShowTooltip(t));
  }
  onMouseMove(t) {
    this.lastMouseEvent && (this.lastMouseEvent = t), this.tooltipMouseTrack && this.state === 2 && this.tooltipComp && this.positionTooltip();
  }
  onMouseDown() {
    this.setToDoNothing();
  }
  onMouseLeave() {
    this.interactionEnabled ? this.lockService() : this.setToDoNothing();
  }
  onFocusIn() {
    this.prepareToShowTooltip();
  }
  onFocusOut(t) {
    var u;
    const r = t.relatedTarget, n = this.parentComp.getGui(), a = (u = this.tooltipComp) == null ? void 0 : u.getGui();
    this.isInteractingWithTooltip || n.contains(r) || this.interactionEnabled && (a != null && a.contains(r)) || this.setToDoNothing();
  }
  onKeyDown() {
    this.setToDoNothing();
  }
  prepareToShowTooltip(t) {
    if (this.state != 0 || Th.isLocked)
      return;
    let r = 0;
    t && (r = this.isLastTooltipHiddenRecently() ? 200 : this.getTooltipDelay("show")), this.lastMouseEvent = t || null, this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), r), this.state = 1;
  }
  isLastTooltipHiddenRecently() {
    const t = (/* @__PURE__ */ new Date()).getTime(), r = Th.lastTooltipHideTime;
    return t - r < tj;
  }
  setToDoNothing(t) {
    !t && this.state === 2 && this.hideTooltip(), this.onBodyScrollEventCallback && (this.onBodyScrollEventCallback(), this.onBodyScrollEventCallback = void 0), this.onColumnMovedEventCallback && (this.onColumnMovedEventCallback(), this.onColumnMovedEventCallback = void 0), this.clearTimeouts(), this.state = 0, this.lastMouseEvent = null;
  }
  showTooltip() {
    const t = {
      ...this.parentComp.getTooltipParams()
    };
    if (!$r(t.value) || this.shouldDisplayTooltip && !this.shouldDisplayTooltip()) {
      this.setToDoNothing();
      return;
    }
    this.state = 2, this.tooltipInstanceCount++;
    const r = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);
    this.userComponentFactory.getTooltipCompDetails(t).newAgStackInstance().then(r);
  }
  hideTooltip(t) {
    !t && this.isInteractingWithTooltip || (this.tooltipComp && (this.destroyTooltipComp(), Th.lastTooltipHideTime = (/* @__PURE__ */ new Date()).getTime()), this.eventService.dispatchEvent({
      type: "tooltipHide",
      parentGui: this.parentComp.getGui()
    }), t && (this.isInteractingWithTooltip = !1), this.setToDoNothing(!0));
  }
  newTooltipComponentCallback(t, r) {
    if (this.state !== 2 || this.tooltipInstanceCount !== t) {
      this.destroyBean(r);
      return;
    }
    const a = r.getGui();
    this.tooltipComp = r, a.classList.contains("ag-tooltip") || a.classList.add("ag-tooltip-custom"), this.tooltipTrigger === 0 && a.classList.add("ag-tooltip-animate"), this.interactionEnabled && a.classList.add("ag-tooltip-interactive");
    const u = this.localeService.getLocaleTextFunc(), s = this.popupService.addPopup({
      eChild: a,
      ariaLabel: u("ariaLabelTooltip", "Tooltip")
    });
    if (s && (this.tooltipPopupDestroyFunc = s.hideFunc), this.positionTooltip(), this.tooltipTrigger === 1) {
      const c = () => this.setToDoNothing();
      [this.onBodyScrollEventCallback, this.onColumnMovedEventCallback] = this.addManagedEventListeners({
        bodyScroll: c,
        columnMoved: c
      });
    }
    this.interactionEnabled && ([this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener] = this.addManagedElementListeners(a, {
      mouseenter: this.onTooltipMouseEnter.bind(this),
      mouseleave: this.onTooltipMouseLeave.bind(this)
    }), this.tooltipTrigger === 1 && ([this.tooltipFocusInListener, this.tooltipFocusOutListener] = this.addManagedElementListeners(a, {
      focusin: this.onTooltipFocusIn.bind(this),
      focusout: this.onTooltipFocusOut.bind(this)
    }))), this.eventService.dispatchEvent({
      type: "tooltipShow",
      tooltipGui: a,
      parentGui: this.parentComp.getGui()
    }), this.startHideTimeout();
  }
  onTooltipMouseEnter() {
    this.isInteractingWithTooltip = !0, this.unlockService();
  }
  onTooltipMouseLeave() {
    this.isTooltipFocused() || (this.isInteractingWithTooltip = !1, this.lockService());
  }
  onTooltipFocusIn() {
    this.isInteractingWithTooltip = !0;
  }
  isTooltipFocused() {
    var n;
    const t = (n = this.tooltipComp) == null ? void 0 : n.getGui(), r = Sa(this.gos);
    return !!t && t.contains(r);
  }
  onTooltipFocusOut(t) {
    const r = this.parentComp.getGui();
    this.isTooltipFocused() || (this.isInteractingWithTooltip = !1, r.contains(t.relatedTarget) ? this.startHideTimeout() : this.hideTooltip());
  }
  positionTooltip() {
    const t = {
      type: "tooltip",
      ePopup: this.tooltipComp.getGui(),
      nudgeY: 18,
      skipObserver: this.tooltipMouseTrack
    };
    this.lastMouseEvent ? this.popupService.positionPopupUnderMouseEvent({
      ...t,
      mouseEvent: this.lastMouseEvent
    }) : this.popupService.positionPopupByComponent({
      ...t,
      eventSource: this.parentComp.getGui(),
      position: "under",
      keepWithinBounds: !0,
      nudgeY: 5
    });
  }
  destroyTooltipComp() {
    this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");
    const t = this.tooltipPopupDestroyFunc, r = this.tooltipComp, n = this.tooltipTrigger === 0 ? rj : 0;
    window.setTimeout(() => {
      t(), this.destroyBean(r);
    }, n), this.clearTooltipListeners(), this.tooltipPopupDestroyFunc = void 0, this.tooltipComp = void 0;
  }
  clearTooltipListeners() {
    [
      this.tooltipMouseEnterListener,
      this.tooltipMouseLeaveListener,
      this.tooltipFocusInListener,
      this.tooltipFocusOutListener
    ].forEach((t) => {
      t && t();
    }), this.tooltipMouseEnterListener = this.tooltipMouseLeaveListener = this.tooltipFocusInListener = this.tooltipFocusOutListener = null;
  }
  lockService() {
    Th.isLocked = !0, this.interactiveTooltipTimeoutId = window.setTimeout(() => {
      this.unlockService(), this.setToDoNothing();
    }, nF);
  }
  unlockService() {
    Th.isLocked = !1, this.clearInteractiveTimeout();
  }
  startHideTimeout() {
    this.clearHideTimeout(), this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.getTooltipDelay("hide"));
  }
  clearShowTimeout() {
    this.showTooltipTimeoutId && (window.clearTimeout(this.showTooltipTimeoutId), this.showTooltipTimeoutId = void 0);
  }
  clearHideTimeout() {
    this.hideTooltipTimeoutId && (window.clearTimeout(this.hideTooltipTimeoutId), this.hideTooltipTimeoutId = void 0);
  }
  clearInteractiveTimeout() {
    this.interactiveTooltipTimeoutId && (window.clearTimeout(this.interactiveTooltipTimeoutId), this.interactiveTooltipTimeoutId = void 0);
  }
  clearTimeouts() {
    this.clearShowTimeout(), this.clearHideTimeout(), this.clearInteractiveTimeout();
  }
};
ak.isLocked = !1;
var nj = ak, Bv = class extends mr {
  constructor(e, t) {
    super(), this.ctrl = e, t && (this.beans = t);
  }
  wireBeans(e) {
    this.beans = e;
  }
  postConstruct() {
    this.refreshToolTip();
  }
  setBrowserTooltip(e) {
    const t = "title", r = this.ctrl.getGui();
    r && (e != null && e != "" ? r.setAttribute(t, e) : r.removeAttribute(t));
  }
  updateTooltipText() {
    this.tooltip = this.ctrl.getTooltipValue();
  }
  createTooltipFeatureIfNeeded() {
    var t, r, n, a;
    if (this.tooltipManager != null)
      return;
    const e = {
      getTooltipParams: () => this.getTooltipParams(),
      getGui: () => this.ctrl.getGui()
    };
    this.tooltipManager = this.createBean(
      new nj(
        e,
        (r = (t = this.ctrl).getTooltipShowDelayOverride) == null ? void 0 : r.call(t),
        (a = (n = this.ctrl).getTooltipHideDelayOverride) == null ? void 0 : a.call(n),
        this.ctrl.shouldDisplayTooltip
      ),
      this.beans.context
    );
  }
  refreshToolTip() {
    this.browserTooltips = this.beans.gos.get("enableBrowserTooltips"), this.updateTooltipText(), this.browserTooltips ? (this.setBrowserTooltip(this.tooltip), this.tooltipManager && (this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context))) : (this.setBrowserTooltip(null), this.createTooltipFeatureIfNeeded());
  }
  getTooltipParams() {
    var a, u, s, c, i;
    const e = this.ctrl, t = (a = e.getColumn) == null ? void 0 : a.call(e), r = (u = e.getColDef) == null ? void 0 : u.call(e), n = (s = e.getRowNode) == null ? void 0 : s.call(e);
    return {
      location: e.getLocation(),
      //'cell',
      colDef: r,
      column: t,
      rowIndex: (c = e.getRowIndex) == null ? void 0 : c.call(e),
      node: n,
      data: n == null ? void 0 : n.data,
      value: this.getTooltipText(),
      valueFormatted: (i = e.getValueFormatted) == null ? void 0 : i.call(e),
      hideTooltipCallback: () => {
        var l;
        return (l = this.tooltipManager) == null ? void 0 : l.hideTooltip(!0);
      }
    };
  }
  getTooltipText() {
    return this.tooltip;
  }
  // overriding to make public, as we don't dispose this bean via context
  destroy() {
    this.tooltipManager && (this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context)), super.destroy();
  }
}, ij = new $2(), In = null, na = class ok extends mr {
  constructor(t, r) {
    super(), this.suppressDataRefValidation = !1, this.displayed = !0, this.visible = !0, this.compId = ij.next(), this.cssClassManager = new ny(() => this.eGui), this.componentSelectors = new Map((r ?? []).map((n) => [n.selector, n])), t && this.setTemplate(t);
  }
  preWireBeans(t) {
    super.preWireBeans(t);
  }
  preConstruct() {
    this.usingBrowserTooltips = this.gos.get("enableBrowserTooltips"), this.wireTemplate(this.getGui());
  }
  wireTemplate(t, r) {
    t && this.gos && (this.applyElementsToComponent(t), this.createChildComponentsFromTags(t, r));
  }
  getCompId() {
    return this.compId;
  }
  getTooltipParams() {
    return {
      value: this.tooltipText,
      location: "UNKNOWN"
    };
  }
  setTooltip(t) {
    const { newTooltipText: r, showDelayOverride: n, hideDelayOverride: a, location: u, shouldDisplayTooltip: s } = t || {};
    this.tooltipFeature && (this.tooltipFeature = this.destroyBean(this.tooltipFeature)), this.tooltipText !== r && (this.tooltipText = r);
    const c = () => this.tooltipText;
    r != null && (this.tooltipFeature = this.createBean(
      new Bv({
        getTooltipValue: c,
        getGui: () => this.getGui(),
        getLocation: () => u ?? "UNKNOWN",
        getColDef: t == null ? void 0 : t.getColDef,
        getColumn: t == null ? void 0 : t.getColumn,
        getTooltipShowDelayOverride: n != null ? () => n : void 0,
        getTooltipHideDelayOverride: a != null ? () => a : void 0,
        shouldDisplayTooltip: s
      })
    ));
  }
  getDataRefAttribute(t) {
    return t.getAttribute ? t.getAttribute("data-ref") : null;
  }
  applyElementsToComponent(t, r, n, a = null) {
    if (r === void 0 && (r = this.getDataRefAttribute(t)), r) {
      const u = this[r];
      if (u === In)
        this[r] = a ?? t;
      else {
        const s = n && n[r];
        !this.suppressDataRefValidation && !s && Fr(`Issue with data-ref: ${r} on ${this.constructor.name} with ${u}`);
      }
    }
  }
  // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag
  createChildComponentsFromTags(t, r) {
    qU(t.childNodes).forEach((a) => {
      if (!(a instanceof HTMLElement))
        return;
      const u = this.createComponentFromElement(
        a,
        (s) => {
          s.getGui() && this.copyAttributesFromNode(a, s.getGui());
        },
        r
      );
      if (u) {
        if (u.addItems && a.children.length) {
          this.createChildComponentsFromTags(a, r);
          const s = Array.prototype.slice.call(a.children);
          u.addItems(s);
        }
        this.swapComponentForNode(u, t, a);
      } else a.childNodes && this.createChildComponentsFromTags(a, r);
    });
  }
  createComponentFromElement(t, r, n) {
    const a = t.nodeName, u = this.getDataRefAttribute(t), s = a.indexOf("AG-") === 0, c = s ? this.componentSelectors.get(a) : null;
    let i = null;
    if (c) {
      ok.elementGettingCreated = t;
      const l = n && u ? n[u] : void 0;
      i = new c.component(l), i.setParentComponent(this), this.createBean(i, null, r);
    } else s && Fr(`Missing selector: ${a}`);
    return this.applyElementsToComponent(t, u, n, i), i;
  }
  copyAttributesFromNode(t, r) {
    ej(t.attributes, (n, a) => r.setAttribute(n, a));
  }
  swapComponentForNode(t, r, n) {
    const a = t.getGui();
    r.replaceChild(a, n), r.insertBefore(document.createComment(n.nodeName), a), this.addDestroyFunc(this.destroyBean.bind(this, t));
  }
  activateTabIndex(t) {
    const r = this.gos.get("tabIndex");
    t || (t = []), t.length || t.push(this.getGui()), t.forEach((n) => n.setAttribute("tabindex", r.toString()));
  }
  setTemplate(t, r, n) {
    const a = jm(t);
    this.setTemplateFromElement(a, r, n);
  }
  setTemplateFromElement(t, r, n, a = !1) {
    if (this.eGui = t, this.suppressDataRefValidation = a, r)
      for (let u = 0; u < r.length; u++) {
        const s = r[u];
        this.componentSelectors.set(s.selector, s);
      }
    this.wireTemplate(t, n);
  }
  getGui() {
    return this.eGui;
  }
  getFocusableElement() {
    return this.eGui;
  }
  getAriaElement() {
    return this.getFocusableElement();
  }
  setParentComponent(t) {
    this.parentComponent = t;
  }
  getParentComponent() {
    return this.parentComponent;
  }
  // this method is for older code, that wants to provide the gui element,
  // it is not intended for this to be in ag-Stack
  setGui(t) {
    this.eGui = t;
  }
  queryForHtmlElement(t) {
    return this.eGui.querySelector(t);
  }
  getContainerAndElement(t, r) {
    let n = r;
    return t == null ? null : (n || (n = this.eGui), X2(t) ? {
      element: t,
      parent: n
    } : {
      element: t.getGui(),
      parent: n
    });
  }
  prependChild(t, r) {
    const { element: n, parent: a } = this.getContainerAndElement(t, r) || {};
    !n || !a || a.insertAdjacentElement("afterbegin", n);
  }
  appendChild(t, r) {
    const { element: n, parent: a } = this.getContainerAndElement(t, r) || {};
    !n || !a || a.appendChild(n);
  }
  isDisplayed() {
    return this.displayed;
  }
  setVisible(t, r = {}) {
    if (t !== this.visible) {
      this.visible = t;
      const { skipAriaHidden: n } = r;
      KU(this.eGui, t, { skipAriaHidden: n });
    }
  }
  setDisplayed(t, r = {}) {
    if (t !== this.displayed) {
      this.displayed = t;
      const { skipAriaHidden: n } = r;
      ba(this.eGui, t, { skipAriaHidden: n });
      const a = {
        type: "displayChanged",
        visible: this.displayed
      };
      this.dispatchLocalEvent(a);
    }
  }
  destroy() {
    this.parentComponent && (this.parentComponent = void 0), this.tooltipFeature && (this.tooltipFeature = this.destroyBean(this.tooltipFeature)), super.destroy();
  }
  addGuiEventListener(t, r, n) {
    this.eGui.addEventListener(t, r, n), this.addDestroyFunc(() => this.eGui.removeEventListener(t, r));
  }
  addCssClass(t) {
    this.cssClassManager.addCssClass(t);
  }
  removeCssClass(t) {
    this.cssClassManager.removeCssClass(t);
  }
  containsCssClass(t) {
    return this.cssClassManager.containsCssClass(t);
  }
  addOrRemoveCssClass(t, r) {
    this.cssClassManager.addOrRemoveCssClass(t, r);
  }
}, sk = {
  // header column group shown when expanded (click to contract)
  columnGroupOpened: "expanded",
  // header column group shown when contracted (click to expand)
  columnGroupClosed: "contracted",
  // tool panel column group contracted (click to expand)
  columnSelectClosed: "tree-closed",
  // tool panel column group expanded (click to contract)
  columnSelectOpen: "tree-open",
  // column tool panel header expand/collapse all button, shown when some children are expanded and
  //     others are collapsed
  columnSelectIndeterminate: "tree-indeterminate",
  // shown on drag and drop image component icon while dragging column to the side of the grid to pin
  columnMovePin: "pin",
  // shown on drag and drop image component icon while dragging over part of the page that is not a drop zone
  columnMoveHide: "eye-slash",
  // shown on drag and drop image component icon while dragging columns to reorder
  columnMoveMove: "arrows",
  // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling
  columnMoveLeft: "left",
  // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling
  columnMoveRight: "right",
  // shown on drag and drop image component icon while dragging over Row Groups drop zone
  columnMoveGroup: "group",
  // shown on drag and drop image component icon while dragging over Values drop zone
  columnMoveValue: "aggregation",
  // shown on drag and drop image component icon while dragging over pivot drop zone
  columnMovePivot: "pivot",
  // shown on drag and drop image component icon while dragging over drop zone that doesn't support it, e.g.
  //     string column over aggregation drop zone
  dropNotAllowed: "not-allowed",
  // shown on row group when contracted (click to expand)
  groupContracted: "tree-closed",
  // shown on row group when expanded (click to contract)
  groupExpanded: "tree-open",
  // set filter tree list group contracted (click to expand)
  setFilterGroupClosed: "tree-closed",
  // set filter tree list group expanded (click to contract)
  setFilterGroupOpen: "tree-open",
  // set filter tree list expand/collapse all button, shown when some children are expanded and
  //     others are collapsed
  setFilterGroupIndeterminate: "tree-indeterminate",
  // context menu chart item
  chart: "chart",
  // chart window title bar
  close: "cross",
  // X (remove) on column 'pill' after adding it to a drop zone list
  cancel: "cancel",
  // indicates the currently active pin state in the "Pin column" sub-menu of the column menu
  check: "tick",
  // "go to first" button in pagination controls
  first: "first",
  // "go to previous" button in pagination controls
  previous: "previous",
  // "go to next" button in pagination controls
  next: "next",
  // "go to last" button in pagination controls
  last: "last",
  // shown on top right of chart when chart is linked to range data (click to unlink)
  linked: "linked",
  // shown on top right of chart when chart is not linked to range data (click to link)
  unlinked: "unlinked",
  // "Choose colour" button on chart settings tab
  colorPicker: "color-picker",
  // rotating spinner shown by the loading cell renderer
  groupLoading: "loading",
  // button to launch enterprise column menu
  menu: "menu",
  menuAlt: "menu-alt",
  // filter tool panel tab
  filter: "filter",
  // column tool panel tab
  columns: "columns",
  // button in chart regular size window title bar (click to maximise)
  maximize: "maximize",
  // button in chart maximised window title bar (click to make regular size)
  minimize: "minimize",
  // "Pin column" item in column header menu
  menuPin: "pin",
  // "Value aggregation" column menu item (shown on numeric columns when grouping is active)"
  menuValue: "aggregation",
  // "Group by {column-name}" item in column header menu
  menuAddRowGroup: "group",
  // "Un-Group by {column-name}" item in column header menu
  menuRemoveRowGroup: "group",
  // context menu copy item
  clipboardCopy: "copy",
  // context menu cut item
  clipboardCut: "cut",
  // context menu paste item
  clipboardPaste: "paste",
  // identifies the pivot drop zone
  pivotPanel: "pivot",
  // "Row groups" drop zone in column tool panel
  rowGroupPanel: "group",
  // columns tool panel Values drop zone
  valuePanel: "aggregation",
  // drag handle used to pick up draggable columns
  columnDrag: "grip",
  // drag handle used to pick up draggable rows
  rowDrag: "grip",
  // context menu export item
  save: "save",
  // csv export
  csvExport: "csv",
  // excel export,
  excelExport: "excel",
  // icon on dropdown editors
  smallDown: "small-down",
  // version of small-right used in RTL mode
  smallLeft: "small-left",
  // separater between column 'pills' when you add multiple columns to the header drop zone
  smallRight: "small-right",
  smallUp: "small-up",
  // show on column header when column is sorted ascending
  sortAscending: "asc",
  // show on column header when column is sorted descending
  sortDescending: "desc",
  // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true
  sortUnSort: "none",
  // Builder button in Advanced Filter
  advancedFilterBuilder: "group",
  // drag handle used to pick up Advanced Filter Builder rows
  advancedFilterBuilderDrag: "grip",
  // Advanced Filter Builder row validation error
  advancedFilterBuilderInvalid: "not-allowed",
  // shown on Advanced Filter Builder rows to move them up
  advancedFilterBuilderMoveUp: "up",
  // shown on Advanced Filter Builder rows to move them down
  advancedFilterBuilderMoveDown: "down",
  // shown on Advanced Filter Builder rows to add new rows
  advancedFilterBuilderAdd: "plus",
  // shown on Advanced Filter Builder rows to remove row
  advancedFilterBuilderRemove: "minus",
  // Edit Chart menu item shown in Integrated Charts menu
  chartsMenuEdit: "chart",
  // Advanced Settings menu item shown in Integrated Charts menu
  chartsMenuAdvancedSettings: "settings",
  // shown in Integrated Charts menu add fields
  chartsMenuAdd: "plus",
  // checked checkbox
  checkboxChecked: "checkbox-checked",
  // indeterminate checkbox
  checkboxIndeterminate: "checkbox-indeterminate",
  // unchecked checkbox
  checkboxUnchecked: "checkbox-unchecked",
  // radio button on
  radioButtonOn: "radio-button-on",
  // radio button off
  radioButtonOff: "radio-button-off"
}, aj = (() => {
  const e = new Set(Object.values(sk));
  return e.add("eye"), e;
})();
function oj(e, t, r) {
  const n = $s(e, t, r);
  if (n) {
    const { className: u } = n;
    if (typeof u == "string" && u.indexOf("ag-icon") > -1 || typeof u == "object" && u["ag-icon"])
      return n;
  }
  const a = document.createElement("span");
  return a.appendChild(n), a;
}
function $s(e, t, r, n) {
  let a = null;
  const u = r && r.getColDef().icons;
  if (u && (a = u[e]), t && !a) {
    const s = t.get("icons");
    s && (a = s[e]);
  }
  if (a) {
    let s;
    if (typeof a == "function")
      s = a();
    else if (typeof a == "string")
      s = a;
    else
      throw new Error("icon from grid options needs to be a string or a function");
    if (typeof s == "string")
      return jm(s);
    if (X2(s))
      return s;
    Fr("iconRenderer should return back a string or a dom object");
  } else {
    const s = document.createElement("span");
    let c = sk[e] ?? (aj.has(e) ? e : void 0);
    return c || (Fr(`Did not find icon ${e}`), c = ""), s.setAttribute("class", `ag-icon ag-icon-${c}`), s.setAttribute("unselectable", "on"), vu(s, "presentation"), s;
  }
}
var sj = class extends na {
  constructor() {
    super(...arguments), this.dragSource = null, this.eIcon = In, this.eLabel = In;
  }
  postConstruct() {
    const e = (t) => oj(t, this.gos, null);
    this.dropIconMap = {
      pinned: e("columnMovePin"),
      hide: e("columnMoveHide"),
      move: e("columnMoveMove"),
      left: e("columnMoveLeft"),
      right: e("columnMoveRight"),
      group: e("columnMoveGroup"),
      aggregate: e("columnMoveValue"),
      pivot: e("columnMovePivot"),
      notAllowed: e("dropNotAllowed")
    };
  }
  init(e) {
    this.dragSource = e.dragSource, this.setTemplate(
      /* html */
      `<div class="ag-dnd-ghost ag-unselectable">
                <span data-ref="eIcon" class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
                <div data-ref="eLabel" class="ag-dnd-ghost-label"></div>
            </div>`
    );
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    this.dragSource = null, super.destroy();
  }
  setIcon(e, t = !1) {
    var n, a;
    Qs(this.eIcon);
    let r = null;
    e || (e = (n = this.dragSource) != null && n.getDefaultIconName ? (a = this.dragSource) == null ? void 0 : a.getDefaultIconName() : "notAllowed"), r = this.dropIconMap[e], this.eIcon.classList.toggle("ag-shake-left-to-right", t), !(r === this.dropIconMap.hide && this.gos.get("suppressDragLeaveHidesColumns")) && r && this.eIcon.appendChild(r);
  }
  setLabel(e) {
    this.eLabel.textContent = ac(e);
  }
};
function lk(e, t, r) {
  if (r === 0)
    return !1;
  const n = Math.abs(e.clientX - t.clientX), a = Math.abs(e.clientY - t.clientY);
  return Math.max(n, a) <= r;
}
var tf = class {
  constructor(e, t = !1) {
    this.DOUBLE_TAP_MILLIS = 500, this.destroyFuncs = [], this.touching = !1, this.localEventService = new Gv(), this.eElement = e, this.preventMouseClick = t;
    const r = this.onTouchStart.bind(this), n = this.onTouchMove.bind(this), a = this.onTouchEnd.bind(this);
    this.eElement.addEventListener("touchstart", r, { passive: !0 }), this.eElement.addEventListener("touchmove", n, { passive: !0 }), this.eElement.addEventListener("touchend", a, { passive: !1 }), this.destroyFuncs.push(() => {
      this.eElement.removeEventListener("touchstart", r, { passive: !0 }), this.eElement.removeEventListener("touchmove", n, { passive: !0 }), this.eElement.removeEventListener("touchend", a, { passive: !1 });
    });
  }
  getActiveTouch(e) {
    for (let t = 0; t < e.length; t++)
      if (e[t].identifier === this.touchStart.identifier)
        return e[t];
    return null;
  }
  addEventListener(e, t) {
    this.localEventService.addEventListener(e, t);
  }
  removeEventListener(e, t) {
    this.localEventService.removeEventListener(e, t);
  }
  onTouchStart(e) {
    if (this.touching)
      return;
    this.touchStart = e.touches[0], this.touching = !0, this.moved = !1;
    const t = this.touchStart;
    window.setTimeout(() => {
      const r = this.touchStart === t;
      if (this.touching && r && !this.moved) {
        this.moved = !0;
        const n = {
          type: "longTap",
          touchStart: this.touchStart,
          touchEvent: e
        };
        this.localEventService.dispatchEvent(n);
      }
    }, 500);
  }
  onTouchMove(e) {
    if (!this.touching)
      return;
    const t = this.getActiveTouch(e.touches);
    if (!t)
      return;
    !lk(t, this.touchStart, 4) && (this.moved = !0);
  }
  onTouchEnd(e) {
    if (this.touching) {
      if (!this.moved) {
        const t = {
          type: "tap",
          touchStart: this.touchStart
        };
        this.localEventService.dispatchEvent(t), this.checkForDoubleTap();
      }
      this.preventMouseClick && e.cancelable && e.preventDefault(), this.touching = !1;
    }
  }
  checkForDoubleTap() {
    const e = (/* @__PURE__ */ new Date()).getTime();
    if (this.lastTapTime && this.lastTapTime > 0)
      if (e - this.lastTapTime > this.DOUBLE_TAP_MILLIS) {
        const r = {
          type: "doubleTap",
          touchStart: this.touchStart
        };
        this.localEventService.dispatchEvent(r), this.lastTapTime = null;
      } else
        this.lastTapTime = e;
    else
      this.lastTapTime = e;
  }
  destroy() {
    this.destroyFuncs.forEach((e) => e());
  }
};
function dm(e, t) {
  return (
    /* html */
    `<span data-ref="eSort${e}" class="ag-sort-indicator-icon ag-sort-${t} ag-hidden" aria-hidden="true"></span>`
  );
}
var lj = (
  /* html */
  `<span class="ag-sort-indicator-container">
        ${dm("Order", "order")}
        ${dm("Asc", "ascending-icon")}
        ${dm("Desc", "descending-icon")}
        ${dm("Mixed", "mixed-icon")}
        ${dm("None", "none-icon")}
    </span>`
), Z2 = class extends na {
  constructor(e) {
    super(), this.eSortOrder = In, this.eSortAsc = In, this.eSortDesc = In, this.eSortMixed = In, this.eSortNone = In, e || this.setTemplate(lj);
  }
  wireBeans(e) {
    this.sortController = e.sortController;
  }
  attachCustomElements(e, t, r, n, a) {
    this.eSortOrder = e, this.eSortAsc = t, this.eSortDesc = r, this.eSortMixed = n, this.eSortNone = a;
  }
  setupSort(e, t = !1) {
    if (this.column = e, this.suppressOrder = t, this.setupMultiSortIndicator(), !this.column.isSortable() && !this.column.getColDef().showRowGroup)
      return;
    this.addInIcon("sortAscending", this.eSortAsc, e), this.addInIcon("sortDescending", this.eSortDesc, e), this.addInIcon("sortUnSort", this.eSortNone, e);
    const r = this.updateIcons.bind(this), n = this.onSortChanged.bind(this);
    this.addManagedPropertyListener("unSortIcon", r), this.addManagedEventListeners({
      newColumnsLoaded: r,
      // Watch global events, as row group columns can effect their display column.
      sortChanged: n,
      // when grouping changes so can sort indexes and icons
      columnRowGroupChanged: n
    }), this.onSortChanged();
  }
  addInIcon(e, t, r) {
    if (t == null)
      return;
    const n = $s(e, this.gos, r);
    n && t.appendChild(n);
  }
  onSortChanged() {
    this.updateIcons(), this.suppressOrder || this.updateSortOrder();
  }
  updateIcons() {
    const e = this.sortController.getDisplaySortForColumn(this.column);
    if (this.eSortAsc) {
      const t = e === "asc";
      ba(this.eSortAsc, t, { skipAriaHidden: !0 });
    }
    if (this.eSortDesc) {
      const t = e === "desc";
      ba(this.eSortDesc, t, { skipAriaHidden: !0 });
    }
    if (this.eSortNone) {
      const t = !this.column.getColDef().unSortIcon && !this.gos.get("unSortIcon"), r = e == null;
      ba(this.eSortNone, !t && r, { skipAriaHidden: !0 });
    }
  }
  setupMultiSortIndicator() {
    this.addInIcon("sortUnSort", this.eSortMixed, this.column);
    const e = this.column.getColDef().showRowGroup;
    ec(this.gos) && e && (this.addManagedEventListeners({
      // Watch global events, as row group columns can effect their display column.
      sortChanged: this.updateMultiSortIndicator.bind(this),
      // when grouping changes so can sort indexes and icons
      columnRowGroupChanged: this.updateMultiSortIndicator.bind(this)
    }), this.updateMultiSortIndicator());
  }
  updateMultiSortIndicator() {
    if (this.eSortMixed) {
      const e = this.sortController.getDisplaySortForColumn(this.column) === "mixed";
      ba(this.eSortMixed, e, { skipAriaHidden: !0 });
    }
  }
  // we listen here for global sort events, NOT column sort events, as we want to do this
  // when sorting has been set on all column (if we listened just for our col (where we
  // set the asc / desc icons) then it's possible other cols are yet to get their sorting state.
  updateSortOrder() {
    if (!this.eSortOrder)
      return;
    const e = this.sortController.getColumnsWithSortingOrdered(), t = this.sortController.getDisplaySortIndexForColumn(this.column) ?? -1, r = e.some(
      (a) => this.sortController.getDisplaySortIndexForColumn(a) ?? !1
    ), n = t >= 0 && r;
    ba(this.eSortOrder, n, { skipAriaHidden: !0 }), t >= 0 ? this.eSortOrder.textContent = (t + 1).toString() : Qs(this.eSortOrder);
  }
}, uj = {
  selector: "AG-SORT-INDICATOR",
  component: Z2
}, cj = (
  /* html */
  `<div class="ag-cell-label-container" role="presentation">
        <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
        <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>
        <div data-ref="eLabel" class="ag-header-cell-label" role="presentation">
            <span data-ref="eText" class="ag-header-cell-text"></span>
            <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
            <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>
        </div>
    </div>`
), gT = class extends na {
  constructor() {
    super(...arguments), this.eFilter = In, this.eFilterButton = In, this.eSortIndicator = In, this.eMenu = In, this.eLabel = In, this.eText = In, this.eSortOrder = In, this.eSortAsc = In, this.eSortDesc = In, this.eSortMixed = In, this.eSortNone = In, this.lastMovingChanged = 0;
  }
  wireBeans(e) {
    this.sortController = e.sortController, this.menuService = e.menuService, this.funcColsService = e.funcColsService;
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
  refresh(e) {
    const t = this.params;
    return this.params = e, this.workOutTemplate() != this.currentTemplate || this.workOutShowMenu() != this.currentShowMenu || this.workOutSort() != this.currentSort || this.shouldSuppressMenuHide() != this.currentSuppressMenuHide || t.enableFilterButton != e.enableFilterButton || t.enableFilterIcon != e.enableFilterIcon ? !1 : (this.setDisplayName(e), !0);
  }
  workOutTemplate() {
    let e = this.params.template ?? cj;
    return e = e && e.trim ? e.trim() : e, e;
  }
  init(e) {
    this.params = e, this.currentTemplate = this.workOutTemplate(), this.setTemplate(this.currentTemplate, [uj]), this.setupTap(), this.setMenu(), this.setupSort(), this.setupFilterIcon(), this.setupFilterButton(), this.setDisplayName(e);
  }
  setDisplayName(e) {
    if (this.currentDisplayName != e.displayName) {
      this.currentDisplayName = e.displayName;
      const t = ac(this.currentDisplayName, !0);
      this.eText && (this.eText.textContent = t);
    }
  }
  addInIcon(e, t, r) {
    if (t == null)
      return;
    const n = $s(e, this.gos, r);
    n && t.appendChild(n);
  }
  setupTap() {
    const { gos: e } = this;
    if (e.get("suppressTouch"))
      return;
    const t = new tf(this.getGui(), !0), r = this.shouldSuppressMenuHide(), n = r && $r(this.eMenu), a = n ? new tf(this.eMenu, !0) : t;
    if (this.params.enableMenu) {
      const u = n ? "tap" : "longTap", s = (c) => this.params.showColumnMenuAfterMouseClick(c.touchStart);
      this.addManagedListeners(a, { [u]: s });
    }
    if (this.params.enableSorting) {
      const u = (s) => {
        var i, l;
        const c = s.touchStart.target;
        r && ((i = this.eMenu) != null && i.contains(c) || (l = this.eFilterButton) != null && l.contains(c)) || this.sortController.progressSort(this.params.column, !1, "uiColumnSorted");
      };
      this.addManagedListeners(t, { tap: u });
    }
    if (this.params.enableFilterButton) {
      const u = new tf(this.eFilterButton, !0);
      this.addManagedListeners(u, {
        tap: () => this.params.showFilter(this.eFilterButton)
      }), this.addDestroyFunc(() => u.destroy());
    }
    this.addDestroyFunc(() => t.destroy()), n && this.addDestroyFunc(() => a.destroy());
  }
  workOutShowMenu() {
    return this.params.enableMenu && this.menuService.isHeaderMenuButtonEnabled();
  }
  shouldSuppressMenuHide() {
    return this.menuService.isHeaderMenuButtonAlwaysShowEnabled();
  }
  setMenu() {
    if (!this.eMenu)
      return;
    if (this.currentShowMenu = this.workOutShowMenu(), !this.currentShowMenu) {
      _h(this.eMenu), this.eMenu = void 0;
      return;
    }
    const e = this.menuService.isLegacyMenuEnabled();
    this.addInIcon(e ? "menu" : "menuAlt", this.eMenu, this.params.column), this.eMenu.classList.toggle("ag-header-menu-icon", !e), this.currentSuppressMenuHide = this.shouldSuppressMenuHide(), this.addManagedElementListeners(this.eMenu, { click: () => this.params.showColumnMenu(this.eMenu) }), this.eMenu.classList.toggle("ag-header-menu-always-show", this.currentSuppressMenuHide);
  }
  onMenuKeyboardShortcut(e) {
    const t = this.params.column, r = this.menuService.isLegacyMenuEnabled();
    if (e && !r) {
      if (this.menuService.isFilterMenuInHeaderEnabled(t))
        return this.params.showFilter(this.eFilterButton ?? this.eMenu ?? this.getGui()), !0;
    } else if (this.params.enableMenu)
      return this.params.showColumnMenu(this.eMenu ?? this.eFilterButton ?? this.getGui()), !0;
    return !1;
  }
  workOutSort() {
    return this.params.enableSorting;
  }
  setupSort() {
    if (this.currentSort = this.params.enableSorting, this.eSortIndicator || (this.eSortIndicator = this.createBean(new Z2(!0)), this.eSortIndicator.attachCustomElements(
      this.eSortOrder,
      this.eSortAsc,
      this.eSortDesc,
      this.eSortMixed,
      this.eSortNone
    )), this.eSortIndicator.setupSort(this.params.column), !this.currentSort)
      return;
    this.addManagedListeners(this.params.column, {
      movingChanged: () => {
        this.lastMovingChanged = (/* @__PURE__ */ new Date()).getTime();
      }
    }), this.eLabel && this.addManagedElementListeners(this.eLabel, {
      click: (t) => {
        const r = this.params.column.isMoving(), a = (/* @__PURE__ */ new Date()).getTime() - this.lastMovingChanged < 50;
        if (!(r || a)) {
          const c = this.gos.get("multiSortKey") === "ctrl" ? t.ctrlKey || t.metaKey : t.shiftKey;
          this.params.progressSort(c);
        }
      }
    });
    const e = () => {
      const t = this.params.column.getSort();
      if (this.addOrRemoveCssClass("ag-header-cell-sorted-asc", t === "asc"), this.addOrRemoveCssClass("ag-header-cell-sorted-desc", t === "desc"), this.addOrRemoveCssClass("ag-header-cell-sorted-none", !t), this.params.column.getColDef().showRowGroup) {
        const r = this.funcColsService.getSourceColumnsForGroupColumn(
          this.params.column
        ), a = !(r == null ? void 0 : r.every(
          (u) => this.params.column.getSort() == u.getSort()
        ));
        this.addOrRemoveCssClass("ag-header-cell-sorted-mixed", a);
      }
    };
    this.addManagedEventListeners({
      sortChanged: e,
      columnRowGroupChanged: e
    });
  }
  setupFilterIcon() {
    this.eFilter && this.configureFilter(this.params.enableFilterIcon, this.eFilter, this.onFilterChangedIcon.bind(this));
  }
  setupFilterButton() {
    if (!this.eFilterButton)
      return;
    this.configureFilter(
      this.params.enableFilterButton,
      this.eFilterButton,
      this.onFilterChangedButton.bind(this)
    ) ? this.addManagedElementListeners(this.eFilterButton, {
      click: () => this.params.showFilter(this.eFilterButton)
    }) : this.eFilterButton = void 0;
  }
  configureFilter(e, t, r) {
    if (!e)
      return _h(t), !1;
    const n = this.params.column;
    return this.addInIcon("filter", t, n), this.addManagedListeners(n, { filterChanged: r }), r(), !0;
  }
  onFilterChangedIcon() {
    const e = this.params.column.isFilterActive();
    ba(this.eFilter, e, { skipAriaHidden: !0 });
  }
  onFilterChangedButton() {
    const e = this.params.column.isFilterActive();
    this.eFilterButton.classList.toggle("ag-filter-active", e);
  }
  getAnchorElementForMenu(e) {
    return e ? this.eFilterButton ?? this.eMenu ?? this.getGui() : this.eMenu ?? this.eFilterButton ?? this.getGui();
  }
}, dj = class extends na {
  constructor() {
    super(
      /* html */
      `<div class="ag-header-group-cell-label" role="presentation">
            <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span>
            <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>
            <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>
        </div>`
    ), this.agOpened = In, this.agClosed = In, this.agLabel = In;
  }
  wireBeans(e) {
    this.columnModel = e.columnModel;
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
  init(e) {
    this.params = e, this.checkWarnings(), this.setupLabel(), this.addGroupExpandIcon(), this.setupExpandIcons();
  }
  checkWarnings() {
    this.params.template && Fr(
      "A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)"
    );
  }
  setupExpandIcons() {
    this.addInIcon("columnGroupOpened", this.agOpened), this.addInIcon("columnGroupClosed", this.agClosed);
    const e = (a) => {
      if (Qc(a))
        return;
      const u = !this.params.columnGroup.isExpanded();
      this.columnModel.setColumnGroupOpened(
        this.params.columnGroup.getProvidedColumnGroup(),
        u,
        "uiColumnExpanded"
      );
    };
    this.addTouchAndClickListeners(this.agClosed, e), this.addTouchAndClickListeners(this.agOpened, e);
    const t = (a) => {
      Ev(a);
    };
    this.addManagedElementListeners(this.agClosed, { dblclick: t }), this.addManagedElementListeners(this.agOpened, { dblclick: t }), this.addManagedElementListeners(this.getGui(), { dblclick: e }), this.updateIconVisibility();
    const r = this.params.columnGroup.getProvidedColumnGroup(), n = this.updateIconVisibility.bind(this);
    this.addManagedListeners(r, {
      expandedChanged: n,
      expandableChanged: n
    });
  }
  addTouchAndClickListeners(e, t) {
    const r = new tf(e, !0);
    this.addManagedListeners(r, { tap: t }), this.addDestroyFunc(() => r.destroy()), this.addManagedElementListeners(e, { click: t });
  }
  updateIconVisibility() {
    if (this.params.columnGroup.isExpandable()) {
      const t = this.params.columnGroup.isExpanded();
      ba(this.agOpened, t), ba(this.agClosed, !t);
    } else
      ba(this.agOpened, !1), ba(this.agClosed, !1);
  }
  addInIcon(e, t) {
    const r = $s(e, this.gos, null);
    r && t.appendChild(r);
  }
  addGroupExpandIcon() {
    if (!this.params.columnGroup.isExpandable()) {
      ba(this.agOpened, !1), ba(this.agClosed, !1);
      return;
    }
  }
  setupLabel() {
    var r;
    const { displayName: e, columnGroup: t } = this.params;
    if ($r(e)) {
      const n = ac(e, !0);
      this.agLabel.textContent = n;
    }
    this.addOrRemoveCssClass("ag-sticky-label", !((r = t.getColGroupDef()) != null && r.suppressStickyLabel));
  }
}, fj = "↑", hj = "↓", pj = class extends na {
  constructor() {
    super(), this.refreshCount = 0;
    const e = document.createElement("span"), t = document.createElement("span");
    t.setAttribute("class", "ag-value-change-delta");
    const r = document.createElement("span");
    r.setAttribute("class", "ag-value-change-value"), e.appendChild(t), e.appendChild(r), this.setTemplateFromElement(e);
  }
  wireBeans(e) {
    this.filterManager = e.filterManager;
  }
  init(e) {
    this.eValue = this.queryForHtmlElement(".ag-value-change-value"), this.eDelta = this.queryForHtmlElement(".ag-value-change-delta"), this.refresh(e, !0);
  }
  showDelta(e, t) {
    const r = Math.abs(t), n = e.formatValue(r), a = $r(n) ? n : r, u = t >= 0;
    u ? this.eDelta.textContent = fj + a : this.eDelta.textContent = hj + a, this.eDelta.classList.toggle("ag-value-change-delta-up", u), this.eDelta.classList.toggle("ag-value-change-delta-down", !u);
  }
  setTimerToRemoveDelta() {
    this.refreshCount++;
    const e = this.refreshCount;
    this.getFrameworkOverrides().wrapIncoming(() => {
      window.setTimeout(() => {
        e === this.refreshCount && this.hideDeltaValue();
      }, 2e3);
    });
  }
  hideDeltaValue() {
    this.eValue.classList.remove("ag-value-change-value-highlight"), Qs(this.eDelta);
  }
  refresh(e, t = !1) {
    var n;
    const r = e.value;
    if (r === this.lastValue || ($r(e.valueFormatted) ? this.eValue.textContent = e.valueFormatted : $r(e.value) ? this.eValue.textContent = r : Qs(this.eValue), (n = this.filterManager) != null && n.isSuppressFlashingCellsBecauseFiltering()))
      return !1;
    if (typeof r == "number" && typeof this.lastValue == "number") {
      const a = r - this.lastValue;
      this.showDelta(e, a);
    }
    return this.lastValue && this.eValue.classList.add("ag-value-change-value-highlight"), t || this.setTimerToRemoveDelta(), this.lastValue = r, !0;
  }
}, vj = class extends na {
  constructor() {
    super(), this.refreshCount = 0;
    const e = document.createElement("span"), t = document.createElement("span");
    t.setAttribute("class", "ag-value-slide-current"), e.appendChild(t), this.setTemplateFromElement(e), this.eCurrent = this.queryForHtmlElement(".ag-value-slide-current");
  }
  wireBeans(e) {
    this.filterManager = e.filterManager;
  }
  init(e) {
    this.refresh(e, !0);
  }
  addSlideAnimation() {
    this.refreshCount++;
    const e = this.refreshCount;
    this.ePrevious && this.getGui().removeChild(this.ePrevious);
    const t = document.createElement("span");
    t.setAttribute("class", "ag-value-slide-previous ag-value-slide-out"), this.ePrevious = t, this.ePrevious.textContent = this.eCurrent.textContent, this.getGui().insertBefore(this.ePrevious, this.eCurrent), this.getFrameworkOverrides().wrapIncoming(() => {
      window.setTimeout(() => {
        e === this.refreshCount && this.ePrevious.classList.add("ag-value-slide-out-end");
      }, 50), window.setTimeout(() => {
        e === this.refreshCount && (this.getGui().removeChild(this.ePrevious), this.ePrevious = null);
      }, 3e3);
    });
  }
  refresh(e, t = !1) {
    var n;
    let r = e.value;
    return mi(r) && (r = ""), r === this.lastValue || (n = this.filterManager) != null && n.isSuppressFlashingCellsBecauseFiltering() ? !1 : (t || this.addSlideAnimation(), this.lastValue = r, $r(e.valueFormatted) ? this.eCurrent.textContent = e.valueFormatted : $r(e.value) ? this.eCurrent.textContent = r : Qs(this.eCurrent), !0);
  }
}, dr = class {
};
dr.BACKSPACE = "Backspace";
dr.TAB = "Tab";
dr.ENTER = "Enter";
dr.ESCAPE = "Escape";
dr.SPACE = " ";
dr.LEFT = "ArrowLeft";
dr.UP = "ArrowUp";
dr.RIGHT = "ArrowRight";
dr.DOWN = "ArrowDown";
dr.DELETE = "Delete";
dr.F2 = "F2";
dr.PAGE_UP = "PageUp";
dr.PAGE_DOWN = "PageDown";
dr.PAGE_HOME = "Home";
dr.PAGE_END = "End";
dr.A = "KeyA";
dr.C = "KeyC";
dr.D = "KeyD";
dr.V = "KeyV";
dr.X = "KeyX";
dr.Y = "KeyY";
dr.Z = "KeyZ";
var gj = class extends na {
  constructor(e, t, r) {
    super(t, r), this.labelSeparator = "", this.labelAlignment = "left", this.disabled = !1, this.label = "", this.config = e || {};
  }
  postConstruct() {
    this.addCssClass("ag-labeled"), this.eLabel.classList.add("ag-label");
    const { labelSeparator: e, label: t, labelWidth: r, labelAlignment: n, disabled: a } = this.config;
    a != null && this.setDisabled(a), e != null && this.setLabelSeparator(e), t != null && this.setLabel(t), r != null && this.setLabelWidth(r), this.setLabelAlignment(n || this.labelAlignment), this.refreshLabel();
  }
  refreshLabel() {
    Qs(this.eLabel), typeof this.label == "string" ? this.eLabel.innerText = this.label + this.labelSeparator : this.label && this.eLabel.appendChild(this.label), this.label === "" ? (ba(this.eLabel, !1), vu(this.eLabel, "presentation")) : (ba(this.eLabel, !0), vu(this.eLabel, null));
  }
  setLabelSeparator(e) {
    return this.labelSeparator === e ? this : (this.labelSeparator = e, this.label != null && this.refreshLabel(), this);
  }
  getLabelId() {
    return this.eLabel.id = this.eLabel.id || `ag-${this.getCompId()}-label`, this.eLabel.id;
  }
  getLabel() {
    return this.label;
  }
  setLabel(e) {
    return this.label === e ? this : (this.label = e, this.refreshLabel(), this);
  }
  setLabelAlignment(e) {
    const r = this.getGui().classList;
    return r.toggle("ag-label-align-left", e === "left"), r.toggle("ag-label-align-right", e === "right"), r.toggle("ag-label-align-top", e === "top"), this;
  }
  setLabelEllipsis(e) {
    return this.eLabel.classList.toggle("ag-label-ellipsis", e), this;
  }
  setLabelWidth(e) {
    return this.label == null ? this : (b1(this.eLabel, e), this);
  }
  setDisabled(e) {
    e = !!e;
    const t = this.getGui();
    return Um(t, e), t.classList.toggle("ag-disabled", e), this.disabled = e, this;
  }
  isDisabled() {
    return !!this.disabled;
  }
}, uk = class extends gj {
  constructor(e, t, r, n) {
    super(e, t, r), this.className = n;
  }
  postConstruct() {
    super.postConstruct();
    const { width: e, value: t, onValueChange: r } = this.config;
    e != null && this.setWidth(e), t != null && this.setValue(t), r != null && this.onValueChange(r), this.className && this.addCssClass(this.className), this.refreshAriaLabelledBy();
  }
  setLabel(e) {
    return super.setLabel(e), this.refreshAriaLabelledBy(), this;
  }
  refreshAriaLabelledBy() {
    const e = this.getAriaElement(), t = this.getLabelId(), r = this.getLabel();
    r == null || r == "" || IU(e) !== null ? _m(e, "") : _m(e, t ?? "");
  }
  setAriaLabel(e) {
    return Dv(this.getAriaElement(), e), this.refreshAriaLabelledBy(), this;
  }
  onValueChange(e) {
    return this.addManagedListeners(this, { fieldValueChanged: () => e(this.getValue()) }), this;
  }
  getWidth() {
    return this.getGui().clientWidth;
  }
  setWidth(e) {
    return pu(this.getGui(), e), this;
  }
  getPreviousValue() {
    return this.previousValue;
  }
  getValue() {
    return this.value;
  }
  setValue(e, t) {
    return this.value === e ? this : (this.previousValue = this.value, this.value = e, t || this.dispatchLocalEvent({ type: "fieldValueChanged" }), this);
  }
}, Ph = class extends uk {
  constructor(e, t, r = "text", n = "input") {
    super(
      e,
      (e == null ? void 0 : e.template) ?? /* html */
      `
            <div role="presentation">
                <div data-ref="eLabel" class="ag-input-field-label"></div>
                <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">
                    <${n} data-ref="eInput" class="ag-input-field-input"></${n}>
                </div>
            </div>`,
      [],
      t
    ), this.inputType = r, this.displayFieldTag = n, this.eLabel = In, this.eWrapper = In, this.eInput = In;
  }
  postConstruct() {
    super.postConstruct(), this.setInputType(), this.eLabel.classList.add(`${this.className}-label`), this.eWrapper.classList.add(`${this.className}-input-wrapper`), this.eInput.classList.add(`${this.className}-input`), this.addCssClass("ag-input-field"), this.eInput.id = this.eInput.id || `ag-${this.getCompId()}-input`;
    const { inputName: e, inputWidth: t } = this.config;
    e != null && this.setInputName(e), t != null && this.setInputWidth(t), this.addInputListeners(), this.activateTabIndex([this.eInput]);
  }
  addInputListeners() {
    this.addManagedElementListeners(this.eInput, { input: (e) => this.setValue(e.target.value) });
  }
  setInputType() {
    this.displayFieldTag === "input" && this.eInput.setAttribute("type", this.inputType);
  }
  getInputElement() {
    return this.eInput;
  }
  setInputWidth(e) {
    return b1(this.eWrapper, e), this;
  }
  setInputName(e) {
    return this.getInputElement().setAttribute("name", e), this;
  }
  getFocusableElement() {
    return this.eInput;
  }
  setMaxLength(e) {
    const t = this.eInput;
    return t.maxLength = e, this;
  }
  setInputPlaceholder(e) {
    return Vl(this.eInput, "placeholder", e), this;
  }
  setInputAriaLabel(e) {
    return Dv(this.eInput, e), this.refreshAriaLabelledBy(), this;
  }
  setDisabled(e) {
    return Um(this.eInput, e), super.setDisabled(e);
  }
  setAutoComplete(e) {
    if (e === !0)
      Vl(this.eInput, "autocomplete", null);
    else {
      const t = typeof e == "string" ? e : "off";
      Vl(this.eInput, "autocomplete", t);
    }
    return this;
  }
}, K2 = class extends Ph {
  constructor(e, t = "ag-checkbox", r = "checkbox") {
    super(e, t, r), this.labelAlignment = "right", this.selected = !1, this.readOnly = !1, this.passive = !1;
  }
  postConstruct() {
    super.postConstruct();
    const { readOnly: e, passive: t } = this.config;
    typeof e == "boolean" && this.setReadOnly(e), typeof t == "boolean" && this.setPassive(t);
  }
  addInputListeners() {
    this.addManagedElementListeners(this.eInput, { click: this.onCheckboxClick.bind(this) }), this.addManagedElementListeners(this.eLabel, { click: this.toggle.bind(this) });
  }
  getNextValue() {
    return this.selected === void 0 ? !0 : !this.selected;
  }
  setPassive(e) {
    this.passive = e;
  }
  isReadOnly() {
    return this.readOnly;
  }
  setReadOnly(e) {
    this.eWrapper.classList.toggle("ag-disabled", e), this.eInput.disabled = e, this.readOnly = e;
  }
  setDisabled(e) {
    return this.eWrapper.classList.toggle("ag-disabled", e), super.setDisabled(e);
  }
  toggle() {
    if (this.eInput.disabled)
      return;
    const e = this.isSelected(), t = this.getNextValue();
    this.passive ? this.dispatchChange(t, e) : this.setValue(t);
  }
  getValue() {
    return this.isSelected();
  }
  setValue(e, t) {
    return this.refreshSelectedClass(e), this.setSelected(e, t), this;
  }
  setName(e) {
    const t = this.getInputElement();
    return t.name = e, this;
  }
  isSelected() {
    return this.selected;
  }
  setSelected(e, t) {
    this.isSelected() !== e && (this.previousValue = this.isSelected(), e = this.selected = typeof e == "boolean" ? e : void 0, this.eInput.checked = e, this.eInput.indeterminate = e === void 0, t || this.dispatchChange(this.selected, this.previousValue));
  }
  dispatchChange(e, t, r) {
    this.dispatchLocalEvent({ type: "fieldValueChanged", selected: e, previousValue: t, event: r });
    const n = this.getInputElement();
    this.eventService.dispatchEvent({
      type: "checkboxChanged",
      id: n.id,
      name: n.name,
      selected: e,
      previousValue: t
    });
  }
  onCheckboxClick(e) {
    if (this.passive || this.eInput.disabled)
      return;
    const t = this.isSelected(), r = this.selected = e.target.checked;
    this.refreshSelectedClass(r), this.dispatchChange(r, t, e);
  }
  refreshSelectedClass(e) {
    this.eWrapper.classList.toggle("ag-checked", e === !0), this.eWrapper.classList.toggle("ag-indeterminate", e == null);
  }
}, J2 = {
  selector: "AG-CHECKBOX",
  component: K2
}, mj = class extends na {
  constructor() {
    super(
      /* html*/
      `
            <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
                <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
            </div>`,
      [J2]
    ), this.eCheckbox = In;
  }
  init(e) {
    this.refresh(e);
    const t = this.eCheckbox.getInputElement();
    t.setAttribute("tabindex", "-1"), $L(t, "polite"), this.addManagedListeners(t, {
      click: (r) => {
        if (Ev(r), this.eCheckbox.isDisabled())
          return;
        const n = this.eCheckbox.getValue();
        this.onCheckboxChanged(n);
      },
      dblclick: (r) => {
        Ev(r);
      }
    }), this.addManagedElementListeners(this.params.eGridCell, {
      keydown: (r) => {
        if (r.key === dr.SPACE && !this.eCheckbox.isDisabled()) {
          this.params.eGridCell === Sa(this.gos) && this.eCheckbox.toggle();
          const n = this.eCheckbox.getValue();
          this.onCheckboxChanged(n), r.preventDefault();
        }
      }
    });
  }
  refresh(e) {
    return this.params = e, this.updateCheckbox(e), !0;
  }
  updateCheckbox(e) {
    var c;
    let t, r = !0;
    if (e.node.group && e.column)
      if (typeof e.value == "boolean")
        t = e.value;
      else {
        const i = e.column.getColId();
        i.startsWith(Y1) ? t = e.value == null || e.value === "" ? void 0 : e.value === "true" : e.node.aggData && e.node.aggData[i] !== void 0 ? t = e.value ?? void 0 : r = !1;
      }
    else
      t = e.value ?? void 0;
    if (!r) {
      this.eCheckbox.setDisplayed(!1);
      return;
    }
    this.eCheckbox.setValue(t);
    const n = e.disabled != null ? e.disabled : !((c = e.column) != null && c.isCellEditable(e.node));
    this.eCheckbox.setDisabled(n);
    const a = this.localeService.getLocaleTextFunc(), u = z2(a, t), s = n ? u : `${a("ariaToggleCellValue", "Press SPACE to toggle cell value")} (${u})`;
    this.eCheckbox.setInputAriaLabel(s);
  }
  onCheckboxChanged(e) {
    const { column: t, node: r, value: n } = this.params;
    this.eventService.dispatchEvent({
      type: "cellEditingStarted",
      column: t,
      colDef: t == null ? void 0 : t.getColDef(),
      data: r.data,
      node: r,
      rowIndex: r.rowIndex,
      rowPinned: r.rowPinned,
      value: n
    });
    const a = this.params.node.setDataValue(this.params.column, e, "edit");
    this.eventService.dispatchEvent({
      type: "cellEditingStopped",
      column: t,
      colDef: t == null ? void 0 : t.getColDef(),
      data: r.data,
      node: r,
      rowIndex: r.rowIndex,
      rowPinned: r.rowPinned,
      value: n,
      oldValue: n,
      newValue: e,
      valueChanged: a
    }), a || this.updateCheckbox(this.params);
  }
}, yj = class extends na {
  constructor() {
    super(
      /* html */
      `<div class="ag-loading">
            <span class="ag-loading-icon" data-ref="eLoadingIcon"></span>
            <span class="ag-loading-text" data-ref="eLoadingText"></span>
        </div>`
    ), this.eLoadingIcon = In, this.eLoadingText = In;
  }
  init(e) {
    e.node.failedLoad ? this.setupFailed() : this.setupLoading();
  }
  setupFailed() {
    const e = this.localeService.getLocaleTextFunc();
    this.eLoadingText.innerText = e("loadingError", "ERR");
  }
  setupLoading() {
    const e = $s("groupLoading", this.gos, null);
    e && this.eLoadingIcon.appendChild(e);
    const t = this.localeService.getLocaleTextFunc();
    this.eLoadingText.innerText = t("loadingOoo", "Loading");
  }
  refresh(e) {
    return !1;
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
}, Cj = class extends na {
  constructor() {
    super(
      /* html */
      '<div class="ag-skeleton-container"></div>'
    );
  }
  init(e) {
    const t = `ag-cell-skeleton-renderer-${this.getCompId()}`;
    this.getGui().setAttribute("id", t), this.addDestroyFunc(() => _m(e.eParentOfValue)), _m(e.eParentOfValue, t), e.node.failedLoad ? this.setupFailed() : this.setupLoading(e);
  }
  setupFailed() {
    const e = this.localeService.getLocaleTextFunc();
    this.getGui().innerText = e("loadingError", "ERR");
    const t = e("ariaSkeletonCellLoadingFailed", "Row failed to load");
    Dv(this.getGui(), t);
  }
  setupLoading(e) {
    const r = Va(this.gos).createElement("div");
    r.classList.add("ag-skeleton-effect");
    const n = e.node.rowIndex;
    if (n != null) {
      const s = 75 + 25 * (n % 2 === 0 ? Math.sin(n) : Math.cos(n));
      r.style.width = `${s}%`;
    }
    this.getGui().appendChild(r);
    const u = this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading", "Row data is loading");
    Dv(this.getGui(), u);
  }
  refresh(e) {
    return !1;
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
}, ck = class extends na {
  constructor() {
    super();
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
}, bj = class extends ck {
  init() {
    var t;
    const e = Jc((t = this.gos.get("overlayLoadingTemplate")) == null ? void 0 : t.trim());
    if (this.setTemplate(
      e ?? /* html */
      '<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'
    ), !e) {
      const r = this.localeService.getLocaleTextFunc();
      setTimeout(() => {
        this.getGui().textContent = r("loadingOoo", "Loading...");
      });
    }
  }
}, wj = class extends ck {
  init() {
    var t;
    const e = Jc((t = this.gos.get("overlayNoRowsTemplate")) == null ? void 0 : t.trim());
    if (this.setTemplate(e ?? /* html */
    '<span class="ag-overlay-no-rows-center"></span>'), !e) {
      const r = this.localeService.getLocaleTextFunc();
      setTimeout(() => {
        this.getGui().textContent = r("noRowsToShow", "No Rows To Show");
      });
    }
  }
}, Vv = class extends na {
  isPopup() {
    return !0;
  }
  setParentComponent(e) {
    e.addCssClass("ag-has-popup"), super.setParentComponent(e);
  }
  destroy() {
    const e = this.parentComponent;
    e && e.isAlive() && e.getGui().classList.remove("ag-has-popup"), super.destroy();
  }
}, Sj = class extends Vv {
  constructor() {
    super(
      /* html */
      '<div class="ag-tooltip"></div>'
    );
  }
  // will need to type params
  init(e) {
    const { value: t } = e;
    this.getGui().textContent = ac(t, !0);
  }
};
function xj(e, t, r) {
  const n = {}, a = e.filter(
    (u) => !t.some((s) => s === u)
  );
  return a.length > 0 && a.forEach(
    (u) => n[u] = dk(u, r).values
  ), n;
}
function dk(e, t, r, n) {
  let a = t.map((c, i) => ({
    value: c,
    relevance: Tj(e.toLowerCase(), c.toLocaleLowerCase()),
    idx: i
  }));
  if (a.sort((c, i) => i.relevance - c.relevance), r && (a = a.filter((c) => c.relevance !== 0)), a.length > 0 && n && n > 0) {
    const i = a[0].relevance * n;
    a = a.filter((l) => i - l.relevance < 0);
  }
  const u = [], s = [];
  for (const c of a)
    u.push(c.value), s.push(c.idx);
  return { values: u, indices: s };
}
function Tj(e, t) {
  const r = e.replace(/\s/g, ""), n = t.replace(/\s/g, "");
  let a = 0, u = -1;
  for (let s = 0; s < r.length; s++) {
    const c = n.indexOf(r[s], u + 1);
    c !== -1 && (u = c, a += 100 - u * 100 / 1e4 * 100);
  }
  return a;
}
var Rj = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "userComponentRegistry", this.agGridDefaults = {
      // drag and drop
      agDragAndDropImage: sj,
      //header
      agColumnHeader: gT,
      agColumnGroupHeader: dj,
      agSortIndicator: Z2,
      // renderers
      agAnimateShowChangeCellRenderer: pj,
      agAnimateSlideCellRenderer: vj,
      agLoadingCellRenderer: yj,
      agSkeletonCellRenderer: Cj,
      agCheckboxCellRenderer: mj,
      //overlays
      agLoadingOverlay: bj,
      agNoRowsOverlay: wj,
      // tooltips
      agTooltipComponent: Sj
    }, this.agGridDefaultParams = {}, this.enterpriseAgDefaultCompsModule = {
      agSetColumnFilter: "@ag-grid-enterprise/set-filter",
      agSetColumnFloatingFilter: "@ag-grid-enterprise/set-filter",
      agMultiColumnFilter: "@ag-grid-enterprise/multi-filter",
      agMultiColumnFloatingFilter: "@ag-grid-enterprise/multi-filter",
      agGroupColumnFilter: "@ag-grid-enterprise/row-grouping",
      agGroupColumnFloatingFilter: "@ag-grid-enterprise/row-grouping",
      agGroupCellRenderer: "@ag-grid-enterprise/row-grouping",
      // Actually in enterprise core as used by MasterDetail too but best guess is they are grouping
      agGroupRowRenderer: "@ag-grid-enterprise/row-grouping",
      // Actually in enterprise core as used by MasterDetail but best guess is they are grouping
      agRichSelect: "@ag-grid-enterprise/rich-select",
      agRichSelectCellEditor: "@ag-grid-enterprise/rich-select",
      agDetailCellRenderer: "@ag-grid-enterprise/master-detail",
      agSparklineCellRenderer: "@ag-grid-enterprise/sparklines"
      /* SparklinesModule */
    }, this.jsComps = {};
  }
  postConstruct() {
    const e = this.gos.get("components");
    e != null && fu(e, (t, r) => this.registerJsComponent(t, r));
  }
  registerDefaultComponent(e, t, r) {
    this.agGridDefaults[e] = t, r && (this.agGridDefaultParams[e] = r);
  }
  registerJsComponent(e, t) {
    this.jsComps[e] = t;
  }
  retrieve(e, t) {
    const r = (c, i, l) => ({
      componentFromFramework: i,
      component: c,
      params: l
    }), n = this.getFrameworkOverrides().frameworkComponent(
      t,
      this.gos.get("components")
    );
    if (n != null)
      return r(n, !0);
    const a = this.jsComps[t];
    if (a) {
      const c = this.getFrameworkOverrides().isFrameworkComponent(a);
      return r(a, c);
    }
    const u = this.agGridDefaults[t];
    if (u)
      return r(u, !1, this.agGridDefaultParams[t]);
    const s = this.enterpriseAgDefaultCompsModule[t];
    return s ? this.gos.assertModuleRegistered(s, `AG Grid '${e}' component: ${t}`) : I2(() => {
      this.warnAboutMissingComponent(e, t);
    }, "MissingComp" + t), null;
  }
  warnAboutMissingComponent(e, t) {
    const r = [
      // Don't include the old names / internals in potential suggestions
      ...Object.keys(this.agGridDefaults).filter(
        (a) => !["agCellEditor", "agGroupRowRenderer", "agSortIndicator"].includes(a)
      ),
      ...Object.keys(this.jsComps)
    ], n = dk(t, r, !0, 0.8).values;
    Fr(
      `Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`
    ), n.length > 0 && Fr(`         Did you mean: [${n.slice(0, 3)}]?`), Fr(
      `If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`
    );
  }
}, Ia = class Cm {
  constructor(t) {
    this.status = 0, this.resolution = null, this.waiters = [], t(
      (r) => this.onDone(r),
      (r) => this.onReject(r)
    );
  }
  static all(t) {
    return t.length ? new Cm((r) => {
      let n = t.length;
      const a = new Array(n);
      t.forEach((u, s) => {
        u.then((c) => {
          a[s] = c, n--, n === 0 && r(a);
        });
      });
    }) : Cm.resolve();
  }
  static resolve(t = null) {
    return new Cm((r) => r(t));
  }
  then(t) {
    return new Cm((r) => {
      this.status === 1 ? r(t(this.resolution)) : this.waiters.push((n) => r(t(n)));
    });
  }
  onDone(t) {
    this.status = 1, this.resolution = t, this.waiters.forEach((r) => r(t));
  }
  onReject(t) {
  }
}, Aj = {
  propertyName: "dateComponent",
  cellRenderer: !1
}, Ej = {
  propertyName: "dragAndDropImageComponent",
  cellRenderer: !1
}, Mj = {
  propertyName: "headerComponent",
  cellRenderer: !1
}, Dj = {
  propertyName: "headerGroupComponent",
  cellRenderer: !1
}, iF = {
  propertyName: "cellRenderer",
  cellRenderer: !0
}, Fj = {
  propertyName: "cellRenderer",
  cellRenderer: !1
}, Pj = {
  propertyName: "loadingCellRenderer",
  cellRenderer: !0
}, Ij = {
  propertyName: "cellEditor",
  cellRenderer: !1
}, aF = {
  propertyName: "innerRenderer",
  cellRenderer: !0
}, Lj = {
  propertyName: "loadingOverlayComponent",
  cellRenderer: !1
}, kj = {
  propertyName: "noRowsOverlayComponent",
  cellRenderer: !1
}, Oj = {
  propertyName: "tooltipComponent",
  cellRenderer: !1
}, Q2 = {
  propertyName: "filter",
  cellRenderer: !1
}, Nj = {
  propertyName: "floatingFilterComponent",
  cellRenderer: !1
}, Gj = {
  propertyName: "toolPanel",
  cellRenderer: !1
}, Hj = {
  propertyName: "statusPanel",
  cellRenderer: !1
}, Bj = {
  propertyName: "fullWidthCellRenderer",
  cellRenderer: !0
}, Vj = {
  propertyName: "loadingCellRenderer",
  cellRenderer: !0
}, zj = {
  propertyName: "groupRowRenderer",
  cellRenderer: !0
}, Wj = {
  propertyName: "detailCellRenderer",
  cellRenderer: !0
}, _j = {
  propertyName: "menuItem",
  cellRenderer: !1
}, fk = class hk extends mr {
  constructor() {
    super(...arguments), this.beanName = "userComponentFactory";
  }
  wireBeans(t) {
    this.agComponentUtils = t.agComponentUtils, this.componentMetadataProvider = t.componentMetadataProvider, this.userComponentRegistry = t.userComponentRegistry, this.frameworkComponentWrapper = t.frameworkComponentWrapper, this.gridOptions = t.gridOptions;
  }
  getDragAndDropImageCompDetails(t) {
    return this.getCompDetails(this.gridOptions, Ej, "agDragAndDropImage", t, !0);
  }
  getHeaderCompDetails(t, r) {
    return this.getCompDetails(t, Mj, "agColumnHeader", r);
  }
  getHeaderGroupCompDetails(t) {
    const r = t.columnGroup.getColGroupDef();
    return this.getCompDetails(r, Dj, "agColumnGroupHeader", t);
  }
  // this one is unusual, as it can be LoadingCellRenderer, DetailCellRenderer, FullWidthCellRenderer or GroupRowRenderer.
  // so we have to pass the type in.
  getFullWidthCellRendererDetails(t) {
    return this.getCompDetails(this.gridOptions, Bj, null, t, !0);
  }
  getFullWidthLoadingCellRendererDetails(t) {
    return this.getCompDetails(this.gridOptions, Vj, "agLoadingCellRenderer", t, !0);
  }
  getFullWidthGroupCellRendererDetails(t) {
    return this.getCompDetails(this.gridOptions, zj, "agGroupRowRenderer", t, !0);
  }
  getFullWidthDetailCellRendererDetails(t) {
    return this.getCompDetails(this.gridOptions, Wj, "agDetailCellRenderer", t, !0);
  }
  // CELL RENDERER
  getInnerRendererDetails(t, r) {
    return this.getCompDetails(t, aF, null, r);
  }
  getFullWidthGroupRowInnerCellRenderer(t, r) {
    return this.getCompDetails(t, aF, null, r);
  }
  getCellRendererDetails(t, r) {
    return this.getCompDetails(t, iF, null, r);
  }
  getEditorRendererDetails(t, r) {
    return this.getCompDetails(t, Fj, null, r);
  }
  getLoadingCellRendererDetails(t, r) {
    return this.getCompDetails(t, Pj, "agSkeletonCellRenderer", r, !0);
  }
  // CELL EDITOR
  getCellEditorDetails(t, r) {
    return this.getCompDetails(t, Ij, "agCellEditor", r, !0);
  }
  // FILTER
  getFilterDetails(t, r, n) {
    return this.getCompDetails(t, Q2, n, r, !0);
  }
  getDateCompDetails(t) {
    return this.getCompDetails(this.gridOptions, Aj, "agDateInput", t, !0);
  }
  getLoadingOverlayCompDetails(t) {
    return this.getCompDetails(this.gridOptions, Lj, "agLoadingOverlay", t, !0);
  }
  getNoRowsOverlayCompDetails(t) {
    return this.getCompDetails(this.gridOptions, kj, "agNoRowsOverlay", t, !0);
  }
  getTooltipCompDetails(t) {
    return this.getCompDetails(t.colDef, Oj, "agTooltipComponent", t, !0);
  }
  getSetFilterCellRendererDetails(t, r) {
    return this.getCompDetails(t, iF, null, r);
  }
  getFloatingFilterCompDetails(t, r, n) {
    return this.getCompDetails(t, Nj, n, r);
  }
  getToolPanelCompDetails(t, r) {
    return this.getCompDetails(t, Gj, null, r, !0);
  }
  getStatusPanelCompDetails(t, r) {
    return this.getCompDetails(t, Hj, null, r, !0);
  }
  getMenuItemCompDetails(t, r) {
    return this.getCompDetails(t, _j, "agMenuItem", r, !0);
  }
  getCompDetails(t, r, n, a, u = !1) {
    const { propertyName: s, cellRenderer: c } = r;
    let { compName: i, jsComp: l, fwComp: v, paramsFromSelector: f, popupFromSelector: p, popupPositionFromSelector: g } = hk.getCompKeys(this.frameworkOverrides, t, r, a), y;
    const C = (S) => {
      const E = this.userComponentRegistry.retrieve(s, S);
      E && (l = E.componentFromFramework ? void 0 : E.component, v = E.componentFromFramework ? E.component : void 0, y = E.params);
    };
    if (i != null && C(i), l == null && v == null && n != null && C(n), l && c && !this.agComponentUtils.doesImplementIComponent(l) && (l = this.agComponentUtils.adaptFunction(s, l)), !l && !v) {
      u && Ni(`Could not find component ${i}, did you forget to configure this component?`);
      return;
    }
    const m = this.mergeParamsWithApplicationProvidedParams(
      t,
      r,
      a,
      f,
      y
    ), h = l == null, w = l || v;
    return {
      componentFromFramework: h,
      componentClass: w,
      params: m,
      type: r,
      popupFromSelector: p,
      popupPositionFromSelector: g,
      newAgStackInstance: () => this.newAgStackInstance(w, h, m, r)
    };
  }
  static getCompKeys(t, r, n, a) {
    const { propertyName: u } = n;
    let s, c, i, l, v, f;
    if (r) {
      const p = r, g = p[u + "Selector"], y = g ? g(a) : null, C = (m) => {
        typeof m == "string" ? s = m : m != null && m !== !0 && (t.isFrameworkComponent(m) ? i = m : c = m);
      };
      y ? (C(y.component), l = y.params, v = y.popup, f = y.popupPosition) : C(p[u]);
    }
    return { compName: s, jsComp: c, fwComp: i, paramsFromSelector: l, popupFromSelector: v, popupPositionFromSelector: f };
  }
  newAgStackInstance(t, r, n, a) {
    const u = a.propertyName, s = !r;
    let c;
    if (s)
      c = new t();
    else {
      const l = this.componentMetadataProvider.retrieve(u);
      c = this.frameworkComponentWrapper.wrap(
        t,
        l.mandatoryMethodList,
        l.optionalMethodList,
        a
      );
    }
    const i = this.initComponent(c, n);
    return i == null ? Ia.resolve(c) : i.then(() => c);
  }
  // used by Floating Filter
  mergeParamsWithApplicationProvidedParams(t, r, n, a = null, u) {
    const s = this.gos.getGridCommonParams();
    rs(s, n), u && rs(s, u);
    const c = t, i = c && c[r.propertyName + "Params"];
    if (typeof i == "function") {
      const l = i(n);
      rs(s, l);
    } else typeof i == "object" && rs(s, i);
    return rs(s, a), s;
  }
  initComponent(t, r) {
    if (this.createBean(t), t.init != null)
      return t.init(r);
  }
};
function Em(e) {
  const t = e;
  return t != null && t.getFrameworkComponentInstance != null ? t.getFrameworkComponentInstance() : e;
}
var X1 = class Ei {
  /**
   * Globally register the given module for all grids.
   * @param module - module to register
   */
  static register(t) {
    Ei.__register(t, !0, void 0);
  }
  /**
   * Globally register the given modules for all grids.
   * @param modules - modules to register
   */
  static registerModules(t) {
    Ei.__registerModules(t, !0, void 0);
  }
  /** AG GRID INTERNAL - Module registration helper. */
  static __register(t, r, n) {
    Ei.runVersionChecks(t), n !== void 0 ? (Ei.areGridScopedModules = !0, Ei.gridModulesMap[n] === void 0 && (Ei.gridModulesMap[n] = {}), Ei.gridModulesMap[n][t.moduleName] = t) : Ei.globalModulesMap[t.moduleName] = t, Ei.setModuleBased(r);
  }
  /** AG GRID INTERNAL - Unregister grid scoped module. */
  static __unRegisterGridModules(t) {
    delete Ei.gridModulesMap[t];
  }
  /** AG GRID INTERNAL - Module registration helper. */
  static __registerModules(t, r, n) {
    Ei.setModuleBased(r), t && t.forEach((a) => Ei.__register(a, r, n));
  }
  static isValidModuleVersion(t) {
    const [r, n] = t.version.split(".") || [], [a, u] = Ei.currentModuleVersion.split(".") || [];
    return r === a && n === u;
  }
  static runVersionChecks(t) {
    Ei.currentModuleVersion || (Ei.currentModuleVersion = t.version);
    const r = (n) => `You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${n} Please update all modules to the same version.`;
    if (t.version ? Ei.isValidModuleVersion(t) || Ni(
      r(
        `'${t.moduleName}' is version ${t.version} but the other modules are version ${Ei.currentModuleVersion}.`
      )
    ) : Ni(r(`'${t.moduleName}' is incompatible.`)), t.validate) {
      const n = t.validate();
      n.isValid || Ni(`${n.message}`);
    }
  }
  static setModuleBased(t) {
    Ei.moduleBased === void 0 ? Ei.moduleBased = t : Ei.moduleBased !== t && (Ni(
      "AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."
    ), Ni("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."));
  }
  /**
   * AG GRID INTERNAL - Set if files are being served from a single UMD bundle to provide accurate enterprise upgrade steps.
   */
  static __setIsBundled() {
    Ei.isBundled = !0;
  }
  /** AG GRID INTERNAL - Assert a given module has been register, globally or individually with this grid. */
  static __assertRegistered(t, r, n) {
    var u;
    if (this.__isRegistered(t, n))
      return !0;
    let a;
    if (Ei.isBundled)
      a = `AG Grid: unable to use ${r} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:
        
        <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>
        
For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;
    else if (Ei.moduleBased || Ei.moduleBased === void 0) {
      const s = (u = Object.entries(uf).find(([c, i]) => i === t)) == null ? void 0 : u[0];
      a = `AG Grid: unable to use ${r} as the ${s} is not registered${Ei.areGridScopedModules ? ` for gridId: ${n}` : ""}. Check if you have registered the module:
           
    import { ModuleRegistry } from '@ag-grid-community/core';
    import { ${s} } from '${t}';
    
    ModuleRegistry.registerModules([ ${s} ]);

For more info see: https://www.ag-grid.com/javascript-grid/modules/`;
    } else
      a = `AG Grid: unable to use ${r} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:
            
    import 'ag-grid-enterprise';`;
    return Ni(a), !1;
  }
  /** AG GRID INTERNAL - Is the given module registered, globally or individually with this grid. */
  static __isRegistered(t, r) {
    var n;
    return !!Ei.globalModulesMap[t] || !!((n = Ei.gridModulesMap[r]) != null && n[t]);
  }
  /** AG GRID INTERNAL - Get all registered modules globally / individually for this grid. */
  static __getRegisteredModules(t) {
    return [...PC(Ei.globalModulesMap), ...PC(Ei.gridModulesMap[t] || {})];
  }
  /** AG GRID INTERNAL - Get the list of modules registered individually for this grid. */
  static __getGridRegisteredModules(t) {
    return PC(Ei.gridModulesMap[t] ?? {}) || [];
  }
  /** INTERNAL */
  static __isPackageBased() {
    return !Ei.moduleBased;
  }
};
X1.globalModulesMap = {};
X1.gridModulesMap = {};
X1.areGridScopedModules = !1;
var tc = X1, Uj = class {
  constructor(e) {
    this.beans = {}, this.createdBeans = [], this.destroyed = !1, !(!e || !e.beanClasses) && (this.beanDestroyComparator = e.beanDestroyComparator, this.init(e));
  }
  init(e) {
    var t;
    Object.entries(e.providedBeanInstances).forEach(([r, n]) => {
      this.beans[r] = n;
    }), e.beanClasses.forEach((r) => {
      const n = new r();
      n.beanName ? this.beans[n.beanName] = n : console.error(`Bean ${r.name} is missing beanName`), this.createdBeans.push(n);
    }), (t = e.derivedBeans) == null || t.forEach((r) => {
      const { beanName: n, bean: a } = r(this);
      this.beans[n] = a, this.createdBeans.push(a);
    }), e.beanInitComparator && this.createdBeans.sort(e.beanInitComparator), this.initBeans(this.createdBeans);
  }
  getBeanInstances() {
    return Object.values(this.beans);
  }
  createBean(e, t) {
    if (!e)
      throw Error("Can't wire to bean since it is null");
    return this.initBeans([e], t), e;
  }
  initBeans(e, t) {
    e.forEach((r) => {
      var n, a;
      (n = r.preWireBeans) == null || n.call(r, this.beans), (a = r.wireBeans) == null || a.call(r, this.beans);
    }), e.forEach((r) => {
      var n;
      return (n = r.preConstruct) == null ? void 0 : n.call(r);
    }), t && e.forEach(t), e.forEach((r) => {
      var n;
      return (n = r.postConstruct) == null ? void 0 : n.call(r);
    });
  }
  getBeans() {
    return this.beans;
  }
  getBean(e) {
    return this.beans[e];
  }
  destroy() {
    if (this.destroyed)
      return;
    this.destroyed = !0;
    const e = this.getBeanInstances();
    this.beanDestroyComparator && e.sort(this.beanDestroyComparator), this.destroyBeans(e), this.beans = {}, this.createdBeans = [];
  }
  /**
   * Destroys a bean and returns undefined to support destruction and clean up in a single line.
   * this.dateComp = this.context.destroyBean(this.dateComp);
   */
  destroyBean(e) {
    var t;
    (t = e == null ? void 0 : e.destroy) == null || t.call(e);
  }
  /**
   * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line.
   * this.dateComps = this.context.destroyBeans(this.dateComps);
   */
  destroyBeans(e) {
    if (e)
      for (let t = 0; t < e.length; t++)
        this.destroyBean(e[t]);
    return [];
  }
  isDestroyed() {
    return this.destroyed;
  }
}, jj = class extends Uj {
  init(e) {
    this.gridId = e.gridId, this.beans.context = this, super.init(e);
  }
  destroy() {
    super.destroy(), tc.__unRegisterGridModules(this.gridId);
  }
  getGridId() {
    return this.gridId;
  }
}, pk = /* @__PURE__ */ ((e) => (e[e.Left = 0] = "Left", e[e.Right = 1] = "Right", e))(pk || {}), Yj = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "dragAndDropService", this.dragSourceAndParamsList = [], this.dropTargets = [];
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.dragService = e.dragService, this.mouseEventService = e.mouseEventService, this.environment = e.environment, this.userComponentFactory = e.userComponentFactory;
  }
  addDragSource(e, t = !1) {
    const r = {
      eElement: e.eElement,
      dragStartPixels: e.dragStartPixels,
      onDragStart: this.onDragStart.bind(this, e),
      onDragStop: this.onDragStop.bind(this),
      onDragging: this.onDragging.bind(this),
      onDragCancel: this.onDragCancel.bind(this),
      includeTouch: t
    };
    this.dragSourceAndParamsList.push({ params: r, dragSource: e }), this.dragService.addDragSource(r);
  }
  getDragAndDropImageComponent() {
    const { dragAndDropImageComp: e } = this;
    return !e || !e.comp ? null : e.comp;
  }
  removeDragSource(e) {
    const t = this.dragSourceAndParamsList.find((r) => r.dragSource === e);
    t && (this.dragService.removeDragSource(t.params), bs(this.dragSourceAndParamsList, t));
  }
  destroy() {
    this.dragSourceAndParamsList.forEach(
      (e) => this.dragService.removeDragSource(e.params)
    ), this.dragSourceAndParamsList.length = 0, this.dropTargets.length = 0, this.clearDragAndDropProperties(), super.destroy();
  }
  nudge() {
    this.dragging && this.onDragging(this.eventLastTime, !0);
  }
  onDragStart(e, t) {
    var r, n;
    this.dragging = !0, this.dragSource = e, this.eventLastTime = t, this.dragItem = this.dragSource.getDragItem(), (n = (r = this.dragSource).onDragStarted) == null || n.call(r), this.createDragAndDropImageComponent();
  }
  onDragStop(e) {
    var t, r, n;
    if ((r = (t = this.dragSource) == null ? void 0 : t.onDragStopped) == null || r.call(t), (n = this.lastDropTarget) != null && n.onDragStop) {
      const a = this.createDropTargetEvent(this.lastDropTarget, e, null, null, !1);
      this.lastDropTarget.onDragStop(a);
    }
    this.clearDragAndDropProperties();
  }
  onDragCancel() {
    var e, t, r;
    (t = (e = this.dragSource) == null ? void 0 : e.onDragCancelled) == null || t.call(e), (r = this.lastDropTarget) != null && r.onDragCancel && this.lastDropTarget.onDragCancel(
      this.createDropTargetEvent(this.lastDropTarget, this.eventLastTime, null, null, !1)
    ), this.clearDragAndDropProperties();
  }
  clearDragAndDropProperties() {
    this.eventLastTime = null, this.dragging = !1, this.lastDropTarget = void 0, this.dragItem = null, this.dragSource = null, this.removeDragAndDropImageComponent();
  }
  onDragging(e, t = !1) {
    var s, c, i, l;
    const r = this.getHorizontalDirection(e), n = this.getVerticalDirection(e);
    this.eventLastTime = e, this.positionDragAndDropImageComp(e);
    const a = this.dropTargets.filter((v) => this.isMouseOnDropTarget(e, v)), u = this.findCurrentDropTarget(e, a);
    if (u !== this.lastDropTarget) {
      if (this.leaveLastTargetIfExists(e, r, n, t), this.lastDropTarget !== null && u === null && ((c = (s = this.dragSource) == null ? void 0 : s.onGridExit) == null || c.call(s, this.dragItem)), this.lastDropTarget === null && u !== null && ((l = (i = this.dragSource) == null ? void 0 : i.onGridEnter) == null || l.call(i, this.dragItem)), this.enterDragTargetIfExists(u, e, r, n, t), u && this.dragAndDropImageComp) {
        const { comp: v, promise: f } = this.dragAndDropImageComp;
        v ? v.setIcon(u.getIconName ? u.getIconName() : null) : f.then((p) => {
          p && p.setIcon(u.getIconName ? u.getIconName() : null);
        });
      }
      this.lastDropTarget = u;
    } else if (u && u.onDragging) {
      const v = this.createDropTargetEvent(u, e, r, n, t);
      u.onDragging(v);
    }
  }
  getAllContainersFromDropTarget(e) {
    const t = e.getSecondaryContainers ? e.getSecondaryContainers() : null, r = [[e.getContainer()]];
    return t ? r.concat(t) : r;
  }
  allContainersIntersect(e, t) {
    for (const r of t) {
      const { width: n, height: a, left: u, right: s, top: c, bottom: i } = r.getBoundingClientRect();
      if (n === 0 || a === 0)
        return !1;
      const l = e.clientX >= u && e.clientX < s, v = e.clientY >= c && e.clientY < i;
      if (!l || !v)
        return !1;
    }
    return !0;
  }
  // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers
  isMouseOnDropTarget(e, t) {
    const r = this.getAllContainersFromDropTarget(t);
    let n = !1;
    for (const s of r)
      if (this.allContainersIntersect(e, s)) {
        n = !0;
        break;
      }
    const { eElement: a, type: u } = this.dragSource;
    return t.targetContainsSource && !t.getContainer().contains(a) ? !1 : n && t.isInterestedIn(u, a);
  }
  findCurrentDropTarget(e, t) {
    const r = t.length;
    if (r === 0)
      return null;
    if (r === 1)
      return t[0];
    const a = Vm(this.gos).elementsFromPoint(e.clientX, e.clientY);
    for (const u of a)
      for (const s of t)
        if (tU(this.getAllContainersFromDropTarget(s)).indexOf(u) !== -1)
          return s;
    return null;
  }
  enterDragTargetIfExists(e, t, r, n, a) {
    if (e && e.onDragEnter) {
      const u = this.createDropTargetEvent(
        e,
        t,
        r,
        n,
        a
      );
      e.onDragEnter(u);
    }
  }
  leaveLastTargetIfExists(e, t, r, n) {
    if (!this.lastDropTarget)
      return;
    if (this.lastDropTarget.onDragLeave) {
      const u = this.createDropTargetEvent(
        this.lastDropTarget,
        e,
        t,
        r,
        n
      );
      this.lastDropTarget.onDragLeave(u);
    }
    const a = this.getDragAndDropImageComponent();
    a && a.setIcon(null);
  }
  addDropTarget(e) {
    this.dropTargets.push(e);
  }
  removeDropTarget(e) {
    this.dropTargets = this.dropTargets.filter((t) => t.getContainer() !== e.getContainer());
  }
  hasExternalDropZones() {
    return this.dropTargets.some((e) => e.external);
  }
  findExternalZone(e) {
    return this.dropTargets.filter((r) => r.external).find((r) => r.getContainer() === e.getContainer()) || null;
  }
  isDropZoneWithinThisGrid(e) {
    const r = this.ctrlsService.getGridBodyCtrl().getGui(), { dropZoneTarget: n } = e;
    return r.contains(n);
  }
  getHorizontalDirection(e) {
    const t = this.eventLastTime && this.eventLastTime.clientX, r = e.clientX;
    return t === r ? null : t > r ? 0 : 1;
  }
  getVerticalDirection(e) {
    const t = this.eventLastTime && this.eventLastTime.clientY, r = e.clientY;
    return t === r ? null : t > r ? 0 : 1;
  }
  createDropTargetEvent(e, t, r, n, a) {
    const u = e.getContainer(), s = u.getBoundingClientRect(), { dragItem: c, dragSource: i } = this, l = t.clientX - s.left, v = t.clientY - s.top;
    return this.gos.addGridCommonParams({
      event: t,
      x: l,
      y: v,
      vDirection: n,
      hDirection: r,
      dragSource: i,
      fromNudge: a,
      dragItem: c,
      dropZoneTarget: u
    });
  }
  positionDragAndDropImageComp(e) {
    const t = this.getDragAndDropImageComponent();
    if (!t)
      return;
    const r = t.getGui(), a = r.getBoundingClientRect().height, u = YU() - 2, s = XU() - 2;
    if (!r.offsetParent)
      return;
    const i = rk(r.offsetParent), { clientY: l, clientX: v } = e;
    let f = l - i.top - a / 2, p = v - i.left - 10;
    const g = Va(this.gos), y = g.defaultView || window, C = y.pageYOffset || g.documentElement.scrollTop, m = y.pageXOffset || g.documentElement.scrollLeft;
    u > 0 && p + r.clientWidth > u + m && (p = u + m - r.clientWidth), p < 0 && (p = 0), s > 0 && f + r.clientHeight > s + C && (f = s + C - r.clientHeight), f < 0 && (f = 0), r.style.left = `${p}px`, r.style.top = `${f}px`;
  }
  removeDragAndDropImageComponent() {
    if (this.dragAndDropImageComp) {
      const { comp: e } = this.dragAndDropImageComp;
      if (e) {
        const t = e.getGui();
        this.dragAndDropImageParent && this.dragAndDropImageParent.removeChild(t), this.destroyBean(e);
      }
    }
    this.dragAndDropImageComp = null;
  }
  createDragAndDropImageComponent() {
    const { dragSource: e } = this;
    if (!e)
      return;
    const r = this.userComponentFactory.getDragAndDropImageCompDetails({
      dragSource: e
    }).newAgStackInstance();
    this.dragAndDropImageComp = {
      promise: r
    }, r.then((n) => {
      !n || !this.isAlive() || (this.processDragAndDropImageComponent(n), this.dragAndDropImageComp.comp = n);
    });
  }
  processDragAndDropImageComponent(e) {
    const { dragSource: t, mouseEventService: r, environment: n } = this;
    if (!t)
      return;
    const a = e.getGui();
    a.style.setProperty("position", "absolute"), a.style.setProperty("z-index", "9999"), r.stampTopLevelGridCompWithGridInstance(a), n.applyThemeClasses(a), e.setIcon(null);
    let { dragItemName: u } = t;
    L2(u) && (u = u()), e.setLabel(u || ""), a.style.top = "20px", a.style.left = "20px";
    const s = Va(this.gos);
    let c = null, i = null;
    try {
      c = s.fullscreenElement;
    } catch {
    } finally {
      c || (c = Vm(this.gos));
      const l = c.querySelector("body");
      l ? i = l : c instanceof ShadowRoot ? i = c : c instanceof Document ? i = c == null ? void 0 : c.documentElement : i = c;
    }
    this.dragAndDropImageParent = i, i ? i.appendChild(a) : Fr("Could not find document body, it is needed for drag and drop.");
  }
}, Xj = class {
  constructor(e) {
    this.tickingInterval = null, this.onScrollCallback = null, this.scrollContainer = e.scrollContainer, this.scrollHorizontally = e.scrollAxis.indexOf("x") !== -1, this.scrollVertically = e.scrollAxis.indexOf("y") !== -1, this.scrollByTick = e.scrollByTick != null ? e.scrollByTick : 20, e.onScrollCallback && (this.onScrollCallback = e.onScrollCallback), this.scrollVertically && (this.getVerticalPosition = e.getVerticalPosition, this.setVerticalPosition = e.setVerticalPosition), this.scrollHorizontally && (this.getHorizontalPosition = e.getHorizontalPosition, this.setHorizontalPosition = e.setHorizontalPosition), this.shouldSkipVerticalScroll = e.shouldSkipVerticalScroll || (() => !1), this.shouldSkipHorizontalScroll = e.shouldSkipHorizontalScroll || (() => !1);
  }
  check(e, t = !1) {
    const r = t || this.shouldSkipVerticalScroll();
    if (r && this.shouldSkipHorizontalScroll())
      return;
    const n = this.scrollContainer.getBoundingClientRect(), a = this.scrollByTick;
    this.tickLeft = e.clientX < n.left + a, this.tickRight = e.clientX > n.right - a, this.tickUp = e.clientY < n.top + a && !r, this.tickDown = e.clientY > n.bottom - a && !r, this.tickLeft || this.tickRight || this.tickUp || this.tickDown ? this.ensureTickingStarted() : this.ensureCleared();
  }
  ensureTickingStarted() {
    this.tickingInterval === null && (this.tickingInterval = window.setInterval(this.doTick.bind(this), 100), this.tickCount = 0);
  }
  doTick() {
    this.tickCount++;
    const e = this.tickCount > 20 ? 200 : this.tickCount > 10 ? 80 : 40;
    if (this.scrollVertically) {
      const t = this.getVerticalPosition();
      this.tickUp && this.setVerticalPosition(t - e), this.tickDown && this.setVerticalPosition(t + e);
    }
    if (this.scrollHorizontally) {
      const t = this.getHorizontalPosition();
      this.tickLeft && this.setHorizontalPosition(t - e), this.tickRight && this.setHorizontalPosition(t + e);
    }
    this.onScrollCallback && this.onScrollCallback();
  }
  ensureCleared() {
    this.tickingInterval && (window.clearInterval(this.tickingInterval), this.tickingInterval = null);
  }
}, kC = /* @__PURE__ */ ((e) => (e[e.Above = 0] = "Above", e[e.Below = 1] = "Below", e))(kC || {}), $j = class extends mr {
  wireBeans(e) {
    this.dragAndDropService = e.dragAndDropService, this.rowModel = e.rowModel, this.pageBoundsService = e.pageBoundsService, this.focusService = e.focusService, this.sortController = e.sortController, this.filterManager = e.filterManager, this.selectionService = e.selectionService, this.mouseEventService = e.mouseEventService, this.ctrlsService = e.ctrlsService, this.funcColsService = e.funcColsService, this.rangeService = e.rangeService;
  }
  constructor(e) {
    super(), this.eContainer = e;
  }
  postConstruct() {
    da(this.gos) && (this.clientSideRowModel = this.rowModel), this.ctrlsService.whenReady(this, (e) => {
      const t = e.gridBodyCtrl;
      this.autoScrollService = new Xj({
        scrollContainer: t.getBodyViewportElement(),
        scrollAxis: "y",
        getVerticalPosition: () => t.getScrollFeature().getVScrollPosition().top,
        setVerticalPosition: (r) => t.getScrollFeature().setVerticalScrollPosition(r),
        onScrollCallback: () => {
          this.onDragging(this.lastDraggingEvent);
        }
      });
    });
  }
  getContainer() {
    return this.eContainer;
  }
  isInterestedIn(e) {
    return e === 2;
  }
  getIconName() {
    return this.gos.get("rowDragManaged") && this.shouldPreventRowMove() ? "notAllowed" : "move";
  }
  shouldPreventRowMove() {
    var n;
    return !!(this.funcColsService.getRowGroupColumns().length || ((n = this.filterManager) == null ? void 0 : n.isAnyFilterPresent()) || this.sortController.isSortActive());
  }
  getRowNodes(e) {
    if (!this.isFromThisGrid(e))
      return e.dragItem.rowNodes || [];
    const t = e.dragItem.rowNode;
    if (this.gos.get("rowDragMultiRow")) {
      const n = [...this.selectionService.getSelectedNodes()].sort((a, u) => a.rowIndex == null || u.rowIndex == null ? 0 : this.getRowIndexNumber(a) - this.getRowIndexNumber(u));
      if (n.indexOf(t) !== -1)
        return n;
    }
    return [t];
  }
  onDragEnter(e) {
    e.dragItem.rowNodes = this.getRowNodes(e), this.dispatchGridEvent("rowDragEnter", e), this.getRowNodes(e).forEach((t) => {
      t.setDragging(!0);
    }), this.onEnterOrDragging(e);
  }
  onDragging(e) {
    this.onEnterOrDragging(e);
  }
  isFromThisGrid(e) {
    const { dragSourceDomDataKey: t } = e.dragSource;
    return t === this.gos.getDomDataKey();
  }
  onEnterOrDragging(e) {
    this.dispatchGridEvent("rowDragMove", e), this.lastDraggingEvent = e;
    const t = this.mouseEventService.getNormalisedPosition(e).y;
    this.gos.get("rowDragManaged") && this.doManagedDrag(e, t), this.autoScrollService.check(e.event);
  }
  doManagedDrag(e, t) {
    const r = this.isFromThisGrid(e), n = this.gos.get("rowDragManaged"), a = e.dragItem.rowNodes;
    n && this.shouldPreventRowMove() || (this.gos.get("suppressMoveWhenRowDragging") || !r ? this.dragAndDropService.isDropZoneWithinThisGrid(e) && this.clientSideRowModel.highlightRowAtPixel(a[0], t) : this.moveRows(a, t));
  }
  getRowIndexNumber(e) {
    const t = e.getRowIndexString();
    return parseInt(di(t.split("-")), 10);
  }
  moveRowAndClearHighlight(e) {
    const t = this.clientSideRowModel.getLastHighlightedRowNode(), r = t && t.highlighted === 1, n = this.mouseEventService.getNormalisedPosition(e).y, a = e.dragItem.rowNodes;
    let u = r ? 1 : 0;
    if (this.isFromThisGrid(e))
      a.forEach((s) => {
        s.rowTop < n && (u -= 1);
      }), this.moveRows(a, n, u);
    else {
      const s = ty(this.gos);
      let c = this.clientSideRowModel.getRowIndexAtPixel(n) + 1;
      this.clientSideRowModel.getHighlightPosition(n) === 0 && c--, this.clientSideRowModel.updateRowData({
        add: a.filter(
          (i) => !this.clientSideRowModel.getRowNode(
            (s == null ? void 0 : s({ data: i.data, level: 0, rowPinned: i.rowPinned })) ?? i.data.id
          )
        ).map((i) => i.data),
        addIndex: c
      });
    }
    this.clearRowHighlight();
  }
  clearRowHighlight() {
    this.clientSideRowModel.highlightRowAtPixel(null);
  }
  moveRows(e, t, r = 0) {
    var a;
    this.clientSideRowModel.ensureRowsAtPixel(e, t, r) && (this.focusService.clearFocusedCell(), (a = this.rangeService) == null || a.removeAllCellRanges());
  }
  addRowDropZone(e) {
    if (!e.getContainer()) {
      Fr("addRowDropZone - A container target needs to be provided");
      return;
    }
    if (this.dragAndDropService.findExternalZone(e)) {
      Fr(
        "addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again."
      );
      return;
    }
    let t = {
      getContainer: e.getContainer
    };
    e.fromGrid ? t = e : (e.onDragEnter && (t.onDragEnter = (n) => {
      e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter", n));
    }), e.onDragLeave && (t.onDragLeave = (n) => {
      e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave", n));
    }), e.onDragging && (t.onDragging = (n) => {
      e.onDragging(this.draggingToRowDragEvent("rowDragMove", n));
    }), e.onDragStop && (t.onDragStop = (n) => {
      e.onDragStop(this.draggingToRowDragEvent("rowDragEnd", n));
    }), e.onDragCancel && (t.onDragCancel = (n) => {
      e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel", n));
    }));
    const r = {
      isInterestedIn: (n) => n === 2,
      getIconName: () => "move",
      external: !0,
      ...t
    };
    this.dragAndDropService.addDropTarget(r), this.addDestroyFunc(() => this.dragAndDropService.removeDropTarget(r));
  }
  getRowDropZone(e) {
    const t = this.getContainer.bind(this), r = this.onDragEnter.bind(this), n = this.onDragLeave.bind(this), a = this.onDragging.bind(this), u = this.onDragStop.bind(this), s = this.onDragCancel.bind(this);
    let c;
    return e ? c = {
      getContainer: t,
      onDragEnter: e.onDragEnter ? (i) => {
        r(i), e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter", i));
      } : r,
      onDragLeave: e.onDragLeave ? (i) => {
        n(i), e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave", i));
      } : n,
      onDragging: e.onDragging ? (i) => {
        a(i), e.onDragging(this.draggingToRowDragEvent("rowDragMove", i));
      } : a,
      onDragStop: e.onDragStop ? (i) => {
        u(i), e.onDragStop(this.draggingToRowDragEvent("rowDragEnd", i));
      } : u,
      onDragCancel: e.onDragCancel ? (i) => {
        s(i), e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel", i));
      } : s,
      fromGrid: !0
    } : c = {
      getContainer: t,
      onDragEnter: r,
      onDragLeave: n,
      onDragging: a,
      onDragStop: u,
      onDragCancel: s,
      /* @private */
      fromGrid: !0
    }, c;
  }
  draggingToRowDragEvent(e, t) {
    const r = this.mouseEventService.getNormalisedPosition(t).y, n = r > this.pageBoundsService.getCurrentPageHeight();
    let a = -1, u;
    n || (a = this.rowModel.getRowIndexAtPixel(r), u = this.rowModel.getRow(a));
    let s;
    switch (t.vDirection) {
      case 1:
        s = "down";
        break;
      case 0:
        s = "up";
        break;
      default:
        s = null;
        break;
    }
    return this.gos.addGridCommonParams({
      type: e,
      event: t.event,
      node: t.dragItem.rowNode,
      nodes: t.dragItem.rowNodes,
      overIndex: a,
      overNode: u,
      y: r,
      vDirection: s
    });
  }
  dispatchGridEvent(e, t) {
    const r = this.draggingToRowDragEvent(e, t);
    this.eventService.dispatchEvent(r);
  }
  onDragLeave(e) {
    this.dispatchGridEvent("rowDragLeave", e), this.stopDragging(e), this.gos.get("rowDragManaged") && this.clearRowHighlight();
  }
  onDragStop(e) {
    this.dispatchGridEvent("rowDragEnd", e), this.stopDragging(e), this.gos.get("rowDragManaged") && (this.gos.get("suppressMoveWhenRowDragging") || !this.isFromThisGrid(e)) && this.dragAndDropService.isDropZoneWithinThisGrid(e) && this.moveRowAndClearHighlight(e);
  }
  onDragCancel(e) {
    this.dispatchGridEvent("rowDragCancel", e), this.stopDragging(e), this.gos.get("rowDragManaged") && (this.gos.get("suppressMoveWhenRowDragging") || !this.isFromThisGrid(e)) && this.dragAndDropService.isDropZoneWithinThisGrid(e) && this.clearRowHighlight();
  }
  stopDragging(e) {
    this.autoScrollService.ensureCleared(), this.getRowNodes(e).forEach((t) => {
      t.setDragging(!1);
    });
  }
}, Zj = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "dragService", this.dragEndFunctions = [], this.dragSources = [];
  }
  wireBeans(e) {
    this.mouseEventService = e.mouseEventService;
  }
  destroy() {
    this.dragSources.forEach(this.removeListener.bind(this)), this.dragSources.length = 0, super.destroy();
  }
  removeListener(e) {
    const t = e.dragSource.eElement, r = e.mouseDownListener;
    if (t.removeEventListener("mousedown", r), e.touchEnabled) {
      const n = e.touchStartListener;
      t.removeEventListener("touchstart", n, { passive: !0 });
    }
  }
  removeDragSource(e) {
    const t = this.dragSources.find((r) => r.dragSource === e);
    t && (this.removeListener(t), bs(this.dragSources, t));
  }
  isDragging() {
    return this.dragging;
  }
  addDragSource(e) {
    const t = this.onMouseDown.bind(this, e), { eElement: r, includeTouch: n, stopPropagationForTouch: a } = e;
    r.addEventListener("mousedown", t);
    let u = null;
    const s = this.gos.get("suppressTouch");
    n && !s && (u = (c) => {
      U2(c.target) || (a && c.stopPropagation(), this.onTouchStart(e, c));
    }, r.addEventListener("touchstart", u, { passive: !1 })), this.dragSources.push({
      dragSource: e,
      mouseDownListener: t,
      touchStartListener: u,
      touchEnabled: !!n
    });
  }
  getStartTarget() {
    return this.startTarget;
  }
  // gets called whenever mouse down on any drag source
  onTouchStart(e, t) {
    this.currentDragParams = e, this.dragging = !1;
    const r = t.touches[0];
    this.touchLastTime = r, this.touchStart = r;
    const n = (i) => this.onTouchMove(i, e.eElement), a = (i) => this.onTouchUp(i, e.eElement), u = (i) => {
      i.cancelable && i.preventDefault();
    }, s = t.target, c = [
      // Prevents the page document from moving while we are dragging items around.
      // preventDefault needs to be called in the touchmove listener and never inside the
      // touchstart, because using touchstart causes the click event to be cancelled on touch devices.
      {
        target: Vm(this.gos),
        type: "touchmove",
        listener: u,
        options: { passive: !1 }
      },
      { target: s, type: "touchmove", listener: n, options: { passive: !0 } },
      { target: s, type: "touchend", listener: a, options: { passive: !0 } },
      { target: s, type: "touchcancel", listener: a, options: { passive: !0 } }
    ];
    this.addTemporaryEvents(c), e.dragStartPixels === 0 && this.onCommonMove(r, this.touchStart, e.eElement);
  }
  // gets called whenever mouse down on any drag source
  onMouseDown(e, t) {
    const r = t;
    if (e.skipMouseEvent && e.skipMouseEvent(t) || r._alreadyProcessedByDragService || (r._alreadyProcessedByDragService = !0, t.button !== 0))
      return;
    this.shouldPreventMouseEvent(t) && t.preventDefault(), this.currentDragParams = e, this.dragging = !1, this.mouseStartEvent = t, this.startTarget = t.target;
    const n = (l) => this.onMouseMove(l, e.eElement), a = (l) => this.onMouseUp(l, e.eElement), u = (l) => l.preventDefault(), s = (l) => {
      l.key === dr.ESCAPE && this.cancelDrag(e.eElement);
    }, c = Vm(this.gos), i = [
      { target: c, type: "mousemove", listener: n },
      { target: c, type: "mouseup", listener: a },
      { target: c, type: "contextmenu", listener: u },
      { target: c, type: "keydown", listener: s }
    ];
    this.addTemporaryEvents(i), e.dragStartPixels === 0 && this.onMouseMove(t, e.eElement);
  }
  addTemporaryEvents(e) {
    e.forEach((t) => {
      const { target: r, type: n, listener: a, options: u } = t;
      r.addEventListener(n, a, u);
    }), this.dragEndFunctions.push(() => {
      e.forEach((t) => {
        const { target: r, type: n, listener: a, options: u } = t;
        r.removeEventListener(n, a, u);
      });
    });
  }
  // returns true if the event is close to the original event by X pixels either vertically or horizontally.
  // we only start dragging after X pixels so this allows us to know if we should start dragging yet.
  isEventNearStartEvent(e, t) {
    const { dragStartPixels: r } = this.currentDragParams, n = $r(r) ? r : 4;
    return lk(e, t, n);
  }
  getFirstActiveTouch(e) {
    for (let t = 0; t < e.length; t++)
      if (e[t].identifier === this.touchStart.identifier)
        return e[t];
    return null;
  }
  onCommonMove(e, t, r) {
    if (!this.dragging) {
      if (this.isEventNearStartEvent(e, t))
        return;
      this.dragging = !0, this.eventService.dispatchEvent({
        type: "dragStarted",
        target: r
      }), this.currentDragParams.onDragStart(t), this.currentDragParams.onDragging(t);
    }
    this.currentDragParams.onDragging(e);
  }
  onTouchMove(e, t) {
    const r = this.getFirstActiveTouch(e.touches);
    r && this.onCommonMove(r, this.touchStart, t);
  }
  // only gets called after a mouse down - as this is only added after mouseDown
  // and is removed when mouseUp happens
  onMouseMove(e, t) {
    var r;
    sc() && ((r = Va(this.gos).getSelection()) == null || r.removeAllRanges()), this.shouldPreventMouseEvent(e) && e.preventDefault(), this.onCommonMove(e, this.mouseStartEvent, t);
  }
  shouldPreventMouseEvent(e) {
    const t = this.gos.get("enableCellTextSelection"), r = e.type === "mousemove";
    return (
      // when `isEnableCellTextSelect` is `true`, we need to preventDefault on mouseMove
      // to avoid the grid text being selected while dragging components.
      t && r && e.cancelable && this.mouseEventService.isEventFromThisGrid(e) && !this.isOverFormFieldElement(e)
    );
  }
  isOverFormFieldElement(e) {
    const t = e.target, r = t == null ? void 0 : t.tagName.toLocaleLowerCase();
    return !!(r != null && r.match("^a$|textarea|input|select|button"));
  }
  onTouchUp(e, t) {
    let r = this.getFirstActiveTouch(e.changedTouches);
    r || (r = this.touchLastTime), this.onUpCommon(r, t);
  }
  onMouseUp(e, t) {
    this.onUpCommon(e, t);
  }
  onUpCommon(e, t) {
    this.dragging && (this.dragging = !1, this.currentDragParams.onDragStop(e), this.eventService.dispatchEvent({
      type: "dragStopped",
      target: t
    })), this.resetDragProperties();
  }
  cancelDrag(e) {
    var t, r;
    this.eventService.dispatchEvent({
      type: "dragCancelled",
      target: e
    }), (r = (t = this.currentDragParams) == null ? void 0 : t.onDragCancel) == null || r.call(t), this.resetDragProperties();
  }
  resetDragProperties() {
    this.mouseStartEvent = null, this.startTarget = null, this.touchStart = null, this.touchLastTime = null, this.currentDragParams = null, this.dragEndFunctions.forEach((e) => e()), this.dragEndFunctions.length = 0;
  }
}, mT = class extends na {
  constructor(e, t, r, n, a, u) {
    super(), this.cellValueFn = e, this.rowNode = t, this.column = r, this.customGui = n, this.dragStartPixels = a, this.suppressVisibilityChange = u, this.dragSource = null;
  }
  wireBeans(e) {
    this.beans = e;
  }
  isCustomGui() {
    return this.customGui != null;
  }
  postConstruct() {
    if (this.customGui ? this.setDragElement(this.customGui, this.dragStartPixels) : (this.setTemplate(
      /* html */
      '<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'
    ), this.getGui().appendChild($s("rowDrag", this.gos, null)), this.addDragSource()), this.checkCompatibility(), !this.suppressVisibilityChange) {
      const e = this.gos.get("rowDragManaged") ? new Jj(this, this.beans, this.rowNode, this.column) : new Kj(this, this.beans, this.rowNode, this.column);
      this.createManagedBean(e, this.beans.context);
    }
  }
  setDragElement(e, t) {
    this.setTemplateFromElement(e, void 0, void 0, !0), this.addDragSource(t);
  }
  getSelectedNodes() {
    if (!this.gos.get("rowDragMultiRow"))
      return [this.rowNode];
    const t = this.beans.selectionService.getSelectedNodes();
    return t.indexOf(this.rowNode) !== -1 ? t : [this.rowNode];
  }
  // returns true if all compatibility items work out
  checkCompatibility() {
    const e = this.gos.get("rowDragManaged");
    this.gos.get("treeData") && e && Fr("If using row drag with tree data, you cannot have rowDragManaged=true");
  }
  getDragItem() {
    return {
      rowNode: this.rowNode,
      rowNodes: this.getSelectedNodes(),
      columns: this.column ? [this.column] : void 0,
      defaultTextValue: this.cellValueFn()
    };
  }
  getRowDragText(e) {
    if (e) {
      const t = e.getColDef();
      if (t.rowDragText)
        return t.rowDragText;
    }
    return this.gos.get("rowDragText");
  }
  addDragSource(e = 4) {
    this.dragSource && this.removeDragSource();
    const t = this.getGui();
    this.gos.get("enableCellTextSelection") && (this.removeMouseDownListener(), this.mouseDownListener = this.addManagedElementListeners(t, {
      mousedown: (n) => {
        n == null || n.preventDefault();
      }
    })[0]);
    const r = this.localeService.getLocaleTextFunc();
    this.dragSource = {
      type: 2,
      eElement: t,
      dragItemName: () => {
        var s;
        const n = this.getDragItem(), a = ((s = n.rowNodes) == null ? void 0 : s.length) || 1, u = this.getRowDragText(this.column);
        return u ? u(n, a) : a === 1 ? this.cellValueFn() : `${a} ${r("rowDragRows", "rows")}`;
      },
      getDragItem: () => this.getDragItem(),
      dragStartPixels: e,
      dragSourceDomDataKey: this.gos.getDomDataKey()
    }, this.beans.dragAndDropService.addDragSource(this.dragSource, !0);
  }
  destroy() {
    this.removeDragSource(), this.removeMouseDownListener(), super.destroy();
  }
  removeDragSource() {
    this.dragSource && (this.beans.dragAndDropService.removeDragSource(this.dragSource), this.dragSource = null);
  }
  removeMouseDownListener() {
    this.mouseDownListener && (this.mouseDownListener(), this.mouseDownListener = void 0);
  }
}, vk = class extends mr {
  constructor(e, t, r) {
    super(), this.parent = e, this.rowNode = t, this.column = r;
  }
  setDisplayedOrVisible(e) {
    const t = { skipAriaHidden: !0 };
    if (e)
      this.parent.setDisplayed(!1, t);
    else {
      let r = !0, n = !1;
      this.column && (r = this.column.isRowDrag(this.rowNode) || this.parent.isCustomGui(), n = L2(this.column.getColDef().rowDrag)), n ? (this.parent.setDisplayed(!0, t), this.parent.setVisible(r, t)) : (this.parent.setDisplayed(r, t), this.parent.setVisible(!0, t));
    }
  }
}, Kj = class extends vk {
  constructor(e, t, r, n) {
    super(e, r, n), this.beans = t;
  }
  postConstruct() {
    this.addManagedPropertyListener("suppressRowDrag", this.onSuppressRowDrag.bind(this));
    const e = this.workOutVisibility.bind(this);
    this.addManagedListeners(this.rowNode, {
      dataChanged: e,
      cellChanged: e
    }), this.addManagedListeners(this.beans.eventService, { newColumnsLoaded: e }), this.workOutVisibility();
  }
  onSuppressRowDrag() {
    this.workOutVisibility();
  }
  workOutVisibility() {
    const e = this.gos.get("suppressRowDrag");
    this.setDisplayedOrVisible(e);
  }
}, Jj = class extends vk {
  constructor(e, t, r, n) {
    super(e, r, n), this.beans = t;
  }
  postConstruct() {
    const e = this.workOutVisibility.bind(this);
    this.addManagedListeners(this.beans.eventService, {
      sortChanged: e,
      filterChanged: e,
      columnRowGroupChanged: e,
      newColumnsLoaded: e
    }), this.addManagedListeners(this.rowNode, {
      dataChanged: e,
      cellChanged: e
    }), this.addManagedPropertyListener("suppressRowDrag", this.onSuppressRowDrag.bind(this)), this.workOutVisibility();
  }
  onSuppressRowDrag() {
    this.workOutVisibility();
  }
  workOutVisibility() {
    const t = this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(), r = t && t.shouldPreventRowMove(), n = this.gos.get("suppressRowDrag"), a = this.beans.dragAndDropService.hasExternalDropZones(), u = r && !a || n;
    this.setDisplayedOrVisible(u);
  }
}, Qj = /* @__PURE__ */ new Set(["localEventService", "__objectId", "sticky", "__autoHeights", "checkAutoHeightsDebounced"]), ay = class Zd {
  constructor(t) {
    this.rowIndex = null, this.key = null, this.sourceRowIndex = -1, this.childrenMapped = {}, this.treeNode = null, this.treeNodeFlags = 0, this.displayed = !1, this.rowTop = null, this.oldRowTop = null, this.selectable = !0, this.__objectId = Zd.OBJECT_ID_SEQUENCE++, this.__autoHeights = {}, this.alreadyRendered = !1, this.highlighted = null, this.hovered = !1, this.selected = !1, this.beans = t;
  }
  /**
   * Replaces the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed.
   */
  setData(t) {
    this.setDataCommon(t, !1);
  }
  // similar to setRowData, however it is expected that the data is the same data item. this
  // is intended to be used with Redux type stores, where the whole data can be changed. we are
  // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the
  // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving
  // dataChanged event, will refresh the cells rather than rip them all out (so user can show transitions).
  /**
   * Updates the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed.
   */
  updateData(t) {
    this.setDataCommon(t, !0);
  }
  setDataCommon(t, r) {
    var u;
    const n = this.data;
    this.data = t, this.beans.valueCache.onDataChanged(), this.updateDataOnDetailNode(), this.checkRowSelectable(), this.resetQuickFilterAggregateText();
    const a = this.createDataChangedEvent(t, n, r);
    (u = this.localEventService) == null || u.dispatchEvent(a);
  }
  // when we are doing master / detail, the detail node is lazy created, but then kept around.
  // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data
  // in sync, otherwise expand/collapse of the detail would still show the old values.
  updateDataOnDetailNode() {
    this.detailNode && (this.detailNode.data = this.data);
  }
  createDataChangedEvent(t, r, n) {
    return {
      type: "dataChanged",
      node: this,
      oldData: r,
      newData: t,
      update: n
    };
  }
  getRowIndexString() {
    return this.rowIndex == null ? (Ni(
      "Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."
    ), null) : this.rowPinned === "top" ? Zd.ID_PREFIX_TOP_PINNED + this.rowIndex : this.rowPinned === "bottom" ? Zd.ID_PREFIX_BOTTOM_PINNED + this.rowIndex : this.rowIndex.toString();
  }
  createDaemonNode() {
    const t = new Zd(this.beans);
    return t.id = this.id, t.data = this.data, t.__daemon = !0, t.selected = this.selected, t.level = this.level, t;
  }
  setDataAndId(t, r) {
    var s;
    const n = $r(this.id) ? this.createDaemonNode() : null, a = this.data;
    this.data = t, this.updateDataOnDetailNode(), this.setId(r), this.checkRowSelectable(), this.beans.selectionService.syncInRowNode(this, n);
    const u = this.createDataChangedEvent(t, a, !1);
    (s = this.localEventService) == null || s.dispatchEvent(u);
  }
  checkRowSelectable() {
    const t = k2(this.beans.gos);
    this.setRowSelectable(t ? t(this) : !0);
  }
  setRowSelectable(t, r) {
    if (this.selectable !== t) {
      if (this.selectable = t, this.dispatchRowEvent("selectableChanged"), r)
        return;
      if (Wh(this.beans.gos)) {
        const a = this.calculateSelectedFromChildren();
        this.setSelectedParams({
          newValue: a ?? !1,
          source: "selectableChanged"
        });
        return;
      }
      this.isSelected() && !this.selectable && this.setSelectedParams({
        newValue: !1,
        source: "selectableChanged"
      });
    }
  }
  setId(t) {
    var n;
    const r = ty(this.beans.gos);
    if (r)
      if (this.data) {
        const a = ((n = this.parent) == null ? void 0 : n.getRoute()) ?? [];
        this.id = r({
          data: this.data,
          parentKeys: a.length > 0 ? a : void 0,
          level: this.level,
          rowPinned: this.rowPinned
        }), this.id.startsWith(Zd.ID_PREFIX_ROW_GROUP) && Ni(
          `Row IDs cannot start with ${Zd.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`
        );
      } else
        this.id = void 0;
    else
      this.id = t;
  }
  setRowTop(t) {
    this.oldRowTop = this.rowTop, this.rowTop !== t && (this.rowTop = t, this.dispatchRowEvent("topChanged"), this.setDisplayed(t !== null));
  }
  clearRowTopAndRowIndex() {
    this.oldRowTop = null, this.setRowTop(null), this.setRowIndex(null);
  }
  setHovered(t) {
    this.hovered = t;
  }
  isHovered() {
    return this.hovered;
  }
  setMaster(t) {
    this.master !== t && (this.master && !t && (this.expanded = !1), this.master = t, this.dispatchRowEvent("masterChanged"));
  }
  setGroup(t) {
    this.group !== t && (this.group && !t && (this.expanded = !1), this.group = t, this.updateHasChildren(), this.checkRowSelectable(), this.dispatchRowEvent("groupChanged"));
  }
  /**
   * Sets the row height.
   * Call if you want to change the height initially assigned to the row.
   * After calling, you must call `api.onRowHeightChanged()` so the grid knows it needs to work out the placement of the rows. */
  setRowHeight(t, r = !1) {
    this.rowHeight = t, this.rowHeightEstimated = r, this.dispatchRowEvent("heightChanged");
  }
  setRowAutoHeight(t, r) {
    this.__autoHeights || (this.__autoHeights = {}), this.__autoHeights[r.getId()] = t, t != null && (this.checkAutoHeightsDebounced == null && (this.checkAutoHeightsDebounced = Cs(this.checkAutoHeights.bind(this), 1)), this.checkAutoHeightsDebounced());
  }
  checkAutoHeights() {
    var c;
    let t = !1, r = !0, n = 0;
    const a = this.__autoHeights;
    if (a == null || (this.beans.visibleColsService.getAllAutoHeightCols().forEach((i) => {
      let l = a[i.getId()];
      if (l == null)
        if (this.beans.columnModel.isColSpanActive()) {
          let v = [];
          switch (i.getPinned()) {
            case "left":
              v = this.beans.visibleColsService.getLeftColsForRow(this);
              break;
            case "right":
              v = this.beans.visibleColsService.getRightColsForRow(this);
              break;
            case null:
              v = this.beans.columnViewportService.getColsWithinViewport(this);
              break;
          }
          if (v.includes(i)) {
            t = !0;
            return;
          }
          l = -1;
        } else {
          t = !0;
          return;
        }
      else
        r = !1;
      l > n && (n = l);
    }), t) || ((r || n < 10) && (n = af(this.beans.gos, this).height), n == this.rowHeight))
      return;
    this.setRowHeight(n);
    const s = this.beans.rowModel;
    (c = s.onRowHeightChangedDebounced) == null || c.call(s);
  }
  /**
   * Set the expanded state of this rowNode. Pass `true` to expand and `false` to collapse.
   */
  setExpanded(t, r, n) {
    if (this.expanded === t)
      return;
    this.expanded = t, this.dispatchRowEvent("expandedChanged");
    const a = { ...this.createGlobalRowEvent("rowGroupOpened"), expanded: t, event: r || null };
    this.beans.rowNodeEventThrottle.dispatchExpanded(a, n), this.beans.rowRenderer.refreshCells({ rowNodes: [this] });
  }
  createGlobalRowEvent(t) {
    return this.beans.gos.addGridCommonParams({
      type: t,
      node: this,
      data: this.data,
      rowIndex: this.rowIndex,
      rowPinned: this.rowPinned
    });
  }
  /**
   * Replaces the value on the `rowNode` for the specified column. When complete,
   * the grid will refresh the rendered cell on the required row only.
   * **Note**: This method only fires `onCellEditRequest` when the Grid is in **Read Only** mode.
   *
   * @param colKey The column where the value should be updated
   * @param newValue The new value
   * @param eventSource The source of the event
   * @returns `true` if the value was changed, otherwise `false`.
   */
  setDataValue(t, r, n) {
    const u = typeof t != "string" ? t : this.beans.columnModel.getCol(t) ?? this.beans.columnModel.getColDefCol(t), s = this.beans.valueService.getValueForDisplay(u, this);
    if (this.beans.gos.get("readOnlyEdit"))
      return this.beans.eventService.dispatchEvent({
        type: "cellEditRequest",
        event: null,
        rowIndex: this.rowIndex,
        rowPinned: this.rowPinned,
        column: u,
        colDef: u.getColDef(),
        data: this.data,
        node: this,
        oldValue: s,
        newValue: r,
        value: r,
        source: n
      }), !1;
    const c = this.beans.valueService.setValue(this, u, r, n);
    return this.dispatchCellChangedEvent(u, r, s), this.checkRowSelectable(), c;
  }
  setGroupValue(t, r) {
    const n = this.beans.columnModel.getCol(t);
    mi(this.groupData) && (this.groupData = {});
    const a = n.getColId(), u = this.groupData[a];
    u !== r && (this.groupData[a] = r, this.dispatchCellChangedEvent(n, r, u));
  }
  // sets the data for an aggregation
  setAggData(t) {
    const r = this.aggData;
    if (this.aggData = t, this.localEventService) {
      const n = (a) => {
        const u = this.aggData ? this.aggData[a] : void 0, s = r ? r[a] : void 0;
        if (u === s)
          return;
        const c = this.beans.columnModel.getCol(a);
        c && this.dispatchCellChangedEvent(c, u, s);
      };
      for (const a in r)
        n(a);
      for (const a in t)
        (!r || !(a in r)) && n(a);
    }
  }
  updateHasChildren() {
    let t = this.group && !this.footer || this.childrenAfterGroup && this.childrenAfterGroup.length > 0;
    if (sd(this.beans.gos)) {
      const n = this.beans.gos.get("treeData"), a = this.beans.gos.get("isServerSideGroup");
      t = !this.stub && !this.footer && (n ? !!a && a(this.data) : !!this.group);
    }
    t !== this.__hasChildren && (this.__hasChildren = !!t, this.dispatchRowEvent("hasChildrenChanged"));
  }
  hasChildren() {
    return this.__hasChildren == null && this.updateHasChildren(), this.__hasChildren;
  }
  dispatchCellChangedEvent(t, r, n) {
    var u;
    const a = {
      type: "cellChanged",
      node: this,
      column: t,
      newValue: r,
      oldValue: n
    };
    (u = this.localEventService) == null || u.dispatchEvent(a);
  }
  /**
   * The first time `quickFilter` runs, the grid creates a one-off string representation of the row.
   * This string is then used for the quick filter instead of hitting each column separately.
   * When you edit, using grid editing, this string gets cleared down.
   * However if you edit without using grid editing, you will need to clear this string down for the row to be updated with the new values.
   * Otherwise new values will not work with the `quickFilter`. */
  resetQuickFilterAggregateText() {
    this.quickFilterAggregateText = null;
  }
  /** Returns:
   * - `true` if the node can be expanded, i.e it is a group or master row.
   * - `false` if the node cannot be expanded
   */
  isExpandable() {
    return this.footer ? !1 : this.beans.columnModel.isPivotMode() ? this.hasChildren() && !this.leafGroup : this.hasChildren() || !!this.master;
  }
  /** Returns:
   * - `true` if node is selected,
   * - `false` if the node isn't selected
   * - `undefined` if it's partially selected (group where not all children are selected). */
  isSelected() {
    return this.footer ? this.sibling.isSelected() : this.selected;
  }
  /** Perform a depth-first search of this node and its children. */
  depthFirstSearch(t) {
    this.childrenAfterGroup && this.childrenAfterGroup.forEach((r) => r.depthFirstSearch(t)), t(this);
  }
  // + selectionController.calculatedSelectedForAllGroupNodes()
  calculateSelectedFromChildren() {
    var n;
    let t = !1, r = !1;
    if (!((n = this.childrenAfterGroup) != null && n.length))
      return this.selectable ? this.selected : null;
    for (let a = 0; a < this.childrenAfterGroup.length; a++) {
      const u = this.childrenAfterGroup[a];
      let s = u.isSelected();
      if (!u.selectable) {
        const c = u.calculateSelectedFromChildren();
        if (c === null)
          continue;
        s = c;
      }
      switch (s) {
        case !0:
          t = !0;
          break;
        case !1:
          r = !0;
          break;
        default:
          return;
      }
    }
    if (!(t && r))
      return t ? !0 : r ? !1 : this.selectable ? this.selected : null;
  }
  setSelectedInitialValue(t) {
    this.selected = t;
  }
  dispatchRowEvent(t) {
    var r;
    (r = this.localEventService) == null || r.dispatchEvent({
      type: t,
      node: this
    });
  }
  selectThisNode(t, r, n = "api") {
    const a = !this.selectable && t, u = this.selected === t;
    if (a || u)
      return !1;
    this.selected = t, this.dispatchRowEvent("rowSelected");
    const s = this.sibling;
    return s && s.footer && s.localEventService && s.dispatchRowEvent("rowSelected"), this.beans.eventService.dispatchEvent({
      ...this.createGlobalRowEvent("rowSelected"),
      event: r || null,
      source: n
    }), !0;
  }
  /**
   * Select (or deselect) the node.
   * @param newValue -`true` for selection, `false` for deselection.
   * @param clearSelection - If selecting, then passing `true` will select the node exclusively (i.e. NOT do multi select). If doing deselection, `clearSelection` has no impact.
   * @param source - Source property that will appear in the `selectionChanged` event.
   */
  setSelected(t, r = !1, n = "api") {
    if (typeof n == "boolean") {
      Fr(
        "since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead."
      );
      return;
    }
    this.setSelectedParams({
      newValue: t,
      clearSelection: r,
      rangeSelect: !1,
      source: n
    });
  }
  // this is for internal use only. To make calling code more readable, this is the same method as setSelected except it takes names parameters
  setSelectedParams(t) {
    return this.rowPinned ? (Fr("cannot select pinned rows"), 0) : this.id === void 0 ? (Fr("cannot select node until id for node is known"), 0) : this.beans.selectionService.setNodesSelected({ ...t, nodes: [this.footer ? this.sibling : this] });
  }
  /**
   * Returns:
   * - `true` if node is either pinned to the `top` or `bottom`
   * - `false` if the node isn't pinned
   */
  isRowPinned() {
    return !!this.rowPinned;
  }
  /** Add an event listener. */
  addEventListener(t, r) {
    var a;
    this.localEventService || (this.localEventService = new Gv()), this.beans.frameworkOverrides.shouldWrapOutgoing && !this.frameworkEventListenerService && (this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides), this.frameworkEventListenerService = new G2(this.beans.frameworkOverrides));
    const n = ((a = this.frameworkEventListenerService) == null ? void 0 : a.wrap(r)) ?? r;
    this.localEventService.addEventListener(t, n);
  }
  /** Remove event listener. */
  removeEventListener(t, r) {
    var a;
    if (!this.localEventService)
      return;
    const n = ((a = this.frameworkEventListenerService) == null ? void 0 : a.unwrap(r)) ?? r;
    this.localEventService.removeEventListener(t, n), this.localEventService.noRegisteredListenersExist() && (this.localEventService = null);
  }
  onMouseEnter() {
    this.dispatchRowEvent("mouseEnter");
  }
  onMouseLeave() {
    this.dispatchRowEvent("mouseLeave");
  }
  /**
   * @deprecated v32.2.0 Check `node.detail` then user provided callback `isFullWidthRow` instead.
   *
   * Returns:
   * - `true` if the node is a full width cell
   * - `false` if the node is not a full width cell
   */
  isFullWidthCell() {
    if (Fr(
      "since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option."
    ), this.detail)
      return !0;
    const t = this.beans.gos.getCallback("isFullWidthRow");
    return t ? t({ rowNode: this }) : !1;
  }
  /**
   * Returns the route of keys to the row node. Returns undefined if the node has no key.
   */
  getRoute() {
    if (this.level === -1)
      return [];
    if (this.key == null)
      return;
    const t = [];
    let r = this;
    for (; r && r.key != null; )
      t.push(r.key), r = r.parent;
    return t.reverse();
  }
  createFooter() {
    if (this.sibling)
      return;
    const t = new Zd(this.beans);
    Object.keys(this).forEach((r) => {
      Qj.has(r) || (t[r] = this[r]);
    }), t.footer = !0, t.setRowTop(null), t.setRowIndex(null), t.oldRowTop = null, t.id = "rowGroupFooter_" + this.id, t.sibling = this, this.sibling = t;
  }
  destroyFooter() {
    this.sibling && (this.sibling.setRowTop(null), this.sibling.setRowIndex(null), this.sibling = void 0);
  }
  setFirstChild(t) {
    this.firstChild !== t && (this.firstChild = t, this.dispatchRowEvent("firstChildChanged"));
  }
  setLastChild(t) {
    this.lastChild !== t && (this.lastChild = t, this.dispatchRowEvent("lastChildChanged"));
  }
  setChildIndex(t) {
    this.childIndex !== t && (this.childIndex = t, this.dispatchRowEvent("childIndexChanged"));
  }
  setDisplayed(t) {
    this.displayed !== t && (this.displayed = t, this.dispatchRowEvent("displayedChanged"));
  }
  setDragging(t) {
    this.dragging !== t && (this.dragging = t, this.dispatchRowEvent("draggingChanged"));
  }
  setHighlighted(t) {
    this.highlighted !== t && (this.highlighted = t, this.dispatchRowEvent("rowHighlightChanged"));
  }
  setAllChildrenCount(t) {
    this.allChildrenCount !== t && (this.allChildrenCount = t, this.dispatchRowEvent("allChildrenCountChanged"));
  }
  setRowIndex(t) {
    this.rowIndex !== t && (this.rowIndex = t, this.dispatchRowEvent("rowIndexChanged"));
  }
  setUiLevel(t) {
    this.uiLevel !== t && (this.uiLevel = t, this.dispatchRowEvent("uiLevelChanged"));
  }
};
ay.ID_PREFIX_ROW_GROUP = "row-group-";
ay.ID_PREFIX_TOP_PINNED = "t-";
ay.ID_PREFIX_BOTTOM_PINNED = "b-";
ay.OBJECT_ID_SEQUENCE = 0;
var Oh = ay, qj = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "filterManager", this.advancedFilterModelUpdateQueue = [];
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.dataTypeService = e.dataTypeService, this.quickFilterService = e.quickFilterService, this.advancedFilterService = e.advancedFilterService, this.columnFilterService = e.columnFilterService;
  }
  postConstruct() {
    const e = this.refreshFiltersForAggregations.bind(this), t = this.updateAdvancedFilterColumns.bind(this);
    this.addManagedEventListeners({
      columnValueChanged: e,
      columnPivotChanged: e,
      columnPivotModeChanged: e,
      newColumnsLoaded: t,
      columnVisible: t,
      advancedFilterEnabledChanged: ({ enabled: r }) => this.onAdvancedFilterEnabledChanged(r),
      dataTypesInferred: this.processFilterModelUpdateQueue.bind(this)
    }), this.externalFilterPresent = this.isExternalFilterPresentCallback(), this.addManagedPropertyListeners(["isExternalFilterPresent", "doesExternalFilterPass"], () => {
      this.onFilterChanged({ source: "api" });
    }), this.updateAggFiltering(), this.addManagedPropertyListener("groupAggFiltering", () => {
      this.updateAggFiltering(), this.onFilterChanged();
    }), this.addManagedPropertyListener(
      "advancedFilterModel",
      (r) => this.setAdvancedFilterModel(r.currentValue)
    ), this.quickFilterService && this.addManagedListeners(this.quickFilterService, {
      quickFilterChanged: () => this.onFilterChanged({ source: "quickFilter" })
    });
  }
  isExternalFilterPresentCallback() {
    const e = this.gos.getCallback("isExternalFilterPresent");
    return typeof e == "function" ? e({}) : !1;
  }
  doesExternalFilterPass(e) {
    const t = this.gos.get("doesExternalFilterPass");
    return typeof t == "function" ? t(e) : !1;
  }
  setFilterModel(e, t = "api") {
    var r;
    if (this.isAdvancedFilterEnabled()) {
      this.warnAdvancedFilters();
      return;
    }
    (r = this.columnFilterService) == null || r.setFilterModel(e, t);
  }
  getFilterModel() {
    var e;
    return ((e = this.columnFilterService) == null ? void 0 : e.getFilterModel()) ?? {};
  }
  isColumnFilterPresent() {
    var e;
    return !!((e = this.columnFilterService) != null && e.isColumnFilterPresent());
  }
  isAggregateFilterPresent() {
    var e;
    return !!((e = this.columnFilterService) != null && e.isAggregateFilterPresent());
  }
  isExternalFilterPresent() {
    return this.externalFilterPresent;
  }
  isChildFilterPresent() {
    return this.isColumnFilterPresent() || this.isQuickFilterPresent() || this.isExternalFilterPresent() || this.isAdvancedFilterPresent();
  }
  isAdvancedFilterPresent() {
    return this.isAdvancedFilterEnabled() && this.advancedFilterService.isFilterPresent();
  }
  onAdvancedFilterEnabledChanged(e) {
    var t, r;
    e ? (t = this.columnFilterService) != null && t.disableColumnFilters() && this.onFilterChanged({ source: "advancedFilter" }) : (r = this.advancedFilterService) != null && r.isFilterPresent() && (this.advancedFilterService.setModel(null), this.onFilterChanged({ source: "advancedFilter" }));
  }
  isAdvancedFilterEnabled() {
    var e;
    return !!((e = this.advancedFilterService) != null && e.isEnabled());
  }
  isAdvancedFilterHeaderActive() {
    return this.isAdvancedFilterEnabled() && this.advancedFilterService.isHeaderActive();
  }
  isAnyFilterPresent() {
    return this.isQuickFilterPresent() || this.isColumnFilterPresent() || this.isAggregateFilterPresent() || this.isExternalFilterPresent() || this.isAdvancedFilterPresent();
  }
  resetQuickFilterCache() {
    var e;
    (e = this.quickFilterService) == null || e.resetQuickFilterCache();
  }
  refreshFiltersForAggregations() {
    lT(this.gos) && this.onFilterChanged();
  }
  onFilterChanged(e = {}) {
    const { source: t, additionalEventAttributes: r, columns: n = [] } = e;
    this.externalFilterPresent = this.isExternalFilterPresentCallback(), (this.columnFilterService ? this.columnFilterService.updateBeforeFilterChanged(e) : Ia.resolve()).then(() => {
      var u;
      const a = {
        source: t,
        type: "filterChanged",
        columns: n
      };
      r && rs(a, r), this.eventService.dispatchEvent(a), (u = this.columnFilterService) == null || u.updateAfterFilterChanged();
    });
  }
  isSuppressFlashingCellsBecauseFiltering() {
    var e;
    return !!((e = this.columnFilterService) != null && e.isSuppressFlashingCellsBecauseFiltering());
  }
  isQuickFilterPresent() {
    var e;
    return !!((e = this.quickFilterService) != null && e.isQuickFilterPresent());
  }
  updateAggFiltering() {
    this.aggFiltering = !!lT(this.gos);
  }
  isAggregateQuickFilterPresent() {
    return this.isQuickFilterPresent() && this.shouldApplyQuickFilterAfterAgg();
  }
  isNonAggregateQuickFilterPresent() {
    return this.isQuickFilterPresent() && !this.shouldApplyQuickFilterAfterAgg();
  }
  shouldApplyQuickFilterAfterAgg() {
    return (this.aggFiltering || this.columnModel.isPivotMode()) && !this.gos.get("applyQuickFilterBeforePivotOrAgg");
  }
  doesRowPassOtherFilters(e, t) {
    return this.doesRowPassFilter({ rowNode: t, filterInstanceToSkip: e });
  }
  doesRowPassAggregateFilters(e) {
    return !(this.isAggregateQuickFilterPresent() && !this.quickFilterService.doesRowPassQuickFilter(e.rowNode) || this.isAggregateFilterPresent() && !this.columnFilterService.doAggregateFiltersPass(e.rowNode, e.filterInstanceToSkip));
  }
  doesRowPassFilter(e) {
    return !(this.isNonAggregateQuickFilterPresent() && !this.quickFilterService.doesRowPassQuickFilter(e.rowNode) || this.isExternalFilterPresent() && !this.doesExternalFilterPass(e.rowNode) || this.isColumnFilterPresent() && !this.columnFilterService.doColumnFiltersPass(e.rowNode, e.filterInstanceToSkip) || this.isAdvancedFilterPresent() && !this.advancedFilterService.doesFilterPass(e.rowNode));
  }
  isFilterActive(e) {
    var t;
    return !!((t = this.columnFilterService) != null && t.isFilterActive(e));
  }
  getOrCreateFilterWrapper(e) {
    var t;
    return ((t = this.columnFilterService) == null ? void 0 : t.getOrCreateFilterWrapper(e)) ?? null;
  }
  getDefaultFloatingFilter(e) {
    return this.columnFilterService.getDefaultFloatingFilter(e);
  }
  createFilterParams(e, t) {
    return this.columnFilterService.createFilterParams(e, t);
  }
  // for group filters, can change dynamically whether they are allowed or not
  isFilterAllowed(e) {
    var t;
    return this.isAdvancedFilterEnabled() ? !1 : !!((t = this.columnFilterService) != null && t.isFilterAllowed(e));
  }
  getFloatingFilterCompDetails(e, t) {
    var r;
    return (r = this.columnFilterService) == null ? void 0 : r.getFloatingFilterCompDetails(e, t);
  }
  getCurrentFloatingFilterParentModel(e) {
    var t;
    return (t = this.columnFilterService) == null ? void 0 : t.getCurrentFloatingFilterParentModel(e);
  }
  // destroys the filter, so it no longer takes part
  destroyFilter(e, t = "api") {
    var r;
    (r = this.columnFilterService) == null || r.destroyFilter(e, t);
  }
  areFilterCompsDifferent(e, t) {
    var r;
    return !!((r = this.columnFilterService) != null && r.areFilterCompsDifferent(e, t));
  }
  getAdvancedFilterModel() {
    return this.isAdvancedFilterEnabled() ? this.advancedFilterService.getModel() : null;
  }
  setAdvancedFilterModel(e) {
    var t;
    if (this.isAdvancedFilterEnabled()) {
      if ((t = this.dataTypeService) != null && t.isPendingInference()) {
        this.advancedFilterModelUpdateQueue.push(e);
        return;
      }
      this.advancedFilterService.setModel(e ?? null), this.onFilterChanged({ source: "advancedFilter" });
    }
  }
  toggleAdvancedFilterBuilder(e, t) {
    this.isAdvancedFilterEnabled() && this.advancedFilterService.getCtrl().toggleFilterBuilder({ source: t, force: e });
  }
  updateAdvancedFilterColumns() {
    this.isAdvancedFilterEnabled() && this.advancedFilterService.updateValidity() && this.onFilterChanged({ source: "advancedFilter" });
  }
  hasFloatingFilters() {
    var e;
    return this.isAdvancedFilterEnabled() ? !1 : !!((e = this.columnFilterService) != null && e.hasFloatingFilters());
  }
  getFilterInstance(e, t) {
    var r;
    if (this.isAdvancedFilterEnabled()) {
      this.warnAdvancedFilters();
      return;
    }
    return (r = this.columnFilterService) == null ? void 0 : r.getFilterInstance(e, t);
  }
  getColumnFilterInstance(e) {
    var t;
    return this.isAdvancedFilterEnabled() ? (this.warnAdvancedFilters(), Promise.resolve(void 0)) : ((t = this.columnFilterService) == null ? void 0 : t.getColumnFilterInstance(e)) ?? Promise.resolve(void 0);
  }
  warnAdvancedFilters() {
    Fr("Column Filter API methods have been disabled as Advanced Filters are enabled.");
  }
  setupAdvancedFilterHeaderComp(e) {
    var t;
    (t = this.advancedFilterService) == null || t.getCtrl().setupHeaderComp(e);
  }
  getHeaderRowCount() {
    return this.isAdvancedFilterHeaderActive() ? 1 : 0;
  }
  getHeaderHeight() {
    return this.isAdvancedFilterHeaderActive() ? this.advancedFilterService.getCtrl().getHeaderHeight() : 0;
  }
  processFilterModelUpdateQueue() {
    this.advancedFilterModelUpdateQueue.forEach((e) => this.setAdvancedFilterModel(e)), this.advancedFilterModelUpdateQueue = [];
  }
  getColumnFilterModel(e) {
    var t;
    return (t = this.columnFilterService) == null ? void 0 : t.getColumnFilterModel(e);
  }
  setColumnFilterModel(e, t) {
    var r;
    return this.isAdvancedFilterEnabled() ? (this.warnAdvancedFilters(), Promise.resolve()) : ((r = this.columnFilterService) == null ? void 0 : r.setColumnFilterModel(e, t)) ?? Promise.resolve();
  }
  setColDefPropertiesForDataType(e, t, r) {
    var n;
    (n = this.columnFilterService) == null || n.setColDefPropertiesForDataType(e, t, r);
  }
}, eY = class extends na {
  constructor(e, t) {
    super(
      /* html */
      '<div class="ag-filter"></div>'
    ), this.column = e, this.source = t, this.filterWrapper = null;
  }
  wireBeans(e) {
    this.filterManager = e.filterManager, this.columnModel = e.columnModel;
  }
  postConstruct() {
    this.createFilter(!0), this.addManagedEventListeners({ filterDestroyed: this.onFilterDestroyed.bind(this) });
  }
  hasFilter() {
    return !!this.filterWrapper;
  }
  getFilter() {
    var e;
    return ((e = this.filterWrapper) == null ? void 0 : e.filterPromise) ?? null;
  }
  afterInit() {
    var e, t;
    return ((t = (e = this.filterWrapper) == null ? void 0 : e.filterPromise) == null ? void 0 : t.then(() => {
    })) ?? Ia.resolve();
  }
  afterGuiAttached(e) {
    var t, r;
    (r = (t = this.filterWrapper) == null ? void 0 : t.filterPromise) == null || r.then((n) => {
      var a;
      (a = n == null ? void 0 : n.afterGuiAttached) == null || a.call(n, e);
    });
  }
  afterGuiDetached() {
    var e, t;
    (t = (e = this.filterWrapper) == null ? void 0 : e.filterPromise) == null || t.then((r) => {
      var n;
      (n = r == null ? void 0 : r.afterGuiDetached) == null || n.call(r);
    });
  }
  createFilter(e) {
    var n, a;
    const { column: t, source: r } = this;
    this.filterWrapper = ((n = this.filterManager) == null ? void 0 : n.getOrCreateFilterWrapper(t)) ?? null, (a = this.filterWrapper) != null && a.filterPromise && this.filterWrapper.filterPromise.then((u) => {
      const s = u.getGui();
      $r(s) || Fr(`getGui method from filter returned ${s}; it should be a DOM element.`), this.appendChild(s), e && this.eventService.dispatchEvent({
        type: "filterOpened",
        column: t,
        source: r,
        eGui: this.getGui()
      });
    });
  }
  onFilterDestroyed(e) {
    (e.source === "api" || e.source === "paramsUpdated") && e.column.getId() === this.column.getId() && this.columnModel.getColDefCol(this.column) && (Qs(this.getGui()), this.createFilter());
  }
  destroy() {
    this.filterWrapper = null, super.destroy();
  }
}, gk = "ag-resizer-wrapper", Xd = (e, t) => `<div data-ref="${e}Resizer" class="ag-resizer ag-resizer-${t}"></div>`, tY = (
  /* html */
  `<div class="${gk}">
        ${Xd("eTopLeft", "topLeft")}
        ${Xd("eTop", "top")}
        ${Xd("eTopRight", "topRight")}
        ${Xd("eRight", "right")}
        ${Xd("eBottomRight", "bottomRight")}
        ${Xd("eBottom", "bottom")}
        ${Xd("eBottomLeft", "bottomLeft")}
        ${Xd("eLeft", "left")}
    </div>`
), rY = class extends mr {
  constructor(e, t) {
    super(), this.element = e, this.dragStartPosition = {
      x: 0,
      y: 0
    }, this.position = {
      x: 0,
      y: 0
    }, this.lastSize = {
      width: -1,
      height: -1
    }, this.positioned = !1, this.resizersAdded = !1, this.resizeListeners = [], this.boundaryEl = null, this.isResizing = !1, this.isMoving = !1, this.resizable = {}, this.movable = !1, this.currentResizer = null, this.config = Object.assign({}, { popup: !1 }, t);
  }
  wireBeans(e) {
    this.popupService = e.popupService, this.resizeObserverService = e.resizeObserverService, this.dragService = e.dragService;
  }
  center() {
    const { clientHeight: e, clientWidth: t } = this.offsetParent, r = t / 2 - this.getWidth() / 2, n = e / 2 - this.getHeight() / 2;
    this.offsetElement(r, n);
  }
  initialisePosition() {
    if (this.positioned)
      return;
    const { centered: e, forcePopupParentAsOffsetParent: t, minWidth: r, width: n, minHeight: a, height: u, x: s, y: c } = this.config;
    this.offsetParent || this.setOffsetParent();
    let i = 0, l = 0;
    const v = lc(this.element);
    if (v) {
      const f = this.findBoundaryElement(), p = window.getComputedStyle(f);
      if (p.minWidth != null) {
        const g = f.offsetWidth - this.element.offsetWidth;
        l = parseInt(p.minWidth, 10) - g;
      }
      if (p.minHeight != null) {
        const g = f.offsetHeight - this.element.offsetHeight;
        i = parseInt(p.minHeight, 10) - g;
      }
    }
    if (this.minHeight = a || i, this.minWidth = r || l, n && this.setWidth(n), u && this.setHeight(u), (!n || !u) && this.refreshSize(), e)
      this.center();
    else if (s || c)
      this.offsetElement(s, c);
    else if (v && t) {
      let f = this.boundaryEl, p = !0;
      if (f || (f = this.findBoundaryElement(), p = !1), f) {
        const g = parseFloat(f.style.top), y = parseFloat(f.style.left);
        p ? this.offsetElement(isNaN(y) ? 0 : y, isNaN(g) ? 0 : g) : this.setPosition(y, g);
      }
    }
    this.positioned = !!this.offsetParent;
  }
  isPositioned() {
    return this.positioned;
  }
  getPosition() {
    return this.position;
  }
  setMovable(e, t) {
    if (!this.config.popup || e === this.movable)
      return;
    this.movable = e;
    const r = this.moveElementDragListener || {
      eElement: t,
      onDragStart: this.onMoveStart.bind(this),
      onDragging: this.onMove.bind(this),
      onDragStop: this.onMoveEnd.bind(this)
    };
    e ? (this.dragService.addDragSource(r), this.moveElementDragListener = r) : (this.dragService.removeDragSource(r), this.moveElementDragListener = void 0);
  }
  setResizable(e) {
    if (this.clearResizeListeners(), e ? this.addResizers() : this.removeResizers(), typeof e == "boolean") {
      if (e === !1)
        return;
      e = {
        topLeft: e,
        top: e,
        topRight: e,
        right: e,
        bottomRight: e,
        bottom: e,
        bottomLeft: e,
        left: e
      };
    }
    Object.keys(e).forEach((t) => {
      const n = !!e[t], a = this.getResizerElement(t), u = {
        dragStartPixels: 0,
        eElement: a,
        onDragStart: (s) => this.onResizeStart(s, t),
        onDragging: this.onResize.bind(this),
        onDragStop: (s) => this.onResizeEnd(s, t)
      };
      (n || !this.isAlive() && !n) && (n ? (this.dragService.addDragSource(u), this.resizeListeners.push(u), a.style.pointerEvents = "all") : a.style.pointerEvents = "none", this.resizable[t] = n);
    });
  }
  removeSizeFromEl() {
    this.element.style.removeProperty("height"), this.element.style.removeProperty("width"), this.element.style.removeProperty("flex");
  }
  restoreLastSize() {
    this.element.style.flex = "0 0 auto";
    const { height: e, width: t } = this.lastSize;
    t !== -1 && (this.element.style.width = `${t}px`), e !== -1 && (this.element.style.height = `${e}px`);
  }
  getHeight() {
    return this.element.offsetHeight;
  }
  setHeight(e) {
    const { popup: t } = this.config, r = this.element;
    let n = !1;
    if (typeof e == "string" && e.indexOf("%") !== -1)
      Am(r, e), e = tk(r), n = !0;
    else if (e = Math.max(this.minHeight, e), this.positioned) {
      const a = this.getAvailableHeight();
      a && e > a && (e = a);
    }
    this.getHeight() !== e && (n ? (r.style.maxHeight = "unset", r.style.minHeight = "unset") : t ? Am(r, e) : (r.style.height = `${e}px`, r.style.flex = "0 0 auto", this.lastSize.height = typeof e == "number" ? e : parseFloat(e)));
  }
  getAvailableHeight() {
    const { popup: e, forcePopupParentAsOffsetParent: t } = this.config;
    this.positioned || this.initialisePosition();
    const { clientHeight: r } = this.offsetParent;
    if (!r)
      return null;
    const n = this.element.getBoundingClientRect(), a = this.offsetParent.getBoundingClientRect(), u = e ? this.position.y : n.top, s = e ? 0 : a.top;
    let c = 0;
    if (t) {
      const l = this.element.parentElement;
      if (l) {
        const { bottom: v } = l.getBoundingClientRect();
        c = v - n.bottom;
      }
    }
    return r + s - u - c;
  }
  getWidth() {
    return this.element.offsetWidth;
  }
  setWidth(e) {
    const t = this.element, { popup: r } = this.config;
    let n = !1;
    if (typeof e == "string" && e.indexOf("%") !== -1)
      pu(t, e), e = g1(t), n = !0;
    else if (this.positioned) {
      e = Math.max(this.minWidth, e);
      const { clientWidth: a } = this.offsetParent, u = r ? this.position.x : this.element.getBoundingClientRect().left;
      a && e + u > a && (e = a - u);
    }
    this.getWidth() !== e && (n ? (t.style.maxWidth = "unset", t.style.minWidth = "unset") : this.config.popup ? pu(t, e) : (t.style.width = `${e}px`, t.style.flex = " unset", this.lastSize.width = typeof e == "number" ? e : parseFloat(e)));
  }
  offsetElement(e = 0, t = 0) {
    const { forcePopupParentAsOffsetParent: r } = this.config, n = r ? this.boundaryEl : this.element;
    n && (this.popupService.positionPopup({
      ePopup: n,
      keepWithinBounds: !0,
      skipObserver: this.movable || this.isResizable(),
      updatePosition: () => ({ x: e, y: t })
    }), this.setPosition(parseFloat(n.style.left), parseFloat(n.style.top)));
  }
  constrainSizeToAvailableHeight(e) {
    if (!this.config.forcePopupParentAsOffsetParent)
      return;
    const t = () => {
      const r = this.getAvailableHeight();
      this.element.style.setProperty("max-height", `${r}px`);
    };
    e ? this.resizeObserverSubscriber = this.resizeObserverService.observeResize(
      this.popupService.getPopupParent(),
      t
    ) : (this.element.style.removeProperty("max-height"), this.resizeObserverSubscriber && (this.resizeObserverSubscriber(), this.resizeObserverSubscriber = void 0));
  }
  setPosition(e, t) {
    this.position.x = e, this.position.y = t;
  }
  updateDragStartPosition(e, t) {
    this.dragStartPosition = { x: e, y: t };
  }
  calculateMouseMovement(e) {
    const { e: t, isLeft: r, isTop: n, anywhereWithin: a, topBuffer: u } = e, s = t.clientX - this.dragStartPosition.x, c = t.clientY - this.dragStartPosition.y, i = this.shouldSkipX(t, !!r, !!a, s) ? 0 : s, l = this.shouldSkipY(t, !!n, u, c) ? 0 : c;
    return { movementX: i, movementY: l };
  }
  shouldSkipX(e, t, r, n) {
    const a = this.element.getBoundingClientRect(), u = this.offsetParent.getBoundingClientRect(), s = this.boundaryEl.getBoundingClientRect(), c = this.config.popup ? this.position.x : a.left;
    let i = c <= 0 && u.left >= e.clientX || u.right <= e.clientX && u.right <= s.right;
    return i ? !0 : (t ? i = // skip if we are moving to the left and the cursor
    // is positioned to the right of the left side anchor
    n < 0 && e.clientX > c + u.left || // skip if we are moving to the right and the cursor
    // is positioned to the left of the dialog
    n > 0 && e.clientX < c + u.left : r ? i = n < 0 && e.clientX > s.right || n > 0 && e.clientX < c + u.left : i = // if the movement is bound to the right side of the dialog
    // we skip if we are moving to the left and the cursor
    // is to the right of the dialog
    n < 0 && e.clientX > s.right || // or skip if we are moving to the right and the cursor
    // is to the left of the right side anchor
    n > 0 && e.clientX < s.right, i);
  }
  shouldSkipY(e, t, r = 0, n) {
    const a = this.element.getBoundingClientRect(), u = this.offsetParent.getBoundingClientRect(), s = this.boundaryEl.getBoundingClientRect(), c = this.config.popup ? this.position.y : a.top;
    let i = c <= 0 && u.top >= e.clientY || u.bottom <= e.clientY && u.bottom <= s.bottom;
    return i ? !0 : (t ? i = // skip if we are moving to towards top and the cursor is
    // below the top anchor + topBuffer
    // note: topBuffer is used when moving the dialog using the title bar
    n < 0 && e.clientY > c + u.top + r || // skip if we are moving to the bottom and the cursor is
    // above the top anchor
    n > 0 && e.clientY < c + u.top : i = // skip if we are moving towards the top and the cursor
    // is below the bottom anchor
    n < 0 && e.clientY > s.bottom || // skip if we are moving towards the bottom and the cursor
    // is above the bottom anchor
    n > 0 && e.clientY < s.bottom, i);
  }
  createResizeMap() {
    const e = this.element;
    this.resizerMap = {
      topLeft: { element: e.querySelector("[data-ref=eTopLeftResizer]") },
      top: { element: e.querySelector("[data-ref=eTopResizer]") },
      topRight: { element: e.querySelector("[data-ref=eTopRightResizer]") },
      right: { element: e.querySelector("[data-ref=eRightResizer]") },
      bottomRight: { element: e.querySelector("[data-ref=eBottomRightResizer]") },
      bottom: { element: e.querySelector("[data-ref=eBottomResizer]") },
      bottomLeft: { element: e.querySelector("[data-ref=eBottomLeftResizer]") },
      left: { element: e.querySelector("[data-ref=eLeftResizer]") }
    };
  }
  addResizers() {
    if (this.resizersAdded)
      return;
    const e = this.element;
    if (!e)
      return;
    const r = new DOMParser().parseFromString(tY, "text/html").body;
    e.appendChild(r.firstChild), this.createResizeMap(), this.resizersAdded = !0;
  }
  removeResizers() {
    this.resizerMap = void 0;
    const e = this.element.querySelector(`.${gk}`);
    e && this.element.removeChild(e), this.resizersAdded = !1;
  }
  getResizerElement(e) {
    return this.resizerMap[e].element;
  }
  onResizeStart(e, t) {
    this.boundaryEl = this.findBoundaryElement(), this.positioned || this.initialisePosition(), this.currentResizer = {
      isTop: !!t.match(/top/i),
      isRight: !!t.match(/right/i),
      isBottom: !!t.match(/bottom/i),
      isLeft: !!t.match(/left/i)
    }, this.element.classList.add("ag-resizing"), this.resizerMap[t].element.classList.add("ag-active");
    const { popup: r, forcePopupParentAsOffsetParent: n } = this.config;
    !r && !n && this.applySizeToSiblings(this.currentResizer.isBottom || this.currentResizer.isTop), this.isResizing = !0, this.updateDragStartPosition(e.clientX, e.clientY);
  }
  getSiblings() {
    const t = this.element.parentElement;
    return t ? Array.prototype.slice.call(t.children).filter((r) => !r.classList.contains("ag-hidden")) : null;
  }
  getMinSizeOfSiblings() {
    const e = this.getSiblings() || [];
    let t = 0, r = 0;
    for (let n = 0; n < e.length; n++) {
      const a = e[n], u = !!a.style.flex && a.style.flex !== "0 0 auto";
      if (a === this.element)
        continue;
      let s = this.minHeight || 0, c = this.minWidth || 0;
      if (u) {
        const i = window.getComputedStyle(a);
        i.minHeight && (s = parseInt(i.minHeight, 10)), i.minWidth && (c = parseInt(i.minWidth, 10));
      } else
        s = a.offsetHeight, c = a.offsetWidth;
      t += s, r += c;
    }
    return { height: t, width: r };
  }
  applySizeToSiblings(e) {
    let t = null;
    const r = this.getSiblings();
    if (r) {
      for (let n = 0; n < r.length; n++) {
        const a = r[n];
        a !== t && (e ? a.style.height = `${a.offsetHeight}px` : a.style.width = `${a.offsetWidth}px`, a.style.flex = "0 0 auto", a === this.element && (t = r[n + 1]));
      }
      t && (t.style.removeProperty("height"), t.style.removeProperty("min-height"), t.style.removeProperty("max-height"), t.style.flex = "1 1 auto");
    }
  }
  isResizable() {
    return Object.values(this.resizable).some((e) => e);
  }
  onResize(e) {
    if (!this.isResizing || !this.currentResizer)
      return;
    const { popup: t, forcePopupParentAsOffsetParent: r } = this.config, { isTop: n, isRight: a, isBottom: u, isLeft: s } = this.currentResizer, c = a || s, i = u || n, { movementX: l, movementY: v } = this.calculateMouseMovement({ e, isLeft: s, isTop: n }), f = this.position.x, p = this.position.y;
    let g = 0, y = 0;
    if (c && l) {
      const C = s ? -1 : 1, m = this.getWidth(), h = m + l * C;
      let w = !1;
      s && (g = m - h, (f + g <= 0 || h <= this.minWidth) && (w = !0, g = 0)), w || this.setWidth(h);
    }
    if (i && v) {
      const C = n ? -1 : 1, m = this.getHeight(), h = m + v * C;
      let w = !1;
      n ? (y = m - h, (p + y <= 0 || h <= this.minHeight) && (w = !0, y = 0)) : !this.config.popup && !this.config.forcePopupParentAsOffsetParent && m < h && this.getMinSizeOfSiblings().height + h > this.element.parentElement.offsetHeight && (w = !0), w || this.setHeight(h);
    }
    this.updateDragStartPosition(e.clientX, e.clientY), ((t || r) && g || y) && this.offsetElement(f + g, p + y);
  }
  onResizeEnd(e, t) {
    this.isResizing = !1, this.currentResizer = null, this.boundaryEl = null, this.element.classList.remove("ag-resizing"), this.resizerMap[t].element.classList.remove("ag-active"), this.dispatchLocalEvent({ type: "resize" });
  }
  refreshSize() {
    const e = this.element;
    this.config.popup && (this.config.width || this.setWidth(e.offsetWidth), this.config.height || this.setHeight(e.offsetHeight));
  }
  onMoveStart(e) {
    this.boundaryEl = this.findBoundaryElement(), this.positioned || this.initialisePosition(), this.isMoving = !0, this.element.classList.add("ag-moving"), this.updateDragStartPosition(e.clientX, e.clientY);
  }
  onMove(e) {
    if (!this.isMoving)
      return;
    const { x: t, y: r } = this.position;
    let n;
    this.config.calculateTopBuffer && (n = this.config.calculateTopBuffer());
    const { movementX: a, movementY: u } = this.calculateMouseMovement({
      e,
      isTop: !0,
      anywhereWithin: !0,
      topBuffer: n
    });
    this.offsetElement(t + a, r + u), this.updateDragStartPosition(e.clientX, e.clientY);
  }
  onMoveEnd() {
    this.isMoving = !1, this.boundaryEl = null, this.element.classList.remove("ag-moving");
  }
  setOffsetParent() {
    this.config.forcePopupParentAsOffsetParent ? this.offsetParent = this.popupService.getPopupParent() : this.offsetParent = this.element.offsetParent;
  }
  findBoundaryElement() {
    let e = this.element;
    for (; e; ) {
      if (window.getComputedStyle(e).position !== "static")
        return e;
      e = e.parentElement;
    }
    return this.element;
  }
  clearResizeListeners() {
    for (; this.resizeListeners.length; ) {
      const e = this.resizeListeners.pop();
      this.dragService.removeDragSource(e);
    }
  }
  destroy() {
    super.destroy(), this.moveElementDragListener && this.dragService.removeDragSource(this.moveElementDragListener), this.constrainSizeToAvailableHeight(!1), this.clearResizeListeners(), this.removeResizers();
  }
}, mk = class yk extends mr {
  constructor(t, r = {}) {
    super(), this.eFocusableElement = t, this.callbacks = r, this.callbacks = {
      shouldStopEventPropagation: () => !1,
      onTabKeyDown: (n) => {
        if (n.defaultPrevented)
          return;
        const a = this.focusService.findNextFocusableElement(this.eFocusableElement, !1, n.shiftKey);
        a && (a.focus(), n.preventDefault());
      },
      ...r
    };
  }
  wireBeans(t) {
    this.focusService = t.focusService;
  }
  postConstruct() {
    this.eFocusableElement.classList.add(yk.FOCUS_MANAGED_CLASS), this.addKeyDownListeners(this.eFocusableElement), this.callbacks.onFocusIn && this.addManagedElementListeners(this.eFocusableElement, { focusin: this.callbacks.onFocusIn }), this.callbacks.onFocusOut && this.addManagedElementListeners(this.eFocusableElement, { focusout: this.callbacks.onFocusOut });
  }
  addKeyDownListeners(t) {
    this.addManagedElementListeners(t, {
      keydown: (r) => {
        if (!(r.defaultPrevented || Qc(r))) {
          if (this.callbacks.shouldStopEventPropagation(r)) {
            Ev(r);
            return;
          }
          r.key === dr.TAB ? this.callbacks.onTabKeyDown(r) : this.callbacks.handleKeyDown && this.callbacks.handleKeyDown(r);
        }
      }
    });
  }
};
mk.FOCUS_MANAGED_CLASS = "ag-focus-managed";
var $h = mk, Ck = {
  applyFilter: "Apply",
  clearFilter: "Clear",
  resetFilter: "Reset",
  cancelFilter: "Cancel",
  textFilter: "Text Filter",
  numberFilter: "Number Filter",
  dateFilter: "Date Filter",
  setFilter: "Set Filter",
  filterOoo: "Filter...",
  empty: "Choose one",
  equals: "Equals",
  notEqual: "Does not equal",
  lessThan: "Less than",
  greaterThan: "Greater than",
  inRange: "Between",
  inRangeStart: "From",
  inRangeEnd: "To",
  lessThanOrEqual: "Less than or equal to",
  greaterThanOrEqual: "Greater than or equal to",
  contains: "Contains",
  notContains: "Does not contain",
  startsWith: "Begins with",
  endsWith: "Ends with",
  blank: "Blank",
  notBlank: "Not blank",
  before: "Before",
  after: "After",
  andCondition: "AND",
  orCondition: "OR",
  dateFormatOoo: "yyyy-mm-dd"
};
function q2(e, t) {
  return w1(e) ? (e.debounceMs != null && Fr("debounceMs is ignored when apply button is present"), 0) : e.debounceMs != null ? e.debounceMs : t;
}
function w1(e) {
  return !!e.buttons && e.buttons.indexOf("apply") >= 0;
}
var nY = class extends na {
  constructor(e) {
    super(), this.filterNameKey = e, this.applyActive = !1, this.hidePopup = null, this.debouncePending = !1, this.appliedModel = null, this.eFilterBody = In, this.buttonListeners = [];
  }
  wireBeans(e) {
    this.rowModel = e.rowModel;
  }
  postConstruct() {
    this.resetTemplate(), this.createManagedBean(
      new $h(this.getFocusableElement(), {
        handleKeyDown: this.handleKeyDown.bind(this)
      })
    ), this.positionableFeature = new rY(this.getPositionableElement(), {
      forcePopupParentAsOffsetParent: !0
    }), this.createBean(this.positionableFeature);
  }
  // override
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  handleKeyDown(e) {
  }
  getFilterTitle() {
    return this.translate(this.filterNameKey);
  }
  isFilterActive() {
    return !!this.appliedModel;
  }
  resetTemplate(e) {
    let t = this.getGui();
    t && t.removeEventListener("submit", this.onFormSubmit);
    const r = (
      /* html */
      `
            <form class="ag-filter-wrapper">
                <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody">
                    ${this.createBodyTemplate()}
                </div>
            </form>`
    );
    this.setTemplate(r, this.getAgComponents(), e), t = this.getGui(), t && t.addEventListener("submit", this.onFormSubmit);
  }
  isReadOnly() {
    return !!this.providedFilterParams.readOnly;
  }
  init(e) {
    this.setParams(e), this.resetUiToDefaults(!0).then(() => {
      this.updateUiVisibility(), this.setupOnBtApplyDebounce();
    });
  }
  setParams(e) {
    this.providedFilterParams = e, this.applyActive = w1(e), this.resetButtonsPanel(e);
  }
  updateParams(e) {
    this.providedFilterParams = e, this.applyActive = w1(e), this.resetUiToActiveModel(this.getModel(), () => {
      this.updateUiVisibility(), this.setupOnBtApplyDebounce();
    });
  }
  resetButtonsPanel(e, t) {
    const { buttons: r, readOnly: n } = t ?? {}, { buttons: a, readOnly: u } = e;
    if (n === u && l1(r, a))
      return;
    const s = a && a.length > 0 && !this.isReadOnly();
    if (this.eButtonsPanel ? (Qs(this.eButtonsPanel), this.buttonListeners.forEach((l) => l()), this.buttonListeners = []) : s && (this.eButtonsPanel = document.createElement("div"), this.eButtonsPanel.classList.add("ag-filter-apply-panel")), !s) {
      this.eButtonsPanel && _h(this.eButtonsPanel);
      return;
    }
    const c = document.createDocumentFragment(), i = (l) => {
      let v, f;
      switch (l) {
        case "apply":
          v = this.translate("applyFilter"), f = (y) => this.onBtApply(!1, !1, y);
          break;
        case "clear":
          v = this.translate("clearFilter"), f = () => this.onBtClear();
          break;
        case "reset":
          v = this.translate("resetFilter"), f = () => this.onBtReset();
          break;
        case "cancel":
          v = this.translate("cancelFilter"), f = (y) => {
            this.onBtCancel(y);
          };
          break;
        default:
          Fr("Unknown button type specified");
          return;
      }
      const g = jm(
        /* html */
        `<button
                    type="${l === "apply" ? "submit" : "button"}"
                    data-ref="${l}FilterButton"
                    class="ag-button ag-standard-button ag-filter-apply-panel-button"
                >${v}
                </button>`
      );
      this.buttonListeners.push(...this.addManagedElementListeners(g, { click: f })), c.append(g);
    };
    a.forEach((l) => i(l)), this.eButtonsPanel.append(c), this.getGui().appendChild(this.eButtonsPanel);
  }
  // subclasses can override this to provide alternative debounce defaults
  getDefaultDebounceMs() {
    return 0;
  }
  setupOnBtApplyDebounce() {
    const e = q2(this.providedFilterParams, this.getDefaultDebounceMs()), t = Cs(this.checkApplyDebounce.bind(this), e);
    this.onBtApplyDebounce = () => {
      this.debouncePending = !0, t();
    };
  }
  checkApplyDebounce() {
    this.debouncePending && (this.debouncePending = !1, this.onBtApply());
  }
  getModel() {
    return this.appliedModel ? this.appliedModel : null;
  }
  setModel(e) {
    return (e != null ? this.setModelIntoUi(e) : this.resetUiToDefaults()).then(() => {
      this.updateUiVisibility(), this.applyModel("api");
    });
  }
  onBtCancel(e) {
    this.resetUiToActiveModel(this.getModel(), () => {
      this.handleCancelEnd(e);
    });
  }
  handleCancelEnd(e) {
    this.providedFilterParams.closeOnApply && this.close(e);
  }
  resetUiToActiveModel(e, t) {
    const r = () => {
      this.onUiChanged(!1, "prevent"), t == null || t();
    };
    e != null ? this.setModelIntoUi(e).then(r) : this.resetUiToDefaults().then(r);
  }
  onBtClear() {
    this.resetUiToDefaults().then(() => this.onUiChanged());
  }
  onBtReset() {
    this.onBtClear(), this.onBtApply();
  }
  /**
   * Applies changes made in the UI to the filter, and returns true if the model has changed.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  applyModel(e = "api") {
    const t = this.getModelFromUi();
    if (!this.isModelValid(t))
      return !1;
    const r = this.appliedModel;
    return this.appliedModel = t, !this.areModelsEqual(r, t);
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isModelValid(e) {
    return !0;
  }
  onFormSubmit(e) {
    e.preventDefault();
  }
  onBtApply(e = !1, t = !1, r) {
    r && r.preventDefault(), this.applyModel(t ? "rowDataUpdated" : "ui") && this.providedFilterParams.filterChangedCallback({ afterFloatingFilter: e, afterDataChange: t, source: "columnFilter" });
    const { closeOnApply: n } = this.providedFilterParams;
    n && this.applyActive && !e && !t && this.close(r);
  }
  onNewRowsLoaded() {
  }
  close(e) {
    if (!this.hidePopup)
      return;
    const t = e, r = t && t.key;
    let n;
    (r === "Enter" || r === "Space") && (n = { keyboardEvent: t }), this.hidePopup(n), this.hidePopup = null;
  }
  /**
   * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no
   * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can
   * be adjusted by using the apply parameter.
   */
  onUiChanged(e = !1, t) {
    if (this.updateUiVisibility(), this.providedFilterParams.filterModifiedCallback(), this.applyActive && !this.isReadOnly()) {
      const r = this.isModelValid(this.getModelFromUi()), n = this.queryForHtmlElement('[data-ref="applyFilterButton"]');
      n && Um(n, !r);
    }
    e && !t || t === "immediately" ? this.onBtApply(e) : (!this.applyActive && !t || t === "debounce") && this.onBtApplyDebounce();
  }
  afterGuiAttached(e) {
    e && (this.hidePopup = e.hidePopup), this.refreshFilterResizer(e == null ? void 0 : e.container);
  }
  refreshFilterResizer(e) {
    if (!this.positionableFeature || e === "toolPanel")
      return;
    const t = e === "floatingFilter" || e === "columnFilter", { positionableFeature: r, gos: n } = this;
    t ? (r.restoreLastSize(), r.setResizable(
      n.get("enableRtl") ? { bottom: !0, bottomLeft: !0, left: !0 } : { bottom: !0, bottomRight: !0, right: !0 }
    )) : (this.positionableFeature.removeSizeFromEl(), this.positionableFeature.setResizable(!1)), this.positionableFeature.constrainSizeToAvailableHeight(!0);
  }
  afterGuiDetached() {
    this.checkApplyDebounce(), this.positionableFeature && this.positionableFeature.constrainSizeToAvailableHeight(!1);
  }
  refresh(e) {
    const t = this.providedFilterParams;
    return this.providedFilterParams = e, this.resetButtonsPanel(e, t), !0;
  }
  destroy() {
    const e = this.getGui();
    e && e.removeEventListener("submit", this.onFormSubmit), this.hidePopup = null, this.positionableFeature && (this.positionableFeature = this.destroyBean(this.positionableFeature)), this.appliedModel = null, super.destroy();
  }
  translate(e) {
    return this.localeService.getLocaleTextFunc()(e, Ck[e]);
  }
  getCellValue(e) {
    return this.providedFilterParams.getValue(e);
  }
  // override to control positionable feature
  getPositionableElement() {
    return this.eFilterBody;
  }
}, iY = class extends K2 {
  constructor(e) {
    super(e, "ag-radio-button", "radio");
  }
  isSelected() {
    return this.eInput.checked;
  }
  toggle() {
    this.eInput.disabled || this.isSelected() || this.setValue(!0);
  }
  addInputListeners() {
    super.addInputListeners(), this.addManagedEventListeners({ checkboxChanged: this.onChange.bind(this) });
  }
  /**
   * This ensures that if another radio button in the same named group is selected, we deselect this radio button.
   * By default the browser does this for you, but we are managing classes ourselves in order to ensure input
   * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected,
   * not deselected, so we need to use our own event.
   */
  onChange(e) {
    e.selected && e.name && this.eInput.name && this.eInput.name === e.name && e.id && this.eInput.id !== e.id && this.setValue(!1, !0);
  }
}, aY = class extends na {
  constructor(e = "default", t = !1) {
    super(
      /* html */
      `<div class="ag-list ag-${e}-list" role="listbox"></div>`
    ), this.cssIdentifier = e, this.unFocusable = t, this.activeClass = "ag-active-item", this.options = [], this.itemEls = [];
  }
  postConstruct() {
    const e = this.getGui();
    this.addManagedElementListeners(e, { mouseleave: () => this.clearHighlighted() }), !this.unFocusable && this.addManagedElementListeners(e, { keydown: this.handleKeyDown.bind(this) });
  }
  handleKeyDown(e) {
    const t = e.key;
    switch (t) {
      case dr.ENTER:
        if (!this.highlightedEl)
          this.setValue(this.getValue());
        else {
          const r = this.itemEls.indexOf(this.highlightedEl);
          this.setValueByIndex(r);
        }
        break;
      case dr.DOWN:
      case dr.UP:
        e.preventDefault(), this.navigate(t);
        break;
      case dr.PAGE_DOWN:
      case dr.PAGE_UP:
      case dr.PAGE_HOME:
      case dr.PAGE_END:
        e.preventDefault(), this.navigateToPage(t);
        break;
    }
  }
  navigate(e) {
    const t = e === dr.DOWN;
    let r;
    if (!this.highlightedEl)
      r = this.itemEls[t ? 0 : this.itemEls.length - 1];
    else {
      let a = this.itemEls.indexOf(this.highlightedEl) + (t ? 1 : -1);
      a = Math.min(Math.max(a, 0), this.itemEls.length - 1), r = this.itemEls[a];
    }
    this.highlightItem(r);
  }
  navigateToPage(e) {
    if (!this.highlightedEl || this.itemEls.length === 0)
      return;
    const t = this.itemEls.indexOf(this.highlightedEl), r = this.options.length - 1, n = this.itemEls[0].clientHeight, a = Math.floor(this.getGui().clientHeight / n);
    let u = -1;
    e === dr.PAGE_HOME ? u = 0 : e === dr.PAGE_END ? u = r : e === dr.PAGE_DOWN ? u = Math.min(t + a, r) : e === dr.PAGE_UP && (u = Math.max(t - a, 0)), u !== -1 && this.highlightItem(this.itemEls[u]);
  }
  addOptions(e) {
    return e.forEach((t) => this.addOption(t)), this;
  }
  addOption(e) {
    const { value: t, text: r } = e, n = r || t;
    return this.options.push({ value: t, text: n }), this.renderOption(t, n), this.updateIndices(), this;
  }
  clearOptions() {
    this.options = [], this.reset(!0), this.itemEls.forEach((e) => {
      _h(e);
    }), this.itemEls = [];
  }
  updateIndices() {
    const e = this.getGui().querySelectorAll(".ag-list-item");
    e.forEach((t, r) => {
      GU(t, r + 1), NU(t, e.length);
    });
  }
  renderOption(e, t) {
    const r = Va(this.gos), n = r.createElement("div");
    vu(n, "option"), n.classList.add("ag-list-item", `ag-${this.cssIdentifier}-list-item`);
    const a = r.createElement("span");
    n.appendChild(a), a.textContent = t, this.unFocusable || (n.tabIndex = -1), this.itemEls.push(n), this.addManagedListeners(n, {
      mouseover: () => this.highlightItem(n),
      mousedown: (u) => {
        u.preventDefault(), u.stopPropagation(), this.setValue(e);
      }
    }), this.createManagedBean(
      new Bv({
        getTooltipValue: () => t,
        getGui: () => n,
        getLocation: () => "UNKNOWN",
        // only show tooltips for items where the text cannot be fully displayed
        shouldDisplayTooltip: () => a.scrollWidth > a.clientWidth
      })
    ), this.getGui().appendChild(n);
  }
  setValue(e, t) {
    if (this.value === e)
      return this.fireItemSelected(), this;
    if (e == null)
      return this.reset(t), this;
    const r = this.options.findIndex((n) => n.value === e);
    if (r !== -1) {
      const n = this.options[r];
      this.value = n.value, this.displayValue = n.text, this.highlightItem(this.itemEls[r]), t || this.fireChangeEvent();
    }
    return this;
  }
  setValueByIndex(e) {
    return this.setValue(this.options[e].value);
  }
  getValue() {
    return this.value;
  }
  getDisplayValue() {
    return this.displayValue;
  }
  refreshHighlighted() {
    this.clearHighlighted();
    const e = this.options.findIndex((t) => t.value === this.value);
    e !== -1 && this.highlightItem(this.itemEls[e]);
  }
  reset(e) {
    this.value = null, this.displayValue = null, this.clearHighlighted(), e || this.fireChangeEvent();
  }
  highlightItem(e) {
    if (!lc(e))
      return;
    this.clearHighlighted(), this.highlightedEl = e, this.highlightedEl.classList.add(this.activeClass), v1(this.highlightedEl, !0);
    const t = this.getGui(), { scrollTop: r, clientHeight: n } = t, { offsetTop: a, offsetHeight: u } = e;
    (a + u > r + n || a < r) && this.highlightedEl.scrollIntoView({ block: "nearest" }), this.unFocusable || this.highlightedEl.focus();
  }
  clearHighlighted() {
    !this.highlightedEl || !lc(this.highlightedEl) || (this.highlightedEl.classList.remove(this.activeClass), v1(this.highlightedEl, !1), this.highlightedEl = null);
  }
  fireChangeEvent() {
    this.dispatchLocalEvent({ type: "fieldValueChanged" }), this.fireItemSelected();
  }
  fireItemSelected() {
    this.dispatchLocalEvent({ type: "selectedItem" });
  }
}, oY = class extends uk {
  constructor(e) {
    if (super(
      e,
      (e == null ? void 0 : e.template) || /* html */
      `
            <div class="ag-picker-field" role="presentation">
                <div data-ref="eLabel"></div>
                <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">
                    <div data-ref="eDisplayField" class="ag-picker-field-display"></div>
                    <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
                </div>
            </div>`,
      (e == null ? void 0 : e.agComponents) || [],
      e == null ? void 0 : e.className
    ), this.isPickerDisplayed = !1, this.skipClick = !1, this.pickerGap = 4, this.hideCurrentPicker = null, this.eLabel = In, this.eWrapper = In, this.eDisplayField = In, this.eIcon = In, this.ariaRole = e == null ? void 0 : e.ariaRole, this.onPickerFocusIn = this.onPickerFocusIn.bind(this), this.onPickerFocusOut = this.onPickerFocusOut.bind(this), !e)
      return;
    const { pickerGap: t, maxPickerHeight: r, variableWidth: n, minPickerWidth: a, maxPickerWidth: u } = e;
    t != null && (this.pickerGap = t), this.variableWidth = !!n, r != null && this.setPickerMaxHeight(r), a != null && this.setPickerMinWidth(a), u != null && this.setPickerMaxWidth(u);
  }
  wireBeans(e) {
    this.popupService = e.popupService;
  }
  postConstruct() {
    super.postConstruct(), this.setupAria();
    const e = `ag-${this.getCompId()}-display`;
    this.eDisplayField.setAttribute("id", e);
    const t = this.getAriaElement();
    this.addManagedElementListeners(t, { keydown: this.onKeyDown.bind(this) }), this.addManagedElementListeners(this.eLabel, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) }), this.addManagedElementListeners(this.eWrapper, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) });
    const { pickerIcon: r, inputWidth: n } = this.config;
    if (r) {
      const a = $s(r, this.gos);
      a && this.eIcon.appendChild(a);
    }
    n != null && this.setInputWidth(n);
  }
  setupAria() {
    const e = this.getAriaElement();
    e.setAttribute("tabindex", this.gos.get("tabIndex").toString()), p1(e, !1), this.ariaRole && vu(e, this.ariaRole);
  }
  onLabelOrWrapperMouseDown(e) {
    if (e) {
      const t = this.getFocusableElement();
      if (t !== this.eWrapper && (e == null ? void 0 : e.target) === t)
        return;
      e.preventDefault(), this.getFocusableElement().focus();
    }
    if (this.skipClick) {
      this.skipClick = !1;
      return;
    }
    this.isDisabled() || (this.isPickerDisplayed ? this.hidePicker() : this.showPicker());
  }
  onKeyDown(e) {
    switch (e.key) {
      case dr.UP:
      case dr.DOWN:
      case dr.ENTER:
      case dr.SPACE:
        e.preventDefault(), this.onLabelOrWrapperMouseDown();
        break;
      case dr.ESCAPE:
        this.isPickerDisplayed && (e.preventDefault(), e.stopPropagation(), this.hideCurrentPicker && this.hideCurrentPicker());
        break;
    }
  }
  showPicker() {
    this.isPickerDisplayed = !0, this.pickerComponent || (this.pickerComponent = this.createPickerComponent());
    const e = this.pickerComponent.getGui();
    e.addEventListener("focusin", this.onPickerFocusIn), e.addEventListener("focusout", this.onPickerFocusOut), this.hideCurrentPicker = this.renderAndPositionPicker(), this.toggleExpandedStyles(!0);
  }
  renderAndPositionPicker() {
    const e = this.pickerComponent.getGui();
    this.gos.get("suppressScrollWhenPopupsAreOpen") || ([this.destroyMouseWheelFunc] = this.addManagedEventListeners({
      bodyScroll: () => {
        this.hidePicker();
      }
    }));
    const t = this.localeService.getLocaleTextFunc(), { pickerAriaLabelKey: r, pickerAriaLabelValue: n, modalPicker: a = !0 } = this.config, u = {
      modal: a,
      eChild: e,
      closeOnEsc: !0,
      closedCallback: () => {
        const p = DL(this.gos);
        this.beforeHidePicker(), p && this.isAlive() && this.getFocusableElement().focus();
      },
      ariaLabel: t(r, n),
      anchorToElement: this.eWrapper
    };
    e.style.position = "absolute";
    const s = this.popupService.addPopup(u), { maxPickerHeight: c, minPickerWidth: i, maxPickerWidth: l, variableWidth: v } = this;
    v ? (i && (e.style.minWidth = i), e.style.width = Y2(g1(this.eWrapper)), l && (e.style.maxWidth = l)) : b1(e, l ?? g1(this.eWrapper));
    const f = c ?? `${j2(this.popupService.getPopupParent())}px`;
    return e.style.setProperty("max-height", f), this.alignPickerToComponent(), s.hideFunc;
  }
  alignPickerToComponent() {
    if (!this.pickerComponent)
      return;
    const { pickerType: e } = this.config, { pickerGap: t } = this, r = this.gos.get("enableRtl") ? "right" : "left";
    this.popupService.positionPopupByComponent({
      type: e,
      eventSource: this.eWrapper,
      ePopup: this.pickerComponent.getGui(),
      position: "under",
      alignSide: r,
      keepWithinBounds: !0,
      nudgeY: t
    });
  }
  beforeHidePicker() {
    this.destroyMouseWheelFunc && (this.destroyMouseWheelFunc(), this.destroyMouseWheelFunc = void 0), this.toggleExpandedStyles(!1);
    const e = this.pickerComponent.getGui();
    e.removeEventListener("focusin", this.onPickerFocusIn), e.removeEventListener("focusout", this.onPickerFocusOut), this.isPickerDisplayed = !1, this.pickerComponent = void 0, this.hideCurrentPicker = null;
  }
  toggleExpandedStyles(e) {
    if (!this.isAlive())
      return;
    const t = this.getAriaElement();
    p1(t, e), this.eWrapper.classList.toggle("ag-picker-expanded", e), this.eWrapper.classList.toggle("ag-picker-collapsed", !e);
  }
  onPickerFocusIn() {
    this.togglePickerHasFocus(!0);
  }
  onPickerFocusOut(e) {
    var t;
    (t = this.pickerComponent) != null && t.getGui().contains(e.relatedTarget) || this.togglePickerHasFocus(!1);
  }
  togglePickerHasFocus(e) {
    this.pickerComponent && this.eWrapper.classList.toggle("ag-picker-has-focus", e);
  }
  hidePicker() {
    this.hideCurrentPicker && this.hideCurrentPicker();
  }
  setInputWidth(e) {
    return b1(this.eWrapper, e), this;
  }
  getFocusableElement() {
    return this.eWrapper;
  }
  setPickerGap(e) {
    return this.pickerGap = e, this;
  }
  setPickerMinWidth(e) {
    return typeof e == "number" && (e = `${e}px`), this.minPickerWidth = e ?? void 0, this;
  }
  setPickerMaxWidth(e) {
    return typeof e == "number" && (e = `${e}px`), this.maxPickerWidth = e ?? void 0, this;
  }
  setPickerMaxHeight(e) {
    return typeof e == "number" && (e = `${e}px`), this.maxPickerHeight = e ?? void 0, this;
  }
  destroy() {
    this.hidePicker(), super.destroy();
  }
}, eR = class extends oY {
  constructor(e) {
    super({
      pickerAriaLabelKey: "ariaLabelSelectField",
      pickerAriaLabelValue: "Select Field",
      pickerType: "ag-list",
      className: "ag-select",
      pickerIcon: "smallDown",
      ariaRole: "combobox",
      ...e
    });
  }
  postConstruct() {
    super.postConstruct(), this.createListComponent(), this.eWrapper.tabIndex = this.gos.get("tabIndex");
    const { options: e, value: t, placeholder: r } = this.config;
    e != null && this.addOptions(e), t != null && this.setValue(t, !0), r && t == null && (this.eDisplayField.textContent = r), this.addManagedElementListeners(this.eWrapper, { focusout: this.onWrapperFocusOut.bind(this) });
  }
  onWrapperFocusOut(e) {
    this.eWrapper.contains(e.relatedTarget) || this.hidePicker();
  }
  createListComponent() {
    this.listComponent = this.createBean(new aY("select", !0)), this.listComponent.setParentComponent(this);
    const e = this.listComponent.getAriaElement(), t = `ag-select-list-${this.listComponent.getCompId()}`;
    e.setAttribute("id", t), UU(this.getAriaElement(), e), this.listComponent.addManagedListeners(this.listComponent, {
      selectedItem: () => {
        this.hidePicker(), this.dispatchLocalEvent({ type: "selectedItem" });
      }
    }), this.listComponent.addManagedListeners(this.listComponent, {
      fieldValueChanged: () => {
        this.listComponent && (this.setValue(this.listComponent.getValue(), !1, !0), this.hidePicker());
      }
    });
  }
  createPickerComponent() {
    return this.listComponent;
  }
  onKeyDown(e) {
    var r;
    const { key: t } = e;
    switch (t === dr.TAB && this.hidePicker(), t) {
      case dr.ENTER:
      case dr.UP:
      case dr.DOWN:
      case dr.PAGE_UP:
      case dr.PAGE_DOWN:
      case dr.PAGE_HOME:
      case dr.PAGE_END:
        e.preventDefault(), this.isPickerDisplayed ? (r = this.listComponent) == null || r.handleKeyDown(e) : super.onKeyDown(e);
        break;
      case dr.ESCAPE:
        super.onKeyDown(e);
        break;
      case dr.SPACE:
        this.isPickerDisplayed ? e.preventDefault() : super.onKeyDown(e);
        break;
    }
  }
  showPicker() {
    this.listComponent && (super.showPicker(), this.listComponent.refreshHighlighted());
  }
  addOptions(e) {
    return e.forEach((t) => this.addOption(t)), this;
  }
  addOption(e) {
    return this.listComponent.addOption(e), this;
  }
  clearOptions() {
    var e;
    return (e = this.listComponent) == null || e.clearOptions(), this;
  }
  setValue(e, t, r) {
    if (this.value === e || !this.listComponent)
      return this;
    if (r || this.listComponent.setValue(e, !0), this.listComponent.getValue() === this.getValue())
      return this;
    let a = this.listComponent.getDisplayValue();
    return a == null && this.config.placeholder && (a = this.config.placeholder), this.eDisplayField.textContent = a, this.setTooltip({
      newTooltipText: a ?? null,
      shouldDisplayTooltip: () => this.eDisplayField.scrollWidth > this.eDisplayField.clientWidth
    }), super.setValue(e, t);
  }
  destroy() {
    this.listComponent && (this.listComponent = this.destroyBean(this.listComponent)), super.destroy();
  }
}, sY = {
  selector: "AG-SELECT",
  component: eR
}, bk = class {
  constructor() {
    this.customFilterOptions = {};
  }
  init(e, t) {
    this.filterOptions = e.filterOptions || t, this.mapCustomOptions(), this.selectDefaultItem(e);
  }
  getFilterOptions() {
    return this.filterOptions;
  }
  mapCustomOptions() {
    this.filterOptions && this.filterOptions.forEach((e) => {
      if (typeof e == "string")
        return;
      const t = [["displayKey"], ["displayName"], ["predicate", "test"]], r = (n) => n.some((a) => e[a] != null) ? !0 : (Fr(`ignoring FilterOptionDef as it doesn't contain one of '${n}'`), !1);
      if (!t.every(r)) {
        this.filterOptions = this.filterOptions.filter((n) => n === e) || [];
        return;
      }
      this.customFilterOptions[e.displayKey] = e;
    });
  }
  selectDefaultItem(e) {
    if (e.defaultOption)
      this.defaultOption = e.defaultOption;
    else if (this.filterOptions.length >= 1) {
      const t = this.filterOptions[0];
      typeof t == "string" ? this.defaultOption = t : t.displayKey ? this.defaultOption = t.displayKey : Fr("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'");
    } else
      Fr("no filter options for filter");
  }
  getDefaultOption() {
    return this.defaultOption;
  }
  getCustomOption(e) {
    return this.customFilterOptions[e];
  }
}, wk = class extends nY {
  constructor() {
    super(...arguments), this.eTypes = [], this.eJoinOperatorPanels = [], this.eJoinOperatorsAnd = [], this.eJoinOperatorsOr = [], this.eConditionBodies = [], this.listener = () => this.onUiChanged(), this.lastUiCompletePosition = null, this.joinOperatorId = 0;
  }
  getNumberOfInputs(e) {
    const t = this.optionsFactory.getCustomOption(e);
    if (t) {
      const { numberOfInputs: n } = t;
      return n ?? 1;
    }
    return e && ["empty", "notBlank", "blank"].indexOf(e) >= 0 ? 0 : e === "inRange" ? 2 : 1;
  }
  // floating filter calls this when user applies filter from floating filter
  onFloatingFilterChanged(e, t) {
    this.setTypeFromFloatingFilter(e), this.setValueFromFloatingFilter(t), this.onUiChanged(!0);
  }
  setTypeFromFloatingFilter(e) {
    this.eTypes.forEach((t, r) => {
      r === 0 ? t.setValue(e, !0) : t.setValue(this.optionsFactory.getDefaultOption(), !0);
    });
  }
  getModelFromUi() {
    const e = this.getUiCompleteConditions();
    return e.length === 0 ? null : this.maxNumConditions > 1 && e.length > 1 ? {
      filterType: this.getFilterType(),
      operator: this.getJoinOperator(),
      conditions: e
    } : e[0];
  }
  getConditionTypes() {
    return this.eTypes.map((e) => e.getValue());
  }
  getConditionType(e) {
    return this.eTypes[e].getValue();
  }
  getJoinOperator() {
    return this.eJoinOperatorsOr.length === 0 ? this.defaultJoinOperator : this.eJoinOperatorsOr[0].getValue() === !0 ? "OR" : "AND";
  }
  areModelsEqual(e, t) {
    if (!e && !t)
      return !0;
    if (!e && t || e && !t)
      return !1;
    const r = !e.operator, n = !t.operator;
    if (!r && n || r && !n)
      return !1;
    let u;
    if (r) {
      const s = e, c = t;
      u = this.areSimpleModelsEqual(s, c);
    } else {
      const s = e, c = t;
      u = s.operator === c.operator && cf(
        s.conditions,
        c.conditions,
        (i, l) => this.areSimpleModelsEqual(i, l)
      );
    }
    return u;
  }
  shouldRefresh(e) {
    var u;
    const t = this.getModel(), r = t ? t.conditions ?? [t] : null, n = ((u = e.filterOptions) == null ? void 0 : u.map((s) => typeof s == "string" ? s : s.displayKey)) ?? this.getDefaultFilterOptions();
    return !(!(!r || r.every((s) => n.find((c) => c === s.type) !== void 0)) || typeof e.maxNumConditions == "number" && r && r.length > e.maxNumConditions);
  }
  refresh(e) {
    return !this.shouldRefresh(e) || !super.refresh(e) ? !1 : (this.setParams(e), this.removeConditionsAndOperators(0), this.createOption(), this.setModel(this.getModel()), !0);
  }
  setModelIntoUi(e) {
    if (e.operator) {
      const r = e;
      let n = r.conditions;
      n == null && (n = [], Fr("Filter model is missing 'conditions'"));
      const a = this.validateAndUpdateConditions(n), u = this.getNumConditions();
      if (a < u)
        this.removeConditionsAndOperators(a);
      else if (a > u)
        for (let c = u; c < a; c++)
          this.createJoinOperatorPanel(), this.createOption();
      const s = r.operator === "OR";
      this.eJoinOperatorsAnd.forEach((c) => c.setValue(!s, !0)), this.eJoinOperatorsOr.forEach((c) => c.setValue(s, !0)), n.forEach((c, i) => {
        this.eTypes[i].setValue(c.type, !0), this.setConditionIntoUi(c, i);
      });
    } else {
      const r = e;
      this.getNumConditions() > 1 && this.removeConditionsAndOperators(1), this.eTypes[0].setValue(r.type, !0), this.setConditionIntoUi(r, 0);
    }
    return this.lastUiCompletePosition = this.getNumConditions() - 1, this.createMissingConditionsAndOperators(), this.onUiChanged(), Ia.resolve();
  }
  validateAndUpdateConditions(e) {
    let t = e.length;
    return t > this.maxNumConditions && (e.splice(this.maxNumConditions), Fr(
      'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'
    ), t = this.maxNumConditions), t;
  }
  doesFilterPass(e) {
    const t = this.getModel();
    if (t == null)
      return !0;
    const { operator: r } = t, n = [];
    if (r) {
      const u = t;
      n.push(...u.conditions ?? []);
    } else
      n.push(t);
    return n[r && r === "OR" ? "some" : "every"]((u) => this.individualConditionPasses(e, u));
  }
  setParams(e) {
    super.setParams(e), this.setNumConditions(e), this.defaultJoinOperator = this.getDefaultJoinOperator(e.defaultJoinOperator), this.filterPlaceholder = e.filterPlaceholder, this.optionsFactory = new bk(), this.optionsFactory.init(e, this.getDefaultFilterOptions()), this.createFilterListOptions(), this.createOption(), this.createMissingConditionsAndOperators(), this.isReadOnly() && this.eFilterBody.setAttribute("tabindex", "-1");
  }
  setNumConditions(e) {
    this.maxNumConditions = e.maxNumConditions ?? 2, this.maxNumConditions < 1 && (Fr('"filterParams.maxNumConditions" must be greater than or equal to zero.'), this.maxNumConditions = 1), this.numAlwaysVisibleConditions = e.numAlwaysVisibleConditions ?? 1, this.numAlwaysVisibleConditions < 1 && (Fr('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'), this.numAlwaysVisibleConditions = 1), this.numAlwaysVisibleConditions > this.maxNumConditions && (Fr(
      '"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'
    ), this.numAlwaysVisibleConditions = this.maxNumConditions);
  }
  createOption() {
    const e = this.createManagedBean(new eR());
    this.eTypes.push(e), e.addCssClass("ag-filter-select"), this.eFilterBody.appendChild(e.getGui());
    const t = this.createValueElement();
    this.eConditionBodies.push(t), this.eFilterBody.appendChild(t), this.putOptionsIntoDropdown(e), this.resetType(e);
    const r = this.getNumConditions() - 1;
    this.forEachPositionInput(r, (n) => this.resetInput(n)), this.addChangedListeners(e, r);
  }
  createJoinOperatorPanel() {
    const e = document.createElement("div");
    this.eJoinOperatorPanels.push(e), e.classList.add("ag-filter-condition");
    const t = this.createJoinOperator(this.eJoinOperatorsAnd, e, "and"), r = this.createJoinOperator(this.eJoinOperatorsOr, e, "or");
    this.eFilterBody.appendChild(e);
    const n = this.eJoinOperatorPanels.length - 1, a = this.joinOperatorId++;
    this.resetJoinOperatorAnd(t, n, a), this.resetJoinOperatorOr(r, n, a), this.isReadOnly() || (t.onValueChange(this.listener), r.onValueChange(this.listener));
  }
  createJoinOperator(e, t, r) {
    const n = this.createManagedBean(new iY());
    return e.push(n), n.addCssClass("ag-filter-condition-operator"), n.addCssClass(`ag-filter-condition-operator-${r}`), t.appendChild(n.getGui()), n;
  }
  getDefaultJoinOperator(e) {
    return e === "AND" || e === "OR" ? e : "AND";
  }
  createFilterListOptions() {
    const e = this.optionsFactory.getFilterOptions();
    this.filterListOptions = e.map(
      (t) => typeof t == "string" ? this.createBoilerplateListOption(t) : this.createCustomListOption(t)
    );
  }
  putOptionsIntoDropdown(e) {
    this.filterListOptions.forEach((t) => {
      e.addOption(t);
    }), e.setDisabled(this.filterListOptions.length <= 1);
  }
  createBoilerplateListOption(e) {
    return { value: e, text: this.translate(e) };
  }
  createCustomListOption(e) {
    const { displayKey: t } = e, r = this.optionsFactory.getCustomOption(e.displayKey);
    return {
      value: t,
      text: r ? this.localeService.getLocaleTextFunc()(r.displayKey, r.displayName) : this.translate(t)
    };
  }
  createBodyTemplate() {
    return "";
  }
  getAgComponents() {
    return [];
  }
  getCssIdentifier() {
    return "simple-filter";
  }
  updateUiVisibility() {
    const e = this.getJoinOperator();
    this.updateNumConditions(), this.updateConditionStatusesAndValues(this.lastUiCompletePosition, e);
  }
  updateNumConditions() {
    let e = -1, t = !0;
    for (let r = 0; r < this.getNumConditions(); r++)
      this.isConditionUiComplete(r) ? e = r : t = !1;
    if (this.shouldAddNewConditionAtEnd(t))
      this.createJoinOperatorPanel(), this.createOption();
    else {
      const r = this.lastUiCompletePosition ?? this.getNumConditions() - 2;
      if (e < r) {
        this.removeConditionsAndOperators(r + 1);
        const n = e + 1, a = r - n;
        a > 0 && this.removeConditionsAndOperators(n, a), this.createMissingConditionsAndOperators();
      }
    }
    this.lastUiCompletePosition = e;
  }
  updateConditionStatusesAndValues(e, t) {
    this.eTypes.forEach((n, a) => {
      const u = this.isConditionDisabled(a, e);
      n.setDisabled(u || this.filterListOptions.length <= 1), a === 1 && (Um(this.eJoinOperatorPanels[0], u), this.eJoinOperatorsAnd[0].setDisabled(u), this.eJoinOperatorsOr[0].setDisabled(u));
    }), this.eConditionBodies.forEach((n, a) => {
      ba(n, this.isConditionBodyVisible(a));
    });
    const r = (t ?? this.getJoinOperator()) === "OR";
    this.eJoinOperatorsAnd.forEach((n) => {
      n.setValue(!r, !0);
    }), this.eJoinOperatorsOr.forEach((n) => {
      n.setValue(r, !0);
    }), this.forEachInput((n, a, u, s) => {
      this.setElementDisplayed(n, a < s), this.setElementDisabled(n, this.isConditionDisabled(u, e));
    }), this.resetPlaceholder();
  }
  shouldAddNewConditionAtEnd(e) {
    return e && this.getNumConditions() < this.maxNumConditions && !this.isReadOnly();
  }
  removeConditionsAndOperators(e, t) {
    if (e >= this.getNumConditions())
      return;
    this.removeComponents(this.eTypes, e, t), this.removeElements(this.eConditionBodies, e, t), this.removeValueElements(e, t);
    const r = Math.max(e - 1, 0);
    this.removeElements(this.eJoinOperatorPanels, r, t), this.removeComponents(this.eJoinOperatorsAnd, r, t), this.removeComponents(this.eJoinOperatorsOr, r, t);
  }
  removeElements(e, t, r) {
    this.removeItems(e, t, r).forEach((a) => _h(a));
  }
  removeComponents(e, t, r) {
    this.removeItems(e, t, r).forEach((a) => {
      _h(a.getGui()), this.destroyBean(a);
    });
  }
  removeItems(e, t, r) {
    return r == null ? e.splice(t) : e.splice(t, r);
  }
  afterGuiAttached(e) {
    if (super.afterGuiAttached(e), this.resetPlaceholder(), !(e != null && e.suppressFocus))
      if (this.isReadOnly())
        this.eFilterBody.focus();
      else {
        const t = this.getInputs(0)[0];
        if (!t)
          return;
        t instanceof Ph && t.getInputElement().focus();
      }
  }
  afterGuiDetached() {
    super.afterGuiDetached();
    const e = this.getModel();
    this.resetUiToActiveModel(e);
    let t = -1, r = -1, n = !1;
    const a = this.getJoinOperator();
    for (let s = this.getNumConditions() - 1; s >= 0; s--)
      if (this.isConditionUiComplete(s))
        t === -1 && (t = s, r = s);
      else {
        const c = s >= this.numAlwaysVisibleConditions && !this.isConditionUiComplete(s - 1), i = s < t;
        (c || i) && (this.removeConditionsAndOperators(s, 1), n = !0, i && r--);
      }
    let u = !1;
    this.getNumConditions() < this.numAlwaysVisibleConditions && (this.createMissingConditionsAndOperators(), u = !0), this.shouldAddNewConditionAtEnd(r === this.getNumConditions() - 1) && (this.createJoinOperatorPanel(), this.createOption(), u = !0), u && this.updateConditionStatusesAndValues(r, a), n && this.updateJoinOperatorsDisabled(), this.lastUiCompletePosition = r;
  }
  getPlaceholderText(e, t) {
    let r = this.translate(e);
    if (L2(this.filterPlaceholder)) {
      const n = this.filterPlaceholder, a = this.eTypes[t].getValue(), u = this.translate(a);
      r = n({
        filterOptionKey: a,
        filterOption: u,
        placeholder: r
      });
    } else typeof this.filterPlaceholder == "string" && (r = this.filterPlaceholder);
    return r;
  }
  // allow sub-classes to reset HTML placeholders after UI update.
  resetPlaceholder() {
    const e = this.localeService.getLocaleTextFunc();
    this.forEachInput((t, r, n, a) => {
      if (!(t instanceof Ph))
        return;
      const u = r === 0 && a > 1 ? "inRangeStart" : r === 0 ? "filterOoo" : "inRangeEnd", s = r === 0 && a > 1 ? e("ariaFilterFromValue", "Filter from value") : r === 0 ? e("ariaFilterValue", "Filter Value") : e("ariaFilterToValue", "Filter to Value");
      t.setInputPlaceholder(this.getPlaceholderText(u, n)), t.setInputAriaLabel(s);
    });
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  setElementValue(e, t, r) {
    e instanceof Ph && e.setValue(t != null ? String(t) : null, !0);
  }
  setElementDisplayed(e, t) {
    e instanceof na && ba(e.getGui(), t);
  }
  setElementDisabled(e, t) {
    e instanceof na && Um(e.getGui(), t);
  }
  attachElementOnChange(e, t) {
    e instanceof Ph && e.onValueChange(t);
  }
  forEachInput(e) {
    this.getConditionTypes().forEach((t, r) => {
      this.forEachPositionTypeInput(r, t, e);
    });
  }
  forEachPositionInput(e, t) {
    const r = this.getConditionType(e);
    this.forEachPositionTypeInput(e, r, t);
  }
  forEachPositionTypeInput(e, t, r) {
    const n = this.getNumberOfInputs(t), a = this.getInputs(e);
    for (let u = 0; u < a.length; u++) {
      const s = a[u];
      s != null && r(s, u, e, n);
    }
  }
  isConditionDisabled(e, t) {
    return this.isReadOnly() ? !0 : e === 0 ? !1 : e > t + 1;
  }
  isConditionBodyVisible(e) {
    const t = this.getConditionType(e);
    return this.getNumberOfInputs(t) > 0;
  }
  // returns true if the UI represents a working filter, eg all parts are filled out.
  // eg if text filter and textfield blank then returns false.
  isConditionUiComplete(e) {
    return !(e >= this.getNumConditions() || this.getConditionType(e) === "empty" || this.getValues(e).some((r) => r == null));
  }
  getNumConditions() {
    return this.eTypes.length;
  }
  getUiCompleteConditions() {
    const e = [];
    for (let t = 0; t < this.getNumConditions(); t++)
      this.isConditionUiComplete(t) && e.push(this.createCondition(t));
    return e;
  }
  createMissingConditionsAndOperators() {
    if (!this.isReadOnly())
      for (let e = this.getNumConditions(); e < this.numAlwaysVisibleConditions; e++)
        this.createJoinOperatorPanel(), this.createOption();
  }
  resetUiToDefaults(e) {
    return this.removeConditionsAndOperators(this.isReadOnly() ? 1 : this.numAlwaysVisibleConditions), this.eTypes.forEach((t) => this.resetType(t)), this.eJoinOperatorsAnd.forEach(
      (t, r) => this.resetJoinOperatorAnd(t, r, this.joinOperatorId + r)
    ), this.eJoinOperatorsOr.forEach(
      (t, r) => this.resetJoinOperatorOr(t, r, this.joinOperatorId + r)
    ), this.joinOperatorId++, this.forEachInput((t) => this.resetInput(t)), this.resetPlaceholder(), this.createMissingConditionsAndOperators(), this.lastUiCompletePosition = null, e || this.onUiChanged(), Ia.resolve();
  }
  resetType(e) {
    const r = this.localeService.getLocaleTextFunc()("ariaFilteringOperator", "Filtering operator");
    e.setValue(this.optionsFactory.getDefaultOption(), !0).setAriaLabel(r).setDisabled(this.isReadOnly() || this.filterListOptions.length <= 1);
  }
  resetJoinOperatorAnd(e, t, r) {
    this.resetJoinOperator(
      e,
      t,
      this.isDefaultOperator("AND"),
      this.translate("andCondition"),
      r
    );
  }
  resetJoinOperatorOr(e, t, r) {
    this.resetJoinOperator(
      e,
      t,
      this.isDefaultOperator("OR"),
      this.translate("orCondition"),
      r
    );
  }
  resetJoinOperator(e, t, r, n, a) {
    this.updateJoinOperatorDisabled(
      e.setValue(r, !0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${a}`).setLabel(n),
      t
    );
  }
  updateJoinOperatorsDisabled() {
    this.eJoinOperatorsAnd.forEach((e, t) => this.updateJoinOperatorDisabled(e, t)), this.eJoinOperatorsOr.forEach((e, t) => this.updateJoinOperatorDisabled(e, t));
  }
  updateJoinOperatorDisabled(e, t) {
    e.setDisabled(this.isReadOnly() || t > 0);
  }
  resetInput(e) {
    this.setElementValue(e, null), this.setElementDisabled(e, this.isReadOnly());
  }
  // puts model values into the UI
  setConditionIntoUi(e, t) {
    const r = this.mapValuesFromModel(e);
    this.forEachInput((n, a, u) => {
      u === t && this.setElementValue(n, r[a] != null ? r[a] : null);
    });
  }
  // after floating filter changes, this sets the 'value' section. this is implemented by the base class
  // (as that's where value is controlled), the 'type' part from the floating filter is dealt with in this class.
  setValueFromFloatingFilter(e) {
    this.forEachInput((t, r, n) => {
      this.setElementValue(t, r === 0 && n === 0 ? e : null, !0);
    });
  }
  isDefaultOperator(e) {
    return e === this.defaultJoinOperator;
  }
  addChangedListeners(e, t) {
    this.isReadOnly() || (e.onValueChange(this.listener), this.forEachPositionInput(t, (r) => {
      this.attachElementOnChange(r, this.listener);
    }));
  }
  /** returns true if the row passes the said condition */
  individualConditionPasses(e, t) {
    const r = this.getCellValue(e.node), n = this.mapValuesFromModel(t), a = this.optionsFactory.getCustomOption(t.type), u = this.evaluateCustomFilter(a, n, r);
    return u ?? (r == null ? this.evaluateNullValue(t.type) : this.evaluateNonNullValue(n, r, t, e));
  }
  evaluateCustomFilter(e, t, r) {
    if (e == null)
      return;
    const { predicate: n } = e;
    if (n != null && !t.some((a) => a == null))
      return n(t, r);
  }
  isBlank(e) {
    return e == null || typeof e == "string" && e.trim().length === 0;
  }
  hasInvalidInputs() {
    return !1;
  }
}, Sk = class extends wk {
  setParams(e) {
    super.setParams(e), this.scalarFilterParams = e;
  }
  evaluateNullValue(e) {
    switch (e) {
      case "equals":
        if (this.scalarFilterParams.includeBlanksInEquals)
          return !0;
        break;
      case "notEqual":
        if (this.scalarFilterParams.includeBlanksInNotEqual)
          return !0;
        break;
      case "greaterThan":
      case "greaterThanOrEqual":
        if (this.scalarFilterParams.includeBlanksInGreaterThan)
          return !0;
        break;
      case "lessThan":
      case "lessThanOrEqual":
        if (this.scalarFilterParams.includeBlanksInLessThan)
          return !0;
        break;
      case "inRange":
        if (this.scalarFilterParams.includeBlanksInRange)
          return !0;
        break;
      case "blank":
        return !0;
      case "notBlank":
        return !1;
    }
    return !1;
  }
  evaluateNonNullValue(e, t, r) {
    const n = this.comparator(), a = e[0] != null ? n(e[0], t) : 0;
    switch (r.type) {
      case "equals":
        return a === 0;
      case "notEqual":
        return a !== 0;
      case "greaterThan":
        return a > 0;
      case "greaterThanOrEqual":
        return a >= 0;
      case "lessThan":
        return a < 0;
      case "lessThanOrEqual":
        return a <= 0;
      case "inRange": {
        const u = n(e[1], t);
        return this.scalarFilterParams.inRangeInclusive ? a >= 0 && u <= 0 : a > 0 && u < 0;
      }
      case "blank":
        return this.isBlank(t);
      case "notBlank":
        return !this.isBlank(t);
      default:
        return Fr(
          'Unexpected type of filter "' + r.type + '", it looks like the filter was configured with incorrect Filter Options'
        ), !0;
    }
  }
}, lY = 65, uY = 67, cY = 86, dY = 68, fY = 90, hY = 89;
function xk(e) {
  var r;
  return e.altKey || e.ctrlKey || e.metaKey ? !1 : ((r = e.key) == null ? void 0 : r.length) === 1;
}
function yT(e, t, r, n, a) {
  const u = n ? n.getColDef().suppressKeyboardEvent : void 0;
  if (!u)
    return !1;
  const s = e.addGridCommonParams({
    event: t,
    editing: a,
    column: n,
    node: r,
    data: r.data,
    colDef: n.getColDef()
  });
  return !!(u && u(s));
}
function pY(e, t, r, n) {
  const a = n.getDefinition(), u = a && a.suppressHeaderKeyboardEvent;
  if (!$r(u))
    return !1;
  const s = e.addGridCommonParams({
    colDef: a,
    column: n,
    headerRowIndex: r,
    event: t
  });
  return !!u(s);
}
function vY(e) {
  const { keyCode: t } = e;
  let r;
  switch (t) {
    case lY:
      r = dr.A;
      break;
    case uY:
      r = dr.C;
      break;
    case cY:
      r = dr.V;
      break;
    case dY:
      r = dr.D;
      break;
    case fY:
      r = dr.Z;
      break;
    case hY:
      r = dr.Y;
      break;
    default:
      r = e.code;
  }
  return r;
}
function gY(e, t = !1) {
  return e === dr.DELETE ? !0 : !t && e === dr.BACKSPACE ? JL() : !1;
}
var Zh = class extends Ph {
  constructor(e, t = "ag-text-field", r = "text") {
    super(e, t, r);
  }
  postConstruct() {
    super.postConstruct(), this.config.allowedCharPattern && this.preventDisallowedCharacters();
  }
  setValue(e, t) {
    return this.eInput.value !== e && (this.eInput.value = $r(e) ? e : ""), super.setValue(e, t);
  }
  /** Used to set an initial value into the input without necessarily setting `this.value` or triggering events (e.g. to set an invalid value) */
  setStartValue(e) {
    this.setValue(e, !0);
  }
  preventDisallowedCharacters() {
    const e = new RegExp(`[${this.config.allowedCharPattern}]`), t = (r) => {
      xk(r) && r.key && !e.test(r.key) && r.preventDefault();
    };
    this.addManagedListeners(this.eInput, {
      keydown: t,
      paste: (r) => {
        var a;
        const n = (a = r.clipboardData) == null ? void 0 : a.getData("text");
        n && n.split("").some((u) => !e.test(u)) && r.preventDefault();
      }
    });
  }
}, $1 = {
  selector: "AG-INPUT-TEXT-FIELD",
  component: Zh
}, tR = class extends Zh {
  constructor(e) {
    super(e, "ag-number-field", "number");
  }
  postConstruct() {
    super.postConstruct(), this.addManagedListeners(this.eInput, {
      blur: () => {
        const a = parseFloat(this.eInput.value), u = isNaN(a) ? "" : this.normalizeValue(a.toString());
        this.value !== u && this.setValue(u);
      },
      wheel: this.onWheel.bind(this)
    }), this.eInput.step = "any";
    const { precision: e, min: t, max: r, step: n } = this.config;
    typeof e == "number" && this.setPrecision(e), typeof t == "number" && this.setMin(t), typeof r == "number" && this.setMax(r), typeof n == "number" && this.setStep(n);
  }
  onWheel(e) {
    Sa(this.gos) === this.eInput && e.preventDefault();
  }
  normalizeValue(e) {
    if (e === "")
      return "";
    this.precision != null && (e = this.adjustPrecision(e));
    const t = parseFloat(e);
    return this.min != null && t < this.min ? e = this.min.toString() : this.max != null && t > this.max && (e = this.max.toString()), e;
  }
  adjustPrecision(e, t) {
    if (this.precision == null)
      return e;
    if (t) {
      const n = parseFloat(e).toFixed(this.precision);
      return parseFloat(n).toString();
    }
    const r = String(e).split(".");
    if (r.length > 1) {
      if (r[1].length <= this.precision)
        return e;
      if (this.precision > 0)
        return `${r[0]}.${r[1].slice(0, this.precision)}`;
    }
    return r[0];
  }
  setMin(e) {
    return this.min === e ? this : (this.min = e, Vl(this.eInput, "min", e), this);
  }
  setMax(e) {
    return this.max === e ? this : (this.max = e, Vl(this.eInput, "max", e), this);
  }
  setPrecision(e) {
    return this.precision = e, this;
  }
  setStep(e) {
    return this.step === e ? this : (this.step = e, Vl(this.eInput, "step", e), this);
  }
  setValue(e, t) {
    return this.setValueOrInputValue(
      (r) => super.setValue(r, t),
      () => this,
      e
    );
  }
  setStartValue(e) {
    return this.setValueOrInputValue(
      (t) => super.setValue(t, !0),
      (t) => {
        this.eInput.value = t;
      },
      e
    );
  }
  setValueOrInputValue(e, t, r) {
    if ($r(r)) {
      let n = this.isScientificNotation(r);
      if (n && this.eInput.validity.valid)
        return e(r);
      if (!n) {
        r = this.adjustPrecision(r);
        const a = this.normalizeValue(r);
        n = r != a;
      }
      if (n)
        return t(r);
    }
    return e(r);
  }
  getValue() {
    if (!this.eInput.validity.valid)
      return;
    const e = this.eInput.value;
    return this.isScientificNotation(e) ? this.adjustPrecision(e, !0) : super.getValue();
  }
  isScientificNotation(e) {
    return typeof e == "string" && e.includes("e");
  }
}, mY = {
  selector: "AG-INPUT-NUMBER-FIELD",
  component: tR
}, Tk = [
  "equals",
  "notEqual",
  "greaterThan",
  "greaterThanOrEqual",
  "lessThan",
  "lessThanOrEqual",
  "inRange",
  "blank",
  "notBlank"
], rR = class {
  constructor(e, t, r) {
    this.localeService = e, this.optionsFactory = t, this.valueFormatter = r;
  }
  // used by:
  // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only.
  // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only)
  getModelAsString(e) {
    if (!e)
      return null;
    const t = e.operator != null, r = this.localeService.getLocaleTextFunc();
    if (t) {
      const n = e, u = (n.conditions ?? []).map((c) => this.getModelAsString(c)), s = n.operator === "AND" ? "andCondition" : "orCondition";
      return u.join(
        ` ${r(s, Ck[s])} `
      );
    } else {
      if (e.type === "blank" || e.type === "notBlank")
        return r(e.type, e.type);
      {
        const n = e, a = this.optionsFactory.getCustomOption(n.type), { displayKey: u, displayName: s, numberOfInputs: c } = a || {};
        return u && s && c === 0 ? (r(u, s), s) : this.conditionToString(n, a);
      }
    }
  }
  updateParams(e) {
    this.optionsFactory = e.optionsFactory;
  }
  formatValue(e) {
    return this.valueFormatter ? this.valueFormatter(e ?? null) ?? "" : String(e);
  }
}, Rk = class extends rR {
  conditionToString(e, t) {
    const { numberOfInputs: r } = t || {};
    return e.type == "inRange" || r === 2 ? `${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}` : e.filter != null ? this.formatValue(e.filter) : `${e.type}`;
  }
};
function CT(e) {
  const { allowedCharPattern: t } = e ?? {};
  return t ?? null;
}
var yY = class extends Sk {
  constructor() {
    super("numberFilter"), this.eValuesFrom = [], this.eValuesTo = [];
  }
  refresh(e) {
    return this.numberFilterParams.allowedCharPattern !== e.allowedCharPattern ? !1 : super.refresh(e);
  }
  mapValuesFromModel(e) {
    const { filter: t, filterTo: r, type: n } = e || {};
    return [this.processValue(t), this.processValue(r)].slice(0, this.getNumberOfInputs(n));
  }
  getDefaultDebounceMs() {
    return 500;
  }
  comparator() {
    return (e, t) => e === t ? 0 : e < t ? 1 : -1;
  }
  setParams(e) {
    this.numberFilterParams = e, super.setParams(e), this.filterModelFormatter = new Rk(
      this.localeService,
      this.optionsFactory,
      this.numberFilterParams.numberFormatter
    );
  }
  getDefaultFilterOptions() {
    return Tk;
  }
  setElementValue(e, t, r) {
    const n = !r && this.numberFilterParams.numberFormatter ? this.numberFilterParams.numberFormatter(t ?? null) : t;
    super.setElementValue(e, n);
  }
  createValueElement() {
    const e = CT(this.numberFilterParams), t = document.createElement("div");
    return t.classList.add("ag-filter-body"), vu(t, "presentation"), this.createFromToElement(t, this.eValuesFrom, "from", e), this.createFromToElement(t, this.eValuesTo, "to", e), t;
  }
  createFromToElement(e, t, r, n) {
    const a = this.createManagedBean(
      n ? new Zh({ allowedCharPattern: n }) : new tR()
    );
    a.addCssClass(`ag-filter-${r}`), a.addCssClass("ag-filter-filter"), t.push(a), e.appendChild(a.getGui());
  }
  removeValueElements(e, t) {
    this.removeComponents(this.eValuesFrom, e, t), this.removeComponents(this.eValuesTo, e, t);
  }
  getValues(e) {
    const t = [];
    return this.forEachPositionInput(e, (r, n, a, u) => {
      n < u && t.push(this.processValue(this.stringToFloat(r.getValue())));
    }), t;
  }
  areSimpleModelsEqual(e, t) {
    return e.filter === t.filter && e.filterTo === t.filterTo && e.type === t.type;
  }
  getFilterType() {
    return "number";
  }
  processValue(e) {
    return e == null || isNaN(e) ? null : e;
  }
  stringToFloat(e) {
    if (typeof e == "number")
      return e;
    let t = Jc(e);
    return t != null && t.trim() === "" && (t = null), this.numberFilterParams.numberParser ? this.numberFilterParams.numberParser(t) : t == null || t.trim() === "-" ? null : parseFloat(t);
  }
  createCondition(e) {
    const t = this.getConditionType(e), r = {
      filterType: this.getFilterType(),
      type: t
    }, n = this.getValues(e);
    return n.length > 0 && (r.filter = n[0]), n.length > 1 && (r.filterTo = n[1]), r;
  }
  getInputs(e) {
    return e >= this.eValuesFrom.length ? [null, null] : [this.eValuesFrom[e], this.eValuesTo[e]];
  }
  getModelAsString(e) {
    return this.filterModelFormatter.getModelAsString(e) ?? "";
  }
  hasInvalidInputs() {
    let e = !1;
    return this.forEachInput((t) => {
      if (!t.getInputElement().validity.valid) {
        e = !0;
        return;
      }
    }), e;
  }
}, Ak = [
  "contains",
  "notContains",
  "equals",
  "notEqual",
  "startsWith",
  "endsWith",
  "blank",
  "notBlank"
], Ek = class extends rR {
  conditionToString(e, t) {
    const { numberOfInputs: r } = t || {};
    return e.type == "inRange" || r === 2 ? `${e.filter}-${e.filterTo}` : e.filter != null ? `${e.filter}` : `${e.type}`;
  }
};
function Mk(e) {
  const t = e && e.trim();
  return t === "" ? e : t;
}
var CY = class extends wk {
  constructor() {
    super("textFilter"), this.defaultFormatter = (e) => e, this.defaultLowercaseFormatter = (e) => e == null ? null : e.toString().toLowerCase(), this.defaultMatcher = ({ filterOption: e, value: t, filterText: r }) => {
      if (r == null)
        return !1;
      switch (e) {
        case "contains":
          return t.indexOf(r) >= 0;
        case "notContains":
          return t.indexOf(r) < 0;
        case "equals":
          return t === r;
        case "notEqual":
          return t != r;
        case "startsWith":
          return t.indexOf(r) === 0;
        case "endsWith": {
          const n = t.lastIndexOf(r);
          return n >= 0 && n === t.length - r.length;
        }
        default:
          return !1;
      }
    }, this.eValuesFrom = [], this.eValuesTo = [];
  }
  getDefaultDebounceMs() {
    return 500;
  }
  setParams(e) {
    this.textFilterParams = e, super.setParams(e), this.matcher = this.getTextMatcher(), this.formatter = this.textFilterParams.textFormatter || (this.textFilterParams.caseSensitive ? this.defaultFormatter : this.defaultLowercaseFormatter), this.filterModelFormatter = new Ek(this.localeService, this.optionsFactory);
  }
  getTextMatcher() {
    const e = this.textFilterParams.textCustomComparator;
    return e ? (Fr("textCustomComparator is deprecated, use textMatcher instead."), ({ filterOption: t, value: r, filterText: n }) => e(t, r, n)) : this.textFilterParams.textMatcher || this.defaultMatcher;
  }
  createCondition(e) {
    const t = this.getConditionType(e), r = {
      filterType: this.getFilterType(),
      type: t
    }, n = this.getValuesWithSideEffects(e, !0);
    return n.length > 0 && (r.filter = n[0]), n.length > 1 && (r.filterTo = n[1]), r;
  }
  getFilterType() {
    return "text";
  }
  areSimpleModelsEqual(e, t) {
    return e.filter === t.filter && e.filterTo === t.filterTo && e.type === t.type;
  }
  getInputs(e) {
    return e >= this.eValuesFrom.length ? [null, null] : [this.eValuesFrom[e], this.eValuesTo[e]];
  }
  getValues(e) {
    return this.getValuesWithSideEffects(e, !1);
  }
  getValuesWithSideEffects(e, t) {
    const r = [];
    return this.forEachPositionInput(e, (n, a, u, s) => {
      if (a < s) {
        let c = Jc(n.getValue());
        t && this.textFilterParams.trimInput && (c = Mk(c) ?? null, n.setValue(c, !0)), r.push(c);
      }
    }), r;
  }
  getDefaultFilterOptions() {
    return Ak;
  }
  createValueElement() {
    const e = document.createElement("div");
    return e.classList.add("ag-filter-body"), vu(e, "presentation"), this.createFromToElement(e, this.eValuesFrom, "from"), this.createFromToElement(e, this.eValuesTo, "to"), e;
  }
  createFromToElement(e, t, r) {
    const n = this.createManagedBean(new Zh());
    n.addCssClass(`ag-filter-${r}`), n.addCssClass("ag-filter-filter"), t.push(n), e.appendChild(n.getGui());
  }
  removeValueElements(e, t) {
    this.removeComponents(this.eValuesFrom, e, t), this.removeComponents(this.eValuesTo, e, t);
  }
  mapValuesFromModel(e) {
    const { filter: t, filterTo: r, type: n } = e || {};
    return [t || null, r || null].slice(0, this.getNumberOfInputs(n));
  }
  evaluateNullValue(e) {
    return e ? ["notEqual", "notContains", "blank"].indexOf(e) >= 0 : !1;
  }
  evaluateNonNullValue(e, t, r, n) {
    const a = e.map((p) => this.formatter(p)) || [], u = this.formatter(t), { api: s, colDef: c, column: i, context: l, textFormatter: v } = this.textFilterParams;
    if (r.type === "blank")
      return this.isBlank(t);
    if (r.type === "notBlank")
      return !this.isBlank(t);
    const f = {
      api: s,
      colDef: c,
      column: i,
      context: l,
      node: n.node,
      data: n.data,
      filterOption: r.type,
      value: u,
      textFormatter: v
    };
    return a.some((p) => this.matcher({ ...f, filterText: p }));
  }
  getModelAsString(e) {
    return this.filterModelFormatter.getModelAsString(e) ?? "";
  }
};
function Dk(e) {
  if (typeof e == "number")
    return e;
  if (typeof e == "string") {
    const t = parseInt(e);
    return isNaN(t) ? void 0 : t;
  }
}
function Qu(e, t = Number.MAX_VALUE) {
  return (r) => {
    const n = Dk(r);
    if (!(n == null || n < e || n > t))
      return n;
  };
}
function Mm(e, t) {
  return e.toString().padStart(t, "0");
}
function bY(e, t) {
  const r = [];
  for (let n = e; n <= t; n++)
    r.push(n);
  return r;
}
function wY(e, t, r) {
  return typeof e != "number" ? "" : e.toString().replace(".", r).replace(/(\d)(?=(\d{3})+(?!\d))/g, `$1${t}`);
}
function zl(e, t = !0, r = "-") {
  if (!e)
    return null;
  let n = [e.getFullYear(), e.getMonth() + 1, e.getDate()].map((a) => Mm(a, 2)).join(r);
  return t && (n += " " + [e.getHours(), e.getMinutes(), e.getSeconds()].map((a) => Mm(a, 2)).join(":")), n;
}
var Rx = (e) => {
  if (e > 3 && e < 21)
    return "th";
  switch (e % 10) {
    case 1:
      return "st";
    case 2:
      return "nd";
    case 3:
      return "rd";
  }
  return "th";
};
function Dm(e, t = "YYYY-MM-DD") {
  const r = Mm(e.getFullYear(), 4), n = [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ], a = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], u = {
    YYYY: () => r.slice(r.length - 4, r.length),
    YY: () => r.slice(r.length - 2, r.length),
    Y: () => `${e.getFullYear()}`,
    MMMM: () => n[e.getMonth()],
    MMM: () => n[e.getMonth()].slice(0, 3),
    MM: () => Mm(e.getMonth() + 1, 2),
    Mo: () => `${e.getMonth() + 1}${Rx(e.getMonth() + 1)}`,
    M: () => `${e.getMonth() + 1}`,
    Do: () => `${e.getDate()}${Rx(e.getDate())}`,
    DD: () => Mm(e.getDate(), 2),
    D: () => `${e.getDate()}`,
    dddd: () => a[e.getDay()],
    ddd: () => a[e.getDay()].slice(0, 3),
    dd: () => a[e.getDay()].slice(0, 2),
    do: () => `${e.getDay()}${Rx(e.getDay())}`,
    d: () => `${e.getDay()}`
  }, s = new RegExp(Object.keys(u).join("|"), "g");
  return t.replace(s, (c) => c in u ? u[c]() : c);
}
function ws(e) {
  if (!e)
    return null;
  const [t, r] = e.split(" ");
  if (!t)
    return null;
  const n = t.split("-").map((f) => parseInt(f, 10));
  if (n.filter((f) => !isNaN(f)).length !== 3)
    return null;
  const [a, u, s] = n, c = new Date(a, u - 1, s);
  if (c.getFullYear() !== a || c.getMonth() !== u - 1 || c.getDate() !== s)
    return null;
  if (!r || r === "00:00:00")
    return c;
  const [i, l, v] = r.split(":").map((f) => parseInt(f, 10));
  return i >= 0 && i < 24 && c.setHours(i), l >= 0 && l < 60 && c.setMinutes(l), v >= 0 && v < 60 && c.setSeconds(v), c;
}
var Fk = class {
  constructor(e, t, r, n, a) {
    this.alive = !0, this.context = e, this.eParent = n, t.getDateCompDetails(r).newAgStackInstance().then((c) => {
      if (!this.alive) {
        e.destroyBean(c);
        return;
      }
      this.dateComp = c, c && (n.appendChild(c.getGui()), c.afterGuiAttached && c.afterGuiAttached(), this.tempValue && c.setDate(this.tempValue), this.disabled != null && this.setDateCompDisabled(this.disabled), a == null || a(this));
    });
  }
  destroy() {
    this.alive = !1, this.dateComp = this.context.destroyBean(this.dateComp);
  }
  getDate() {
    return this.dateComp ? this.dateComp.getDate() : this.tempValue;
  }
  setDate(e) {
    this.dateComp ? this.dateComp.setDate(e) : this.tempValue = e;
  }
  setDisabled(e) {
    this.dateComp ? this.setDateCompDisabled(e) : this.disabled = e;
  }
  setDisplayed(e) {
    ba(this.eParent, e);
  }
  setInputPlaceholder(e) {
    this.dateComp && this.dateComp.setInputPlaceholder && this.dateComp.setInputPlaceholder(e);
  }
  setInputAriaLabel(e) {
    this.dateComp && this.dateComp.setInputAriaLabel && this.dateComp.setInputAriaLabel(e);
  }
  afterGuiAttached(e) {
    this.dateComp && typeof this.dateComp.afterGuiAttached == "function" && this.dateComp.afterGuiAttached(e);
  }
  updateParams(e) {
    var r, n;
    let t = !1;
    (r = this.dateComp) != null && r.refresh && typeof this.dateComp.refresh == "function" && this.dateComp.refresh(e) !== null && (t = !0), !t && ((n = this.dateComp) != null && n.onParamsUpdated) && typeof this.dateComp.onParamsUpdated == "function" && this.dateComp.onParamsUpdated(e) !== null && Fr("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.");
  }
  setDateCompDisabled(e) {
    this.dateComp != null && this.dateComp.setDisabled != null && this.dateComp.setDisabled(e);
  }
}, Pk = [
  "equals",
  "notEqual",
  "lessThan",
  "greaterThan",
  "inRange",
  "blank",
  "notBlank"
], Ik = class extends rR {
  constructor(e, t, r) {
    super(t, r), this.dateFilterParams = e;
  }
  conditionToString(e, t) {
    const { type: r } = e, { numberOfInputs: n } = t || {}, a = r == "inRange" || n === 2, u = ws(e.dateFrom), s = ws(e.dateTo), c = this.dateFilterParams.inRangeFloatingFilterDateFormat;
    if (a) {
      const i = u !== null ? Dm(u, c) : "null", l = s !== null ? Dm(s, c) : "null";
      return `${i}-${l}`;
    }
    return u != null ? Dm(u, c) : `${r}`;
  }
  updateParams(e) {
    super.updateParams(e), this.dateFilterParams = e.dateFilterParams;
  }
}, oF = 1e3, sF = 1 / 0, SY = class extends Sk {
  constructor() {
    super("dateFilter"), this.eConditionPanelsFrom = [], this.eConditionPanelsTo = [], this.dateConditionFromComps = [], this.dateConditionToComps = [], this.minValidYear = oF, this.maxValidYear = sF, this.minValidDate = null, this.maxValidDate = null;
  }
  wireBeans(e) {
    super.wireBeans(e), this.context = e.context, this.userComponentFactory = e.userComponentFactory;
  }
  afterGuiAttached(e) {
    super.afterGuiAttached(e), this.dateConditionFromComps[0].afterGuiAttached(e);
  }
  mapValuesFromModel(e) {
    const { dateFrom: t, dateTo: r, type: n } = e || {};
    return [
      t && ws(t) || null,
      r && ws(r) || null
    ].slice(0, this.getNumberOfInputs(n));
  }
  comparator() {
    return this.dateFilterParams.comparator ? this.dateFilterParams.comparator : this.defaultComparator.bind(this);
  }
  defaultComparator(e, t) {
    const r = t;
    return t == null || r < e ? -1 : r > e ? 1 : 0;
  }
  setParams(e) {
    this.dateFilterParams = e, super.setParams(e);
    const t = (r, n) => {
      if (e[r] != null)
        if (isNaN(e[r]))
          Fr(`DateFilter ${r} is not a number`);
        else
          return e[r] == null ? n : Number(e[r]);
      return n;
    };
    this.minValidYear = t("minValidYear", oF), this.maxValidYear = t("maxValidYear", sF), this.minValidYear > this.maxValidYear && Fr("DateFilter minValidYear should be <= maxValidYear"), e.minValidDate ? this.minValidDate = e.minValidDate instanceof Date ? e.minValidDate : ws(e.minValidDate) : this.minValidDate = null, e.maxValidDate ? this.maxValidDate = e.maxValidDate instanceof Date ? e.maxValidDate : ws(e.maxValidDate) : this.maxValidDate = null, this.minValidDate && this.maxValidDate && this.minValidDate > this.maxValidDate && Fr("DateFilter minValidDate should be <= maxValidDate"), this.filterModelFormatter = new Ik(
      this.dateFilterParams,
      this.localeService,
      this.optionsFactory
    );
  }
  createDateCompWrapper(e) {
    const t = new Fk(
      this.context,
      this.userComponentFactory,
      {
        onDateChanged: () => this.onUiChanged(),
        filterParams: this.dateFilterParams
      },
      e
    );
    return this.addDestroyFunc(() => t.destroy()), t;
  }
  setElementValue(e, t) {
    e.setDate(t);
  }
  setElementDisplayed(e, t) {
    e.setDisplayed(t);
  }
  setElementDisabled(e, t) {
    e.setDisabled(t);
  }
  getDefaultFilterOptions() {
    return Pk;
  }
  createValueElement() {
    const t = Va(this.gos).createElement("div");
    return t.classList.add("ag-filter-body"), this.createFromToElement(t, this.eConditionPanelsFrom, this.dateConditionFromComps, "from"), this.createFromToElement(t, this.eConditionPanelsTo, this.dateConditionToComps, "to"), t;
  }
  createFromToElement(e, t, r, n) {
    const u = Va(this.gos).createElement("div");
    u.classList.add(`ag-filter-${n}`), u.classList.add(`ag-filter-date-${n}`), t.push(u), e.appendChild(u), r.push(this.createDateCompWrapper(u));
  }
  removeValueElements(e, t) {
    this.removeDateComps(this.dateConditionFromComps, e, t), this.removeDateComps(this.dateConditionToComps, e, t), this.removeItems(this.eConditionPanelsFrom, e, t), this.removeItems(this.eConditionPanelsTo, e, t);
  }
  removeDateComps(e, t, r) {
    this.removeItems(e, t, r).forEach((a) => a.destroy());
  }
  isValidDateValue(e) {
    if (e === null)
      return !1;
    if (this.minValidDate) {
      if (e < this.minValidDate)
        return !1;
    } else if (e.getUTCFullYear() < this.minValidYear)
      return !1;
    if (this.maxValidDate) {
      if (e > this.maxValidDate)
        return !1;
    } else if (e.getUTCFullYear() > this.maxValidYear)
      return !1;
    return !0;
  }
  isConditionUiComplete(e) {
    if (!super.isConditionUiComplete(e))
      return !1;
    let t = !0;
    return this.forEachInput((r, n, a, u) => {
      a !== e || !t || n >= u || (t = t && this.isValidDateValue(r.getDate()));
    }), t;
  }
  areSimpleModelsEqual(e, t) {
    return e.dateFrom === t.dateFrom && e.dateTo === t.dateTo && e.type === t.type;
  }
  getFilterType() {
    return "date";
  }
  createCondition(e) {
    const t = this.getConditionType(e), r = {}, n = this.getValues(e);
    return n.length > 0 && (r.dateFrom = zl(n[0])), n.length > 1 && (r.dateTo = zl(n[1])), {
      dateFrom: null,
      dateTo: null,
      filterType: this.getFilterType(),
      type: t,
      ...r
    };
  }
  resetPlaceholder() {
    const e = this.localeService.getLocaleTextFunc(), t = this.translate("dateFormatOoo"), r = e("ariaFilterValue", "Filter Value");
    this.forEachInput((n) => {
      n.setInputPlaceholder(t), n.setInputAriaLabel(r);
    });
  }
  getInputs(e) {
    return e >= this.dateConditionFromComps.length ? [null, null] : [this.dateConditionFromComps[e], this.dateConditionToComps[e]];
  }
  getValues(e) {
    const t = [];
    return this.forEachPositionInput(e, (r, n, a, u) => {
      n < u && t.push(r.getDate());
    }), t;
  }
  translate(e) {
    return e === "lessThan" ? super.translate("before") : e === "greaterThan" ? super.translate("after") : super.translate(e);
  }
  getModelAsString(e) {
    return this.filterModelFormatter.getModelAsString(e) ?? "";
  }
}, nR = class extends mr {
  constructor(e, t, r, n) {
    super(), this.columnOrGroup = e, this.columnOrGroup = e, this.eCell = t, this.ariaEl = this.eCell.querySelector("[role=columnheader]") || this.eCell, this.colsSpanning = n, this.beans = r;
  }
  setColsSpanning(e) {
    this.colsSpanning = e, this.onLeftChanged();
  }
  getColumnOrGroup() {
    return this.beans.gos.get("enableRtl") && this.colsSpanning ? di(this.colsSpanning) : this.columnOrGroup;
  }
  postConstruct() {
    const e = this.onLeftChanged.bind(this);
    this.addManagedListeners(this.columnOrGroup, { leftChanged: e }), this.setLeftFirstTime(), this.addManagedEventListeners({ displayedColumnsWidthChanged: e }), this.addManagedPropertyListener("domLayout", e);
  }
  setLeftFirstTime() {
    const e = this.beans.gos.get("suppressColumnMoveAnimation"), t = $r(this.columnOrGroup.getOldLeft());
    this.beans.columnAnimationService.isActive() && t && !e ? this.animateInLeft() : this.onLeftChanged();
  }
  animateInLeft() {
    const e = this.getColumnOrGroup(), t = e.getLeft(), r = e.getOldLeft(), n = this.modifyLeftForPrintLayout(e, r), a = this.modifyLeftForPrintLayout(e, t);
    this.setLeft(n), this.actualLeft = a, this.beans.columnAnimationService.executeNextVMTurn(() => {
      this.actualLeft === a && this.setLeft(a);
    });
  }
  onLeftChanged() {
    const e = this.getColumnOrGroup(), t = e.getLeft();
    this.actualLeft = this.modifyLeftForPrintLayout(e, t), this.setLeft(this.actualLeft);
  }
  modifyLeftForPrintLayout(e, t) {
    if (!Ao(this.beans.gos, "print") || e.getPinned() === "left")
      return t;
    const n = this.beans.visibleColsService.getColsLeftWidth();
    if (e.getPinned() === "right") {
      const a = this.beans.visibleColsService.getBodyContainerWidth();
      return n + a + t;
    }
    return n + t;
  }
  setLeft(e) {
    if ($r(e) && (this.eCell.style.left = `${e}px`), Ba(this.columnOrGroup)) {
      const t = this.columnOrGroup.getLeafColumns();
      if (!t.length)
        return;
      t.length > 1 && zU(this.ariaEl, t.length);
    }
  }
}, xY = "ag-column-first", TY = "ag-column-last";
function Lk(e, t, r, n) {
  return mi(e) ? [] : AY(e.headerClass, e, t, r, n);
}
function kk(e, t, r) {
  e.addOrRemoveCssClass(xY, r.isColAtEdge(t, "first")), e.addOrRemoveCssClass(TY, r.isColAtEdge(t, "last"));
}
function RY(e, t, r, n) {
  return t.addGridCommonParams({
    // bad naming, as colDef here can be a group or a column,
    // however most people won't appreciate the difference,
    // so keeping it as colDef to avoid confusion.
    colDef: e,
    column: r,
    columnGroup: n
  });
}
function AY(e, t, r, n, a) {
  if (mi(e))
    return [];
  let u;
  if (typeof e == "function") {
    const s = RY(t, r, n, a);
    u = e(s);
  } else
    u = e;
  return typeof u == "string" ? [u] : Array.isArray(u) ? [...u] : [];
}
var EY = 0, Ok = class Nk extends mr {
  constructor(t, r, n) {
    super(), this.resizeToggleTimeout = 0, this.resizeMultiplier = 1, this.resizeFeature = null, this.lastFocusEvent = null, this.dragSource = null, this.columnGroupChild = t, this.parentRowCtrl = n, this.beans = r, this.instanceId = t.getUniqueId() + "-" + EY++;
  }
  wireBeans(t) {
    this.pinnedWidthService = t.pinnedWidthService, this.focusService = t.focusService, this.userComponentFactory = t.userComponentFactory, this.ctrlsService = t.ctrlsService, this.dragAndDropService = t.dragAndDropService, this.menuService = t.menuService;
  }
  postConstruct() {
    const t = this.refreshTabIndex.bind(this);
    this.addManagedPropertyListeners(["suppressHeaderFocus"], t), this.addManagedEventListeners({
      overlayExclusiveChanged: t
    });
  }
  shouldStopEventPropagation(t) {
    const { headerRowIndex: r, column: n } = this.focusService.getFocusedHeader();
    return pY(this.gos, t, r, n);
  }
  getWrapperHasFocus() {
    return Sa(this.gos) === this.eGui;
  }
  setGui(t, r) {
    this.eGui = t, this.addDomData(r), r.addManagedListeners(this.beans.eventService, {
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this)
    }), r.addManagedElementListeners(this.eGui, {
      focus: this.onGuiFocus.bind(this)
    }), this.onDisplayedColumnsChanged(), this.refreshTabIndex();
  }
  onGuiFocus() {
    this.eventService.dispatchEvent({
      type: "headerFocused",
      column: this.column
    });
  }
  setupAutoHeight(t) {
    const { wrapperElement: r, checkMeasuringCallback: n, compBean: a } = t, { animationFrameService: u, resizeObserverService: s, columnModel: c, gos: i } = this.beans, l = (C) => {
      if (!this.isAlive() || !a.isAlive())
        return;
      const { paddingTop: m, paddingBottom: h, borderBottomWidth: w, borderTopWidth: S } = Xh(this.getGui()), E = m + h + w + S, T = r.offsetHeight + E;
      if (C < 5) {
        const F = Va(i), P = !F || !F.contains(r), k = T == 0;
        if (P || k) {
          u.requestAnimationFrame(() => l(C + 1));
          return;
        }
      }
      c.setColHeaderHeight(this.column, T);
    };
    let v = !1, f;
    const p = () => {
      const C = this.column.isAutoHeaderHeight();
      C && !v && g(), !C && v && y();
    }, g = () => {
      v = !0, l(0), this.comp.addOrRemoveCssClass("ag-header-cell-auto-height", !0), f = s.observeResize(r, () => l(0));
    }, y = () => {
      v = !1, f && f(), this.comp.addOrRemoveCssClass("ag-header-cell-auto-height", !1), f = void 0;
    };
    p(), a.addDestroyFunc(() => y()), a.addManagedListeners(this.column, { widthChanged: () => v && l(0) }), a.addManagedEventListeners({
      sortChanged: () => {
        v && window.setTimeout(() => l(0));
      }
    }), n && n(p);
  }
  onDisplayedColumnsChanged() {
    const { comp: t, column: r, beans: n, eGui: a } = this;
    !t || !r || !a || (kk(t, r, n.visibleColsService), ZL(a, n.visibleColsService.getAriaColIndex(r)));
  }
  addResizeAndMoveKeyboardListeners(t) {
    this.resizeFeature && t.addManagedListeners(this.eGui, {
      keydown: this.onGuiKeyDown.bind(this),
      keyup: this.onGuiKeyUp.bind(this)
    });
  }
  refreshTabIndex() {
    const t = this.focusService.isHeaderFocusSuppressed();
    this.eGui && Vl(this.eGui, "tabindex", t ? null : "-1");
  }
  onGuiKeyDown(t) {
    var s;
    const r = Sa(this.gos), n = t.key === dr.LEFT || t.key === dr.RIGHT;
    if (this.isResizing && (t.preventDefault(), t.stopImmediatePropagation()), // if elements within the header are focused, we don't process the event
    r !== this.eGui || // if shiftKey and altKey are not pressed, it's cell navigation so we don't process the event
    !t.shiftKey && !t.altKey || ((this.isResizing || n) && (t.preventDefault(), t.stopImmediatePropagation()), !n))
      return;
    const a = t.key === dr.LEFT !== this.gos.get("enableRtl"), u = pk[a ? "Left" : "Right"];
    if (t.altKey) {
      this.isResizing = !0, this.resizeMultiplier += 1;
      const c = this.getViewportAdjustedResizeDiff(t);
      this.resizeHeader(c, t.shiftKey), (s = this.resizeFeature) == null || s.toggleColumnResizing(!0);
    } else
      this.moveHeader(u);
  }
  getViewportAdjustedResizeDiff(t) {
    let r = this.getResizeDiff(t);
    if (this.column.getPinned()) {
      const a = this.pinnedWidthService.getPinnedLeftWidth(), u = this.pinnedWidthService.getPinnedRightWidth(), s = iy(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement()) - 50;
      if (a + u + r > s)
        if (s > a + u)
          r = s - a - u;
        else
          return 0;
    }
    return r;
  }
  getResizeDiff(t) {
    let r = t.key === dr.LEFT !== this.gos.get("enableRtl");
    const n = this.column.getPinned(), a = this.gos.get("enableRtl");
    return n && a !== (n === "right") && (r = !r), (r ? -1 : 1) * this.resizeMultiplier;
  }
  onGuiKeyUp() {
    this.isResizing && (this.resizeToggleTimeout && (window.clearTimeout(this.resizeToggleTimeout), this.resizeToggleTimeout = 0), this.isResizing = !1, this.resizeMultiplier = 1, this.resizeToggleTimeout = window.setTimeout(() => {
      var t;
      (t = this.resizeFeature) == null || t.toggleColumnResizing(!1);
    }, 150));
  }
  handleKeyDown(t) {
    const r = this.getWrapperHasFocus();
    switch (t.key) {
      case dr.PAGE_DOWN:
      case dr.PAGE_UP:
      case dr.PAGE_HOME:
      case dr.PAGE_END:
        r && t.preventDefault();
    }
  }
  addDomData(t) {
    const r = Nk.DOM_DATA_KEY_HEADER_CTRL;
    zh(this.gos, this.eGui, r, this), t.addDestroyFunc(() => zh(this.gos, this.eGui, r, null));
  }
  getGui() {
    return this.eGui;
  }
  focus(t) {
    return this.eGui ? (this.lastFocusEvent = t || null, this.eGui.focus(), !0) : !1;
  }
  getRowIndex() {
    return this.parentRowCtrl.getRowIndex();
  }
  getParentRowCtrl() {
    return this.parentRowCtrl;
  }
  getPinned() {
    return this.parentRowCtrl.getPinned();
  }
  getColumnGroupChild() {
    return this.columnGroupChild;
  }
  removeDragSource() {
    this.dragSource && (this.dragAndDropService.removeDragSource(this.dragSource), this.dragSource = null);
  }
  handleContextMenuMouseEvent(t, r, n) {
    const a = t ?? r;
    this.gos.get("preventDefaultOnContextMenu") && a.preventDefault(), this.menuService.isHeaderContextMenuEnabled(n) && this.menuService.showHeaderContextMenu(n, t, r), this.dispatchColumnMouseEvent("columnHeaderContextMenu", n);
  }
  dispatchColumnMouseEvent(t, r) {
    this.eventService.dispatchEvent({
      type: t,
      column: r
    });
  }
  clearComponent() {
    this.removeDragSource(), this.resizeFeature = null, this.comp = null, this.eGui = null;
  }
  destroy() {
    super.destroy(), this.column = null, this.lastFocusEvent = null, this.columnGroupChild = null, this.parentRowCtrl = null;
  }
};
Ok.DOM_DATA_KEY_HEADER_CTRL = "headerCtrl";
var Z1 = Ok, iR = class extends mr {
  wireBeans(e) {
    this.columnHoverService = e.columnHoverService;
  }
  constructor(e, t) {
    super(), this.columns = e, this.element = t;
  }
  postConstruct() {
    this.gos.get("columnHoverHighlight") && this.addMouseHoverListeners();
  }
  addMouseHoverListeners() {
    this.addManagedListeners(this.element, {
      mouseout: this.onMouseOut.bind(this),
      mouseover: this.onMouseOver.bind(this)
    });
  }
  onMouseOut() {
    this.columnHoverService.clearMouseOver();
  }
  onMouseOver() {
    this.columnHoverService.setMouseOver(this.columns);
  }
}, MY = class extends Z1 {
  constructor(e, t, r) {
    super(e, t, r), this.iconCreated = !1, this.column = e;
  }
  setComp(e, t, r, n, a) {
    this.comp = e, a = ry(this, this.beans.context, a), this.eButtonShowMainFilter = r, this.eFloatingFilterBody = n, this.setGui(t, a), this.setupActive(), this.setupWidth(a), this.setupLeft(a), this.setupHover(a), this.setupFocus(a), this.setupAria(), this.setupFilterButton(), this.setupUserComp(), this.setupSyncWithFilter(a), this.setupUi(), a.addManagedElementListeners(this.eButtonShowMainFilter, { click: this.showParentFilter.bind(this) }), this.setupFilterChangedListener(a), a.addManagedListeners(this.column, { colDefChanged: () => this.onColDefChanged(a) }), a.addDestroyFunc(() => {
      this.eButtonShowMainFilter = null, this.eFloatingFilterBody = null, this.userCompDetails = null, this.clearComponent();
    });
  }
  // empty abstract method
  resizeHeader() {
  }
  // empty abstract method
  moveHeader() {
  }
  setupActive() {
    const e = this.column.getColDef(), t = !!e.filter, r = !!e.floatingFilter;
    this.active = t && r;
  }
  setupUi() {
    if (this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton && this.active), this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body", this.suppressFilterButton), this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body", !this.suppressFilterButton), !this.active || this.iconCreated)
      return;
    const e = $s("filter", this.gos, this.column);
    e && (this.iconCreated = !0, this.eButtonShowMainFilter.appendChild(e));
  }
  setupFocus(e) {
    e.createManagedBean(
      new $h(this.eGui, {
        shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),
        onTabKeyDown: this.onTabKeyDown.bind(this),
        handleKeyDown: this.handleKeyDown.bind(this),
        onFocusIn: this.onFocusIn.bind(this)
      })
    );
  }
  setupAria() {
    const e = this.localeService.getLocaleTextFunc();
    Dv(this.eButtonShowMainFilter, e("ariaFilterMenuOpen", "Open Filter Menu"));
  }
  onTabKeyDown(e) {
    if (Sa(this.gos) === this.eGui)
      return;
    const n = this.focusService.findNextFocusableElement(this.eGui, null, e.shiftKey);
    if (n) {
      this.beans.headerNavigationService.scrollToColumn(this.column), e.preventDefault(), n.focus();
      return;
    }
    const a = this.findNextColumnWithFloatingFilter(e.shiftKey);
    a && this.focusService.focusHeaderPosition({
      headerPosition: {
        headerRowIndex: this.getParentRowCtrl().getRowIndex(),
        column: a
      },
      event: e
    }) && e.preventDefault();
  }
  findNextColumnWithFloatingFilter(e) {
    const t = this.beans.visibleColsService;
    let r = this.column;
    do
      if (r = e ? t.getColBefore(r) : t.getColAfter(r), !r)
        break;
    while (!r.getColDef().filter || !r.getColDef().floatingFilter);
    return r;
  }
  handleKeyDown(e) {
    super.handleKeyDown(e);
    const t = this.getWrapperHasFocus();
    switch (e.key) {
      case dr.UP:
      case dr.DOWN:
        t || e.preventDefault();
      case dr.LEFT:
      case dr.RIGHT:
        if (t)
          return;
        e.stopPropagation();
      case dr.ENTER:
        t && this.focusService.focusInto(this.eGui) && e.preventDefault();
        break;
      case dr.ESCAPE:
        t || this.eGui.focus();
    }
  }
  onFocusIn(e) {
    if (this.eGui.contains(e.relatedTarget))
      return;
    const r = !!e.relatedTarget && !e.relatedTarget.classList.contains("ag-floating-filter"), n = !!e.relatedTarget && Cv(e.relatedTarget, "ag-floating-filter");
    if (r && n && e.target === this.eGui) {
      const u = this.lastFocusEvent, s = !!(u && u.key === dr.TAB);
      if (u && s) {
        const c = u.shiftKey;
        this.focusService.focusInto(this.eGui, c);
      }
    }
    const a = this.getRowIndex();
    this.beans.focusService.setFocusedHeader(a, this.column);
  }
  setupHover(e) {
    e.createManagedBean(new iR([this.column], this.eGui));
    const t = () => {
      if (!this.gos.get("columnHoverHighlight"))
        return;
      const r = this.beans.columnHoverService.isHovered(this.column);
      this.comp.addOrRemoveCssClass("ag-column-hover", r);
    };
    e.addManagedEventListeners({ columnHoverChanged: t }), t();
  }
  setupLeft(e) {
    const t = new nR(this.column, this.eGui, this.beans);
    e.createManagedBean(t);
  }
  setupFilterButton() {
    this.suppressFilterButton = !this.menuService.isFloatingFilterButtonEnabled(this.column), this.highlightFilterButtonWhenActive = !this.menuService.isLegacyMenuEnabled();
  }
  setupUserComp() {
    var t;
    if (!this.active)
      return;
    const e = (t = this.beans.filterManager) == null ? void 0 : t.getFloatingFilterCompDetails(
      this.column,
      () => this.showParentFilter()
    );
    e && this.setCompDetails(e);
  }
  setCompDetails(e) {
    this.userCompDetails = e, this.comp.setCompDetails(e);
  }
  showParentFilter() {
    const e = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter;
    this.menuService.showFilterMenu({
      column: this.column,
      buttonElement: e,
      containerType: "floatingFilter",
      positionBy: "button"
    });
  }
  setupSyncWithFilter(e) {
    if (!this.active)
      return;
    const { filterManager: t } = this.beans, r = (n) => {
      if ((n == null ? void 0 : n.source) === "filterDestroyed" && !this.isAlive())
        return;
      const a = this.comp.getFloatingFilterComp();
      a && a.then((u) => {
        if (u) {
          const s = t == null ? void 0 : t.getCurrentFloatingFilterParentModel(this.column), c = n ? {
            // event can have additional params like `afterDataChange` which need to be passed through
            ...n,
            columns: n.columns ?? [],
            source: n.source === "api" ? "api" : "columnFilter"
          } : null;
          u.onParentModelChanged(s, c);
        }
      });
    };
    [this.destroySyncListener] = e.addManagedListeners(this.column, { filterChanged: r }), t != null && t.isFilterActive(this.column) && r(null);
  }
  setupWidth(e) {
    const t = () => {
      const r = `${this.column.getActualWidth()}px`;
      this.comp.setWidth(r);
    };
    e.addManagedListeners(this.column, { widthChanged: t }), t();
  }
  setupFilterChangedListener(e) {
    this.active && ([this.destroyFilterChangedListener] = e.addManagedListeners(this.column, {
      filterChanged: this.updateFilterButton.bind(this)
    }), this.updateFilterButton());
  }
  updateFilterButton() {
    var e;
    if (!this.suppressFilterButton && this.comp) {
      const t = !!((e = this.beans.filterManager) != null && e.isFilterAllowed(this.column));
      this.comp.setButtonWrapperDisplayed(t), this.highlightFilterButtonWhenActive && t && this.eButtonShowMainFilter.classList.toggle("ag-filter-active", this.column.isFilterActive());
    }
  }
  onColDefChanged(e) {
    var u;
    const t = this.active;
    this.setupActive();
    const r = !t && this.active;
    t && !this.active && (this.destroySyncListener(), this.destroyFilterChangedListener());
    const n = this.active ? (u = this.beans.filterManager) == null ? void 0 : u.getFloatingFilterCompDetails(this.column, () => this.showParentFilter()) : null, a = this.comp.getFloatingFilterComp();
    !a || !n ? this.updateCompDetails(e, n, r) : a.then((s) => {
      var c;
      !s || (c = this.beans.filterManager) != null && c.areFilterCompsDifferent(this.userCompDetails ?? null, n) ? this.updateCompDetails(e, n, r) : this.updateFloatingFilterParams(n);
    });
  }
  updateCompDetails(e, t, r) {
    this.isAlive() && (this.setCompDetails(t), this.setupFilterButton(), this.setupUi(), r && (this.setupSyncWithFilter(e), this.setupFilterChangedListener(e)));
  }
  updateFloatingFilterParams(e) {
    var r;
    if (!e)
      return;
    const t = e.params;
    (r = this.comp.getFloatingFilterComp()) == null || r.then((n) => {
      let a = !1;
      n != null && n.refresh && typeof n.refresh == "function" && n.refresh(t) !== null && (a = !0), !a && (n != null && n.onParamsUpdated) && typeof n.onParamsUpdated == "function" && n.onParamsUpdated(t) !== null && Fr("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.");
    });
  }
  destroy() {
    super.destroy(), this.destroySyncListener = null, this.destroyFilterChangedListener = null;
  }
};
var $n = "32.2.2";
function DY(e) {
  var t, r;
  return !!((t = e.filterManager) != null && t.isColumnFilterPresent()) || !!((r = e.filterManager) != null && r.isAggregateFilterPresent());
}
function FY(e, t, r) {
  var n;
  return (n = e.filterManager) == null ? void 0 : n.getFilterInstance(t, r);
}
function PY(e, t) {
  var r;
  return ((r = e.filterManager) == null ? void 0 : r.getColumnFilterInstance(t)) ?? Promise.resolve(void 0);
}
function IY(e, t) {
  var n;
  const r = e.columnModel.getColDefCol(t);
  if (r)
    return (n = e.filterManager) == null ? void 0 : n.destroyFilter(r, "api");
}
function LY(e, t) {
  e.frameworkOverrides.wrapIncoming(() => {
    var r;
    return (r = e.filterManager) == null ? void 0 : r.setFilterModel(t);
  });
}
function kY(e) {
  var t;
  return ((t = e.filterManager) == null ? void 0 : t.getFilterModel()) ?? {};
}
function OY(e, t) {
  var r;
  return ((r = e.filterManager) == null ? void 0 : r.getColumnFilterModel(t)) ?? null;
}
function NY(e, t, r) {
  var n;
  return ((n = e.filterManager) == null ? void 0 : n.setColumnFilterModel(t, r)) ?? Promise.resolve();
}
function GY(e, t) {
  const r = e.columnModel.getCol(t);
  if (!r) {
    Ni(`column '${t}' not found`);
    return;
  }
  e.menuService.showFilterMenu({
    column: r,
    containerType: "columnFilter",
    positionBy: "auto"
  });
}
function HY(e, t, r) {
  if (t == null)
    return null;
  let n = null;
  const { compName: a, jsComp: u, fwComp: s } = fk.getCompKeys(e, t, Q2);
  return a ? n = {
    set: "agSetColumnFloatingFilter",
    agSetColumnFilter: "agSetColumnFloatingFilter",
    multi: "agMultiColumnFloatingFilter",
    agMultiColumnFilter: "agMultiColumnFloatingFilter",
    group: "agGroupColumnFloatingFilter",
    agGroupColumnFilter: "agGroupColumnFloatingFilter",
    number: "agNumberColumnFloatingFilter",
    agNumberColumnFilter: "agNumberColumnFloatingFilter",
    date: "agDateColumnFloatingFilter",
    agDateColumnFilter: "agDateColumnFloatingFilter",
    text: "agTextColumnFloatingFilter",
    agTextColumnFilter: "agTextColumnFloatingFilter"
  }[a] : u == null && s == null && t.filter === !0 && (n = r()), n;
}
var lF = {
  january: "January",
  february: "February",
  march: "March",
  april: "April",
  may: "May",
  june: "June",
  july: "July",
  august: "August",
  september: "September",
  october: "October",
  november: "November",
  december: "December"
}, uF = [
  "january",
  "february",
  "march",
  "april",
  "may",
  "june",
  "july",
  "august",
  "september",
  "october",
  "november",
  "december"
], BY = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnFilterService", this.allColumnFilters = /* @__PURE__ */ new Map(), this.allColumnListeners = /* @__PURE__ */ new Map(), this.activeAggregateFilters = [], this.activeColumnFilters = [], this.processingFilterChange = !1, this.filterModelUpdateQueue = [], this.columnFilterModelUpdateQueue = [];
  }
  wireBeans(e) {
    this.valueService = e.valueService, this.columnModel = e.columnModel, this.rowModel = e.rowModel, this.userComponentFactory = e.userComponentFactory, this.rowRenderer = e.rowRenderer, this.dataTypeService = e.dataTypeService, this.filterManager = e.filterManager;
  }
  postConstruct() {
    var e, t;
    this.addManagedEventListeners({
      gridColumnsChanged: this.onColumnsChanged.bind(this),
      rowDataUpdated: () => this.onNewRowsLoaded("rowDataUpdated"),
      dataTypesInferred: this.processFilterModelUpdateQueue.bind(this)
    }), this.initialFilterModel = {
      ...((t = (e = this.gos.get("initialState")) == null ? void 0 : e.filter) == null ? void 0 : t.filterModel) ?? {}
    };
  }
  setFilterModel(e, t = "api") {
    var a;
    if ((a = this.dataTypeService) != null && a.isPendingInference()) {
      this.filterModelUpdateQueue.push({ model: e, source: t });
      return;
    }
    const r = [], n = this.getFilterModel(!0);
    if (e) {
      const u = new Set(Object.keys(e));
      this.allColumnFilters.forEach((s, c) => {
        const i = e[c];
        r.push(this.setModelOnFilterWrapper(s.filterPromise, i)), u.delete(c);
      }), u.forEach((s) => {
        const c = this.columnModel.getColDefCol(s) || this.columnModel.getCol(s);
        if (!c) {
          Fr("setFilterModel() - no column found for colId: " + s);
          return;
        }
        if (!c.isFilterAllowed()) {
          Fr("setFilterModel() - unable to fully apply model, filtering disabled for colId: " + s);
          return;
        }
        const i = this.getOrCreateFilterWrapper(c);
        if (!i) {
          Fr(
            "setFilterModel() - unable to fully apply model, unable to create filter for colId: " + s
          );
          return;
        }
        r.push(this.setModelOnFilterWrapper(i.filterPromise, e[s]));
      });
    } else
      this.allColumnFilters.forEach((u) => {
        r.push(this.setModelOnFilterWrapper(u.filterPromise, null));
      });
    Ia.all(r).then(() => {
      var c;
      const u = this.getFilterModel(!0), s = [];
      this.allColumnFilters.forEach((i, l) => {
        const v = n ? n[l] : null, f = u ? u[l] : null;
        l1(v, f) || s.push(i.column);
      }), s.length > 0 && ((c = this.filterManager) == null || c.onFilterChanged({ columns: s, source: t }));
    });
  }
  setModelOnFilterWrapper(e, t) {
    return new Ia((r) => {
      e.then((n) => {
        typeof n.setModel != "function" && (Fr("filter missing setModel method, which is needed for setFilterModel"), r()), (n.setModel(t) || Ia.resolve()).then(() => r());
      });
    });
  }
  getFilterModel(e) {
    const t = {}, { allColumnFilters: r, initialFilterModel: n } = this;
    return r.forEach((a, u) => {
      const s = this.getModelFromFilterWrapper(a);
      $r(s) && (t[u] = s);
    }), e || Object.entries(n).forEach(([a, u]) => {
      var s;
      $r(u) && !r.has(a) && ((s = this.columnModel.getCol(a)) != null && s.isFilterAllowed()) && (t[a] = u);
    }), t;
  }
  getModelFromFilterWrapper(e) {
    const { filter: t } = e;
    return t ? typeof t.getModel != "function" ? (Fr("filter API missing getModel method, which is needed for getFilterModel"), null) : t.getModel() : this.getModelFromInitialState(e.column);
  }
  getModelFromInitialState(e) {
    return this.initialFilterModel[e.getColId()] ?? null;
  }
  isColumnFilterPresent() {
    return this.activeColumnFilters.length > 0;
  }
  isAggregateFilterPresent() {
    return !!this.activeAggregateFilters.length;
  }
  disableColumnFilters() {
    return this.allColumnFilters.size ? (this.allColumnFilters.forEach(
      (e) => this.disposeFilterWrapper(e, "advancedFilterEnabled")
    ), !0) : !1;
  }
  doAggregateFiltersPass(e, t) {
    return this.doColumnFiltersPass(e, t, !0);
  }
  updateActiveFilters() {
    const e = (u) => u ? u.isFilterActive ? u.isFilterActive() : (Fr("Filter is missing isFilterActive() method"), !1) : !1, t = !!lT(this.gos), r = (u) => {
      if (!u.isPrimary())
        return !0;
      const c = !this.columnModel.isPivotActive();
      return !u.isValueActive() || !c ? !1 : this.columnModel.isPivotMode() ? !0 : t;
    }, n = [], a = [];
    return this.forEachColumnFilter((u, s) => {
      e(u) && (r(s.column) ? n.push(u) : a.push(u));
    }).then(() => {
      this.activeAggregateFilters = n, this.activeColumnFilters = a;
    });
  }
  updateFilterFlagInColumns(e, t) {
    return this.forEachColumnFilter(
      (r, n) => n.column.setFilterActive(r.isFilterActive(), e, t)
    );
  }
  forEachColumnFilter(e) {
    return Ia.all(
      Array.from(this.allColumnFilters.values()).map(
        (t) => t.filterPromise.then((r) => e(r, t))
      )
    );
  }
  doColumnFiltersPass(e, t, r) {
    const { data: n, aggData: a } = e, u = r ? this.activeAggregateFilters : this.activeColumnFilters, s = r ? a : n;
    for (let c = 0; c < u.length; c++) {
      const i = u[c];
      if (!(i == null || i === t)) {
        if (typeof i.doesFilterPass != "function")
          throw new Error("Filter is missing method doesFilterPass");
        if (!i.doesFilterPass({ node: e, data: s }))
          return !1;
      }
    }
    return !0;
  }
  // sometimes (especially in React) the filter can call onFilterChanged when we are in the middle
  // of a render cycle. this would be bad, so we wait for render cycle to complete when this happens.
  // this happens in react when we change React State in the grid (eg setting RowCtrl's in RowContainer)
  // which results in React State getting applied in the main application, triggering a useEffect() to
  // be kicked off adn then the application calling the grid's API. in AG-6554, the custom filter was
  // getting it's useEffect() triggered in this way.
  callOnFilterChangedOutsideRenderCycle(e) {
    const t = () => {
      var r;
      return (r = this.filterManager) == null ? void 0 : r.onFilterChanged(e);
    };
    this.rowRenderer.isRefreshInProgress() ? setTimeout(t, 0) : t();
  }
  updateBeforeFilterChanged(e = {}) {
    const { filterInstance: t, additionalEventAttributes: r } = e;
    return this.updateDependentFilters(), this.updateActiveFilters().then(
      () => this.updateFilterFlagInColumns("filterChanged", r).then(() => {
        this.allColumnFilters.forEach((n) => {
          n.filterPromise && n.filterPromise.then((a) => {
            a && a !== t && a.onAnyFilterChanged && a.onAnyFilterChanged();
          });
        }), this.processingFilterChange = !0;
      })
    );
  }
  updateAfterFilterChanged() {
    this.processingFilterChange = !1;
  }
  isSuppressFlashingCellsBecauseFiltering() {
    return !(this.gos.get("allowShowChangeAfterFilter") ?? !1) && this.processingFilterChange;
  }
  onNewRowsLoaded(e) {
    this.forEachColumnFilter((t) => {
      t.onNewRowsLoaded && t.onNewRowsLoaded();
    }).then(() => this.updateFilterFlagInColumns(e, { afterDataChange: !0 })).then(() => this.updateActiveFilters());
  }
  createValueGetter(e) {
    return ({ node: t }) => this.valueService.getValue(e, t, !0);
  }
  createGetValue(e) {
    return (t, r) => {
      const n = r ? this.columnModel.getCol(r) : e;
      return n ? this.valueService.getValue(n, t, !0) : void 0;
    };
  }
  isFilterActive(e) {
    const { filter: t } = this.cachedFilter(e) ?? {};
    return t ? t.isFilterActive() : this.getModelFromInitialState(e) != null;
  }
  getOrCreateFilterWrapper(e) {
    if (!e.isFilterAllowed())
      return null;
    let t = this.cachedFilter(e);
    return t || (t = this.createFilterWrapper(e), this.setColumnFilterWrapper(e, t)), t;
  }
  cachedFilter(e) {
    return this.allColumnFilters.get(e.getColId());
  }
  getDefaultFilter(e) {
    var r;
    let t;
    if (gx(this.gos))
      t = "agSetColumnFilter";
    else {
      const n = (r = this.dataTypeService) == null ? void 0 : r.getBaseDataType(e);
      n === "number" ? t = "agNumberColumnFilter" : n === "date" || n === "dateString" ? t = "agDateColumnFilter" : t = "agTextColumnFilter";
    }
    return t;
  }
  getDefaultFloatingFilter(e) {
    var r;
    let t;
    if (gx(this.gos))
      t = "agSetColumnFloatingFilter";
    else {
      const n = (r = this.dataTypeService) == null ? void 0 : r.getBaseDataType(e);
      n === "number" ? t = "agNumberColumnFloatingFilter" : n === "date" || n === "dateString" ? t = "agDateColumnFloatingFilter" : t = "agTextColumnFloatingFilter";
    }
    return t;
  }
  createFilterInstance(e, t) {
    const r = this.getDefaultFilter(e), n = e.getColDef();
    let a;
    const u = {
      ...this.createFilterParams(e, n),
      filterModifiedCallback: () => this.filterModifiedCallbackFactory(a, e)(),
      filterChangedCallback: (c) => this.filterChangedCallbackFactory(a, e)(c),
      doesRowPassOtherFilter: (c) => this.filterManager ? this.filterManager.doesRowPassOtherFilters(a, c) : !0
    }, s = this.userComponentFactory.getFilterDetails(n, u, r);
    return s ? {
      filterPromise: () => {
        const c = s.newAgStackInstance();
        return c != null && c.then((i) => {
          a = i, t && (t.filter = i);
        }), c;
      },
      compDetails: s
    } : { filterPromise: null, compDetails: null };
  }
  createFilterParams(e, t) {
    return this.gos.addGridCommonParams({
      column: e,
      colDef: VL(t),
      rowModel: this.rowModel,
      filterChangedCallback: () => {
      },
      filterModifiedCallback: () => {
      },
      valueGetter: this.createValueGetter(e),
      getValue: this.createGetValue(e),
      doesRowPassOtherFilter: () => !0
    });
  }
  createFilterWrapper(e) {
    const t = {
      column: e,
      filterPromise: null,
      compiledElement: null,
      compDetails: null
    }, { filterPromise: r, compDetails: n } = this.createFilterInstance(e, t);
    return t.filterPromise = (r == null ? void 0 : r()) ?? null, t.compDetails = n, t;
  }
  onColumnsChanged() {
    var r;
    const e = [];
    this.allColumnFilters.forEach((n, a) => {
      let u;
      n.column.isPrimary() ? u = this.columnModel.getColDefCol(a) : u = this.columnModel.getCol(a), !(u && u === n.column) && (e.push(n.column), this.disposeFilterWrapper(n, "columnChanged"), this.disposeColumnListener(a));
    });
    const t = e.every(
      (n) => n.getColDef().filter === "agGroupColumnFilter"
    );
    e.length > 0 && !t ? (r = this.filterManager) == null || r.onFilterChanged({ columns: e, source: "api" }) : this.updateDependentFilters();
  }
  updateDependentFilters() {
    const e = this.columnModel.getAutoCols();
    e == null || e.forEach((t) => {
      t.getColDef().filter === "agGroupColumnFilter" && this.getOrCreateFilterWrapper(t);
    });
  }
  // for group filters, can change dynamically whether they are allowed or not
  isFilterAllowed(e) {
    if (!e.isFilterAllowed())
      return !1;
    const { filter: r } = this.allColumnFilters.get(e.getColId()) ?? {};
    return r && typeof (r == null ? void 0 : r.isFilterAllowed) == "function" ? r.isFilterAllowed() : !0;
  }
  getFloatingFilterCompDetails(e, t) {
    const r = (i) => {
      var v;
      const l = (v = this.getOrCreateFilterWrapper(e)) == null ? void 0 : v.filterPromise;
      l != null && l.then((f) => {
        i(Em(f));
      });
    }, n = e.getColDef(), a = {
      ...this.createFilterParams(e, n),
      filterChangedCallback: () => r(
        (i) => this.filterChangedCallbackFactory(i, e)()
      )
    }, u = this.userComponentFactory.mergeParamsWithApplicationProvidedParams(
      n,
      Q2,
      a
    );
    let s = HY(
      this.frameworkOverrides,
      n,
      () => this.getDefaultFloatingFilter(e)
    );
    s == null && (s = "agReadOnlyFloatingFilter");
    const c = {
      column: e,
      filterParams: u,
      currentParentModel: () => this.getCurrentFloatingFilterParentModel(e),
      parentFilterInstance: r,
      showParentFilter: t,
      suppressFilterButton: !1
      // This one might be overridden from the colDef
    };
    return this.userComponentFactory.getFloatingFilterCompDetails(n, c, s);
  }
  getCurrentFloatingFilterParentModel(e) {
    return this.getModelFromFilterWrapper(this.cachedFilter(e) ?? { column: e });
  }
  // destroys the filter, so it no longer takes part
  destroyFilter(e, t = "api") {
    var a;
    const r = e.getColId(), n = this.allColumnFilters.get(r);
    this.disposeColumnListener(r), delete this.initialFilterModel[r], n && (this.disposeFilterWrapper(n, t), (a = this.filterManager) == null || a.onFilterChanged({
      columns: [e],
      source: "api"
    }));
  }
  disposeColumnListener(e) {
    const t = this.allColumnListeners.get(e);
    t && (this.allColumnListeners.delete(e), t());
  }
  disposeFilterWrapper(e, t) {
    e.filterPromise.then((r) => {
      this.destroyBean(r), e.column.setFilterActive(!1, "filterDestroyed"), this.allColumnFilters.delete(e.column.getColId()), this.eventService.dispatchEvent({
        type: "filterDestroyed",
        source: t,
        column: e.column
      });
    });
  }
  filterModifiedCallbackFactory(e, t) {
    return () => {
      this.eventService.dispatchEvent({
        type: "filterModified",
        column: t,
        filterInstance: e
      });
    };
  }
  filterChangedCallbackFactory(e, t) {
    return (r) => {
      const n = (r == null ? void 0 : r.source) ?? "columnFilter", a = {
        filter: e,
        additionalEventAttributes: r,
        columns: [t],
        source: n
      };
      this.callOnFilterChangedOutsideRenderCycle(a);
    };
  }
  checkDestroyFilter(e) {
    const t = this.allColumnFilters.get(e);
    if (!t)
      return;
    const r = t.column, { compDetails: n } = r.isFilterAllowed() ? this.createFilterInstance(r) : { compDetails: null };
    if (this.areFilterCompsDifferent(t.compDetails, n)) {
      this.destroyFilter(r, "paramsUpdated");
      return;
    }
    const a = r.getColDef().filterParams;
    if (!t.filterPromise) {
      this.destroyFilter(r, "paramsUpdated");
      return;
    }
    t.filterPromise.then((u) => {
      (u != null && u.refresh ? u.refresh({
        ...this.createFilterParams(r, r.getColDef()),
        filterModifiedCallback: this.filterModifiedCallbackFactory(u, r),
        filterChangedCallback: this.filterChangedCallbackFactory(u, r),
        doesRowPassOtherFilter: (c) => this.filterManager ? this.filterManager.doesRowPassOtherFilters(u, c) : !0,
        ...a
      }) : !0) === !1 && this.destroyFilter(r, "paramsUpdated");
    });
  }
  setColumnFilterWrapper(e, t) {
    const r = e.getColId();
    this.allColumnFilters.set(r, t), this.allColumnListeners.set(
      r,
      this.addManagedListeners(e, { colDefChanged: () => this.checkDestroyFilter(r) })[0]
    );
  }
  areFilterCompsDifferent(e, t) {
    if (!t || !e)
      return !0;
    const { componentClass: r } = e, { componentClass: n } = t;
    return !(r === n || // react hooks returns new wrappers, so check nested render method
    (r == null ? void 0 : r.render) && (n == null ? void 0 : n.render) && r.render === n.render);
  }
  hasFloatingFilters() {
    return this.columnModel.getCols().some((t) => t.getColDef().floatingFilter);
  }
  getFilterInstance(e, t) {
    t && this.getFilterInstanceImpl(e).then((r) => {
      const n = Em(r);
      t(n);
    });
  }
  getColumnFilterInstance(e) {
    return new Promise((t) => {
      this.getFilterInstanceImpl(e).then((r) => {
        t(Em(r));
      });
    });
  }
  getFilterInstanceImpl(e) {
    var n;
    const t = this.columnModel.getColDefCol(e);
    return t ? ((n = this.getOrCreateFilterWrapper(t)) == null ? void 0 : n.filterPromise) ?? Ia.resolve(null) : Ia.resolve(void 0);
  }
  processFilterModelUpdateQueue() {
    this.filterModelUpdateQueue.forEach(({ model: e, source: t }) => this.setFilterModel(e, t)), this.filterModelUpdateQueue = [], this.columnFilterModelUpdateQueue.forEach(({ key: e, model: t, resolve: r }) => {
      this.setColumnFilterModel(e, t).then(() => r());
    }), this.columnFilterModelUpdateQueue = [];
  }
  getColumnFilterModel(e) {
    const t = this.getFilterWrapper(e);
    return t ? this.getModelFromFilterWrapper(t) : null;
  }
  setColumnFilterModel(e, t) {
    var u;
    if ((u = this.dataTypeService) != null && u.isPendingInference()) {
      let s = () => {
      };
      const c = new Promise((i) => {
        s = i;
      });
      return this.columnFilterModelUpdateQueue.push({ key: e, model: t, resolve: s }), c;
    }
    const r = this.columnModel.getColDefCol(e), n = r ? this.getOrCreateFilterWrapper(r) : null;
    return n ? ((s) => new Promise((c) => {
      s.then((i) => c(i));
    }))(this.setModelOnFilterWrapper(n.filterPromise, t)) : Promise.resolve();
  }
  getFilterWrapper(e) {
    const t = this.columnModel.getColDefCol(e);
    return t ? this.cachedFilter(t) ?? null : null;
  }
  setColDefPropertiesForDataType(e, t, r) {
    const n = gx(this.gos), a = this.localeService.getLocaleTextFunc(), u = (s) => {
      const { filterParams: c } = e;
      e.filterParams = typeof c == "object" ? {
        ...c,
        ...s
      } : s;
    };
    switch (t.baseDataType) {
      case "number": {
        n && u({
          comparator: (s, c) => {
            const i = s == null ? 0 : parseInt(s), l = c == null ? 0 : parseInt(c);
            return i === l ? 0 : i > l ? 1 : -1;
          }
        });
        break;
      }
      case "boolean": {
        u(n ? {
          valueFormatter: (s) => $r(s.value) ? a(String(s.value), s.value ? "True" : "False") : a("blanks", "(Blanks)")
        } : {
          maxNumConditions: 1,
          debounceMs: 0,
          filterOptions: [
            "empty",
            {
              displayKey: "true",
              displayName: "True",
              predicate: (s, c) => c,
              numberOfInputs: 0
            },
            {
              displayKey: "false",
              displayName: "False",
              predicate: (s, c) => c === !1,
              numberOfInputs: 0
            }
          ]
        });
        break;
      }
      case "date": {
        n && u({
          valueFormatter: (s) => {
            const c = r(s);
            return $r(c) ? c : a("blanks", "(Blanks)");
          },
          treeList: !0,
          treeListFormatter: (s, c) => {
            if (c === 1 && s != null) {
              const i = uF[Number(s) - 1];
              return a(i, lF[i]);
            }
            return s ?? a("blanks", "(Blanks)");
          }
        });
        break;
      }
      case "dateString": {
        const s = t.dateParser;
        u(n ? {
          valueFormatter: (c) => {
            const i = r(c);
            return $r(i) ? i : a("blanks", "(Blanks)");
          },
          treeList: !0,
          treeListPathGetter: (c) => {
            const i = s(c ?? void 0);
            return i ? [String(i.getFullYear()), String(i.getMonth() + 1), String(i.getDate())] : null;
          },
          treeListFormatter: (c, i) => {
            if (i === 1 && c != null) {
              const l = uF[Number(c) - 1];
              return a(l, lF[l]);
            }
            return c ?? a("blanks", "(Blanks)");
          }
        } : {
          comparator: (c, i) => {
            const l = s(i);
            return i == null || l < c ? -1 : l > c ? 1 : 0;
          }
        });
        break;
      }
      case "object": {
        n ? u({
          valueFormatter: (s) => {
            const c = r(s);
            return $r(c) ? c : a("blanks", "(Blanks)");
          }
        }) : e.filterValueGetter = (s) => r({
          column: s.column,
          node: s.node,
          value: this.valueService.getValue(s.column, s.node)
        });
        break;
      }
    }
  }
  destroy() {
    super.destroy(), this.allColumnFilters.forEach((e) => this.disposeFilterWrapper(e, "gridDestroyed")), this.allColumnListeners.clear();
  }
};
function VY(e) {
  var t;
  return !!((t = e.filterManager) != null && t.isAnyFilterPresent());
}
function zY(e, t = "api") {
  var r;
  (r = e.filterManager) == null || r.onFilterChanged({ source: t });
}
var WY = class extends na {
  constructor() {
    super(
      /* html */
      `
            <div class="ag-floating-filter-input" role="presentation">
                <ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>
            </div>`,
      [$1]
    ), this.eFloatingFilterText = In;
  }
  wireBeans(e) {
    this.columnNameService = e.columnNameService;
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
  init(e) {
    this.params = e;
    const t = this.columnNameService.getDisplayNameForColumn(e.column, "header", !0), r = this.localeService.getLocaleTextFunc();
    this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${r("ariaFilterInput", "Filter Input")}`);
  }
  onParentModelChanged(e) {
    if (e == null) {
      this.eFloatingFilterText.setValue("");
      return;
    }
    this.params.parentFilterInstance((t) => {
      if (t.getModelAsString) {
        const r = t.getModelAsString(e);
        this.eFloatingFilterText.setValue(r);
      }
    });
  }
  onParamsUpdated(e) {
    this.refresh(e);
  }
  refresh(e) {
    this.init(e);
  }
}, Gk = class extends na {
  wireBeans(e) {
    this.columnNameService = e.columnNameService;
  }
  getDefaultDebounceMs() {
    return 0;
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
  isEventFromFloatingFilter(e) {
    return e && e.afterFloatingFilter;
  }
  isEventFromDataChange(e) {
    return e == null ? void 0 : e.afterDataChange;
  }
  getLastType() {
    return this.lastType;
  }
  isReadOnly() {
    return this.readOnly;
  }
  setLastTypeFromModel(e) {
    if (!e) {
      this.lastType = this.optionsFactory.getDefaultOption();
      return;
    }
    const t = e.operator;
    let r;
    t ? r = e.conditions[0] : r = e, this.lastType = r.type;
  }
  canWeEditAfterModelFromParentFilter(e) {
    if (!e)
      return this.isTypeEditable(this.lastType);
    if (e.operator)
      return !1;
    const r = e;
    return this.isTypeEditable(r.type);
  }
  init(e) {
    this.setSimpleParams(e, !1);
  }
  setSimpleParams(e, t = !0) {
    this.optionsFactory = new bk(), this.optionsFactory.init(e.filterParams, this.getDefaultFilterOptions()), t || (this.lastType = this.optionsFactory.getDefaultOption()), this.readOnly = !!e.filterParams.readOnly;
    const r = this.isTypeEditable(this.optionsFactory.getDefaultOption());
    this.setEditable(r);
  }
  onParamsUpdated(e) {
    this.refresh(e);
  }
  refresh(e) {
    this.setSimpleParams(e);
  }
  doesFilterHaveSingleInput(e) {
    const t = this.optionsFactory.getCustomOption(e), { numberOfInputs: r } = t || {};
    return r == null || r == 1;
  }
  isTypeEditable(e) {
    const t = ["inRange", "empty", "blank", "notBlank"];
    return !!e && !this.isReadOnly() && this.doesFilterHaveSingleInput(e) && t.indexOf(e) < 0;
  }
  getAriaLabel(e) {
    const t = this.columnNameService.getDisplayNameForColumn(e.column, "header", !0), r = this.localeService.getLocaleTextFunc();
    return `${t} ${r("ariaFilterInput", "Filter Input")}`;
  }
}, _Y = class extends Gk {
  constructor() {
    super(
      /* html */
      `
            <div class="ag-floating-filter-input" role="presentation">
                <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field>
                <div data-ref="eDateWrapper" style="display: flex;"></div>
            </div>`,
      [$1]
    ), this.eReadOnlyText = In, this.eDateWrapper = In;
  }
  wireBeans(e) {
    super.wireBeans(e), this.context = e.context, this.userComponentFactory = e.userComponentFactory;
  }
  getDefaultFilterOptions() {
    return Pk;
  }
  init(e) {
    super.init(e), this.params = e, this.filterParams = e.filterParams, this.createDateComponent(), this.filterModelFormatter = new Ik(
      this.filterParams,
      this.localeService,
      this.optionsFactory
    );
    const t = this.localeService.getLocaleTextFunc();
    this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput", "Date Filter Input"));
  }
  onParamsUpdated(e) {
    this.refresh(e);
  }
  refresh(e) {
    super.refresh(e), this.params = e, this.filterParams = e.filterParams, this.updateDateComponent(), this.filterModelFormatter.updateParams({
      optionsFactory: this.optionsFactory,
      dateFilterParams: this.filterParams
    }), this.updateCompOnModelChange(e.currentParentModel());
  }
  updateCompOnModelChange(e) {
    const t = !this.isReadOnly() && this.canWeEditAfterModelFromParentFilter(e);
    if (this.setEditable(t), t) {
      if (e) {
        const r = e;
        this.dateComp.setDate(ws(r.dateFrom));
      } else
        this.dateComp.setDate(null);
      this.eReadOnlyText.setValue("");
    } else
      this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)), this.dateComp.setDate(null);
  }
  setEditable(e) {
    ba(this.eDateWrapper, e), ba(this.eReadOnlyText.getGui(), !e);
  }
  onParentModelChanged(e, t) {
    this.isEventFromFloatingFilter(t) || this.isEventFromDataChange(t) || (super.setLastTypeFromModel(e), this.updateCompOnModelChange(e));
  }
  onDateChanged() {
    const e = this.dateComp.getDate(), t = zl(e);
    this.params.parentFilterInstance((r) => {
      if (r) {
        const n = ws(t);
        r.onFloatingFilterChanged(this.getLastType() || null, n);
      }
    });
  }
  getDateComponentParams() {
    const e = q2(this.params.filterParams, this.getDefaultDebounceMs());
    return {
      onDateChanged: Cs(this.onDateChanged.bind(this), e),
      filterParams: this.params.column.getColDef().filterParams
    };
  }
  createDateComponent() {
    this.dateComp = new Fk(
      this.context,
      this.userComponentFactory,
      this.getDateComponentParams(),
      this.eDateWrapper,
      (e) => {
        e.setInputAriaLabel(this.getAriaLabel(this.params));
      }
    ), this.addDestroyFunc(() => this.dateComp.destroy());
  }
  updateDateComponent() {
    const e = this.gos.addGridCommonParams(this.getDateComponentParams());
    this.dateComp.updateParams(e);
  }
  getFilterModelFormatter() {
    return this.filterModelFormatter;
  }
}, UY = class extends na {
  constructor() {
    super(
      /* html */
      `
            <div class="ag-filter-filter">
                <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field>
            </div>`,
      [$1]
    ), this.eDateInput = In;
  }
  // this is a user component, and IComponent has "public destroy()" as part of the interface.
  // so we need to override destroy() just to make the method public.
  destroy() {
    super.destroy();
  }
  init(e) {
    this.params = e, this.setParams(e);
    const t = this.eDateInput.getInputElement();
    this.addManagedListeners(t, {
      // ensures that the input element is focussed when a clear button is clicked,
      // unless using safari as there is no clear button and focus does not work properly
      mouseDown: () => {
        this.eDateInput.isDisabled() || this.usingSafariDatePicker || t.focus();
      },
      input: (r) => {
        r.target === Sa(this.gos) && (this.eDateInput.isDisabled() || this.params.onDateChanged());
      }
    });
  }
  setParams(e) {
    const t = this.eDateInput.getInputElement(), r = this.shouldUseBrowserDatePicker(e);
    this.usingSafariDatePicker = r && sc(), t.type = r ? "date" : "text";
    const { minValidYear: n, maxValidYear: a, minValidDate: u, maxValidDate: s } = e.filterParams || {};
    if (u && n && Fr(
      "DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."
    ), s && a && Fr(
      "DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."
    ), u && s) {
      const [c, i] = [u, s].map(
        (l) => l instanceof Date ? l : ws(l)
      );
      c && i && c.getTime() > i.getTime() && Fr(
        "DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate."
      );
    }
    u ? u instanceof Date ? t.min = Dm(u) : t.min = u : n && (t.min = `${n}-01-01`), s ? s instanceof Date ? t.max = Dm(s) : t.max = s : a && (t.max = `${a}-12-31`);
  }
  onParamsUpdated(e) {
    this.refresh(e);
  }
  refresh(e) {
    this.params = e, this.setParams(e);
  }
  getDate() {
    return ws(this.eDateInput.getValue());
  }
  setDate(e) {
    this.eDateInput.setValue(zl(e, !1));
  }
  setInputPlaceholder(e) {
    this.eDateInput.setInputPlaceholder(e);
  }
  setInputAriaLabel(e) {
    this.eDateInput.setAriaLabel(e);
  }
  setDisabled(e) {
    this.eDateInput.setDisabled(e);
  }
  afterGuiAttached(e) {
    (!e || !e.suppressFocus) && this.eDateInput.getInputElement().focus();
  }
  shouldUseBrowserDatePicker(e) {
    return e.filterParams && e.filterParams.browserDatePicker != null ? e.filterParams.browserDatePicker : W2() || _2() || sc() && KL() >= 14.1;
  }
}, Hk = class extends mr {
  constructor(e) {
    super(), this.params = e, this.eFloatingFilterTextInput = In, this.valueChangedListener = () => {
    };
  }
  setupGui(e) {
    var n;
    this.eFloatingFilterTextInput = this.createManagedBean(new Zh((n = this.params) == null ? void 0 : n.config));
    const t = this.eFloatingFilterTextInput.getGui();
    e.appendChild(t);
    const r = (a) => this.valueChangedListener(a);
    this.addManagedListeners(t, {
      input: r,
      keydown: r
    });
  }
  setEditable(e) {
    this.eFloatingFilterTextInput.setDisabled(!e);
  }
  setAutoComplete(e) {
    this.eFloatingFilterTextInput.setAutoComplete(e);
  }
  getValue() {
    return this.eFloatingFilterTextInput.getValue();
  }
  setValue(e, t) {
    this.eFloatingFilterTextInput.setValue(e, t);
  }
  setValueChangedListener(e) {
    this.valueChangedListener = e;
  }
  setParams(e) {
    this.setAriaLabel(e.ariaLabel), e.autoComplete !== void 0 && this.setAutoComplete(e.autoComplete);
  }
  setAriaLabel(e) {
    this.eFloatingFilterTextInput.setInputAriaLabel(e);
  }
}, Bk = class extends Gk {
  constructor() {
    super(...arguments), this.eFloatingFilterInputContainer = In;
  }
  postConstruct() {
    this.setTemplate(
      /* html */
      `
            <div class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div>
        `
    );
  }
  getDefaultDebounceMs() {
    return 500;
  }
  onParentModelChanged(e, t) {
    this.isEventFromFloatingFilter(t) || this.isEventFromDataChange(t) || (this.setLastTypeFromModel(e), this.setEditable(this.canWeEditAfterModelFromParentFilter(e)), this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)));
  }
  init(e) {
    this.setupFloatingFilterInputService(e), super.init(e), this.setTextInputParams(e);
  }
  setupFloatingFilterInputService(e) {
    this.floatingFilterInputService = this.createFloatingFilterInputService(e), this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer);
  }
  setTextInputParams(e) {
    this.params = e;
    const t = e.browserAutoComplete ?? !1;
    if (this.floatingFilterInputService.setParams({
      ariaLabel: this.getAriaLabel(e),
      autoComplete: t
    }), this.applyActive = w1(this.params.filterParams), !this.isReadOnly()) {
      const r = q2(this.params.filterParams, this.getDefaultDebounceMs()), n = Cs(
        this.syncUpWithParentFilter.bind(this),
        r
      );
      this.floatingFilterInputService.setValueChangedListener(n);
    }
  }
  onParamsUpdated(e) {
    this.refresh(e);
  }
  refresh(e) {
    super.refresh(e), this.setTextInputParams(e);
  }
  recreateFloatingFilterInputService(e) {
    const t = this.floatingFilterInputService.getValue();
    Qs(this.eFloatingFilterInputContainer), this.destroyBean(this.floatingFilterInputService), this.setupFloatingFilterInputService(e), this.floatingFilterInputService.setValue(t, !0);
  }
  syncUpWithParentFilter(e) {
    const t = e.key === dr.ENTER;
    if (this.applyActive && !t)
      return;
    let r = this.floatingFilterInputService.getValue();
    this.params.filterParams.trimInput && (r = Mk(r), this.floatingFilterInputService.setValue(r, !0)), this.params.parentFilterInstance((n) => {
      n && n.onFloatingFilterChanged(this.getLastType() || null, r || null);
    });
  }
  setEditable(e) {
    this.floatingFilterInputService.setEditable(e);
  }
}, jY = class extends mr {
  constructor() {
    super(...arguments), this.valueChangedListener = () => {
    }, this.numberInputActive = !0;
  }
  setupGui(e) {
    this.eFloatingFilterNumberInput = this.createManagedBean(new tR()), this.eFloatingFilterTextInput = this.createManagedBean(new Zh()), this.eFloatingFilterTextInput.setDisabled(!0);
    const t = this.eFloatingFilterNumberInput.getGui(), r = this.eFloatingFilterTextInput.getGui();
    e.appendChild(t), e.appendChild(r), this.setupListeners(t, (n) => this.valueChangedListener(n)), this.setupListeners(r, (n) => this.valueChangedListener(n));
  }
  setEditable(e) {
    this.numberInputActive = e, this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive), this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive);
  }
  setAutoComplete(e) {
    this.eFloatingFilterNumberInput.setAutoComplete(e), this.eFloatingFilterTextInput.setAutoComplete(e);
  }
  getValue() {
    return this.getActiveInputElement().getValue();
  }
  setValue(e, t) {
    this.getActiveInputElement().setValue(e, t);
  }
  getActiveInputElement() {
    return this.numberInputActive ? this.eFloatingFilterNumberInput : this.eFloatingFilterTextInput;
  }
  setValueChangedListener(e) {
    this.valueChangedListener = e;
  }
  setupListeners(e, t) {
    this.addManagedListeners(e, {
      input: t,
      keydown: t
    });
  }
  setParams(e) {
    this.setAriaLabel(e.ariaLabel), e.autoComplete !== void 0 && this.setAutoComplete(e.autoComplete);
  }
  setAriaLabel(e) {
    this.eFloatingFilterNumberInput.setInputAriaLabel(e), this.eFloatingFilterTextInput.setInputAriaLabel(e);
  }
}, YY = class extends Bk {
  init(e) {
    var t;
    super.init(e), this.filterModelFormatter = new Rk(
      this.localeService,
      this.optionsFactory,
      (t = e.filterParams) == null ? void 0 : t.numberFormatter
    );
  }
  onParamsUpdated(e) {
    this.refresh(e);
  }
  refresh(e) {
    CT(e.filterParams) !== this.allowedCharPattern && this.recreateFloatingFilterInputService(e), super.refresh(e), this.filterModelFormatter.updateParams({ optionsFactory: this.optionsFactory });
  }
  getDefaultFilterOptions() {
    return Tk;
  }
  getFilterModelFormatter() {
    return this.filterModelFormatter;
  }
  createFloatingFilterInputService(e) {
    return this.allowedCharPattern = CT(e.filterParams), this.allowedCharPattern ? this.createManagedBean(
      new Hk({
        config: { allowedCharPattern: this.allowedCharPattern }
      })
    ) : this.createManagedBean(new jY());
  }
}, XY = class extends Bk {
  init(e) {
    super.init(e), this.filterModelFormatter = new Ek(this.localeService, this.optionsFactory);
  }
  onParamsUpdated(e) {
    this.refresh(e);
  }
  refresh(e) {
    super.refresh(e), this.filterModelFormatter.updateParams({ optionsFactory: this.optionsFactory });
  }
  getDefaultFilterOptions() {
    return Ak;
  }
  getFilterModelFormatter() {
    return this.filterModelFormatter;
  }
  createFloatingFilterInputService() {
    return this.createManagedBean(new Hk());
  }
};
function $Y(e) {
  var t;
  return !!((t = e.filterManager) != null && t.isQuickFilterPresent());
}
function ZY(e) {
  return e.gos.get("quickFilterText");
}
function KY(e) {
  var t;
  (t = e.filterManager) == null || t.resetQuickFilterCache();
}
var JY = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "quickFilterService", this.quickFilter = null, this.quickFilterParts = null;
  }
  wireBeans(e) {
    this.valueService = e.valueService, this.columnModel = e.columnModel, this.rowModel = e.rowModel, this.pivotResultColsService = e.pivotResultColsService;
  }
  postConstruct() {
    const e = this.resetQuickFilterCache.bind(this);
    this.addManagedEventListeners({
      columnPivotModeChanged: e,
      newColumnsLoaded: e,
      columnRowGroupChanged: e,
      columnVisible: () => {
        this.gos.get("includeHiddenColumnsInQuickFilter") || this.resetQuickFilterCache();
      }
    }), this.addManagedPropertyListener("quickFilterText", (t) => this.setQuickFilter(t.currentValue)), this.addManagedPropertyListeners(
      ["includeHiddenColumnsInQuickFilter", "applyQuickFilterBeforePivotOrAgg"],
      () => this.onQuickFilterColumnConfigChanged()
    ), this.quickFilter = this.parseQuickFilter(this.gos.get("quickFilterText")), this.parser = this.gos.get("quickFilterParser"), this.matcher = this.gos.get("quickFilterMatcher"), this.setQuickFilterParts(), this.addManagedPropertyListeners(
      ["quickFilterMatcher", "quickFilterParser"],
      () => this.setQuickFilterParserAndMatcher()
    );
  }
  // if we are using autoGroupCols, then they should be included for quick filter. this covers the
  // following scenarios:
  // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on
  // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this
  //    (tree data is a bit different, as parent rows can be filtered on, unlike row grouping)
  refreshQuickFilterCols() {
    var a;
    const e = this.columnModel.isPivotMode(), t = this.columnModel.getAutoCols(), r = this.columnModel.getColDefCols();
    let n = (e && !this.gos.get("applyQuickFilterBeforePivotOrAgg") ? (a = this.pivotResultColsService.getPivotResultCols()) == null ? void 0 : a.list : r) ?? [];
    t && (n = n.concat(t)), this.colsForQuickFilter = this.gos.get("includeHiddenColumnsInQuickFilter") ? n : n.filter((u) => u.isVisible() || u.isRowGroupActive());
  }
  isQuickFilterPresent() {
    return this.quickFilter !== null;
  }
  doesRowPassQuickFilter(e) {
    const t = this.gos.get("cacheQuickFilter");
    return this.matcher ? this.doesRowPassQuickFilterMatcher(t, e) : this.quickFilterParts.every(
      (r) => t ? this.doesRowPassQuickFilterCache(e, r) : this.doesRowPassQuickFilterNoCache(e, r)
    );
  }
  resetQuickFilterCache() {
    this.rowModel.forEachNode((e) => e.quickFilterAggregateText = null);
  }
  setQuickFilterParts() {
    const { quickFilter: e, parser: t } = this;
    e ? this.quickFilterParts = t ? t(e) : e.split(" ") : this.quickFilterParts = null;
  }
  parseQuickFilter(e) {
    return $r(e) ? da(this.gos) ? e.toUpperCase() : (Fr("Quick filtering only works with the Client-Side Row Model"), null) : null;
  }
  setQuickFilter(e) {
    if (e != null && typeof e != "string") {
      Fr(`Grid option quickFilterText only supports string inputs, received: ${typeof e}`);
      return;
    }
    const t = this.parseQuickFilter(e);
    this.quickFilter !== t && (this.quickFilter = t, this.setQuickFilterParts(), this.dispatchLocalEvent({ type: "quickFilterChanged" }));
  }
  setQuickFilterParserAndMatcher() {
    const e = this.gos.get("quickFilterParser"), t = this.gos.get("quickFilterMatcher"), r = e !== this.parser || t !== this.matcher;
    this.parser = e, this.matcher = t, r && (this.setQuickFilterParts(), this.dispatchLocalEvent({ type: "quickFilterChanged" }));
  }
  onQuickFilterColumnConfigChanged() {
    this.refreshQuickFilterCols(), this.resetQuickFilterCache(), this.isQuickFilterPresent() && this.dispatchLocalEvent({ type: "quickFilterChanged" });
  }
  doesRowPassQuickFilterNoCache(e, t) {
    return this.colsForQuickFilter.some((r) => {
      const n = this.getQuickFilterTextForColumn(r, e);
      return $r(n) && n.indexOf(t) >= 0;
    });
  }
  doesRowPassQuickFilterCache(e, t) {
    return this.checkGenerateQuickFilterAggregateText(e), e.quickFilterAggregateText.indexOf(t) >= 0;
  }
  doesRowPassQuickFilterMatcher(e, t) {
    let r;
    e ? (this.checkGenerateQuickFilterAggregateText(t), r = t.quickFilterAggregateText) : r = this.getQuickFilterAggregateText(t);
    const { quickFilterParts: n, matcher: a } = this;
    return a(n, r);
  }
  checkGenerateQuickFilterAggregateText(e) {
    e.quickFilterAggregateText || (e.quickFilterAggregateText = this.getQuickFilterAggregateText(e));
  }
  getQuickFilterTextForColumn(e, t) {
    let r = this.valueService.getValue(e, t, !0);
    const n = e.getColDef();
    if (n.getQuickFilterText) {
      const a = this.gos.addGridCommonParams({
        value: r,
        node: t,
        data: t.data,
        column: e,
        colDef: n
      });
      r = n.getQuickFilterText(a);
    }
    return $r(r) ? r.toString().toUpperCase() : null;
  }
  getQuickFilterAggregateText(e) {
    const t = [];
    return this.colsForQuickFilter.forEach((r) => {
      const n = this.getQuickFilterTextForColumn(r, e);
      $r(n) && t.push(n);
    }), t.join(`
`);
  }
}, aR = {
  version: $n,
  moduleName: "@ag-grid-community/filter-core",
  beans: [qj]
}, QY = {
  version: $n,
  moduleName: "@ag-grid-community/filter-api",
  apiFunctions: {
    isAnyFilterPresent: VY,
    onFilterChanged: zY
  },
  dependantModules: [aR]
}, oR = {
  version: $n,
  moduleName: "@ag-grid-community/column-filter",
  beans: [BY],
  dependantModules: [aR]
}, qY = {
  version: $n,
  moduleName: "@ag-grid-community/column-filter-api",
  apiFunctions: {
    isColumnFilterPresent: DY,
    getFilterInstance: FY,
    getColumnFilterInstance: PY,
    destroyFilter: IY,
    setFilterModel: LY,
    getFilterModel: kY,
    getColumnFilterModel: OY,
    setColumnFilterModel: NY,
    showColumnFilter: GY
  },
  dependantModules: [oR, QY]
}, Vk = {
  version: $n,
  moduleName: "@ag-grid-community/floating-filter-core",
  controllers: [{ name: "headerFilterCell", classImp: MY }],
  dependantModules: [oR]
}, eX = {
  version: $n,
  moduleName: "@ag-grid-community/read-only-floating-filter",
  userComponents: [{ name: "agReadOnlyFloatingFilter", classImp: WY }],
  dependantModules: [Vk]
}, tX = {
  version: $n,
  moduleName: "@ag-grid-community/simple-filter",
  dependantModules: [oR],
  userComponents: [
    { name: "agTextColumnFilter", classImp: CY },
    { name: "agNumberColumnFilter", classImp: yY },
    { name: "agDateColumnFilter", classImp: SY },
    { name: "agDateInput", classImp: UY }
  ]
}, rX = {
  version: $n,
  moduleName: "@ag-grid-community/simple-floating-filter",
  dependantModules: [tX, Vk],
  userComponents: [
    { name: "agTextColumnFloatingFilter", classImp: XY },
    { name: "agNumberColumnFloatingFilter", classImp: YY },
    { name: "agDateColumnFloatingFilter", classImp: _Y }
  ]
}, zk = {
  version: $n,
  moduleName: "@ag-grid-community/quick-filter-core",
  beans: [JY],
  dependantModules: [aR]
}, nX = {
  version: $n,
  moduleName: "@ag-grid-community/quick-filter-api",
  apiFunctions: {
    isQuickFilterPresent: $Y,
    getQuickFilter: ZY,
    resetQuickFilter: KY
  },
  dependantModules: [zk]
}, iX = {
  version: $n,
  moduleName: "@ag-grid-community/quick-filter",
  dependantModules: [zk, nX]
}, aX = {
  version: $n,
  moduleName: "@ag-grid-community/filter",
  dependantModules: [
    rX,
    eX,
    iX,
    qY
  ]
}, bT = /* @__PURE__ */ ((e) => (e.COLUMN_GROUP = "group", e.COLUMN = "column", e.FLOATING_FILTER = "filter", e))(bT || {}), oX = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "headerNavigationService", this.currentHeaderRowWithoutSpan = -1;
  }
  wireBeans(e) {
    this.focusService = e.focusService, this.headerPositionUtils = e.headerPositionUtils, this.ctrlsService = e.ctrlsService, this.columnModel = e.columnModel, this.visibleColService = e.visibleColsService;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (t) => {
      this.gridBodyCon = t.gridBodyCtrl;
    });
    const e = Va(this.gos);
    this.addManagedElementListeners(e, { mousedown: () => this.setCurrentHeaderRowWithoutSpan(-1) });
  }
  getHeaderRowCount() {
    var e;
    return ((e = this.ctrlsService.getHeaderRowContainerCtrl()) == null ? void 0 : e.getRowCount()) ?? 0;
  }
  getHeaderPositionForColumn(e, t) {
    let r;
    if (typeof e == "string" ? (r = this.columnModel.getCol(e), r || (r = this.visibleColService.getColumnGroup(e))) : r = e, !r)
      return null;
    const n = this.ctrlsService.getHeaderRowContainerCtrl(), a = n == null ? void 0 : n.getAllCtrls(), u = di(a || []).getType() === "filter", s = this.getHeaderRowCount() - 1;
    let c = -1, i = r;
    for (; i; )
      c++, i = i.getParent();
    let l = c;
    return t && u && l === s - 1 && l++, l === -1 ? null : {
      headerRowIndex: l,
      column: r
    };
  }
  /*
   * This method navigates grid header vertically
   * @return {boolean} true to preventDefault on the event that caused this navigation.
   */
  navigateVertically(e, t, r) {
    if (t || (t = this.focusService.getFocusedHeader()), !t)
      return !1;
    const { headerRowIndex: n } = t, a = t.column, u = this.getHeaderRowCount(), s = e === 0;
    let {
      headerRowIndex: c,
      column: i,
      // eslint-disable-next-line prefer-const
      headerRowIndexWithoutSpan: l
    } = s ? this.headerPositionUtils.getColumnVisibleParent(a, n) : this.headerPositionUtils.getColumnVisibleChild(a, n), v = !1;
    return c < 0 && (c = 0, i = a, v = !0), c >= u ? (c = -1, this.setCurrentHeaderRowWithoutSpan(-1)) : l !== void 0 && (this.currentHeaderRowWithoutSpan = l), !v && !i ? !1 : this.focusService.focusHeaderPosition({
      headerPosition: { headerRowIndex: c, column: i },
      allowUserOverride: !0,
      event: r
    });
  }
  setCurrentHeaderRowWithoutSpan(e) {
    this.currentHeaderRowWithoutSpan = e;
  }
  /*
   * This method navigates grid header horizontally
   * @return {boolean} true to preventDefault on the event that caused this navigation.
   */
  navigateHorizontally(e, t = !1, r) {
    const n = this.focusService.getFocusedHeader(), a = e === 2, u = this.gos.get("enableRtl");
    let s, c;
    if (this.currentHeaderRowWithoutSpan !== -1 ? n.headerRowIndex = this.currentHeaderRowWithoutSpan : this.currentHeaderRowWithoutSpan = n.headerRowIndex, a !== u ? (c = "Before", s = this.headerPositionUtils.findHeader(n, c)) : (c = "After", s = this.headerPositionUtils.findHeader(n, c)), s || !t)
      return this.focusService.focusHeaderPosition({
        headerPosition: s,
        direction: c,
        fromTab: t,
        allowUserOverride: !0,
        event: r
      });
    if (t) {
      const i = this.gos.getCallback("tabToNextHeader");
      if (i)
        return this.focusService.focusHeaderPositionFromUserFunc({
          userFunc: i,
          headerPosition: s,
          direction: c
        });
    }
    return this.focusNextHeaderRow(n, c, r);
  }
  focusNextHeaderRow(e, t, r) {
    const n = e.headerRowIndex;
    let a = null, u;
    if (t === "Before" ? n > 0 && (u = n - 1, this.currentHeaderRowWithoutSpan -= 1, a = this.headerPositionUtils.findColAtEdgeForHeaderRow(u, "end")) : (u = n + 1, this.currentHeaderRowWithoutSpan < this.getHeaderRowCount() ? this.currentHeaderRowWithoutSpan += 1 : this.setCurrentHeaderRowWithoutSpan(-1), a = this.headerPositionUtils.findColAtEdgeForHeaderRow(u, "start")), !a)
      return !1;
    const { column: s, headerRowIndex: c } = this.headerPositionUtils.getHeaderIndexToFocus(
      a.column,
      a == null ? void 0 : a.headerRowIndex
    );
    return this.focusService.focusHeaderPosition({
      headerPosition: { column: s, headerRowIndex: c },
      direction: t,
      fromTab: !0,
      allowUserOverride: !0,
      event: r
    });
  }
  scrollToColumn(e, t = "After") {
    if (e.getPinned())
      return;
    let r;
    if (Ba(e)) {
      const n = e.getDisplayedLeafColumns();
      r = t === "Before" ? di(n) : n[0];
    } else
      r = e;
    this.gridBodyCon.getScrollFeature().ensureColumnVisible(r);
  }
}, sX = class extends mr {
  wireBeans(e) {
    this.animationFrameService = e.animationFrameService, this.headerNavigationService = e.headerNavigationService, this.focusService = e.focusService, this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService, this.ctrlsService = e.ctrlsService, this.filterManager = e.filterManager, this.menuService = e.menuService;
  }
  setComp(e, t, r) {
    this.comp = e, this.eGui = t, this.createManagedBean(
      new $h(r, {
        onTabKeyDown: this.onTabKeyDown.bind(this),
        handleKeyDown: this.handleKeyDown.bind(this),
        onFocusOut: this.onFocusOut.bind(this)
      })
    ), this.addManagedEventListeners({
      columnPivotModeChanged: this.onPivotModeChanged.bind(this),
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this)
    }), this.onPivotModeChanged(), this.setupHeaderHeight();
    const n = this.onHeaderContextMenu.bind(this);
    this.addManagedElementListeners(this.eGui, { contextmenu: n }), this.mockContextMenuForIPad(n), this.ctrlsService.register("gridHeaderCtrl", this);
  }
  setupHeaderHeight() {
    const e = this.setHeaderHeight.bind(this);
    e(), this.addManagedPropertyListeners(
      [
        "headerHeight",
        "pivotHeaderHeight",
        "groupHeaderHeight",
        "pivotGroupHeaderHeight",
        "floatingFiltersHeight"
      ],
      e
    ), this.addManagedEventListeners({
      displayedColumnsChanged: e,
      columnHeaderHeightChanged: e,
      // add this to the animation frame to avoid a feedback loop
      columnGroupHeaderHeightChanged: () => this.animationFrameService.requestAnimationFrame(() => e()),
      gridStylesChanged: e,
      advancedFilterEnabledChanged: e
    });
  }
  getHeaderHeight() {
    return this.headerHeight;
  }
  setHeaderHeight() {
    var u;
    const { columnModel: e } = this;
    let t = 0;
    const r = this.columnModel.getGroupRowsHeight().reduce((s, c) => s + c, 0), n = this.columnModel.getColumnHeaderRowHeight();
    if ((u = this.filterManager) != null && u.hasFloatingFilters() && (t += e.getFloatingFiltersHeight()), t += r, t += n, this.headerHeight === t)
      return;
    this.headerHeight = t;
    const a = `${t + 1}px`;
    this.comp.setHeightAndMinHeight(a), this.eventService.dispatchEvent({
      type: "headerHeightChanged"
    });
  }
  onPivotModeChanged() {
    const e = this.columnModel.isPivotMode();
    this.comp.addOrRemoveCssClass("ag-pivot-on", e), this.comp.addOrRemoveCssClass("ag-pivot-off", !e);
  }
  onDisplayedColumnsChanged() {
    const t = this.visibleColsService.getAllCols().some((r) => r.isSpanHeaderHeight());
    this.comp.addOrRemoveCssClass("ag-header-allow-overflow", t);
  }
  onTabKeyDown(e) {
    const t = this.gos.get("enableRtl"), r = e.shiftKey, n = r !== t ? 2 : 3;
    (this.headerNavigationService.navigateHorizontally(n, !0, e) || !r && this.focusService.focusOverlay(!1) || this.focusService.focusNextGridCoreContainer(r)) && e.preventDefault();
  }
  handleKeyDown(e) {
    let t = null;
    switch (e.key) {
      case dr.LEFT:
        t = 2;
      case dr.RIGHT: {
        $r(t) || (t = 3), this.headerNavigationService.navigateHorizontally(t, !1, e) && e.preventDefault();
        break;
      }
      case dr.UP:
        t = 0;
      case dr.DOWN: {
        $r(t) || (t = 1), this.headerNavigationService.navigateVertically(t, null, e) && e.preventDefault();
        break;
      }
      default:
        return;
    }
  }
  onFocusOut(e) {
    const { relatedTarget: t } = e;
    !t && this.eGui.contains(Sa(this.gos)) || this.eGui.contains(t) || this.focusService.clearFocusedHeader();
  }
  onHeaderContextMenu(e, t, r) {
    var a;
    if (!e && !r || !this.menuService.isHeaderContextMenuEnabled())
      return;
    const { target: n } = e ?? t;
    (n === this.eGui || n === ((a = this.ctrlsService.getHeaderRowContainerCtrl()) == null ? void 0 : a.getViewportElement())) && this.menuService.showHeaderContextMenu(void 0, e, r);
  }
  mockContextMenuForIPad(e) {
    if (!df())
      return;
    const t = new tf(this.eGui), r = (n) => {
      e(void 0, n.touchStart, n.touchEvent);
    };
    this.addManagedListeners(t, { longTap: r }), this.addDestroyFunc(() => t.destroy());
  }
}, sR = class extends mr {
  constructor(e, t = !1) {
    super(), this.callback = e, this.addSpacer = t;
  }
  wireBeans(e) {
    this.visibleColsService = e.visibleColsService, this.scrollVisibleService = e.scrollVisibleService;
  }
  postConstruct() {
    const e = this.setWidth.bind(this);
    this.addManagedPropertyListener("domLayout", e), this.addManagedEventListeners({
      columnContainerWidthChanged: e,
      displayedColumnsChanged: e,
      leftPinnedWidthChanged: e
    }), this.addSpacer && this.addManagedEventListeners({
      rightPinnedWidthChanged: e,
      scrollVisibilityChanged: e,
      scrollbarWidthChanged: e
    }), this.setWidth();
  }
  setWidth() {
    const e = Ao(this.gos, "print"), t = this.visibleColsService.getBodyContainerWidth(), r = this.visibleColsService.getColsLeftWidth(), n = this.visibleColsService.getDisplayedColumnsRightWidth();
    let a;
    e ? a = t + r + n : (a = t, this.addSpacer && (this.gos.get("enableRtl") ? r : n) === 0 && this.scrollVisibleService.isVerticalScrollShowing() && (a += this.scrollVisibleService.getScrollbarWidth())), this.callback(a);
  }
}, lX = class extends mr {
  constructor(e) {
    super(), this.columnsToAggregate = [], this.columnsToGroup = [], this.columnsToPivot = [], this.pinned = e;
  }
  wireBeans(e) {
    this.funcColsService = e.funcColsService;
  }
  /** Callback for when drag enters */
  onDragEnter(e) {
    if (this.clearColumnsList(), this.gos.get("functionsReadOnly"))
      return;
    const t = e.dragItem.columns;
    t && t.forEach((r) => {
      r.isPrimary() && (r.isAnyFunctionActive() || (r.isAllowValue() ? this.columnsToAggregate.push(r) : r.isAllowRowGroup() ? this.columnsToGroup.push(r) : r.isAllowPivot() && this.columnsToPivot.push(r)));
    });
  }
  getIconName() {
    return this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length > 0 ? this.pinned ? "pinned" : "move" : null;
  }
  /** Callback for when drag leaves */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  onDragLeave(e) {
    this.clearColumnsList();
  }
  clearColumnsList() {
    this.columnsToAggregate.length = 0, this.columnsToGroup.length = 0, this.columnsToPivot.length = 0;
  }
  /** Callback for when dragging */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  onDragging(e) {
  }
  /** Callback for when drag stops */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  onDragStop(e) {
    this.columnsToAggregate.length > 0 && this.funcColsService.addValueColumns(this.columnsToAggregate, "toolPanelDragAndDrop"), this.columnsToGroup.length > 0 && this.funcColsService.addRowGroupColumns(this.columnsToGroup, "toolPanelDragAndDrop"), this.columnsToPivot.length > 0 && this.funcColsService.addPivotColumns(this.columnsToPivot, "toolPanelDragAndDrop");
  }
  onDragCancel() {
    this.clearColumnsList();
  }
};
function Wk(e) {
  const {
    isFromHeader: t,
    fromLeft: r,
    xPosition: n,
    fromEnter: a,
    fakeEvent: u,
    pinned: s,
    gos: c,
    columnModel: i,
    columnMoveService: l,
    visibleColsService: v
  } = e;
  let { allMovingColumns: f } = e;
  if (t) {
    const x = [];
    f.forEach((T) => {
      var k;
      let F = null, P = T.getParent();
      for (; P != null && P.getDisplayedLeafColumns().length === 1; )
        F = P, P = P.getParent();
      F != null ? (!!((k = F.getColGroupDef()) != null && k.marryChildren) ? (
        // when marry children is true, we also have to move hidden
        // columns within the group, so grab them from the `providedColumnGroup`
        F.getProvidedColumnGroup().getLeafColumns()
      ) : F.getLeafColumns()).forEach((A) => {
        x.includes(A) || x.push(A);
      }) : x.includes(T) || x.push(T);
    }), f = x;
  }
  const p = f.slice();
  i.sortColsLikeCols(p);
  const g = fX({
    movingCols: p,
    draggingRight: r,
    xPosition: n,
    pinned: s,
    gos: c,
    columnModel: i,
    visibleColsService: v
  }), y = uX(p, i);
  if (g.length === 0)
    return;
  const C = g[0];
  let m = y !== null && !a;
  if (t && (m = y !== null), m && !u && (!r && C >= y || r && C <= y))
    return;
  const h = v.getAllCols(), w = [];
  let S = null;
  for (let x = 0; x < g.length; x++) {
    const T = g[x], F = l.getProposedColumnOrder(p, T);
    if (!l.doesOrderPassRules(F))
      continue;
    const P = F.filter((I) => h.includes(I));
    if (S === null)
      S = P;
    else if (!cf(P, S))
      break;
    const k = cX(F);
    w.push({ move: T, fragCount: k });
  }
  if (w.length === 0)
    return;
  w.sort((x, T) => x.fragCount - T.fragCount);
  const E = w[0].move;
  if (!(E > i.getCols().length - f.length))
    return { columns: f, toIndex: E };
}
function lR(e) {
  const { columns: t, toIndex: r } = Wk(e) || {}, { finished: n, columnMoveService: a } = e;
  return !t || r == null ? null : (a.moveColumns(t, r, "uiColumnMoved", n), n ? null : { columns: t, toIndex: r });
}
function uX(e, t) {
  const r = t.getCols(), n = Q_(e.map((i) => r.indexOf(i))), a = n[0];
  return di(n) - a !== n.length - 1 ? null : a;
}
function cX(e) {
  function t(n) {
    const a = [];
    let u = n.getOriginalParent();
    for (; u != null; )
      a.push(u), u = u.getOriginalParent();
    return a;
  }
  let r = 0;
  for (let n = 0; n < e.length - 1; n++) {
    let a = t(e[n]), u = t(e[n + 1]);
    [a, u] = a.length > u.length ? [a, u] : [u, a], a.forEach((s) => {
      u.indexOf(s) === -1 && r++;
    });
  }
  return r;
}
function dX(e, t) {
  switch (t) {
    case "left":
      return e.getLeftCols();
    case "right":
      return e.getRightCols();
    default:
      return e.getCenterCols();
  }
}
function fX(e) {
  const { movingCols: t, draggingRight: r, xPosition: n, pinned: a, gos: u, columnModel: s, visibleColsService: c } = e;
  if (u.get("suppressMovableColumns") || t.some((S) => S.getColDef().suppressMovable))
    return [];
  const l = dX(c, a), v = s.getCols(), f = l.filter((S) => kh(t, S)), p = l.filter((S) => !kh(t, S)), g = v.filter((S) => !kh(t, S));
  let y = 0, C = n;
  if (r) {
    let S = 0;
    f.forEach((E) => S += E.getActualWidth()), C -= S;
  }
  if (C > 0) {
    for (let S = 0; S < p.length; S++) {
      const E = p[S];
      if (C -= E.getActualWidth(), C < 0)
        break;
      y++;
    }
    r && y++;
  }
  let m;
  if (y > 0) {
    const S = p[y - 1];
    m = g.indexOf(S) + 1;
  } else
    m = g.indexOf(p[0]), m === -1 && (m = 0);
  const h = [m], w = (S, E) => S - E;
  if (r) {
    let S = m + 1;
    const E = v.length - 1;
    for (; S <= E; )
      h.push(S), S++;
    h.sort(w);
  } else {
    let S = m;
    const E = v.length - 1;
    let x = v[S];
    for (; S <= E && l.indexOf(x) < 0; )
      S++, h.push(S), x = v[S];
    S = m - 1;
    const T = 0;
    for (; S >= T; )
      h.push(S), S--;
    h.sort(w).reverse();
  }
  return h;
}
function S1(e) {
  var l;
  const { pinned: t, fromKeyboard: r, gos: n, ctrlsService: a, useHeaderRow: u, skipScrollPadding: s } = e;
  let c = (l = a.getHeaderRowContainerCtrl(t)) == null ? void 0 : l.getViewportElement(), { x: i } = e;
  return c ? (r && (i -= c.getBoundingClientRect().left), n.get("enableRtl") && (u && (c = c.querySelector(".ag-header-row")), i = c.clientWidth - i), t == null && !s && (i += a.get("center").getCenterViewportScrollLeft()), i) : 0;
}
function bv(e, t) {
  for (const r of e)
    r.setMoving(t, "uiColumnMoved");
}
var cF = 7, wT = 100, mC = wT / 2, hX = 5, pX = 100, vX = class extends mr {
  constructor(e) {
    super(), this.needToMoveLeft = !1, this.needToMoveRight = !1, this.lastMovedInfo = null, this.pinned = e, this.isCenterContainer = !$r(e);
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService, this.columnMoveService = e.columnMoveService, this.dragAndDropService = e.dragAndDropService, this.ctrlsService = e.ctrlsService;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      this.gridBodyCon = e.gridBodyCtrl;
    });
  }
  getIconName() {
    var t;
    const e = ((t = this.lastDraggingEvent) == null ? void 0 : t.dragItem.columns) ?? [];
    for (const r of e) {
      const n = r.getPinned();
      if (r.getColDef().lockPinned) {
        if (n == this.pinned)
          return "move";
        continue;
      }
      if (n === this.pinned || !this.pinned)
        return "move";
      if (!n && this.pinned)
        return "pinned";
    }
    return "notAllowed";
  }
  onDragEnter(e) {
    const t = e.dragItem.columns;
    if (e.dragSource.type === 0)
      this.setColumnsVisible(t, !0, "uiColumnDragged");
    else {
      const n = e.dragItem.visibleState, a = (t || []).filter((u) => n[u.getId()]);
      this.setColumnsVisible(a, !0, "uiColumnDragged");
    }
    this.gos.get("suppressMoveWhenColumnDragging") || this.attemptToPinColumns(t, this.pinned), this.onDragging(e, !0, !0);
  }
  onDragging(e = this.lastDraggingEvent, t = !1, r = !1, n = !1) {
    const a = this.gos.get("suppressMoveWhenColumnDragging");
    if (n && !a) {
      this.finishColumnMoving();
      return;
    }
    if (this.lastDraggingEvent = e, !e || !n && mi(e.hDirection))
      return;
    const { pinned: u, gos: s, ctrlsService: c } = this, i = S1({
      x: e.x,
      pinned: u,
      gos: s,
      ctrlsService: c
    });
    t || this.checkCenterForScrolling(i), a ? this.handleColumnDragWhileSuppressingMovement(e, t, r, i, n) : this.handleColumnDragWhileAllowingMovement(e, t, r, i, n);
  }
  onDragLeave() {
    this.ensureIntervalCleared(), this.clearHighlighted(), this.lastMovedInfo = null;
  }
  onDragStop() {
    this.onDragging(this.lastDraggingEvent, !1, !0, !0), this.ensureIntervalCleared(), this.lastMovedInfo = null;
  }
  onDragCancel() {
    this.clearHighlighted(), this.ensureIntervalCleared(), this.lastMovedInfo = null;
  }
  setColumnsVisible(e, t, r) {
    if (!e)
      return;
    const n = e.filter((a) => !a.getColDef().lockVisible);
    this.columnModel.setColsVisible(n, t, r);
  }
  finishColumnMoving() {
    if (this.clearHighlighted(), !this.lastMovedInfo)
      return;
    const { columns: e, toIndex: t } = this.lastMovedInfo;
    this.columnMoveService.moveColumns(e, t, "uiColumnMoved", !0);
  }
  handleColumnDragWhileSuppressingMovement(e, t, r, n, a) {
    const u = this.getAllMovingColumns(e, !0);
    if (a) {
      const s = this.isAttemptingToPin(u);
      s && this.attemptToPinColumns(u, void 0, !0);
      const { fromLeft: c, xPosition: i } = this.getNormalisedXPositionInfo(u, s) || {};
      if (c == null || i == null) {
        this.finishColumnMoving();
        return;
      }
      this.moveColumnsAfterHighlight({
        allMovingColumns: u,
        xPosition: i,
        fromEnter: t,
        fakeEvent: r,
        fromLeft: c
      });
    } else {
      if (!this.dragAndDropService.isDropZoneWithinThisGrid(e))
        return;
      this.highlightHoveredColumn(u, n);
    }
  }
  handleColumnDragWhileAllowingMovement(e, t, r, n, a) {
    const u = this.getAllMovingColumns(e), s = this.normaliseDirection(e.hDirection) === 1, c = e.dragSource.type === 1, i = this.getMoveColumnParams({
      allMovingColumns: u,
      isFromHeader: c,
      xPosition: n,
      fromLeft: s,
      fromEnter: t,
      fakeEvent: r
    }), l = lR({ ...i, finished: a });
    l && (this.lastMovedInfo = l);
  }
  getAllMovingColumns(e, t = !1) {
    const r = e.dragSource.getDragItem();
    let n = null;
    t ? (n = r.columnsInSplit, n || (n = r.columns)) : n = r.columns;
    const a = (u) => u.getColDef().lockPinned ? u.getPinned() == this.pinned : !0;
    return n ? n.filter(a) : [];
  }
  getMoveColumnParams(e) {
    const { allMovingColumns: t, isFromHeader: r, xPosition: n, fromLeft: a, fromEnter: u, fakeEvent: s } = e, { pinned: c, gos: i, columnModel: l, columnMoveService: v, visibleColsService: f } = this;
    return {
      allMovingColumns: t,
      isFromHeader: r,
      fromLeft: a,
      xPosition: n,
      pinned: c,
      fromEnter: u,
      fakeEvent: s,
      gos: i,
      columnModel: l,
      columnMoveService: v,
      visibleColsService: f
    };
  }
  findFirstAndLastMovingColumns(e) {
    const t = e.length;
    let r, n;
    for (let a = 0; a <= t; a++) {
      if (!r) {
        const u = e[a];
        u.getLeft() != null && (r = u);
      }
      if (!n) {
        const u = e[t - 1 - a];
        u.getLeft() != null && (n = u);
      }
      if (r && n)
        break;
    }
    return { firstMovingCol: r, lastMovingCol: n };
  }
  highlightHoveredColumn(e, t) {
    var v;
    const { gos: r, columnModel: n } = this, a = r.get("enableRtl"), u = n.getCols().filter((f) => f.isVisible() && f.getPinned() === this.pinned);
    let s = null, c = null, i = null;
    for (const f of u) {
      if (c = f.getActualWidth(), s = this.getNormalisedColumnLeft(f, 0, a), s != null) {
        const p = s + c;
        if (s <= t && p >= t) {
          i = f;
          break;
        }
      }
      s = null, c = null;
    }
    if (i)
      e.indexOf(i) !== -1 && (i = null);
    else {
      for (let f = u.length - 1; f >= 0; f--) {
        const p = u[f], g = u[f].getParent();
        if (!g) {
          i = p;
          break;
        }
        const y = g == null ? void 0 : g.getDisplayedLeafColumns();
        if (y.length) {
          i = di(y);
          break;
        }
      }
      if (!i)
        return;
      s = this.getNormalisedColumnLeft(i, 0, a), c = i.getActualWidth();
    }
    if (((v = this.lastHighlightedColumn) == null ? void 0 : v.column) !== i && this.clearHighlighted(), i == null || s == null || c == null)
      return;
    let l;
    t - s < c / 2 !== a ? l = 0 : l = 1, i.setHighlighted(l), this.lastHighlightedColumn = { column: i, position: l };
  }
  getNormalisedXPositionInfo(e, t) {
    const { gos: r, visibleColsService: n } = this, a = r.get("enableRtl"), { firstMovingCol: u, column: s, position: c } = this.getColumnMoveAndTargetInfo(
      e,
      t,
      a
    );
    if (!u || !s || c == null)
      return;
    const i = n.getAllCols(), l = i.indexOf(u), v = i.indexOf(s), f = c === 0 !== a, p = l < v || l === v && !f;
    let g = 0;
    if (f ? p && (g -= 1) : p || (g += 1), v + g === l)
      return;
    const y = i[v + g];
    if (!y)
      return;
    const C = this.getNormalisedColumnLeft(y, 20, a);
    return { fromLeft: p, xPosition: C };
  }
  getColumnMoveAndTargetInfo(e, t, r) {
    const n = this.lastHighlightedColumn || {}, { firstMovingCol: a, lastMovingCol: u } = this.findFirstAndLastMovingColumns(e);
    if (!a || !u || n.column || !t)
      return {
        firstMovingCol: a,
        ...n
      };
    const c = this.getPinDirection() === "left";
    return {
      firstMovingCol: a,
      position: c ? 1 : 0,
      column: c !== r ? a : u
    };
  }
  normaliseDirection(e) {
    if (this.gos.get("enableRtl"))
      switch (e) {
        case 0:
          return 1;
        case 1:
          return 0;
      }
    return e;
  }
  getNormalisedColumnLeft(e, t, r) {
    const { gos: n, ctrlsService: a } = this, u = e.getLeft();
    if (u == null)
      return null;
    const s = e.getActualWidth();
    return S1({
      x: r ? u + s - t : u + t,
      pinned: e.getPinned(),
      useHeaderRow: r,
      skipScrollPadding: !0,
      gos: n,
      ctrlsService: a
    });
  }
  isAttemptingToPin(e) {
    const t = this.needToMoveLeft || this.needToMoveRight, r = this.failedMoveAttempts > cF;
    return t && r || e.some((n) => n.getPinned() !== this.pinned);
  }
  moveColumnsAfterHighlight(e) {
    const { allMovingColumns: t, xPosition: r, fromEnter: n, fakeEvent: a, fromLeft: u } = e, s = this.getMoveColumnParams({
      allMovingColumns: t,
      isFromHeader: !0,
      xPosition: r,
      fromLeft: u,
      fromEnter: n,
      fakeEvent: a
    }), { columns: c, toIndex: i } = Wk(s) || {};
    c && i != null && (this.lastMovedInfo = {
      columns: c,
      toIndex: i
    }), this.finishColumnMoving();
  }
  clearHighlighted() {
    this.lastHighlightedColumn && (this.lastHighlightedColumn.column.setHighlighted(null), this.lastHighlightedColumn = null);
  }
  checkCenterForScrolling(e) {
    if (!this.isCenterContainer)
      return;
    const t = this.ctrlsService.get("center"), r = t.getCenterViewportScrollLeft(), n = r + t.getCenterWidth();
    this.gos.get("enableRtl") ? (this.needToMoveRight = e < r + mC, this.needToMoveLeft = e > n - mC) : (this.needToMoveLeft = e < r + mC, this.needToMoveRight = e > n - mC), this.needToMoveLeft || this.needToMoveRight ? this.ensureIntervalStarted() : this.ensureIntervalCleared();
  }
  ensureIntervalStarted() {
    var e;
    this.movingIntervalId || (this.intervalCount = 0, this.failedMoveAttempts = 0, this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), pX), (e = this.dragAndDropService.getDragAndDropImageComponent()) == null || e.setIcon(this.needToMoveLeft ? "left" : "right", !0));
  }
  ensureIntervalCleared() {
    var e;
    this.movingIntervalId && (window.clearInterval(this.movingIntervalId), this.movingIntervalId = null, this.failedMoveAttempts = 0, (e = this.dragAndDropService.getDragAndDropImageComponent()) == null || e.setIcon(this.getIconName()));
  }
  moveInterval() {
    var n, a;
    let e;
    this.intervalCount++, e = 10 + this.intervalCount * hX, e > wT && (e = wT);
    let t = null;
    const r = this.gridBodyCon.getScrollFeature();
    if (this.needToMoveLeft ? t = r.scrollHorizontally(-e) : this.needToMoveRight && (t = r.scrollHorizontally(e)), t !== 0)
      this.onDragging(this.lastDraggingEvent), this.failedMoveAttempts = 0;
    else {
      if (this.failedMoveAttempts++, this.failedMoveAttempts <= cF + 1)
        return;
      if ((n = this.dragAndDropService.getDragAndDropImageComponent()) == null || n.setIcon("pinned"), !this.gos.get("suppressMoveWhenColumnDragging")) {
        const u = (a = this.lastDraggingEvent) == null ? void 0 : a.dragItem.columns;
        this.attemptToPinColumns(u, void 0, !0);
      }
    }
  }
  getPinDirection() {
    if (this.needToMoveLeft || this.pinned === "left")
      return "left";
    if (this.needToMoveRight || this.pinned === "right")
      return "right";
  }
  attemptToPinColumns(e, t, r = !1) {
    const n = (e || []).filter((a) => !a.getColDef().lockPinned);
    return n.length ? (r && (t = this.getPinDirection()), this.columnModel.setColsPinned(n, t, "uiColumnDragged"), r && this.dragAndDropService.nudge(), n.length) : 0;
  }
  destroy() {
    super.destroy(), this.lastDraggingEvent = null, this.clearHighlighted(), this.lastMovedInfo = null;
  }
}, gX = class extends mr {
  wireBeans(e) {
    this.dragAndDropService = e.dragAndDropService, this.columnModel = e.columnModel, this.ctrlsService = e.ctrlsService;
  }
  constructor(e, t) {
    super(), this.pinned = e, this.eContainer = t;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      switch (this.pinned) {
        case "left":
          this.eSecondaryContainers = [
            [e.gridBodyCtrl.getBodyViewportElement(), e.left.getContainerElement()],
            [e.bottomLeft.getContainerElement()],
            [e.topLeft.getContainerElement()]
          ];
          break;
        case "right":
          this.eSecondaryContainers = [
            [e.gridBodyCtrl.getBodyViewportElement(), e.right.getContainerElement()],
            [e.bottomRight.getContainerElement()],
            [e.topRight.getContainerElement()]
          ];
          break;
        default:
          this.eSecondaryContainers = [
            [e.gridBodyCtrl.getBodyViewportElement(), e.center.getViewportElement()],
            [e.bottomCenter.getViewportElement()],
            [e.topCenter.getViewportElement()]
          ];
          break;
      }
    }), this.moveColumnFeature = this.createManagedBean(new vX(this.pinned)), this.bodyDropPivotTarget = this.createManagedBean(new lX(this.pinned)), this.dragAndDropService.addDropTarget(this), this.addDestroyFunc(() => this.dragAndDropService.removeDropTarget(this));
  }
  isInterestedIn(e) {
    return e === 1 || e === 0 && this.gos.get("allowDragFromColumnsToolPanel");
  }
  getSecondaryContainers() {
    return this.eSecondaryContainers;
  }
  getContainer() {
    return this.eContainer;
  }
  getIconName() {
    return this.currentDropListener.getIconName();
  }
  // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel
  // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when
  // dropped into the grid's body.
  isDropColumnInPivotMode(e) {
    return this.columnModel.isPivotMode() && e.dragSource.type === 0;
  }
  onDragEnter(e) {
    this.currentDropListener = this.isDropColumnInPivotMode(e) ? this.bodyDropPivotTarget : this.moveColumnFeature, this.currentDropListener.onDragEnter(e);
  }
  onDragLeave(e) {
    this.currentDropListener.onDragLeave(e);
  }
  onDragging(e) {
    this.currentDropListener.onDragging(e);
  }
  onDragStop(e) {
    this.currentDropListener.onDragStop(e);
  }
  onDragCancel() {
    this.currentDropListener.onDragCancel();
  }
}, mX = class extends mr {
  wireBeans(e) {
    this.horizontalResizeService = e.horizontalResizeService, this.pinnedWidthService = e.pinnedWidthService, this.ctrlsService = e.ctrlsService, this.columnSizeService = e.columnSizeService, this.columnAutosizeService = e.columnAutosizeService;
  }
  constructor(e, t, r, n, a) {
    super(), this.pinned = e, this.column = t, this.eResize = r, this.comp = n, this.ctrl = a;
  }
  postConstruct() {
    const e = [];
    let t, r;
    const n = () => {
      if (ba(this.eResize, t), !t)
        return;
      const s = this.horizontalResizeService.addResizeBar({
        eResizeBar: this.eResize,
        onResizeStart: this.onResizeStart.bind(this),
        onResizing: this.onResizing.bind(this, !1),
        onResizeEnd: this.onResizing.bind(this, !0)
      });
      if (e.push(s), r) {
        const c = this.gos.get("skipHeaderOnAutoSize"), i = () => {
          this.columnAutosizeService.autoSizeColumn(this.column, "uiColumnResized", c);
        };
        this.eResize.addEventListener("dblclick", i);
        const l = new tf(this.eResize);
        l.addEventListener("doubleTap", i), e.push(() => {
          this.eResize.removeEventListener("dblclick", i), l.removeEventListener("doubleTap", i), l.destroy();
        });
      }
    }, a = () => {
      e.forEach((s) => s()), e.length = 0;
    }, u = () => {
      const s = this.column.isResizable(), c = !this.gos.get("suppressAutoSize") && !this.column.getColDef().suppressAutoSize;
      (s !== t || c !== r) && (t = s, r = c, a(), n());
    };
    u(), this.addDestroyFunc(a), this.ctrl.setRefreshFunction("resize", u);
  }
  onResizing(e, t) {
    const { column: r, lastResizeAmount: n, resizeStartWidth: a } = this, u = this.normaliseResizeAmount(t), s = a + u, c = [{ key: r, newWidth: s }];
    if (this.column.getPinned()) {
      const i = this.pinnedWidthService.getPinnedLeftWidth(), l = this.pinnedWidthService.getPinnedRightWidth(), v = iy(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement()) - 50;
      if (i + l + (u - n) > v)
        return;
    }
    this.lastResizeAmount = u, this.columnSizeService.setColumnWidths(c, this.resizeWithShiftKey, e, "uiColumnResized"), e && this.toggleColumnResizing(!1);
  }
  onResizeStart(e) {
    this.resizeStartWidth = this.column.getActualWidth(), this.lastResizeAmount = 0, this.resizeWithShiftKey = e, this.toggleColumnResizing(!0);
  }
  toggleColumnResizing(e) {
    this.comp.addOrRemoveCssClass("ag-column-resizing", e);
  }
  // optionally inverts the drag, depending on pinned and RTL
  // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out?
  normaliseResizeAmount(e) {
    let t = e;
    const r = this.pinned !== "left", n = this.pinned === "right";
    return this.gos.get("enableRtl") ? r && (t *= -1) : n && (t *= -1), t;
  }
}, yX = class extends mr {
  constructor(e) {
    super(), this.cbSelectAllVisible = !1, this.processingEventFromCheckbox = !1, this.column = e;
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.selectionService = e.selectionService;
  }
  postConstruct() {
    const e = (t) => {
      t && typeof t != "string" && (this.selectionOptions = t);
    };
    e(this.gos.get("rowSelection")), this.addManagedPropertyListener("rowSelection", (t) => e(t.currentValue));
  }
  onSpaceKeyDown(e) {
    const t = this.cbSelectAll;
    t.isDisplayed() && !t.getGui().contains(Sa(this.gos)) && (e.preventDefault(), t.setValue(!t.getValue()));
  }
  getCheckboxGui() {
    return this.cbSelectAll.getGui();
  }
  setComp(e) {
    this.headerCellCtrl = e, this.cbSelectAll = this.createManagedBean(new K2()), this.cbSelectAll.addCssClass("ag-header-select-all"), vu(this.cbSelectAll.getGui(), "presentation"), this.showOrHideSelectAll(), this.addManagedEventListeners({
      newColumnsLoaded: this.onNewColumnsLoaded.bind(this),
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
      selectionChanged: this.onSelectionChanged.bind(this),
      paginationChanged: this.onSelectionChanged.bind(this),
      modelUpdated: this.onModelChanged.bind(this)
    }), this.addManagedListeners(this.cbSelectAll, { fieldValueChanged: this.onCbSelectAll.bind(this) }), V2(this.cbSelectAll.getGui(), !0), this.cbSelectAll.getInputElement().setAttribute("tabindex", "-1"), this.refreshSelectAllLabel();
  }
  onNewColumnsLoaded() {
    this.showOrHideSelectAll();
  }
  onDisplayedColumnsChanged() {
    this.isAlive() && this.showOrHideSelectAll();
  }
  showOrHideSelectAll() {
    this.cbSelectAllVisible = this.isCheckboxSelection(), this.cbSelectAll.setDisplayed(this.cbSelectAllVisible, { skipAriaHidden: !0 }), this.cbSelectAllVisible && (this.checkRightRowModelType("selectAllCheckbox"), this.checkSelectionType("selectAllCheckbox"), this.updateStateOfCheckbox()), this.refreshSelectAllLabel();
  }
  onModelChanged() {
    this.cbSelectAllVisible && this.updateStateOfCheckbox();
  }
  onSelectionChanged() {
    this.cbSelectAllVisible && this.updateStateOfCheckbox();
  }
  updateStateOfCheckbox() {
    if (this.processingEventFromCheckbox)
      return;
    this.processingEventFromCheckbox = !0;
    const e = this.selectionService.getSelectAllState(this.isFilteredOnly(), this.isCurrentPageOnly());
    this.cbSelectAll.setValue(e);
    const t = this.selectionService.hasNodesToSelect(
      this.isFilteredOnly(),
      this.isCurrentPageOnly()
    );
    this.cbSelectAll.setDisabled(!t), this.refreshSelectAllLabel(), this.processingEventFromCheckbox = !1;
  }
  refreshSelectAllLabel() {
    const e = this.localeService.getLocaleTextFunc(), r = this.cbSelectAll.getValue() ? e("ariaChecked", "checked") : e("ariaUnchecked", "unchecked"), n = e("ariaRowSelectAll", "Press Space to toggle all rows selection");
    this.cbSelectAllVisible ? this.headerCellCtrl.setAriaDescriptionProperty("selectAll", `${n} (${r})`) : this.headerCellCtrl.setAriaDescriptionProperty("selectAll", null), this.cbSelectAll.setInputAriaLabel(`${n} (${r})`), this.headerCellCtrl.announceAriaDescription();
  }
  checkSelectionType(e) {
    return kL(this.gos) ? !0 : (Fr(`${e} is only available if using 'multiRow' selection mode.`), !1);
  }
  checkRightRowModelType(e) {
    return da(this.gos) || sd(this.gos) ? !0 : (Fr(
      `${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${this.rowModel.getType()}.`
    ), !1);
  }
  onCbSelectAll() {
    if (this.processingEventFromCheckbox || !this.cbSelectAllVisible)
      return;
    const e = this.cbSelectAll.getValue(), t = this.isFilteredOnly(), r = this.isCurrentPageOnly();
    let n = "uiSelectAll";
    r ? n = "uiSelectAllCurrentPage" : t && (n = "uiSelectAllFiltered");
    const a = {
      source: n,
      justFiltered: t,
      justCurrentPage: r
    };
    e ? this.selectionService.selectAllRowNodes(a) : this.selectionService.deselectAllRowNodes(a);
  }
  /**
   * Checkbox is enabled when either the `headerCheckbox` option is enabled in the new selection API
   * or `headerCheckboxSelection` is enabled in the legacy API.
   */
  isCheckboxSelection() {
    const e = this.selectionOptions, t = e && d1(e) && Mv(this.column), r = this.column.getColDef().headerCheckboxSelection;
    let n = !1;
    return t ? n = !0 : typeof r == "function" ? n = r(
      this.gos.addGridCommonParams({
        column: this.column,
        colDef: this.column.getColDef()
      })
    ) : n = !!r, n && this.checkRightRowModelType(t ? "headerCheckbox" : "headerCheckboxSelection") && this.checkSelectionType(t ? "headerCheckbox" : "headerCheckboxSelection");
  }
  isFilteredOnly() {
    const e = this.selectionOptions;
    return e !== void 0 ? e.mode === "multiRow" && e.selectAll === "filtered" : !!this.column.getColDef().headerCheckboxSelectionFilteredOnly;
  }
  isCurrentPageOnly() {
    const e = this.selectionOptions;
    return e !== void 0 ? e.mode === "multiRow" && e.selectAll === "currentPage" : !!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly;
  }
}, CX = class extends Z1 {
  constructor(e, t, r) {
    super(e, t, r), this.refreshFunctions = {}, this.userHeaderClasses = /* @__PURE__ */ new Set(), this.ariaDescriptionProperties = /* @__PURE__ */ new Map(), this.column = e;
  }
  setComp(e, t, r, n, a) {
    this.comp = e, a = ry(this, this.beans.context, a), this.setGui(t, a), this.updateState(), this.setupWidth(a), this.setupMovingCss(a), this.setupMenuClass(a), this.setupSortableClass(a), this.setupWrapTextClass(), this.refreshSpanHeaderHeight(), this.setupAutoHeight({
      wrapperElement: n,
      checkMeasuringCallback: (s) => this.setRefreshFunction("measuring", s),
      compBean: a
    }), this.addColumnHoverListener(a), this.setupFilterClass(a), this.setupClassesFromColDef(), this.setupTooltip(a), this.addActiveHeaderMouseListeners(a), this.setupSelectAll(a), this.setupUserComp(a), this.refreshAria(), this.resizeFeature = a.createManagedBean(
      new mX(this.getPinned(), this.column, r, e, this)
    ), a.createManagedBean(new iR([this.column], t)), a.createManagedBean(new nR(this.column, t, this.beans)), a.createManagedBean(
      new $h(t, {
        shouldStopEventPropagation: (s) => this.shouldStopEventPropagation(s),
        onTabKeyDown: () => null,
        handleKeyDown: this.handleKeyDown.bind(this),
        onFocusIn: this.onFocusIn.bind(this),
        onFocusOut: this.onFocusOut.bind(this)
      })
    ), this.addResizeAndMoveKeyboardListeners(a), a.addManagedPropertyListeners(
      ["suppressMovableColumns", "suppressMenuHide", "suppressAggFuncInHeader"],
      () => this.refresh(a)
    ), a.addManagedListeners(this.column, { colDefChanged: () => this.refresh(a) }), a.addManagedListeners(this.column, { headerHighlightChanged: this.onHeaderHighlightChanged.bind(this) });
    const u = () => this.checkDisplayName(a);
    a.addManagedEventListeners({
      columnValueChanged: u,
      columnRowGroupChanged: u,
      columnPivotChanged: u,
      headerHeightChanged: this.onHeaderHeightChanged.bind(this)
    }), a.addDestroyFunc(() => {
      this.refreshFunctions = {}, this.selectAllFeature = null, this.dragSourceElement = void 0, this.userCompDetails = null, this.userHeaderClasses.clear(), this.ariaDescriptionProperties.clear(), this.clearComponent();
    });
  }
  resizeHeader(e, t) {
    if (!this.column.isResizable())
      return;
    const r = this.column.getActualWidth(), n = this.column.getMinWidth(), a = this.column.getMaxWidth(), u = Math.min(Math.max(r + e, n), a);
    this.beans.columnSizeService.setColumnWidths(
      [{ key: this.column, newWidth: u }],
      t,
      !0,
      "uiColumnResized"
    );
  }
  moveHeader(e) {
    const { eGui: t, beans: r, column: n, ctrlsService: a } = this, { gos: u, columnModel: s, columnMoveService: c, visibleColsService: i } = r, l = this.getPinned(), v = t.getBoundingClientRect().left, f = n.getActualWidth(), p = u.get("enableRtl"), y = S1({
      x: e === 0 !== p ? v - 20 : v + f + 20,
      pinned: l,
      fromKeyboard: !0,
      gos: u,
      ctrlsService: a
    }), C = this.focusService.getFocusedHeader();
    lR({
      allMovingColumns: [n],
      isFromHeader: !0,
      fromLeft: e === 1,
      xPosition: y,
      pinned: l,
      fromEnter: !1,
      fakeEvent: !1,
      gos: u,
      columnModel: s,
      columnMoveService: c,
      visibleColsService: i,
      finished: !0
    }), a.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(n, "auto"), (!this.isAlive() || this.beans.gos.get("ensureDomOrder")) && C && this.restoreFocus(C);
  }
  restoreFocus(e) {
    this.focusService.focusHeaderPosition({
      headerPosition: {
        ...e,
        column: this.column
      }
    });
  }
  setupUserComp(e) {
    const t = this.lookupUserCompDetails(e);
    this.setCompDetails(t);
  }
  setCompDetails(e) {
    this.userCompDetails = e, this.comp.setUserCompDetails(e);
  }
  lookupUserCompDetails(e) {
    const t = this.createParams(e), r = this.column.getColDef();
    return this.userComponentFactory.getHeaderCompDetails(r, t);
  }
  createParams(e) {
    return this.gos.addGridCommonParams({
      column: this.column,
      displayName: this.displayName,
      enableSorting: this.column.isSortable(),
      enableMenu: this.menuEnabled,
      enableFilterButton: this.openFilterEnabled && this.menuService.isHeaderFilterButtonEnabled(this.column),
      enableFilterIcon: !this.openFilterEnabled || this.menuService.isLegacyMenuEnabled(),
      showColumnMenu: (r) => {
        this.menuService.showColumnMenu({
          column: this.column,
          buttonElement: r,
          positionBy: "button"
        });
      },
      showColumnMenuAfterMouseClick: (r) => {
        this.menuService.showColumnMenu({
          column: this.column,
          mouseEvent: r,
          positionBy: "mouse"
        });
      },
      showFilter: (r) => {
        this.menuService.showFilterMenu({
          column: this.column,
          buttonElement: r,
          containerType: "columnFilter",
          positionBy: "button"
        });
      },
      progressSort: (r) => {
        this.beans.sortController.progressSort(this.column, !!r, "uiColumnSorted");
      },
      setSort: (r, n) => {
        this.beans.sortController.setSortForColumn(this.column, r, !!n, "uiColumnSorted");
      },
      eGridHeader: this.getGui(),
      setTooltip: (r, n) => {
        this.setupTooltip(e, r, n);
      }
    });
  }
  setupSelectAll(e) {
    this.selectAllFeature = e.createManagedBean(new yX(this.column)), this.selectAllFeature.setComp(this);
  }
  getSelectAllGui() {
    return this.selectAllFeature.getCheckboxGui();
  }
  handleKeyDown(e) {
    super.handleKeyDown(e), e.key === dr.SPACE && this.selectAllFeature.onSpaceKeyDown(e), e.key === dr.ENTER && this.onEnterKeyDown(e), e.key === dr.DOWN && e.altKey && this.showMenuOnKeyPress(e, !1);
  }
  onEnterKeyDown(e) {
    if (e.ctrlKey || e.metaKey)
      this.showMenuOnKeyPress(e, !0);
    else if (this.sortable) {
      const t = e.shiftKey;
      this.beans.sortController.progressSort(this.column, t, "uiColumnSorted");
    }
  }
  showMenuOnKeyPress(e, t) {
    const r = this.comp.getUserCompInstance();
    !r || !(r instanceof gT) || r.onMenuKeyboardShortcut(t) && e.preventDefault();
  }
  onFocusIn(e) {
    if (!this.getGui().contains(e.relatedTarget)) {
      const t = this.getRowIndex();
      this.focusService.setFocusedHeader(t, this.column), this.announceAriaDescription();
    }
    this.focusService.isKeyboardMode() && this.setActiveHeader(!0);
  }
  onFocusOut(e) {
    this.getGui().contains(e.relatedTarget) || this.setActiveHeader(!1);
  }
  setupTooltip(e, t, r) {
    this.tooltipFeature && (this.tooltipFeature = this.destroyBean(this.tooltipFeature));
    const n = this.gos.get("tooltipShowMode") === "whenTruncated", a = this.eGui, u = this.column.getColDef();
    !r && n && !u.headerComponent && (r = () => {
      const i = a.querySelector(".ag-header-cell-text");
      return i ? i.scrollWidth > i.clientWidth : !0;
    });
    const s = {
      getColumn: () => this.column,
      getColDef: () => this.column.getColDef(),
      getGui: () => a,
      getLocation: () => "header",
      getTooltipValue: () => t ?? this.column.getColDef().headerTooltip,
      shouldDisplayTooltip: r
    }, c = e.createManagedBean(new Bv(s));
    this.setRefreshFunction("tooltip", () => c.refreshToolTip());
  }
  setupClassesFromColDef() {
    const e = () => {
      const t = this.column.getColDef(), r = Lk(t, this.gos, this.column, null), n = this.userHeaderClasses;
      this.userHeaderClasses = new Set(r), r.forEach((a) => {
        n.has(a) ? n.delete(a) : this.comp.addOrRemoveCssClass(a, !0);
      }), n.forEach((a) => this.comp.addOrRemoveCssClass(a, !1));
    };
    this.setRefreshFunction("headerClasses", e), e();
  }
  setDragSource(e) {
    if (this.dragSourceElement = e, this.removeDragSource(), !e || !this.draggable)
      return;
    const { column: t, beans: r, displayName: n, dragAndDropService: a, gos: u } = this, { columnModel: s } = r;
    let c = !this.gos.get("suppressDragLeaveHidesColumns");
    const i = this.dragSource = {
      type: 1,
      eElement: e,
      getDefaultIconName: () => c ? "hide" : "notAllowed",
      getDragItem: () => this.createDragItem(t),
      dragItemName: n,
      onDragStarted: () => {
        c = !u.get("suppressDragLeaveHidesColumns"), bv([t], !0);
      },
      onDragStopped: () => bv([t], !1),
      onDragCancelled: () => bv([t], !1),
      onGridEnter: (l) => {
        var v;
        if (c) {
          const f = ((v = l == null ? void 0 : l.columns) == null ? void 0 : v.filter((p) => !p.getColDef().lockVisible)) || [];
          s.setColsVisible(f, !0, "uiColumnMoved");
        }
      },
      onGridExit: (l) => {
        var v;
        if (c) {
          const f = ((v = l == null ? void 0 : l.columns) == null ? void 0 : v.filter((p) => !p.getColDef().lockVisible)) || [];
          s.setColsVisible(f, !1, "uiColumnMoved");
        }
      }
    };
    a.addDragSource(i, !0);
  }
  createDragItem(e) {
    const t = {};
    return t[e.getId()] = e.isVisible(), {
      columns: [e],
      visibleState: t
    };
  }
  updateState() {
    this.menuEnabled = this.menuService.isColumnMenuInHeaderEnabled(this.column), this.openFilterEnabled = this.menuService.isFilterMenuInHeaderEnabled(this.column), this.sortable = this.column.isSortable(), this.displayName = this.calculateDisplayName(), this.draggable = this.workOutDraggable();
  }
  setRefreshFunction(e, t) {
    this.refreshFunctions[e] = t;
  }
  refresh(e) {
    this.updateState(), this.refreshHeaderComp(e), this.refreshAria(), Object.values(this.refreshFunctions).forEach((t) => t());
  }
  refreshHeaderComp(e) {
    const t = this.lookupUserCompDetails(e);
    (this.comp.getUserCompInstance() != null && this.userCompDetails.componentClass == t.componentClass ? this.attemptHeaderCompRefresh(t.params) : !1) ? this.setDragSource(this.dragSourceElement) : this.setCompDetails(t);
  }
  attemptHeaderCompRefresh(e) {
    const t = this.comp.getUserCompInstance();
    return !t || !t.refresh ? !1 : t.refresh(e);
  }
  calculateDisplayName() {
    return this.beans.columnNameService.getDisplayNameForColumn(this.column, "header", !0);
  }
  checkDisplayName(e) {
    this.displayName !== this.calculateDisplayName() && this.refresh(e);
  }
  workOutDraggable() {
    const e = this.column.getColDef();
    return !!(!this.gos.get("suppressMovableColumns") && !e.suppressMovable && !e.lockPosition) || !!e.enableRowGroup || !!e.enablePivot;
  }
  setupWidth(e) {
    const t = () => {
      const r = this.column.getActualWidth();
      this.comp.setWidth(`${r}px`);
    };
    e.addManagedListeners(this.column, { widthChanged: t }), t();
  }
  setupMovingCss(e) {
    const t = () => {
      this.comp.addOrRemoveCssClass("ag-header-cell-moving", this.column.isMoving());
    };
    e.addManagedListeners(this.column, { movingChanged: t }), t();
  }
  setupMenuClass(e) {
    const t = () => {
      this.comp.addOrRemoveCssClass("ag-column-menu-visible", this.column.isMenuVisible());
    };
    e.addManagedListeners(this.column, { menuVisibleChanged: t }), t();
  }
  setupSortableClass(e) {
    const t = () => {
      this.comp.addOrRemoveCssClass("ag-header-cell-sortable", !!this.sortable);
    };
    t(), this.setRefreshFunction("updateSortable", t), e.addManagedEventListeners({ sortChanged: this.refreshAriaSort.bind(this) });
  }
  setupFilterClass(e) {
    const t = () => {
      const r = this.column.isFilterActive();
      this.comp.addOrRemoveCssClass("ag-header-cell-filtered", r), this.refreshAria();
    };
    e.addManagedListeners(this.column, { filterActiveChanged: t }), t();
  }
  setupWrapTextClass() {
    const e = () => {
      const t = !!this.column.getColDef().wrapHeaderText;
      this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text", t);
    };
    e(), this.setRefreshFunction("wrapText", e);
  }
  onHeaderHighlightChanged() {
    const e = this.column.getHighlighted(), t = e === 0, r = e === 1;
    this.comp.addOrRemoveCssClass("ag-header-highlight-before", t), this.comp.addOrRemoveCssClass("ag-header-highlight-after", r);
  }
  onDisplayedColumnsChanged() {
    super.onDisplayedColumnsChanged(), this.isAlive() && this.onHeaderHeightChanged();
  }
  onHeaderHeightChanged() {
    this.refreshSpanHeaderHeight();
  }
  refreshSpanHeaderHeight() {
    const { eGui: e, column: t, comp: r, beans: n } = this;
    if (!t.isSpanHeaderHeight()) {
      e.style.removeProperty("top"), e.style.removeProperty("height"), r.addOrRemoveCssClass("ag-header-span-height", !1), r.addOrRemoveCssClass("ag-header-span-total", !1);
      return;
    }
    const { numberOfParents: a, isSpanningTotal: u } = this.column.getColumnGroupPaddingInfo();
    r.addOrRemoveCssClass("ag-header-span-height", a > 0);
    const { columnModel: s } = n, c = s.getColumnHeaderRowHeight();
    if (a === 0) {
      r.addOrRemoveCssClass("ag-header-span-total", !1), e.style.setProperty("top", "0px"), e.style.setProperty("height", `${c}px`);
      return;
    }
    r.addOrRemoveCssClass("ag-header-span-total", u);
    const i = this.beans.columnModel.getGroupRowsHeight();
    let l = 0;
    for (let v = 0; v < a; v++)
      l += i[i.length - 1 - v];
    e.style.setProperty("top", `${-l}px`), e.style.setProperty("height", `${c + l}px`);
  }
  refreshAriaSort() {
    if (this.sortable) {
      const e = this.localeService.getLocaleTextFunc(), t = this.beans.sortController.getDisplaySortForColumn(this.column) || null;
      this.comp.setAriaSort(PU(t)), this.setAriaDescriptionProperty("sort", e("ariaSortableColumn", "Press ENTER to sort"));
    } else
      this.comp.setAriaSort(), this.setAriaDescriptionProperty("sort", null);
  }
  refreshAriaMenu() {
    if (this.menuEnabled) {
      const e = this.localeService.getLocaleTextFunc();
      this.setAriaDescriptionProperty("menu", e("ariaMenuColumn", "Press ALT DOWN to open column menu"));
    } else
      this.setAriaDescriptionProperty("menu", null);
  }
  refreshAriaFilterButton() {
    if (this.openFilterEnabled && !this.menuService.isLegacyMenuEnabled()) {
      const e = this.localeService.getLocaleTextFunc();
      this.setAriaDescriptionProperty(
        "filterButton",
        e("ariaFilterColumn", "Press CTRL ENTER to open filter")
      );
    } else
      this.setAriaDescriptionProperty("filterButton", null);
  }
  refreshAriaFiltered() {
    const e = this.localeService.getLocaleTextFunc();
    this.column.isFilterActive() ? this.setAriaDescriptionProperty("filter", e("ariaColumnFiltered", "Column Filtered")) : this.setAriaDescriptionProperty("filter", null);
  }
  setAriaDescriptionProperty(e, t) {
    t != null ? this.ariaDescriptionProperties.set(e, t) : this.ariaDescriptionProperties.delete(e);
  }
  announceAriaDescription() {
    if (!this.eGui.contains(Sa(this.beans.gos)))
      return;
    const e = Array.from(this.ariaDescriptionProperties.keys()).sort((t, r) => t === "filter" ? -1 : r.charCodeAt(0) - t.charCodeAt(0)).map((t) => this.ariaDescriptionProperties.get(t)).join(". ");
    this.beans.ariaAnnouncementService.announceValue(e, "columnHeader");
  }
  refreshAria() {
    this.refreshAriaSort(), this.refreshAriaMenu(), this.refreshAriaFilterButton(), this.refreshAriaFiltered();
  }
  addColumnHoverListener(e) {
    const t = () => {
      if (!this.gos.get("columnHoverHighlight"))
        return;
      const r = this.beans.columnHoverService.isHovered(this.column);
      this.comp.addOrRemoveCssClass("ag-column-hover", r);
    };
    e.addManagedEventListeners({ columnHoverChanged: t }), t();
  }
  getColId() {
    return this.column.getColId();
  }
  addActiveHeaderMouseListeners(e) {
    const t = (a) => this.handleMouseOverChange(a.type === "mouseenter"), r = () => this.dispatchColumnMouseEvent("columnHeaderClicked", this.column), n = (a) => this.handleContextMenuMouseEvent(a, void 0, this.column);
    e.addManagedListeners(this.getGui(), {
      mouseenter: t,
      mouseleave: t,
      click: r,
      contextmenu: n
    });
  }
  handleMouseOverChange(e) {
    this.setActiveHeader(e), this.eventService.dispatchEvent({
      type: e ? "columnHeaderMouseOver" : "columnHeaderMouseLeave",
      column: this.column
    });
  }
  setActiveHeader(e) {
    this.comp.addOrRemoveCssClass("ag-header-active", e);
  }
  getAnchorElementForMenu(e) {
    const t = this.comp.getUserCompInstance();
    return t instanceof gT ? t.getAnchorElementForMenu(e) : this.getGui();
  }
  destroy() {
    super.destroy();
  }
}, bX = class extends mr {
  wireBeans(e) {
    this.horizontalResizeService = e.horizontalResizeService, this.autoWidthCalculator = e.autoWidthCalculator, this.visibleColsService = e.visibleColsService, this.columnSizeService = e.columnSizeService, this.columnAutosizeService = e.columnAutosizeService;
  }
  constructor(e, t, r, n) {
    super(), this.eResize = t, this.comp = e, this.pinned = r, this.columnGroup = n;
  }
  postConstruct() {
    if (!this.columnGroup.isResizable()) {
      this.comp.setResizableDisplayed(!1);
      return;
    }
    const e = this.horizontalResizeService.addResizeBar({
      eResizeBar: this.eResize,
      onResizeStart: this.onResizeStart.bind(this),
      onResizing: this.onResizing.bind(this, !1),
      onResizeEnd: this.onResizing.bind(this, !0)
    });
    if (this.addDestroyFunc(e), !this.gos.get("suppressAutoSize")) {
      const t = this.gos.get("skipHeaderOnAutoSize");
      this.eResize.addEventListener("dblclick", () => {
        const r = [];
        this.columnGroup.getDisplayedLeafColumns().forEach((a) => {
          a.getColDef().suppressAutoSize || r.push(a.getColId());
        }), r.length > 0 && this.columnAutosizeService.autoSizeCols({
          colKeys: r,
          skipHeader: t,
          stopAtGroup: this.columnGroup,
          source: "uiColumnResized"
        }), this.resizeLeafColumnsToFit("uiColumnResized");
      });
    }
  }
  onResizeStart(e) {
    const t = this.getInitialValues(e);
    this.storeLocalValues(t), this.toggleColumnResizing(!0);
  }
  onResizing(e, t, r = "uiColumnResized") {
    const n = this.normaliseDragChange(t), a = this.resizeStartWidth + n;
    this.resizeColumnsFromLocalValues(a, r, e);
  }
  getInitialValues(e) {
    const t = this.getColumnsToResize(), r = this.getInitialSizeOfColumns(t), n = this.getSizeRatiosOfColumns(t, r), a = {
      columnsToResize: t,
      resizeStartWidth: r,
      resizeRatios: n
    };
    let u = null;
    if (e && (u = this.visibleColsService.getGroupAtDirection(this.columnGroup, "After")), u) {
      const s = u.getDisplayedLeafColumns(), c = a.groupAfterColumns = s.filter(
        (l) => l.isResizable()
      ), i = a.groupAfterStartWidth = this.getInitialSizeOfColumns(c);
      a.groupAfterRatios = this.getSizeRatiosOfColumns(c, i);
    } else
      a.groupAfterColumns = void 0, a.groupAfterStartWidth = void 0, a.groupAfterRatios = void 0;
    return a;
  }
  storeLocalValues(e) {
    const {
      columnsToResize: t,
      resizeStartWidth: r,
      resizeRatios: n,
      groupAfterColumns: a,
      groupAfterStartWidth: u,
      groupAfterRatios: s
    } = e;
    this.resizeCols = t, this.resizeStartWidth = r, this.resizeRatios = n, this.resizeTakeFromCols = a, this.resizeTakeFromStartWidth = u, this.resizeTakeFromRatios = s;
  }
  clearLocalValues() {
    this.resizeCols = void 0, this.resizeRatios = void 0, this.resizeTakeFromCols = void 0, this.resizeTakeFromRatios = void 0;
  }
  resizeLeafColumnsToFit(e) {
    const t = this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup), r = this.getInitialValues();
    t > r.resizeStartWidth && this.resizeColumns(r, t, e, !0);
  }
  resizeColumnsFromLocalValues(e, t, r = !0) {
    if (!this.resizeCols || !this.resizeRatios)
      return;
    const n = {
      columnsToResize: this.resizeCols,
      resizeStartWidth: this.resizeStartWidth,
      resizeRatios: this.resizeRatios,
      groupAfterColumns: this.resizeTakeFromCols ?? void 0,
      groupAfterStartWidth: this.resizeTakeFromStartWidth ?? void 0,
      groupAfterRatios: this.resizeTakeFromRatios ?? void 0
    };
    this.resizeColumns(n, e, t, r);
  }
  resizeColumns(e, t, r, n = !0) {
    const {
      columnsToResize: a,
      resizeStartWidth: u,
      resizeRatios: s,
      groupAfterColumns: c,
      groupAfterStartWidth: i,
      groupAfterRatios: l
    } = e, v = [];
    if (v.push({
      columns: a,
      ratios: s,
      width: t
    }), c) {
      const f = t - u;
      v.push({
        columns: c,
        ratios: l,
        width: i - f
      });
    }
    this.columnSizeService.resizeColumnSets({
      resizeSets: v,
      finished: n,
      source: r
    }), n && this.toggleColumnResizing(!1);
  }
  toggleColumnResizing(e) {
    this.comp.addOrRemoveCssClass("ag-column-resizing", e);
  }
  getColumnsToResize() {
    return this.columnGroup.getDisplayedLeafColumns().filter((t) => t.isResizable());
  }
  getInitialSizeOfColumns(e) {
    return e.reduce((t, r) => t + r.getActualWidth(), 0);
  }
  getSizeRatiosOfColumns(e, t) {
    return e.map((r) => r.getActualWidth() / t);
  }
  // optionally inverts the drag, depending on pinned and RTL
  // note - this method is duplicated in RenderedHeaderCell - should refactor out?
  normaliseDragChange(e) {
    let t = e;
    return this.gos.get("enableRtl") ? this.pinned !== "left" && (t *= -1) : this.pinned === "right" && (t *= -1), t;
  }
  destroy() {
    super.destroy(), this.clearLocalValues();
  }
}, wX = class extends mr {
  constructor(e, t) {
    super(), this.removeChildListenersFuncs = [], this.columnGroup = t, this.comp = e;
  }
  postConstruct() {
    this.addListenersToChildrenColumns(), this.addManagedListeners(this.columnGroup, {
      displayedChildrenChanged: this.onDisplayedChildrenChanged.bind(this)
    }), this.onWidthChanged(), this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this));
  }
  addListenersToChildrenColumns() {
    this.removeListenersOnChildrenColumns();
    const e = this.onWidthChanged.bind(this);
    this.columnGroup.getLeafColumns().forEach((t) => {
      t.addEventListener("widthChanged", e), t.addEventListener("visibleChanged", e), this.removeChildListenersFuncs.push(() => {
        t.removeEventListener("widthChanged", e), t.removeEventListener("visibleChanged", e);
      });
    });
  }
  removeListenersOnChildrenColumns() {
    this.removeChildListenersFuncs.forEach((e) => e()), this.removeChildListenersFuncs = [];
  }
  onDisplayedChildrenChanged() {
    this.addListenersToChildrenColumns(), this.onWidthChanged();
  }
  onWidthChanged() {
    const e = this.columnGroup.getActualWidth();
    this.comp.setWidth(`${e}px`), this.comp.addOrRemoveCssClass("ag-hidden", e === 0);
  }
}, SX = class extends Z1 {
  constructor(e, t, r) {
    super(e, t, r), this.onSuppressColMoveChange = () => {
      if (!this.isAlive() || this.isSuppressMoving())
        this.removeDragSource();
      else if (!this.dragSource) {
        const n = this.getGui();
        this.setDragSource(n);
      }
    }, this.column = e;
  }
  setComp(e, t, r, n, a) {
    this.comp = e, a = ry(this, this.beans.context, a), this.setGui(t, a), this.displayName = this.beans.columnNameService.getDisplayNameForColumnGroup(this.column, "header"), this.addClasses(), this.setupMovingCss(a), this.setupExpandable(a), this.setupTooltip(a), this.setupAutoHeight({
      wrapperElement: n,
      compBean: a
    }), this.setupUserComp(a), this.addHeaderMouseListeners(a);
    const u = this.getParentRowCtrl().getPinned(), s = this.column.getProvidedColumnGroup().getLeafColumns();
    a.createManagedBean(new iR(s, t)), a.createManagedBean(new nR(this.column, t, this.beans)), a.createManagedBean(new wX(e, this.column)), this.resizeFeature = a.createManagedBean(new bX(e, r, u, this.column)), a.createManagedBean(
      new $h(t, {
        shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),
        onTabKeyDown: () => {
        },
        handleKeyDown: this.handleKeyDown.bind(this),
        onFocusIn: this.onFocusIn.bind(this)
      })
    ), this.addHighlightListeners(a, s), a.addManagedPropertyListener("suppressMovableColumns", this.onSuppressColMoveChange), this.addResizeAndMoveKeyboardListeners(a), a.addDestroyFunc(() => this.clearComponent());
  }
  addHighlightListeners(e, t) {
    if (this.beans.gos.get("suppressMoveWhenColumnDragging"))
      for (const r of t)
        e.addManagedListeners(r, {
          headerHighlightChanged: this.onLeafColumnHighlightChanged.bind(this, r)
        });
  }
  onLeafColumnHighlightChanged(e) {
    const t = this.column.getDisplayedLeafColumns(), r = t[0] === e, n = di(t) === e;
    if (!r && !n)
      return;
    const a = e.getHighlighted(), u = !!this.getParentRowCtrl().findHeaderCellCtrl((i) => i.getColumnGroupChild().isMoving());
    let s = !1, c = !1;
    if (u) {
      const i = this.beans.gos.get("enableRtl"), l = a === 1, v = a === 0;
      r && (i ? c = l : s = v), n && (i ? s = v : c = l);
    }
    this.comp.addOrRemoveCssClass("ag-header-highlight-before", s), this.comp.addOrRemoveCssClass("ag-header-highlight-after", c);
  }
  getColumn() {
    return this.column;
  }
  resizeHeader(e, t) {
    if (!this.resizeFeature)
      return;
    const r = this.resizeFeature.getInitialValues(t);
    this.resizeFeature.resizeColumns(
      r,
      r.resizeStartWidth + e,
      "uiColumnResized",
      !0
    );
  }
  moveHeader(e) {
    const { beans: t, eGui: r, column: n, ctrlsService: a } = this, { gos: u, columnModel: s, columnMoveService: c, visibleColsService: i } = t, l = u.get("enableRtl"), v = e === 0, f = this.getPinned(), p = r.getBoundingClientRect(), g = p.left, y = p.width, C = S1({
      x: v !== l ? g - 20 : g + y + 20,
      pinned: f,
      fromKeyboard: !0,
      gos: u,
      ctrlsService: a
    }), m = n.getGroupId(), h = this.focusService.getFocusedHeader();
    lR({
      allMovingColumns: this.column.getLeafColumns(),
      isFromHeader: !0,
      fromLeft: e === 1,
      xPosition: C,
      pinned: f,
      fromEnter: !1,
      fakeEvent: !1,
      gos: u,
      columnModel: s,
      columnMoveService: c,
      visibleColsService: i,
      finished: !0
    });
    const w = n.getDisplayedLeafColumns(), S = v ? w[0] : di(w);
    this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(S, "auto"), (!this.isAlive() || this.beans.gos.get("ensureDomOrder")) && h && this.restoreFocus(m, n, h);
  }
  restoreFocus(e, t, r) {
    const n = t.getLeafColumns();
    if (!n.length)
      return;
    const a = n[0].getParent();
    if (!a)
      return;
    const u = this.findGroupWidthId(a, e);
    u && this.focusService.focusHeaderPosition({
      headerPosition: {
        ...r,
        column: u
      }
    });
  }
  findGroupWidthId(e, t) {
    for (; e; ) {
      if (e.getGroupId() === t)
        return e;
      e = e.getParent();
    }
    return null;
  }
  resizeLeafColumnsToFit(e) {
    this.resizeFeature && this.resizeFeature.resizeLeafColumnsToFit(e);
  }
  setupUserComp(e) {
    const t = this.gos.addGridCommonParams({
      displayName: this.displayName,
      columnGroup: this.column,
      setExpanded: (n) => {
        this.beans.columnModel.setColumnGroupOpened(
          this.column.getProvidedColumnGroup(),
          n,
          "gridInitializing"
        );
      },
      setTooltip: (n, a) => {
        this.setupTooltip(e, n, a);
      }
    }), r = this.userComponentFactory.getHeaderGroupCompDetails(t);
    this.comp.setUserCompDetails(r);
  }
  addHeaderMouseListeners(e) {
    const t = (a) => this.handleMouseOverChange(a.type === "mouseenter"), r = () => this.dispatchColumnMouseEvent("columnHeaderClicked", this.column.getProvidedColumnGroup()), n = (a) => this.handleContextMenuMouseEvent(a, void 0, this.column.getProvidedColumnGroup());
    e.addManagedListeners(this.getGui(), {
      mouseenter: t,
      mouseleave: t,
      click: r,
      contextmenu: n
    });
  }
  handleMouseOverChange(e) {
    this.eventService.dispatchEvent({
      type: e ? "columnHeaderMouseOver" : "columnHeaderMouseLeave",
      column: this.column.getProvidedColumnGroup()
    });
  }
  setupTooltip(e, t, r) {
    this.tooltipFeature && (this.tooltipFeature = this.destroyBean(this.tooltipFeature));
    const n = this.column.getColGroupDef(), a = this.gos.get("tooltipShowMode") === "whenTruncated", u = this.eGui;
    !r && a && !(n != null && n.headerGroupComponent) && (r = () => {
      const c = u.querySelector(".ag-header-group-text");
      return c ? c.scrollWidth > c.clientWidth : !0;
    });
    const s = {
      getColumn: () => this.column,
      getGui: () => u,
      getLocation: () => "headerGroup",
      getTooltipValue: () => t ?? (n && n.headerTooltip),
      shouldDisplayTooltip: r
    };
    n && (s.getColDef = () => n), e.createManagedBean(new Bv(s));
  }
  setupExpandable(e) {
    const t = this.column.getProvidedColumnGroup();
    this.refreshExpanded();
    const r = this.refreshExpanded.bind(this);
    e.addManagedListeners(t, {
      expandedChanged: r,
      expandableChanged: r
    });
  }
  refreshExpanded() {
    const { column: e } = this;
    this.expandable = e.isExpandable();
    const t = e.isExpanded();
    this.expandable ? this.comp.setAriaExpanded(t ? "true" : "false") : this.comp.setAriaExpanded(void 0);
  }
  getColId() {
    return this.column.getUniqueId();
  }
  addClasses() {
    const e = this.column.getColGroupDef(), t = Lk(e, this.gos, null, this.column);
    this.column.isPadding() ? (t.push("ag-header-group-cell-no-group"), this.column.getLeafColumns().every((n) => n.isSpanHeaderHeight()) && t.push("ag-header-span-height")) : (t.push("ag-header-group-cell-with-group"), e != null && e.wrapHeaderText && t.push("ag-header-cell-wrap-text")), t.forEach((r) => this.comp.addOrRemoveCssClass(r, !0));
  }
  setupMovingCss(e) {
    const r = this.column.getProvidedColumnGroup().getLeafColumns(), n = () => this.comp.addOrRemoveCssClass("ag-header-cell-moving", this.column.isMoving());
    r.forEach((a) => {
      e.addManagedListeners(a, { movingChanged: n });
    }), n();
  }
  onFocusIn(e) {
    if (!this.eGui.contains(e.relatedTarget)) {
      const t = this.getRowIndex();
      this.beans.focusService.setFocusedHeader(t, this.column);
    }
  }
  handleKeyDown(e) {
    super.handleKeyDown(e);
    const t = this.getWrapperHasFocus();
    if (!(!this.expandable || !t) && e.key === dr.ENTER) {
      const r = this.column, n = !r.isExpanded();
      this.beans.columnModel.setColumnGroupOpened(
        r.getProvidedColumnGroup(),
        n,
        "uiColumnExpanded"
      );
    }
  }
  // unlike columns, this will only get called once, as we don't react on props on column groups
  // (we will always destroy and recreate this comp if something changes)
  setDragSource(e) {
    if (!this.isAlive() || this.isSuppressMoving() || (this.removeDragSource(), !e))
      return;
    const { beans: t, column: r, displayName: n, gos: a, dragAndDropService: u } = this, { columnModel: s } = t, c = r.getProvidedColumnGroup().getLeafColumns();
    let i = !a.get("suppressDragLeaveHidesColumns");
    const l = this.dragSource = {
      type: 1,
      eElement: e,
      getDefaultIconName: () => i ? "hide" : "notAllowed",
      dragItemName: n,
      // we add in the original group leaf columns, so we move both visible and non-visible items
      getDragItem: () => this.getDragItemForGroup(r),
      onDragStarted: () => {
        i = !a.get("suppressDragLeaveHidesColumns"), bv(c, !0);
      },
      onDragStopped: () => bv(c, !1),
      onDragCancelled: () => bv(c, !1),
      onGridEnter: (v) => {
        if (i) {
          const { columns: f = [], visibleState: p } = v ?? {}, g = f.filter(
            (y) => !y.getColDef().lockVisible && (!p || p[y.getColId()])
          );
          s.setColsVisible(g, !0, "uiColumnMoved");
        }
      },
      onGridExit: (v) => {
        var f;
        if (i) {
          const p = ((f = v == null ? void 0 : v.columns) == null ? void 0 : f.filter((g) => !g.getColDef().lockVisible)) || [];
          s.setColsVisible(p, !1, "uiColumnMoved");
        }
      }
    };
    u.addDragSource(l, !0);
  }
  // when moving the columns, we want to move all the columns (contained within the DragItem) in this group in one go,
  // and in the order they are currently in the screen.
  getDragItemForGroup(e) {
    const t = e.getProvidedColumnGroup().getLeafColumns(), r = {};
    t.forEach((s) => r[s.getId()] = s.isVisible());
    const n = [];
    this.beans.visibleColsService.getAllCols().forEach((s) => {
      t.indexOf(s) >= 0 && (n.push(s), bs(t, s));
    }), t.forEach((s) => n.push(s));
    const a = [], u = e.getLeafColumns();
    for (const s of n)
      u.indexOf(s) !== -1 && a.push(s);
    return {
      columns: n,
      columnsInSplit: a,
      visibleState: r
    };
  }
  isSuppressMoving() {
    let e = !1;
    return this.column.getLeafColumns().forEach((r) => {
      (r.getColDef().suppressMovable || r.getColDef().lockPosition) && (e = !0);
    }), e || this.gos.get("suppressMovableColumns");
  }
  destroy() {
    super.destroy();
  }
}, xX = 0, Ax = class extends mr {
  constructor(e, t, r) {
    super(), this.instanceId = xX++, this.rowIndex = e, this.pinned = t, this.type = r;
    const n = r == "group" ? "ag-header-row-column-group" : r == "filter" ? "ag-header-row-column-filter" : "ag-header-row-column";
    this.headerRowClass = `ag-header-row ${n}`;
  }
  wireBeans(e) {
    this.beans = e;
  }
  postConstruct() {
    this.isPrintLayout = Ao(this.gos, "print"), this.isEnsureDomOrder = this.gos.get("ensureDomOrder");
  }
  /** Checks that every header cell that is currently visible has been rendered.
   * Can only be false under some circumstances when using React
   */
  areCellsRendered() {
    return this.comp ? this.getHeaderCellCtrls().every((e) => e.getGui() != null) : !1;
  }
  /**
   *
   * @param comp Proxy to the actual component
   * @param initCompState Should the component be initialised with the current state of the controller. Default: true
   */
  setComp(e, t, r = !0) {
    this.comp = e, t = ry(this, this.beans.context, t), r && (this.onRowHeightChanged(), this.onVirtualColumnsChanged()), this.setWidth(), this.addEventListeners(t);
  }
  getHeaderRowClass() {
    return this.headerRowClass;
  }
  getAriaRowIndex() {
    return this.rowIndex + 1;
  }
  addEventListeners(e) {
    const t = this.onRowHeightChanged.bind(this);
    e.addManagedEventListeners({
      columnResized: this.onColumnResized.bind(this),
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
      virtualColumnsChanged: (r) => this.onVirtualColumnsChanged(r.afterScroll),
      columnGroupHeaderHeightChanged: t,
      columnHeaderHeightChanged: t,
      gridStylesChanged: t,
      advancedFilterEnabledChanged: t
    }), e.addManagedPropertyListener("domLayout", this.onDisplayedColumnsChanged.bind(this)), e.addManagedPropertyListener("ensureDomOrder", (r) => this.isEnsureDomOrder = r.currentValue), e.addManagedPropertyListeners(
      [
        "headerHeight",
        "pivotHeaderHeight",
        "groupHeaderHeight",
        "pivotGroupHeaderHeight",
        "floatingFiltersHeight"
      ],
      t
    );
  }
  getHeaderCellCtrl(e) {
    if (this.headerCellCtrls)
      return PC(this.headerCellCtrls).find((t) => t.getColumnGroupChild() === e);
  }
  onDisplayedColumnsChanged() {
    this.isPrintLayout = Ao(this.gos, "print"), this.onVirtualColumnsChanged(), this.setWidth(), this.onRowHeightChanged();
  }
  getType() {
    return this.type;
  }
  onColumnResized() {
    this.setWidth();
  }
  setWidth() {
    const e = this.getWidthForRow();
    this.comp.setWidth(`${e}px`);
  }
  getWidthForRow() {
    const { visibleColsService: e } = this.beans;
    return this.isPrintLayout ? this.pinned != null ? 0 : e.getContainerWidth("right") + e.getContainerWidth("left") + e.getContainerWidth(null) : e.getContainerWidth(this.pinned);
  }
  onRowHeightChanged() {
    const { topOffset: e, rowHeight: t } = this.getTopAndHeight();
    this.comp.setTop(e + "px"), this.comp.setHeight(t + "px");
  }
  getTopAndHeight() {
    const { columnModel: e, filterManager: t } = this.beans, r = [], n = e.getGroupRowsHeight(), a = e.getColumnHeaderRowHeight();
    r.push(...n), r.push(a), t != null && t.hasFloatingFilters() && r.push(e.getFloatingFiltersHeight());
    let u = 0;
    for (let c = 0; c < this.rowIndex; c++)
      u += r[c];
    const s = r[this.rowIndex];
    return { topOffset: u, rowHeight: s };
  }
  getPinned() {
    return this.pinned;
  }
  getRowIndex() {
    return this.rowIndex;
  }
  onVirtualColumnsChanged(e = !1) {
    const t = this.getHeaderCtrls(), r = this.isEnsureDomOrder || this.isPrintLayout;
    this.comp.setHeaderCtrls(t, r, e);
  }
  getHeaderCtrls() {
    const e = this.headerCellCtrls;
    this.headerCellCtrls = /* @__PURE__ */ new Map();
    const t = this.getColumnsInViewport();
    for (const n of t)
      this.recycleAndCreateHeaderCtrls(n, e);
    const r = (n) => {
      const { focusService: a, visibleColsService: u } = this.beans;
      return a.isHeaderWrapperFocused(n) ? u.isVisible(n.getColumnGroupChild()) : !1;
    };
    if (e)
      for (const [n, a] of e)
        r(a) ? this.headerCellCtrls.set(n, a) : this.destroyBean(a);
    return this.getHeaderCellCtrls();
  }
  getHeaderCellCtrls() {
    var e;
    return Array.from(((e = this.headerCellCtrls) == null ? void 0 : e.values()) ?? []);
  }
  recycleAndCreateHeaderCtrls(e, t) {
    if (!this.headerCellCtrls || e.isEmptyGroup())
      return;
    const r = e.getUniqueId();
    let n;
    if (t && (n = t.get(r), t.delete(r)), n && n.getColumnGroupChild() != e && (this.destroyBean(n), n = void 0), n == null)
      switch (this.type) {
        case "filter": {
          n = this.createBean(
            this.beans.ctrlsFactory.getInstance(
              "headerFilterCell",
              e,
              this.beans,
              this
            )
          );
          break;
        }
        case "group":
          n = this.createBean(
            new SX(e, this.beans, this)
          );
          break;
        default:
          n = this.createBean(new CX(e, this.beans, this));
          break;
      }
    this.headerCellCtrls.set(r, n);
  }
  getColumnsInViewport() {
    return this.isPrintLayout ? this.getColumnsInViewportPrintLayout() : this.getColumnsInViewportNormalLayout();
  }
  getColumnsInViewportPrintLayout() {
    if (this.pinned != null)
      return [];
    let e = [];
    const t = this.getActualDepth(), { columnViewportService: r } = this.beans;
    return ["left", null, "right"].forEach((n) => {
      const a = r.getHeadersToRender(n, t);
      e = e.concat(a);
    }), e;
  }
  getActualDepth() {
    return this.type == "filter" ? this.rowIndex - 1 : this.rowIndex;
  }
  getColumnsInViewportNormalLayout() {
    return this.beans.columnViewportService.getHeadersToRender(this.pinned, this.getActualDepth());
  }
  findHeaderCellCtrl(e) {
    if (!this.headerCellCtrls)
      return;
    const t = this.getHeaderCellCtrls();
    let r;
    return typeof e == "function" ? r = t.find(e) : r = t.find((n) => n.getColumnGroupChild() == e), r;
  }
  focusHeader(e, t) {
    const r = this.findHeaderCellCtrl(e);
    return r ? r.focus(t) : !1;
  }
  destroy() {
    var e;
    (e = this.headerCellCtrls) == null || e.forEach((t) => {
      this.destroyBean(t);
    }), this.headerCellCtrls = void 0, super.destroy();
  }
}, TX = class extends mr {
  constructor(e) {
    super(), this.hidden = !1, this.includeFloatingFilter = !1, this.groupsRowCtrls = [], this.pinned = e;
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.scrollVisibleService = e.scrollVisibleService, this.pinnedWidthService = e.pinnedWidthService, this.columnModel = e.columnModel, this.focusService = e.focusService, this.filterManager = e.filterManager;
  }
  setComp(e, t) {
    this.comp = e, this.eViewport = t, this.setupCenterWidth(), this.setupPinnedWidth(), this.setupDragAndDrop(this.eViewport);
    const r = this.onDisplayedColumnsChanged.bind(this);
    this.addManagedEventListeners({
      gridColumnsChanged: this.onGridColumnsChanged.bind(this),
      displayedColumnsChanged: r,
      advancedFilterEnabledChanged: r
    });
    const n = `${typeof this.pinned == "string" ? this.pinned : "center"}Header`;
    this.ctrlsService.register(n, this), this.columnModel.isReady() && this.refresh();
  }
  getAllCtrls() {
    const e = [...this.groupsRowCtrls];
    return this.columnsRowCtrl && e.push(this.columnsRowCtrl), this.filtersRowCtrl && e.push(this.filtersRowCtrl), e;
  }
  refresh(e = !1) {
    const t = new $2(), r = this.focusService.getFocusHeaderToUseAfterRefresh(), n = () => {
      const c = this.columnModel.getHeaderRowCount() - 1;
      this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls);
      for (let i = 0; i < c; i++) {
        const l = this.createBean(
          new Ax(
            t.next(),
            this.pinned,
            "group"
            /* COLUMN_GROUP */
          )
        );
        this.groupsRowCtrls.push(l);
      }
    }, a = () => {
      const c = t.next(), i = !this.hidden && (this.columnsRowCtrl == null || !e || this.columnsRowCtrl.getRowIndex() !== c);
      (i || this.hidden) && (this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl)), i && (this.columnsRowCtrl = this.createBean(new Ax(
        c,
        this.pinned,
        "column"
        /* COLUMN */
      )));
    }, u = () => {
      var l;
      this.includeFloatingFilter = !!((l = this.filterManager) != null && l.hasFloatingFilters()) && !this.hidden;
      const c = () => {
        this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl);
      };
      if (!this.includeFloatingFilter) {
        c();
        return;
      }
      const i = t.next();
      if (this.filtersRowCtrl) {
        const v = this.filtersRowCtrl.getRowIndex() !== i;
        (!e || v) && c();
      }
      this.filtersRowCtrl || (this.filtersRowCtrl = this.createBean(
        new Ax(
          i,
          this.pinned,
          "filter"
          /* FLOATING_FILTER */
        )
      ));
    };
    n(), a(), u();
    const s = this.getAllCtrls();
    this.comp.setCtrls(s), this.restoreFocusOnHeader(r);
  }
  getHeaderCtrlForColumn(e) {
    var t;
    if (of(e))
      return (t = this.columnsRowCtrl) == null ? void 0 : t.getHeaderCellCtrl(e);
    if (this.groupsRowCtrls.length !== 0)
      for (let r = 0; r < this.groupsRowCtrls.length; r++) {
        const n = this.groupsRowCtrls[r].getHeaderCellCtrl(e);
        if (n)
          return n;
      }
  }
  getHtmlElementForColumnHeader(e) {
    const t = this.getHeaderCtrlForColumn(e);
    return t ? t.getGui() : null;
  }
  getRowType(e) {
    const r = this.getAllCtrls()[e];
    return r ? r.getType() : void 0;
  }
  focusHeader(e, t, r) {
    const a = this.getAllCtrls()[e];
    return a ? a.focusHeader(t, r) : !1;
  }
  getViewportElement() {
    return this.eViewport;
  }
  getGroupRowCount() {
    return this.groupsRowCtrls.length;
  }
  getGroupRowCtrlAtIndex(e) {
    return this.groupsRowCtrls[e];
  }
  getRowCount() {
    return this.groupsRowCtrls.length + (this.columnsRowCtrl ? 1 : 0) + (this.filtersRowCtrl ? 1 : 0);
  }
  setHorizontalScroll(e) {
    this.comp.setViewportScrollLeft(e);
  }
  onScrollCallback(e) {
    this.addManagedElementListeners(this.getViewportElement(), { scroll: e });
  }
  destroy() {
    this.filtersRowCtrl && (this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl)), this.columnsRowCtrl && (this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl)), this.groupsRowCtrls && this.groupsRowCtrls.length && (this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls)), super.destroy();
  }
  setupDragAndDrop(e) {
    const t = new gX(this.pinned, e);
    this.createManagedBean(t);
  }
  restoreFocusOnHeader(e) {
    if (!e)
      return;
    const { column: t } = e;
    t.getPinned() == this.pinned && this.focusService.focusHeaderPosition({ headerPosition: e });
  }
  // grid cols have changed - this also means the number of rows in the header can have
  // changed. so we remove all the old rows and insert new ones for a complete refresh
  onGridColumnsChanged() {
    this.refresh(!0);
  }
  onDisplayedColumnsChanged() {
    var t;
    const e = ((t = this.filterManager) == null ? void 0 : t.hasFloatingFilters()) && !this.hidden;
    this.includeFloatingFilter !== e && this.refresh(!0);
  }
  setupCenterWidth() {
    this.pinned == null && this.createManagedBean(new sR((e) => this.comp.setCenterWidth(`${e}px`), !0));
  }
  setupPinnedWidth() {
    if (this.pinned == null)
      return;
    const e = this.pinned === "left", t = this.pinned === "right";
    this.hidden = !0;
    const r = () => {
      const n = e ? this.pinnedWidthService.getPinnedLeftWidth() : this.pinnedWidthService.getPinnedRightWidth();
      if (n == null)
        return;
      const a = n == 0, u = this.hidden !== a, s = this.gos.get("enableRtl"), c = this.scrollVisibleService.getScrollbarWidth(), l = this.scrollVisibleService.isVerticalScrollShowing() && (s && e || !s && t) ? n + c : n;
      this.comp.setPinnedContainerWidth(`${l}px`), this.comp.setDisplayed(!a), u && (this.hidden = a, this.refresh());
    };
    this.addManagedEventListeners({
      leftPinnedWidthChanged: r,
      rightPinnedWidthChanged: r,
      scrollVisibilityChanged: r,
      scrollbarWidthChanged: r
    });
  }
}, uR = class extends mr {
  constructor(e) {
    super(), this.view = e;
  }
  postConstruct() {
    this.addManagedPropertyListener("domLayout", this.updateLayoutClasses.bind(this)), this.updateLayoutClasses();
  }
  updateLayoutClasses() {
    const e = this.getDomLayout(), t = {
      autoHeight: e === "autoHeight",
      normal: e === "normal",
      print: e === "print"
    }, r = t.autoHeight ? "ag-layout-auto-height" : t.print ? "ag-layout-print" : "ag-layout-normal";
    this.view.updateLayoutClasses(r, t);
  }
  // returns either 'print', 'autoHeight' or 'normal' (normal is the default)
  getDomLayout() {
    const e = this.gos.get("domLayout") ?? "normal";
    return ["normal", "print", "autoHeight"].indexOf(e) === -1 ? (Fr(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`), "normal") : e;
  }
}, RX = class extends na {
  constructor() {
    super(
      /* html */
      `
            <div class="ag-overlay" role="presentation">
                <div class="ag-overlay-panel" role="presentation">
                    <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div>
                </div>
            </div>`
    ), this.eOverlayWrapper = In, this.activePromise = null, this.activeOverlay = null, this.updateListenerDestroyFunc = null, this.activeOverlayWrapperCssClass = null, this.elToFocusAfter = null;
  }
  wireBeans(e) {
    this.overlayService = e.overlayService, this.focusService = e.focusService, this.visibleColsService = e.visibleColsService;
  }
  handleKeyDown(e) {
    if (e.key !== dr.TAB || e.defaultPrevented || Qc(e) || this.focusService.findNextFocusableElement(this.eOverlayWrapper, !1, e.shiftKey))
      return;
    let r = !1;
    e.shiftKey ? r = this.focusService.focusGridView(di(this.visibleColsService.getAllCols()), !0, !1) : r = this.focusService.focusNextGridCoreContainer(!1), r && e.preventDefault();
  }
  updateLayoutClasses(e, t) {
    const r = this.eOverlayWrapper.classList;
    r.toggle("ag-layout-auto-height", t.autoHeight), r.toggle("ag-layout-normal", t.normal), r.toggle("ag-layout-print", t.print);
  }
  postConstruct() {
    this.createManagedBean(new uR(this)), this.setDisplayed(!1, { skipAriaHidden: !0 }), this.overlayService.setOverlayWrapperComp(this), this.addManagedElementListeners(this.getFocusableElement(), { keydown: this.handleKeyDown.bind(this) });
  }
  setWrapperTypeClass(e) {
    const t = this.eOverlayWrapper.classList;
    this.activeOverlayWrapperCssClass && t.toggle(this.activeOverlayWrapperCssClass, !1), this.activeOverlayWrapperCssClass = e, t.toggle(e, !0);
  }
  showOverlay(e, t, r, n) {
    if (this.setWrapperTypeClass(t), this.destroyActiveOverlay(), this.elToFocusAfter = null, this.activePromise = e, !!e) {
      if (this.setDisplayed(!0, { skipAriaHidden: !0 }), r && this.focusService.isGridFocused()) {
        const a = Sa(this.gos);
        a && !DL(this.gos) && (this.elToFocusAfter = a);
      }
      e.then((a) => {
        if (this.activePromise !== e) {
          this.activeOverlay !== a && (this.destroyBean(a), a = null);
          return;
        }
        if (this.activePromise = null, !a)
          return;
        if (this.activeOverlay !== a && (this.eOverlayWrapper.appendChild(a.getGui()), this.activeOverlay = a, n)) {
          const s = a;
          this.updateListenerDestroyFunc = this.addManagedPropertyListener(n, ({ currentValue: c }) => {
            var i;
            (i = s.refresh) == null || i.call(s, this.gos.addGridCommonParams({ ...c ?? {} }));
          });
        }
        const u = this.focusService;
        r && u.isGridFocused() && u.focusInto(this.eOverlayWrapper);
      });
    }
  }
  updateOverlayWrapperPaddingTop(e) {
    this.eOverlayWrapper.style.setProperty("padding-top", `${e}px`);
  }
  destroyActiveOverlay() {
    var n;
    this.activePromise = null;
    const e = this.activeOverlay;
    if (!e)
      return;
    let t = this.elToFocusAfter;
    this.activeOverlay = null, this.elToFocusAfter = null, t && !this.focusService.isGridFocused() && (t = null);
    const r = this.updateListenerDestroyFunc;
    r && (r(), this.updateListenerDestroyFunc = null), this.destroyBean(e), Qs(this.eOverlayWrapper), (n = t == null ? void 0 : t.focus) == null || n.call(t, { preventScroll: !0 });
  }
  hideOverlay() {
    this.destroyActiveOverlay(), this.setDisplayed(!1, { skipAriaHidden: !0 });
  }
  destroy() {
    this.elToFocusAfter = null, this.destroyActiveOverlay(), this.overlayService.setOverlayWrapperComp(void 0), super.destroy();
  }
}, _k = class extends na {
  constructor(e, t) {
    super(), this.direction = t, this.eViewport = In, this.eContainer = In, this.hideTimeout = null, this.setTemplate(e);
  }
  wireBeans(e) {
    this.animationFrameService = e.animationFrameService;
  }
  postConstruct() {
    this.addManagedEventListeners({
      scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this)
    }), this.onScrollVisibilityChanged(), this.addOrRemoveCssClass("ag-apple-scrollbar", JL() || df());
  }
  initialiseInvisibleScrollbar() {
    this.invisibleScrollbar === void 0 && (this.invisibleScrollbar = qL(), this.invisibleScrollbar && (this.hideAndShowInvisibleScrollAsNeeded(), this.addActiveListenerToggles()));
  }
  addActiveListenerToggles() {
    const e = this.getGui(), t = () => this.addOrRemoveCssClass("ag-scrollbar-active", !0), r = () => this.addOrRemoveCssClass("ag-scrollbar-active", !1);
    this.addManagedListeners(e, {
      mouseenter: t,
      mousedown: t,
      touchstart: t,
      mouseleave: r,
      touchend: r
    });
  }
  onScrollVisibilityChanged() {
    this.invisibleScrollbar === void 0 && this.initialiseInvisibleScrollbar(), this.animationFrameService.requestAnimationFrame(() => this.setScrollVisible());
  }
  hideAndShowInvisibleScrollAsNeeded() {
    this.addManagedEventListeners({
      bodyScroll: (e) => {
        e.direction === this.direction && (this.hideTimeout !== null && (window.clearTimeout(this.hideTimeout), this.hideTimeout = null), this.addOrRemoveCssClass("ag-scrollbar-scrolling", !0));
      },
      bodyScrollEnd: () => {
        this.hideTimeout = window.setTimeout(() => {
          this.addOrRemoveCssClass("ag-scrollbar-scrolling", !1), this.hideTimeout = null;
        }, 400);
      }
    });
  }
  attemptSettingScrollPosition(e) {
    const t = this.getViewportElement();
    V_(
      () => lc(t),
      () => this.setScrollPosition(e),
      100
    );
  }
  getViewportElement() {
    return this.eViewport;
  }
  getContainer() {
    return this.eContainer;
  }
  onScrollCallback(e) {
    this.addManagedElementListeners(this.getViewportElement(), { scroll: e });
  }
}, AX = class extends _k {
  constructor() {
    super(
      /* html */
      `<div class="ag-body-horizontal-scroll" aria-hidden="true">
            <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div>
            <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport">
                <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div>
            </div>
            <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div>
        </div>`,
      "horizontal"
    ), this.eLeftSpacer = In, this.eRightSpacer = In;
  }
  wireBeans(e) {
    super.wireBeans(e), this.visibleColsService = e.visibleColsService, this.pinnedRowModel = e.pinnedRowModel, this.ctrlsService = e.ctrlsService, this.scrollVisibleService = e.scrollVisibleService;
  }
  postConstruct() {
    super.postConstruct();
    const e = this.setFakeHScrollSpacerWidths.bind(this);
    this.addManagedEventListeners({
      displayedColumnsChanged: e,
      displayedColumnsWidthChanged: e,
      pinnedRowDataChanged: this.onPinnedRowDataChanged.bind(this)
    }), this.addManagedPropertyListener("domLayout", e), this.ctrlsService.register("fakeHScrollComp", this), this.createManagedBean(new sR((t) => this.eContainer.style.width = `${t}px`)), this.addManagedPropertyListeners(["suppressHorizontalScroll"], this.onScrollVisibilityChanged.bind(this));
  }
  initialiseInvisibleScrollbar() {
    this.invisibleScrollbar === void 0 && (this.enableRtl = this.gos.get("enableRtl"), super.initialiseInvisibleScrollbar(), this.invisibleScrollbar && this.refreshCompBottom());
  }
  onPinnedRowDataChanged() {
    this.refreshCompBottom();
  }
  refreshCompBottom() {
    if (!this.invisibleScrollbar)
      return;
    const e = this.pinnedRowModel.getPinnedBottomTotalHeight();
    this.getGui().style.bottom = `${e}px`;
  }
  onScrollVisibilityChanged() {
    super.onScrollVisibilityChanged(), this.setFakeHScrollSpacerWidths();
  }
  setFakeHScrollSpacerWidths() {
    const e = this.scrollVisibleService.isVerticalScrollShowing();
    let t = this.visibleColsService.getDisplayedColumnsRightWidth();
    const r = !this.enableRtl && e, n = this.scrollVisibleService.getScrollbarWidth();
    r && (t += n), pu(this.eRightSpacer, t), this.eRightSpacer.classList.toggle("ag-scroller-corner", t <= n);
    let a = this.visibleColsService.getColsLeftWidth();
    this.enableRtl && e && (a += n), pu(this.eLeftSpacer, a), this.eLeftSpacer.classList.toggle("ag-scroller-corner", a <= n);
  }
  setScrollVisible() {
    const e = this.scrollVisibleService.isHorizontalScrollShowing(), t = this.invisibleScrollbar, r = this.gos.get("suppressHorizontalScroll"), n = e && this.scrollVisibleService.getScrollbarWidth() || 0, u = r ? 0 : n === 0 && t ? 16 : n;
    this.addOrRemoveCssClass("ag-scrollbar-invisible", t), Am(this.getGui(), u), Am(this.eViewport, u), Am(this.eContainer, u), this.setDisplayed(e, { skipAriaHidden: !0 });
  }
  getScrollPosition() {
    return y1(this.getViewportElement(), this.enableRtl);
  }
  setScrollPosition(e) {
    lc(this.getViewportElement()) || this.attemptSettingScrollPosition(e), C1(this.getViewportElement(), e, this.enableRtl);
  }
}, Uk = class extends mr {
  wireBeans(e) {
    this.maxDivHeightScaler = e.rowContainerHeightService;
  }
  constructor(e, t) {
    super(), this.eContainer = e, this.eViewport = t;
  }
  postConstruct() {
    this.addManagedEventListeners({ rowContainerHeightChanged: this.onHeightChanged.bind(this) });
  }
  onHeightChanged() {
    const e = this.maxDivHeightScaler.getUiContainerHeight(), t = e != null ? `${e}px` : "";
    this.eContainer.style.height = t, this.eViewport && (this.eViewport.style.height = t);
  }
}, EX = class extends _k {
  wireBeans(e) {
    super.wireBeans(e), this.ctrlsService = e.ctrlsService, this.scrollVisibleService = e.scrollVisibleService;
  }
  constructor() {
    super(
      /* html */
      `<div class="ag-body-vertical-scroll" aria-hidden="true">
            <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport">
                <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div>
            </div>
        </div>`,
      "vertical"
    );
  }
  postConstruct() {
    super.postConstruct(), this.createManagedBean(new Uk(this.eContainer)), this.ctrlsService.register("fakeVScrollComp", this), this.addManagedEventListeners({ rowContainerHeightChanged: this.onRowContainerHeightChanged.bind(this) });
  }
  setScrollVisible() {
    const e = this.scrollVisibleService.isVerticalScrollShowing(), t = this.invisibleScrollbar, r = e && this.scrollVisibleService.getScrollbarWidth() || 0, n = r === 0 && t ? 16 : r;
    this.addOrRemoveCssClass("ag-scrollbar-invisible", t), pu(this.getGui(), n), pu(this.eViewport, n), pu(this.eContainer, n), this.setDisplayed(e, { skipAriaHidden: !0 });
  }
  onRowContainerHeightChanged() {
    const { ctrlsService: e } = this, r = e.getGridBodyCtrl().getBodyViewportElement(), n = this.getScrollPosition(), a = r.scrollTop;
    n != a && this.setScrollPosition(a, !0);
  }
  getScrollPosition() {
    return this.getViewportElement().scrollTop;
  }
  setScrollPosition(e, t) {
    !t && !lc(this.getViewportElement()) && this.attemptSettingScrollPosition(e), this.getViewportElement().scrollTop = e;
  }
}, ST = /* @__PURE__ */ ((e) => (e.FakeHScrollbar = "fakeHScrollComp", e.Header = "centerHeader", e.PinnedTop = "topCenter", e.PinnedBottom = "bottomCenter", e.StickyTop = "stickyTopCenter", e.StickyBottom = "stickyBottomCenter", e))(ST || {}), MX = class extends mr {
  constructor(e) {
    super(), this.lastScrollSource = [null, null], this.scrollLeft = -1, this.nextScrollTop = -1, this.scrollTop = -1, this.lastOffsetHeight = -1, this.lastScrollTop = -1, this.eBodyViewport = e, this.resetLastHScrollDebounced = Cs(
      () => this.lastScrollSource[
        1
        /* Horizontal */
      ] = null,
      500
    ), this.resetLastVScrollDebounced = Cs(() => this.lastScrollSource[
      0
      /* Vertical */
    ] = null, 500);
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.animationFrameService = e.animationFrameService, this.paginationService = e.paginationService, this.pageBoundsService = e.pageBoundsService, this.rowModel = e.rowModel, this.heightScaler = e.rowContainerHeightService, this.rowRenderer = e.rowRenderer, this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService;
  }
  postConstruct() {
    this.enableRtl = this.gos.get("enableRtl"), this.addManagedEventListeners({
      displayedColumnsWidthChanged: this.onDisplayedColumnsWidthChanged.bind(this)
    }), this.ctrlsService.whenReady(this, (e) => {
      this.centerRowsCtrl = e.center, this.onDisplayedColumnsWidthChanged(), this.addScrollListener();
    });
  }
  addScrollListener() {
    this.addHorizontalScrollListeners(), this.addVerticalScrollListeners();
  }
  addHorizontalScrollListeners() {
    this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(), {
      scroll: this.onHScroll.bind(
        this,
        "Viewport"
        /* Viewport */
      )
    });
    for (const e of Object.values(ST)) {
      const t = this.ctrlsService.get(e);
      this.registerScrollPartner(t, this.onHScroll.bind(this, e));
    }
  }
  addVerticalScrollListeners() {
    const e = this.ctrlsService.get("fakeVScrollComp"), t = this.gos.get("debounceVerticalScrollbar"), r = t ? Cs(this.onVScroll.bind(
      this,
      "Viewport"
      /* Viewport */
    ), 100) : this.onVScroll.bind(
      this,
      "Viewport"
      /* Viewport */
    ), n = t ? Cs(this.onVScroll.bind(
      this,
      "fakeVScrollComp"
      /* FakeVScrollbar */
    ), 100) : this.onVScroll.bind(
      this,
      "fakeVScrollComp"
      /* FakeVScrollbar */
    );
    this.addManagedElementListeners(this.eBodyViewport, { scroll: r }), this.registerScrollPartner(e, n);
  }
  registerScrollPartner(e, t) {
    e.onScrollCallback(t);
  }
  onDisplayedColumnsWidthChanged() {
    this.enableRtl && this.horizontallyScrollHeaderCenterAndFloatingCenter();
  }
  horizontallyScrollHeaderCenterAndFloatingCenter(e) {
    this.centerRowsCtrl != null && (e === void 0 && (e = this.centerRowsCtrl.getCenterViewportScrollLeft()), this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)));
  }
  setScrollLeftForAllContainersExceptCurrent(e) {
    for (const t of [
      ...Object.values(ST),
      "Viewport"
      /* Viewport */
    ]) {
      if (this.lastScrollSource[
        1
        /* Horizontal */
      ] === t)
        continue;
      const r = this.getViewportForSource(t);
      C1(r, e, this.enableRtl);
    }
  }
  getViewportForSource(e) {
    return e === "Viewport" ? this.centerRowsCtrl.getViewportElement() : this.ctrlsService.get(e).getViewportElement();
  }
  isControllingScroll(e, t) {
    return this.lastScrollSource[t] == null ? (t === 0 ? this.lastScrollSource[0] = e : this.lastScrollSource[1] = e, !0) : this.lastScrollSource[t] === e;
  }
  onHScroll(e) {
    if (!this.isControllingScroll(
      e,
      1
      /* Horizontal */
    ))
      return;
    const t = this.centerRowsCtrl.getViewportElement(), { scrollLeft: r } = t;
    if (this.shouldBlockScrollUpdate(1, r, !0))
      return;
    const n = y1(this.getViewportForSource(e), this.enableRtl);
    this.doHorizontalScroll(Math.round(n)), this.resetLastHScrollDebounced();
  }
  onVScroll(e) {
    if (!this.isControllingScroll(
      e,
      0
      /* Vertical */
    ))
      return;
    let t;
    e === "Viewport" ? t = this.eBodyViewport.scrollTop : t = this.ctrlsService.get("fakeVScrollComp").getScrollPosition(), !this.shouldBlockScrollUpdate(0, t, !0) && (this.animationFrameService.setScrollTop(t), this.nextScrollTop = t, e === "Viewport" ? this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t) : this.eBodyViewport.scrollTop = t, this.gos.get("suppressAnimationFrame") ? this.scrollGridIfNeeded() : this.animationFrameService.schedule(), this.resetLastVScrollDebounced());
  }
  doHorizontalScroll(e) {
    const t = this.ctrlsService.get("fakeHScrollComp").getScrollPosition();
    this.scrollLeft === e && e === t || (this.scrollLeft = e, this.fireScrollEvent(
      1
      /* Horizontal */
    ), this.horizontallyScrollHeaderCenterAndFloatingCenter(e), this.centerRowsCtrl.onHorizontalViewportChanged(!0));
  }
  fireScrollEvent(e) {
    const t = {
      type: "bodyScroll",
      direction: e === 1 ? "horizontal" : "vertical",
      left: this.scrollLeft,
      top: this.scrollTop
    };
    this.eventService.dispatchEvent(t), window.clearTimeout(this.scrollTimer), this.scrollTimer = void 0, this.scrollTimer = window.setTimeout(() => {
      this.eventService.dispatchEvent({
        ...t,
        type: "bodyScrollEnd"
      });
    }, 100);
  }
  shouldBlockScrollUpdate(e, t, r = !1) {
    return r && !df() ? !1 : e === 0 ? this.shouldBlockVerticalScroll(t) : this.shouldBlockHorizontalScroll(t);
  }
  shouldBlockVerticalScroll(e) {
    const t = j2(this.eBodyViewport), { scrollHeight: r } = this.eBodyViewport;
    return e < 0 || e + t > r;
  }
  shouldBlockHorizontalScroll(e) {
    const t = this.centerRowsCtrl.getCenterWidth(), { scrollWidth: r } = this.centerRowsCtrl.getViewportElement();
    if (this.enableRtl && m1()) {
      if (e > 0)
        return !0;
    } else if (e < 0)
      return !0;
    return Math.abs(e) + t > r;
  }
  redrawRowsAfterScroll() {
    this.fireScrollEvent(
      0
      /* Vertical */
    );
  }
  // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again.
  // (which happens with some implementations of tabbing). this can result in horizontal scroll getting
  // reset back to the left, however no scroll event is fired. so we need to get header to also scroll
  // back to the left to be kept in sync.
  // adding and removing the grid from the DOM both resets the scroll position and
  // triggers a resize event, so notify listeners if the scroll position has changed
  checkScrollLeft() {
    this.scrollLeft !== this.centerRowsCtrl.getCenterViewportScrollLeft() && this.onHScroll(
      "Viewport"
      /* Viewport */
    );
  }
  scrollGridIfNeeded() {
    const e = this.scrollTop != this.nextScrollTop;
    return e && (this.scrollTop = this.nextScrollTop, this.redrawRowsAfterScroll()), e;
  }
  // called by scrollHorizontally method and alignedGridsService
  setHorizontalScrollPosition(e, t = !1) {
    const n = this.centerRowsCtrl.getViewportElement().scrollWidth - this.centerRowsCtrl.getCenterWidth();
    !t && this.shouldBlockScrollUpdate(1, e) && (this.enableRtl && m1() ? e = e > 0 ? 0 : n : e = Math.min(Math.max(e, 0), n)), C1(this.centerRowsCtrl.getViewportElement(), Math.abs(e), this.enableRtl), this.doHorizontalScroll(e);
  }
  setVerticalScrollPosition(e) {
    this.eBodyViewport.scrollTop = e;
  }
  getVScrollPosition() {
    return this.lastScrollTop = this.eBodyViewport.scrollTop, this.lastOffsetHeight = this.eBodyViewport.offsetHeight, {
      top: this.lastScrollTop,
      bottom: this.lastScrollTop + this.lastOffsetHeight
    };
  }
  /** Get an approximate scroll position that returns the last real value read.
   * This is useful for avoiding repeated DOM reads that force the browser to recalculate styles.
   * This can have big performance improvements but may not be 100% accurate so only use if this is acceptable.
   */
  getApproximateVScollPosition() {
    return this.lastScrollTop >= 0 && this.lastOffsetHeight >= 0 ? {
      top: this.scrollTop,
      bottom: this.scrollTop + this.lastOffsetHeight
    } : this.getVScrollPosition();
  }
  getHScrollPosition() {
    return this.centerRowsCtrl.getHScrollPosition();
  }
  isHorizontalScrollShowing() {
    return this.centerRowsCtrl.isHorizontalScrollShowing();
  }
  // called by the headerRootComp and moveColumnController
  scrollHorizontally(e) {
    const t = this.centerRowsCtrl.getViewportElement().scrollLeft;
    return this.setHorizontalScrollPosition(t + e), this.centerRowsCtrl.getViewportElement().scrollLeft - t;
  }
  // gets called by rowRenderer when new data loaded, as it will want to scroll to the top
  scrollToTop() {
    this.eBodyViewport.scrollTop = 0;
  }
  // Valid values for position are bottom, middle and top
  ensureNodeVisible(e, t = null) {
    const r = this.rowModel.getRowCount();
    let n = -1;
    for (let a = 0; a < r; a++) {
      const u = this.rowModel.getRow(a);
      if (typeof e == "function") {
        if (u && e(u)) {
          n = a;
          break;
        }
      } else if (e === u || e === u.data) {
        n = a;
        break;
      }
    }
    n >= 0 && this.ensureIndexVisible(n, t);
  }
  // Valid values for position are bottom, middle and top
  // position should be {'top','middle','bottom', or undefined/null}.
  // if undefined/null, then the grid will to the minimal amount of scrolling,
  // eg if grid needs to scroll up, it scrolls until row is on top,
  //    if grid needs to scroll down, it scrolls until row is on bottom,
  //    if row is already in view, grid does not scroll
  ensureIndexVisible(e, t) {
    if (Ao(this.gos, "print"))
      return;
    const r = this.rowModel.getRowCount();
    if (typeof e != "number" || e < 0 || e >= r) {
      Fr("Invalid row index for ensureIndexVisible: " + e);
      return;
    }
    const a = this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel");
    this.getFrameworkOverrides().wrapIncoming(() => {
      var v;
      a || (v = this.paginationService) == null || v.goToPageWithIndex(e);
      const u = this.ctrlsService.getGridBodyCtrl(), s = u.getStickyTopHeight(), c = u.getStickyBottomHeight(), i = this.rowModel.getRow(e);
      let l;
      do {
        const f = i.rowTop, p = i.rowHeight, g = this.pageBoundsService.getPixelOffset(), y = i.rowTop - g, C = y + i.rowHeight, m = this.getVScrollPosition(), h = this.heightScaler.getDivStretchOffset(), w = m.top + h, S = m.bottom + h, E = S - w, x = this.heightScaler.getScrollPositionForPixel(y), T = this.heightScaler.getScrollPositionForPixel(C - E), F = Math.min((x + T) / 2, y), P = w + s > y, k = S - c < C;
        let I = null;
        t === "top" ? I = x : t === "bottom" ? I = T : t === "middle" ? I = F : P ? I = x - s : k && (I = T + c), I !== null && (this.setVerticalScrollPosition(I), this.rowRenderer.redraw({ afterScroll: !0 })), l = f !== i.rowTop || p !== i.rowHeight;
      } while (l);
      this.animationFrameService.flushAllFrames();
    });
  }
  ensureColumnVisible(e, t = "auto") {
    const r = this.columnModel.getCol(e);
    if (!r || r.isPinned() || !this.visibleColsService.isColDisplayed(r))
      return;
    const n = this.getPositionedHorizontalScroll(r, t);
    this.getFrameworkOverrides().wrapIncoming(() => {
      n !== null && this.centerRowsCtrl.setCenterViewportScrollLeft(n), this.centerRowsCtrl.onHorizontalViewportChanged(), this.animationFrameService.flushAllFrames();
    });
  }
  setScrollPosition(e, t) {
    this.getFrameworkOverrides().wrapIncoming(() => {
      this.centerRowsCtrl.setCenterViewportScrollLeft(t), this.setVerticalScrollPosition(e), this.rowRenderer.redraw({ afterScroll: !0 }), this.animationFrameService.flushAllFrames();
    });
  }
  getPositionedHorizontalScroll(e, t) {
    const { columnBeforeStart: r, columnAfterEnd: n } = this.isColumnOutsideViewport(e), a = this.centerRowsCtrl.getCenterWidth() < e.getActualWidth(), u = this.centerRowsCtrl.getCenterWidth(), s = this.enableRtl;
    let c = (s ? r : n) || a, i = s ? n : r;
    t !== "auto" && (c = t === "start", i = t === "end");
    const l = t === "middle";
    if (c || i || l) {
      const { colLeft: v, colMiddle: f, colRight: p } = this.getColumnBounds(e);
      return l ? f - u / 2 : c ? s ? p : v : s ? v - u : p - u;
    }
    return null;
  }
  isColumnOutsideViewport(e) {
    const { start: t, end: r } = this.getViewportBounds(), { colLeft: n, colRight: a } = this.getColumnBounds(e), u = this.enableRtl, s = u ? t > a : r < a, c = u ? r < n : t > n;
    return { columnBeforeStart: s, columnAfterEnd: c };
  }
  getColumnBounds(e) {
    const t = this.enableRtl, r = this.visibleColsService.getBodyContainerWidth(), n = e.getActualWidth(), a = e.getLeft(), u = t ? -1 : 1, s = t ? r - a : a, c = s + n * u, i = s + n / 2 * u;
    return { colLeft: s, colMiddle: i, colRight: c };
  }
  getViewportBounds() {
    const e = this.centerRowsCtrl.getCenterWidth(), t = this.centerRowsCtrl.getCenterViewportScrollLeft(), r = t, n = e + t;
    return { start: r, end: n, width: e };
  }
}, DX = class extends mr {
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.pinnedWidthService = e.pinnedWidthService, this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService, this.columnSizeService = e.columnSizeService, this.scrollVisibleService = e.scrollVisibleService, this.columnViewportService = e.columnViewportService;
  }
  constructor(e) {
    super(), this.centerContainerCtrl = e;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      this.gridBodyCtrl = e.gridBodyCtrl, this.listenForResize();
    }), this.addManagedEventListeners({ scrollbarWidthChanged: this.onScrollbarWidthChanged.bind(this) }), this.addManagedPropertyListeners(["alwaysShowHorizontalScroll", "alwaysShowVerticalScroll"], () => {
      this.checkViewportAndScrolls();
    });
  }
  listenForResize() {
    const e = () => this.onCenterViewportResized();
    this.centerContainerCtrl.registerViewportResizeListener(e), this.gridBodyCtrl.registerBodyViewportResizeListener(e);
  }
  onScrollbarWidthChanged() {
    this.checkViewportAndScrolls();
  }
  onCenterViewportResized() {
    if (this.scrollVisibleService.onCentreViewportResized(), this.centerContainerCtrl.isViewportInTheDOMTree()) {
      this.keepPinnedColumnsNarrowerThanViewport(), this.checkViewportAndScrolls();
      const e = this.centerContainerCtrl.getCenterWidth();
      e !== this.centerWidth && (this.centerWidth = e, this.columnSizeService.refreshFlexedColumns({
        viewportWidth: this.centerWidth,
        updateBodyWidths: !0,
        fireResizedEvent: !0
      }));
    } else
      this.bodyHeight = 0;
  }
  keepPinnedColumnsNarrowerThanViewport() {
    const e = this.gridBodyCtrl.getBodyViewportElement(), t = iy(e);
    if (t <= 50)
      return;
    let r = this.getPinnedColumnsOverflowingViewport(t - 50);
    const n = this.gos.getCallback("processUnpinnedColumns");
    r.length && (n && (r = n({
      columns: r,
      viewportWidth: t
    })), this.columnModel.setColsPinned(r, null, "viewportSizeFeature"));
  }
  getPinnedColumnsOverflowingViewport(e) {
    const t = this.pinnedWidthService.getPinnedRightWidth(), r = this.pinnedWidthService.getPinnedLeftWidth(), n = t + r;
    if (n < e)
      return [];
    const a = [...this.visibleColsService.getLeftCols()], u = [...this.visibleColsService.getRightCols()];
    let s = 0, c = 0;
    const i = 0, l = [];
    let v = n - i - e;
    for (; (c < a.length || s < u.length) && v > 0; ) {
      if (s < u.length) {
        const f = u[s++];
        v -= f.getActualWidth(), l.push(f);
      }
      if (c < a.length && v > 0) {
        const f = a[c++];
        v -= f.getActualWidth(), l.push(f);
      }
    }
    return l;
  }
  // gets called every time the viewport size changes. we use this to check visibility of scrollbars
  // in the grid panel, and also to check size and position of viewport for row and column virtualisation.
  checkViewportAndScrolls() {
    this.updateScrollVisibleService(), this.checkBodyHeight(), this.onHorizontalViewportChanged(), this.gridBodyCtrl.getScrollFeature().checkScrollLeft();
  }
  getBodyHeight() {
    return this.bodyHeight;
  }
  checkBodyHeight() {
    const e = this.gridBodyCtrl.getBodyViewportElement(), t = j2(e);
    this.bodyHeight !== t && (this.bodyHeight = t, this.eventService.dispatchEvent({
      type: "bodyHeightChanged"
    }));
  }
  updateScrollVisibleService() {
    this.updateScrollVisibleServiceImpl(), setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500);
  }
  updateScrollVisibleServiceImpl() {
    const e = {
      horizontalScrollShowing: this.isHorizontalScrollShowing(),
      verticalScrollShowing: this.gridBodyCtrl.isVerticalScrollShowing()
    };
    this.scrollVisibleService.setScrollsVisible(e);
  }
  isHorizontalScrollShowing() {
    return this.centerContainerCtrl.isHorizontalScrollShowing();
  }
  // this gets called whenever a change in the viewport, so we can inform column controller it has to work
  // out the virtual columns again. gets called from following locations:
  // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged
  onHorizontalViewportChanged() {
    const e = this.centerContainerCtrl.getCenterWidth(), t = this.centerContainerCtrl.getViewportScrollLeft();
    this.columnViewportService.setScrollPosition(e, t);
  }
}, FX = class extends mr {
  wireBeans(e) {
    this.dragService = e.dragService, this.rangeService = e.rangeService;
  }
  constructor(e) {
    super(), this.eContainer = e;
  }
  postConstruct() {
    if (!this.rangeService)
      return;
    this.params = {
      eElement: this.eContainer,
      onDragStart: this.rangeService.onDragStart.bind(this.rangeService),
      onDragStop: this.rangeService.onDragStop.bind(this.rangeService),
      onDragging: this.rangeService.onDragging.bind(this.rangeService)
    }, this.addManagedPropertyListeners(["enableRangeSelection", "cellSelection"], () => {
      nd(this.gos) ? this.enableFeature() : this.disableFeature();
    }), this.addDestroyFunc(() => this.disableFeature()), nd(this.gos) && this.enableFeature();
  }
  enableFeature() {
    this.dragService.addDragSource(this.params);
  }
  disableFeature() {
    this.dragService.removeDragSource(this.params);
  }
}, PX = class extends na {
  constructor() {
    super(
      /* html*/
      `
            <div class="ag-selection-checkbox" role="presentation">
                <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
            </div>`,
      [J2]
    ), this.eCheckbox = In;
  }
  postConstruct() {
    this.eCheckbox.setPassive(!0);
  }
  getCheckboxId() {
    return this.eCheckbox.getInputElement().id;
  }
  onDataChanged() {
    this.onSelectionChanged();
  }
  onSelectableChanged() {
    this.showOrHideSelect();
  }
  onSelectionChanged() {
    const e = this.localeService.getLocaleTextFunc(), t = this.rowNode.isSelected(), r = z2(e, t), [n, a] = this.rowNode.selectable ? ["ariaRowToggleSelection", "Press Space to toggle row selection"] : ["ariaRowSelectionDisabled", "Row Selection is disabled for this row"], u = e(n, a);
    this.eCheckbox.setValue(t, !0), this.eCheckbox.setInputAriaLabel(`${u} (${r})`);
  }
  onClicked(e, t, r) {
    return this.rowNode.setSelectedParams({
      newValue: e,
      rangeSelect: r.shiftKey,
      groupSelectsFiltered: t,
      event: r,
      source: "checkboxSelected"
    });
  }
  init(e) {
    if (this.rowNode = e.rowNode, this.column = e.column, this.overrides = e.overrides, this.onSelectionChanged(), this.addManagedListeners(this.eCheckbox.getInputElement(), {
      // we don't want double click on this icon to open a group
      dblclick: (n) => Ev(n),
      click: (n) => {
        Ev(n);
        const a = O2(this.gos) === "filteredDescendants", u = this.eCheckbox.getValue();
        this.shouldHandleIndeterminateState(u, a) ? this.onClicked(!0, a, n || {}) === 0 && this.onClicked(!1, a, n) : u ? this.onClicked(!1, a, n) : this.onClicked(!0, a, n || {});
      }
    }), this.addManagedListeners(this.rowNode, {
      rowSelected: this.onSelectionChanged.bind(this),
      dataChanged: this.onDataChanged.bind(this),
      selectableChanged: this.onSelectableChanged.bind(this)
    }), k2(this.gos) || typeof this.getIsVisible() == "function") {
      const n = this.showOrHideSelect.bind(this);
      this.addManagedEventListeners({ displayedColumnsChanged: n }), this.addManagedListeners(this.rowNode, {
        dataChanged: n,
        cellChanged: n
      }), this.showOrHideSelect();
    }
    this.eCheckbox.getInputElement().setAttribute("tabindex", "-1");
  }
  shouldHandleIndeterminateState(e, t) {
    return t && (this.eCheckbox.getPreviousValue() === void 0 || e === void 0) && da(this.gos);
  }
  showOrHideSelect() {
    var a, u, s;
    let e = this.rowNode.selectable;
    const t = this.getIsVisible();
    if (e)
      if (typeof t == "function") {
        const c = (a = this.overrides) == null ? void 0 : a.callbackParams;
        if (!this.column)
          e = t({ ...c, node: this.rowNode, data: this.rowNode.data });
        else {
          const i = this.column.createColumnFunctionCallbackParams(this.rowNode);
          e = t({ ...c, ...i });
        }
      } else
        e = t ?? !1;
    const r = this.gos.get("rowSelection");
    if (r && typeof r != "string" ? !j_(r) : (u = this.column) == null ? void 0 : u.getColDef().showDisabledCheckboxes) {
      this.eCheckbox.setDisabled(!e), this.setVisible(!0), this.setDisplayed(!0);
      return;
    }
    if ((s = this.overrides) != null && s.removeHidden) {
      this.setDisplayed(e);
      return;
    }
    this.setVisible(e);
  }
  getIsVisible() {
    var t, r;
    if (this.overrides)
      return this.overrides.isVisible;
    const e = this.gos.get("rowSelection");
    return e && typeof e != "string" ? Av(e) : (r = (t = this.column) == null ? void 0 : t.getColDef()) == null ? void 0 : r.checkboxSelection;
  }
}, IX = class extends na {
  constructor(e, t, r) {
    super(
      /* html */
      '<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'
    ), this.rowNode = e, this.column = t, this.eCell = r;
  }
  postConstruct() {
    this.getGui().appendChild($s("rowDrag", this.gos, null)), this.addGuiEventListener("mousedown", (t) => {
      t.stopPropagation();
    }), this.addDragSource(), this.checkVisibility();
  }
  addDragSource() {
    this.addGuiEventListener("dragstart", this.onDragStart.bind(this));
  }
  onDragStart(e) {
    const t = this.column.getColDef().dndSourceOnRowDrag;
    e.dataTransfer.setDragImage(this.eCell, 0, 0);
    const r = () => {
      try {
        const n = JSON.stringify(this.rowNode.data);
        e.dataTransfer.setData("application/json", n), e.dataTransfer.setData("text/plain", n);
      } catch {
      }
    };
    if (t) {
      const n = this.gos.addGridCommonParams({
        rowNode: this.rowNode,
        dragEvent: e
      });
      t(n);
    } else
      r();
  }
  checkVisibility() {
    const e = this.column.isDndSource(this.rowNode);
    this.setDisplayed(e);
  }
}, LX = class extends mr {
  constructor(e, t) {
    super(), this.staticClasses = [], this.cellCtrl = e, this.beans = t, this.column = e.getColumn(), this.rowNode = e.getRowNode();
  }
  setComp(e) {
    this.cellComp = e, this.applyUserStyles(), this.applyCellClassRules(), this.applyClassesFromColDef();
  }
  applyCellClassRules() {
    const e = this.column.getColDef(), { cellClassRules: t } = e, r = this.beans.gos.addGridCommonParams({
      value: this.cellCtrl.getValue(),
      data: this.rowNode.data,
      node: this.rowNode,
      colDef: e,
      column: this.column,
      rowIndex: this.rowNode.rowIndex
    });
    this.beans.stylingService.processClassRules(
      // if current was previous, skip
      t === this.cellClassRules ? void 0 : this.cellClassRules,
      t,
      r,
      (n) => this.cellComp.addOrRemoveCssClass(n, !0),
      (n) => this.cellComp.addOrRemoveCssClass(n, !1)
    ), this.cellClassRules = t;
  }
  applyUserStyles() {
    const e = this.column.getColDef();
    if (!e.cellStyle)
      return;
    let t;
    if (typeof e.cellStyle == "function") {
      const r = this.beans.gos.addGridCommonParams({
        column: this.column,
        value: this.cellCtrl.getValue(),
        colDef: e,
        data: this.rowNode.data,
        node: this.rowNode,
        rowIndex: this.rowNode.rowIndex
      }), n = e.cellStyle;
      t = n(r);
    } else
      t = e.cellStyle;
    t && this.cellComp.setUserStyles(t);
  }
  applyClassesFromColDef() {
    const e = this.column.getColDef(), t = this.beans.gos.addGridCommonParams({
      value: this.cellCtrl.getValue(),
      data: this.rowNode.data,
      node: this.rowNode,
      column: this.column,
      colDef: e,
      rowIndex: this.rowNode.rowIndex
    });
    this.staticClasses.length && this.staticClasses.forEach((r) => this.cellComp.addOrRemoveCssClass(r, !1)), this.staticClasses = this.beans.stylingService.getStaticCellClasses(e, t), this.staticClasses.length && this.staticClasses.forEach((r) => this.cellComp.addOrRemoveCssClass(r, !0));
  }
  // overriding to make public, as we don't dispose this bean via context
  destroy() {
    super.destroy();
  }
}, kX = class extends mr {
  constructor(e, t, r, n, a) {
    super(), this.cellCtrl = e, this.beans = t, this.rowNode = n, this.rowCtrl = a;
  }
  setComp(e) {
    this.eGui = e;
  }
  onKeyDown(e) {
    const t = e.key;
    switch (t) {
      case dr.ENTER:
        this.onEnterKeyDown(e);
        break;
      case dr.F2:
        this.onF2KeyDown(e);
        break;
      case dr.ESCAPE:
        this.onEscapeKeyDown(e);
        break;
      case dr.TAB:
        this.onTabKeyDown(e);
        break;
      case dr.BACKSPACE:
      case dr.DELETE:
        this.onBackspaceOrDeleteKeyDown(t, e);
        break;
      case dr.DOWN:
      case dr.UP:
      case dr.RIGHT:
      case dr.LEFT:
        this.onNavigationKeyDown(e, t);
        break;
    }
  }
  onNavigationKeyDown(e, t) {
    this.cellCtrl.isEditing() || (e.shiftKey && this.cellCtrl.isRangeSelectionEnabled() ? this.onShiftRangeSelect(e) : this.beans.navigationService.navigateToNextCell(e, t, this.cellCtrl.getCellPosition(), !0), e.preventDefault());
  }
  onShiftRangeSelect(e) {
    if (!this.beans.rangeService)
      return;
    const t = this.beans.rangeService.extendLatestRangeInDirection(e);
    t && this.beans.navigationService.ensureCellVisible(t);
  }
  onTabKeyDown(e) {
    this.beans.navigationService.onTabKeyDown(this.cellCtrl, e);
  }
  onBackspaceOrDeleteKeyDown(e, t) {
    const { cellCtrl: r, beans: n, rowNode: a } = this, { gos: u, rangeService: s, eventService: c } = n;
    if (!r.isEditing()) {
      if (c.dispatchEvent({ type: "keyShortcutChangedCellStart" }), gY(e, u.get("enableCellEditingOnBackspace"))) {
        if (s && nd(u))
          s.clearCellRangeCellValues({ dispatchWrapperEvents: !0, wrapperEventSource: "deleteKey" });
        else if (r.isCellEditable()) {
          const i = r.getColumn(), l = this.beans.valueService.getDeleteValue(i, a);
          a.setDataValue(i, l, "cellClear");
        }
      } else
        r.startRowOrCellEdit(e, t);
      c.dispatchEvent({ type: "keyShortcutChangedCellEnd" });
    }
  }
  onEnterKeyDown(e) {
    if (this.cellCtrl.isEditing() || this.rowCtrl.isEditing())
      this.cellCtrl.stopEditingAndFocus(!1, e.shiftKey);
    else if (this.beans.gos.get("enterNavigatesVertically")) {
      const t = e.shiftKey ? dr.UP : dr.DOWN;
      this.beans.navigationService.navigateToNextCell(null, t, this.cellCtrl.getCellPosition(), !1);
    } else
      this.cellCtrl.startRowOrCellEdit(dr.ENTER, e), this.cellCtrl.isEditing() && e.preventDefault();
  }
  onF2KeyDown(e) {
    this.cellCtrl.isEditing() || this.cellCtrl.startRowOrCellEdit(dr.F2, e);
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  onEscapeKeyDown(e) {
    this.cellCtrl.isEditing() && (this.cellCtrl.stopRowOrCellEdit(!0), this.cellCtrl.focusCell(!0));
  }
  processCharacter(e) {
    if (e.target !== this.eGui || this.cellCtrl.isEditing())
      return;
    const n = e.key;
    n === " " ? this.onSpaceKeyDown(e) : this.cellCtrl.startRowOrCellEdit(n, e) && e.preventDefault();
  }
  onSpaceKeyDown(e) {
    const { gos: t } = this.beans;
    if (!this.cellCtrl.isEditing() && u1(t)) {
      const r = this.rowNode.isSelected(), n = !r, a = O2(t) === "filteredDescendants", u = this.rowNode.setSelectedParams({
        newValue: n,
        rangeSelect: e.shiftKey,
        groupSelectsFiltered: a,
        event: e,
        source: "spaceKey"
      });
      r === void 0 && u === 0 && this.rowNode.setSelectedParams({
        newValue: !1,
        rangeSelect: e.shiftKey,
        groupSelectsFiltered: a,
        event: e,
        source: "spaceKey"
      });
    }
    e.preventDefault();
  }
  destroy() {
    super.destroy();
  }
}, OX = class extends mr {
  constructor(e, t, r) {
    super(), this.cellCtrl = e, this.beans = t, this.column = r;
  }
  onMouseEvent(e, t) {
    if (!Qc(t))
      switch (e) {
        case "click":
          this.onCellClicked(t);
          break;
        case "mousedown":
        case "touchstart":
          this.onMouseDown(t);
          break;
        case "dblclick":
          this.onCellDoubleClicked(t);
          break;
        case "mouseout":
          this.onMouseOut(t);
          break;
        case "mouseover":
          this.onMouseOver(t);
          break;
      }
  }
  onCellClicked(e) {
    if (this.isDoubleClickOnIPad()) {
      this.onCellDoubleClicked(e), e.preventDefault();
      return;
    }
    const { eventService: t, rangeService: r, gos: n } = this.beans, a = e.ctrlKey || e.metaKey;
    r && a && r.getCellRangeCount(this.cellCtrl.getCellPosition()) > 1 && r.intersectLastRange(!0);
    const u = this.cellCtrl.createEvent(e, "cellClicked");
    t.dispatchEvent(u);
    const s = this.column.getColDef();
    s.onCellClicked && window.setTimeout(() => {
      this.beans.frameworkOverrides.wrapOutgoing(() => {
        s.onCellClicked(u);
      });
    }, 0), (n.get("singleClickEdit") || s.singleClickEdit) && !n.get("suppressClickEdit") && !(e.shiftKey && (r == null ? void 0 : r.getCellRanges().length) != 0) && this.cellCtrl.startRowOrCellEdit();
  }
  // returns true if on iPad and this is second 'click' event in 200ms
  isDoubleClickOnIPad() {
    if (!df() || HL("dblclick"))
      return !1;
    const e = (/* @__PURE__ */ new Date()).getTime(), t = e - this.lastIPadMouseClickEvent < 200;
    return this.lastIPadMouseClickEvent = e, t;
  }
  onCellDoubleClicked(e) {
    const { column: t, beans: r, cellCtrl: n } = this, { eventService: a, frameworkOverrides: u, gos: s } = r, c = t.getColDef(), i = n.createEvent(e, "cellDoubleClicked");
    a.dispatchEvent(i), typeof c.onCellDoubleClicked == "function" && window.setTimeout(() => {
      u.wrapOutgoing(() => {
        c.onCellDoubleClicked(i);
      });
    }, 0), !s.get("singleClickEdit") && !s.get("suppressClickEdit") && n.startRowOrCellEdit(null, e);
  }
  onMouseDown(e) {
    const { ctrlKey: t, metaKey: r, shiftKey: n } = e, a = e.target, { cellCtrl: u, beans: s } = this, { eventService: c, rangeService: i, focusService: l, gos: v } = s;
    if (this.isRightClickInExistingRange(e))
      return;
    const f = i && i.getCellRanges().length != 0;
    if (!n || !f) {
      const g = v.get("enableCellTextSelection") && e.defaultPrevented, y = (sc() || g) && !u.isEditing() && !U2(a);
      u.focusCell(y);
    }
    if (n && f && !l.isCellFocused(u.getCellPosition())) {
      e.preventDefault();
      const p = l.getFocusedCell();
      if (p) {
        const { column: g, rowIndex: y, rowPinned: C } = p, m = s.rowRenderer.getRowByPosition({ rowIndex: y, rowPinned: C }), h = m == null ? void 0 : m.getCellCtrl(g);
        h != null && h.isEditing() && h.stopEditing(), l.setFocusedCell({
          column: g,
          rowIndex: y,
          rowPinned: C,
          forceBrowserFocus: !0,
          preventScrollOnBrowserFocus: !0
        });
      }
    }
    if (!this.containsWidget(a)) {
      if (i) {
        const p = this.cellCtrl.getCellPosition();
        if (n)
          i.extendLatestRangeToCell(p);
        else {
          const g = t || r;
          i.setRangeToCell(p, g);
        }
      }
      c.dispatchEvent(this.cellCtrl.createEvent(e, "cellMouseDown"));
    }
  }
  isRightClickInExistingRange(e) {
    const { rangeService: t } = this.beans;
    if (t) {
      const r = t.isCellInAnyRange(this.cellCtrl.getCellPosition()), n = e.button === 2 || e.ctrlKey && this.beans.gos.get("allowContextMenuWithControlKey");
      if (r && n)
        return !0;
    }
    return !1;
  }
  containsWidget(e) {
    return Cv(e, "ag-selection-checkbox", 3);
  }
  onMouseOut(e) {
    this.mouseStayingInsideCell(e) || (this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e, "cellMouseOut")), this.beans.columnHoverService.clearMouseOver());
  }
  onMouseOver(e) {
    this.mouseStayingInsideCell(e) || (this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e, "cellMouseOver")), this.beans.columnHoverService.setMouseOver([this.column]));
  }
  mouseStayingInsideCell(e) {
    if (!e.target || !e.relatedTarget)
      return !1;
    const t = this.cellCtrl.getGui(), r = t.contains(e.target), n = t.contains(e.relatedTarget);
    return r && n;
  }
  destroy() {
    super.destroy();
  }
}, NX = class extends mr {
  constructor(e, t) {
    super(), this.cellCtrl = e, this.beans = t, this.column = e.getColumn(), this.rowNode = e.getRowNode();
  }
  setupRowSpan() {
    this.rowSpan = this.column.getRowSpan(this.rowNode), this.addManagedListeners(this.beans.eventService, { newColumnsLoaded: () => this.onNewColumnsLoaded() });
  }
  setComp(e) {
    this.eGui = e, this.setupColSpan(), this.setupRowSpan(), this.onLeftChanged(), this.onWidthChanged(), this.applyRowSpan();
  }
  onNewColumnsLoaded() {
    const e = this.column.getRowSpan(this.rowNode);
    this.rowSpan !== e && (this.rowSpan = e, this.applyRowSpan(!0));
  }
  onDisplayColumnsChanged() {
    const e = this.getColSpanningList();
    cf(this.colsSpanning, e) || (this.colsSpanning = e, this.onWidthChanged(), this.onLeftChanged());
  }
  setupColSpan() {
    this.column.getColDef().colSpan != null && (this.colsSpanning = this.getColSpanningList(), this.addManagedListeners(this.beans.eventService, {
      // because we are col spanning, a reorder of the cols can change what cols we are spanning over
      displayedColumnsChanged: this.onDisplayColumnsChanged.bind(this),
      // because we are spanning over multiple cols, we check for width any time any cols width changes.
      // this is expensive - really we should be explicitly checking only the cols we are spanning over
      // instead of every col, however it would be tricky code to track the cols we are spanning over, so
      // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code.
      displayedColumnsWidthChanged: this.onWidthChanged.bind(this)
    }));
  }
  onWidthChanged() {
    if (!this.eGui)
      return;
    const e = this.getCellWidth();
    this.eGui.style.width = `${e}px`;
  }
  getCellWidth() {
    return this.colsSpanning ? this.colsSpanning.reduce((e, t) => e + t.getActualWidth(), 0) : this.column.getActualWidth();
  }
  getColSpanningList() {
    const e = this.column.getColSpan(this.rowNode), t = [];
    if (e === 1)
      t.push(this.column);
    else {
      let r = this.column;
      const n = this.column.getPinned();
      for (let a = 0; r && a < e && (t.push(r), r = this.beans.visibleColsService.getColAfter(r), !(!r || mi(r) || n !== r.getPinned())); a++)
        ;
    }
    return t;
  }
  onLeftChanged() {
    if (!this.eGui)
      return;
    const e = this.modifyLeftForPrintLayout(this.getCellLeft());
    this.eGui.style.left = e + "px";
  }
  getCellLeft() {
    let e;
    return this.beans.gos.get("enableRtl") && this.colsSpanning ? e = di(this.colsSpanning) : e = this.column, e.getLeft();
  }
  modifyLeftForPrintLayout(e) {
    if (!this.cellCtrl.isPrintLayout() || this.column.getPinned() === "left")
      return e;
    const t = this.beans.visibleColsService.getColsLeftWidth();
    if (this.column.getPinned() === "right") {
      const r = this.beans.visibleColsService.getBodyContainerWidth();
      return t + r + (e || 0);
    }
    return t + (e || 0);
  }
  applyRowSpan(e) {
    if (this.rowSpan === 1 && !e)
      return;
    const r = _1(this.beans.gos) * this.rowSpan;
    this.eGui.style.height = `${r}px`, this.eGui.style.zIndex = "1";
  }
  // overriding to make public, as we don't dispose this bean via context
  destroy() {
    super.destroy();
  }
}, fm = "ag-cell-range-selected", GX = "ag-cell-range-chart", HX = "ag-cell-range-single-cell", BX = "ag-cell-range-chart-category", VX = "ag-cell-range-handle", zX = "ag-cell-range-top", WX = "ag-cell-range-right", _X = "ag-cell-range-bottom", UX = "ag-cell-range-left", jX = class {
  constructor(e, t) {
    this.beans = e, this.rangeService = e.rangeService, this.selectionHandleFactory = e.selectionHandleFactory, this.cellCtrl = t;
  }
  setComp(e, t) {
    this.cellComp = e, this.eGui = t, this.onCellSelectionChanged();
  }
  onCellSelectionChanged() {
    this.cellComp && (this.rangeCount = this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()), this.hasChartRange = this.getHasChartRange(), this.cellComp.addOrRemoveCssClass(fm, this.rangeCount !== 0), this.cellComp.addOrRemoveCssClass(`${fm}-1`, this.rangeCount === 1), this.cellComp.addOrRemoveCssClass(`${fm}-2`, this.rangeCount === 2), this.cellComp.addOrRemoveCssClass(`${fm}-3`, this.rangeCount === 3), this.cellComp.addOrRemoveCssClass(`${fm}-4`, this.rangeCount >= 4), this.cellComp.addOrRemoveCssClass(GX, this.hasChartRange), v1(this.eGui, this.rangeCount > 0 ? !0 : void 0), this.cellComp.addOrRemoveCssClass(HX, this.isSingleCell()), this.updateRangeBorders(), this.refreshHandle());
  }
  updateRangeBorders() {
    const e = this.getRangeBorders(), t = this.isSingleCell(), r = !t && e.top, n = !t && e.right, a = !t && e.bottom, u = !t && e.left;
    this.cellComp.addOrRemoveCssClass(zX, r), this.cellComp.addOrRemoveCssClass(WX, n), this.cellComp.addOrRemoveCssClass(_X, a), this.cellComp.addOrRemoveCssClass(UX, u);
  }
  isSingleCell() {
    const { rangeService: e } = this.beans;
    return this.rangeCount === 1 && !!e && !e.isMoreThanOneCell();
  }
  getHasChartRange() {
    const { rangeService: e } = this.beans;
    if (!this.rangeCount || !e)
      return !1;
    const t = e.getCellRanges();
    return t.length > 0 && t.every((r) => kh([
      1,
      0
      /* VALUE */
    ], r.type));
  }
  updateRangeBordersIfRangeCount() {
    this.rangeCount > 0 && (this.updateRangeBorders(), this.refreshHandle());
  }
  getRangeBorders() {
    const e = this.beans.gos.get("enableRtl");
    let t = !1, r = !1, n = !1, a = !1;
    const u = this.cellCtrl.getCellPosition().column, s = this.beans.visibleColsService;
    let c, i;
    e ? (c = s.getColAfter(u), i = s.getColBefore(u)) : (c = s.getColBefore(u), i = s.getColAfter(u));
    const l = this.rangeService.getCellRanges().filter((v) => this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(), v));
    c || (a = !0), i || (r = !0);
    for (let v = 0; v < l.length && !(t && r && n && a); v++) {
      const f = l[v], p = this.rangeService.getRangeStartRow(f), g = this.rangeService.getRangeEndRow(f);
      !t && this.beans.rowPositionUtils.sameRow(p, this.cellCtrl.getCellPosition()) && (t = !0), !n && this.beans.rowPositionUtils.sameRow(g, this.cellCtrl.getCellPosition()) && (n = !0), !a && c && f.columns.indexOf(c) < 0 && (a = !0), !r && i && f.columns.indexOf(i) < 0 && (r = !0);
    }
    return { top: t, right: r, bottom: n, left: a };
  }
  refreshHandle() {
    if (this.beans.context.isDestroyed())
      return;
    const e = this.shouldHaveSelectionHandle();
    this.selectionHandle && !e && (this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle)), e && this.addSelectionHandle(), this.cellComp.addOrRemoveCssClass(VX, !!this.selectionHandle);
  }
  shouldHaveSelectionHandle() {
    const e = this.beans.gos, t = this.rangeService.getCellRanges(), r = t.length;
    if (this.rangeCount < 1 || r < 1)
      return !1;
    const n = di(t), a = this.cellCtrl.getCellPosition(), u = K3(e) && !this.cellCtrl.isSuppressFillHandle(), s = Z_(e);
    let c = r === 1 && !this.cellCtrl.isEditing() && (u || s);
    if (this.hasChartRange) {
      const l = t[0].type === 1 && this.rangeService.isCellInSpecificRange(a, t[0]);
      this.cellComp.addOrRemoveCssClass(BX, l), c = n.type === 0;
    }
    return c && n.endRow != null && this.rangeService.isContiguousRange(n) && this.rangeService.isBottomRightCell(n, a);
  }
  addSelectionHandle() {
    const e = di(this.rangeService.getCellRanges()).type, r = K3(this.beans.gos) && mi(e) ? 0 : 1;
    this.selectionHandle && this.selectionHandle.getType() !== r && (this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle)), this.selectionHandle || (this.selectionHandle = this.selectionHandleFactory.createSelectionHandle(r)), this.selectionHandle.refresh(this.cellCtrl);
  }
  destroy() {
    this.beans.context.destroyBean(this.selectionHandle);
  }
}, YX = "ag-cell", XX = "ag-cell-auto-height", $X = "ag-cell-normal-height", ZX = "ag-cell-focus", KX = "ag-cell-first-right-pinned", JX = "ag-cell-last-left-pinned", QX = "ag-cell-not-inline-editing", qX = "ag-column-hover", e$ = "ag-cell-wrap-text", t$ = 0, jk = class xT extends mr {
  constructor(t, r, n, a) {
    super(), this.column = t, this.rowNode = r, this.beans = n, this.rowCtrl = a, this.cellRangeFeature = void 0, this.cellPositionFeature = void 0, this.cellCustomStyleFeature = void 0, this.tooltipFeature = void 0, this.cellMouseListenerFeature = void 0, this.cellKeyboardListenerFeature = void 0, this.suppressRefreshCell = !1, this.onCellCompAttachedFuncs = [], this.onCellEditorAttachedFuncs = [], this.instanceId = t.getId() + "-" + t$++, this.colIdSanitised = ac(this.column.getId()), this.createCellPosition(), this.updateAndFormatValue(!1);
  }
  shouldRestoreFocus() {
    return this.beans.focusService.shouldRestoreFocus(this.cellPosition);
  }
  onFocusOut() {
    this.beans.focusService.clearRestoreFocus();
  }
  addFeatures() {
    this.cellPositionFeature = new NX(this, this.beans), this.cellCustomStyleFeature = new LX(this, this.beans), this.cellMouseListenerFeature = new OX(this, this.beans, this.column), this.cellKeyboardListenerFeature = new kX(
      this,
      this.beans,
      this.column,
      this.rowNode,
      this.rowCtrl
    ), this.column.isTooltipEnabled() && this.enableTooltipFeature(), this.beans.rangeService && nd(this.beans.gos) && (this.cellRangeFeature = new jX(this.beans, this));
  }
  removeFeatures() {
    const t = this.beans.context;
    this.cellPositionFeature = t.destroyBean(this.cellPositionFeature), this.cellCustomStyleFeature = t.destroyBean(this.cellCustomStyleFeature), this.cellMouseListenerFeature = t.destroyBean(this.cellMouseListenerFeature), this.cellKeyboardListenerFeature = t.destroyBean(this.cellKeyboardListenerFeature), this.cellRangeFeature = t.destroyBean(this.cellRangeFeature), this.disableTooltipFeature();
  }
  enableTooltipFeature(t, r) {
    const n = () => {
      const s = this.column.getColDef(), c = this.rowNode.data;
      if (s.tooltipField && $r(c))
        return Rm(c, s.tooltipField, this.column.isTooltipFieldContainsDots());
      const i = s.tooltipValueGetter;
      return i ? i(
        this.beans.gos.addGridCommonParams({
          location: "cell",
          colDef: this.column.getColDef(),
          column: this.column,
          rowIndex: this.cellPosition.rowIndex,
          node: this.rowNode,
          data: this.rowNode.data,
          value: this.value,
          valueFormatted: this.valueFormatted
        })
      ) : null;
    }, a = this.beans.gos.get("tooltipShowMode") === "whenTruncated";
    !r && a && !this.isCellRenderer() && (r = () => {
      const s = this.getGui(), c = s.children.length === 0 ? s : s.querySelector(".ag-cell-value");
      return c ? c.scrollWidth > c.clientWidth : !0;
    });
    const u = {
      getColumn: () => this.column,
      getColDef: () => this.column.getColDef(),
      getRowIndex: () => this.cellPosition.rowIndex,
      getRowNode: () => this.rowNode,
      getGui: () => this.getGui(),
      getLocation: () => "cell",
      getTooltipValue: t != null ? () => t : n,
      // this makes no sense, why is the cell formatted value passed to the tooltip???
      getValueFormatted: () => this.valueFormatted,
      shouldDisplayTooltip: r
    };
    this.tooltipFeature = new Bv(u, this.beans);
  }
  disableTooltipFeature() {
    this.tooltipFeature = this.beans.context.destroyBean(this.tooltipFeature);
  }
  setComp(t, r, n, a, u, s) {
    var c, i, l, v;
    this.cellComp = t, this.eGui = r, this.printLayout = a, s ?? (s = this), this.addDomData(s), this.addFeatures(), s.addDestroyFunc(() => this.removeFeatures()), this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")), this.onCellFocused(this.focusEventToRestore), this.applyStaticCssClasses(), this.setWrapText(), this.onFirstRightPinnedChanged(), this.onLastLeftPinnedChanged(), this.onColumnHover(), this.setupControlComps(), this.setupAutoHeight(n, s), this.refreshFirstAndLastStyles(), this.refreshAriaColIndex(), (c = this.cellPositionFeature) == null || c.setComp(r), (i = this.cellCustomStyleFeature) == null || i.setComp(t), (l = this.tooltipFeature) == null || l.refreshToolTip(), (v = this.cellKeyboardListenerFeature) == null || v.setComp(this.eGui), this.cellRangeFeature && this.cellRangeFeature.setComp(t, r), u && this.isCellEditable() ? this.startEditing() : this.showValue(), this.onCellCompAttachedFuncs.length && (this.onCellCompAttachedFuncs.forEach((f) => f()), this.onCellCompAttachedFuncs = []);
  }
  setupAutoHeight(t, r) {
    if (this.isAutoHeight = this.column.isAutoHeight(), !this.isAutoHeight || !t)
      return;
    const n = t.parentElement, a = af(this.beans.gos, this.rowNode).height, u = (i) => {
      if (this.editing || !this.isAlive() || !r.isAlive())
        return;
      const { paddingTop: l, paddingBottom: v, borderBottomWidth: f, borderTopWidth: p } = Xh(n), g = l + v + f + p, C = t.offsetHeight + g;
      if (i < 5) {
        const h = Va(this.beans.gos), w = !h || !h.contains(t), S = C == 0;
        if (w || S) {
          window.setTimeout(() => u(i + 1), 0);
          return;
        }
      }
      const m = Math.max(C, a);
      this.rowNode.setRowAutoHeight(m, this.column);
    }, s = () => u(0);
    s();
    const c = this.beans.resizeObserverService.observeResize(t, s);
    r.addDestroyFunc(() => {
      c(), this.rowNode.setRowAutoHeight(void 0, this.column);
    });
  }
  getCellAriaRole() {
    return this.column.getColDef().cellAriaRole ?? "gridcell";
  }
  isCellRenderer() {
    const t = this.column.getColDef();
    return t.cellRenderer != null || t.cellRendererSelector != null;
  }
  getValueToDisplay() {
    return this.valueFormatted ?? this.value;
  }
  showValue(t = !1) {
    var u, s;
    const r = this.getValueToDisplay();
    let n;
    if (this.rowNode.stub && ((u = this.rowNode.groupData) == null ? void 0 : u[this.column.getId()]) == null) {
      const c = this.createCellRendererParams();
      n = this.beans.userComponentFactory.getLoadingCellRendererDetails(
        this.column.getColDef(),
        c
      );
    } else if (this.isCellRenderer()) {
      const c = this.createCellRendererParams();
      n = this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(), c);
    }
    this.cellComp.setRenderDetails(n, r, t), (s = this.cellRangeFeature) == null || s.refreshHandle();
  }
  setupControlComps() {
    const t = this.column.getColDef();
    this.includeSelection = this.isIncludeControl(this.isCheckboxSelection(t)), this.includeRowDrag = this.isIncludeControl(t.rowDrag), this.includeDndSource = this.isIncludeControl(t.dndSource), this.cellComp.setIncludeSelection(this.includeSelection), this.cellComp.setIncludeDndSource(this.includeDndSource), this.cellComp.setIncludeRowDrag(this.includeRowDrag);
  }
  isForceWrapper() {
    return this.beans.gos.get("enableCellTextSelection") || this.column.isAutoHeight();
  }
  // eslint-disable-next-line @typescript-eslint/ban-types
  isIncludeControl(t) {
    return this.rowNode.rowPinned != null ? !1 : typeof t == "function" || t === !0;
  }
  isCheckboxSelection(t) {
    const { rowSelection: r } = this.beans.gridOptions;
    return t.checkboxSelection || Mv(this.column) && r && typeof r != "string" && Av(r);
  }
  refreshShouldDestroy() {
    const t = this.column.getColDef(), r = this.includeSelection != this.isIncludeControl(this.isCheckboxSelection(t)), n = this.includeRowDrag != this.isIncludeControl(t.rowDrag), a = this.includeDndSource != this.isIncludeControl(t.dndSource), u = this.isAutoHeight != this.column.isAutoHeight();
    return r || n || a || u;
  }
  // either called internally if single cell editing, or called by rowRenderer if row editing
  startEditing(t = null, r = !1, n = null) {
    const { editService: a } = this.beans;
    return !this.isCellEditable() || this.editing || !a ? !0 : this.cellComp ? a.startEditing(this, t, r, n) : (this.onCellCompAttachedFuncs.push(() => {
      this.startEditing(t, r, n);
    }), !0);
  }
  setEditing(t, r) {
    var n;
    this.editCompDetails = r, this.editing !== t && (this.editing = t, (n = this.cellRangeFeature) == null || n.refreshHandle());
  }
  // pass in 'true' to cancel the editing.
  stopRowOrCellEdit(t = !1) {
    this.beans.gos.get("editType") === "fullRow" ? this.rowCtrl.stopEditing(t) : this.stopEditing(t);
  }
  onPopupEditorClosed() {
    this.editing && this.stopEditingAndFocus();
  }
  /**
   * Ends the Cell Editing
   * @param cancel `True` if the edit process is being canceled.
   * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`.
   */
  stopEditing(t = !1) {
    this.onCellEditorAttachedFuncs = [];
    const { editService: r } = this.beans;
    return !this.editing || !r ? !1 : r.stopEditing(this, t);
  }
  createCellRendererParams() {
    return this.beans.gos.addGridCommonParams({
      value: this.value,
      valueFormatted: this.valueFormatted,
      getValue: () => this.beans.valueService.getValueForDisplay(this.column, this.rowNode),
      setValue: (r) => this.beans.valueService.setValue(this.rowNode, this.column, r),
      formatValue: this.formatValue.bind(this),
      data: this.rowNode.data,
      node: this.rowNode,
      pinned: this.column.getPinned(),
      colDef: this.column.getColDef(),
      column: this.column,
      refreshCell: this.refreshCell.bind(this),
      eGridCell: this.getGui(),
      eParentOfValue: this.cellComp.getParentOfValue(),
      registerRowDragger: (r, n, a, u) => this.registerRowDragger(r, n, u),
      setTooltip: (r, n) => {
        var a;
        this.tooltipFeature && this.disableTooltipFeature(), this.enableTooltipFeature(r, n), (a = this.tooltipFeature) == null || a.refreshToolTip();
      }
    });
  }
  setFocusOutOnEditor() {
    var t;
    this.editing && ((t = this.beans.editService) == null || t.setFocusOutOnEditor(this));
  }
  setFocusInOnEditor() {
    var t;
    this.editing && ((t = this.beans.editService) == null || t.setFocusInOnEditor(this));
  }
  onCellChanged(t) {
    t.column === this.column && this.refreshCell({});
  }
  refreshOrDestroyCell(t) {
    var r;
    this.refreshShouldDestroy() ? (r = this.rowCtrl) == null || r.recreateCell(this) : this.refreshCell(t);
  }
  // + stop editing {forceRefresh: true, suppressFlash: true}
  // + event cellChanged {}
  // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything
  // + rowCtrl: event dataChanged {suppressFlash: !update, newData: !update}
  // + rowCtrl: api refreshCells() {animate: true/false}
  // + rowRenderer: api softRefreshView() {}
  refreshCell(t) {
    var v, f, p, g, y;
    if (this.suppressRefreshCell || this.editing)
      return;
    const r = this.column.getColDef(), n = t != null && !!t.newData, a = t != null && !!t.suppressFlash || !!r.suppressCellFlash, u = r.field == null && r.valueGetter == null && r.showRowGroup == null, s = t && t.forceRefresh || u || n, c = !!this.cellComp, i = this.updateAndFormatValue(c), l = s || i;
    if (c) {
      if (l) {
        this.showValue(n);
        const C = (v = this.beans.filterManager) == null ? void 0 : v.isSuppressFlashingCellsBecauseFiltering();
        !a && !C && (this.beans.gos.get("enableCellChangeFlash") || r.enableCellChangeFlash) && this.flashCell(), (f = this.cellCustomStyleFeature) == null || f.applyUserStyles(), (p = this.cellCustomStyleFeature) == null || p.applyClassesFromColDef();
      }
      (g = this.tooltipFeature) == null || g.refreshToolTip(), (y = this.cellCustomStyleFeature) == null || y.applyCellClassRules();
    }
  }
  // cell editors call this, when they want to stop for reasons other
  // than what we pick up on. eg selecting from a dropdown ends editing.
  stopEditingAndFocus(t = !1, r = !1) {
    var n;
    (n = this.beans.editService) == null || n.stopEditingAndFocus(this, t, r);
  }
  // user can also call this via API
  flashCell(t) {
    const r = (t == null ? void 0 : t.flashDuration) ?? (t == null ? void 0 : t.flashDelay), n = (t == null ? void 0 : t.fadeDuration) ?? (t == null ? void 0 : t.fadeDelay);
    this.animateCell("data-changed", r, n);
  }
  animateCell(t, r, n) {
    if (!this.cellComp)
      return;
    const { gos: a } = this.beans;
    if (r || (r = a.get("cellFlashDuration")), r === 0)
      return;
    $r(n) || (n = a.get("cellFadeDuration"));
    const u = `ag-cell-${t}`, s = `ag-cell-${t}-animation`;
    this.cellComp.addOrRemoveCssClass(u, !0), this.cellComp.addOrRemoveCssClass(s, !1), this.beans.frameworkOverrides.wrapIncoming(() => {
      window.setTimeout(() => {
        this.isAlive() && (this.cellComp.addOrRemoveCssClass(u, !1), this.cellComp.addOrRemoveCssClass(s, !0), this.eGui.style.transition = `background-color ${n}ms`, window.setTimeout(() => {
          this.isAlive() && (this.cellComp.addOrRemoveCssClass(s, !1), this.eGui.style.transition = "");
        }, n));
      }, r);
    });
  }
  onFlashCells(t) {
    if (!this.cellComp)
      return;
    const r = this.beans.cellPositionUtils.createId(this.getCellPosition());
    t.cells[r] && this.animateCell("highlight");
  }
  isCellEditable() {
    return this.column.isCellEditable(this.rowNode);
  }
  isSuppressFillHandle() {
    return this.column.isSuppressFillHandle();
  }
  formatValue(t) {
    return this.callValueFormatter(t) ?? t;
  }
  callValueFormatter(t) {
    return this.beans.valueService.formatValue(this.column, this.rowNode, t);
  }
  updateAndFormatValue(t) {
    const r = this.value, n = this.valueFormatted;
    return this.value = this.beans.valueService.getValueForDisplay(this.column, this.rowNode), this.valueFormatted = this.callValueFormatter(this.value), t ? !this.valuesAreEqual(r, this.value) || this.valueFormatted != n : !0;
  }
  valuesAreEqual(t, r) {
    const n = this.column.getColDef();
    return n.equals ? n.equals(t, r) : t === r;
  }
  getComp() {
    return this.cellComp;
  }
  getValue() {
    return this.value;
  }
  addDomData(t) {
    const r = this.getGui();
    zh(this.beans.gos, r, xT.DOM_DATA_KEY_CELL_CTRL, this), t.addDestroyFunc(() => zh(this.beans.gos, r, xT.DOM_DATA_KEY_CELL_CTRL, null));
  }
  createEvent(t, r) {
    return this.beans.gos.addGridCommonParams({
      type: r,
      node: this.rowNode,
      data: this.rowNode.data,
      value: this.value,
      column: this.column,
      colDef: this.column.getColDef(),
      rowPinned: this.rowNode.rowPinned,
      event: t,
      rowIndex: this.rowNode.rowIndex
    });
  }
  processCharacter(t) {
    var r;
    (r = this.cellKeyboardListenerFeature) == null || r.processCharacter(t);
  }
  onKeyDown(t) {
    var r;
    (r = this.cellKeyboardListenerFeature) == null || r.onKeyDown(t);
  }
  onMouseEvent(t, r) {
    var n;
    (n = this.cellMouseListenerFeature) == null || n.onMouseEvent(t, r);
  }
  getGui() {
    return this.eGui;
  }
  getColSpanningList() {
    return this.cellPositionFeature.getColSpanningList();
  }
  onLeftChanged() {
    var t;
    this.cellComp && ((t = this.cellPositionFeature) == null || t.onLeftChanged());
  }
  onDisplayedColumnsChanged() {
    this.eGui && (this.refreshAriaColIndex(), this.refreshFirstAndLastStyles());
  }
  refreshFirstAndLastStyles() {
    const { cellComp: t, column: r, beans: n } = this;
    kk(t, r, n.visibleColsService);
  }
  refreshAriaColIndex() {
    const t = this.beans.visibleColsService.getAriaColIndex(this.column);
    ZL(this.getGui(), t);
  }
  isSuppressNavigable() {
    return this.column.isSuppressNavigable(this.rowNode);
  }
  onWidthChanged() {
    var t;
    return (t = this.cellPositionFeature) == null ? void 0 : t.onWidthChanged();
  }
  getColumn() {
    return this.column;
  }
  getRowNode() {
    return this.rowNode;
  }
  isPrintLayout() {
    return this.printLayout;
  }
  getCellPosition() {
    return this.cellPosition;
  }
  isEditing() {
    return this.editing;
  }
  // called by rowRenderer when user navigates via tab key
  startRowOrCellEdit(t, r = null) {
    return this.cellComp ? this.beans.gos.get("editType") === "fullRow" ? this.rowCtrl.startRowEditing(t, this) : this.startEditing(t, !0, r) : (this.onCellCompAttachedFuncs.push(() => {
      this.startRowOrCellEdit(t, r);
    }), !0);
  }
  getRowCtrl() {
    return this.rowCtrl;
  }
  getRowPosition() {
    return {
      rowIndex: this.cellPosition.rowIndex,
      rowPinned: this.cellPosition.rowPinned
    };
  }
  updateRangeBordersIfRangeCount() {
    this.cellComp && this.cellRangeFeature && this.cellRangeFeature.updateRangeBordersIfRangeCount();
  }
  onCellSelectionChanged() {
    this.cellComp && this.cellRangeFeature && this.cellRangeFeature.onCellSelectionChanged();
  }
  isRangeSelectionEnabled() {
    return this.cellRangeFeature != null;
  }
  focusCell(t = !1) {
    this.beans.focusService.setFocusedCell({
      rowIndex: this.getCellPosition().rowIndex,
      column: this.column,
      rowPinned: this.rowNode.rowPinned,
      forceBrowserFocus: t
    });
  }
  onRowIndexChanged() {
    this.createCellPosition(), this.onCellFocused(), this.cellRangeFeature && this.cellRangeFeature.onCellSelectionChanged();
  }
  onSuppressCellFocusChanged(t) {
    this.eGui && Vl(this.eGui, "tabindex", t ? void 0 : -1);
  }
  onFirstRightPinnedChanged() {
    if (!this.cellComp)
      return;
    const t = this.column.isFirstRightPinned();
    this.cellComp.addOrRemoveCssClass(KX, t);
  }
  onLastLeftPinnedChanged() {
    if (!this.cellComp)
      return;
    const t = this.column.isLastLeftPinned();
    this.cellComp.addOrRemoveCssClass(JX, t);
  }
  onCellFocused(t) {
    if (this.beans.focusService.isCellFocusSuppressed())
      return;
    const r = this.beans.focusService.isCellFocused(this.cellPosition);
    if (!this.cellComp) {
      r && (t != null && t.forceBrowserFocus) && (this.focusEventToRestore = t);
      return;
    }
    if (this.focusEventToRestore = void 0, this.cellComp.addOrRemoveCssClass(ZX, r), r && t && t.forceBrowserFocus) {
      let a = this.cellComp.getFocusableElement();
      if (this.editing) {
        const u = this.beans.focusService.findFocusableElements(a, null, !0);
        u.length && (a = u[0]);
      }
      a.focus({ preventScroll: !!t.preventScrollOnBrowserFocus });
    }
    const n = this.beans.gos.get("editType") === "fullRow";
    !r && !n && this.editing && this.stopRowOrCellEdit(), r && this.rowCtrl.announceDescription();
  }
  createCellPosition() {
    this.cellPosition = {
      rowIndex: this.rowNode.rowIndex,
      rowPinned: Jc(this.rowNode.rowPinned),
      column: this.column
    };
  }
  // CSS Classes that only get applied once, they never change
  applyStaticCssClasses() {
    this.cellComp.addOrRemoveCssClass(YX, !0), this.cellComp.addOrRemoveCssClass(QX, !0);
    const t = this.column.isAutoHeight() == !0;
    this.cellComp.addOrRemoveCssClass(XX, t), this.cellComp.addOrRemoveCssClass($X, !t);
  }
  onColumnHover() {
    if (!this.cellComp || !this.beans.gos.get("columnHoverHighlight"))
      return;
    const t = this.beans.columnHoverService.isHovered(this.column);
    this.cellComp.addOrRemoveCssClass(qX, t);
  }
  onColDefChanged() {
    var r;
    if (!this.cellComp)
      return;
    this.column.isTooltipEnabled() ? (this.disableTooltipFeature(), this.enableTooltipFeature()) : this.disableTooltipFeature(), this.setWrapText(), this.editing ? (r = this.beans.editService) == null || r.handleColDefChanged(this) : this.refreshOrDestroyCell({ forceRefresh: !0, suppressFlash: !0 });
  }
  setWrapText() {
    const t = this.column.getColDef().wrapText == !0;
    this.cellComp.addOrRemoveCssClass(e$, t);
  }
  dispatchCellContextMenuEvent(t) {
    const r = this.column.getColDef(), n = this.createEvent(t, "cellContextMenu");
    this.beans.eventService.dispatchEvent(n), r.onCellContextMenu && window.setTimeout(() => {
      this.beans.frameworkOverrides.wrapOutgoing(() => {
        r.onCellContextMenu(n);
      });
    }, 0);
  }
  getCellRenderer() {
    return this.cellComp ? this.cellComp.getCellRenderer() : null;
  }
  getCellEditor() {
    return this.cellComp ? this.cellComp.getCellEditor() : null;
  }
  destroy() {
    this.onCellCompAttachedFuncs = [], this.onCellEditorAttachedFuncs = [], super.destroy();
  }
  createSelectionCheckbox() {
    const t = new PX();
    return this.beans.context.createBean(t), t.init({ rowNode: this.rowNode, column: this.column }), t;
  }
  createDndSource() {
    const t = new IX(this.rowNode, this.column, this.eGui);
    return this.beans.context.createBean(t), t;
  }
  registerRowDragger(t, r, n) {
    if (this.customRowDragComp) {
      this.customRowDragComp.setDragElement(t, r);
      return;
    }
    const a = this.createRowDragComp(t, r, n);
    a && (this.customRowDragComp = a, this.addDestroyFunc(() => {
      this.beans.context.destroyBean(a), this.customRowDragComp = null;
    }));
  }
  createRowDragComp(t, r, n) {
    const a = this.beans.gos.get("pagination"), u = this.beans.gos.get("rowDragManaged"), s = da(this.beans.gos);
    if (u) {
      if (!s) {
        Fr("managed row dragging is only allowed in the Client Side Row Model");
        return;
      }
      if (a) {
        Fr("managed row dragging is not possible when doing pagination");
        return;
      }
    }
    const c = new mT(
      () => this.value,
      this.rowNode,
      this.column,
      t,
      r,
      n
    );
    return this.beans.context.createBean(c), c;
  }
  setSuppressRefreshCell(t) {
    this.suppressRefreshCell = t;
  }
  getEditCompDetails() {
    return this.editCompDetails;
  }
  onCellEditorAttached(t) {
    this.onCellEditorAttachedFuncs.push(t);
  }
  cellEditorAttached() {
    this.onCellEditorAttachedFuncs.forEach((t) => t()), this.onCellEditorAttachedFuncs = [];
  }
};
jk.DOM_DATA_KEY_CELL_CTRL = "cellCtrl";
var Nh = jk, r$ = 0, Yk = class TT extends mr {
  constructor(t, r, n, a, u) {
    var s;
    super(), this.allRowGuis = [], this.active = !0, this.centerCellCtrls = { list: [], map: {} }, this.leftCellCtrls = { list: [], map: {} }, this.rightCellCtrls = { list: [], map: {} }, this.slideInAnimation = {
      left: !1,
      center: !1,
      right: !1,
      fullWidth: !1
    }, this.fadeInAnimation = {
      left: !1,
      center: !1,
      right: !1,
      fullWidth: !1
    }, this.rowDragComps = [], this.lastMouseDownOnDragger = !1, this.emptyStyle = {}, this.updateColumnListsPending = !1, this.rowId = null, this.businessKeySanitised = null, this.beans = r, this.gos = r.gos, this.rowNode = t, this.paginationPage = ((s = r.paginationService) == null ? void 0 : s.getCurrentPage()) ?? 0, this.useAnimationFrameForCreate = a, this.printLayout = u, this.suppressRowTransform = this.gos.get("suppressRowTransform"), this.instanceId = t.id + "-" + r$++, this.rowId = ac(t.id), this.initRowBusinessKey(), this.rowFocused = r.focusService.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned), this.rowLevel = r.rowCssClassCalculator.calculateRowLevel(this.rowNode), this.setRowType(), this.setAnimateFlags(n), this.rowStyles = this.processStylesFromGridOptions(), this.addListeners();
  }
  initRowBusinessKey() {
    this.businessKeyForNodeFunc = this.gos.get("getBusinessKeyForNode"), this.updateRowBusinessKey();
  }
  updateRowBusinessKey() {
    if (typeof this.businessKeyForNodeFunc != "function")
      return;
    const t = this.businessKeyForNodeFunc(this.rowNode);
    this.businessKeySanitised = ac(t);
  }
  getRowId() {
    return this.rowId;
  }
  getRowStyles() {
    return this.rowStyles;
  }
  isSticky() {
    return this.rowNode.sticky;
  }
  updateGui(t, r) {
    t === "left" ? this.leftGui = r : t === "right" ? this.rightGui = r : t === "fullWidth" ? this.fullWidthGui = r : this.centerGui = r;
  }
  setComp(t, r, n, a) {
    a = ry(this, this.beans.context, a);
    const u = { rowComp: t, element: r, containerType: n, compBean: a };
    this.allRowGuis.push(u), this.updateGui(n, u), this.initialiseRowComp(u), this.rowType !== "FullWidthLoading" && !this.rowNode.rowPinned && this.beans.rowRenderer.dispatchFirstDataRenderedEvent();
  }
  unsetComp(t) {
    this.allRowGuis = this.allRowGuis.filter((r) => r.containerType !== t), this.updateGui(t, void 0);
  }
  isCacheable() {
    return this.rowType === "FullWidthDetail" && this.gos.get("keepDetailRows");
  }
  setCached(t) {
    const r = t ? "none" : "";
    this.allRowGuis.forEach((n) => n.element.style.display = r);
  }
  initialiseRowComp(t) {
    const r = this.gos;
    this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")), this.listenOnDomOrder(t), this.beans.columnModel.wasAutoRowHeightEverActive() && this.rowNode.checkAutoHeights(), this.onRowHeightChanged(t), this.updateRowIndexes(t), this.setFocusedClasses(t), this.setStylesFromGridOptions(!1, t), u1(r) && this.rowNode.selectable && this.onRowSelected(t), this.updateColumnLists(!this.useAnimationFrameForCreate);
    const n = t.rowComp;
    this.getInitialRowClasses(t.containerType).forEach((u) => n.addOrRemoveCssClass(u, !0)), this.executeSlideAndFadeAnimations(t), this.rowNode.group && p1(t.element, this.rowNode.expanded == !0), this.setRowCompRowId(n), this.setRowCompRowBusinessKey(n), zh(r, t.element, TT.DOM_DATA_KEY_ROW_CTRL, this), t.compBean.addDestroyFunc(() => zh(r, t.element, TT.DOM_DATA_KEY_ROW_CTRL, null)), this.useAnimationFrameForCreate ? this.beans.animationFrameService.createTask(
      this.addHoverFunctionality.bind(this, t),
      this.rowNode.rowIndex,
      "createTasksP2"
    ) : this.addHoverFunctionality(t), this.isFullWidth() && this.setupFullWidth(t), r.get("rowDragEntireRow") && this.addRowDraggerToRow(t), this.useAnimationFrameForCreate && this.beans.animationFrameService.addDestroyTask(() => {
      this.isAlive() && t.rowComp.addOrRemoveCssClass("ag-after-created", !0);
    }), this.executeProcessRowPostCreateFunc();
  }
  setRowCompRowBusinessKey(t) {
    this.businessKeySanitised != null && t.setRowBusinessKey(this.businessKeySanitised);
  }
  getBusinessKey() {
    return this.businessKeySanitised;
  }
  setRowCompRowId(t) {
    this.rowId = ac(this.rowNode.id), this.rowId != null && t.setRowId(this.rowId);
  }
  executeSlideAndFadeAnimations(t) {
    const { containerType: r } = t;
    this.slideInAnimation[r] && ($3(() => {
      this.onTopChanged();
    }), this.slideInAnimation[r] = !1), this.fadeInAnimation[r] && ($3(() => {
      t.rowComp.addOrRemoveCssClass("ag-opacity-zero", !1);
    }), this.fadeInAnimation[r] = !1);
  }
  addRowDraggerToRow(t) {
    if (nd(this.gos)) {
      Fr("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `cellSelection: true`");
      return;
    }
    const r = this.beans.localeService.getLocaleTextFunc(), n = new mT(
      () => `1 ${r("rowDragRow", "row")}`,
      this.rowNode,
      void 0,
      t.element,
      void 0,
      !0
    ), a = this.createBean(n, this.beans.context);
    this.rowDragComps.push(a), t.compBean.addDestroyFunc(() => {
      this.rowDragComps = this.rowDragComps.filter((u) => u !== a), this.destroyBean(a, this.beans.context);
    });
  }
  setupFullWidth(t) {
    const r = this.getPinnedForContainer(t.containerType);
    if (this.rowType == "FullWidthDetail" && !this.gos.assertModuleRegistered(
      "@ag-grid-enterprise/master-detail",
      "cell renderer 'agDetailCellRenderer' (for master detail)"
    ))
      return;
    const n = this.createFullWidthCompDetails(t.element, r);
    t.rowComp.showFullWidth(n);
  }
  isPrintLayout() {
    return this.printLayout;
  }
  getFullWidthCellRenderers() {
    var t, r;
    return this.gos.get("embedFullWidthRows") ? this.allRowGuis.map((n) => {
      var a;
      return (a = n == null ? void 0 : n.rowComp) == null ? void 0 : a.getFullWidthCellRenderer();
    }) : [(r = (t = this.fullWidthGui) == null ? void 0 : t.rowComp) == null ? void 0 : r.getFullWidthCellRenderer()];
  }
  // use by autoWidthCalculator, as it clones the elements
  getCellElement(t) {
    const r = this.getCellCtrl(t);
    return r ? r.getGui() : null;
  }
  executeProcessRowPostCreateFunc() {
    const t = this.gos.getCallback("processRowPostCreate");
    if (!t || !this.areAllContainersReady())
      return;
    const r = {
      // areAllContainersReady asserts that centerGui is not null
      eRow: this.centerGui.element,
      ePinnedLeftRow: this.leftGui ? this.leftGui.element : void 0,
      ePinnedRightRow: this.rightGui ? this.rightGui.element : void 0,
      node: this.rowNode,
      rowIndex: this.rowNode.rowIndex,
      addRenderedRowListener: this.addEventListener.bind(this)
    };
    t(r);
  }
  areAllContainersReady() {
    const t = !!this.leftGui || !this.beans.visibleColsService.isPinningLeft(), r = !!this.centerGui, n = !!this.rightGui || !this.beans.visibleColsService.isPinningRight();
    return t && r && n;
  }
  isNodeFullWidthCell() {
    if (this.rowNode.detail)
      return !0;
    const t = this.beans.gos.getCallback("isFullWidthRow");
    return t ? t({ rowNode: this.rowNode }) : !1;
  }
  setRowType() {
    const t = this.rowNode.stub && !this.gos.get("suppressServerSideFullWidthLoadingRow") && !this.gos.get("groupHideOpenParents"), r = this.isNodeFullWidthCell(), n = this.gos.get("masterDetail") && this.rowNode.detail, a = this.beans.columnModel.isPivotMode(), s = !!this.rowNode.group && !this.rowNode.footer && j1(this.gos, a);
    t ? this.rowType = "FullWidthLoading" : n ? this.rowType = "FullWidthDetail" : r ? this.rowType = "FullWidth" : s ? this.rowType = "FullWidthGroup" : this.rowType = "Normal";
  }
  updateColumnLists(t = !1, r = !1) {
    if (this.isFullWidth())
      return;
    if (t || this.gos.get("suppressAnimationFrame") || this.printLayout) {
      this.updateColumnListsImpl(r);
      return;
    }
    this.updateColumnListsPending || (this.beans.animationFrameService.createTask(
      () => {
        this.active && this.updateColumnListsImpl(!0);
      },
      this.rowNode.rowIndex,
      "createTasksP1"
    ), this.updateColumnListsPending = !0);
  }
  createCellCtrls(t, r, n = null) {
    const a = {
      list: [],
      map: {}
    }, u = (s, c) => {
      a.list.push(c), a.map[s] = c;
    };
    return r.forEach((s) => {
      const c = s.getInstanceId();
      let i = t.map[c];
      i || (i = new Nh(s, this.rowNode, this.beans, this)), u(c, i);
    }), t.list.forEach((s) => {
      const c = s.getColumn().getInstanceId();
      if (a.map[c] != null)
        return;
      if (!this.isCellEligibleToBeRemoved(s, n)) {
        u(c, s);
        return;
      }
      s.destroy();
    }), a;
  }
  updateColumnListsImpl(t) {
    this.updateColumnListsPending = !1, this.createAllCellCtrls(), this.setCellCtrls(t);
  }
  setCellCtrls(t) {
    this.allRowGuis.forEach((r) => {
      const n = this.getCellCtrlsForContainer(r.containerType);
      r.rowComp.setCellCtrls(n, t);
    });
  }
  getCellCtrlsForContainer(t) {
    switch (t) {
      case "left":
        return this.leftCellCtrls.list;
      case "right":
        return this.rightCellCtrls.list;
      case "fullWidth":
        return [];
      case "center":
        return this.centerCellCtrls.list;
    }
  }
  createAllCellCtrls() {
    const t = this.beans.columnViewportService, r = this.beans.visibleColsService;
    if (this.printLayout)
      this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, r.getAllCols()), this.leftCellCtrls = { list: [], map: {} }, this.rightCellCtrls = { list: [], map: {} };
    else {
      const n = t.getColsWithinViewport(this.rowNode);
      this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, n);
      const a = r.getLeftColsForRow(this.rowNode);
      this.leftCellCtrls = this.createCellCtrls(this.leftCellCtrls, a, "left");
      const u = r.getRightColsForRow(this.rowNode);
      this.rightCellCtrls = this.createCellCtrls(this.rightCellCtrls, u, "right");
    }
  }
  isCellEligibleToBeRemoved(t, r) {
    if (t.getColumn().getPinned() != r)
      return !0;
    const s = t.isEditing(), c = this.beans.focusService.isCellFocused(t.getCellPosition());
    if (s || c) {
      const l = t.getColumn();
      return !(this.beans.visibleColsService.getAllCols().indexOf(l) >= 0);
    }
    return !0;
  }
  getDomOrder() {
    return this.gos.get("ensureDomOrder") || Ao(this.gos, "print");
  }
  listenOnDomOrder(t) {
    const r = () => {
      t.rowComp.setDomOrder(this.getDomOrder());
    };
    t.compBean.addManagedPropertyListeners(["domLayout", "ensureDomOrder"], r);
  }
  setAnimateFlags(t) {
    if (this.isSticky() || !t)
      return;
    const r = $r(this.rowNode.oldRowTop), n = this.beans.visibleColsService.isPinningLeft(), a = this.beans.visibleColsService.isPinningRight();
    if (r) {
      if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) {
        this.slideInAnimation.fullWidth = !0;
        return;
      }
      this.slideInAnimation.center = !0, this.slideInAnimation.left = n, this.slideInAnimation.right = a;
    } else {
      if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) {
        this.fadeInAnimation.fullWidth = !0;
        return;
      }
      this.fadeInAnimation.center = !0, this.fadeInAnimation.left = n, this.fadeInAnimation.right = a;
    }
  }
  isEditing() {
    return this.editingRow;
  }
  isFullWidth() {
    return this.rowType !== "Normal";
  }
  refreshFullWidth() {
    const t = (c, i) => c ? c.rowComp.refreshFullWidth(() => this.createFullWidthCompDetails(c.element, i).params) : !0, r = t(this.fullWidthGui, null), n = t(this.centerGui, null), a = t(this.leftGui, "left"), u = t(this.rightGui, "right");
    return r && n && a && u;
  }
  addListeners() {
    this.addManagedListeners(this.rowNode, {
      heightChanged: () => this.onRowHeightChanged(),
      rowSelected: () => this.onRowSelected(),
      rowIndexChanged: this.onRowIndexChanged.bind(this),
      topChanged: this.onTopChanged.bind(this),
      expandedChanged: this.updateExpandedCss.bind(this),
      hasChildrenChanged: this.updateExpandedCss.bind(this)
    }), this.rowNode.detail && this.addManagedListeners(this.rowNode.parent, { dataChanged: this.onRowNodeDataChanged.bind(this) }), this.addManagedListeners(this.rowNode, {
      dataChanged: this.onRowNodeDataChanged.bind(this),
      cellChanged: this.postProcessCss.bind(this),
      rowHighlightChanged: this.onRowNodeHighlightChanged.bind(this),
      draggingChanged: this.postProcessRowDragging.bind(this),
      uiLevelChanged: this.onUiLevelChanged.bind(this)
    }), this.addManagedListeners(this.beans.eventService, {
      paginationPixelOffsetChanged: this.onPaginationPixelOffsetChanged.bind(this),
      heightScaleChanged: this.onTopChanged.bind(this),
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
      virtualColumnsChanged: this.onVirtualColumnsChanged.bind(this),
      cellFocused: this.onCellFocusChanged.bind(this),
      cellFocusCleared: this.onCellFocusChanged.bind(this),
      paginationChanged: this.onPaginationChanged.bind(this),
      modelUpdated: this.refreshFirstAndLastRowStyles.bind(this),
      columnMoved: () => this.updateColumnLists()
    }), this.addDestroyFunc(() => {
      this.rowDragComps = this.destroyBeans(this.rowDragComps, this.beans.context), this.tooltipFeature && (this.tooltipFeature = this.destroyBean(this.tooltipFeature, this.beans.context));
    }), this.addManagedPropertyListeners(["rowDragEntireRow"], () => {
      if (this.gos.get("rowDragEntireRow")) {
        this.allRowGuis.forEach((r) => {
          this.addRowDraggerToRow(r);
        });
        return;
      }
      this.rowDragComps = this.destroyBeans(this.rowDragComps, this.beans.context);
    }), this.addListenersForCellComps();
  }
  addListenersForCellComps() {
    this.addManagedListeners(this.rowNode, {
      rowIndexChanged: () => {
        this.getAllCellCtrls().forEach((t) => t.onRowIndexChanged());
      },
      cellChanged: (t) => {
        this.getAllCellCtrls().forEach((r) => r.onCellChanged(t));
      }
    });
  }
  onRowNodeDataChanged(t) {
    if (this.isFullWidth() !== !!this.isNodeFullWidthCell()) {
      this.beans.rowRenderer.redrawRow(this.rowNode);
      return;
    }
    if (this.isFullWidth()) {
      this.refreshFullWidth() || this.beans.rowRenderer.redrawRow(this.rowNode);
      return;
    }
    this.getAllCellCtrls().forEach(
      (n) => n.refreshCell({
        suppressFlash: !t.update,
        newData: !t.update
      })
    ), this.allRowGuis.forEach((n) => {
      this.setRowCompRowId(n.rowComp), this.updateRowBusinessKey(), this.setRowCompRowBusinessKey(n.rowComp);
    }), this.onRowSelected(), this.postProcessCss();
  }
  postProcessCss() {
    this.setStylesFromGridOptions(!0), this.postProcessClassesFromGridOptions(), this.postProcessRowClassRules(), this.postProcessRowDragging();
  }
  onRowNodeHighlightChanged() {
    const t = this.rowNode.highlighted;
    this.allRowGuis.forEach((r) => {
      const n = t === 0, a = t === 1;
      r.rowComp.addOrRemoveCssClass("ag-row-highlight-above", n), r.rowComp.addOrRemoveCssClass("ag-row-highlight-below", a);
    });
  }
  postProcessRowDragging() {
    const t = this.rowNode.dragging;
    this.allRowGuis.forEach((r) => r.rowComp.addOrRemoveCssClass("ag-row-dragging", t));
  }
  updateExpandedCss() {
    const t = this.rowNode.isExpandable(), r = this.rowNode.expanded == !0;
    this.allRowGuis.forEach((n) => {
      n.rowComp.addOrRemoveCssClass("ag-row-group", t), n.rowComp.addOrRemoveCssClass("ag-row-group-expanded", t && r), n.rowComp.addOrRemoveCssClass("ag-row-group-contracted", t && !r), p1(n.element, t && r);
    });
  }
  onDisplayedColumnsChanged() {
    this.updateColumnLists(!0), this.beans.columnModel.wasAutoRowHeightEverActive() && this.rowNode.checkAutoHeights();
  }
  onVirtualColumnsChanged() {
    this.updateColumnLists(!1, !0);
  }
  getRowPosition() {
    return {
      rowPinned: Jc(this.rowNode.rowPinned),
      rowIndex: this.rowNode.rowIndex
    };
  }
  findFullWidthRowGui(t) {
    return this.allRowGuis.find((r) => r.element.contains(t));
  }
  onKeyboardNavigate(t) {
    const r = this.findFullWidthRowGui(t.target);
    if (!((r ? r.element : null) === t.target))
      return;
    const u = this.rowNode, s = this.beans.focusService.getFocusedCell(), c = {
      rowIndex: u.rowIndex,
      rowPinned: u.rowPinned,
      column: (s == null ? void 0 : s.column) ?? this.getColumnForFullWidth(r)
    };
    this.beans.navigationService.navigateToNextCell(t, t.key, c, !0), t.preventDefault();
  }
  onTabKeyDown(t) {
    if (t.defaultPrevented || Qc(t))
      return;
    const r = this.allRowGuis.find(
      (i) => i.element.contains(t.target)
    ), n = r ? r.element : null, a = n === t.target, u = Sa(this.gos);
    let s = !1;
    n && u && (s = n.contains(u) && u.classList.contains("ag-cell"));
    let c = null;
    !a && !s && (c = this.beans.focusService.findNextFocusableElement(
      n,
      !1,
      t.shiftKey
    )), (this.isFullWidth() && a || !c) && this.beans.navigationService.onTabKeyDown(this, t);
  }
  getFullWidthElement() {
    return this.fullWidthGui ? this.fullWidthGui.element : null;
  }
  getRowYPosition() {
    var r;
    const t = (r = this.allRowGuis.find((n) => lc(n.element))) == null ? void 0 : r.element;
    return t ? t.getBoundingClientRect().top : 0;
  }
  onSuppressCellFocusChanged(t) {
    const r = this.isFullWidth() && t ? void 0 : -1;
    this.allRowGuis.forEach((n) => {
      Vl(n.element, "tabindex", r);
    });
  }
  onFullWidthRowFocused(t) {
    var u;
    const r = this.rowNode, n = t ? this.isFullWidth() && t.rowIndex === r.rowIndex && t.rowPinned == r.rowPinned : !1, a = this.fullWidthGui ? this.fullWidthGui.element : (u = this.centerGui) == null ? void 0 : u.element;
    a && (a.classList.toggle("ag-full-width-focus", n), n && (t != null && t.forceBrowserFocus) && a.focus({ preventScroll: !0 }));
  }
  recreateCell(t) {
    this.centerCellCtrls = this.removeCellCtrl(this.centerCellCtrls, t), this.leftCellCtrls = this.removeCellCtrl(this.leftCellCtrls, t), this.rightCellCtrls = this.removeCellCtrl(this.rightCellCtrls, t), t.destroy(), this.updateColumnLists();
  }
  removeCellCtrl(t, r) {
    const n = {
      list: [],
      map: {}
    };
    return t.list.forEach((a) => {
      a !== r && (n.list.push(a), n.map[a.getColumn().getInstanceId()] = a);
    }), n;
  }
  onMouseEvent(t, r) {
    switch (t) {
      case "dblclick":
        this.onRowDblClick(r);
        break;
      case "click":
        this.onRowClick(r);
        break;
      case "touchstart":
      case "mousedown":
        this.onRowMouseDown(r);
        break;
    }
  }
  createRowEvent(t, r) {
    return this.gos.addGridCommonParams({
      type: t,
      node: this.rowNode,
      data: this.rowNode.data,
      rowIndex: this.rowNode.rowIndex,
      rowPinned: this.rowNode.rowPinned,
      event: r
    });
  }
  createRowEventWithSource(t, r) {
    const n = this.createRowEvent(t, r);
    return n.source = this, n;
  }
  onRowDblClick(t) {
    Qc(t) || this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowDoubleClicked", t));
  }
  getColumnForFullWidth(t) {
    const { visibleColsService: r } = this.beans;
    switch (t == null ? void 0 : t.containerType) {
      case "center":
        return r.getCenterCols()[0];
      case "left":
        return r.getLeftCols()[0];
      case "right":
        return r.getRightCols()[0];
      default:
        return r.getAllCols()[0];
    }
  }
  onRowMouseDown(t) {
    if (this.lastMouseDownOnDragger = Cv(t.target, "ag-row-drag", 3), !this.isFullWidth())
      return;
    const r = this.rowNode;
    this.beans.rangeService && this.beans.rangeService.removeAllCellRanges();
    const n = this.findFullWidthRowGui(t.target), a = n == null ? void 0 : n.element, u = t.target;
    let s = !0;
    a && a.contains(u) && U2(u) && (s = !1), this.beans.focusService.setFocusedCell({
      rowIndex: r.rowIndex,
      column: this.getColumnForFullWidth(n),
      rowPinned: r.rowPinned,
      forceBrowserFocus: s
    });
  }
  onRowClick(t) {
    if (Qc(t) || this.lastMouseDownOnDragger)
      return;
    const { gos: n } = this;
    this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowClicked", t));
    const a = t.ctrlKey || t.metaKey, u = t.shiftKey, s = this.rowNode.isSelected();
    if (
      // we do not allow selecting groups by clicking (as the click here expands the group), or if it's a detail row,
      // so return if it's a group row
      Wh(n) && this.rowNode.group || this.isRowSelectionBlocked() || // if click selection disabled, do nothing
      !K_(n) && !s || // if click deselection disabled, do nothing
      !vx(n) && s
    )
      return;
    const i = J_(n), l = vx(n), v = "rowClicked";
    if (s)
      i ? this.rowNode.setSelectedParams({ newValue: !1, event: t, source: v }) : a ? l && this.rowNode.setSelectedParams({ newValue: !1, event: t, source: v }) : this.rowNode.setSelectedParams({
        newValue: !0,
        clearSelection: !u,
        rangeSelect: u,
        event: t,
        source: v
      });
    else {
      const f = i ? !1 : !a;
      this.rowNode.setSelectedParams({
        newValue: !0,
        clearSelection: f,
        rangeSelect: u,
        event: t,
        source: v
      });
    }
  }
  isRowSelectionBlocked() {
    return !this.rowNode.selectable || !!this.rowNode.rowPinned || !u1(this.gos);
  }
  setupDetailRowAutoHeight(t) {
    if (this.rowType !== "FullWidthDetail" || !this.gos.get("detailRowAutoHeight"))
      return;
    const r = () => {
      const a = t.clientHeight;
      if (a != null && a > 0) {
        const u = () => {
          this.rowNode.setRowHeight(a), (da(this.gos) || sd(this.gos)) && this.beans.rowModel.onRowHeightChanged();
        };
        window.setTimeout(u, 0);
      }
    }, n = this.beans.resizeObserverService.observeResize(t, r);
    this.addDestroyFunc(n), r();
  }
  createFullWidthCompDetails(t, r) {
    const { gos: n, rowNode: a } = this, u = n.addGridCommonParams({
      fullWidth: !0,
      data: a.data,
      node: a,
      value: a.key,
      valueFormatted: a.key,
      // these need to be taken out, as part of 'afterAttached' now
      eGridCell: t,
      eParentOfValue: t,
      pinned: r,
      addRenderedRowListener: this.addEventListener.bind(this),
      registerRowDragger: (c, i, l, v) => this.addFullWidthRowDragging(c, i, l, v),
      setTooltip: (c, i) => this.refreshRowTooltip(c, i)
    }), s = this.beans.userComponentFactory;
    switch (this.rowType) {
      case "FullWidthDetail":
        return s.getFullWidthDetailCellRendererDetails(u);
      case "FullWidthGroup":
        return s.getFullWidthGroupCellRendererDetails(u);
      case "FullWidthLoading":
        return s.getFullWidthLoadingCellRendererDetails(u);
      default:
        return s.getFullWidthCellRendererDetails(u);
    }
  }
  refreshRowTooltip(t, r) {
    if (!this.fullWidthGui)
      return;
    const n = {
      getGui: () => this.fullWidthGui.element,
      getTooltipValue: () => t,
      getLocation: () => "fullWidthRow",
      shouldDisplayTooltip: r
    };
    this.tooltipFeature && this.destroyBean(this.tooltipFeature, this.beans.context), this.tooltipFeature = this.createBean(new Bv(n, this.beans));
  }
  addFullWidthRowDragging(t, r, n = "", a) {
    if (!this.isFullWidth())
      return;
    const u = new mT(
      () => n,
      this.rowNode,
      void 0,
      t,
      r,
      a
    );
    this.createBean(u, this.beans.context), this.addDestroyFunc(() => {
      this.destroyBean(u, this.beans.context);
    });
  }
  onUiLevelChanged() {
    const t = this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);
    if (this.rowLevel != t) {
      const r = "ag-row-level-" + t, n = "ag-row-level-" + this.rowLevel;
      this.allRowGuis.forEach((a) => {
        a.rowComp.addOrRemoveCssClass(r, !0), a.rowComp.addOrRemoveCssClass(n, !1);
      });
    }
    this.rowLevel = t;
  }
  isFirstRowOnPage() {
    return this.rowNode.rowIndex === this.beans.pageBoundsService.getFirstRow();
  }
  isLastRowOnPage() {
    return this.rowNode.rowIndex === this.beans.pageBoundsService.getLastRow();
  }
  refreshFirstAndLastRowStyles() {
    const t = this.isFirstRowOnPage(), r = this.isLastRowOnPage();
    this.firstRowOnPage !== t && (this.firstRowOnPage = t, this.allRowGuis.forEach((n) => n.rowComp.addOrRemoveCssClass("ag-row-first", t))), this.lastRowOnPage !== r && (this.lastRowOnPage = r, this.allRowGuis.forEach((n) => n.rowComp.addOrRemoveCssClass("ag-row-last", r)));
  }
  stopEditing(t = !1) {
    var r;
    this.stoppingRowEdit || (r = this.beans.rowEditService) == null || r.stopEditing(this, t);
  }
  setInlineEditingCss() {
    const t = this.editingRow || this.getAllCellCtrls().some((r) => r.isEditing());
    this.allRowGuis.forEach((r) => {
      r.rowComp.addOrRemoveCssClass("ag-row-inline-editing", t), r.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing", !t);
    });
  }
  setEditingRow(t) {
    this.editingRow = t;
  }
  startRowEditing(t = null, r = null, n = null) {
    var a;
    return this.editingRow ? !0 : ((a = this.beans.rowEditService) == null ? void 0 : a.startEditing(this, t, r, n)) ?? !0;
  }
  getAllCellCtrls() {
    return this.leftCellCtrls.list.length === 0 && this.rightCellCtrls.list.length === 0 ? this.centerCellCtrls.list : [...this.centerCellCtrls.list, ...this.leftCellCtrls.list, ...this.rightCellCtrls.list];
  }
  postProcessClassesFromGridOptions() {
    const t = this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);
    !t || !t.length || t.forEach((r) => {
      this.allRowGuis.forEach((n) => n.rowComp.addOrRemoveCssClass(r, !0));
    });
  }
  postProcessRowClassRules() {
    this.beans.rowCssClassCalculator.processRowClassRules(
      this.rowNode,
      (t) => {
        this.allRowGuis.forEach((r) => r.rowComp.addOrRemoveCssClass(t, !0));
      },
      (t) => {
        this.allRowGuis.forEach((r) => r.rowComp.addOrRemoveCssClass(t, !1));
      }
    );
  }
  setStylesFromGridOptions(t, r) {
    t && (this.rowStyles = this.processStylesFromGridOptions()), this.forEachGui(r, (n) => n.rowComp.setUserStyles(this.rowStyles));
  }
  getPinnedForContainer(t) {
    return t === "left" || t === "right" ? t : null;
  }
  getInitialRowClasses(t) {
    const r = this.getPinnedForContainer(t), n = {
      rowNode: this.rowNode,
      rowFocused: this.rowFocused,
      fadeRowIn: this.fadeInAnimation[t],
      rowIsEven: this.rowNode.rowIndex % 2 === 0,
      rowLevel: this.rowLevel,
      fullWidthRow: this.isFullWidth(),
      firstRowOnPage: this.isFirstRowOnPage(),
      lastRowOnPage: this.isLastRowOnPage(),
      printLayout: this.printLayout,
      expandable: this.rowNode.isExpandable(),
      pinned: r
    };
    return this.beans.rowCssClassCalculator.getInitialRowClasses(n);
  }
  processStylesFromGridOptions() {
    const t = this.gos.get("rowStyle");
    if (t && typeof t == "function") {
      Fr("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");
      return;
    }
    const r = this.gos.getCallback("getRowStyle");
    let n;
    if (r) {
      const a = {
        data: this.rowNode.data,
        node: this.rowNode,
        rowIndex: this.rowNode.rowIndex
      };
      n = r(a);
    }
    return n || t ? Object.assign({}, t, n) : this.emptyStyle;
  }
  onRowSelected(t) {
    const r = !!this.rowNode.isSelected();
    this.forEachGui(t, (n) => {
      n.rowComp.addOrRemoveCssClass("ag-row-selected", r), v1(n.element, r), n.element.contains(Sa(this.gos)) && (n === this.centerGui || n === this.fullWidthGui) && this.announceDescription();
    });
  }
  announceDescription() {
    if (this.isRowSelectionBlocked())
      return;
    const t = this.rowNode.isSelected();
    if (t && !vx(this.gos))
      return;
    const n = this.beans.localeService.getLocaleTextFunc()(
      t ? "ariaRowDeselect" : "ariaRowSelect",
      `Press SPACE to ${t ? "deselect" : "select"} this row.`
    );
    this.beans.ariaAnnouncementService.announceValue(n, "rowSelection");
  }
  addHoverFunctionality(t) {
    if (!this.active)
      return;
    const { element: r, compBean: n } = t, { rowNode: a, beans: u, gos: s } = this;
    n.addManagedListeners(r, {
      mouseenter: () => a.onMouseEnter(),
      mouseleave: () => a.onMouseLeave()
    }), n.addManagedListeners(a, {
      mouseEnter: () => {
        !u.dragService.isDragging() && !s.get("suppressRowHoverHighlight") && (r.classList.add("ag-row-hover"), a.setHovered(!0));
      },
      mouseLeave: () => {
        r.classList.remove("ag-row-hover"), a.setHovered(!1);
      }
    });
  }
  // for animation, we don't want to animate entry or exit to a very far away pixel,
  // otherwise the row would move so fast, it would appear to disappear. so this method
  // moves the row closer to the viewport if it is far away, so the row slide in / out
  // at a speed the user can see.
  roundRowTopToBounds(t) {
    const r = this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(), n = this.applyPaginationOffset(r.top, !0) - 100, a = this.applyPaginationOffset(r.bottom, !0) + 100;
    return Math.min(Math.max(n, t), a);
  }
  getFrameworkOverrides() {
    return this.beans.frameworkOverrides;
  }
  forEachGui(t, r) {
    t ? r(t) : this.allRowGuis.forEach(r);
  }
  onRowHeightChanged(t) {
    if (this.rowNode.rowHeight == null)
      return;
    const r = this.rowNode.rowHeight, n = this.beans.environment.getDefaultRowHeight(), u = EL(this.gos) ? af(this.gos, this.rowNode).height : void 0, s = u ? `${Math.min(n, u) - 2}px` : void 0;
    this.forEachGui(t, (c) => {
      c.element.style.height = `${r}px`, s && c.element.style.setProperty("--ag-line-height", s);
    });
  }
  addEventListener(t, r) {
    super.addEventListener(t, r);
  }
  removeEventListener(t, r) {
    super.removeEventListener(t, r);
  }
  // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.
  destroyFirstPass(t = !1) {
    if (this.active = !1, !t && yv(this.gos) && !this.isSticky())
      if (this.rowNode.rowTop != null) {
        const a = this.roundRowTopToBounds(this.rowNode.rowTop);
        this.setRowTop(a);
      } else
        this.allRowGuis.forEach((a) => a.rowComp.addOrRemoveCssClass("ag-opacity-zero", !0));
    this.rowNode.setHovered(!1);
    const r = this.createRowEvent("virtualRowRemoved");
    this.dispatchLocalEvent(r), this.beans.eventService.dispatchEvent(r), super.destroy();
  }
  destroySecondPass() {
    this.allRowGuis.length = 0, this.stopEditing();
    const t = (r) => (r.list.forEach((n) => n.destroy()), { list: [], map: {} });
    this.centerCellCtrls = t(this.centerCellCtrls), this.leftCellCtrls = t(this.leftCellCtrls), this.rightCellCtrls = t(this.rightCellCtrls);
  }
  setFocusedClasses(t) {
    this.forEachGui(t, (r) => {
      r.rowComp.addOrRemoveCssClass("ag-row-focus", this.rowFocused), r.rowComp.addOrRemoveCssClass("ag-row-no-focus", !this.rowFocused);
    });
  }
  onCellFocusChanged() {
    const t = this.beans.focusService.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
    t !== this.rowFocused && (this.rowFocused = t, this.setFocusedClasses()), !t && this.editingRow && this.stopEditing(!1);
  }
  onPaginationChanged() {
    var r;
    const t = ((r = this.beans.paginationService) == null ? void 0 : r.getCurrentPage()) ?? 0;
    this.paginationPage !== t && (this.paginationPage = t, this.onTopChanged()), this.refreshFirstAndLastRowStyles();
  }
  onTopChanged() {
    this.setRowTop(this.rowNode.rowTop);
  }
  onPaginationPixelOffsetChanged() {
    this.onTopChanged();
  }
  // applies pagination offset, eg if on second page, and page height is 500px, then removes
  // 500px from the top position, so a row with rowTop 600px is displayed at location 100px.
  // reverse will take the offset away rather than add.
  applyPaginationOffset(t, r = !1) {
    if (this.rowNode.isRowPinned() || this.rowNode.sticky)
      return t;
    const n = this.beans.pageBoundsService.getPixelOffset();
    return t + n * (r ? 1 : -1);
  }
  setRowTop(t) {
    if (!this.printLayout && $r(t)) {
      const r = this.applyPaginationOffset(t), u = `${this.rowNode.isRowPinned() || this.rowNode.sticky ? r : this.beans.rowContainerHeightService.getRealPixelPosition(r)}px`;
      this.setRowTopStyle(u);
    }
  }
  // the top needs to be set into the DOM element when the element is created, not updated afterwards.
  // otherwise the transition would not work, as it would be transitioning from zero (the unset value).
  // for example, suppose a row that is outside the viewport, then user does a filter to remove other rows
  // and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered,
  // but now is in the viewport) then a new RowComp is created, however it should have it's position initialised
  // to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation
  // time, the row would animate down (ie from position zero).
  getInitialRowTop(t) {
    return this.suppressRowTransform ? this.getInitialRowTopShared(t) : void 0;
  }
  getInitialTransform(t) {
    return this.suppressRowTransform ? void 0 : `translateY(${this.getInitialRowTopShared(t)})`;
  }
  getInitialRowTopShared(t) {
    if (this.printLayout)
      return "";
    const r = this.rowNode;
    let n;
    if (this.isSticky())
      n = r.stickyRowTop;
    else {
      const a = this.slideInAnimation[t] ? this.roundRowTopToBounds(r.oldRowTop) : r.rowTop, u = this.applyPaginationOffset(a);
      n = r.isRowPinned() ? u : this.beans.rowContainerHeightService.getRealPixelPosition(u);
    }
    return n + "px";
  }
  setRowTopStyle(t) {
    this.allRowGuis.forEach(
      (r) => this.suppressRowTransform ? r.rowComp.setTop(t) : r.rowComp.setTransform(`translateY(${t})`)
    );
  }
  getRowNode() {
    return this.rowNode;
  }
  getCellCtrl(t) {
    let r = null;
    return this.getAllCellCtrls().forEach((n) => {
      n.getColumn() == t && (r = n);
    }), r != null || this.getAllCellCtrls().forEach((n) => {
      n.getColSpanningList().indexOf(t) >= 0 && (r = n);
    }), r;
  }
  onRowIndexChanged() {
    this.rowNode.rowIndex != null && (this.onCellFocusChanged(), this.updateRowIndexes(), this.postProcessCss());
  }
  getRowIndex() {
    return this.rowNode.getRowIndexString();
  }
  updateRowIndexes(t) {
    var s;
    const r = this.rowNode.getRowIndexString();
    if (r === null)
      return;
    const n = this.beans.headerNavigationService.getHeaderRowCount() + (((s = this.beans.filterManager) == null ? void 0 : s.getHeaderRowCount()) ?? 0), a = this.rowNode.rowIndex % 2 === 0, u = n + this.rowNode.rowIndex + 1;
    this.forEachGui(t, (c) => {
      c.rowComp.setRowIndex(r), c.rowComp.addOrRemoveCssClass("ag-row-even", a), c.rowComp.addOrRemoveCssClass("ag-row-odd", !a), BU(c.element, u);
    });
  }
  setStoppingRowEdit(t) {
    this.stoppingRowEdit = t;
  }
};
Yk.DOM_DATA_KEY_ROW_CTRL = "renderedRow";
var Gh = Yk, n$ = class extends mr {
  wireBeans(e) {
    this.mouseEventService = e.mouseEventService, this.valueService = e.valueService, this.menuService = e.menuService, this.ctrlsService = e.ctrlsService, this.navigationService = e.navigationService, this.focusService = e.focusService, this.undoRedoService = e.undoRedoService, this.visibleColsService = e.visibleColsService, this.rowModel = e.rowModel, this.pinnedRowModel = e.pinnedRowModel, this.rangeService = e.rangeService, this.clipboardService = e.clipboardService;
  }
  constructor(e) {
    super(), this.element = e;
  }
  postConstruct() {
    this.addKeyboardListeners(), this.addMouseListeners(), this.mockContextMenuForIPad();
  }
  addKeyboardListeners() {
    const e = "keydown", t = this.processKeyboardEvent.bind(this, e);
    this.addManagedElementListeners(this.element, { [e]: t });
  }
  addMouseListeners() {
    ["dblclick", "contextmenu", "mouseover", "mouseout", "click", HL("touchstart") ? "touchstart" : "mousedown"].forEach((r) => {
      const n = this.processMouseEvent.bind(this, r);
      this.addManagedElementListeners(this.element, { [r]: n });
    });
  }
  processMouseEvent(e, t) {
    if (!this.mouseEventService.isEventFromThisGrid(t) || Qc(t))
      return;
    const r = this.getRowForEvent(t), n = this.mouseEventService.getRenderedCellForEvent(t);
    e === "contextmenu" ? this.handleContextMenuMouseEvent(t, void 0, r, n) : (n && n.onMouseEvent(e, t), r && r.onMouseEvent(e, t));
  }
  mockContextMenuForIPad() {
    if (!df())
      return;
    const e = new tf(this.element), t = (r) => {
      const n = this.getRowForEvent(r.touchEvent), a = this.mouseEventService.getRenderedCellForEvent(r.touchEvent);
      this.handleContextMenuMouseEvent(void 0, r.touchEvent, n, a);
    };
    this.addManagedListeners(e, { longTap: t }), this.addDestroyFunc(() => e.destroy());
  }
  getRowForEvent(e) {
    let t = e.target;
    for (; t; ) {
      const r = Bm(this.gos, t, Gh.DOM_DATA_KEY_ROW_CTRL);
      if (r)
        return r;
      t = t.parentElement;
    }
    return null;
  }
  handleContextMenuMouseEvent(e, t, r, n) {
    const a = r ? r.getRowNode() : null, u = n ? n.getColumn() : null;
    let s = null;
    if (u) {
      const l = e || t;
      n.dispatchCellContextMenuEvent(l ?? null), s = this.valueService.getValue(u, a);
    }
    const c = this.ctrlsService.getGridBodyCtrl(), i = n ? n.getGui() : c.getGridBodyElement();
    this.menuService.showContextMenu({
      mouseEvent: e,
      touchEvent: t,
      rowNode: a,
      column: u,
      value: s,
      anchorToElement: i
    });
  }
  getControlsForEventTarget(e) {
    return {
      cellCtrl: uT(this.gos, e, Nh.DOM_DATA_KEY_CELL_CTRL),
      rowCtrl: uT(this.gos, e, Gh.DOM_DATA_KEY_ROW_CTRL)
    };
  }
  processKeyboardEvent(e, t) {
    const { cellCtrl: r, rowCtrl: n } = this.getControlsForEventTarget(t.target);
    t.defaultPrevented || (r ? this.processCellKeyboardEvent(r, e, t) : n && n.isFullWidth() && this.processFullWidthRowKeyboardEvent(n, e, t));
  }
  processCellKeyboardEvent(e, t, r) {
    const n = e.getRowNode(), a = e.getColumn(), u = e.isEditing();
    !yT(
      this.gos,
      r,
      n,
      a,
      u
    ) && t === "keydown" && (!u && this.navigationService.handlePageScrollingKey(r) || e.onKeyDown(r), this.doGridOperations(r, e.isEditing()), xk(r) && e.processCharacter(r)), t === "keydown" && this.eventService.dispatchEvent(e.createEvent(r, "cellKeyDown"));
  }
  processFullWidthRowKeyboardEvent(e, t, r) {
    const n = e.getRowNode(), a = this.focusService.getFocusedCell(), u = a && a.column;
    if (!yT(this.gos, r, n, u, !1)) {
      const c = r.key;
      if (t === "keydown")
        switch (c) {
          case dr.PAGE_HOME:
          case dr.PAGE_END:
          case dr.PAGE_UP:
          case dr.PAGE_DOWN:
            this.navigationService.handlePageScrollingKey(r, !0);
            break;
          case dr.UP:
          case dr.DOWN:
            e.onKeyboardNavigate(r);
            break;
          case dr.TAB:
            e.onTabKeyDown(r);
            break;
        }
    }
    t === "keydown" && this.eventService.dispatchEvent(e.createRowEvent("cellKeyDown", r));
  }
  doGridOperations(e, t) {
    if (!e.ctrlKey && !e.metaKey || t || !this.mouseEventService.isEventFromThisGrid(e))
      return;
    const r = vY(e);
    if (r === dr.A)
      return this.onCtrlAndA(e);
    if (r === dr.C)
      return this.onCtrlAndC(e);
    if (r === dr.D)
      return this.onCtrlAndD(e);
    if (r === dr.V)
      return this.onCtrlAndV(e);
    if (r === dr.X)
      return this.onCtrlAndX(e);
    if (r === dr.Y)
      return this.onCtrlAndY();
    if (r === dr.Z)
      return this.onCtrlAndZ(e);
  }
  onCtrlAndA(e) {
    const { pinnedRowModel: t, rowModel: r, rangeService: n } = this;
    if (n && r.isRowsToRender()) {
      const [a, u] = [
        t.isEmpty("top"),
        t.isEmpty("bottom")
      ], s = a ? null : "top";
      let c, i;
      u ? (c = null, i = r.getRowCount() - 1) : (c = "bottom", i = t.getPinnedBottomRowCount() - 1);
      const l = this.visibleColsService.getAllCols();
      if (Rs(l))
        return;
      n.setCellRange({
        rowStartIndex: 0,
        rowStartPinned: s,
        rowEndIndex: i,
        rowEndPinned: c,
        columnStart: l[0],
        columnEnd: di(l)
      });
    }
    e.preventDefault();
  }
  onCtrlAndC(e) {
    if (!this.clipboardService || this.gos.get("enableCellTextSelection"))
      return;
    const { cellCtrl: t, rowCtrl: r } = this.getControlsForEventTarget(e.target);
    t != null && t.isEditing() || r != null && r.isEditing() || (e.preventDefault(), this.clipboardService.copyToClipboard());
  }
  onCtrlAndX(e) {
    if (!this.clipboardService || this.gos.get("enableCellTextSelection") || this.gos.get("suppressCutToClipboard"))
      return;
    const { cellCtrl: t, rowCtrl: r } = this.getControlsForEventTarget(e.target);
    t != null && t.isEditing() || r != null && r.isEditing() || (e.preventDefault(), this.clipboardService.cutToClipboard(void 0, "ui"));
  }
  onCtrlAndV(e) {
    const { cellCtrl: t, rowCtrl: r } = this.getControlsForEventTarget(e.target);
    t != null && t.isEditing() || r != null && r.isEditing() || this.clipboardService && !this.gos.get("suppressClipboardPaste") && this.clipboardService.pasteFromClipboard();
  }
  onCtrlAndD(e) {
    this.clipboardService && !this.gos.get("suppressClipboardPaste") && this.clipboardService.copyRangeDown(), e.preventDefault();
  }
  onCtrlAndZ(e) {
    !this.gos.get("undoRedoCellEditing") || !this.undoRedoService || (e.preventDefault(), e.shiftKey ? this.undoRedoService.redo("ui") : this.undoRedoService.undo("ui"));
  }
  onCtrlAndY() {
    var e;
    (e = this.undoRedoService) == null || e.redo("ui");
  }
}, i$ = class extends mr {
  wireBeans(e) {
    this.pinnedWidthService = e.pinnedWidthService;
  }
  constructor(e) {
    super(), this.element = e;
  }
  postConstruct() {
    this.addManagedEventListeners({ leftPinnedWidthChanged: this.onPinnedLeftWidthChanged.bind(this) });
  }
  onPinnedLeftWidthChanged() {
    const e = this.pinnedWidthService.getPinnedLeftWidth(), t = e > 0;
    ba(this.element, t), pu(this.element, e);
  }
  getWidth() {
    return this.pinnedWidthService.getPinnedLeftWidth();
  }
}, a$ = class extends mr {
  wireBeans(e) {
    this.pinnedWidthService = e.pinnedWidthService;
  }
  constructor(e) {
    super(), this.element = e;
  }
  postConstruct() {
    this.addManagedEventListeners({
      rightPinnedWidthChanged: this.onPinnedRightWidthChanged.bind(this)
    });
  }
  onPinnedRightWidthChanged() {
    const e = this.pinnedWidthService.getPinnedRightWidth(), t = e > 0;
    ba(this.element, t), pu(this.element, e);
  }
  getWidth() {
    return this.pinnedWidthService.getPinnedRightWidth();
  }
}, yC = (e) => e.getTopRowCtrls(), CC = (e) => e.getStickyTopRowCtrls(), bC = (e) => e.getStickyBottomRowCtrls(), wC = (e) => e.getBottomRowCtrls(), SC = (e) => e.getCentreRowCtrls(), o$ = {
  center: {
    type: "center",
    container: "ag-center-cols-container",
    viewport: "ag-center-cols-viewport",
    getRowCtrls: SC
  },
  left: {
    type: "left",
    container: "ag-pinned-left-cols-container",
    pinnedType: "left",
    getRowCtrls: SC
  },
  right: {
    type: "right",
    container: "ag-pinned-right-cols-container",
    pinnedType: "right",
    getRowCtrls: SC
  },
  fullWidth: {
    type: "fullWidth",
    container: "ag-full-width-container",
    fullWidth: !0,
    getRowCtrls: SC
  },
  topCenter: {
    type: "center",
    container: "ag-floating-top-container",
    viewport: "ag-floating-top-viewport",
    getRowCtrls: yC
  },
  topLeft: {
    type: "left",
    container: "ag-pinned-left-floating-top",
    pinnedType: "left",
    getRowCtrls: yC
  },
  topRight: {
    type: "right",
    container: "ag-pinned-right-floating-top",
    pinnedType: "right",
    getRowCtrls: yC
  },
  topFullWidth: {
    type: "fullWidth",
    container: "ag-floating-top-full-width-container",
    fullWidth: !0,
    getRowCtrls: yC
  },
  stickyTopCenter: {
    type: "center",
    container: "ag-sticky-top-container",
    viewport: "ag-sticky-top-viewport",
    getRowCtrls: CC
  },
  stickyTopLeft: {
    type: "left",
    container: "ag-pinned-left-sticky-top",
    pinnedType: "left",
    getRowCtrls: CC
  },
  stickyTopRight: {
    type: "right",
    container: "ag-pinned-right-sticky-top",
    pinnedType: "right",
    getRowCtrls: CC
  },
  stickyTopFullWidth: {
    type: "fullWidth",
    container: "ag-sticky-top-full-width-container",
    fullWidth: !0,
    getRowCtrls: CC
  },
  stickyBottomCenter: {
    type: "center",
    container: "ag-sticky-bottom-container",
    viewport: "ag-sticky-bottom-viewport",
    getRowCtrls: bC
  },
  stickyBottomLeft: {
    type: "left",
    container: "ag-pinned-left-sticky-bottom",
    pinnedType: "left",
    getRowCtrls: bC
  },
  stickyBottomRight: {
    type: "right",
    container: "ag-pinned-right-sticky-bottom",
    pinnedType: "right",
    getRowCtrls: bC
  },
  stickyBottomFullWidth: {
    type: "fullWidth",
    container: "ag-sticky-bottom-full-width-container",
    fullWidth: !0,
    getRowCtrls: bC
  },
  bottomCenter: {
    type: "center",
    container: "ag-floating-bottom-container",
    viewport: "ag-floating-bottom-viewport",
    getRowCtrls: wC
  },
  bottomLeft: {
    type: "left",
    container: "ag-pinned-left-floating-bottom",
    pinnedType: "left",
    getRowCtrls: wC
  },
  bottomRight: {
    type: "right",
    container: "ag-pinned-right-floating-bottom",
    pinnedType: "right",
    getRowCtrls: wC
  },
  bottomFullWidth: {
    type: "fullWidth",
    container: "ag-floating-bottom-full-width-container",
    fullWidth: !0,
    getRowCtrls: wC
  }
};
function vv(e) {
  return o$[e];
}
var s$ = ["topCenter", "topLeft", "topRight"], l$ = ["bottomCenter", "bottomLeft", "bottomRight"], u$ = ["center", "left", "right"], c$ = ["center", "left", "right", "fullWidth"], d$ = ["stickyTopCenter", "stickyBottomCenter", "center", "topCenter", "bottomCenter"], f$ = ["left", "bottomLeft", "topLeft", "stickyTopLeft", "stickyBottomLeft"], h$ = ["right", "bottomRight", "topRight", "stickyTopRight", "stickyBottomRight"], Xk = ["stickyTopCenter", "stickyTopLeft", "stickyTopRight"], $k = ["stickyBottomCenter", "stickyBottomLeft", "stickyBottomRight"], p$ = [
  ...Xk,
  "stickyTopFullWidth",
  ...$k,
  "stickyBottomFullWidth"
], v$ = [
  ...s$,
  ...l$,
  ...u$,
  ...Xk,
  ...$k
], g$ = class extends mr {
  constructor(e) {
    super(), this.visible = !0, this.EMPTY_CTRLS = [], this.name = e, this.options = vv(e);
  }
  wireBeans(e) {
    this.dragService = e.dragService, this.ctrlsService = e.ctrlsService, this.columnViewportService = e.columnViewportService, this.resizeObserverService = e.resizeObserverService, this.rowRenderer = e.rowRenderer;
  }
  postConstruct() {
    this.enableRtl = this.gos.get("enableRtl"), this.forContainers(["center"], () => {
      this.viewportSizeFeature = this.createManagedBean(new DX(this)), this.addManagedEventListeners({
        stickyTopOffsetChanged: this.onStickyTopOffsetChanged.bind(this)
      });
    });
  }
  onStickyTopOffsetChanged(e) {
    this.comp.setOffsetTop(`${e.offset}px`);
  }
  registerWithCtrlsService() {
    this.options.fullWidth || this.ctrlsService.register(this.name, this);
  }
  forContainers(e, t) {
    e.indexOf(this.name) >= 0 && t();
  }
  getContainerElement() {
    return this.eContainer;
  }
  getViewportSizeFeature() {
    return this.viewportSizeFeature;
  }
  setComp(e, t, r) {
    this.comp = e, this.eContainer = t, this.eViewport = r, this.createManagedBean(new n$(this.eContainer)), this.addPreventScrollWhileDragging(), this.listenOnDomOrder();
    const n = () => this.onPinnedWidthChanged();
    this.forContainers(f$, () => {
      this.pinnedWidthFeature = this.createManagedBean(new i$(this.eContainer)), this.addManagedEventListeners({ leftPinnedWidthChanged: n });
    }), this.forContainers(h$, () => {
      this.pinnedWidthFeature = this.createManagedBean(new a$(this.eContainer)), this.addManagedEventListeners({ rightPinnedWidthChanged: n });
    }), this.forContainers(
      c$,
      () => this.createManagedBean(
        new Uk(this.eContainer, this.name === "center" ? r : void 0)
      )
    ), this.forContainers(v$, () => this.createManagedBean(new FX(this.eContainer))), this.forContainers(
      d$,
      () => this.createManagedBean(new sR((a) => this.comp.setContainerWidth(`${a}px`)))
    ), this.visible = this.isContainerVisible(), this.addListeners(), this.registerWithCtrlsService();
  }
  onScrollCallback(e) {
    this.addManagedElementListeners(this.getViewportElement(), { scroll: e });
  }
  addListeners() {
    this.addManagedEventListeners({
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
      displayedColumnsWidthChanged: this.onDisplayedColumnsWidthChanged.bind(this),
      displayedRowsChanged: (e) => this.onDisplayedRowsChanged(e.afterScroll)
    }), this.onDisplayedColumnsChanged(), this.onDisplayedColumnsWidthChanged(), this.onDisplayedRowsChanged();
  }
  listenOnDomOrder() {
    if (p$.indexOf(this.name) >= 0) {
      this.comp.setDomOrder(!0);
      return;
    }
    const t = () => {
      const r = this.gos.get("ensureDomOrder"), n = Ao(this.gos, "print");
      this.comp.setDomOrder(r || n);
    };
    this.addManagedPropertyListener("domLayout", t), t();
  }
  onDisplayedColumnsChanged() {
    this.forContainers(["center"], () => this.onHorizontalViewportChanged());
  }
  onDisplayedColumnsWidthChanged() {
    this.forContainers(["center"], () => this.onHorizontalViewportChanged());
  }
  // this methods prevents the grid views from being scrolled while the dragService is being used
  // eg. the view should not scroll up and down while dragging rows using the rowDragComp.
  addPreventScrollWhileDragging() {
    const e = (t) => {
      this.dragService.isDragging() && t.cancelable && t.preventDefault();
    };
    this.eContainer.addEventListener("touchmove", e, { passive: !1 }), this.addDestroyFunc(() => this.eContainer.removeEventListener("touchmove", e));
  }
  // this gets called whenever a change in the viewport, so we can inform column controller it has to work
  // out the virtual columns again. gets called from following locations:
  // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged
  onHorizontalViewportChanged(e = !1) {
    const t = this.getCenterWidth(), r = this.getCenterViewportScrollLeft();
    this.columnViewportService.setScrollPosition(t, r, e);
  }
  hasHorizontalScrollGap() {
    return this.eContainer.clientWidth - this.eViewport.clientWidth < 0;
  }
  hasVerticalScrollGap() {
    return this.eContainer.clientHeight - this.eViewport.clientHeight < 0;
  }
  getCenterWidth() {
    return iy(this.eViewport);
  }
  getCenterViewportScrollLeft() {
    return y1(this.eViewport, this.enableRtl);
  }
  registerViewportResizeListener(e) {
    const t = this.resizeObserverService.observeResize(this.eViewport, e);
    this.addDestroyFunc(() => t());
  }
  isViewportInTheDOMTree() {
    return nk(this.eViewport);
  }
  getViewportScrollLeft() {
    return y1(this.eViewport, this.enableRtl);
  }
  isHorizontalScrollShowing() {
    return this.gos.get("alwaysShowHorizontalScroll") || JU(this.eViewport);
  }
  getViewportElement() {
    return this.eViewport;
  }
  setHorizontalScroll(e) {
    this.comp.setHorizontalScroll(e);
  }
  getHScrollPosition() {
    return {
      left: this.eViewport.scrollLeft,
      right: this.eViewport.scrollLeft + this.eViewport.offsetWidth
    };
  }
  setCenterViewportScrollLeft(e) {
    C1(this.eViewport, e, this.enableRtl);
  }
  isContainerVisible() {
    return !(this.options.pinnedType != null) || !!this.pinnedWidthFeature && this.pinnedWidthFeature.getWidth() > 0;
  }
  onPinnedWidthChanged() {
    const e = this.isContainerVisible();
    this.visible != e && (this.visible = e, this.onDisplayedRowsChanged());
  }
  onDisplayedRowsChanged(e = !1) {
    const t = this.options.getRowCtrls(this.rowRenderer);
    if (!this.visible || t.length === 0) {
      this.comp.setRowCtrls({ rowCtrls: this.EMPTY_CTRLS });
      return;
    }
    const r = Ao(this.gos, "print"), a = this.gos.get("embedFullWidthRows") || r, u = t.filter((s) => {
      const c = s.isFullWidth();
      return this.options.fullWidth ? !a && c : a || !c;
    });
    this.comp.setRowCtrls({ rowCtrls: u, useFlushSync: e });
  }
}, m$ = "ag-force-vertical-scroll", y$ = "ag-selectable", C$ = "ag-column-moving", b$ = class extends mr {
  constructor() {
    super(...arguments), this.stickyTopHeight = 0, this.stickyBottomHeight = 0;
  }
  wireBeans(e) {
    this.animationFrameService = e.animationFrameService, this.rowContainerHeightService = e.rowContainerHeightService, this.ctrlsService = e.ctrlsService, this.columnModel = e.columnModel, this.columnSizeService = e.columnSizeService, this.scrollVisibleService = e.scrollVisibleService, this.menuService = e.menuService, this.headerNavigationService = e.headerNavigationService, this.dragAndDropService = e.dragAndDropService, this.pinnedRowModel = e.pinnedRowModel, this.rowRenderer = e.rowRenderer, this.popupService = e.popupService, this.mouseEventService = e.mouseEventService, this.rowModel = e.rowModel, this.filterManager = e.filterManager, this.environment = e.environment;
  }
  getScrollFeature() {
    return this.bodyScrollFeature;
  }
  getBodyViewportElement() {
    return this.eBodyViewport;
  }
  setComp(e, t, r, n, a, u, s) {
    var c;
    this.comp = e, this.eGridBody = t, this.eBodyViewport = r, this.eTop = n, this.eBottom = a, this.eStickyTop = u, this.eStickyBottom = s, this.eCenterColsViewport = r.querySelector(
      `.${vv("center").viewport}`
    ), this.eFullWidthContainer = r.querySelector(
      `.${vv("fullWidth").container}`
    ), this.eStickyTopFullWidthContainer = u.querySelector(
      `.${vv("stickyTopFullWidth").container}`
    ), this.eStickyBottomFullWidthContainer = s.querySelector(
      `.${vv("stickyBottomFullWidth").container}`
    ), this.setCellTextSelection(this.gos.get("enableCellTextSelection")), this.addManagedPropertyListener(
      "enableCellTextSelection",
      (i) => this.setCellTextSelection(i.currentValue)
    ), this.createManagedBean(new uR(this.comp)), this.bodyScrollFeature = this.createManagedBean(new MX(this.eBodyViewport)), this.addRowDragListener(), this.setupRowAnimationCssClass(), this.addEventListeners(), this.addFocusListeners([n, r, a, u, s]), this.onGridColumnsChanged(), this.addBodyViewportListener(), this.setFloatingHeights(), this.disableBrowserDragging(), this.addStopEditingWhenGridLosesFocus(), this.updateScrollingClasses(), (c = this.filterManager) == null || c.setupAdvancedFilterHeaderComp(n), this.ctrlsService.register("gridBodyCtrl", this);
  }
  getComp() {
    return this.comp;
  }
  addEventListeners() {
    const e = this.setFloatingHeights.bind(this);
    this.addManagedEventListeners({
      gridColumnsChanged: this.onGridColumnsChanged.bind(this),
      scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this),
      scrollGapChanged: this.onScrollGapChanged.bind(this),
      pinnedRowDataChanged: e,
      pinnedHeightChanged: e,
      headerHeightChanged: this.onHeaderHeightChanged.bind(this)
    });
  }
  addFocusListeners(e) {
    e.forEach((t) => {
      this.addManagedElementListeners(t, {
        focusin: (r) => {
          const { target: n } = r, a = Cv(n, "ag-root", t);
          t.classList.toggle("ag-has-focus", !a);
        },
        focusout: (r) => {
          const { target: n, relatedTarget: a } = r, u = t.contains(a), s = Cv(
            a,
            "ag-root",
            t
          );
          Cv(n, "ag-root", t) || (!u || s) && t.classList.remove("ag-has-focus");
        }
      });
    });
  }
  // used by ColumnAnimationService
  setColumnMovingCss(e) {
    this.comp.setColumnMovingCss(C$, e);
  }
  setCellTextSelection(e = !1) {
    this.comp.setCellSelectableCss(y$, e);
  }
  onScrollVisibilityChanged() {
    const e = this.scrollVisibleService.isVerticalScrollShowing();
    this.setVerticalScrollPaddingVisible(e), this.setStickyWidth(e), this.setStickyBottomOffsetBottom();
    const t = e && this.scrollVisibleService.getScrollbarWidth() || 0, r = qL() ? 16 : 0, n = `calc(100% + ${t + r}px)`;
    this.animationFrameService.requestAnimationFrame(() => this.comp.setBodyViewportWidth(n)), this.updateScrollingClasses();
  }
  onScrollGapChanged() {
    this.updateScrollingClasses();
  }
  updateScrollingClasses() {
    this.eGridBody.classList.toggle(
      "ag-body-vertical-content-no-gap",
      !this.scrollVisibleService.hasVerticalScrollGap()
    ), this.eGridBody.classList.toggle(
      "ag-body-horizontal-content-no-gap",
      !this.scrollVisibleService.hasHorizontalScrollGap()
    );
  }
  onGridColumnsChanged() {
    const e = this.columnModel.getCols();
    this.comp.setColumnCount(e.length);
  }
  // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)
  // and then that will start the browser native drag n' drop, which messes up with our own drag and drop.
  disableBrowserDragging() {
    this.addManagedElementListeners(this.eGridBody, {
      dragstart: (e) => {
        if (e.target instanceof HTMLImageElement)
          return e.preventDefault(), !1;
      }
    });
  }
  addStopEditingWhenGridLosesFocus() {
    if (!this.gos.get("stopEditingWhenCellsLoseFocus"))
      return;
    const e = (r) => {
      const n = r.relatedTarget;
      if (vT(n) === null) {
        this.rowRenderer.stopEditing();
        return;
      }
      let a = (
        // see if click came from inside the viewports
        t.some((u) => u.contains(n)) && // and also that it's not from a detail grid
        this.mouseEventService.isElementInThisGrid(n)
      );
      if (!a) {
        const u = this.popupService;
        a = u.getActivePopups().some((s) => s.contains(n)) || u.isElementWithinCustomPopup(n);
      }
      a || this.rowRenderer.stopEditing();
    }, t = [this.eBodyViewport, this.eBottom, this.eTop, this.eStickyTop, this.eStickyBottom];
    t.forEach((r) => this.addManagedElementListeners(r, { focusout: e }));
  }
  updateRowCount() {
    var n;
    const e = this.headerNavigationService.getHeaderRowCount() + (((n = this.filterManager) == null ? void 0 : n.getHeaderRowCount()) ?? 0), t = this.rowModel.isLastRowIndexKnown() ? this.rowModel.getRowCount() : -1, r = t === -1 ? -1 : e + t;
    this.comp.setRowCount(r);
  }
  registerBodyViewportResizeListener(e) {
    this.comp.registerBodyViewportResizeListener(e);
  }
  setVerticalScrollPaddingVisible(e) {
    const t = e ? "scroll" : "hidden";
    this.comp.setPinnedTopBottomOverflowY(t);
  }
  isVerticalScrollShowing() {
    const e = this.gos.get("alwaysShowVerticalScroll"), t = e ? m$ : null, r = Ao(this.gos, "normal");
    return this.comp.setAlwaysVerticalScrollClass(t, e), e || r && QU(this.eBodyViewport);
  }
  setupRowAnimationCssClass() {
    let e = this.environment.hasMeasuredSizes();
    const t = () => {
      const r = e && yv(this.gos) && !this.rowContainerHeightService.isStretching(), n = r ? "ag-row-animation" : "ag-row-no-animation";
      this.comp.setRowAnimationCssOnBodyViewport(n, r);
    };
    t(), this.addManagedEventListeners({ heightScaleChanged: t }), this.addManagedPropertyListener("animateRows", t), this.addManagedEventListeners({
      gridStylesChanged: () => {
        !e && this.environment.hasMeasuredSizes() && (e = !0, t());
      }
    });
  }
  getGridBodyElement() {
    return this.eGridBody;
  }
  addBodyViewportListener() {
    const e = this.onBodyViewportContextMenu.bind(this);
    this.addManagedElementListeners(this.eBodyViewport, { contextmenu: e }), this.mockContextMenuForIPad(e), this.addManagedElementListeners(this.eBodyViewport, { wheel: this.onBodyViewportWheel.bind(this) }), this.addManagedElementListeners(this.eStickyTop, { wheel: this.onStickyWheel.bind(this) }), this.addManagedElementListeners(this.eStickyBottom, { wheel: this.onStickyWheel.bind(this) }), this.addFullWidthContainerWheelListener();
  }
  addFullWidthContainerWheelListener() {
    this.addManagedElementListeners(this.eFullWidthContainer, {
      wheel: (e) => this.onFullWidthContainerWheel(e)
    });
  }
  onFullWidthContainerWheel(e) {
    const { deltaX: t, deltaY: r, shiftKey: n } = e;
    (n || Math.abs(t) > Math.abs(r)) && this.mouseEventService.isEventFromThisGrid(e) && this.scrollGridBodyToMatchEvent(e);
  }
  onStickyWheel(e) {
    const { deltaX: t, deltaY: r, shiftKey: n } = e, a = n || Math.abs(t) > Math.abs(r), u = e.target;
    a ? (this.eStickyTopFullWidthContainer.contains(u) || this.eStickyBottomFullWidthContainer.contains(u)) && this.scrollGridBodyToMatchEvent(e) : (e.preventDefault(), this.scrollVertically(r));
  }
  scrollGridBodyToMatchEvent(e) {
    const { deltaX: t, deltaY: r } = e;
    e.preventDefault(), this.eCenterColsViewport.scrollBy({ left: t || r });
  }
  onBodyViewportContextMenu(e, t, r) {
    if (!e && !r)
      return;
    this.gos.get("preventDefaultOnContextMenu") && (e || r).preventDefault();
    const { target: n } = e || t;
    (n === this.eBodyViewport || n === this.ctrlsService.get("center").getViewportElement()) && this.menuService.showContextMenu({
      mouseEvent: e,
      touchEvent: r,
      value: null,
      anchorToElement: this.eGridBody
    });
  }
  mockContextMenuForIPad(e) {
    if (!df())
      return;
    const t = new tf(this.eBodyViewport), r = (n) => {
      e(void 0, n.touchStart, n.touchEvent);
    };
    this.addManagedListeners(t, { longTap: r }), this.addDestroyFunc(() => t.destroy());
  }
  onBodyViewportWheel(e) {
    this.gos.get("suppressScrollWhenPopupsAreOpen") && this.popupService.hasAnchoredPopup() && e.preventDefault();
  }
  getGui() {
    return this.eGridBody;
  }
  // called by rowDragFeature
  scrollVertically(e) {
    const t = this.eBodyViewport.scrollTop;
    return this.bodyScrollFeature.setVerticalScrollPosition(t + e), this.eBodyViewport.scrollTop - t;
  }
  addRowDragListener() {
    this.rowDragFeature = this.createManagedBean(new $j(this.eBodyViewport)), this.dragAndDropService.addDropTarget(this.rowDragFeature), this.addDestroyFunc(() => this.dragAndDropService.removeDropTarget(this.rowDragFeature));
  }
  getRowDragFeature() {
    return this.rowDragFeature;
  }
  setFloatingHeights() {
    const { pinnedRowModel: e } = this, t = e.getPinnedTopTotalHeight(), r = e.getPinnedBottomTotalHeight();
    this.comp.setTopHeight(t), this.comp.setBottomHeight(r), this.comp.setTopDisplay(t ? "inherit" : "none"), this.comp.setBottomDisplay(r ? "inherit" : "none"), this.setStickyTopOffsetTop(), this.setStickyBottomOffsetBottom();
  }
  setStickyTopHeight(e = 0) {
    this.comp.setStickyTopHeight(`${e}px`), this.stickyTopHeight = e;
  }
  getStickyTopHeight() {
    return this.stickyTopHeight;
  }
  setStickyBottomHeight(e = 0) {
    this.comp.setStickyBottomHeight(`${e}px`), this.stickyBottomHeight = e;
  }
  getStickyBottomHeight() {
    return this.stickyBottomHeight;
  }
  setStickyWidth(e) {
    if (!e)
      this.comp.setStickyTopWidth("100%"), this.comp.setStickyBottomWidth("100%");
    else {
      const t = this.scrollVisibleService.getScrollbarWidth();
      this.comp.setStickyTopWidth(`calc(100% - ${t}px)`), this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`);
    }
  }
  onHeaderHeightChanged() {
    this.setStickyTopOffsetTop();
  }
  setStickyTopOffsetTop() {
    var a;
    const t = this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight() + (((a = this.filterManager) == null ? void 0 : a.getHeaderHeight()) ?? 0), r = this.pinnedRowModel.getPinnedTopTotalHeight();
    let n = 0;
    t > 0 && (n += t), r > 0 && (n += r), n > 0 && (n += 1), this.comp.setStickyTopTop(`${n}px`);
  }
  setStickyBottomOffsetBottom() {
    const e = this.pinnedRowModel.getPinnedBottomTotalHeight(), r = this.scrollVisibleService.isHorizontalScrollShowing() && this.scrollVisibleService.getScrollbarWidth() || 0, n = e + r;
    this.comp.setStickyBottomBottom(`${n}px`);
  }
  // method will call itself if no available width. this covers if the grid
  // isn't visible, but is just about to be visible.
  sizeColumnsToFit(e, t) {
    const n = this.isVerticalScrollShowing() ? this.scrollVisibleService.getScrollbarWidth() : 0, u = iy(this.eGridBody) - n;
    if (u > 0) {
      this.columnSizeService.sizeColumnsToFit(u, "sizeColumnsToFit", !1, e);
      return;
    }
    t === void 0 ? window.setTimeout(() => {
      this.sizeColumnsToFit(e, 100);
    }, 0) : t === 100 ? window.setTimeout(() => {
      this.sizeColumnsToFit(e, 500);
    }, 100) : t === 500 ? window.setTimeout(() => {
      this.sizeColumnsToFit(e, -1);
    }, 500) : Fr(
      "tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?"
    );
  }
  // + rangeService
  addScrollEventListener(e) {
    this.eBodyViewport.addEventListener("scroll", e, { passive: !0 });
  }
  // + focusService
  removeScrollEventListener(e) {
    this.eBodyViewport.removeEventListener("scroll", e);
  }
};
function hm(e) {
  return e.map((t) => `<ag-row-container name="${t}"></ag-row-container>`).join("");
}
`${hm(["topLeft", "topCenter", "topRight", "topFullWidth"])}${hm(["left", "center", "right", "fullWidth"])}${hm(["stickyTopLeft", "stickyTopCenter", "stickyTopRight", "stickyTopFullWidth"])}${hm(["stickyBottomLeft", "stickyBottomCenter", "stickyBottomRight", "stickyBottomFullWidth"])}${hm(["bottomLeft", "bottomCenter", "bottomRight", "bottomFullWidth"])}`;
var w$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "scrollVisibleService";
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.columnAnimationService = e.columnAnimationService;
  }
  postConstruct() {
    this.getScrollbarWidth(), this.addManagedEventListeners({
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
      displayedColumnsWidthChanged: this.onDisplayedColumnsWidthChanged.bind(this)
    });
  }
  onDisplayedColumnsChanged() {
    this.updateScrollVisible();
  }
  onDisplayedColumnsWidthChanged() {
    this.updateScrollVisible();
  }
  onCentreViewportResized() {
    this.updateScrollGap();
  }
  updateScrollVisible() {
    this.columnAnimationService.isActive() ? this.columnAnimationService.executeLaterVMTurn(() => {
      this.columnAnimationService.executeLaterVMTurn(() => this.updateScrollVisibleImpl());
    }) : this.updateScrollVisibleImpl();
  }
  updateScrollVisibleImpl() {
    const e = this.ctrlsService.get("center");
    if (!e || this.columnAnimationService.isActive())
      return;
    const t = {
      horizontalScrollShowing: e.isHorizontalScrollShowing(),
      verticalScrollShowing: this.isVerticalScrollShowing()
    };
    this.setScrollsVisible(t), this.updateScrollGap();
  }
  updateScrollGap() {
    const e = this.ctrlsService.get("center"), t = e.hasHorizontalScrollGap(), r = e.hasVerticalScrollGap();
    (this.horizontalScrollGap !== t || this.verticalScrollGap !== r) && (this.horizontalScrollGap = t, this.verticalScrollGap = r, this.eventService.dispatchEvent({
      type: "scrollGapChanged"
    }));
  }
  setScrollsVisible(e) {
    (this.horizontalScrollShowing !== e.horizontalScrollShowing || this.verticalScrollShowing !== e.verticalScrollShowing) && (this.horizontalScrollShowing = e.horizontalScrollShowing, this.verticalScrollShowing = e.verticalScrollShowing, this.eventService.dispatchEvent({
      type: "scrollVisibilityChanged"
    }));
  }
  // used by pagination service - to know page height
  isHorizontalScrollShowing() {
    return this.horizontalScrollShowing;
  }
  // used by header container
  isVerticalScrollShowing() {
    return this.verticalScrollShowing;
  }
  hasHorizontalScrollGap() {
    return this.horizontalScrollGap;
  }
  hasVerticalScrollGap() {
    return this.verticalScrollGap;
  }
  // the user might be using some non-standard scrollbar, eg a scrollbar that has zero
  // width and overlays (like the Safari scrollbar, but presented in Chrome). so we
  // allow the user to provide the scroll width before we work it out.
  getScrollbarWidth() {
    if (this.scrollbarWidth == null) {
      const e = this.gos.get("scrollbarWidth"), r = typeof e == "number" && e >= 0 ? e : $U();
      r != null && (this.scrollbarWidth = r, this.eventService.dispatchEvent({
        type: "scrollbarWidthChanged"
      }));
    }
    return this.scrollbarWidth;
  }
}, dF = "__ag_grid_instance", Zk = class Kk extends mr {
  constructor() {
    super(...arguments), this.beanName = "mouseEventService", this.gridInstanceId = Kk.gridInstanceSequence.next();
  }
  wireBeans(t) {
    this.ctrlsService = t.ctrlsService;
  }
  // we put the instance id onto the main DOM element. this is used for events, when grids are inside grids,
  // so the grid can work out if the even came from this grid or a grid inside this one. see the ctrl+v logic
  // for where this is used.
  stampTopLevelGridCompWithGridInstance(t) {
    t[dF] = this.gridInstanceId;
  }
  getRenderedCellForEvent(t) {
    return uT(this.gos, t.target, Nh.DOM_DATA_KEY_CELL_CTRL);
  }
  // walks the path of the event, and returns true if this grid is the first one that it finds. if doing
  // master / detail grids, and a child grid is found, then it returns false. this stops things like copy/paste
  // getting executed on many grids at the same time.
  isEventFromThisGrid(t) {
    return this.isElementInThisGrid(t.target);
  }
  isElementInThisGrid(t) {
    let r = t;
    for (; r; ) {
      const n = r[dF];
      if ($r(n))
        return n === this.gridInstanceId;
      r = r.parentElement;
    }
    return !1;
  }
  getCellPositionForEvent(t) {
    const r = this.getRenderedCellForEvent(t);
    return r ? r.getCellPosition() : null;
  }
  getNormalisedPosition(t) {
    const r = Ao(this.gos, "normal"), n = t;
    let a, u;
    if (n.clientX != null || n.clientY != null ? (a = n.clientX, u = n.clientY) : (a = n.x, u = n.y), r) {
      const s = this.ctrlsService.getGridBodyCtrl(), c = s.getScrollFeature().getVScrollPosition(), i = s.getScrollFeature().getHScrollPosition();
      a += i.left, u += c.top;
    }
    return { x: a, y: u };
  }
};
Zk.gridInstanceSequence = new $2();
var S$ = Zk, x$ = class extends mr {
  constructor() {
    super(), this.beanName = "navigationService", this.onPageDown = Z3(this.onPageDown, 100), this.onPageUp = Z3(this.onPageUp, 100);
  }
  wireBeans(e) {
    this.mouseEventService = e.mouseEventService, this.pageBoundsService = e.pageBoundsService, this.focusService = e.focusService, this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService, this.rowModel = e.rowModel, this.ctrlsService = e.ctrlsService, this.rowRenderer = e.rowRenderer, this.headerNavigationService = e.headerNavigationService, this.rowPositionUtils = e.rowPositionUtils, this.cellNavigationService = e.cellNavigationService, this.pinnedRowModel = e.pinnedRowModel, this.scrollVisibleService = e.scrollVisibleService, this.rangeService = e.rangeService;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      this.gridBodyCon = e.gridBodyCtrl;
    });
  }
  handlePageScrollingKey(e, t = !1) {
    const r = e.key, n = e.altKey, a = e.ctrlKey || e.metaKey, u = !!this.rangeService && e.shiftKey, s = this.mouseEventService.getCellPositionForEvent(e);
    let c = !1;
    switch (r) {
      case dr.PAGE_HOME:
      case dr.PAGE_END:
        !a && !n && (this.onHomeOrEndKey(r), c = !0);
        break;
      case dr.LEFT:
      case dr.RIGHT:
      case dr.UP:
      case dr.DOWN:
        if (!s)
          return !1;
        a && !n && !u && (this.onCtrlUpDownLeftRight(r, s), c = !0);
        break;
      case dr.PAGE_DOWN:
      case dr.PAGE_UP:
        !a && !n && (c = this.handlePageUpDown(r, s, t));
        break;
    }
    return c && e.preventDefault(), c;
  }
  handlePageUpDown(e, t, r) {
    return r && (t = this.focusService.getFocusedCell()), t ? (e === dr.PAGE_UP ? this.onPageUp(t) : this.onPageDown(t), !0) : !1;
  }
  navigateTo(e) {
    var s;
    const { scrollIndex: t, scrollType: r, scrollColumn: n, focusIndex: a, focusColumn: u } = e;
    $r(n) && !n.isPinned() && this.gridBodyCon.getScrollFeature().ensureColumnVisible(n), $r(t) && this.gridBodyCon.getScrollFeature().ensureIndexVisible(t, r), e.isAsync || this.gridBodyCon.getScrollFeature().ensureIndexVisible(a), this.focusService.setFocusedCell({
      rowIndex: a,
      column: u,
      rowPinned: null,
      forceBrowserFocus: !0
    }), (s = this.rangeService) == null || s.setRangeToCell({ rowIndex: a, rowPinned: null, column: u });
  }
  // this method is throttled, see the `constructor`
  onPageDown(e) {
    const r = this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(), n = this.getViewportHeight(), a = this.pageBoundsService.getPixelOffset(), u = r.top + n, s = this.rowModel.getRowIndexAtPixel(u + a);
    this.columnModel.isAutoRowHeightActive() ? this.navigateToNextPageWithAutoHeight(e, s) : this.navigateToNextPage(e, s);
  }
  // this method is throttled, see the `constructor`
  onPageUp(e) {
    const r = this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(), n = this.pageBoundsService.getPixelOffset(), a = r.top, u = this.rowModel.getRowIndexAtPixel(a + n);
    this.columnModel.isAutoRowHeightActive() ? this.navigateToNextPageWithAutoHeight(e, u, !0) : this.navigateToNextPage(e, u, !0);
  }
  navigateToNextPage(e, t, r = !1) {
    const n = this.getViewportHeight(), a = this.pageBoundsService.getFirstRow(), u = this.pageBoundsService.getLastRow(), s = this.pageBoundsService.getPixelOffset(), c = this.rowModel.getRow(e.rowIndex), i = r ? (
      // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
      (c == null ? void 0 : c.rowHeight) - n - s
    ) : n - s, l = (c == null ? void 0 : c.rowTop) + i;
    let v = this.rowModel.getRowIndexAtPixel(l + s);
    if (v === e.rowIndex) {
      const p = r ? -1 : 1;
      t = v = e.rowIndex + p;
    }
    let f;
    r ? (f = "bottom", v < a && (v = a), t < a && (t = a)) : (f = "top", v > u && (v = u), t > u && (t = u)), this.isRowTallerThanView(v) && (t = v, f = "top"), this.navigateTo({
      scrollIndex: t,
      scrollType: f,
      scrollColumn: null,
      focusIndex: v,
      focusColumn: e.column
    });
  }
  navigateToNextPageWithAutoHeight(e, t, r = !1) {
    this.navigateTo({
      scrollIndex: t,
      scrollType: r ? "bottom" : "top",
      scrollColumn: null,
      focusIndex: t,
      focusColumn: e.column
    }), setTimeout(() => {
      const n = this.getNextFocusIndexForAutoHeight(e, r);
      this.navigateTo({
        scrollIndex: t,
        scrollType: r ? "bottom" : "top",
        scrollColumn: null,
        focusIndex: n,
        focusColumn: e.column,
        isAsync: !0
      });
    }, 50);
  }
  getNextFocusIndexForAutoHeight(e, t = !1) {
    const r = t ? -1 : 1, n = this.getViewportHeight(), a = this.pageBoundsService.getLastRow();
    let u = 0, s = e.rowIndex;
    for (; s >= 0 && s <= a; ) {
      const c = this.rowModel.getRow(s);
      if (c) {
        const i = c.rowHeight ?? 0;
        if (u + i > n)
          break;
        u += i;
      }
      s += r;
    }
    return Math.max(0, Math.min(s, a));
  }
  getViewportHeight() {
    const e = this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(), t = this.scrollVisibleService.getScrollbarWidth();
    let r = e.bottom - e.top;
    return this.ctrlsService.get("center").isHorizontalScrollShowing() && (r -= t), r;
  }
  isRowTallerThanView(e) {
    const t = this.rowModel.getRow(e);
    if (!t)
      return !1;
    const r = t.rowHeight;
    return typeof r != "number" ? !1 : r > this.getViewportHeight();
  }
  onCtrlUpDownLeftRight(e, t) {
    const r = this.cellNavigationService.getNextCellToFocus(e, t, !0), { rowIndex: n } = r, a = r.column;
    this.navigateTo({
      scrollIndex: n,
      scrollType: null,
      scrollColumn: a,
      focusIndex: n,
      focusColumn: a
    });
  }
  // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring
  // same cell into view (which means either scroll all the way up, or all the way down).
  onHomeOrEndKey(e) {
    const t = e === dr.PAGE_HOME, r = this.visibleColsService.getAllCols(), n = t ? r[0] : di(r), a = t ? this.pageBoundsService.getFirstRow() : this.pageBoundsService.getLastRow();
    this.navigateTo({
      scrollIndex: a,
      scrollType: null,
      scrollColumn: n,
      focusIndex: a,
      focusColumn: n
    });
  }
  // result of keyboard event
  onTabKeyDown(e, t) {
    const r = t.shiftKey, n = this.tabToNextCellCommon(e, r, t);
    if (n !== !1) {
      n ? t.preventDefault() : n === null && this.focusService.allowFocusForNextGridCoreContainer(r);
      return;
    }
    if (r) {
      const { rowIndex: a, rowPinned: u } = e.getRowPosition();
      (u ? a === 0 : a === this.pageBoundsService.getFirstRow()) && (this.gos.get("headerHeight") === 0 || this.focusService.isHeaderFocusSuppressed() ? this.focusService.focusNextGridCoreContainer(!0, !0) : (t.preventDefault(), this.focusService.focusPreviousFromFirstCell(t)));
    } else
      e instanceof Nh && e.focusCell(!0), (!r && this.focusService.focusOverlay(!1) || this.focusService.focusNextGridCoreContainer(r)) && t.preventDefault();
  }
  // comes from API
  tabToNextCell(e, t) {
    const r = this.focusService.getFocusedCell();
    if (!r)
      return !1;
    let n = this.getCellByPosition(r);
    return !n && (n = this.rowRenderer.getRowByPosition(r), !n || !n.isFullWidth()) ? !1 : !!this.tabToNextCellCommon(n, e, t);
  }
  tabToNextCellCommon(e, t, r) {
    let n = e.isEditing();
    if (!n && e instanceof Nh) {
      const s = e.getRowCtrl();
      s && (n = s.isEditing());
    }
    let a;
    return n ? this.gos.get("editType") === "fullRow" ? a = this.moveToNextEditingRow(e, t, r) : a = this.moveToNextEditingCell(e, t, r) : a = this.moveToNextCellNotEditing(e, t), a === null ? a : a || !!this.focusService.getFocusedHeader();
  }
  // returns null if no navigation should be performed
  moveToNextEditingCell(e, t, r = null) {
    const n = e.getCellPosition();
    e.getGui().focus(), e.stopEditing();
    const a = this.findNextCellToFocusOn(n, t, !0);
    return a === !1 ? null : a == null ? !1 : (a.startEditing(null, !0, r), a.focusCell(!1), !0);
  }
  // returns null if no navigation should be performed
  moveToNextEditingRow(e, t, r = null) {
    const n = e.getCellPosition(), a = this.findNextCellToFocusOn(n, t, !0);
    if (a === !1)
      return null;
    if (a == null)
      return !1;
    const u = a.getCellPosition(), s = this.isCellEditable(n), c = this.isCellEditable(u), i = u && n.rowIndex === u.rowIndex && n.rowPinned === u.rowPinned;
    return s && e.setFocusOutOnEditor(), i || (e.getRowCtrl().stopEditing(), a.getRowCtrl().startRowEditing(void 0, void 0, r)), c ? (a.setFocusInOnEditor(), a.focusCell()) : a.focusCell(!0), !0;
  }
  // returns null if no navigation should be performed
  moveToNextCellNotEditing(e, t) {
    const r = this.visibleColsService.getAllCols();
    let n;
    e instanceof Gh ? n = {
      ...e.getRowPosition(),
      column: t ? r[0] : di(r)
    } : n = e.getCellPosition();
    const a = this.findNextCellToFocusOn(n, t, !1);
    if (a === !1)
      return null;
    if (a instanceof Nh)
      a.focusCell(!0);
    else if (a)
      return this.tryToFocusFullWidthRow(a.getRowPosition(), t);
    return $r(a);
  }
  /**
   * called by the cell, when tab is pressed while editing.
   * @return: RenderedCell when navigation successful, false if navigation should not be performed, otherwise null
   */
  findNextCellToFocusOn(e, t, r) {
    var a;
    let n = e;
    for (; ; ) {
      e !== n && (e = n), t || (n = this.getLastCellOfColSpan(n)), n = this.cellNavigationService.getNextTabbedCell(n, t);
      const u = this.gos.getCallback("tabToNextCell");
      if ($r(u)) {
        const l = u({
          backwards: t,
          editing: r,
          previousCellPosition: e,
          nextCellPosition: n || null
        });
        if (l === !0 || l === null)
          l === null && Fr(
            "Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."
          ), n = e;
        else {
          if (l === !1)
            return !1;
          n = {
            rowIndex: l.rowIndex,
            column: l.column,
            rowPinned: l.rowPinned
          };
        }
      }
      if (!n)
        return null;
      if (n.rowIndex < 0) {
        const i = this.headerNavigationService.getHeaderRowCount();
        return this.focusService.focusHeaderPosition({
          headerPosition: {
            headerRowIndex: i + n.rowIndex,
            column: n.column
          },
          fromCell: !0
        }), null;
      }
      const s = this.gos.get("editType") === "fullRow";
      if (r && !s && !this.isCellEditable(n))
        continue;
      this.ensureCellVisible(n);
      const c = this.getCellByPosition(n);
      if (!c) {
        const i = this.rowRenderer.getRowByPosition(n);
        if (!i || !i.isFullWidth() || r)
          continue;
        return i;
      }
      if (!c.isSuppressNavigable())
        return (a = this.rangeService) == null || a.setRangeToCell(n), c;
    }
  }
  isCellEditable(e) {
    const t = this.lookupRowNodeForCell(e);
    return t ? e.column.isCellEditable(t) : !1;
  }
  getCellByPosition(e) {
    const t = this.rowRenderer.getRowByPosition(e);
    return t ? t.getCellCtrl(e.column) : null;
  }
  lookupRowNodeForCell(e) {
    return e.rowPinned === "top" ? this.pinnedRowModel.getPinnedTopRow(e.rowIndex) : e.rowPinned === "bottom" ? this.pinnedRowModel.getPinnedBottomRow(e.rowIndex) : this.rowModel.getRow(e.rowIndex);
  }
  // we use index for rows, but column object for columns, as the next column (by index) might not
  // be visible (header grouping) so it's not reliable, so using the column object instead.
  navigateToNextCell(e, t, r, n) {
    let a = r, u = !1;
    for (; a && (a === r || !this.isValidNavigateCell(a)); )
      this.gos.get("enableRtl") ? t === dr.LEFT && (a = this.getLastCellOfColSpan(a)) : t === dr.RIGHT && (a = this.getLastCellOfColSpan(a)), a = this.cellNavigationService.getNextCellToFocus(t, a), u = mi(a);
    if (u && e && e.key === dr.UP && (a = {
      rowIndex: -1,
      rowPinned: null,
      column: r.column
    }), n) {
      const c = this.gos.getCallback("navigateToNextCell");
      if ($r(c)) {
        const l = c({
          key: t,
          previousCellPosition: r,
          nextCellPosition: a || null,
          event: e
        });
        $r(l) ? a = {
          rowPinned: l.rowPinned,
          rowIndex: l.rowIndex,
          column: l.column
        } : a = null;
      }
    }
    if (!a)
      return;
    if (a.rowIndex < 0) {
      const c = this.headerNavigationService.getHeaderRowCount();
      this.focusService.focusHeaderPosition({
        headerPosition: { headerRowIndex: c + a.rowIndex, column: r.column },
        event: e || void 0,
        fromCell: !0
      });
      return;
    }
    const s = this.getNormalisedPosition(a);
    s ? this.focusPosition(s) : this.tryToFocusFullWidthRow(a);
  }
  getNormalisedPosition(e) {
    this.ensureCellVisible(e);
    const t = this.getCellByPosition(e);
    return t ? (e = t.getCellPosition(), this.ensureCellVisible(e), e) : null;
  }
  tryToFocusFullWidthRow(e, t) {
    const r = this.visibleColsService.getAllCols(), n = this.rowRenderer.getRowByPosition(e);
    if (!n || !n.isFullWidth())
      return !1;
    const a = this.focusService.getFocusedCell(), u = {
      rowIndex: e.rowIndex,
      rowPinned: e.rowPinned,
      column: e.column || (t ? di(r) : r[0])
    };
    this.focusPosition(u);
    const s = t ?? (a != null && this.rowPositionUtils.before(u, a));
    return this.eventService.dispatchEvent({
      type: "fullWidthRowFocused",
      rowIndex: u.rowIndex,
      rowPinned: u.rowPinned,
      column: u.column,
      isFullWidthCell: !0,
      fromBelow: s
    }), !0;
  }
  focusPosition(e) {
    var t;
    this.focusService.setFocusedCell({
      rowIndex: e.rowIndex,
      column: e.column,
      rowPinned: e.rowPinned,
      forceBrowserFocus: !0
    }), (t = this.rangeService) == null || t.setRangeToCell(e);
  }
  isValidNavigateCell(e) {
    return !!this.rowPositionUtils.getRowNode(e);
  }
  getLastCellOfColSpan(e) {
    const t = this.getCellByPosition(e);
    if (!t)
      return e;
    const r = t.getColSpanningList();
    return r.length === 1 ? e : {
      rowIndex: e.rowIndex,
      column: di(r),
      rowPinned: e.rowPinned
    };
  }
  ensureCellVisible(e) {
    const t = U1(this.gos), r = this.rowModel.getRow(e.rowIndex);
    !(t && (r == null ? void 0 : r.sticky)) && mi(e.rowPinned) && this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex), e.column.isPinned() || this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column);
  }
}, T$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "horizontalResizeService";
  }
  wireBeans(e) {
    this.dragService = e.dragService, this.ctrlsService = e.ctrlsService;
  }
  addResizeBar(e) {
    const t = {
      dragStartPixels: e.dragStartPixels || 0,
      eElement: e.eResizeBar,
      onDragStart: this.onDragStart.bind(this, e),
      onDragStop: this.onDragStop.bind(this, e),
      onDragging: this.onDragging.bind(this, e),
      onDragCancel: this.onDragStop.bind(this, e),
      includeTouch: !0,
      stopPropagationForTouch: !0
    };
    return this.dragService.addDragSource(t), () => this.dragService.removeDragSource(t);
  }
  onDragStart(e, t) {
    this.dragStartX = t.clientX, this.setResizeIcons();
    const r = t instanceof MouseEvent && t.shiftKey === !0;
    e.onResizeStart(r);
  }
  setResizeIcons() {
    const e = this.ctrlsService.get("gridCtrl");
    e.setResizeCursor(!0), e.disableUserSelect(!0);
  }
  onDragStop(e) {
    e.onResizeEnd(this.resizeAmount), this.resetIcons();
  }
  resetIcons() {
    const e = this.ctrlsService.get("gridCtrl");
    e.setResizeCursor(!1), e.disableUserSelect(!1);
  }
  onDragging(e, t) {
    this.resizeAmount = t.clientX - this.dragStartX, e.onResizing(this.resizeAmount);
  }
}, R$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "filterMenuFactory";
  }
  wireBeans(e) {
    this.popupService = e.popupService, this.focusService = e.focusService, this.ctrlsService = e.ctrlsService, this.menuService = e.menuService;
  }
  hideActiveMenu() {
    this.hidePopup && this.hidePopup();
  }
  showMenuAfterMouseEvent(e, t, r) {
    this.showPopup(
      e,
      (n) => {
        this.popupService.positionPopupUnderMouseEvent({
          column: e,
          type: r,
          mouseEvent: t,
          ePopup: n
        });
      },
      r,
      t.target,
      this.menuService.isLegacyMenuEnabled()
    );
  }
  showMenuAfterButtonClick(e, t, r) {
    let n = -1, a = "left";
    const u = this.menuService.isLegacyMenuEnabled();
    !u && this.gos.get("enableRtl") && (n = 1, a = "right");
    const s = u ? void 0 : 4 * n, c = u ? void 0 : 4;
    this.showPopup(
      e,
      (i) => {
        this.popupService.positionPopupByComponent({
          type: r,
          eventSource: t,
          ePopup: i,
          nudgeX: s,
          nudgeY: c,
          alignSide: a,
          keepWithinBounds: !0,
          position: "under",
          column: e
        });
      },
      r,
      t,
      u
    );
  }
  showPopup(e, t, r, n, a) {
    const u = e ? this.createBean(new eY(e, "COLUMN_MENU")) : void 0;
    if (this.activeMenu = u, !(u != null && u.hasFilter()) || !e)
      throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");
    const s = document.createElement("div");
    vu(s, "presentation"), s.classList.add("ag-menu"), a || s.classList.add("ag-filter-menu"), [this.tabListener] = this.addManagedElementListeners(s, {
      keydown: (y) => this.trapFocusWithin(y, s)
    }), s.appendChild(u == null ? void 0 : u.getGui());
    let c;
    const i = () => u == null ? void 0 : u.afterGuiDetached(), l = this.menuService.isColumnMenuAnchoringEnabled() ? n ?? this.ctrlsService.getGridBodyCtrl().getGui() : void 0, v = (y) => {
      e.setMenuVisible(!1, "contextMenu");
      const C = y instanceof KeyboardEvent;
      if (this.tabListener && (this.tabListener = this.tabListener()), C && n && lc(n)) {
        const m = this.focusService.findTabbableParent(n);
        m && m.focus();
      }
      i(), this.destroyBean(this.activeMenu), this.dispatchVisibleChangedEvent(!1, r, e);
    }, f = this.localeService.getLocaleTextFunc(), p = a && r !== "columnFilter" ? f("ariaLabelColumnMenu", "Column Menu") : f("ariaLabelColumnFilter", "Column Filter"), g = this.popupService.addPopup({
      modal: !0,
      eChild: s,
      closeOnEsc: !0,
      closedCallback: v,
      positionCallback: () => t(s),
      anchorToElement: l,
      ariaLabel: p
    });
    g && (this.hidePopup = c = g.hideFunc), u.afterInit().then(() => {
      t(s), u.afterGuiAttached({ container: r, hidePopup: c });
    }), e.setMenuVisible(!0, "contextMenu"), this.dispatchVisibleChangedEvent(!0, r, e);
  }
  trapFocusWithin(e, t) {
    e.key !== dr.TAB || e.defaultPrevented || this.focusService.findNextFocusableElement(t, !1, e.shiftKey) || (e.preventDefault(), this.focusService.focusInto(t, e.shiftKey));
  }
  dispatchVisibleChangedEvent(e, t, r) {
    this.eventService.dispatchEvent({
      type: "columnMenuVisibleChanged",
      visible: e,
      switchingTab: !1,
      key: t,
      column: r ?? null,
      columnGroup: null
    });
  }
  isMenuEnabled(e) {
    return e.isFilterAllowed() && (e.getColDef().menuTabs ?? ["filterMenuTab"]).includes("filterMenuTab");
  }
  showMenuAfterContextMenuEvent() {
  }
  destroy() {
    this.destroyBean(this.activeMenu), super.destroy();
  }
}, A$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "resizeObserverService";
  }
  observeResize(e, t) {
    const n = ML(this.gos).ResizeObserver, a = n ? new n(t) : null;
    return a == null || a.observe(e), () => a == null ? void 0 : a.disconnect();
  }
}, E$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "animationFrameService", this.createTasksP1 = { list: [], sorted: !1 }, this.createTasksP2 = { list: [], sorted: !1 }, this.destroyTasks = [], this.ticking = !1, this.scrollGoingDown = !0, this.lastPage = 0, this.lastScrollTop = 0, this.taskCount = 0, this.cancelledTasks = /* @__PURE__ */ new Set();
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.paginationService = e.paginationService;
  }
  setScrollTop(e) {
    var r;
    const t = this.gos.get("pagination");
    if (this.scrollGoingDown = e >= this.lastScrollTop, t && e === 0) {
      const n = ((r = this.paginationService) == null ? void 0 : r.getCurrentPage()) ?? 0;
      n !== this.lastPage && (this.lastPage = n, this.scrollGoingDown = !0);
    }
    this.lastScrollTop = e;
  }
  postConstruct() {
    this.useAnimationFrame = !this.gos.get("suppressAnimationFrame");
  }
  isOn() {
    return this.useAnimationFrame;
  }
  // this method is for our AG Grid sanity only - if animation frames are turned off,
  // then no place in the code should be looking to add any work to be done in animation
  // frames. this stops bugs - where some code is asking for a frame to be executed
  // when it should not.
  verifyAnimationFrameOn(e) {
    this.useAnimationFrame === !1 && Fr(`AnimationFrameService.${e} called but animation frames are off`);
  }
  createTask(e, t, r) {
    this.verifyAnimationFrameOn(r);
    const n = { task: e, index: t, createOrder: ++this.taskCount };
    this.addTaskToList(this[r], n), this.schedule();
  }
  cancelTask(e) {
    this.cancelledTasks.add(e);
  }
  addTaskToList(e, t) {
    e.list.push(t), e.sorted = !1;
  }
  sortTaskList(e) {
    if (e.sorted)
      return;
    const t = this.scrollGoingDown ? 1 : -1;
    e.list.sort(
      (r, n) => r.index !== n.index ? t * (n.index - r.index) : n.createOrder - r.createOrder
    ), e.sorted = !0;
  }
  addDestroyTask(e) {
    this.verifyAnimationFrameOn("createTasksP3"), this.destroyTasks.push(e), this.schedule();
  }
  executeFrame(e) {
    this.verifyAnimationFrameOn("executeFrame");
    const t = this.createTasksP1, r = t.list, n = this.createTasksP2, a = n.list, u = this.destroyTasks, s = (/* @__PURE__ */ new Date()).getTime();
    let c = (/* @__PURE__ */ new Date()).getTime() - s;
    const i = e <= 0, l = this.ctrlsService.getGridBodyCtrl();
    for (; i || c < e; ) {
      if (!l.getScrollFeature().scrollGridIfNeeded()) {
        let f;
        if (r.length)
          this.sortTaskList(t), f = r.pop().task;
        else if (a.length)
          this.sortTaskList(n), f = a.pop().task;
        else if (u.length)
          f = u.pop();
        else {
          this.cancelledTasks.clear();
          break;
        }
        this.cancelledTasks.has(f) || f();
      }
      c = (/* @__PURE__ */ new Date()).getTime() - s;
    }
    r.length || a.length || u.length ? this.requestFrame() : this.stopTicking();
  }
  stopTicking() {
    this.ticking = !1;
  }
  flushAllFrames() {
    this.useAnimationFrame && this.executeFrame(-1);
  }
  schedule() {
    this.useAnimationFrame && (this.ticking || (this.ticking = !0, this.requestFrame()));
  }
  requestFrame() {
    const e = this.executeFrame.bind(this, 60);
    this.requestAnimationFrame(e);
  }
  requestAnimationFrame(e) {
    const t = ML(this.gos);
    t.requestAnimationFrame ? t.requestAnimationFrame(e) : t.webkitRequestAnimationFrame ? t.webkitRequestAnimationFrame(e) : t.setTimeout(e, 0);
  }
  isQueueEmpty() {
    return !this.ticking;
  }
  // a debounce utility used for parts of the app involved with rendering.
  // the advantage over normal debounce is the client can call flushAllFrames()
  // to make sure all rendering is complete. we don't wait any milliseconds,
  // as this is intended to batch calls in one VM turn.
  debounce(e) {
    let t = !1;
    return () => {
      if (!this.isOn()) {
        window.setTimeout(e, 0);
        return;
      }
      t || (t = !0, this.addDestroyTask(() => {
        t = !1, e();
      }));
    };
  }
}, fi = /* @__PURE__ */ ((e) => (e.EVERYTHING = "group", e.FILTER = "filter", e.SORT = "sort", e.MAP = "map", e.AGGREGATE = "aggregate", e.FILTER_AGGREGATES = "filter_aggregates", e.PIVOT = "pivot", e.NOTHING = "nothing", e))(fi || {}), M$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "expansionService";
  }
  wireBeans(e) {
    this.rowModel = e.rowModel;
  }
  postConstruct() {
    this.isClientSideRowModel = da(this.gos);
  }
  expandRows(e) {
    if (!this.isClientSideRowModel)
      return;
    const t = new Set(e);
    this.rowModel.forEachNode((r) => {
      r.id && t.has(r.id) && (r.expanded = !0);
    }), this.onGroupExpandedOrCollapsed();
  }
  getExpandedRows() {
    const e = [];
    return this.rowModel.forEachNode(({ expanded: t, id: r }) => {
      t && r && e.push(r);
    }), e;
  }
  expandAll(e) {
    this.isClientSideRowModel && this.rowModel.expandOrCollapseAll(e);
  }
  setRowNodeExpanded(e, t, r, n) {
    e && (r && e.parent && e.parent.level !== -1 && this.setRowNodeExpanded(e.parent, t, r, n), e.setExpanded(t, void 0, n));
  }
  onGroupExpandedOrCollapsed() {
    this.isClientSideRowModel && this.rowModel.refreshModel({
      step: "map"
      /* MAP */
    });
  }
}, D$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "menuService";
  }
  wireBeans(e) {
    this.valueService = e.valueService, this.filterMenuFactory = e.filterMenuFactory, this.ctrlsService = e.ctrlsService, this.animationFrameService = e.animationFrameService, this.filterManager = e.filterManager, this.rowRenderer = e.rowRenderer, this.columnChooserFactory = e.columnChooserFactory, this.contextMenuFactory = e.contextMenuFactory, this.enterpriseMenuFactory = e.enterpriseMenuFactory;
  }
  postConstruct() {
    this.activeMenuFactory = this.enterpriseMenuFactory ?? this.filterMenuFactory;
  }
  showColumnMenu(e) {
    this.showColumnMenuCommon(this.activeMenuFactory, e, "columnMenu");
  }
  showFilterMenu(e) {
    const t = this.enterpriseMenuFactory && this.isLegacyMenuEnabled() ? this.enterpriseMenuFactory : this.filterMenuFactory;
    this.showColumnMenuCommon(t, e, e.containerType, !0);
  }
  showHeaderContextMenu(e, t, r) {
    this.activeMenuFactory.showMenuAfterContextMenuEvent(e, t, r);
  }
  getContextMenuPosition(e, t) {
    const r = this.getRowCtrl(e), n = this.getCellGui(r, t);
    if (!n)
      return r ? { x: 0, y: r.getRowYPosition() } : { x: 0, y: 0 };
    const a = n.getBoundingClientRect();
    return {
      x: a.x + a.width / 2,
      y: a.y + a.height / 2
    };
  }
  showContextMenu(e) {
    var u;
    const { rowNode: t } = e, r = e.column;
    let { anchorToElement: n, value: a } = e;
    t && r && a == null && (a = this.valueService.getValueForDisplay(r, t)), n == null && (n = this.getContextMenuAnchorElement(t, r)), (u = this.contextMenuFactory) == null || u.onContextMenu(
      e.mouseEvent ?? null,
      e.touchEvent ?? null,
      t ?? null,
      r ?? null,
      a,
      n
    );
  }
  showColumnChooser(e) {
    var t;
    (t = this.columnChooserFactory) == null || t.showColumnChooser(e);
  }
  hidePopupMenu() {
    var e;
    (e = this.contextMenuFactory) == null || e.hideActiveMenu(), this.activeMenuFactory.hideActiveMenu();
  }
  hideColumnChooser() {
    var e;
    (e = this.columnChooserFactory) == null || e.hideActiveColumnChooser();
  }
  isColumnMenuInHeaderEnabled(e) {
    const { suppressMenu: t, suppressHeaderMenuButton: r } = e.getColDef();
    return !(r ?? t) && this.activeMenuFactory.isMenuEnabled(e) && (this.isLegacyMenuEnabled() || !!this.enterpriseMenuFactory);
  }
  isFilterMenuInHeaderEnabled(e) {
    var t;
    return !e.getColDef().suppressHeaderFilterButton && !!((t = this.filterManager) != null && t.isFilterAllowed(e));
  }
  isHeaderContextMenuEnabled(e) {
    const t = e && of(e) ? e.getColDef() : e == null ? void 0 : e.getColGroupDef();
    return !(t != null && t.suppressHeaderContextMenu) && this.getColumnMenuType() === "new";
  }
  isHeaderMenuButtonAlwaysShowEnabled() {
    return this.isSuppressMenuHide();
  }
  isHeaderMenuButtonEnabled() {
    const e = !this.isSuppressMenuHide();
    return !(df() && e);
  }
  isHeaderFilterButtonEnabled(e) {
    return this.isFilterMenuInHeaderEnabled(e) && !this.isLegacyMenuEnabled() && !this.isFloatingFilterButtonDisplayed(e);
  }
  isFilterMenuItemEnabled(e) {
    var t;
    return !!((t = this.filterManager) != null && t.isFilterAllowed(e)) && !this.isLegacyMenuEnabled() && !this.isFilterMenuInHeaderEnabled(e) && !this.isFloatingFilterButtonDisplayed(e);
  }
  isColumnMenuAnchoringEnabled() {
    return !this.isLegacyMenuEnabled();
  }
  areAdditionalColumnMenuItemsEnabled() {
    return this.getColumnMenuType() === "new";
  }
  isLegacyMenuEnabled() {
    return this.getColumnMenuType() === "legacy";
  }
  isFloatingFilterButtonEnabled(e) {
    var n;
    const t = e.getColDef(), r = (n = t.floatingFilterComponentParams) == null ? void 0 : n.suppressFilterButton;
    return r != null && Fr(
      "As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."
    ), t.suppressFloatingFilterButton == null ? !r : !t.suppressFloatingFilterButton;
  }
  getColumnMenuType() {
    return this.gos.get("columnMenu");
  }
  isFloatingFilterButtonDisplayed(e) {
    return !!e.getColDef().floatingFilter && this.isFloatingFilterButtonEnabled(e);
  }
  isSuppressMenuHide() {
    const e = this.gos.get("suppressMenuHide");
    return this.isLegacyMenuEnabled() ? this.gos.exists("suppressMenuHide") ? e : !1 : e;
  }
  showColumnMenuCommon(e, t, r, n) {
    const { positionBy: a } = t, u = t.column;
    if (a === "button") {
      const { buttonElement: s } = t;
      e.showMenuAfterButtonClick(u, s, r, n);
    } else if (a === "mouse") {
      const { mouseEvent: s } = t;
      e.showMenuAfterMouseEvent(u, s, r, n);
    } else u && (this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(u, "auto"), this.animationFrameService.requestAnimationFrame(() => {
      var c;
      const s = (c = this.ctrlsService.getHeaderRowContainerCtrl(u.getPinned())) == null ? void 0 : c.getHeaderCtrlForColumn(u);
      s && e.showMenuAfterButtonClick(
        u,
        s.getAnchorElementForMenu(n),
        r,
        !0
      );
    }));
  }
  getRowCtrl(e) {
    const { rowIndex: t, rowPinned: r } = e || {};
    if (t != null)
      return this.rowRenderer.getRowByPosition({ rowIndex: t, rowPinned: r }) || void 0;
  }
  getCellGui(e, t) {
    if (!e || !t)
      return;
    const r = e.getCellCtrl(t);
    return (r == null ? void 0 : r.getGui()) || void 0;
  }
  getContextMenuAnchorElement(e, t) {
    const r = this.ctrlsService.getGridBodyCtrl().getGridBodyElement(), n = this.getRowCtrl(e);
    if (!n)
      return r;
    const a = this.getCellGui(n, t);
    return a || (n.isFullWidth() ? n.getFullWidthElement() : r);
  }
}, F$ = class extends Ph {
  constructor(e) {
    super(e, "ag-text-area", null, "textarea");
  }
  setValue(e, t) {
    const r = super.setValue(e, t);
    return this.eInput.value = e, r;
  }
  setCols(e) {
    return this.eInput.cols = e, this;
  }
  setRows(e) {
    return this.eInput.rows = e, this;
  }
}, P$ = {
  selector: "AG-INPUT-TEXT-AREA",
  component: F$
}, I$ = class extends Vv {
  constructor() {
    super(
      /* html */
      `<div class="ag-large-text">
        <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
        </div>`,
      [P$]
    ), this.eTextArea = In;
  }
  init(e) {
    this.params = e, this.focusAfterAttached = e.cellStartedEdit, this.eTextArea.setMaxLength(e.maxLength || 200).setCols(e.cols || 60).setRows(e.rows || 10), $r(e.value, !0) && this.eTextArea.setValue(e.value.toString(), !0), this.addGuiEventListener("keydown", this.onKeyDown.bind(this)), this.activateTabIndex();
  }
  onKeyDown(e) {
    const t = e.key;
    (t === dr.LEFT || t === dr.UP || t === dr.RIGHT || t === dr.DOWN || e.shiftKey && t === dr.ENTER) && e.stopPropagation();
  }
  afterGuiAttached() {
    const e = this.localeService.getLocaleTextFunc();
    this.eTextArea.setInputAriaLabel(e("ariaInputEditor", "Input Editor")), this.focusAfterAttached && this.eTextArea.getFocusableElement().focus();
  }
  getValue() {
    const e = this.eTextArea.getValue();
    return !$r(e) && !$r(this.params.value) ? this.params.value : this.params.parseValue(e);
  }
}, L$ = class extends Vv {
  constructor(e) {
    super(
      /* html */
      '<div class="ag-popup-editor" tabindex="-1"/>'
    ), this.params = e;
  }
  postConstruct() {
    zh(this.gos, this.getGui(), "popupEditorWrapper", !0), this.addKeyDownListener();
  }
  addKeyDownListener() {
    const e = this.getGui(), t = this.params, r = (n) => {
      yT(this.gos, n, t.node, t.column, !0) || t.onKeyDown(n);
    };
    this.addManagedElementListeners(e, { keydown: r });
  }
}, k$ = class extends Vv {
  constructor() {
    super(
      /* html */
      `<div class="ag-cell-edit-wrapper">
                <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select>
            </div>`,
      [sY]
    ), this.eSelect = In, this.startedByEnter = !1;
  }
  wireBeans(e) {
    this.valueService = e.valueService;
  }
  init(e) {
    this.focusAfterAttached = e.cellStartedEdit;
    const { eSelect: t, valueService: r, gos: n } = this, { values: a, value: u, eventKey: s } = e;
    if (mi(a)) {
      Fr("no values found for select cellEditor");
      return;
    }
    this.startedByEnter = s != null ? s === dr.ENTER : !1;
    let c = !1;
    a.forEach((f) => {
      const p = { value: f }, g = r.formatValue(e.column, null, f), y = g != null;
      p.text = y ? g : f, t.addOption(p), c = c || u === f;
    }), c ? t.setValue(e.value, !0) : e.values.length && t.setValue(e.values[0], !0);
    const { valueListGap: i, valueListMaxWidth: l, valueListMaxHeight: v } = e;
    i != null && t.setPickerGap(i), v != null && t.setPickerMaxHeight(v), l != null && t.setPickerMaxWidth(l), n.get("editType") !== "fullRow" && this.addManagedListeners(this.eSelect, { selectedItem: () => e.stopEditing() });
  }
  afterGuiAttached() {
    this.focusAfterAttached && this.eSelect.getFocusableElement().focus(), this.startedByEnter && setTimeout(() => {
      this.isAlive() && this.eSelect.showPicker();
    });
  }
  focusIn() {
    this.eSelect.getFocusableElement().focus();
  }
  getValue() {
    return this.eSelect.getValue();
  }
  isPopup() {
    return !1;
  }
}, K1 = class extends Vv {
  constructor(e) {
    super(
      /* html */
      `
            <div class="ag-cell-edit-wrapper">
                ${e.getTemplate()}
            </div>`,
      e.getAgComponents()
    ), this.cellEditorInput = e, this.eInput = In;
  }
  init(e) {
    this.params = e;
    const { cellStartedEdit: t, eventKey: r, suppressPreventDefault: n } = e, a = this.eInput;
    this.cellEditorInput.init(a, e);
    let u, s = !0;
    t ? (this.focusAfterAttached = !0, r === dr.BACKSPACE || r === dr.DELETE ? u = "" : r && r.length === 1 ? n ? s = !1 : u = r : (u = this.cellEditorInput.getStartValue(), r !== dr.F2 && (this.highlightAllOnFocus = !0))) : (this.focusAfterAttached = !1, u = this.cellEditorInput.getStartValue()), s && u != null && a.setStartValue(u), this.addManagedElementListeners(a.getGui(), {
      keydown: (c) => {
        const { key: i } = c;
        (i === dr.PAGE_UP || i === dr.PAGE_DOWN) && c.preventDefault();
      }
    });
  }
  afterGuiAttached() {
    var n, a;
    const e = this.localeService.getLocaleTextFunc(), t = this.eInput;
    if (t.setInputAriaLabel(e("ariaInputEditor", "Input Editor")), !this.focusAfterAttached)
      return;
    sc() || t.getFocusableElement().focus();
    const r = t.getInputElement();
    this.highlightAllOnFocus ? r.select() : (a = (n = this.cellEditorInput).setCaret) == null || a.call(n);
  }
  // gets called when tabbing through cells and in full row edit mode
  focusIn() {
    const e = this.eInput, t = e.getFocusableElement(), r = e.getInputElement();
    t.focus(), r.select();
  }
  getValue() {
    return this.cellEditorInput.getValue();
  }
  isPopup() {
    return !1;
  }
}, O$ = class {
  getTemplate() {
    return (
      /* html */
      '<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>'
    );
  }
  getAgComponents() {
    return [$1];
  }
  init(e, t) {
    this.eInput = e, this.params = t, t.maxLength != null && e.setMaxLength(t.maxLength);
  }
  getValue() {
    const e = this.eInput.getValue();
    return !$r(e) && !$r(this.params.value) ? this.params.value : this.params.parseValue(e);
  }
  getStartValue() {
    return this.params.useFormatter || this.params.column.getColDef().refData ? this.params.formatValue(this.params.value) : this.params.value;
  }
  setCaret() {
    const e = this.eInput.getValue(), t = $r(e) && e.length || 0;
    t && this.eInput.getInputElement().setSelectionRange(t, t);
  }
}, Jk = class extends K1 {
  constructor() {
    super(new O$());
  }
}, N$ = class {
  getTemplate() {
    return (
      /* html */
      '<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>'
    );
  }
  getAgComponents() {
    return [mY];
  }
  init(e, t) {
    this.eInput = e, this.params = t, t.max != null && e.setMax(t.max), t.min != null && e.setMin(t.min), t.precision != null && e.setPrecision(t.precision), t.step != null && e.setStep(t.step);
    const r = e.getInputElement();
    t.preventStepping ? e.addManagedElementListeners(r, { keydown: this.preventStepping }) : t.showStepperButtons && r.classList.add("ag-number-field-input-stepper");
  }
  preventStepping(e) {
    (e.key === dr.UP || e.key === dr.DOWN) && e.preventDefault();
  }
  getValue() {
    const e = this.eInput.getValue();
    if (!$r(e) && !$r(this.params.value))
      return this.params.value;
    let t = this.params.parseValue(e);
    if (t == null)
      return t;
    if (typeof t == "string") {
      if (t === "")
        return null;
      t = Number(t);
    }
    return isNaN(t) ? null : t;
  }
  getStartValue() {
    return this.params.value;
  }
  setCaret() {
    sc() && this.eInput.getInputElement().focus({ preventScroll: !0 });
  }
}, G$ = class extends K1 {
  constructor() {
    super(new N$());
  }
}, H$ = class extends Zh {
  constructor(e) {
    super(e, "ag-date-field", "date");
  }
  postConstruct() {
    super.postConstruct();
    const e = sc();
    this.addManagedListeners(this.eInput, {
      wheel: this.onWheel.bind(this),
      mousedown: () => {
        this.isDisabled() || e || this.eInput.focus();
      }
    }), this.eInput.step = "any";
  }
  onWheel(e) {
    Sa(this.gos) === this.eInput && e.preventDefault();
  }
  setMin(e) {
    const t = e instanceof Date ? zl(e ?? null, !1) ?? void 0 : e;
    return this.min === t ? this : (this.min = t, Vl(this.eInput, "min", t), this);
  }
  setMax(e) {
    const t = e instanceof Date ? zl(e ?? null, !1) ?? void 0 : e;
    return this.max === t ? this : (this.max = t, Vl(this.eInput, "max", t), this);
  }
  setStep(e) {
    return this.step === e ? this : (this.step = e, Vl(this.eInput, "step", e), this);
  }
  getDate() {
    if (this.eInput.validity.valid)
      return ws(this.getValue()) ?? void 0;
  }
  setDate(e, t) {
    this.setValue(zl(e ?? null, !1), t);
  }
}, Qk = {
  selector: "AG-INPUT-DATE-FIELD",
  component: H$
}, B$ = class {
  getTemplate() {
    return (
      /* html */
      '<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'
    );
  }
  getAgComponents() {
    return [Qk];
  }
  init(e, t) {
    this.eInput = e, this.params = t, t.min != null && e.setMin(t.min), t.max != null && e.setMax(t.max), t.step != null && e.setStep(t.step);
  }
  getValue() {
    const e = this.eInput.getDate();
    return !$r(e) && !$r(this.params.value) ? this.params.value : e ?? null;
  }
  getStartValue() {
    const { value: e } = this.params;
    if (e instanceof Date)
      return zl(e, !1);
  }
}, V$ = class extends K1 {
  constructor() {
    super(new B$());
  }
}, z$ = class {
  constructor(e) {
    this.getDataTypeService = e;
  }
  getTemplate() {
    return (
      /* html */
      '<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'
    );
  }
  getAgComponents() {
    return [Qk];
  }
  init(e, t) {
    this.eInput = e, this.params = t, t.min != null && e.setMin(t.min), t.max != null && e.setMax(t.max), t.step != null && e.setStep(t.step);
  }
  getValue() {
    const e = this.formatDate(this.eInput.getDate());
    return !$r(e) && !$r(this.params.value) ? this.params.value : this.params.parseValue(e ?? "");
  }
  getStartValue() {
    return zl(this.parseDate(this.params.value ?? void 0) ?? null, !1);
  }
  parseDate(e) {
    const t = this.getDataTypeService();
    return t ? t.getDateParserFunction(this.params.column)(e) : ws(e) ?? void 0;
  }
  formatDate(e) {
    const t = this.getDataTypeService();
    return t ? t.getDateFormatterFunction(this.params.column)(e) : zl(e ?? null, !1) ?? void 0;
  }
}, W$ = class extends K1 {
  wireBeans(e) {
    this.dataTypeService = e.dataTypeService;
  }
  constructor() {
    super(new z$(() => this.dataTypeService));
  }
}, _$ = class extends Vv {
  constructor() {
    super(
      /* html */
      `
            <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
                <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
            </div>`,
      [J2]
    ), this.eCheckbox = In;
  }
  init(e) {
    this.params = e;
    const t = e.value ?? void 0;
    this.eCheckbox.setValue(t), this.eCheckbox.getInputElement().setAttribute("tabindex", "-1"), this.setAriaLabel(t), this.addManagedListeners(this.eCheckbox, {
      fieldValueChanged: (n) => this.setAriaLabel(n.selected)
    });
  }
  getValue() {
    return this.eCheckbox.getValue();
  }
  focusIn() {
    this.eCheckbox.getFocusableElement().focus();
  }
  afterGuiAttached() {
    this.params.cellStartedEdit && this.focusIn();
  }
  isPopup() {
    return !1;
  }
  setAriaLabel(e) {
    const t = this.localeService.getLocaleTextFunc(), r = z2(t, e), n = t("ariaToggleCellValue", "Press SPACE to toggle cell value");
    this.eCheckbox.setInputAriaLabel(`${n} (${r})`);
  }
}, bm = class {
  constructor(e) {
    this.cellValueChanges = e;
  }
}, Ex = class extends bm {
  constructor(e, t, r, n) {
    super(e), this.initialRange = t, this.finalRange = r, this.ranges = n;
  }
}, U$ = 10, fF = class {
  constructor(e) {
    this.actionStack = [], this.maxStackSize = e || U$, this.actionStack = new Array(this.maxStackSize);
  }
  pop() {
    return this.actionStack.pop();
  }
  push(e) {
    e.cellValueChanges && e.cellValueChanges.length > 0 && (this.actionStack.length === this.maxStackSize && this.actionStack.shift(), this.actionStack.push(e));
  }
  clear() {
    this.actionStack = [];
  }
  getCurrentStackSize() {
    return this.actionStack.length;
  }
}, j$ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "undoRedoService", this.cellValueChanges = [], this.activeCellEdit = null, this.activeRowEdit = null, this.isPasting = !1, this.isRangeInAction = !1, this.onCellValueChanged = (e) => {
      const t = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned }, r = this.activeCellEdit !== null && this.cellPositionUtils.equals(this.activeCellEdit, t), n = this.activeRowEdit !== null && this.rowPositionUtils.sameRow(this.activeRowEdit, t);
      if (!(r || n || this.isPasting || this.isRangeInAction))
        return;
      const { rowPinned: u, rowIndex: s, column: c, oldValue: i, value: l } = e, v = {
        rowPinned: u,
        rowIndex: s,
        columnId: c.getColId(),
        newValue: l,
        oldValue: i
      };
      this.cellValueChanges.push(v);
    }, this.clearStacks = () => {
      this.undoStack.clear(), this.redoStack.clear();
    };
  }
  wireBeans(e) {
    this.focusService = e.focusService, this.ctrlsService = e.ctrlsService, this.cellPositionUtils = e.cellPositionUtils, this.rowPositionUtils = e.rowPositionUtils, this.columnModel = e.columnModel, this.rangeService = e.rangeService;
  }
  postConstruct() {
    if (!this.gos.get("undoRedoCellEditing"))
      return;
    const e = this.gos.get("undoRedoCellEditingLimit");
    if (e <= 0)
      return;
    this.undoStack = new fF(e), this.redoStack = new fF(e), this.addListeners();
    const t = this.clearStacks.bind(this);
    this.addManagedEventListeners({
      cellValueChanged: this.onCellValueChanged.bind(this),
      // undo / redo is restricted to actual editing so we clear the stacks when other operations are
      // performed that change the order of the row / cols.
      modelUpdated: (r) => {
        r.keepUndoRedoStack || this.clearStacks();
      },
      columnPivotModeChanged: t,
      newColumnsLoaded: t,
      columnGroupOpened: t,
      columnRowGroupChanged: t,
      columnMoved: t,
      columnPinned: t,
      columnVisible: t,
      rowDragEnd: t
    }), this.ctrlsService.whenReady(this, (r) => {
      this.gridBodyCtrl = r.gridBodyCtrl;
    });
  }
  getCurrentUndoStackSize() {
    return this.undoStack ? this.undoStack.getCurrentStackSize() : 0;
  }
  getCurrentRedoStackSize() {
    return this.redoStack ? this.redoStack.getCurrentStackSize() : 0;
  }
  undo(e) {
    this.eventService.dispatchEvent({
      type: "undoStarted",
      source: e
    });
    const t = this.undoRedo(this.undoStack, this.redoStack, "initialRange", "oldValue", "undo");
    this.eventService.dispatchEvent({
      type: "undoEnded",
      source: e,
      operationPerformed: t
    });
  }
  redo(e) {
    this.eventService.dispatchEvent({
      type: "redoStarted",
      source: e
    });
    const t = this.undoRedo(this.redoStack, this.undoStack, "finalRange", "newValue", "redo");
    this.eventService.dispatchEvent({
      type: "redoEnded",
      source: e,
      operationPerformed: t
    });
  }
  undoRedo(e, t, r, n, a) {
    if (!e)
      return !1;
    const u = e.pop();
    return !u || !u.cellValueChanges ? !1 : (this.processAction(
      u,
      (s) => s[n],
      a
    ), u instanceof Ex ? this.processRange(this.rangeService, u.ranges || [u[r]]) : this.processCell(u.cellValueChanges), t.push(u), !0);
  }
  processAction(e, t, r) {
    e.cellValueChanges.forEach((n) => {
      const { rowIndex: a, rowPinned: u, columnId: s } = n, c = { rowIndex: a, rowPinned: u }, i = this.rowPositionUtils.getRowNode(c);
      i.displayed && i.setDataValue(s, t(n), r);
    });
  }
  processRange(e, t) {
    let r;
    e.removeAllCellRanges(!0), t.forEach((n, a) => {
      if (!n)
        return;
      const u = n.startRow, s = n.endRow;
      a === t.length - 1 && (r = {
        rowPinned: u.rowPinned,
        rowIndex: u.rowIndex,
        columnId: n.startColumn.getColId()
      }, this.setLastFocusedCell(r));
      const c = {
        rowStartIndex: u.rowIndex,
        rowStartPinned: u.rowPinned,
        rowEndIndex: s.rowIndex,
        rowEndPinned: s.rowPinned,
        columnStart: n.startColumn,
        columns: n.columns
      };
      e.addCellRange(c);
    });
  }
  processCell(e) {
    const t = e[0], { rowIndex: r, rowPinned: n } = t, a = { rowIndex: r, rowPinned: n }, u = this.rowPositionUtils.getRowNode(a), s = {
      rowPinned: t.rowPinned,
      rowIndex: u.rowIndex,
      columnId: t.columnId
    };
    this.setLastFocusedCell(s, this.rangeService);
  }
  setLastFocusedCell(e, t) {
    const { rowIndex: r, columnId: n, rowPinned: a } = e, u = this.gridBodyCtrl.getScrollFeature(), s = this.columnModel.getCol(n);
    if (!s)
      return;
    u.ensureIndexVisible(r), u.ensureColumnVisible(s);
    const c = { rowIndex: r, column: s, rowPinned: a };
    this.focusService.setFocusedCell({ ...c, forceBrowserFocus: !0 }), t == null || t.setRangeToCell(c);
  }
  addListeners() {
    this.addManagedEventListeners({
      rowEditingStarted: (e) => {
        this.activeRowEdit = { rowIndex: e.rowIndex, rowPinned: e.rowPinned };
      },
      rowEditingStopped: () => {
        const e = new bm(this.cellValueChanges);
        this.pushActionsToUndoStack(e), this.activeRowEdit = null;
      },
      cellEditingStarted: (e) => {
        this.activeCellEdit = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned };
      },
      cellEditingStopped: (e) => {
        if (this.activeCellEdit = null, e.valueChanged && !this.activeRowEdit && !this.isPasting && !this.isRangeInAction) {
          const r = new bm(this.cellValueChanges);
          this.pushActionsToUndoStack(r);
        }
      },
      pasteStart: () => {
        this.isPasting = !0;
      },
      pasteEnd: () => {
        const e = new bm(this.cellValueChanges);
        this.pushActionsToUndoStack(e), this.isPasting = !1;
      },
      fillStart: () => {
        this.isRangeInAction = !0;
      },
      fillEnd: (e) => {
        const t = new Ex(this.cellValueChanges, e.initialRange, e.finalRange);
        this.pushActionsToUndoStack(t), this.isRangeInAction = !1;
      },
      keyShortcutChangedCellStart: () => {
        this.isRangeInAction = !0;
      },
      keyShortcutChangedCellEnd: () => {
        let e;
        this.rangeService && nd(this.gos) ? e = new Ex(this.cellValueChanges, void 0, void 0, [
          ...this.rangeService.getCellRanges()
        ]) : e = new bm(this.cellValueChanges), this.pushActionsToUndoStack(e), this.isRangeInAction = !1;
      }
    });
  }
  pushActionsToUndoStack(e) {
    this.undoStack.push(e), this.cellValueChanges = [], this.redoStack.clear();
  }
};
function Y$(e) {
  return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();
}
function X$(e) {
  return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition();
}
function qk(e, t, r = "auto") {
  e.frameworkOverrides.wrapIncoming(
    () => e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t, r),
    "ensureVisible"
  );
}
function e4(e, t, r) {
  e.frameworkOverrides.wrapIncoming(
    () => e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t, r),
    "ensureVisible"
  );
}
function $$(e, t, r = null) {
  e.frameworkOverrides.wrapIncoming(
    () => e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t, r),
    "ensureVisible"
  );
}
function Z$(e) {
  var t;
  (t = e.undoRedoService) == null || t.undo("api");
}
function K$(e) {
  var t;
  (t = e.undoRedoService) == null || t.redo("api");
}
function J$(e, t = {}) {
  return e.rowRenderer.getCellEditorInstances(t).map(Em);
}
function Q$(e) {
  return e.rowRenderer.getEditingCells();
}
function q$(e, t = !1) {
  e.rowRenderer.stopEditing(t);
}
function eZ(e, t) {
  const r = e.columnModel.getCol(t.colKey);
  if (!r) {
    Fr(`no column found for ${t.colKey}`);
    return;
  }
  const n = {
    rowIndex: t.rowIndex,
    rowPinned: t.rowPinned || null,
    column: r
  };
  t.rowPinned == null && e4(e, t.rowIndex), qk(e, t.colKey);
  const u = e.navigationService.getCellByPosition(n);
  if (!u)
    return;
  const { focusService: s, gos: c } = e, i = () => {
    const v = Sa(c), f = u.getGui();
    return v !== f && f.contains(v);
  }, l = c.get("stopEditingWhenCellsLoseFocus") && i();
  (l || !s.isCellFocused(n)) && s.setFocusedCell({
    ...n,
    forceBrowserFocus: l,
    preventScrollOnBrowserFocus: !0
  }), u.startRowOrCellEdit(t.key);
}
function tZ(e) {
  var t;
  return ((t = e.undoRedoService) == null ? void 0 : t.getCurrentUndoStackSize()) ?? 0;
}
function rZ(e) {
  var t;
  return ((t = e.undoRedoService) == null ? void 0 : t.getCurrentRedoStackSize()) ?? 0;
}
var nZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "editService";
  }
  wireBeans(e) {
    this.navigationService = e.navigationService, this.userComponentFactory = e.userComponentFactory, this.valueService = e.valueService;
  }
  startEditing(e, t = null, r = !1, n = null) {
    var l;
    const a = this.createCellEditorParams(e, t, r), u = e.getColumn().getColDef(), s = this.userComponentFactory.getCellEditorDetails(u, a), c = (s == null ? void 0 : s.popupFromSelector) != null ? s.popupFromSelector : !!u.cellEditorPopup, i = (s == null ? void 0 : s.popupPositionFromSelector) != null ? s.popupPositionFromSelector : u.cellEditorPopupPosition;
    return e.setEditing(!0, s), e.getComp().setEditDetails(s, c, i, this.gos.get("reactiveCustomComponents")), this.eventService.dispatchEvent(e.createEvent(n, "cellEditingStarted")), !((l = s == null ? void 0 : s.params) != null && l.suppressPreventDefault);
  }
  stopEditing(e, t) {
    const r = e.getComp(), { newValue: n, newValueExists: a } = this.takeValueFromCellEditor(t, r), u = e.getRowNode(), s = e.getColumn(), c = this.valueService.getValueForDisplay(s, u);
    let i = !1;
    return a && (i = this.saveNewValue(e, c, n, u, s)), e.setEditing(!1, void 0), r.setEditDetails(), e.updateAndFormatValue(!1), e.refreshCell({ forceRefresh: !0, suppressFlash: !0 }), this.eventService.dispatchEvent({
      ...e.createEvent(null, "cellEditingStopped"),
      oldValue: c,
      newValue: n,
      valueChanged: i
    }), i;
  }
  handleColDefChanged(e) {
    const t = e.getCellEditor();
    if (t != null && t.refresh) {
      const { eventKey: r, cellStartedEdit: n } = e.getEditCompDetails().params, a = this.createCellEditorParams(e, r, n), u = e.getColumn().getColDef(), s = this.userComponentFactory.getCellEditorDetails(u, a);
      t.refresh(s.params);
    }
  }
  setFocusOutOnEditor(e) {
    const t = e.getComp().getCellEditor();
    t && t.focusOut && t.focusOut();
  }
  setFocusInOnEditor(e) {
    const t = e.getComp(), r = t.getCellEditor();
    r != null && r.focusIn ? r.focusIn() : (e.focusCell(!0), e.onCellEditorAttached(() => {
      var n, a;
      return (a = (n = t.getCellEditor()) == null ? void 0 : n.focusIn) == null ? void 0 : a.call(n);
    }));
  }
  stopEditingAndFocus(e, t = !1, r = !1) {
    e.stopRowOrCellEdit(), e.focusCell(!0), t || this.navigateAfterEdit(r, e.getCellPosition());
  }
  createPopupEditorWrapper(e) {
    return new L$(e);
  }
  takeValueFromCellEditor(e, t) {
    const r = { newValueExists: !1 };
    if (e)
      return r;
    const n = t.getCellEditor();
    return !n || n.isCancelAfterEnd && n.isCancelAfterEnd() ? r : {
      newValue: n.getValue(),
      newValueExists: !0
    };
  }
  /**
   * @returns `True` if the value changes, otherwise `False`.
   */
  saveNewValue(e, t, r, n, a) {
    if (r === t)
      return !1;
    e.setSuppressRefreshCell(!0);
    const u = n.setDataValue(a, r, "edit");
    return e.setSuppressRefreshCell(!1), u;
  }
  createCellEditorParams(e, t, r) {
    const n = e.getColumn(), a = e.getRowNode();
    return this.gos.addGridCommonParams({
      value: this.valueService.getValueForDisplay(n, a),
      eventKey: t,
      column: n,
      colDef: n.getColDef(),
      rowIndex: e.getCellPosition().rowIndex,
      node: a,
      data: a.data,
      cellStartedEdit: r,
      onKeyDown: e.onKeyDown.bind(e),
      stopEditing: e.stopEditingAndFocus.bind(e),
      eGridCell: e.getGui(),
      parseValue: (u) => this.valueService.parseValue(n, a, u, e.getValue()),
      formatValue: e.formatValue.bind(e)
    });
  }
  navigateAfterEdit(e, t) {
    if (this.gos.get("enterNavigatesVerticallyAfterEdit")) {
      const n = e ? dr.UP : dr.DOWN;
      this.navigationService.navigateToNextCell(null, n, t, !1);
    }
  }
}, iZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowEditService";
  }
  startEditing(e, t = null, r = null, n = null) {
    let a = !0;
    return e.getAllCellCtrls().reduce((s, c) => {
      const i = c === r;
      return i ? a = c.startEditing(t, i, n) : c.startEditing(null, i, n), s ? !0 : c.isEditing();
    }, !1) && this.setEditing(e, !0), a;
  }
  stopEditing(e, t = !1) {
    const r = e.getAllCellCtrls(), n = e.isEditing();
    e.setStoppingRowEdit(!0);
    let a = !1;
    for (const u of r) {
      const s = u.stopEditing(t);
      n && !t && !a && s && (a = !0);
    }
    a && this.eventService.dispatchEvent(e.createRowEvent("rowValueChanged")), n && this.setEditing(e, !1), e.setStoppingRowEdit(!1);
  }
  setEditing(e, t) {
    e.setEditingRow(t), e.forEachGui(void 0, (n) => n.rowComp.addOrRemoveCssClass("ag-row-editing", t));
    const r = t ? e.createRowEvent("rowEditingStarted") : e.createRowEvent("rowEditingStopped");
    this.eventService.dispatchEvent(r);
  }
}, Kh = {
  version: $n,
  moduleName: "@ag-grid-community/edit-core",
  beans: [nZ]
}, aZ = {
  version: $n,
  moduleName: "@ag-grid-community/edit-api",
  apiFunctions: {
    undoCellEditing: Z$,
    redoCellEditing: K$,
    getCellEditorInstances: J$,
    getEditingCells: Q$,
    stopEditing: q$,
    startEditingCell: eZ,
    getCurrentUndoSize: tZ,
    getCurrentRedoSize: rZ
  },
  dependantModules: [Kh]
}, oZ = {
  version: $n,
  moduleName: "@ag-grid-community/undo-redo-edit",
  beans: [j$],
  dependantModules: [Kh]
}, sZ = {
  version: $n,
  moduleName: "@ag-grid-community/full-row-edit",
  beans: [iZ],
  dependantModules: [Kh]
}, t4 = {
  version: $n,
  moduleName: "@ag-grid-community/default-editor",
  userComponents: [{ name: "agCellEditor", classImp: Jk }],
  dependantModules: [Kh]
}, lZ = {
  version: $n,
  moduleName: "@ag-grid-community/data-type-editors",
  userComponents: [
    { name: "agTextCellEditor", classImp: Jk },
    {
      name: "agNumberCellEditor",
      classImp: G$,
      params: {
        suppressPreventDefault: !0
      }
    },
    { name: "agDateCellEditor", classImp: V$ },
    { name: "agDateStringCellEditor", classImp: W$ },
    { name: "agCheckboxCellEditor", classImp: _$ }
  ],
  dependantModules: [t4]
}, uZ = {
  version: $n,
  moduleName: "@ag-grid-community/select-editor",
  userComponents: [{ name: "agSelectCellEditor", classImp: k$ }],
  dependantModules: [Kh]
}, cZ = {
  version: $n,
  moduleName: "@ag-grid-community/large-text-editor",
  userComponents: [{ name: "agLargeTextCellEditor", classImp: I$ }],
  dependantModules: [Kh]
}, dZ = {
  version: $n,
  moduleName: "@ag-grid-community/all-editors",
  dependantModules: [t4, lZ, uZ, cZ]
}, fZ = {
  version: $n,
  moduleName: "@ag-grid-community/editing",
  dependantModules: [Kh, oZ, sZ, dZ, aZ]
}, hZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "autoWidthCalculator";
  }
  wireBeans(e) {
    this.rowRenderer = e.rowRenderer, this.ctrlsService = e.ctrlsService;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      this.centerRowContainerCtrl = e.center;
    });
  }
  // this is the trick: we create a dummy container and clone all the cells
  // into the dummy, then check the dummy's width. then destroy the dummy
  // as we don't need it any more.
  // drawback: only the cells visible on the screen are considered
  getPreferredWidthForColumn(e, t) {
    const r = this.getHeaderCellForColumn(e);
    if (!r)
      return -1;
    const n = this.rowRenderer.getAllCellsForColumn(e);
    return t || n.push(r), this.addElementsToContainerAndGetWidth(n);
  }
  getPreferredWidthForColumnGroup(e) {
    const t = this.getHeaderCellForColumn(e);
    return t ? this.addElementsToContainerAndGetWidth([t]) : -1;
  }
  addElementsToContainerAndGetWidth(e) {
    const t = document.createElement("form");
    t.style.position = "fixed";
    const r = this.centerRowContainerCtrl.getContainerElement();
    e.forEach((u) => this.cloneItemIntoDummy(u, t)), r.appendChild(t);
    const n = t.offsetWidth;
    r.removeChild(t);
    const a = this.getAutoSizePadding();
    return n + a;
  }
  getAutoSizePadding() {
    return this.gos.get("autoSizePadding");
  }
  getHeaderCellForColumn(e) {
    let t = null;
    return this.ctrlsService.getHeaderRowContainerCtrls().forEach((r) => {
      const n = r.getHtmlElementForColumnHeader(e);
      n != null && (t = n);
    }), t;
  }
  cloneItemIntoDummy(e, t) {
    const r = e.cloneNode(!0);
    r.style.width = "", r.style.position = "static", r.style.left = "";
    const n = document.createElement("div"), a = n.classList;
    ["ag-header-cell", "ag-header-group-cell"].some((c) => r.classList.contains(c)) ? (a.add("ag-header", "ag-header-row"), n.style.position = "static") : a.add("ag-row");
    let s = e.parentElement;
    for (; s; ) {
      if (["ag-header-row", "ag-row"].some((i) => s.classList.contains(i))) {
        for (let i = 0; i < s.classList.length; i++) {
          const l = s.classList[i];
          l != "ag-row-position-absolute" && a.add(l);
        }
        break;
      }
      s = s.parentElement;
    }
    n.appendChild(r), t.appendChild(n);
  }
}, pZ = class extends mr {
  constructor(e, t) {
    super(), this.createRowCon = e, this.destroyRowCtrls = t, this.stickyTopRowCtrls = [], this.stickyBottomRowCtrls = [], this.extraTopHeight = 0, this.extraBottomHeight = 0;
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.rowRenderer = e.rowRenderer, this.ctrlsService = e.ctrlsService, this.pageBoundsService = e.pageBoundsService;
  }
  postConstruct() {
    this.isClientSide = da(this.gos), this.ctrlsService.whenReady(this, (e) => {
      this.gridBodyCtrl = e.gridBodyCtrl;
    }), this.resetStickyContainers();
  }
  getStickyTopRowCtrls() {
    return this.stickyTopRowCtrls;
  }
  getStickyBottomRowCtrls() {
    return this.stickyBottomRowCtrls;
  }
  setOffsetTop(e) {
    this.extraTopHeight !== e && (this.extraTopHeight = e, this.eventService.dispatchEvent({
      type: "stickyTopOffsetChanged",
      offset: e
    }));
  }
  setOffsetBottom(e) {
    this.extraBottomHeight !== e && (this.extraBottomHeight = e);
  }
  resetOffsets() {
    this.setOffsetBottom(0), this.setOffsetTop(0);
  }
  getExtraTopHeight() {
    return this.extraTopHeight;
  }
  getExtraBottomHeight() {
    return this.extraBottomHeight;
  }
  /**
   * Get the last pixel of the group, this pixel is used to push the sticky node up out of the viewport.
   */
  getLastPixelOfGroup(e) {
    return this.isClientSide ? this.getClientSideLastPixelOfGroup(e) : this.getServerSideLastPixelOfGroup(e);
  }
  /**
   * Get the first pixel of the group, this pixel is used to push the sticky node down out of the viewport
   */
  getFirstPixelOfGroup(e) {
    return e.footer ? e.sibling.rowTop + e.sibling.rowHeight - 1 : e.hasChildren() ? e.rowTop - 1 : 0;
  }
  getServerSideLastPixelOfGroup(e) {
    var t, r;
    if (this.isClientSide)
      throw new Error("This func should only be called in server side row model.");
    if (e.isExpandable() || e.footer) {
      if (e.master)
        return e.detailNode.rowTop + e.detailNode.rowHeight;
      if (!e.sibling || Math.abs(e.sibling.rowIndex - e.rowIndex) === 1) {
        let a = (t = e.childStore) == null ? void 0 : t.getStoreBounds();
        return e.footer && (a = (r = e.sibling.childStore) == null ? void 0 : r.getStoreBounds()), ((a == null ? void 0 : a.heightPx) ?? 0) + ((a == null ? void 0 : a.topPx) ?? 0);
      }
      return e.footer ? e.rowTop + e.rowHeight : e.sibling.rowTop + e.sibling.rowHeight;
    }
    return Number.MAX_SAFE_INTEGER;
  }
  getClientSideLastPixelOfGroup(e) {
    if (!this.isClientSide)
      throw new Error("This func should only be called in client side row model.");
    if (e.isExpandable() || e.footer) {
      if (e.footer && e.rowIndex === 0)
        return Number.MAX_SAFE_INTEGER;
      if (!e.sibling || Math.abs(e.sibling.rowIndex - e.rowIndex) === 1) {
        let n = e.footer ? e.sibling : e;
        for (; n.isExpandable() && n.expanded; )
          if (n.master)
            n = n.detailNode;
          else if (n.childrenAfterSort) {
            if (n.childrenAfterSort.length === 0)
              break;
            n = di(n.childrenAfterSort);
          }
        return n.rowTop + n.rowHeight;
      }
      return e.footer ? e.rowTop + e.rowHeight : e.sibling.rowTop + e.sibling.rowHeight;
    }
    return Number.MAX_SAFE_INTEGER;
  }
  updateStickyRows(e) {
    const t = e === "top";
    let r = 0;
    if (!this.canRowsBeSticky())
      return this.refreshNodesAndContainerHeight(e, /* @__PURE__ */ new Set(), r);
    const n = t ? this.rowRenderer.getFirstVisibleVerticalPixel() - this.extraTopHeight : this.rowRenderer.getLastVisibleVerticalPixel() - this.extraTopHeight, a = /* @__PURE__ */ new Set(), u = (l) => {
      if (a.add(l), t) {
        const v = this.getLastPixelOfGroup(l), f = n + r + l.rowHeight;
        v < f ? l.stickyRowTop = r + (v - f) : l.stickyRowTop = r;
      } else {
        const v = this.getFirstPixelOfGroup(l), f = n - (r + l.rowHeight);
        v > f ? l.stickyRowTop = r - (v - f) : l.stickyRowTop = r;
      }
      r = 0, a.forEach((v) => {
        const f = v.stickyRowTop + v.rowHeight;
        r < f && (r = f);
      });
    }, s = this.areFooterRowsStickySuppressed(), c = this.gos.get("suppressGroupRowsSticky"), i = (l) => {
      if (!l.displayed)
        return !1;
      if (l.footer) {
        if (s === !0 || s === "grand" && l.level === -1 || s === "group" && l.level > -1)
          return !1;
        const v = l.sibling.rowIndex ? l.sibling.rowIndex + 1 === l.rowIndex : !1;
        return e === "bottom" && v ? !1 : !a.has(l);
      }
      return l.isExpandable() ? c === !0 || e === "bottom" ? !1 : !a.has(l) && l.expanded : !1;
    };
    for (let l = 0; l < 100; l++) {
      let v = n + r;
      t || (v = n - r);
      const f = this.rowModel.getRowIndexAtPixel(v), p = this.rowModel.getRow(f);
      if (p == null)
        break;
      const y = this.getStickyAncestors(p).find(
        (m) => (t ? m.rowIndex < f : m.rowIndex > f) && i(m)
      );
      if (y) {
        u(y);
        continue;
      }
      if ((t ? p.rowTop < v : p.rowTop + p.rowHeight > v) && i(p)) {
        u(p);
        continue;
      }
      break;
    }
    return t || a.forEach((l) => {
      l.stickyRowTop = r - (l.stickyRowTop + l.rowHeight);
    }), this.refreshNodesAndContainerHeight(e, a, r);
  }
  areFooterRowsStickySuppressed() {
    const e = this.gos.get("suppressStickyTotalRow");
    if (e === !0)
      return !0;
    const t = !!this.gos.get("groupIncludeFooter") || e === "group", r = !!this.gos.get("groupIncludeTotalFooter") || e === "grand";
    return t && r ? !0 : r ? "grand" : t ? "group" : !1;
  }
  canRowsBeSticky() {
    const e = U1(this.gos), t = this.areFooterRowsStickySuppressed(), r = this.gos.get("suppressGroupRowsSticky");
    return e && (!t || !r);
  }
  getStickyAncestors(e) {
    const t = [];
    let r = e.footer ? e.sibling : e.parent;
    for (; r; )
      r.sibling && t.push(r.sibling), t.push(r), r = r.parent;
    return t.reverse();
  }
  checkStickyRows() {
    const e = this.updateStickyRows("top"), t = this.updateStickyRows("bottom");
    return e || t;
  }
  destroyStickyCtrls() {
    this.resetStickyContainers();
  }
  resetStickyContainers() {
    this.refreshNodesAndContainerHeight("top", /* @__PURE__ */ new Set(), 0), this.refreshNodesAndContainerHeight("bottom", /* @__PURE__ */ new Set(), 0);
  }
  refreshStickyNode(e) {
    const t = /* @__PURE__ */ new Set();
    if (this.stickyTopRowCtrls.some((r) => r.getRowNode() === e)) {
      for (let r = 0; r < this.stickyTopRowCtrls.length; r++) {
        const n = this.stickyTopRowCtrls[r].getRowNode();
        n !== e && t.add(n);
      }
      this.refreshNodesAndContainerHeight("top", t, this.topContainerHeight) && this.checkStickyRows();
      return;
    }
    for (let r = 0; r < this.stickyBottomRowCtrls.length; r++) {
      const n = this.stickyBottomRowCtrls[r].getRowNode();
      n !== e && t.add(n);
    }
    this.refreshNodesAndContainerHeight("bottom", t, this.bottomContainerHeight) && this.checkStickyRows();
  }
  /**
   * Destroy old ctrls and create new ctrls where necessary.
   */
  refreshNodesAndContainerHeight(e, t, r) {
    const n = e === "top", a = n ? this.stickyTopRowCtrls : this.stickyBottomRowCtrls, u = {}, s = [];
    for (let p = 0; p < a.length; p++) {
      const g = a[p].getRowNode();
      if (!t.has(g)) {
        u[g.id] = a[p], g.sticky = !1;
        continue;
      }
      s.push(a[p]);
    }
    const c = /* @__PURE__ */ new Set();
    for (let p = 0; p < s.length; p++)
      c.add(s[p].getRowNode());
    const i = [];
    t.forEach((p) => {
      c.has(p) || (p.sticky = !0, i.push(this.createRowCon(p, !1, !1)));
    });
    let l = !!i.length || s.length !== a.length;
    n ? this.topContainerHeight !== r && (this.topContainerHeight = r, this.gridBodyCtrl.setStickyTopHeight(r), l = !0) : this.bottomContainerHeight !== r && (this.bottomContainerHeight = r, this.gridBodyCtrl.setStickyBottomHeight(r), l = !0), this.destroyRowCtrls(u, !1);
    const v = [...s, ...i];
    v.sort((p, g) => g.getRowNode().rowIndex - p.getRowNode().rowIndex), n || v.reverse(), v.forEach((p) => p.setRowTop(p.getRowNode().stickyRowTop));
    let f = 0;
    return n ? (t.forEach((p) => {
      p.rowIndex < this.pageBoundsService.getFirstRow() && (f += p.rowHeight);
    }), f > this.topContainerHeight && (f = this.topContainerHeight), this.setOffsetTop(f)) : (t.forEach((p) => {
      p.rowIndex > this.pageBoundsService.getLastRow() && (f += p.rowHeight);
    }), f > this.bottomContainerHeight && (f = this.bottomContainerHeight), this.setOffsetBottom(f)), l ? (n ? this.stickyTopRowCtrls = v : this.stickyBottomRowCtrls = v, !0) : !1;
  }
  ensureRowHeightsValid() {
    let e = !1;
    const t = (r) => {
      const n = r.getRowNode();
      if (n.rowHeightEstimated) {
        const a = af(this.gos, n);
        n.setRowHeight(a.height), e = !0;
      }
    };
    return this.stickyTopRowCtrls.forEach(t), this.stickyBottomRowCtrls.forEach(t), e;
  }
}, vZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowRenderer", this.destroyFuncsForColumnListeners = [], this.rowCtrlsByRowIndex = {}, this.zombieRowCtrls = {}, this.allRowCtrls = [], this.topRowCtrls = [], this.bottomRowCtrls = [], this.refreshInProgress = !1, this.dataFirstRenderedFired = !1, this.setupRangeSelectionListeners = () => {
      const e = () => {
        this.getAllCellCtrls().forEach((u) => u.onCellSelectionChanged());
      }, t = () => {
        this.getAllCellCtrls().forEach((u) => u.updateRangeBordersIfRangeCount());
      }, r = () => {
        this.eventService.addEventListener("cellSelectionChanged", e), this.eventService.addEventListener("columnMoved", t), this.eventService.addEventListener("columnPinned", t), this.eventService.addEventListener("columnVisible", t);
      }, n = () => {
        this.eventService.removeEventListener("cellSelectionChanged", e), this.eventService.removeEventListener("columnMoved", t), this.eventService.removeEventListener("columnPinned", t), this.eventService.removeEventListener("columnVisible", t);
      };
      this.addDestroyFunc(() => n()), this.addManagedPropertyListeners(["enableRangeSelection", "cellSelection"], () => {
        nd(this.gos) ? r() : n();
      }), nd(this.gos) && r();
    };
  }
  wireBeans(e) {
    this.animationFrameService = e.animationFrameService, this.paginationService = e.paginationService, this.pageBoundsService = e.pageBoundsService, this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService, this.pinnedRowModel = e.pinnedRowModel, this.rowModel = e.rowModel, this.focusService = e.focusService, this.beans = e, this.rowContainerHeightService = e.rowContainerHeightService, this.ctrlsService = e.ctrlsService, this.environment = e.environment;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      this.gridBodyCtrl = e.gridBodyCtrl, this.initialise();
    });
  }
  initialise() {
    this.addManagedEventListeners({
      paginationChanged: this.onPageLoaded.bind(this),
      pinnedRowDataChanged: this.onPinnedRowDataChanged.bind(this),
      displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
      bodyScroll: this.onBodyScroll.bind(this),
      bodyHeightChanged: this.redraw.bind(this, {})
    }), this.addManagedPropertyListeners(["domLayout", "embedFullWidthRows"], () => this.onDomLayoutChanged()), this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction", "rowBuffer"], () => this.redraw()), this.addManagedPropertyListener("suppressCellFocus", (e) => this.onSuppressCellFocusChanged(e.currentValue)), this.addManagedPropertyListeners(
      [
        "getBusinessKeyForNode",
        "fullWidthCellRenderer",
        "fullWidthCellRendererParams",
        "rowStyle",
        "getRowStyle",
        "rowClass",
        "getRowClass",
        "rowClassRules",
        "suppressStickyTotalRow",
        "groupRowRenderer",
        "groupRowRendererParams",
        // maybe only needs to refresh FW rows...
        "loadingCellRenderer",
        "loadingCellRendererParams",
        "detailCellRenderer",
        "detailCellRendererParams",
        "enableRangeSelection",
        "enableCellTextSelection",
        "rowSelection"
      ],
      () => this.redrawRows()
    ), U1(this.gos) && (da(this.gos) || sd(this.gos)) && (this.stickyRowFeature = this.createManagedBean(
      new pZ(this.createRowCon.bind(this), this.destroyRowCtrls.bind(this))
    )), this.registerCellEventListeners(), this.initialiseCache(), this.printLayout = Ao(this.gos, "print"), this.embedFullWidthRows = this.printLayout || this.gos.get("embedFullWidthRows"), this.redrawAfterModelUpdate();
  }
  initialiseCache() {
    if (this.gos.get("keepDetailRows")) {
      const e = this.getKeepDetailRowsCount(), t = e ?? 3;
      this.cachedRowCtrls = new gZ(t);
    }
  }
  getKeepDetailRowsCount() {
    return this.gos.get("keepDetailRowsCount");
  }
  getStickyTopRowCtrls() {
    return this.stickyRowFeature ? this.stickyRowFeature.getStickyTopRowCtrls() : [];
  }
  getStickyBottomRowCtrls() {
    return this.stickyRowFeature ? this.stickyRowFeature.getStickyBottomRowCtrls() : [];
  }
  updateAllRowCtrls() {
    const e = Q3(this.rowCtrlsByRowIndex), t = Q3(this.zombieRowCtrls), r = this.cachedRowCtrls ? this.cachedRowCtrls.getEntries() : [];
    t.length > 0 || r.length > 0 ? this.allRowCtrls = [...e, ...t, ...r] : this.allRowCtrls = e;
  }
  onCellFocusChanged(e) {
    this.getAllCellCtrls().forEach((t) => t.onCellFocused(e)), this.getFullWidthRowCtrls().forEach((t) => t.onFullWidthRowFocused(e));
  }
  onSuppressCellFocusChanged(e) {
    this.getAllCellCtrls().forEach((t) => t.onSuppressCellFocusChanged(e)), this.getFullWidthRowCtrls().forEach((t) => t.onSuppressCellFocusChanged(e));
  }
  // in a clean design, each cell would register for each of these events. however when scrolling, all the cells
  // registering and de-registering for events is a performance bottleneck. so we register here once and inform
  // all active cells.
  registerCellEventListeners() {
    this.addManagedEventListeners({
      cellFocused: (e) => {
        this.onCellFocusChanged(e);
      },
      cellFocusCleared: () => this.onCellFocusChanged(),
      flashCells: (e) => {
        this.getAllCellCtrls().forEach((t) => t.onFlashCells(e));
      },
      columnHoverChanged: () => {
        this.getAllCellCtrls().forEach((e) => e.onColumnHover());
      },
      displayedColumnsChanged: () => {
        this.getAllCellCtrls().forEach((e) => e.onDisplayedColumnsChanged());
      },
      displayedColumnsWidthChanged: () => {
        this.printLayout && this.getAllCellCtrls().forEach((e) => e.onLeftChanged());
      }
    }), this.setupRangeSelectionListeners(), this.refreshListenersToColumnsForCellComps(), this.addManagedEventListeners({
      gridColumnsChanged: this.refreshListenersToColumnsForCellComps.bind(this)
    }), this.addDestroyFunc(this.removeGridColumnListeners.bind(this));
  }
  // executes all functions in destroyFuncsForColumnListeners and then clears the list
  removeGridColumnListeners() {
    this.destroyFuncsForColumnListeners.forEach((e) => e()), this.destroyFuncsForColumnListeners.length = 0;
  }
  // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for.
  // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to
  // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here
  // once instead.
  refreshListenersToColumnsForCellComps() {
    this.removeGridColumnListeners(), this.columnModel.getCols().forEach((t) => {
      const r = (i) => {
        this.getAllCellCtrls().forEach((l) => {
          l.getColumn() === t && i(l);
        });
      }, n = () => {
        r((i) => i.onLeftChanged());
      }, a = () => {
        r((i) => i.onWidthChanged());
      }, u = () => {
        r((i) => i.onFirstRightPinnedChanged());
      }, s = () => {
        r((i) => i.onLastLeftPinnedChanged());
      }, c = () => {
        r((i) => i.onColDefChanged());
      };
      t.addEventListener("leftChanged", n), t.addEventListener("widthChanged", a), t.addEventListener("firstRightPinnedChanged", u), t.addEventListener("lastLeftPinnedChanged", s), t.addEventListener("colDefChanged", c), this.destroyFuncsForColumnListeners.push(() => {
        t.removeEventListener("leftChanged", n), t.removeEventListener("widthChanged", a), t.removeEventListener("firstRightPinnedChanged", u), t.removeEventListener("lastLeftPinnedChanged", s), t.removeEventListener("colDefChanged", c);
      });
    });
  }
  onDomLayoutChanged() {
    const e = Ao(this.gos, "print"), t = e || this.gos.get("embedFullWidthRows"), r = t !== this.embedFullWidthRows || this.printLayout !== e;
    this.printLayout = e, this.embedFullWidthRows = t, r && this.redrawAfterModelUpdate({ domLayoutChanged: !0 });
  }
  // for row models that have datasources, when we update the datasource, we need to force the rowRenderer
  // to redraw all rows. otherwise the old rows from the old datasource will stay displayed.
  datasourceChanged() {
    this.firstRenderedRow = 0, this.lastRenderedRow = -1;
    const e = Object.keys(this.rowCtrlsByRowIndex);
    this.removeRowCtrls(e);
  }
  onPageLoaded(e) {
    const t = {
      recycleRows: e.keepRenderedRows,
      animate: e.animate,
      newData: e.newData,
      newPage: e.newPage,
      // because this is a model updated event (not pinned rows), we
      // can skip updating the pinned rows. this is needed so that if user
      // is doing transaction updates, the pinned rows are not getting constantly
      // trashed - or editing cells in pinned rows are not refreshed and put into read mode
      onlyBody: !0
    };
    this.redrawAfterModelUpdate(t);
  }
  getAllCellsForColumn(e) {
    const t = [];
    return this.getAllRowCtrls().forEach((r) => {
      const n = r.getCellElement(e);
      n && t.push(n);
    }), t;
  }
  refreshFloatingRowComps() {
    this.refreshFloatingRows(this.topRowCtrls, "top"), this.refreshFloatingRows(this.bottomRowCtrls, "bottom");
  }
  getTopRowCtrls() {
    return this.topRowCtrls;
  }
  getCentreRowCtrls() {
    return this.allRowCtrls;
  }
  getBottomRowCtrls() {
    return this.bottomRowCtrls;
  }
  /**
   * Determines which row controllers need to be destroyed and re-created vs which ones can
   * be re-used.
   *
   * This is operation is to pinned/floating rows as `this.recycleRows` is to normal/body rows.
   *
   * All `RowCtrl` instances in `rowCtrls` that don't correspond to `RowNode` instances in `rowNodes` are destroyed.
   * All `RowNode` instances in `rowNodes` that don't correspond to `RowCtrl` instances in `rowCtrls` are created.
   * All instances in `rowCtrls` must be in the same order as their corresponding nodes in `rowNodes`.
   *
   * @param rowCtrls The list of existing row controllers
   * @param rowNodes The canonical list of row nodes that should have associated controllers
   */
  refreshFloatingRows(e, t) {
    const { pinnedRowModel: r, beans: n, printLayout: a } = this, u = Object.fromEntries(e.map((c) => [c.getRowNode().id, c]));
    r.forEachPinnedRow(t, (c, i) => {
      const l = e[i];
      l && r.getPinnedRowById(l.getRowNode().id, t) === void 0 && (l.destroyFirstPass(), l.destroySecondPass()), c.id in u ? (e[i] = u[c.id], delete u[c.id]) : e[i] = new Gh(c, n, !1, !1, a);
    });
    const s = t === "top" ? r.getPinnedTopRowCount() : r.getPinnedBottomRowCount();
    e.length = s;
  }
  onPinnedRowDataChanged() {
    const e = {
      recycleRows: !0
    };
    this.redrawAfterModelUpdate(e);
  }
  redrawRow(e, t = !1) {
    var r;
    if (e.sticky)
      this.stickyRowFeature.refreshStickyNode(e);
    else if ((r = this.cachedRowCtrls) != null && r.has(e)) {
      this.cachedRowCtrls.removeRow(e);
      return;
    } else {
      const n = (a) => {
        const u = a[e.rowIndex];
        u && u.getRowNode() === e && (u.destroyFirstPass(), u.destroySecondPass(), a[e.rowIndex] = this.createRowCon(e, !1, !1));
      };
      switch (e.rowPinned) {
        case "top":
          n(this.topRowCtrls);
          break;
        case "bottom":
          n(this.bottomRowCtrls);
          break;
        default:
          n(this.rowCtrlsByRowIndex), this.updateAllRowCtrls();
      }
    }
    t || this.dispatchDisplayedRowsChanged(!1);
  }
  redrawRows(e) {
    if (e != null) {
      e == null || e.forEach((r) => this.redrawRow(r, !0)), this.dispatchDisplayedRowsChanged(!1);
      return;
    }
    this.redrawAfterModelUpdate();
  }
  getCellToRestoreFocusToAfterRefresh(e) {
    const t = e != null && e.suppressKeepFocus ? null : this.focusService.getFocusCellToUseAfterRefresh();
    if (t == null)
      return null;
    const r = Sa(this.gos), n = Bm(this.gos, r, Nh.DOM_DATA_KEY_CELL_CTRL), a = Bm(this.gos, r, Gh.DOM_DATA_KEY_ROW_CTRL);
    return n || a ? t : null;
  }
  // gets called from:
  // +) initialisation (in registerGridComp) params = null
  // +) onDomLayoutChanged, params = null
  // +) onPageLoaded, recycleRows, animate, newData, newPage from event, onlyBody=true
  // +) onPinnedRowDataChanged, recycleRows = true
  // +) redrawRows (from Grid API), recycleRows = true/false
  redrawAfterModelUpdate(e = {}) {
    this.getLockOnRefresh();
    const t = this.getCellToRestoreFocusToAfterRefresh(e);
    this.updateContainerHeights(), this.scrollToTopIfNewData(e);
    const r = !e.domLayoutChanged && !!e.recycleRows, n = e.animate && yv(this.gos), a = r ? this.getRowsToRecycle() : null;
    if (r || this.removeAllRowComps(), this.workOutFirstAndLastRowsToRender(), this.stickyRowFeature) {
      this.stickyRowFeature.checkStickyRows();
      const u = this.stickyRowFeature.getExtraTopHeight() + this.stickyRowFeature.getExtraBottomHeight();
      u && this.updateContainerHeights(u);
    }
    this.recycleRows(a, n), this.gridBodyCtrl.updateRowCount(), e.onlyBody || this.refreshFloatingRowComps(), this.dispatchDisplayedRowsChanged(), t != null && this.restoreFocusedCell(t), this.releaseLockOnRefresh();
  }
  scrollToTopIfNewData(e) {
    var n;
    const t = e.newData || e.newPage, r = this.gos.get("suppressScrollOnNewData");
    t && !r && (this.gridBodyCtrl.getScrollFeature().scrollToTop(), (n = this.stickyRowFeature) == null || n.resetOffsets());
  }
  updateContainerHeights(e = 0) {
    if (this.printLayout) {
      this.rowContainerHeightService.setModelHeight(null);
      return;
    }
    let t = this.pageBoundsService.getCurrentPageHeight();
    t === 0 && (t = 1), this.rowContainerHeightService.setModelHeight(t + e);
  }
  getLockOnRefresh() {
    var e, t;
    if (this.refreshInProgress)
      throw new Error(
        "AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace."
      );
    this.refreshInProgress = !0, (t = (e = this.frameworkOverrides).getLockOnRefresh) == null || t.call(e);
  }
  releaseLockOnRefresh() {
    var e, t;
    this.refreshInProgress = !1, (t = (e = this.frameworkOverrides).releaseLockOnRefresh) == null || t.call(e);
  }
  isRefreshInProgress() {
    return this.refreshInProgress;
  }
  // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without
  // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits
  // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the
  // edited cell).
  restoreFocusedCell(e) {
    e && this.focusService.restoreFocusedCell(e, () => {
      this.onCellFocusChanged(
        this.gos.addGridCommonParams({
          rowIndex: e.rowIndex,
          column: e.column,
          rowPinned: e.rowPinned,
          forceBrowserFocus: !0,
          preventScrollOnBrowserFocus: !0,
          type: "cellFocused"
        })
      );
    });
  }
  stopEditing(e = !1) {
    this.getAllRowCtrls().forEach((t) => {
      t.stopEditing(e);
    });
  }
  getAllCellCtrls() {
    const e = [], t = this.getAllRowCtrls(), r = t.length;
    for (let n = 0; n < r; n++) {
      const a = t[n].getAllCellCtrls(), u = a.length;
      for (let s = 0; s < u; s++)
        e.push(a[s]);
    }
    return e;
  }
  getAllRowCtrls() {
    const e = this.stickyRowFeature && this.stickyRowFeature.getStickyTopRowCtrls() || [], t = this.stickyRowFeature && this.stickyRowFeature.getStickyBottomRowCtrls() || [], r = [...this.topRowCtrls, ...this.bottomRowCtrls, ...e, ...t];
    for (const n in this.rowCtrlsByRowIndex)
      r.push(this.rowCtrlsByRowIndex[n]);
    return r;
  }
  addRenderedRowListener(e, t, r) {
    const n = this.rowCtrlsByRowIndex[t];
    n && n.addEventListener(e, r);
  }
  flashCells(e = {}) {
    this.getCellCtrls(e.rowNodes, e.columns).forEach(
      (t) => t.flashCell(e)
    );
  }
  refreshCells(e = {}) {
    const t = {
      forceRefresh: e.force,
      newData: !1,
      suppressFlash: e.suppressFlash
    };
    for (const r of this.getCellCtrls(e.rowNodes, e.columns))
      r.refreshOrDestroyCell(t);
    this.refreshFullWidth(e.rowNodes);
  }
  refreshFullWidth(e) {
    if (!e)
      return;
    let t = null;
    this.stickyRowFeature && rF() && (t = this.getCellToRestoreFocusToAfterRefresh() || null);
    for (const r of this.getRowCtrls(e)) {
      if (!r.isFullWidth())
        continue;
      r.refreshFullWidth() || this.redrawRow(r.getRowNode(), !0);
    }
    this.dispatchDisplayedRowsChanged(!1), t && this.restoreFocusedCell(t);
  }
  getCellRendererInstances(e) {
    var a;
    const t = this.getCellCtrls(e.rowNodes, e.columns).map((u) => u.getCellRenderer()).filter((u) => u != null);
    if ((a = e.columns) != null && a.length)
      return t;
    const r = [], n = this.mapRowNodes(e.rowNodes);
    return this.getAllRowCtrls().forEach((u) => {
      if (n && !this.isRowInMap(u.getRowNode(), n) || !u.isFullWidth())
        return;
      const s = u.getFullWidthCellRenderers();
      for (let c = 0; c < s.length; c++) {
        const i = s[c];
        i != null && r.push(i);
      }
    }), [...r, ...t];
  }
  getCellEditorInstances(e) {
    const t = [];
    return this.getCellCtrls(e.rowNodes, e.columns).forEach((r) => {
      const n = r.getCellEditor();
      n && t.push(n);
    }), t;
  }
  getEditingCells() {
    const e = [];
    return this.getAllCellCtrls().forEach((t) => {
      if (t.isEditing()) {
        const r = t.getCellPosition();
        e.push(r);
      }
    }), e;
  }
  mapRowNodes(e) {
    if (!e)
      return;
    const t = {
      top: {},
      bottom: {},
      normal: {}
    };
    return e.forEach((r) => {
      const n = r.id;
      switch (r.rowPinned) {
        case "top":
          t.top[n] = r;
          break;
        case "bottom":
          t.bottom[n] = r;
          break;
        default:
          t.normal[n] = r;
          break;
      }
    }), t;
  }
  isRowInMap(e, t) {
    const r = e.id;
    switch (e.rowPinned) {
      case "top":
        return t.top[r] != null;
      case "bottom":
        return t.bottom[r] != null;
      default:
        return t.normal[r] != null;
    }
  }
  /**
   * @param rowNodes if provided, returns the RowCtrls for the provided rowNodes. otherwise returns all RowCtrls.
   */
  getRowCtrls(e) {
    const t = this.mapRowNodes(e), r = this.getAllRowCtrls();
    return !e || !t ? r : r.filter((n) => {
      const a = n.getRowNode();
      return this.isRowInMap(a, t);
    });
  }
  // returns CellCtrl's that match the provided rowNodes and columns. eg if one row node
  // and two columns provided, that identifies 4 cells, so 4 CellCtrl's returned.
  getCellCtrls(e, t) {
    let r;
    $r(t) && (r = {}, t.forEach((a) => {
      const u = this.columnModel.getCol(a);
      $r(u) && (r[u.getId()] = !0);
    }));
    const n = [];
    return this.getRowCtrls(e).forEach((a) => {
      a.getAllCellCtrls().forEach((u) => {
        const s = u.getColumn().getId();
        r && !r[s] || n.push(u);
      });
    }), n;
  }
  destroy() {
    this.removeAllRowComps(!0), super.destroy();
  }
  removeAllRowComps(e = !1) {
    const t = Object.keys(this.rowCtrlsByRowIndex);
    this.removeRowCtrls(t, e), this.stickyRowFeature && this.stickyRowFeature.destroyStickyCtrls();
  }
  getRowsToRecycle() {
    const e = [];
    fu(this.rowCtrlsByRowIndex, (r, n) => {
      n.getRowNode().id == null && e.push(r);
    }), this.removeRowCtrls(e);
    const t = {};
    return fu(this.rowCtrlsByRowIndex, (r, n) => {
      const a = n.getRowNode();
      t[a.id] = n;
    }), this.rowCtrlsByRowIndex = {}, t;
  }
  // takes array of row indexes
  removeRowCtrls(e, t = !1) {
    e.forEach((r) => {
      const n = this.rowCtrlsByRowIndex[r];
      n && (n.destroyFirstPass(t), n.destroySecondPass()), delete this.rowCtrlsByRowIndex[r];
    });
  }
  onBodyScroll(e) {
    e.direction === "vertical" && this.redraw({ afterScroll: !0 });
  }
  // gets called when rows don't change, but viewport does, so after:
  // 1) height of grid body changes, ie number of displayed rows has changed
  // 2) grid scrolled to new position
  // 3) ensure index visible (which is a scroll)
  redraw(e = {}) {
    const { afterScroll: t } = e;
    let r;
    this.stickyRowFeature && rF() && (r = this.getCellToRestoreFocusToAfterRefresh() || void 0);
    const n = this.firstRenderedRow, a = this.lastRenderedRow;
    this.workOutFirstAndLastRowsToRender();
    let u = !1;
    if (this.stickyRowFeature) {
      u = this.stickyRowFeature.checkStickyRows();
      const c = this.stickyRowFeature.getExtraTopHeight() + this.stickyRowFeature.getExtraBottomHeight();
      c && this.updateContainerHeights(c);
    }
    const s = this.firstRenderedRow !== n || this.lastRenderedRow !== a;
    if (!(t && !u && !s) && (this.getLockOnRefresh(), this.recycleRows(null, !1, t), this.releaseLockOnRefresh(), this.dispatchDisplayedRowsChanged(t && !u), r != null)) {
      const c = this.getCellToRestoreFocusToAfterRefresh();
      r != null && c == null && (this.animationFrameService.flushAllFrames(), this.restoreFocusedCell(r));
    }
  }
  removeRowCompsNotToDraw(e, t) {
    const r = {};
    e.forEach((u) => r[u] = !0);
    const a = Object.keys(this.rowCtrlsByRowIndex).filter((u) => !r[u]);
    this.removeRowCtrls(a, t);
  }
  calculateIndexesToDraw(e) {
    const t = bY(this.firstRenderedRow, this.lastRenderedRow), r = (a, u) => {
      const s = u.getRowNode().rowIndex;
      s != null && (s < this.firstRenderedRow || s > this.lastRenderedRow) && this.doNotUnVirtualiseRow(u) && t.push(s);
    };
    fu(this.rowCtrlsByRowIndex, r), fu(e, r), t.sort((a, u) => a - u);
    const n = [];
    for (let a = 0; a < t.length; a++) {
      const u = t[a], s = this.rowModel.getRow(u);
      s && !s.sticky && n.push(u);
    }
    return n;
  }
  recycleRows(e, t = !1, r = !1) {
    const n = this.calculateIndexesToDraw(e);
    (this.printLayout || r) && (t = !1), this.removeRowCompsNotToDraw(n, !t), n.forEach((a) => {
      this.createOrUpdateRowCtrl(a, e, t, r);
    }), e && (r && !this.gos.get("suppressAnimationFrame") && !this.printLayout ? this.beans.animationFrameService.addDestroyTask(() => {
      this.destroyRowCtrls(e, t), this.updateAllRowCtrls(), this.dispatchDisplayedRowsChanged();
    }) : this.destroyRowCtrls(e, t)), this.updateAllRowCtrls();
  }
  dispatchDisplayedRowsChanged(e = !1) {
    this.eventService.dispatchEvent({
      type: "displayedRowsChanged",
      afterScroll: e
    });
  }
  onDisplayedColumnsChanged() {
    const e = this.visibleColsService.isPinningLeft(), t = this.visibleColsService.isPinningRight();
    (this.pinningLeft !== e || t !== this.pinningRight) && (this.pinningLeft = e, this.pinningRight = t, this.embedFullWidthRows && this.redrawFullWidthEmbeddedRows());
  }
  // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse,
  // then it should go into the pinned left area if pinning left, or the center area if not pinning.
  redrawFullWidthEmbeddedRows() {
    const e = [];
    this.getFullWidthRowCtrls().forEach((t) => {
      const r = t.getRowNode().rowIndex;
      e.push(r.toString());
    }), this.refreshFloatingRowComps(), this.removeRowCtrls(e), this.redraw({ afterScroll: !0 });
  }
  getFullWidthRowCtrls(e) {
    const t = this.mapRowNodes(e);
    return this.getAllRowCtrls().filter((r) => {
      if (!r.isFullWidth())
        return !1;
      const n = r.getRowNode();
      return !(t != null && !this.isRowInMap(n, t));
    });
  }
  createOrUpdateRowCtrl(e, t, r, n) {
    let a, u = this.rowCtrlsByRowIndex[e];
    if (u || (a = this.rowModel.getRow(e), $r(a) && $r(t) && t[a.id] && a.alreadyRendered && (u = t[a.id], t[a.id] = null)), !u)
      if (a || (a = this.rowModel.getRow(e)), $r(a))
        u = this.createRowCon(a, r, n);
      else
        return;
    return a && (a.alreadyRendered = !0), this.rowCtrlsByRowIndex[e] = u, u;
  }
  destroyRowCtrls(e, t) {
    const r = [];
    fu(e, (n, a) => {
      if (a) {
        if (this.cachedRowCtrls && a.isCacheable()) {
          this.cachedRowCtrls.addRow(a);
          return;
        }
        if (a.destroyFirstPass(!t), t) {
          const u = a.instanceId;
          this.zombieRowCtrls[u] = a, r.push(() => {
            a.destroySecondPass(), delete this.zombieRowCtrls[u];
          });
        } else
          a.destroySecondPass();
      }
    }), t && (r.push(() => {
      this.updateAllRowCtrls(), this.dispatchDisplayedRowsChanged();
    }), H_(r));
  }
  getRowBuffer() {
    return this.gos.get("rowBuffer");
  }
  getRowBufferInPixels() {
    const e = this.getRowBuffer(), t = _1(this.gos);
    return e * t;
  }
  workOutFirstAndLastRowsToRender() {
    this.rowContainerHeightService.updateOffset();
    let e, t;
    if (!this.rowModel.isRowsToRender())
      e = 0, t = -1;
    else if (this.printLayout)
      this.environment.refreshRowHeightVariable(), e = this.pageBoundsService.getFirstRow(), t = this.pageBoundsService.getLastRow();
    else {
      const c = this.getRowBufferInPixels(), i = this.ctrlsService.getGridBodyCtrl(), l = this.gos.get("suppressRowVirtualisation");
      let v = !1, f, p;
      do {
        const h = this.pageBoundsService.getPixelOffset(), { pageFirstPixel: w, pageLastPixel: S } = this.pageBoundsService.getCurrentPagePixelRange(), E = this.rowContainerHeightService.getDivStretchOffset(), x = i.getScrollFeature().getVScrollPosition(), T = x.top, F = x.bottom;
        l ? (f = w + E, p = S + E) : (f = Math.max(T + h - c, w) + E, p = Math.min(F + h + c, S) + E), this.firstVisibleVPixel = Math.max(T + h, w) + E, this.lastVisibleVPixel = Math.min(F + h, S) + E, v = this.ensureAllRowsInRangeHaveHeightsCalculated(f, p);
      } while (v);
      let g = this.rowModel.getRowIndexAtPixel(f), y = this.rowModel.getRowIndexAtPixel(p);
      const C = this.pageBoundsService.getFirstRow(), m = this.pageBoundsService.getLastRow();
      g < C && (g = C), y > m && (y = m), e = g, t = y;
    }
    const r = Ao(this.gos, "normal"), n = this.gos.get("suppressMaxRenderedRowRestriction"), a = Math.max(this.getRowBuffer(), 500);
    r && !n && t - e > a && (t = e + a);
    const u = e !== this.firstRenderedRow, s = t !== this.lastRenderedRow;
    (u || s) && (this.firstRenderedRow = e, this.lastRenderedRow = t, this.eventService.dispatchEvent({
      type: "viewportChanged",
      firstRow: e,
      lastRow: t
    }));
  }
  /**
   * This event will only be fired once, and is queued until after the browser next renders.
   * This allows us to fire an event during the start of the render cycle, when we first see data being rendered
   * but not execute the event until all of the data has finished being rendered to the dom.
   */
  dispatchFirstDataRenderedEvent() {
    this.dataFirstRenderedFired || (this.dataFirstRenderedFired = !0, window.requestAnimationFrame(() => {
      this.beans.eventService.dispatchEvent({
        type: "firstDataRendered",
        firstRow: this.firstRenderedRow,
        lastRow: this.lastRenderedRow
      });
    }));
  }
  ensureAllRowsInRangeHaveHeightsCalculated(e, t) {
    var u, s;
    const r = (u = this.pinnedRowModel) == null ? void 0 : u.ensureRowHeightsValid(), n = (s = this.stickyRowFeature) == null ? void 0 : s.ensureRowHeightsValid(), a = this.rowModel.ensureRowHeightsValid(
      e,
      t,
      this.pageBoundsService.getFirstRow(),
      this.pageBoundsService.getLastRow()
    );
    return (a || n) && this.eventService.dispatchEvent({
      type: "recalculateRowBounds"
    }), n || a || r ? (this.updateContainerHeights(), !0) : !1;
  }
  getFirstVisibleVerticalPixel() {
    return this.firstVisibleVPixel;
  }
  getLastVisibleVerticalPixel() {
    return this.lastVisibleVPixel;
  }
  getFirstVirtualRenderedRow() {
    return this.firstRenderedRow;
  }
  getLastVirtualRenderedRow() {
    return this.lastRenderedRow;
  }
  // check that none of the rows to remove are editing or focused as:
  // a) if editing, we want to keep them, otherwise the user will loose the context of the edit,
  //    eg user starts editing, enters some text, then scrolls down and then up, next time row rendered
  //    the edit is reset - so we want to keep it rendered.
  // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard,
  //    otherwise the user can range select and drag (with focus cell going out of the viewport)
  //    and then ctrl+c, nothing will happen if cell is removed from dom.
  // c) if detail record of master detail, as users complained that the context of detail rows
  //    was getting lost when detail row out of view. eg user expands to show detail row,
  //    then manipulates the detail panel (eg sorts the detail grid), then context is lost
  //    after detail panel is scrolled out of / into view.
  doNotUnVirtualiseRow(e) {
    const n = e.getRowNode(), a = this.focusService.isRowNodeFocused(n), u = e.isEditing(), s = n.detail;
    return a || u || s ? !!this.isRowPresent(n) : !1;
  }
  isRowPresent(e) {
    return this.rowModel.isRowPresent(e) ? this.paginationService ? this.paginationService.isRowPresent(e) : !0 : !1;
  }
  createRowCon(e, t, r) {
    const n = this.cachedRowCtrls ? this.cachedRowCtrls.getRow(e) : null;
    if (n)
      return n;
    const a = this.gos.get("suppressAnimationFrame"), u = r && !a && !this.printLayout;
    return new Gh(e, this.beans, t, u, this.printLayout);
  }
  getRenderedNodes() {
    const e = this.rowCtrlsByRowIndex;
    return Object.values(e).map((t) => t.getRowNode());
  }
  getRowByPosition(e) {
    let t;
    const { rowIndex: r } = e;
    switch (e.rowPinned) {
      case "top":
        t = this.topRowCtrls[r];
        break;
      case "bottom":
        t = this.bottomRowCtrls[r];
        break;
      default:
        t = this.rowCtrlsByRowIndex[r], t || (t = this.getStickyTopRowCtrls().find((n) => n.getRowNode().rowIndex === r) || null, t || (t = this.getStickyBottomRowCtrls().find((n) => n.getRowNode().rowIndex === r) || null));
        break;
    }
    return t;
  }
  // returns true if any row between startIndex and endIndex is rendered. used by
  // SSRM or IRM, as they don't want to purge visible blocks from cache.
  isRangeInRenderedViewport(e, t) {
    if (e == null || t == null)
      return !1;
    const n = e > this.lastRenderedRow;
    return !(t < this.firstRenderedRow) && !n;
  }
}, gZ = class {
  constructor(e) {
    this.entriesMap = {}, this.entriesList = [], this.maxCount = e;
  }
  addRow(e) {
    if (this.entriesMap[e.getRowNode().id] = e, this.entriesList.push(e), e.setCached(!0), this.entriesList.length > this.maxCount) {
      const t = this.entriesList[0];
      t.destroyFirstPass(), t.destroySecondPass(), this.removeFromCache(t);
    }
  }
  getRow(e) {
    if (e == null || e.id == null)
      return null;
    const t = this.entriesMap[e.id];
    return t ? (this.removeFromCache(t), t.setCached(!1), t.getRowNode() != e ? null : t) : null;
  }
  has(e) {
    return this.entriesMap[e.id] != null;
  }
  removeRow(e) {
    const t = e.id, r = this.entriesMap[t];
    delete this.entriesMap[t], bs(this.entriesList, r);
  }
  removeFromCache(e) {
    const t = e.getRowNode().id;
    delete this.entriesMap[t], bs(this.entriesList, e);
  }
  getEntries() {
    return this.entriesList;
  }
}, mZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "pinnedRowModel", this.nextId = 0, this.pinnedTopRows = new hF(), this.pinnedBottomRows = new hF();
  }
  wireBeans(e) {
    this.beans = e;
  }
  postConstruct() {
    this.setPinnedRowData(this.gos.get("pinnedTopRowData"), "top"), this.setPinnedRowData(this.gos.get("pinnedBottomRowData"), "bottom"), this.addManagedPropertyListener("pinnedTopRowData", (e) => this.setPinnedRowData(e.currentValue, "top")), this.addManagedPropertyListener("pinnedBottomRowData", (e) => this.setPinnedRowData(e.currentValue, "bottom")), this.addManagedEventListeners({ gridStylesChanged: this.onGridStylesChanges.bind(this) });
  }
  isEmpty(e) {
    return (e === "top" ? this.pinnedTopRows : this.pinnedBottomRows).isEmpty();
  }
  isRowsToRender(e) {
    return !this.isEmpty(e);
  }
  onGridStylesChanges(e) {
    if (e.rowHeightChanged) {
      const t = (r) => {
        r.setRowHeight(r.rowHeight, !0);
      };
      this.pinnedBottomRows.forEach(t), this.pinnedTopRows.forEach(t);
    }
  }
  ensureRowHeightsValid() {
    var n, a;
    let e = !1, t = 0;
    const r = (u) => {
      if (u.rowHeightEstimated) {
        const s = af(this.gos, u);
        u.setRowTop(t), u.setRowHeight(s.height), t += s.height, e = !0;
      }
    };
    return (n = this.pinnedBottomRows) == null || n.forEach(r), t = 0, (a = this.pinnedTopRows) == null || a.forEach(r), this.eventService.dispatchEvent({
      type: "pinnedHeightChanged"
    }), e;
  }
  setPinnedRowData(e, t) {
    this.updateNodesFromRowData(e, t), this.eventService.dispatchEvent({
      type: "pinnedRowDataChanged"
    });
  }
  /**
   * Updates existing RowNode instances and creates new ones if necessary
   *
   * Setting data as `undefined` will clear row nodes
   */
  updateNodesFromRowData(e, t) {
    const r = t === "top" ? this.pinnedTopRows : this.pinnedBottomRows;
    if (e === void 0) {
      r.clear();
      return;
    }
    const n = ty(this.gos), a = t === "top" ? Oh.ID_PREFIX_TOP_PINNED : Oh.ID_PREFIX_BOTTOM_PINNED, u = r.getIds(), s = [], c = /* @__PURE__ */ new Set();
    let i = 0, l = -1;
    for (const v of e) {
      const f = (n == null ? void 0 : n({ data: v, level: 0, rowPinned: t })) ?? a + this.nextId++;
      if (c.has(f)) {
        Fr(
          "Duplicate ID",
          f,
          "found for pinned row with data",
          v,
          "When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."
        );
        continue;
      }
      l++, c.add(f), s.push(f);
      const p = r.getById(f);
      if (p !== void 0)
        p.data !== v && p.setData(v), i += this.setRowTopAndRowIndex(p, i, l), u.delete(f);
      else {
        const g = new Oh(this.beans);
        g.id = f, g.data = v, g.rowPinned = t, i += this.setRowTopAndRowIndex(g, i, l), r.push(g);
      }
    }
    u.forEach((v) => {
      var f;
      (f = r.getById(v)) == null || f.clearRowTopAndRowIndex();
    }), r.removeAllById(u), r.setOrder(s);
  }
  setRowTopAndRowIndex(e, t, r) {
    return e.setRowTop(t), e.setRowHeight(af(this.gos, e).height), e.setRowIndex(r), e.rowHeight;
  }
  getPinnedTopTotalHeight() {
    return this.getTotalHeight(this.pinnedTopRows);
  }
  getPinnedBottomTotalHeight() {
    return this.getTotalHeight(this.pinnedBottomRows);
  }
  getPinnedTopRowCount() {
    return this.pinnedTopRows.getSize();
  }
  getPinnedBottomRowCount() {
    return this.pinnedBottomRows.getSize();
  }
  getPinnedTopRow(e) {
    return this.pinnedTopRows.getByIndex(e);
  }
  getPinnedBottomRow(e) {
    return this.pinnedBottomRows.getByIndex(e);
  }
  getPinnedRowById(e, t) {
    return t === "top" ? this.pinnedTopRows.getById(e) : this.pinnedBottomRows.getById(e);
  }
  forEachPinnedRow(e, t) {
    return e === "top" ? this.pinnedTopRows.forEach(t) : this.pinnedBottomRows.forEach(t);
  }
  getTotalHeight(e) {
    const t = e.getSize();
    if (t === 0)
      return 0;
    const r = e.getByIndex(t - 1);
    return r === void 0 ? 0 : r.rowTop + r.rowHeight;
  }
}, hF = class {
  constructor() {
    this.cache = {}, this.ordering = [];
  }
  getById(e) {
    return this.cache[e];
  }
  getByIndex(e) {
    const t = this.ordering[e];
    return this.cache[t];
  }
  push(e) {
    this.cache[e.id] = e, this.ordering.push(e.id);
  }
  removeAllById(e) {
    for (const t of e)
      delete this.cache[t];
    this.ordering = this.ordering.filter((t) => !e.has(t));
  }
  setOrder(e) {
    this.ordering = e;
  }
  forEach(e) {
    this.ordering.forEach((t, r) => {
      const n = this.cache[t];
      n && e(n, r);
    });
  }
  clear() {
    this.ordering.length = 0, this.cache = {};
  }
  isEmpty() {
    return this.ordering.length === 0;
  }
  getSize() {
    return this.ordering.length;
  }
  getIds() {
    return new Set(this.ordering);
  }
}, yZ = class {
  constructor() {
    this.root = null, this.end = null, this.cachedRange = [];
  }
  init(e) {
    this.rowModel = e;
  }
  reset() {
    this.root = null, this.end = null, this.cachedRange.length = 0;
  }
  setRoot(e) {
    this.root = e, this.end = null, this.cachedRange.length = 0;
  }
  setEndRange(e) {
    this.end = e, this.cachedRange.length = 0;
  }
  getRange() {
    if (this.cachedRange.length === 0) {
      const e = this.getRoot(), t = this.getEnd();
      if (e == null || t == null)
        return this.cachedRange;
      this.cachedRange = this.rowModel.getNodesInRangeForSelection(e, t);
    }
    return this.cachedRange;
  }
  isInRange(e) {
    return this.root === null ? !1 : this.getRange().some((t) => t.id === e.id);
  }
  getRoot() {
    var e;
    return this.root && ((e = this.root) == null ? void 0 : e.key) === null && (this.root = this.rowModel.getRowNode(this.root.id) ?? null), this.root;
  }
  getEnd() {
    var e;
    return this.end && ((e = this.end) == null ? void 0 : e.key) === null && (this.end = this.rowModel.getRowNode(this.end.id) ?? null), this.end;
  }
  /**
   * Truncates the range to the given node (assumed to be within the current range).
   * Returns nodes that remain in the current range and those that should be removed
   *
   * @param node - Node at which to truncate the range
   * @returns Object of nodes to either keep or discard (i.e. deselect) from the range
   */
  truncate(e) {
    const t = this.getRange();
    if (t.length === 0)
      return { keep: [], discard: [] };
    const r = t[0].id === this.root.id, n = t.findIndex((a) => a.id === e.id);
    if (n > -1) {
      const a = t.slice(0, n), u = t.slice(n + 1);
      return this.setEndRange(e), r ? { keep: a, discard: u } : { keep: u, discard: a };
    } else
      return { keep: t, discard: [] };
  }
  /**
   * Extends the range to the given node. Returns nodes that remain in the current range
   * and those that should be removed.
   *
   * @param node - Node marking the new end of the range
   * @returns Object of nodes to either keep or discard (i.e. deselect) from the range
   */
  extend(e, t = !1) {
    const r = this.getRoot();
    if (r == null) {
      const a = this.getRange().slice();
      return t && e.depthFirstSearch((u) => !u.group && a.push(u)), a.push(e), this.setRoot(e), { keep: a, discard: [] };
    }
    if (this.rowModel.getNodesInRangeForSelection(r, e).find((a) => {
      var u;
      return a.id === ((u = this.end) == null ? void 0 : u.id);
    }))
      return this.setEndRange(e), { keep: this.getRange(), discard: [] };
    {
      const a = this.getRange().slice();
      return this.setEndRange(e), { keep: this.getRange(), discard: a };
    }
  }
}, CZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "stylingService";
  }
  wireBeans(e) {
    this.expressionService = e.expressionService;
  }
  processAllCellClasses(e, t, r, n) {
    this.processClassRules(void 0, e.cellClassRules, t, r, n), this.processStaticCellClasses(e, t, r);
  }
  processClassRules(e, t, r, n, a) {
    if (t == null && e == null)
      return;
    const u = {}, s = {}, c = (i, l) => {
      i.split(" ").forEach((v) => {
        v.trim() != "" && l(v);
      });
    };
    if (t) {
      const i = Object.keys(t);
      for (let l = 0; l < i.length; l++) {
        const v = i[l], f = t[v];
        let p;
        typeof f == "string" ? p = this.expressionService.evaluate(f, r) : typeof f == "function" && (p = f(r)), c(v, (g) => {
          p ? u[g] = !0 : s[g] = !0;
        });
      }
    }
    e && a && Object.keys(e).forEach(
      (i) => c(i, (l) => {
        u[l] || (s[l] = !0);
      })
    ), a && Object.keys(s).forEach(a), Object.keys(u).forEach(n);
  }
  getStaticCellClasses(e, t) {
    const { cellClass: r } = e;
    if (!r)
      return [];
    let n;
    return typeof r == "function" ? n = r(t) : n = r, typeof n == "string" && (n = [n]), n || [];
  }
  processStaticCellClasses(e, t, r) {
    this.getStaticCellClasses(e, t).forEach((a) => {
      r(a);
    });
  }
}, OC = /* @__PURE__ */ ((e) => (e.TAB_GUARD = "ag-tab-guard", e.TAB_GUARD_TOP = "ag-tab-guard-top", e.TAB_GUARD_BOTTOM = "ag-tab-guard-bottom", e))(OC || {}), r4 = class extends mr {
  constructor(e) {
    super(), this.skipTabGuardFocus = !1, this.forcingFocusOut = !1, this.allowFocus = !1;
    const {
      comp: t,
      eTopGuard: r,
      eBottomGuard: n,
      focusTrapActive: a,
      forceFocusOutWhenTabGuardsAreEmpty: u,
      isFocusableContainer: s,
      focusInnerElement: c,
      onFocusIn: i,
      onFocusOut: l,
      shouldStopEventPropagation: v,
      onTabKeyDown: f,
      handleKeyDown: p,
      eFocusableElement: g
    } = e;
    this.comp = t, this.eTopGuard = r, this.eBottomGuard = n, this.providedFocusInnerElement = c, this.eFocusableElement = g, this.focusTrapActive = !!a, this.forceFocusOutWhenTabGuardsAreEmpty = !!u, this.isFocusableContainer = !!s, this.providedFocusIn = i, this.providedFocusOut = l, this.providedShouldStopEventPropagation = v, this.providedOnTabKeyDown = f, this.providedHandleKeyDown = p;
  }
  wireBeans(e) {
    this.focusService = e.focusService;
  }
  postConstruct() {
    this.createManagedBean(
      new $h(this.eFocusableElement, {
        shouldStopEventPropagation: () => this.shouldStopEventPropagation(),
        onTabKeyDown: (e) => this.onTabKeyDown(e),
        handleKeyDown: (e) => this.handleKeyDown(e),
        onFocusIn: (e) => this.onFocusIn(e),
        onFocusOut: (e) => this.onFocusOut(e)
      })
    ), this.activateTabGuards(), [this.eTopGuard, this.eBottomGuard].forEach(
      (e) => this.addManagedElementListeners(e, { focus: this.onFocus.bind(this) })
    );
  }
  handleKeyDown(e) {
    this.providedHandleKeyDown && this.providedHandleKeyDown(e);
  }
  tabGuardsAreActive() {
    return !!this.eTopGuard && this.eTopGuard.hasAttribute("tabIndex");
  }
  shouldStopEventPropagation() {
    return this.providedShouldStopEventPropagation ? this.providedShouldStopEventPropagation() : !1;
  }
  activateTabGuards() {
    if (this.forcingFocusOut)
      return;
    const e = this.gos.get("tabIndex");
    this.comp.setTabIndex(e.toString());
  }
  deactivateTabGuards() {
    this.comp.setTabIndex();
  }
  onFocus(e) {
    if (this.isFocusableContainer && !this.eFocusableElement.contains(e.relatedTarget) && !this.allowFocus) {
      this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);
      return;
    }
    if (this.skipTabGuardFocus) {
      this.skipTabGuardFocus = !1;
      return;
    }
    if (this.forceFocusOutWhenTabGuardsAreEmpty && this.focusService.findFocusableElements(this.eFocusableElement, ".ag-tab-guard").length === 0) {
      this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);
      return;
    }
    if (this.isFocusableContainer && this.eFocusableElement.contains(e.relatedTarget))
      return;
    const t = e.target === this.eBottomGuard;
    this.providedFocusInnerElement ? this.providedFocusInnerElement(t) : this.focusInnerElement(t);
  }
  findNextElementOutsideAndFocus(e) {
    var i;
    const t = Va(this.gos), r = this.focusService.findFocusableElements(t.body, null, !0), n = r.indexOf(e ? this.eTopGuard : this.eBottomGuard);
    if (n === -1)
      return;
    let a, u;
    e ? (a = 0, u = n) : (a = n + 1, u = r.length);
    const s = r.slice(a, u), c = this.gos.get("tabIndex");
    s.sort((l, v) => {
      const f = parseInt(l.getAttribute("tabindex") || "0"), p = parseInt(v.getAttribute("tabindex") || "0");
      return p === c ? 1 : f === c ? -1 : f === 0 ? 1 : p === 0 ? -1 : f - p;
    }), (i = s[e ? s.length - 1 : 0]) == null || i.focus();
  }
  onFocusIn(e) {
    this.focusTrapActive || this.forcingFocusOut || (this.providedFocusIn && this.providedFocusIn(e), this.isFocusableContainer || this.deactivateTabGuards());
  }
  onFocusOut(e) {
    this.focusTrapActive || (this.providedFocusOut && this.providedFocusOut(e), this.eFocusableElement.contains(e.relatedTarget) || this.activateTabGuards());
  }
  onTabKeyDown(e) {
    if (this.providedOnTabKeyDown) {
      this.providedOnTabKeyDown(e);
      return;
    }
    if (this.focusTrapActive || e.defaultPrevented)
      return;
    const t = this.tabGuardsAreActive();
    t && this.deactivateTabGuards();
    const r = this.getNextFocusableElement(e.shiftKey);
    t && setTimeout(() => this.activateTabGuards(), 0), r && (r.focus(), e.preventDefault());
  }
  focusInnerElement(e = !1) {
    const t = this.focusService.findFocusableElements(this.eFocusableElement);
    this.tabGuardsAreActive() && (t.splice(0, 1), t.splice(t.length - 1, 1)), t.length && t[e ? t.length - 1 : 0].focus({ preventScroll: !0 });
  }
  getNextFocusableElement(e) {
    return this.focusService.findNextFocusableElement(this.eFocusableElement, !1, e);
  }
  forceFocusOutOfContainer(e = !1) {
    if (this.forcingFocusOut)
      return;
    const t = e ? this.eTopGuard : this.eBottomGuard;
    this.activateTabGuards(), this.skipTabGuardFocus = !0, this.forcingFocusOut = !0, t.focus(), window.setTimeout(() => {
      this.forcingFocusOut = !1, this.activateTabGuards();
    });
  }
  isTabGuard(e, t) {
    return e === this.eTopGuard && !t || e === this.eBottomGuard && (t ?? !0);
  }
  setAllowFocus(e) {
    this.allowFocus = e;
  }
}, bZ = class extends mr {
  constructor(e) {
    super(), this.comp = e;
  }
  initialiseTabGuard(e) {
    this.eTopGuard = this.createTabGuard("top"), this.eBottomGuard = this.createTabGuard("bottom"), this.eFocusableElement = this.comp.getFocusableElement();
    const { eTopGuard: t, eBottomGuard: r, eFocusableElement: n } = this, a = [t, r], u = {
      setTabIndex: (C) => {
        a.forEach(
          (m) => C != null ? m.setAttribute("tabindex", C) : m.removeAttribute("tabindex")
        );
      }
    };
    this.addTabGuards(t, r);
    const {
      focusTrapActive: s = !1,
      onFocusIn: c,
      onFocusOut: i,
      focusInnerElement: l,
      handleKeyDown: v,
      onTabKeyDown: f,
      shouldStopEventPropagation: p,
      forceFocusOutWhenTabGuardsAreEmpty: g,
      isFocusableContainer: y
    } = e;
    this.tabGuardCtrl = this.createManagedBean(
      new r4({
        comp: u,
        focusTrapActive: s,
        eTopGuard: t,
        eBottomGuard: r,
        eFocusableElement: n,
        onFocusIn: c,
        onFocusOut: i,
        focusInnerElement: l,
        handleKeyDown: v,
        onTabKeyDown: f,
        shouldStopEventPropagation: p,
        forceFocusOutWhenTabGuardsAreEmpty: g,
        isFocusableContainer: y
      })
    );
  }
  getTabGuardCtrl() {
    return this.tabGuardCtrl;
  }
  createTabGuard(e) {
    const t = Va(this.gos).createElement("div"), r = e === "top" ? "ag-tab-guard-top" : "ag-tab-guard-bottom";
    return t.classList.add("ag-tab-guard", r), vu(t, "presentation"), t;
  }
  addTabGuards(e, t) {
    this.eFocusableElement.insertAdjacentElement("afterbegin", e), this.eFocusableElement.insertAdjacentElement("beforeend", t);
  }
  removeAllChildrenExceptTabGuards() {
    const e = [this.eTopGuard, this.eBottomGuard];
    Qs(this.comp.getFocusableElement()), this.addTabGuards(...e);
  }
  forceFocusOutOfContainer(e = !1) {
    this.tabGuardCtrl.forceFocusOutOfContainer(e);
  }
  appendChild(e, t, r) {
    X2(t) || (t = t.getGui());
    const { eBottomGuard: n } = this;
    n ? n.insertAdjacentElement("beforebegin", t) : e(t, r);
  }
}, wZ = class extends na {
  initialiseTabGuard(t) {
    this.tabGuardFeature = this.createManagedBean(new bZ(this)), this.tabGuardFeature.initialiseTabGuard(t);
  }
  forceFocusOutOfContainer(t = !1) {
    this.tabGuardFeature.forceFocusOutOfContainer(t);
  }
  appendChild(t, r) {
    this.tabGuardFeature.appendChild(super.appendChild.bind(this), t, r);
  }
}, SZ = 0, xZ = 200, TZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "popupService", this.popupList = [];
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.resizeObserverService = e.resizeObserverService, this.environment = e.environment;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      this.gridCtrl = e.gridCtrl;
    }), this.addManagedEventListeners({ gridStylesChanged: this.handleThemeChange.bind(this) });
  }
  getPopupParent() {
    const e = this.gos.get("popupParent");
    return e || this.gridCtrl.getGui();
  }
  positionPopupForMenu(e) {
    const { eventSource: t, ePopup: r } = e, n = this.getPopupIndex(r);
    if (n !== -1) {
      const g = this.popupList[n];
      g.alignedToElement = t;
    }
    const a = t.getBoundingClientRect(), u = this.getParentRect(), s = this.keepXYWithinBounds(
      r,
      a.top - u.top,
      0
      /* vertical */
    ), c = r.clientWidth > 0 ? r.clientWidth : 200;
    r.style.minWidth = `${c}px`;
    const l = u.right - u.left - c;
    let v;
    this.gos.get("enableRtl") ? (v = p(), v < 0 && (v = f(), this.setAlignedStyles(r, "left")), v > l && (v = 0, this.setAlignedStyles(r, "right"))) : (v = f(), v > l && (v = p(), this.setAlignedStyles(r, "right")), v < 0 && (v = 0, this.setAlignedStyles(r, "left"))), r.style.left = `${v}px`, r.style.top = `${s}px`;
    function f() {
      return a.right - u.left - 2;
    }
    function p() {
      return a.left - u.left - c;
    }
  }
  positionPopupUnderMouseEvent(e) {
    const { ePopup: t, nudgeX: r, nudgeY: n, skipObserver: a } = e;
    this.positionPopup({
      ePopup: t,
      nudgeX: r,
      nudgeY: n,
      keepWithinBounds: !0,
      skipObserver: a,
      updatePosition: () => this.calculatePointerAlign(e.mouseEvent),
      postProcessCallback: () => this.callPostProcessPopup(
        e.type,
        e.ePopup,
        null,
        e.mouseEvent,
        e.column,
        e.rowNode
      )
    });
  }
  calculatePointerAlign(e) {
    const t = this.getParentRect();
    return {
      x: e.clientX - t.left,
      y: e.clientY - t.top
    };
  }
  positionPopupByComponent(e) {
    const {
      ePopup: t,
      nudgeX: r,
      nudgeY: n,
      keepWithinBounds: a,
      eventSource: u,
      alignSide: s = "left",
      position: c = "over",
      column: i,
      rowNode: l,
      type: v
    } = e, f = u.getBoundingClientRect(), p = this.getParentRect(), g = this.getPopupIndex(t);
    if (g !== -1) {
      const C = this.popupList[g];
      C.alignedToElement = u;
    }
    const y = () => {
      let C = f.left - p.left;
      s === "right" && (C -= t.offsetWidth - f.width);
      let m;
      return c === "over" ? (m = f.top - p.top, this.setAlignedStyles(t, "over")) : (this.setAlignedStyles(t, "under"), this.shouldRenderUnderOrAbove(t, f, p, e.nudgeY || 0) === "under" ? m = f.top - p.top + f.height : m = f.top - t.offsetHeight - (n || 0) * 2 - p.top), { x: C, y: m };
    };
    this.positionPopup({
      ePopup: t,
      nudgeX: r,
      nudgeY: n,
      keepWithinBounds: a,
      updatePosition: y,
      postProcessCallback: () => this.callPostProcessPopup(v, t, u, null, i, l)
    });
  }
  shouldRenderUnderOrAbove(e, t, r, n) {
    const a = r.bottom - t.bottom, u = t.top - r.top, s = e.offsetHeight + n;
    return a > s ? "under" : u > s || u > a ? "above" : "under";
  }
  setAlignedStyles(e, t) {
    const r = this.getPopupIndex(e);
    if (r === -1)
      return;
    const n = this.popupList[r], { alignedToElement: a } = n;
    !a || (["right", "left", "over", "above", "under"].forEach((s) => {
      a.classList.remove(`ag-has-popup-positioned-${s}`), e.classList.remove(`ag-popup-positioned-${s}`);
    }), !t) || (a.classList.add(`ag-has-popup-positioned-${t}`), e.classList.add(`ag-popup-positioned-${t}`));
  }
  callPostProcessPopup(e, t, r, n, a, u) {
    const s = this.gos.getCallback("postProcessPopup");
    s && s({
      column: a,
      rowNode: u,
      ePopup: t,
      type: e,
      eventSource: r,
      mouseEvent: n
    });
  }
  positionPopup(e) {
    const { ePopup: t, keepWithinBounds: r, nudgeX: n, nudgeY: a, skipObserver: u, updatePosition: s } = e, c = { width: 0, height: 0 }, i = (l = !1) => {
      let { x: v, y: f } = s();
      l && t.clientWidth === c.width && t.clientHeight === c.height || (c.width = t.clientWidth, c.height = t.clientHeight, n && (v += n), a && (f += a), r && (v = this.keepXYWithinBounds(
        t,
        v,
        1
        /* horizontal */
      ), f = this.keepXYWithinBounds(
        t,
        f,
        0
        /* vertical */
      )), t.style.left = `${v}px`, t.style.top = `${f}px`, e.postProcessCallback && e.postProcessCallback());
    };
    if (i(), !u) {
      const l = this.resizeObserverService.observeResize(
        t,
        () => i(!0)
      );
      setTimeout(() => l(), xZ);
    }
  }
  getActivePopups() {
    return this.popupList.map((e) => e.element);
  }
  getPopupList() {
    return this.popupList;
  }
  getParentRect() {
    const e = Va(this.gos);
    let t = this.getPopupParent();
    return t === e.body ? t = e.documentElement : getComputedStyle(t).position === "static" && (t = t.offsetParent), rk(t);
  }
  keepXYWithinBounds(e, t, r) {
    const n = r === 0, a = n ? "clientHeight" : "clientWidth", u = n ? "top" : "left", s = n ? "height" : "width", c = n ? "scrollTop" : "scrollLeft", i = Va(this.gos), l = i.documentElement, v = this.getPopupParent(), f = e.getBoundingClientRect(), p = v.getBoundingClientRect(), g = i.documentElement.getBoundingClientRect(), y = v === i.body, C = Math.ceil(f[s]);
    let h = y ? (n ? tk : g1)(l) + l[c] : v[a];
    y && (h -= Math.abs(g[u] - p[u]));
    const w = h - C;
    return Math.min(Math.max(t, 0), Math.abs(w));
  }
  addPopup(e) {
    const t = Va(this.gos), { eChild: r, ariaLabel: n, alwaysOnTop: a, positionCallback: u, anchorToElement: s } = e;
    if (!t)
      return Fr("could not find the document, document is empty"), { hideFunc: () => {
      } };
    const c = this.getPopupIndex(r);
    if (c !== -1)
      return { hideFunc: this.popupList[c].hideFunc };
    this.initialisePopupPosition(r);
    const i = this.createPopupWrapper(r, n, !!a), l = this.addEventListenersToPopup({ ...e, wrapperEl: i });
    return u && u(), this.addPopupToPopupList(r, i, l, s), {
      hideFunc: l
    };
  }
  initialisePopupPosition(e) {
    const r = this.getPopupParent().getBoundingClientRect();
    $r(e.style.top) || (e.style.top = `${r.top * -1}px`), $r(e.style.left) || (e.style.left = `${r.left * -1}px`);
  }
  createPopupWrapper(e, t, r) {
    const n = this.getPopupParent(), a = document.createElement("div");
    return this.environment.applyThemeClasses(a), a.classList.add("ag-popup"), e.classList.add(this.gos.get("enableRtl") ? "ag-rtl" : "ag-ltr", "ag-popup-child"), e.hasAttribute("role") || vu(e, "dialog"), Dv(e, t), a.appendChild(e), n.appendChild(a), r ? this.setAlwaysOnTop(e, !0) : this.bringPopupToFront(e), a;
  }
  handleThemeChange(e) {
    if (e.themeChanged)
      for (const t of this.popupList)
        this.environment.applyThemeClasses(t.wrapper);
  }
  addEventListenersToPopup(e) {
    const t = Va(this.gos), r = this.getPopupParent(), { wrapperEl: n, eChild: a, closedCallback: u, afterGuiAttached: s, closeOnEsc: c, modal: i } = e;
    let l = !1;
    const v = (y) => {
      if (!n.contains(Sa(this.gos)))
        return;
      y.key === dr.ESCAPE && !Qc(y) && g({ keyboardEvent: y });
    }, f = (y) => g({ mouseEvent: y }), p = (y) => g({ touchEvent: y }), g = (y = {}) => {
      const { mouseEvent: C, touchEvent: m, keyboardEvent: h, forceHide: w } = y;
      !w && // we don't hide popup if the event was on the child, or any
      // children of this child
      (this.isEventFromCurrentPopup({ mouseEvent: C, touchEvent: m }, a) || // this method should only be called once. the client can have different
      // paths, each one wanting to close, so this method may be called multiple times.
      l) || (l = !0, r.removeChild(n), t.removeEventListener("keydown", v), t.removeEventListener("mousedown", f), t.removeEventListener("touchstart", p), t.removeEventListener("contextmenu", f), this.eventService.removeEventListener("dragStarted", f), u && u(C || m || h), this.removePopupFromPopupList(a));
    };
    return s && s({ hidePopup: g }), window.setTimeout(() => {
      c && t.addEventListener("keydown", v), i && (t.addEventListener("mousedown", f), this.eventService.addEventListener("dragStarted", f), t.addEventListener("touchstart", p), t.addEventListener("contextmenu", f));
    }, 0), g;
  }
  addPopupToPopupList(e, t, r, n) {
    this.popupList.push({
      element: e,
      wrapper: t,
      hideFunc: r,
      instanceId: SZ++,
      isAnchored: !!n
    }), n && this.setPopupPositionRelatedToElement(e, n);
  }
  getPopupIndex(e) {
    return this.popupList.findIndex((t) => t.element === e);
  }
  setPopupPositionRelatedToElement(e, t) {
    const r = this.getPopupIndex(e);
    if (r === -1)
      return;
    const n = this.popupList[r];
    if (n.stopAnchoringPromise && n.stopAnchoringPromise.then((u) => u && u()), n.stopAnchoringPromise = void 0, n.isAnchored = !1, !t)
      return;
    const a = this.keepPopupPositionedRelativeTo({
      element: t,
      ePopup: e,
      hidePopup: n.hideFunc
    });
    return n.stopAnchoringPromise = a, n.isAnchored = !0, a;
  }
  removePopupFromPopupList(e) {
    this.setAlignedStyles(e, null), this.setPopupPositionRelatedToElement(e, null), this.popupList = this.popupList.filter((t) => t.element !== e);
  }
  keepPopupPositionedRelativeTo(e) {
    const t = this.getPopupParent(), r = t.getBoundingClientRect(), { element: n, ePopup: a } = e, u = n.getBoundingClientRect(), s = (f) => parseInt(f.substring(0, f.length - 1), 10), c = (f, p) => {
      const g = r[f] - u[f], y = s(a.style[f]);
      return {
        initialDiff: g,
        lastDiff: g,
        initial: y,
        last: y,
        direction: p
      };
    }, i = c(
      "top",
      0
      /* vertical */
    ), l = c(
      "left",
      1
      /* horizontal */
    ), v = this.getFrameworkOverrides();
    return new Ia((f) => {
      v.wrapIncoming(() => {
        v.setInterval(() => {
          const p = t.getBoundingClientRect(), g = n.getBoundingClientRect();
          if (g.top == 0 && g.left == 0 && g.height == 0 && g.width == 0) {
            e.hidePopup();
            return;
          }
          const C = (m, h) => {
            const w = s(a.style[h]);
            m.last !== w && (m.initial = w, m.last = w);
            const S = p[h] - g[h];
            if (S != m.lastDiff) {
              const E = this.keepXYWithinBounds(
                a,
                m.initial + m.initialDiff - S,
                m.direction
              );
              a.style[h] = `${E}px`, m.last = E;
            }
            m.lastDiff = S;
          };
          C(i, "top"), C(l, "left");
        }, 200).then((p) => {
          f(() => {
            p != null && window.clearInterval(p);
          });
        });
      }, "popupPositioning");
    });
  }
  hasAnchoredPopup() {
    return this.popupList.some((e) => e.isAnchored);
  }
  isEventFromCurrentPopup(e, t) {
    const { mouseEvent: r, touchEvent: n } = e, a = r || n;
    if (!a)
      return !1;
    const u = this.getPopupIndex(t);
    if (u === -1)
      return !1;
    for (let s = u; s < this.popupList.length; s++) {
      const c = this.popupList[s];
      if (nU(c.element, a))
        return !0;
    }
    return this.isElementWithinCustomPopup(a.target);
  }
  isElementWithinCustomPopup(e) {
    const t = Va(this.gos);
    for (; e && e !== t.body; ) {
      if (e.classList.contains("ag-custom-component-popup") || e.parentElement === null)
        return !0;
      e = e.parentElement;
    }
    return !1;
  }
  getWrapper(e) {
    for (; !e.classList.contains("ag-popup") && e.parentElement; )
      e = e.parentElement;
    return e.classList.contains("ag-popup") ? e : null;
  }
  setAlwaysOnTop(e, t) {
    const r = this.getWrapper(e);
    r && (r.classList.toggle("ag-always-on-top", !!t), t && this.bringPopupToFront(r));
  }
  /** @return true if moved */
  bringPopupToFront(e) {
    const t = this.getPopupParent(), r = Array.prototype.slice.call(t.querySelectorAll(".ag-popup")), n = r.length, a = Array.prototype.slice.call(
      t.querySelectorAll(".ag-popup.ag-always-on-top")
    ), u = a.length, s = this.getWrapper(e);
    if (!s || n <= 1 || !t.contains(e))
      return !1;
    const c = r.indexOf(s), i = s.querySelectorAll("div"), l = [];
    i.forEach((f) => {
      f.scrollTop !== 0 && l.push([f, f.scrollTop]);
    });
    let v = !1;
    for (u ? s.classList.contains("ag-always-on-top") ? c !== n - 1 && (di(a).insertAdjacentElement("afterend", s), v = !0) : c !== n - u - 1 && (a[0].insertAdjacentElement("beforebegin", s), v = !0) : c !== n - 1 && (di(r).insertAdjacentElement("afterend", s), v = !0); l.length; ) {
      const f = l.pop();
      f[0].scrollTop = f[1];
    }
    return v;
  }
}, RZ = ["touchstart", "touchend", "touchmove", "touchcancel"], n4 = class {
  constructor(e = "javascript") {
    this.frameworkName = e, this.renderingEngine = "vanilla", this.wrapIncoming = (t) => t(), this.wrapOutgoing = (t) => t();
  }
  setInterval(e, t) {
    return new Ia((r) => {
      r(window.setInterval(e, t));
    });
  }
  // for Vanilla JS, we just add the event to the element
  addEventListener(e, t, r, n) {
    const a = kh(RZ, t);
    e.addEventListener(t, r, { capture: !!n, passive: a });
  }
  get shouldWrapOutgoing() {
    return !1;
  }
  frameworkComponent(e) {
    return null;
  }
  isFrameworkComponent(e) {
    return !1;
  }
  getDocLink(e) {
    return `https://www.ag-grid.com/${this.frameworkName === "solid" ? "react" : this.frameworkName}-data-grid${e ? `/${e}` : ""}`;
  }
}, AZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "cellNavigationService";
  }
  wireBeans(e) {
    this.visibleColsService = e.visibleColsService, this.rowModel = e.rowModel, this.rowRenderer = e.rowRenderer, this.pinnedRowModel = e.pinnedRowModel, this.paginationService = e.paginationService, this.pageBoundsService = e.pageBoundsService;
  }
  // returns null if no cell to focus on, ie at the end of the grid
  getNextCellToFocus(e, t, r = !1) {
    return r ? this.getNextCellToFocusWithCtrlPressed(e, t) : this.getNextCellToFocusWithoutCtrlPressed(e, t);
  }
  getNextCellToFocusWithCtrlPressed(e, t) {
    const r = e === dr.UP, n = e === dr.DOWN, a = e === dr.LEFT;
    let u, s;
    if (r || n)
      s = r ? this.pageBoundsService.getFirstRow() : this.pageBoundsService.getLastRow(), u = t.column;
    else {
      const c = this.visibleColsService.getAllCols(), i = this.gos.get("enableRtl");
      s = t.rowIndex, u = a !== i ? c[0] : di(c);
    }
    return {
      rowIndex: s,
      rowPinned: null,
      column: u
    };
  }
  getNextCellToFocusWithoutCtrlPressed(e, t) {
    let r = t, n = !1;
    for (; !n; ) {
      switch (e) {
        case dr.UP:
          r = this.getCellAbove(r);
          break;
        case dr.DOWN:
          r = this.getCellBelow(r);
          break;
        case dr.RIGHT:
          this.gos.get("enableRtl") ? r = this.getCellToLeft(r) : r = this.getCellToRight(r);
          break;
        case dr.LEFT:
          this.gos.get("enableRtl") ? r = this.getCellToRight(r) : r = this.getCellToLeft(r);
          break;
        default:
          r = null, Fr("unknown key for navigation ", e);
          break;
      }
      r ? n = this.isCellGoodToFocusOn(r) : n = !0;
    }
    return r;
  }
  isCellGoodToFocusOn(e) {
    const t = e.column;
    let r;
    switch (e.rowPinned) {
      case "top":
        r = this.pinnedRowModel.getPinnedTopRow(e.rowIndex);
        break;
      case "bottom":
        r = this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);
        break;
      default:
        r = this.rowModel.getRow(e.rowIndex);
        break;
    }
    return r ? !t.isSuppressNavigable(r) : !1;
  }
  getCellToLeft(e) {
    if (!e)
      return null;
    const t = this.visibleColsService.getColBefore(e.column);
    return t ? {
      rowIndex: e.rowIndex,
      column: t,
      rowPinned: e.rowPinned
    } : null;
  }
  getCellToRight(e) {
    if (!e)
      return null;
    const t = this.visibleColsService.getColAfter(e.column);
    return t ? {
      rowIndex: e.rowIndex,
      column: t,
      rowPinned: e.rowPinned
    } : null;
  }
  getRowBelow(e) {
    const t = e.rowIndex, r = e.rowPinned;
    let n = !1;
    if (this.isLastRowInContainer(e))
      switch (r) {
        case "bottom":
          return null;
        case "top":
          return this.rowModel.isRowsToRender() ? { rowIndex: this.pageBoundsService.getFirstRow(), rowPinned: null } : this.pinnedRowModel.isRowsToRender("bottom") ? { rowIndex: 0, rowPinned: "bottom" } : null;
        default:
          return this.pinnedRowModel.isRowsToRender("bottom") ? { rowIndex: 0, rowPinned: "bottom" } : null;
      }
    else r && (n = !0);
    const a = this.rowModel.getRow(e.rowIndex), u = n ? void 0 : this.getNextStickyPosition(a);
    return u || { rowIndex: t + 1, rowPinned: r };
  }
  getNextStickyPosition(e, t) {
    if (!U1(this.gos) || !e || !e.sticky)
      return;
    const r = this.rowRenderer.getStickyTopRowCtrls().some((c) => c.getRowNode().rowIndex === e.rowIndex);
    let n = [];
    r ? n = [...this.rowRenderer.getStickyTopRowCtrls()].sort(
      (c, i) => c.getRowNode().rowIndex - i.getRowNode().rowIndex
    ) : n = [...this.rowRenderer.getStickyBottomRowCtrls()].sort(
      (c, i) => i.getRowNode().rowIndex - c.getRowNode().rowIndex
    );
    const a = t ? -1 : 1, u = n.findIndex((c) => c.getRowNode().rowIndex === e.rowIndex), s = n[u + a];
    if (s)
      return { rowIndex: s.getRowNode().rowIndex, rowPinned: null };
  }
  getCellBelow(e) {
    if (!e)
      return null;
    const t = this.getRowBelow(e);
    return t ? {
      rowIndex: t.rowIndex,
      column: e.column,
      rowPinned: t.rowPinned
    } : null;
  }
  isLastRowInContainer(e) {
    const t = e.rowPinned, r = e.rowIndex;
    return t === "top" ? this.pinnedRowModel.getPinnedTopRowCount() - 1 <= r : t === "bottom" ? this.pinnedRowModel.getPinnedBottomRowCount() - 1 <= r : this.pageBoundsService.getLastRow() <= r;
  }
  getRowAbove(e) {
    const t = e.rowIndex, r = e.rowPinned, n = r ? t === 0 : t === this.pageBoundsService.getFirstRow();
    let a = !1;
    if (n)
      return r === "top" ? null : r ? this.rowModel.isRowsToRender() ? this.getLastBodyCell() : this.pinnedRowModel.isRowsToRender("top") ? this.getLastFloatingTopRow() : null : this.pinnedRowModel.isRowsToRender("top") ? this.getLastFloatingTopRow() : null;
    r && (a = !0);
    const u = this.rowModel.getRow(e.rowIndex), s = a ? void 0 : this.getNextStickyPosition(u, !0);
    return s || { rowIndex: t - 1, rowPinned: r };
  }
  getCellAbove(e) {
    if (!e)
      return null;
    const t = this.getRowAbove({ rowIndex: e.rowIndex, rowPinned: e.rowPinned });
    return t ? {
      rowIndex: t.rowIndex,
      column: e.column,
      rowPinned: t.rowPinned
    } : null;
  }
  getLastBodyCell() {
    return { rowIndex: this.pageBoundsService.getLastRow(), rowPinned: null };
  }
  getLastFloatingTopRow() {
    return { rowIndex: this.pinnedRowModel.getPinnedTopRowCount() - 1, rowPinned: "top" };
  }
  getNextTabbedCell(e, t) {
    return t ? this.getNextTabbedCellBackwards(e) : this.getNextTabbedCellForwards(e);
  }
  getNextTabbedCellForwards(e) {
    var u;
    const t = this.visibleColsService.getAllCols();
    let r = e.rowIndex, n = e.rowPinned, a = this.visibleColsService.getColAfter(e.column);
    if (!a) {
      a = t[0];
      const s = this.getRowBelow(e);
      if (mi(s) || !s.rowPinned && !(((u = this.paginationService) == null ? void 0 : u.isRowInPage(s)) ?? !0))
        return null;
      r = s ? s.rowIndex : null, n = s ? s.rowPinned : null;
    }
    return { rowIndex: r, column: a, rowPinned: n };
  }
  getNextTabbedCellBackwards(e) {
    var u;
    const t = this.visibleColsService.getAllCols();
    let r = e.rowIndex, n = e.rowPinned, a = this.visibleColsService.getColBefore(e.column);
    if (!a) {
      a = di(t);
      const s = this.getRowAbove({ rowIndex: e.rowIndex, rowPinned: e.rowPinned });
      if (mi(s) || !s.rowPinned && !(((u = this.paginationService) == null ? void 0 : u.isRowInPage(s)) ?? !0))
        return null;
      r = s ? s.rowIndex : null, n = s ? s.rowPinned : null;
    }
    return { rowIndex: r, column: a, rowPinned: n };
  }
}, qo = (e, t) => {
  for (const r in t)
    t[r] = e;
  return t;
}, pF = {
  ...qo("@ag-grid-community/core", {
    dispatchEvent: 0,
    destroy: 0,
    getGridId: 0,
    getGridOption: 0,
    isDestroyed: 0,
    setGridOption: 0,
    updateGridOptions: 0,
    getState: 0,
    setNodesSelected: 0,
    selectAll: 0,
    deselectAll: 0,
    selectAllFiltered: 0,
    deselectAllFiltered: 0,
    selectAllOnCurrentPage: 0,
    deselectAllOnCurrentPage: 0,
    getSelectedNodes: 0,
    getSelectedRows: 0,
    redrawRows: 0,
    setRowNodeExpanded: 0,
    getRowNode: 0,
    addRenderedRowListener: 0,
    getRenderedNodes: 0,
    forEachNode: 0,
    getFirstDisplayedRow: 0,
    getFirstDisplayedRowIndex: 0,
    getLastDisplayedRow: 0,
    getLastDisplayedRowIndex: 0,
    getDisplayedRowAtIndex: 0,
    getDisplayedRowCount: 0,
    getModel: 0,
    getVerticalPixelRange: 0,
    getHorizontalPixelRange: 0,
    ensureColumnVisible: 0,
    ensureIndexVisible: 0,
    ensureNodeVisible: 0,
    getFocusedCell: 0,
    clearFocusedCell: 0,
    setFocusedCell: 0,
    tabToNextCell: 0,
    tabToPreviousCell: 0,
    setFocusedHeader: 0,
    addEventListener: 0,
    addGlobalListener: 0,
    removeEventListener: 0,
    removeGlobalListener: 0,
    expireValueCache: 0,
    getValue: 0,
    getCellValue: 0,
    showColumnMenuAfterButtonClick: 0,
    showColumnMenuAfterMouseClick: 0,
    showColumnMenu: 0,
    hidePopupMenu: 0,
    onSortChanged: 0,
    getPinnedTopRowCount: 0,
    getPinnedBottomRowCount: 0,
    getPinnedTopRow: 0,
    getPinnedBottomRow: 0,
    showLoadingOverlay: 0,
    showNoRowsOverlay: 0,
    hideOverlay: 0,
    setGridAriaProperty: 0,
    refreshCells: 0,
    flashCells: 0,
    refreshHeader: 0,
    isAnimationFrameQueueEmpty: 0,
    flushAllAnimationFrames: 0,
    getSizesForCurrentTheme: 0,
    getCellRendererInstances: 0,
    addRowDropZone: 0,
    removeRowDropZone: 0,
    getRowDropZoneParams: 0,
    getColumnDef: 0,
    getColumnDefs: 0,
    sizeColumnsToFit: 0,
    setColumnGroupOpened: 0,
    getColumnGroup: 0,
    getProvidedColumnGroup: 0,
    getDisplayNameForColumn: 0,
    getDisplayNameForColumnGroup: 0,
    getColumn: 0,
    getColumns: 0,
    applyColumnState: 0,
    getColumnState: 0,
    resetColumnState: 0,
    getColumnGroupState: 0,
    setColumnGroupState: 0,
    resetColumnGroupState: 0,
    isPinning: 0,
    isPinningLeft: 0,
    isPinningRight: 0,
    getDisplayedColAfter: 0,
    getDisplayedColBefore: 0,
    setColumnVisible: 0,
    setColumnsVisible: 0,
    setColumnPinned: 0,
    setColumnsPinned: 0,
    getAllGridColumns: 0,
    getDisplayedLeftColumns: 0,
    getDisplayedCenterColumns: 0,
    getDisplayedRightColumns: 0,
    getAllDisplayedColumns: 0,
    getAllDisplayedVirtualColumns: 0,
    moveColumn: 0,
    moveColumnByIndex: 0,
    moveColumns: 0,
    setColumnWidth: 0,
    setColumnWidths: 0,
    getLeftDisplayedColumnGroups: 0,
    getCenterDisplayedColumnGroups: 0,
    getRightDisplayedColumnGroups: 0,
    getAllDisplayedColumnGroups: 0,
    autoSizeColumn: 0,
    autoSizeColumns: 0,
    autoSizeAllColumns: 0,
    undoCellEditing: 0,
    redoCellEditing: 0,
    getCellEditorInstances: 0,
    getEditingCells: 0,
    stopEditing: 0,
    startEditingCell: 0,
    getCurrentUndoSize: 0,
    getCurrentRedoSize: 0,
    isAnyFilterPresent: 0,
    onFilterChanged: 0,
    isColumnFilterPresent: 0,
    getFilterInstance: 0,
    getColumnFilterInstance: 0,
    destroyFilter: 0,
    setFilterModel: 0,
    getFilterModel: 0,
    getColumnFilterModel: 0,
    setColumnFilterModel: 0,
    showColumnFilter: 0,
    isQuickFilterPresent: 0,
    getQuickFilter: 0,
    resetQuickFilter: 0,
    paginationIsLastPageFound: 0,
    paginationGetPageSize: 0,
    paginationGetCurrentPage: 0,
    paginationGetTotalPages: 0,
    paginationGetRowCount: 0,
    paginationGoToNextPage: 0,
    paginationGoToPreviousPage: 0,
    paginationGoToFirstPage: 0,
    paginationGoToLastPage: 0,
    paginationGoToPage: 0,
    // These may need updating to say which of multiple possible modules they could be missing from.
    expandAll: 0,
    collapseAll: 0,
    onRowHeightChanged: 0,
    setRowCount: 0,
    getCacheBlockState: 0,
    isLastRowIndexKnown: 0
  }),
  ...qo("@ag-grid-community/client-side-row-model", {
    onGroupExpandedOrCollapsed: 0,
    refreshClientSideRowModel: 0,
    isRowDataEmpty: 0,
    forEachLeafNode: 0,
    forEachNodeAfterFilter: 0,
    forEachNodeAfterFilterAndSort: 0,
    resetRowHeights: 0,
    applyTransaction: 0,
    applyTransactionAsync: 0,
    flushAsyncTransactions: 0,
    getBestCostNodeSelection: 0
  }),
  ...qo("@ag-grid-community/csv-export", {
    getDataAsCsv: 0,
    exportDataAsCsv: 0
  }),
  ...qo("@ag-grid-community/infinite-row-model", {
    refreshInfiniteCache: 0,
    purgeInfiniteCache: 0,
    getInfiniteRowCount: 0
  }),
  ...qo("@ag-grid-enterprise/advanced-filter", {
    getAdvancedFilterModel: 0,
    setAdvancedFilterModel: 0,
    showAdvancedFilterBuilder: 0,
    hideAdvancedFilterBuilder: 0
  }),
  ...qo("@ag-grid-enterprise/charts", {
    getChartModels: 0,
    getChartRef: 0,
    getChartImageDataURL: 0,
    downloadChart: 0,
    openChartToolPanel: 0,
    closeChartToolPanel: 0,
    createRangeChart: 0,
    createPivotChart: 0,
    createCrossFilterChart: 0,
    updateChart: 0,
    restoreChart: 0
  }),
  ...qo("@ag-grid-enterprise/clipboard", {
    copyToClipboard: 0,
    cutToClipboard: 0,
    copySelectedRowsToClipboard: 0,
    copySelectedRangeToClipboard: 0,
    copySelectedRangeDown: 0,
    pasteFromClipboard: 0
  }),
  ...qo("@ag-grid-enterprise/excel-export", {
    getDataAsExcel: 0,
    exportDataAsExcel: 0,
    getSheetDataForExcel: 0,
    getMultipleSheetsAsExcel: 0,
    exportMultipleSheetsAsExcel: 0
  }),
  ...qo("@ag-grid-enterprise/master-detail", {
    addDetailGridInfo: 0,
    removeDetailGridInfo: 0,
    getDetailGridInfo: 0,
    forEachDetailGridInfo: 0
  }),
  ...qo("@ag-grid-enterprise/menu", {
    showContextMenu: 0,
    showColumnChooser: 0,
    hideColumnChooser: 0
  }),
  ...qo("@ag-grid-enterprise/range-selection", {
    getCellRanges: 0,
    addCellRange: 0,
    clearRangeSelection: 0,
    clearCellSelection: 0
  }),
  ...qo("@ag-grid-enterprise/row-grouping", {
    addAggFunc: 0,
    addAggFuncs: 0,
    clearAggFuncs: 0,
    setColumnAggFunc: 0,
    isPivotMode: 0,
    getPivotResultColumn: 0,
    setValueColumns: 0,
    getValueColumns: 0,
    removeValueColumn: 0,
    removeValueColumns: 0,
    addValueColumn: 0,
    addValueColumns: 0,
    setRowGroupColumns: 0,
    removeRowGroupColumn: 0,
    removeRowGroupColumns: 0,
    addRowGroupColumn: 0,
    addRowGroupColumns: 0,
    getRowGroupColumns: 0,
    moveRowGroupColumn: 0,
    setPivotColumns: 0,
    removePivotColumn: 0,
    removePivotColumns: 0,
    addPivotColumn: 0,
    addPivotColumns: 0,
    getPivotColumns: 0,
    setPivotResultColumns: 0,
    getPivotResultColumns: 0
  }),
  ...qo("@ag-grid-enterprise/server-side-row-model", {
    getServerSideSelectionState: 0,
    setServerSideSelectionState: 0,
    applyServerSideTransaction: 0,
    applyServerSideTransactionAsync: 0,
    applyServerSideRowData: 0,
    retryServerSideLoads: 0,
    flushServerSideAsyncTransactions: 0,
    refreshServerSide: 0,
    getServerSideGroupLevelState: 0
  }),
  ...qo("@ag-grid-enterprise/side-bar", {
    isSideBarVisible: 0,
    setSideBarVisible: 0,
    setSideBarPosition: 0,
    openToolPanel: 0,
    closeToolPanel: 0,
    getOpenedToolPanel: 0,
    refreshToolPanel: 0,
    isToolPanelShowing: 0,
    getToolPanelInstance: 0,
    getSideBar: 0
  }),
  ...qo("@ag-grid-enterprise/status-bar", {
    getStatusPanel: 0
  })
}, Mx = {
  isDestroyed: () => !0,
  destroy() {
  },
  preConstruct() {
  },
  postConstruct() {
  },
  preWireBeans() {
  },
  wireBeans() {
  }
}, EZ = (e, t) => e.eventService.dispatchEvent(t), i4 = class {
};
Reflect.defineProperty(i4, "name", { value: "GridApi" });
var MZ = class extends mr {
  constructor() {
    super(), this.beanName = "apiFunctionService", this.api = new i4(), this.fns = {
      ...Mx,
      // dispatchEvent is used by frameworks, also used by aligned grids to identify a grid api instance
      dispatchEvent: EZ
    }, this.beans = null, this.preDestroyLink = "";
    const { api: e } = this;
    for (const t in pF)
      e[t] = this.makeApi(t)[t];
  }
  wireBeans(e) {
    this.beans = e;
  }
  postConstruct() {
    this.preDestroyLink = this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed");
  }
  addFunction(e, t) {
    var a;
    const { fns: r, beans: n } = this;
    r !== Mx && (r[e] = ((a = n == null ? void 0 : n.validationService) == null ? void 0 : a.validateApiFunction(e, t)) ?? t);
  }
  makeApi(e) {
    return {
      [e]: (...t) => {
        const {
          beans: r,
          fns: { [e]: n }
        } = this;
        return n ? n(r, ...t) : this.apiNotFound(e);
      }
    };
  }
  apiNotFound(e) {
    const { beans: t, gos: r, preDestroyLink: n } = this;
    if (!t)
      Fr(
        `Grid API function ${e}() cannot be called as the grid has been destroyed.
Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${n}`
      );
    else {
      const a = pF[e];
      r.assertModuleRegistered(a, `api.${e}`) && Fr(`API function '${e}' not registered to module '${a}'`);
    }
  }
  destroy() {
    super.destroy(), this.fns = Mx, this.beans = null;
  }
};
function DZ(e) {
  return {
    beanName: "gridApi",
    bean: e.getBean("apiFunctionService").api
  };
}
var FZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnDefFactory";
  }
  buildColumnDefs(e, t, r) {
    const n = [], a = {};
    return e.forEach((u) => {
      const s = this.createDefFromColumn(u, t, r);
      let c = !0, i = s, l = u.getOriginalParent(), v = null;
      for (; l; ) {
        let f = null;
        if (l.isPadding()) {
          l = l.getOriginalParent();
          continue;
        }
        const p = a[l.getGroupId()];
        if (p) {
          p.children.push(i), c = !1;
          break;
        }
        if (f = this.createDefFromGroup(l), f && (f.children = [i], a[f.groupId] = f, i = f, l = l.getOriginalParent()), l != null && v === l) {
          c = !1;
          break;
        }
        v = l;
      }
      c && n.push(i);
    }), n;
  }
  createDefFromGroup(e) {
    const t = dT(e.getColGroupDef(), ["children"]);
    return t && (t.groupId = e.getGroupId()), t;
  }
  createDefFromColumn(e, t, r) {
    const n = dT(e.getColDef());
    return n.colId = e.getColId(), n.width = e.getActualWidth(), n.rowGroup = e.isRowGroupActive(), n.rowGroupIndex = e.isRowGroupActive() ? t.indexOf(e) : null, n.pivot = e.isPivotActive(), n.pivotIndex = e.isPivotActive() ? r.indexOf(e) : null, n.aggFunc = e.isValueActive() ? e.getAggFunc() : null, n.hide = e.isVisible() ? void 0 : !0, n.pinned = e.isPinned() ? e.getPinned() : null, n.sort = e.getSort() ? e.getSort() : null, n.sortIndex = e.getSortIndex() != null ? e.getSortIndex() : null, n;
  }
}, PZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnEventDispatcher";
  }
  visibleCols(e) {
    this.eventService.dispatchEvent({
      type: "displayedColumnsChanged",
      source: e
    });
  }
  gridColumns() {
    this.eventService.dispatchEvent({
      type: "gridColumnsChanged"
    });
  }
  headerHeight(e) {
    this.eventService.dispatchEvent({
      type: "columnHeaderHeightChanged",
      column: e,
      columns: [e],
      source: "autosizeColumnHeaderHeight"
    });
  }
  groupHeaderHeight(e) {
    this.eventService.dispatchEvent({
      type: "columnGroupHeaderHeightChanged",
      columnGroup: e,
      source: "autosizeColumnGroupHeaderHeight"
    });
  }
  groupOpened(e) {
    this.eventService.dispatchEvent({
      type: "columnGroupOpened",
      columnGroup: e.length === 1 ? e[0] : void 0,
      columnGroups: e
    });
  }
  rowGroupChanged(e, t) {
    this.eventService.dispatchEvent({
      type: "columnRowGroupChanged",
      columns: e,
      column: e.length === 1 ? e[0] : null,
      source: t
    });
  }
  genericColumnEvent(e, t, r) {
    this.eventService.dispatchEvent({
      type: e,
      columns: t,
      column: t.length === 1 ? t[0] : null,
      source: r
    });
  }
  pivotModeChanged() {
    this.eventService.dispatchEvent({
      type: "columnPivotModeChanged"
    });
  }
  virtualColumnsChanged(e) {
    this.eventService.dispatchEvent({
      type: "virtualColumnsChanged",
      afterScroll: e
    });
  }
  newColumnsLoaded(e) {
    this.eventService.dispatchEvent({
      type: "newColumnsLoaded",
      source: e
    });
  }
  /** @deprecated v32.2 */
  everythingChanged(e) {
    this.eventService.dispatchEvent({
      type: "columnEverythingChanged",
      source: e
    });
  }
  columnMoved(e) {
    const { movedColumns: t, source: r, toIndex: n, finished: a } = e;
    this.eventService.dispatchEvent({
      type: "columnMoved",
      columns: t,
      column: t && t.length === 1 ? t[0] : null,
      toIndex: n,
      finished: a,
      source: r
    });
  }
  columnPinned(e, t) {
    if (!e.length)
      return;
    const r = e.length === 1 ? e[0] : null, n = this.getCommonValue(e, (a) => a.getPinned());
    this.eventService.dispatchEvent({
      type: "columnPinned",
      // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned'
      pinned: n ?? null,
      columns: e,
      column: r,
      source: t
    });
  }
  columnVisible(e, t) {
    if (!e.length)
      return;
    const r = e.length === 1 ? e[0] : null, n = this.getCommonValue(e, (a) => a.isVisible());
    this.eventService.dispatchEvent({
      type: "columnVisible",
      visible: n,
      columns: e,
      column: r,
      source: t
    });
  }
  getCommonValue(e, t) {
    if (!e || e.length == 0)
      return;
    const r = t(e[0]);
    for (let n = 1; n < e.length; n++)
      if (r !== t(e[n]))
        return;
    return r;
  }
  columnChanged(e, t, r) {
    this.eventService.dispatchEvent({
      type: e,
      columns: t,
      column: t && t.length == 1 ? t[0] : null,
      source: r
    });
  }
  columnResized(e, t, r, n = null) {
    e && e.length && this.eventService.dispatchEvent({
      type: "columnResized",
      columns: e,
      column: e.length === 1 ? e[0] : null,
      flexColumns: n,
      finished: t,
      source: r
    });
  }
}, IZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnGetStateService";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.funcColsService = e.funcColsService;
  }
  getColumnState() {
    const e = this.columnModel.getColDefCols();
    if (mi(e) || !this.columnModel.isAlive())
      return [];
    const r = this.columnModel.getAllCols().map((n) => this.createStateItemFromColumn(n));
    return this.orderColumnStateList(r), r;
  }
  createStateItemFromColumn(e) {
    const t = this.funcColsService.getRowGroupColumns(), r = this.funcColsService.getPivotColumns(), n = e.isRowGroupActive() ? t.indexOf(e) : null, a = e.isPivotActive() ? r.indexOf(e) : null, u = e.isValueActive() ? e.getAggFunc() : null, s = e.getSort() != null ? e.getSort() : null, c = e.getSortIndex() != null ? e.getSortIndex() : null, i = e.getFlex() != null && e.getFlex() > 0 ? e.getFlex() : null;
    return {
      colId: e.getColId(),
      width: e.getActualWidth(),
      hide: !e.isVisible(),
      pinned: e.getPinned(),
      sort: s,
      sortIndex: c,
      aggFunc: u,
      rowGroup: e.isRowGroupActive(),
      rowGroupIndex: n,
      pivot: e.isPivotActive(),
      pivotIndex: a,
      flex: i
    };
  }
  orderColumnStateList(e) {
    const t = this.columnModel.getCols(), r = new Map(t.map((n, a) => [n.getColId(), a]));
    e.sort((n, a) => {
      const u = r.has(n.colId) ? r.get(n.colId) : -1, s = r.has(a.colId) ? r.get(a.colId) : -1;
      return u - s;
    });
  }
}, LZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnGroupStateService";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.columnAnimationService = e.columnAnimationService, this.eventDispatcher = e.columnEventDispatcher, this.visibleColsService = e.visibleColsService;
  }
  getColumnGroupState() {
    const e = [], t = this.columnModel.getColTree();
    return id(null, t, (r) => {
      ts(r) && e.push({
        groupId: r.getGroupId(),
        open: r.isExpanded()
      });
    }), e;
  }
  resetColumnGroupState(e) {
    const t = this.columnModel.getColDefColTree();
    if (!t)
      return;
    const r = [];
    id(null, t, (n) => {
      if (ts(n)) {
        const a = n.getColGroupDef(), u = {
          groupId: n.getGroupId(),
          open: a ? a.openByDefault : void 0
        };
        r.push(u);
      }
    }), this.setColumnGroupState(r, e);
  }
  setColumnGroupState(e, t) {
    if (!this.columnModel.getColTree())
      return;
    this.columnAnimationService.start();
    const n = [];
    e.forEach((a) => {
      const u = a.groupId, s = a.open, c = this.columnModel.getProvidedColGroup(u);
      c && c.isExpanded() !== s && (c.setExpanded(s), n.push(c));
    }), this.visibleColsService.refresh(t, !0), n.length && this.eventDispatcher.groupOpened(n), this.columnAnimationService.finish();
  }
}, kZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnViewportService", this.colsWithinViewport = [], this.headerColsWithinViewport = [], this.colsWithinViewportHash = "", this.rowsOfHeadersToRenderLeft = {}, this.rowsOfHeadersToRenderRight = {}, this.rowsOfHeadersToRenderCenter = {};
  }
  wireBeans(e) {
    this.visibleColsService = e.visibleColsService, this.columnModel = e.columnModel, this.eventDispatcher = e.columnEventDispatcher;
  }
  postConstruct() {
    this.suppressColumnVirtualisation = this.gos.get("suppressColumnVirtualisation");
  }
  setScrollPosition(e, t, r = !1) {
    const n = this.visibleColsService.isBodyWidthDirty();
    if (!(e === this.scrollWidth && t === this.scrollPosition && !n)) {
      if (this.scrollWidth = e, this.scrollPosition = t, this.visibleColsService.setBodyWidthDirty(), this.gos.get("enableRtl")) {
        const u = this.visibleColsService.getBodyContainerWidth();
        this.viewportLeft = u - this.scrollPosition - this.scrollWidth, this.viewportRight = u - this.scrollPosition;
      } else
        this.viewportLeft = this.scrollPosition, this.viewportRight = this.scrollWidth + this.scrollPosition;
      this.columnModel.isReady() && this.checkViewportColumns(r);
    }
  }
  getHeadersToRender(e, t) {
    let r;
    switch (e) {
      case "left":
        r = this.rowsOfHeadersToRenderLeft[t];
        break;
      case "right":
        r = this.rowsOfHeadersToRenderRight[t];
        break;
      default:
        r = this.rowsOfHeadersToRenderCenter[t];
        break;
    }
    return r || [];
  }
  extractViewportColumns() {
    const e = this.visibleColsService.getCenterCols();
    this.isColumnVirtualisationSuppressed() ? (this.colsWithinViewport = e, this.headerColsWithinViewport = e) : (this.colsWithinViewport = e.filter(this.isColumnInRowViewport.bind(this)), this.headerColsWithinViewport = e.filter(this.isColumnInHeaderViewport.bind(this)));
  }
  isColumnVirtualisationSuppressed() {
    return this.suppressColumnVirtualisation || this.viewportRight === 0;
  }
  clear() {
    this.rowsOfHeadersToRenderLeft = {}, this.rowsOfHeadersToRenderRight = {}, this.rowsOfHeadersToRenderCenter = {}, this.colsWithinViewportHash = "";
  }
  isColumnInHeaderViewport(e) {
    return e.isAutoHeaderHeight() || this.isAnyParentAutoHeaderHeight(e) ? !0 : this.isColumnInRowViewport(e);
  }
  isAnyParentAutoHeaderHeight(e) {
    for (; e; ) {
      if (e.isAutoHeaderHeight())
        return !0;
      e = e.getParent();
    }
    return !1;
  }
  isColumnInRowViewport(e) {
    if (e.isAutoHeight())
      return !0;
    const t = e.getLeft() || 0, r = t + e.getActualWidth(), n = this.viewportLeft - 200, a = this.viewportRight + 200, u = t < n && r < n, s = t > a && r > a;
    return !u && !s;
  }
  // used by Grid API only
  getViewportColumns() {
    const e = this.visibleColsService.getLeftCols(), t = this.visibleColsService.getRightCols();
    return this.colsWithinViewport.concat(e).concat(t);
  }
  // + rowRenderer
  // if we are not column spanning, this just returns back the virtual centre columns,
  // however if we are column spanning, then different rows can have different virtual
  // columns, so we have to work out the list for each individual row.
  getColsWithinViewport(e) {
    if (!this.columnModel.isColSpanActive())
      return this.colsWithinViewport;
    const t = (a) => {
      const u = a.getLeft();
      return $r(u) && u > this.viewportLeft;
    }, r = this.isColumnVirtualisationSuppressed() ? void 0 : this.isColumnInRowViewport.bind(this), n = this.visibleColsService.getColsCenter();
    return this.visibleColsService.getColsForRow(
      e,
      n,
      r,
      t
    );
  }
  // checks what columns are currently displayed due to column virtualisation. dispatches an event
  // if the list of columns has changed.
  // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit()
  checkViewportColumns(e = !1) {
    this.extractViewport() && this.eventDispatcher.virtualColumnsChanged(e);
  }
  calculateHeaderRows() {
    this.rowsOfHeadersToRenderLeft = {}, this.rowsOfHeadersToRenderRight = {}, this.rowsOfHeadersToRenderCenter = {};
    const e = {}, t = this.visibleColsService.getLeftCols(), r = this.visibleColsService.getRightCols();
    this.headerColsWithinViewport.concat(t).concat(r).forEach((u) => e[u.getId()] = !0);
    const a = (u, s, c) => {
      let i = !1;
      for (let l = 0; l < u.length; l++) {
        const v = u[l];
        let f = !1;
        if (of(v))
          f = e[v.getId()] === !0;
        else {
          const g = v.getDisplayedChildren();
          g && (f = a(g, s, c + 1));
        }
        f && (i = !0, s[c] || (s[c] = []), s[c].push(v));
      }
      return i;
    };
    a(this.visibleColsService.getTreeLeft(), this.rowsOfHeadersToRenderLeft, 0), a(this.visibleColsService.getTreeRight(), this.rowsOfHeadersToRenderRight, 0), a(this.visibleColsService.getTreeCenter(), this.rowsOfHeadersToRenderCenter, 0);
  }
  extractViewport() {
    const e = (n) => `${n.getId()}-${n.getPinned() || "normal"}`;
    this.extractViewportColumns();
    const t = this.getViewportColumns().map(e).join("#"), r = this.colsWithinViewportHash !== t;
    return r && (this.colsWithinViewportHash = t, this.calculateHeaderRows()), r;
  }
}, OZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "agComponentUtils";
  }
  wireBeans(e) {
    this.componentMetadataProvider = e.componentMetadataProvider;
  }
  adaptFunction(e, t) {
    const r = this.componentMetadataProvider.retrieve(e);
    return r && r.functionAdapter ? r.functionAdapter(t) : null;
  }
  adaptCellRendererFunction(e) {
    class t {
      refresh() {
        return !1;
      }
      getGui() {
        return this.eGui;
      }
      init(n) {
        const a = e(n), u = typeof a;
        if (u === "string" || u === "number" || u === "boolean") {
          this.eGui = jm("<span>" + a + "</span>");
          return;
        }
        if (a == null) {
          this.eGui = jm("<span></span>");
          return;
        }
        this.eGui = a;
      }
    }
    return t;
  }
  doesImplementIComponent(e) {
    return e ? e.prototype && "getGui" in e.prototype : !1;
  }
}, NZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "componentMetadataProvider";
  }
  wireBeans(e) {
    this.agComponentUtils = e.agComponentUtils;
  }
  postConstruct() {
    this.componentMetaData = {
      dateComponent: {
        mandatoryMethodList: ["getDate", "setDate"],
        optionalMethodList: [
          "afterGuiAttached",
          "setInputPlaceholder",
          "setInputAriaLabel",
          "setDisabled",
          "onParamsUpdated",
          "refresh"
        ]
      },
      detailCellRenderer: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh"],
        functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
      },
      dragAndDropImageComponent: {
        mandatoryMethodList: ["setIcon", "setLabel"],
        optionalMethodList: []
      },
      headerComponent: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh"]
      },
      headerGroupComponent: {
        mandatoryMethodList: [],
        optionalMethodList: []
      },
      loadingCellRenderer: {
        mandatoryMethodList: [],
        optionalMethodList: [],
        functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
      },
      loadingOverlayComponent: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh"]
      },
      noRowsOverlayComponent: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh"]
      },
      floatingFilterComponent: {
        mandatoryMethodList: ["onParentModelChanged"],
        optionalMethodList: ["afterGuiAttached", "onParamsUpdated", "refresh"]
      },
      cellRenderer: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh", "afterGuiAttached"],
        functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
      },
      cellEditor: {
        mandatoryMethodList: ["getValue"],
        optionalMethodList: [
          "isPopup",
          "isCancelBeforeStart",
          "isCancelAfterEnd",
          "getPopupPosition",
          "focusIn",
          "focusOut",
          "afterGuiAttached",
          "refresh"
        ]
      },
      innerRenderer: {
        mandatoryMethodList: [],
        optionalMethodList: ["afterGuiAttached"],
        functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
      },
      fullWidthCellRenderer: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh", "afterGuiAttached"],
        functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
      },
      groupRowRenderer: {
        mandatoryMethodList: [],
        optionalMethodList: ["afterGuiAttached"],
        functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
      },
      filter: {
        mandatoryMethodList: ["isFilterActive", "doesFilterPass", "getModel", "setModel"],
        optionalMethodList: [
          "afterGuiAttached",
          "afterGuiDetached",
          "onNewRowsLoaded",
          "getModelAsString",
          "onFloatingFilterChanged",
          "onAnyFilterChanged",
          "refresh"
        ]
      },
      statusPanel: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh"]
      },
      toolPanel: {
        mandatoryMethodList: [],
        optionalMethodList: ["refresh", "getState"]
      },
      tooltipComponent: {
        mandatoryMethodList: [],
        optionalMethodList: []
      },
      menuItem: {
        mandatoryMethodList: [],
        optionalMethodList: ["setActive", "select", "setExpanded", "configureDefaults"]
      }
    };
  }
  retrieve(e) {
    return this.componentMetaData[e];
  }
}, GZ = [
  // core beans only
  "rowPositionUtils",
  "cellPositionUtils",
  "headerPositionUtils",
  "paginationAutoPageSizeService",
  "apiFunctionService",
  "gridApi",
  "userComponentRegistry",
  "agComponentUtils",
  "componentMetadataProvider",
  "resizeObserverService",
  "userComponentFactory",
  "rowContainerHeightService",
  "horizontalResizeService",
  "localeService",
  "validationService",
  "pinnedRowModel",
  "dragService",
  "visibleColsService",
  "eventService",
  "gos",
  "popupService",
  "selectionService",
  "columnFilterService",
  "quickFilterService",
  "filterManager",
  "columnModel",
  "headerNavigationService",
  "pageBoundsService",
  "paginationService",
  "pageBoundsListener",
  "rowRenderer",
  "expressionService",
  "columnFactory",
  "alignedGridsService",
  "navigationService",
  "valueCache",
  "valueService",
  "loggerFactory",
  "autoWidthCalculator",
  "filterMenuFactory",
  "dragAndDropService",
  "focusService",
  "mouseEventService",
  "environment",
  "cellNavigationService",
  "stylingService",
  "scrollVisibleService",
  "sortController",
  "columnHoverService",
  "columnAnimationService",
  "selectableService",
  "autoColService",
  "controlsColService",
  "changeDetectionService",
  "animationFrameService",
  "undoRedoService",
  "columnDefFactory",
  "rowCssClassCalculator",
  "rowNodeBlockLoader",
  "rowNodeSorter",
  "ctrlsService",
  "pinnedWidthService",
  "rowNodeEventThrottle",
  "ctrlsFactory",
  "dataTypeService",
  "syncService",
  "overlayService",
  "stateService",
  "expansionService",
  "apiEventService",
  "ariaAnnouncementService",
  "menuService",
  "columnApplyStateService",
  "columnEventDispatcher",
  "columnMoveService",
  "columnAutosizeService",
  "columnGetStateService",
  "columnGroupStateService",
  "columnSizeService",
  "funcColsService",
  "columnNameService",
  "columnViewportService",
  "pivotResultColsService",
  "showRowGroupColsService"
], vF = Object.fromEntries(
  GZ.map((e, t) => [e, t])
);
function HZ(e, t) {
  const r = (e.beanName ? vF[e.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER, n = (t.beanName ? vF[t.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER;
  return r - n;
}
function BZ(e, t) {
  return (e == null ? void 0 : e.beanName) === "gridDestroyService" ? -1 : 0;
}
var VZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "ctrlsFactory", this.registry = {};
  }
  register(e) {
    this.registry[e.name] = e.classImp;
  }
  getInstance(e, ...t) {
    const r = this.registry[e];
    if (r != null)
      return new r(...t);
  }
}, zZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "ctrlsService", this.params = {
      gridCtrl: void 0,
      gridBodyCtrl: void 0,
      center: void 0,
      left: void 0,
      right: void 0,
      bottomCenter: void 0,
      bottomLeft: void 0,
      bottomRight: void 0,
      topCenter: void 0,
      topLeft: void 0,
      topRight: void 0,
      stickyTopCenter: void 0,
      stickyTopLeft: void 0,
      stickyTopRight: void 0,
      stickyBottomCenter: void 0,
      stickyBottomLeft: void 0,
      stickyBottomRight: void 0,
      fakeHScrollComp: void 0,
      fakeVScrollComp: void 0,
      gridHeaderCtrl: void 0,
      centerHeader: void 0,
      leftHeader: void 0,
      rightHeader: void 0
    }, this.ready = !1, this.readyCallbacks = [], this.runReadyCallbacksAsync = !1;
  }
  wireBeans(e) {
    var t, r;
    this.runReadyCallbacksAsync = ((r = (t = e.frameworkOverrides).runWhenReadyAsync) == null ? void 0 : r.call(t)) ?? !1;
  }
  postConstruct() {
    this.addEventListener(
      "ready",
      () => {
        this.updateReady(), this.ready && (this.readyCallbacks.forEach((e) => e(this.params)), this.readyCallbacks.length = 0);
      },
      this.runReadyCallbacksAsync
    );
  }
  updateReady() {
    this.ready = Object.values(this.params).every((e) => (e == null ? void 0 : e.isAlive()) ?? !1);
  }
  whenReady(e, t) {
    this.ready ? t(this.params) : this.readyCallbacks.push(t), e.addDestroyFunc(() => {
      const r = this.readyCallbacks.indexOf(t);
      r >= 0 && this.readyCallbacks.splice(r, 1);
    });
  }
  register(e, t) {
    this.params[e] = t, this.updateReady(), this.ready && this.dispatchLocalEvent({ type: "ready" }), t.addDestroyFunc(() => {
      this.updateReady();
    });
  }
  get(e) {
    return this.params[e];
  }
  getGridBodyCtrl() {
    return this.params.gridBodyCtrl;
  }
  getHeaderRowContainerCtrls() {
    const { leftHeader: e, centerHeader: t, rightHeader: r } = this.params;
    return [e, r, t];
  }
  getHeaderRowContainerCtrl(e) {
    const t = this.params;
    switch (e) {
      case "left":
        return t.leftHeader;
      case "right":
        return t.rightHeader;
      default:
        return t.centerHeader;
    }
  }
}, WZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "cellPositionUtils";
  }
  createId(e) {
    const { rowIndex: t, rowPinned: r, column: n } = e;
    return this.createIdFromValues({ rowIndex: t, column: n, rowPinned: r });
  }
  createIdFromValues(e) {
    const { rowIndex: t, rowPinned: r, column: n } = e;
    return `${t}.${r ?? "null"}.${n.getId()}`;
  }
  equals(e, t) {
    const r = e.column === t.column, n = e.rowPinned === t.rowPinned, a = e.rowIndex === t.rowIndex;
    return r && n && a;
  }
}, _Z = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowNodeEventThrottle", this.events = [];
  }
  wireBeans(e) {
    this.animationFrameService = e.animationFrameService, this.rowModel = e.rowModel;
  }
  postConstruct() {
    da(this.gos) && (this.clientSideRowModel = this.rowModel);
  }
  // because the user can call rowNode.setExpanded() many times in one VM turn,
  // we throttle the calls to ClientSideRowModel using animationFrameService. this means for 100
  // row nodes getting expanded, we only update the CSRM once, and then we fire all events after
  // CSRM has updated.
  //
  // if we did not do this, then the user could call setExpanded on 100+ rows, causing the grid
  // to re-render 100+ times, which would be a performance lag.
  //
  // we use animationFrameService
  // rather than debounce() so this will get done if anyone flushes the animationFrameService
  // (eg user calls api.ensureRowVisible(), which in turn flushes ).
  dispatchExpanded(e, t) {
    if (this.clientSideRowModel == null) {
      this.eventService.dispatchEvent(e);
      return;
    }
    this.events.push(e);
    const r = () => {
      this.clientSideRowModel && this.clientSideRowModel.onRowGroupOpened(), this.events.forEach((n) => this.eventService.dispatchEvent(n)), this.events = [];
    };
    t ? r() : (this.dispatchExpandedDebounced == null && (this.dispatchExpandedDebounced = this.animationFrameService.debounce(r)), this.dispatchExpandedDebounced());
  }
}, UZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowPositionUtils";
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.pinnedRowModel = e.pinnedRowModel, this.pageBoundsService = e.pageBoundsService;
  }
  getFirstRow() {
    let e = 0, t;
    return this.pinnedRowModel.getPinnedTopRowCount() ? t = "top" : this.rowModel.getRowCount() ? (t = null, e = this.pageBoundsService.getFirstRow()) : this.pinnedRowModel.getPinnedBottomRowCount() && (t = "bottom"), t === void 0 ? null : { rowIndex: e, rowPinned: t };
  }
  getLastRow() {
    let e, t = null;
    const r = this.pinnedRowModel.getPinnedBottomRowCount(), n = this.pinnedRowModel.getPinnedTopRowCount();
    return r ? (t = "bottom", e = r - 1) : this.rowModel.getRowCount() ? (t = null, e = this.pageBoundsService.getLastRow()) : n && (t = "top", e = n - 1), e === void 0 ? null : { rowIndex: e, rowPinned: t };
  }
  getRowNode(e) {
    switch (e.rowPinned) {
      case "top":
        return this.pinnedRowModel.getPinnedTopRow(e.rowIndex);
      case "bottom":
        return this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);
      default:
        return this.rowModel.getRow(e.rowIndex);
    }
  }
  sameRow(e, t) {
    return !e && !t ? !0 : e && !t || !e && t ? !1 : e.rowIndex === t.rowIndex && e.rowPinned == t.rowPinned;
  }
  // tests if this row selection is before the other row selection
  before(e, t) {
    switch (e.rowPinned) {
      case "top":
        if (t.rowPinned !== "top")
          return !0;
        break;
      case "bottom":
        if (t.rowPinned !== "bottom")
          return !1;
        break;
      default:
        if ($r(t.rowPinned))
          return t.rowPinned !== "top";
        break;
    }
    return e.rowIndex < t.rowIndex;
  }
}, gF = {
  cssName: "--ag-row-height",
  changeKey: "rowHeightChanged",
  defaultValue: 42
}, mF = {
  cssName: "--ag-header-height",
  changeKey: "headerHeightChanged",
  defaultValue: 48
}, yF = {
  cssName: "--ag-list-item-height",
  changeKey: "listItemHeightChanged",
  defaultValue: 24
}, jZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "environment", this.sizeEls = /* @__PURE__ */ new Map(), this.lastKnownValues = /* @__PURE__ */ new Map(), this.ancestorThemeClasses = [], this.sizesMeasured = !1, this.gridTheme = null;
  }
  wireBeans(e) {
    this.resizeObserverService = e.resizeObserverService, this.eGridDiv = e.eGridDiv;
  }
  postConstruct() {
    this.addManagedPropertyListener("theme", () => this.handleThemeGridOptionChange()), this.handleThemeGridOptionChange(), this.addDestroyFunc(() => this.stopUsingTheme()), this.addManagedPropertyListener("rowHeight", () => this.refreshRowHeightVariable()), this.ancestorThemeClasses = this.readAncestorThemeClasses(), this.setUpThemeClassObservers(), this.getSizeEl(gF), this.getSizeEl(mF), this.getSizeEl(yF);
  }
  getDefaultRowHeight() {
    return this.getCSSVariablePixelValue(gF);
  }
  getDefaultHeaderHeight() {
    return this.getCSSVariablePixelValue(mF);
  }
  getDefaultColumnMinWidth() {
    return Math.min(36, this.getDefaultRowHeight());
  }
  getDefaultListItemHeight() {
    return this.getCSSVariablePixelValue(yF);
  }
  hasMeasuredSizes() {
    return this.sizesMeasured;
  }
  getGridThemeClass() {
    var e;
    return ((e = this.gridTheme) == null ? void 0 : e.getCssClass()) || null;
  }
  getThemeClasses() {
    return this.gridTheme ? [this.gridTheme.getCssClass()] : this.ancestorThemeClasses;
  }
  applyThemeClasses(e) {
    const t = this.getThemeClasses();
    for (const r of Array.from(e.classList))
      r.startsWith("ag-theme-") && !t.includes(r) && e.classList.remove(r);
    e.classList.add(...t);
  }
  refreshRowHeightVariable() {
    const e = this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(), t = this.gos.get("rowHeight");
    if (t == null || isNaN(t) || !isFinite(t))
      return e !== null && this.eGridDiv.style.setProperty("--ag-line-height", null), -1;
    const r = `${t}px`;
    return e != r ? (this.eGridDiv.style.setProperty("--ag-line-height", r), t) : e != "" ? parseFloat(e) : -1;
  }
  getCSSVariablePixelValue(e) {
    const t = this.lastKnownValues.get(e);
    if (t != null)
      return t;
    const r = this.measureSizeEl(e);
    return r === "detached" || r === "no-styles" ? e.defaultValue : (this.lastKnownValues.set(e, r), r);
  }
  measureSizeEl(e) {
    const t = this.getSizeEl(e);
    if (t.offsetParent == null)
      return "detached";
    const r = t.offsetWidth;
    return r === CF ? "no-styles" : (this.sizesMeasured = !0, r);
  }
  getSizeEl(e) {
    let t = this.sizeEls.get(e);
    if (t)
      return t;
    let r = this.eMeasurementContainer;
    r || (r = this.eMeasurementContainer = document.createElement("div"), r.className = "ag-measurement-container", this.gos.get("theme") && this.applyThemeClasses(r), this.eGridDiv.appendChild(r)), t = document.createElement("div"), t.style.width = `var(${e.cssName}, ${CF}px)`, r.appendChild(t), this.sizeEls.set(e, t);
    let n = this.measureSizeEl(e);
    n === "no-styles" && Fr(
      `no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`
    );
    const a = this.resizeObserverService.observeResize(t, () => {
      const u = this.measureSizeEl(e);
      u === "detached" || u === "no-styles" || (this.lastKnownValues.set(e, u), u !== n && (n = u, this.fireGridStylesChangedEvent(e.changeKey)));
    });
    return this.addDestroyFunc(() => a()), t;
  }
  fireGridStylesChangedEvent(e) {
    this.eventService.dispatchEvent({
      type: "gridStylesChanged",
      [e]: !0
    });
  }
  setUpThemeClassObservers() {
    const e = new MutationObserver(() => {
      const r = this.readAncestorThemeClasses();
      YZ(r, this.ancestorThemeClasses) || (this.ancestorThemeClasses = r, this.fireGridStylesChangedEvent("themeChanged"));
    });
    let t = this.eGridDiv;
    for (; t; )
      e.observe(t || this.eGridDiv, {
        attributes: !0,
        attributeFilter: ["class"]
      }), t = t.parentElement;
    this.addDestroyFunc(() => e.disconnect());
  }
  readAncestorThemeClasses() {
    let e = this.eGridDiv;
    const t = [];
    for (; e; ) {
      const r = Array.from(e.classList).filter((n) => n.startsWith("ag-theme-"));
      for (const n of r)
        t.includes(n) || t.unshift(n);
      e = e.parentElement;
    }
    return Object.freeze(t);
  }
  handleThemeGridOptionChange() {
    const { gos: e, eMeasurementContainer: t, gridTheme: r } = this, n = e.get("theme") || null;
    n !== r && (r == null || r.stopUse(), this.gridTheme = n, n == null || n.startUse({
      loadThemeGoogleFonts: e.get("loadThemeGoogleFonts"),
      container: this.eGridDiv
    }), t && this.applyThemeClasses(t), this.fireGridStylesChangedEvent("themeChanged"));
  }
  stopUsingTheme() {
    var e;
    (e = this.gridTheme) == null || e.stopUse(), this.gridTheme = null;
  }
}, YZ = (e, t) => e.length === t.length && e.findIndex((r, n) => e[n] !== t[n]) === -1, CF = 15538, XZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "eventService", this.globalEventService = new Gv();
  }
  wireBeans(e) {
    this.globalEventListener = e.globalEventListener, this.globalSyncEventListener = e.globalSyncEventListener;
  }
  postConstruct() {
    if (this.globalEventListener) {
      const e = c1(this.gos);
      this.addGlobalListener(this.globalEventListener, e);
    }
    this.globalSyncEventListener && this.addGlobalListener(this.globalSyncEventListener, !1);
  }
  addEventListener(e, t, r) {
    this.globalEventService.addEventListener(e, t, r);
  }
  removeEventListener(e, t, r) {
    this.globalEventService.removeEventListener(e, t, r);
  }
  addGlobalListener(e, t = !1) {
    this.globalEventService.addGlobalListener(e, t);
  }
  removeGlobalListener(e, t = !1) {
    this.globalEventService.removeGlobalListener(e, t);
  }
  /** @deprecated DO NOT FIRE LOCAL EVENTS OFF THE EVENT SERVICE */
  dispatchLocalEvent() {
  }
  dispatchEvent(e) {
    this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e));
  }
  dispatchEventOnce(e) {
    this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e));
  }
}, cR = class kl extends mr {
  constructor() {
    super(...arguments), this.beanName = "focusService";
  }
  wireBeans(t) {
    this.eGridDiv = t.eGridDiv, this.columnModel = t.columnModel, this.visibleColsService = t.visibleColsService, this.headerNavigationService = t.headerNavigationService, this.headerPositionUtils = t.headerPositionUtils, this.rowRenderer = t.rowRenderer, this.rowPositionUtils = t.rowPositionUtils, this.cellPositionUtils = t.cellPositionUtils, this.navigationService = t.navigationService, this.ctrlsService = t.ctrlsService, this.filterManager = t.filterManager, this.rangeService = t.rangeService, this.advancedFilterService = t.advancedFilterService, this.overlayService = t.overlayService;
  }
  static addKeyboardModeEvents(t) {
    this.instanceCount > 0 || (t.addEventListener("keydown", kl.toggleKeyboardMode), t.addEventListener("mousedown", kl.toggleKeyboardMode));
  }
  static removeKeyboardModeEvents(t) {
    this.instanceCount > 0 || (t.removeEventListener("keydown", kl.toggleKeyboardMode), t.removeEventListener("mousedown", kl.toggleKeyboardMode));
  }
  static toggleKeyboardMode(t) {
    const r = kl.keyboardModeActive, n = t.type === "keydown";
    n && (t.ctrlKey || t.metaKey || t.altKey) || r !== n && (kl.keyboardModeActive = n);
  }
  postConstruct() {
    const t = this.clearFocusedCell.bind(this);
    this.addManagedEventListeners({
      columnPivotModeChanged: t,
      newColumnsLoaded: this.onColumnEverythingChanged.bind(this),
      columnGroupOpened: t,
      columnRowGroupChanged: t
    }), this.registerKeyboardFocusEvents(), this.ctrlsService.whenReady(this, (r) => {
      this.gridCtrl = r.gridCtrl;
    });
  }
  registerKeyboardFocusEvents() {
    const t = Va(this.gos);
    kl.addKeyboardModeEvents(t), kl.instanceCount++, this.addDestroyFunc(() => {
      kl.instanceCount--, kl.removeKeyboardModeEvents(t);
    });
  }
  onColumnEverythingChanged() {
    if (!this.focusedCellPosition)
      return;
    const t = this.focusedCellPosition.column, r = this.columnModel.getCol(t.getId());
    t !== r && this.clearFocusedCell();
  }
  isKeyboardMode() {
    return kl.keyboardModeActive;
  }
  // we check if the browser is focusing something, and if it is, and
  // it's the cell we think is focused, then return the cell. so this
  // methods returns the cell if a) we think it has focus and b) the
  // browser thinks it has focus. this then returns nothing if we
  // first focus a cell, then second click outside the grid, as then the
  // grid cell will still be focused as far as the grid is concerned,
  // however the browser focus will have moved somewhere else.
  getFocusCellToUseAfterRefresh() {
    return this.gos.get("suppressFocusAfterRefresh") || !this.focusedCellPosition || this.isDomDataMissingInHierarchy(Sa(this.gos), Gh.DOM_DATA_KEY_ROW_CTRL) ? null : this.focusedCellPosition;
  }
  getFocusHeaderToUseAfterRefresh() {
    return this.gos.get("suppressFocusAfterRefresh") || !this.focusedHeaderPosition || this.isDomDataMissingInHierarchy(
      Sa(this.gos),
      Z1.DOM_DATA_KEY_HEADER_CTRL
    ) ? null : this.focusedHeaderPosition;
  }
  isDomDataMissingInHierarchy(t, r) {
    let n = t;
    for (; n; ) {
      if (Bm(this.gos, n, r))
        return !1;
      n = n.parentNode;
    }
    return !0;
  }
  getFocusedCell() {
    return this.focusedCellPosition;
  }
  shouldRestoreFocus(t) {
    return this.isCellRestoreFocused(t) ? (setTimeout(() => {
      this.restoredFocusedCellPosition = null;
    }, 0), !0) : !1;
  }
  clearRestoreFocus() {
    this.restoredFocusedCellPosition = null, this.awaitRestoreFocusedCell = !1;
  }
  restoreFocusedCell(t, r) {
    this.awaitRestoreFocusedCell = !0, setTimeout(() => {
      this.awaitRestoreFocusedCell && (this.setRestoreFocusedCell(t), r());
    });
  }
  isCellRestoreFocused(t) {
    return this.restoredFocusedCellPosition == null ? !1 : this.cellPositionUtils.equals(t, this.restoredFocusedCellPosition);
  }
  setRestoreFocusedCell(t) {
    this.getFrameworkOverrides().renderingEngine === "react" && (this.restoredFocusedCellPosition = t);
  }
  getFocusEventParams(t) {
    const { rowIndex: r, rowPinned: n, column: a } = t, u = {
      rowIndex: r,
      rowPinned: n,
      column: a,
      isFullWidthCell: !1
    }, s = this.rowRenderer.getRowByPosition({ rowIndex: r, rowPinned: n });
    return s && (u.isFullWidthCell = s.isFullWidth()), u;
  }
  clearFocusedCell() {
    if (this.restoredFocusedCellPosition = null, this.focusedCellPosition == null)
      return;
    const t = this.getFocusEventParams(this.focusedCellPosition);
    this.focusedCellPosition = null, this.eventService.dispatchEvent({
      type: "cellFocusCleared",
      ...t
    });
  }
  setFocusedCell(t) {
    const { column: r, rowIndex: n, rowPinned: a, forceBrowserFocus: u = !1, preventScrollOnBrowserFocus: s = !1 } = t, c = this.columnModel.getCol(r);
    if (!c) {
      this.focusedCellPosition = null;
      return;
    }
    this.focusedCellPosition = {
      rowIndex: n,
      rowPinned: Jc(a),
      column: c
    }, this.eventService.dispatchEvent({
      type: "cellFocused",
      ...this.getFocusEventParams(this.focusedCellPosition),
      forceBrowserFocus: u,
      preventScrollOnBrowserFocus: s
    });
  }
  isCellFocused(t) {
    return this.focusedCellPosition == null ? !1 : this.cellPositionUtils.equals(t, this.focusedCellPosition);
  }
  isRowNodeFocused(t) {
    return this.isRowFocused(t.rowIndex, t.rowPinned);
  }
  isHeaderWrapperFocused(t) {
    if (this.focusedHeaderPosition == null)
      return !1;
    const r = t.getColumnGroupChild(), n = t.getRowIndex(), a = t.getPinned(), { column: u, headerRowIndex: s } = this.focusedHeaderPosition;
    return r === u && n === s && a == u.getPinned();
  }
  clearFocusedHeader() {
    this.focusedHeaderPosition = null;
  }
  getFocusedHeader() {
    return this.focusedHeaderPosition;
  }
  setFocusedHeader(t, r) {
    this.focusedHeaderPosition = { headerRowIndex: t, column: r };
  }
  isHeaderFocusSuppressed() {
    return this.gos.get("suppressHeaderFocus") || this.overlayService.isExclusive();
  }
  isCellFocusSuppressed() {
    return this.gos.get("suppressCellFocus") || this.overlayService.isExclusive();
  }
  focusHeaderPosition(t) {
    var l;
    if (this.isHeaderFocusSuppressed())
      return !1;
    const { direction: r, fromTab: n, allowUserOverride: a, event: u, fromCell: s, rowWithoutSpanValue: c } = t;
    let { headerPosition: i } = t;
    if (s && ((l = this.filterManager) != null && l.isAdvancedFilterHeaderActive()))
      return this.focusAdvancedFilter(i);
    if (a) {
      const v = this.getFocusedHeader(), f = this.headerNavigationService.getHeaderRowCount();
      if (n) {
        const p = this.gos.getCallback("tabToNextHeader");
        p && (i = this.getHeaderPositionFromUserFunc({
          userFunc: p,
          direction: r,
          currentPosition: v,
          headerPosition: i,
          headerRowCount: f
        }));
      } else {
        const p = this.gos.getCallback("navigateToNextHeader");
        if (p && u) {
          const g = {
            key: u.key,
            previousHeaderPosition: v,
            nextHeaderPosition: i,
            headerRowCount: f,
            event: u
          };
          i = p(g);
        }
      }
    }
    return i ? this.focusProvidedHeaderPosition({
      headerPosition: i,
      direction: r,
      event: u,
      fromCell: s,
      rowWithoutSpanValue: c
    }) : !1;
  }
  focusHeaderPositionFromUserFunc(t) {
    if (this.isHeaderFocusSuppressed())
      return !1;
    const { userFunc: r, headerPosition: n, direction: a, event: u } = t, s = this.getFocusedHeader(), c = this.headerNavigationService.getHeaderRowCount(), i = this.getHeaderPositionFromUserFunc({
      userFunc: r,
      direction: a,
      currentPosition: s,
      headerPosition: n,
      headerRowCount: c
    });
    return !!i && this.focusProvidedHeaderPosition({
      headerPosition: i,
      direction: a,
      event: u
    });
  }
  getHeaderPositionFromUserFunc(t) {
    const { userFunc: r, direction: n, currentPosition: a, headerPosition: u, headerRowCount: s } = t, i = r({
      backwards: n === "Before",
      previousHeaderPosition: a,
      nextHeaderPosition: u,
      headerRowCount: s
    });
    return i === !0 || i === null ? (i === null && Fr(
      "Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."
    ), a) : i === !1 ? null : i;
  }
  focusProvidedHeaderPosition(t) {
    var f;
    const { headerPosition: r, direction: n, fromCell: a, rowWithoutSpanValue: u, event: s } = t, { column: c, headerRowIndex: i } = r;
    if (i === -1)
      return (f = this.filterManager) != null && f.isAdvancedFilterHeaderActive() ? this.focusAdvancedFilter(r) : this.focusGridView(c);
    this.headerNavigationService.scrollToColumn(c, n);
    const l = this.ctrlsService.getHeaderRowContainerCtrl(c.getPinned()), v = (l == null ? void 0 : l.focusHeader(r.headerRowIndex, c, s)) || !1;
    return v && (u != null || a) && this.headerNavigationService.setCurrentHeaderRowWithoutSpan(u ?? -1), v;
  }
  focusFirstHeader() {
    if (this.overlayService.isExclusive() && this.focusOverlay())
      return !0;
    let t = this.visibleColsService.getAllCols()[0];
    if (!t)
      return !1;
    t.getParent() && (t = this.visibleColsService.getColGroupAtLevel(t, 0));
    const r = this.headerPositionUtils.getHeaderIndexToFocus(t, 0);
    return this.focusHeaderPosition({
      headerPosition: r,
      rowWithoutSpanValue: 0
    });
  }
  focusLastHeader(t) {
    if (this.overlayService.isExclusive() && this.focusOverlay(!0))
      return !0;
    const r = this.headerNavigationService.getHeaderRowCount() - 1, n = di(this.visibleColsService.getAllCols());
    return this.focusHeaderPosition({
      headerPosition: { headerRowIndex: r, column: n },
      rowWithoutSpanValue: -1,
      event: t
    });
  }
  focusPreviousFromFirstCell(t) {
    var r;
    return (r = this.filterManager) != null && r.isAdvancedFilterHeaderActive() ? this.focusAdvancedFilter(null) : this.focusLastHeader(t);
  }
  isAnyCellFocused() {
    return !!this.focusedCellPosition;
  }
  isRowFocused(t, r) {
    return this.focusedCellPosition == null ? !1 : this.focusedCellPosition.rowIndex === t && this.focusedCellPosition.rowPinned === Jc(r);
  }
  findFocusableElements(t, r, n = !1) {
    const a = ZU;
    let u = ek;
    r && (u += ", " + r), n && (u += ', [tabindex="-1"]');
    const s = Array.prototype.slice.apply(t.querySelectorAll(a)).filter((l) => lc(l)), c = Array.prototype.slice.apply(t.querySelectorAll(u));
    return c.length ? ((l, v) => l.filter((f) => v.indexOf(f) === -1))(s, c) : s;
  }
  focusInto(t, r = !1, n = !1) {
    const a = this.findFocusableElements(t, null, n), u = r ? di(a) : a[0];
    return u ? (u.focus({ preventScroll: !0 }), !0) : !1;
  }
  findFocusableElementBeforeTabGuard(t, r) {
    if (!r)
      return null;
    const n = this.findFocusableElements(t), a = n.indexOf(r);
    if (a === -1)
      return null;
    let u = -1;
    for (let s = a - 1; s >= 0; s--)
      if (n[s].classList.contains(
        "ag-tab-guard-top"
        /* TAB_GUARD_TOP */
      )) {
        u = s;
        break;
      }
    return u <= 0 ? null : n[u - 1];
  }
  findNextFocusableElement(t = this.eGridDiv, r, n) {
    const a = this.findFocusableElements(t, r ? ':not([tabindex="-1"])' : null), u = Sa(this.gos);
    let s;
    r ? s = a.findIndex((i) => i.contains(u)) : s = a.indexOf(u);
    const c = s + (n ? -1 : 1);
    return c < 0 || c >= a.length ? null : a[c];
  }
  isTargetUnderManagedComponent(t, r) {
    if (!r)
      return !1;
    const n = t.querySelectorAll(`.${$h.FOCUS_MANAGED_CLASS}`);
    if (!n.length)
      return !1;
    for (let a = 0; a < n.length; a++)
      if (n[a].contains(r))
        return !0;
    return !1;
  }
  findTabbableParent(t, r = 5) {
    let n = 0;
    for (; t && vT(t) === null && ++n <= r; )
      t = t.parentElement;
    return vT(t) === null ? null : t;
  }
  focusOverlay(t) {
    var n;
    const r = this.overlayService.isVisible() && ((n = this.overlayService.getOverlayWrapper()) == null ? void 0 : n.getGui());
    return !!r && this.focusInto(r, t);
  }
  focusGridViewFailed(t, r) {
    return r && this.focusOverlay(t) || t && this.focusLastHeader();
  }
  focusGridView(t, r = !1, n = !0) {
    var u, s;
    if (this.overlayService.isExclusive())
      return n && this.focusOverlay(r);
    if (this.isCellFocusSuppressed())
      return r && !this.isHeaderFocusSuppressed() ? this.focusLastHeader() : n && this.focusOverlay(r) ? !0 : this.focusNextGridCoreContainer(!1);
    const a = r ? this.rowPositionUtils.getLastRow() : this.rowPositionUtils.getFirstRow();
    if (a) {
      const { rowIndex: c, rowPinned: i } = a;
      if (t ?? (t = (u = this.getFocusedHeader()) == null ? void 0 : u.column), t && c !== void 0 && c !== null) {
        if (this.navigationService.ensureCellVisible({ rowIndex: c, column: t, rowPinned: i }), r) {
          const l = this.rowRenderer.getRowByPosition(a);
          if (l != null && l.isFullWidth() && this.navigationService.tryToFocusFullWidthRow(a, r))
            return !0;
        }
        return this.setFocusedCell({
          rowIndex: c,
          column: t,
          rowPinned: Jc(i),
          forceBrowserFocus: !0
        }), (s = this.rangeService) == null || s.setRangeToCell({ rowIndex: c, rowPinned: i, column: t }), !0;
      }
    }
    return !!(n && this.focusOverlay(r) || r && this.focusLastHeader());
  }
  /** Returns true if an element inside the grid has focus */
  isGridFocused() {
    const t = Sa(this.gos);
    return !!t && this.eGridDiv.contains(t);
  }
  focusNextGridCoreContainer(t, r = !1) {
    return !r && this.gridCtrl.focusNextInnerContainer(t) ? !0 : ((r || !t && !this.gridCtrl.isDetailGrid()) && this.gridCtrl.forceFocusOutOfContainer(t), !1);
  }
  focusAdvancedFilter(t) {
    var r;
    return this.advancedFilterFocusColumn = t == null ? void 0 : t.column, ((r = this.advancedFilterService) == null ? void 0 : r.getCtrl().focusHeaderComp()) ?? !1;
  }
  focusNextFromAdvancedFilter(t, r) {
    var a;
    const n = (r ? void 0 : this.advancedFilterFocusColumn) ?? ((a = this.visibleColsService.getAllCols()) == null ? void 0 : a[0]);
    return t ? this.focusHeaderPosition({
      headerPosition: {
        column: n,
        headerRowIndex: this.headerNavigationService.getHeaderRowCount() - 1
      }
    }) : this.focusGridView(n);
  }
  clearAdvancedFilterColumn() {
    this.advancedFilterFocusColumn = void 0;
  }
  addFocusableContainer(t) {
    this.gridCtrl.addFocusableContainer(t);
  }
  removeFocusableContainer(t) {
    this.gridCtrl.removeFocusableContainer(t);
  }
  focusGridInnerElement(t) {
    return this.gridCtrl.focusInnerElement(t);
  }
  allowFocusForNextGridCoreContainer(t) {
    this.gridCtrl.allowFocusForNextCoreContainer(t);
  }
};
cR.keyboardModeActive = !1;
cR.instanceCount = 0;
var $Z = cR, ZZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "pinnedWidthService";
  }
  wireBeans(e) {
    this.visibleColsService = e.visibleColsService;
  }
  postConstruct() {
    const e = this.checkContainerWidths.bind(this);
    this.addManagedEventListeners({
      displayedColumnsChanged: e,
      displayedColumnsWidthChanged: e
    }), this.addManagedPropertyListener("domLayout", e);
  }
  checkContainerWidths() {
    const e = Ao(this.gos, "print"), t = e ? 0 : this.visibleColsService.getColsLeftWidth(), r = e ? 0 : this.visibleColsService.getDisplayedColumnsRightWidth();
    t != this.leftWidth && (this.leftWidth = t, this.eventService.dispatchEvent({ type: "leftPinnedWidthChanged" })), r != this.rightWidth && (this.rightWidth = r, this.eventService.dispatchEvent({ type: "rightPinnedWidthChanged" }));
  }
  getPinnedRightWidth() {
    return this.rightWidth;
  }
  getPinnedLeftWidth() {
    return this.leftWidth;
  }
}, KZ = class extends mr {
  constructor() {
    super(...arguments), this.additionalFocusableContainers = /* @__PURE__ */ new Set();
  }
  wireBeans(e) {
    this.beans = e, this.focusService = e.focusService, this.visibleColsService = e.visibleColsService;
  }
  setComp(e, t, r) {
    this.view = e, this.eGridHostDiv = t, this.eGui = r, this.eGui.setAttribute("grid-id", this.beans.context.getGridId());
    const { dragAndDropService: n, mouseEventService: a, ctrlsService: u, resizeObserverService: s } = this.beans, c = {
      getContainer: () => this.eGui,
      isInterestedIn: (l) => l === 1 || l === 0,
      getIconName: () => "notAllowed"
    };
    n.addDropTarget(c), this.addDestroyFunc(() => n.removeDropTarget(c)), a.stampTopLevelGridCompWithGridInstance(t), this.createManagedBean(new uR(this.view)), this.view.setRtlClass(this.gos.get("enableRtl") ? "ag-rtl" : "ag-ltr"), this.updateGridThemeClass(), this.addManagedEventListeners({ gridStylesChanged: this.handleThemeChange.bind(this) });
    const i = s.observeResize(
      this.eGridHostDiv,
      this.onGridSizeChanged.bind(this)
    );
    this.addDestroyFunc(() => i()), u.register("gridCtrl", this);
  }
  isDetailGrid() {
    var t;
    const e = this.focusService.findTabbableParent(this.getGui());
    return ((t = e == null ? void 0 : e.getAttribute("row-id")) == null ? void 0 : t.startsWith("detail")) || !1;
  }
  getOptionalSelectors() {
    var t, r, n, a, u;
    const e = this.beans;
    return {
      paginationSelector: (t = e.paginationService) == null ? void 0 : t.getPaginationSelector(),
      gridHeaderDropZonesSelector: (r = e.columnDropZonesService) == null ? void 0 : r.getDropZoneSelector(),
      sideBarSelector: (n = e.sideBarService) == null ? void 0 : n.getSideBarSelector(),
      statusBarSelector: (a = e.statusBarService) == null ? void 0 : a.getStatusPanelSelector(),
      watermarkSelector: (u = e.licenseManager) == null ? void 0 : u.getWatermarkSelector()
    };
  }
  onGridSizeChanged() {
    this.eventService.dispatchEvent({
      type: "gridSizeChanged",
      clientWidth: this.eGridHostDiv.clientWidth,
      clientHeight: this.eGridHostDiv.clientHeight
    });
  }
  destroyGridUi() {
    this.view.destroyGridUi();
  }
  getGui() {
    return this.eGui;
  }
  setResizeCursor(e) {
    this.view.setCursor(e ? "ew-resize" : null);
  }
  disableUserSelect(e) {
    this.view.setUserSelect(e ? "none" : null);
  }
  focusNextInnerContainer(e) {
    const t = this.getFocusableContainers(), { indexWithFocus: r, nextIndex: n } = this.getNextFocusableIndex(t, e);
    if (n < 0 || n >= t.length)
      return !1;
    if (n === 0) {
      if (r > 0) {
        const a = this.visibleColsService.getAllCols(), u = di(a);
        if (this.focusService.focusGridView(u, !0))
          return !0;
      }
      return !1;
    }
    return this.focusContainer(t[n], e);
  }
  focusInnerElement(e) {
    const t = this.gos.getCallback("focusGridInnerElement");
    if (t && t({ fromBottom: !!e }))
      return !0;
    const r = this.getFocusableContainers(), n = this.visibleColsService.getAllCols();
    if (e) {
      if (r.length > 1)
        return this.focusContainer(di(r), !0);
      const a = di(n);
      if (this.focusService.focusGridView(a, !0))
        return !0;
    }
    if (this.gos.get("headerHeight") === 0 || this.focusService.isHeaderFocusSuppressed()) {
      if (this.focusService.focusGridView(n[0]))
        return !0;
      for (let a = 1; a < r.length; a++)
        if (this.focusService.focusInto(r[a].getGui()))
          return !0;
      return !1;
    }
    return this.focusService.focusFirstHeader();
  }
  forceFocusOutOfContainer(e = !1) {
    this.view.forceFocusOutOfContainer(e);
  }
  addFocusableContainer(e) {
    this.additionalFocusableContainers.add(e);
  }
  removeFocusableContainer(e) {
    this.additionalFocusableContainers.delete(e);
  }
  allowFocusForNextCoreContainer(e) {
    var u;
    const t = this.view.getFocusableContainers(), { nextIndex: r, indexWithFocus: n } = this.getNextFocusableIndex(t, e);
    if (n === -1 || r < 0 || r >= t.length)
      return;
    const a = t[r];
    (u = a.setAllowFocus) == null || u.call(a, !0), setTimeout(() => {
      var s;
      (s = a.setAllowFocus) == null || s.call(a, !1);
    });
  }
  getNextFocusableIndex(e, t) {
    const r = Sa(this.gos), n = e.findIndex((u) => u.getGui().contains(r)), a = n + (t ? -1 : 1);
    return {
      indexWithFocus: n,
      nextIndex: a
    };
  }
  focusContainer(e, t) {
    var n, a;
    (n = e.setAllowFocus) == null || n.call(e, !0);
    const r = this.focusService.focusInto(e.getGui(), t);
    return (a = e.setAllowFocus) == null || a.call(e, !1), r;
  }
  getFocusableContainers() {
    return [...this.view.getFocusableContainers(), ...this.additionalFocusableContainers];
  }
  updateGridThemeClass() {
    const e = this.beans.environment.getGridThemeClass();
    e && this.view.setGridThemeClass(e);
  }
  handleThemeChange(e) {
    e.themeChanged && this.updateGridThemeClass();
  }
  destroy() {
    this.additionalFocusableContainers.clear(), super.destroy();
  }
}, JZ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "alignedGridsService", this.consuming = !1;
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.columnSizeService = e.columnSizeService, this.ctrlsService = e.ctrlsService, this.columnApplyStateService = e.columnApplyStateService;
  }
  getAlignedGridApis() {
    let e = this.gos.get("alignedGrids") ?? [];
    const t = typeof e == "function";
    typeof e == "function" && (e = e());
    const r = () => `See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;
    return e.map((a) => {
      var s;
      if (!a) {
        Ni("alignedGrids contains an undefined option."), t || Ni(`You may want to configure via a callback to avoid setup race conditions:
                     "alignedGrids: () => [linkedGrid]"`), Ni(r());
        return;
      }
      if (this.isGridApi(a))
        return a;
      const u = a;
      return "current" in u ? (s = u.current) == null ? void 0 : s.api : (u.api || Ni(
        `alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${r()}`
      ), u.api);
    }).filter((a) => !!a && !a.isDestroyed());
  }
  isGridApi(e) {
    return !!e && !!e.dispatchEvent;
  }
  postConstruct() {
    const e = this.fireColumnEvent.bind(this);
    this.addManagedEventListeners({
      columnMoved: e,
      columnVisible: e,
      columnPinned: e,
      columnGroupOpened: e,
      columnResized: e,
      bodyScroll: this.fireScrollEvent.bind(this),
      alignedGridColumn: ({ event: t }) => this.onColumnEvent(t),
      alignedGridScroll: ({ event: t }) => this.onScrollEvent(t)
    });
  }
  // common logic across all the fire methods
  fireEvent(e) {
    this.consuming || this.getAlignedGridApis().forEach((t) => {
      t.isDestroyed() || t.dispatchEvent(e);
    });
  }
  // common logic across all consume methods. very little common logic, however extracting
  // guarantees consistency across the methods.
  onEvent(e) {
    this.consuming = !0, e(), this.consuming = !1;
  }
  fireColumnEvent(e) {
    this.fireEvent({
      type: "alignedGridColumn",
      event: e
    });
  }
  fireScrollEvent(e) {
    e.direction === "horizontal" && this.fireEvent({
      type: "alignedGridScroll",
      event: e
    });
  }
  onScrollEvent(e) {
    this.onEvent(() => {
      this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left, !0);
    });
  }
  extractDataFromEvent(e, t) {
    const r = [];
    return e.columns ? e.columns.forEach((n) => {
      r.push(t(n));
    }) : e.column && r.push(t(e.column)), r;
  }
  getMasterColumns(e) {
    return this.extractDataFromEvent(e, (t) => t);
  }
  getColumnIds(e) {
    return this.extractDataFromEvent(e, (t) => t.getColId());
  }
  onColumnEvent(e) {
    this.onEvent(() => {
      switch (e.type) {
        case "columnMoved":
        case "columnVisible":
        case "columnPinned":
        case "columnResized": {
          this.processColumnEvent(e);
          break;
        }
        case "columnGroupOpened": {
          this.processGroupOpenedEvent(e);
          break;
        }
        case "columnPivotChanged":
          Fr(
            "pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid."
          );
          break;
      }
    });
  }
  processGroupOpenedEvent(e) {
    const { columnModel: t } = this;
    e.columnGroups.forEach((r) => {
      let n = null;
      r && (n = t.getProvidedColGroup(r.getGroupId())), !(r && !n) && t.setColumnGroupOpened(n, r.isExpanded(), "alignedGridChanged");
    });
  }
  processColumnEvent(e) {
    var l;
    const t = e.column;
    let r = null;
    if (t && (r = this.columnModel.getColDefCol(t.getColId())), t && !r)
      return;
    const n = this.getMasterColumns(e), { columnApplyStateService: a, columnSizeService: u, ctrlsService: s } = this;
    switch (e.type) {
      case "columnMoved":
        {
          const f = e.api.getColumnState().map((p) => ({ colId: p.colId }));
          a.applyColumnState(
            { state: f, applyOrder: !0 },
            "alignedGridChanged"
          );
        }
        break;
      case "columnVisible":
        {
          const f = e.api.getColumnState().map((p) => ({ colId: p.colId, hide: p.hide }));
          a.applyColumnState({ state: f }, "alignedGridChanged");
        }
        break;
      case "columnPinned":
        {
          const f = e.api.getColumnState().map((p) => ({ colId: p.colId, pinned: p.pinned }));
          a.applyColumnState({ state: f }, "alignedGridChanged");
        }
        break;
      case "columnResized": {
        const v = e, f = {};
        n.forEach((p) => {
          f[p.getId()] = { key: p.getColId(), newWidth: p.getActualWidth() };
        }), (l = v.flexColumns) == null || l.forEach((p) => {
          f[p.getId()] && delete f[p.getId()];
        }), u.setColumnWidths(
          Object.values(f),
          !1,
          v.finished,
          "alignedGridChanged"
        );
        break;
      }
    }
    const i = s.getGridBodyCtrl().isVerticalScrollShowing();
    this.getAlignedGridApis().forEach((v) => {
      v.setGridOption("alwaysShowVerticalScroll", i);
    });
  }
}, QZ = {
  version: $n,
  moduleName: "@ag-grid-community/aligned-grid",
  beans: [JZ]
};
function qZ(e, t) {
  const r = e.columnModel.getColDefCol(t);
  return r ? r.getColDef() : null;
}
function eK(e) {
  return e.columnModel.getColumnDefs();
}
function tK(e, t) {
  typeof t == "number" ? e.columnSizeService.sizeColumnsToFit(t, "api") : e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t);
}
function rK(e, t, r) {
  e.columnModel.setColumnGroupOpened(t, r, "api");
}
function nK(e, t, r) {
  return e.visibleColsService.getColumnGroup(t, r);
}
function iK(e, t) {
  return e.columnModel.getProvidedColGroup(t);
}
function aK(e, t, r) {
  return e.columnNameService.getDisplayNameForColumn(t, r) || "";
}
function oK(e, t, r) {
  return e.columnNameService.getDisplayNameForColumnGroup(t, r) || "";
}
function sK(e, t) {
  return e.columnModel.getColDefCol(t);
}
function lK(e) {
  return e.columnModel.getColDefCols();
}
function uK(e, t) {
  return e.columnApplyStateService.applyColumnState(t, "api");
}
function cK(e) {
  return e.columnGetStateService.getColumnState();
}
function dK(e) {
  e.columnApplyStateService.resetColumnState("api");
}
function fK(e) {
  return e.columnGroupStateService.getColumnGroupState();
}
function hK(e, t) {
  e.columnGroupStateService.setColumnGroupState(t, "api");
}
function pK(e) {
  e.columnGroupStateService.resetColumnGroupState("api");
}
function vK(e) {
  return e.visibleColsService.isPinningLeft() || e.visibleColsService.isPinningRight();
}
function gK(e) {
  return e.visibleColsService.isPinningLeft();
}
function mK(e) {
  return e.visibleColsService.isPinningRight();
}
function yK(e, t) {
  return e.visibleColsService.getColAfter(t);
}
function CK(e, t) {
  return e.visibleColsService.getColBefore(t);
}
function bK(e, t, r) {
  e.columnModel.setColsVisible([t], r, "api");
}
function wK(e, t, r) {
  e.columnModel.setColsVisible(t, r, "api");
}
function SK(e, t, r) {
  e.columnModel.setColsPinned([t], r, "api");
}
function xK(e, t, r) {
  e.columnModel.setColsPinned(t, r, "api");
}
function TK(e) {
  return e.columnModel.getCols();
}
function RK(e) {
  return e.visibleColsService.getLeftCols();
}
function AK(e) {
  return e.visibleColsService.getCenterCols();
}
function EK(e) {
  return e.visibleColsService.getRightCols();
}
function MK(e) {
  return e.visibleColsService.getAllCols();
}
function DK(e) {
  return e.columnViewportService.getViewportColumns();
}
function FK(e, t, r) {
  e.columnMoveService.moveColumns([t], r, "api");
}
function PK(e, t, r) {
  e.columnMoveService.moveColumnByIndex(t, r, "api");
}
function IK(e, t, r) {
  e.columnMoveService.moveColumns(t, r, "api");
}
function LK(e, t, r, n = !0, a = "api") {
  e.columnSizeService.setColumnWidths([{ key: t, newWidth: r }], !1, n, a);
}
function kK(e, t, r = !0, n = "api") {
  e.columnSizeService.setColumnWidths(t, !1, r, n);
}
function OK(e) {
  return e.visibleColsService.getTreeLeft();
}
function NK(e) {
  return e.visibleColsService.getTreeCenter();
}
function GK(e) {
  return e.visibleColsService.getTreeRight();
}
function HK(e) {
  return e.visibleColsService.getAllTrees();
}
function BK(e, t, r) {
  return e.columnAutosizeService.autoSizeCols({ colKeys: [t], skipHeader: r, source: "api" });
}
function VK(e, t, r) {
  e.columnAutosizeService.autoSizeCols({ colKeys: t, skipHeader: r, source: "api" });
}
function zK(e, t) {
  e.columnAutosizeService.autoSizeAllColumns("api", t);
}
var WK = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "dataTypeService", this.dataTypeDefinitions = {}, this.isWaitingForRowData = !1, this.isColumnTypeOverrideInDataTypeDefinitions = !1, this.columnStateUpdatesPendingInference = {}, this.columnStateUpdateListenerDestroyFuncs = [];
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.columnModel = e.columnModel, this.funcColsService = e.funcColsService, this.valueService = e.valueService, this.columnApplyStateService = e.columnApplyStateService, this.filterManager = e.filterManager;
  }
  postConstruct() {
    this.groupHideOpenParents = this.gos.get("groupHideOpenParents"), this.addManagedPropertyListener("groupHideOpenParents", () => {
      this.groupHideOpenParents = this.gos.get("groupHideOpenParents");
    }), this.processDataTypeDefinitions(), this.addManagedPropertyListener("dataTypeDefinitions", (e) => {
      this.processDataTypeDefinitions(), this.columnModel.recreateColumnDefs(Ah(e.source));
    });
  }
  processDataTypeDefinitions() {
    const e = this.getDefaultDataTypes();
    this.dataTypeDefinitions = {}, this.formatValueFuncs = {};
    const t = (n) => (a) => {
      const { column: u, node: s, value: c } = a;
      let i = u.getColDef().valueFormatter;
      return i === n.groupSafeValueFormatter && (i = n.valueFormatter), this.valueService.formatValue(u, s, c, i);
    };
    Object.entries(e).forEach(([n, a]) => {
      const u = {
        ...a,
        groupSafeValueFormatter: this.createGroupSafeValueFormatter(a)
      };
      this.dataTypeDefinitions[n] = u, this.formatValueFuncs[n] = t(u);
    });
    const r = this.gos.get("dataTypeDefinitions") ?? {};
    this.dataTypeMatchers = {}, Object.entries(r).forEach(([n, a]) => {
      const u = this.processDataTypeDefinition(
        a,
        r,
        [n],
        e
      );
      u && (this.dataTypeDefinitions[n] = u, a.dataTypeMatcher && (this.dataTypeMatchers[n] = a.dataTypeMatcher), this.formatValueFuncs[n] = t(u));
    }), this.checkObjectValueHandlers(e), ["dateString", "text", "number", "boolean", "date"].forEach((n) => {
      const a = this.dataTypeMatchers[n];
      a && delete this.dataTypeMatchers[n], this.dataTypeMatchers[n] = a ?? e[n].dataTypeMatcher;
    });
  }
  mergeDataTypeDefinitions(e, t) {
    const r = {
      ...e,
      ...t
    };
    return e.columnTypes && t.columnTypes && t.appendColumnTypes && (r.columnTypes = [
      ...LC(e.columnTypes),
      ...LC(t.columnTypes)
    ]), r;
  }
  processDataTypeDefinition(e, t, r, n) {
    let a;
    const u = e.extendsDataType;
    if (e.columnTypes && (this.isColumnTypeOverrideInDataTypeDefinitions = !0), e.extendsDataType === e.baseDataType) {
      let s = n[u];
      const c = t[u];
      if (s && c && (s = c), !this.validateDataTypeDefinition(e, s, u))
        return;
      a = this.mergeDataTypeDefinitions(s, e);
    } else {
      if (r.includes(u)) {
        Fr(
          'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.'
        );
        return;
      }
      const s = t[u];
      if (!this.validateDataTypeDefinition(e, s, u))
        return;
      const c = this.processDataTypeDefinition(
        s,
        t,
        [...r, u],
        n
      );
      if (!c)
        return;
      a = this.mergeDataTypeDefinitions(
        c,
        e
      );
    }
    return {
      ...a,
      groupSafeValueFormatter: this.createGroupSafeValueFormatter(a)
    };
  }
  validateDataTypeDefinition(e, t, r) {
    return t ? t.baseDataType !== e.baseDataType ? (Fr('The "baseDataType" property of a data type definition must match that of its parent.'), !1) : !0 : (Fr(`The data type definition ${r} does not exist.`), !1);
  }
  createGroupSafeValueFormatter(e) {
    if (e.valueFormatter)
      return (t) => {
        var r, n;
        if ((r = t.node) != null && r.group) {
          const a = (t.colDef.pivotValueColumn ?? t.column).getAggFunc();
          if (a) {
            if (a === "first" || a === "last")
              return e.valueFormatter(t);
            if (e.baseDataType === "number" && a !== "count") {
              if (typeof t.value == "number")
                return e.valueFormatter(t);
              if (typeof t.value == "object") {
                if (!t.value)
                  return;
                if ("toNumber" in t.value)
                  return e.valueFormatter({
                    ...t,
                    value: t.value.toNumber()
                  });
                if ("value" in t.value)
                  return e.valueFormatter({
                    ...t,
                    value: t.value.value
                  });
              }
            }
            return;
          }
          if ((this.gos.get("suppressGroupMaintainValueType") || this.gos.get("groupDisplayType") === "groupRows") && !this.gos.get("treeData"))
            return;
        } else if (this.groupHideOpenParents && t.column.isRowGroupActive() && typeof t.value == "string" && !((n = e.dataTypeMatcher) != null && n.call(e, t.value)))
          return;
        return e.valueFormatter(t);
      };
  }
  updateColDefAndGetColumnType(e, t, r) {
    let { cellDataType: n } = t;
    const { field: a } = t;
    if (n === void 0 && (n = e.cellDataType), (n == null || n === !0) && (n = this.canInferCellDataType(e, t) ? this.inferCellDataType(a, r) : !1), !n) {
      e.cellDataType = !1;
      return;
    }
    const u = this.dataTypeDefinitions[n];
    if (!u) {
      Fr(`Missing data type definition - "${n}"`);
      return;
    }
    return e.cellDataType = n, u.groupSafeValueFormatter && (e.valueFormatter = u.groupSafeValueFormatter), u.valueParser && (e.valueParser = u.valueParser), u.suppressDefaultProperties || this.setColDefPropertiesForBaseDataType(e, n, u, r), u.columnTypes;
  }
  addColumnListeners(e) {
    if (!this.isWaitingForRowData)
      return;
    const t = this.columnStateUpdatesPendingInference[e.getColId()];
    if (!t)
      return;
    const r = (n) => {
      t.add(n.key);
    };
    e.addEventListener("columnStateUpdated", r), this.columnStateUpdateListenerDestroyFuncs.push(
      () => e.removeEventListener("columnStateUpdated", r)
    );
  }
  canInferCellDataType(e, t) {
    if (!da(this.gos))
      return !1;
    const r = { cellRenderer: !0, valueGetter: !0, valueParser: !0, refData: !0 };
    if (this.doColDefPropsPreventInference(t, r))
      return !1;
    const n = t.type === null ? e.type : t.type;
    if (n) {
      const a = this.gos.get("columnTypes") ?? {};
      if (LC(n).some((s) => {
        const c = a[s.trim()];
        return c && this.doColDefPropsPreventInference(c, r);
      }))
        return !1;
    }
    return !this.doColDefPropsPreventInference(e, r);
  }
  doColDefPropsPreventInference(e, t) {
    return [
      ["cellRenderer", "agSparklineCellRenderer"],
      ["valueGetter", void 0],
      ["valueParser", void 0],
      ["refData", void 0]
    ].some(
      ([r, n]) => this.doesColDefPropPreventInference(e, t, r, n)
    );
  }
  doesColDefPropPreventInference(e, t, r, n) {
    if (!t[r])
      return !1;
    const a = e[r];
    return a === null ? (t[r] = !1, !1) : n === void 0 ? !!a : a === n;
  }
  inferCellDataType(e, t) {
    if (!e)
      return;
    let r;
    const n = this.getInitialData();
    if (n) {
      const u = e.indexOf(".") >= 0 && !this.gos.get("suppressFieldDotNotation");
      r = Rm(n, e, u);
    } else
      this.initWaitForRowData(t);
    if (r == null)
      return;
    const [a] = Object.entries(this.dataTypeMatchers).find(
      ([u, s]) => s(r)
    ) ?? ["object"];
    return a;
  }
  getInitialData() {
    const e = this.gos.get("rowData");
    if (e != null && e.length)
      return e[0];
    if (this.initialData)
      return this.initialData;
    {
      const t = this.rowModel.getRootNode().allLeafChildren;
      if (t != null && t.length)
        return t[0].data;
    }
    return null;
  }
  initWaitForRowData(e) {
    if (this.columnStateUpdatesPendingInference[e] = /* @__PURE__ */ new Set(), this.isWaitingForRowData)
      return;
    this.isWaitingForRowData = !0;
    const t = this.isColumnTypeOverrideInDataTypeDefinitions;
    t && this.columnModel.queueResizeOperations();
    const [r] = this.addManagedEventListeners({
      rowDataUpdateStarted: (n) => {
        const { firstRowData: a } = n;
        a && (r == null || r(), this.isWaitingForRowData = !1, this.processColumnsPendingInference(a, t), this.columnStateUpdatesPendingInference = {}, t && this.columnModel.processResizeOperations(), this.eventService.dispatchEvent({
          type: "dataTypesInferred"
        }));
      }
    });
  }
  isPendingInference() {
    return this.isWaitingForRowData;
  }
  processColumnsPendingInference(e, t) {
    this.initialData = e;
    const r = [];
    this.destroyColumnStateUpdateListeners();
    const n = {}, a = {};
    Object.entries(this.columnStateUpdatesPendingInference).forEach(([u, s]) => {
      const c = this.columnModel.getCol(u);
      if (!c)
        return;
      const i = c.getColDef();
      if (!this.columnModel.resetColDefIntoCol(c, "cellDataTypeInferred"))
        return;
      const l = c.getColDef();
      if (t && l.type && l.type !== i.type) {
        const v = this.getUpdatedColumnState(c, s);
        v.rowGroup && v.rowGroupIndex == null && (n[u] = v), v.pivot && v.pivotIndex == null && (a[u] = v), r.push(v);
      }
    }), t && r.push(
      ...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(
        n,
        a
      )
    ), r.length && this.columnApplyStateService.applyColumnState({ state: r }, "cellDataTypeInferred"), this.initialData = null;
  }
  getUpdatedColumnState(e, t) {
    const r = this.columnApplyStateService.getColumnStateFromColDef(e);
    return t.forEach((n) => {
      delete r[n], n === "rowGroup" ? delete r.rowGroupIndex : n === "pivot" && delete r.pivotIndex;
    }), r;
  }
  checkObjectValueHandlers(e) {
    const t = this.dataTypeDefinitions.object, r = e.object;
    this.hasObjectValueParser = t.valueParser !== r.valueParser, this.hasObjectValueFormatter = t.valueFormatter !== r.valueFormatter;
  }
  getDateStringTypeDefinition(e) {
    return e ? this.getDataTypeDefinition(e) ?? this.dataTypeDefinitions.dateString : this.dataTypeDefinitions.dateString;
  }
  getDateParserFunction(e) {
    return this.getDateStringTypeDefinition(e).dateParser;
  }
  getDateFormatterFunction(e) {
    return this.getDateStringTypeDefinition(e).dateFormatter;
  }
  getDataTypeDefinition(e) {
    const t = e.getColDef();
    if (t.cellDataType)
      return this.dataTypeDefinitions[t.cellDataType];
  }
  getBaseDataType(e) {
    var t;
    return (t = this.getDataTypeDefinition(e)) == null ? void 0 : t.baseDataType;
  }
  checkType(e, t) {
    var n;
    if (t == null)
      return !0;
    const r = (n = this.getDataTypeDefinition(e)) == null ? void 0 : n.dataTypeMatcher;
    return r ? r(t) : !0;
  }
  validateColDef(e) {
    const t = (r) => Fr(
      `Cell data type is "object" but no Value ${r} has been provided. Please either provide an object data type definition with a Value ${r}, or set "colDef.value${r}"`
    );
    e.cellDataType === "object" && (e.valueFormatter === this.dataTypeDefinitions.object.groupSafeValueFormatter && !this.hasObjectValueFormatter && t("Formatter"), e.editable && e.valueParser === this.dataTypeDefinitions.object.valueParser && !this.hasObjectValueParser && t("Parser"));
  }
  getFormatValue(e) {
    return this.formatValueFuncs[e];
  }
  setColDefPropertiesForBaseDataType(e, t, r, n) {
    var u;
    const a = this.formatValueFuncs[t];
    switch (r.baseDataType) {
      case "number": {
        e.cellEditor = "agNumberCellEditor";
        break;
      }
      case "boolean": {
        e.cellEditor = "agCheckboxCellEditor", e.cellRenderer = "agCheckboxCellRenderer", e.suppressKeyboardEvent = (s) => !!s.colDef.editable && s.event.key === dr.SPACE;
        break;
      }
      case "date": {
        e.cellEditor = "agDateCellEditor", e.keyCreator = a;
        break;
      }
      case "dateString": {
        e.cellEditor = "agDateStringCellEditor", e.keyCreator = a;
        break;
      }
      case "object": {
        e.cellEditorParams = {
          useFormatter: !0
        }, e.comparator = (s, c) => {
          const i = this.columnModel.getColDefCol(n), l = i == null ? void 0 : i.getColDef();
          if (!i || !l)
            return 0;
          const v = s == null ? "" : a({ column: i, node: null, value: s }), f = c == null ? "" : a({ column: i, node: null, value: c });
          return v === f ? 0 : v > f ? 1 : -1;
        }, e.keyCreator = a;
        break;
      }
    }
    (u = this.filterManager) == null || u.setColDefPropertiesForDataType(e, r, a);
  }
  getDefaultDataTypes() {
    const e = (r) => !!r.match("^\\d{4}-\\d{2}-\\d{2}$"), t = this.localeService.getLocaleTextFunc();
    return {
      number: {
        baseDataType: "number",
        // can be empty space with legacy copy
        valueParser: (r) => {
          var n, a;
          return ((a = (n = r.newValue) == null ? void 0 : n.trim) == null ? void 0 : a.call(n)) === "" ? null : Number(r.newValue);
        },
        valueFormatter: (r) => r.value == null ? "" : typeof r.value != "number" || isNaN(r.value) ? t("invalidNumber", "Invalid Number") : String(r.value),
        dataTypeMatcher: (r) => typeof r == "number"
      },
      text: {
        baseDataType: "text",
        valueParser: (r) => r.newValue === "" ? null : iT(r.newValue),
        dataTypeMatcher: (r) => typeof r == "string"
      },
      boolean: {
        baseDataType: "boolean",
        valueParser: (r) => {
          var n, a;
          return r.newValue == null ? r.newValue : ((a = (n = r.newValue) == null ? void 0 : n.trim) == null ? void 0 : a.call(n)) === "" ? null : String(r.newValue).toLowerCase() === "true";
        },
        valueFormatter: (r) => r.value == null ? "" : String(r.value),
        dataTypeMatcher: (r) => typeof r == "boolean"
      },
      date: {
        baseDataType: "date",
        valueParser: (r) => ws(r.newValue == null ? null : String(r.newValue)),
        valueFormatter: (r) => r.value == null ? "" : !(r.value instanceof Date) || isNaN(r.value.getTime()) ? t("invalidDate", "Invalid Date") : zl(r.value, !1) ?? "",
        dataTypeMatcher: (r) => r instanceof Date
      },
      dateString: {
        baseDataType: "dateString",
        dateParser: (r) => ws(r) ?? void 0,
        dateFormatter: (r) => zl(r ?? null, !1) ?? void 0,
        valueParser: (r) => e(String(r.newValue)) ? r.newValue : null,
        valueFormatter: (r) => e(String(r.value)) ? r.value : "",
        dataTypeMatcher: (r) => typeof r == "string" && e(r)
      },
      object: {
        baseDataType: "object",
        valueParser: () => null,
        valueFormatter: (r) => iT(r.value) ?? ""
      }
    };
  }
  destroyColumnStateUpdateListeners() {
    this.columnStateUpdateListenerDestroyFuncs.forEach((e) => e()), this.columnStateUpdateListenerDestroyFuncs = [];
  }
  destroy() {
    this.dataTypeDefinitions = {}, this.dataTypeMatchers = {}, this.formatValueFuncs = {}, this.columnStateUpdatesPendingInference = {}, this.destroyColumnStateUpdateListeners(), super.destroy();
  }
}, _K = {
  version: $n,
  moduleName: "@ag-grid-community/data-type",
  beans: [WK]
}, UK = {
  version: $n,
  moduleName: "@ag-grid-community/column-api",
  apiFunctions: {
    getColumnDef: qZ,
    getColumnDefs: eK,
    sizeColumnsToFit: tK,
    setColumnGroupOpened: rK,
    getColumnGroup: nK,
    getProvidedColumnGroup: iK,
    getDisplayNameForColumn: aK,
    getDisplayNameForColumnGroup: oK,
    getColumn: sK,
    getColumns: lK,
    applyColumnState: uK,
    getColumnState: cK,
    resetColumnState: dK,
    getColumnGroupState: fK,
    setColumnGroupState: hK,
    resetColumnGroupState: pK,
    isPinning: vK,
    isPinningLeft: gK,
    isPinningRight: mK,
    getDisplayedColAfter: yK,
    getDisplayedColBefore: CK,
    setColumnVisible: bK,
    setColumnsVisible: wK,
    setColumnPinned: SK,
    setColumnsPinned: xK,
    getAllGridColumns: TK,
    getDisplayedLeftColumns: RK,
    getDisplayedCenterColumns: AK,
    getDisplayedRightColumns: EK,
    getAllDisplayedColumns: MK,
    getAllDisplayedVirtualColumns: DK,
    moveColumn: FK,
    moveColumnByIndex: PK,
    moveColumns: IK,
    setColumnWidth: LK,
    setColumnWidths: kK,
    getLeftDisplayedColumnGroups: OK,
    getCenterDisplayedColumnGroups: NK,
    getRightDisplayedColumnGroups: GK,
    getAllDisplayedColumnGroups: HK,
    autoSizeColumn: BK,
    autoSizeColumns: VK,
    autoSizeAllColumns: zK
  }
};
function jK(e, t) {
  e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t);
}
function YK(e, t) {
  const r = e.dragAndDropService.findExternalZone(t);
  r && e.dragAndDropService.removeDropTarget(r);
}
function XK(e, t) {
  return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t);
}
var $K = {
  version: $n,
  moduleName: "@ag-grid-community/drag-api",
  apiFunctions: {
    addRowDropZone: jK,
    removeRowDropZone: YK,
    getRowDropZoneParams: XK
  }
};
function ZK(e) {
  return e.pinnedRowModel.getPinnedTopRowCount();
}
function KK(e) {
  return e.pinnedRowModel.getPinnedBottomRowCount();
}
function JK(e, t) {
  return e.pinnedRowModel.getPinnedTopRow(t);
}
function QK(e, t) {
  return e.pinnedRowModel.getPinnedBottomRow(t);
}
var qK = {
  version: $n,
  moduleName: "@ag-grid-community/pinned-row-api",
  apiFunctions: {
    getPinnedTopRowCount: ZK,
    getPinnedBottomRowCount: KK,
    getPinnedTopRow: JK,
    getPinnedBottomRow: QK
  }
};
function eJ(e) {
  e.overlayService.showLoadingOverlay();
}
function tJ(e) {
  e.overlayService.showNoRowsOverlay();
}
function rJ(e) {
  e.overlayService.hideOverlay();
}
var nJ = {
  version: $n,
  moduleName: "@ag-grid-community/overlay-api",
  apiFunctions: {
    showLoadingOverlay: eJ,
    showNoRowsOverlay: tJ,
    hideOverlay: rJ
  }
};
function iJ(e, t, r) {
  if (!t)
    return;
  const n = e.ctrlsService.getGridBodyCtrl().getGui(), a = `aria-${t}`;
  r === null ? n.removeAttribute(a) : n.setAttribute(a, r);
}
function aJ(e, t = {}) {
  e.frameworkOverrides.wrapIncoming(() => e.rowRenderer.refreshCells(t));
}
function oJ(e, t = {}) {
  const r = (n) => Fr(
    `Since v31.1 api.flashCells parameter '${n}Delay' is deprecated. Please use '${n}Duration' instead.`
  );
  $r(t.fadeDelay) && r("fade"), $r(t.flashDelay) && r("flash"), e.frameworkOverrides.wrapIncoming(() => e.rowRenderer.flashCells(t));
}
function sJ(e) {
  e.frameworkOverrides.wrapIncoming(
    () => e.ctrlsService.getHeaderRowContainerCtrls().forEach((t) => t.refresh())
  );
}
function lJ(e) {
  return e.animationFrameService.isQueueEmpty();
}
function uJ(e) {
  e.animationFrameService.flushAllFrames();
}
function cJ(e) {
  return {
    rowHeight: _1(e.gos),
    headerHeight: e.columnModel.getHeaderHeight()
  };
}
function dJ(e, t = {}) {
  return e.rowRenderer.getCellRendererInstances(t).map(Em);
}
var fJ = {
  version: $n,
  moduleName: "@ag-grid-community/render-api",
  apiFunctions: {
    setGridAriaProperty: iJ,
    refreshCells: aJ,
    flashCells: oJ,
    refreshHeader: sJ,
    isAnimationFrameQueueEmpty: lJ,
    flushAllAnimationFrames: uJ,
    getSizesForCurrentTheme: cJ,
    getCellRendererInstances: dJ
  }
};
function hJ(e) {
  e.valueCache.expire();
}
function pJ(e, t, r) {
  return a4(e, { colKey: t, rowNode: r });
}
function a4(e, t) {
  const { colKey: r, rowNode: n, useFormatter: a } = t, u = e.columnModel.getColDefCol(r) ?? e.columnModel.getCol(r);
  if (mi(u))
    return null;
  const s = e.valueService.getValueForDisplay(u, n);
  return a ? e.valueService.formatValue(u, n, s) ?? ac(s, !0) : s;
}
function vJ(e) {
  return e.context.getGridId();
}
function gJ(e) {
  e.gridDestroyService.destroy();
}
function mJ(e) {
  return e.gridDestroyService.isDestroyCalled();
}
function yJ(e, t) {
  return e.gos.get(t);
}
function CJ(e, t, r) {
  o4(e, { [t]: r });
}
function o4(e, t) {
  e.gos.updateGridOptions({ options: t });
}
function bJ(e, t, r) {
  e.apiEventService.addEventListener(t, r);
}
function wJ(e, t, r) {
  e.apiEventService.removeEventListener(t, r);
}
function SJ(e, t) {
  e.apiEventService.addGlobalListener(t);
}
function xJ(e, t) {
  e.apiEventService.removeGlobalListener(t);
}
function TJ(e) {
  return e.focusService.getFocusedCell();
}
function RJ(e) {
  return e.focusService.clearFocusedCell();
}
function AJ(e, t, r, n) {
  e.focusService.setFocusedCell({ rowIndex: t, column: r, rowPinned: n, forceBrowserFocus: !0 });
}
function EJ(e, t) {
  return e.navigationService.tabToNextCell(!1, t);
}
function MJ(e, t) {
  return e.navigationService.tabToNextCell(!0, t);
}
function DJ(e, t, r = !1) {
  const n = e.headerNavigationService.getHeaderPositionForColumn(t, r);
  n && e.focusService.focusHeaderPosition({ headerPosition: n });
}
function FJ(e, t, r) {
  const n = e.columnModel.getCol(t);
  e.menuService.showColumnMenu({
    column: n,
    buttonElement: r,
    positionBy: "button"
  });
}
function PJ(e, t, r) {
  let n = e.columnModel.getCol(t);
  if (n || (n = e.columnModel.getColDefCol(t)), !n) {
    Ni(`column '${t}' not found`);
    return;
  }
  e.menuService.showColumnMenu({
    column: n,
    mouseEvent: r,
    positionBy: "mouse"
  });
}
function IJ(e, t) {
  const r = e.columnModel.getCol(t);
  if (!r) {
    Ni(`column '${t}' not found`);
    return;
  }
  e.menuService.showColumnMenu({
    column: r,
    positionBy: "auto"
  });
}
function LJ(e) {
  e.menuService.hidePopupMenu();
}
function kJ(e, t = {}) {
  const r = t ? t.rowNodes : void 0;
  e.frameworkOverrides.wrapIncoming(() => e.rowRenderer.redrawRows(r));
}
function OJ(e, t, r, n, a) {
  e.expansionService.setRowNodeExpanded(t, r, n, a);
}
function NJ(e, t) {
  return e.rowModel.getRowNode(t);
}
function GJ(e, t, r, n) {
  e.rowRenderer.addRenderedRowListener(t, r, n);
}
function HJ(e) {
  return e.rowRenderer.getRenderedNodes();
}
function BJ(e, t, r) {
  e.rowModel.forEachNode(t, r);
}
function VJ(e) {
  return s4(e);
}
function s4(e) {
  return e.rowRenderer.getFirstVirtualRenderedRow();
}
function zJ(e) {
  return l4(e);
}
function l4(e) {
  return e.rowRenderer.getLastVirtualRenderedRow();
}
function WJ(e, t) {
  return e.rowModel.getRow(t);
}
function _J(e) {
  return e.rowModel.getRowCount();
}
function UJ(e) {
  return e.rowModel;
}
function jJ(e, t) {
  if (!t.nodes.every((c) => c.rowPinned ? (Fr("cannot select pinned rows"), !1) : c.id === void 0 ? (Fr("cannot select node until id for node is known"), !1) : !0))
    return;
  const { nodes: n, source: a, newValue: u } = t, s = n;
  e.selectionService.setNodesSelected({ nodes: s, source: a ?? "api", newValue: u });
}
function YJ(e, t = "apiSelectAll") {
  e.selectionService.selectAllRowNodes({ source: t });
}
function XJ(e, t = "apiSelectAll") {
  e.selectionService.deselectAllRowNodes({ source: t });
}
function $J(e, t = "apiSelectAllFiltered") {
  e.selectionService.selectAllRowNodes({ source: t, justFiltered: !0 });
}
function ZJ(e, t = "apiSelectAllFiltered") {
  e.selectionService.deselectAllRowNodes({ source: t, justFiltered: !0 });
}
function KJ(e, t = "apiSelectAllCurrentPage") {
  e.selectionService.selectAllRowNodes({ source: t, justCurrentPage: !0 });
}
function JJ(e, t = "apiSelectAllCurrentPage") {
  e.selectionService.deselectAllRowNodes({ source: t, justCurrentPage: !0 });
}
function QJ(e) {
  return e.selectionService.getSelectedNodes();
}
function qJ(e) {
  return e.selectionService.getSelectedRows();
}
function eQ(e) {
  e.sortController.onSortChanged("api");
}
var tQ = {
  version: $n,
  moduleName: "@ag-grid-community/core-api",
  apiFunctions: {
    getGridId: vJ,
    destroy: gJ,
    isDestroyed: mJ,
    getGridOption: yJ,
    setGridOption: CJ,
    updateGridOptions: o4
  }
}, rQ = {
  version: $n,
  moduleName: "@ag-grid-community/row-selection-api",
  apiFunctions: {
    setNodesSelected: jJ,
    selectAll: YJ,
    deselectAll: XJ,
    selectAllFiltered: $J,
    deselectAllFiltered: ZJ,
    selectAllOnCurrentPage: KJ,
    deselectAllOnCurrentPage: JJ,
    getSelectedNodes: QJ,
    getSelectedRows: qJ
  }
}, nQ = {
  version: $n,
  moduleName: "@ag-grid-community/row-api",
  apiFunctions: {
    redrawRows: kJ,
    setRowNodeExpanded: OJ,
    getRowNode: NJ,
    addRenderedRowListener: GJ,
    getRenderedNodes: HJ,
    forEachNode: BJ,
    getFirstDisplayedRow: VJ,
    getFirstDisplayedRowIndex: s4,
    getLastDisplayedRow: zJ,
    getLastDisplayedRowIndex: l4,
    getDisplayedRowAtIndex: WJ,
    getDisplayedRowCount: _J,
    getModel: UJ
  }
}, iQ = {
  version: $n,
  moduleName: "@ag-grid-community/scroll-api",
  apiFunctions: {
    getVerticalPixelRange: Y$,
    getHorizontalPixelRange: X$,
    ensureColumnVisible: qk,
    ensureIndexVisible: e4,
    ensureNodeVisible: $$
  }
}, aQ = {
  version: $n,
  moduleName: "@ag-grid-community/keyboard-navigation-api",
  apiFunctions: {
    getFocusedCell: TJ,
    clearFocusedCell: RJ,
    setFocusedCell: AJ,
    setFocusedHeader: DJ,
    tabToNextCell: EJ,
    tabToPreviousCell: MJ
  }
}, oQ = {
  version: $n,
  moduleName: "@ag-grid-community/event-api",
  apiFunctions: {
    addEventListener: bJ,
    addGlobalListener: SJ,
    removeEventListener: wJ,
    removeGlobalListener: xJ
  }
}, sQ = {
  version: $n,
  moduleName: "@ag-grid-community/cell-api",
  apiFunctions: {
    expireValueCache: hJ,
    getValue: pJ,
    getCellValue: a4
  }
}, lQ = {
  version: $n,
  moduleName: "@ag-grid-community/menu-api",
  apiFunctions: {
    showColumnMenuAfterButtonClick: FJ,
    showColumnMenuAfterMouseClick: PJ,
    showColumnMenu: IJ,
    hidePopupMenu: LJ
  }
}, uQ = {
  version: $n,
  moduleName: "@ag-grid-community/sort-api",
  apiFunctions: {
    onSortChanged: eQ
  }
}, cQ = {
  version: $n,
  moduleName: "@ag-grid-community/api",
  dependantModules: [
    tQ,
    qK,
    rQ,
    UK,
    nQ,
    $K,
    iQ,
    nJ,
    aQ,
    oQ,
    fJ,
    sQ,
    lQ,
    uQ
  ]
};
function dQ(e) {
  var t;
  return ((t = e.stateService) == null ? void 0 : t.getState()) ?? {};
}
function fQ(e) {
  switch (e.version || (e.version = "32.1.0"), e.version) {
    case "32.1.0":
      e = hQ(e);
  }
  return e;
}
function hQ(e) {
  return e.cellSelection = pQ(e, "rangeSelection"), e;
}
function pQ(e, t) {
  if (e && typeof e == "object")
    return e[t];
}
var vQ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "stateService", this.suppressEvents = !0, this.queuedUpdateSources = /* @__PURE__ */ new Set(), this.dispatchStateUpdateEventDebounced = Cs(() => this.dispatchQueuedStateUpdateEvents(), 0), this.onRowGroupOpenedDebounced = Cs(
      () => this.updateCachedState("rowGroupExpansion", this.getRowGroupExpansionState()),
      0
    ), this.onRowSelectedDebounced = Cs(() => {
      this.staleStateKeys.delete("rowSelection"), this.updateCachedState("rowSelection", this.getRowSelectionState());
    }, 0), this.staleStateKeys = /* @__PURE__ */ new Set();
  }
  wireBeans(e) {
    this.filterManager = e.filterManager, this.ctrlsService = e.ctrlsService, this.pivotResultColsService = e.pivotResultColsService, this.focusService = e.focusService, this.columnModel = e.columnModel, this.visibleColsService = e.visibleColsService, this.columnGroupStateService = e.columnGroupStateService, this.columnGetStateService = e.columnGetStateService, this.paginationService = e.paginationService, this.selectionService = e.selectionService, this.expansionService = e.expansionService, this.columnAnimationService = e.columnAnimationService, this.columnApplyStateService = e.columnApplyStateService, this.sideBarService = e.sideBarService, this.rangeService = e.rangeService;
  }
  postConstruct() {
    this.isClientSideRowModel = da(this.gos), this.cachedState = this.getInitialState(), this.ctrlsService.whenReady(
      this,
      () => this.suppressEventsAndDispatchInitEvent(() => this.setupStateOnGridReady())
    );
    const [e, t, r] = this.addManagedEventListeners({
      newColumnsLoaded: ({ source: n }) => {
        n === "gridInitializing" && (e(), this.suppressEventsAndDispatchInitEvent(() => this.setupStateOnColumnsInitialised()));
      },
      rowCountReady: () => {
        t == null || t(), this.suppressEventsAndDispatchInitEvent(() => this.setupStateOnRowCountReady());
      },
      firstDataRendered: () => {
        r == null || r(), this.suppressEventsAndDispatchInitEvent(() => this.setupStateOnFirstDataRendered());
      }
    });
  }
  getInitialState() {
    return fQ(this.gos.get("initialState") ?? {});
  }
  getState() {
    return this.staleStateKeys.size && this.refreshStaleState(), this.cachedState;
  }
  setupStateOnGridReady() {
    this.updateCachedState("sideBar", this.getSideBarState());
    const e = () => this.updateCachedState("sideBar", this.getSideBarState());
    this.addManagedEventListeners({
      toolPanelVisibleChanged: e,
      sideBarUpdated: e
    });
  }
  setupStateOnColumnsInitialised() {
    const e = this.getInitialState();
    this.setColumnState(e), this.setColumnGroupState(e), this.updateColumnState([
      "aggregation",
      "columnOrder",
      "columnPinning",
      "columnSizing",
      "columnVisibility",
      "pivot",
      "pivot",
      "rowGroup",
      "sort"
    ]), this.updateCachedState("columnGroup", this.getColumnGroupState());
    const t = (r) => () => this.updateColumnState([r]);
    this.addManagedEventListeners({
      columnValueChanged: t("aggregation"),
      columnMoved: t("columnOrder"),
      columnPinned: t("columnPinning"),
      columnResized: t("columnSizing"),
      columnVisible: t("columnVisibility"),
      columnPivotChanged: t("pivot"),
      columnPivotModeChanged: t("pivot"),
      columnRowGroupChanged: t("rowGroup"),
      sortChanged: t("sort"),
      newColumnsLoaded: () => this.updateColumnState([
        "aggregation",
        "columnOrder",
        "columnPinning",
        "columnSizing",
        "columnVisibility",
        "pivot",
        "rowGroup",
        "sort"
      ]),
      columnGroupOpened: () => this.updateCachedState("columnGroup", this.getColumnGroupState())
    });
  }
  setupStateOnRowCountReady() {
    const {
      filter: e,
      rowGroupExpansion: t,
      rowSelection: r,
      pagination: n
    } = this.getInitialState(), a = this.gos.get("advancedFilterModel");
    (e || a) && this.setFilterState(e, a), t && this.setRowGroupExpansionState(t), r && this.setRowSelectionState(r), n && this.setPaginationState(n), this.updateCachedState("filter", this.getFilterState()), this.updateCachedState("rowGroupExpansion", this.getRowGroupExpansionState()), this.updateCachedState("rowSelection", this.getRowSelectionState()), this.updateCachedState("pagination", this.getPaginationState());
    const u = () => this.updateCachedState("rowGroupExpansion", this.getRowGroupExpansionState());
    this.addManagedEventListeners({
      filterChanged: () => this.updateCachedState("filter", this.getFilterState()),
      rowGroupOpened: () => this.onRowGroupOpenedDebounced(),
      expandOrCollapseAll: u,
      // `groupDefaultExpanded` updates expansion state without an expansion event
      columnRowGroupChanged: u,
      rowDataUpdated: () => {
        this.gos.get("groupDefaultExpanded") !== 0 && setTimeout(() => {
          u();
        });
      },
      selectionChanged: () => {
        this.staleStateKeys.add("rowSelection"), this.onRowSelectedDebounced();
      },
      paginationChanged: (s) => {
        (s.newPage || s.newPageSize) && this.updateCachedState("pagination", this.getPaginationState());
      }
    });
  }
  setupStateOnFirstDataRendered() {
    const {
      scroll: e,
      cellSelection: t,
      focusedCell: r,
      columnOrder: n
    } = this.getInitialState();
    r && this.setFocusedCellState(r), t && this.setCellSelectionState(t), e && this.setScrollState(e), this.setColumnPivotState(!!(n != null && n.orderedColIds)), this.updateCachedState("sideBar", this.getSideBarState()), this.updateCachedState("focusedCell", this.getFocusedCellState());
    const a = this.getRangeSelectionState();
    this.updateCachedState("rangeSelection", a), this.updateCachedState("cellSelection", a), this.updateCachedState("scroll", this.getScrollState()), this.addManagedEventListeners({
      cellFocused: () => this.updateCachedState("focusedCell", this.getFocusedCellState()),
      cellSelectionChanged: (u) => {
        if (u.finished) {
          const s = this.getRangeSelectionState();
          this.updateCachedState("rangeSelection", s), this.updateCachedState("cellSelection", s);
        }
      },
      bodyScrollEnd: () => this.updateCachedState("scroll", this.getScrollState())
    });
  }
  getColumnState() {
    const e = this.columnModel.isPivotMode(), t = [], r = [], n = [], a = [], u = [], s = [], c = [], i = [], l = [];
    let v = 0;
    const f = this.columnGetStateService.getColumnState();
    for (let p = 0; p < f.length; p++) {
      const {
        colId: g,
        sort: y,
        sortIndex: C,
        rowGroup: m,
        rowGroupIndex: h,
        aggFunc: w,
        pivot: S,
        pivotIndex: E,
        pinned: x,
        hide: T,
        width: F,
        flex: P
      } = f[p];
      l.push(g), y && (t[C ?? v++] = { colId: g, sort: y }), m && (r[h ?? 0] = g), typeof w == "string" && n.push({ colId: g, aggFunc: w }), S && (a[E ?? 0] = g), x && (x === "right" ? s : u).push(g), T && c.push(g), (P || F) && i.push({ colId: g, flex: P ?? void 0, width: F });
    }
    return {
      sort: t.length ? { sortModel: t } : void 0,
      rowGroup: r.length ? { groupColIds: r } : void 0,
      aggregation: n.length ? { aggregationModel: n } : void 0,
      pivot: a.length || e ? { pivotMode: e, pivotColIds: a } : void 0,
      columnPinning: u.length || s.length ? { leftColIds: u, rightColIds: s } : void 0,
      columnVisibility: c.length ? { hiddenColIds: c } : void 0,
      columnSizing: i.length ? { columnSizingModel: i } : void 0,
      columnOrder: l.length ? { orderedColIds: l } : void 0
    };
  }
  setColumnState(e) {
    const {
      sort: t,
      rowGroup: r,
      aggregation: n,
      pivot: a,
      columnPinning: u,
      columnVisibility: s,
      columnSizing: c,
      columnOrder: i,
      partialColumnState: l
    } = e, v = {}, f = (m) => {
      let h = v[m];
      return h || (h = { colId: m }, v[m] = h, h);
    }, p = l ? {} : {
      sort: null,
      sortIndex: null,
      rowGroup: null,
      rowGroupIndex: null,
      aggFunc: null,
      pivot: null,
      pivotIndex: null,
      pinned: null,
      hide: null,
      flex: null
    };
    t && (t.sortModel.forEach(({ colId: m, sort: h }, w) => {
      const S = f(m);
      S.sort = h, S.sortIndex = w;
    }), p.sort = null, p.sortIndex = null), r && (r.groupColIds.forEach((m, h) => {
      const w = f(m);
      w.rowGroup = !0, w.rowGroupIndex = h;
    }), p.rowGroup = null, p.rowGroupIndex = null), n && (n.aggregationModel.forEach(({ colId: m, aggFunc: h }) => {
      f(m).aggFunc = h;
    }), p.aggFunc = null), a && (a.pivotColIds.forEach((m, h) => {
      const w = f(m);
      w.pivot = !0, w.pivotIndex = h;
    }), this.gos.updateGridOptions({
      options: { pivotMode: a.pivotMode },
      source: "gridInitializing"
    }), p.pivot = null, p.pivotIndex = null), u && (u.leftColIds.forEach((m) => {
      f(m).pinned = "left";
    }), u.rightColIds.forEach((m) => {
      f(m).pinned = "right";
    }), p.pinned = null), s && (s.hiddenColIds.forEach((m) => {
      f(m).hide = !0;
    }), p.hide = null), c && (c.columnSizingModel.forEach(({ colId: m, flex: h, width: w }) => {
      const S = f(m);
      S.flex = h ?? null, S.width = w;
    }), p.flex = null);
    const g = i == null ? void 0 : i.orderedColIds, y = !!(g != null && g.length), C = y ? g.map((m) => f(m)) : Object.values(v);
    C.length && (this.columnStates = C, this.columnApplyStateService.applyColumnState(
      {
        state: C,
        applyOrder: y,
        defaultState: p
      },
      "gridInitializing"
    ));
  }
  setColumnPivotState(e) {
    const t = this.columnStates;
    this.columnStates = void 0;
    const r = this.columnGroupStates;
    if (this.columnGroupStates = void 0, !!this.pivotResultColsService.isPivotResultColsPresent()) {
      if (t) {
        const n = [];
        for (const a of t)
          this.pivotResultColsService.getPivotResultCol(a.colId) && n.push(a);
        this.columnApplyStateService.applyColumnState(
          {
            state: n,
            applyOrder: e
          },
          "gridInitializing"
        );
      }
      r && this.columnGroupStateService.setColumnGroupState(r, "gridInitializing");
    }
  }
  getColumnGroupState() {
    const e = this.columnGroupStateService.getColumnGroupState(), t = [];
    return e.forEach(({ groupId: r, open: n }) => {
      n && t.push(r);
    }), t.length ? { openColumnGroupIds: t } : void 0;
  }
  setColumnGroupState(e) {
    var a;
    if (!Object.prototype.hasOwnProperty.call(e, "columnGroup"))
      return;
    const t = new Set((a = e.columnGroup) == null ? void 0 : a.openColumnGroupIds), n = this.columnGroupStateService.getColumnGroupState().map(({ groupId: u }) => {
      const s = t.has(u);
      return s && t.delete(u), {
        groupId: u,
        open: s
      };
    });
    t.forEach((u) => {
      n.push({
        groupId: u,
        open: !0
      });
    }), n.length && (this.columnGroupStates = n), this.columnGroupStateService.setColumnGroupState(n, "gridInitializing");
  }
  getFilterState() {
    var r, n;
    let e = (r = this.filterManager) == null ? void 0 : r.getFilterModel();
    e && Object.keys(e).length === 0 && (e = void 0);
    const t = ((n = this.filterManager) == null ? void 0 : n.getAdvancedFilterModel()) ?? void 0;
    return e || t ? { filterModel: e, advancedFilterModel: t } : void 0;
  }
  setFilterState(e, t) {
    var a, u;
    const { filterModel: r, advancedFilterModel: n } = e ?? {
      advancedFilterModel: t
    };
    r && ((a = this.filterManager) == null || a.setFilterModel(r, "columnFilter")), n && ((u = this.filterManager) == null || u.setAdvancedFilterModel(n));
  }
  getRangeSelectionState() {
    var t;
    const e = (t = this.rangeService) == null ? void 0 : t.getCellRanges().map((r) => {
      const { id: n, type: a, startRow: u, endRow: s, columns: c, startColumn: i } = r;
      return {
        id: n,
        type: a,
        startRow: u,
        endRow: s,
        colIds: c.map((l) => l.getColId()),
        startColId: i.getColId()
      };
    });
    return e != null && e.length ? { cellRanges: e } : void 0;
  }
  setCellSelectionState(e) {
    const { gos: t, rangeService: r, columnModel: n, visibleColsService: a } = this;
    if (!nd(t) || !r)
      return;
    const u = [];
    if (e.cellRanges.forEach((s) => {
      const c = [];
      if (s.colIds.forEach((l) => {
        const v = n.getCol(l);
        v && c.push(v);
      }), !c.length)
        return;
      let i = n.getCol(s.startColId);
      if (!i) {
        const l = a.getAllCols(), v = new Set(c);
        i = l.find((f) => v.has(f));
      }
      u.push({
        ...s,
        columns: c,
        startColumn: i
      });
    }), X_(t) && $_(t) && u.length > 1)
      return Fr("cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`");
    r.setCellRanges(u);
  }
  getScrollState() {
    var n;
    if (!this.isClientSideRowModel)
      return;
    const e = (n = this.ctrlsService.getGridBodyCtrl()) == null ? void 0 : n.getScrollFeature(), { left: t } = (e == null ? void 0 : e.getHScrollPosition()) ?? { left: 0 }, { top: r } = (e == null ? void 0 : e.getVScrollPosition()) ?? { top: 0 };
    return r || t ? {
      top: r,
      left: t
    } : void 0;
  }
  setScrollState(e) {
    var n;
    if (!this.isClientSideRowModel)
      return;
    const { top: t, left: r } = e;
    (n = this.ctrlsService.getGridBodyCtrl()) == null || n.getScrollFeature().setScrollPosition(t, r);
  }
  getSideBarState() {
    var e, t;
    return (t = (e = this.sideBarService) == null ? void 0 : e.getSideBarComp()) == null ? void 0 : t.getState();
  }
  getFocusedCellState() {
    if (!this.isClientSideRowModel)
      return;
    const e = this.focusService.getFocusedCell();
    if (e) {
      const { column: t, rowIndex: r, rowPinned: n } = e;
      return {
        colId: t.getColId(),
        rowIndex: r,
        rowPinned: n
      };
    }
  }
  setFocusedCellState(e) {
    if (!this.isClientSideRowModel)
      return;
    const { colId: t, rowIndex: r, rowPinned: n } = e;
    this.focusService.setFocusedCell({
      column: this.columnModel.getCol(t),
      rowIndex: r,
      rowPinned: n,
      forceBrowserFocus: !0,
      preventScrollOnBrowserFocus: !0
    });
  }
  getPaginationState() {
    if (!this.paginationService)
      return;
    const e = this.paginationService.getCurrentPage(), t = this.gos.get("paginationAutoPageSize") ? void 0 : this.paginationService.getPageSize();
    if (!(!e && !t))
      return { page: e, pageSize: t };
  }
  setPaginationState(e) {
    this.paginationService && (e.pageSize && !this.gos.get("paginationAutoPageSize") && this.paginationService.setPageSize(e.pageSize, "initialState"), typeof e.page == "number" && this.paginationService.setPage(e.page));
  }
  getRowSelectionState() {
    var r;
    const e = this.selectionService.getSelectionState();
    return !e || !Array.isArray(e) && (e.selectAll === !1 || e.selectAllChildren === !1) && !((r = e == null ? void 0 : e.toggledNodes) != null && r.length) ? void 0 : e;
  }
  setRowSelectionState(e) {
    this.selectionService.setSelectionState(e, "gridInitializing");
  }
  getRowGroupExpansionState() {
    const e = this.expansionService.getExpandedRows();
    return e.length ? {
      expandedRowGroupIds: e
    } : void 0;
  }
  setRowGroupExpansionState(e) {
    this.expansionService.expandRows(e.expandedRowGroupIds);
  }
  updateColumnState(e) {
    const t = this.getColumnState();
    let r = !1;
    Object.entries(t).forEach(([n, a]) => {
      l1(a, this.cachedState[n]) || (r = !0);
    }), this.cachedState = {
      ...this.cachedState,
      ...t
    }, r && this.dispatchStateUpdateEvent(e);
  }
  updateCachedState(e, t) {
    const r = this.cachedState[e];
    this.setCachedStateValue(e, t), l1(t, r) || this.dispatchStateUpdateEvent([e]);
  }
  setCachedStateValue(e, t) {
    this.cachedState = {
      ...this.cachedState,
      [e]: t
    };
  }
  refreshStaleState() {
    this.staleStateKeys.forEach((e) => {
      switch (e) {
        case "rowSelection":
          this.setCachedStateValue(e, this.getRowSelectionState());
          break;
      }
    }), this.staleStateKeys.clear();
  }
  dispatchStateUpdateEvent(e) {
    this.suppressEvents || (e.forEach((t) => this.queuedUpdateSources.add(t)), this.dispatchStateUpdateEventDebounced());
  }
  dispatchQueuedStateUpdateEvents() {
    const e = Array.from(this.queuedUpdateSources);
    this.queuedUpdateSources.clear(), this.eventService.dispatchEvent({
      type: "stateUpdated",
      sources: e,
      state: this.cachedState
    });
  }
  suppressEventsAndDispatchInitEvent(e) {
    this.suppressEvents = !0, this.columnAnimationService.setSuppressAnimation(!0), e(), setTimeout(() => {
      this.suppressEvents = !1, this.queuedUpdateSources.clear(), this.isAlive() && (this.columnAnimationService.setSuppressAnimation(!1), this.dispatchStateUpdateEvent(["gridInitializing"]));
    });
  }
}, u4 = {
  version: $n,
  moduleName: "@ag-grid-community/state-core",
  beans: [vQ]
}, gQ = {
  version: $n,
  moduleName: "@ag-grid-community/state-api",
  apiFunctions: {
    getState: dQ
  },
  dependantModules: [u4]
}, mQ = {
  version: $n,
  moduleName: "@ag-grid-community/state",
  dependantModules: [u4, gQ]
};
function yQ(e) {
  return e.rowModel.isLastRowIndexKnown();
}
function CQ(e) {
  var t;
  return ((t = e.paginationService) == null ? void 0 : t.getPageSize()) ?? 100;
}
function bQ(e) {
  var t;
  return ((t = e.paginationService) == null ? void 0 : t.getCurrentPage()) ?? 0;
}
function wQ(e) {
  var t;
  return ((t = e.paginationService) == null ? void 0 : t.getTotalPages()) ?? 1;
}
function SQ(e) {
  return e.paginationService ? e.paginationService.getMasterRowCount() : e.rowModel.getRowCount();
}
function xQ(e) {
  var t;
  (t = e.paginationService) == null || t.goToNextPage();
}
function TQ(e) {
  var t;
  (t = e.paginationService) == null || t.goToPreviousPage();
}
function RQ(e) {
  var t;
  (t = e.paginationService) == null || t.goToFirstPage();
}
function AQ(e) {
  var t;
  (t = e.paginationService) == null || t.goToLastPage();
}
function EQ(e, t) {
  var r;
  (r = e.paginationService) == null || r.goToPage(t);
}
var MQ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "paginationAutoPageSizeService";
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.paginationService = e.paginationService;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => {
      this.centerRowsCtrl = e.center;
      const t = this.checkPageSize.bind(this);
      this.addManagedEventListeners({
        bodyHeightChanged: t,
        scrollVisibilityChanged: t
      }), this.addManagedPropertyListener("paginationAutoPageSize", this.onPaginationAutoSizeChanged.bind(this)), this.checkPageSize();
    });
  }
  notActive() {
    return !this.gos.get("paginationAutoPageSize") || this.centerRowsCtrl == null;
  }
  onPaginationAutoSizeChanged() {
    this.notActive() ? this.paginationService.unsetAutoCalculatedPageSize() : this.checkPageSize();
  }
  checkPageSize() {
    if (this.notActive())
      return;
    const e = this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();
    if (e > 0) {
      const t = () => {
        const r = Math.max(_1(this.gos), 1), n = Math.floor(e / r);
        this.paginationService.setPageSize(n, "autoCalculated");
      };
      this.isBodyRendered ? Cs(() => t(), 50)() : (t(), this.isBodyRendered = !0);
    } else
      this.isBodyRendered = !1;
  }
};
function DQ(e, t, r) {
  e.addManagedElementListeners(t, {
    keydown: (n) => {
      if (!n.defaultPrevented && n.key === dr.TAB) {
        const a = n.shiftKey;
        r.findNextFocusableElement(t, !1, a) || r.focusNextGridCoreContainer(a) && n.preventDefault();
      }
    }
  });
}
var pm = "paginationPageSizeSelector", FQ = class extends na {
  constructor() {
    super(
      /* html */
      '<span class="ag-paging-page-size"></span>'
    ), this.hasEmptyOption = !1, this.handlePageSizeItemSelected = () => {
      if (!this.selectPageSizeComp)
        return;
      const e = this.selectPageSizeComp.getValue();
      if (!e)
        return;
      const t = Number(e);
      isNaN(t) || t < 1 || t === this.paginationService.getPageSize() || (this.paginationService.setPageSize(t, "pageSizeSelector"), this.hasEmptyOption && this.toggleSelectDisplay(!0), this.selectPageSizeComp.getFocusableElement().focus());
    };
  }
  wireBeans(e) {
    this.paginationService = e.paginationService;
  }
  postConstruct() {
    this.addManagedPropertyListener(pm, () => {
      this.onPageSizeSelectorValuesChange();
    }), this.addManagedEventListeners({ paginationChanged: (e) => this.handlePaginationChanged(e) });
  }
  handlePaginationChanged(e) {
    if (!this.selectPageSizeComp || !(e != null && e.newPageSize))
      return;
    const t = this.paginationService.getPageSize();
    this.getPageSizeSelectorValues().includes(t) ? this.selectPageSizeComp.setValue(t.toString()) : this.hasEmptyOption ? this.selectPageSizeComp.setValue("") : this.toggleSelectDisplay(!0);
  }
  toggleSelectDisplay(e) {
    this.selectPageSizeComp && !e && this.reset(), e && (this.reloadPageSizesSelector(), this.selectPageSizeComp);
  }
  reset() {
    Qs(this.getGui()), this.selectPageSizeComp && (this.selectPageSizeComp = this.destroyBean(this.selectPageSizeComp));
  }
  onPageSizeSelectorValuesChange() {
    this.selectPageSizeComp && this.shouldShowPageSizeSelector() && this.reloadPageSizesSelector();
  }
  shouldShowPageSizeSelector() {
    return this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel") && !this.gos.get("paginationAutoPageSize") && this.gos.get(pm) !== !1;
  }
  reloadPageSizesSelector() {
    const e = this.getPageSizeSelectorValues(), t = this.paginationService.getPageSize(), r = !t || !e.includes(t);
    if (r) {
      const a = this.gos.exists("paginationPageSize"), u = this.gos.get(pm) !== !0;
      Fr(
        `'paginationPageSize=${t}'${a ? "" : " (default value)"}, but ${t} is not included in${u ? "" : " the default"} paginationPageSizeSelector=[${e.join(", ")}].`
      ), u || Fr(
        `Either set '${pm}' to an array that includes ${t} or to 'false' to disable the page size selector.`
      ), e.unshift("");
    }
    const n = String(r ? "" : t);
    this.selectPageSizeComp ? (cf(this.pageSizeOptions, e) || (this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)), this.pageSizeOptions = e), this.selectPageSizeComp.setValue(n, !0)) : this.createPageSizeSelectorComp(e, n), this.hasEmptyOption = r;
  }
  createPageSizeSelectOptions(e) {
    return e.map((t) => ({
      value: String(t)
    }));
  }
  createPageSizeSelectorComp(e, t) {
    const r = this.localeService.getLocaleTextFunc(), n = r("pageSizeSelectorLabel", "Page Size:"), a = r("ariaPageSizeSelectorLabel", "Page Size");
    this.selectPageSizeComp = this.createManagedBean(new eR()).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(a).setLabel(n).onValueChange(() => this.handlePageSizeItemSelected()), this.appendChild(this.selectPageSizeComp);
  }
  getPageSizeSelectorValues() {
    const e = [20, 50, 100], t = this.gos.get(pm);
    return !Array.isArray(t) || Rs(t) ? e : [...t].sort((r, n) => r - n);
  }
  destroy() {
    this.toggleSelectDisplay(!1), super.destroy();
  }
}, PQ = {
  selector: "AG-PAGE-SIZE-SELECTOR",
  component: FQ
}, IQ = class extends wZ {
  constructor() {
    super(), this.btFirst = In, this.btPrevious = In, this.btNext = In, this.btLast = In, this.lbRecordCount = In, this.lbFirstRowOnPage = In, this.lbLastRowOnPage = In, this.lbCurrent = In, this.lbTotal = In, this.pageSizeComp = In, this.previousAndFirstButtonsDisabled = !1, this.nextButtonDisabled = !1, this.lastButtonDisabled = !1, this.areListenersSetup = !1, this.allowFocusInnerElement = !1;
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.paginationService = e.paginationService, this.focusService = e.focusService, this.ariaAnnouncementService = e.ariaAnnouncementService;
  }
  postConstruct() {
    const e = this.gos.get("enableRtl");
    this.setTemplate(this.getTemplate(), [PQ]);
    const { btFirst: t, btPrevious: r, btNext: n, btLast: a } = this;
    this.activateTabIndex([t, r, n, a]), t.insertAdjacentElement("afterbegin", $s(e ? "last" : "first", this.gos)), r.insertAdjacentElement("afterbegin", $s(e ? "next" : "previous", this.gos)), n.insertAdjacentElement("afterbegin", $s(e ? "previous" : "next", this.gos)), a.insertAdjacentElement("afterbegin", $s(e ? "first" : "last", this.gos)), this.addManagedPropertyListener("pagination", this.onPaginationChanged.bind(this)), this.addManagedPropertyListener("suppressPaginationPanel", this.onPaginationChanged.bind(this)), this.addManagedPropertyListeners(
      ["paginationPageSizeSelector", "paginationAutoPageSize", "suppressPaginationPanel"],
      () => this.onPageSizeRelatedOptionsChange()
    ), this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()), this.initialiseTabGuard({
      // prevent tab guard default logic
      onTabKeyDown: () => {
      },
      focusInnerElement: (u) => {
        this.allowFocusInnerElement ? this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(u) : this.focusService.focusGridInnerElement(u);
      },
      forceFocusOutWhenTabGuardsAreEmpty: !0
    }), this.onPaginationChanged();
  }
  setAllowFocus(e) {
    this.allowFocusInnerElement = e;
  }
  onPaginationChanged() {
    const t = this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel");
    this.setDisplayed(t), t && (this.setupListeners(), this.enableOrDisableButtons(), this.updateLabels(), this.onPageSizeRelatedOptionsChange());
  }
  onPageSizeRelatedOptionsChange() {
    this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector());
  }
  setupListeners() {
    this.areListenersSetup || (this.addManagedEventListeners({ paginationChanged: this.onPaginationChanged.bind(this) }), [
      { el: this.btFirst, fn: this.onBtFirst.bind(this) },
      { el: this.btPrevious, fn: this.onBtPrevious.bind(this) },
      { el: this.btNext, fn: this.onBtNext.bind(this) },
      { el: this.btLast, fn: this.onBtLast.bind(this) }
    ].forEach((e) => {
      const { el: t, fn: r } = e;
      this.addManagedListeners(t, {
        click: r,
        keydown: (n) => {
          (n.key === dr.ENTER || n.key === dr.SPACE) && (n.preventDefault(), r());
        }
      });
    }), DQ(this, this.getGui(), this.focusService), this.areListenersSetup = !0);
  }
  onBtFirst() {
    this.previousAndFirstButtonsDisabled || this.paginationService.goToFirstPage();
  }
  formatNumber(e) {
    const t = this.gos.getCallback("paginationNumberFormatter");
    if (t)
      return t({ value: e });
    const r = this.localeService.getLocaleTextFunc(), n = r("thousandSeparator", ","), a = r("decimalSeparator", ".");
    return wY(e, n, a);
  }
  getTemplate() {
    const e = this.localeService.getLocaleTextFunc(), t = e("page", "Page"), r = e("to", "to"), n = e("of", "of"), a = e("firstPage", "First Page"), u = e("previousPage", "Previous Page"), s = e("nextPage", "Next Page"), c = e("lastPage", "Last Page"), i = this.getCompId();
    return (
      /* html */
      `<div class="ag-paging-panel ag-unselectable" id="ag-${i}">
                <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector>
                <span class="ag-paging-row-summary-panel">
                    <span id="ag-${i}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
                    <span id="ag-${i}-to">${r}</span>
                    <span id="ag-${i}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
                    <span id="ag-${i}-of">${n}</span>
                    <span id="ag-${i}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>
                </span>
                <span class="ag-paging-page-summary-panel" role="presentation">
                    <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>
                    <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${u}"></div>
                    <span class="ag-paging-description">
                        <span id="ag-${i}-start-page">${t}</span>
                        <span id="ag-${i}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span>
                        <span id="ag-${i}-of-page">${n}</span>
                        <span id="ag-${i}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span>
                    </span>
                    <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${s}"></div>
                    <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${c}"></div>
                </span>
            </div>`
    );
  }
  onBtNext() {
    this.nextButtonDisabled || this.paginationService.goToNextPage();
  }
  onBtPrevious() {
    this.previousAndFirstButtonsDisabled || this.paginationService.goToPreviousPage();
  }
  onBtLast() {
    this.lastButtonDisabled || this.paginationService.goToLastPage();
  }
  enableOrDisableButtons() {
    const e = this.paginationService.getCurrentPage(), t = this.rowModel.isLastRowIndexKnown(), r = this.paginationService.getTotalPages();
    this.previousAndFirstButtonsDisabled = e === 0, this.toggleButtonDisabled(this.btFirst, this.previousAndFirstButtonsDisabled), this.toggleButtonDisabled(this.btPrevious, this.previousAndFirstButtonsDisabled);
    const n = this.isZeroPagesToDisplay(), a = e === r - 1;
    this.nextButtonDisabled = a || n, this.lastButtonDisabled = !t || n || e === r - 1, this.toggleButtonDisabled(this.btNext, this.nextButtonDisabled), this.toggleButtonDisabled(this.btLast, this.lastButtonDisabled);
  }
  toggleButtonDisabled(e, t) {
    OU(e, t), e.classList.toggle("ag-disabled", t);
  }
  isZeroPagesToDisplay() {
    const e = this.rowModel.isLastRowIndexKnown(), t = this.paginationService.getTotalPages();
    return e && t === 0;
  }
  updateLabels() {
    const e = this.rowModel.isLastRowIndexKnown(), t = this.paginationService.getTotalPages(), r = this.paginationService.getMasterRowCount(), n = e ? r : null;
    if (n === 1) {
      const w = this.rowModel.getRow(0);
      if (w && w.group && !(w.groupData || w.aggData)) {
        this.setTotalLabelsToZero();
        return;
      }
    }
    const a = this.paginationService.getCurrentPage(), u = this.paginationService.getPageSize();
    let s, c;
    this.isZeroPagesToDisplay() ? s = c = 0 : (s = u * a + 1, c = s + u - 1, e && c > n && (c = n));
    const i = s + u - 1, l = !e && r < i, v = this.formatNumber(s);
    this.lbFirstRowOnPage.textContent = v;
    let f;
    const p = this.localeService.getLocaleTextFunc();
    l ? f = p("pageLastRowUnknown", "?") : f = this.formatNumber(c), this.lbLastRowOnPage.textContent = f;
    const y = t > 0 ? a + 1 : 0, C = this.formatNumber(y);
    this.lbCurrent.textContent = C;
    let m, h;
    if (e)
      m = this.formatNumber(t), h = this.formatNumber(n);
    else {
      const w = p("more", "more");
      m = w, h = w;
    }
    this.lbTotal.textContent = m, this.lbRecordCount.textContent = h, this.announceAriaStatus(v, f, h, C, m);
  }
  announceAriaStatus(e, t, r, n, a) {
    const u = this.localeService.getLocaleTextFunc(), s = u("page", "Page"), c = u("to", "to"), i = u("of", "of"), l = `${e} ${c} ${t} ${i} ${r}`, v = `${s} ${n} ${i} ${a}`;
    l !== this.ariaRowStatus && (this.ariaRowStatus = l, this.ariaAnnouncementService.announceValue(l, "paginationRow")), v !== this.ariaPageStatus && (this.ariaPageStatus = v, this.ariaAnnouncementService.announceValue(v, "paginationPage"));
  }
  setTotalLabelsToZero() {
    const e = this.formatNumber(0);
    this.lbFirstRowOnPage.textContent = e, this.lbCurrent.textContent = e, this.lbLastRowOnPage.textContent = e, this.lbTotal.textContent = e, this.lbRecordCount.textContent = e, this.announceAriaStatus(e, e, e, e, e);
  }
}, LQ = {
  selector: "AG-PAGINATION",
  component: IQ
}, kQ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "paginationService", this.currentPage = 0, this.topDisplayedRowIndex = 0, this.bottomDisplayedRowIndex = 0, this.masterRowCount = 0;
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.pageBoundsService = e.pageBoundsService;
  }
  postConstruct() {
    this.active = this.gos.get("pagination"), this.pageSizeFromGridOptions = this.gos.get("paginationPageSize"), this.paginateChildRows = this.isPaginateChildRows(), this.addManagedPropertyListener("pagination", this.onPaginationGridOptionChanged.bind(this)), this.addManagedPropertyListener("paginationPageSize", this.onPageSizeGridOptionChanged.bind(this));
  }
  getPaginationSelector() {
    return LQ;
  }
  isPaginateChildRows() {
    return this.gos.get("groupRemoveSingleChildren") || this.gos.get("groupRemoveLowestSingleChildren") ? !0 : this.gos.get("paginateChildRows");
  }
  onPaginationGridOptionChanged() {
    this.active = this.gos.get("pagination"), this.calculatePages(), this.dispatchPaginationChangedEvent({ keepRenderedRows: !0 });
  }
  onPageSizeGridOptionChanged() {
    this.setPageSize(this.gos.get("paginationPageSize"), "gridOptions");
  }
  goToPage(e) {
    !this.active || this.currentPage === e || typeof this.currentPage != "number" || (this.currentPage = e, this.calculatePages(), this.dispatchPaginationChangedEvent({ newPage: !0 }));
  }
  isRowPresent(e) {
    return e.rowIndex >= this.topDisplayedRowIndex && e.rowIndex <= this.bottomDisplayedRowIndex;
  }
  getPageForIndex(e) {
    return Math.floor(e / this.pageSize);
  }
  goToPageWithIndex(e) {
    if (!this.active)
      return;
    const t = this.getPageForIndex(e);
    this.goToPage(t);
  }
  isRowInPage(e) {
    return this.active ? this.getPageForIndex(e.rowIndex) === this.currentPage : !0;
  }
  getCurrentPage() {
    return this.currentPage;
  }
  goToNextPage() {
    this.goToPage(this.currentPage + 1);
  }
  goToPreviousPage() {
    this.goToPage(this.currentPage - 1);
  }
  goToFirstPage() {
    this.goToPage(0);
  }
  goToLastPage() {
    const e = this.rowModel.getRowCount(), t = Math.floor(e / this.pageSize);
    this.goToPage(t);
  }
  getPageSize() {
    return this.pageSize;
  }
  getTotalPages() {
    return this.totalPages;
  }
  /** This is only for state setting before data has been loaded */
  setPage(e) {
    this.currentPage = e;
  }
  get pageSize() {
    return $r(this.pageSizeAutoCalculated) && this.gos.get("paginationAutoPageSize") ? this.pageSizeAutoCalculated : $r(this.pageSizeFromPageSizeSelector) ? this.pageSizeFromPageSizeSelector : $r(this.pageSizeFromInitialState) ? this.pageSizeFromInitialState : $r(this.pageSizeFromGridOptions) ? this.pageSizeFromGridOptions : this.defaultPageSize;
  }
  calculatePages() {
    this.active ? this.paginateChildRows ? this.calculatePagesAllRows() : this.calculatePagesMasterRowsOnly() : this.calculatedPagesNotActive(), this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex, this.bottomDisplayedRowIndex);
  }
  unsetAutoCalculatedPageSize() {
    if (this.pageSizeAutoCalculated === void 0)
      return;
    const e = this.pageSizeAutoCalculated;
    this.pageSizeAutoCalculated = void 0, this.pageSize !== e && (this.calculatePages(), this.dispatchPaginationChangedEvent({ newPageSize: !0 }));
  }
  setPageSize(e, t) {
    const r = this.pageSize;
    switch (t) {
      case "autoCalculated":
        this.pageSizeAutoCalculated = e;
        break;
      case "pageSizeSelector":
        this.pageSizeFromPageSizeSelector = e, this.currentPage !== 0 && this.goToFirstPage();
        break;
      case "initialState":
        this.pageSizeFromInitialState = e;
        break;
      case "gridOptions":
        this.pageSizeFromGridOptions = e, this.pageSizeFromInitialState = void 0, this.pageSizeFromPageSizeSelector = void 0, this.currentPage !== 0 && this.goToFirstPage();
        break;
    }
    r !== this.pageSize && (this.calculatePages(), this.dispatchPaginationChangedEvent({ newPageSize: !0, keepRenderedRows: !0 }));
  }
  setZeroRows() {
    this.masterRowCount = 0, this.topDisplayedRowIndex = 0, this.bottomDisplayedRowIndex = -1, this.currentPage = 0, this.totalPages = 0;
  }
  adjustCurrentPageIfInvalid() {
    this.currentPage >= this.totalPages && (this.currentPage = this.totalPages - 1), (!isFinite(this.currentPage) || isNaN(this.currentPage) || this.currentPage < 0) && (this.currentPage = 0);
  }
  calculatePagesMasterRowsOnly() {
    if (this.masterRowCount = this.rowModel.getTopLevelRowCount(), this.masterRowCount <= 0) {
      this.setZeroRows();
      return;
    }
    const e = this.masterRowCount - 1;
    this.totalPages = Math.floor(e / this.pageSize) + 1, this.adjustCurrentPageIfInvalid();
    const t = this.pageSize * this.currentPage;
    let r = this.pageSize * (this.currentPage + 1) - 1;
    if (r > e && (r = e), this.topDisplayedRowIndex = this.rowModel.getTopLevelRowDisplayedIndex(t), r === e)
      this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;
    else {
      const n = this.rowModel.getTopLevelRowDisplayedIndex(r + 1);
      this.bottomDisplayedRowIndex = n - 1;
    }
  }
  getMasterRowCount() {
    return this.masterRowCount;
  }
  calculatePagesAllRows() {
    if (this.masterRowCount = this.rowModel.getRowCount(), this.masterRowCount === 0) {
      this.setZeroRows();
      return;
    }
    const e = this.masterRowCount - 1;
    this.totalPages = Math.floor(e / this.pageSize) + 1, this.adjustCurrentPageIfInvalid(), this.topDisplayedRowIndex = this.pageSize * this.currentPage, this.bottomDisplayedRowIndex = this.pageSize * (this.currentPage + 1) - 1, this.bottomDisplayedRowIndex > e && (this.bottomDisplayedRowIndex = e);
  }
  calculatedPagesNotActive() {
    this.setPageSize(void 0, "autoCalculated"), this.totalPages = 1, this.currentPage = 0, this.topDisplayedRowIndex = 0, this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;
  }
  dispatchPaginationChangedEvent(e) {
    const { keepRenderedRows: t = !1, newPage: r = !1, newPageSize: n = !1 } = e;
    this.eventService.dispatchEvent({
      type: "paginationChanged",
      animate: !1,
      newData: !1,
      newPage: r,
      newPageSize: n,
      keepRenderedRows: t
    });
  }
}, c4 = {
  version: $n,
  moduleName: "@ag-grid-community/pagination-core",
  beans: [kQ, MQ]
}, OQ = {
  version: $n,
  moduleName: "@ag-grid-community/pagination-api",
  dependantModules: [c4],
  apiFunctions: {
    paginationIsLastPageFound: yQ,
    paginationGetPageSize: CQ,
    paginationGetCurrentPage: bQ,
    paginationGetTotalPages: wQ,
    paginationGetRowCount: SQ,
    paginationGoToNextPage: xQ,
    paginationGoToPreviousPage: TQ,
    paginationGoToFirstPage: RQ,
    paginationGoToLastPage: AQ,
    paginationGoToPage: EQ
  }
}, NQ = {
  version: $n,
  moduleName: "@ag-grid-community/pagination",
  dependantModules: [c4, OQ]
}, ms = "clientSide", es = "serverSide", cv = "infinite", GQ = {
  onGroupExpandedOrCollapsed: [ms],
  refreshClientSideRowModel: [ms],
  isRowDataEmpty: [ms],
  forEachLeafNode: [ms],
  forEachNodeAfterFilter: [ms],
  forEachNodeAfterFilterAndSort: [ms],
  resetRowHeights: [ms],
  applyTransaction: [ms],
  applyTransactionAsync: [ms],
  flushAsyncTransactions: [ms],
  getBestCostNodeSelection: [ms],
  getServerSideSelectionState: [es],
  setServerSideSelectionState: [es],
  applyServerSideTransaction: [es],
  applyServerSideTransactionAsync: [es],
  applyServerSideRowData: [es],
  retryServerSideLoads: [es],
  flushServerSideAsyncTransactions: [es],
  refreshServerSide: [es],
  getServerSideGroupLevelState: [es],
  refreshInfiniteCache: [cv],
  purgeInfiniteCache: [cv],
  getInfiniteRowCount: [cv],
  isLastRowIndexKnown: [cv, es],
  expandAll: [ms, es],
  collapseAll: [ms, es],
  onRowHeightChanged: [ms, es],
  setRowCount: [cv, es],
  getCacheBlockState: [cv, es]
}, HQ = {
  getValue: {
    version: "v31.3",
    new: "getCellValue"
  },
  getFirstDisplayedRow: {
    version: "v31.1",
    new: "getFirstDisplayedRowIndex"
  },
  getLastDisplayedRow: {
    version: "v31.1",
    new: "getLastDisplayedRowIndex"
  },
  getModel: {
    version: "v31.1",
    message: "Please use the appropriate grid API methods instead."
  },
  setColumnVisible: {
    version: "v31.1",
    old: "setColumnVisible(key,visible)",
    new: "setColumnsVisible([key],visible)"
  },
  setColumnPinned: {
    version: "v31.1",
    old: "setColumnPinned(key,pinned)",
    new: "setColumnsPinned([key],pinned)"
  },
  moveColumn: {
    version: "v31.1",
    old: "moveColumn(key, toIndex)",
    new: "moveColumns([key], toIndex)"
  },
  setColumnWidth: {
    version: "v31.1",
    old: "setColumnWidth(col, width)",
    new: "setColumnWidths([{key: col, newWidth: width}])"
  },
  autoSizeColumn: {
    version: "v31.1",
    old: "autoSizeColumn(key, skipHeader)",
    new: "autoSizeColumns([key], skipHeader)"
  },
  addAggFunc: {
    version: "v31.1",
    old: "addAggFunc(key, func)",
    new: "addAggFuncs({ key: func })"
  },
  removeValueColumn: {
    version: "v31.1",
    old: "removeValueColumn(colKey)",
    new: "removeValueColumns([colKey])"
  },
  addValueColumn: {
    version: "v31.1",
    old: "addValueColumn(colKey)",
    new: "addValueColumns([colKey])"
  },
  removeRowGroupColumn: {
    version: "v31.1",
    old: "removeRowGroupColumn(colKey)",
    new: "removeRowGroupColumns([colKey])"
  },
  addRowGroupColumn: {
    version: "v31.1",
    old: "addRowGroupColumn(colKey)",
    new: "addRowGroupColumns([colKey])"
  },
  removePivotColumn: {
    version: "v31.1",
    old: "removePivotColumn(colKey)",
    new: "removePivotColumns([colKey])"
  },
  addPivotColumn: {
    version: "v31.1",
    old: "addPivotColumn(colKey)",
    new: "addPivotColumns([colKey])"
  },
  showColumnMenuAfterButtonClick: {
    version: "v31.1",
    message: "Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."
  },
  showColumnMenuAfterMouseClick: {
    version: "v31.1",
    message: "Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."
  },
  getFilterInstance: {
    version: "v31.1",
    message: "'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."
  },
  showLoadingOverlay: {
    version: "v32",
    message: '`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'
  },
  clearRangeSelection: {
    version: "v32.2",
    message: "Use `clearCellSelection` instead."
  },
  getInfiniteRowCount: {
    version: "v32.2",
    old: "getInfiniteRowCount()",
    new: "getDisplayedRowCount()"
  }
};
function BQ(e, t, r) {
  const n = HQ[e];
  if (n) {
    const { version: u, new: s, old: c, message: i } = n, l = c ?? e;
    return (...v) => {
      const f = s ? `Please use ${s} instead. ` : "";
      return Fr(`Since ${u} api.${l} is deprecated. ${f}${i ?? ""}`), t.apply(t, v);
    };
  }
  const a = GQ[e];
  return a ? (...u) => {
    const s = r.rowModel.getType();
    if (!a.includes(s)) {
      Ni(
        `api.${e} can only be called when gridOptions.rowModelType is ${a.join(" or ")}`
      );
      return;
    }
    return t.apply(t, u);
  } : t;
}
var VQ = {
  columnsMenuParams: { version: "31.1", message: "Use `columnChooserParams` instead." },
  suppressMenu: { version: "31.1", message: "Use `suppressHeaderMenuButton` instead." },
  suppressCellFlash: { version: "31.2", message: "Use `enableCellChangeFlash={false}` in the ColDef" },
  checkboxSelection: { version: "32.2", message: "Use `rowSelection.checkboxes` in `GridOptions` instead." },
  headerCheckboxSelection: {
    version: "32.2",
    message: "Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."
  },
  headerCheckboxSelectionFilteredOnly: {
    version: "32.2",
    message: 'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'
  },
  headerCheckboxSelectionCurrentPageOnly: {
    version: "32.2",
    message: 'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'
  },
  showDisabledCheckboxes: {
    version: "32.2",
    message: "Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."
  }
}, $d = (e, t) => (t.rowModelType ?? "clientSide") === "clientSide" ? {
  module: "@ag-grid-enterprise/row-grouping"
  /* RowGroupingModule */
} : null, zQ = {
  // supported on all row models, but need module for client side.
  enableRowGroup: $d,
  rowGroup: $d,
  rowGroupIndex: $d,
  enablePivot: $d,
  enableValue: $d,
  pivot: $d,
  pivotIndex: $d,
  aggFunc: $d,
  cellEditor: (e) => e.cellEditor === "agRichSelect" || e.cellEditor === "agRichSelectCellEditor" ? {
    module: "@ag-grid-enterprise/rich-select"
    /* RichSelectModule */
  } : null,
  menuTabs: (e) => {
    var r;
    const t = ["columnsMenuTab", "generalMenuTab"];
    return (r = e.menuTabs) != null && r.some((n) => t.includes(n)) ? {
      module: "@ag-grid-enterprise/menu"
      /* MenuModule */
    } : null;
  },
  columnsMenuParams: {
    module: [
      "@ag-grid-enterprise/menu",
      "@ag-grid-enterprise/column-tool-panel"
      /* ColumnsToolPanelModule */
    ]
  },
  columnChooserParams: {
    module: [
      "@ag-grid-enterprise/menu",
      "@ag-grid-enterprise/column-tool-panel"
      /* ColumnsToolPanelModule */
    ]
  },
  headerCheckboxSelection: {
    supportedRowModels: ["clientSide", "serverSide"],
    validate: (e, { rowSelection: t }) => t === "multiple" ? null : "headerCheckboxSelection is only supported with rowSelection=multiple"
  },
  headerCheckboxSelectionFilteredOnly: {
    supportedRowModels: ["clientSide"],
    validate: (e, { rowSelection: t }) => t === "multiple" ? null : "headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"
  },
  headerCheckboxSelectionCurrentPageOnly: {
    supportedRowModels: ["clientSide"],
    validate: (e, { rowSelection: t }) => t === "multiple" ? null : "headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"
  },
  children: () => fv
}, WQ = {
  headerName: void 0,
  columnGroupShow: void 0,
  headerClass: void 0,
  toolPanelClass: void 0,
  headerValueGetter: void 0,
  pivotKeys: void 0,
  groupId: void 0,
  colId: void 0,
  sort: void 0,
  initialSort: void 0,
  field: void 0,
  type: void 0,
  cellDataType: void 0,
  tooltipComponent: void 0,
  tooltipField: void 0,
  headerTooltip: void 0,
  cellClass: void 0,
  showRowGroup: void 0,
  filter: void 0,
  initialAggFunc: void 0,
  defaultAggFunc: void 0,
  aggFunc: void 0,
  pinned: void 0,
  initialPinned: void 0,
  chartDataType: void 0,
  cellAriaRole: void 0,
  cellEditorPopupPosition: void 0,
  headerGroupComponent: void 0,
  headerGroupComponentParams: void 0,
  cellStyle: void 0,
  cellRenderer: void 0,
  cellRendererParams: void 0,
  cellEditor: void 0,
  cellEditorParams: void 0,
  filterParams: void 0,
  pivotValueColumn: void 0,
  headerComponent: void 0,
  headerComponentParams: void 0,
  floatingFilterComponent: void 0,
  floatingFilterComponentParams: void 0,
  tooltipComponentParams: void 0,
  refData: void 0,
  columnsMenuParams: void 0,
  columnChooserParams: void 0,
  children: void 0,
  sortingOrder: void 0,
  allowedAggFuncs: void 0,
  menuTabs: void 0,
  pivotTotalColumnIds: void 0,
  cellClassRules: void 0,
  icons: void 0,
  sortIndex: void 0,
  initialSortIndex: void 0,
  flex: void 0,
  initialFlex: void 0,
  width: void 0,
  initialWidth: void 0,
  minWidth: void 0,
  maxWidth: void 0,
  rowGroupIndex: void 0,
  initialRowGroupIndex: void 0,
  pivotIndex: void 0,
  initialPivotIndex: void 0,
  suppressCellFlash: void 0,
  suppressColumnsToolPanel: void 0,
  suppressFiltersToolPanel: void 0,
  openByDefault: void 0,
  marryChildren: void 0,
  suppressStickyLabel: void 0,
  hide: void 0,
  initialHide: void 0,
  rowGroup: void 0,
  initialRowGroup: void 0,
  pivot: void 0,
  initialPivot: void 0,
  checkboxSelection: void 0,
  showDisabledCheckboxes: void 0,
  headerCheckboxSelection: void 0,
  headerCheckboxSelectionFilteredOnly: void 0,
  headerCheckboxSelectionCurrentPageOnly: void 0,
  suppressMenu: void 0,
  suppressHeaderMenuButton: void 0,
  suppressMovable: void 0,
  lockPosition: void 0,
  lockVisible: void 0,
  lockPinned: void 0,
  unSortIcon: void 0,
  suppressSizeToFit: void 0,
  suppressAutoSize: void 0,
  enableRowGroup: void 0,
  enablePivot: void 0,
  enableValue: void 0,
  editable: void 0,
  suppressPaste: void 0,
  suppressNavigable: void 0,
  enableCellChangeFlash: void 0,
  rowDrag: void 0,
  dndSource: void 0,
  autoHeight: void 0,
  wrapText: void 0,
  sortable: void 0,
  resizable: void 0,
  singleClickEdit: void 0,
  floatingFilter: void 0,
  cellEditorPopup: void 0,
  suppressFillHandle: void 0,
  wrapHeaderText: void 0,
  autoHeaderHeight: void 0,
  dndSourceOnRowDrag: void 0,
  valueGetter: void 0,
  valueSetter: void 0,
  filterValueGetter: void 0,
  keyCreator: void 0,
  valueFormatter: void 0,
  valueParser: void 0,
  comparator: void 0,
  equals: void 0,
  pivotComparator: void 0,
  suppressKeyboardEvent: void 0,
  suppressHeaderKeyboardEvent: void 0,
  colSpan: void 0,
  rowSpan: void 0,
  getQuickFilterText: void 0,
  onCellValueChanged: void 0,
  onCellClicked: void 0,
  onCellDoubleClicked: void 0,
  onCellContextMenu: void 0,
  rowDragText: void 0,
  tooltipValueGetter: void 0,
  cellRendererSelector: void 0,
  cellEditorSelector: void 0,
  suppressSpanHeaderHeight: void 0,
  useValueFormatterForExport: void 0,
  useValueParserForImport: void 0,
  mainMenuItems: void 0,
  contextMenuItems: void 0,
  suppressFloatingFilterButton: void 0,
  suppressHeaderFilterButton: void 0,
  suppressHeaderContextMenu: void 0,
  loadingCellRenderer: void 0,
  loadingCellRendererParams: void 0,
  loadingCellRendererSelector: void 0,
  context: void 0
}, _Q = Object.keys(WQ), fv = {
  objectName: "colDef",
  allProperties: _Q,
  docsUrl: "column-properties/",
  deprecations: VQ,
  validations: zQ
}, UQ = () => ({
  advancedFilterModel: { version: "31", message: "Use `initialState.filter.advancedFilterModel` instead." },
  suppressAsyncEvents: { version: "31", message: "Events should be handled asynchronously." },
  cellFadeDelay: { version: "31.1", renamed: "cellFadeDuration" },
  cellFlashDelay: { version: "31.1", renamed: "cellFlashDuration" },
  suppressServerSideInfiniteScroll: { version: "31.1" },
  serverSideSortOnServer: { version: "31.1" },
  serverSideFilterOnServer: { version: "31.1" },
  enableCellChangeFlash: {
    version: "31.2",
    message: "Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."
  },
  groupIncludeFooter: { version: "31.3", message: "Use `groupTotalRow` instead." },
  groupIncludeTotalFooter: { version: "31.3", message: "Use `grandTotalRow` instead." },
  suppressLoadingOverlay: { version: "32", message: "Use `loading`=false instead." },
  enableFillHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." },
  enableRangeHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." },
  enableRangeSelection: { version: "32.2", message: "Use `cellSelection = true` instead." },
  suppressMultiRangeSelection: {
    version: "32.2",
    message: "Use `cellSelection.suppressMultiRanges` instead."
  },
  suppressClearOnFillReduction: {
    version: "32.2",
    message: "Use `cellSelection.handle.suppressClearOnFillReduction` instead."
  },
  fillHandleDirection: { version: "32.2", message: "Use `cellSelection.handle.direction` instead." },
  fillOperation: { version: "32.2", message: "Use `cellSelection.handle.setFillValue` instead." },
  suppressRowClickSelection: {
    version: "32.2",
    message: "Use `rowSelection.enableClickSelection` instead."
  },
  suppressRowDeselection: { version: "32.2", message: "Use `rowSelection.enableClickSelection` instead." },
  rowMultiSelectWithClick: {
    version: "32.2",
    message: "Use `rowSelection.enableSelectionWithoutKeys` instead."
  },
  groupSelectsChildren: {
    version: "32.2",
    message: 'Use `rowSelection.groupSelects = "descendants"` instead.'
  },
  groupSelectsFiltered: {
    version: "32.2",
    message: 'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'
  },
  isRowSelectable: { version: "32.2", message: "Use `selectionOptions.isRowSelectable` instead." },
  suppressCopySingleCellRanges: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." },
  suppressCopyRowsToClipboard: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." },
  onRangeSelectionChanged: { version: "32.2", message: "Use `onCellSelectionChanged` instead." },
  onRangeDeleteStart: { version: "32.2", message: "Use `onCellSelectionDeleteStart` instead." },
  onRangeDeleteEnd: { version: "32.2", message: "Use `onCellSelectionDeleteEnd` instead." },
  suppressBrowserResizeObserver: {
    version: "32.2",
    message: "The grid always uses the browser's ResizeObserver, this grid option has no effect."
  },
  onColumnEverythingChanged: {
    version: "32.2",
    message: "Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."
  }
}), jQ = {
  suppressContextMenu: !1,
  preventDefaultOnContextMenu: !1,
  allowContextMenuWithControlKey: !1,
  suppressMenuHide: !0,
  enableBrowserTooltips: !1,
  tooltipTrigger: "hover",
  tooltipShowDelay: 2e3,
  tooltipHideDelay: 1e4,
  tooltipMouseTrack: !1,
  tooltipShowMode: "standard",
  tooltipInteraction: !1,
  copyHeadersToClipboard: !1,
  copyGroupHeadersToClipboard: !1,
  clipboardDelimiter: "	",
  suppressCopyRowsToClipboard: !1,
  suppressCopySingleCellRanges: !1,
  suppressLastEmptyLineOnPaste: !1,
  suppressClipboardPaste: !1,
  suppressClipboardApi: !1,
  suppressCutToClipboard: !1,
  maintainColumnOrder: !1,
  enableStrictPivotColumnOrder: !1,
  suppressFieldDotNotation: !1,
  allowDragFromColumnsToolPanel: !1,
  suppressMovableColumns: !1,
  suppressColumnMoveAnimation: !1,
  suppressMoveWhenColumnDragging: !1,
  suppressDragLeaveHidesColumns: !1,
  suppressRowGroupHidesColumns: !1,
  suppressAutoSize: !1,
  autoSizePadding: 20,
  skipHeaderOnAutoSize: !1,
  singleClickEdit: !1,
  suppressClickEdit: !1,
  readOnlyEdit: !1,
  stopEditingWhenCellsLoseFocus: !1,
  enterNavigatesVertically: !1,
  enterNavigatesVerticallyAfterEdit: !1,
  enableCellEditingOnBackspace: !1,
  undoRedoCellEditing: !1,
  undoRedoCellEditingLimit: 10,
  suppressCsvExport: !1,
  suppressExcelExport: !1,
  cacheQuickFilter: !1,
  includeHiddenColumnsInQuickFilter: !1,
  excludeChildrenWhenTreeDataFiltering: !1,
  enableAdvancedFilter: !1,
  includeHiddenColumnsInAdvancedFilter: !1,
  enableCharts: !1,
  masterDetail: !1,
  keepDetailRows: !1,
  keepDetailRowsCount: 10,
  detailRowAutoHeight: !1,
  tabIndex: 0,
  rowBuffer: 10,
  valueCache: !1,
  valueCacheNeverExpires: !1,
  enableCellExpressions: !1,
  suppressTouch: !1,
  suppressFocusAfterRefresh: !1,
  suppressAsyncEvents: !1,
  suppressBrowserResizeObserver: !1,
  suppressPropertyNamesCheck: !1,
  suppressChangeDetection: !1,
  debug: !1,
  suppressLoadingOverlay: !1,
  suppressNoRowsOverlay: !1,
  pagination: !1,
  paginationPageSize: 100,
  paginationPageSizeSelector: !0,
  paginationAutoPageSize: !1,
  paginateChildRows: !1,
  suppressPaginationPanel: !1,
  pivotMode: !1,
  pivotPanelShow: "never",
  pivotDefaultExpanded: 0,
  pivotSuppressAutoColumn: !1,
  suppressExpandablePivotGroups: !1,
  functionsReadOnly: !1,
  suppressAggFuncInHeader: !1,
  alwaysAggregateAtRootLevel: !1,
  aggregateOnlyChangedColumns: !1,
  suppressAggFilteredOnly: !1,
  removePivotHeaderRowWhenSingleValueColumn: !1,
  animateRows: !0,
  enableCellChangeFlash: !1,
  cellFlashDelay: 500,
  cellFlashDuration: 500,
  cellFadeDelay: 1e3,
  cellFadeDuration: 1e3,
  allowShowChangeAfterFilter: !1,
  domLayout: "normal",
  ensureDomOrder: !1,
  enableRtl: !1,
  suppressColumnVirtualisation: !1,
  suppressMaxRenderedRowRestriction: !1,
  suppressRowVirtualisation: !1,
  rowDragManaged: !1,
  suppressRowDrag: !1,
  suppressMoveWhenRowDragging: !1,
  rowDragEntireRow: !1,
  rowDragMultiRow: !1,
  embedFullWidthRows: !1,
  groupDisplayType: "singleColumn",
  groupDefaultExpanded: 0,
  groupMaintainOrder: !1,
  groupSelectsChildren: !1,
  groupIncludeTotalFooter: !1,
  groupSuppressBlankHeader: !1,
  groupSelectsFiltered: !1,
  showOpenedGroup: !1,
  groupRemoveSingleChildren: !1,
  groupRemoveLowestSingleChildren: !1,
  groupHideOpenParents: !1,
  groupAllowUnbalanced: !1,
  rowGroupPanelShow: "never",
  suppressMakeColumnVisibleAfterUnGroup: !1,
  treeData: !1,
  rowGroupPanelSuppressSort: !1,
  suppressGroupRowsSticky: !1,
  rowModelType: "clientSide",
  asyncTransactionWaitMillis: 50,
  suppressModelUpdateAfterUpdateTransaction: !1,
  cacheOverflowSize: 1,
  infiniteInitialRowCount: 1,
  serverSideInitialRowCount: 1,
  suppressServerSideInfiniteScroll: !1,
  cacheBlockSize: 100,
  maxBlocksInCache: -1,
  maxConcurrentDatasourceRequests: 2,
  blockLoadDebounceMillis: 0,
  purgeClosedRowNodes: !1,
  serverSideSortAllLevels: !1,
  serverSideOnlyRefreshFilteredGroups: !1,
  serverSideSortOnServer: !1,
  serverSideFilterOnServer: !1,
  serverSidePivotResultFieldSeparator: "_",
  viewportRowModelPageSize: 5,
  viewportRowModelBufferSize: 5,
  alwaysShowHorizontalScroll: !1,
  alwaysShowVerticalScroll: !1,
  debounceVerticalScrollbar: !1,
  suppressHorizontalScroll: !1,
  suppressScrollOnNewData: !1,
  suppressScrollWhenPopupsAreOpen: !1,
  suppressAnimationFrame: !1,
  suppressMiddleClickScrolls: !1,
  suppressPreventDefaultOnMouseWheel: !1,
  rowMultiSelectWithClick: !1,
  suppressRowDeselection: !1,
  suppressRowClickSelection: !1,
  suppressCellFocus: !1,
  suppressHeaderFocus: !1,
  suppressMultiRangeSelection: !1,
  enableCellTextSelection: !1,
  enableRangeSelection: !1,
  enableRangeHandle: !1,
  enableFillHandle: !1,
  fillHandleDirection: "xy",
  suppressClearOnFillReduction: !1,
  accentedSort: !1,
  unSortIcon: !1,
  suppressMultiSort: !1,
  alwaysMultiSort: !1,
  suppressMaintainUnsortedOrder: !1,
  suppressRowHoverHighlight: !1,
  suppressRowTransform: !1,
  columnHoverHighlight: !1,
  deltaSort: !1,
  enableGroupEdit: !1,
  suppressGroupMaintainValueType: !1,
  groupLockGroupColumns: 0,
  serverSideEnableClientSideSort: !1,
  suppressServerSideFullWidthLoadingRow: !1,
  pivotMaxGeneratedColumns: -1,
  columnMenu: "new",
  reactiveCustomComponents: !0,
  suppressSetFilterByDefault: !1
}, YQ = () => ({
  sideBar: {
    module: "@ag-grid-enterprise/side-bar"
    /* SideBarModule */
  },
  statusBar: {
    module: "@ag-grid-enterprise/status-bar"
    /* StatusBarModule */
  },
  enableCharts: {
    module: "@ag-grid-enterprise/charts"
    /* GridChartsModule */
  },
  getMainMenuItems: {
    module: "@ag-grid-enterprise/menu"
    /* MenuModule */
  },
  getContextMenuItems: {
    module: "@ag-grid-enterprise/menu"
    /* MenuModule */
  },
  allowContextMenuWithControlKey: {
    module: "@ag-grid-enterprise/menu"
    /* MenuModule */
  },
  enableAdvancedFilter: {
    module: "@ag-grid-enterprise/advanced-filter"
    /* AdvancedFilterModule */
  },
  treeData: {
    supportedRowModels: ["clientSide", "serverSide"],
    module: "@ag-grid-enterprise/row-grouping",
    validate: (e) => {
      const t = e.rowModelType ?? "clientSide";
      switch (t) {
        case "clientSide": {
          const r = `treeData requires 'getDataPath' in the ${t} row model.`;
          return e.getDataPath ? null : r;
        }
        case "serverSide": {
          const r = `treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;
          return e.isServerSideGroup && e.getServerSideGroupKey ? null : r;
        }
      }
      return null;
    }
  },
  masterDetail: {
    module: "@ag-grid-enterprise/master-detail"
    /* MasterDetailModule */
  },
  enableRangeSelection: {
    module: "@ag-grid-enterprise/range-selection"
    /* RangeSelectionModule */
  },
  enableRangeHandle: {
    dependencies: {
      enableRangeSelection: [!0]
    }
  },
  enableFillHandle: {
    dependencies: {
      enableRangeSelection: [!0]
    }
  },
  groupDefaultExpanded: {
    supportedRowModels: ["clientSide"]
  },
  groupIncludeFooter: {
    supportedRowModels: ["clientSide", "serverSide"],
    validate: (e) => {
      switch (e.rowModelType ?? "clientSide") {
        case "clientSide":
          return null;
        case "serverSide":
          return e.suppressServerSideInfiniteScroll ? "groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll" : null;
      }
      return null;
    }
  },
  groupHideOpenParents: {
    supportedRowModels: ["clientSide", "serverSide"],
    dependencies: {
      groupTotalRow: [void 0, "bottom"]
    }
  },
  groupIncludeTotalFooter: {
    supportedRowModels: ["clientSide"]
  },
  groupRemoveSingleChildren: {
    dependencies: {
      groupHideOpenParents: [void 0, !1],
      groupRemoveLowestSingleChildren: [void 0, !1]
    }
  },
  groupRemoveLowestSingleChildren: {
    dependencies: {
      groupHideOpenParents: [void 0, !1],
      groupRemoveSingleChildren: [void 0, !1]
    }
  },
  groupSelectsChildren: {
    dependencies: {
      rowSelection: ["multiple"]
    }
  },
  viewportDatasource: {
    supportedRowModels: ["viewport"],
    module: "@ag-grid-enterprise/viewport-row-model"
    /* ViewportRowModelModule */
  },
  serverSideDatasource: {
    supportedRowModels: ["serverSide"],
    module: "@ag-grid-enterprise/server-side-row-model"
    /* ServerSideRowModelModule */
  },
  cacheBlockSize: {
    supportedRowModels: ["serverSide", "infinite"]
  },
  datasource: {
    supportedRowModels: ["infinite"],
    module: "@ag-grid-community/infinite-row-model"
    /* InfiniteRowModelModule */
  },
  rowData: {
    supportedRowModels: ["clientSide"],
    module: "@ag-grid-community/client-side-row-model"
    /* ClientSideRowModelModule */
  },
  paginationPageSizeSelector: {
    validate: (e) => {
      const t = e.paginationPageSizeSelector;
      return typeof t == "boolean" || t == null || t.length ? null : `'paginationPageSizeSelector' cannot be an empty array.
                    If you want to hide the page size selector, set paginationPageSizeSelector to false.`;
    }
  },
  rowSelection: {
    validate({ rowSelection: e }) {
      return e && typeof e == "string" ? 'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.' : null;
    }
  },
  cellSelection: {
    module: "@ag-grid-enterprise/range-selection"
    /* RangeSelectionModule */
  },
  columnDefs: () => fv,
  defaultColDef: () => fv,
  defaultColGroupDef: () => fv,
  autoGroupColumnDef: () => fv,
  selectionColumnDef: () => fv
}), XQ = () => ({
  objectName: "gridOptions",
  allProperties: [...zm.ALL_PROPERTIES, ...Wm.EVENT_CALLBACKS],
  propertyExceptions: ["api"],
  docsUrl: "grid-options/",
  deprecations: UQ(),
  validations: YQ()
}), $Q = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "validationService";
  }
  wireBeans(e) {
    this.beans = e, this.gridOptions = e.gridOptions;
  }
  postConstruct() {
    this.processGridOptions(this.gridOptions);
  }
  processGridOptions(e) {
    this.processOptions(e, XQ());
  }
  validateApiFunction(e, t) {
    return BQ(e, t, this.beans);
  }
  processOptions(e, t) {
    const { validations: r, deprecations: n, allProperties: a, propertyExceptions: u, objectName: s, docsUrl: c } = t;
    a && this.gridOptions.suppressPropertyNamesCheck !== !0 && this.checkProperties(
      e,
      [...u ?? [], ...Object.keys(n)],
      a,
      s,
      c
    );
    const i = /* @__PURE__ */ new Set();
    Object.keys(e).forEach((v) => {
      const f = n[v];
      if (f)
        if ("renamed" in f) {
          const { renamed: S, version: E } = f;
          i.add(
            `As of v${E}, ${String(v)} is deprecated. Please use ${String(S)} instead.`
          ), e[S] = e[v];
        } else {
          const { message: S, version: E } = f;
          i.add(`As of v${E}, ${String(v)} is deprecated. ${S ?? ""}`);
        }
      const p = e[v];
      if (p == null || p === !1)
        return;
      const g = r[v];
      let y;
      if (g)
        if (typeof g == "function") {
          const S = g(e, this.gridOptions);
          if (!S)
            return;
          if ("objectName" in S) {
            const E = e[v];
            if (Array.isArray(E)) {
              E.forEach((x) => {
                this.processOptions(x, S);
              });
              return;
            }
            this.processOptions(e[v], S);
            return;
          }
          y = S;
        } else
          y = g;
      else return;
      const { module: C, dependencies: m, validate: h, supportedRowModels: w } = y;
      if (w) {
        const S = this.gridOptions.rowModelType ?? "clientSide";
        if (!w.includes(S)) {
          i.add(`${String(v)} is not supported with the '${S}' row model.`);
          return;
        }
      }
      if (C) {
        const S = Array.isArray(C) ? C : [C];
        let E = !0;
        if (S.forEach((x) => {
          this.gos.assertModuleRegistered(x, String(v)) || (E = !1, i.add(`${String(v)} is only available when ${x} is loaded.`));
        }), !E)
          return;
      }
      if (m) {
        const S = this.checkForRequiredDependencies(v, m, e);
        if (S) {
          i.add(S);
          return;
        }
      }
      if (h) {
        const S = h(e, this.gridOptions);
        if (S) {
          i.add(S);
          return;
        }
      }
    }), i.size > 0 && i.forEach((v) => {
      Fr(v);
    });
  }
  checkForRequiredDependencies(e, t, r) {
    const a = Object.entries(t).find(([c, i]) => {
      const l = r[c];
      return !i.includes(l);
    });
    if (!a)
      return null;
    const [u, s] = a;
    return s.length > 1 ? `'${String(e)}' requires '${u}' to be one of [${s.join(", ")}].` : `'${String(e)}' requires '${u}' to be ${s[0]}.`;
  }
  checkProperties(e, t, r, n, a) {
    const u = ["__ob__", "__v_skip", "__metadata__"], s = xj(
      Object.getOwnPropertyNames(e),
      [...u, ...t, ...r],
      r
    );
    if (fu(s, (c, i) => {
      let l = `invalid ${n} property '${c}' did you mean any of these: ${i.slice(0, 8).join(", ")}.`;
      r.includes("context") && (l += `
If you are trying to annotate ${n} with application data, use the '${n}.context' property instead.`), Fr(l);
    }), Object.keys(s).length > 0 && a) {
      const c = this.getFrameworkOverrides().getDocLink(a);
      Fr(`to see all the valid ${n} properties please check: ${c}`);
    }
  }
}, ZQ = {
  version: $n,
  moduleName: "@ag-grid-community/core"
  /* CommunityCoreModule */
}, KQ = {
  version: $n,
  moduleName: "@ag-grid-community/core-validations",
  beans: [$Q]
}, JQ = {
  version: $n,
  moduleName: "@ag-grid-community/core-community-features",
  dependantModules: [
    ZQ,
    KQ,
    fZ,
    aX,
    mQ,
    _K,
    QZ,
    NQ,
    cQ
  ]
}, QQ = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "gridDestroyService", this.destroyCalled = !1;
  }
  wireBeans(e) {
    this.beans = e;
  }
  destroy() {
    var e, t;
    this.destroyCalled || (this.eventService.dispatchEvent({
      type: "gridPreDestroyed",
      state: ((e = this.beans.stateService) == null ? void 0 : e.getState()) ?? {}
    }), this.destroyCalled = !0, (t = this.beans.ctrlsService.get("gridCtrl")) == null || t.destroyGridUi(), this.beans.context.destroy(), super.destroy());
  }
  isDestroyCalled() {
    return this.destroyCalled;
  }
}, NC = /* @__PURE__ */ new Set(["gridPreDestroyed", "fillStart", "pasteStart"]), qQ = (e) => e === "checkboxSelected" || e === "rowClicked" || e === "spaceKey" || e === "uiSelectAll" || e === "uiSelectAllCurrentPage" || e === "uiSelectAllFiltered", eq = new Map([
  ...zm.BOOLEAN_PROPERTIES.map((e) => [e, oT]),
  ...zm.NUMBER_PROPERTIES.map((e) => [e, Dk]),
  ["groupAggFiltering", (e) => typeof e == "function" ? e : oT(e)],
  ["pageSize", Qu(1)],
  ["autoSizePadding", Qu(0)],
  ["keepDetailRowsCount", Qu(1)],
  ["rowBuffer", Qu(0)],
  ["infiniteInitialRowCount", Qu(1)],
  ["cacheOverflowSize", Qu(1)],
  ["cacheBlockSize", Qu(1)],
  ["serverSideInitialRowCount", Qu(1)],
  ["viewportRowModelPageSize", Qu(1)],
  ["viewportRowModelBufferSize", Qu(0)]
]);
function d4(e, t) {
  const r = eq.get(e);
  return r ? r(t) : t;
}
function tq(e) {
  const t = {};
  return Object.entries(e).forEach(([r, n]) => {
    const a = d4(r, n);
    t[r] = a;
  }), t;
}
var f4 = class h4 extends mr {
  constructor() {
    super(...arguments), this.beanName = "gos", this.domDataKey = "__AG_" + Math.random().toString(), this.propertyEventService = new Gv(), this.globalEventHandlerFactory = (t) => (r, n) => {
      if (!this.isAlive())
        return;
      const a = NC.has(r);
      if (a && !t || !a && t)
        return;
      const u = Wm.getCallbackForEvent(r), s = this.gridOptions[u];
      typeof s == "function" && this.frameworkOverrides.wrapOutgoing(() => {
        s(n);
      });
    };
  }
  wireBeans(t) {
    this.gridOptions = t.gridOptions, this.eGridDiv = t.eGridDiv, this.validationService = t.validationService, this.environment = t.environment, this.api = t.gridApi, this.gridId = t.context.getGridId();
  }
  // This is quicker then having code call gridOptionsService.get('context')
  get gridOptionsContext() {
    return this.gridOptions.context;
  }
  postConstruct() {
    const t = !this.get("suppressAsyncEvents");
    this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this), t), this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this), !1), this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides), this.addManagedEventListeners({
      gridOptionsChanged: ({ options: r }) => {
        this.updateGridOptions({ options: r, force: !0, source: "gridOptionsUpdated" });
      }
    });
  }
  /**
   * Get the raw value of the GridOptions property provided.
   * @param property
   */
  get(t) {
    return this.gridOptions[t] ?? jQ[t];
  }
  /**
   * Get the GridOption callback but wrapped so that the common params of api and context are automatically applied to the params.
   * @param property GridOption callback properties based on the fact that this property has a callback with params extending AgGridCommon
   */
  getCallback(t) {
    return this.mergeGridCommonParams(this.gridOptions[t]);
  }
  /**
   * Returns `true` if a value has been specified for this GridOption.
   * @param property GridOption property
   */
  exists(t) {
    return $r(this.gridOptions[t]);
  }
  /**
   * Wrap the user callback and attach the api and context to the params object on the way through.
   * @param callback User provided callback
   * @returns Wrapped callback where the params object not require api and context
   */
  mergeGridCommonParams(t) {
    return t && ((n) => {
      const a = n;
      return a.api = this.api, a.context = this.gridOptionsContext, t(a);
    });
  }
  updateGridOptions({
    options: t,
    force: r,
    source: n = "api"
  }) {
    var s;
    const a = { id: h4.changeSetId++, properties: [] }, u = [];
    Object.entries(t).forEach(([c, i]) => {
      n === "api" && MU[c] && Fr(`${c} is an initial property and cannot be updated.`);
      const l = d4(c, i), v = r || typeof l == "object" && n === "api", f = this.gridOptions[c];
      if (v || f !== l) {
        this.gridOptions[c] = l;
        const p = {
          type: c,
          currentValue: l,
          previousValue: f,
          changeSet: a,
          source: n
        };
        u.push(p);
      }
    }), (s = this.validationService) == null || s.processGridOptions(this.gridOptions), a.properties = u.map((c) => c.type), u.forEach((c) => {
      this.gridOptions.debug && ef(`Updated property ${c.type} from`, c.previousValue, " to ", c.currentValue), this.propertyEventService.dispatchEvent(c);
    });
  }
  addPropertyEventListener(t, r) {
    this.propertyEventService.addEventListener(t, r);
  }
  removePropertyEventListener(t, r) {
    this.propertyEventService.removeEventListener(t, r);
  }
  getDomDataKey() {
    return this.domDataKey;
  }
  getGridCommonParams() {
    return {
      api: this.api,
      context: this.gridOptionsContext
    };
  }
  addGridCommonParams(t) {
    const r = t;
    return r.api = this.api, r.context = this.gridOptionsContext, r;
  }
  assertModuleRegistered(t, r) {
    return tc.__assertRegistered(t, r, this.gridId);
  }
  isModuleRegistered(t) {
    return tc.__isRegistered(t, this.gridId);
  }
};
f4.changeSetId = 0;
var rq = f4, nq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "headerPositionUtils";
  }
  wireBeans(e) {
    this.visibleColsService = e.visibleColsService, this.ctrlsService = e.ctrlsService;
  }
  findHeader(e, t) {
    let r, n;
    if (Ba(e.column) ? r = this.visibleColsService.getGroupAtDirection(e.column, t) : (n = `getCol${t}`, r = this.visibleColsService[n](e.column)), !r)
      return;
    const { headerRowIndex: a } = e;
    if (this.getHeaderRowType(a) !== "filter") {
      const c = [r];
      for (; r.getParent(); )
        r = r.getParent(), c.push(r);
      r = c[c.length - 1 - a];
    }
    const { column: u, headerRowIndex: s } = this.getHeaderIndexToFocus(r, a);
    return {
      column: u,
      headerRowIndex: s
    };
  }
  getHeaderIndexToFocus(e, t) {
    let r;
    if (Ba(e) && this.isAnyChildSpanningHeaderHeight(e) && e.isPadding()) {
      const n = e;
      r = n.getLeafColumns()[0];
      let a = r;
      for (; a !== n; )
        t++, a = a.getParent();
    }
    return {
      column: r || e,
      headerRowIndex: t
    };
  }
  isAnyChildSpanningHeaderHeight(e) {
    return e ? e.getLeafColumns().some((t) => t.isSpanHeaderHeight()) : !1;
  }
  getColumnVisibleParent(e, t) {
    const r = this.getHeaderRowType(t), n = r === "filter", a = r === "column";
    let u = n ? e : e.getParent(), s = t - 1, c = s;
    if (a && this.isAnyChildSpanningHeaderHeight(e.getParent())) {
      for (; u && u.isPadding(); )
        u = u.getParent(), s--;
      c = s, s < 0 && (u = e, s = t, c = void 0);
    }
    return { column: u, headerRowIndex: s, headerRowIndexWithoutSpan: c };
  }
  getColumnVisibleChild(e, t, r = "After") {
    const n = this.getHeaderRowType(t);
    let a = e, u = t + 1;
    const s = u;
    if (n === "group") {
      const c = e.getDisplayedLeafColumns(), i = r === "After" ? c[0] : di(c), l = [];
      let v = i;
      for (; v.getParent() !== e; )
        v = v.getParent(), l.push(v);
      if (a = i, i.isSpanHeaderHeight())
        for (let f = l.length - 1; f >= 0; f--) {
          const p = l[f];
          if (!p.isPadding()) {
            a = p;
            break;
          }
          u++;
        }
      else
        a = di(l), a || (a = i);
    }
    return { column: a, headerRowIndex: u, headerRowIndexWithoutSpan: s };
  }
  getHeaderRowType(e) {
    const t = this.ctrlsService.getHeaderRowContainerCtrl();
    if (t)
      return t.getRowType(e);
  }
  findColAtEdgeForHeaderRow(e, t) {
    const r = this.visibleColsService.getAllCols(), n = r[t === "start" ? 0 : r.length - 1];
    if (!n)
      return;
    const a = this.ctrlsService.getHeaderRowContainerCtrl(n.getPinned()), u = a == null ? void 0 : a.getRowType(e);
    if (u == "group") {
      const s = this.visibleColsService.getColGroupAtLevel(n, e);
      return {
        headerRowIndex: e,
        column: s
      };
    }
    return {
      // if type==null, means the header level didn't exist
      headerRowIndex: u == null ? -1 : e,
      column: n
    };
  }
}, iq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "localeService";
  }
  getLocaleTextFunc() {
    const e = this.gos.getCallback("getLocaleText");
    if (e)
      return (r, n, a) => e({
        key: r,
        defaultValue: n,
        variableValues: a
      });
    const t = this.gos.get("localeText");
    return (r, n, a) => {
      let u = t && t[r];
      if (u && a && a.length) {
        let s = 0;
        for (; !(s >= a.length || u.indexOf("${variable}") === -1); )
          u = u.replace("${variable}", a[s++]);
      }
      return u ?? n;
    };
  }
}, aq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "apiEventService", this.syncEventListeners = /* @__PURE__ */ new Map(), this.asyncEventListeners = /* @__PURE__ */ new Map(), this.syncGlobalEventListeners = /* @__PURE__ */ new Set(), this.globalEventListenerPairs = /* @__PURE__ */ new Map();
  }
  postConstruct() {
    this.frameworkEventWrappingService = new G2(this.getFrameworkOverrides());
  }
  addEventListener(e, t) {
    const r = this.frameworkEventWrappingService.wrap(t), n = c1(this.gos) && !NC.has(e), a = n ? this.asyncEventListeners : this.syncEventListeners;
    a.has(e) || a.set(e, /* @__PURE__ */ new Set()), a.get(e).add(r), this.eventService.addEventListener(e, r, n);
  }
  removeEventListener(e, t) {
    var u;
    const r = this.frameworkEventWrappingService.unwrap(t), n = this.asyncEventListeners.get(e), a = !!(n != null && n.delete(r));
    a || (u = this.syncEventListeners.get(e)) == null || u.delete(r), this.eventService.removeEventListener(e, r, a);
  }
  addGlobalListener(e) {
    const t = this.frameworkEventWrappingService.wrapGlobal(e);
    if (c1(this.gos)) {
      const n = (u, s) => {
        NC.has(u) && t(u, s);
      }, a = (u, s) => {
        NC.has(u) || t(u, s);
      };
      this.globalEventListenerPairs.set(e, { syncListener: n, asyncListener: a }), this.eventService.addGlobalListener(n, !1), this.eventService.addGlobalListener(a, !0);
    } else
      this.syncGlobalEventListeners.add(t), this.eventService.addGlobalListener(t, !1);
  }
  removeGlobalListener(e) {
    const t = this.frameworkEventWrappingService.unwrapGlobal(e);
    if (this.globalEventListenerPairs.has(t)) {
      const { syncListener: n, asyncListener: a } = this.globalEventListenerPairs.get(t);
      this.eventService.removeGlobalListener(n, !1), this.eventService.removeGlobalListener(a, !0), this.globalEventListenerPairs.delete(e);
    } else
      this.syncGlobalEventListeners.delete(t), this.eventService.removeGlobalListener(t, !1);
  }
  destroyEventListeners(e, t) {
    e.forEach((r, n) => {
      r.forEach((a) => this.eventService.removeEventListener(n, a, t)), r.clear();
    }), e.clear();
  }
  destroyGlobalListeners(e, t) {
    e.forEach((r) => this.eventService.removeGlobalListener(r, t)), e.clear();
  }
  destroy() {
    super.destroy(), this.destroyEventListeners(this.syncEventListeners, !1), this.destroyEventListeners(this.asyncEventListeners, !0), this.destroyGlobalListeners(this.syncGlobalEventListeners, !1), this.globalEventListenerPairs.forEach(({ syncListener: e, asyncListener: t }) => {
      this.eventService.removeGlobalListener(e, !1), this.eventService.removeGlobalListener(t, !0);
    }), this.globalEventListenerPairs.clear();
  }
}, oq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "pageBoundsListener";
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.paginationService = e.paginationService, this.pageBoundsService = e.pageBoundsService;
  }
  postConstruct() {
    this.addManagedEventListeners({
      modelUpdated: this.onModelUpdated.bind(this),
      recalculateRowBounds: this.calculatePages.bind(this)
    }), this.onModelUpdated();
  }
  onModelUpdated(e) {
    this.calculatePages(), this.eventService.dispatchEvent({
      type: "paginationChanged",
      animate: (e == null ? void 0 : e.animate) ?? !1,
      newData: (e == null ? void 0 : e.newData) ?? !1,
      newPage: (e == null ? void 0 : e.newPage) ?? !1,
      newPageSize: (e == null ? void 0 : e.newPageSize) ?? !1,
      keepRenderedRows: (e == null ? void 0 : e.keepRenderedRows) ?? !1
    });
  }
  calculatePages() {
    this.paginationService ? this.paginationService.calculatePages() : this.pageBoundsService.calculateBounds(0, this.rowModel.getRowCount() - 1);
  }
}, sq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "pageBoundsService", this.pixelOffset = 0;
  }
  wireBeans(e) {
    this.rowModel = e.rowModel;
  }
  getFirstRow() {
    return this.topRowBounds ? this.topRowBounds.rowIndex : -1;
  }
  getLastRow() {
    return this.bottomRowBounds ? this.bottomRowBounds.rowIndex : -1;
  }
  getCurrentPageHeight() {
    return mi(this.topRowBounds) || mi(this.bottomRowBounds) ? 0 : Math.max(this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight - this.topRowBounds.rowTop, 0);
  }
  getCurrentPagePixelRange() {
    const e = this.topRowBounds ? this.topRowBounds.rowTop : 0, t = this.bottomRowBounds ? this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight : 0;
    return { pageFirstPixel: e, pageLastPixel: t };
  }
  calculateBounds(e, t) {
    this.topRowBounds = this.rowModel.getRowBounds(e), this.topRowBounds && (this.topRowBounds.rowIndex = e), this.bottomRowBounds = this.rowModel.getRowBounds(t), this.bottomRowBounds && (this.bottomRowBounds.rowIndex = t), this.calculatePixelOffset();
  }
  getPixelOffset() {
    return this.pixelOffset;
  }
  calculatePixelOffset() {
    const e = $r(this.topRowBounds) ? this.topRowBounds.rowTop : 0;
    this.pixelOffset !== e && (this.pixelOffset = e, this.eventService.dispatchEvent({ type: "paginationPixelOffsetChanged" }));
  }
}, lq = class extends mr {
  constructor() {
    super(), this.beanName = "ariaAnnouncementService", this.descriptionContainer = null, this.pendingAnnouncements = /* @__PURE__ */ new Map(), this.updateAnnouncement = Cs(this.updateAnnouncement.bind(this), 200);
  }
  wireBeans(e) {
    this.eGridDiv = e.eGridDiv;
  }
  postConstruct() {
    const e = Va(this.gos), t = this.descriptionContainer = e.createElement("div");
    t.classList.add("ag-aria-description-container"), $L(t, "polite"), kU(t, "additions text"), LU(t, !0), this.eGridDiv.appendChild(t);
  }
  /**
   * @param key used for debouncing calls
   */
  announceValue(e, t) {
    this.pendingAnnouncements.set(t, e), this.updateAnnouncement();
  }
  updateAnnouncement() {
    if (!this.descriptionContainer)
      return;
    const e = Array.from(this.pendingAnnouncements.values()).join(". ");
    this.pendingAnnouncements.clear(), this.descriptionContainer.textContent = "", setTimeout(() => {
      this.isAlive() && this.descriptionContainer && (this.descriptionContainer.textContent = e);
    }, 50);
  }
  destroy() {
    super.destroy();
    const { descriptionContainer: e } = this;
    e && (Qs(e), e.parentElement && e.parentElement.removeChild(e)), this.descriptionContainer = null, this.eGridDiv = null, this.pendingAnnouncements.clear();
  }
}, uq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnAnimationService", this.executeNextFuncs = [], this.executeLaterFuncs = [], this.active = !1, this.activeNext = !1, this.suppressAnimation = !1, this.animationThreadCount = 0;
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService;
  }
  postConstruct() {
    this.ctrlsService.whenReady(this, (e) => this.gridBodyCtrl = e.gridBodyCtrl);
  }
  isActive() {
    return this.active && !this.suppressAnimation;
  }
  setSuppressAnimation(e) {
    this.suppressAnimation = e;
  }
  start() {
    this.active || this.gos.get("suppressColumnMoveAnimation") || this.gos.get("enableRtl") || (this.ensureAnimationCssClassPresent(), this.active = !0, this.activeNext = !0);
  }
  finish() {
    this.active && this.flush(
      () => this.activeNext = !1,
      () => this.active = !1
    );
  }
  executeNextVMTurn(e) {
    this.activeNext ? this.executeNextFuncs.push(e) : e();
  }
  executeLaterVMTurn(e) {
    this.active ? this.executeLaterFuncs.push(e) : e();
  }
  ensureAnimationCssClassPresent() {
    this.animationThreadCount++;
    const e = this.animationThreadCount;
    this.gridBodyCtrl.setColumnMovingCss(!0), this.executeLaterFuncs.push(() => {
      this.animationThreadCount === e && this.gridBodyCtrl.setColumnMovingCss(!1);
    });
  }
  flush(e, t) {
    if (this.executeNextFuncs.length === 0 && this.executeLaterFuncs.length === 0) {
      e(), t();
      return;
    }
    const r = (n) => {
      for (; n.length; ) {
        const a = n.pop();
        a && a();
      }
    };
    this.getFrameworkOverrides().wrapIncoming(() => {
      window.setTimeout(() => {
        e(), r(this.executeNextFuncs);
      }, 0), window.setTimeout(() => {
        t(), r(this.executeLaterFuncs);
      }, 200);
    });
  }
}, cq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "columnHoverService";
  }
  setMouseOver(e) {
    this.updateState(e);
  }
  clearMouseOver() {
    this.updateState(null);
  }
  isHovered(e) {
    return !!this.selectedColumns && this.selectedColumns.indexOf(e) >= 0;
  }
  updateState(e) {
    this.selectedColumns = e, this.eventService.dispatchEvent({
      type: "columnHoverChanged"
    });
  }
}, dq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "overlayService", this.state = 0, this.showInitialOverlay = !0, this.wrapperPadding = 0;
  }
  wireBeans(e) {
    this.userComponentFactory = e.userComponentFactory, this.rowModel = e.rowModel, this.columnModel = e.columnModel, this.ctrlsService = e.ctrlsService;
  }
  postConstruct() {
    this.isClientSide = da(this.gos);
    const e = () => this.updateOverlayVisibility();
    this.addManagedEventListeners({
      newColumnsLoaded: e,
      rowDataUpdated: e,
      gridSizeChanged: this.onGridSizeChanged.bind(this),
      rowCountReady: () => {
        this.showInitialOverlay = !1, this.updateOverlayVisibility();
      }
    }), this.addManagedPropertyListener("loading", e);
  }
  setOverlayWrapperComp(e) {
    this.overlayWrapperComp = e, this.updateOverlayVisibility();
  }
  /** Returns true if the overlay is visible. */
  isVisible() {
    return this.state !== 0 && !!this.overlayWrapperComp;
  }
  /** Returns true if the overlay is visible and is exclusive (popup over the grid) */
  isExclusive() {
    return this.state === 1 && !!this.overlayWrapperComp;
  }
  /** Gets the overlay wrapper component */
  getOverlayWrapper() {
    return this.overlayWrapperComp;
  }
  showLoadingOverlay() {
    this.showInitialOverlay = !1;
    const e = this.gos.get("loading");
    !e && (e !== void 0 || this.gos.get("suppressLoadingOverlay")) || this.doShowLoadingOverlay();
  }
  showNoRowsOverlay() {
    this.showInitialOverlay = !1, !(this.gos.get("loading") || this.gos.get("suppressNoRowsOverlay")) && this.doShowNoRowsOverlay();
  }
  hideOverlay() {
    if (this.showInitialOverlay = !1, this.gos.get("loading")) {
      Fr(
        "Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead."
      );
      return;
    }
    this.doHideOverlay();
  }
  updateOverlayVisibility() {
    if (!this.overlayWrapperComp) {
      this.state = 0;
      return;
    }
    let e = this.gos.get("loading");
    this.showInitialOverlay && e === void 0 && !this.gos.get("suppressLoadingOverlay") && (e = !this.gos.get("columnDefs") || !this.columnModel.isReady() || !this.gos.get("rowData") && this.isClientSide), e ? this.state !== 1 && this.doShowLoadingOverlay() : (this.showInitialOverlay = !1, this.rowModel.isEmpty() && !this.gos.get("suppressNoRowsOverlay") && this.isClientSide ? this.state !== 2 && this.doShowNoRowsOverlay() : this.state !== 0 && this.doHideOverlay());
  }
  doShowLoadingOverlay() {
    this.overlayWrapperComp && (this.state = 1, this.showOverlay(
      this.userComponentFactory.getLoadingOverlayCompDetails({}),
      "ag-overlay-loading-wrapper",
      "loadingOverlayComponentParams"
    ), this.updateExclusive());
  }
  doShowNoRowsOverlay() {
    this.overlayWrapperComp && (this.state = 2, this.showOverlay(
      this.userComponentFactory.getNoRowsOverlayCompDetails({}),
      "ag-overlay-no-rows-wrapper",
      "noRowsOverlayComponentParams"
    ), this.updateExclusive());
  }
  doHideOverlay() {
    this.overlayWrapperComp && (this.state = 0, this.overlayWrapperComp.hideOverlay(), this.updateExclusive());
  }
  showOverlay(e, t, r) {
    var a;
    const n = e.newAgStackInstance();
    (a = this.overlayWrapperComp) == null || a.showOverlay(n, t, this.isExclusive(), r), this.refreshWrapperPadding();
  }
  updateExclusive() {
    const e = this.exclusive;
    this.exclusive = this.isExclusive(), this.exclusive !== e && this.eventService.dispatchEvent({
      type: "overlayExclusiveChanged"
    });
  }
  onGridSizeChanged() {
    this.refreshWrapperPadding();
  }
  refreshWrapperPadding() {
    if (!this.overlayWrapperComp)
      return;
    let e = 0;
    if (this.state === 2) {
      const t = this.ctrlsService.get("gridHeaderCtrl");
      e = (t == null ? void 0 : t.getHeaderHeight()) || 0;
    } else this.wrapperPadding !== 0 && (e = 0);
    this.wrapperPadding !== e && (this.wrapperPadding = e, this.overlayWrapperComp.updateOverlayWrapperPaddingTop(e));
  }
}, fq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowCssClassCalculator";
  }
  wireBeans(e) {
    this.stylingService = e.stylingService;
  }
  getInitialRowClasses(e) {
    const t = [];
    return $r(e.extraCssClass) && t.push(e.extraCssClass), t.push("ag-row"), t.push(e.rowFocused ? "ag-row-focus" : "ag-row-no-focus"), e.fadeRowIn && t.push("ag-opacity-zero"), t.push(e.rowIsEven ? "ag-row-even" : "ag-row-odd"), e.rowNode.isRowPinned() && t.push("ag-row-pinned"), e.rowNode.isSelected() && t.push("ag-row-selected"), e.rowNode.footer && t.push("ag-row-footer"), t.push("ag-row-level-" + e.rowLevel), e.rowNode.stub && t.push("ag-row-loading"), e.fullWidthRow && t.push("ag-full-width-row"), e.expandable && (t.push("ag-row-group"), t.push(e.rowNode.expanded ? "ag-row-group-expanded" : "ag-row-group-contracted")), e.rowNode.dragging && t.push("ag-row-dragging"), J3(t, this.processClassesFromGridOptions(e.rowNode)), J3(t, this.preProcessRowClassRules(e.rowNode)), t.push(e.printLayout ? "ag-row-position-relative" : "ag-row-position-absolute"), e.firstRowOnPage && t.push("ag-row-first"), e.lastRowOnPage && t.push("ag-row-last"), e.fullWidthRow && (e.pinned === "left" && t.push("ag-cell-last-left-pinned"), e.pinned === "right" && t.push("ag-cell-first-right-pinned")), t;
  }
  processClassesFromGridOptions(e) {
    const t = [], r = (u) => {
      typeof u == "string" ? t.push(u) : Array.isArray(u) && u.forEach((s) => t.push(s));
    }, n = this.gos.get("rowClass");
    if (n) {
      if (typeof n == "function")
        return Fr("rowClass should not be a function, please use getRowClass instead"), [];
      r(n);
    }
    const a = this.gos.getCallback("getRowClass");
    if (a) {
      const u = {
        data: e.data,
        node: e,
        rowIndex: e.rowIndex
      }, s = a(u);
      r(s);
    }
    return t;
  }
  preProcessRowClassRules(e) {
    const t = [];
    return this.processRowClassRules(
      e,
      (r) => {
        t.push(r);
      },
      () => {
      }
    ), t;
  }
  processRowClassRules(e, t, r) {
    const n = this.gos.addGridCommonParams({
      data: e.data,
      node: e,
      rowIndex: e.rowIndex
    });
    this.stylingService.processClassRules(
      void 0,
      this.gos.get("rowClassRules"),
      n,
      t,
      r
    );
  }
  calculateRowLevel(e) {
    return e.group ? e.level : e.parent ? e.parent.level + 1 : 0;
  }
}, hq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowContainerHeightService", this.scrollY = 0, this.uiBodyHeight = 0;
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService;
  }
  postConstruct() {
    this.addManagedEventListeners({ bodyHeightChanged: this.updateOffset.bind(this) }), this.maxDivHeight = jU(), this.gos.get("debug") && ef("RowContainerHeightService - maxDivHeight = " + this.maxDivHeight);
  }
  isStretching() {
    return this.stretching;
  }
  getDivStretchOffset() {
    return this.divStretchOffset;
  }
  updateOffset() {
    if (!this.stretching)
      return;
    const t = this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top, r = this.getUiBodyHeight();
    (t !== this.scrollY || r !== this.uiBodyHeight) && (this.scrollY = t, this.uiBodyHeight = r, this.calculateOffset());
  }
  calculateOffset() {
    this.setUiContainerHeight(this.maxDivHeight), this.pixelsToShave = this.modelHeight - this.uiContainerHeight, this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight;
    const e = this.scrollY / this.maxScrollY, t = e * this.pixelsToShave;
    this.gos.get("debug") && ef(
      `RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`
    ), this.setDivStretchOffset(t);
  }
  setUiContainerHeight(e) {
    e !== this.uiContainerHeight && (this.uiContainerHeight = e, this.eventService.dispatchEvent({ type: "rowContainerHeightChanged" }));
  }
  clearOffset() {
    this.setUiContainerHeight(this.modelHeight), this.pixelsToShave = 0, this.setDivStretchOffset(0);
  }
  setDivStretchOffset(e) {
    const t = typeof e == "number" ? Math.floor(e) : null;
    this.divStretchOffset !== t && (this.divStretchOffset = t, this.eventService.dispatchEvent({ type: "heightScaleChanged" }));
  }
  setModelHeight(e) {
    this.modelHeight = e, this.stretching = e != null && // null happens when in print layout
    this.maxDivHeight > 0 && e > this.maxDivHeight, this.stretching ? this.calculateOffset() : this.clearOffset();
  }
  getUiContainerHeight() {
    return this.uiContainerHeight;
  }
  getRealPixelPosition(e) {
    return e - this.divStretchOffset;
  }
  getUiBodyHeight() {
    const t = this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();
    return t.bottom - t.top;
  }
  getScrollPositionForPixel(e) {
    if (this.pixelsToShave <= 0)
      return e;
    const t = this.modelHeight - this.getUiBodyHeight(), r = e / t;
    return this.maxScrollY * r;
  }
}, pq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowNodeSorter";
  }
  wireBeans(e) {
    this.valueService = e.valueService, this.columnModel = e.columnModel, this.showRowGroupColsService = e.showRowGroupColsService;
  }
  postConstruct() {
    this.isAccentedSort = this.gos.get("accentedSort"), this.primaryColumnsSortGroups = ec(this.gos), this.addManagedPropertyListener(
      "accentedSort",
      (e) => this.isAccentedSort = e.currentValue
    ), this.addManagedPropertyListener(
      "autoGroupColumnDef",
      () => this.primaryColumnsSortGroups = ec(this.gos)
    );
  }
  doFullSort(e, t) {
    const r = (a, u) => ({ currentPos: u, rowNode: a }), n = e.map(r);
    return n.sort(this.compareRowNodes.bind(this, t)), n.map((a) => a.rowNode);
  }
  compareRowNodes(e, t, r) {
    const n = t.rowNode, a = r.rowNode;
    for (let u = 0, s = e.length; u < s; u++) {
      const c = e[u], i = c.sort === "desc", l = this.getValue(n, c.column), v = this.getValue(a, c.column);
      let f;
      const p = this.getComparator(c, n);
      if (p ? f = p(l, v, n, a, i) : f = W_(l, v, this.isAccentedSort), !isNaN(f) && f !== 0)
        return c.sort === "asc" ? f : f * -1;
    }
    return t.currentPos - r.currentPos;
  }
  getComparator(e, t) {
    const r = e.column, n = r.getColDef().comparator;
    if (n != null)
      return n;
    if (!r.getColDef().showRowGroup)
      return;
    const a = !t.group && r.getColDef().field;
    if (!a)
      return;
    const u = this.columnModel.getColDefCol(a);
    if (u)
      return u.getColDef().comparator;
  }
  getValue(e, t) {
    var n, a, u;
    if (!this.primaryColumnsSortGroups)
      return this.valueService.getValue(t, e, !1, !1);
    if (e.rowGroupColumn === t) {
      if (j1(this.gos, this.columnModel.isPivotActive())) {
        const i = (n = e.allLeafChildren) == null ? void 0 : n[0];
        return i ? this.valueService.getValue(t, i, !1, !1) : void 0;
      }
      const c = (a = this.showRowGroupColsService) == null ? void 0 : a.getShowRowGroupCol(t.getId());
      return c ? (u = e.groupData) == null ? void 0 : u[c.getId()] : void 0;
    }
    if (!(e.group && t.getColDef().showRowGroup))
      return this.valueService.getValue(t, e, !1, !1);
  }
}, J1 = class {
  constructor(e, t) {
    this.active = !0, this.nodeIdsToColumns = {}, this.mapToItems = {}, this.keepingColumns = e, this.pathRoot = {
      rowNode: t,
      children: null
    }, this.mapToItems[t.id] = this.pathRoot;
  }
  // can be set inactive by:
  // a) ClientSideRowModel, if no transactions or
  // b) PivotService, if secondary columns changed
  setInactive() {
    this.active = !1;
  }
  isActive() {
    return this.active;
  }
  depthFirstSearchChangedPath(e, t) {
    if (e.children)
      for (let r = 0; r < e.children.length; r++)
        this.depthFirstSearchChangedPath(e.children[r], t);
    t(e.rowNode);
  }
  depthFirstSearchEverything(e, t, r) {
    if (e.childrenAfterGroup)
      for (let n = 0; n < e.childrenAfterGroup.length; n++) {
        const a = e.childrenAfterGroup[n];
        a.childrenAfterGroup ? this.depthFirstSearchEverything(e.childrenAfterGroup[n], t, r) : r && t(a);
      }
    t(e);
  }
  // traverseLeafNodes -> used when NOT doing changed path, ie traversing everything. the callback
  // will be called for child nodes in addition to parent nodes.
  forEachChangedNodeDepthFirst(e, t = !1, r = !1) {
    this.active && !r ? this.depthFirstSearchChangedPath(this.pathRoot, e) : this.depthFirstSearchEverything(this.pathRoot.rowNode, e, t);
  }
  executeFromRootNode(e) {
    e(this.pathRoot.rowNode);
  }
  createPathItems(e) {
    let t = e, r = 0;
    for (; !this.mapToItems[t.id]; ) {
      const n = {
        rowNode: t,
        children: null
      };
      this.mapToItems[t.id] = n, r++, t = t.parent;
    }
    return r;
  }
  populateColumnsMap(e, t) {
    if (!this.keepingColumns || !t)
      return;
    let r = e;
    for (; r; )
      this.nodeIdsToColumns[r.id] || (this.nodeIdsToColumns[r.id] = {}), t.forEach((n) => this.nodeIdsToColumns[r.id][n.getId()] = !0), r = r.parent;
  }
  linkPathItems(e, t) {
    let r = e;
    for (let n = 0; n < t; n++) {
      const a = this.mapToItems[r.id], u = this.mapToItems[r.parent.id];
      u.children || (u.children = []), u.children.push(a), r = r.parent;
    }
  }
  // called by
  // 1) change detection (provides cols) and
  // 2) groupStage if doing transaction update (doesn't provide cols)
  addParentNode(e, t) {
    if (!e || e.isRowPinned())
      return;
    const r = this.createPathItems(e);
    this.linkPathItems(e, r), this.populateColumnsMap(e, t);
  }
  canSkip(e) {
    return this.active && !this.mapToItems[e.id];
  }
  getValueColumnsForNode(e, t) {
    if (!this.keepingColumns)
      return t;
    const r = this.nodeIdsToColumns[e.id];
    return t.filter((a) => r[a.getId()]);
  }
  getNotValueColumnsForNode(e, t) {
    if (!this.keepingColumns)
      return null;
    const r = this.nodeIdsToColumns[e.id];
    return t.filter((a) => !r[a.getId()]);
  }
}, p4 = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "selectionService", this.selectedNodes = /* @__PURE__ */ new Map(), this.selectionCtx = new yZ(), this.rowSelectionMode = void 0;
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.pageBoundsService = e.pageBoundsService;
  }
  postConstruct() {
    const { gos: e, rowModel: t, onRowSelected: r } = this;
    this.selectionCtx.init(t), this.rowSelectionMode = f1(e), this.groupSelectsChildren = Wh(e), this.addManagedPropertyListeners(["groupSelectsChildren", "rowSelection"], () => {
      const n = Wh(e), a = f1(e);
      (n !== this.groupSelectsChildren || a !== this.rowSelectionMode) && (this.groupSelectsChildren = n, this.rowSelectionMode = a, this.deselectAllRowNodes({ source: "api" }));
    }), this.addManagedEventListeners({ rowSelected: r.bind(this) });
  }
  destroy() {
    super.destroy(), this.resetNodes(), this.selectionCtx.reset();
  }
  isMultiSelect() {
    return this.rowSelectionMode === "multiRow";
  }
  /**
   * We override the selection value for UI-triggered events because it's the
   * current selection state that should determine the next selection state. This
   * is a stepping stone towards removing selection logic from event listeners and
   * other code external to the selection service(s).
   */
  overrideSelectionValue(e, t) {
    if (!qQ(t))
      return e;
    const r = this.selectionCtx.getRoot();
    return r ? r.isSelected() ?? !1 : !0;
  }
  setNodesSelected(e) {
    var f;
    const { newValue: t, clearSelection: r, suppressFinishActions: n, rangeSelect: a, nodes: u, event: s, source: c } = e;
    if (u.length === 0)
      return 0;
    if (u.length > 1 && !this.isMultiSelect())
      return Fr("cannot multi select unless selection mode is 'multiRow'"), 0;
    const i = this.groupSelectsChildren && e.groupSelectsFiltered === !0, l = u.map((p) => p.footer ? p.sibling : p);
    if (a) {
      if (l.length > 1)
        return Fr("cannot range select while selecting multiple rows"), 0;
      const p = l[0], g = this.overrideSelectionValue(t, c);
      if (this.isMultiSelect()) {
        if (this.selectionCtx.isInRange(p)) {
          const y = this.selectionCtx.truncate(p);
          return g && this.selectRange(y.discard, !1, c), this.selectRange(y.keep, g, c);
        } else if (this.selectionCtx.getRoot() !== p) {
          const m = this.selectionCtx.extend(p, this.groupSelectsChildren);
          return g && this.selectRange(m.discard, !1, c), this.selectRange(m.keep, g, c);
        }
      }
    }
    n || this.selectionCtx.setRoot(l[0]);
    let v = 0;
    for (let p = 0; p < l.length; p++) {
      const g = l[p];
      i && g.group || g.selectThisNode(t, s, c) && v++, this.groupSelectsChildren && ((f = g.childrenAfterGroup) != null && f.length) && (v += this.selectChildren(g, t, i, c));
    }
    return n || (t && (r || !this.isMultiSelect()) && (v += this.clearOtherNodes(l[0], c)), v > 0 && (this.updateGroupsFromChildrenSelections(c), this.dispatchSelectionChanged(c))), v;
  }
  // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by
  // holding down 'shift'.
  selectRange(e, t, r) {
    let n = 0;
    return e.forEach((a) => {
      if (a.group && this.groupSelectsChildren)
        return;
      a.selectThisNode(t, void 0, r) && n++;
    }), n > 0 && (this.updateGroupsFromChildrenSelections(r), this.dispatchSelectionChanged(r)), n;
  }
  selectChildren(e, t, r, n) {
    const a = r ? e.childrenAfterAggFilter : e.childrenAfterGroup;
    return mi(a) ? 0 : this.setNodesSelected({
      newValue: t,
      clearSelection: !1,
      suppressFinishActions: !0,
      groupSelectsFiltered: r,
      source: n,
      nodes: a
    });
  }
  getSelectedNodes() {
    const e = [];
    return this.selectedNodes.forEach((t) => {
      t && e.push(t);
    }), e;
  }
  getSelectedRows() {
    const e = [];
    return this.selectedNodes.forEach((t) => {
      t && t.data && e.push(t.data);
    }), e;
  }
  getSelectionCount() {
    return this.selectedNodes.size;
  }
  /**
   * This method is used by the CSRM to remove groups which are being disposed of,
   * events do not need fired in this case
   */
  filterFromSelection(e) {
    const t = /* @__PURE__ */ new Map();
    this.selectedNodes.forEach((r, n) => {
      r && e(r) && t.set(n, r);
    }), this.selectedNodes = t;
  }
  // should only be called if groupSelectsChildren=true
  updateGroupsFromChildrenSelections(e, t) {
    if (!this.groupSelectsChildren || !da(this.gos))
      return !1;
    const n = this.rowModel.getRootNode();
    t || (t = new J1(!0, n), t.setInactive());
    let a = !1;
    return t.forEachChangedNodeDepthFirst((u) => {
      if (u !== n) {
        const s = u.calculateSelectedFromChildren();
        a = u.selectThisNode(s === null ? !1 : s, void 0, e) || a;
      }
    }), a;
  }
  clearOtherNodes(e, t) {
    const r = /* @__PURE__ */ new Map();
    let n = 0;
    return this.selectedNodes.forEach((a) => {
      if (a && a.id !== e.id) {
        const u = this.selectedNodes.get(a.id);
        n += u.setSelectedParams({
          newValue: !1,
          clearSelection: !1,
          suppressFinishActions: !0,
          source: t
        }), this.groupSelectsChildren && a.parent && r.set(a.parent.id, a.parent);
      }
    }), r.forEach((a) => {
      const u = a.calculateSelectedFromChildren();
      a.selectThisNode(u === null ? !1 : u, void 0, t);
    }), n;
  }
  onRowSelected(e) {
    const t = e.node;
    this.groupSelectsChildren && t.group || (t.isSelected() ? this.selectedNodes.set(t.id, t) : this.selectedNodes.delete(t.id));
  }
  syncInRowNode(e, t) {
    this.syncInOldRowNode(e, t), this.syncInNewRowNode(e);
  }
  // if the id has changed for the node, then this means the rowNode
  // is getting used for a different data item, which breaks
  // our selectedNodes, as the node now is mapped by the old id
  // which is inconsistent. so to keep the old node as selected,
  // we swap in the clone (with the old id and old data). this means
  // the oldNode is effectively a daemon we keep a reference to,
  // so if client calls api.getSelectedNodes(), it gets the daemon
  // in the result. when the client un-selects, the reference to the
  // daemon is removed. the daemon, because it's an oldNode, is not
  // used by the grid for rendering, it's a copy of what the node used
  // to be like before the id was changed.
  syncInOldRowNode(e, t) {
    if ($r(t) && e.id !== t.id && t) {
      const n = t.id;
      this.selectedNodes.get(n) == e && this.selectedNodes.set(t.id, t);
    }
  }
  syncInNewRowNode(e) {
    this.selectedNodes.has(e.id) ? (e.setSelectedInitialValue(!0), this.selectedNodes.set(e.id, e)) : e.setSelectedInitialValue(!1);
  }
  reset(e) {
    const t = this.getSelectionCount();
    this.resetNodes(), t && this.dispatchSelectionChanged(e);
  }
  resetNodes() {
    var e;
    (e = this.selectedNodes) == null || e.clear();
  }
  // returns a list of all nodes at 'best cost' - a feature to be used
  // with groups / trees. if a group has all it's children selected,
  // then the group appears in the result, but not the children.
  // Designed for use with 'children' as the group selection type,
  // where groups don't actually appear in the selection normally.
  getBestCostNodeSelection() {
    if (!da(this.gos))
      return;
    const t = this.rowModel.getTopLevelNodes();
    if (t === null)
      return;
    const r = [];
    function n(a) {
      for (let u = 0, s = a.length; u < s; u++) {
        const c = a[u];
        if (c.isSelected())
          r.push(c);
        else {
          const i = c;
          i.group && i.children && n(i.children);
        }
      }
    }
    return n(t), r;
  }
  isEmpty() {
    let e = 0;
    return this.selectedNodes.forEach((t) => {
      t && e++;
    }), e === 0;
  }
  deselectAllRowNodes(e) {
    const t = (s) => s.selectThisNode(!1, void 0, n), r = da(this.gos), { source: n, justFiltered: a, justCurrentPage: u } = e;
    if (u || a) {
      if (!r) {
        Ni("selecting just filtered only works when gridOptions.rowModelType='clientSide'");
        return;
      }
      this.getNodesToSelect(a, u).forEach(t);
    } else
      this.selectedNodes.forEach((s) => {
        s && t(s);
      }), this.reset(n);
    this.selectionCtx.reset(), r && this.groupSelectsChildren && this.updateGroupsFromChildrenSelections(n), this.dispatchSelectionChanged(n);
  }
  getSelectedCounts(e, t) {
    let r = 0, n = 0;
    const a = (u) => {
      this.groupSelectsChildren && u.group || (u.isSelected() ? r++ : u.selectable && n++);
    };
    return this.getNodesToSelect(e, t).forEach(a), { selectedCount: r, notSelectedCount: n };
  }
  getSelectAllState(e, t) {
    const { selectedCount: r, notSelectedCount: n } = this.getSelectedCounts(e, t);
    return r === 0 && n === 0 ? !1 : r > 0 && n > 0 ? null : r > 0;
  }
  hasNodesToSelect(e = !1, t = !1) {
    return this.getNodesToSelect(e, t).filter((r) => r.selectable).length > 0;
  }
  /**
   * @param justFiltered whether to just include nodes which have passed the filter
   * @param justCurrentPage whether to just include nodes on the current page
   * @returns all nodes including unselectable nodes which are the target of this selection attempt
   */
  getNodesToSelect(e = !1, t = !1) {
    this.validateSelectAllType();
    const r = [];
    if (t)
      return this.forEachNodeOnPage((a) => {
        if (!a.group) {
          r.push(a);
          return;
        }
        if (!a.expanded) {
          const u = (s) => {
            var c;
            r.push(s), (c = s.childrenAfterFilter) != null && c.length && s.childrenAfterFilter.forEach(u);
          };
          u(a);
          return;
        }
        this.groupSelectsChildren || r.push(a);
      }), r;
    const n = this.rowModel;
    return e ? (n.forEachNodeAfterFilter((a) => {
      r.push(a);
    }), r) : (n.forEachNode((a) => {
      r.push(a);
    }), r);
  }
  forEachNodeOnPage(e) {
    const t = this.pageBoundsService.getFirstRow(), r = this.pageBoundsService.getLastRow();
    for (let n = t; n <= r; n++) {
      const a = this.rowModel.getRow(n);
      a && e(a);
    }
  }
  selectAllRowNodes(e) {
    if (Y_(this.gos) && !kL(this.gos))
      return Fr("cannot multi select unless selection mode is 'multiRow'");
    this.validateSelectAllType();
    const { source: t, justFiltered: r, justCurrentPage: n } = e, a = this.getNodesToSelect(r, n);
    a.forEach((u) => u.selectThisNode(!0, void 0, t)), this.selectionCtx.setRoot(a[0] ?? null), this.selectionCtx.setEndRange(di(a) ?? null), da(this.gos) && this.groupSelectsChildren && this.updateGroupsFromChildrenSelections(t), this.dispatchSelectionChanged(t);
  }
  getSelectionState() {
    const e = [];
    return this.selectedNodes.forEach((t) => {
      t != null && t.id && e.push(t.id);
    }), e.length ? e : null;
  }
  setSelectionState(e, t) {
    if (!Array.isArray(e))
      return Ni(
        "Invalid selection state. When using client-side row model, the state must conform to `string[]`."
      );
    const r = new Set(e), n = [];
    this.rowModel.forEachNode((a) => {
      r.has(a.id) && n.push(a);
    }), this.setNodesSelected({
      newValue: !0,
      nodes: n,
      source: t
    });
  }
  dispatchSelectionChanged(e) {
    this.eventService.dispatchEvent({
      type: "selectionChanged",
      source: e
    });
  }
  validateSelectAllType() {
    if (!da(this.gos))
      throw new Error(
        `selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`
      );
  }
}, vq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "selectableService";
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.selectionService = e.selectionService;
  }
  postConstruct() {
    this.addManagedPropertyListener("isRowSelectable", () => this.updateSelectable());
  }
  /**
   * Used by CSRM only, to update selectable state after group state changes.
   */
  updateSelectableAfterGrouping() {
    this.updateSelectable(!0);
  }
  updateSelectable(e = !1) {
    const { gos: t } = this, r = u1(t), n = k2(t);
    if (!r || !n)
      return;
    const a = Wh(t), u = da(t) && a, s = [], c = (i) => {
      if (e && !i.group)
        return;
      if (u && i.group) {
        const v = i.childrenAfterGroup.some((f) => f.selectable === !0);
        i.setRowSelectable(v, !0);
        return;
      }
      const l = (n == null ? void 0 : n(i)) ?? !0;
      i.setRowSelectable(l, !0), !l && i.isSelected() && s.push(i);
    };
    if (u) {
      const i = this.rowModel;
      new J1(!1, i.getRootNode()).forEachChangedNodeDepthFirst(c, !0, !0);
    } else
      this.rowModel.forEachNode(c);
    s.length && this.selectionService.setNodesSelected({
      nodes: s,
      newValue: !1,
      source: "selectableChanged"
    }), u && this.selectionService instanceof p4 && this.selectionService.updateGroupsFromChildrenSelections("selectableChanged");
  }
}, bF = ["asc", "desc", null], gq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "sortController";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.funcColsService = e.funcColsService, this.showRowGroupColsService = e.showRowGroupColsService;
  }
  progressSort(e, t, r) {
    const n = this.getNextSortDirection(e);
    this.setSortForColumn(e, n, t, r);
  }
  setSortForColumn(e, t, r, n) {
    t !== "asc" && t !== "desc" && (t = null);
    const a = ec(this.gos);
    let u = [e];
    if (a && e.getColDef().showRowGroup) {
      const i = this.funcColsService.getSourceColumnsForGroupColumn(e), l = i == null ? void 0 : i.filter((v) => v.isSortable());
      l && (u = [e, ...l]);
    }
    u.forEach((i) => i.setSort(t, n));
    const s = (r || this.gos.get("alwaysMultiSort")) && !this.gos.get("suppressMultiSort"), c = [];
    if (!s) {
      const i = this.clearSortBarTheseColumns(u, n);
      c.push(...i);
    }
    this.updateSortIndex(e), c.push(...u), this.dispatchSortChangedEvents(n, c);
  }
  updateSortIndex(e) {
    var c;
    const t = ec(this.gos), r = (c = this.showRowGroupColsService) == null ? void 0 : c.getShowRowGroupCol(e.getId()), n = t && r || e, a = this.getColumnsWithSortingOrdered();
    this.columnModel.getAllCols().forEach((i) => i.setSortIndex(null));
    const u = a.filter((i) => t && i.getColDef().showRowGroup ? !1 : i !== n);
    (n.getSort() ? [...u, n] : u).forEach((i, l) => {
      i.setSortIndex(l);
    });
  }
  // gets called by API, so if data changes, use can call this, which will end up
  // working out the sort order again of the rows.
  onSortChanged(e, t) {
    this.dispatchSortChangedEvents(e, t);
  }
  isSortActive() {
    const t = this.columnModel.getAllCols().filter((r) => !!r.getSort());
    return t && t.length > 0;
  }
  dispatchSortChangedEvents(e, t) {
    const r = {
      type: "sortChanged",
      source: e
    };
    t && (r.columns = t), this.eventService.dispatchEvent(r);
  }
  clearSortBarTheseColumns(e, t) {
    const r = [];
    return this.columnModel.getAllCols().forEach((n) => {
      e.includes(n) || (n.getSort() && r.push(n), n.setSort(void 0, t));
    }), r;
  }
  getNextSortDirection(e) {
    let t;
    if (e.getColDef().sortingOrder ? t = e.getColDef().sortingOrder : this.gos.get("sortingOrder") ? t = this.gos.get("sortingOrder") : t = bF, !Array.isArray(t) || t.length <= 0)
      return Fr(`sortingOrder must be an array with at least one element, currently it's ${t}`), null;
    const r = t.indexOf(e.getSort()), n = r < 0, a = r == t.length - 1;
    let u;
    return n || a ? u = t[0] : u = t[r + 1], bF.indexOf(u) < 0 ? (Fr("invalid sort type ", u), null) : u;
  }
  /**
   * @returns a map of sort indexes for every sorted column, if groups sort primaries then they will have equivalent indices
   */
  getIndexedSortMap() {
    let e = this.columnModel.getAllCols().filter((u) => !!u.getSort());
    if (this.columnModel.isPivotMode()) {
      const u = ec(this.gos);
      e = e.filter((s) => {
        var v;
        const c = !!s.getAggFunc(), i = !s.isPrimary(), l = u ? (v = this.showRowGroupColsService) == null ? void 0 : v.getShowRowGroupCol(s.getId()) : s.getColDef().showRowGroup;
        return c || i || l;
      });
    }
    const t = this.funcColsService.getRowGroupColumns().filter((u) => !!u.getSort()), r = {};
    e.forEach((u, s) => r[u.getId()] = s), e.sort((u, s) => {
      const c = u.getSortIndex(), i = s.getSortIndex();
      if (c != null && i != null)
        return c - i;
      if (c == null && i == null) {
        const l = r[u.getId()], v = r[s.getId()];
        return l > v ? 1 : -1;
      } else return i == null ? -1 : 1;
    });
    const n = ec(this.gos) && !!t.length;
    n && (e = [
      ...new Set(
        // if linked sorting, replace all columns with the display group column for index purposes, and ensure uniqueness
        e.map((u) => {
          var s;
          return ((s = this.showRowGroupColsService) == null ? void 0 : s.getShowRowGroupCol(u.getId())) ?? u;
        })
      )
    ]);
    const a = /* @__PURE__ */ new Map();
    return e.forEach((u, s) => a.set(u, s)), n && t.forEach((u) => {
      const s = this.showRowGroupColsService.getShowRowGroupCol(u.getId());
      a.set(u, a.get(s));
    }), a;
  }
  getColumnsWithSortingOrdered() {
    return [...this.getIndexedSortMap().entries()].sort(([e, t], [r, n]) => t - n).map(([e]) => e);
  }
  // used by server side row models, to sent sort to server
  getSortModel() {
    return this.getColumnsWithSortingOrdered().filter((e) => e.getSort()).map((e) => ({
      sort: e.getSort(),
      colId: e.getId()
    }));
  }
  getSortOptions() {
    return this.getColumnsWithSortingOrdered().filter((e) => e.getSort()).map((e) => ({
      sort: e.getSort(),
      column: e
    }));
  }
  canColumnDisplayMixedSort(e) {
    const t = ec(this.gos), r = !!e.getColDef().showRowGroup;
    return t && r;
  }
  getDisplaySortForColumn(e) {
    const t = this.funcColsService.getSourceColumnsForGroupColumn(e);
    if (!this.canColumnDisplayMixedSort(e) || !(t != null && t.length))
      return e.getSort();
    const n = e.getColDef().field != null || !!e.getColDef().valueGetter ? [e, ...t] : t, a = n[0].getSort();
    return n.every((s) => s.getSort() == a) ? a : "mixed";
  }
  getDisplaySortIndexForColumn(e) {
    return this.getIndexedSortMap().get(e);
  }
}, mq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "syncService", this.waitingForColumns = !1;
  }
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService, this.columnModel = e.columnModel, this.rowModel = e.rowModel;
  }
  postConstruct() {
    this.addManagedPropertyListener("columnDefs", (e) => this.setColumnDefs(e));
  }
  start() {
    this.ctrlsService.whenReady(this, () => {
      const e = this.gos.get("columnDefs");
      e ? this.setColumnsAndData(e) : this.waitingForColumns = !0, this.gridReady();
    });
  }
  setColumnsAndData(e) {
    this.columnModel.setColumnDefs(e ?? [], "gridInitializing"), this.rowModel.start();
  }
  gridReady() {
    this.eventService.dispatchEvent({
      type: "gridReady"
    });
    const e = this.gos.isModuleRegistered(
      "@ag-grid-enterprise/core"
      /* EnterpriseCoreModule */
    );
    this.gos.get("debug") && ef(`initialised successfully, enterprise = ${e}`);
  }
  setColumnDefs(e) {
    const t = this.gos.get("columnDefs");
    if (t) {
      if (this.waitingForColumns) {
        this.waitingForColumns = !1, this.setColumnsAndData(t);
        return;
      }
      this.columnModel.setColumnDefs(t, Ah(e.source));
    }
  }
}, yq = "paste", Cq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "changeDetectionService";
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.rowRenderer = e.rowRenderer;
  }
  postConstruct() {
    da(this.gos) && (this.clientSideRowModel = this.rowModel), this.addManagedEventListeners({ cellValueChanged: this.onCellValueChanged.bind(this) });
  }
  onCellValueChanged(e) {
    e.source !== yq && this.doChangeDetection(e.node, e.column);
  }
  doChangeDetection(e, t) {
    if (this.gos.get("suppressChangeDetection"))
      return;
    const r = [e];
    if (this.clientSideRowModel && !e.isRowPinned()) {
      const n = this.gos.get("aggregateOnlyChangedColumns"), a = new J1(n, this.clientSideRowModel.getRootNode());
      a.addParentNode(e.parent, [t]), this.clientSideRowModel.doAggregate(a), a.forEachChangedNodeDepthFirst((u) => {
        r.push(u);
      });
    }
    this.rowRenderer.refreshCells({ rowNodes: r });
  }
}, bq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "expressionService", this.expressionToFunctionCache = {};
  }
  evaluate(e, t) {
    if (typeof e == "string")
      return this.evaluateExpression(e, t);
    Ni("value should be either a string or a function", e);
  }
  evaluateExpression(e, t) {
    try {
      return this.createExpressionFunction(e)(
        t.value,
        t.context,
        t.oldValue,
        t.newValue,
        t.value,
        t.node,
        t.data,
        t.colDef,
        t.rowIndex,
        t.api,
        t.getValue,
        t.column,
        t.columnGroup
      );
    } catch (r) {
      return ef("Processing of the expression failed"), ef("Expression = ", e), ef("Params = ", t), ef("Exception = ", r), null;
    }
  }
  createExpressionFunction(e) {
    if (this.expressionToFunctionCache[e])
      return this.expressionToFunctionCache[e];
    const t = this.createFunctionBody(e), r = new Function(
      "x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",
      t
    );
    return this.expressionToFunctionCache[e] = r, r;
  }
  createFunctionBody(e) {
    return e.indexOf("return") >= 0 ? e : "return " + e + ";";
  }
}, wq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "valueCache", this.cacheVersion = 0;
  }
  postConstruct() {
    this.active = this.gos.get("valueCache"), this.neverExpires = this.gos.get("valueCacheNeverExpires");
  }
  onDataChanged() {
    this.neverExpires || this.expire();
  }
  expire() {
    this.cacheVersion++;
  }
  setValue(e, t, r) {
    this.active && (e.__cacheVersion !== this.cacheVersion && (e.__cacheVersion = this.cacheVersion, e.__cacheData = {}), e.__cacheData[t] = r);
  }
  getValue(e, t) {
    if (!(!this.active || e.__cacheVersion !== this.cacheVersion))
      return e.__cacheData[t];
  }
}, Sq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "valueService", this.initialised = !1, this.isSsrm = !1;
  }
  wireBeans(e) {
    this.expressionService = e.expressionService, this.columnModel = e.columnModel, this.valueCache = e.valueCache, this.dataTypeService = e.dataTypeService;
  }
  postConstruct() {
    this.initialised || this.init();
  }
  init() {
    this.isSsrm = sd(this.gos), this.cellExpressions = this.gos.get("enableCellExpressions"), this.isTreeData = this.gos.get("treeData"), this.initialised = !0;
    const e = (r) => this.callColumnCellValueChangedHandler(r), t = c1(this.gos);
    this.eventService.addEventListener("cellValueChanged", e, t), this.addDestroyFunc(() => this.eventService.removeEventListener("cellValueChanged", e, t)), this.addManagedPropertyListener("treeData", (r) => this.isTreeData = r.currentValue);
  }
  /**
   * Use this function to get a displayable cell value.
   * This hides values in expanded group rows which are instead displayed by the footer row.
   */
  getValueForDisplay(e, t) {
    const r = t.leafGroup && this.columnModel.isPivotMode(), n = t.group && t.expanded && !t.footer && !r, a = this.gos.get("groupSuppressBlankHeader");
    if (!n || a)
      return this.getValue(e, t);
    let u = !1;
    const s = this.gos.get("groupTotalRow") ?? this.gos.get("groupIncludeFooter");
    typeof s != "function" ? u = !!s : u = !!(this.gos.getCallback("groupTotalRow") ?? this.gos.getCallback("groupIncludeFooter"))({ node: this });
    const c = n && u;
    return this.getValue(e, t, !1, c);
  }
  getValue(e, t, r = !1, n = !1) {
    if (this.initialised || this.init(), !t)
      return;
    const a = e.getColDef(), u = a.field, s = e.getColId(), c = t.data;
    let i;
    const l = t.groupData && t.groupData[s] !== void 0, v = !n && t.aggData && t.aggData[s] !== void 0, f = this.isSsrm && n && !!e.getColDef().aggFunc, p = this.isSsrm && t.footer && t.field && (e.getColDef().showRowGroup === !0 || e.getColDef().showRowGroup === t.field);
    if (r && a.filterValueGetter ? i = this.executeFilterValueGetter(a.filterValueGetter, c, e, t) : this.isTreeData && v ? i = t.aggData[s] : this.isTreeData && a.valueGetter ? i = this.executeValueGetter(a.valueGetter, c, e, t) : this.isTreeData && u && c ? i = Rm(c, u, e.isFieldContainsDots()) : l ? i = t.groupData[s] : v ? i = t.aggData[s] : a.valueGetter ? i = this.executeValueGetter(a.valueGetter, c, e, t) : p ? i = Rm(c, t.field, e.isFieldContainsDots()) : u && c && !f && (i = Rm(c, u, e.isFieldContainsDots())), this.cellExpressions && typeof i == "string" && i.indexOf("=") === 0) {
      const g = i.substring(1);
      i = this.executeValueGetter(g, c, e, t);
    }
    if (i == null) {
      const g = this.getOpenedGroup(t, e);
      if (g != null)
        return g;
    }
    return i;
  }
  parseValue(e, t, r, n) {
    const a = e.getColDef(), u = a.valueParser;
    if ($r(u)) {
      const s = this.gos.addGridCommonParams({
        node: t,
        data: t == null ? void 0 : t.data,
        oldValue: n,
        newValue: r,
        colDef: a,
        column: e
      });
      return typeof u == "function" ? u(s) : this.expressionService.evaluate(u, s);
    }
    return r;
  }
  getDeleteValue(e, t) {
    return $r(e.getColDef().valueParser) ? this.parseValue(e, t, "", this.getValueForDisplay(e, t)) ?? null : null;
  }
  formatValue(e, t, r, n, a = !0) {
    let u = null, s;
    const c = e.getColDef();
    if (n ? s = n : a && (s = c.valueFormatter), s) {
      const i = this.gos.addGridCommonParams({
        value: r,
        node: t,
        data: t ? t.data : null,
        colDef: c,
        column: e
      });
      typeof s == "function" ? u = s(i) : u = this.expressionService.evaluate(s, i);
    } else if (c.refData)
      return c.refData[r] || "";
    return u == null && Array.isArray(r) && (u = r.join(", ")), u;
  }
  getOpenedGroup(e, t) {
    if (!this.gos.get("showOpenedGroup") || !t.getColDef().showRowGroup)
      return;
    const n = t.getColDef().showRowGroup;
    let a = e.parent;
    for (; a != null; ) {
      if (a.rowGroupColumn && (n === !0 || n === a.rowGroupColumn.getColId()))
        return a.key;
      a = a.parent;
    }
  }
  /**
   * Sets the value of a GridCell
   * @param rowNode The `RowNode` to be updated
   * @param colKey The `Column` to be updated
   * @param newValue The new value to be set
   * @param eventSource The event source
   * @returns `True` if the value has been updated, otherwise`False`.
   */
  setValue(e, t, r, n) {
    const a = this.columnModel.getColDefCol(t);
    if (!e || !a)
      return !1;
    mi(e.data) && (e.data = {});
    const { field: u, valueSetter: s } = a.getColDef();
    if (mi(u) && mi(s))
      return Fr("you need either field or valueSetter set on colDef for editing to work"), !1;
    if (this.dataTypeService && !this.dataTypeService.checkType(a, r))
      return Fr("Data type of the new value does not match the cell data type of the column"), !1;
    const c = this.gos.addGridCommonParams({
      node: e,
      data: e.data,
      oldValue: this.getValue(a, e),
      newValue: r,
      colDef: a.getColDef(),
      column: a
    });
    c.newValue = r;
    let i;
    if ($r(s) ? typeof s == "function" ? i = s(c) : i = this.expressionService.evaluate(s, c) : i = this.setValueUsingField(e.data, u, r, a.isFieldContainsDots()), i === void 0 && (i = !0), !i)
      return !1;
    e.resetQuickFilterAggregateText(), this.valueCache.onDataChanged();
    const l = this.getValue(a, e);
    return this.eventService.dispatchEvent({
      type: "cellValueChanged",
      event: null,
      rowIndex: e.rowIndex,
      rowPinned: e.rowPinned,
      column: c.column,
      colDef: c.colDef,
      data: e.data,
      node: e,
      oldValue: c.oldValue,
      newValue: l,
      value: l,
      source: n
    }), !0;
  }
  callColumnCellValueChangedHandler(e) {
    const t = e.colDef.onCellValueChanged;
    typeof t == "function" && this.getFrameworkOverrides().wrapOutgoing(() => {
      t({
        node: e.node,
        data: e.data,
        oldValue: e.oldValue,
        newValue: e.newValue,
        colDef: e.colDef,
        column: e.column,
        api: e.api,
        context: e.context
      });
    });
  }
  setValueUsingField(e, t, r, n) {
    if (!t)
      return !1;
    let a = !1;
    if (!n)
      a = e[t] === r, a || (e[t] = r);
    else {
      const u = t.split(".");
      let s = e;
      for (; u.length > 0 && s; ) {
        const c = u.shift();
        u.length === 0 ? (a = s[c] === r, a || (s[c] = r)) : s = s[c];
      }
    }
    return !a;
  }
  executeFilterValueGetter(e, t, r, n) {
    const a = this.gos.addGridCommonParams({
      data: t,
      node: n,
      column: r,
      colDef: r.getColDef(),
      getValue: this.getValueCallback.bind(this, n)
    });
    return typeof e == "function" ? e(a) : this.expressionService.evaluate(e, a);
  }
  executeValueGetter(e, t, r, n) {
    const a = r.getColId(), u = this.valueCache.getValue(n, a);
    if (u !== void 0)
      return u;
    const s = this.gos.addGridCommonParams({
      data: t,
      node: n,
      column: r,
      colDef: r.getColDef(),
      getValue: this.getValueCallback.bind(this, n)
    });
    let c;
    return typeof e == "function" ? c = e(s) : c = this.expressionService.evaluate(e, s), this.valueCache.setValue(n, a, c), c;
  }
  getValueCallback(e, t) {
    const r = this.columnModel.getColDefCol(t);
    return r ? this.getValue(r, e) : null;
  }
  // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col
  getKeyForNode(e, t) {
    const r = this.getValue(e, t), n = e.getColDef().keyCreator;
    let a = r;
    if (n) {
      const u = this.gos.addGridCommonParams({
        value: r,
        colDef: e.getColDef(),
        column: e,
        node: t,
        data: t.data
      });
      a = n(u);
    }
    return typeof a == "string" || a == null || (a = String(a), a === "[object Object]" && Fr(
      "a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key"
    )), a;
  }
}, dR = class Rh {
  static applyGlobalGridOptions(t) {
    if (!Rh.gridOptions)
      return t;
    let r = {};
    return rs(r, Rh.gridOptions, !0, !0), Rh.mergeStrategy === "deep" ? rs(r, t, !0, !0) : r = { ...r, ...t }, Rh.gridOptions.context && (r.context = Rh.gridOptions.context), t.context && (Rh.mergeStrategy === "deep" && r.context && rs(t.context, r.context, !0, !0), r.context = t.context), r;
  }
};
dR.gridOptions = void 0;
dR.mergeStrategy = "shallow";
var v4 = dR;
function xq(e) {
  var t;
  return (t = v4.gridOptions) == null ? void 0 : t[e];
}
var Tq = 1, Rq = class {
  create(e, t, r, n, a) {
    const u = v4.applyGlobalGridOptions(t), s = tq(u), c = s.gridId ?? String(Tq++), i = this.getRegisteredModules(a, c), l = this.createBeansList(s.rowModelType, i, c), v = this.createProvidedBeans(e, s, a);
    if (!l) {
      Ni("Failed to create grid.");
      return;
    }
    const f = {
      providedBeanInstances: v,
      beanClasses: l,
      gridId: c,
      beanInitComparator: HZ,
      beanDestroyComparator: BZ,
      derivedBeans: [DZ]
    }, p = new jj(f);
    return this.registerModuleUserComponents(p, i), this.registerControllers(p, i), this.registerModuleApiFunctions(p, i), r(p), p.getBean("syncService").start(), n && n(p), p.getBean("gridApi");
  }
  registerControllers(e, t) {
    const r = e.getBean("ctrlsFactory");
    t.forEach((n) => {
      n.controllers && n.controllers.forEach((a) => r.register(a));
    });
  }
  getRegisteredModules(e, t) {
    const r = e ? e.modules : null, n = tc.__getRegisteredModules(t), a = [], u = {}, s = (c, i, l) => {
      ((f) => {
        u[f.moduleName] || (u[f.moduleName] = !0, a.push(f), tc.__register(f, c, l));
      })(i), i.dependantModules && i.dependantModules.forEach((f) => s(c, f, l));
    };
    return s(
      !!(r != null && r.length) || !tc.__isPackageBased(),
      JQ,
      void 0
    ), r && r.forEach((c) => s(!0, c, t)), n && n.forEach((c) => s(!tc.__isPackageBased(), c, void 0)), a;
  }
  registerModuleUserComponents(e, t) {
    const r = this.extractModuleEntity(
      t,
      (a) => a.userComponents ? a.userComponents : []
    ), n = e.getBean("userComponentRegistry");
    r.forEach(({ name: a, classImp: u, params: s }) => {
      n.registerDefaultComponent(a, u, s);
    });
  }
  registerModuleApiFunctions(e, t) {
    const r = e.getBean("apiFunctionService");
    t.forEach((n) => {
      const a = n.apiFunctions;
      a && Object.keys(a).forEach((s) => {
        r == null || r.addFunction(s, a[s]);
      });
    });
  }
  createProvidedBeans(e, t, r) {
    let n = r ? r.frameworkOverrides : null;
    mi(n) && (n = new n4());
    const a = {
      gridOptions: t,
      eGridDiv: e,
      globalEventListener: r ? r.globalEventListener : null,
      globalSyncEventListener: r ? r.globalSyncEventListener : null,
      frameworkOverrides: n
    };
    return r && r.providedBeanInstances && Object.assign(a, r.providedBeanInstances), a;
  }
  createBeansList(e = "clientSide", t, r) {
    const n = t.filter(
      (i) => !i.rowModel || i.rowModel === e
    ), a = {
      clientSide: "@ag-grid-community/client-side-row-model",
      infinite: "@ag-grid-community/infinite-row-model",
      serverSide: "@ag-grid-enterprise/server-side-row-model",
      viewport: "@ag-grid-enterprise/viewport-row-model"
      /* ViewportRowModelModule */
    };
    if (!a[e]) {
      Ni("Could not find row model for rowModelType = ", e);
      return;
    }
    if (!tc.__assertRegistered(
      a[e],
      `rowModelType = '${e}'`,
      r
    ))
      return;
    const u = [
      UZ,
      WZ,
      nq,
      QQ,
      MZ,
      Rj,
      OZ,
      NZ,
      A$,
      fk,
      hq,
      T$,
      iq,
      mZ,
      Zj,
      RU,
      XZ,
      rq,
      TZ,
      p4,
      hU,
      oX,
      sq,
      oq,
      vZ,
      bq,
      fU,
      x$,
      wq,
      Sq,
      hZ,
      R$,
      Yj,
      $Z,
      S$,
      jZ,
      AZ,
      CZ,
      w$,
      gq,
      cq,
      uq,
      vq,
      Cq,
      E$,
      FZ,
      fq,
      pq,
      zZ,
      ZZ,
      _Z,
      VZ,
      mq,
      dq,
      M$,
      aq,
      lq,
      D$,
      mU,
      PZ,
      yU,
      vU,
      IZ,
      LZ,
      TU,
      gU,
      SU,
      kZ,
      xU,
      sU
    ], s = this.extractModuleEntity(n, (i) => i.beans ? i.beans : []);
    u.push(...s);
    const c = [];
    return u.forEach((i) => {
      c.indexOf(i) < 0 && c.push(i);
    }), c;
  }
  extractModuleEntity(e, t) {
    return [].concat(...e.map(t));
  }
}, Aq = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowModelHelperService";
  }
  wireBeans(e) {
    this.rowModel = e.rowModel;
  }
  postConstruct() {
    const e = this.rowModel;
    switch (e.getType()) {
      case "clientSide":
        this.clientSideRowModel = e;
        break;
      case "infinite":
        this.infiniteRowModel = e;
        break;
      case "serverSide":
        this.serverSideRowModel = e;
        break;
    }
  }
  getClientSideRowModel() {
    return this.clientSideRowModel;
  }
  getInfiniteRowModel() {
    return this.infiniteRowModel;
  }
  getServerSideRowModel() {
    return this.serverSideRowModel;
  }
};
function Eq(e) {
  e.expansionService.expandAll(!0);
}
function Mq(e) {
  e.expansionService.expandAll(!1);
}
function Dq(e) {
  var n, a;
  const t = (n = e.rowModelHelperService) == null ? void 0 : n.getClientSideRowModel(), r = (a = e.rowModelHelperService) == null ? void 0 : a.getServerSideRowModel();
  t ? t.onRowHeightChanged() : r && r.onRowHeightChanged();
}
var Fq = {
  version: $n,
  moduleName: "@ag-grid-community/csrm-ssrm-shared-api",
  apiFunctions: {
    expandAll: Eq,
    collapseAll: Mq,
    onRowHeightChanged: Dq
  }
}, Pq = class {
  wrap(e, t, r = [], n) {
    const a = this.createWrapper(e, n);
    return t.forEach((u) => {
      this.createMethod(a, u, !0);
    }), r.forEach((u) => {
      this.createMethod(a, u, !1);
    }), a;
  }
  createMethod(e, t, r) {
    e.addMethod(t, this.createMethodProxy(e, t, r));
  }
  createMethodProxy(e, t, r) {
    return function() {
      return e.hasMethod(t) ? e.callMethod(t, arguments) : (r && Fr("Framework component is missing the method " + t + "()"), null);
    };
  }
}, zv = typeof __webpack_require__.g > "u" ? {} : __webpack_require__.g;
zv.HTMLElement = typeof HTMLElement > "u" ? {} : HTMLElement;
zv.HTMLButtonElement = typeof HTMLButtonElement > "u" ? {} : HTMLButtonElement;
zv.HTMLSelectElement = typeof HTMLSelectElement > "u" ? {} : HTMLSelectElement;
zv.HTMLInputElement = typeof HTMLInputElement > "u" ? {} : HTMLInputElement;
zv.Node = typeof Node > "u" ? {} : Node;
zv.MouseEvent = typeof MouseEvent > "u" ? {} : MouseEvent;
var Wo = react__WEBPACK_IMPORTED_MODULE_1___default().createContext({}), oy = (e, t, r, n) => {
  if (!e || e.componentFromFramework || t.isDestroyed())
    return;
  const u = e.newAgStackInstance();
  if (u == null)
    return;
  let s, c, i = !1;
  return u.then((l) => {
    if (i) {
      t.destroyBean(l);
      return;
    }
    s = l, c = s.getGui(), r.appendChild(c), wF(n, s);
  }), () => {
    var l;
    i = !0, s && ((l = c == null ? void 0 : c.parentElement) == null || l.removeChild(c), t.destroyBean(s), n && wF(n, void 0));
  };
}, wF = (e, t) => {
  if (e)
    if (e instanceof Function)
      e(t);
    else {
      const r = e;
      r.current = t;
    }
}, uu = (...e) => e.filter((r) => r != null && r !== "").join(" "), Hl = class g4 {
  constructor(...t) {
    this.classesMap = {}, t.forEach((r) => {
      this.classesMap[r] = !0;
    });
  }
  setClass(t, r) {
    if (!!this.classesMap[t] == r)
      return this;
    const a = new g4();
    return a.classesMap = { ...this.classesMap }, a.classesMap[t] = r, a;
  }
  toString() {
    return Object.keys(this.classesMap).filter((r) => this.classesMap[r]).join(" ");
  }
}, Wv = (e) => {
  const t = () => typeof Symbol == "function" && Symbol.for, r = () => t() ? Symbol.for("react.memo") : 60115;
  return typeof e == "function" && !(e.prototype && e.prototype.isReactComponent) || typeof e == "object" && e.$$typeof === r();
}, IF, RT = (IF = (react__WEBPACK_IMPORTED_MODULE_1___default().version)) == null ? void 0 : IF.split(".")[0], Iq = RT === "16" || RT === "17";
function Lq() {
  return RT === "19";
}
var GC = !1;
function kq(e) {
  return GC || setTimeout(() => GC = !1, 0), GC = !0, e();
}
var fR = (e, t) => {
  !Iq && e && !GC ? Dh.flushSync(t) : t();
};
function hR(e, t, r) {
  if (t == null || e == null)
    return t;
  if (e === t || t.length === 0 && e.length === 0)
    return e;
  if (r || e.length === 0 && t.length > 0 || e.length > 0 && t.length === 0)
    return t;
  const n = [], a = [], u = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
  for (let c = 0; c < t.length; c++) {
    const i = t[c];
    s.set(i.instanceId, i);
  }
  for (let c = 0; c < e.length; c++) {
    const i = e[c];
    u.set(i.instanceId, i), s.has(i.instanceId) && n.push(i);
  }
  for (let c = 0; c < t.length; c++) {
    const i = t[c], l = i.instanceId;
    u.has(l) || a.push(i);
  }
  return n.length === e.length && a.length === 0 ? e : n.length === 0 && a.length === t.length ? t : n.length === 0 ? a : a.length === 0 ? n : [...n, ...a];
}
var m4 = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((e, t) => {
  var te;
  const { ctrlsFactory: r, context: n } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), [v, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [p, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [y, C] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [m, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl()), [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl("ag-hidden")), [E, x] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl("ag-hidden")), [T, F] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl("ag-invisible"));
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(t, () => ({
    // force new instance when grid tries to refresh
    refresh() {
      return !1;
    }
  })), (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => oy(v, n, u.current), [v]);
  const P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((re) => {
    if (a.current = re, !re) {
      l.current = n.destroyBean(l.current);
      return;
    }
    const z = {
      setInnerRenderer: (W, q) => {
        f(W), C(q);
      },
      setChildCount: (W) => g(W),
      addOrRemoveCssClass: (W, q) => h((ie) => ie.setClass(W, q)),
      setContractedDisplayed: (W) => x((q) => q.setClass("ag-hidden", !W)),
      setExpandedDisplayed: (W) => S((q) => q.setClass("ag-hidden", !W)),
      setCheckboxVisible: (W) => F((q) => q.setClass("ag-invisible", !W))
    }, Z = r.getInstance("groupCellRendererCtrl");
    Z && (l.current = n.createBean(Z), l.current.init(
      z,
      re,
      s.current,
      c.current,
      i.current,
      m4,
      e
    ));
  }, []), k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => `ag-cell-wrapper ${m.toString()}`, [m]), I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => `ag-group-expanded ${w.toString()}`, [w]), L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => `ag-group-contracted ${E.toString()}`,
    [E]
  ), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => `ag-group-checkbox ${T.toString()}`, [T]), O = v && v.componentFromFramework, N = O ? v.componentClass : void 0, Y = v == null && y != null, j = ac(y, !0);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    "span",
    {
      className: k,
      ref: P,
      ...e.colDef ? {} : { role: (te = l.current) == null ? void 0 : te.getCellAriaRole() }
    },
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { className: I, ref: c }),
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { className: L, ref: i }),
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { className: A, ref: s }),
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { className: "ag-group-value", ref: u }, Y && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, j), O && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(N, { ...v.params })),
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { className: "ag-group-child-count" }, p)
  );
}), SF = m4, pR = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({
  setMethods: () => {
  }
}), Oq = (e) => {
  const { initialProps: t, addUpdateCallback: r, CustomComponentClass: n, setMethods: a } = e, [{ key: u, ...s }, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(t);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    r((i) => c(i));
  }, []), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(pR.Provider, { value: { setMethods: a } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(n, { key: u, ...s }));
}, Nq = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(Oq), Gq = 0;
function xF() {
  return `agPortalKey_${++Gq}`;
}
var y4 = class {
  constructor(e, t, r, n) {
    this.portal = null, this.oldPortal = null, this.reactComponent = e, this.portalManager = t, this.componentType = r, this.suppressFallbackMethods = !!n, this.statelessComponent = this.isStateless(this.reactComponent), this.key = xF(), this.portalKey = xF(), this.instanceCreated = this.isStatelessComponent() ? Ia.resolve(!1) : new Ia((a) => {
      this.resolveInstanceCreated = a;
    });
  }
  getGui() {
    return this.eParentElement;
  }
  /** `getGui()` returns the parent element. This returns the actual root element. */
  getRootElement() {
    return this.eParentElement.firstChild;
  }
  destroy() {
    this.componentInstance && typeof this.componentInstance.destroy == "function" && this.componentInstance.destroy();
    const e = this.portal;
    e && this.portalManager.destroyPortal(e);
  }
  createParentElement(e) {
    const t = this.portalManager.getComponentWrappingElement(), r = document.createElement(t || "div");
    return r.classList.add("ag-react-container"), e.reactContainer = r, r;
  }
  addParentContainerStyleAndClasses() {
    this.componentInstance && (this.componentInstance.getReactContainerStyle && this.componentInstance.getReactContainerStyle() && (Fr(
      'Since v31.1 "getReactContainerStyle" is deprecated. Apply styling directly to ".ag-react-container" if needed.'
    ), Object.assign(this.eParentElement.style, this.componentInstance.getReactContainerStyle())), this.componentInstance.getReactContainerClasses && this.componentInstance.getReactContainerClasses() && (Fr(
      'Since v31.1 "getReactContainerClasses" is deprecated. Apply styling directly to ".ag-react-container" if needed.'
    ), this.componentInstance.getReactContainerClasses().forEach((t) => this.eParentElement.classList.add(t))));
  }
  statelessComponentRendered() {
    return this.eParentElement.childElementCount > 0 || this.eParentElement.childNodes.length > 0;
  }
  getFrameworkComponentInstance() {
    return this.componentInstance;
  }
  isStatelessComponent() {
    return this.statelessComponent;
  }
  getReactComponentName() {
    return this.reactComponent.name;
  }
  getMemoType() {
    return this.hasSymbol() ? Symbol.for("react.memo") : 60115;
  }
  hasSymbol() {
    return typeof Symbol == "function" && Symbol.for;
  }
  isStateless(e) {
    return typeof e == "function" && !(e.prototype && e.prototype.isReactComponent) || typeof e == "object" && e.$$typeof === this.getMemoType();
  }
  hasMethod(e) {
    const t = this.getFrameworkComponentInstance();
    return !!t && t[e] != null || this.fallbackMethodAvailable(e);
  }
  callMethod(e, t) {
    const r = this.getFrameworkComponentInstance();
    if (this.isStatelessComponent())
      return this.fallbackMethod(e, t && t[0] ? t[0] : {});
    if (!r) {
      setTimeout(() => this.callMethod(e, t));
      return;
    }
    const n = r[e];
    if (n)
      return n.apply(r, t);
    if (this.fallbackMethodAvailable(e))
      return this.fallbackMethod(e, t && t[0] ? t[0] : {});
  }
  addMethod(e, t) {
    this[e] = t;
  }
  init(e) {
    return this.eParentElement = this.createParentElement(e), this.createOrUpdatePortal(e), new Ia((t) => this.createReactComponent(t));
  }
  createOrUpdatePortal(e) {
    this.isStatelessComponent() || (this.ref = (t) => {
      var r;
      this.componentInstance = t, this.addParentContainerStyleAndClasses(), (r = this.resolveInstanceCreated) == null || r.call(this, !0), this.resolveInstanceCreated = void 0;
    }, e.ref = this.ref), this.reactElement = this.createElement(this.reactComponent, { ...e, key: this.key }), this.portal = A1.createPortal(
      this.reactElement,
      this.eParentElement,
      this.portalKey
      // fixed deltaRowModeRefreshCompRenderer
    );
  }
  createElement(e, t) {
    return (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(e, t);
  }
  createReactComponent(e) {
    this.portalManager.mountReactPortal(this.portal, this, e);
  }
  rendered() {
    return this.isStatelessComponent() && this.statelessComponentRendered() || !!(!this.isStatelessComponent() && this.getFrameworkComponentInstance());
  }
  /*
   * fallback methods - these will be invoked if a corresponding instance method is not present
   * for example if refresh is called and is not available on the component instance, then refreshComponent on this
   * class will be invoked instead
   *
   * Currently only refresh is supported
   */
  refreshComponent(e) {
    this.oldPortal = this.portal, this.createOrUpdatePortal(e), this.portalManager.updateReactPortal(this.oldPortal, this.portal);
  }
  fallbackMethod(e, t) {
    const r = this[`${e}Component`];
    if (!this.suppressFallbackMethods && r)
      return r.bind(this)(t);
  }
  fallbackMethodAvailable(e) {
    return this.suppressFallbackMethods ? !1 : !!this[`${e}Component`];
  }
};
function vR(e, t, r) {
  e.forEach((n) => {
    const a = t[n];
    a && (r[n] = a);
  });
}
var dc = class extends y4 {
  constructor() {
    super(...arguments), this.awaitUpdateCallback = new Ia((e) => {
      this.resolveUpdateCallback = e;
    }), this.wrapperComponent = Nq;
  }
  init(e) {
    return this.sourceParams = e, super.init(this.getProps());
  }
  addMethod() {
  }
  getInstance() {
    return this.instanceCreated.then(() => this.componentInstance);
  }
  getFrameworkComponentInstance() {
    return this;
  }
  createElement(e, t) {
    return super.createElement(this.wrapperComponent, {
      initialProps: t,
      CustomComponentClass: e,
      setMethods: (r) => this.setMethods(r),
      addUpdateCallback: (r) => {
        this.updateCallback = () => (r(this.getProps()), new Ia((n) => {
          setTimeout(() => {
            n();
          });
        })), this.resolveUpdateCallback();
      }
    });
  }
  setMethods(e) {
    this.providedMethods = e, vR(this.getOptionalMethods(), this.providedMethods, this);
  }
  getOptionalMethods() {
    return [];
  }
  getProps() {
    return {
      ...this.sourceParams,
      key: this.key,
      ref: this.ref
    };
  }
  refreshProps() {
    return this.updateCallback ? this.updateCallback() : new Ia(
      (e) => this.awaitUpdateCallback.then(() => {
        this.updateCallback().then(() => e());
      })
    );
  }
}, Hq = class extends dc {
  refresh(e) {
    return this.sourceParams = e, this.refreshProps(), !0;
  }
}, Bq = class extends dc {
  constructor() {
    super(...arguments), this.date = null, this.onDateChange = (e) => this.updateDate(e);
  }
  getDate() {
    return this.date;
  }
  setDate(e) {
    this.date = e, this.refreshProps();
  }
  refresh(e) {
    this.sourceParams = e, this.refreshProps();
  }
  getOptionalMethods() {
    return ["afterGuiAttached", "setInputPlaceholder", "setInputAriaLabel", "setDisabled"];
  }
  updateDate(e) {
    this.setDate(e), this.sourceParams.onDateChanged();
  }
  getProps() {
    const e = super.getProps();
    return e.date = this.date, e.onDateChange = this.onDateChange, delete e.onDateChanged, e;
  }
}, Vq = class extends dc {
  constructor() {
    super(...arguments), this.label = "", this.icon = null, this.shake = !1;
  }
  setIcon(e, t) {
    this.icon = e, this.shake = t, this.refreshProps();
  }
  setLabel(e) {
    this.label = e, this.refreshProps();
  }
  getProps() {
    const e = super.getProps(), { label: t, icon: r, shake: n } = this;
    return e.label = t, e.icon = r, e.shake = n, e;
  }
}, zq = class extends dc {
  constructor() {
    super(...arguments), this.model = null, this.onModelChange = (e) => this.updateModel(e), this.onUiChange = () => this.sourceParams.filterChangedCallback(), this.expectingNewMethods = !0, this.hasBeenActive = !1;
  }
  isFilterActive() {
    return this.model != null;
  }
  doesFilterPass(e) {
    return this.providedMethods.doesFilterPass(e);
  }
  getModel() {
    return this.model;
  }
  setModel(e) {
    return this.expectingNewMethods = !0, this.model = e, this.hasBeenActive || (this.hasBeenActive = this.isFilterActive()), this.refreshProps();
  }
  refresh(e) {
    return this.sourceParams = e, this.refreshProps(), !0;
  }
  getOptionalMethods() {
    return ["afterGuiAttached", "afterGuiDetached", "onNewRowsLoaded", "getModelAsString", "onAnyFilterChanged"];
  }
  setMethods(e) {
    var t;
    this.expectingNewMethods === !1 && this.hasBeenActive && ((t = this.providedMethods) == null ? void 0 : t.doesFilterPass) !== (e == null ? void 0 : e.doesFilterPass) && setTimeout(() => {
      this.sourceParams.filterChangedCallback();
    }), this.expectingNewMethods = !1, super.setMethods(e);
  }
  updateModel(e) {
    this.setModel(e).then(() => this.sourceParams.filterChangedCallback());
  }
  getProps() {
    const e = super.getProps();
    return e.model = this.model, e.onModelChange = this.onModelChange, e.onUiChange = this.onUiChange, delete e.filterChangedCallback, delete e.filterModifiedCallback, delete e.valueGetter, e;
  }
};
function C4(e, t) {
  e.parentFilterInstance((r) => {
    (r.setModel(t) || Ia.resolve()).then(() => {
      e.filterParams.filterChangedCallback();
    });
  });
}
var Wq = class {
  constructor(e, t) {
    this.floatingFilterParams = e, this.refreshProps = t, this.model = null, this.onModelChange = (r) => this.updateModel(r);
  }
  getProps() {
    return {
      ...this.floatingFilterParams,
      model: this.model,
      onModelChange: this.onModelChange
    };
  }
  onParentModelChanged(e) {
    this.model = e, this.refreshProps();
  }
  refresh(e) {
    this.floatingFilterParams = e, this.refreshProps();
  }
  setMethods(e) {
    vR(this.getOptionalMethods(), e, this);
  }
  getOptionalMethods() {
    return ["afterGuiAttached"];
  }
  updateModel(e) {
    this.model = e, this.refreshProps(), C4(this.floatingFilterParams, e);
  }
}, _q = class extends dc {
  constructor() {
    super(...arguments), this.model = null, this.onModelChange = (e) => this.updateModel(e);
  }
  onParentModelChanged(e) {
    this.model = e, this.refreshProps();
  }
  refresh(e) {
    this.sourceParams = e, this.refreshProps();
  }
  getOptionalMethods() {
    return ["afterGuiAttached"];
  }
  updateModel(e) {
    this.model = e, this.refreshProps(), C4(this.sourceParams, e);
  }
  getProps() {
    const e = super.getProps();
    return e.model = this.model, e.onModelChange = this.onModelChange, e;
  }
}, Uq = class extends dc {
  refresh(e) {
    this.sourceParams = e, this.refreshProps();
  }
}, jq = class extends dc {
  constructor() {
    super(...arguments), this.active = !1, this.expanded = !1, this.onActiveChange = (e) => this.updateActive(e);
  }
  setActive(e) {
    this.awaitSetActive(e);
  }
  setExpanded(e) {
    this.expanded = e, this.refreshProps();
  }
  getOptionalMethods() {
    return ["select", "configureDefaults"];
  }
  awaitSetActive(e) {
    return this.active = e, this.refreshProps();
  }
  updateActive(e) {
    const t = this.awaitSetActive(e);
    e && t.then(() => this.sourceParams.onItemActivated());
  }
  getProps() {
    const e = super.getProps();
    return e.active = this.active, e.expanded = this.expanded, e.onActiveChange = this.onActiveChange, delete e.onItemActivated, e;
  }
}, Yq = class extends dc {
  refresh(e) {
    this.sourceParams = e, this.refreshProps();
  }
}, Xq = class extends dc {
  refresh(e) {
    return this.sourceParams = e, this.refreshProps(), !0;
  }
}, $q = class extends dc {
  constructor() {
    super(...arguments), this.onStateChange = (e) => this.updateState(e);
  }
  refresh(e) {
    return this.sourceParams = e, this.refreshProps(), !0;
  }
  getState() {
    return this.state;
  }
  updateState(e) {
    this.state = e, this.refreshProps(), this.sourceParams.onStateUpdated();
  }
  getProps() {
    const e = super.getProps();
    return e.state = this.state, e.onStateChange = this.onStateChange, e;
  }
};
function gR() {
  Fr("As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.");
}
var Zq = 1e3, Kq = class {
  constructor(e, t, r) {
    this.destroyed = !1, this.portals = [], this.hasPendingPortalUpdate = !1, this.wrappingElement = t || "div", this.refresher = e, this.maxComponentCreationTimeMs = r || Zq;
  }
  getPortals() {
    return this.portals;
  }
  destroy() {
    this.destroyed = !0;
  }
  destroyPortal(e) {
    this.portals = this.portals.filter((t) => t !== e), this.batchUpdate();
  }
  getComponentWrappingElement() {
    return this.wrappingElement;
  }
  mountReactPortal(e, t, r) {
    this.portals = [...this.portals, e], this.waitForInstance(t, r), this.batchUpdate();
  }
  updateReactPortal(e, t) {
    this.portals[this.portals.indexOf(e)] = t, this.batchUpdate();
  }
  batchUpdate() {
    this.hasPendingPortalUpdate || (setTimeout(() => {
      this.destroyed || (this.refresher(), this.hasPendingPortalUpdate = !1);
    }), this.hasPendingPortalUpdate = !0);
  }
  waitForInstance(e, t, r = Date.now()) {
    if (this.destroyed) {
      t(null);
      return;
    }
    if (e.rendered())
      t(e);
    else {
      if (Date.now() - r >= this.maxComponentCreationTimeMs && !this.hasPendingPortalUpdate)
        return;
      window.setTimeout(() => {
        this.waitForInstance(e, t, r);
      });
    }
  }
}, Jq = ({ ctrl: e }) => {
  const t = e.isAlive(), { context: r } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), n = t ? e.getColId() : void 0, [a, u] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  t && !f.current && (f.current = new ny(() => c.current));
  const p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((m) => {
    var S;
    if (c.current = m, s.current = m ? r.createBean(new Hv()) : r.destroyBean(s.current), !m || !t)
      return;
    const h = {
      setWidth: (E) => {
        c.current && (c.current.style.width = E);
      },
      addOrRemoveCssClass: (E, x) => f.current.addOrRemoveCssClass(E, x),
      setAriaSort: (E) => {
        c.current && (E ? WU(c.current, E) : _U(c.current));
      },
      setUserCompDetails: (E) => u(E),
      getUserCompInstance: () => v.current || void 0
    };
    e.setComp(h, m, i.current, l.current, s.current);
    const w = e.getSelectAllGui();
    (S = i.current) == null || S.insertAdjacentElement("afterend", w), s.current.addDestroyFunc(() => w.remove());
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(
    () => oy(a, r, l.current, v),
    [a]
  ), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    e.setDragSource(c.current);
  }, [a]);
  const g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => !!((a == null ? void 0 : a.componentFromFramework) && Wv(a.componentClass)), [a]), y = a && a.componentFromFramework, C = a && a.componentClass;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: p, className: "ag-header-cell", "col-id": n, role: "columnheader" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: i, className: "ag-header-cell-resize", role: "presentation" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: l, className: "ag-header-cell-comp-wrapper", role: "presentation" }, y && g && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(C, { ...a.params }), y && !g && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(C, { ...a.params, ref: v })));
}, Qq = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(Jq), qq = ({ ctrl: e }) => {
  const { context: t, gos: r } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    () => new Hl("ag-header-cell", "ag-floating-filter")
  ), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl()), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    () => new Hl("ag-floating-filter-button", "ag-hidden")
  ), [l, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("false"), [f, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), x = (j) => {
    j != null && S.current && S.current(j);
  }, T = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((j) => {
    if (C.current = j, y.current = j ? t.createBean(new Hv()) : t.destroyBean(y.current), !j)
      return;
    E.current = new Ia((re) => {
      S.current = re;
    });
    const te = {
      addOrRemoveCssClass: (re, z) => a((Z) => Z.setClass(re, z)),
      addOrRemoveBodyCssClass: (re, z) => s((Z) => Z.setClass(re, z)),
      setButtonWrapperDisplayed: (re) => {
        i((z) => z.setClass("ag-hidden", !re)), v(re ? "false" : "true");
      },
      setWidth: (re) => {
        C.current && (C.current.style.width = re);
      },
      setCompDetails: (re) => p(re),
      getFloatingFilterComp: () => E.current ? E.current : null,
      setMenuIcon: (re) => {
        var z;
        return (z = w.current) == null ? void 0 : z.appendChild(re);
      }
    };
    e.setComp(te, j, w.current, m.current, y.current);
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(
    () => oy(f, t, m.current, x),
    [f]
  );
  const F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => n.toString(), [n]), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => u.toString(), [u]), k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => c.toString(), [c]), I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => !!(f && f.componentFromFramework && Wv(f.componentClass)), [f]), L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => r.get("reactiveCustomComponents"), []), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    if (f)
      if (L) {
        const j = new Wq(
          f.params,
          () => g((te) => te + 1)
        );
        return x(j), j;
      } else f.componentFromFramework && gR();
  }, [f]), O = A == null ? void 0 : A.getProps(), N = f && f.componentFromFramework, Y = f && f.componentClass;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: T, className: F, role: "gridcell" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: m, className: P, role: "presentation" }, N && !L && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Y, { ...f.params, ref: I ? () => {
  } : x }), N && L && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    pR.Provider,
    {
      value: {
        setMethods: (j) => A.setMethods(j)
      }
    },
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Y, { ...O })
  )), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    "div",
    {
      ref: h,
      "aria-hidden": l,
      className: k,
      role: "presentation"
    },
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
      "button",
      {
        ref: w,
        type: "button",
        className: "ag-button ag-floating-filter-button-button",
        tabIndex: -1
      }
    )
  ));
}, eee = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(qq), tee = ({ ctrl: e }) => {
  const { context: t } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), [r, n] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl()), [a, u] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl()), [s, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("false"), [i, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [v, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e.getColId(), []), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((P) => {
    if (y.current = P, g.current = P ? t.createBean(new Hv()) : t.destroyBean(g.current), !P)
      return;
    const k = {
      setWidth: (I) => {
        y.current && (y.current.style.width = I);
      },
      addOrRemoveCssClass: (I, L) => n((A) => A.setClass(I, L)),
      setUserCompDetails: (I) => f(I),
      setResizableDisplayed: (I) => {
        u((L) => L.setClass("ag-hidden", !I)), c(I ? "false" : "true");
      },
      setAriaExpanded: (I) => l(I),
      getUserCompInstance: () => h.current || void 0
    };
    e.setComp(k, P, C.current, m.current, g.current);
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => oy(v, t, m.current), [v]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    y.current && e.setDragSource(y.current);
  }, [v]);
  const S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => !!((v == null ? void 0 : v.componentFromFramework) && Wv(v.componentClass)), [v]), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => "ag-header-group-cell " + r.toString(), [r]), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => "ag-header-cell-resize " + a.toString(),
    [a]
  ), T = v && v.componentFromFramework, F = v && v.componentClass;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: w, className: E, "col-id": p, role: "columnheader", "aria-expanded": i }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: m, className: "ag-header-cell-comp-wrapper", role: "presentation" }, T && S && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(F, { ...v.params }), T && !S && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(F, { ...v.params, ref: h })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: C, "aria-hidden": s, className: x }));
}, ree = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(tee), nee = ({ ctrl: e }) => {
  const { context: t } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), { topOffset: r, rowHeight: n } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e.getTopAndHeight(), []), a = e.getAriaRowIndex(), u = e.getHeaderRowClass(), [s, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => n + "px"), [i, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => r + "px"), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), [p, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => e.getHeaderCtrls()), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((S) => {
    if (C.current = S, y.current = S ? t.createBean(new Hv()) : t.destroyBean(y.current), !S)
      return;
    const E = {
      setHeight: (x) => c(x),
      setTop: (x) => l(x),
      setHeaderCtrls: (x, T, F) => {
        f.current = v.current, v.current = x;
        const P = hR(f.current, x, T);
        P !== f.current && fR(F, () => g(P));
      },
      setWidth: (x) => {
        C.current && (C.current.style.width = x);
      }
    };
    e.setComp(E, y.current, !1);
  }, []), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      height: s,
      top: i
    }),
    [s, i]
  ), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((S) => {
    switch (e.getType()) {
      case bT.COLUMN_GROUP:
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ree, { ctrl: S, key: S.instanceId });
      case bT.FLOATING_FILTER:
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(eee, { ctrl: S, key: S.instanceId });
      default:
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Qq, { ctrl: S, key: S.instanceId });
    }
  }, []);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: m, className: u, role: "row", style: h, "aria-rowindex": a }, p.map(w));
}, iee = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(nee), aee = ({ pinned: e }) => {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!0), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), { context: u } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), l = e === "left", v = e === "right", f = !l && !v, p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((C) => {
    if (s.current = C, i.current = C ? u.createBean(new TX(e)) : u.destroyBean(i.current), !C)
      return;
    const m = {
      setDisplayed: r,
      setCtrls: (h) => a(h),
      // centre only
      setCenterWidth: (h) => {
        c.current && (c.current.style.width = h);
      },
      setViewportScrollLeft: (h) => {
        s.current && (s.current.scrollLeft = h);
      },
      // pinned only
      setPinnedContainerWidth: (h) => {
        s.current && (s.current.style.width = h, s.current.style.minWidth = h, s.current.style.maxWidth = h);
      }
    };
    i.current.setComp(m, s.current);
  }, []), g = t ? "" : "ag-hidden", y = () => n.map((C) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(iee, { ctrl: C, key: C.instanceId }));
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, l && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    "div",
    {
      ref: p,
      className: "ag-pinned-left-header " + g,
      "aria-hidden": !t,
      role: "rowgroup"
    },
    y()
  ), v && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    "div",
    {
      ref: p,
      className: "ag-pinned-right-header " + g,
      "aria-hidden": !t,
      role: "rowgroup"
    },
    y()
  ), f && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: p, className: "ag-header-viewport " + g, role: "presentation" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: c, className: "ag-header-container", role: "rowgroup" }, y())));
}, Dx = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(aee), oee = () => {
  const [e, t] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl()), [r, n] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), { context: a } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((v) => {
    if (u.current = v, s.current = v ? a.createBean(new sX()) : a.destroyBean(s.current), !v)
      return;
    const f = {
      addOrRemoveCssClass: (p, g) => t((y) => y.setClass(p, g)),
      setHeightAndMinHeight: (p) => n(p)
    };
    s.current.setComp(f, v, v);
  }, []), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => "ag-header " + e.toString(), [e]), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      height: r,
      minHeight: r
    }),
    [r]
  );
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: c, className: i, style: l, role: "presentation" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Dx, { pinned: "left" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Dx, { pinned: null }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Dx, { pinned: "right" }));
}, see = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(oee), lee = (e, t) => {
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const r = t.current;
    if (r) {
      const n = r.parentElement;
      if (n) {
        const a = document.createComment(e);
        return n.insertBefore(a, r), () => {
          n.removeChild(a);
        };
      }
    }
  }, [e]);
}, Mh = lee, uee = class {
  constructor(e, t) {
    this.cellEditorParams = e, this.refreshProps = t, this.instanceCreated = new Ia((r) => {
      this.resolveInstanceCreated = r;
    }), this.onValueChange = (r) => this.updateValue(r), this.value = e.value;
  }
  getProps() {
    return {
      ...this.cellEditorParams,
      initialValue: this.cellEditorParams.value,
      value: this.value,
      onValueChange: this.onValueChange
    };
  }
  getValue() {
    return this.value;
  }
  refresh(e) {
    this.cellEditorParams = e, this.refreshProps();
  }
  setMethods(e) {
    vR(this.getOptionalMethods(), e, this);
  }
  getInstance() {
    return this.instanceCreated.then(() => this.componentInstance);
  }
  setRef(e) {
    var t;
    this.componentInstance = e, (t = this.resolveInstanceCreated) == null || t.call(this), this.resolveInstanceCreated = void 0;
  }
  getOptionalMethods() {
    return ["isCancelBeforeStart", "isCancelAfterEnd", "focusIn", "focusOut", "afterGuiAttached"];
  }
  updateValue(e) {
    this.value = e, this.refreshProps();
  }
}, cee = (e) => {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), [, u] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
  n.current && (a.current = !0), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => (n.current || (r.current = t.current(), n.current = !0), u((s) => s + 1), () => {
    var s;
    a.current && ((s = r.current) == null || s.call(r));
  }), []);
}, dee = (e) => {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), { context: n, popupService: a, localeService: u, gos: s, editService: c } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo);
  return cee(() => {
    var E, x;
    const { editDetails: i, cellCtrl: l, eParentCell: v } = e, { compDetails: f } = i, p = s.get("stopEditingWhenCellsLoseFocus"), g = n.createBean(c.createPopupEditorWrapper(f.params)), y = g.getGui();
    if (e.jsChildComp) {
      const T = e.jsChildComp.getGui();
      T && y.appendChild(T);
    }
    const C = {
      column: l.getColumn(),
      rowNode: l.getRowNode(),
      type: "popupCellEditor",
      eventSource: v,
      ePopup: y,
      position: i.popupPosition,
      keepWithinBounds: !0
    }, m = a.positionPopupByComponent.bind(a, C), h = u.getLocaleTextFunc(), w = a.addPopup({
      modal: p,
      eChild: y,
      closeOnEsc: !0,
      closedCallback: () => {
        l.onPopupEditorClosed();
      },
      anchorToElement: v,
      positionCallback: m,
      ariaLabel: h("ariaLabelCellEditor", "Cell Editor")
    }), S = w ? w.hideFunc : void 0;
    return r(g), (x = (E = e.jsChildComp) == null ? void 0 : E.afterGuiAttached) == null || x.call(E), () => {
      S == null || S(), n.destroyBean(g);
    };
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, t && e.wrappedContent && A1.createPortal(e.wrappedContent, t.getGui()));
}, TF = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(dee), fee = (e, t, r, n, a, u) => {
  const { context: s } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    const i = a.current;
    if (!i)
      return;
    const l = i.getGui();
    l && l.parentElement && l.parentElement.removeChild(l), s.destroyBean(i), a.current = void 0;
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const i = e != null, l = (e == null ? void 0 : e.compDetails) && !e.compDetails.componentFromFramework, v = t && r == null;
    if (!(i && l && !v)) {
      c();
      return;
    }
    const p = e.compDetails;
    if (a.current) {
      const y = a.current, m = y.refresh != null && e.force == !1 ? y.refresh(p.params) : !1;
      if (m === !0 || m === void 0)
        return;
      c();
    }
    const g = p.newAgStackInstance();
    g != null && g.then((y) => {
      if (!y)
        return;
      const C = y.getGui();
      if (!C)
        return;
      (t ? r : u.current).appendChild(C), a.current = y;
    });
  }, [e, t, n]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => c, []);
}, hee = fee, pee = (e, t, r) => {
  const { compProxy: n } = e;
  r(n);
  const a = n.getProps(), u = Wv(t);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    pR.Provider,
    {
      value: {
        setMethods: (s) => n.setMethods(s)
      }
    },
    u ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(t, { ...a }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(t, { ...a, ref: (s) => n.setRef(s) })
  );
}, RF = (e, t, r) => {
  const n = e.compProxy;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, n ? pee(e, t, r) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(t, { ...e.compDetails.params, ref: r }));
}, vee = (e, t, r, n, a) => {
  const u = e.compDetails, s = u.componentClass, c = u.componentFromFramework && !e.popup, i = u.componentFromFramework && e.popup, l = !u.componentFromFramework && e.popup;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, c && RF(e, s, t), i && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    TF,
    {
      editDetails: e,
      cellCtrl: n,
      eParentCell: r,
      wrappedContent: RF(e, s, t)
    }
  ), l && a && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    TF,
    {
      editDetails: e,
      cellCtrl: n,
      eParentCell: r,
      jsChildComp: a
    }
  ));
}, gee = (e, t, r, n, a, u, s) => {
  const { compDetails: c, value: i } = e, l = !c, v = c && c.componentFromFramework, f = c && c.componentClass, p = i != null && i.toString ? i.toString() : i, g = () => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, l && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, p), v && !u && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(f, { ...c.params, key: t, ref: n }), v && u && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(f, { ...c.params, key: t }));
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, a ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { role: "presentation", id: `cell-${r}`, className: "ag-cell-value", ref: s }, g()) : g());
}, mee = ({
  cellCtrl: e,
  printLayout: t,
  editingRow: r
}) => {
  const { context: n } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), { colIdSanitised: a, instanceId: u } = e, s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    () => e.isCellRenderer() ? void 0 : { compDetails: void 0, value: e.getValueToDisplay(), force: !1 }
  ), [l, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [f, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1), [g, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [C, m] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [h, w] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [S, E] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [x, T] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e.isForceWrapper(), [e]), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e.getCellAriaRole(), [e]), k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), N = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), Y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), [j, te] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), re = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((le) => {
    Y.current = le, te((ue) => ue + 1);
  }, []), z = c != null && (C || S || h), Z = F || z, W = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (le) => {
      if (A.current = le, le) {
        const ue = le.isCancelBeforeStart && le.isCancelBeforeStart();
        setTimeout(() => {
          ue ? (e.stopEditing(!0), e.focusCell(!0)) : e.cellEditorAttached();
        });
      }
    },
    [e]
  ), q = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  q.current || (q.current = new ny(() => k.current)), hee(c, Z, Y.current, j, L, k);
  const ie = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    var Ge;
    const le = ie.current, ue = c;
    if (ie.current = c, le == null || le.compDetails == null || ue == null || ue.compDetails == null)
      return;
    const ve = le.compDetails, be = ue.compDetails;
    if (ve.componentClass != be.componentClass || ((Ge = I.current) == null ? void 0 : Ge.refresh) == null)
      return;
    I.current.refresh(be.params) != !0 && p((we) => we + 1);
  }, [c]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    if (!(l && !l.compDetails.componentFromFramework))
      return;
    const ue = l.compDetails, ve = l.popup === !0, be = ue.newAgStackInstance();
    return be.then((Me) => {
      if (!Me)
        return;
      const Ge = Me.getGui();
      if (W(Me), !ve) {
        const we = (F ? O : k).current;
        we == null || we.appendChild(Ge), Me.afterGuiAttached && Me.afterGuiAttached();
      }
      T(Me);
    }), () => {
      be.then((Me) => {
        var we;
        const Ge = Me.getGui();
        n.destroyBean(Me), W(void 0), T(void 0), (we = Ge == null ? void 0 : Ge.parentElement) == null || we.removeChild(Ge);
      });
    };
  }, [l]);
  const ce = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (le) => {
      if (O.current = le, !le) {
        N.current.forEach((ve) => ve()), N.current = [];
        return;
      }
      const ue = (ve) => {
        if (ve) {
          const be = ve.getGui();
          le.insertAdjacentElement("afterbegin", be), N.current.push(() => {
            n.destroyBean(ve), _h(be);
          });
        }
        return ve;
      };
      if (C) {
        const ve = e.createSelectionCheckbox();
        ue(ve);
      }
      S && ue(e.createDndSource()), h && ue(e.createRowDragComp());
    },
    [e, n, S, h, C]
  ), X = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((le) => {
    if (k.current = le, s.current = le ? n.createBean(new Hv()) : n.destroyBean(s.current), !le || !e)
      return;
    const ue = {
      addOrRemoveCssClass: (be, Me) => q.current.addOrRemoveCssClass(be, Me),
      setUserStyles: (be) => y(be),
      getFocusableElement: () => k.current,
      setIncludeSelection: (be) => m(be),
      setIncludeRowDrag: (be) => w(be),
      setIncludeDndSource: (be) => E(be),
      getCellEditor: () => A.current || null,
      getCellRenderer: () => I.current ?? L.current,
      getParentOfValue: () => Y.current ?? O.current ?? k.current,
      setRenderDetails: (be, Me, Ge) => {
        i((we) => (we == null ? void 0 : we.compDetails) !== be || (we == null ? void 0 : we.value) !== Me || (we == null ? void 0 : we.force) !== Ge ? {
          value: Me,
          compDetails: be,
          force: Ge
        } : we);
      },
      setEditDetails: (be, Me, Ge, we) => {
        if (be) {
          let Re;
          we ? Re = new uee(
            be.params,
            () => p((Ae) => Ae + 1)
          ) : be.componentFromFramework && gR(), v({
            compDetails: be,
            popup: Me,
            popupPosition: Ge,
            compProxy: Re
          }), Me || i(void 0);
        } else
          v((Re) => {
            Re != null && Re.compProxy && (A.current = void 0);
          });
      }
    }, ve = O.current || void 0;
    e.setComp(ue, le, ve, t, r, s.current);
  }, []), U = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    var ue;
    return !!(((ue = c == null ? void 0 : c.compDetails) == null ? void 0 : ue.componentFromFramework) && Wv(c.compDetails.componentClass));
  }, [c]);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    var le;
    k.current && (q.current.addOrRemoveCssClass("ag-cell-value", !Z), q.current.addOrRemoveCssClass("ag-cell-inline-editing", !!l && !l.popup), q.current.addOrRemoveCssClass("ag-cell-popup-editing", !!l && !!l.popup), q.current.addOrRemoveCssClass("ag-cell-not-inline-editing", !l || !!l.popup), (le = e.getRowCtrl()) == null || le.setInlineEditingCss(), e.shouldRestoreFocus() && !e.isEditing() && k.current.focus({ preventScroll: !0 }));
  });
  const ne = () => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, c != null && gee(
    c,
    f,
    u,
    I,
    Z,
    U,
    re
  ), l != null && vee(l, W, k.current, e, x)), se = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => e.onFocusOut(), []);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: X, style: g, role: P, "col-id": a, onBlur: se }, Z ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "ag-cell-wrapper", role: "presentation", ref: ce }, ne()) : ne());
}, yee = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(mee), Cee = ({ rowCtrl: e, containerType: t }) => {
  const { context: r, gos: n } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e.getDomOrder()), s = e.isFullWidth(), c = e.getRowNode().displayed, [i, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => c ? e.getRowIndex() : null), [v, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => e.getRowId()), [p, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => e.getBusinessKey()), [y, C] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => e.getRowStyles()), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => null), [E, x] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [T, F] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    () => c ? e.getInitialRowTop(t) : void 0
  ), [P, k] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    () => c ? e.getInitialTransform(t) : void 0
  ), I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), [O, N] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var X;
    if (A.current || !E || O > 10)
      return;
    const ce = (X = I.current) == null ? void 0 : X.firstChild;
    ce ? (e.setupDetailRowAutoHeight(ce), A.current = !0) : N((U) => U + 1);
  }, [E, O]);
  const Y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  Y.current || (Y.current = new ny(() => I.current));
  const j = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((ce) => {
    if (I.current = ce, a.current = ce ? r.createBean(new Hv()) : r.destroyBean(a.current), !ce) {
      e.unsetComp(t);
      return;
    }
    if (!e.isAlive())
      return;
    const X = {
      // the rowTop is managed by state, instead of direct style manipulation by rowCtrl (like all the other styles)
      // as we need to have an initial value when it's placed into he DOM for the first time, for animation to work.
      setTop: F,
      setTransform: k,
      // i found using React for managing classes at the row level was to slow, as modifying classes caused a lot of
      // React code to execute, so avoiding React for managing CSS Classes made the grid go much faster.
      addOrRemoveCssClass: (U, ne) => Y.current.addOrRemoveCssClass(U, ne),
      setDomOrder: (U) => u.current = U,
      setRowIndex: l,
      setRowId: f,
      setRowBusinessKey: g,
      setUserStyles: C,
      // if we don't maintain the order, then cols will be ripped out and into the dom
      // when cols reordered, which would stop the CSS transitions from working
      setCellCtrls: (U, ne) => {
        h.current = m.current, m.current = U;
        const se = hR(h.current, U, u.current);
        se !== h.current && fR(ne, () => S(se));
      },
      showFullWidth: (U) => x(U),
      getFullWidthCellRenderer: () => L.current,
      refreshFullWidth: (U) => W.current ? (x((ne) => ({
        ...ne,
        params: U()
      })), !0) : !L.current || !L.current.refresh ? !1 : L.current.refresh(U())
    };
    e.setComp(X, ce, t, a.current);
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(
    () => oy(E, r, I.current, L),
    [E]
  );
  const te = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    const ce = { top: T, transform: P };
    return Object.assign(ce, y), ce;
  }, [T, P, y]), re = s && (E == null ? void 0 : E.componentFromFramework), z = !s && w != null, Z = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => !!((E == null ? void 0 : E.componentFromFramework) && Wv(E.componentClass)), [E]), W = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    W.current = Z && !!E && !!n.get("reactiveCustomComponents");
  }, [Z, E]);
  const q = () => w == null ? void 0 : w.map((ce) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    yee,
    {
      cellCtrl: ce,
      editingRow: e.isEditing(),
      printLayout: e.isPrintLayout(),
      key: ce.instanceId
    }
  )), ie = () => {
    const ce = E.componentClass;
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, Z ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ce, { ...E.params }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ce, { ...E.params, ref: L }));
  };
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    "div",
    {
      ref: j,
      role: "row",
      style: te,
      "row-index": i,
      "row-id": v,
      "row-business-key": p
    },
    z && q(),
    re && ie()
  );
}, bee = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(Cee), wee = ({ name: e }) => {
  const { context: t } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => vv(e), [e]), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => []), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uu(r.viewport), [r]), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uu(r.container), [r]), g = r.type === "center", y = g ? n : a;
  Mh(" AG Row Container " + e + " ", y);
  const C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => g ? n.current != null && a.current != null : a.current != null, []), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => g ? n.current == null && a.current == null : a.current == null, []), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (m() && (v.current = t.destroyBean(v.current)), C()) {
      const x = (F) => {
        const P = hR(
          s.current,
          u.current,
          l.current
        );
        P !== s.current && (s.current = P, fR(F, () => i(P)));
      }, T = {
        setHorizontalScroll: (F) => {
          n.current && (n.current.scrollLeft = F);
        },
        setViewportHeight: (F) => {
          n.current && (n.current.style.height = F);
        },
        setRowCtrls: ({ rowCtrls: F, useFlushSync: P }) => {
          const k = !!P && u.current.length > 0 && F.length > 0;
          u.current = F, x(k);
        },
        setDomOrder: (F) => {
          l.current != F && (l.current = F, x(!1));
        },
        setContainerWidth: (F) => {
          a.current && (a.current.style.width = F);
        },
        setOffsetTop: (F) => {
          a.current && (a.current.style.transform = `translateY(${F})`);
        }
      };
      v.current = t.createBean(new g$(e)), v.current.setComp(T, a.current, n.current);
    }
  }, [C, m]), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (x) => {
      a.current = x, h();
    },
    [h]
  ), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (x) => {
      n.current = x, h();
    },
    [h]
  ), E = () => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: p, ref: w, role: "rowgroup" }, c.map((x) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(bee, { rowCtrl: x, containerType: r.type, key: x.instanceId })));
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, g ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: f, ref: S, role: "presentation" }, E()) : E());
}, See = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(wee), xee = () => {
  const { context: e, resizeObserverService: t } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), [r, n] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [a, u] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), [s, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), [i, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("0px"), [v, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("0px"), [p, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("100%"), [y, C] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("0px"), [m, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("0px"), [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("100%"), [E, x] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [T, F] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [P, k] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [I, L] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [A, O] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [N, Y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("ag-layout-normal"), j = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  j.current || (j.current = new ny(() => te.current));
  const te = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), re = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), z = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), Z = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), W = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), q = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), ie = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), ce = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), X = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]);
  Mh(" AG Grid Body ", te), Mh(" AG Pinned Top ", re), Mh(" AG Sticky Top ", z), Mh(" AG Middle ", q), Mh(" AG Pinned Bottom ", ie);
  const U = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((oe) => {
    if (te.current = oe, !oe) {
      ce.current = e.destroyBeans(ce.current), X.current.forEach((me) => me()), X.current = [];
      return;
    }
    if (!e)
      return;
    const _ = (me, xe) => {
      me.appendChild(xe), X.current.push(() => me.removeChild(xe));
    }, V = (me) => {
      const xe = e.createBean(new me());
      return ce.current.push(xe), xe;
    }, fe = (me, xe, Fe) => {
      _(me, document.createComment(Fe)), _(me, V(xe).getGui());
    };
    fe(oe, AX, " AG Fake Horizontal Scroll "), fe(oe, RX, " AG Overlay Wrapper "), W.current && fe(W.current, EX, " AG Fake Vertical Scroll ");
    const $ = {
      setRowAnimationCssOnBodyViewport: n,
      setColumnCount: (me) => {
        te.current && VU(te.current, me);
      },
      setRowCount: (me) => {
        te.current && HU(te.current, me);
      },
      setTopHeight: u,
      setBottomHeight: c,
      setStickyTopHeight: l,
      setStickyTopTop: f,
      setStickyTopWidth: g,
      setTopDisplay: x,
      setBottomDisplay: F,
      setColumnMovingCss: (me, xe) => j.current.addOrRemoveCssClass(me, xe),
      updateLayoutClasses: Y,
      setAlwaysVerticalScrollClass: k,
      setPinnedTopBottomOverflowY: L,
      setCellSelectableCss: (me, xe) => O(xe ? me : null),
      setBodyViewportWidth: (me) => {
        q.current && (q.current.style.width = me);
      },
      registerBodyViewportResizeListener: (me) => {
        if (q.current) {
          const xe = t.observeResize(q.current, me);
          X.current.push(() => xe());
        }
      },
      setStickyBottomHeight: C,
      setStickyBottomBottom: h,
      setStickyBottomWidth: S
    }, he = e.createBean(new b$());
    ce.current.push(he), he.setComp(
      $,
      oe,
      q.current,
      re.current,
      ie.current,
      z.current,
      Z.current
    );
  }, []), ne = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uu("ag-root", "ag-unselectable", N), [N]), se = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => uu(
      "ag-body-viewport",
      r,
      N,
      P,
      A
    ),
    [r, N, P, A]
  ), le = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uu("ag-body", N), [N]), ue = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uu("ag-floating-top", A), [A]), ve = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uu("ag-sticky-top", A), [A]), be = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => uu("ag-sticky-bottom", y === "0px" ? "ag-hidden" : null, A),
    [A, y]
  ), Me = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uu("ag-floating-bottom", A), [A]), Ge = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      height: a,
      minHeight: a,
      display: E,
      overflowY: I
    }),
    [a, E, I]
  ), we = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      height: i,
      top: v,
      width: p
    }),
    [i, v, p]
  ), Re = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      height: y,
      bottom: m,
      width: w
    }),
    [y, m, w]
  ), Ae = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      height: s,
      minHeight: s,
      display: T,
      overflowY: I
    }),
    [s, T, I]
  ), K = (oe) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(See, { name: oe, key: `${oe}-container` }), ee = ({
    section: oe,
    children: _,
    className: V,
    style: fe
  }) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: oe, className: V, role: "presentation", style: fe }, _.map(K));
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: U, className: ne, role: "treegrid" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(see, null), ee({
    section: re,
    className: ue,
    style: Ge,
    children: ["topLeft", "topCenter", "topRight", "topFullWidth"]
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: le, ref: W, role: "presentation" }, ee({
    section: q,
    className: se,
    children: ["left", "center", "right", "fullWidth"]
  })), ee({
    section: z,
    className: ve,
    style: we,
    children: ["stickyTopLeft", "stickyTopCenter", "stickyTopRight", "stickyTopFullWidth"]
  }), ee({
    section: Z,
    className: be,
    style: Re,
    children: ["stickyBottomLeft", "stickyBottomCenter", "stickyBottomRight", "stickyBottomFullWidth"]
  }), ee({
    section: ie,
    className: Me,
    style: Ae,
    children: ["bottomLeft", "bottomCenter", "bottomRight", "bottomFullWidth"]
  }));
}, Tee = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(xee), Ree = (e, t) => {
  const { children: r, eFocusableElement: n, onTabKeyDown: a, gridCtrl: u, forceFocusOutWhenTabGuardsAreEmpty: s } = e, { context: c } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), f = (m) => {
    const h = m == null ? void 0 : parseInt(m, 10).toString();
    [i, l].forEach((w) => {
      var S, E;
      h === void 0 ? (S = w.current) == null || S.removeAttribute("tabindex") : (E = w.current) == null || E.setAttribute("tabindex", h);
    });
  };
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(t, () => ({
    forceFocusOutOfContainer(m) {
      var h;
      (h = v.current) == null || h.forceFocusOutOfContainer(m);
    }
  }));
  const p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    const m = i.current, h = l.current;
    if (!m && !h) {
      v.current = c.destroyBean(v.current);
      return;
    }
    if (m && h) {
      const w = {
        setTabIndex: f
      };
      v.current = c.createBean(
        new r4({
          comp: w,
          eTopGuard: m,
          eBottomGuard: h,
          eFocusableElement: n,
          onTabKeyDown: a,
          forceFocusOutWhenTabGuardsAreEmpty: s,
          focusInnerElement: (S) => u.focusInnerElement(S)
        })
      );
    }
  }, []), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (m) => {
      i.current = m, p();
    },
    [p]
  ), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (m) => {
      l.current = m, p();
    },
    [p]
  ), C = (m) => {
    const h = m === "top" ? OC.TAB_GUARD_TOP : OC.TAB_GUARD_BOTTOM;
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
      "div",
      {
        className: `${OC.TAB_GUARD} ${h}`,
        role: "presentation",
        ref: m === "top" ? g : y
      }
    );
  };
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, C("top"), r, C("bottom"));
}, Aee = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(Ree), Eee = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(Aee), Mee = ({ context: e }) => {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [l, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [f, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [g, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(() => {
  }), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), T = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
  }, []), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e.isDestroyed() ? null : e.getBeans(), [e]);
  Mh(" AG Grid ", m);
  const k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((N) => {
    if (m.current = N, C.current = N ? e.createBean(new KZ()) : e.destroyBean(C.current), !N || e.isDestroyed())
      return;
    const Y = C.current;
    E.current = Y.focusInnerElement.bind(Y);
    const j = {
      destroyGridUi: () => {
      },
      // do nothing, as framework users destroy grid by removing the comp
      setRtlClass: r,
      setGridThemeClass: a,
      forceFocusOutOfContainer: (te) => {
        var re, z;
        if (!te && ((re = x.current) != null && re.isDisplayed())) {
          x.current.forceFocusOutOfContainer(te);
          return;
        }
        (z = h.current) == null || z.forceFocusOutOfContainer(te);
      },
      updateLayoutClasses: s,
      getFocusableContainers: () => {
        var z;
        const te = [], re = (z = m.current) == null ? void 0 : z.querySelector(".ag-root");
        return re && te.push({ getGui: () => re }), T.current.forEach((Z) => {
          Z.isDisplayed() && te.push(Z);
        }), te;
      },
      setCursor: i,
      setUserSelect: v
    };
    Y.setComp(j, N, N), p(!0);
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const N = C.current, Y = m.current;
    if (!g || !P || !N || !w || !Y)
      return;
    const j = [], {
      watermarkSelector: te,
      paginationSelector: re,
      sideBarSelector: z,
      statusBarSelector: Z,
      gridHeaderDropZonesSelector: W
    } = N.getOptionalSelectors(), q = [];
    if (W) {
      const ce = e.createBean(new W.component()), X = ce.getGui();
      Y.insertAdjacentElement("afterbegin", X), q.push(X), j.push(ce);
    }
    if (z) {
      const ce = e.createBean(new z.component()), X = ce.getGui(), U = w.querySelector(".ag-tab-guard-bottom");
      U && (U.insertAdjacentElement("beforebegin", X), q.push(X)), j.push(ce), T.current.push(ce);
    }
    const ie = (ce) => {
      const X = e.createBean(new ce()), U = X.getGui();
      return Y.insertAdjacentElement("beforeend", U), q.push(U), j.push(X), X;
    };
    if (Z && ie(Z.component), re) {
      const ce = ie(re.component);
      x.current = ce, T.current.push(ce);
    }
    return te && ie(te.component), () => {
      e.destroyBeans(j), q.forEach((ce) => {
        var X;
        (X = ce.parentElement) == null || X.removeChild(ce);
      });
    };
  }, [g, w, P]);
  const I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => uu("ag-root-wrapper", t, n, u),
    [t, n, u]
  ), L = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => uu("ag-root-wrapper-body", "ag-focus-managed", u),
    [u]
  ), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      userSelect: l ?? "",
      WebkitUserSelect: l ?? "",
      cursor: c ?? ""
    }),
    [l, c]
  ), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((N) => {
    h.current = N, y(N !== null);
  }, []);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { ref: k, className: I, style: A, role: "presentation" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: L, ref: S, role: "presentation" }, f && w && P && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Wo.Provider, { value: P }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    Eee,
    {
      ref: O,
      eFocusableElement: w,
      onTabKeyDown: F,
      gridCtrl: C.current,
      forceFocusOutWhenTabGuardsAreEmpty: !0
    },
    // we wait for initialised before rending the children, so GridComp has created and registered with it's
    // GridCtrl before we create the child GridBodyComp. Otherwise the GridBodyComp would initialise first,
    // before we have set the the Layout CSS classes, causing the GridBodyComp to render rows to a grid that
    // doesn't have it's height specified, which would result if all the rows getting rendered (and if many rows,
    // hangs the UI)
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Tee, null)
  ))));
}, Dee = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(Mee), Fee = class extends mr {
  wireBeans(e) {
    this.ctrlsService = e.ctrlsService;
  }
  areHeaderCellsRendered() {
    return this.ctrlsService.getHeaderRowContainerCtrls().every((e) => e.getAllCtrls().every((t) => t.areCellsRendered()));
  }
}, b4 = (e) => {
  var m;
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), [v, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(void 0), [, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((h) => {
    if (r.current = h, !h) {
      a.current.forEach((L) => L()), a.current.length = 0;
      return;
    }
    const w = e.modules || [];
    n.current || (n.current = new Kq(
      () => p((L) => L + 1),
      e.componentWrappingElement,
      e.maxComponentCreationTimeMs
    ), a.current.push(() => {
      var L;
      (L = n.current) == null || L.destroy(), n.current = null;
    }));
    const S = DU(e.gridOptions, e), E = () => {
      if (l.current) {
        const L = () => {
          var O;
          return (O = c.current) != null && O.shouldQueueUpdates() ? void 0 : u.current.shift();
        };
        let A = L();
        for (; A; )
          A(), A = L();
      }
    }, x = new kee(E);
    c.current = x;
    const T = new Fee(), F = {
      providedBeanInstances: {
        frameworkComponentWrapper: new Iee(
          n.current,
          S.reactiveCustomComponents ?? xq("reactiveCustomComponents") ?? !0
        ),
        renderStatusService: T
      },
      modules: w,
      frameworkOverrides: x
    }, P = (L) => {
      f(L), L.createBean(T), a.current.push(() => {
        L.destroy();
      }), L.getBean("ctrlsService").whenReady(
        {
          addDestroyFunc: (A) => {
            a.current.push(A);
          }
        },
        () => {
          var O;
          if (L.isDestroyed())
            return;
          const A = t.current;
          A && ((O = e.setGridApi) == null || O.call(e, A));
        }
      );
    }, k = (L) => {
      L.getBean("ctrlsService").whenReady(
        {
          addDestroyFunc: (A) => {
            a.current.push(A);
          }
        },
        () => {
          u.current.forEach((A) => A()), u.current.length = 0, l.current = !0;
        }
      );
    }, I = new Rq();
    S.gridId ?? (S.gridId = i.current), t.current = I.create(
      h,
      S,
      P,
      k,
      F
    ), a.current.push(() => {
      t.current = void 0;
    }), i.current = t.current.getGridId();
  }, []), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    height: "100%",
    ...e.containerStyle || {}
  }), [e.containerStyle]), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((h) => {
    var w;
    l.current && !((w = c.current) != null && w.shouldQueueUpdates()) ? h() : u.current.push(h);
  }, []);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const h = Pee(s.current, e);
    s.current = e, C(() => {
      t.current && FU(h, t.current);
    });
  }, [e]), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { style: y, className: e.className, ref: g }, v && !v.isDestroyed() ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Dee, { context: v }) : null, ((m = n.current) == null ? void 0 : m.getPortals()) ?? null);
};
function Pee(e, t) {
  const r = {};
  return Object.keys(t).forEach((n) => {
    const a = t[n];
    e[n] !== a && (r[n] = a);
  }), r;
}
var Iee = class extends Pq {
  constructor(e, t) {
    super(), this.parent = e, this.reactiveCustomComponents = t;
  }
  createWrapper(e, t) {
    if (this.reactiveCustomComponents) {
      const a = ((u) => {
        switch (u) {
          case "filter":
            return zq;
          case "floatingFilterComponent":
            return _q;
          case "dateComponent":
            return Bq;
          case "dragAndDropImageComponent":
            return Vq;
          case "loadingOverlayComponent":
            return Uq;
          case "noRowsOverlayComponent":
            return Yq;
          case "statusPanel":
            return Xq;
          case "toolPanel":
            return $q;
          case "menuItem":
            return jq;
          case "cellRenderer":
            return Hq;
        }
      })(t.propertyName);
      if (a)
        return new a(e, this.parent, t);
    } else
      switch (t.propertyName) {
        case "filter":
        case "floatingFilterComponent":
        case "dateComponent":
        case "dragAndDropImageComponent":
        case "loadingOverlayComponent":
        case "noRowsOverlayComponent":
        case "statusPanel":
        case "toolPanel":
        case "menuItem":
        case "cellRenderer":
          gR();
          break;
      }
    const r = !t.cellRenderer && t.propertyName !== "toolPanel";
    return new y4(e, this.parent, t, r);
  }
}, Lee = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((e, t) => {
  const { ctrlsFactory: r, context: n, gos: a, resizeObserverService: u, rowModel: s } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Wo), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl()), [l, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => new Hl()), [f, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [g, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => tc.__getGridRegisteredModules(e.api.getGridId()), [e]), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => c.toString() + " ag-details-row", [c]), E = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => l.toString() + " ag-details-grid", [l]);
  t && (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(t, () => ({
    refresh() {
      var F;
      return ((F = C.current) == null ? void 0 : F.refresh()) ?? !1;
    }
  })), e.template && Fr(
    "detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/"
  );
  const x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((F) => {
    var I;
    if (m.current = F, !F) {
      C.current = n.destroyBean(C.current), (I = h.current) == null || I.call(h);
      return;
    }
    const P = {
      addOrRemoveCssClass: (L, A) => i((O) => O.setClass(L, A)),
      addOrRemoveDetailGridCssClass: (L, A) => v((O) => O.setClass(L, A)),
      setDetailGrid: (L) => p(L),
      setRowData: (L) => y(L),
      getGui: () => m.current
    }, k = r.getInstance("detailCellRenderer");
    if (k && (n.createBean(k), k.init(P, e), C.current = k, a.get("detailRowAutoHeight"))) {
      const L = () => {
        if (m.current == null)
          return;
        const A = m.current.clientHeight;
        A != null && A > 0 && setTimeout(() => {
          e.node.setRowHeight(A), (da(a) || sd(a)) && s.onRowHeightChanged();
        }, 0);
      };
      h.current = u.observeResize(F, L), L();
    }
  }, []), T = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((F) => {
    var P;
    (P = C.current) == null || P.registerDetailWithMaster(F);
  }, []);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: S, ref: x }, f && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
    b4,
    {
      className: E,
      ...f,
      modules: w,
      rowData: g,
      setGridApi: T
    }
  ));
}), kee = class extends n4 {
  constructor(e) {
    super("react"), this.processQueuedUpdates = e, this.queueUpdates = !1, this.frameworkComponents = {
      agGroupCellRenderer: SF,
      agGroupRowRenderer: SF,
      agDetailCellRenderer: Lee
    }, this.wrapIncoming = (t, r) => r === "ensureVisible" ? kq(t) : t(), this.renderingEngine = "react";
  }
  frameworkComponent(e) {
    return this.frameworkComponents[e];
  }
  isFrameworkComponent(e) {
    if (!e)
      return !1;
    const t = e.prototype;
    return !(t && "getGui" in t);
  }
  getLockOnRefresh() {
    this.queueUpdates = !0;
  }
  releaseLockOnRefresh() {
    this.queueUpdates = !1, this.processQueuedUpdates();
  }
  shouldQueueUpdates() {
    return this.queueUpdates;
  }
  runWhenReadyAsync() {
    return Lq();
  }
}, Oee = class extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
  constructor() {
    super(...arguments), this.apiListeners = [], this.setGridApi = (e) => {
      this.api = e, this.apiListeners.forEach((t) => t(e));
    };
  }
  registerApiListener(e) {
    this.apiListeners.push(e);
  }
  componentWillUnmount() {
    this.apiListeners.length = 0;
  }
  render() {
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(b4, { ...this.props, setGridApi: this.setGridApi });
  }
}, Nee = "ROOT_NODE_ID", Fx = 0, Gee = class {
  constructor(e, t, r, n, a, u) {
    this.nextId = 0, this.rowCountReady = !1, this.allNodesMap = {}, this.rootNode = e, this.gos = t, this.eventService = r, this.funcColsService = n, this.beans = u, this.selectionService = a, this.rootNode.group = !0, this.rootNode.level = -1, this.rootNode.id = Nee, this.rootNode.allLeafChildren = [], this.rootNode.childrenAfterGroup = [], this.rootNode.childrenAfterSort = [], this.rootNode.childrenAfterAggFilter = [], this.rootNode.childrenAfterFilter = [];
  }
  getCopyOfNodesMap() {
    return VL(this.allNodesMap);
  }
  getRowNode(e) {
    return this.allNodesMap[e];
  }
  setRowData(e) {
    if (typeof e == "string") {
      Fr("rowData must be an array.");
      return;
    }
    this.rowCountReady = !0, this.dispatchRowDataUpdateStartedEvent(e);
    const t = this.rootNode, r = this.rootNode.sibling;
    t.childrenAfterFilter = null, t.childrenAfterGroup = null, t.childrenAfterAggFilter = null, t.childrenAfterSort = null, t.childrenMapped = null, t.updateHasChildren(), this.nextId = 0, this.allNodesMap = {}, e ? t.allLeafChildren = e.map(
      (n, a) => this.createNode(n, this.rootNode, Fx, a)
    ) : (t.allLeafChildren = [], t.childrenAfterGroup = []), r && (r.childrenAfterFilter = t.childrenAfterFilter, r.childrenAfterGroup = t.childrenAfterGroup, r.childrenAfterAggFilter = t.childrenAfterAggFilter, r.childrenAfterSort = t.childrenAfterSort, r.childrenMapped = t.childrenMapped, r.allLeafChildren = t.allLeafChildren);
  }
  updateRowData(e) {
    this.rowCountReady = !0, this.dispatchRowDataUpdateStartedEvent(e.add);
    const t = {
      rowNodeTransaction: { remove: [], update: [], add: [] },
      rowsInserted: !1
    }, r = [];
    return this.executeRemove(e, t, r), this.executeUpdate(e, t, r), this.executeAdd(e, t), this.updateSelection(r, "rowDataChanged"), t;
  }
  /**
   * Used by the immutable service, after updateRowData, after updating with a generated transaction to
   * apply the order as specified by the the new data. We use sourceRowIndex to determine the order of the rows.
   * Time complexity is O(n) where n is the number of rows/rowData
   * @returns true if the order changed, otherwise false
   */
  updateRowOrderFromRowData(e) {
    const t = this.rootNode.allLeafChildren, r = (t == null ? void 0 : t.length) ?? 0, n = /* @__PURE__ */ new Map();
    let a = -1, u = -1;
    for (let s = 0; s < r; ++s) {
      const c = t[s], i = c.data;
      i !== e[s] && (u < 0 && (a = s), u = s, n.set(i, c));
    }
    if (a < 0)
      return !1;
    for (let s = a; s <= u; ++s) {
      const c = n.get(e[s]);
      c !== void 0 && (t[s] = c, c.sourceRowIndex = s);
    }
    return !0;
  }
  isRowCountReady() {
    return this.rowCountReady;
  }
  dispatchRowDataUpdateStartedEvent(e) {
    this.eventService.dispatchEvent({
      type: "rowDataUpdateStarted",
      firstRowData: e != null && e.length ? e[0] : null
    });
  }
  updateSelection(e, t) {
    const r = e.length > 0;
    r && this.selectionService.setNodesSelected({
      newValue: !1,
      nodes: e,
      suppressFinishActions: !0,
      source: t
    }), this.selectionService.updateGroupsFromChildrenSelections(t), r && this.eventService.dispatchEvent({
      type: "selectionChanged",
      source: t
    });
  }
  executeAdd(e, t) {
    const r = e.add;
    if (Rs(r))
      return;
    const n = this.rootNode.allLeafChildren;
    let a = n.length;
    if (typeof e.addIndex == "number" && (a = this.sanitizeAddIndex(e.addIndex), a > 0 && this.gos.get("treeData")))
      for (let i = 0; i < n.length; i++) {
        const l = n[i];
        if ((l == null ? void 0 : l.rowIndex) == a - 1) {
          a = i + 1;
          break;
        }
      }
    const u = r.map(
      (c, i) => this.createNode(c, this.rootNode, Fx, a + i)
    );
    if (a < n.length) {
      const c = n.slice(0, a), i = n.slice(a, n.length), l = c.length + u.length;
      for (let v = 0, f = i.length; v < f; ++v)
        i[v].sourceRowIndex = l + v;
      this.rootNode.allLeafChildren = [...c, ...u, ...i], t.rowsInserted = !0;
    } else
      this.rootNode.allLeafChildren = n.concat(u);
    const s = this.rootNode.sibling;
    s && (s.allLeafChildren = n), t.rowNodeTransaction.add = u;
  }
  sanitizeAddIndex(e) {
    var r;
    const t = ((r = this.rootNode.allLeafChildren) == null ? void 0 : r.length) ?? 0;
    return e < 0 || e >= t || Number.isNaN(e) ? t : Math.ceil(e);
  }
  executeRemove(e, { rowNodeTransaction: t }, r) {
    var s, c;
    const { remove: n } = e;
    if (Rs(n))
      return;
    const a = {};
    n.forEach((i) => {
      const l = this.lookupRowNode(i);
      l && (l.isSelected() && r.push(l), l.clearRowTopAndRowIndex(), a[l.id] = !0, delete this.allNodesMap[l.id], t.remove.push(l));
    }), this.rootNode.allLeafChildren = ((s = this.rootNode.allLeafChildren) == null ? void 0 : s.filter((i) => !a[i.id])) ?? null, (c = this.rootNode.allLeafChildren) == null || c.forEach((i, l) => {
      i.sourceRowIndex = l;
    });
    const u = this.rootNode.sibling;
    u && (u.allLeafChildren = this.rootNode.allLeafChildren);
  }
  executeUpdate(e, { rowNodeTransaction: t }, r) {
    const { update: n } = e;
    Rs(n) || n.forEach((a) => {
      const u = this.lookupRowNode(a);
      u && (u.updateData(a), !u.selectable && u.isSelected() && r.push(u), this.setMasterForRow(u, a, Fx, !1), t.update.push(u));
    });
  }
  lookupRowNode(e) {
    var n;
    const t = ty(this.gos);
    let r;
    if (t) {
      const a = t({ data: e, level: 0 });
      if (r = this.allNodesMap[a], !r)
        return Ni(`could not find row id=${a}, data item was not found for this id`), null;
    } else if (r = (n = this.rootNode.allLeafChildren) == null ? void 0 : n.find((a) => a.data === e), !r)
      return Ni("could not find data item as object was not found", e), Ni("Consider using getRowId to help the Grid find matching row data"), null;
    return r || null;
  }
  createNode(e, t, r, n) {
    const a = new Oh(this.beans);
    return a.sourceRowIndex = n, a.group = !1, this.setMasterForRow(a, e, r, !0), t && (a.parent = t), a.level = r, a.setDataAndId(e, this.nextId.toString()), this.allNodesMap[a.id] && Fr(
      `duplicate node id '${a.id}' detected from getRowId callback, this could cause issues in your grid.`
    ), this.allNodesMap[a.id] = a, this.nextId++, a;
  }
  setMasterForRow(e, t, r, n) {
    if (this.gos.get("treeData"))
      e.setMaster(!1), n && (e.expanded = !1);
    else {
      if (this.gos.get("masterDetail")) {
        const s = this.gos.get("isRowMaster");
        s ? e.setMaster(s(t)) : e.setMaster(!0);
      } else
        e.setMaster(!1);
      if (n) {
        const s = this.funcColsService.getRowGroupColumns(), c = s ? s.length : 0, i = r + c;
        e.expanded = e.master ? this.isExpanded(i) : !1;
      }
    }
  }
  isExpanded(e) {
    const t = this.gos.get("groupDefaultExpanded");
    return t === -1 ? !0 : e < t;
  }
}, Hee = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "rowModel", this.onRowHeightChanged_debounced = Cs(this.onRowHeightChanged.bind(this), 100), this.rowsToDisplay = [], this.hasStarted = !1, this.shouldSkipSettingDataOnStart = !1, this.isRefreshingModel = !1, this.rowCountReady = !1;
  }
  wireBeans(e) {
    this.beans = e, this.columnModel = e.columnModel, this.funcColsService = e.funcColsService, this.selectionService = e.selectionService, this.valueCache = e.valueCache, this.environment = e.environment, this.filterStage = e.filterStage, this.sortStage = e.sortStage, this.flattenStage = e.flattenStage, this.groupStage = e.groupStage, this.aggregationStage = e.aggregationStage, this.pivotStage = e.pivotStage, this.filterAggregatesStage = e.filterAggregatesStage;
  }
  postConstruct() {
    const e = this.refreshModel.bind(this, { step: fi.EVERYTHING }), t = !this.gos.get("suppressAnimationFrame"), r = this.refreshModel.bind(this, {
      step: fi.EVERYTHING,
      // after cols change, row grouping (the first stage) could of changed
      afterColumnsChanged: !0,
      keepRenderedRows: !0,
      // we want animations cos sorting or filtering could be applied
      animate: t
    });
    this.addManagedEventListeners({
      newColumnsLoaded: r,
      columnRowGroupChanged: e,
      columnValueChanged: this.onValueChanged.bind(this),
      columnPivotChanged: this.refreshModel.bind(this, { step: fi.PIVOT }),
      filterChanged: this.onFilterChanged.bind(this),
      sortChanged: this.onSortChanged.bind(this),
      columnPivotModeChanged: e,
      gridStylesChanged: this.onGridStylesChanges.bind(this),
      gridReady: this.onGridReady.bind(this)
    }), this.addPropertyListeners(), this.rootNode = new Oh(this.beans), this.nodeManager = new Gee(
      this.rootNode,
      this.gos,
      this.eventService,
      this.funcColsService,
      this.selectionService,
      this.beans
    );
  }
  addPropertyListeners() {
    const e = /* @__PURE__ */ new Set(["treeData", "masterDetail"]), t = /* @__PURE__ */ new Set([
      "groupDefaultExpanded",
      "groupAllowUnbalanced",
      "initialGroupOrderComparator",
      "groupHideOpenParents",
      "groupDisplayType"
    ]), r = /* @__PURE__ */ new Set(["excludeChildrenWhenTreeDataFiltering"]), n = /* @__PURE__ */ new Set([
      "removePivotHeaderRowWhenSingleValueColumn",
      "pivotRowTotals",
      "pivotColumnGroupTotals",
      "suppressExpandablePivotGroups"
    ]), a = /* @__PURE__ */ new Set([
      "getGroupRowAgg",
      "alwaysAggregateAtRootLevel",
      "groupIncludeTotalFooter",
      "suppressAggFilteredOnly",
      "grandTotalRow"
    ]), u = /* @__PURE__ */ new Set([
      "postSortRows",
      "groupDisplayType",
      "accentedSort"
    ]), s = /* @__PURE__ */ new Set([]), c = /* @__PURE__ */ new Set([
      "groupRemoveSingleChildren",
      "groupRemoveLowestSingleChildren",
      "groupIncludeFooter",
      "groupTotalRow"
    ]), i = [
      ...e,
      ...t,
      ...r,
      ...n,
      ...n,
      ...a,
      ...u,
      ...s,
      ...c
    ];
    this.addManagedPropertyListeners(i, (l) => {
      var p;
      const v = (p = l.changeSet) == null ? void 0 : p.properties;
      if (!v)
        return;
      const f = (g) => v.some((y) => g.has(y));
      if (f(e)) {
        this.setRowData(this.rootNode.allLeafChildren.map((g) => g.data));
        return;
      }
      if (f(t)) {
        this.refreshModel({ step: fi.EVERYTHING });
        return;
      }
      if (f(r)) {
        this.refreshModel({ step: fi.FILTER });
        return;
      }
      if (f(n)) {
        this.refreshModel({ step: fi.PIVOT });
        return;
      }
      if (f(a)) {
        this.refreshModel({ step: fi.AGGREGATE });
        return;
      }
      if (f(u)) {
        this.refreshModel({ step: fi.SORT });
        return;
      }
      if (f(s)) {
        this.refreshModel({ step: fi.FILTER_AGGREGATES });
        return;
      }
      f(c) && this.refreshModel({ step: fi.MAP });
    }), this.addManagedPropertyListener("rowHeight", () => this.resetRowHeights());
  }
  start() {
    this.hasStarted = !0, this.shouldSkipSettingDataOnStart ? this.dispatchUpdateEventsAndRefresh() : this.setInitialData();
  }
  setInitialData() {
    const e = this.gos.get("rowData");
    e && (this.shouldSkipSettingDataOnStart = !0, this.setRowData(e));
  }
  ensureRowHeightsValid(e, t, r, n) {
    let a, u = !1;
    do {
      a = !1;
      const s = this.getRowIndexAtPixel(e), c = this.getRowIndexAtPixel(t), i = Math.max(s, r), l = Math.min(c, n);
      for (let v = i; v <= l; v++) {
        const f = this.getRow(v);
        if (f.rowHeightEstimated) {
          const p = af(this.gos, f);
          f.setRowHeight(p.height), a = !0, u = !0;
        }
      }
      a && this.setRowTopAndRowIndex();
    } while (a);
    return u;
  }
  setRowTopAndRowIndex() {
    const e = this.environment.getDefaultRowHeight();
    let t = 0;
    const r = /* @__PURE__ */ new Set(), n = Ao(this.gos, "normal");
    for (let a = 0; a < this.rowsToDisplay.length; a++) {
      const u = this.rowsToDisplay[a];
      if (u.id != null && r.add(u.id), u.rowHeight == null) {
        const s = af(this.gos, u, n, e);
        u.setRowHeight(s.height, s.estimated);
      }
      u.setRowTop(t), u.setRowIndex(a), t += u.rowHeight;
    }
    return r;
  }
  clearRowTopAndRowIndex(e, t) {
    const r = e.isActive(), n = (u) => {
      u && u.id != null && !t.has(u.id) && u.clearRowTopAndRowIndex();
    }, a = (u) => {
      if (n(u), n(u.detailNode), n(u.sibling), u.hasChildren() && u.childrenAfterGroup) {
        const s = u.level == -1;
        r && !s && !u.expanded || u.childrenAfterGroup.forEach(a);
      }
    };
    a(this.rootNode);
  }
  // returns false if row was moved, otherwise true
  ensureRowsAtPixel(e, t, r = 0) {
    const n = this.getRowIndexAtPixel(t), a = this.getRow(n), u = !this.gos.get("suppressAnimationFrame");
    if (a === e[0])
      return !1;
    const s = this.rootNode.allLeafChildren;
    return e.forEach((c) => {
      bs(s, c);
    }), e.forEach((c, i) => {
      h1(s, c, Math.max(n + r, 0) + i);
    }), e.forEach((c, i) => {
      c.sourceRowIndex = i;
    }), this.refreshModel({
      step: fi.EVERYTHING,
      keepRenderedRows: !0,
      keepEditingRows: !0,
      animate: u,
      rowNodesOrderChanged: !0
      // We assume the order changed and we don't need to check if it really did
    }), !0;
  }
  highlightRowAtPixel(e, t) {
    const r = t != null ? this.getRowIndexAtPixel(t) : null, n = r != null ? this.getRow(r) : null;
    if (!n || !e || n === e || t == null) {
      this.lastHighlightedRow && (this.lastHighlightedRow.setHighlighted(null), this.lastHighlightedRow = null);
      return;
    }
    const a = this.getHighlightPosition(t, n);
    this.lastHighlightedRow && this.lastHighlightedRow !== n && (this.lastHighlightedRow.setHighlighted(null), this.lastHighlightedRow = null), n.setHighlighted(a), this.lastHighlightedRow = n;
  }
  getHighlightPosition(e, t) {
    if (!t) {
      const a = this.getRowIndexAtPixel(e);
      if (t = this.getRow(a || 0), !t)
        return kC.Below;
    }
    const { rowTop: r, rowHeight: n } = t;
    return e - r < n / 2 ? kC.Above : kC.Below;
  }
  getLastHighlightedRowNode() {
    return this.lastHighlightedRow;
  }
  isLastRowIndexKnown() {
    return !0;
  }
  getRowCount() {
    return this.rowsToDisplay ? this.rowsToDisplay.length : 0;
  }
  /**
   * Returns the number of rows with level === 1
   */
  getTopLevelRowCount() {
    if (this.rowsToDisplay.length === 0)
      return 0;
    if (this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode)
      return 1;
    const t = this.rootNode.childrenAfterAggFilter, r = this.rootNode.sibling ? 1 : 0;
    return (t ? t.length : 0) + r;
  }
  /**
   * Get the row display index by the top level index
   * top level index is the index of rows with level === 1
   */
  getTopLevelRowDisplayedIndex(e) {
    if (this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode)
      return e;
    let r = e;
    if (this.rowsToDisplay[0].footer) {
      if (e === 0)
        return 0;
      r -= 1;
    }
    const n = this.rowsToDisplay[this.rowsToDisplay.length - 1], a = r >= this.rootNode.childrenAfterSort.length;
    if (n.footer && a)
      return n.rowIndex;
    let u = this.rootNode.childrenAfterSort[r];
    if (this.gos.get("groupHideOpenParents"))
      for (; u.expanded && u.childrenAfterSort && u.childrenAfterSort.length > 0; )
        u = u.childrenAfterSort[0];
    return u.rowIndex;
  }
  getRowBounds(e) {
    if (mi(this.rowsToDisplay))
      return null;
    const t = this.rowsToDisplay[e];
    return t ? {
      rowTop: t.rowTop,
      rowHeight: t.rowHeight
    } : null;
  }
  onRowGroupOpened() {
    const e = yv(this.gos);
    this.refreshModel({ step: fi.MAP, keepRenderedRows: !0, animate: e });
  }
  onFilterChanged(e) {
    if (e.afterDataChange)
      return;
    const t = yv(this.gos), n = e.columns.length === 0 || e.columns.some((a) => a.isPrimary()) ? fi.FILTER : fi.FILTER_AGGREGATES;
    this.refreshModel({ step: n, keepRenderedRows: !0, animate: t });
  }
  onSortChanged() {
    const e = yv(this.gos);
    this.refreshModel({
      step: fi.SORT,
      keepRenderedRows: !0,
      animate: e,
      keepEditingRows: !0
    });
  }
  getType() {
    return "clientSide";
  }
  onValueChanged() {
    this.columnModel.isPivotActive() ? this.refreshModel({ step: fi.PIVOT }) : this.refreshModel({ step: fi.AGGREGATE });
  }
  createChangePath(e) {
    const t = Rs(e), r = new J1(!1, this.rootNode);
    return t && r.setInactive(), r;
  }
  isSuppressModelUpdateAfterUpdateTransaction(e) {
    if (!this.gos.get("suppressModelUpdateAfterUpdateTransaction") || e.rowNodeTransactions == null)
      return !1;
    const t = e.rowNodeTransactions.filter(
      (n) => n.add != null && n.add.length > 0 || n.remove != null && n.remove.length > 0
    );
    return t == null || t.length == 0;
  }
  buildRefreshModelParams(e) {
    let t = fi.EVERYTHING;
    const r = {
      everything: fi.EVERYTHING,
      group: fi.EVERYTHING,
      filter: fi.FILTER,
      map: fi.MAP,
      aggregate: fi.AGGREGATE,
      sort: fi.SORT,
      pivot: fi.PIVOT
    };
    if ($r(e) && (t = r[e]), mi(t)) {
      Ni(`invalid step ${e}, available steps are ${Object.keys(r).join(", ")}`);
      return;
    }
    const n = !this.gos.get("suppressAnimationFrame");
    return {
      step: t,
      keepRenderedRows: !0,
      keepEditingRows: !0,
      animate: n
    };
  }
  refreshModel(e) {
    if (!this.hasStarted || this.isRefreshingModel || this.columnModel.isChangeEventsDispatching())
      return;
    const t = typeof e == "object" && "step" in e ? e : this.buildRefreshModelParams(e);
    if (!t || this.isSuppressModelUpdateAfterUpdateTransaction(t))
      return;
    const r = this.createChangePath(t.rowNodeTransactions);
    switch (this.isRefreshingModel = !0, t.step) {
      case fi.EVERYTHING:
        this.doRowGrouping(
          t.rowNodeTransactions,
          r,
          !!t.rowNodesOrderChanged,
          !!t.afterColumnsChanged
        );
      case fi.FILTER:
        this.doFilter(r);
      case fi.PIVOT:
        this.doPivot(r);
      case fi.AGGREGATE:
        this.doAggregate(r);
      case fi.FILTER_AGGREGATES:
        this.doFilterAggregates(r);
      case fi.SORT:
        this.doSort(t.rowNodeTransactions, r);
      case fi.MAP:
        this.doRowsToDisplay();
    }
    const n = this.setRowTopAndRowIndex();
    this.clearRowTopAndRowIndex(r, n), this.isRefreshingModel = !1, this.eventService.dispatchEvent({
      type: "modelUpdated",
      animate: t.animate,
      keepRenderedRows: t.keepRenderedRows,
      newData: t.newData,
      newPage: !1,
      keepUndoRedoStack: t.keepUndoRedoStack
    });
  }
  isEmpty() {
    const e = mi(this.rootNode.allLeafChildren) || this.rootNode.allLeafChildren.length === 0;
    return mi(this.rootNode) || e || !this.columnModel.isReady();
  }
  isRowsToRender() {
    return $r(this.rowsToDisplay) && this.rowsToDisplay.length > 0;
  }
  getNodesInRangeForSelection(e, t) {
    let r = !1, n = !1;
    const a = [], u = Wh(this.gos);
    return this.forEachNodeAfterFilterAndSort((s) => {
      if (n)
        return;
      if (r && (s === t || s === e) && (n = !0, s.group && u)) {
        a.push(...s.allLeafChildren);
        return;
      }
      if (!r) {
        if (s !== t && s !== e)
          return;
        r = !0;
      }
      if (!s.group || !u) {
        a.push(s);
        return;
      }
    }), a;
  }
  // eslint-disable-next-line
  setDatasource(e) {
    Ni("should never call setDatasource on clientSideRowController");
  }
  getTopLevelNodes() {
    return this.rootNode ? this.rootNode.childrenAfterGroup : null;
  }
  getRootNode() {
    return this.rootNode;
  }
  getRow(e) {
    return this.rowsToDisplay[e];
  }
  isRowPresent(e) {
    return this.rowsToDisplay.indexOf(e) >= 0;
  }
  getRowIndexAtPixel(e) {
    if (this.isEmpty() || this.rowsToDisplay.length === 0)
      return -1;
    let t = 0, r = this.rowsToDisplay.length - 1;
    if (e <= 0)
      return 0;
    if (di(this.rowsToDisplay).rowTop <= e)
      return this.rowsToDisplay.length - 1;
    let a = -1, u = -1;
    for (; ; ) {
      const s = Math.floor((t + r) / 2), c = this.rowsToDisplay[s];
      if (this.isRowInPixel(c, e) || (c.rowTop < e ? t = s + 1 : c.rowTop > e && (r = s - 1), a === t && u === r))
        return s;
      a = t, u = r;
    }
  }
  isRowInPixel(e, t) {
    const r = e.rowTop, n = e.rowTop + e.rowHeight;
    return r <= t && n > t;
  }
  forEachLeafNode(e) {
    this.rootNode.allLeafChildren && this.rootNode.allLeafChildren.forEach((t, r) => e(t, r));
  }
  forEachNode(e, t = !1) {
    this.recursivelyWalkNodesAndCallback({
      nodes: [...this.rootNode.childrenAfterGroup || []],
      callback: e,
      recursionType: 0,
      index: 0,
      includeFooterNodes: t
    });
  }
  forEachNodeAfterFilter(e, t = !1) {
    this.recursivelyWalkNodesAndCallback({
      nodes: [...this.rootNode.childrenAfterAggFilter || []],
      callback: e,
      recursionType: 1,
      index: 0,
      includeFooterNodes: t
    });
  }
  forEachNodeAfterFilterAndSort(e, t = !1) {
    this.recursivelyWalkNodesAndCallback({
      nodes: [...this.rootNode.childrenAfterSort || []],
      callback: e,
      recursionType: 2,
      index: 0,
      includeFooterNodes: t
    });
  }
  forEachPivotNode(e, t = !1) {
    this.recursivelyWalkNodesAndCallback({
      nodes: [this.rootNode],
      callback: e,
      recursionType: 3,
      index: 0,
      includeFooterNodes: t
    });
  }
  // iterates through each item in memory, and calls the callback function
  // nodes - the rowNodes to traverse
  // callback - the user provided callback
  // recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc
  // index - works similar to the index in forEach in javascript's array function
  recursivelyWalkNodesAndCallback(e) {
    const { nodes: t, callback: r, recursionType: n, includeFooterNodes: a } = e;
    let { index: u } = e;
    const s = (c) => {
      var g;
      const i = (g = t[0]) == null ? void 0 : g.parent;
      if (!i)
        return;
      const l = a && FL(this.gos), v = PL(this.gos), f = a && v({ node: i });
      if (i === this.rootNode) {
        l === c && (i.createFooter(), r(i.sibling, u++));
        return;
      }
      f === c && (i.createFooter(), r(i.sibling, u++));
    };
    s("top");
    for (let c = 0; c < t.length; c++) {
      const i = t[c];
      if (r(i, u++), i.hasChildren() && !i.footer) {
        let l = null;
        switch (n) {
          case 0:
            l = i.childrenAfterGroup;
            break;
          case 1:
            l = i.childrenAfterAggFilter;
            break;
          case 2:
            l = i.childrenAfterSort;
            break;
          case 3:
            l = i.leafGroup ? null : i.childrenAfterSort;
            break;
        }
        l && (u = this.recursivelyWalkNodesAndCallback({
          nodes: [...l],
          callback: r,
          recursionType: n,
          index: u,
          includeFooterNodes: a
        }));
      }
    }
    return s("bottom"), u;
  }
  // it's possible to recompute the aggregate without doing the other parts
  // + api.refreshClientSideRowModel('aggregate')
  doAggregate(e) {
    var t;
    (t = this.aggregationStage) == null || t.execute({ rowNode: this.rootNode, changedPath: e });
  }
  doFilterAggregates(e) {
    this.filterAggregatesStage ? this.filterAggregatesStage.execute({ rowNode: this.rootNode, changedPath: e }) : this.rootNode.childrenAfterAggFilter = this.rootNode.childrenAfterFilter;
  }
  // + gridApi.expandAll()
  // + gridApi.collapseAll()
  expandOrCollapseAll(e) {
    const t = this.gos.get("treeData"), r = this.columnModel.isPivotActive(), n = (a) => {
      a && a.forEach((u) => {
        const s = () => {
          u.expanded = e, n(u.childrenAfterGroup);
        };
        if (t) {
          $r(u.childrenAfterGroup) && s();
          return;
        }
        if (r) {
          !u.leafGroup && s();
          return;
        }
        u.group && s();
      });
    };
    this.rootNode && n(this.rootNode.childrenAfterGroup), this.refreshModel({ step: fi.MAP }), this.eventService.dispatchEvent({
      type: "expandOrCollapseAll",
      source: e ? "expandAll" : "collapseAll"
    });
  }
  doSort(e, t) {
    this.sortStage.execute({
      rowNode: this.rootNode,
      rowNodeTransactions: e,
      changedPath: t
    });
  }
  doRowGrouping(e, t, r, n) {
    if (this.groupStage)
      e ? this.groupStage.execute({
        rowNode: this.rootNode,
        rowNodeTransactions: e,
        rowNodesOrderChanged: r,
        changedPath: t
      }) : this.groupStage.execute({
        rowNode: this.rootNode,
        changedPath: t,
        afterColumnsChanged: n
      }), Wh(this.gos) && this.selectionService.updateGroupsFromChildrenSelections(
        "rowGroupChanged",
        t
      ) && this.eventService.dispatchEvent({
        type: "selectionChanged",
        source: "rowGroupChanged"
      });
    else {
      const a = this.rootNode, u = a.sibling;
      a.childrenAfterGroup = a.allLeafChildren, u && (u.childrenAfterGroup = a.childrenAfterGroup), this.rootNode.updateHasChildren();
    }
    this.nodeManager.isRowCountReady() && (this.rowCountReady = !0, this.eventService.dispatchEventOnce({
      type: "rowCountReady"
    }));
  }
  doFilter(e) {
    this.filterStage.execute({ rowNode: this.rootNode, changedPath: e });
  }
  doPivot(e) {
    var t;
    (t = this.pivotStage) == null || t.execute({ rowNode: this.rootNode, changedPath: e });
  }
  getNodeManager() {
    return this.nodeManager;
  }
  getRowNode(e) {
    if (typeof e == "string" && e.indexOf(Oh.ID_PREFIX_ROW_GROUP) == 0) {
      let r;
      return this.forEachNode((n) => {
        n.id === e && (r = n);
      }), r;
    }
    return this.nodeManager.getRowNode(e);
  }
  // rows: the rows to put into the model
  setRowData(e) {
    this.selectionService.reset("rowDataChanged"), this.nodeManager.setRowData(e), this.hasStarted && this.dispatchUpdateEventsAndRefresh();
  }
  dispatchUpdateEventsAndRefresh() {
    this.eventService.dispatchEvent({
      type: "rowDataUpdated"
    }), this.refreshModel({
      step: fi.EVERYTHING,
      newData: !0
    });
  }
  batchUpdateRowData(e, t) {
    if (this.applyAsyncTransactionsTimeout == null) {
      this.rowDataTransactionBatch = [];
      const r = this.gos.get("asyncTransactionWaitMillis");
      this.applyAsyncTransactionsTimeout = window.setTimeout(() => {
        this.isAlive() && this.executeBatchUpdateRowData();
      }, r);
    }
    this.rowDataTransactionBatch.push({ rowDataTransaction: e, callback: t });
  }
  flushAsyncTransactions() {
    this.applyAsyncTransactionsTimeout != null && (clearTimeout(this.applyAsyncTransactionsTimeout), this.executeBatchUpdateRowData());
  }
  executeBatchUpdateRowData() {
    var n;
    this.valueCache.onDataChanged();
    const e = [], t = [];
    let r = !1;
    (n = this.rowDataTransactionBatch) == null || n.forEach((a) => {
      const { rowNodeTransaction: u, rowsInserted: s } = this.nodeManager.updateRowData(a.rowDataTransaction);
      s && (r = !0), t.push(u), a.callback && e.push(a.callback.bind(null, u));
    }), this.commonUpdateRowData(t, r), e.length > 0 && window.setTimeout(() => {
      e.forEach((a) => a());
    }, 0), t.length > 0 && this.eventService.dispatchEvent({
      type: "asyncTransactionsFlushed",
      results: t
    }), this.rowDataTransactionBatch = null, this.applyAsyncTransactionsTimeout = void 0;
  }
  /**
   * Used to apply transaction changes.
   * Called by gridApi & rowDragFeature
   */
  updateRowData(e) {
    this.valueCache.onDataChanged();
    const { rowNodeTransaction: t, rowsInserted: r } = this.nodeManager.updateRowData(e);
    return this.commonUpdateRowData([t], r), t;
  }
  /**
   * Used to apply generated transaction
   */
  afterImmutableDataChange(e, t) {
    this.commonUpdateRowData([e], t);
  }
  /**
   * Common to:
   * - executeBatchUpdateRowData (batch transactions)
   * - updateRowData (single transaction)
   * - afterImmutableDataChange (generated transaction)
   *
   * @param rowNodeTrans - the transactions to apply
   * @param orderChanged - whether the order of the rows has changed, either via generated transaction or user provided addIndex
   */
  commonUpdateRowData(e, t) {
    if (!this.hasStarted)
      return;
    const r = !this.gos.get("suppressAnimationFrame");
    this.eventService.dispatchEvent({
      type: "rowDataUpdated"
    }), this.refreshModel({
      step: fi.EVERYTHING,
      rowNodeTransactions: e,
      rowNodesOrderChanged: t,
      keepRenderedRows: !0,
      keepEditingRows: !0,
      animate: r
    });
  }
  doRowsToDisplay() {
    this.rowsToDisplay = this.flattenStage.execute({ rowNode: this.rootNode });
  }
  onRowHeightChanged() {
    this.refreshModel({
      step: fi.MAP,
      keepRenderedRows: !0,
      keepEditingRows: !0,
      keepUndoRedoStack: !0
    });
  }
  /** This method is debounced. It is used for row auto-height. If we don't debounce,
   * then the Row Models will end up recalculating each row position
   * for each row height change and result in the Row Renderer laying out rows.
   * This is particularly bad if using print layout, and showing eg 1,000 rows,
   * each row will change it's height, causing Row Model to update 1,000 times.
   */
  onRowHeightChangedDebounced() {
    this.onRowHeightChanged_debounced();
  }
  resetRowHeights() {
    const e = this.resetRowHeightsForAllRowNodes();
    this.rootNode.setRowHeight(this.rootNode.rowHeight, !0), this.rootNode.sibling && this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight, !0), e && this.onRowHeightChanged();
  }
  resetRowHeightsForAllRowNodes() {
    let e = !1;
    return this.forEachNode((t) => {
      t.setRowHeight(t.rowHeight, !0);
      const r = t.detailNode;
      r && r.setRowHeight(r.rowHeight, !0), t.sibling && t.sibling.setRowHeight(t.sibling.rowHeight, !0), e = !0;
    }), e;
  }
  onGridStylesChanges(e) {
    if (e.rowHeightChanged) {
      if (this.columnModel.isAutoRowHeightActive())
        return;
      this.resetRowHeights();
    }
  }
  onGridReady() {
    this.hasStarted || this.setInitialData();
  }
  isRowDataLoaded() {
    return this.rowCountReady;
  }
};
function Bee(e) {
  e.expansionService.onGroupExpandedOrCollapsed();
}
function Vee(e, t) {
  var r, n;
  (n = (r = e.rowModelHelperService) == null ? void 0 : r.getClientSideRowModel()) == null || n.refreshModel(t);
}
function zee(e) {
  var t, r;
  return ((r = (t = e.rowModelHelperService) == null ? void 0 : t.getClientSideRowModel()) == null ? void 0 : r.isEmpty()) ?? !0;
}
function Wee(e, t) {
  var r, n;
  (n = (r = e.rowModelHelperService) == null ? void 0 : r.getClientSideRowModel()) == null || n.forEachLeafNode(t);
}
function _ee(e, t) {
  var r, n;
  (n = (r = e.rowModelHelperService) == null ? void 0 : r.getClientSideRowModel()) == null || n.forEachNodeAfterFilter(t);
}
function Uee(e, t) {
  var r, n;
  (n = (r = e.rowModelHelperService) == null ? void 0 : r.getClientSideRowModel()) == null || n.forEachNodeAfterFilterAndSort(t);
}
function jee(e) {
  var t, r;
  if (e.columnModel.isAutoRowHeightActive()) {
    Fr("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");
    return;
  }
  (r = (t = e.rowModelHelperService) == null ? void 0 : t.getClientSideRowModel()) == null || r.resetRowHeights();
}
function Yee(e, t) {
  return e.frameworkOverrides.wrapIncoming(
    () => {
      var r, n;
      return (n = (r = e.rowModelHelperService) == null ? void 0 : r.getClientSideRowModel()) == null ? void 0 : n.updateRowData(t);
    }
  );
}
function Xee(e, t, r) {
  e.frameworkOverrides.wrapIncoming(
    () => {
      var n, a;
      return (a = (n = e.rowModelHelperService) == null ? void 0 : n.getClientSideRowModel()) == null ? void 0 : a.batchUpdateRowData(t, r);
    }
  );
}
function $ee(e) {
  e.frameworkOverrides.wrapIncoming(
    () => {
      var t, r;
      return (r = (t = e.rowModelHelperService) == null ? void 0 : t.getClientSideRowModel()) == null ? void 0 : r.flushAsyncTransactions();
    }
  );
}
function Zee(e) {
  return e.selectionService.getBestCostNodeSelection();
}
var Kee = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "filterStage";
  }
  wireBeans(e) {
    this.filterManager = e.filterManager;
  }
  execute(e) {
    const { changedPath: t } = e;
    this.filter(t);
  }
  filter(e) {
    var r;
    const t = !!((r = this.filterManager) != null && r.isChildFilterPresent());
    this.filterNodes(t, e);
  }
  filterNodes(e, t) {
    const r = (n, a) => {
      n.hasChildren() && e && !a ? n.childrenAfterFilter = n.childrenAfterGroup.filter((u) => {
        const s = u.childrenAfterFilter && u.childrenAfterFilter.length > 0, c = u.data && this.filterManager.doesRowPassFilter({ rowNode: u });
        return s || c;
      }) : n.childrenAfterFilter = n.childrenAfterGroup, n.sibling && (n.sibling.childrenAfterFilter = n.childrenAfterFilter);
    };
    if (this.doingTreeDataFiltering()) {
      const n = (u, s) => {
        if (u.childrenAfterGroup)
          for (let c = 0; c < u.childrenAfterGroup.length; c++) {
            const i = u.childrenAfterGroup[c], l = s || this.filterManager.doesRowPassFilter({ rowNode: i });
            i.childrenAfterGroup ? n(u.childrenAfterGroup[c], l) : r(i, l);
          }
        r(u, s);
      }, a = (u) => n(u, !1);
      t.executeFromRootNode(a);
    } else {
      const n = (a) => r(a, !1);
      t.forEachChangedNodeDepthFirst(n, !0);
    }
  }
  doingTreeDataFiltering() {
    return this.gos.get("treeData") && !this.gos.get("excludeChildrenWhenTreeDataFiltering");
  }
}, Jee = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "flattenStage";
  }
  wireBeans(e) {
    this.beans = e, this.columnModel = e.columnModel;
  }
  execute(e) {
    const t = e.rowNode, r = [], n = this.columnModel.isPivotMode(), a = n && t.leafGroup, u = a ? [t] : t.childrenAfterSort, s = this.getFlattenDetails();
    this.recursivelyAddToRowsToDisplay(s, u, r, n, 0);
    const c = r.length > 0;
    if (!a && // don't show total footer when showRootNode is true (i.e. in pivot mode and no groups)
    c && s.grandTotalRow) {
      t.createFooter();
      const l = s.grandTotalRow === "top";
      this.addRowNodeToRowsToDisplay(s, t.sibling, r, 0, l);
    }
    return r;
  }
  getFlattenDetails() {
    const e = this.gos.get("groupRemoveSingleChildren");
    return {
      groupRemoveLowestSingleChildren: !e && this.gos.get("groupRemoveLowestSingleChildren"),
      groupRemoveSingleChildren: e,
      isGroupMultiAutoColumn: IL(this.gos),
      hideOpenParents: this.gos.get("groupHideOpenParents"),
      grandTotalRow: FL(this.gos),
      groupTotalRow: PL(this.gos)
    };
  }
  recursivelyAddToRowsToDisplay(e, t, r, n, a) {
    if (!Rs(t))
      for (let u = 0; u < t.length; u++) {
        const s = t[u], c = s.hasChildren(), i = n && !c, l = e.groupRemoveSingleChildren && c && s.childrenAfterGroup.length === 1, v = e.groupRemoveLowestSingleChildren && c && s.leafGroup && s.childrenAfterGroup.length === 1, f = n && s.leafGroup, p = e.hideOpenParents && s.expanded && !s.master && !f;
        if (!i && !p && !l && !v && this.addRowNodeToRowsToDisplay(e, s, r, a), !(n && s.leafGroup)) {
          if (c) {
            const y = l || v;
            if (s.expanded || y) {
              const C = e.groupTotalRow({ node: s });
              C || s.destroyFooter();
              const m = y ? a : a + 1;
              C === "top" && (s.createFooter(), this.addRowNodeToRowsToDisplay(e, s.sibling, r, m)), this.recursivelyAddToRowsToDisplay(
                e,
                s.childrenAfterSort,
                r,
                n,
                m
              ), C === "bottom" && (s.createFooter(), this.addRowNodeToRowsToDisplay(e, s.sibling, r, m));
            }
          } else if (s.master && s.expanded) {
            const y = this.createDetailNode(s);
            this.addRowNodeToRowsToDisplay(e, y, r, a);
          }
        }
      }
  }
  // duplicated method, it's also in floatingRowModel
  addRowNodeToRowsToDisplay(e, t, r, n, a) {
    a ? r.unshift(t) : r.push(t), t.setUiLevel(e.isGroupMultiAutoColumn ? 0 : n);
  }
  createDetailNode(e) {
    if ($r(e.detailNode))
      return e.detailNode;
    const t = new Oh(this.beans);
    return t.detail = !0, t.selectable = !1, t.parent = e, $r(e.id) && (t.id = "detail_" + e.id), t.data = e.data, t.level = e.level + 1, e.detailNode = t, t;
  }
}, Qee = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "immutableService";
  }
  wireBeans(e) {
    this.rowModel = e.rowModel, this.selectionService = e.selectionService;
  }
  postConstruct() {
    da(this.gos) && (this.clientSideRowModel = this.rowModel, this.addManagedPropertyListener("rowData", () => this.onRowDataUpdated()));
  }
  isActive() {
    const e = this.gos.exists("getRowId");
    return this.gos.get("resetRowDataOnUpdate") ? !1 : e;
  }
  setRowData(e) {
    const t = this.createTransactionForRowData(e);
    if (!t)
      return;
    const r = this.clientSideRowModel.getNodeManager(), { rowNodeTransaction: n, rowsInserted: a } = r.updateRowData(t);
    let u = !1;
    this.gos.get("suppressMaintainUnsortedOrder") || (u = r.updateRowOrderFromRowData(e)), this.clientSideRowModel.afterImmutableDataChange(n, u || a);
  }
  /** Converts the setRowData() command to a transaction */
  createTransactionForRowData(e) {
    if (!da(this.gos))
      return Ni("ImmutableService only works with ClientSideRowModel"), null;
    const t = ty(this.gos);
    if (t == null)
      return Ni("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!"), null;
    const r = this.clientSideRowModel.getNodeManager().getCopyOfNodesMap(), n = [], a = [], u = [];
    return $r(e) && e.forEach((s) => {
      const c = t({ data: s, level: 0 }), i = r[c];
      i ? (i.data !== s && a.push(s), r[c] = void 0) : u.push(s);
    }), fu(r, (s, c) => {
      c && n.push(c.data);
    }), { remove: n, update: a, add: u };
  }
  onRowDataUpdated() {
    const e = this.gos.get("rowData");
    e && (this.isActive() ? this.setRowData(e) : (this.selectionService.reset("rowDataChanged"), this.clientSideRowModel.setRowData(e)));
  }
}, qee = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "sortService";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.funcColsService = e.funcColsService, this.rowNodeSorter = e.rowNodeSorter, this.showRowGroupColsService = e.showRowGroupColsService;
  }
  sort(e, t, r, n, a, u) {
    const s = this.gos.get("groupMaintainOrder"), c = this.columnModel.getCols().some((p) => p.isRowGroupActive());
    let i = {};
    r && n && (i = this.calculateDirtyNodes(n));
    const l = this.columnModel.isPivotMode(), v = this.gos.getCallback("postSortRows"), f = (p) => {
      var C;
      this.pullDownGroupDataForHideOpenParents(p.childrenAfterAggFilter, !0);
      const g = l && p.leafGroup;
      if (s && c && !p.leafGroup && !u) {
        const m = (C = this.funcColsService.getRowGroupColumns()) == null ? void 0 : C[p.level + 1], h = (m == null ? void 0 : m.getSort()) === null, w = p.childrenAfterAggFilter.slice(0);
        if (p.childrenAfterSort && !h) {
          const S = {};
          p.childrenAfterSort.forEach((E, x) => {
            S[E.id] = x;
          }), w.sort(
            (E, x) => (S[E.id] ?? 0) - (S[x.id] ?? 0)
          );
        }
        p.childrenAfterSort = w;
      } else !t || g ? p.childrenAfterSort = p.childrenAfterAggFilter.slice(0) : r ? p.childrenAfterSort = this.doDeltaSort(p, i, a, e) : p.childrenAfterSort = this.rowNodeSorter.doFullSort(p.childrenAfterAggFilter, e);
      if (p.sibling && (p.sibling.childrenAfterSort = p.childrenAfterSort), this.updateChildIndexes(p), v) {
        const m = { nodes: p.childrenAfterSort };
        v(m);
      }
    };
    a && a.forEachChangedNodeDepthFirst(f), this.updateGroupDataForHideOpenParents(a);
  }
  calculateDirtyNodes(e) {
    const t = {}, r = (n) => {
      n && n.forEach((a) => t[a.id] = !0);
    };
    return e && e.forEach((n) => {
      r(n.add), r(n.update), r(n.remove);
    }), t;
  }
  doDeltaSort(e, t, r, n) {
    const a = e.childrenAfterAggFilter, u = e.childrenAfterSort;
    if (!u)
      return this.rowNodeSorter.doFullSort(a, n);
    const s = {}, c = [];
    a.forEach((f) => {
      t[f.id] || !r.canSkip(f) ? c.push(f) : s[f.id] = !0;
    });
    const i = u.filter((f) => s[f.id]), l = (f, p) => ({
      currentPos: p,
      rowNode: f
    }), v = c.map(l).sort((f, p) => this.rowNodeSorter.compareRowNodes(n, f, p));
    return this.mergeSortedArrays(n, v, i.map(l)).map(
      ({ rowNode: f }) => f
    );
  }
  // Merge two sorted arrays into each other
  mergeSortedArrays(e, t, r) {
    const n = [];
    let a = 0, u = 0;
    for (; a < t.length && u < r.length; )
      this.rowNodeSorter.compareRowNodes(e, t[a], r[u]) < 0 ? n.push(t[a++]) : n.push(r[u++]);
    for (; a < t.length; )
      n.push(t[a++]);
    for (; u < r.length; )
      n.push(r[u++]);
    return n;
  }
  updateChildIndexes(e) {
    if (mi(e.childrenAfterSort))
      return;
    const t = e.childrenAfterSort;
    for (let r = 0; r < t.length; r++) {
      const n = t[r], a = r === 0, u = r === e.childrenAfterSort.length - 1;
      n.setFirstChild(a), n.setLastChild(u), n.setChildIndex(r);
    }
  }
  updateGroupDataForHideOpenParents(e) {
    if (!this.gos.get("groupHideOpenParents"))
      return;
    if (this.gos.get("treeData"))
      return Fr(
        "The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."
      ), !1;
    const t = (r) => {
      this.pullDownGroupDataForHideOpenParents(r.childrenAfterSort, !1), r.childrenAfterSort.forEach((n) => {
        n.hasChildren() && t(n);
      });
    };
    e && e.executeFromRootNode((r) => t(r));
  }
  pullDownGroupDataForHideOpenParents(e, t) {
    !this.gos.get("groupHideOpenParents") || mi(e) || e.forEach((r) => {
      var a;
      (((a = this.showRowGroupColsService) == null ? void 0 : a.getShowRowGroupCols()) ?? []).forEach((u) => {
        const s = u.getColDef().showRowGroup;
        if (typeof s != "string") {
          Ni(
            "groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup"
          );
          return;
        }
        const c = s, i = this.columnModel.getColDefCol(c);
        if (i !== r.rowGroupColumn)
          if (t)
            r.setGroupValue(u.getId(), void 0);
          else {
            const v = this.getFirstChildOfFirstChild(r, i);
            v && r.setGroupValue(u.getId(), v.key);
          }
      });
    });
  }
  getFirstChildOfFirstChild(e, t) {
    let r = e;
    for (; r; ) {
      const n = r.parent;
      if (n && r.firstChild) {
        if (n.rowGroupColumn === t)
          return n;
      } else
        return null;
      r = n;
    }
    return null;
  }
}, ete = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "sortStage";
  }
  wireBeans(e) {
    this.sortService = e.sortService, this.sortController = e.sortController;
  }
  execute(e) {
    const t = this.sortController.getSortOptions(), r = $r(t) && t.length > 0, n = r && $r(e.rowNodeTransactions) && // in time we can remove this check, so that delta sort is always
    // on if transactions are present. it's off for now so that we can
    // selectively turn it on and test it with some select users before
    // rolling out to everyone.
    this.gos.get("deltaSort"), a = t.some((u) => ec(this.gos) ? u.column.isPrimary() && u.column.isRowGroupActive() : !!u.column.getColDef().showRowGroup);
    this.sortService.sort(
      t,
      r,
      n,
      e.rowNodeTransactions,
      e.changedPath,
      a
    );
  }
}, mR = "32.2.2", w4 = {
  version: mR,
  moduleName: `${uf.ClientSideRowModelModule}-core`,
  rowModel: "clientSide",
  beans: [Hee, Kee, ete, Jee, qee, Qee]
}, tte = {
  version: mR,
  moduleName: `${uf.ClientSideRowModelModule}-api`,
  beans: [Aq],
  apiFunctions: {
    onGroupExpandedOrCollapsed: Bee,
    refreshClientSideRowModel: Vee,
    isRowDataEmpty: zee,
    forEachLeafNode: Wee,
    forEachNodeAfterFilter: _ee,
    forEachNodeAfterFilterAndSort: Uee,
    resetRowHeights: jee,
    applyTransaction: Yee,
    applyTransactionAsync: Xee,
    flushAsyncTransactions: $ee,
    getBestCostNodeSelection: Zee
  },
  dependantModules: [w4, Fq]
}, rte = {
  version: mR,
  moduleName: uf.ClientSideRowModelModule,
  dependantModules: [w4, tte]
}, nte = class extends mr {
  setBeans(e) {
    this.beans = e;
  }
  getFileName(e) {
    const t = this.getDefaultFileExtension();
    return (e == null || !e.length) && (e = this.getDefaultFileName()), e.indexOf(".") === -1 ? `${e}.${t}` : e;
  }
  getData(e) {
    const t = this.createSerializingSession(e);
    return this.beans.gridSerializer.serialize(t, e);
  }
  getDefaultFileName() {
    return `export.${this.getDefaultFileExtension()}`;
  }
}, ite = class {
  constructor(e) {
    this.groupColumns = [];
    const {
      columnModel: t,
      funcColsService: r,
      columnNameService: n,
      valueService: a,
      gos: u,
      processCellCallback: s,
      processHeaderCallback: c,
      processGroupHeaderCallback: i,
      processRowGroupCallback: l
    } = e;
    this.columnModel = t, this.funcColsService = r, this.columnNameService = n, this.valueService = a, this.gos = u, this.processCellCallback = s, this.processHeaderCallback = c, this.processGroupHeaderCallback = i, this.processRowGroupCallback = l;
  }
  prepare(e) {
    this.groupColumns = e.filter((t) => !!t.getColDef().showRowGroup);
  }
  extractHeaderValue(e) {
    return this.getHeaderName(this.processHeaderCallback, e) ?? "";
  }
  extractRowCellValue(e, t, r, n, a) {
    const s = (!this.gos.get("groupHideOpenParents") || a.footer) && this.shouldRenderGroupSummaryCell(a, e, t) ? this.createValueForGroupNode(e, a) : this.valueService.getValue(e, a);
    return this.processCell({
      accumulatedRowIndex: r,
      rowNode: a,
      column: e,
      value: s,
      processCellCallback: this.processCellCallback,
      type: n
    });
  }
  shouldRenderGroupSummaryCell(e, t, r) {
    var s;
    if (!(e && e.group))
      return !1;
    if (this.groupColumns.indexOf(t) !== -1) {
      if (((s = e.groupData) == null ? void 0 : s[t.getId()]) != null || sd(this.gos) && e.group)
        return !0;
      if (e.footer && e.level === -1) {
        const c = t.getColDef();
        return c == null || c.showRowGroup === !0 || c.showRowGroup === this.funcColsService.getRowGroupColumns()[0].getId();
      }
    }
    const u = j1(this.gos, this.columnModel.isPivotMode());
    return r === 0 && u;
  }
  getHeaderName(e, t) {
    return e ? e(this.gos.addGridCommonParams({ column: t })) : this.columnNameService.getDisplayNameForColumn(t, "csv", !0);
  }
  createValueForGroupNode(e, t) {
    if (this.processRowGroupCallback)
      return this.processRowGroupCallback(this.gos.addGridCommonParams({ column: e, node: t }));
    const r = this.gos.get("treeData"), n = this.gos.get("suppressGroupMaintainValueType"), a = (i) => {
      var v;
      if (r || n)
        return i.key;
      const l = (v = i.groupData) == null ? void 0 : v[e.getId()];
      return !l || !i.rowGroupColumn || i.rowGroupColumn.getColDef().useValueFormatterForExport === !1 ? l : this.valueService.formatValue(i.rowGroupColumn, i, l) ?? l;
    }, u = t.footer, s = [a(t)];
    if (!IL(this.gos))
      for (; t.parent; )
        t = t.parent, s.push(a(t));
    const c = s.reverse().join(" -> ");
    return u ? `Total ${c}` : c;
  }
  processCell(e) {
    const { accumulatedRowIndex: t, rowNode: r, column: n, value: a, processCellCallback: u, type: s } = e;
    return u ? {
      value: u(
        this.gos.addGridCommonParams({
          accumulatedRowIndex: t,
          column: n,
          node: r,
          value: a,
          type: s,
          parseValue: (c) => this.valueService.parseValue(
            n,
            r,
            c,
            this.valueService.getValue(n, r)
          ),
          formatValue: (c) => this.valueService.formatValue(n, r, c) ?? c
        })
      ) ?? ""
    } : n.getColDef().useValueFormatterForExport !== !1 ? {
      value: a ?? "",
      valueFormatted: this.valueService.formatValue(n, r, a)
    } : { value: a ?? "" };
  }
}, ate = class {
  static download(e, t) {
    const r = document.defaultView || window;
    if (!r) {
      Fr("There is no `window` associated with the current `document`");
      return;
    }
    const n = document.createElement("a"), a = r.URL.createObjectURL(t);
    n.setAttribute("href", a), n.setAttribute("download", e), n.style.display = "none", document.body.appendChild(n), n.dispatchEvent(
      new MouseEvent("click", {
        bubbles: !1,
        cancelable: !0,
        view: r
      })
    ), document.body.removeChild(n), r.setTimeout(() => {
      r.URL.revokeObjectURL(a);
    }, 0);
  }
}, AF = `\r
`, ote = class extends ite {
  constructor(e) {
    super(e), this.isFirstLine = !0, this.result = "";
    const { suppressQuotes: t, columnSeparator: r } = e;
    this.suppressQuotes = t, this.columnSeparator = r;
  }
  addCustomContent(e) {
    e && (typeof e == "string" ? (/^\s*\n/.test(e) || this.beginNewLine(), e = e.replace(/\r?\n/g, AF), this.result += e) : e.forEach((t) => {
      this.beginNewLine(), t.forEach((r, n) => {
        n !== 0 && (this.result += this.columnSeparator), this.result += this.putInQuotes(r.data.value || ""), r.mergeAcross && this.appendEmptyCells(r.mergeAcross);
      });
    }));
  }
  onNewHeaderGroupingRow() {
    return this.beginNewLine(), {
      onColumn: this.onNewHeaderGroupingRowColumn.bind(this)
    };
  }
  onNewHeaderGroupingRowColumn(e, t, r, n) {
    r != 0 && (this.result += this.columnSeparator), this.result += this.putInQuotes(t), this.appendEmptyCells(n);
  }
  appendEmptyCells(e) {
    for (let t = 1; t <= e; t++)
      this.result += this.columnSeparator + this.putInQuotes("");
  }
  onNewHeaderRow() {
    return this.beginNewLine(), {
      onColumn: this.onNewHeaderRowColumn.bind(this)
    };
  }
  onNewHeaderRowColumn(e, t) {
    t != 0 && (this.result += this.columnSeparator), this.result += this.putInQuotes(this.extractHeaderValue(e));
  }
  onNewBodyRow() {
    return this.beginNewLine(), {
      onColumn: this.onNewBodyRowColumn.bind(this)
    };
  }
  onNewBodyRowColumn(e, t, r) {
    t != 0 && (this.result += this.columnSeparator);
    const n = this.extractRowCellValue(e, t, t, "csv", r);
    this.result += this.putInQuotes(n.valueFormatted ?? n.value);
  }
  putInQuotes(e) {
    if (this.suppressQuotes)
      return e;
    if (e == null)
      return '""';
    let t;
    return typeof e == "string" ? t = e : typeof e.toString == "function" ? t = e.toString() : (Fr("unknown value type during csv conversion"), t = ""), '"' + t.replace(/"/g, '""') + '"';
  }
  parse() {
    return this.result;
  }
  beginNewLine() {
    this.isFirstLine || (this.result += AF), this.isFirstLine = !1;
  }
}, ste = class extends nte {
  constructor() {
    super(...arguments), this.beanName = "csvCreator";
  }
  wireBeans(e) {
    this.columnModel = e.columnModel, this.columnNameService = e.columnNameService, this.funcColsService = e.funcColsService, this.valueService = e.valueService, this.gridSerializer = e.gridSerializer;
  }
  postConstruct() {
    this.setBeans({
      gridSerializer: this.gridSerializer,
      gos: this.gos
    });
  }
  getMergedParams(e) {
    const t = this.gos.get("defaultCsvExportParams");
    return Object.assign({}, t, e);
  }
  export(e) {
    if (this.isExportSuppressed()) {
      Fr("Export cancelled. Export is not allowed as per your configuration.");
      return;
    }
    const t = this.getMergedParams(e), r = this.getData(t), n = new Blob(["\uFEFF", r], { type: "text/plain" }), a = typeof t.fileName == "function" ? t.fileName(this.gos.getGridCommonParams()) : t.fileName;
    ate.download(this.getFileName(a), n);
  }
  exportDataAsCsv(e) {
    this.export(e);
  }
  getDataAsCsv(e, t = !1) {
    const r = t ? Object.assign({}, e) : this.getMergedParams(e);
    return this.getData(r);
  }
  getDefaultFileExtension() {
    return "csv";
  }
  createSerializingSession(e) {
    const { columnModel: t, columnNameService: r, funcColsService: n, valueService: a, gos: u } = this, {
      processCellCallback: s,
      processHeaderCallback: c,
      processGroupHeaderCallback: i,
      processRowGroupCallback: l,
      suppressQuotes: v,
      columnSeparator: f
    } = e;
    return new ote({
      columnModel: t,
      columnNameService: r,
      funcColsService: n,
      valueService: a,
      gos: u,
      processCellCallback: s || void 0,
      processHeaderCallback: c || void 0,
      processGroupHeaderCallback: i || void 0,
      processRowGroupCallback: l || void 0,
      suppressQuotes: v || !1,
      columnSeparator: f || ","
    });
  }
  isExportSuppressed() {
    return this.gos.get("suppressCsvExport");
  }
};
function lte(e, t) {
  var r;
  return (r = e.csvCreator) == null ? void 0 : r.getDataAsCsv(t);
}
function ute(e, t) {
  var r;
  (r = e.csvCreator) == null || r.exportDataAsCsv(t);
}
var cte = class extends mr {
  constructor() {
    super(...arguments), this.beanName = "gridSerializer";
  }
  wireBeans(e) {
    this.visibleColsService = e.visibleColsService, this.columnModel = e.columnModel, this.columnNameService = e.columnNameService, this.rowModel = e.rowModel, this.pinnedRowModel = e.pinnedRowModel, this.selectionService = e.selectionService, this.rowNodeSorter = e.rowNodeSorter, this.sortController = e.sortController;
  }
  serialize(e, t = {}) {
    const { allColumns: r, columnKeys: n, skipRowGroups: a } = t, u = this.getColumnsToExport(
      r,
      a,
      n
    );
    return z_(
      // first pass, put in the header names of the cols
      this.prepareSession(u),
      this.prependContent(t),
      this.exportColumnGroups(t, u),
      this.exportHeaders(t, u),
      this.processPinnedTopRows(t, u),
      this.processRows(t, u),
      this.processPinnedBottomRows(t, u),
      this.appendContent(t)
    )(e).parse();
  }
  processRow(e, t, r, n) {
    var h;
    const a = t.shouldRowBeSkipped || (() => !1), u = this.gos.get("groupRemoveSingleChildren"), s = this.gos.get("groupRemoveLowestSingleChildren"), i = t.rowPositions != null || !!t.onlySelected, l = this.gos.get("groupHideOpenParents") && !i, v = this.columnModel.isPivotMode() ? n.leafGroup : !n.group, f = !!n.footer, p = s && n.leafGroup, g = n.allChildrenCount === 1 && ((h = n.childrenAfterGroup) == null ? void 0 : h.length) === 1 && (u || p);
    if (!v && !f && (t.skipRowGroups || g || l) || t.onlySelected && !n.isSelected() || t.skipPinnedTop && n.rowPinned === "top" || t.skipPinnedBottom && n.rowPinned === "bottom" || n.level === -1 && !v && !f || a(this.gos.addGridCommonParams({ node: n })))
      return;
    const m = e.onNewBodyRow(n);
    if (r.forEach((w, S) => {
      m.onColumn(w, S, n);
    }), t.getCustomContentBelowRow) {
      const w = t.getCustomContentBelowRow(this.gos.addGridCommonParams({ node: n }));
      w && e.addCustomContent(w);
    }
  }
  appendContent(e) {
    return (t) => {
      const r = e.appendContent;
      return r && t.addCustomContent(r), t;
    };
  }
  prependContent(e) {
    return (t) => {
      const r = e.prependContent;
      return r && t.addCustomContent(r), t;
    };
  }
  prepareSession(e) {
    return (t) => (t.prepare(e), t);
  }
  exportColumnGroups(e, t) {
    return (r) => {
      if (!e.skipColumnGroupHeaders) {
        const n = new UL(), a = this.visibleColsService.createGroups({
          columns: t,
          idCreator: n,
          pinned: null,
          isStandaloneStructure: !0
        });
        this.recursivelyAddHeaderGroups(
          a,
          r,
          e.processGroupHeaderCallback
        );
      }
      return r;
    };
  }
  exportHeaders(e, t) {
    return (r) => {
      if (!e.skipColumnHeaders) {
        const n = r.onNewHeaderRow();
        t.forEach((a, u) => {
          n.onColumn(a, u, void 0);
        });
      }
      return r;
    };
  }
  processPinnedTopRows(e, t) {
    return (r) => {
      const n = this.processRow.bind(this, r, e, t);
      return e.rowPositions ? e.rowPositions.filter((a) => a.rowPinned === "top").sort((a, u) => a.rowIndex - u.rowIndex).map((a) => this.pinnedRowModel.getPinnedTopRow(a.rowIndex)).forEach(n) : this.pinnedRowModel.forEachPinnedRow("top", n), r;
    };
  }
  processRows(e, t) {
    return (r) => {
      const n = this.rowModel, a = da(this.gos), u = sd(this.gos), s = !a && e.onlySelected, c = this.processRow.bind(this, r, e, t), { exportedRows: i = "filteredAndSorted" } = e;
      if (e.rowPositions)
        e.rowPositions.filter((l) => l.rowPinned == null).sort((l, v) => l.rowIndex - v.rowIndex).map((l) => n.getRow(l.rowIndex)).forEach(c);
      else if (this.columnModel.isPivotMode())
        a ? n.forEachPivotNode(c, !0) : u ? n.forEachNodeAfterFilterAndSort(c, !0) : n.forEachNode(c);
      else if (e.onlySelectedAllPages || s) {
        const l = this.selectionService.getSelectedNodes();
        this.replicateSortedOrder(l), l.forEach(c);
      } else
        i === "all" ? n.forEachNode(c) : a || u ? n.forEachNodeAfterFilterAndSort(c, !0) : n.forEachNode(c);
      return r;
    };
  }
  replicateSortedOrder(e) {
    const t = this.sortController.getSortOptions(), r = (n, a) => {
      var u, s;
      return n.rowIndex != null && a.rowIndex != null ? n.rowIndex - a.rowIndex : n.level === a.level ? ((u = n.parent) == null ? void 0 : u.id) === ((s = a.parent) == null ? void 0 : s.id) ? this.rowNodeSorter.compareRowNodes(
        t,
        {
          rowNode: n,
          currentPos: n.rowIndex ?? -1
        },
        {
          rowNode: a,
          currentPos: a.rowIndex ?? -1
        }
      ) : r(n.parent, a.parent) : n.level > a.level ? r(n.parent, a) : r(n, a.parent);
    };
    e.sort(r);
  }
  processPinnedBottomRows(e, t) {
    return (r) => {
      const n = this.processRow.bind(this, r, e, t);
      return e.rowPositions ? e.rowPositions.filter((a) => a.rowPinned === "bottom").sort((a, u) => a.rowIndex - u.rowIndex).map((a) => this.pinnedRowModel.getPinnedBottomRow(a.rowIndex)).forEach(n) : this.pinnedRowModel.forEachPinnedRow("bottom", n), r;
    };
  }
  getColumnsToExport(e = !1, t = !1, r) {
    const n = this.columnModel.isPivotMode();
    if (r && r.length)
      return this.columnModel.getColsForKeys(r);
    const a = this.gos.get("treeData");
    let u = [];
    return e && !n ? u = this.columnModel.getCols() : u = this.visibleColsService.getAllCols(), t && !a && (u = u.filter(
      (s) => cT(s) || Mv(s)
    )), u;
  }
  recursivelyAddHeaderGroups(e, t, r) {
    const n = [];
    e.forEach((a) => {
      const u = a;
      u.getChildren && u.getChildren().forEach((s) => n.push(s));
    }), e.length > 0 && Ba(e[0]) && this.doAddHeaderHeader(t, e, r), n && n.length > 0 && this.recursivelyAddHeaderGroups(
      n,
      t,
      r
    );
  }
  doAddHeaderHeader(e, t, r) {
    const n = e.onNewHeaderGroupingRow();
    let a = 0;
    t.forEach((u) => {
      const s = u;
      let c;
      r ? c = r(
        this.gos.addGridCommonParams({
          columnGroup: s
        })
      ) : c = this.columnNameService.getDisplayNameForColumnGroup(s, "header");
      const i = s.getLeafColumns().reduce((l, v, f, p) => {
        let g = di(l);
        return v.getColumnGroupShow() === "open" ? (!g || g[1] != null) && (g = [f], l.push(g)) : g && g[1] == null && (g[1] = f - 1), f === p.length - 1 && g && g[1] == null && (g[1] = f), l;
      }, []);
      n.onColumn(
        s,
        c || "",
        a++,
        s.getLeafColumns().length - 1,
        i
      );
    });
  }
}, yR = "32.2.2", S4 = {
  version: yR,
  moduleName: `${uf.CsvExportModule}-core`,
  beans: [ste, cte]
}, dte = {
  version: yR,
  moduleName: `${uf.CsvExportModule}-api`,
  apiFunctions: {
    getDataAsCsv: lte,
    exportDataAsCsv: ute
  },
  dependantModules: [S4]
}, fte = {
  version: yR,
  moduleName: uf.CsvExportModule,
  dependantModules: [S4, dte]
};
const CR = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  active: e = !1,
  disabled: t = !1,
  className: r,
  style: n,
  activeLabel: a = "(current)",
  children: u,
  linkStyle: s,
  linkClassName: c,
  as: i = Zm,
  ...l
}, v) => {
  const f = e || t ? "span" : i;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", {
    ref: v,
    style: n,
    className: ln(r, "page-item", {
      active: e,
      disabled: t
    }),
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(f, {
      className: ln("page-link", c),
      style: s,
      ...l,
      children: [u, e && a && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", {
        className: "visually-hidden",
        children: a
      })]
    })
  });
});
CR.displayName = "PageItem";
function sy(e, t, r = e) {
  const n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
    children: a,
    ...u
  }, s) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(CR, {
    ...u,
    ref: s,
    children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", {
      "aria-hidden": "true",
      children: a || t
    }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", {
      className: "visually-hidden",
      children: r
    })]
  }));
  return n.displayName = e, n;
}
const hte = sy("First", "«"), pte = sy("Prev", "‹", "Previous"), vte = sy("Ellipsis", "…", "More"), gte = sy("Next", "›"), mte = sy("Last", "»"), x4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  size: r,
  ...n
}, a) => {
  const u = mn(e, "pagination");
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", {
    ref: a,
    ...n,
    className: ln(t, u, r && `${u}-${r}`)
  });
});
x4.displayName = "Pagination";
const Yc = Object.assign(x4, {
  First: hte,
  Prev: pte,
  Ellipsis: vte,
  Item: CR,
  Next: gte,
  Last: mte
}), yte = {
  /**
   * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.
   * @type {string}
   */
  id: hn.string,
  /** An `href` passed to the Toggle component */
  href: hn.string,
  /** An `onClick` handler passed to the Toggle component */
  onClick: hn.func,
  /** The content of the non-toggle Button.  */
  title: hn.node.isRequired,
  /** Disables both Buttons  */
  disabled: hn.bool,
  /**
   * Aligns the dropdown menu.
   *
   * _see [DropdownMenu](#dropdown-menu-props) for more details_
   *
   * @type {"start"|"end"|{ sm: "start"|"end" }|{ md: "start"|"end" }|{ lg: "start"|"end" }|{ xl: "start"|"end"}|{ xxl: "start"|"end"} }
   */
  align: eB,
  /** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
  menuRole: hn.string,
  /** Whether to render the dropdown menu in the DOM before the first time it is shown */
  renderMenuOnMount: hn.bool,
  /**
   *  Which event when fired outside the component will cause it to be closed.
   *
   * _see [DropdownMenu](#dropdown-menu-props) for more details_
   */
  rootCloseEvent: hn.string,
  /**
   * Menu color variant.
   *
   * Omitting this will use the default light color.
   */
  menuVariant: hn.oneOf(["dark"]),
  /**
   * Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
   * Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
   *
   */
  flip: hn.bool,
  /** @ignore */
  bsPrefix: hn.string,
  /** @ignore */
  variant: hn.string,
  /** @ignore */
  size: hn.string
}, bR = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  title: e,
  children: t,
  bsPrefix: r,
  rootCloseEvent: n,
  variant: a,
  size: u,
  menuRole: s,
  renderMenuOnMount: c,
  disabled: i,
  href: l,
  id: v,
  menuVariant: f,
  flip: p,
  ...g
}, y) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Za, {
  ref: y,
  ...g,
  children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(u2, {
    id: v,
    href: l,
    size: u,
    variant: a,
    disabled: i,
    childBsPrefix: r,
    children: e
  }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(l2, {
    role: s,
    renderOnMount: c,
    rootCloseEvent: n,
    variant: f,
    flip: p,
    children: t
  })]
}));
bR.displayName = "DropdownButton";
bR.propTypes = yte;
var Cte = { fieldSeparator: ",", decimalSeparator: ".", quoteStrings: !0, quoteCharacter: '"', showTitle: !1, title: "My Generated Report", filename: "generated", showColumnHeaders: !0, useTextFile: !1, useBom: !0, columnHeaders: [], useKeysAsHeaders: !1, boolDisplay: { true: "TRUE", false: "FALSE" }, replaceUndefinedWith: "" }, bte = `\r
`, wte = "\uFEFF", T4 = (e) => Object.assign({}, Cte, e);
class Ste extends Error {
  constructor(t) {
    super(t), this.name = "CsvGenerationError";
  }
}
class xte extends Error {
  constructor(t) {
    super(t), this.name = "EmptyHeadersError";
  }
}
class Tte extends Error {
  constructor(t) {
    super(t), this.name = "UnsupportedDataFormatError";
  }
}
var _v = (e) => e, qs = (e) => e, Fm = _v, Q1 = _v, Fv = _v, EF = _v, MF = _v, Rte = function(e, t) {
  return t == '"' && e.indexOf('"') > -1 ? e.replace(/"/g, '""') : e;
}, Ate = (e) => EF(typeof e == "object" ? e.key : e), Ete = (e) => MF(typeof e == "object" ? e.displayLabel : e), Mte = (e, ...t) => t.reduce((r, n) => n(r), e), Dte = (e) => (t) => e.useBom ? Q1(qs(t) + wte) : t, Fte = (e) => (t) => e.showTitle ? wR(Q1(qs(t) + e.title))(Fv("")) : t, wR = (e) => (t) => Q1(qs(e) + qs(t) + bte), R4 = (e) => (t, r) => Pte(e)(Fv(qs(t) + qs(r))), Pte = (e) => (t) => _v(qs(t) + e.fieldSeparator), Ite = (e, t) => (r) => {
  if (!e.showColumnHeaders) return r;
  if (t.length < 1) throw new xte("Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.");
  let n = Fv("");
  for (let a = 0; a < t.length; a++) {
    const u = Ete(t[a]);
    n = R4(e)(n, A4(e, qs(u)));
  }
  return n = Fv(qs(n).slice(0, -1)), wR(r)(n);
}, Lte = (e, t, r) => (n) => {
  let a = n;
  for (var u = 0; u < r.length; u++) {
    let s = Fv("");
    for (let c = 0; c < t.length; c++) {
      const i = Ate(t[c]), l = r[u][qs(i)];
      s = R4(e)(s, A4(e, l));
    }
    s = Fv(qs(s).slice(0, -1)), a = wR(a)(s);
  }
  return a;
}, kte = qs, Ote = (e) => +e === e && (!isFinite(e) || !!(e % 1)), Nte = (e, t) => {
  if (Ote(t)) {
    if (e.decimalSeparator === "locale") return Fm(t.toLocaleString());
    if (e.decimalSeparator) return Fm(t.toString().replace(".", e.decimalSeparator));
  }
  return Fm(t.toString());
}, HC = (e, t) => {
  let r = t;
  return (e.quoteStrings || e.fieldSeparator && t.indexOf(e.fieldSeparator) > -1 || e.quoteCharacter && t.indexOf(e.quoteCharacter) > -1 || t.indexOf(`
`) > -1 || t.indexOf("\r") > -1) && (r = e.quoteCharacter + Rte(t, e.quoteCharacter) + e.quoteCharacter), Fm(r);
}, Gte = (e, t) => {
  const r = t ? "true" : "false";
  return Fm(e.boolDisplay[r]);
}, Hte = (e, t) => typeof t > "u" && e.replaceUndefinedWith !== void 0 ? HC(e, e.replaceUndefinedWith + "") : t === null ? HC(e, "null") : HC(e, ""), A4 = (e, t) => {
  if (typeof t == "number") return Nte(e, t);
  if (typeof t == "string") return HC(e, t);
  if (typeof t == "boolean" && e.boolDisplay) return Gte(e, t);
  if (t === null || typeof t > "u") return Hte(e, t);
  throw new Tte(`
    typeof ${typeof t} isn't supported. Only number, string, boolean, null and undefined are supported.
    Please convert the data in your object to one of those before generating the CSV.
    `);
}, Bte = (e) => (t) => {
  const r = T4(e), n = r.useKeysAsHeaders ? Object.keys(t[0]) : r.columnHeaders;
  let a = Mte(Q1(""), Dte(r), Fte(r), Ite(r, n), Lte(r, n, t));
  if (qs(a).length < 1) throw new Ste("Output is empty. Is your data formatted correctly?");
  return a;
}, Mi = /* @__PURE__ */ ((e) => (e[e.READY = 0] = "READY", e[e.RUNNING = 1] = "RUNNING", e[e.WRITING = 2] = "WRITING", e[e.FINISHED = 3] = "FINISHED", e[e.CANCELLED = 4] = "CANCELLED", e[e.ERROR = 5] = "ERROR", e))(Mi || {}), xC;
function DF(e) {
  if ((!xC && xC !== 0 || e) && Iv) {
    var t = document.createElement("div");
    t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "50px", t.style.height = "50px", t.style.overflow = "scroll", document.body.appendChild(t), xC = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
  }
  return xC;
}
const E4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "modal-body"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
E4.displayName = "ModalBody";
const SR = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  contentClassName: r,
  centered: n,
  size: a,
  fullscreen: u,
  children: s,
  scrollable: c,
  ...i
}, l) => {
  e = mn(e, "modal");
  const v = `${e}-dialog`, f = typeof u == "string" ? `${e}-fullscreen-${u}` : `${e}-fullscreen`;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    ...i,
    ref: l,
    className: ln(v, t, a && `${e}-${a}`, n && `${v}-centered`, c && `${v}-scrollable`, u && f),
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
      className: ln(`${e}-content`, r),
      children: s
    })
  });
});
SR.displayName = "ModalDialog";
const M4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "div",
  ...n
}, a) => (t = mn(t, "modal-footer"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
M4.displayName = "ModalFooter";
const D4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  closeLabel: r = "Close",
  closeButton: n = !1,
  ...a
}, u) => (e = mn(e, "modal-header"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GP, {
  ref: u,
  ...a,
  className: ln(t, e),
  closeLabel: r,
  closeButton: n
})));
D4.displayName = "ModalHeader";
const Vte = Km("h4"), F4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = Vte,
  ...n
}, a) => (t = mn(t, "modal-title"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
F4.displayName = "ModalTitle";
function zte(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(rf, {
    ...e,
    timeout: null
  });
}
function Wte(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(rf, {
    ...e,
    timeout: null
  });
}
const P4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  className: t,
  style: r,
  dialogClassName: n,
  contentClassName: a,
  children: u,
  dialogAs: s = SR,
  "data-bs-theme": c,
  "aria-labelledby": i,
  "aria-describedby": l,
  "aria-label": v,
  /* BaseModal props */
  show: f = !1,
  animation: p = !0,
  backdrop: g = !0,
  keyboard: y = !0,
  onEscapeKeyDown: C,
  onShow: m,
  onHide: h,
  container: w,
  autoFocus: S = !0,
  enforceFocus: E = !0,
  restoreFocus: x = !0,
  restoreFocusOptions: T,
  onEntered: F,
  onExit: P,
  onExiting: k,
  onEnter: I,
  onEntering: L,
  onExited: A,
  backdropClassName: O,
  manager: N,
  ...Y
}, j) => {
  const [te, re] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}), [z, Z] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), W = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), q = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), ie = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), [ce, X] = xP(), U = ad(j, X), ne = wa(h), se = JF();
  e = mn(e, "modal");
  const le = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    onHide: ne
  }), [ne]);
  function ue() {
    return N || zP({
      isRTL: se
    });
  }
  function ve(me) {
    if (!Iv) return;
    const xe = ue().getScrollbarWidth() > 0, Fe = me.scrollHeight > Ym(me).documentElement.clientHeight;
    re({
      paddingRight: xe && !Fe ? DF() : void 0,
      paddingLeft: !xe && Fe ? DF() : void 0
    });
  }
  const be = wa(() => {
    ce && ve(ce.dialog);
  });
  PP(() => {
    Bx(window, "resize", be), ie.current == null || ie.current();
  });
  const Me = () => {
    W.current = !0;
  }, Ge = (me) => {
    W.current && ce && me.target === ce.dialog && (q.current = !0), W.current = !1;
  }, we = () => {
    Z(!0), ie.current = YF(ce.dialog, () => {
      Z(!1);
    });
  }, Re = (me) => {
    me.target === me.currentTarget && we();
  }, Ae = (me) => {
    if (g === "static") {
      Re(me);
      return;
    }
    if (q.current || me.target !== me.currentTarget) {
      q.current = !1;
      return;
    }
    h == null || h();
  }, K = (me) => {
    y ? C == null || C(me) : (me.preventDefault(), g === "static" && we());
  }, ee = (me, xe) => {
    me && ve(me), I == null || I(me, xe);
  }, oe = (me) => {
    ie.current == null || ie.current(), P == null || P(me);
  }, _ = (me, xe) => {
    L == null || L(me, xe), OT(window, "resize", be);
  }, V = (me) => {
    me && (me.style.display = ""), A == null || A(me), Bx(window, "resize", be);
  }, fe = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((me) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    ...me,
    className: ln(`${e}-backdrop`, O, !p && "show")
  }), [p, O, e]), $ = {
    ...r,
    ...te
  };
  $.display = "block";
  const he = (me) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    role: "dialog",
    ...me,
    style: $,
    className: ln(t, e, z && `${e}-static`, !p && "show"),
    onClick: g ? Ae : void 0,
    onMouseUp: Ge,
    "data-bs-theme": c,
    "aria-label": v,
    "aria-labelledby": i,
    "aria-describedby": l,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s, {
      ...Y,
      onMouseDown: Me,
      className: n,
      contentClassName: a,
      children: u
    })
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(qT.Provider, {
    value: le,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(kP, {
      show: f,
      ref: U,
      backdrop: g,
      container: w,
      keyboard: !0,
      autoFocus: S,
      enforceFocus: E,
      restoreFocus: x,
      restoreFocusOptions: T,
      onEscapeKeyDown: K,
      onShow: m,
      onHide: h,
      onEnter: ee,
      onEntering: _,
      onEntered: F,
      onExit: oe,
      onExiting: k,
      onExited: V,
      manager: ue(),
      transition: p ? zte : void 0,
      backdropTransition: p ? Wte : void 0,
      renderBackdrop: fe,
      renderDialog: he
    })
  });
});
P4.displayName = "Modal";
const ns = Object.assign(P4, {
  Body: E4,
  Header: D4,
  Title: F4,
  Footer: M4,
  Dialog: SR,
  TRANSITION_DURATION: 300,
  BACKDROP_TRANSITION_DURATION: 150
}), q1 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = "span",
  ...n
}, a) => (t = mn(t, "input-group-text"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
q1.displayName = "InputGroupText";
const _te = (e) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(q1, {
  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($m, {
    type: "checkbox",
    ...e
  })
}), Ute = (e) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(q1, {
  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($m, {
    type: "radio",
    ...e
  })
}), I4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  size: t,
  hasValidation: r,
  className: n,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: a = "div",
  ...u
}, s) => {
  e = mn(e, "input-group");
  const c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({}), []);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(G1.Provider, {
    value: c,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(a, {
      ref: s,
      ...u,
      className: ln(n, e, t && `${e}-${t}`, r && "has-validation")
    })
  });
});
I4.displayName = "InputGroup";
const Px = Object.assign(I4, {
  Text: q1,
  Radio: Ute,
  Checkbox: _te
}), FF = 1e3;
function jte(e, t, r) {
  const n = (e - t) / (r - t) * 100;
  return Math.round(n * FF) / FF;
}
function PF({
  min: e,
  now: t,
  max: r,
  label: n,
  visuallyHidden: a,
  striped: u,
  animated: s,
  className: c,
  style: i,
  variant: l,
  bsPrefix: v,
  ...f
}, p) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    ref: p,
    ...f,
    role: "progressbar",
    className: ln(c, `${v}-bar`, {
      [`bg-${l}`]: l,
      [`${v}-bar-animated`]: s,
      [`${v}-bar-striped`]: s || u
    }),
    style: {
      width: `${jte(t, e, r)}%`,
      ...i
    },
    "aria-valuenow": t,
    "aria-valuemin": e,
    "aria-valuemax": r,
    children: a ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", {
      className: "visually-hidden",
      children: n
    }) : n
  });
}
const AT = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  isChild: e = !1,
  ...t
}, r) => {
  const n = {
    min: 0,
    max: 100,
    animated: !1,
    visuallyHidden: !1,
    striped: !1,
    ...t
  };
  if (n.bsPrefix = mn(n.bsPrefix, "progress"), e)
    return PF(n, r);
  const {
    min: a,
    now: u,
    max: s,
    label: c,
    visuallyHidden: i,
    striped: l,
    animated: v,
    bsPrefix: f,
    variant: p,
    className: g,
    children: y,
    ...C
  } = n;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    ref: r,
    ...C,
    className: ln(g, f),
    children: y ? Yx(y, (m) => /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(m, {
      isChild: !0
    })) : PF({
      min: a,
      now: u,
      max: s,
      label: c,
      visuallyHidden: i,
      striped: l,
      animated: v,
      bsPrefix: f,
      variant: p
    }, r)
  });
});
AT.displayName = "ProgressBar";
const xR = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  variant: t,
  animation: r = "border",
  size: n,
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: a = "div",
  className: u,
  ...s
}, c) => {
  e = mn(e, "spinner");
  const i = `${e}-${r}`;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(a, {
    ref: c,
    ...s,
    className: ln(u, i, n && `${i}-${n}`, t && `text-${t}`)
  });
});
xR.displayName = "Spinner";
function L4(e, t) {
  return Array.isArray(e) ? e.includes(t) : e === t;
}
const ly = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext({});
ly.displayName = "AccordionContext";
const TR = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  as: e = "div",
  bsPrefix: t,
  className: r,
  children: n,
  eventKey: a,
  ...u
}, s) => {
  const {
    activeEventKey: c
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ly);
  return t = mn(t, "accordion-collapse"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MP, {
    ref: s,
    in: L4(c, a),
    ...u,
    className: ln(r, t),
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
      children: react__WEBPACK_IMPORTED_MODULE_1__.Children.only(n)
    })
  });
});
TR.displayName = "AccordionCollapse";
const eb = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext({
  eventKey: ""
});
eb.displayName = "AccordionItemContext";
const k4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: e = "div",
  bsPrefix: t,
  className: r,
  onEnter: n,
  onEntering: a,
  onEntered: u,
  onExit: s,
  onExiting: c,
  onExited: i,
  ...l
}, v) => {
  t = mn(t, "accordion-body");
  const {
    eventKey: f
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(eb);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TR, {
    eventKey: f,
    onEnter: n,
    onEntering: a,
    onEntered: u,
    onExit: s,
    onExiting: c,
    onExited: i,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
      ref: v,
      ...l,
      className: ln(r, t)
    })
  });
});
k4.displayName = "AccordionBody";
function Yte(e, t) {
  const {
    activeEventKey: r,
    onSelect: n,
    alwaysOpen: a
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ly);
  return (u) => {
    let s = e === r ? null : e;
    a && (Array.isArray(r) ? r.includes(e) ? s = r.filter((c) => c !== e) : s = [...r, e] : s = [e]), n == null || n(s, u), t == null || t(u);
  };
}
const RR = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: e = "button",
  bsPrefix: t,
  className: r,
  onClick: n,
  ...a
}, u) => {
  t = mn(t, "accordion-button");
  const {
    eventKey: s
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(eb), c = Yte(s, n), {
    activeEventKey: i
  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ly);
  return e === "button" && (a.type = "button"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
    ref: u,
    onClick: c,
    ...a,
    "aria-expanded": Array.isArray(i) ? i.includes(s) : s === i,
    className: ln(r, t, !L4(i, s) && "collapsed")
  });
});
RR.displayName = "AccordionButton";
const O4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: e = "h2",
  bsPrefix: t,
  className: r,
  children: n,
  onClick: a,
  ...u
}, s) => (t = mn(t, "accordion-header"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
  ref: s,
  ...u,
  className: ln(r, t),
  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(RR, {
    onClick: a,
    children: n
  })
})));
O4.displayName = "AccordionHeader";
const N4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  as: e = "div",
  bsPrefix: t,
  className: r,
  eventKey: n,
  ...a
}, u) => {
  t = mn(t, "accordion-item");
  const s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    eventKey: n
  }), [n]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(eb.Provider, {
    value: s,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, {
      ref: u,
      ...a,
      className: ln(r, t)
    })
  });
});
N4.displayName = "AccordionItem";
const G4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  const {
    // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
    as: r = "div",
    activeKey: n,
    bsPrefix: a,
    className: u,
    onSelect: s,
    flush: c,
    alwaysOpen: i,
    ...l
  } = Lv(e, {
    activeKey: "onSelect"
  }), v = mn(a, "accordion"), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    activeEventKey: n,
    onSelect: s,
    alwaysOpen: i
  }), [n, s, i]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ly.Provider, {
    value: f,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
      ref: t,
      ...l,
      className: ln(u, v, c && `${v}-flush`)
    })
  });
});
G4.displayName = "Accordion";
const TC = Object.assign(G4, {
  Button: RR,
  Collapse: TR,
  Item: N4,
  Header: O4,
  Body: k4
});
function H4(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di, { children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { className: "d-flex justify-content-center", children: "Error Occurred." }),
      e.message && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Text, { className: "d-flex justify-content-center", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { className: "onyx-text-pink", children: e.message }) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Text, { className: "d-flex justify-content-center", children: "Please try again or contact CLIMB-TRE support if the problem persists." })
    ] }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TC, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(TC.Item, { eventKey: "0", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TC.Header, { children: "View Error Message" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TC.Body, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("small", { className: "onyx-text-pink font-monospace", children: e.error ? `${e.error.name}: ${e.error.message}` : "No error message." }) })
    ] }) })
  ] });
}
function B4(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    ns,
    {
      className: "onyx-modal",
      centered: !0,
      show: e.show,
      onHide: e.onHide,
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Header, { closeButton: !0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Title, { children: e.title }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Body, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(H4, { ...e }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Footer, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { variant: "dark", onClick: e.onHide, children: "Close" }) })
      ]
    }
  );
}
function Xte() {
  const e = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)({ status: Mi.READY }), t = () => e.current.status = Mi.CANCELLED, r = () => e.current.status = Mi.READY;
  return {
    statusToken: e.current,
    readyExport: r,
    cancelExport: t
  };
}
function $te(e) {
  return !/^[a-zA-Z0-9_/-]+$/.test(e.trim()) || e.trim().length < 5 || e.trim().length > 50;
}
function V4(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(Mi.READY), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [l, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), { statusToken: f, readyExport: p, cancelExport: g } = Xte(), y = () => {
    const h = c || e.defaultFileNamePrefix;
    if ($te(h)) {
      v(!0);
      return;
    } else v(!1);
    a(0), s(null), p(), e.handleExport({
      fileName: h + e.fileExtension,
      statusToken: f,
      setExportStatus: r,
      setExportProgress: a,
      setExportError: s
    });
  }, C = () => {
    g(), r(Mi.CANCELLED);
  }, m = (h) => {
    v(!1), i(h.target.value);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    ns,
    {
      className: "onyx-modal",
      centered: !0,
      show: e.show,
      onHide: e.onHide,
      onExited: () => {
        (t === Mi.FINISHED || t === Mi.CANCELLED) && r(Mi.READY);
      },
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Header, { closeButton: !0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Title, { children: "Export Data" }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ns.Body, { children: [
          t === Mi.READY && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Px, { className: "mb-3", children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Px.Text, { children: "File Name" }),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              Di.Control,
              {
                value: c,
                placeholder: e.defaultFileNamePrefix,
                onChange: m,
                onKeyDown: (h) => {
                  h.key === "Enter" && e.defaultFileNamePrefix.startsWith(c) && i(e.defaultFileNamePrefix);
                },
                isInvalid: l
              }
            ),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Px.Text, { children: e.fileExtension }),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Control.Feedback, { type: "invalid", children: "Prefix must be 5 to 50 alphanumeric, underscore or dash characters." }),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Text, { muted: !0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { children: "Warning:" }),
              " If the file already exists, it will be overwritten."
            ] }) })
          ] }),
          t === Mi.RUNNING && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { className: "d-flex justify-content-center", children: e.exportProgressMessage }),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AT, { now: n })
          ] }),
          t === Mi.CANCELLED && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { className: "d-flex justify-content-center", children: "Cancelled Operation." }),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AT, { now: n, variant: "danger" })
          ] }),
          t === Mi.ERROR && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(H4, { error: u }),
          t === Mi.WRITING && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Group, { className: "mb-3", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { className: "d-flex justify-content-center", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 2, children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(xR, {}),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "Writing File..." })
          ] }) }) }),
          t === Mi.FINISHED && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { className: "d-flex justify-content-center", children: "Export Finished." }),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Text, { className: "d-flex justify-content-center", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [
              "File Name:",
              " ",
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { children: (c || e.defaultFileNamePrefix) + e.fileExtension })
            ] }) })
          ] })
        ] }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ns.Footer, { children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { variant: "dark", onClick: e.onHide, children: "Close" }),
          t === Mi.READY && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { variant: "primary", onClick: y, children: "Export" }),
          t === Mi.RUNNING && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { variant: "danger", onClick: C, children: "Cancel" }),
          (t === Mi.CANCELLED || t === Mi.ERROR) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            Ki,
            {
              variant: "primary",
              onClick: () => r(Mi.READY),
              children: "Retry"
            }
          ),
          (t === Mi.WRITING || t === Mi.FINISHED) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { variant: "primary", onClick: e.onHide, children: "Done" })
        ] })
      ]
    }
  );
}
tc.registerModules([rte, fte]);
function AR(e) {
  var t;
  return ((t = e.data) == null ? void 0 : t.map(
    (r) => Object.fromEntries(
      Object.entries(r).map(([n, a]) => [
        n,
        typeof a == "string" || typeof a == "number" ? a : typeof a == "boolean" || a === null ? (a == null ? void 0 : a.toString()) || "" : JSON.stringify(a)
      ])
    )
  )) || [];
}
function z4(e, t) {
  let r;
  return e.data.data && e.data.data.length > 0 ? r = Object.keys(e.data.data[0]).map((n) => {
    var u, s;
    const a = t(n);
    return (u = e.cellRenderers) != null && u.get(n) && (a.cellRenderer = e.cellRenderers.get(n)), n === "climb_id" ? a.pinned = "left" : n === "changes" && (a.autoHeight = !0, a.wrapText = !0), (s = e.tooltipFields) != null && s.includes(n) && (a.tooltipValueGetter = (c) => c.value.toString()), (!e.flexOnly || e.flexOnly.includes(n)) && (a.flex = 1), a;
  }) : r = [], r;
}
function Zte(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Yc, { size: "sm", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Yc.First,
      {
        disabled: !(e.isPaginated && e.paginationParams.prevPage),
        onClick: () => e.paginationParams.handleUserPageChange(
          e.paginationParams.prevParams,
          1
        )
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Yc.Prev,
      {
        disabled: !(e.isPaginated && e.paginationParams.prevPage),
        onClick: () => e.paginationParams.handleUserPageChange(
          e.paginationParams.prevParams,
          e.paginationParams.pageNumber - 1
        )
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Yc.Item,
      {
        disabled: !e.isPaginated,
        style: { minWidth: "125px", textAlign: "center" },
        children: e.paginationParams.pageCountMessage
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Yc.Next,
      {
        disabled: !(e.isPaginated && e.paginationParams.nextPage),
        onClick: () => e.paginationParams.handleUserPageChange(
          e.paginationParams.nextParams,
          e.paginationParams.pageNumber + 1
        )
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Yc.Last,
      {
        disabled: !(e.isPaginated && e.paginationParams.nextPage),
        onClick: () => e.paginationParams.handleUserPageChange(
          e.paginationParams.nextParams,
          e.paginationParams.numPages
        )
      }
    )
  ] });
}
function Kte(e, t, r) {
  e.length > 0 && r === "asc" ? typeof e[0][t] == "number" ? e.sort((n, a) => n[t] - a[t]) : e.sort(
    (n, a) => n[t] > a[t] ? 1 : -1
  ) : e.length > 0 && r === "desc" && (typeof e[0][t] == "number" ? e.sort((n, a) => a[t] - n[t]) : e.sort(
    (n, a) => n[t] < a[t] ? 1 : -1
  ));
}
function Jte(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    var l, v;
    (l = e.gridRef.current) == null || l.api.resetColumnState(), (v = e.gridRef.current) == null || v.api.sizeColumnsToFit();
  }, [e.gridRef]), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    () => {
      var l, v, f;
      return (f = e.gridRef.current) == null ? void 0 : f.api.setColumnsPinned(
        ((v = (l = e.gridRef.current) == null ? void 0 : l.api.getColumns()) == null ? void 0 : v.map((p) => p.getId())) || [],
        null
      );
    },
    [e.gridRef]
  ), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    () => {
      var l;
      return (l = e.gridRef.current) == null ? void 0 : l.api.setFilterModel(null);
    },
    [e.gridRef]
  ), s = async (l) => {
    l.setExportStatus(Mi.RUNNING);
    const v = T4({
      useKeysAsHeaders: !0
    }), f = [];
    let p = 0, g = new URLSearchParams(e.searchParameters);
    for (; g; ) {
      const C = new URLSearchParams(g);
      await e.httpPathHandler(`projects/${e.project}/?${C.toString()}`).then((m) => m.json()).then((m) => {
        var w;
        if (l.statusToken.status === Mi.CANCELLED)
          throw new Error("export_cancelled");
        const h = AR(m);
        f.push(h), g = ((w = m.next) == null ? void 0 : w.split("?", 2)[1]) || "", p += h.length, l.setExportProgress(
          p / e.rowDisplayParams.of * 100
        );
      });
    }
    const y = Array.prototype.concat.apply([], f);
    return y.length === 0 ? "" : (e.paginationParams.order && Kte(
      y,
      e.paginationParams.order.replace(/^-/, ""),
      e.paginationParams.order.startsWith("-") ? "desc" : "asc"
    ), kte(Bte(v)(y)));
  }, c = async () => {
    var v;
    return ((v = e.gridRef.current) == null ? void 0 : v.api.getDataAsCsv()) || "";
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Yc, { size: "sm", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      V4,
      {
        ...e,
        fileExtension: ".csv",
        show: t,
        handleExport: (l) => {
          let v;
          e.isPaginated ? v = () => s(l) : v = c, v().then((f) => {
            l.setExportStatus(Mi.WRITING), e.fileWriter(l.fileName, f).then(() => l.setExportStatus(Mi.FINISHED)).catch((p) => {
              l.setExportError(p), l.setExportStatus(Mi.ERROR);
            });
          }).catch((f) => {
            f.message === "export_cancelled" ? l.setExportStatus(Mi.CANCELLED) : (l.setExportError(f), l.setExportStatus(Mi.ERROR));
          });
        },
        onHide: () => r(!1),
        exportProgressMessage: `Gathering ${e.rowDisplayParams.of} records...`
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      bR,
      {
        id: "table-options",
        title: "Options",
        size: "sm",
        variant: "dark",
        children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Header, { children: "Column Controls" }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Item, { onClick: n, children: "Reset All Columns" }, "resetAllColumns"),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Item, { onClick: a, children: "Unpin All Columns" }, "unpinAllColumns"),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($C, {}),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Header, { children: "Filter Controls" }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            Za.Item,
            {
              disabled: !e.isFilterable,
              onClick: u,
              children: "Clear Table Filters"
            },
            "clearTableFilters"
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($C, {}),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Header, { children: "Export Data" }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            Za.Item,
            {
              onClick: () => r(!0),
              children: "Export to CSV"
            },
            "exportToCSV"
          )
        ]
      }
    )
  ] });
}
function W4(e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({ width: "100%", height: "100%" }), []), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({ height: "100%", width: "100%" }), []), [a, u] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    var c;
    e.isPaginated || u(((c = t.current) == null ? void 0 : c.api.getDisplayedRowCount()) || 0);
  }, [t, e.isPaginated]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { gap: 2, style: r, children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ag-theme-quartz", style: n, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Oee,
      {
        ref: t,
        rowData: e.rowData,
        columnDefs: e.columnDefs,
        tooltipMouseTrack: !0,
        tooltipHideDelay: 5e3,
        gridOptions: {
          ...e.gridOptions,
          enableCellTextSelection: !0,
          defaultColDef: {
            filter: e.isFilterable
          }
        },
        onGridReady: e.onGridReady,
        onRowDataUpdated: s,
        onFilterChanged: s,
        suppressMultiSort: !0,
        suppressColumnVirtualisation: !0,
        suppressCellFocus: !0,
        rowBuffer: 50,
        loading: e.isDataLoading
      }
    ) }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("i", { className: "text-secondary", children: e.footer || "" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { style: { float: "right" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 2, children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Yc, { size: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Yc.Item, { children: e.isCountLoading ? "Loading..." : `${e.rowDisplayParams.from} to ${e.isPaginated ? e.rowDisplayParams.to : a} of ${e.rowDisplayParams.of}` }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Zte, { ...e }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Jte,
          {
            ...e,
            gridRef: t,
            isFilterable: e.isFilterable
          }
        )
      ] }) }) })
    ] })
  ] });
}
function x1(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), u = (c) => {
    var l, v;
    const i = e.headerTooltipPrefix || "";
    return {
      field: c,
      headerName: ((l = e.headerNames) == null ? void 0 : l.get(c)) || c,
      minWidth: 200,
      headerTooltip: (v = e.headerTooltips) == null ? void 0 : v.get(i + c)
    };
  }, s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    r(AR(e.data)), a(z4(e, u));
  }, []);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    W4,
    {
      ...e,
      rowData: t,
      columnDefs: n,
      searchParameters: "",
      onGridReady: s,
      rowDisplayParams: {
        from: t.length >= 1 ? 1 : 0,
        to: t.length,
        of: t.length
      },
      footer: e.footer,
      isFilterable: !0,
      isPaginated: !1,
      paginationParams: {
        pageNumber: 1,
        numPages: 1,
        pageCountMessage: "Page 1 of 1",
        prevPage: !1,
        nextPage: !1,
        prevParams: "",
        nextParams: "",
        userPageSize: 0,
        handleUserPageChange: () => {
        },
        order: ""
      }
    }
  );
}
function Qte(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1), [l, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1), [f, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [g, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [C, m] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [h, w] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({
    fromCount: 0,
    toCount: 0
  }), [S, E] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), x = 1e3, T = 50, {
    isFetching: F,
    data: P = { count: 0, numPages: 0 }
  } = Nl({
    queryKey: ["count", e.project, e.searchParameters],
    queryFn: async () => {
      const z = new URLSearchParams(e.searchParameters).toString();
      return e.httpPathHandler(`projects/${e.project}/count/?${z}`).then((Z) => Z.json()).then((Z) => ({
        count: Z.data.count,
        numPages: Z.data.count ? Math.ceil(Z.data.count / T) : 1
      }));
    },
    enabled: !!e.project,
    cacheTime: 0.5 * 60 * 1e3
  }), k = !!(f || c > 1), I = !!(g || c < P.numPages), L = (z, Z) => z.slice(
    (Z - 1) * T,
    Z * T
  ), A = (z) => {
    const Z = x / T;
    return {
      resultsPage: z % Z || Z,
      serverPage: Math.ceil(z * T / x)
    };
  }, O = (z, Z) => {
    a(z), w({
      fromCount: (Z - 1) * T + (z.length >= 1 ? 1 : 0),
      toCount: (Z - 1) * T + z.length
    });
  }, N = (z, Z, W) => {
    var ie, ce;
    const q = AR(z);
    r(q), O(L(q, Z), W), p(((ie = z.previous) == null ? void 0 : ie.split("?", 2)[1]) || ""), y(((ce = z.next) == null ? void 0 : ce.split("?", 2)[1]) || "");
  }, Y = (z) => {
    const Z = new URLSearchParams(e.searchParameters);
    if (z.columns && z.columns.length > 0) {
      const W = z.columns[z.columns.length - 1].getId(), q = z.columns[z.columns.length - 1].getSort() || "";
      q === "asc" ? (Z.set("order", W), E(W)) : q === "desc" ? (Z.set("order", `-${W}`), E(`-${W}`)) : E("");
    }
    j(Z.toString(), 1, !0);
  }, j = (z, Z, W = !1) => {
    const { resultsPage: q, serverPage: ie } = A(Z);
    if (i(Z), v(ie), !C && (W || ie !== l)) {
      m(!0);
      const ce = new URLSearchParams(z);
      ce.set("page", ie.toString()), ce.delete("cursor"), e.httpPathHandler(`projects/${e.project}/?${ce.toString()}`).then((X) => X.json()).then((X) => N(X, q, Z)).finally(() => m(!1));
    } else
      O(L(t, q), Z);
  }, te = (z) => {
    var W, q;
    const Z = e.headerTooltipPrefix || "";
    return {
      field: z,
      headerName: ((W = e.headerNames) == null ? void 0 : W.get(z)) || z,
      minWidth: 200,
      headerTooltip: (q = e.headerTooltips) == null ? void 0 : q.get(Z + z),
      comparator: () => 0
    };
  }, re = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    N(e.data, 1, 1), s(z4(e, te));
  }, []);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    W4,
    {
      ...e,
      rowData: n,
      columnDefs: u,
      gridOptions: {
        onSortChanged: Y
      },
      onGridReady: re,
      rowDisplayParams: {
        from: h.fromCount,
        to: h.toCount,
        of: P.count
      },
      footer: e.footer,
      isDataLoading: C,
      isCountLoading: F,
      isFilterable: !1,
      isPaginated: !0,
      paginationParams: {
        pageCountMessage: F ? "Loading..." : `Page ${c} of ${P.numPages}`,
        pageNumber: c,
        numPages: P.numPages,
        prevPage: k,
        nextPage: I,
        prevParams: f,
        nextParams: g,
        userPageSize: T,
        handleUserPageChange: j,
        order: S
      }
    }
  );
}
const _4 = Km("h4");
_4.displayName = "DivStyledAsH4";
const U4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = _4,
  ...n
}, a) => (t = mn(t, "alert-heading"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
U4.displayName = "AlertHeading";
const j4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  className: e,
  bsPrefix: t,
  as: r = Zm,
  ...n
}, a) => (t = mn(t, "alert-link"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(r, {
  ref: a,
  className: ln(e, t),
  ...n
})));
j4.displayName = "AlertLink";
const Y4 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((e, t) => {
  const {
    bsPrefix: r,
    show: n = !0,
    closeLabel: a = "Close alert",
    closeVariant: u,
    className: s,
    children: c,
    variant: i = "primary",
    onClose: l,
    dismissible: v,
    transition: f = rf,
    ...p
  } = Lv(e, {
    show: "onClose"
  }), g = mn(r, "alert"), y = wa((h) => {
    l && l(!1, h);
  }), C = f === !0 ? rf : f, m = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
    role: "alert",
    ...C ? void 0 : p,
    ref: t,
    className: ln(s, g, i && `${g}-${i}`, v && `${g}-dismissible`),
    children: [v && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ov, {
      onClick: y,
      "aria-label": a,
      variant: u
    }), c]
  });
  return C ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(C, {
    unmountOnExit: !0,
    ...p,
    ref: void 0,
    in: n,
    children: m
  }) : n ? m : null;
});
Y4.displayName = "Alert";
const ET = Object.assign(Y4, {
  Link: j4,
  Heading: U4
});
function qte() {
  const [e, t] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const r = setTimeout(() => t(!0), 500);
    return () => clearTimeout(r);
  }), e ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "d-flex justify-content-center", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 2, children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(xR, {}),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "Loading..." })
  ] }) }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {});
}
function ere(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: Object.entries(e.messages).map(
    ([t, r]) => Array.isArray(r) ? r.map((n) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ET, { variant: "danger", children: [
      t,
      ": ",
      n
    ] }, t)) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ET, { variant: "danger", children: [
      t,
      ": ",
      r
    ] }, t)
  ) });
}
function ER({
  isFetching: e,
  error: t,
  data: r,
  children: n
}) {
  return e ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(qte, {}) : t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ET, { variant: "danger", children: [
    "Error: ",
    t.message
  ] }) : r != null && r.messages ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ere, { messages: r.messages }) : n;
}
const X4 = "If you haven't already, please make sure you have clicked the 'Get Started With S3 Buckets' button under the 'S3 Buckets' tab on BRYN.";
function tre(e, t) {
  return [["", e]].concat(Array.from(new URLSearchParams(t).entries())).map(
    ([, r]) => r.split(/[ ,]+/).map((n) => n.replace(/[^a-zA-Z0-9_/-]/, ""))
  ).flat().join("_").slice(0, 50);
}
function rre(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => tre(e.project, e.searchParameters),
    [e.project, e.searchParameters]
  ), s = (v) => {
    a(v), r(!0);
  }, c = (v) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Ki,
    {
      className: "p-0",
      size: "sm",
      variant: "link",
      onClick: () => e.handleRecordModalShow(v.value),
      children: v.value
    }
  ), i = (v) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Ki,
    {
      className: "p-0",
      size: "sm",
      variant: "link",
      onClick: () => e.s3PathHandler(v.value).catch((f) => s(f)),
      children: v.value
    }
  ), l = /* @__PURE__ */ new Map([
    ["climb_id", c],
    ["ingest_report", i]
  ]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl, { className: "h-100", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Gl.Header, { children: "Results" }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(is, { fluid: !0, className: "p-2 pb-0 h-100", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        B4,
        {
          title: "S3 Reports",
          message: X4,
          error: n,
          show: t,
          onHide: () => r(!1)
        }
      ),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        ER,
        {
          isFetching: e.resultPending,
          error: e.resultError,
          data: e.resultData,
          children: e.searchParameters.includes("summarise=") ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            x1,
            {
              ...e,
              data: e.resultData || {},
              defaultFileNamePrefix: u,
              headerTooltips: e.fieldDescriptions,
              cellRenderers: l
            }
          ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            Qte,
            {
              ...e,
              searchParameters: e.searchParameters,
              defaultFileNamePrefix: u,
              data: e.resultData || {},
              headerTooltips: e.fieldDescriptions,
              cellRenderers: l
            }
          )
        }
      )
    ] })
  ] });
}
const wm = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({
  bsPrefix: e,
  bg: t = "primary",
  pill: r = !1,
  text: n,
  className: a,
  as: u = "span",
  ...s
}, c) => {
  const i = mn(e, "badge");
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(u, {
    ref: c,
    ...s,
    className: ln(a, i, r && "rounded-pill", n && `text-${n}`, t && `bg-${t}`)
  });
});
wm.displayName = "Badge";
function nre(e) {
  let t;
  return x8(e, (r) => {
    t == null && (t = r.props.eventKey);
  }), t;
}
function ire(e) {
  const {
    title: t,
    eventKey: r,
    disabled: n,
    tabClassName: a,
    tabAttrs: u,
    id: s
  } = e.props;
  return t == null ? null : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(JT, {
    as: "li",
    role: "presentation",
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(L1, {
      as: "button",
      type: "button",
      eventKey: r,
      disabled: n,
      id: s,
      className: a,
      ...u,
      children: t
    })
  });
}
const $4 = (e) => {
  const {
    id: t,
    onSelect: r,
    transition: n,
    mountOnEnter: a = !1,
    unmountOnExit: u = !1,
    variant: s = "tabs",
    children: c,
    activeKey: i = nre(c),
    ...l
  } = Lv(e, {
    activeKey: "onSelect"
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(LT, {
    id: t,
    activeKey: i,
    onSelect: r,
    transition: HT(n),
    mountOnEnter: a,
    unmountOnExit: u,
    children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys, {
      id: t,
      ...l,
      role: "tablist",
      as: "ul",
      variant: s,
      children: Yx(c, ire)
    }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(zT, {
      children: Yx(c, (v) => {
        const f = {
          ...v.props
        };
        return delete f.title, delete f.disabled, delete f.tabClassName, delete f.tabAttrs, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(WT, {
          ...f
        });
      })
    })]
  });
};
$4.displayName = "Tabs";
function Ix({
  record: e,
  field: t,
  name: r
}) {
  var n;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Yh, { children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { md: 6, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h6", { children: [
      r,
      ":"
    ] }) }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { md: 6, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "onyx-text-pink", children: ((n = e[t]) == null ? void 0 : n.toString()) || "" }) })
  ] });
}
function are(e) {
  var m;
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), c = (h) => {
    s(h), a(!0);
  }, i = (h) => typeof h.value == "string" && h.value.startsWith("s3://") && h.value.endsWith(".html") ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Ki,
    {
      className: "p-0",
      size: "sm",
      variant: "link",
      onClick: () => e.s3PathHandler(h.value).catch((w) => c(w)),
      children: h.value
    }
  ) : h.value, {
    isFetching: l,
    error: v,
    data: f = { data: {} }
  } = Nl({
    queryKey: ["record-data", e.project, e.recordID],
    queryFn: async () => e.httpPathHandler(`projects/${e.project}/${e.recordID}/`).then((h) => h.json()),
    enabled: !!(e.project && e.recordID),
    staleTime: 1 * 60 * 1e3
  }), p = (h) => h.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" "), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => Object.entries((f == null ? void 0 : f.data) || {}).filter(
      ([h]) => {
        var w;
        return ((w = e.projectFields.get(h)) == null ? void 0 : w.type) !== "relation";
      }
    ),
    [f, e.projectFields]
  ), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => Object.entries((f == null ? void 0 : f.data) || {}).filter(([h]) => {
      var w;
      return ((w = e.projectFields.get(h)) == null ? void 0 : w.type) === "relation";
    }).sort(([h], [w]) => h < w ? -1 : 1),
    [f, e.projectFields]
  ), C = (h) => {
    const w = JSON.stringify(f.data);
    h.setExportStatus(Mi.WRITING), e.fileWriter(h.fileName, w).then(() => h.setExportStatus(Mi.FINISHED)).catch((S) => {
      h.setExportError(S), h.setExportStatus(Mi.ERROR);
    });
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    ER,
    {
      isFetching: l,
      error: v,
      data: f,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
        hu.Container,
        {
          id: "record-data-tabs",
          defaultActiveKey: "record-data-details",
          children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              B4,
              {
                title: "S3 Reports",
                message: X4,
                error: u,
                show: n,
                onHide: () => a(!1)
              }
            ),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              V4,
              {
                ...e,
                defaultFileNamePrefix: e.recordID,
                fileExtension: ".json",
                show: t,
                handleExport: C,
                onHide: () => r(!1),
                exportProgressMessage: "Exporting record data to JSON..."
              }
            ),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Yh, { className: "h-100", children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { xs: 3, xl: 2, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { gap: 1, children: [
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(is, { children: [
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    Ix,
                    {
                      record: f == null ? void 0 : f.data,
                      field: "published_date",
                      name: "Date"
                    }
                  ),
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    Ix,
                    {
                      record: f == null ? void 0 : f.data,
                      field: "site",
                      name: "Site"
                    }
                  ),
                  ((m = f == null ? void 0 : f.data) == null ? void 0 : m.platform) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    Ix,
                    {
                      record: f == null ? void 0 : f.data,
                      field: "platform",
                      name: "Platform"
                    }
                  )
                ] }),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ys, { variant: "pills", className: "flex-column", children: [
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Item, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Link, { eventKey: "record-data-details", children: "Details" }) }),
                  y.map(([h]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Item, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ys.Link, { eventKey: h, children: p(h) }) }, h))
                ] }),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                  Ki,
                  {
                    size: "sm",
                    variant: "dark",
                    onClick: () => r(!0),
                    children: "Export Record to JSON"
                  }
                )
              ] }) }),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { xs: 9, xl: 10, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(hu.Content, { className: "h-100", children: [
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(hu.Pane, { eventKey: "record-data-details", className: "h-100", children: [
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h5", { children: "Details" }),
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    x1,
                    {
                      ...e,
                      data: {
                        data: g.map(([h, w]) => ({
                          Field: h,
                          Value: w
                        }))
                      },
                      defaultFileNamePrefix: `${e.recordID}_details`,
                      footer: "Table showing the top-level fields for the record.",
                      cellRenderers: /* @__PURE__ */ new Map([["Value", i]])
                    }
                  )
                ] }),
                y.map(([h, w]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(hu.Pane, { eventKey: h, className: "h-100", children: [
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h5", { children: p(h) }),
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    x1,
                    {
                      ...e,
                      data: { data: w },
                      defaultFileNamePrefix: `${e.recordID}_${h}`,
                      headerTooltips: e.fieldDescriptions,
                      headerTooltipPrefix: h + "__",
                      footer: e.fieldDescriptions.get(h) || "No Description."
                    }
                  )
                ] }, h))
              ] }) })
            ] })
          ]
        }
      )
    }
  );
}
function ore(e) {
  const t = new Date(e.value.toString());
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t.toDateString() });
}
function sre(e) {
  const t = e.value.toString().toLowerCase();
  return t === "add" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(wm, { bg: "dark", children: t }) : t === "change" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(wm, { bg: "info", className: "text-dark", children: t }) : t === "delete" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(wm, { bg: "danger", children: t }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(wm, { bg: "secondary", children: t });
}
function lre(e) {
  const t = JSON.parse(e.value);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { children: t.map((r, n) => {
    var a, u, s;
    if (r.type === "relation") {
      let c;
      return r.action === "add" ? c = "Added" : r.action === "change" ? c = "Changed" : r.action === "delete" ? c = "Deleted" : c = "Modified", /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("strong", { children: (a = r.field) == null ? void 0 : a.toString() }),
        ": ",
        c,
        " ",
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "onyx-text-pink", children: (u = r.count) == null ? void 0 : u.toString() }),
        " ",
        "record",
        r.count === 1 ? "" : "s",
        "."
      ] }, n);
    } else
      return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("strong", { children: (s = r.field) == null ? void 0 : s.toString() }),
        ":",
        " ",
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "onyx-text-pink", children: JSON.stringify(r.from) }),
        " ",
        "→",
        " ",
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "onyx-text-pink", children: JSON.stringify(r.to) })
      ] }, n);
  }) });
}
function ure(e) {
  var a;
  const {
    isFetching: t,
    error: r,
    data: n = { data: {} }
  } = Nl({
    queryKey: ["record-history", e.project, e.recordID],
    queryFn: async () => e.httpPathHandler(`projects/${e.project}/history/${e.recordID}/`).then((u) => u.json()),
    enabled: !!(e.project && e.recordID),
    staleTime: 6e4
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    ER,
    {
      isFetching: t,
      error: r,
      data: n,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h5", { children: "History" }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          x1,
          {
            ...e,
            data: { data: (a = n.data) == null ? void 0 : a.history },
            defaultFileNamePrefix: `${e.recordID}_history`,
            flexOnly: ["changes"],
            tooltipFields: ["timestamp"],
            headerNames: /* @__PURE__ */ new Map([
              ["username", "User"],
              ["timestamp", "Date"],
              ["action", "Action"],
              ["changes", "Changes"]
            ]),
            footer: "Table showing the complete change history for the record.",
            cellRenderers: /* @__PURE__ */ new Map([
              ["timestamp", ore],
              ["action", sre],
              ["changes", lre]
            ])
          }
        )
      ] })
    }
  );
}
function cre(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    ns,
    {
      className: "onyx-modal",
      dialogClassName: "onyx-modal-dialog",
      contentClassName: "onyx-modal-content",
      show: e.show,
      onHide: e.onHide,
      "aria-labelledby": "record-modal-title",
      scrollable: !0,
      centered: !0,
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Header, { closeButton: !0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ns.Title, { id: "record-modal-title", children: [
          "CLIMB ID: ",
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "onyx-text-pink", children: e.recordID })
        ] }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Body, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          $4,
          {
            defaultActiveKey: "record-data",
            id: "record-modal-tabs",
            className: "mb-3",
            children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                hu,
                {
                  eventKey: "record-data",
                  title: "Data",
                  className: "onyx-modal-tab-pane",
                  mountOnEnter: !0,
                  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(are, { ...e })
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                hu,
                {
                  eventKey: "record-history",
                  title: "History",
                  className: "onyx-modal-tab-pane",
                  mountOnEnter: !0,
                  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ure, { ...e })
                }
              )
            ]
          }
        ) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ns.Footer, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ki, { variant: "dark", onClick: e.onHide, children: "Close" }) })
      ]
    }
  );
}
const dre = (e, t) => {
  const [r, n] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const a = setTimeout(() => {
      n(e);
    }, t);
    return () => {
      clearTimeout(a);
    };
  }, [e, t]), r;
};
function fre(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("Summarise"), [c, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Array()), [l, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [f, p] = react__WEBPACK_IMPORTED_MODULE_1___default().useState(!1), [g, y] = react__WEBPACK_IMPORTED_MODULE_1___default().useState(""), [C, m] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), h = Array.from(e.projectFields.entries()).filter(([, L]) => L.actions.includes("filter")).map(([L]) => L), w = Array.from(e.projectFields.entries()).filter(([, L]) => L.actions.includes("list")).map(([L]) => L);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    r(""), a([]), s("Summarise"), i([]), v(""), p(!1), y("");
  }, [e.project]);
  const {
    isFetching: S,
    error: E,
    data: x = {},
    refetch: T
  } = Nl({
    queryKey: ["results", e.project, l],
    queryFn: async () => e.httpPathHandler(`projects/${e.project}/?${l}`).then((L) => L.json()),
    enabled: !!e.project,
    cacheTime: 0.5 * 60 * 1e3
  }), F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => new URLSearchParams(
      n.filter((L) => L.field).map((L) => L.lookup ? [L.field + "__" + L.lookup, L.value] : [L.field, L.value]).concat(
        c.filter((L) => L).map((L) => [u.toLowerCase(), L])
      ).concat(
        [t].filter((L) => L).map((L) => ["search", L])
      )
    ).toString(),
    [n, u, c, t]
  ), P = dre(F, 1e3);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(
    () => v(P),
    [P]
  );
  const k = () => {
    S || T();
  }, I = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((L) => {
    y(L), p(!0);
  }, []);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(is, { fluid: !0, className: "g-2 h-100", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      cre,
      {
        ...e,
        recordID: g,
        show: f,
        onHide: () => p(!1)
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "parent h-100", children: [
      !C && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "left-col h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "g-2 h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { gap: 2, className: "h-100 pt-1", children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          bB,
          {
            ...e,
            searchInput: t,
            setSearchInput: r,
            handleSearch: k
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { gap: 2, className: "h-100 overflow-y-hidden", children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            O_,
            {
              ...e,
              filterList: n,
              setFilterList: a,
              filterFieldOptions: h
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            G_,
            {
              ...e,
              transform: u,
              setTransform: s,
              transformList: c,
              setTransformList: i,
              filterFieldOptions: h,
              listFieldOptions: w
            }
          )
        ] })
      ] }) }) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Ki,
        {
          size: "sm",
          variant: "dark",
          title: C ? "Expand Sidebar" : "Collapse Sidebar",
          onClick: () => m(!C),
          children: C ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(hB, {}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(fB, {})
        }
      ),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "right-col h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "g-2 h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        rre,
        {
          ...e,
          resultPending: S,
          resultError: E instanceof Error ? E : null,
          resultData: x,
          searchParameters: l,
          handleRecordModalShow: I
        }
      ) }) })
    ] })
  ] });
}
var Z4 = { exports: {} };
(function(e, t) {
  (function(n, a) {
    e.exports = a();
  })(self, function() {
    return (
      /******/
      function() {
        var r = {
          /***/
          9288: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = {
                "X,X div": 'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',
                "X input,X button": 'font-family:"Open Sans",verdana,arial,sans-serif;',
                "X input:focus,X button:focus": "outline:none;",
                "X a": "text-decoration:none;",
                "X a:hover": "text-decoration:none;",
                "X .crisp": "shape-rendering:crispEdges;",
                "X .user-select-none": "-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;",
                "X svg": "overflow:hidden;",
                "X svg a": "fill:#447adb;",
                "X svg a:hover": "fill:#3c6dc5;",
                "X .main-svg": "position:absolute;top:0;left:0;pointer-events:none;",
                "X .main-svg .draglayer": "pointer-events:all;",
                "X .cursor-default": "cursor:default;",
                "X .cursor-pointer": "cursor:pointer;",
                "X .cursor-crosshair": "cursor:crosshair;",
                "X .cursor-move": "cursor:move;",
                "X .cursor-col-resize": "cursor:col-resize;",
                "X .cursor-row-resize": "cursor:row-resize;",
                "X .cursor-ns-resize": "cursor:ns-resize;",
                "X .cursor-ew-resize": "cursor:ew-resize;",
                "X .cursor-sw-resize": "cursor:sw-resize;",
                "X .cursor-s-resize": "cursor:s-resize;",
                "X .cursor-se-resize": "cursor:se-resize;",
                "X .cursor-w-resize": "cursor:w-resize;",
                "X .cursor-e-resize": "cursor:e-resize;",
                "X .cursor-nw-resize": "cursor:nw-resize;",
                "X .cursor-n-resize": "cursor:n-resize;",
                "X .cursor-ne-resize": "cursor:ne-resize;",
                "X .cursor-grab": "cursor:-webkit-grab;cursor:grab;",
                "X .modebar": "position:absolute;top:2px;right:2px;",
                "X .ease-bg": "-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;",
                "X .modebar--hover>:not(.watermark)": "opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;",
                "X:hover .modebar--hover .modebar-group": "opacity:1;",
                "X .modebar-group": "float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;",
                "X .modebar-btn": "position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;",
                "X .modebar-btn svg": "position:relative;top:2px;",
                "X .modebar.vertical": "display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;",
                "X .modebar.vertical svg": "top:-1px;",
                "X .modebar.vertical .modebar-group": "display:block;float:none;padding-left:0px;padding-bottom:8px;",
                "X .modebar.vertical .modebar-group .modebar-btn": "display:block;text-align:center;",
                "X [data-title]:before,X [data-title]:after": "position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;",
                "X [data-title]:hover:before,X [data-title]:hover:after": "display:block;opacity:1;",
                "X [data-title]:before": 'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',
                "X [data-title]:after": "content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;",
                "X .vertical [data-title]:before,X .vertical [data-title]:after": "top:0%;right:200%;",
                "X .vertical [data-title]:before": "border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",
                Y: 'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',
                "Y p": "margin:0;",
                "Y .notifier-note": "min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;",
                "Y .notifier-close": "color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;",
                "Y .notifier-close:hover": "color:#444;text-decoration:none;cursor:pointer;"
              };
              for (var f in v) {
                var p = f.replace(/^,/, " ,").replace(/X/g, ".js-plotly-plot .plotly").replace(/Y/g, ".plotly-notifier");
                l.addStyleRule(p, v[f]);
              }
            }
          ),
          /***/
          6712: (
            /***/
            function(s, c, i) {
              s.exports = i(1843);
            }
          ),
          /***/
          7240: (
            /***/
            function(s, c, i) {
              s.exports = i(1132);
            }
          ),
          /***/
          6144: (
            /***/
            function(s, c, i) {
              s.exports = i(7776);
            }
          ),
          /***/
          2016: (
            /***/
            function(s, c, i) {
              s.exports = i(4884);
            }
          ),
          /***/
          5556: (
            /***/
            function(s, c, i) {
              s.exports = i(6744);
            }
          ),
          /***/
          6489: (
            /***/
            function(s, c, i) {
              s.exports = i(2028);
            }
          ),
          /***/
          3472: (
            /***/
            function(s, c, i) {
              var l = i(2016);
              l.register([
                // traces
                i(7240),
                i(260),
                // transforms
                i(6712),
                i(5556),
                i(6489),
                i(7312),
                // components
                i(6144)
              ]), s.exports = l;
            }
          ),
          /***/
          260: (
            /***/
            function(s, c, i) {
              s.exports = i(5792);
            }
          ),
          /***/
          7312: (
            /***/
            function(s, c, i) {
              s.exports = i(6272);
            }
          ),
          /***/
          2196: (
            /***/
            function(s) {
              s.exports = [
                // no arrow
                {
                  path: "",
                  backoff: 0
                },
                // wide with flat back
                {
                  path: "M-2.4,-3V3L0.6,0Z",
                  backoff: 0.6
                },
                // narrower with flat back
                {
                  path: "M-3.7,-2.5V2.5L1.3,0Z",
                  backoff: 1.3
                },
                // barbed
                {
                  path: "M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",
                  backoff: 1.55
                },
                // wide line-drawn
                {
                  path: "M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",
                  backoff: 1.6
                },
                // narrower line-drawn
                {
                  path: "M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",
                  backoff: 2
                },
                // circle
                {
                  path: "M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",
                  backoff: 0,
                  noRotate: !0
                },
                // square
                {
                  path: "M2,2V-2H-2V2Z",
                  backoff: 0,
                  noRotate: !0
                }
              ];
            }
          ),
          /***/
          3916: (
            /***/
            function(s, c, i) {
              var l = i(2196), v = i(5376), f = i(3816), p = i(1780).templatedArray;
              i(6208), s.exports = p("annotation", {
                visible: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc+arraydraw"
                },
                text: {
                  valType: "string",
                  editType: "calc+arraydraw"
                },
                textangle: {
                  valType: "angle",
                  dflt: 0,
                  editType: "calc+arraydraw"
                },
                font: v({
                  editType: "calc+arraydraw",
                  colorEditType: "arraydraw"
                }),
                width: {
                  valType: "number",
                  min: 1,
                  dflt: null,
                  editType: "calc+arraydraw"
                },
                height: {
                  valType: "number",
                  min: 1,
                  dflt: null,
                  editType: "calc+arraydraw"
                },
                opacity: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 1,
                  editType: "arraydraw"
                },
                align: {
                  valType: "enumerated",
                  values: ["left", "center", "right"],
                  dflt: "center",
                  editType: "arraydraw"
                },
                valign: {
                  valType: "enumerated",
                  values: ["top", "middle", "bottom"],
                  dflt: "middle",
                  editType: "arraydraw"
                },
                bgcolor: {
                  valType: "color",
                  dflt: "rgba(0,0,0,0)",
                  editType: "arraydraw"
                },
                bordercolor: {
                  valType: "color",
                  dflt: "rgba(0,0,0,0)",
                  editType: "arraydraw"
                },
                borderpad: {
                  valType: "number",
                  min: 0,
                  dflt: 1,
                  editType: "calc+arraydraw"
                },
                borderwidth: {
                  valType: "number",
                  min: 0,
                  dflt: 1,
                  editType: "calc+arraydraw"
                },
                // arrow
                showarrow: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc+arraydraw"
                },
                arrowcolor: {
                  valType: "color",
                  editType: "arraydraw"
                },
                arrowhead: {
                  valType: "integer",
                  min: 0,
                  max: l.length,
                  dflt: 1,
                  editType: "arraydraw"
                },
                startarrowhead: {
                  valType: "integer",
                  min: 0,
                  max: l.length,
                  dflt: 1,
                  editType: "arraydraw"
                },
                arrowside: {
                  valType: "flaglist",
                  flags: ["end", "start"],
                  extras: ["none"],
                  dflt: "end",
                  editType: "arraydraw"
                },
                arrowsize: {
                  valType: "number",
                  min: 0.3,
                  dflt: 1,
                  editType: "calc+arraydraw"
                },
                startarrowsize: {
                  valType: "number",
                  min: 0.3,
                  dflt: 1,
                  editType: "calc+arraydraw"
                },
                arrowwidth: {
                  valType: "number",
                  min: 0.1,
                  editType: "calc+arraydraw"
                },
                standoff: {
                  valType: "number",
                  min: 0,
                  dflt: 0,
                  editType: "calc+arraydraw"
                },
                startstandoff: {
                  valType: "number",
                  min: 0,
                  dflt: 0,
                  editType: "calc+arraydraw"
                },
                ax: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                ay: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                axref: {
                  valType: "enumerated",
                  dflt: "pixel",
                  values: ["pixel", f.idRegex.x.toString()],
                  editType: "calc"
                },
                ayref: {
                  valType: "enumerated",
                  dflt: "pixel",
                  values: ["pixel", f.idRegex.y.toString()],
                  editType: "calc"
                },
                // positioning
                xref: {
                  valType: "enumerated",
                  values: ["paper", f.idRegex.x.toString()],
                  editType: "calc"
                },
                x: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                xanchor: {
                  valType: "enumerated",
                  values: ["auto", "left", "center", "right"],
                  dflt: "auto",
                  editType: "calc+arraydraw"
                },
                xshift: {
                  valType: "number",
                  dflt: 0,
                  editType: "calc+arraydraw"
                },
                yref: {
                  valType: "enumerated",
                  values: ["paper", f.idRegex.y.toString()],
                  editType: "calc"
                },
                y: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                yanchor: {
                  valType: "enumerated",
                  values: ["auto", "top", "middle", "bottom"],
                  dflt: "auto",
                  editType: "calc+arraydraw"
                },
                yshift: {
                  valType: "number",
                  dflt: 0,
                  editType: "calc+arraydraw"
                },
                clicktoshow: {
                  valType: "enumerated",
                  values: [!1, "onoff", "onout"],
                  dflt: !1,
                  editType: "arraydraw"
                },
                xclick: {
                  valType: "any",
                  editType: "arraydraw"
                },
                yclick: {
                  valType: "any",
                  editType: "arraydraw"
                },
                hovertext: {
                  valType: "string",
                  editType: "arraydraw"
                },
                hoverlabel: {
                  bgcolor: {
                    valType: "color",
                    editType: "arraydraw"
                  },
                  bordercolor: {
                    valType: "color",
                    editType: "arraydraw"
                  },
                  font: v({
                    editType: "arraydraw"
                  }),
                  editType: "arraydraw"
                },
                captureevents: {
                  valType: "boolean",
                  editType: "arraydraw"
                },
                editType: "calc",
                _deprecated: {
                  ref: {
                    valType: "string",
                    editType: "calc"
                  }
                }
              });
            }
          ),
          /***/
          272: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(6196).draw;
              s.exports = function(C) {
                var m = C._fullLayout, h = l.filterVisible(m.annotations);
                if (h.length && C._fullData.length)
                  return l.syncOrAsync([f, p], C);
              };
              function p(y) {
                var C = y._fullLayout;
                l.filterVisible(C.annotations).forEach(function(m) {
                  var h = v.getFromId(y, m.xref), w = v.getFromId(y, m.yref), S = v.getRefType(m.xref), E = v.getRefType(m.yref);
                  m._extremes = {}, S === "range" && g(m, h), E === "range" && g(m, w);
                });
              }
              function g(y, C) {
                var m = C._id, h = m.charAt(0), w = y[h], S = y["a" + h], E = y[h + "ref"], x = y["a" + h + "ref"], T = y["_" + h + "padplus"], F = y["_" + h + "padminus"], P = {
                  x: 1,
                  y: -1
                }[h] * y[h + "shift"], k = 3 * y.arrowsize * y.arrowwidth || 0, I = k + P, L = k - P, A = 3 * y.startarrowsize * y.arrowwidth || 0, O = A + P, N = A - P, Y;
                if (x === E) {
                  var j = v.findExtremes(C, [C.r2c(w)], {
                    ppadplus: I,
                    ppadminus: L
                  }), te = v.findExtremes(C, [C.r2c(S)], {
                    ppadplus: Math.max(T, O),
                    ppadminus: Math.max(F, N)
                  });
                  Y = {
                    min: [j.min[0], te.min[0]],
                    max: [j.max[0], te.max[0]]
                  };
                } else
                  O = S ? O + S : O, N = S ? N - S : N, Y = v.findExtremes(C, [C.r2c(w)], {
                    ppadplus: Math.max(T, I, O),
                    ppadminus: Math.max(F, L, N)
                  });
                y._extremes[m] = Y;
              }
            }
          ),
          /***/
          2300: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4040), f = i(1780).arrayEditor;
              s.exports = {
                hasClickToShow: p,
                onClick: g
              };
              function p(m, h) {
                var w = y(m, h);
                return w.on.length > 0 || w.explicitOff.length > 0;
              }
              function g(m, h) {
                var w = y(m, h), S = w.on, E = w.off.concat(w.explicitOff), x = {}, T = m._fullLayout.annotations, F, P;
                if (S.length || E.length) {
                  for (F = 0; F < S.length; F++)
                    P = f(m.layout, "annotations", T[S[F]]), P.modifyItem("visible", !0), l.extendFlat(x, P.getUpdateObj());
                  for (F = 0; F < E.length; F++)
                    P = f(m.layout, "annotations", T[E[F]]), P.modifyItem("visible", !1), l.extendFlat(x, P.getUpdateObj());
                  return v.call("update", m, {}, x);
                }
              }
              function y(m, h) {
                var w = m._fullLayout.annotations, S = [], E = [], x = [], T = (h || []).length, F, P, k, I, L, A, O, N;
                for (F = 0; F < w.length; F++)
                  if (k = w[F], I = k.clicktoshow, I) {
                    for (P = 0; P < T; P++)
                      if (L = h[P], A = L.xaxis, O = L.yaxis, A._id === k.xref && O._id === k.yref && A.d2r(L.x) === C(k._xclick, A) && O.d2r(L.y) === C(k._yclick, O)) {
                        k.visible ? I === "onout" ? N = E : N = x : N = S, N.push(F);
                        break;
                      }
                    P === T && k.visible && I === "onout" && E.push(F);
                  }
                return {
                  on: S,
                  off: E,
                  explicitOff: x
                };
              }
              function C(m, h) {
                return h.type === "log" ? h.l2r(m) : h.d2r(m);
              }
            }
          ),
          /***/
          7192: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(6308);
              s.exports = function(p, g, y, C) {
                C("opacity");
                var m = C("bgcolor"), h = C("bordercolor"), w = v.opacity(h);
                C("borderpad");
                var S = C("borderwidth"), E = C("showarrow");
                C("text", E ? " " : y._dfltTitle.annotation), C("textangle"), l.coerceFont(C, "font", y.font), C("width"), C("align");
                var x = C("height");
                if (x && C("valign"), E) {
                  var T = C("arrowside"), F, P;
                  T.indexOf("end") !== -1 && (F = C("arrowhead"), P = C("arrowsize")), T.indexOf("start") !== -1 && (C("startarrowhead", F), C("startarrowsize", P)), C("arrowcolor", w ? g.bordercolor : v.defaultLine), C("arrowwidth", (w && S || 1) * 2), C("standoff"), C("startstandoff");
                }
                var k = C("hovertext"), I = y.hoverlabel || {};
                if (k) {
                  var L = C("hoverlabel.bgcolor", I.bgcolor || (v.opacity(m) ? v.rgb(m) : v.defaultLine)), A = C("hoverlabel.bordercolor", I.bordercolor || v.contrast(L)), O = l.extendFlat({}, I.font);
                  O.color || (O.color = A), l.coerceFont(C, "hoverlabel.font", O);
                }
                C("captureevents", !!k);
              };
            }
          ),
          /***/
          9208: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(6896);
              s.exports = function(p, g, y, C) {
                g = g || {};
                var m = y === "log" && g.type === "linear", h = y === "linear" && g.type === "log";
                if (!(m || h)) return;
                var w = p._fullLayout.annotations, S = g._id.charAt(0), E, x;
                function T(P) {
                  var k = E[P], I = null;
                  m ? I = v(k, g.range) : I = Math.pow(10, k), l(I) || (I = null), C(x + P, I);
                }
                for (var F = 0; F < w.length; F++)
                  E = w[F], x = "annotations[" + F + "].", E[S + "ref"] === g._id && T(S), E["a" + S + "ref"] === g._id && T("a" + S);
              };
            }
          ),
          /***/
          5216: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(1272), p = i(7192), g = i(3916);
              s.exports = function(m, h) {
                f(m, h, {
                  name: "annotations",
                  handleItemDefaults: y
                });
              };
              function y(C, m, h) {
                function w(re, z) {
                  return l.coerce(C, m, g, re, z);
                }
                var S = w("visible"), E = w("clicktoshow");
                if (S || E) {
                  p(C, m, h, w);
                  for (var x = m.showarrow, T = ["x", "y"], F = [-10, -30], P = {
                    _fullLayout: h
                  }, k = 0; k < 2; k++) {
                    var I = T[k], L = v.coerceRef(C, m, P, I, "", "paper");
                    if (L !== "paper") {
                      var A = v.getFromId(P, L);
                      A._annIndices.push(m._index);
                    }
                    if (v.coercePosition(m, P, w, L, I, 0.5), x) {
                      var O = "a" + I, N = v.coerceRef(C, m, P, O, "pixel", ["pixel", "paper"]);
                      N !== "pixel" && N !== L && (N = m[O] = "pixel");
                      var Y = N === "pixel" ? F[k] : 0.4;
                      v.coercePosition(m, P, w, N, O, Y);
                    }
                    w(I + "anchor"), w(I + "shift");
                  }
                  if (l.noneOrAll(C, m, ["x", "y"]), x && l.noneOrAll(C, m, ["ax", "ay"]), E) {
                    var j = w("xclick"), te = w("yclick");
                    m._xclick = j === void 0 ? m.x : v.cleanPosition(j, P, m.xref), m._yclick = te === void 0 ? m.y : v.cleanPosition(te, P, m.yref);
                  }
                }
              }
            }
          ),
          /***/
          6196: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(7316), p = i(3400), g = p.strTranslate, y = i(4460), C = i(6308), m = i(3616), h = i(3024), w = i(2736), S = i(3972), E = i(6476), x = i(1780).arrayEditor, T = i(3652);
              s.exports = {
                draw: F,
                drawOne: P,
                drawRaw: I
              };
              function F(L) {
                var A = L._fullLayout;
                A._infolayer.selectAll(".annotation").remove();
                for (var O = 0; O < A.annotations.length; O++)
                  A.annotations[O].visible && P(L, O);
                return f.previousPromises(L);
              }
              function P(L, A) {
                var O = L._fullLayout, N = O.annotations[A] || {}, Y = y.getFromId(L, N.xref), j = y.getFromId(L, N.yref);
                Y && Y.setScale(), j && j.setScale(), I(L, N, A, !1, Y, j);
              }
              function k(L, A, O, N, Y) {
                var j = Y[O], te = Y[O + "ref"], re = O.indexOf("y") !== -1, z = y.getRefType(te) === "domain", Z = re ? N.h : N.w;
                return L ? z ? j + (re ? -A : A) / L._length : L.p2r(L.r2p(j) + A) : j + (re ? -A : A) / Z;
              }
              function I(L, A, O, N, Y, j) {
                var te = L._fullLayout, re = L._fullLayout._size, z = L._context.edits, Z, W;
                N ? (Z = "annotation-" + N, W = N + ".annotations") : (Z = "annotation", W = "annotations");
                var q = x(L.layout, W, A), ie = q.modifyBase, ce = q.modifyItem, X = q.getUpdateObj;
                te._infolayer.selectAll("." + Z + '[data-index="' + O + '"]').remove();
                var U = "clip" + te._uid + "_ann" + O;
                if (!A._input || A.visible === !1) {
                  l.selectAll("#" + U).remove();
                  return;
                }
                var ne = {
                  x: {},
                  y: {}
                }, se = +A.textangle || 0, le = te._infolayer.append("g").classed(Z, !0).attr("data-index", String(O)).style("opacity", A.opacity), ue = le.append("g").classed("annotation-text-g", !0), ve = z[A.showarrow ? "annotationTail" : "annotationPosition"], be = A.captureevents || z.annotationText || ve;
                function Me(me) {
                  var xe = {
                    index: O,
                    annotation: A._input,
                    fullAnnotation: A,
                    event: me
                  };
                  return N && (xe.subplotId = N), xe;
                }
                var Ge = ue.append("g").style("pointer-events", be ? "all" : null).call(S, "pointer").on("click", function() {
                  L._dragging = !1, L.emit("plotly_clickannotation", Me(l.event));
                });
                A.hovertext && Ge.on("mouseover", function() {
                  var me = A.hoverlabel, xe = me.font, Fe = this.getBoundingClientRect(), Ve = L.getBoundingClientRect();
                  h.loneHover({
                    x0: Fe.left - Ve.left,
                    x1: Fe.right - Ve.left,
                    y: (Fe.top + Fe.bottom) / 2 - Ve.top,
                    text: A.hovertext,
                    color: me.bgcolor,
                    borderColor: me.bordercolor,
                    fontFamily: xe.family,
                    fontSize: xe.size,
                    fontColor: xe.color,
                    fontWeight: xe.weight,
                    fontStyle: xe.style,
                    fontVariant: xe.variant,
                    fontShadow: xe.fontShadow,
                    fontLineposition: xe.fontLineposition,
                    fontTextcase: xe.fontTextcase
                  }, {
                    container: te._hoverlayer.node(),
                    outerContainer: te._paper.node(),
                    gd: L
                  });
                }).on("mouseout", function() {
                  h.loneUnhover(te._hoverlayer.node());
                });
                var we = A.borderwidth, Re = A.borderpad, Ae = we + Re, K = Ge.append("rect").attr("class", "bg").style("stroke-width", we + "px").call(C.stroke, A.bordercolor).call(C.fill, A.bgcolor), ee = A.width || A.height, oe = te._topclips.selectAll("#" + U).data(ee ? [0] : []);
                oe.enter().append("clipPath").classed("annclip", !0).attr("id", U).append("rect"), oe.exit().remove();
                var _ = A.font, V = te._meta ? p.templateString(A.text, te._meta) : A.text, fe = Ge.append("text").classed("annotation-text", !0).text(V);
                function $(me) {
                  return me.call(m.font, _).attr({
                    "text-anchor": {
                      left: "start",
                      right: "end"
                    }[A.align] || "middle"
                  }), w.convertToTspans(me, L, he), me;
                }
                function he() {
                  var me = fe.selectAll("a");
                  if (me.size() === 1 && me.text() === fe.text()) {
                    var xe = Ge.insert("a", ":first-child").attr({
                      "xlink:xlink:href": me.attr("xlink:href"),
                      "xlink:xlink:show": me.attr("xlink:show")
                    }).style({
                      cursor: "pointer"
                    });
                    xe.node().appendChild(K.node());
                  }
                  var Fe = Ge.select(".annotation-text-math-group"), Ve = !Fe.empty(), Be = m.bBox((Ve ? Fe : fe).node()), Je = Be.width, et = Be.height, at = A.width || Je, De = A.height || et, Ne = Math.round(at + 2 * Ae), Ie = Math.round(De + 2 * Ae);
                  function Ue(Pr, ir) {
                    return ir === "auto" && (Pr < 0.3333333333333333 ? ir = "left" : Pr > 0.6666666666666666 ? ir = "right" : ir = "center"), {
                      center: 0,
                      middle: 0,
                      left: 0.5,
                      bottom: -0.5,
                      right: -0.5,
                      top: 0.5
                    }[ir];
                  }
                  for (var ot = !1, ct = ["x", "y"], Tt = 0; Tt < ct.length; Tt++) {
                    var kt = ct[Tt], Ot = A[kt + "ref"] || kt, Rt = A["a" + kt + "ref"], xt = {
                      x: Y,
                      y: j
                    }[kt], Wt = (se + (kt === "x" ? 0 : -90)) * Math.PI / 180, bt = Ne * Math.cos(Wt), jt = Ie * Math.sin(Wt), qt = Math.abs(bt) + Math.abs(jt), Yt = A[kt + "anchor"], Ut = A[kt + "shift"] * (kt === "x" ? 1 : -1), tt = ne[kt], ze, _e, Ye, lt, Te, Oe = y.getRefType(Ot);
                    if (xt && Oe !== "domain") {
                      var je = xt.r2fraction(A[kt]);
                      (je < 0 || je > 1) && (Rt === Ot ? (je = xt.r2fraction(A["a" + kt]), (je < 0 || je > 1) && (ot = !0)) : ot = !0), ze = xt._offset + xt.r2p(A[kt]), lt = 0.5;
                    } else {
                      var Xe = Oe === "domain";
                      kt === "x" ? (Ye = A[kt], ze = Xe ? xt._offset + xt._length * Ye : ze = re.l + re.w * Ye) : (Ye = 1 - A[kt], ze = Xe ? xt._offset + xt._length * Ye : ze = re.t + re.h * Ye), lt = A.showarrow ? 0.5 : Ye;
                    }
                    if (A.showarrow) {
                      tt.head = ze;
                      var nt = A["a" + kt];
                      if (Te = bt * Ue(0.5, A.xanchor) - jt * Ue(0.5, A.yanchor), Rt === Ot) {
                        var it = y.getRefType(Rt);
                        it === "domain" ? (kt === "y" && (nt = 1 - nt), tt.tail = xt._offset + xt._length * nt) : it === "paper" ? kt === "y" ? (nt = 1 - nt, tt.tail = re.t + re.h * nt) : tt.tail = re.l + re.w * nt : tt.tail = xt._offset + xt.r2p(nt), _e = Te;
                      } else
                        tt.tail = ze + nt, _e = Te + nt;
                      tt.text = tt.tail + Te;
                      var Nt = te[kt === "x" ? "width" : "height"];
                      if (Ot === "paper" && (tt.head = p.constrain(tt.head, 1, Nt - 1)), Rt === "pixel") {
                        var At = -Math.max(tt.tail - 3, tt.text), vt = Math.min(tt.tail + 3, tt.text) - Nt;
                        At > 0 ? (tt.tail += At, tt.text += At) : vt > 0 && (tt.tail -= vt, tt.text -= vt);
                      }
                      tt.tail += Ut, tt.head += Ut;
                    } else
                      Te = qt * Ue(lt, Yt), _e = Te, tt.text = ze + Te;
                    tt.text += Ut, Te += Ut, _e += Ut, A["_" + kt + "padplus"] = qt / 2 + _e, A["_" + kt + "padminus"] = qt / 2 - _e, A["_" + kt + "size"] = qt, A["_" + kt + "shift"] = Te;
                  }
                  if (ot) {
                    Ge.remove();
                    return;
                  }
                  var ut = 0, Pt = 0;
                  if (A.align !== "left" && (ut = (at - Je) * (A.align === "center" ? 0.5 : 1)), A.valign !== "top" && (Pt = (De - et) * (A.valign === "middle" ? 0.5 : 1)), Ve)
                    Fe.select("svg").attr({
                      x: Ae + ut - 1,
                      y: Ae + Pt
                    }).call(m.setClipUrl, ee ? U : null, L);
                  else {
                    var rr = Ae + Pt - Be.top, lr = Ae + ut - Be.left;
                    fe.call(w.positionText, lr, rr).call(m.setClipUrl, ee ? U : null, L);
                  }
                  oe.select("rect").call(m.setRect, Ae, Ae, at, De), K.call(m.setRect, we / 2, we / 2, Ne - we, Ie - we), Ge.call(m.setTranslate, Math.round(ne.x.text - Ne / 2), Math.round(ne.y.text - Ie / 2)), ue.attr({
                    transform: "rotate(" + se + "," + ne.x.text + "," + ne.y.text + ")"
                  });
                  var Mr = function(Pr, ir) {
                    le.selectAll(".annotation-arrow-g").remove();
                    var Lr = ne.x.head, yr = ne.y.head, Sr = ne.x.tail + Pr, Yr = ne.y.tail + ir, Ar = ne.x.text + Pr, pr = ne.y.text + ir, kr = p.rotationXYMatrix(se, Ar, pr), br = p.apply2DTransform(kr), Gr = p.apply2DTransform2(kr), rn = +K.attr("width"), cn = +K.attr("height"), Dr = Ar - 0.5 * rn, Se = Dr + rn, ae = pr - 0.5 * cn, ft = ae + cn, rt = [[Dr, ae, Dr, ft], [Dr, ft, Se, ft], [Se, ft, Se, ae], [Se, ae, Dr, ae]].map(Gr);
                    if (!rt.reduce(function(zt, tr) {
                      return zt ^ !!p.segmentsIntersect(Lr, yr, Lr + 1e6, yr + 1e6, tr[0], tr[1], tr[2], tr[3]);
                    }, !1)) {
                      rt.forEach(function(zt) {
                        var tr = p.segmentsIntersect(Sr, Yr, Lr, yr, zt[0], zt[1], zt[2], zt[3]);
                        tr && (Sr = tr.x, Yr = tr.y);
                      });
                      var gt = A.arrowwidth, wt = A.arrowcolor, Ct = A.arrowside, pt = le.append("g").style({
                        opacity: C.opacity(wt)
                      }).classed("annotation-arrow-g", !0), dt = pt.append("path").attr("d", "M" + Sr + "," + Yr + "L" + Lr + "," + yr).style("stroke-width", gt + "px").call(C.stroke, C.rgb(wt));
                      if (T(dt, Ct, A), z.annotationPosition && dt.node().parentNode && !N) {
                        var St = Lr, Ft = yr;
                        if (A.standoff) {
                          var Gt = Math.sqrt(Math.pow(Lr - Sr, 2) + Math.pow(yr - Yr, 2));
                          St += A.standoff * (Sr - Lr) / Gt, Ft += A.standoff * (Yr - yr) / Gt;
                        }
                        var Lt = pt.append("path").classed("annotation-arrow", !0).classed("anndrag", !0).classed("cursor-move", !0).attr({
                          d: "M3,3H-3V-3H3ZM0,0L" + (Sr - St) + "," + (Yr - Ft),
                          transform: g(St, Ft)
                        }).style("stroke-width", gt + 6 + "px").call(C.stroke, "rgba(0,0,0,0)").call(C.fill, "rgba(0,0,0,0)"), $t, _t;
                        E.init({
                          element: Lt.node(),
                          gd: L,
                          prepFn: function() {
                            var zt = m.getTranslate(Ge);
                            $t = zt.x, _t = zt.y, Y && Y.autorange && ie(Y._name + ".autorange", !0), j && j.autorange && ie(j._name + ".autorange", !0);
                          },
                          moveFn: function(zt, tr) {
                            var nr = br($t, _t), xr = nr[0] + zt, Er = nr[1] + tr;
                            Ge.call(m.setTranslate, xr, Er), ce("x", k(Y, zt, "x", re, A)), ce("y", k(j, tr, "y", re, A)), A.axref === A.xref && ce("ax", k(Y, zt, "ax", re, A)), A.ayref === A.yref && ce("ay", k(j, tr, "ay", re, A)), pt.attr("transform", g(zt, tr)), ue.attr({
                              transform: "rotate(" + se + "," + xr + "," + Er + ")"
                            });
                          },
                          doneFn: function() {
                            v.call("_guiRelayout", L, X());
                            var zt = document.querySelector(".js-notes-box-panel");
                            zt && zt.redraw(zt.selectedObj);
                          }
                        });
                      }
                    }
                  };
                  if (A.showarrow && Mr(0, 0), ve) {
                    var Rr;
                    E.init({
                      element: Ge.node(),
                      gd: L,
                      prepFn: function() {
                        Rr = ue.attr("transform");
                      },
                      moveFn: function(Pr, ir) {
                        var Lr = "pointer";
                        if (A.showarrow)
                          A.axref === A.xref ? ce("ax", k(Y, Pr, "ax", re, A)) : ce("ax", A.ax + Pr), A.ayref === A.yref ? ce("ay", k(j, ir, "ay", re.w, A)) : ce("ay", A.ay + ir), Mr(Pr, ir);
                        else {
                          if (N)
                            return;
                          var yr, Sr;
                          if (Y)
                            yr = k(Y, Pr, "x", re, A);
                          else {
                            var Yr = A._xsize / re.w, Ar = A.x + (A._xshift - A.xshift) / re.w - Yr / 2;
                            yr = E.align(Ar + Pr / re.w, Yr, 0, 1, A.xanchor);
                          }
                          if (j)
                            Sr = k(j, ir, "y", re, A);
                          else {
                            var pr = A._ysize / re.h, kr = A.y - (A._yshift + A.yshift) / re.h - pr / 2;
                            Sr = E.align(kr - ir / re.h, pr, 0, 1, A.yanchor);
                          }
                          ce("x", yr), ce("y", Sr), (!Y || !j) && (Lr = E.getCursor(Y ? 0.5 : yr, j ? 0.5 : Sr, A.xanchor, A.yanchor));
                        }
                        ue.attr({
                          transform: g(Pr, ir) + Rr
                        }), S(Ge, Lr);
                      },
                      clickFn: function(Pr, ir) {
                        A.captureevents && L.emit("plotly_clickannotation", Me(ir));
                      },
                      doneFn: function() {
                        S(Ge), v.call("_guiRelayout", L, X());
                        var Pr = document.querySelector(".js-notes-box-panel");
                        Pr && Pr.redraw(Pr.selectedObj);
                      }
                    });
                  }
                }
                z.annotationText ? fe.call(w.makeEditable, {
                  delegate: Ge,
                  gd: L
                }).call($).on("edit", function(me) {
                  A.text = me, this.call($), ce("text", me), Y && Y.autorange && ie(Y._name + ".autorange", !0), j && j.autorange && ie(j._name + ".autorange", !0), v.call("_guiRelayout", L, X());
                }) : fe.call($);
              }
            }
          ),
          /***/
          3652: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(6308), f = i(2196), p = i(3400), g = p.strScale, y = p.strRotate, C = p.strTranslate;
              s.exports = function(h, w, S) {
                var E = h.node(), x = f[S.arrowhead || 0], T = f[S.startarrowhead || 0], F = (S.arrowwidth || 1) * (S.arrowsize || 1), P = (S.arrowwidth || 1) * (S.startarrowsize || 1), k = w.indexOf("start") >= 0, I = w.indexOf("end") >= 0, L = x.backoff * F + S.standoff, A = T.backoff * P + S.startstandoff, O, N, Y, j;
                if (E.nodeName === "line") {
                  O = {
                    x: +h.attr("x1"),
                    y: +h.attr("y1")
                  }, N = {
                    x: +h.attr("x2"),
                    y: +h.attr("y2")
                  };
                  var te = O.x - N.x, re = O.y - N.y;
                  if (Y = Math.atan2(re, te), j = Y + Math.PI, L && A && L + A > Math.sqrt(te * te + re * re)) {
                    ue();
                    return;
                  }
                  if (L) {
                    if (L * L > te * te + re * re) {
                      ue();
                      return;
                    }
                    var z = L * Math.cos(Y), Z = L * Math.sin(Y);
                    N.x += z, N.y += Z, h.attr({
                      x2: N.x,
                      y2: N.y
                    });
                  }
                  if (A) {
                    if (A * A > te * te + re * re) {
                      ue();
                      return;
                    }
                    var W = A * Math.cos(Y), q = A * Math.sin(Y);
                    O.x -= W, O.y -= q, h.attr({
                      x1: O.x,
                      y1: O.y
                    });
                  }
                } else if (E.nodeName === "path") {
                  var ie = E.getTotalLength(), ce = "";
                  if (ie < L + A) {
                    ue();
                    return;
                  }
                  var X = E.getPointAtLength(0), U = E.getPointAtLength(0.1);
                  Y = Math.atan2(X.y - U.y, X.x - U.x), O = E.getPointAtLength(Math.min(A, ie)), ce = "0px," + A + "px,";
                  var ne = E.getPointAtLength(ie), se = E.getPointAtLength(ie - 0.1);
                  j = Math.atan2(ne.y - se.y, ne.x - se.x), N = E.getPointAtLength(Math.max(0, ie - L));
                  var le = ce ? A + L : L;
                  ce += ie - le + "px," + ie + "px", h.style("stroke-dasharray", ce);
                }
                function ue() {
                  h.style("stroke-dasharray", "0px,100px");
                }
                function ve(be, Me, Ge, we) {
                  be.path && (be.noRotate && (Ge = 0), l.select(E.parentNode).append("path").attr({
                    class: h.attr("class"),
                    d: be.path,
                    transform: C(Me.x, Me.y) + y(Ge * 180 / Math.PI) + g(we)
                  }).style({
                    fill: v.rgb(S.arrowcolor),
                    "stroke-width": 0
                  }));
                }
                k && ve(T, O, Y, P), I && ve(x, N, j, F);
              };
            }
          ),
          /***/
          9180: (
            /***/
            function(s, c, i) {
              var l = i(6196), v = i(2300);
              s.exports = {
                moduleType: "component",
                name: "annotations",
                layoutAttributes: i(3916),
                supplyLayoutDefaults: i(5216),
                includeBasePlot: i(6632)("annotations"),
                calcAutorange: i(272),
                draw: l.draw,
                drawOne: l.drawOne,
                drawRaw: l.drawRaw,
                hasClickToShow: v.hasClickToShow,
                onClick: v.onClick,
                convertCoords: i(9208)
              };
            }
          ),
          /***/
          5899: (
            /***/
            function(s, c, i) {
              var l = i(3916), v = i(7824).overrideAll, f = i(1780).templatedArray;
              s.exports = v(f("annotation", {
                visible: l.visible,
                x: {
                  valType: "any"
                },
                y: {
                  valType: "any"
                },
                z: {
                  valType: "any"
                },
                ax: {
                  valType: "number"
                },
                ay: {
                  valType: "number"
                },
                xanchor: l.xanchor,
                xshift: l.xshift,
                yanchor: l.yanchor,
                yshift: l.yshift,
                text: l.text,
                textangle: l.textangle,
                font: l.font,
                width: l.width,
                height: l.height,
                opacity: l.opacity,
                align: l.align,
                valign: l.valign,
                bgcolor: l.bgcolor,
                bordercolor: l.bordercolor,
                borderpad: l.borderpad,
                borderwidth: l.borderwidth,
                showarrow: l.showarrow,
                arrowcolor: l.arrowcolor,
                arrowhead: l.arrowhead,
                startarrowhead: l.startarrowhead,
                arrowside: l.arrowside,
                arrowsize: l.arrowsize,
                startarrowsize: l.startarrowsize,
                arrowwidth: l.arrowwidth,
                standoff: l.standoff,
                startstandoff: l.startstandoff,
                hovertext: l.hovertext,
                hoverlabel: l.hoverlabel,
                captureevents: l.captureevents
                // maybes later?
                // clicktoshow: annAttrs.clicktoshow,
                // xclick: annAttrs.xclick,
                // yclick: annAttrs.yclick,
                // not needed!
                // axref: 'pixel'
                // ayref: 'pixel'
                // xref: 'x'
                // yref: 'y
                // zref: 'z'
              }), "calc", "from-root");
            }
          ),
          /***/
          76: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460);
              s.exports = function(g) {
                for (var y = g.fullSceneLayout, C = y.annotations, m = 0; m < C.length; m++)
                  f(C[m], g);
                g.fullLayout._infolayer.selectAll(".annotation-" + g.id).remove();
              };
              function f(p, g) {
                var y = g.fullSceneLayout, C = y.domain, m = g.fullLayout._size, h = {
                  // this gets fill in on render
                  pdata: null,
                  // to get setConvert to not execute cleanly
                  type: "linear",
                  // don't try to update them on `editable: true`
                  autorange: !1,
                  // set infinite range so that annotation draw routine
                  // does not try to remove 'outside-range' annotations,
                  // this case is handled in the render loop
                  range: [-1 / 0, 1 / 0]
                };
                p._xa = {}, l.extendFlat(p._xa, h), v.setConvert(p._xa), p._xa._offset = m.l + C.x[0] * m.w, p._xa.l2p = function() {
                  return 0.5 * (1 + p._pdata[0] / p._pdata[3]) * m.w * (C.x[1] - C.x[0]);
                }, p._ya = {}, l.extendFlat(p._ya, h), v.setConvert(p._ya), p._ya._offset = m.t + (1 - C.y[1]) * m.h, p._ya.l2p = function() {
                  return 0.5 * (1 - p._pdata[1] / p._pdata[3]) * m.h * (C.y[1] - C.y[0]);
                };
              }
            }
          ),
          /***/
          2808: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(1272), p = i(7192), g = i(5899);
              s.exports = function(m, h, w) {
                f(m, h, {
                  name: "annotations",
                  handleItemDefaults: y,
                  fullLayout: w.fullLayout
                });
              };
              function y(C, m, h, w) {
                function S(T, F) {
                  return l.coerce(C, m, g, T, F);
                }
                function E(T) {
                  var F = T + "axis", P = {
                    _fullLayout: {}
                  };
                  return P._fullLayout[F] = h[F], v.coercePosition(m, P, S, T, T, 0.5);
                }
                var x = S("visible");
                x && (p(C, m, w.fullLayout, S), E("x"), E("y"), E("z"), l.noneOrAll(C, m, ["x", "y", "z"]), m.xref = "x", m.yref = "y", m.zref = "z", S("xanchor"), S("yanchor"), S("xshift"), S("yshift"), m.showarrow && (m.axref = "pixel", m.ayref = "pixel", S("ax", -10), S("ay", -30), l.noneOrAll(C, m, ["ax", "ay"])));
              }
            }
          ),
          /***/
          1836: (
            /***/
            function(s, c, i) {
              var l = i(6196).drawRaw, v = i(4424), f = ["x", "y", "z"];
              s.exports = function(g) {
                for (var y = g.fullSceneLayout, C = g.dataScale, m = y.annotations, h = 0; h < m.length; h++) {
                  for (var w = m[h], S = !1, E = 0; E < 3; E++) {
                    var x = f[E], T = w[x], F = y[x + "axis"], P = F.r2fraction(T);
                    if (P < 0 || P > 1) {
                      S = !0;
                      break;
                    }
                  }
                  S ? g.fullLayout._infolayer.select(".annotation-" + g.id + '[data-index="' + h + '"]').remove() : (w._pdata = v(g.glplot.cameraParams, [y.xaxis.r2l(w.x) * C[0], y.yaxis.r2l(w.y) * C[1], y.zaxis.r2l(w.z) * C[2]]), l(g.graphDiv, w, h, g.id, w._xa, w._ya));
                }
              };
            }
          ),
          /***/
          6864: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3400);
              s.exports = {
                moduleType: "component",
                name: "annotations3d",
                schema: {
                  subplots: {
                    scene: {
                      annotations: i(5899)
                    }
                  }
                },
                layoutAttributes: i(5899),
                handleDefaults: i(2808),
                includeBasePlot: f,
                convert: i(76),
                draw: i(1836)
              };
              function f(p, g) {
                var y = l.subplotsRegistry.gl3d;
                if (y)
                  for (var C = y.attrRegex, m = Object.keys(p), h = 0; h < m.length; h++) {
                    var w = m[h];
                    C.test(w) && (p[w].annotations || []).length && (v.pushUnique(g._basePlotModules, y), v.pushUnique(g._subplots.gl3d, w));
                  }
              }
            }
          ),
          /***/
          4976: (
            /***/
            function(s, c, i) {
              s.exports = i(8700), i(5168), i(7020), i(7411), i(5668), i(2787), i(2084), i(6368), i(4747), i(5616), i(632), i(3040), i(1104), i(9075), i(4592), i(5348);
            }
          ),
          /***/
          7776: (
            /***/
            function(s, c, i) {
              var l = i(4976), v = i(3400), f = i(9032), p = f.EPOCHJD, g = f.ONEDAY, y = {
                valType: "enumerated",
                values: v.sortObjectKeys(l.calendars),
                editType: "calc",
                dflt: "gregorian"
              }, C = function(Y, j, te, re) {
                var z = {};
                return z[te] = y, v.coerce(Y, j, z, te, re);
              }, m = function(Y, j, te, re) {
                for (var z = 0; z < te.length; z++)
                  C(Y, j, te[z] + "calendar", re.calendar);
              }, h = {
                chinese: "2000-01-01",
                coptic: "2000-01-01",
                discworld: "2000-01-01",
                ethiopian: "2000-01-01",
                hebrew: "5000-01-01",
                islamic: "1000-01-01",
                julian: "2000-01-01",
                mayan: "5000-01-01",
                nanakshahi: "1000-01-01",
                nepali: "2000-01-01",
                persian: "1000-01-01",
                jalali: "1000-01-01",
                taiwan: "1000-01-01",
                thai: "2000-01-01",
                ummalqura: "1400-01-01"
              }, w = {
                chinese: "2000-01-02",
                coptic: "2000-01-03",
                discworld: "2000-01-03",
                ethiopian: "2000-01-05",
                hebrew: "5000-01-01",
                islamic: "1000-01-02",
                julian: "2000-01-03",
                mayan: "5000-01-01",
                nanakshahi: "1000-01-05",
                nepali: "2000-01-05",
                persian: "1000-01-01",
                jalali: "1000-01-01",
                taiwan: "1000-01-04",
                thai: "2000-01-04",
                ummalqura: "1400-01-06"
              }, S = {
                chinese: ["2000-01-01", "2001-01-01"],
                coptic: ["1700-01-01", "1701-01-01"],
                discworld: ["1800-01-01", "1801-01-01"],
                ethiopian: ["2000-01-01", "2001-01-01"],
                hebrew: ["5700-01-01", "5701-01-01"],
                islamic: ["1400-01-01", "1401-01-01"],
                julian: ["2000-01-01", "2001-01-01"],
                mayan: ["5200-01-01", "5201-01-01"],
                nanakshahi: ["0500-01-01", "0501-01-01"],
                nepali: ["2000-01-01", "2001-01-01"],
                persian: ["1400-01-01", "1401-01-01"],
                jalali: ["1400-01-01", "1401-01-01"],
                taiwan: ["0100-01-01", "0101-01-01"],
                thai: ["2500-01-01", "2501-01-01"],
                ummalqura: ["1400-01-01", "1401-01-01"]
              }, E = "##", x = {
                d: {
                  0: "dd",
                  "-": "d"
                },
                // 2-digit or unpadded day of month
                e: {
                  0: "d",
                  "-": "d"
                },
                // alternate, always unpadded day of month
                a: {
                  0: "D",
                  "-": "D"
                },
                // short weekday name
                A: {
                  0: "DD",
                  "-": "DD"
                },
                // full weekday name
                j: {
                  0: "oo",
                  "-": "o"
                },
                // 3-digit or unpadded day of the year
                W: {
                  0: "ww",
                  "-": "w"
                },
                // 2-digit or unpadded week of the year (Monday first)
                m: {
                  0: "mm",
                  "-": "m"
                },
                // 2-digit or unpadded month number
                b: {
                  0: "M",
                  "-": "M"
                },
                // short month name
                B: {
                  0: "MM",
                  "-": "MM"
                },
                // full month name
                y: {
                  0: "yy",
                  "-": "yy"
                },
                // 2-digit year (map unpadded to zero-padded)
                Y: {
                  0: "yyyy",
                  "-": "yyyy"
                },
                // 4-digit year (map unpadded to zero-padded)
                U: E,
                // Sunday-first week of the year
                w: E,
                // day of the week [0(sunday),6]
                // combined format, we replace the date part with the world-calendar version
                // and the %X stays there for d3 to handle with time parts
                c: {
                  0: "D M d %X yyyy",
                  "-": "D M d %X yyyy"
                },
                x: {
                  0: "mm/dd/yyyy",
                  "-": "mm/dd/yyyy"
                }
              };
              function T(Y, j, te) {
                for (var re = Math.floor((j + 0.05) / g) + p, z = P(te).fromJD(re), Z = 0, W, q, ie, ce, X; (Z = Y.indexOf("%", Z)) !== -1; )
                  W = Y.charAt(Z + 1), W === "0" || W === "-" || W === "_" ? (ie = 3, q = Y.charAt(Z + 2), W === "_" && (W = "-")) : (q = W, W = "0", ie = 2), ce = x[q], ce ? (ce === E ? X = E : X = z.formatDate(ce[W]), Y = Y.substr(0, Z) + X + Y.substr(Z + ie), Z += X.length) : Z += ie;
                return Y;
              }
              var F = {};
              function P(Y) {
                var j = F[Y];
                return j || (j = F[Y] = l.instance(Y), j);
              }
              function k(Y) {
                return v.extendFlat({}, y, {
                  description: Y
                });
              }
              function I(Y) {
                return "Sets the calendar system to use with `" + Y + "` date data.";
              }
              var L = {
                xcalendar: k(I("x"))
              }, A = v.extendFlat({}, L, {
                ycalendar: k(I("y"))
              }), O = v.extendFlat({}, A, {
                zcalendar: k(I("z"))
              }), N = k(["Sets the calendar system to use for `range` and `tick0`", "if this is a date axis. This does not set the calendar for", "interpreting data on this axis, that's specified in the trace", "or via the global `layout.calendar`"].join(" "));
              s.exports = {
                moduleType: "component",
                name: "calendars",
                schema: {
                  traces: {
                    scatter: A,
                    bar: A,
                    box: A,
                    heatmap: A,
                    contour: A,
                    histogram: A,
                    histogram2d: A,
                    histogram2dcontour: A,
                    scatter3d: O,
                    surface: O,
                    mesh3d: O,
                    scattergl: A,
                    ohlc: L,
                    candlestick: L
                  },
                  layout: {
                    calendar: k(["Sets the default calendar system to use for interpreting and", "displaying dates throughout the plot."].join(" "))
                  },
                  subplots: {
                    xaxis: {
                      calendar: N
                    },
                    yaxis: {
                      calendar: N
                    },
                    scene: {
                      xaxis: {
                        calendar: N
                      },
                      // TODO: it's actually redundant to include yaxis and zaxis here
                      // because in the scene attributes these are the same object so merging
                      // into one merges into them all. However, I left them in for parity with
                      // cartesian, where yaxis is unused until we Plotschema.get() when we
                      // use its presence or absence to determine whether to delete attributes
                      // from yaxis if they only apply to x (rangeselector/rangeslider)
                      yaxis: {
                        calendar: N
                      },
                      zaxis: {
                        calendar: N
                      }
                    },
                    polar: {
                      radialaxis: {
                        calendar: N
                      }
                    }
                  },
                  transforms: {
                    filter: {
                      valuecalendar: k(["WARNING: All transforms are deprecated and may be removed from the API in next major version.", "Sets the calendar system to use for `value`, if it is a date."].join(" ")),
                      targetcalendar: k(["WARNING: All transforms are deprecated and may be removed from the API in next major version.", "Sets the calendar system to use for `target`, if it is an", "array of dates. If `target` is a string (eg *x*) we use the", "corresponding trace attribute (eg `xcalendar`) if it exists,", "even if `targetcalendar` is provided."].join(" "))
                    }
                  }
                },
                layoutAttributes: y,
                handleDefaults: C,
                handleTraceDefaults: m,
                CANONICAL_SUNDAY: w,
                CANONICAL_TICK: h,
                DFLTRANGE: S,
                getCal: P,
                worldCalFmt: T
              };
            }
          ),
          /***/
          2548: (
            /***/
            function(s, c) {
              c.defaults = [
                "#1f77b4",
                // muted blue
                "#ff7f0e",
                // safety orange
                "#2ca02c",
                // cooked asparagus green
                "#d62728",
                // brick red
                "#9467bd",
                // muted purple
                "#8c564b",
                // chestnut brown
                "#e377c2",
                // raspberry yogurt pink
                "#7f7f7f",
                // middle gray
                "#bcbd22",
                // curry yellow-green
                "#17becf"
                // blue-teal
              ], c.defaultLine = "#444", c.lightLine = "#eee", c.background = "#fff", c.borderLine = "#BEC8D9", c.lightFraction = 90.9090909090909;
            }
          ),
          /***/
          6308: (
            /***/
            function(s, c, i) {
              var l = i(9760), v = i(8248), f = i(8116).isTypedArray, p = s.exports = {}, g = i(2548);
              p.defaults = g.defaults;
              var y = p.defaultLine = g.defaultLine;
              p.lightLine = g.lightLine;
              var C = p.background = g.background;
              p.tinyRGB = function(h) {
                var w = h.toRgb();
                return "rgb(" + Math.round(w.r) + ", " + Math.round(w.g) + ", " + Math.round(w.b) + ")";
              }, p.rgb = function(h) {
                return p.tinyRGB(l(h));
              }, p.opacity = function(h) {
                return h ? l(h).getAlpha() : 0;
              }, p.addOpacity = function(h, w) {
                var S = l(h).toRgb();
                return "rgba(" + Math.round(S.r) + ", " + Math.round(S.g) + ", " + Math.round(S.b) + ", " + w + ")";
              }, p.combine = function(h, w) {
                var S = l(h).toRgb();
                if (S.a === 1) return l(h).toRgbString();
                var E = l(w || C).toRgb(), x = E.a === 1 ? E : {
                  r: 255 * (1 - E.a) + E.r * E.a,
                  g: 255 * (1 - E.a) + E.g * E.a,
                  b: 255 * (1 - E.a) + E.b * E.a
                }, T = {
                  r: x.r * (1 - S.a) + S.r * S.a,
                  g: x.g * (1 - S.a) + S.g * S.a,
                  b: x.b * (1 - S.a) + S.b * S.a
                };
                return l(T).toRgbString();
              }, p.interpolate = function(h, w, S) {
                var E = l(h).toRgb(), x = l(w).toRgb(), T = {
                  r: S * E.r + (1 - S) * x.r,
                  g: S * E.g + (1 - S) * x.g,
                  b: S * E.b + (1 - S) * x.b
                };
                return l(T).toRgbString();
              }, p.contrast = function(h, w, S) {
                var E = l(h);
                E.getAlpha() !== 1 && (E = l(p.combine(h, C)));
                var x = E.isDark() ? w ? E.lighten(w) : C : S ? E.darken(S) : y;
                return x.toString();
              }, p.stroke = function(h, w) {
                var S = l(w);
                h.style({
                  stroke: p.tinyRGB(S),
                  "stroke-opacity": S.getAlpha()
                });
              }, p.fill = function(h, w) {
                var S = l(w);
                h.style({
                  fill: p.tinyRGB(S),
                  "fill-opacity": S.getAlpha()
                });
              }, p.clean = function(h) {
                if (!(!h || typeof h != "object")) {
                  var w = Object.keys(h), S, E, x, T;
                  for (S = 0; S < w.length; S++)
                    if (x = w[S], T = h[x], x.substr(x.length - 5) === "color")
                      if (Array.isArray(T))
                        for (E = 0; E < T.length; E++) T[E] = m(T[E]);
                      else h[x] = m(T);
                    else if (x.substr(x.length - 10) === "colorscale" && Array.isArray(T))
                      for (E = 0; E < T.length; E++)
                        Array.isArray(T[E]) && (T[E][1] = m(T[E][1]));
                    else if (Array.isArray(T)) {
                      var F = T[0];
                      if (!Array.isArray(F) && F && typeof F == "object")
                        for (E = 0; E < T.length; E++) p.clean(T[E]);
                    } else T && typeof T == "object" && !f(T) && p.clean(T);
                }
              };
              function m(h) {
                if (v(h) || typeof h != "string") return h;
                var w = h.trim();
                if (w.substr(0, 3) !== "rgb") return h;
                var S = w.match(/^rgba?\s*\(([^()]*)\)$/);
                if (!S) return h;
                var E = S[1].trim().split(/\s*[\s,]\s*/), x = w.charAt(3) === "a" && E.length === 4;
                if (!x && E.length !== 3) return h;
                for (var T = 0; T < E.length; T++) {
                  if (!E[T].length || (E[T] = Number(E[T]), !(E[T] >= 0)))
                    return h;
                  if (T === 3)
                    E[T] > 1 && (E[T] = 1);
                  else if (E[T] >= 1)
                    return h;
                }
                var F = Math.round(E[0] * 255) + ", " + Math.round(E[1] * 255) + ", " + Math.round(E[2] * 255);
                return x ? "rgba(" + F + ", " + E[3] + ")" : "rgb(" + F + ")";
              }
            }
          ),
          /***/
          616: (
            /***/
            function(s, c, i) {
              var l = i(4724), v = i(5376), f = i(2880).extendFlat, p = i(7824).overrideAll;
              s.exports = p({
                orientation: {
                  valType: "enumerated",
                  values: ["h", "v"],
                  dflt: "v"
                },
                thicknessmode: {
                  valType: "enumerated",
                  values: ["fraction", "pixels"],
                  dflt: "pixels"
                },
                thickness: {
                  valType: "number",
                  min: 0,
                  dflt: 30
                },
                lenmode: {
                  valType: "enumerated",
                  values: ["fraction", "pixels"],
                  dflt: "fraction"
                },
                len: {
                  valType: "number",
                  min: 0,
                  dflt: 1
                },
                x: {
                  valType: "number"
                },
                xref: {
                  valType: "enumerated",
                  dflt: "paper",
                  values: ["container", "paper"],
                  editType: "layoutstyle"
                },
                xanchor: {
                  valType: "enumerated",
                  values: ["left", "center", "right"]
                },
                xpad: {
                  valType: "number",
                  min: 0,
                  dflt: 10
                },
                y: {
                  valType: "number"
                },
                yref: {
                  valType: "enumerated",
                  dflt: "paper",
                  values: ["container", "paper"],
                  editType: "layoutstyle"
                },
                yanchor: {
                  valType: "enumerated",
                  values: ["top", "middle", "bottom"]
                },
                ypad: {
                  valType: "number",
                  min: 0,
                  dflt: 10
                },
                // a possible line around the bar itself
                outlinecolor: l.linecolor,
                outlinewidth: l.linewidth,
                // Should outlinewidth have {dflt: 0} ?
                // another possible line outside the padding and tick labels
                bordercolor: l.linecolor,
                borderwidth: {
                  valType: "number",
                  min: 0,
                  dflt: 0
                },
                bgcolor: {
                  valType: "color",
                  dflt: "rgba(0,0,0,0)"
                },
                // tick and title properties named and function exactly as in axes
                tickmode: l.minor.tickmode,
                nticks: l.nticks,
                tick0: l.tick0,
                dtick: l.dtick,
                tickvals: l.tickvals,
                ticktext: l.ticktext,
                ticks: f({}, l.ticks, {
                  dflt: ""
                }),
                ticklabeloverflow: f({}, l.ticklabeloverflow, {}),
                // ticklabelposition: not used directly, as values depend on orientation
                // left/right options are for x axes, and top/bottom options are for y axes
                ticklabelposition: {
                  valType: "enumerated",
                  values: ["outside", "inside", "outside top", "inside top", "outside left", "inside left", "outside right", "inside right", "outside bottom", "inside bottom"],
                  dflt: "outside"
                },
                ticklen: l.ticklen,
                tickwidth: l.tickwidth,
                tickcolor: l.tickcolor,
                ticklabelstep: l.ticklabelstep,
                showticklabels: l.showticklabels,
                labelalias: l.labelalias,
                tickfont: v({}),
                tickangle: l.tickangle,
                tickformat: l.tickformat,
                tickformatstops: l.tickformatstops,
                tickprefix: l.tickprefix,
                showtickprefix: l.showtickprefix,
                ticksuffix: l.ticksuffix,
                showticksuffix: l.showticksuffix,
                separatethousands: l.separatethousands,
                exponentformat: l.exponentformat,
                minexponent: l.minexponent,
                showexponent: l.showexponent,
                title: {
                  text: {
                    valType: "string"
                  },
                  font: v({}),
                  side: {
                    valType: "enumerated",
                    values: ["right", "top", "bottom"]
                  }
                },
                _deprecated: {
                  title: {
                    valType: "string"
                  },
                  titlefont: v({}),
                  titleside: {
                    valType: "enumerated",
                    values: ["right", "top", "bottom"],
                    dflt: "top"
                  }
                }
              }, "colorbars", "from-root");
            }
          ),
          /***/
          3964: (
            /***/
            function(s) {
              s.exports = {
                cn: {
                  colorbar: "colorbar",
                  cbbg: "cbbg",
                  cbfill: "cbfill",
                  cbfills: "cbfills",
                  cbline: "cbline",
                  cblines: "cblines",
                  cbaxis: "cbaxis",
                  cbtitleunshift: "cbtitleunshift",
                  cbtitle: "cbtitle",
                  cboutline: "cboutline",
                  crisp: "crisp",
                  jsPlaceholder: "js-placeholder"
                }
              };
            }
          ),
          /***/
          4013: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(1780), f = i(6332), p = i(5404), g = i(5936), y = i(2568), C = i(616);
              s.exports = function(h, w, S) {
                var E = v.newContainer(w, "colorbar"), x = h.colorbar || {};
                function T(ne, se) {
                  return l.coerce(x, E, C, ne, se);
                }
                var F = S.margin || {
                  t: 0,
                  b: 0,
                  l: 0,
                  r: 0
                }, P = S.width - F.l - F.r, k = S.height - F.t - F.b, I = T("orientation"), L = I === "v", A = T("thicknessmode");
                T("thickness", A === "fraction" ? 30 / (L ? P : k) : 30);
                var O = T("lenmode");
                T("len", O === "fraction" ? 1 : L ? k : P);
                var N = T("yref"), Y = T("xref"), j = N === "paper", te = Y === "paper", re, z, Z, W = "left";
                L ? (Z = "middle", W = te ? "left" : "right", re = te ? 1.02 : 1, z = 0.5) : (Z = j ? "bottom" : "top", W = "center", re = 0.5, z = j ? 1.02 : 1), l.coerce(x, E, {
                  x: {
                    valType: "number",
                    min: te ? -2 : 0,
                    max: te ? 3 : 1,
                    dflt: re
                  }
                }, "x"), l.coerce(x, E, {
                  y: {
                    valType: "number",
                    min: j ? -2 : 0,
                    max: j ? 3 : 1,
                    dflt: z
                  }
                }, "y"), T("xanchor", W), T("xpad"), T("yanchor", Z), T("ypad"), l.noneOrAll(x, E, ["x", "y"]), T("outlinecolor"), T("outlinewidth"), T("bordercolor"), T("borderwidth"), T("bgcolor");
                var q = l.coerce(x, E, {
                  ticklabelposition: {
                    valType: "enumerated",
                    dflt: "outside",
                    values: L ? ["outside", "inside", "outside top", "inside top", "outside bottom", "inside bottom"] : ["outside", "inside", "outside left", "inside left", "outside right", "inside right"]
                  }
                }, "ticklabelposition");
                T("ticklabeloverflow", q.indexOf("inside") !== -1 ? "hide past domain" : "hide past div"), f(x, E, T, "linear");
                var ie = S.font, ce = {
                  noAutotickangles: !0,
                  outerTicks: !1,
                  font: ie
                };
                q.indexOf("inside") !== -1 && (ce.bgColor = "black"), y(x, E, T, "linear", ce), g(x, E, T, "linear", ce), p(x, E, T, "linear", ce), T("title.text", S._dfltTitle.colorbar);
                var X = E.showticklabels ? E.tickfont : ie, U = l.extendFlat({}, ie, {
                  family: X.family,
                  size: l.bigFont(X.size)
                });
                l.coerceFont(T, "title.font", U), T("title.side", L ? "top" : "right");
              };
            }
          ),
          /***/
          7848: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(9760), f = i(7316), p = i(4040), g = i(4460), y = i(6476), C = i(3400), m = C.strTranslate, h = i(2880).extendFlat, w = i(3972), S = i(3616), E = i(6308), x = i(1668), T = i(2736), F = i(4288).flipScale, P = i(5955), k = i(7668), I = i(4724), L = i(4284), A = L.LINE_SPACING, O = L.FROM_TL, N = L.FROM_BR, Y = i(3964).cn;
              function j(q) {
                var ie = q._fullLayout, ce = ie._infolayer.selectAll("g." + Y.colorbar).data(te(q), function(X) {
                  return X._id;
                });
                ce.enter().append("g").attr("class", function(X) {
                  return X._id;
                }).classed(Y.colorbar, !0), ce.each(function(X) {
                  var U = l.select(this);
                  C.ensureSingle(U, "rect", Y.cbbg), C.ensureSingle(U, "g", Y.cbfills), C.ensureSingle(U, "g", Y.cblines), C.ensureSingle(U, "g", Y.cbaxis, function(se) {
                    se.classed(Y.crisp, !0);
                  }), C.ensureSingle(U, "g", Y.cbtitleunshift, function(se) {
                    se.append("g").classed(Y.cbtitle, !0);
                  }), C.ensureSingle(U, "rect", Y.cboutline);
                  var ne = re(U, X, q);
                  ne && ne.then && (q._promises || []).push(ne), q._context.edits.colorbarPosition && z(U, X, q);
                }), ce.exit().each(function(X) {
                  f.autoMargin(q, X._id);
                }).remove(), ce.order();
              }
              function te(q) {
                var ie = q._fullLayout, ce = q.calcdata, X = [], U, ne, se, le;
                function ue(_) {
                  return h(_, {
                    // fillcolor can be a d3 scale, domain is z values, range is colors
                    // or leave it out for no fill,
                    // or set to a string constant for single-color fill
                    _fillcolor: null,
                    // line.color has the same options as fillcolor
                    _line: {
                      color: null,
                      width: null,
                      dash: null
                    },
                    // levels of lines to draw.
                    // note that this DOES NOT determine the extent of the bar
                    // that's given by the domain of fillcolor
                    // (or line.color if no fillcolor domain)
                    _levels: {
                      start: null,
                      end: null,
                      size: null
                    },
                    // separate fill levels (for example, heatmap coloring of a
                    // contour map) if this is omitted, fillcolors will be
                    // evaluated halfway between levels
                    _filllevels: null,
                    // for continuous colorscales: fill with a gradient instead of explicit levels
                    // value should be the colorscale [[0, c0], [v1, c1], ..., [1, cEnd]]
                    _fillgradient: null,
                    // when using a gradient, we need the data range specified separately
                    _zrange: null
                  });
                }
                function ve() {
                  typeof le.calc == "function" ? le.calc(q, se, U) : (U._fillgradient = ne.reversescale ? F(ne.colorscale) : ne.colorscale, U._zrange = [ne[le.min], ne[le.max]]);
                }
                for (var be = 0; be < ce.length; be++) {
                  var Me = ce[be];
                  if (se = Me[0].trace, !!se._module) {
                    var Ge = se._module.colorbar;
                    if (se.visible === !0 && Ge)
                      for (var we = Array.isArray(Ge), Re = we ? Ge : [Ge], Ae = 0; Ae < Re.length; Ae++) {
                        le = Re[Ae];
                        var K = le.container;
                        ne = K ? se[K] : se, ne && ne.showscale && (U = ue(ne.colorbar), U._id = "cb" + se.uid + (we && K ? "-" + K : ""), U._traceIndex = se.index, U._propPrefix = (K ? K + "." : "") + "colorbar.", U._meta = se._meta, ve(), X.push(U));
                      }
                  }
                }
                for (var ee in ie._colorAxes)
                  if (ne = ie[ee], ne.showscale) {
                    var oe = ie._colorAxes[ee];
                    U = ue(ne.colorbar), U._id = "cb" + ee, U._propPrefix = ee + ".colorbar.", U._meta = ie._meta, le = {
                      min: "cmin",
                      max: "cmax"
                    }, oe[0] !== "heatmap" && (se = oe[1], le.calc = se._module.colorbar.calc), ve(), X.push(U);
                  }
                return X;
              }
              function re(q, ie, ce) {
                var X = ie.orientation === "v", U = ie.len, ne = ie.lenmode, se = ie.thickness, le = ie.thicknessmode, ue = ie.outlinewidth, ve = ie.borderwidth, be = ie.bgcolor, Me = ie.xanchor, Ge = ie.yanchor, we = ie.xpad, Re = ie.ypad, Ae = ie.x, K = X ? ie.y : 1 - ie.y, ee = ie.yref === "paper", oe = ie.xref === "paper", _ = ce._fullLayout, V = _._size, fe = ie._fillcolor, $ = ie._line, he = ie.title, me = he.side, xe = ie._zrange || l.extent((typeof fe == "function" ? fe : $.color).domain()), Fe = typeof $.color == "function" ? $.color : function() {
                  return $.color;
                }, Ve = typeof fe == "function" ? fe : function() {
                  return fe;
                }, Be = ie._levels, Je = Z(ce, ie, xe), et = Je.fill, at = Je.line, De = Math.round(se * (le === "fraction" ? X ? V.w : V.h : 1)), Ne = De / (X ? V.w : V.h), Ie = Math.round(U * (ne === "fraction" ? X ? V.h : V.w : 1)), Ue = Ie / (X ? V.h : V.w), ot = oe ? V.w : ce._fullLayout.width, ct = ee ? V.h : ce._fullLayout.height, Tt = Math.round(X ? Ae * ot + we : K * ct + Re), kt = {
                  center: 0.5,
                  right: 1
                }[Me] || 0, Ot = {
                  top: 1,
                  middle: 0.5
                }[Ge] || 0, Rt = X ? Ae - kt * Ne : K - Ot * Ne, xt = X ? K - Ot * Ue : Ae - kt * Ue, Wt = Math.round(X ? ct * (1 - xt) : ot * xt);
                ie._lenFrac = Ue, ie._thickFrac = Ne, ie._uFrac = Rt, ie._vFrac = xt;
                var bt = ie._axis = W(ce, ie, xe);
                bt.position = Ne + (X ? Ae + we / V.w : K + Re / V.h);
                var jt = ["top", "bottom"].indexOf(me) !== -1;
                if (X && jt && (bt.title.side = me, bt.titlex = Ae + we / V.w, bt.titley = xt + (he.side === "top" ? Ue - Re / V.h : Re / V.h)), !X && !jt && (bt.title.side = me, bt.titley = K + Re / V.h, bt.titlex = xt + we / V.w), $.color && ie.tickmode === "auto") {
                  bt.tickmode = "linear", bt.tick0 = Be.start;
                  var qt = Be.size, Yt = C.constrain(Ie / 50, 4, 15) + 1, Ut = (xe[1] - xe[0]) / ((ie.nticks || Yt) * qt);
                  if (Ut > 1) {
                    var tt = Math.pow(10, Math.floor(Math.log(Ut) / Math.LN10));
                    qt *= tt * C.roundUp(Ut / tt, [2, 5, 10]), (Math.abs(Be.start) / Be.size + 1e-6) % 1 < 2e-6 && (bt.tick0 = 0);
                  }
                  bt.dtick = qt;
                }
                bt.domain = X ? [xt + Re / V.h, xt + Ue - Re / V.h] : [xt + we / V.w, xt + Ue - we / V.w], bt.setScale(), q.attr("transform", m(Math.round(V.l), Math.round(V.t)));
                var ze = q.select("." + Y.cbtitleunshift).attr("transform", m(-Math.round(V.l), -Math.round(V.t))), _e = bt.ticklabelposition, Ye = bt.title.font.size, lt = q.select("." + Y.cbaxis), Te, Oe = 0, je = 0;
                function Xe(vt, ut) {
                  var Pt = {
                    propContainer: bt,
                    propName: ie._propPrefix + "title",
                    traceIndex: ie._traceIndex,
                    _meta: ie._meta,
                    placeholder: _._dfltTitle.colorbar,
                    containerGroup: q.select("." + Y.cbtitle)
                  }, rr = vt.charAt(0) === "h" ? vt.substr(1) : "h" + vt;
                  q.selectAll("." + rr + ",." + rr + "-math-group").remove(), x.draw(ce, vt, h(Pt, ut || {}));
                }
                function nt() {
                  if (X && jt || !X && !jt) {
                    var vt, ut;
                    me === "top" && (vt = we + V.l + ot * Ae, ut = Re + V.t + ct * (1 - xt - Ue) + 3 + Ye * 0.75), me === "bottom" && (vt = we + V.l + ot * Ae, ut = Re + V.t + ct * (1 - xt) - 3 - Ye * 0.25), me === "right" && (ut = Re + V.t + ct * K + 3 + Ye * 0.75, vt = we + V.l + ot * xt), Xe(bt._id + "title", {
                      attributes: {
                        x: vt,
                        y: ut,
                        "text-anchor": X ? "start" : "middle"
                      }
                    });
                  }
                }
                function it() {
                  if (X && !jt || !X && jt) {
                    var vt = bt.position || 0, ut = bt._offset + bt._length / 2, Pt, rr;
                    if (me === "right")
                      rr = ut, Pt = V.l + ot * vt + 10 + Ye * (bt.showticklabels ? 1 : 0.5);
                    else if (Pt = ut, me === "bottom" && (rr = V.t + ct * vt + 10 + (_e.indexOf("inside") === -1 ? bt.tickfont.size : 0) + (bt.ticks !== "intside" && ie.ticklen || 0)), me === "top") {
                      var lr = he.text.split("<br>").length;
                      rr = V.t + ct * vt + 10 - De - A * Ye * lr;
                    }
                    Xe((X ? (
                      // the 'h' + is a hack to get around the fact that
                      // convertToTspans rotates any 'y...' class by 90 degrees.
                      // TODO: find a better way to control this.
                      "h"
                    ) : "v") + bt._id + "title", {
                      avoid: {
                        selection: l.select(ce).selectAll("g." + bt._id + "tick"),
                        side: me,
                        offsetTop: X ? 0 : V.t,
                        offsetLeft: X ? V.l : 0,
                        maxShift: X ? _.width : _.height
                      },
                      attributes: {
                        x: Pt,
                        y: rr,
                        "text-anchor": "middle"
                      },
                      transform: {
                        rotate: X ? -90 : 0,
                        offset: 0
                      }
                    });
                  }
                }
                function Nt() {
                  if (!X && !jt || X && jt) {
                    var vt = q.select("." + Y.cbtitle), ut = vt.select("text"), Pt = [-ue / 2, ue / 2], rr = vt.select(".h" + bt._id + "title-math-group").node(), lr = 15.6;
                    ut.node() && (lr = parseInt(ut.node().style.fontSize, 10) * A);
                    var Mr;
                    if (rr ? (Mr = S.bBox(rr), je = Mr.width, Oe = Mr.height, Oe > lr && (Pt[1] -= (Oe - lr) / 2)) : ut.node() && !ut.classed(Y.jsPlaceholder) && (Mr = S.bBox(ut.node()), je = Mr.width, Oe = Mr.height), X) {
                      if (Oe) {
                        if (Oe += 5, me === "top")
                          bt.domain[1] -= Oe / V.h, Pt[1] *= -1;
                        else {
                          bt.domain[0] += Oe / V.h;
                          var Rr = T.lineCount(ut);
                          Pt[1] += (1 - Rr) * lr;
                        }
                        vt.attr("transform", m(Pt[0], Pt[1])), bt.setScale();
                      }
                    } else
                      je && (me === "right" && (bt.domain[0] += (je + Ye / 2) / V.w), vt.attr("transform", m(Pt[0], Pt[1])), bt.setScale());
                  }
                  q.selectAll("." + Y.cbfills + ",." + Y.cblines).attr("transform", X ? m(0, Math.round(V.h * (1 - bt.domain[1]))) : m(Math.round(V.w * bt.domain[0]), 0)), lt.attr("transform", X ? m(0, Math.round(-V.t)) : m(Math.round(-V.l), 0));
                  var Pr = q.select("." + Y.cbfills).selectAll("rect." + Y.cbfill).attr("style", "").data(et);
                  Pr.enter().append("rect").classed(Y.cbfill, !0).attr("style", ""), Pr.exit().remove();
                  var ir = xe.map(bt.c2p).map(Math.round).sort(function(Ar, pr) {
                    return Ar - pr;
                  });
                  Pr.each(function(Ar, pr) {
                    var kr = [pr === 0 ? xe[0] : (et[pr] + et[pr - 1]) / 2, pr === et.length - 1 ? xe[1] : (et[pr] + et[pr + 1]) / 2].map(bt.c2p).map(Math.round);
                    X && (kr[1] = C.constrain(kr[1] + (kr[1] > kr[0]) ? 1 : -1, ir[0], ir[1]));
                    var br = l.select(this).attr(X ? "x" : "y", Tt).attr(X ? "y" : "x", l.min(kr)).attr(X ? "width" : "height", Math.max(De, 2)).attr(X ? "height" : "width", Math.max(l.max(kr) - l.min(kr), 2));
                    if (ie._fillgradient)
                      S.gradient(br, ce, ie._id, X ? "vertical" : "horizontalreversed", ie._fillgradient, "fill");
                    else {
                      var Gr = Ve(Ar).replace("e-", "");
                      br.attr("fill", v(Gr).toHexString());
                    }
                  });
                  var Lr = q.select("." + Y.cblines).selectAll("path." + Y.cbline).data($.color && $.width ? at : []);
                  Lr.enter().append("path").classed(Y.cbline, !0), Lr.exit().remove(), Lr.each(function(Ar) {
                    var pr = Tt, kr = Math.round(bt.c2p(Ar)) + $.width / 2 % 1;
                    l.select(this).attr("d", "M" + (X ? pr + "," + kr : kr + "," + pr) + (X ? "h" : "v") + De).call(S.lineGroupStyle, $.width, Fe(Ar), $.dash);
                  }), lt.selectAll("g." + bt._id + "tick,path").remove();
                  var yr = Tt + De + (ue || 0) / 2 - (ie.ticks === "outside" ? 1 : 0), Sr = g.calcTicks(bt), Yr = g.getTickSigns(bt)[2];
                  return g.drawTicks(ce, bt, {
                    vals: bt.ticks === "inside" ? g.clipEnds(bt, Sr) : Sr,
                    layer: lt,
                    path: g.makeTickPath(bt, yr, Yr),
                    transFn: g.makeTransTickFn(bt)
                  }), g.drawLabels(ce, bt, {
                    vals: Sr,
                    layer: lt,
                    transFn: g.makeTransTickLabelFn(bt),
                    labelFns: g.makeLabelFns(bt, yr)
                  });
                }
                function At() {
                  var vt, ut = De + ue / 2;
                  _e.indexOf("inside") === -1 && (vt = S.bBox(lt.node()), ut += X ? vt.width : vt.height), Te = ze.select("text");
                  var Pt = 0, rr = X && me === "top", lr = !X && me === "right", Mr = 0;
                  if (Te.node() && !Te.classed(Y.jsPlaceholder)) {
                    var Rr, Pr = ze.select(".h" + bt._id + "title-math-group").node();
                    Pr && (X && jt || !X && !jt) ? (vt = S.bBox(Pr), Pt = vt.width, Rr = vt.height) : (vt = S.bBox(ze.node()), Pt = vt.right - V.l - (X ? Tt : Wt), Rr = vt.bottom - V.t - (X ? Wt : Tt), !X && me === "top" && (ut += vt.height, Mr = vt.height)), lr && (Te.attr("transform", m(Pt / 2 + Ye / 2, 0)), Pt *= 2), ut = Math.max(ut, X ? Pt : Rr);
                  }
                  var ir = (X ? we : Re) * 2 + ut + ve + ue / 2, Lr = 0;
                  !X && he.text && Ge === "bottom" && K <= 0 && (Lr = ir / 2, ir += Lr, Mr += Lr), _._hColorbarMoveTitle = Lr, _._hColorbarMoveCBTitle = Mr;
                  var yr = ve + ue, Sr = (X ? Tt : Wt) - yr / 2 - (X ? we : 0), Yr = (X ? Wt : Tt) - (X ? Ie : Re + Mr - Lr);
                  q.select("." + Y.cbbg).attr("x", Sr).attr("y", Yr).attr(X ? "width" : "height", Math.max(ir - Lr, 2)).attr(X ? "height" : "width", Math.max(Ie + yr, 2)).call(E.fill, be).call(E.stroke, ie.bordercolor).style("stroke-width", ve);
                  var Ar = lr ? Math.max(Pt - 10, 0) : 0;
                  q.selectAll("." + Y.cboutline).attr("x", (X ? Tt : Wt + we) + Ar).attr("y", (X ? Wt + Re - Ie : Tt) + (rr ? Oe : 0)).attr(X ? "width" : "height", Math.max(De, 2)).attr(X ? "height" : "width", Math.max(Ie - (X ? 2 * Re + Oe : 2 * we + Ar), 2)).call(E.stroke, ie.outlinecolor).style({
                    fill: "none",
                    "stroke-width": ue
                  });
                  var pr = X ? kt * ir : 0, kr = X ? 0 : (1 - Ot) * ir - Mr;
                  if (pr = oe ? V.l - pr : -pr, kr = ee ? V.t - kr : -kr, q.attr("transform", m(pr, kr)), !X && (ve || v(be).getAlpha() && !v.equals(_.paper_bgcolor, be))) {
                    var br = lt.selectAll("text"), Gr = br[0].length, rn = q.select("." + Y.cbbg).node(), cn = S.bBox(rn), Dr = S.getTranslate(q), Se = 2;
                    br.each(function(Ft, Gt) {
                      var Lt = 0, $t = Gr - 1;
                      if (Gt === Lt || Gt === $t) {
                        var _t = S.bBox(this), zt = S.getTranslate(this), tr;
                        if (Gt === $t) {
                          var nr = _t.right + zt.x, xr = cn.right + Dr.x + Wt - ve - Se + Ae;
                          tr = xr - nr, tr > 0 && (tr = 0);
                        } else if (Gt === Lt) {
                          var Er = _t.left + zt.x, Jr = cn.left + Dr.x + Wt + ve + Se;
                          tr = Jr - Er, tr < 0 && (tr = 0);
                        }
                        tr && (Gr < 3 ? this.setAttribute("transform", "translate(" + tr + ",0) " + this.getAttribute("transform")) : this.setAttribute("visibility", "hidden"));
                      }
                    });
                  }
                  var ae = {}, ft = O[Me], rt = N[Me], gt = O[Ge], wt = N[Ge], Ct = ir - De;
                  X ? (ne === "pixels" ? (ae.y = K, ae.t = Ie * gt, ae.b = Ie * wt) : (ae.t = ae.b = 0, ae.yt = K + U * gt, ae.yb = K - U * wt), le === "pixels" ? (ae.x = Ae, ae.l = ir * ft, ae.r = ir * rt) : (ae.l = Ct * ft, ae.r = Ct * rt, ae.xl = Ae - se * ft, ae.xr = Ae + se * rt)) : (ne === "pixels" ? (ae.x = Ae, ae.l = Ie * ft, ae.r = Ie * rt) : (ae.l = ae.r = 0, ae.xl = Ae + U * ft, ae.xr = Ae - U * rt), le === "pixels" ? (ae.y = 1 - K, ae.t = ir * gt, ae.b = ir * wt) : (ae.t = Ct * gt, ae.b = Ct * wt, ae.yt = K - se * gt, ae.yb = K + se * wt));
                  var pt = ie.y < 0.5 ? "b" : "t", dt = ie.x < 0.5 ? "l" : "r";
                  ce._fullLayout._reservedMargin[ie._id] = {};
                  var St = {
                    r: _.width - Sr - pr,
                    l: Sr + ae.r,
                    b: _.height - Yr - kr,
                    t: Yr + ae.b
                  };
                  oe && ee ? f.autoMargin(ce, ie._id, ae) : oe ? ce._fullLayout._reservedMargin[ie._id][pt] = St[pt] : ee || X ? ce._fullLayout._reservedMargin[ie._id][dt] = St[dt] : ce._fullLayout._reservedMargin[ie._id][pt] = St[pt];
                }
                return C.syncOrAsync([f.previousPromises, nt, Nt, it, f.previousPromises, At], ce);
              }
              function z(q, ie, ce) {
                var X = ie.orientation === "v", U = ce._fullLayout, ne = U._size, se, le, ue;
                y.init({
                  element: q.node(),
                  gd: ce,
                  prepFn: function() {
                    se = q.attr("transform"), w(q);
                  },
                  moveFn: function(ve, be) {
                    q.attr("transform", se + m(ve, be)), le = y.align((X ? ie._uFrac : ie._vFrac) + ve / ne.w, X ? ie._thickFrac : ie._lenFrac, 0, 1, ie.xanchor), ue = y.align((X ? ie._vFrac : 1 - ie._uFrac) - be / ne.h, X ? ie._lenFrac : ie._thickFrac, 0, 1, ie.yanchor);
                    var Me = y.getCursor(le, ue, ie.xanchor, ie.yanchor);
                    w(q, Me);
                  },
                  doneFn: function() {
                    if (w(q), le !== void 0 && ue !== void 0) {
                      var ve = {};
                      ve[ie._propPrefix + "x"] = le, ve[ie._propPrefix + "y"] = ue, ie._traceIndex !== void 0 ? p.call("_guiRestyle", ce, ve, ie._traceIndex) : p.call("_guiRelayout", ce, ve);
                    }
                  }
                });
              }
              function Z(q, ie, ce) {
                var X = ie._levels, U = [], ne = [], se, le, ue = X.end + X.size / 100, ve = X.size, be = 1.001 * ce[0] - 1e-3 * ce[1], Me = 1.001 * ce[1] - 1e-3 * ce[0];
                for (le = 0; le < 1e5 && (se = X.start + le * ve, !(ve > 0 ? se >= ue : se <= ue)); le++)
                  se > be && se < Me && U.push(se);
                if (ie._fillgradient)
                  ne = [0];
                else if (typeof ie._fillcolor == "function") {
                  var Ge = ie._filllevels;
                  if (Ge)
                    for (ue = Ge.end + Ge.size / 100, ve = Ge.size, le = 0; le < 1e5 && (se = Ge.start + le * ve, !(ve > 0 ? se >= ue : se <= ue)); le++)
                      se > ce[0] && se < ce[1] && ne.push(se);
                  else
                    ne = U.map(function(we) {
                      return we - X.size / 2;
                    }), ne.push(ne[ne.length - 1] + X.size);
                } else ie._fillcolor && typeof ie._fillcolor == "string" && (ne = [0]);
                return X.size < 0 && (U.reverse(), ne.reverse()), {
                  line: U,
                  fill: ne
                };
              }
              function W(q, ie, ce) {
                var X = q._fullLayout, U = ie.orientation === "v", ne = {
                  type: "linear",
                  range: ce,
                  tickmode: ie.tickmode,
                  nticks: ie.nticks,
                  tick0: ie.tick0,
                  dtick: ie.dtick,
                  tickvals: ie.tickvals,
                  ticktext: ie.ticktext,
                  ticks: ie.ticks,
                  ticklen: ie.ticklen,
                  tickwidth: ie.tickwidth,
                  tickcolor: ie.tickcolor,
                  showticklabels: ie.showticklabels,
                  labelalias: ie.labelalias,
                  ticklabelposition: ie.ticklabelposition,
                  ticklabeloverflow: ie.ticklabeloverflow,
                  ticklabelstep: ie.ticklabelstep,
                  tickfont: ie.tickfont,
                  tickangle: ie.tickangle,
                  tickformat: ie.tickformat,
                  exponentformat: ie.exponentformat,
                  minexponent: ie.minexponent,
                  separatethousands: ie.separatethousands,
                  showexponent: ie.showexponent,
                  showtickprefix: ie.showtickprefix,
                  tickprefix: ie.tickprefix,
                  showticksuffix: ie.showticksuffix,
                  ticksuffix: ie.ticksuffix,
                  title: ie.title,
                  showline: !0,
                  anchor: "free",
                  side: U ? "right" : "bottom",
                  position: 1
                }, se = U ? "y" : "x", le = {
                  type: "linear",
                  _id: se + ie._id
                }, ue = {
                  letter: se,
                  font: X.font,
                  noAutotickangles: se === "y",
                  noHover: !0,
                  noTickson: !0,
                  noTicklabelmode: !0,
                  noInsideRange: !0,
                  calendar: X.calendar
                  // not really necessary (yet?)
                };
                function ve(be, Me) {
                  return C.coerce(ne, le, I, be, Me);
                }
                return P(ne, le, ve, ue, X), k(ne, le, ve, ue), le;
              }
              s.exports = {
                draw: j
              };
            }
          ),
          /***/
          553: (
            /***/
            function(s, c, i) {
              var l = i(3400);
              s.exports = function(f) {
                return l.isPlainObject(f.colorbar);
              };
            }
          ),
          /***/
          5080: (
            /***/
            function(s, c, i) {
              s.exports = {
                moduleType: "component",
                name: "colorbar",
                attributes: i(616),
                supplyDefaults: i(4013),
                draw: i(7848).draw,
                hasColorbar: i(553)
              };
            }
          ),
          /***/
          9084: (
            /***/
            function(s, c, i) {
              var l = i(616), v = i(3756).counter, f = i(2996), p = i(8304).scales;
              f(p), s.exports = function(y, C) {
                y = y || "", C = C || {};
                var m = C.cLetter || "c";
                "onlyIfNumerical" in C && C.onlyIfNumerical;
                var h = "noScale" in C ? C.noScale : y === "marker.line", w = "showScaleDflt" in C ? C.showScaleDflt : m === "z", S = typeof C.colorscaleDflt == "string" ? p[C.colorscaleDflt] : null, E = C.editTypeOverride || "", x;
                "colorAttr" in C ? (x = C.colorAttr, C.colorAttr) : x = {
                  z: "z",
                  c: "color"
                }[m];
                var T = m + "auto", F = m + "min", P = m + "max", k = m + "mid", I = {};
                I[F] = I[P] = void 0;
                var L = {};
                L[T] = !1;
                var A = {};
                return x === "color" && (A.color = {
                  valType: "color",
                  arrayOk: !0,
                  editType: E || "style"
                }, C.anim && (A.color.anim = !0)), A[T] = {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc",
                  impliedEdits: I
                }, A[F] = {
                  valType: "number",
                  dflt: null,
                  editType: E || "plot",
                  impliedEdits: L
                }, A[P] = {
                  valType: "number",
                  dflt: null,
                  editType: E || "plot",
                  impliedEdits: L
                }, A[k] = {
                  valType: "number",
                  dflt: null,
                  editType: "calc",
                  impliedEdits: I
                }, A.colorscale = {
                  valType: "colorscale",
                  editType: "calc",
                  dflt: S,
                  impliedEdits: {
                    autocolorscale: !1
                  }
                }, A.autocolorscale = {
                  valType: "boolean",
                  // gets overrode in 'heatmap' & 'surface' for backwards comp.
                  dflt: C.autoColorDflt !== !1,
                  editType: "calc",
                  impliedEdits: {
                    colorscale: void 0
                  }
                }, A.reversescale = {
                  valType: "boolean",
                  dflt: !1,
                  editType: "plot"
                }, h || (A.showscale = {
                  valType: "boolean",
                  dflt: w,
                  editType: "calc"
                }, A.colorbar = l), C.noColorAxis || (A.coloraxis = {
                  valType: "subplotid",
                  regex: v("coloraxis"),
                  dflt: null,
                  editType: "calc"
                }), A;
              };
            }
          ),
          /***/
          7128: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = i(4288).extractOpts;
              s.exports = function(g, y, C) {
                var m = g._fullLayout, h = C.vals, w = C.containerStr, S = w ? v.nestedProperty(y, w).get() : y, E = f(S), x = E.auto !== !1, T = E.min, F = E.max, P = E.mid, k = function() {
                  return v.aggNums(Math.min, null, h);
                }, I = function() {
                  return v.aggNums(Math.max, null, h);
                };
                if (T === void 0 ? T = k() : x && (S._colorAx && l(T) ? T = Math.min(T, k()) : T = k()), F === void 0 ? F = I() : x && (S._colorAx && l(F) ? F = Math.max(F, I()) : F = I()), x && P !== void 0 && (F - P > P - T ? T = P - (F - P) : F - P < P - T && (F = P + (P - T))), T === F && (T -= 0.5, F += 0.5), E._sync("min", T), E._sync("max", F), E.autocolorscale) {
                  var L;
                  T * F < 0 ? L = m.colorscale.diverging : T >= 0 ? L = m.colorscale.sequential : L = m.colorscale.sequentialminus, E._sync("colorscale", L);
                }
              };
            }
          ),
          /***/
          5504: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4288).hasColorscale, f = i(4288).extractOpts;
              s.exports = function(g, y) {
                function C(T, F) {
                  var P = T["_" + F];
                  P !== void 0 && (T[F] = P);
                }
                function m(T, F) {
                  var P = F.container ? l.nestedProperty(T, F.container).get() : T;
                  if (P)
                    if (P.coloraxis)
                      P._colorAx = y[P.coloraxis];
                    else {
                      var k = f(P), I = k.auto;
                      (I || k.min === void 0) && C(P, F.min), (I || k.max === void 0) && C(P, F.max), k.autocolorscale && C(P, "colorscale");
                    }
                }
                for (var h = 0; h < g.length; h++) {
                  var w = g[h], S = w._module.colorbar;
                  if (S)
                    if (Array.isArray(S))
                      for (var E = 0; E < S.length; E++)
                        m(w, S[E]);
                    else
                      m(w, S);
                  v(w, "marker.line") && m(w, {
                    container: "marker.line",
                    min: "cmin",
                    max: "cmax"
                  });
                }
                for (var x in y._colorAxes)
                  m(y[x], {
                    min: "cmin",
                    max: "cmax"
                  });
              };
            }
          ),
          /***/
          7260: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = i(553), p = i(4013), g = i(8304).isValid, y = i(4040).traceIs;
              function C(m, h) {
                var w = h.slice(0, h.length - 1);
                return h ? v.nestedProperty(m, w).get() || {} : m;
              }
              s.exports = function m(h, w, S, E, x) {
                var T = x.prefix, F = x.cLetter, P = "_module" in w, k = C(h, T), I = C(w, T), L = C(w._template || {}, T) || {}, A = function() {
                  return delete h.coloraxis, delete w.coloraxis, m(h, w, S, E, x);
                };
                if (P) {
                  var O = S._colorAxes || {}, N = E(T + "coloraxis");
                  if (N) {
                    var Y = y(w, "contour") && v.nestedProperty(w, "contours.coloring").get() || "heatmap", j = O[N];
                    j ? (j[2].push(A), j[0] !== Y && (j[0] = !1, v.warn(["Ignoring coloraxis:", N, "setting", "as it is linked to incompatible colorscales."].join(" ")))) : O[N] = [Y, w, [A]];
                    return;
                  }
                }
                var te = k[F + "min"], re = k[F + "max"], z = l(te) && l(re) && te < re, Z = E(T + F + "auto", !z);
                Z ? E(T + F + "mid") : (E(T + F + "min"), E(T + F + "max"));
                var W = k.colorscale, q = L.colorscale, ie;
                if (W !== void 0 && (ie = !g(W)), q !== void 0 && (ie = !g(q)), E(T + "autocolorscale", ie), E(T + "colorscale"), E(T + "reversescale"), T !== "marker.line.") {
                  var ce;
                  T && P && (ce = f(k));
                  var X = E(T + "showscale", ce);
                  X && (T && L && (I._template = L), p(k, I, S));
                }
              };
            }
          ),
          /***/
          4288: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(9760), f = i(8248), p = i(3400), g = i(6308), y = i(8304).isValid;
              function C(P, k, I) {
                var L = k ? p.nestedProperty(P, k).get() || {} : P, A = L[I || "color"];
                A && A._inputArray && (A = A._inputArray);
                var O = !1;
                if (p.isArrayOrTypedArray(A)) {
                  for (var N = 0; N < A.length; N++)
                    if (f(A[N])) {
                      O = !0;
                      break;
                    }
                }
                return p.isPlainObject(L) && (O || L.showscale === !0 || f(L.cmin) && f(L.cmax) || y(L.colorscale) || p.isPlainObject(L.colorbar));
              }
              var m = ["showscale", "autocolorscale", "colorscale", "reversescale", "colorbar"], h = ["min", "max", "mid", "auto"];
              function w(P) {
                var k = P._colorAx, I = k || P, L = {}, A, O, N;
                for (O = 0; O < m.length; O++)
                  N = m[O], L[N] = I[N];
                if (k)
                  for (A = "c", O = 0; O < h.length; O++)
                    N = h[O], L[N] = I["c" + N];
                else {
                  var Y;
                  for (O = 0; O < h.length; O++) {
                    if (N = h[O], Y = "c" + N, Y in I) {
                      L[N] = I[Y];
                      continue;
                    }
                    Y = "z" + N, Y in I && (L[N] = I[Y]);
                  }
                  A = Y.charAt(0);
                }
                return L._sync = function(j, te) {
                  var re = h.indexOf(j) !== -1 ? A + j : j;
                  I[re] = I["_" + re] = te;
                }, L;
              }
              function S(P) {
                for (var k = w(P), I = k.min, L = k.max, A = k.reversescale ? E(k.colorscale) : k.colorscale, O = A.length, N = new Array(O), Y = new Array(O), j = 0; j < O; j++) {
                  var te = A[j];
                  N[j] = I + te[0] * (L - I), Y[j] = te[1];
                }
                return {
                  domain: N,
                  range: Y
                };
              }
              function E(P) {
                for (var k = P.length, I = new Array(k), L = k - 1, A = 0; L >= 0; L--, A++) {
                  var O = P[L];
                  I[A] = [1 - O[0], O[1]];
                }
                return I;
              }
              function x(P, k) {
                k = k || {};
                for (var I = P.domain, L = P.range, A = L.length, O = new Array(A), N = 0; N < A; N++) {
                  var Y = v(L[N]).toRgb();
                  O[N] = [Y.r, Y.g, Y.b, Y.a];
                }
                var j = l.scale.linear().domain(I).range(O).clamp(!0), te = k.noNumericCheck, re = k.returnArray, z;
                return te && re ? z = j : te ? z = function(Z) {
                  return F(j(Z));
                } : re ? z = function(Z) {
                  return f(Z) ? j(Z) : v(Z).isValid() ? Z : g.defaultLine;
                } : z = function(Z) {
                  return f(Z) ? F(j(Z)) : v(Z).isValid() ? Z : g.defaultLine;
                }, z.domain = j.domain, z.range = function() {
                  return L;
                }, z;
              }
              function T(P, k) {
                return x(S(P), k);
              }
              function F(P) {
                var k = {
                  r: P[0],
                  g: P[1],
                  b: P[2],
                  a: P[3]
                };
                return v(k).toRgbString();
              }
              s.exports = {
                hasColorscale: C,
                extractOpts: w,
                extractScale: S,
                flipScale: E,
                makeColorScaleFunc: x,
                makeColorScaleFuncFromTrace: T
              };
            }
          ),
          /***/
          8932: (
            /***/
            function(s, c, i) {
              var l = i(8304), v = i(4288);
              s.exports = {
                moduleType: "component",
                name: "colorscale",
                attributes: i(9084),
                layoutAttributes: i(2332),
                supplyLayoutDefaults: i(1608),
                handleDefaults: i(7260),
                crossTraceDefaults: i(5504),
                calc: i(7128),
                // ./scales.js is required in lib/coerce.js ;
                // it needs to be a separate module to avoid a circular dependency
                scales: l.scales,
                defaultScale: l.defaultScale,
                getScale: l.get,
                isValidScale: l.isValid,
                hasColorscale: v.hasColorscale,
                extractOpts: v.extractOpts,
                extractScale: v.extractScale,
                flipScale: v.flipScale,
                makeColorScaleFunc: v.makeColorScaleFunc,
                makeColorScaleFuncFromTrace: v.makeColorScaleFuncFromTrace
              };
            }
          ),
          /***/
          2332: (
            /***/
            function(s, c, i) {
              var l = i(2880).extendFlat, v = i(9084), f = i(8304).scales;
              s.exports = {
                editType: "calc",
                colorscale: {
                  editType: "calc",
                  sequential: {
                    valType: "colorscale",
                    dflt: f.Reds,
                    editType: "calc"
                  },
                  sequentialminus: {
                    valType: "colorscale",
                    dflt: f.Blues,
                    editType: "calc"
                  },
                  diverging: {
                    valType: "colorscale",
                    dflt: f.RdBu,
                    editType: "calc"
                  }
                },
                coloraxis: l({
                  // not really a 'subplot' attribute container,
                  // but this is the flag we use to denote attributes that
                  // support yaxis, yaxis2, yaxis3, ... counters
                  _isSubplotObj: !0,
                  editType: "calc"
                }, v("", {
                  colorAttr: "corresponding trace color array(s)",
                  noColorAxis: !0,
                  showScaleDflt: !0
                }))
              };
            }
          ),
          /***/
          1608: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(1780), f = i(2332), p = i(7260);
              s.exports = function(y, C) {
                function m(P, k) {
                  return l.coerce(y, C, f, P, k);
                }
                m("colorscale.sequential"), m("colorscale.sequentialminus"), m("colorscale.diverging");
                var h = C._colorAxes, w, S;
                function E(P, k) {
                  return l.coerce(w, S, f.coloraxis, P, k);
                }
                for (var x in h) {
                  var T = h[x];
                  if (T[0])
                    w = y[x] || {}, S = v.newContainer(C, x, "coloraxis"), S._name = x, p(w, S, C, E, {
                      prefix: "",
                      cLetter: "c"
                    });
                  else {
                    for (var F = 0; F < T[2].length; F++)
                      T[2][F]();
                    delete C._colorAxes[x];
                  }
                }
              };
            }
          ),
          /***/
          8304: (
            /***/
            function(s, c, i) {
              var l = i(9760), v = {
                Greys: [[0, "rgb(0,0,0)"], [1, "rgb(255,255,255)"]],
                YlGnBu: [[0, "rgb(8,29,88)"], [0.125, "rgb(37,52,148)"], [0.25, "rgb(34,94,168)"], [0.375, "rgb(29,145,192)"], [0.5, "rgb(65,182,196)"], [0.625, "rgb(127,205,187)"], [0.75, "rgb(199,233,180)"], [0.875, "rgb(237,248,217)"], [1, "rgb(255,255,217)"]],
                Greens: [[0, "rgb(0,68,27)"], [0.125, "rgb(0,109,44)"], [0.25, "rgb(35,139,69)"], [0.375, "rgb(65,171,93)"], [0.5, "rgb(116,196,118)"], [0.625, "rgb(161,217,155)"], [0.75, "rgb(199,233,192)"], [0.875, "rgb(229,245,224)"], [1, "rgb(247,252,245)"]],
                YlOrRd: [[0, "rgb(128,0,38)"], [0.125, "rgb(189,0,38)"], [0.25, "rgb(227,26,28)"], [0.375, "rgb(252,78,42)"], [0.5, "rgb(253,141,60)"], [0.625, "rgb(254,178,76)"], [0.75, "rgb(254,217,118)"], [0.875, "rgb(255,237,160)"], [1, "rgb(255,255,204)"]],
                Bluered: [[0, "rgb(0,0,255)"], [1, "rgb(255,0,0)"]],
                // modified RdBu based on
                // http://www.kennethmoreland.com/color-maps/
                RdBu: [[0, "rgb(5,10,172)"], [0.35, "rgb(106,137,247)"], [0.5, "rgb(190,190,190)"], [0.6, "rgb(220,170,132)"], [0.7, "rgb(230,145,90)"], [1, "rgb(178,10,28)"]],
                // Scale for non-negative numeric values
                Reds: [[0, "rgb(220,220,220)"], [0.2, "rgb(245,195,157)"], [0.4, "rgb(245,160,105)"], [1, "rgb(178,10,28)"]],
                // Scale for non-positive numeric values
                Blues: [[0, "rgb(5,10,172)"], [0.35, "rgb(40,60,190)"], [0.5, "rgb(70,100,245)"], [0.6, "rgb(90,120,245)"], [0.7, "rgb(106,137,247)"], [1, "rgb(220,220,220)"]],
                Picnic: [[0, "rgb(0,0,255)"], [0.1, "rgb(51,153,255)"], [0.2, "rgb(102,204,255)"], [0.3, "rgb(153,204,255)"], [0.4, "rgb(204,204,255)"], [0.5, "rgb(255,255,255)"], [0.6, "rgb(255,204,255)"], [0.7, "rgb(255,153,255)"], [0.8, "rgb(255,102,204)"], [0.9, "rgb(255,102,102)"], [1, "rgb(255,0,0)"]],
                Rainbow: [[0, "rgb(150,0,90)"], [0.125, "rgb(0,0,200)"], [0.25, "rgb(0,25,255)"], [0.375, "rgb(0,152,255)"], [0.5, "rgb(44,255,150)"], [0.625, "rgb(151,255,0)"], [0.75, "rgb(255,234,0)"], [0.875, "rgb(255,111,0)"], [1, "rgb(255,0,0)"]],
                Portland: [[0, "rgb(12,51,131)"], [0.25, "rgb(10,136,186)"], [0.5, "rgb(242,211,56)"], [0.75, "rgb(242,143,56)"], [1, "rgb(217,30,30)"]],
                Jet: [[0, "rgb(0,0,131)"], [0.125, "rgb(0,60,170)"], [0.375, "rgb(5,255,255)"], [0.625, "rgb(255,255,0)"], [0.875, "rgb(250,0,0)"], [1, "rgb(128,0,0)"]],
                Hot: [[0, "rgb(0,0,0)"], [0.3, "rgb(230,0,0)"], [0.6, "rgb(255,210,0)"], [1, "rgb(255,255,255)"]],
                Blackbody: [[0, "rgb(0,0,0)"], [0.2, "rgb(230,0,0)"], [0.4, "rgb(230,210,0)"], [0.7, "rgb(255,255,255)"], [1, "rgb(160,200,255)"]],
                Earth: [[0, "rgb(0,0,130)"], [0.1, "rgb(0,180,180)"], [0.2, "rgb(40,210,40)"], [0.4, "rgb(230,230,50)"], [0.6, "rgb(120,70,20)"], [1, "rgb(255,255,255)"]],
                Electric: [[0, "rgb(0,0,0)"], [0.15, "rgb(30,0,100)"], [0.4, "rgb(120,0,100)"], [0.6, "rgb(160,90,0)"], [0.8, "rgb(230,200,0)"], [1, "rgb(255,250,220)"]],
                Viridis: [[0, "#440154"], [0.06274509803921569, "#48186a"], [0.12549019607843137, "#472d7b"], [0.18823529411764706, "#424086"], [0.25098039215686274, "#3b528b"], [0.3137254901960784, "#33638d"], [0.3764705882352941, "#2c728e"], [0.4392156862745098, "#26828e"], [0.5019607843137255, "#21918c"], [0.5647058823529412, "#1fa088"], [0.6274509803921569, "#28ae80"], [0.6901960784313725, "#3fbc73"], [0.7529411764705882, "#5ec962"], [0.8156862745098039, "#84d44b"], [0.8784313725490196, "#addc30"], [0.9411764705882353, "#d8e219"], [1, "#fde725"]],
                Cividis: [[0, "rgb(0,32,76)"], [0.058824, "rgb(0,42,102)"], [0.117647, "rgb(0,52,110)"], [0.176471, "rgb(39,63,108)"], [0.235294, "rgb(60,74,107)"], [0.294118, "rgb(76,85,107)"], [0.352941, "rgb(91,95,109)"], [0.411765, "rgb(104,106,112)"], [0.470588, "rgb(117,117,117)"], [0.529412, "rgb(131,129,120)"], [0.588235, "rgb(146,140,120)"], [0.647059, "rgb(161,152,118)"], [0.705882, "rgb(176,165,114)"], [0.764706, "rgb(192,177,109)"], [0.823529, "rgb(209,191,102)"], [0.882353, "rgb(225,204,92)"], [0.941176, "rgb(243,219,79)"], [1, "rgb(255,233,69)"]]
              }, f = v.RdBu;
              function p(C, m) {
                if (m || (m = f), !C) return m;
                function h() {
                  try {
                    C = v[C] || JSON.parse(C);
                  } catch {
                    C = m;
                  }
                }
                return typeof C == "string" && (h(), typeof C == "string" && h()), g(C) ? C : m;
              }
              function g(C) {
                var m = 0;
                if (!Array.isArray(C) || C.length < 2 || !C[0] || !C[C.length - 1] || +C[0][0] != 0 || +C[C.length - 1][0] != 1) return !1;
                for (var h = 0; h < C.length; h++) {
                  var w = C[h];
                  if (w.length !== 2 || +w[0] < m || !l(w[1]).isValid())
                    return !1;
                  m = +w[0];
                }
                return !0;
              }
              function y(C) {
                return v[C] !== void 0 ? !0 : g(C);
              }
              s.exports = {
                scales: v,
                defaultScale: f,
                get: p,
                isValid: y
              };
            }
          ),
          /***/
          8316: (
            /***/
            function(s) {
              s.exports = function(i, l, v, f, p) {
                var g = (i - v) / (f - v), y = g + l / (f - v), C = (g + y) / 2;
                return p === "left" || p === "bottom" ? g : p === "center" || p === "middle" ? C : p === "right" || p === "top" ? y : g < 0.6666666666666666 - C ? g : y > 1.3333333333333333 - C ? y : C;
              };
            }
          ),
          /***/
          7416: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = [["sw-resize", "s-resize", "se-resize"], ["w-resize", "move", "e-resize"], ["nw-resize", "n-resize", "ne-resize"]];
              s.exports = function(p, g, y, C) {
                return y === "left" ? p = 0 : y === "center" ? p = 1 : y === "right" ? p = 2 : p = l.constrain(Math.floor(p * 3), 0, 2), C === "bottom" ? g = 0 : C === "middle" ? g = 1 : C === "top" ? g = 2 : g = l.constrain(Math.floor(g * 3), 0, 2), v[g][p];
              };
            }
          ),
          /***/
          2760: (
            /***/
            function(s, c) {
              c.selectMode = function(i) {
                return i === "lasso" || i === "select";
              }, c.drawMode = function(i) {
                return i === "drawclosedpath" || i === "drawopenpath" || i === "drawline" || i === "drawrect" || i === "drawcircle";
              }, c.openMode = function(i) {
                return i === "drawline" || i === "drawopenpath";
              }, c.rectMode = function(i) {
                return i === "select" || i === "drawline" || i === "drawrect" || i === "drawcircle";
              }, c.freeMode = function(i) {
                return i === "lasso" || i === "drawclosedpath" || i === "drawopenpath";
              }, c.selectingOrDrawing = function(i) {
                return c.freeMode(i) || c.rectMode(i);
              };
            }
          ),
          /***/
          6476: (
            /***/
            function(s, c, i) {
              var l = i(9128), v = i(2264), f = i(9184), p = i(3400).removeElement, g = i(3816), y = s.exports = {};
              y.align = i(8316), y.getCursor = i(7416);
              var C = i(2616);
              y.unhover = C.wrapped, y.unhoverRaw = C.raw, y.init = function(S) {
                var E = S.gd, x = 1, T = E._context.doubleClickDelay, F = S.element, P, k, I, L, A, O, N, Y;
                E._mouseDownTime || (E._mouseDownTime = 0), F.style.pointerEvents = "all", F.onmousedown = re, f ? (F._ontouchstart && F.removeEventListener("touchstart", F._ontouchstart), F._ontouchstart = re, F.addEventListener("touchstart", re, {
                  passive: !1
                })) : F.ontouchstart = re;
                function j(W, q, ie) {
                  return Math.abs(W) < ie && (W = 0), Math.abs(q) < ie && (q = 0), [W, q];
                }
                var te = S.clampFn || j;
                function re(W) {
                  E._dragged = !1, E._dragging = !0;
                  var q = h(W);
                  P = q[0], k = q[1], N = W.target, O = W, Y = W.buttons === 2 || W.ctrlKey, typeof W.clientX > "u" && typeof W.clientY > "u" && (W.clientX = P, W.clientY = k), I = (/* @__PURE__ */ new Date()).getTime(), I - E._mouseDownTime < T ? x += 1 : (x = 1, E._mouseDownTime = I), S.prepFn && S.prepFn(W, P, k), v && !Y ? (A = m(), A.style.cursor = window.getComputedStyle(F).cursor) : v || (A = document, L = window.getComputedStyle(document.documentElement).cursor, document.documentElement.style.cursor = window.getComputedStyle(F).cursor), document.addEventListener("mouseup", Z), document.addEventListener("touchend", Z), S.dragmode !== !1 && (W.preventDefault(), document.addEventListener("mousemove", z), document.addEventListener("touchmove", z, {
                    passive: !1
                  }));
                }
                function z(W) {
                  W.preventDefault();
                  var q = h(W), ie = S.minDrag || g.MINDRAG, ce = te(q[0] - P, q[1] - k, ie), X = ce[0], U = ce[1];
                  (X || U) && (E._dragged = !0, y.unhover(E, W)), E._dragged && S.moveFn && !Y && (E._dragdata = {
                    element: F,
                    dx: X,
                    dy: U
                  }, S.moveFn(X, U));
                }
                function Z(W) {
                  if (delete E._dragdata, S.dragmode !== !1 && (W.preventDefault(), document.removeEventListener("mousemove", z), document.removeEventListener("touchmove", z)), document.removeEventListener("mouseup", Z), document.removeEventListener("touchend", Z), v ? p(A) : L && (A.documentElement.style.cursor = L, L = null), !E._dragging) {
                    E._dragged = !1;
                    return;
                  }
                  if (E._dragging = !1, (/* @__PURE__ */ new Date()).getTime() - E._mouseDownTime > T && (x = Math.max(x - 1, 1)), E._dragged)
                    S.doneFn && S.doneFn();
                  else if (S.clickFn && S.clickFn(x, O), !Y) {
                    var q;
                    try {
                      q = new MouseEvent("click", W);
                    } catch {
                      var ie = h(W);
                      q = document.createEvent("MouseEvents"), q.initMouseEvent("click", W.bubbles, W.cancelable, W.view, W.detail, W.screenX, W.screenY, ie[0], ie[1], W.ctrlKey, W.altKey, W.shiftKey, W.metaKey, W.button, W.relatedTarget);
                    }
                    N.dispatchEvent(q);
                  }
                  E._dragging = !1, E._dragged = !1;
                }
              };
              function m() {
                var w = document.createElement("div");
                w.className = "dragcover";
                var S = w.style;
                return S.position = "fixed", S.left = 0, S.right = 0, S.top = 0, S.bottom = 0, S.zIndex = 999999999, S.background = "none", document.body.appendChild(w), w;
              }
              y.coverSlip = m;
              function h(w) {
                return l(w.changedTouches ? w.changedTouches[0] : w, document.body);
              }
            }
          ),
          /***/
          2616: (
            /***/
            function(s, c, i) {
              var l = i(5924), v = i(1200), f = i(2200).getGraphDiv, p = i(2456), g = s.exports = {};
              g.wrapped = function(y, C, m) {
                y = f(y), y._fullLayout && v.clear(y._fullLayout._uid + p.HOVERID), g.raw(y, C, m);
              }, g.raw = function(C, m) {
                var h = C._fullLayout, w = C._hoverdata;
                m || (m = {}), !(m.target && !C._dragged && l.triggerHandler(C, "plotly_beforehover", m) === !1) && (h._hoverlayer.selectAll("g").remove(), h._hoverlayer.selectAll("line").remove(), h._hoverlayer.selectAll("circle").remove(), C._hoverdata = void 0, m.target && w && C.emit("plotly_unhover", {
                  event: m,
                  points: w
                }));
              };
            }
          ),
          /***/
          8192: (
            /***/
            function(s, c) {
              c.u = {
                valType: "string",
                // string type usually doesn't take values... this one should really be
                // a special type or at least a special coercion function, from the GUI
                // you only get these values but elsewhere the user can supply a list of
                // dash lengths in px, and it will be honored
                values: ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot"],
                dflt: "solid",
                editType: "style"
              }, c.c = {
                shape: {
                  valType: "enumerated",
                  values: ["", "/", "\\", "x", "-", "|", "+", "."],
                  dflt: "",
                  arrayOk: !0,
                  editType: "style"
                },
                fillmode: {
                  valType: "enumerated",
                  values: ["replace", "overlay"],
                  dflt: "replace",
                  editType: "style"
                },
                bgcolor: {
                  valType: "color",
                  arrayOk: !0,
                  editType: "style"
                },
                fgcolor: {
                  valType: "color",
                  arrayOk: !0,
                  editType: "style"
                },
                fgopacity: {
                  valType: "number",
                  editType: "style",
                  min: 0,
                  max: 1
                },
                size: {
                  valType: "number",
                  min: 0,
                  dflt: 8,
                  arrayOk: !0,
                  editType: "style"
                },
                solidity: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 0.3,
                  arrayOk: !0,
                  editType: "style"
                },
                editType: "style"
              };
            }
          ),
          /***/
          3616: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3400), f = v.numberFormat, p = i(8248), g = i(9760), y = i(4040), C = i(6308), m = i(8932), h = v.strTranslate, w = i(2736), S = i(9616), E = i(4284), x = E.LINE_SPACING, T = i(3448).DESELECTDIM, F = i(3028), P = i(7152), k = i(624).appendArrayPointValue, I = s.exports = {};
              I.font = function(De, Ne) {
                var Ie = Ne.variant, Ue = Ne.style, ot = Ne.weight, ct = Ne.color, Tt = Ne.size, kt = Ne.family, Ot = Ne.shadow, Rt = Ne.lineposition, xt = Ne.textcase;
                kt && De.style("font-family", kt), Tt + 1 && De.style("font-size", Tt + "px"), ct && De.call(C.fill, ct), ot && De.style("font-weight", ot), Ue && De.style("font-style", Ue), Ie && De.style("font-variant", Ie), xt && De.style("text-transform", L(O(xt))), Ot && De.style("text-shadow", Ot === "auto" ? w.makeTextShadow(C.contrast(ct)) : L(Ot)), Rt && De.style("text-decoration-line", L(N(Rt)));
              };
              function L(De) {
                return De === "none" ? void 0 : De;
              }
              var A = {
                normal: "none",
                lower: "lowercase",
                upper: "uppercase",
                "word caps": "capitalize"
              };
              function O(De) {
                return A[De];
              }
              function N(De) {
                return De.replace("under", "underline").replace("over", "overline").replace("through", "line-through").split("+").join(" ");
              }
              I.setPosition = function(De, Ne, Ie) {
                De.attr("x", Ne).attr("y", Ie);
              }, I.setSize = function(De, Ne, Ie) {
                De.attr("width", Ne).attr("height", Ie);
              }, I.setRect = function(De, Ne, Ie, Ue, ot) {
                De.call(I.setPosition, Ne, Ie).call(I.setSize, Ue, ot);
              }, I.translatePoint = function(De, Ne, Ie, Ue) {
                var ot = Ie.c2p(De.x), ct = Ue.c2p(De.y);
                if (p(ot) && p(ct) && Ne.node())
                  Ne.node().nodeName === "text" ? Ne.attr("x", ot).attr("y", ct) : Ne.attr("transform", h(ot, ct));
                else
                  return !1;
                return !0;
              }, I.translatePoints = function(De, Ne, Ie) {
                De.each(function(Ue) {
                  var ot = l.select(this);
                  I.translatePoint(Ue, ot, Ne, Ie);
                });
              }, I.hideOutsideRangePoint = function(De, Ne, Ie, Ue, ot, ct) {
                Ne.attr("display", Ie.isPtWithinRange(De, ot) && Ue.isPtWithinRange(De, ct) ? null : "none");
              }, I.hideOutsideRangePoints = function(De, Ne) {
                if (Ne._hasClipOnAxisFalse) {
                  var Ie = Ne.xaxis, Ue = Ne.yaxis;
                  De.each(function(ot) {
                    var ct = ot[0].trace, Tt = ct.xcalendar, kt = ct.ycalendar, Ot = y.traceIs(ct, "bar-like") ? ".bartext" : ".point,.textpoint";
                    De.selectAll(Ot).each(function(Rt) {
                      I.hideOutsideRangePoint(Rt, l.select(this), Ie, Ue, Tt, kt);
                    });
                  });
                }
              }, I.crispRound = function(De, Ne, Ie) {
                return !Ne || !p(Ne) ? Ie || 0 : De._context.staticPlot ? Ne : Ne < 1 ? 1 : Math.round(Ne);
              }, I.singleLineStyle = function(De, Ne, Ie, Ue, ot) {
                Ne.style("fill", "none");
                var ct = (((De || [])[0] || {}).trace || {}).line || {}, Tt = Ie || ct.width || 0, kt = ot || ct.dash || "";
                C.stroke(Ne, Ue || ct.color), I.dashLine(Ne, kt, Tt);
              }, I.lineGroupStyle = function(De, Ne, Ie, Ue) {
                De.style("fill", "none").each(function(ot) {
                  var ct = (((ot || [])[0] || {}).trace || {}).line || {}, Tt = Ne || ct.width || 0, kt = Ue || ct.dash || "";
                  l.select(this).call(C.stroke, Ie || ct.color).call(I.dashLine, kt, Tt);
                });
              }, I.dashLine = function(De, Ne, Ie) {
                Ie = +Ie || 0, Ne = I.dashStyle(Ne, Ie), De.style({
                  "stroke-dasharray": Ne,
                  "stroke-width": Ie + "px"
                });
              }, I.dashStyle = function(De, Ne) {
                Ne = +Ne || 1;
                var Ie = Math.max(Ne, 3);
                return De === "solid" ? De = "" : De === "dot" ? De = Ie + "px," + Ie + "px" : De === "dash" ? De = 3 * Ie + "px," + 3 * Ie + "px" : De === "longdash" ? De = 5 * Ie + "px," + 5 * Ie + "px" : De === "dashdot" ? De = 3 * Ie + "px," + Ie + "px," + Ie + "px," + Ie + "px" : De === "longdashdot" && (De = 5 * Ie + "px," + 2 * Ie + "px," + Ie + "px," + 2 * Ie + "px"), De;
              };
              function Y(De, Ne, Ie, Ue) {
                var ot = Ne.fillpattern, ct = Ne.fillgradient, Tt = ot && I.getPatternAttr(ot.shape, 0, "");
                if (Tt) {
                  var kt = I.getPatternAttr(ot.bgcolor, 0, null), Ot = I.getPatternAttr(ot.fgcolor, 0, null), Rt = ot.fgopacity, xt = I.getPatternAttr(ot.size, 0, 8), Wt = I.getPatternAttr(ot.solidity, 0, 0.3), bt = Ne.uid;
                  I.pattern(De, "point", Ie, bt, Tt, xt, Wt, void 0, ot.fillmode, kt, Ot, Rt);
                } else if (ct && ct.type !== "none") {
                  var jt = ct.type, qt = "scatterfill-" + Ne.uid;
                  if (Ue && (qt = "legendfill-" + Ne.uid), !Ue && (ct.start !== void 0 || ct.stop !== void 0)) {
                    var Yt, Ut;
                    jt === "horizontal" ? (Yt = {
                      x: ct.start,
                      y: 0
                    }, Ut = {
                      x: ct.stop,
                      y: 0
                    }) : jt === "vertical" && (Yt = {
                      x: 0,
                      y: ct.start
                    }, Ut = {
                      x: 0,
                      y: ct.stop
                    }), Yt.x = Ne._xA.c2p(Yt.x === void 0 ? Ne._extremes.x.min[0].val : Yt.x, !0), Yt.y = Ne._yA.c2p(Yt.y === void 0 ? Ne._extremes.y.min[0].val : Yt.y, !0), Ut.x = Ne._xA.c2p(Ut.x === void 0 ? Ne._extremes.x.max[0].val : Ut.x, !0), Ut.y = Ne._yA.c2p(Ut.y === void 0 ? Ne._extremes.y.max[0].val : Ut.y, !0), De.call(q, Ie, qt, "linear", ct.colorscale, "fill", Yt, Ut, !0, !1);
                  } else
                    jt === "horizontal" && (jt = jt + "reversed"), De.call(I.gradient, Ie, qt, jt, ct.colorscale, "fill");
                } else Ne.fillcolor && De.call(C.fill, Ne.fillcolor);
              }
              I.singleFillStyle = function(De, Ne) {
                var Ie = l.select(De.node()), Ue = Ie.data(), ot = ((Ue[0] || [])[0] || {}).trace || {};
                Y(De, ot, Ne, !1);
              }, I.fillGroupStyle = function(De, Ne, Ie) {
                De.style("stroke-width", 0).each(function(Ue) {
                  var ot = l.select(this);
                  Ue[0].trace && Y(ot, Ue[0].trace, Ne, Ie);
                });
              };
              var j = i(1984);
              I.symbolNames = [], I.symbolFuncs = [], I.symbolBackOffs = [], I.symbolNeedLines = {}, I.symbolNoDot = {}, I.symbolNoFill = {}, I.symbolList = [], Object.keys(j).forEach(function(De) {
                var Ne = j[De], Ie = Ne.n;
                I.symbolList.push(Ie, String(Ie), De, Ie + 100, String(Ie + 100), De + "-open"), I.symbolNames[Ie] = De, I.symbolFuncs[Ie] = Ne.f, I.symbolBackOffs[Ie] = Ne.backoff || 0, Ne.needLine && (I.symbolNeedLines[Ie] = !0), Ne.noDot ? I.symbolNoDot[Ie] = !0 : I.symbolList.push(Ie + 200, String(Ie + 200), De + "-dot", Ie + 300, String(Ie + 300), De + "-open-dot"), Ne.noFill && (I.symbolNoFill[Ie] = !0);
              });
              var te = I.symbolNames.length, re = "M0,0.5L0.5,0L0,-0.5L-0.5,0Z";
              I.symbolNumber = function(De) {
                if (p(De))
                  De = +De;
                else if (typeof De == "string") {
                  var Ne = 0;
                  De.indexOf("-open") > 0 && (Ne = 100, De = De.replace("-open", "")), De.indexOf("-dot") > 0 && (Ne += 200, De = De.replace("-dot", "")), De = I.symbolNames.indexOf(De), De >= 0 && (De += Ne);
                }
                return De % 100 >= te || De >= 400 ? 0 : Math.floor(Math.max(De, 0));
              };
              function z(De, Ne, Ie, Ue) {
                var ot = De % 100;
                return I.symbolFuncs[ot](Ne, Ie, Ue) + (De >= 200 ? re : "");
              }
              var Z = f("~f"), W = {
                radial: {
                  type: "radial"
                },
                radialreversed: {
                  type: "radial",
                  reversed: !0
                },
                horizontal: {
                  type: "linear",
                  start: {
                    x: 1,
                    y: 0
                  },
                  stop: {
                    x: 0,
                    y: 0
                  }
                },
                horizontalreversed: {
                  type: "linear",
                  start: {
                    x: 1,
                    y: 0
                  },
                  stop: {
                    x: 0,
                    y: 0
                  },
                  reversed: !0
                },
                vertical: {
                  type: "linear",
                  start: {
                    x: 0,
                    y: 1
                  },
                  stop: {
                    x: 0,
                    y: 0
                  }
                },
                verticalreversed: {
                  type: "linear",
                  start: {
                    x: 0,
                    y: 1
                  },
                  stop: {
                    x: 0,
                    y: 0
                  },
                  reversed: !0
                }
              };
              I.gradient = function(De, Ne, Ie, Ue, ot, ct) {
                var Tt = W[Ue];
                return q(De, Ne, Ie, Tt.type, ot, ct, Tt.start, Tt.stop, !1, Tt.reversed);
              };
              function q(De, Ne, Ie, Ue, ot, ct, Tt, kt, Ot, Rt) {
                var xt = ot.length, Wt;
                Ue === "linear" ? Wt = {
                  node: "linearGradient",
                  attrs: {
                    x1: Tt.x,
                    y1: Tt.y,
                    x2: kt.x,
                    y2: kt.y,
                    gradientUnits: Ot ? "userSpaceOnUse" : "objectBoundingBox"
                  },
                  reversed: Rt
                } : Ue === "radial" && (Wt = {
                  node: "radialGradient",
                  reversed: Rt
                });
                for (var bt = new Array(xt), jt = 0; jt < xt; jt++)
                  Wt.reversed ? bt[xt - 1 - jt] = [Z((1 - ot[jt][0]) * 100), ot[jt][1]] : bt[jt] = [Z(ot[jt][0] * 100), ot[jt][1]];
                var qt = Ne._fullLayout, Yt = "g" + qt._uid + "-" + Ie, Ut = qt._defs.select(".gradients").selectAll("#" + Yt).data([Ue + bt.join(";")], v.identity);
                Ut.exit().remove(), Ut.enter().append(Wt.node).each(function() {
                  var tt = l.select(this);
                  Wt.attrs && tt.attr(Wt.attrs), tt.attr("id", Yt);
                  var ze = tt.selectAll("stop").data(bt);
                  ze.exit().remove(), ze.enter().append("stop"), ze.each(function(_e) {
                    var Ye = g(_e[1]);
                    l.select(this).attr({
                      offset: _e[0] + "%",
                      "stop-color": C.tinyRGB(Ye),
                      "stop-opacity": Ye.getAlpha()
                    });
                  });
                }), De.style(ct, ee(Yt, Ne)).style(ct + "-opacity", null), De.classed("gradient_filled", !0);
              }
              I.pattern = function(De, Ne, Ie, Ue, ot, ct, Tt, kt, Ot, Rt, xt, Wt) {
                var bt = Ne === "legend";
                kt && (Ot === "overlay" ? (Rt = kt, xt = C.contrast(Rt)) : (Rt = void 0, xt = kt));
                var jt = Ie._fullLayout, qt = "p" + jt._uid + "-" + Ue, Yt, Ut, tt = function(At, vt, ut, Pt, rr) {
                  return Pt + (rr - Pt) * (At - vt) / (ut - vt);
                }, ze, _e, Ye, lt, Te = {}, Oe = g(xt), je = C.tinyRGB(Oe), Xe = Oe.getAlpha(), nt = Wt * Xe;
                switch (ot) {
                  case "/":
                    Yt = ct * Math.sqrt(2), Ut = ct * Math.sqrt(2), ze = "M-" + Yt / 4 + "," + Ut / 4 + "l" + Yt / 2 + ",-" + Ut / 2 + "M0," + Ut + "L" + Yt + ",0M" + Yt / 4 * 3 + "," + Ut / 4 * 5 + "l" + Yt / 2 + ",-" + Ut / 2, _e = Tt * ct, lt = "path", Te = {
                      d: ze,
                      opacity: nt,
                      stroke: je,
                      "stroke-width": _e + "px"
                    };
                    break;
                  case "\\":
                    Yt = ct * Math.sqrt(2), Ut = ct * Math.sqrt(2), ze = "M" + Yt / 4 * 3 + ",-" + Ut / 4 + "l" + Yt / 2 + "," + Ut / 2 + "M0,0L" + Yt + "," + Ut + "M-" + Yt / 4 + "," + Ut / 4 * 3 + "l" + Yt / 2 + "," + Ut / 2, _e = Tt * ct, lt = "path", Te = {
                      d: ze,
                      opacity: nt,
                      stroke: je,
                      "stroke-width": _e + "px"
                    };
                    break;
                  case "x":
                    Yt = ct * Math.sqrt(2), Ut = ct * Math.sqrt(2), ze = "M-" + Yt / 4 + "," + Ut / 4 + "l" + Yt / 2 + ",-" + Ut / 2 + "M0," + Ut + "L" + Yt + ",0M" + Yt / 4 * 3 + "," + Ut / 4 * 5 + "l" + Yt / 2 + ",-" + Ut / 2 + "M" + Yt / 4 * 3 + ",-" + Ut / 4 + "l" + Yt / 2 + "," + Ut / 2 + "M0,0L" + Yt + "," + Ut + "M-" + Yt / 4 + "," + Ut / 4 * 3 + "l" + Yt / 2 + "," + Ut / 2, _e = ct - ct * Math.sqrt(1 - Tt), lt = "path", Te = {
                      d: ze,
                      opacity: nt,
                      stroke: je,
                      "stroke-width": _e + "px"
                    };
                    break;
                  case "|":
                    Yt = ct, Ut = ct, lt = "path", ze = "M" + Yt / 2 + ",0L" + Yt / 2 + "," + Ut, _e = Tt * ct, lt = "path", Te = {
                      d: ze,
                      opacity: nt,
                      stroke: je,
                      "stroke-width": _e + "px"
                    };
                    break;
                  case "-":
                    Yt = ct, Ut = ct, lt = "path", ze = "M0," + Ut / 2 + "L" + Yt + "," + Ut / 2, _e = Tt * ct, lt = "path", Te = {
                      d: ze,
                      opacity: nt,
                      stroke: je,
                      "stroke-width": _e + "px"
                    };
                    break;
                  case "+":
                    Yt = ct, Ut = ct, lt = "path", ze = "M" + Yt / 2 + ",0L" + Yt / 2 + "," + Ut + "M0," + Ut / 2 + "L" + Yt + "," + Ut / 2, _e = ct - ct * Math.sqrt(1 - Tt), lt = "path", Te = {
                      d: ze,
                      opacity: nt,
                      stroke: je,
                      "stroke-width": _e + "px"
                    };
                    break;
                  case ".":
                    Yt = ct, Ut = ct, Tt < Math.PI / 4 ? Ye = Math.sqrt(Tt * ct * ct / Math.PI) : Ye = tt(Tt, Math.PI / 4, 1, ct / 2, ct / Math.sqrt(2)), lt = "circle", Te = {
                      cx: Yt / 2,
                      cy: Ut / 2,
                      r: Ye,
                      opacity: nt,
                      fill: je
                    };
                    break;
                }
                var it = [ot || "noSh", Rt || "noBg", xt || "noFg", ct, Tt].join(";"), Nt = jt._defs.select(".patterns").selectAll("#" + qt).data([it], v.identity);
                Nt.exit().remove(), Nt.enter().append("pattern").each(function() {
                  var At = l.select(this);
                  if (At.attr({
                    id: qt,
                    width: Yt + "px",
                    height: Ut + "px",
                    patternUnits: "userSpaceOnUse",
                    // for legends scale down patterns just a bit so that default size (i.e 8) nicely fit in small icons
                    patternTransform: bt ? "scale(0.8)" : ""
                  }), Rt) {
                    var vt = g(Rt), ut = C.tinyRGB(vt), Pt = vt.getAlpha(), rr = At.selectAll("rect").data([0]);
                    rr.exit().remove(), rr.enter().append("rect").attr({
                      width: Yt + "px",
                      height: Ut + "px",
                      fill: ut,
                      "fill-opacity": Pt
                    });
                  }
                  var lr = At.selectAll(lt).data([0]);
                  lr.exit().remove(), lr.enter().append(lt).attr(Te);
                }), De.style("fill", ee(qt, Ie)).style("fill-opacity", null), De.classed("pattern_filled", !0);
              }, I.initGradients = function(De) {
                var Ne = De._fullLayout, Ie = v.ensureSingle(Ne._defs, "g", "gradients");
                Ie.selectAll("linearGradient,radialGradient").remove(), l.select(De).selectAll(".gradient_filled").classed("gradient_filled", !1);
              }, I.initPatterns = function(De) {
                var Ne = De._fullLayout, Ie = v.ensureSingle(Ne._defs, "g", "patterns");
                Ie.selectAll("pattern").remove(), l.select(De).selectAll(".pattern_filled").classed("pattern_filled", !1);
              }, I.getPatternAttr = function(De, Ne, Ie) {
                return De && v.isArrayOrTypedArray(De) ? Ne < De.length ? De[Ne] : Ie : De;
              }, I.pointStyle = function(De, Ne, Ie, Ue) {
                if (De.size()) {
                  var ot = I.makePointStyleFns(Ne);
                  De.each(function(ct) {
                    I.singlePointStyle(ct, l.select(this), Ne, ot, Ie, Ue);
                  });
                }
              }, I.singlePointStyle = function(De, Ne, Ie, Ue, ot, ct) {
                var Tt = Ie.marker, kt = Tt.line;
                if (ct && ct.i >= 0 && De.i === void 0 && (De.i = ct.i), Ne.style("opacity", Ue.selectedOpacityFn ? Ue.selectedOpacityFn(De) : De.mo === void 0 ? Tt.opacity : De.mo), Ue.ms2mrc) {
                  var Ot;
                  De.ms === "various" || Tt.size === "various" ? Ot = 3 : Ot = Ue.ms2mrc(De.ms), De.mrc = Ot, Ue.selectedSizeFn && (Ot = De.mrc = Ue.selectedSizeFn(De));
                  var Rt = I.symbolNumber(De.mx || Tt.symbol) || 0;
                  De.om = Rt % 200 >= 100;
                  var xt = at(De, Ie), Wt = V(De, Ie);
                  Ne.attr("d", z(Rt, Ot, xt, Wt));
                }
                var bt = !1, jt, qt, Yt;
                if (De.so)
                  Yt = kt.outlierwidth, qt = kt.outliercolor, jt = Tt.outliercolor;
                else {
                  var Ut = (kt || {}).width;
                  Yt = (De.mlw + 1 || Ut + 1 || // TODO: we need the latter for legends... can we get rid of it?
                  (De.trace ? (De.trace.marker.line || {}).width : 0) + 1) - 1 || 0, "mlc" in De ? qt = De.mlcc = Ue.lineScale(De.mlc) : v.isArrayOrTypedArray(kt.color) ? qt = C.defaultLine : qt = kt.color, v.isArrayOrTypedArray(Tt.color) && (jt = C.defaultLine, bt = !0), "mc" in De ? jt = De.mcc = Ue.markerScale(De.mc) : jt = Tt.color || Tt.colors || "rgba(0,0,0,0)", Ue.selectedColorFn && (jt = Ue.selectedColorFn(De));
                }
                if (De.om)
                  Ne.call(C.stroke, jt).style({
                    "stroke-width": (Yt || 1) + "px",
                    fill: "none"
                  });
                else {
                  Ne.style("stroke-width", (De.isBlank ? 0 : Yt) + "px");
                  var tt = Tt.gradient, ze = De.mgt;
                  ze ? bt = !0 : ze = tt && tt.type, v.isArrayOrTypedArray(ze) && (ze = ze[0], W[ze] || (ze = 0));
                  var _e = Tt.pattern, Ye = _e && I.getPatternAttr(_e.shape, De.i, "");
                  if (ze && ze !== "none") {
                    var lt = De.mgc;
                    lt ? bt = !0 : lt = tt.color;
                    var Te = Ie.uid;
                    bt && (Te += "-" + De.i), I.gradient(Ne, ot, Te, ze, [[0, lt], [1, jt]], "fill");
                  } else if (Ye) {
                    var Oe = !1, je = _e.fgcolor;
                    !je && ct && ct.color && (je = ct.color, Oe = !0);
                    var Xe = I.getPatternAttr(je, De.i, ct && ct.color || null), nt = I.getPatternAttr(_e.bgcolor, De.i, null), it = _e.fgopacity, Nt = I.getPatternAttr(_e.size, De.i, 8), At = I.getPatternAttr(_e.solidity, De.i, 0.3);
                    Oe = Oe || De.mcc || v.isArrayOrTypedArray(_e.shape) || v.isArrayOrTypedArray(_e.bgcolor) || v.isArrayOrTypedArray(_e.fgcolor) || v.isArrayOrTypedArray(_e.size) || v.isArrayOrTypedArray(_e.solidity);
                    var vt = Ie.uid;
                    Oe && (vt += "-" + De.i), I.pattern(Ne, "point", ot, vt, Ye, Nt, At, De.mcc, _e.fillmode, nt, Xe, it);
                  } else
                    v.isArrayOrTypedArray(jt) ? C.fill(Ne, jt[De.i]) : C.fill(Ne, jt);
                  Yt && C.stroke(Ne, qt);
                }
              }, I.makePointStyleFns = function(De) {
                var Ne = {}, Ie = De.marker;
                return Ne.markerScale = I.tryColorscale(Ie, ""), Ne.lineScale = I.tryColorscale(Ie, "line"), y.traceIs(De, "symbols") && (Ne.ms2mrc = F.isBubble(De) ? P(De) : function() {
                  return (Ie.size || 6) / 2;
                }), De.selectedpoints && v.extendFlat(Ne, I.makeSelectedPointStyleFns(De)), Ne;
              }, I.makeSelectedPointStyleFns = function(De) {
                var Ne = {}, Ie = De.selected || {}, Ue = De.unselected || {}, ot = De.marker || {}, ct = Ie.marker || {}, Tt = Ue.marker || {}, kt = ot.opacity, Ot = ct.opacity, Rt = Tt.opacity, xt = Ot !== void 0, Wt = Rt !== void 0;
                (v.isArrayOrTypedArray(kt) || xt || Wt) && (Ne.selectedOpacityFn = function(Ye) {
                  var lt = Ye.mo === void 0 ? ot.opacity : Ye.mo;
                  return Ye.selected ? xt ? Ot : lt : Wt ? Rt : T * lt;
                });
                var bt = ot.color, jt = ct.color, qt = Tt.color;
                (jt || qt) && (Ne.selectedColorFn = function(Ye) {
                  var lt = Ye.mcc || bt;
                  return Ye.selected ? jt || lt : qt || lt;
                });
                var Yt = ot.size, Ut = ct.size, tt = Tt.size, ze = Ut !== void 0, _e = tt !== void 0;
                return y.traceIs(De, "symbols") && (ze || _e) && (Ne.selectedSizeFn = function(Ye) {
                  var lt = Ye.mrc || Yt / 2;
                  return Ye.selected ? ze ? Ut / 2 : lt : _e ? tt / 2 : lt;
                }), Ne;
              }, I.makeSelectedTextStyleFns = function(De) {
                var Ne = {}, Ie = De.selected || {}, Ue = De.unselected || {}, ot = De.textfont || {}, ct = Ie.textfont || {}, Tt = Ue.textfont || {}, kt = ot.color, Ot = ct.color, Rt = Tt.color;
                return Ne.selectedTextColorFn = function(xt) {
                  var Wt = xt.tc || kt;
                  return xt.selected ? Ot || Wt : Rt || (Ot ? Wt : C.addOpacity(Wt, T));
                }, Ne;
              }, I.selectedPointStyle = function(De, Ne) {
                if (!(!De.size() || !Ne.selectedpoints)) {
                  var Ie = I.makeSelectedPointStyleFns(Ne), Ue = Ne.marker || {}, ot = [];
                  Ie.selectedOpacityFn && ot.push(function(ct, Tt) {
                    ct.style("opacity", Ie.selectedOpacityFn(Tt));
                  }), Ie.selectedColorFn && ot.push(function(ct, Tt) {
                    C.fill(ct, Ie.selectedColorFn(Tt));
                  }), Ie.selectedSizeFn && ot.push(function(ct, Tt) {
                    var kt = Tt.mx || Ue.symbol || 0, Ot = Ie.selectedSizeFn(Tt);
                    ct.attr("d", z(I.symbolNumber(kt), Ot, at(Tt, Ne), V(Tt, Ne))), Tt.mrc2 = Ot;
                  }), ot.length && De.each(function(ct) {
                    for (var Tt = l.select(this), kt = 0; kt < ot.length; kt++)
                      ot[kt](Tt, ct);
                  });
                }
              }, I.tryColorscale = function(De, Ne) {
                var Ie = Ne ? v.nestedProperty(De, Ne).get() : De;
                if (Ie) {
                  var Ue = Ie.color;
                  if ((Ie.colorscale || Ie._colorAx) && v.isArrayOrTypedArray(Ue))
                    return m.makeColorScaleFuncFromTrace(Ie);
                }
                return v.identity;
              };
              var ie = {
                start: 1,
                end: -1,
                middle: 0,
                bottom: 1,
                top: -1
              };
              function ce(De, Ne, Ie, Ue, ot) {
                var ct = l.select(De.node().parentNode), Tt = Ne.indexOf("top") !== -1 ? "top" : Ne.indexOf("bottom") !== -1 ? "bottom" : "middle", kt = Ne.indexOf("left") !== -1 ? "end" : Ne.indexOf("right") !== -1 ? "start" : "middle", Ot = Ue ? Ue / 0.8 + 1 : 0, Rt = (w.lineCount(De) - 1) * x + 1, xt = ie[kt] * Ot, Wt = Ie * 0.75 + ie[Tt] * Ot + (ie[Tt] - 1) * Rt * Ie / 2;
                De.attr("text-anchor", kt), ot || ct.attr("transform", h(xt, Wt));
              }
              function X(De, Ne) {
                var Ie = De.ts || Ne.textfont.size;
                return p(Ie) && Ie > 0 ? Ie : 0;
              }
              I.textPointStyle = function(De, Ne, Ie) {
                if (De.size()) {
                  var Ue;
                  if (Ne.selectedpoints) {
                    var ot = I.makeSelectedTextStyleFns(Ne);
                    Ue = ot.selectedTextColorFn;
                  }
                  var ct = Ne.texttemplate, Tt = Ie._fullLayout;
                  De.each(function(kt) {
                    var Ot = l.select(this), Rt = ct ? v.extractOption(kt, Ne, "txt", "texttemplate") : v.extractOption(kt, Ne, "tx", "text");
                    if (!Rt && Rt !== 0) {
                      Ot.remove();
                      return;
                    }
                    if (ct) {
                      var xt = Ne._module.formatLabels, Wt = xt ? xt(kt, Ne, Tt) : {}, bt = {};
                      k(bt, Ne, kt.i);
                      var jt = Ne._meta || {};
                      Rt = v.texttemplateString(Rt, Wt, Tt._d3locale, bt, kt, jt);
                    }
                    var qt = kt.tp || Ne.textposition, Yt = X(kt, Ne), Ut = Ue ? Ue(kt) : kt.tc || Ne.textfont.color;
                    Ot.call(I.font, {
                      family: kt.tf || Ne.textfont.family,
                      weight: kt.tw || Ne.textfont.weight,
                      style: kt.ty || Ne.textfont.style,
                      variant: kt.tv || Ne.textfont.variant,
                      textcase: kt.tC || Ne.textfont.textcase,
                      lineposition: kt.tE || Ne.textfont.lineposition,
                      shadow: kt.tS || Ne.textfont.shadow,
                      size: Yt,
                      color: Ut
                    }).text(Rt).call(w.convertToTspans, Ie).call(ce, qt, Yt, kt.mrc);
                  });
                }
              }, I.selectedTextStyle = function(De, Ne) {
                if (!(!De.size() || !Ne.selectedpoints)) {
                  var Ie = I.makeSelectedTextStyleFns(Ne);
                  De.each(function(Ue) {
                    var ot = l.select(this), ct = Ie.selectedTextColorFn(Ue), Tt = Ue.tp || Ne.textposition, kt = X(Ue, Ne);
                    C.fill(ot, ct);
                    var Ot = y.traceIs(Ne, "bar-like");
                    ce(ot, Tt, kt, Ue.mrc2 || Ue.mrc, Ot);
                  });
                }
              };
              var U = 0.5;
              I.smoothopen = function(De, Ne) {
                if (De.length < 3)
                  return "M" + De.join("L");
                var Ie = "M" + De[0], Ue = [], ot;
                for (ot = 1; ot < De.length - 1; ot++)
                  Ue.push(be(De[ot - 1], De[ot], De[ot + 1], Ne));
                for (Ie += "Q" + Ue[0][0] + " " + De[1], ot = 2; ot < De.length - 1; ot++)
                  Ie += "C" + Ue[ot - 2][1] + " " + Ue[ot - 1][0] + " " + De[ot];
                return Ie += "Q" + Ue[De.length - 3][1] + " " + De[De.length - 1], Ie;
              }, I.smoothclosed = function(De, Ne) {
                if (De.length < 3)
                  return "M" + De.join("L") + "Z";
                var Ie = "M" + De[0], Ue = De.length - 1, ot = [be(De[Ue], De[0], De[1], Ne)], ct;
                for (ct = 1; ct < Ue; ct++)
                  ot.push(be(De[ct - 1], De[ct], De[ct + 1], Ne));
                for (ot.push(be(De[Ue - 1], De[Ue], De[0], Ne)), ct = 1; ct <= Ue; ct++)
                  Ie += "C" + ot[ct - 1][1] + " " + ot[ct][0] + " " + De[ct];
                return Ie += "C" + ot[Ue][1] + " " + ot[0][0] + " " + De[0] + "Z", Ie;
              };
              var ne, se;
              function le(De, Ne, Ie) {
                return Ie && (De = we(De)), Ne ? ve(De[1]) : ue(De[0]);
              }
              function ue(De) {
                var Ne = l.round(De, 2);
                return ne = Ne, Ne;
              }
              function ve(De) {
                var Ne = l.round(De, 2);
                return se = Ne, Ne;
              }
              function be(De, Ne, Ie, Ue) {
                var ot = De[0] - Ne[0], ct = De[1] - Ne[1], Tt = Ie[0] - Ne[0], kt = Ie[1] - Ne[1], Ot = Math.pow(ot * ot + ct * ct, U / 2), Rt = Math.pow(Tt * Tt + kt * kt, U / 2), xt = (Rt * Rt * ot - Ot * Ot * Tt) * Ue, Wt = (Rt * Rt * ct - Ot * Ot * kt) * Ue, bt = 3 * Rt * (Ot + Rt), jt = 3 * Ot * (Ot + Rt);
                return [[ue(Ne[0] + (bt && xt / bt)), ve(Ne[1] + (bt && Wt / bt))], [ue(Ne[0] - (jt && xt / jt)), ve(Ne[1] - (jt && Wt / jt))]];
              }
              var Me = {
                hv: function(De, Ne, Ie) {
                  return "H" + ue(Ne[0]) + "V" + le(Ne, 1, Ie);
                },
                vh: function(De, Ne, Ie) {
                  return "V" + ve(Ne[1]) + "H" + le(Ne, 0, Ie);
                },
                hvh: function(De, Ne, Ie) {
                  return "H" + ue((De[0] + Ne[0]) / 2) + "V" + ve(Ne[1]) + "H" + le(Ne, 0, Ie);
                },
                vhv: function(De, Ne, Ie) {
                  return "V" + ve((De[1] + Ne[1]) / 2) + "H" + ue(Ne[0]) + "V" + le(Ne, 1, Ie);
                }
              }, Ge = function(De, Ne, Ie) {
                return "L" + le(Ne, 0, Ie) + "," + le(Ne, 1, Ie);
              };
              I.steps = function(De) {
                var Ne = Me[De] || Ge;
                return function(Ie) {
                  for (var Ue = "M" + ue(Ie[0][0]) + "," + ve(Ie[0][1]), ot = Ie.length, ct = 1; ct < ot; ct++)
                    Ue += Ne(Ie[ct - 1], Ie[ct], ct === ot - 1);
                  return Ue;
                };
              };
              function we(De, Ne) {
                var Ie = De.backoff, Ue = De.trace, ot = De.d, ct = De.i;
                if (Ie && Ue && Ue.marker && Ue.marker.angle % 360 === 0 && Ue.line && Ue.line.shape !== "spline") {
                  var Tt = v.isArrayOrTypedArray(Ie), kt = De, Ot = Ne ? Ne[0] : ne || 0, Rt = Ne ? Ne[1] : se || 0, xt = kt[0], Wt = kt[1], bt = xt - Ot, jt = Wt - Rt, qt = Math.atan2(jt, bt), Yt = Tt ? Ie[ct] : Ie;
                  if (Yt === "auto") {
                    var Ut = kt.i;
                    Ue.type === "scatter" && Ut--;
                    var tt = kt.marker, ze = tt.symbol;
                    v.isArrayOrTypedArray(ze) && (ze = ze[Ut]);
                    var _e = tt.size;
                    v.isArrayOrTypedArray(_e) && (_e = _e[Ut]), Yt = tt ? I.symbolBackOffs[I.symbolNumber(ze)] * _e : 0, Yt += I.getMarkerStandoff(ot[Ut], Ue) || 0;
                  }
                  var Ye = xt - Yt * Math.cos(qt), lt = Wt - Yt * Math.sin(qt);
                  (Ye <= xt && Ye >= Ot || Ye >= xt && Ye <= Ot) && (lt <= Wt && lt >= Rt || lt >= Wt && lt <= Rt) && (De = [Ye, lt]);
                }
                return De;
              }
              I.applyBackoff = we, I.makeTester = function() {
                var De = v.ensureSingleById(l.select("body"), "svg", "js-plotly-tester", function(Ie) {
                  Ie.attr(S.svgAttrs).style({
                    position: "absolute",
                    left: "-10000px",
                    top: "-10000px",
                    width: "9000px",
                    height: "9000px",
                    "z-index": "1"
                  });
                }), Ne = v.ensureSingle(De, "path", "js-reference-point", function(Ie) {
                  Ie.attr("d", "M0,0H1V1H0Z").style({
                    "stroke-width": 0,
                    fill: "black"
                  });
                });
                I.tester = De, I.testref = Ne;
              }, I.savedBBoxes = {};
              var Re = 0, Ae = 1e4;
              I.bBox = function(De, Ne, Ie) {
                Ie || (Ie = K(De));
                var Ue;
                if (Ie) {
                  if (Ue = I.savedBBoxes[Ie], Ue) return v.extendFlat({}, Ue);
                } else if (De.childNodes.length === 1) {
                  var ot = De.childNodes[0];
                  if (Ie = K(ot), Ie) {
                    var ct = +ot.getAttribute("x") || 0, Tt = +ot.getAttribute("y") || 0, kt = ot.getAttribute("transform");
                    if (!kt) {
                      var Ot = I.bBox(ot, !1, Ie);
                      return ct && (Ot.left += ct, Ot.right += ct), Tt && (Ot.top += Tt, Ot.bottom += Tt), Ot;
                    }
                    if (Ie += "~" + ct + "~" + Tt + "~" + kt, Ue = I.savedBBoxes[Ie], Ue) return v.extendFlat({}, Ue);
                  }
                }
                var Rt, xt;
                Ne ? Rt = De : (xt = I.tester.node(), Rt = De.cloneNode(!0), xt.appendChild(Rt)), l.select(Rt).attr("transform", null).call(w.positionText, 0, 0);
                var Wt = Rt.getBoundingClientRect(), bt = I.testref.node().getBoundingClientRect();
                Ne || xt.removeChild(Rt);
                var jt = {
                  height: Wt.height,
                  width: Wt.width,
                  left: Wt.left - bt.left,
                  top: Wt.top - bt.top,
                  right: Wt.right - bt.left,
                  bottom: Wt.bottom - bt.top
                };
                return Re >= Ae && (I.savedBBoxes = {}, Re = 0), Ie && (I.savedBBoxes[Ie] = jt), Re++, v.extendFlat({}, jt);
              };
              function K(De) {
                var Ne = De.getAttribute("data-unformatted");
                if (Ne !== null)
                  return Ne + De.getAttribute("data-math") + De.getAttribute("text-anchor") + De.getAttribute("style");
              }
              I.setClipUrl = function(De, Ne, Ie) {
                De.attr("clip-path", ee(Ne, Ie));
              };
              function ee(De, Ne) {
                if (!De) return null;
                var Ie = Ne._context, Ue = Ie._exportedPlot ? "" : Ie._baseUrl || "";
                return Ue ? "url('" + Ue + "#" + De + "')" : "url(#" + De + ")";
              }
              I.getTranslate = function(De) {
                var Ne = /.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/, Ie = De.attr ? "attr" : "getAttribute", Ue = De[Ie]("transform") || "", ot = Ue.replace(Ne, function(ct, Tt, kt) {
                  return [Tt, kt].join(" ");
                }).split(" ");
                return {
                  x: +ot[0] || 0,
                  y: +ot[1] || 0
                };
              }, I.setTranslate = function(De, Ne, Ie) {
                var Ue = /(\btranslate\(.*?\);?)/, ot = De.attr ? "attr" : "getAttribute", ct = De.attr ? "attr" : "setAttribute", Tt = De[ot]("transform") || "";
                return Ne = Ne || 0, Ie = Ie || 0, Tt = Tt.replace(Ue, "").trim(), Tt += h(Ne, Ie), Tt = Tt.trim(), De[ct]("transform", Tt), Tt;
              }, I.getScale = function(De) {
                var Ne = /.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/, Ie = De.attr ? "attr" : "getAttribute", Ue = De[Ie]("transform") || "", ot = Ue.replace(Ne, function(ct, Tt, kt) {
                  return [Tt, kt].join(" ");
                }).split(" ");
                return {
                  x: +ot[0] || 1,
                  y: +ot[1] || 1
                };
              }, I.setScale = function(De, Ne, Ie) {
                var Ue = /(\bscale\(.*?\);?)/, ot = De.attr ? "attr" : "getAttribute", ct = De.attr ? "attr" : "setAttribute", Tt = De[ot]("transform") || "";
                return Ne = Ne || 1, Ie = Ie || 1, Tt = Tt.replace(Ue, "").trim(), Tt += "scale(" + Ne + "," + Ie + ")", Tt = Tt.trim(), De[ct]("transform", Tt), Tt;
              };
              var oe = /\s*sc.*/;
              I.setPointGroupScale = function(De, Ne, Ie) {
                if (Ne = Ne || 1, Ie = Ie || 1, !!De) {
                  var Ue = Ne === 1 && Ie === 1 ? "" : "scale(" + Ne + "," + Ie + ")";
                  De.each(function() {
                    var ot = (this.getAttribute("transform") || "").replace(oe, "");
                    ot += Ue, ot = ot.trim(), this.setAttribute("transform", ot);
                  });
                }
              };
              var _ = /translate\([^)]*\)\s*$/;
              I.setTextPointsScale = function(De, Ne, Ie) {
                De && De.each(function() {
                  var Ue, ot = l.select(this), ct = ot.select("text");
                  if (ct.node()) {
                    var Tt = parseFloat(ct.attr("x") || 0), kt = parseFloat(ct.attr("y") || 0), Ot = (ot.attr("transform") || "").match(_);
                    Ne === 1 && Ie === 1 ? Ue = [] : Ue = [h(Tt, kt), "scale(" + Ne + "," + Ie + ")", h(-Tt, -kt)], Ot && Ue.push(Ot), ot.attr("transform", Ue.join(""));
                  }
                });
              };
              function V(De, Ne) {
                var Ie;
                return De && (Ie = De.mf), Ie === void 0 && (Ie = Ne.marker && Ne.marker.standoff || 0), !Ne._geo && !Ne._xA ? -Ie : Ie;
              }
              I.getMarkerStandoff = V;
              var fe = Math.atan2, $ = Math.cos, he = Math.sin;
              function me(De, Ne) {
                var Ie = Ne[0], Ue = Ne[1];
                return [Ie * $(De) - Ue * he(De), Ie * he(De) + Ue * $(De)];
              }
              var xe, Fe, Ve, Be, Je, et;
              function at(De, Ne) {
                var Ie = De.ma;
                Ie === void 0 && (Ie = Ne.marker.angle, (!Ie || v.isArrayOrTypedArray(Ie)) && (Ie = 0));
                var Ue, ot, ct = Ne.marker.angleref;
                if (ct === "previous" || ct === "north") {
                  if (Ne._geo) {
                    var Tt = Ne._geo.project(De.lonlat);
                    Ue = Tt[0], ot = Tt[1];
                  } else {
                    var kt = Ne._xA, Ot = Ne._yA;
                    if (kt && Ot)
                      Ue = kt.c2p(De.x), ot = Ot.c2p(De.y);
                    else
                      return 90;
                  }
                  if (Ne._geo) {
                    var Rt = De.lonlat[0], xt = De.lonlat[1], Wt = Ne._geo.project([
                      Rt,
                      xt + 1e-5
                      // epsilon
                    ]), bt = Ne._geo.project([
                      Rt + 1e-5,
                      // epsilon
                      xt
                    ]), jt = fe(bt[1] - ot, bt[0] - Ue), qt = fe(Wt[1] - ot, Wt[0] - Ue), Yt;
                    if (ct === "north")
                      Yt = Ie / 180 * Math.PI;
                    else if (ct === "previous") {
                      var Ut = Rt / 180 * Math.PI, tt = xt / 180 * Math.PI, ze = xe / 180 * Math.PI, _e = Fe / 180 * Math.PI, Ye = ze - Ut, lt = $(_e) * he(Ye), Te = he(_e) * $(tt) - $(_e) * he(tt) * $(Ye);
                      Yt = -fe(lt, Te) - Math.PI, xe = Rt, Fe = xt;
                    }
                    var Oe = me(jt, [$(Yt), 0]), je = me(qt, [he(Yt), 0]);
                    Ie = fe(Oe[1] + je[1], Oe[0] + je[0]) / Math.PI * 180, ct === "previous" && !(et === Ne.uid && De.i === Je + 1) && (Ie = null);
                  }
                  if (ct === "previous" && !Ne._geo)
                    if (et === Ne.uid && De.i === Je + 1 && p(Ue) && p(ot)) {
                      var Xe = Ue - Ve, nt = ot - Be, it = Ne.line && Ne.line.shape || "", Nt = it.slice(it.length - 1);
                      Nt === "h" && (nt = 0), Nt === "v" && (Xe = 0), Ie += fe(nt, Xe) / Math.PI * 180 + 90;
                    } else
                      Ie = null;
                }
                return Ve = Ue, Be = ot, Je = De.i, et = Ne.uid, Ie;
              }
              I.getMarkerAngle = at;
            }
          ),
          /***/
          1984: (
            /***/
            function(s, c, i) {
              var l = i(9604), v = i(3428).round, f = "M0,0Z", p = Math.sqrt(2), g = Math.sqrt(3), y = Math.PI, C = Math.cos, m = Math.sin;
              s.exports = {
                circle: {
                  n: 0,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = "M" + I + ",0A" + I + "," + I + " 0 1,1 0,-" + I + "A" + I + "," + I + " 0 0,1 " + I + ",0Z";
                    return k ? T(P, k, L) : L;
                  }
                },
                square: {
                  n: 1,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M" + I + "," + I + "H-" + I + "V-" + I + "H" + I + "Z");
                  }
                },
                diamond: {
                  n: 2,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.3, 2);
                    return T(P, k, "M" + I + ",0L0," + I + "L-" + I + ",0L0,-" + I + "Z");
                  }
                },
                cross: {
                  n: 3,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.4, 2), L = v(F * 1.2, 2);
                    return T(P, k, "M" + L + "," + I + "H" + I + "V" + L + "H-" + I + "V" + I + "H-" + L + "V-" + I + "H-" + I + "V-" + L + "H" + I + "V-" + I + "H" + L + "Z");
                  }
                },
                x: {
                  n: 4,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.8 / p, 2), L = "l" + I + "," + I, A = "l" + I + ",-" + I, O = "l-" + I + ",-" + I, N = "l-" + I + "," + I;
                    return T(P, k, "M0," + I + L + A + O + A + O + N + O + N + L + N + L + "Z");
                  }
                },
                "triangle-up": {
                  n: 5,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2 / g, 2), L = v(F / 2, 2), A = v(F, 2);
                    return T(P, k, "M-" + I + "," + L + "H" + I + "L0,-" + A + "Z");
                  }
                },
                "triangle-down": {
                  n: 6,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2 / g, 2), L = v(F / 2, 2), A = v(F, 2);
                    return T(P, k, "M-" + I + ",-" + L + "H" + I + "L0," + A + "Z");
                  }
                },
                "triangle-left": {
                  n: 7,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2 / g, 2), L = v(F / 2, 2), A = v(F, 2);
                    return T(P, k, "M" + L + ",-" + I + "V" + I + "L-" + A + ",0Z");
                  }
                },
                "triangle-right": {
                  n: 8,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2 / g, 2), L = v(F / 2, 2), A = v(F, 2);
                    return T(P, k, "M-" + L + ",-" + I + "V" + I + "L" + A + ",0Z");
                  }
                },
                "triangle-ne": {
                  n: 9,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.6, 2), L = v(F * 1.2, 2);
                    return T(P, k, "M-" + L + ",-" + I + "H" + I + "V" + L + "Z");
                  }
                },
                "triangle-se": {
                  n: 10,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.6, 2), L = v(F * 1.2, 2);
                    return T(P, k, "M" + I + ",-" + L + "V" + I + "H-" + L + "Z");
                  }
                },
                "triangle-sw": {
                  n: 11,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.6, 2), L = v(F * 1.2, 2);
                    return T(P, k, "M" + L + "," + I + "H-" + I + "V-" + L + "Z");
                  }
                },
                "triangle-nw": {
                  n: 12,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.6, 2), L = v(F * 1.2, 2);
                    return T(P, k, "M-" + I + "," + L + "V-" + I + "H" + L + "Z");
                  }
                },
                pentagon: {
                  n: 13,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.951, 2), L = v(F * 0.588, 2), A = v(-F, 2), O = v(F * -0.309, 2), N = v(F * 0.809, 2);
                    return T(P, k, "M" + I + "," + O + "L" + L + "," + N + "H-" + L + "L-" + I + "," + O + "L0," + A + "Z");
                  }
                },
                hexagon: {
                  n: 14,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = v(F / 2, 2), A = v(F * g / 2, 2);
                    return T(P, k, "M" + A + ",-" + L + "V" + L + "L0," + I + "L-" + A + "," + L + "V-" + L + "L0,-" + I + "Z");
                  }
                },
                hexagon2: {
                  n: 15,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = v(F / 2, 2), A = v(F * g / 2, 2);
                    return T(P, k, "M-" + L + "," + A + "H" + L + "L" + I + ",0L" + L + ",-" + A + "H-" + L + "L-" + I + ",0Z");
                  }
                },
                octagon: {
                  n: 16,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.924, 2), L = v(F * 0.383, 2);
                    return T(P, k, "M-" + L + ",-" + I + "H" + L + "L" + I + ",-" + L + "V" + L + "L" + L + "," + I + "H-" + L + "L-" + I + "," + L + "V-" + L + "Z");
                  }
                },
                star: {
                  n: 17,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = F * 1.4, L = v(I * 0.225, 2), A = v(I * 0.951, 2), O = v(I * 0.363, 2), N = v(I * 0.588, 2), Y = v(-I, 2), j = v(I * -0.309, 2), te = v(I * 0.118, 2), re = v(I * 0.809, 2), z = v(I * 0.382, 2);
                    return T(P, k, "M" + L + "," + j + "H" + A + "L" + O + "," + te + "L" + N + "," + re + "L0," + z + "L-" + N + "," + re + "L-" + O + "," + te + "L-" + A + "," + j + "H-" + L + "L0," + Y + "Z");
                  }
                },
                hexagram: {
                  n: 18,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.66, 2), L = v(F * 0.38, 2), A = v(F * 0.76, 2);
                    return T(P, k, "M-" + A + ",0l-" + L + ",-" + I + "h" + A + "l" + L + ",-" + I + "l" + L + "," + I + "h" + A + "l-" + L + "," + I + "l" + L + "," + I + "h-" + A + "l-" + L + "," + I + "l-" + L + ",-" + I + "h-" + A + "Z");
                  }
                },
                "star-triangle-up": {
                  n: 19,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * g * 0.8, 2), L = v(F * 0.8, 2), A = v(F * 1.6, 2), O = v(F * 4, 2), N = "A " + O + "," + O + " 0 0 1 ";
                    return T(P, k, "M-" + I + "," + L + N + I + "," + L + N + "0,-" + A + N + "-" + I + "," + L + "Z");
                  }
                },
                "star-triangle-down": {
                  n: 20,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * g * 0.8, 2), L = v(F * 0.8, 2), A = v(F * 1.6, 2), O = v(F * 4, 2), N = "A " + O + "," + O + " 0 0 1 ";
                    return T(P, k, "M" + I + ",-" + L + N + "-" + I + ",-" + L + N + "0," + A + N + I + ",-" + L + "Z");
                  }
                },
                "star-square": {
                  n: 21,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.1, 2), L = v(F * 2, 2), A = "A " + L + "," + L + " 0 0 1 ";
                    return T(P, k, "M-" + I + ",-" + I + A + "-" + I + "," + I + A + I + "," + I + A + I + ",-" + I + A + "-" + I + ",-" + I + "Z");
                  }
                },
                "star-diamond": {
                  n: 22,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.4, 2), L = v(F * 1.9, 2), A = "A " + L + "," + L + " 0 0 1 ";
                    return T(P, k, "M-" + I + ",0" + A + "0," + I + A + I + ",0" + A + "0,-" + I + A + "-" + I + ",0Z");
                  }
                },
                "diamond-tall": {
                  n: 23,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 0.7, 2), L = v(F * 1.4, 2);
                    return T(P, k, "M0," + L + "L" + I + ",0L0,-" + L + "L-" + I + ",0Z");
                  }
                },
                "diamond-wide": {
                  n: 24,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.4, 2), L = v(F * 0.7, 2);
                    return T(P, k, "M0," + L + "L" + I + ",0L0,-" + L + "L-" + I + ",0Z");
                  }
                },
                hourglass: {
                  n: 25,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M" + I + "," + I + "H-" + I + "L" + I + ",-" + I + "H-" + I + "Z");
                  },
                  noDot: !0
                },
                bowtie: {
                  n: 26,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M" + I + "," + I + "V-" + I + "L-" + I + "," + I + "V-" + I + "Z");
                  },
                  noDot: !0
                },
                "circle-cross": {
                  n: 27,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M0," + I + "V-" + I + "M" + I + ",0H-" + I + "M" + I + ",0A" + I + "," + I + " 0 1,1 0,-" + I + "A" + I + "," + I + " 0 0,1 " + I + ",0Z");
                  },
                  needLine: !0,
                  noDot: !0
                },
                "circle-x": {
                  n: 28,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = v(F / p, 2);
                    return T(P, k, "M" + L + "," + L + "L-" + L + ",-" + L + "M" + L + ",-" + L + "L-" + L + "," + L + "M" + I + ",0A" + I + "," + I + " 0 1,1 0,-" + I + "A" + I + "," + I + " 0 0,1 " + I + ",0Z");
                  },
                  needLine: !0,
                  noDot: !0
                },
                "square-cross": {
                  n: 29,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M0," + I + "V-" + I + "M" + I + ",0H-" + I + "M" + I + "," + I + "H-" + I + "V-" + I + "H" + I + "Z");
                  },
                  needLine: !0,
                  noDot: !0
                },
                "square-x": {
                  n: 30,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M" + I + "," + I + "L-" + I + ",-" + I + "M" + I + ",-" + I + "L-" + I + "," + I + "M" + I + "," + I + "H-" + I + "V-" + I + "H" + I + "Z");
                  },
                  needLine: !0,
                  noDot: !0
                },
                "diamond-cross": {
                  n: 31,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.3, 2);
                    return T(P, k, "M" + I + ",0L0," + I + "L-" + I + ",0L0,-" + I + "ZM0,-" + I + "V" + I + "M-" + I + ",0H" + I);
                  },
                  needLine: !0,
                  noDot: !0
                },
                "diamond-x": {
                  n: 32,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.3, 2), L = v(F * 0.65, 2);
                    return T(P, k, "M" + I + ",0L0," + I + "L-" + I + ",0L0,-" + I + "ZM-" + L + ",-" + L + "L" + L + "," + L + "M-" + L + "," + L + "L" + L + ",-" + L);
                  },
                  needLine: !0,
                  noDot: !0
                },
                "cross-thin": {
                  n: 33,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.4, 2);
                    return T(P, k, "M0," + I + "V-" + I + "M" + I + ",0H-" + I);
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "x-thin": {
                  n: 34,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M" + I + "," + I + "L-" + I + ",-" + I + "M" + I + ",-" + I + "L-" + I + "," + I);
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                asterisk: {
                  n: 35,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.2, 2), L = v(F * 0.85, 2);
                    return T(P, k, "M0," + I + "V-" + I + "M" + I + ",0H-" + I + "M" + L + "," + L + "L-" + L + ",-" + L + "M" + L + ",-" + L + "L-" + L + "," + L);
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                hash: {
                  n: 36,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F / 2, 2), L = v(F, 2);
                    return T(P, k, "M" + I + "," + L + "V-" + L + "M" + (I - L) + ",-" + L + "V" + L + "M" + L + "," + I + "H-" + L + "M-" + L + "," + (I - L) + "H" + L);
                  },
                  needLine: !0,
                  noFill: !0
                },
                "y-up": {
                  n: 37,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.2, 2), L = v(F * 1.6, 2), A = v(F * 0.8, 2);
                    return T(P, k, "M-" + I + "," + A + "L0,0M" + I + "," + A + "L0,0M0,-" + L + "L0,0");
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "y-down": {
                  n: 38,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.2, 2), L = v(F * 1.6, 2), A = v(F * 0.8, 2);
                    return T(P, k, "M-" + I + ",-" + A + "L0,0M" + I + ",-" + A + "L0,0M0," + L + "L0,0");
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "y-left": {
                  n: 39,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.2, 2), L = v(F * 1.6, 2), A = v(F * 0.8, 2);
                    return T(P, k, "M" + A + "," + I + "L0,0M" + A + ",-" + I + "L0,0M-" + L + ",0L0,0");
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "y-right": {
                  n: 40,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.2, 2), L = v(F * 1.6, 2), A = v(F * 0.8, 2);
                    return T(P, k, "M-" + A + "," + I + "L0,0M-" + A + ",-" + I + "L0,0M" + L + ",0L0,0");
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "line-ew": {
                  n: 41,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.4, 2);
                    return T(P, k, "M" + I + ",0H-" + I);
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "line-ns": {
                  n: 42,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 1.4, 2);
                    return T(P, k, "M0," + I + "V-" + I);
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "line-ne": {
                  n: 43,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M" + I + ",-" + I + "L-" + I + "," + I);
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "line-nw": {
                  n: 44,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2);
                    return T(P, k, "M" + I + "," + I + "L-" + I + ",-" + I);
                  },
                  needLine: !0,
                  noDot: !0,
                  noFill: !0
                },
                "arrow-up": {
                  n: 45,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = v(F * 2, 2);
                    return T(P, k, "M0,0L-" + I + "," + L + "H" + I + "Z");
                  },
                  backoff: 1,
                  noDot: !0
                },
                "arrow-down": {
                  n: 46,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = v(F * 2, 2);
                    return T(P, k, "M0,0L-" + I + ",-" + L + "H" + I + "Z");
                  },
                  noDot: !0
                },
                "arrow-left": {
                  n: 47,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2, 2), L = v(F, 2);
                    return T(P, k, "M0,0L" + I + ",-" + L + "V" + L + "Z");
                  },
                  noDot: !0
                },
                "arrow-right": {
                  n: 48,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2, 2), L = v(F, 2);
                    return T(P, k, "M0,0L-" + I + ",-" + L + "V" + L + "Z");
                  },
                  noDot: !0
                },
                "arrow-bar-up": {
                  n: 49,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = v(F * 2, 2);
                    return T(P, k, "M-" + I + ",0H" + I + "M0,0L-" + I + "," + L + "H" + I + "Z");
                  },
                  backoff: 1,
                  needLine: !0,
                  noDot: !0
                },
                "arrow-bar-down": {
                  n: 50,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F, 2), L = v(F * 2, 2);
                    return T(P, k, "M-" + I + ",0H" + I + "M0,0L-" + I + ",-" + L + "H" + I + "Z");
                  },
                  needLine: !0,
                  noDot: !0
                },
                "arrow-bar-left": {
                  n: 51,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2, 2), L = v(F, 2);
                    return T(P, k, "M0,-" + L + "V" + L + "M0,0L" + I + ",-" + L + "V" + L + "Z");
                  },
                  needLine: !0,
                  noDot: !0
                },
                "arrow-bar-right": {
                  n: 52,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = v(F * 2, 2), L = v(F, 2);
                    return T(P, k, "M0,-" + L + "V" + L + "M0,0L-" + I + ",-" + L + "V" + L + "Z");
                  },
                  needLine: !0,
                  noDot: !0
                },
                arrow: {
                  n: 53,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = y / 2.5, L = 2 * F * C(I), A = 2 * F * m(I);
                    return T(P, k, "M0,0L" + -L + "," + A + "L" + L + "," + A + "Z");
                  },
                  backoff: 0.9,
                  noDot: !0
                },
                "arrow-wide": {
                  n: 54,
                  f: function(F, P, k) {
                    if (h(P)) return f;
                    var I = y / 4, L = 2 * F * C(I), A = 2 * F * m(I);
                    return T(P, k, "M0,0L" + -L + "," + A + "A " + 2 * F + "," + 2 * F + " 0 0 1 " + L + "," + A + "Z");
                  },
                  backoff: 0.4,
                  noDot: !0
                }
              };
              function h(F) {
                return F === null;
              }
              var w, S, E, x;
              function T(F, P, k) {
                if ((!F || F % 360 === 0) && !P) return k;
                if (E === F && x === P && w === k) return S;
                E = F, x = P, w = k;
                function I(ie, ce) {
                  var X = C(ie), U = m(ie), ne = ce[0], se = ce[1] + (P || 0);
                  return [ne * X - se * U, ne * U + se * X];
                }
                for (var L = F / 180 * y, A = 0, O = 0, N = l(k), Y = "", j = 0; j < N.length; j++) {
                  var te = N[j], re = te[0], z = A, Z = O;
                  if (re === "M" || re === "L")
                    A = +te[1], O = +te[2];
                  else if (re === "m" || re === "l")
                    A += +te[1], O += +te[2];
                  else if (re === "H")
                    A = +te[1];
                  else if (re === "h")
                    A += +te[1];
                  else if (re === "V")
                    O = +te[1];
                  else if (re === "v")
                    O += +te[1];
                  else if (re === "A") {
                    A = +te[1], O = +te[2];
                    var W = I(L, [+te[6], +te[7]]);
                    te[6] = W[0], te[7] = W[1], te[3] = +te[3] + F;
                  }
                  (re === "H" || re === "V") && (re = "L"), (re === "h" || re === "v") && (re = "l"), (re === "m" || re === "l") && (A -= z, O -= Z);
                  var q = I(L, [A, O]);
                  (re === "H" || re === "V") && (re = "L"), (re === "M" || re === "L" || re === "m" || re === "l") && (te[1] = q[0], te[2] = q[1]), te[0] = re, Y += te[0] + te.slice(1).join(",");
                }
                return S = Y, Y;
              }
            }
          ),
          /***/
          7644: (
            /***/
            function(s) {
              s.exports = {
                visible: {
                  valType: "boolean",
                  editType: "calc"
                },
                type: {
                  valType: "enumerated",
                  values: ["percent", "constant", "sqrt", "data"],
                  editType: "calc"
                },
                symmetric: {
                  valType: "boolean",
                  editType: "calc"
                },
                array: {
                  valType: "data_array",
                  editType: "calc"
                },
                arrayminus: {
                  valType: "data_array",
                  editType: "calc"
                },
                value: {
                  valType: "number",
                  min: 0,
                  dflt: 10,
                  editType: "calc"
                },
                valueminus: {
                  valType: "number",
                  min: 0,
                  dflt: 10,
                  editType: "calc"
                },
                traceref: {
                  valType: "integer",
                  min: 0,
                  dflt: 0,
                  editType: "style"
                },
                tracerefminus: {
                  valType: "integer",
                  min: 0,
                  dflt: 0,
                  editType: "style"
                },
                copy_ystyle: {
                  valType: "boolean",
                  editType: "plot"
                },
                copy_zstyle: {
                  valType: "boolean",
                  editType: "style"
                },
                color: {
                  valType: "color",
                  editType: "style"
                },
                thickness: {
                  valType: "number",
                  min: 0,
                  dflt: 2,
                  editType: "style"
                },
                width: {
                  valType: "number",
                  min: 0,
                  editType: "plot"
                },
                editType: "calc",
                _deprecated: {
                  opacity: {
                    valType: "number",
                    editType: "style"
                  }
                }
              };
            }
          ),
          /***/
          4880: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(4040), f = i(4460), p = i(3400), g = i(3792);
              s.exports = function(m) {
                for (var h = m.calcdata, w = 0; w < h.length; w++) {
                  var S = h[w], E = S[0].trace;
                  if (E.visible === !0 && v.traceIs(E, "errorBarsOK")) {
                    var x = f.getFromId(m, E.xaxis), T = f.getFromId(m, E.yaxis);
                    y(S, E, x, "x"), y(S, E, T, "y");
                  }
                }
              };
              function y(C, m, h, w) {
                var S = m["error_" + w] || {}, E = S.visible && ["linear", "log"].indexOf(h.type) !== -1, x = [];
                if (E) {
                  for (var T = g(S), F = 0; F < C.length; F++) {
                    var P = C[F], k = P.i;
                    if (k === void 0) k = F;
                    else if (k === null) continue;
                    var I = P[w];
                    if (l(h.c2l(I))) {
                      var L = T(I, k);
                      if (l(L[0]) && l(L[1])) {
                        var A = P[w + "s"] = I - L[0], O = P[w + "h"] = I + L[1];
                        x.push(A, O);
                      }
                    }
                  }
                  var N = h._id, Y = m._extremes[N], j = f.findExtremes(h, x, p.extendFlat({
                    tozero: Y.opts.tozero
                  }, {
                    padded: !0
                  }));
                  Y.min = Y.min.concat(j.min), Y.max = Y.max.concat(j.max);
                }
              }
            }
          ),
          /***/
          3792: (
            /***/
            function(s) {
              s.exports = function(l) {
                var v = l.type, f = l.symmetric;
                if (v === "data") {
                  var p = l.array || [];
                  if (f)
                    return function(h, w) {
                      var S = +p[w];
                      return [S, S];
                    };
                  var g = l.arrayminus || [];
                  return function(h, w) {
                    var S = +p[w], E = +g[w];
                    return !isNaN(S) || !isNaN(E) ? [E || 0, S || 0] : [NaN, NaN];
                  };
                } else {
                  var y = c(v, l.value), C = c(v, l.valueminus);
                  return f || l.valueminus === void 0 ? function(h) {
                    var w = y(h);
                    return [w, w];
                  } : function(h) {
                    return [C(h), y(h)];
                  };
                }
              };
              function c(i, l) {
                if (i === "percent")
                  return function(v) {
                    return Math.abs(v * l / 100);
                  };
                if (i === "constant")
                  return function() {
                    return Math.abs(l);
                  };
                if (i === "sqrt")
                  return function(v) {
                    return Math.sqrt(Math.abs(v));
                  };
              }
            }
          ),
          /***/
          5200: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(4040), f = i(3400), p = i(1780), g = i(7644);
              s.exports = function(y, C, m, h) {
                var w = "error_" + h.axis, S = p.newContainer(C, w), E = y[w] || {};
                function x(A, O) {
                  return f.coerce(E, S, g, A, O);
                }
                var T = E.array !== void 0 || E.value !== void 0 || E.type === "sqrt", F = x("visible", T);
                if (F !== !1) {
                  var P = x("type", "array" in E ? "data" : "percent"), k = !0;
                  P !== "sqrt" && (k = x("symmetric", !((P === "data" ? "arrayminus" : "valueminus") in E))), P === "data" ? (x("array"), x("traceref"), k || (x("arrayminus"), x("tracerefminus"))) : (P === "percent" || P === "constant") && (x("value"), k || x("valueminus"));
                  var I = "copy_" + h.inherit + "style";
                  if (h.inherit) {
                    var L = C["error_" + h.inherit];
                    (L || {}).visible && x(I, !(E.color || l(E.thickness) || l(E.width)));
                  }
                  (!h.inherit || !S[I]) && (x("color", m), x("thickness"), x("width", v.traceIs(C, "gl3d") ? 0 : 4));
                }
              };
            }
          ),
          /***/
          4968: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(7824).overrideAll, f = i(7644), p = {
                error_x: l.extendFlat({}, f),
                error_y: l.extendFlat({}, f)
              };
              delete p.error_x.copy_zstyle, delete p.error_y.copy_zstyle, delete p.error_y.copy_ystyle;
              var g = {
                error_x: l.extendFlat({}, f),
                error_y: l.extendFlat({}, f),
                error_z: l.extendFlat({}, f)
              };
              delete g.error_x.copy_ystyle, delete g.error_y.copy_ystyle, delete g.error_z.copy_ystyle, delete g.error_z.copy_zstyle, s.exports = {
                moduleType: "component",
                name: "errorbars",
                schema: {
                  traces: {
                    scatter: p,
                    bar: p,
                    histogram: p,
                    scatter3d: v(g, "calc", "nested"),
                    scattergl: v(p, "calc", "nested")
                  }
                },
                supplyDefaults: i(5200),
                calc: i(4880),
                makeComputeError: i(3792),
                plot: i(8512),
                style: i(2036),
                hoverInfo: y
              };
              function y(C, m, h) {
                (m.error_y || {}).visible && (h.yerr = C.yh - C.y, m.error_y.symmetric || (h.yerrneg = C.y - C.ys)), (m.error_x || {}).visible && (h.xerr = C.xh - C.x, m.error_x.symmetric || (h.xerrneg = C.x - C.xs));
              }
            }
          ),
          /***/
          8512: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(3616), p = i(3028);
              s.exports = function(C, m, h, w) {
                var S, E = h.xaxis, x = h.yaxis, T = w && w.duration > 0, F = C._context.staticPlot;
                m.each(function(P) {
                  var k = P[0].trace, I = k.error_x || {}, L = k.error_y || {}, A;
                  k.ids && (A = function(j) {
                    return j.id;
                  });
                  var O = p.hasMarkers(k) && k.marker.maxdisplayed > 0;
                  !L.visible && !I.visible && (P = []);
                  var N = l.select(this).selectAll("g.errorbar").data(P, A);
                  if (N.exit().remove(), !!P.length) {
                    I.visible || N.selectAll("path.xerror").remove(), L.visible || N.selectAll("path.yerror").remove(), N.style("opacity", 1);
                    var Y = N.enter().append("g").classed("errorbar", !0);
                    T && Y.style("opacity", 0).transition().duration(w.duration).style("opacity", 1), f.setClipUrl(N, h.layerClipId, C), N.each(function(j) {
                      var te = l.select(this), re = g(j, E, x);
                      if (!(O && !j.vis)) {
                        var z, Z = te.select("path.yerror");
                        if (L.visible && v(re.x) && v(re.yh) && v(re.ys)) {
                          var W = L.width;
                          z = "M" + (re.x - W) + "," + re.yh + "h" + 2 * W + // hat
                          "m-" + W + ",0V" + re.ys, re.noYS || (z += "m-" + W + ",0h" + 2 * W), S = !Z.size(), S ? Z = te.append("path").style("vector-effect", F ? "none" : "non-scaling-stroke").classed("yerror", !0) : T && (Z = Z.transition().duration(w.duration).ease(w.easing)), Z.attr("d", z);
                        } else Z.remove();
                        var q = te.select("path.xerror");
                        if (I.visible && v(re.y) && v(re.xh) && v(re.xs)) {
                          var ie = (I.copy_ystyle ? L : I).width;
                          z = "M" + re.xh + "," + (re.y - ie) + "v" + 2 * ie + // hat
                          "m0,-" + ie + "H" + re.xs, re.noXS || (z += "m0,-" + ie + "v" + 2 * ie), S = !q.size(), S ? q = te.append("path").style("vector-effect", F ? "none" : "non-scaling-stroke").classed("xerror", !0) : T && (q = q.transition().duration(w.duration).ease(w.easing)), q.attr("d", z);
                        } else q.remove();
                      }
                    });
                  }
                });
              };
              function g(y, C, m) {
                var h = {
                  x: C.c2p(y.x),
                  y: m.c2p(y.y)
                };
                return y.yh !== void 0 && (h.yh = m.c2p(y.yh), h.ys = m.c2p(y.ys), v(h.ys) || (h.noYS = !0, h.ys = m.c2p(y.ys, !0))), y.xh !== void 0 && (h.xh = C.c2p(y.xh), h.xs = C.c2p(y.xs), v(h.xs) || (h.noXS = !0, h.xs = C.c2p(y.xs, !0))), h;
              }
            }
          ),
          /***/
          2036: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(6308);
              s.exports = function(p) {
                p.each(function(g) {
                  var y = g[0].trace, C = y.error_y || {}, m = y.error_x || {}, h = l.select(this);
                  h.selectAll("path.yerror").style("stroke-width", C.thickness + "px").call(v.stroke, C.color), m.copy_ystyle && (m = C), h.selectAll("path.xerror").style("stroke-width", m.thickness + "px").call(v.stroke, m.color);
                });
              };
            }
          ),
          /***/
          5756: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(5460).hoverlabel, f = i(2880).extendFlat;
              s.exports = {
                hoverlabel: {
                  bgcolor: f({}, v.bgcolor, {
                    arrayOk: !0
                  }),
                  bordercolor: f({}, v.bordercolor, {
                    arrayOk: !0
                  }),
                  font: l({
                    arrayOk: !0,
                    editType: "none"
                  }),
                  align: f({}, v.align, {
                    arrayOk: !0
                  }),
                  namelength: f({}, v.namelength, {
                    arrayOk: !0
                  }),
                  editType: "none"
                }
              };
            }
          ),
          /***/
          5056: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4040);
              s.exports = function(g) {
                var y = g.calcdata, C = g._fullLayout;
                function m(x) {
                  return function(T) {
                    return l.coerceHoverinfo({
                      hoverinfo: T
                    }, {
                      _module: x._module
                    }, C);
                  };
                }
                for (var h = 0; h < y.length; h++) {
                  var w = y[h], S = w[0].trace;
                  if (!v.traceIs(S, "pie-like")) {
                    var E = v.traceIs(S, "2dMap") ? f : l.fillArray;
                    E(S.hoverinfo, w, "hi", m(S)), S.hovertemplate && E(S.hovertemplate, w, "ht"), S.hoverlabel && (E(S.hoverlabel.bgcolor, w, "hbg"), E(S.hoverlabel.bordercolor, w, "hbc"), E(S.hoverlabel.font.size, w, "hts"), E(S.hoverlabel.font.color, w, "htc"), E(S.hoverlabel.font.family, w, "htf"), E(S.hoverlabel.font.weight, w, "htw"), E(S.hoverlabel.font.style, w, "hty"), E(S.hoverlabel.font.variant, w, "htv"), E(S.hoverlabel.namelength, w, "hnl"), E(S.hoverlabel.align, w, "hta"));
                  }
                }
              };
              function f(p, g, y, C) {
                C = C || l.identity, Array.isArray(p) && (g[0][y] = C(p));
              }
            }
          ),
          /***/
          2376: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3292).hover;
              s.exports = function(p, g, y) {
                var C = l.getComponentMethod("annotations", "onClick")(p, p._hoverdata);
                y !== void 0 && v(p, g, y, !0);
                function m() {
                  p.emit("plotly_click", {
                    points: p._hoverdata,
                    event: g
                  });
                }
                p._hoverdata && g && g.target && (C && C.then ? C.then(m) : m(), g.stopImmediatePropagation && g.stopImmediatePropagation());
              };
            }
          ),
          /***/
          2456: (
            /***/
            function(s) {
              s.exports = {
                // hover labels for multiple horizontal bars get tilted by this angle
                YANGLE: 60,
                // size and display constants for hover text
                // pixel size of hover arrows
                HOVERARROWSIZE: 6,
                // pixels padding around text
                HOVERTEXTPAD: 3,
                // hover font
                HOVERFONTSIZE: 13,
                HOVERFONT: "Arial, sans-serif",
                // minimum time (msec) between hover calls
                HOVERMINTIME: 50,
                // ID suffix (with fullLayout._uid) for hover events in the throttle cache
                HOVERID: "-hover"
              };
            }
          ),
          /***/
          5448: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(5756), f = i(6132);
              s.exports = function(g, y, C, m) {
                function h(S, E) {
                  return l.coerce(g, y, v, S, E);
                }
                var w = l.extendFlat({}, m.hoverlabel);
                y.hovertemplate && (w.namelength = -1), f(g, y, h, w);
              };
            }
          ),
          /***/
          624: (
            /***/
            function(s, c, i) {
              var l = i(3400);
              c.getSubplot = function(C) {
                return C.subplot || C.xaxis + C.yaxis || C.geo;
              }, c.isTraceInSubplots = function(C, m) {
                if (C.type === "splom") {
                  for (var h = C.xaxes || [], w = C.yaxes || [], S = 0; S < h.length; S++)
                    for (var E = 0; E < w.length; E++)
                      if (m.indexOf(h[S] + w[E]) !== -1)
                        return !0;
                  return !1;
                }
                return m.indexOf(c.getSubplot(C)) !== -1;
              }, c.flat = function(C, m) {
                for (var h = new Array(C.length), w = 0; w < C.length; w++)
                  h[w] = m;
                return h;
              }, c.p2c = function(C, m) {
                for (var h = new Array(C.length), w = 0; w < C.length; w++)
                  h[w] = C[w].p2c(m);
                return h;
              }, c.getDistanceFunction = function(C, m, h, w) {
                return C === "closest" ? w || c.quadrature(m, h) : C.charAt(0) === "x" ? m : h;
              }, c.getClosest = function(C, m, h) {
                if (h.index !== !1)
                  h.index >= 0 && h.index < C.length ? h.distance = 0 : h.index = !1;
                else
                  for (var w = 0; w < C.length; w++) {
                    var S = m(C[w]);
                    S <= h.distance && (h.index = w, h.distance = S);
                  }
                return h;
              }, c.inbox = function(C, m, h) {
                return C * m < 0 || C === 0 ? h : 1 / 0;
              }, c.quadrature = function(C, m) {
                return function(h) {
                  var w = C(h), S = m(h);
                  return Math.sqrt(w * w + S * S);
                };
              }, c.makeEventData = function(C, m, h) {
                var w = "index" in C ? C.index : C.pointNumber, S = {
                  data: m._input,
                  fullData: m,
                  curveNumber: m.index,
                  pointNumber: w
                };
                if (m._indexToPoints) {
                  var E = m._indexToPoints[w];
                  E.length === 1 ? S.pointIndex = E[0] : S.pointIndices = E;
                } else
                  S.pointIndex = w;
                return m._module.eventData ? S = m._module.eventData(S, C, m, h, w) : ("xVal" in C ? S.x = C.xVal : "x" in C && (S.x = C.x), "yVal" in C ? S.y = C.yVal : "y" in C && (S.y = C.y), C.xa && (S.xaxis = C.xa), C.ya && (S.yaxis = C.ya), C.zLabelVal !== void 0 && (S.z = C.zLabelVal)), c.appendArrayPointValue(S, m, w), S;
              }, c.appendArrayPointValue = function(C, m, h) {
                var w = m._arrayAttrs;
                if (w)
                  for (var S = 0; S < w.length; S++) {
                    var E = w[S], x = f(E);
                    if (C[x] === void 0) {
                      var T = l.nestedProperty(m, E).get(), F = p(T, h);
                      F !== void 0 && (C[x] = F);
                    }
                  }
              }, c.appendArrayMultiPointValues = function(C, m, h) {
                var w = m._arrayAttrs;
                if (w)
                  for (var S = 0; S < w.length; S++) {
                    var E = w[S], x = f(E);
                    if (C[x] === void 0) {
                      for (var T = l.nestedProperty(m, E).get(), F = new Array(h.length), P = 0; P < h.length; P++)
                        F[P] = p(T, h[P]);
                      C[x] = F;
                    }
                  }
              };
              var v = {
                ids: "id",
                locations: "location",
                labels: "label",
                values: "value",
                "marker.colors": "color",
                parents: "parent"
              };
              function f(C) {
                return v[C] || C;
              }
              function p(C, m) {
                if (Array.isArray(m)) {
                  if (Array.isArray(C) && Array.isArray(C[m[0]]))
                    return C[m[0]][m[1]];
                } else
                  return C[m];
              }
              var g = {
                x: !0,
                y: !0
              }, y = {
                "x unified": !0,
                "y unified": !0
              };
              c.isUnifiedHover = function(C) {
                return typeof C != "string" ? !1 : !!y[C];
              }, c.isXYhover = function(C) {
                return typeof C != "string" ? !1 : !!g[C];
              };
            }
          ),
          /***/
          3292: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(9760), p = i(3400), g = p.pushUnique, y = p.strTranslate, C = p.strRotate, m = i(5924), h = i(2736), w = i(2213), S = i(3616), E = i(6308), x = i(6476), T = i(4460), F = i(4040), P = i(624), k = i(2456), I = i(7864), L = i(1140), A = k.YANGLE, O = Math.PI * A / 180, N = 1 / Math.sin(O), Y = Math.cos(O), j = Math.sin(O), te = k.HOVERARROWSIZE, re = k.HOVERTEXTPAD, z = {
                box: !0,
                ohlc: !0,
                violin: !0,
                candlestick: !0
              }, Z = {
                scatter: !0,
                scattergl: !0,
                splom: !0
              };
              function W(_, V) {
                return _.distance - V.distance;
              }
              c.hover = function(V, fe, $, he) {
                V = p.getGraphDiv(V);
                var me = fe.target;
                p.throttle(V._fullLayout._uid + k.HOVERID, k.HOVERMINTIME, function() {
                  q(V, fe, $, he, me);
                });
              }, c.loneHover = function(V, fe) {
                var $ = !0;
                Array.isArray(V) || ($ = !1, V = [V]);
                var he = fe.gd, me = K(he), xe = ee(he), Fe = V.map(function(Ue) {
                  var ot = Ue._x0 || Ue.x0 || Ue.x || 0, ct = Ue._x1 || Ue.x1 || Ue.x || 0, Tt = Ue._y0 || Ue.y0 || Ue.y || 0, kt = Ue._y1 || Ue.y1 || Ue.y || 0, Ot = Ue.eventData;
                  if (Ot) {
                    var Rt = Math.min(ot, ct), xt = Math.max(ot, ct), Wt = Math.min(Tt, kt), bt = Math.max(Tt, kt), jt = Ue.trace;
                    if (F.traceIs(jt, "gl3d")) {
                      var qt = he._fullLayout[jt.scene]._scene.container, Yt = qt.offsetLeft, Ut = qt.offsetTop;
                      Rt += Yt, xt += Yt, Wt += Ut, bt += Ut;
                    }
                    Ot.bbox = {
                      x0: Rt + xe,
                      x1: xt + xe,
                      y0: Wt + me,
                      y1: bt + me
                    }, fe.inOut_bbox && fe.inOut_bbox.push(Ot.bbox);
                  } else
                    Ot = !1;
                  return {
                    color: Ue.color || E.defaultLine,
                    x0: Ue.x0 || Ue.x || 0,
                    x1: Ue.x1 || Ue.x || 0,
                    y0: Ue.y0 || Ue.y || 0,
                    y1: Ue.y1 || Ue.y || 0,
                    xLabel: Ue.xLabel,
                    yLabel: Ue.yLabel,
                    zLabel: Ue.zLabel,
                    text: Ue.text,
                    name: Ue.name,
                    idealAlign: Ue.idealAlign,
                    // optional extra bits of styling
                    borderColor: Ue.borderColor,
                    fontFamily: Ue.fontFamily,
                    fontSize: Ue.fontSize,
                    fontColor: Ue.fontColor,
                    fontWeight: Ue.fontWeight,
                    fontStyle: Ue.fontStyle,
                    fontVariant: Ue.fontVariant,
                    nameLength: Ue.nameLength,
                    textAlign: Ue.textAlign,
                    // filler to make createHoverText happy
                    trace: Ue.trace || {
                      index: 0,
                      hoverinfo: ""
                    },
                    xa: {
                      _offset: 0
                    },
                    ya: {
                      _offset: 0
                    },
                    index: 0,
                    hovertemplate: Ue.hovertemplate || !1,
                    hovertemplateLabels: Ue.hovertemplateLabels || !1,
                    eventData: Ot
                  };
                }), Ve = !1, Be = X(Fe, {
                  gd: he,
                  hovermode: "closest",
                  rotateLabels: Ve,
                  bgColor: fe.bgColor || E.background,
                  container: l.select(fe.container),
                  outerContainer: fe.outerContainer || fe.container
                }), Je = Be.hoverLabels, et = 5, at = 0, De = 0;
                Je.sort(function(Ue, ot) {
                  return Ue.y0 - ot.y0;
                }).each(function(Ue, ot) {
                  var ct = Ue.y0 - Ue.by / 2;
                  ct - et < at ? Ue.offset = at - ct + et : Ue.offset = 0, at = ct + Ue.by + Ue.offset, ot === fe.anchorIndex && (De = Ue.offset);
                }).each(function(Ue) {
                  Ue.offset -= De;
                });
                var Ne = he._fullLayout._invScaleX, Ie = he._fullLayout._invScaleY;
                return ue(Je, Ve, Ne, Ie), $ ? Je : Je.node();
              };
              function q(_, V, fe, $, he) {
                fe || (fe = "xy");
                var me = Array.isArray(fe) ? fe : [fe], xe, Fe = _._fullLayout, Ve = Fe.hoversubplots, Be = Fe._plots || [], Je = Be[fe], et = Fe._has("cartesian"), at = V.hovermode || Fe.hovermode, De = (at || "").charAt(0) === "x", Ne = (at || "").charAt(0) === "y", Ie, Ue;
                if (et && (De || Ne) && Ve === "axis") {
                  for (var ot = me.length, ct = 0; ct < ot; ct++)
                    if (xe = me[ct], Be[xe]) {
                      Ie = T.getFromId(_, xe, "x"), Ue = T.getFromId(_, xe, "y");
                      var Tt = (De ? Ie : Ue)._subplotsWith;
                      if (Tt && Tt.length)
                        for (var kt = 0; kt < Tt.length; kt++)
                          g(me, Tt[kt]);
                    }
                }
                if (Je && Ve !== "single") {
                  var Ot = Je.overlays.map(function(pn) {
                    return pn.id;
                  });
                  me = me.concat(Ot);
                }
                for (var Rt = me.length, xt = new Array(Rt), Wt = new Array(Rt), bt = !1, jt = 0; jt < Rt; jt++)
                  if (xe = me[jt], Be[xe])
                    bt = !0, xt[jt] = Be[xe].xaxis, Wt[jt] = Be[xe].yaxis;
                  else if (Fe[xe] && Fe[xe]._subplot) {
                    var qt = Fe[xe]._subplot;
                    xt[jt] = qt.xaxis, Wt[jt] = qt.yaxis;
                  } else {
                    p.warn("Unrecognized subplot: " + xe);
                    return;
                  }
                if (at && !bt && (at = "closest"), ["x", "y", "closest", "x unified", "y unified"].indexOf(at) === -1 || !_.calcdata || _.querySelector(".zoombox") || _._dragging)
                  return x.unhoverRaw(_, V);
                var Yt = Fe.hoverdistance;
                Yt === -1 && (Yt = 1 / 0);
                var Ut = Fe.spikedistance;
                Ut === -1 && (Ut = 1 / 0);
                var tt = [], ze = [], _e, Ye, lt, Te, Oe, je, Xe, nt, it, Nt, At, vt, ut, Pt = {
                  hLinePoint: null,
                  vLinePoint: null
                }, rr = !1;
                if (Array.isArray(V))
                  for (at = "array", lt = 0; lt < V.length; lt++)
                    Oe = _.calcdata[V[lt].curveNumber || 0], Oe && (je = Oe[0].trace, Oe[0].trace.hoverinfo !== "skip" && (ze.push(Oe), je.orientation === "h" && (rr = !0)));
                else {
                  var lr = _.calcdata.slice();
                  for (lr.sort(function(pn, hi) {
                    var yn = pn[0].trace.zorder || 0, Pn = hi[0].trace.zorder || 0;
                    return yn - Pn;
                  }), Te = 0; Te < lr.length; Te++)
                    Oe = lr[Te], je = Oe[0].trace, je.hoverinfo !== "skip" && P.isTraceInSubplots(je, me) && (ze.push(Oe), je.orientation === "h" && (rr = !0));
                  var Mr = !he, Rr, Pr;
                  if (Mr)
                    "xpx" in V ? Rr = V.xpx : Rr = xt[0]._length / 2, "ypx" in V ? Pr = V.ypx : Pr = Wt[0]._length / 2;
                  else {
                    if (m.triggerHandler(_, "plotly_beforehover", V) === !1)
                      return;
                    var ir = he.getBoundingClientRect();
                    Rr = V.clientX - ir.left, Pr = V.clientY - ir.top, Fe._calcInverseTransform(_);
                    var Lr = p.apply3DTransform(Fe._invTransform)(Rr, Pr);
                    if (Rr = Lr[0], Pr = Lr[1], Rr < 0 || Rr > xt[0]._length || Pr < 0 || Pr > Wt[0]._length)
                      return x.unhoverRaw(_, V);
                  }
                  if (V.pointerX = Rr + xt[0]._offset, V.pointerY = Pr + Wt[0]._offset, "xval" in V ? _e = P.flat(me, V.xval) : _e = P.p2c(xt, Rr), "yval" in V ? Ye = P.flat(me, V.yval) : Ye = P.p2c(Wt, Pr), !v(_e[0]) || !v(Ye[0]))
                    return p.warn("Fx.hover failed", V, _), x.unhoverRaw(_, V);
                }
                var yr = 1 / 0;
                function Sr(pn, hi) {
                  for (Te = 0; Te < ze.length; Te++)
                    if (Oe = ze[Te], !(!Oe || !Oe[0] || !Oe[0].trace) && (je = Oe[0].trace, !(je.visible !== !0 || je._length === 0) && ["carpet", "contourcarpet"].indexOf(je._module.name) === -1)) {
                      if (it = at, P.isUnifiedHover(it) && (it = it.charAt(0)), je.type === "splom" ? (nt = 0, Xe = me[nt]) : (Xe = P.getSubplot(je), nt = me.indexOf(Xe)), vt = {
                        // trace properties
                        cd: Oe,
                        trace: je,
                        xa: xt[nt],
                        ya: Wt[nt],
                        // max distances for hover and spikes - for points that want to show but do not
                        // want to override other points, set distance/spikeDistance equal to max*Distance
                        // and it will not get filtered out but it will be guaranteed to have a greater
                        // distance than any point that calculated a real distance.
                        maxHoverDistance: Yt,
                        maxSpikeDistance: Ut,
                        // point properties - override all of these
                        index: !1,
                        // point index in trace - only used by plotly.js hoverdata consumers
                        distance: Math.min(yr, Yt),
                        // pixel distance or pseudo-distance
                        // distance/pseudo-distance for spikes. This distance should always be calculated
                        // as if in "closest" mode, and should only be set if this point should
                        // generate a spike.
                        spikeDistance: 1 / 0,
                        // in some cases the spikes have different positioning from the hover label
                        // they don't need x0/x1, just one position
                        xSpike: void 0,
                        ySpike: void 0,
                        // where and how to display the hover label
                        color: E.defaultLine,
                        // trace color
                        name: je.name,
                        x0: void 0,
                        x1: void 0,
                        y0: void 0,
                        y1: void 0,
                        xLabelVal: void 0,
                        yLabelVal: void 0,
                        zLabelVal: void 0,
                        text: void 0
                      }, Fe[Xe] && (vt.subplot = Fe[Xe]._subplot), Fe._splomScenes && Fe._splomScenes[je.uid] && (vt.scene = Fe._splomScenes[je.uid]), it === "array") {
                        var yn = V[Te];
                        "pointNumber" in yn ? (vt.index = yn.pointNumber, it = "closest") : (it = "", "xval" in yn && (Nt = yn.xval, it = "x"), "yval" in yn && (At = yn.yval, it = it ? "closest" : "y"));
                      } else pn !== void 0 && hi !== void 0 ? (Nt = pn, At = hi) : (Nt = _e[nt], At = Ye[nt]);
                      if (ut = tt.length, Yt !== 0)
                        if (je._module && je._module.hoverPoints) {
                          var Pn = je._module.hoverPoints(vt, Nt, At, it, {
                            finiteRange: !0,
                            hoverLayer: Fe._hoverlayer,
                            // options for splom when hovering on same axis
                            hoversubplots: Ve,
                            gd: _
                          });
                          if (Pn)
                            for (var kn, Wn = 0; Wn < Pn.length; Wn++)
                              kn = Pn[Wn], v(kn.x0) && v(kn.y0) && tt.push(ve(kn, at));
                        } else
                          p.log("Unrecognized trace type in hover:", je);
                      if (at === "closest" && tt.length > ut && (tt.splice(0, ut), yr = tt[0].distance), et && Ut !== 0 && tt.length === 0) {
                        vt.distance = Ut, vt.index = !1;
                        var Ln = je._module.hoverPoints(vt, Nt, At, "closest", {
                          hoverLayer: Fe._hoverlayer
                        });
                        if (Ln && (Ln = Ln.filter(function(ei) {
                          return ei.spikeDistance <= Ut;
                        })), Ln && Ln.length) {
                          var li, Bn = Ln.filter(function(ei) {
                            return ei.xa.showspikes && ei.xa.spikesnap !== "hovered data";
                          });
                          if (Bn.length) {
                            var ci = Bn[0];
                            v(ci.x0) && v(ci.y0) && (li = Ar(ci), (!Pt.vLinePoint || Pt.vLinePoint.spikeDistance > li.spikeDistance) && (Pt.vLinePoint = li));
                          }
                          var Gi = Ln.filter(function(ei) {
                            return ei.ya.showspikes && ei.ya.spikesnap !== "hovered data";
                          });
                          if (Gi.length) {
                            var pi = Gi[0];
                            v(pi.x0) && v(pi.y0) && (li = Ar(pi), (!Pt.hLinePoint || Pt.hLinePoint.spikeDistance > li.spikeDistance) && (Pt.hLinePoint = li));
                          }
                        }
                      }
                    }
                }
                Sr();
                function Yr(pn, hi, yn) {
                  for (var Pn = null, kn = 1 / 0, Wn, Ln = 0; Ln < pn.length; Ln++)
                    Ie && Ie._id !== pn[Ln].xa._id || Ue && Ue._id !== pn[Ln].ya._id || (Wn = pn[Ln].spikeDistance, yn && Ln === 0 && (Wn = -1 / 0), Wn <= kn && Wn <= hi && (Pn = pn[Ln], kn = Wn));
                  return Pn;
                }
                function Ar(pn) {
                  return pn ? {
                    xa: pn.xa,
                    ya: pn.ya,
                    x: pn.xSpike !== void 0 ? pn.xSpike : (pn.x0 + pn.x1) / 2,
                    y: pn.ySpike !== void 0 ? pn.ySpike : (pn.y0 + pn.y1) / 2,
                    distance: pn.distance,
                    spikeDistance: pn.spikeDistance,
                    curveNumber: pn.trace.index,
                    color: pn.color,
                    pointNumber: pn.index
                  } : null;
                }
                var pr = {
                  fullLayout: Fe,
                  container: Fe._hoverlayer,
                  event: V
                };
                _._spikepoints;
                var kr = {
                  vLinePoint: Pt.vLinePoint,
                  hLinePoint: Pt.hLinePoint
                };
                _._spikepoints = kr;
                var br = function() {
                  var pn = tt.filter(function(yn) {
                    return Ie && Ie._id === yn.xa._id && Ue && Ue._id === yn.ya._id;
                  }), hi = tt.filter(function(yn) {
                    return !(Ie && Ie._id === yn.xa._id && Ue && Ue._id === yn.ya._id);
                  });
                  pn.sort(W), hi.sort(W), tt = pn.concat(hi), tt = Re(tt, at);
                };
                br();
                var Gr = at.charAt(0), rn = (Gr === "x" || Gr === "y") && tt[0] && Z[tt[0].trace.type];
                if (et && Ut !== 0 && tt.length !== 0) {
                  var cn = tt.filter(function(pn) {
                    return pn.ya.showspikes;
                  }), Dr = Yr(cn, Ut, rn);
                  Pt.hLinePoint = Ar(Dr);
                  var Se = tt.filter(function(pn) {
                    return pn.xa.showspikes;
                  }), ae = Yr(Se, Ut, rn);
                  Pt.vLinePoint = Ar(ae);
                }
                if (tt.length === 0) {
                  var ft = x.unhoverRaw(_, V);
                  return et && (Pt.hLinePoint !== null || Pt.vLinePoint !== null) && Ge() && be(_, Pt, pr), ft;
                }
                if (et && Ge() && be(_, Pt, pr), P.isXYhover(it) && tt[0].length !== 0 && tt[0].trace.type !== "splom") {
                  var rt = tt[0];
                  z[rt.trace.type] ? tt = tt.filter(function(pn) {
                    return pn.trace.index === rt.trace.index;
                  }) : tt = [rt];
                  var gt = tt.length, wt = Ae("x", rt, Fe), Ct = Ae("y", rt, Fe);
                  Sr(wt, Ct);
                  var pt = [], dt = {}, St = 0, Ft = function(pn) {
                    var hi = z[pn.trace.type] ? ie(pn) : pn.trace.index;
                    if (!dt[hi])
                      St++, dt[hi] = St, pt.push(pn);
                    else {
                      var yn = dt[hi] - 1, Pn = pt[yn];
                      yn > 0 && Math.abs(pn.distance) < Math.abs(Pn.distance) && (pt[yn] = pn);
                    }
                  }, Gt;
                  for (Gt = 0; Gt < gt; Gt++)
                    Ft(tt[Gt]);
                  for (Gt = tt.length - 1; Gt > gt - 1; Gt--)
                    Ft(tt[Gt]);
                  tt = pt, br();
                }
                var Lt = _._hoverdata, $t = [], _t = K(_), zt = ee(_);
                for (lt = 0; lt < tt.length; lt++) {
                  var tr = tt[lt], nr = P.makeEventData(tr, tr.trace, tr.cd);
                  if (tr.hovertemplate !== !1) {
                    var xr = !1;
                    tr.cd[tr.index] && tr.cd[tr.index].ht && (xr = tr.cd[tr.index].ht), tr.hovertemplate = xr || tr.trace.hovertemplate || !1;
                  }
                  if (tr.xa && tr.ya) {
                    var Er = tr.x0 + tr.xa._offset, Jr = tr.x1 + tr.xa._offset, Ur = tr.y0 + tr.ya._offset, Br = tr.y1 + tr.ya._offset, dn = Math.min(Er, Jr), nn = Math.max(Er, Jr), Sn = Math.min(Ur, Br), ai = Math.max(Ur, Br);
                    nr.bbox = {
                      x0: dn + zt,
                      x1: nn + zt,
                      y0: Sn + _t,
                      y1: ai + _t
                    };
                  }
                  tr.eventData = [nr], $t.push(nr);
                }
                _._hoverdata = $t;
                var Dn = at === "y" && (ze.length > 1 || tt.length > 1) || at === "closest" && rr && tt.length > 1, on = E.combine(Fe.plot_bgcolor || E.background, Fe.paper_bgcolor), ri = X(tt, {
                  gd: _,
                  hovermode: at,
                  rotateLabels: Dn,
                  bgColor: on,
                  container: Fe._hoverlayer,
                  outerContainer: Fe._paper.node(),
                  commonLabelOpts: Fe.hoverlabel,
                  hoverdistance: Fe.hoverdistance
                }), Fi = ri.hoverLabels;
                if (P.isUnifiedHover(at) || (ne(Fi, Dn, Fe, ri.commonLabelBoundingBox), ue(Fi, Dn, Fe._invScaleX, Fe._invScaleY)), he && he.tagName) {
                  var Pi = F.getComponentMethod("annotations", "hasClickToShow")(_, $t);
                  w(l.select(he), Pi ? "pointer" : "");
                }
                !he || $ || !Me(_, V, Lt) || (Lt && _.emit("plotly_unhover", {
                  event: V,
                  points: Lt
                }), _.emit("plotly_hover", {
                  event: V,
                  points: _._hoverdata,
                  xaxes: xt,
                  yaxes: Wt,
                  xvals: _e,
                  yvals: Ye
                }));
              }
              function ie(_) {
                return [_.trace.index, _.index, _.x0, _.y0, _.name, _.attr, _.xa ? _.xa._id : "", _.ya ? _.ya._id : ""].join(",");
              }
              var ce = /<extra>([\s\S]*)<\/extra>/;
              function X(_, V) {
                var fe = V.gd, $ = fe._fullLayout, he = V.hovermode, me = V.rotateLabels, xe = V.bgColor, Fe = V.container, Ve = V.outerContainer, Be = V.commonLabelOpts || {};
                if (_.length === 0) return [[]];
                var Je = V.fontFamily || k.HOVERFONT, et = V.fontSize || k.HOVERFONTSIZE, at = V.fontWeight || $.font.weight, De = V.fontStyle || $.font.style, Ne = V.fontVariant || $.font.variant, Ie = V.fontTextcase || $.font.textcase, Ue = V.fontLineposition || $.font.lineposition, ot = V.fontShadow || $.font.shadow, ct = _[0], Tt = ct.xa, kt = ct.ya, Ot = he.charAt(0), Rt = Ot + "Label", xt = ct[Rt];
                if (xt === void 0 && Tt.type === "multicategory")
                  for (var Wt = 0; Wt < _.length && (xt = _[Wt][Rt], xt === void 0); Wt++)
                    ;
                var bt = oe(fe, Ve), jt = bt.top, qt = bt.width, Yt = bt.height, Ut = xt !== void 0 && ct.distance <= V.hoverdistance && (he === "x" || he === "y");
                if (Ut) {
                  var tt = !0, ze, _e;
                  for (ze = 0; ze < _.length; ze++)
                    if (tt && _[ze].zLabel === void 0 && (tt = !1), _e = _[ze].hoverinfo || _[ze].trace.hoverinfo, _e) {
                      var Ye = Array.isArray(_e) ? _e : _e.split("+");
                      if (Ye.indexOf("all") === -1 && Ye.indexOf(he) === -1) {
                        Ut = !1;
                        break;
                      }
                    }
                  tt && (Ut = !1);
                }
                var lt = Fe.selectAll("g.axistext").data(Ut ? [0] : []);
                lt.enter().append("g").classed("axistext", !0), lt.exit().remove();
                var Te = {
                  minX: 0,
                  maxX: 0,
                  minY: 0,
                  maxY: 0
                };
                if (lt.each(function() {
                  var ae = l.select(this), ft = p.ensureSingle(ae, "path", "", function(nn) {
                    nn.style({
                      "stroke-width": "1px"
                    });
                  }), rt = p.ensureSingle(ae, "text", "", function(nn) {
                    nn.attr("data-notex", 1);
                  }), gt = Be.bgcolor || E.defaultLine, wt = Be.bordercolor || E.contrast(gt), Ct = E.contrast(gt), pt = Be.font, dt = {
                    weight: pt.weight || at,
                    style: pt.style || De,
                    variant: pt.variant || Ne,
                    textcase: pt.textcase || Ie,
                    lineposition: pt.lineposition || Ue,
                    shadow: pt.shadow || ot,
                    family: pt.family || Je,
                    size: pt.size || et,
                    color: pt.color || Ct
                  };
                  ft.style({
                    fill: gt,
                    stroke: wt
                  }), rt.text(xt).call(S.font, dt).call(h.positionText, 0, 0).call(h.convertToTspans, fe), ae.attr("transform", "");
                  var St = oe(fe, rt.node()), Ft, Gt;
                  if (he === "x") {
                    var Lt = Tt.side === "top" ? "-" : "";
                    rt.attr("text-anchor", "middle").call(h.positionText, 0, Tt.side === "top" ? jt - St.bottom - te - re : jt - St.top + te + re), Ft = Tt._offset + (ct.x0 + ct.x1) / 2, Gt = kt._offset + (Tt.side === "top" ? 0 : kt._length);
                    var $t = St.width / 2 + re, _t = Ft;
                    Ft < $t ? _t = $t : Ft > $.width - $t && (_t = $.width - $t), ft.attr("d", "M" + (Ft - _t) + ",0L" + (Ft - _t + te) + "," + Lt + te + "H" + $t + "v" + Lt + (re * 2 + St.height) + "H" + -$t + "V" + Lt + te + "H" + (Ft - _t - te) + "Z"), Ft = _t, Te.minX = Ft - $t, Te.maxX = Ft + $t, Tt.side === "top" ? (Te.minY = Gt - (re * 2 + St.height), Te.maxY = Gt - re) : (Te.minY = Gt + re, Te.maxY = Gt + (re * 2 + St.height));
                  } else {
                    var zt, tr, nr;
                    kt.side === "right" ? (zt = "start", tr = 1, nr = "", Ft = Tt._offset + Tt._length) : (zt = "end", tr = -1, nr = "-", Ft = Tt._offset), Gt = kt._offset + (ct.y0 + ct.y1) / 2, rt.attr("text-anchor", zt), ft.attr("d", "M0,0L" + nr + te + "," + te + "V" + (re + St.height / 2) + "h" + nr + (re * 2 + St.width) + "V-" + (re + St.height / 2) + "H" + nr + te + "V-" + te + "Z"), Te.minY = Gt - (re + St.height / 2), Te.maxY = Gt + (re + St.height / 2), kt.side === "right" ? (Te.minX = Ft + te, Te.maxX = Ft + te + (re * 2 + St.width)) : (Te.minX = Ft - te - (re * 2 + St.width), Te.maxX = Ft - te);
                    var xr = St.height / 2, Er = jt - St.top - xr, Jr = "clip" + $._uid + "commonlabel" + kt._id, Ur;
                    if (Ft < St.width + 2 * re + te) {
                      Ur = "M-" + (te + re) + "-" + xr + "h-" + (St.width - re) + "V" + xr + "h" + (St.width - re) + "Z";
                      var Br = St.width - Ft + re;
                      h.positionText(rt, Br, Er), zt === "end" && rt.selectAll("tspan").each(function() {
                        var nn = l.select(this), Sn = S.tester.append("text").text(nn.text()).call(S.font, dt), ai = oe(fe, Sn.node());
                        Math.round(ai.width) < Math.round(St.width) && nn.attr("x", Br - ai.width), Sn.remove();
                      });
                    } else
                      h.positionText(rt, tr * (re + te), Er), Ur = null;
                    var dn = $._topclips.selectAll("#" + Jr).data(Ur ? [0] : []);
                    dn.enter().append("clipPath").attr("id", Jr).append("path"), dn.exit().remove(), dn.select("path").attr("d", Ur), S.setClipUrl(rt, Ur ? Jr : null, fe);
                  }
                  ae.attr("transform", y(Ft, Gt));
                }), P.isUnifiedHover(he)) {
                  Fe.selectAll("g.hovertext").remove();
                  var Oe = _.filter(function(ae) {
                    return ae.hoverinfo !== "none";
                  });
                  if (Oe.length === 0) return [];
                  var je = $.hoverlabel, Xe = je.font, nt = {
                    showlegend: !0,
                    legend: {
                      title: {
                        text: xt,
                        font: Xe
                      },
                      font: Xe,
                      bgcolor: je.bgcolor,
                      bordercolor: je.bordercolor,
                      borderwidth: 1,
                      tracegroupgap: 7,
                      traceorder: $.legend ? $.legend.traceorder : void 0,
                      orientation: "v"
                    }
                  }, it = {
                    font: Xe
                  };
                  I(nt, it, fe._fullData);
                  var Nt = it.legend;
                  Nt.entries = [];
                  for (var At = 0; At < Oe.length; At++) {
                    var vt = Oe[At];
                    if (vt.hoverinfo !== "none") {
                      var ut = U(vt, !0, he, $, xt), Pt = ut[0], rr = ut[1];
                      vt.name = rr, rr !== "" ? vt.text = rr + " : " + Pt : vt.text = Pt;
                      var lr = vt.cd[vt.index];
                      lr && (lr.mc && (vt.mc = lr.mc), lr.mcc && (vt.mc = lr.mcc), lr.mlc && (vt.mlc = lr.mlc), lr.mlcc && (vt.mlc = lr.mlcc), lr.mlw && (vt.mlw = lr.mlw), lr.mrc && (vt.mrc = lr.mrc), lr.dir && (vt.dir = lr.dir)), vt._distinct = !0, Nt.entries.push([vt]);
                    }
                  }
                  Nt.entries.sort(function(ae, ft) {
                    return ae[0].trace.index - ft[0].trace.index;
                  }), Nt.layer = Fe, Nt._inHover = !0, Nt._groupTitleFont = je.grouptitlefont, L(fe, Nt);
                  var Mr = Fe.select("g.legend"), Rr = oe(fe, Mr.node()), Pr = Rr.width + 2 * re, ir = Rr.height + 2 * re, Lr = Oe[0], yr = (Lr.x0 + Lr.x1) / 2, Sr = (Lr.y0 + Lr.y1) / 2, Yr = !(F.traceIs(Lr.trace, "bar-like") || F.traceIs(Lr.trace, "box-violin")), Ar, pr;
                  Ot === "y" ? Yr ? (pr = Sr - re, Ar = Sr + re) : (pr = Math.min.apply(null, Oe.map(function(ae) {
                    return Math.min(ae.y0, ae.y1);
                  })), Ar = Math.max.apply(null, Oe.map(function(ae) {
                    return Math.max(ae.y0, ae.y1);
                  }))) : pr = Ar = p.mean(Oe.map(function(ae) {
                    return (ae.y0 + ae.y1) / 2;
                  })) - ir / 2;
                  var kr, br;
                  Ot === "x" ? Yr ? (kr = yr + re, br = yr - re) : (kr = Math.max.apply(null, Oe.map(function(ae) {
                    return Math.max(ae.x0, ae.x1);
                  })), br = Math.min.apply(null, Oe.map(function(ae) {
                    return Math.min(ae.x0, ae.x1);
                  }))) : kr = br = p.mean(Oe.map(function(ae) {
                    return (ae.x0 + ae.x1) / 2;
                  })) - Pr / 2;
                  var Gr = Tt._offset, rn = kt._offset;
                  Ar += rn, kr += Gr, br += Gr - Pr, pr += rn - ir;
                  var cn, Dr;
                  return kr + Pr < qt && kr >= 0 ? cn = kr : br + Pr < qt && br >= 0 ? cn = br : Gr + Pr < qt ? cn = Gr : kr - yr < yr - br + Pr ? cn = qt - Pr : cn = 0, cn += re, Ar + ir < Yt && Ar >= 0 ? Dr = Ar : pr + ir < Yt && pr >= 0 ? Dr = pr : rn + ir < Yt ? Dr = rn : Ar - Sr < Sr - pr + ir ? Dr = Yt - ir : Dr = 0, Dr += re, Mr.attr("transform", y(cn - 1, Dr - 1)), Mr;
                }
                var Se = Fe.selectAll("g.hovertext").data(_, function(ae) {
                  return ie(ae);
                });
                return Se.enter().append("g").classed("hovertext", !0).each(function() {
                  var ae = l.select(this);
                  ae.append("rect").call(E.fill, E.addOpacity(xe, 0.8)), ae.append("text").classed("name", !0), ae.append("path").style("stroke-width", "1px"), ae.append("text").classed("nums", !0).call(S.font, {
                    weight: at,
                    style: De,
                    variant: Ne,
                    textcase: Ie,
                    lineposition: Ue,
                    shadow: ot,
                    family: Je,
                    size: et
                  });
                }), Se.exit().remove(), Se.each(function(ae) {
                  var ft = l.select(this).attr("transform", ""), rt = ae.color;
                  Array.isArray(rt) && (rt = rt[ae.eventData[0].pointNumber]);
                  var gt = ae.bgcolor || rt, wt = E.combine(E.opacity(gt) ? gt : E.defaultLine, xe), Ct = E.combine(E.opacity(rt) ? rt : E.defaultLine, xe), pt = ae.borderColor || E.contrast(wt), dt = U(ae, Ut, he, $, xt, ft), St = dt[0], Ft = dt[1], Gt = ft.select("text.nums").call(S.font, {
                    family: ae.fontFamily || Je,
                    size: ae.fontSize || et,
                    color: ae.fontColor || pt,
                    weight: ae.fontWeight || at,
                    style: ae.fontStyle || De,
                    variant: ae.fontVariant || Ne,
                    textcase: ae.fontTextcase || Ie,
                    lineposition: ae.fontLineposition || Ue,
                    shadow: ae.fontShadow || ot
                  }).text(St).attr("data-notex", 1).call(h.positionText, 0, 0).call(h.convertToTspans, fe), Lt = ft.select("text.name"), $t = 0, _t = 0;
                  if (Ft && Ft !== St) {
                    Lt.call(S.font, {
                      family: ae.fontFamily || Je,
                      size: ae.fontSize || et,
                      color: Ct,
                      weight: ae.fontWeight || at,
                      style: ae.fontStyle || De,
                      variant: ae.fontVariant || Ne,
                      textcase: ae.fontTextcase || Ie,
                      lineposition: ae.fontLineposition || Ue,
                      shadow: ae.fontShadow || ot
                    }).text(Ft).attr("data-notex", 1).call(h.positionText, 0, 0).call(h.convertToTspans, fe);
                    var zt = oe(fe, Lt.node());
                    $t = zt.width + 2 * re, _t = zt.height + 2 * re;
                  } else
                    Lt.remove(), ft.select("rect").remove();
                  ft.select("path").style({
                    fill: wt,
                    stroke: pt
                  });
                  var tr = ae.xa._offset + (ae.x0 + ae.x1) / 2, nr = ae.ya._offset + (ae.y0 + ae.y1) / 2, xr = Math.abs(ae.x1 - ae.x0), Er = Math.abs(ae.y1 - ae.y0), Jr = oe(fe, Gt.node()), Ur = Jr.width / $._invScaleX, Br = Jr.height / $._invScaleY;
                  ae.ty0 = (jt - Jr.top) / $._invScaleY, ae.bx = Ur + 2 * re, ae.by = Math.max(Br + 2 * re, _t), ae.anchor = "start", ae.txwidth = Ur, ae.tx2width = $t, ae.offset = 0;
                  var dn = (Ur + te + re + $t) * $._invScaleX, nn, Sn;
                  if (me)
                    ae.pos = tr, nn = nr + Er / 2 + dn <= Yt, Sn = nr - Er / 2 - dn >= 0, (ae.idealAlign === "top" || !nn) && Sn ? (nr -= Er / 2, ae.anchor = "end") : nn ? (nr += Er / 2, ae.anchor = "start") : ae.anchor = "middle", ae.crossPos = nr;
                  else {
                    if (ae.pos = nr, nn = tr + xr / 2 + dn <= qt, Sn = tr - xr / 2 - dn >= 0, (ae.idealAlign === "left" || !nn) && Sn)
                      tr -= xr / 2, ae.anchor = "end";
                    else if (nn)
                      tr += xr / 2, ae.anchor = "start";
                    else {
                      ae.anchor = "middle";
                      var ai = dn / 2, Dn = tr + ai - qt, on = tr - ai;
                      Dn > 0 && (tr -= Dn), on < 0 && (tr += -on);
                    }
                    ae.crossPos = tr;
                  }
                  Gt.attr("text-anchor", ae.anchor), $t && Lt.attr("text-anchor", ae.anchor), ft.attr("transform", y(tr, nr) + (me ? C(A) : ""));
                }), {
                  hoverLabels: Se,
                  commonLabelBoundingBox: Te
                };
              }
              function U(_, V, fe, $, he, me) {
                var xe = "", Fe = "";
                _.nameOverride !== void 0 && (_.name = _.nameOverride), _.name && (_.trace._meta && (_.name = p.templateString(_.name, _.trace._meta)), xe = we(_.name, _.nameLength));
                var Ve = fe.charAt(0), Be = Ve === "x" ? "y" : "x";
                _.zLabel !== void 0 ? (_.xLabel !== void 0 && (Fe += "x: " + _.xLabel + "<br>"), _.yLabel !== void 0 && (Fe += "y: " + _.yLabel + "<br>"), _.trace.type !== "choropleth" && _.trace.type !== "choroplethmapbox" && (Fe += (Fe ? "z: " : "") + _.zLabel)) : V && _[Ve + "Label"] === he ? Fe = _[Be + "Label"] || "" : _.xLabel === void 0 ? _.yLabel !== void 0 && _.trace.type !== "scattercarpet" && (Fe = _.yLabel) : _.yLabel === void 0 ? Fe = _.xLabel : Fe = "(" + _.xLabel + ", " + _.yLabel + ")", (_.text || _.text === 0) && !Array.isArray(_.text) && (Fe += (Fe ? "<br>" : "") + _.text), _.extraText !== void 0 && (Fe += (Fe ? "<br>" : "") + _.extraText), me && Fe === "" && !_.hovertemplate && (xe === "" && me.remove(), Fe = xe);
                var Je = _.hovertemplate || !1;
                if (Je) {
                  var et = _.hovertemplateLabels || _;
                  _[Ve + "Label"] !== he && (et[Ve + "other"] = et[Ve + "Val"], et[Ve + "otherLabel"] = et[Ve + "Label"]), Fe = p.hovertemplateString(Je, et, $._d3locale, _.eventData[0] || {}, _.trace._meta), Fe = Fe.replace(ce, function(at, De) {
                    return xe = we(De, _.nameLength), "";
                  });
                }
                return [Fe, xe];
              }
              function ne(_, V, fe, $) {
                var he = V ? "xa" : "ya", me = V ? "ya" : "xa", xe = 0, Fe = 1, Ve = _.size(), Be = new Array(Ve), Je = 0, et = $.minX, at = $.maxX, De = $.minY, Ne = $.maxY, Ie = function(_e) {
                  return _e * fe._invScaleX;
                }, Ue = function(_e) {
                  return _e * fe._invScaleY;
                };
                _.each(function(_e) {
                  var Ye = _e[he], lt = _e[me], Te = Ye._id.charAt(0) === "x", Oe = Ye.range;
                  Je === 0 && Oe && Oe[0] > Oe[1] !== Te && (Fe = -1);
                  var je = 0, Xe = Te ? fe.width : fe.height;
                  if (fe.hovermode === "x" || fe.hovermode === "y") {
                    var nt = se(_e, V), it = _e.anchor, Nt = it === "end" ? -1 : 1, At, vt;
                    if (it === "middle")
                      At = _e.crossPos + (Te ? Ue(nt.y - _e.by / 2) : Ie(_e.bx / 2 + _e.tx2width / 2)), vt = At + (Te ? Ue(_e.by) : Ie(_e.bx));
                    else if (Te)
                      At = _e.crossPos + Ue(te + nt.y) - Ue(_e.by / 2 - te), vt = At + Ue(_e.by);
                    else {
                      var ut = Ie(Nt * te + nt.x), Pt = ut + Ie(Nt * _e.bx);
                      At = _e.crossPos + Math.min(ut, Pt), vt = _e.crossPos + Math.max(ut, Pt);
                    }
                    Te ? De !== void 0 && Ne !== void 0 && Math.min(vt, Ne) - Math.max(At, De) > 1 && (lt.side === "left" ? (je = lt._mainLinePosition, Xe = fe.width) : Xe = lt._mainLinePosition) : et !== void 0 && at !== void 0 && Math.min(vt, at) - Math.max(At, et) > 1 && (lt.side === "top" ? (je = lt._mainLinePosition, Xe = fe.height) : Xe = lt._mainLinePosition);
                  }
                  Be[Je++] = [{
                    datum: _e,
                    traceIndex: _e.trace.index,
                    dp: 0,
                    pos: _e.pos,
                    posref: _e.posref,
                    size: _e.by * (Te ? N : 1) / 2,
                    pmin: je,
                    pmax: Xe
                  }];
                }), Be.sort(function(_e, Ye) {
                  return _e[0].posref - Ye[0].posref || // for equal positions, sort trace indices increasing or decreasing
                  // depending on whether the axis is reversed or not... so stacked
                  // traces will generally keep their order even if one trace adds
                  // nothing to the stack.
                  Fe * (Ye[0].traceIndex - _e[0].traceIndex);
                });
                var ot, ct, Tt, kt, Ot, Rt, xt;
                function Wt(_e) {
                  var Ye = _e[0], lt = _e[_e.length - 1];
                  if (ct = Ye.pmin - Ye.pos - Ye.dp + Ye.size, Tt = lt.pos + lt.dp + lt.size - Ye.pmax, ct > 0.01) {
                    for (Ot = _e.length - 1; Ot >= 0; Ot--) _e[Ot].dp += ct;
                    ot = !1;
                  }
                  if (!(Tt < 0.01)) {
                    if (ct < -0.01) {
                      for (Ot = _e.length - 1; Ot >= 0; Ot--) _e[Ot].dp -= Tt;
                      ot = !1;
                    }
                    if (ot) {
                      var Te = 0;
                      for (kt = 0; kt < _e.length; kt++)
                        Rt = _e[kt], Rt.pos + Rt.dp + Rt.size > Ye.pmax && Te++;
                      for (kt = _e.length - 1; kt >= 0 && !(Te <= 0); kt--)
                        Rt = _e[kt], Rt.pos > Ye.pmax - 1 && (Rt.del = !0, Te--);
                      for (kt = 0; kt < _e.length && !(Te <= 0); kt++)
                        if (Rt = _e[kt], Rt.pos < Ye.pmin + 1)
                          for (Rt.del = !0, Te--, Tt = Rt.size * 2, Ot = _e.length - 1; Ot >= 0; Ot--) _e[Ot].dp -= Tt;
                      for (kt = _e.length - 1; kt >= 0 && !(Te <= 0); kt--)
                        Rt = _e[kt], Rt.pos + Rt.dp + Rt.size > Ye.pmax && (Rt.del = !0, Te--);
                    }
                  }
                }
                for (; !ot && xe <= Ve; ) {
                  for (xe++, ot = !0, kt = 0; kt < Be.length - 1; ) {
                    var bt = Be[kt], jt = Be[kt + 1], qt = bt[bt.length - 1], Yt = jt[0];
                    if (ct = qt.pos + qt.dp + qt.size - Yt.pos - Yt.dp + Yt.size, ct > 0.01 && qt.pmin === Yt.pmin && qt.pmax === Yt.pmax) {
                      for (Ot = jt.length - 1; Ot >= 0; Ot--) jt[Ot].dp += ct;
                      for (bt.push.apply(bt, jt), Be.splice(kt + 1, 1), xt = 0, Ot = bt.length - 1; Ot >= 0; Ot--) xt += bt[Ot].dp;
                      for (Tt = xt / bt.length, Ot = bt.length - 1; Ot >= 0; Ot--) bt[Ot].dp -= Tt;
                      ot = !1;
                    } else kt++;
                  }
                  Be.forEach(Wt);
                }
                for (kt = Be.length - 1; kt >= 0; kt--) {
                  var Ut = Be[kt];
                  for (Ot = Ut.length - 1; Ot >= 0; Ot--) {
                    var tt = Ut[Ot], ze = tt.datum;
                    ze.offset = tt.dp, ze.del = tt.del;
                  }
                }
              }
              function se(_, V) {
                var fe = 0, $ = _.offset;
                return V && ($ *= -j, fe = _.offset * Y), {
                  x: fe,
                  y: $
                };
              }
              function le(_) {
                var V = {
                  start: 1,
                  end: -1,
                  middle: 0
                }[_.anchor], fe = V * (te + re), $ = fe + V * (_.txwidth + re), he = _.anchor === "middle";
                return he && (fe -= _.tx2width / 2, $ += _.txwidth / 2 + re), {
                  alignShift: V,
                  textShiftX: fe,
                  text2ShiftX: $
                };
              }
              function ue(_, V, fe, $) {
                var he = function(xe) {
                  return xe * fe;
                }, me = function(xe) {
                  return xe * $;
                };
                _.each(function(xe) {
                  var Fe = l.select(this);
                  if (xe.del) return Fe.remove();
                  var Ve = Fe.select("text.nums"), Be = xe.anchor, Je = Be === "end" ? -1 : 1, et = le(xe), at = se(xe, V), De = at.x, Ne = at.y, Ie = Be === "middle";
                  Fe.select("path").attr("d", Ie ? (
                    // middle aligned: rect centered on data
                    "M-" + he(xe.bx / 2 + xe.tx2width / 2) + "," + me(Ne - xe.by / 2) + "h" + he(xe.bx) + "v" + me(xe.by) + "h-" + he(xe.bx) + "Z"
                  ) : (
                    // left or right aligned: side rect with arrow to data
                    "M0,0L" + he(Je * te + De) + "," + me(te + Ne) + "v" + me(xe.by / 2 - te) + "h" + he(Je * xe.bx) + "v-" + me(xe.by) + "H" + he(Je * te + De) + "V" + me(Ne - te) + "Z"
                  ));
                  var Ue = De + et.textShiftX, ot = Ne + xe.ty0 - xe.by / 2 + re, ct = xe.textAlign || "auto";
                  ct !== "auto" && (ct === "left" && Be !== "start" ? (Ve.attr("text-anchor", "start"), Ue = Ie ? -xe.bx / 2 - xe.tx2width / 2 + re : -xe.bx - re) : ct === "right" && Be !== "end" && (Ve.attr("text-anchor", "end"), Ue = Ie ? xe.bx / 2 - xe.tx2width / 2 - re : xe.bx + re)), Ve.call(h.positionText, he(Ue), me(ot)), xe.tx2width && (Fe.select("text.name").call(h.positionText, he(et.text2ShiftX + et.alignShift * re + De), me(Ne + xe.ty0 - xe.by / 2 + re)), Fe.select("rect").call(S.setRect, he(et.text2ShiftX + (et.alignShift - 1) * xe.tx2width / 2 + De), me(Ne - xe.by / 2 - 1), he(xe.tx2width), me(xe.by + 2)));
                });
              }
              function ve(_, V) {
                var fe = _.index, $ = _.trace || {}, he = _.cd[0], me = _.cd[fe] || {};
                function xe(at) {
                  return at || v(at) && at === 0;
                }
                var Fe = Array.isArray(fe) ? function(at, De) {
                  var Ne = p.castOption(he, fe, at);
                  return xe(Ne) ? Ne : p.extractOption({}, $, "", De);
                } : function(at, De) {
                  return p.extractOption(me, $, at, De);
                };
                function Ve(at, De, Ne) {
                  var Ie = Fe(De, Ne);
                  xe(Ie) && (_[at] = Ie);
                }
                if (Ve("hoverinfo", "hi", "hoverinfo"), Ve("bgcolor", "hbg", "hoverlabel.bgcolor"), Ve("borderColor", "hbc", "hoverlabel.bordercolor"), Ve("fontFamily", "htf", "hoverlabel.font.family"), Ve("fontSize", "hts", "hoverlabel.font.size"), Ve("fontColor", "htc", "hoverlabel.font.color"), Ve("fontWeight", "htw", "hoverlabel.font.weight"), Ve("fontStyle", "hty", "hoverlabel.font.style"), Ve("fontVariant", "htv", "hoverlabel.font.variant"), Ve("nameLength", "hnl", "hoverlabel.namelength"), Ve("textAlign", "hta", "hoverlabel.align"), _.posref = V === "y" || V === "closest" && $.orientation === "h" ? _.xa._offset + (_.x0 + _.x1) / 2 : _.ya._offset + (_.y0 + _.y1) / 2, _.x0 = p.constrain(_.x0, 0, _.xa._length), _.x1 = p.constrain(_.x1, 0, _.xa._length), _.y0 = p.constrain(_.y0, 0, _.ya._length), _.y1 = p.constrain(_.y1, 0, _.ya._length), _.xLabelVal !== void 0 && (_.xLabel = "xLabel" in _ ? _.xLabel : T.hoverLabelText(_.xa, _.xLabelVal, $.xhoverformat), _.xVal = _.xa.c2d(_.xLabelVal)), _.yLabelVal !== void 0 && (_.yLabel = "yLabel" in _ ? _.yLabel : T.hoverLabelText(_.ya, _.yLabelVal, $.yhoverformat), _.yVal = _.ya.c2d(_.yLabelVal)), _.zLabelVal !== void 0 && _.zLabel === void 0 && (_.zLabel = String(_.zLabelVal)), !isNaN(_.xerr) && !(_.xa.type === "log" && _.xerr <= 0)) {
                  var Be = T.tickText(_.xa, _.xa.c2l(_.xerr), "hover").text;
                  _.xerrneg !== void 0 ? _.xLabel += " +" + Be + " / -" + T.tickText(_.xa, _.xa.c2l(_.xerrneg), "hover").text : _.xLabel += " ± " + Be, V === "x" && (_.distance += 1);
                }
                if (!isNaN(_.yerr) && !(_.ya.type === "log" && _.yerr <= 0)) {
                  var Je = T.tickText(_.ya, _.ya.c2l(_.yerr), "hover").text;
                  _.yerrneg !== void 0 ? _.yLabel += " +" + Je + " / -" + T.tickText(_.ya, _.ya.c2l(_.yerrneg), "hover").text : _.yLabel += " ± " + Je, V === "y" && (_.distance += 1);
                }
                var et = _.hoverinfo || _.trace.hoverinfo;
                return et && et !== "all" && (et = Array.isArray(et) ? et : et.split("+"), et.indexOf("x") === -1 && (_.xLabel = void 0), et.indexOf("y") === -1 && (_.yLabel = void 0), et.indexOf("z") === -1 && (_.zLabel = void 0), et.indexOf("text") === -1 && (_.text = void 0), et.indexOf("name") === -1 && (_.name = void 0)), _;
              }
              function be(_, V, fe) {
                var $ = fe.container, he = fe.fullLayout, me = he._size, xe = fe.event, Fe = !!V.hLinePoint, Ve = !!V.vLinePoint, Be, Je;
                if ($.selectAll(".spikeline").remove(), !!(Ve || Fe)) {
                  var et = E.combine(he.plot_bgcolor, he.paper_bgcolor);
                  if (Fe) {
                    var at = V.hLinePoint, De, Ne;
                    Be = at && at.xa, Je = at && at.ya;
                    var Ie = Je.spikesnap;
                    Ie === "cursor" ? (De = xe.pointerX, Ne = xe.pointerY) : (De = Be._offset + at.x, Ne = Je._offset + at.y);
                    var Ue = f.readability(at.color, et) < 1.5 ? E.contrast(et) : at.color, ot = Je.spikemode, ct = Je.spikethickness, Tt = Je.spikecolor || Ue, kt = T.getPxPosition(_, Je), Ot, Rt;
                    if (ot.indexOf("toaxis") !== -1 || ot.indexOf("across") !== -1) {
                      if (ot.indexOf("toaxis") !== -1 && (Ot = kt, Rt = De), ot.indexOf("across") !== -1) {
                        var xt = Je._counterDomainMin, Wt = Je._counterDomainMax;
                        Je.anchor === "free" && (xt = Math.min(xt, Je.position), Wt = Math.max(Wt, Je.position)), Ot = me.l + xt * me.w, Rt = me.l + Wt * me.w;
                      }
                      $.insert("line", ":first-child").attr({
                        x1: Ot,
                        x2: Rt,
                        y1: Ne,
                        y2: Ne,
                        "stroke-width": ct,
                        stroke: Tt,
                        "stroke-dasharray": S.dashStyle(Je.spikedash, ct)
                      }).classed("spikeline", !0).classed("crisp", !0), $.insert("line", ":first-child").attr({
                        x1: Ot,
                        x2: Rt,
                        y1: Ne,
                        y2: Ne,
                        "stroke-width": ct + 2,
                        stroke: et
                      }).classed("spikeline", !0).classed("crisp", !0);
                    }
                    ot.indexOf("marker") !== -1 && $.insert("circle", ":first-child").attr({
                      cx: kt + (Je.side !== "right" ? ct : -ct),
                      cy: Ne,
                      r: ct,
                      fill: Tt
                    }).classed("spikeline", !0);
                  }
                  if (Ve) {
                    var bt = V.vLinePoint, jt, qt;
                    Be = bt && bt.xa, Je = bt && bt.ya;
                    var Yt = Be.spikesnap;
                    Yt === "cursor" ? (jt = xe.pointerX, qt = xe.pointerY) : (jt = Be._offset + bt.x, qt = Je._offset + bt.y);
                    var Ut = f.readability(bt.color, et) < 1.5 ? E.contrast(et) : bt.color, tt = Be.spikemode, ze = Be.spikethickness, _e = Be.spikecolor || Ut, Ye = T.getPxPosition(_, Be), lt, Te;
                    if (tt.indexOf("toaxis") !== -1 || tt.indexOf("across") !== -1) {
                      if (tt.indexOf("toaxis") !== -1 && (lt = Ye, Te = qt), tt.indexOf("across") !== -1) {
                        var Oe = Be._counterDomainMin, je = Be._counterDomainMax;
                        Be.anchor === "free" && (Oe = Math.min(Oe, Be.position), je = Math.max(je, Be.position)), lt = me.t + (1 - je) * me.h, Te = me.t + (1 - Oe) * me.h;
                      }
                      $.insert("line", ":first-child").attr({
                        x1: jt,
                        x2: jt,
                        y1: lt,
                        y2: Te,
                        "stroke-width": ze,
                        stroke: _e,
                        "stroke-dasharray": S.dashStyle(Be.spikedash, ze)
                      }).classed("spikeline", !0).classed("crisp", !0), $.insert("line", ":first-child").attr({
                        x1: jt,
                        x2: jt,
                        y1: lt,
                        y2: Te,
                        "stroke-width": ze + 2,
                        stroke: et
                      }).classed("spikeline", !0).classed("crisp", !0);
                    }
                    tt.indexOf("marker") !== -1 && $.insert("circle", ":first-child").attr({
                      cx: jt,
                      cy: Ye - (Be.side !== "top" ? ze : -ze),
                      r: ze,
                      fill: _e
                    }).classed("spikeline", !0);
                  }
                }
              }
              function Me(_, V, fe) {
                if (!fe || fe.length !== _._hoverdata.length) return !0;
                for (var $ = fe.length - 1; $ >= 0; $--) {
                  var he = fe[$], me = _._hoverdata[$];
                  if (he.curveNumber !== me.curveNumber || String(he.pointNumber) !== String(me.pointNumber) || String(he.pointNumbers) !== String(me.pointNumbers))
                    return !0;
                }
                return !1;
              }
              function Ge(_, V) {
                return !0;
              }
              function we(_, V) {
                return h.plainText(_ || "", {
                  len: V,
                  allowedTags: ["br", "sub", "sup", "b", "i", "em"]
                });
              }
              function Re(_, V) {
                for (var fe = V.charAt(0), $ = [], he = [], me = [], xe = 0; xe < _.length; xe++) {
                  var Fe = _[xe];
                  F.traceIs(Fe.trace, "bar-like") || F.traceIs(Fe.trace, "box-violin") ? me.push(Fe) : Fe.trace[fe + "period"] ? he.push(Fe) : $.push(Fe);
                }
                return $.concat(he).concat(me);
              }
              function Ae(_, V, fe) {
                var $ = V[_ + "a"], he = V[_ + "Val"], me = V.cd[0];
                if ($.type === "category" || $.type === "multicategory") he = $._categoriesMap[he];
                else if ($.type === "date") {
                  var xe = V.trace[_ + "periodalignment"];
                  if (xe) {
                    var Fe = V.cd[V.index], Ve = Fe[_ + "Start"];
                    Ve === void 0 && (Ve = Fe[_]);
                    var Be = Fe[_ + "End"];
                    Be === void 0 && (Be = Fe[_]);
                    var Je = Be - Ve;
                    xe === "end" ? he += Je : xe === "middle" && (he += Je / 2);
                  }
                  he = $.d2c(he);
                }
                return me && me.t && me.t.posLetter === $._id && (fe.boxmode === "group" || fe.violinmode === "group") && (he += me.t.dPos), he;
              }
              function K(_) {
                return _.offsetTop + _.clientTop;
              }
              function ee(_) {
                return _.offsetLeft + _.clientLeft;
              }
              function oe(_, V) {
                var fe = _._fullLayout, $ = V.getBoundingClientRect(), he = $.left, me = $.top, xe = he + $.width, Fe = me + $.height, Ve = p.apply3DTransform(fe._invTransform)(he, me), Be = p.apply3DTransform(fe._invTransform)(xe, Fe), Je = Ve[0], et = Ve[1], at = Be[0], De = Be[1];
                return {
                  x: Je,
                  y: et,
                  width: at - Je,
                  height: De - et,
                  top: Math.min(et, De),
                  left: Math.min(Je, at),
                  right: Math.max(Je, at),
                  bottom: Math.max(et, De)
                };
              }
            }
          ),
          /***/
          6132: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(6308), f = i(624).isUnifiedHover;
              s.exports = function(g, y, C, m) {
                m = m || {};
                var h = y.legend;
                function w(S) {
                  m.font[S] || (m.font[S] = h ? y.legend.font[S] : y.font[S]);
                }
                y && f(y.hovermode) && (m.font || (m.font = {}), w("size"), w("family"), w("color"), w("weight"), w("style"), w("variant"), h ? (m.bgcolor || (m.bgcolor = v.combine(y.legend.bgcolor, y.paper_bgcolor)), m.bordercolor || (m.bordercolor = y.legend.bordercolor)) : m.bgcolor || (m.bgcolor = y.paper_bgcolor)), C("hoverlabel.bgcolor", m.bgcolor), C("hoverlabel.bordercolor", m.bordercolor), C("hoverlabel.namelength", m.namelength), l.coerceFont(C, "hoverlabel.font", m.font), C("hoverlabel.align", m.align);
              };
            }
          ),
          /***/
          1008: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(5460);
              s.exports = function(p, g) {
                function y(C, m) {
                  return g[C] !== void 0 ? g[C] : l.coerce(p, g, v, C, m);
                }
                return y("clickmode"), y("hoversubplots"), y("hovermode");
              };
            }
          ),
          /***/
          3024: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3400), f = i(6476), p = i(624), g = i(5460), y = i(3292);
              s.exports = {
                moduleType: "component",
                name: "fx",
                constants: i(2456),
                schema: {
                  layout: g
                },
                attributes: i(5756),
                layoutAttributes: g,
                supplyLayoutGlobalDefaults: i(1976),
                supplyDefaults: i(5448),
                supplyLayoutDefaults: i(8336),
                calc: i(5056),
                getDistanceFunction: p.getDistanceFunction,
                getClosest: p.getClosest,
                inbox: p.inbox,
                quadrature: p.quadrature,
                appendArrayPointValue: p.appendArrayPointValue,
                castHoverOption: m,
                castHoverinfo: h,
                hover: y.hover,
                unhover: f.unhover,
                loneHover: y.loneHover,
                loneUnhover: C,
                click: i(2376)
              };
              function C(w) {
                var S = v.isD3Selection(w) ? w : l.select(w);
                S.selectAll("g.hovertext").remove(), S.selectAll(".spikeline").remove();
              }
              function m(w, S, E) {
                return v.castOption(w, S, "hoverlabel." + E);
              }
              function h(w, S, E) {
                function x(T) {
                  return v.coerceHoverinfo({
                    hoverinfo: T
                  }, {
                    _module: w._module
                  }, S);
                }
                return v.castOption(w, E, "hoverinfo", x);
              }
            }
          ),
          /***/
          5460: (
            /***/
            function(s, c, i) {
              var l = i(2456), v = i(5376), f = v({
                editType: "none"
              });
              f.family.dflt = l.HOVERFONT, f.size.dflt = l.HOVERFONTSIZE, s.exports = {
                clickmode: {
                  valType: "flaglist",
                  flags: ["event", "select"],
                  dflt: "event",
                  editType: "plot",
                  extras: ["none"]
                },
                dragmode: {
                  valType: "enumerated",
                  values: ["zoom", "pan", "select", "lasso", "drawclosedpath", "drawopenpath", "drawline", "drawrect", "drawcircle", "orbit", "turntable", !1],
                  dflt: "zoom",
                  editType: "modebar"
                },
                hovermode: {
                  valType: "enumerated",
                  values: ["x", "y", "closest", !1, "x unified", "y unified"],
                  dflt: "closest",
                  editType: "modebar"
                },
                hoversubplots: {
                  valType: "enumerated",
                  values: ["single", "overlaying", "axis"],
                  dflt: "overlaying",
                  editType: "none"
                },
                hoverdistance: {
                  valType: "integer",
                  min: -1,
                  dflt: 20,
                  editType: "none"
                },
                spikedistance: {
                  valType: "integer",
                  min: -1,
                  dflt: -1,
                  editType: "none"
                },
                hoverlabel: {
                  bgcolor: {
                    valType: "color",
                    editType: "none"
                  },
                  bordercolor: {
                    valType: "color",
                    editType: "none"
                  },
                  font: f,
                  grouptitlefont: v({
                    editType: "none"
                  }),
                  align: {
                    valType: "enumerated",
                    values: ["left", "right", "auto"],
                    dflt: "auto",
                    editType: "none"
                  },
                  namelength: {
                    valType: "integer",
                    min: -1,
                    dflt: 15,
                    editType: "none"
                  },
                  editType: "none"
                },
                selectdirection: {
                  valType: "enumerated",
                  values: ["h", "v", "d", "any"],
                  dflt: "any",
                  editType: "none"
                }
              };
            }
          ),
          /***/
          8336: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(5460), f = i(1008), p = i(6132);
              s.exports = function(y, C) {
                function m(T, F) {
                  return l.coerce(y, C, v, T, F);
                }
                var h = f(y, C);
                h && (m("hoverdistance"), m("spikedistance"));
                var w = m("dragmode");
                w === "select" && m("selectdirection");
                var S = C._has("mapbox"), E = C._has("geo"), x = C._basePlotModules.length;
                C.dragmode === "zoom" && ((S || E) && x === 1 || S && E && x === 2) && (C.dragmode = "pan"), p(y, C, m), l.coerceFont(m, "hoverlabel.grouptitlefont", C.hoverlabel.font);
              };
            }
          ),
          /***/
          1976: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(6132), f = i(5460);
              s.exports = function(g, y) {
                function C(m, h) {
                  return l.coerce(g, y, f, m, h);
                }
                v(g, y, C);
              };
            }
          ),
          /***/
          2704: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(3756).counter, f = i(6968).u, p = i(3816).idRegex, g = i(1780), y = {
                rows: {
                  valType: "integer",
                  min: 1,
                  editType: "plot"
                },
                roworder: {
                  valType: "enumerated",
                  values: ["top to bottom", "bottom to top"],
                  dflt: "top to bottom",
                  editType: "plot"
                },
                columns: {
                  valType: "integer",
                  min: 1,
                  editType: "plot"
                },
                subplots: {
                  valType: "info_array",
                  freeLength: !0,
                  dimensions: 2,
                  items: {
                    valType: "enumerated",
                    values: [v("xy").toString(), ""],
                    editType: "plot"
                  },
                  editType: "plot"
                },
                xaxes: {
                  valType: "info_array",
                  freeLength: !0,
                  items: {
                    valType: "enumerated",
                    values: [p.x.toString(), ""],
                    editType: "plot"
                  },
                  editType: "plot"
                },
                yaxes: {
                  valType: "info_array",
                  freeLength: !0,
                  items: {
                    valType: "enumerated",
                    values: [p.y.toString(), ""],
                    editType: "plot"
                  },
                  editType: "plot"
                },
                pattern: {
                  valType: "enumerated",
                  values: ["independent", "coupled"],
                  dflt: "coupled",
                  editType: "plot"
                },
                xgap: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  editType: "plot"
                },
                ygap: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  editType: "plot"
                },
                domain: f({
                  name: "grid",
                  editType: "plot",
                  noGridCell: !0
                }, {}),
                xside: {
                  valType: "enumerated",
                  values: ["bottom", "bottom plot", "top plot", "top"],
                  dflt: "bottom plot",
                  editType: "plot"
                },
                yside: {
                  valType: "enumerated",
                  values: ["left", "left plot", "right plot", "right"],
                  dflt: "left plot",
                  editType: "plot"
                },
                editType: "plot"
              };
              function C(E, x, T) {
                var F = x[T + "axes"], P = Object.keys((E._splomAxes || {})[T] || {});
                if (Array.isArray(F)) return F;
                if (P.length) return P;
              }
              function m(E, x) {
                var T = E.grid || {}, F = C(x, T, "x"), P = C(x, T, "y");
                if (!E.grid && !F && !P) return;
                var k = Array.isArray(T.subplots) && Array.isArray(T.subplots[0]), I = Array.isArray(F), L = Array.isArray(P), A = I && F !== T.xaxes && L && P !== T.yaxes, O, N;
                k ? (O = T.subplots.length, N = T.subplots[0].length) : (L && (O = P.length), I && (N = F.length));
                var Y = g.newContainer(x, "grid");
                function j(U, ne) {
                  return l.coerce(T, Y, y, U, ne);
                }
                var te = j("rows", O), re = j("columns", N);
                if (!(te * re > 1)) {
                  delete x.grid;
                  return;
                }
                if (!k && !I && !L) {
                  var z = j("pattern") === "independent";
                  z && (k = !0);
                }
                Y._hasSubplotGrid = k;
                var Z = j("roworder"), W = Z === "top to bottom", q = k ? 0.2 : 0.1, ie = k ? 0.3 : 0.1, ce, X;
                A && x._splomGridDflt && (ce = x._splomGridDflt.xside, X = x._splomGridDflt.yside), Y._domains = {
                  x: h("x", j, q, ce, re),
                  y: h("y", j, ie, X, te, W)
                };
              }
              function h(E, x, T, F, P, k) {
                var I = x(E + "gap", T), L = x("domain." + E);
                x(E + "side", F);
                for (var A = new Array(P), O = L[0], N = (L[1] - O) / (P - I), Y = N * (1 - I), j = 0; j < P; j++) {
                  var te = O + N * j;
                  A[k ? P - 1 - j : j] = [te, te + Y];
                }
                return A;
              }
              function w(E, x) {
                var T = x.grid;
                if (!(!T || !T._domains)) {
                  var F = E.grid || {}, P = x._subplots, k = T._hasSubplotGrid, I = T.rows, L = T.columns, A = T.pattern === "independent", O, N, Y, j, te, re, z, Z = T._axisMap = {};
                  if (k) {
                    var W = F.subplots || [];
                    re = T.subplots = new Array(I);
                    var q = 1;
                    for (O = 0; O < I; O++) {
                      var ie = re[O] = new Array(L), ce = W[O] || [];
                      for (N = 0; N < L; N++)
                        if (A ? (te = q === 1 ? "xy" : "x" + q + "y" + q, q++) : te = ce[N], ie[N] = "", P.cartesian.indexOf(te) !== -1) {
                          if (z = te.indexOf("y"), Y = te.slice(0, z), j = te.slice(z), Z[Y] !== void 0 && Z[Y] !== N || Z[j] !== void 0 && Z[j] !== O)
                            continue;
                          ie[N] = te, Z[Y] = N, Z[j] = O;
                        }
                    }
                  } else {
                    var X = C(x, F, "x"), U = C(x, F, "y");
                    T.xaxes = S(X, P.xaxis, L, Z, "x"), T.yaxes = S(U, P.yaxis, I, Z, "y");
                  }
                  var ne = T._anchors = {}, se = T.roworder === "top to bottom";
                  for (var le in Z) {
                    var ue = le.charAt(0), ve = T[ue + "side"], be, Me, Ge;
                    if (ve.length < 8)
                      ne[le] = "free";
                    else if (ue === "x") {
                      if (ve.charAt(0) === "t" === se ? (be = 0, Me = 1, Ge = I) : (be = I - 1, Me = -1, Ge = -1), k) {
                        var we = Z[le];
                        for (O = be; O !== Ge; O += Me)
                          if (te = re[O][we], !!te && (z = te.indexOf("y"), te.slice(0, z) === le)) {
                            ne[le] = te.slice(z);
                            break;
                          }
                      } else
                        for (O = be; O !== Ge; O += Me)
                          if (j = T.yaxes[O], P.cartesian.indexOf(le + j) !== -1) {
                            ne[le] = j;
                            break;
                          }
                    } else if (ve.charAt(0) === "l" ? (be = 0, Me = 1, Ge = L) : (be = L - 1, Me = -1, Ge = -1), k) {
                      var Re = Z[le];
                      for (O = be; O !== Ge; O += Me)
                        if (te = re[Re][O], !!te && (z = te.indexOf("y"), te.slice(z) === le)) {
                          ne[le] = te.slice(0, z);
                          break;
                        }
                    } else
                      for (O = be; O !== Ge; O += Me)
                        if (Y = T.xaxes[O], P.cartesian.indexOf(Y + le) !== -1) {
                          ne[le] = Y;
                          break;
                        }
                  }
                }
              }
              function S(E, x, T, F, P) {
                var k = new Array(T), I;
                function L(A, O) {
                  x.indexOf(O) !== -1 && F[O] === void 0 ? (k[A] = O, F[O] = A) : k[A] = "";
                }
                if (Array.isArray(E))
                  for (I = 0; I < T; I++)
                    L(I, E[I]);
                else
                  for (L(0, P), I = 1; I < T; I++)
                    L(I, P + (I + 1));
                return k;
              }
              s.exports = {
                moduleType: "component",
                name: "grid",
                schema: {
                  layout: {
                    grid: y
                  }
                },
                layoutAttributes: y,
                sizeDefaults: m,
                contentDefaults: w
              };
            }
          ),
          /***/
          5760: (
            /***/
            function(s, c, i) {
              var l = i(3816), v = i(1780).templatedArray;
              i(6208), s.exports = v("image", {
                visible: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "arraydraw"
                },
                source: {
                  valType: "string",
                  editType: "arraydraw"
                },
                layer: {
                  valType: "enumerated",
                  values: ["below", "above"],
                  dflt: "above",
                  editType: "arraydraw"
                },
                sizex: {
                  valType: "number",
                  dflt: 0,
                  editType: "arraydraw"
                },
                sizey: {
                  valType: "number",
                  dflt: 0,
                  editType: "arraydraw"
                },
                sizing: {
                  valType: "enumerated",
                  values: ["fill", "contain", "stretch"],
                  dflt: "contain",
                  editType: "arraydraw"
                },
                opacity: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 1,
                  editType: "arraydraw"
                },
                x: {
                  valType: "any",
                  dflt: 0,
                  editType: "arraydraw"
                },
                y: {
                  valType: "any",
                  dflt: 0,
                  editType: "arraydraw"
                },
                xanchor: {
                  valType: "enumerated",
                  values: ["left", "center", "right"],
                  dflt: "left",
                  editType: "arraydraw"
                },
                yanchor: {
                  valType: "enumerated",
                  values: ["top", "middle", "bottom"],
                  dflt: "top",
                  editType: "arraydraw"
                },
                xref: {
                  valType: "enumerated",
                  values: ["paper", l.idRegex.x.toString()],
                  dflt: "paper",
                  editType: "arraydraw"
                },
                yref: {
                  valType: "enumerated",
                  values: ["paper", l.idRegex.y.toString()],
                  dflt: "paper",
                  editType: "arraydraw"
                },
                editType: "arraydraw"
              });
            }
          ),
          /***/
          3556: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(6896);
              s.exports = function(p, g, y, C) {
                g = g || {};
                var m = y === "log" && g.type === "linear", h = y === "linear" && g.type === "log";
                if (m || h) {
                  for (var w = p._fullLayout.images, S = g._id.charAt(0), E, x, T = 0; T < w.length; T++)
                    if (E = w[T], x = "images[" + T + "].", E[S + "ref"] === g._id) {
                      var F = E[S], P = E["size" + S], k = null, I = null;
                      if (m) {
                        k = v(F, g.range);
                        var L = P / Math.pow(10, k) / 2;
                        I = 2 * Math.log(L + Math.sqrt(1 + L * L)) / Math.LN10;
                      } else
                        k = Math.pow(10, F), I = k * (Math.pow(10, P / 2) - Math.pow(10, -P / 2));
                      l(k) ? l(I) || (I = null) : (k = null, I = null), C(x + S, k), C(x + "size" + S, I);
                    }
                }
              };
            }
          ),
          /***/
          7404: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(1272), p = i(5760), g = "images";
              s.exports = function(m, h) {
                var w = {
                  name: g,
                  handleItemDefaults: y
                };
                f(m, h, w);
              };
              function y(C, m, h) {
                function w(L, A) {
                  return l.coerce(C, m, p, L, A);
                }
                var S = w("source"), E = w("visible", !!S);
                if (!E) return m;
                w("layer"), w("xanchor"), w("yanchor"), w("sizex"), w("sizey"), w("sizing"), w("opacity");
                for (var x = {
                  _fullLayout: h
                }, T = ["x", "y"], F = 0; F < 2; F++) {
                  var P = T[F], k = v.coerceRef(C, m, x, P, "paper", void 0);
                  if (k !== "paper") {
                    var I = v.getFromId(x, k);
                    I._imgIndices.push(m._index);
                  }
                  v.coercePosition(m, x, w, k, P, 0);
                }
                return m;
              }
            }
          ),
          /***/
          963: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3616), f = i(4460), p = i(9811), g = i(9616);
              s.exports = function(C) {
                var m = C._fullLayout, h = [], w = {}, S = [], E, x;
                for (x = 0; x < m.images.length; x++) {
                  var T = m.images[x];
                  if (T.visible)
                    if (T.layer === "below" && T.xref !== "paper" && T.yref !== "paper") {
                      E = p.ref2id(T.xref) + p.ref2id(T.yref);
                      var F = m._plots[E];
                      if (!F) {
                        S.push(T);
                        continue;
                      }
                      F.mainplot && (E = F.mainplot.id), w[E] || (w[E] = []), w[E].push(T);
                    } else T.layer === "above" ? h.push(T) : S.push(T);
                }
                var P = {
                  x: {
                    left: {
                      sizing: "xMin",
                      offset: 0
                    },
                    center: {
                      sizing: "xMid",
                      offset: -1 / 2
                    },
                    right: {
                      sizing: "xMax",
                      offset: -1
                    }
                  },
                  y: {
                    top: {
                      sizing: "YMin",
                      offset: 0
                    },
                    middle: {
                      sizing: "YMid",
                      offset: -1 / 2
                    },
                    bottom: {
                      sizing: "YMax",
                      offset: -1
                    }
                  }
                };
                function k(j) {
                  var te = l.select(this);
                  if (this._imgSrc !== j.source)
                    if (te.attr("xmlns", g.svg), j.source && j.source.slice(0, 5) === "data:")
                      te.attr("xlink:href", j.source), this._imgSrc = j.source;
                    else {
                      var re = new Promise((function(z) {
                        var Z = new Image();
                        this.img = Z, Z.setAttribute("crossOrigin", "anonymous"), Z.onerror = W, Z.onload = function() {
                          var q = document.createElement("canvas");
                          q.width = this.width, q.height = this.height;
                          var ie = q.getContext("2d", {
                            willReadFrequently: !0
                          });
                          ie.drawImage(this, 0, 0);
                          var ce = q.toDataURL("image/png");
                          te.attr("xlink:href", ce), z();
                        }, te.on("error", W), Z.src = j.source, this._imgSrc = j.source;
                        function W() {
                          te.remove(), z();
                        }
                      }).bind(this));
                      C._promises.push(re);
                    }
                }
                function I(j) {
                  var te = l.select(this), re = f.getFromId(C, j.xref), z = f.getFromId(C, j.yref), Z = f.getRefType(j.xref) === "domain", W = f.getRefType(j.yref) === "domain", q = m._size, ie, ce;
                  re !== void 0 ? ie = typeof j.xref == "string" && Z ? re._length * j.sizex : Math.abs(re.l2p(j.sizex) - re.l2p(0)) : ie = j.sizex * q.w, z !== void 0 ? ce = typeof j.yref == "string" && W ? z._length * j.sizey : Math.abs(z.l2p(j.sizey) - z.l2p(0)) : ce = j.sizey * q.h;
                  var X = ie * P.x[j.xanchor].offset, U = ce * P.y[j.yanchor].offset, ne = P.x[j.xanchor].sizing + P.y[j.yanchor].sizing, se, le;
                  switch (re !== void 0 ? se = typeof j.xref == "string" && Z ? re._length * j.x + re._offset : re.r2p(j.x) + re._offset : se = j.x * q.w + q.l, se += X, z !== void 0 ? le = typeof j.yref == "string" && W ? (
                    // consistent with "paper" yref value, where positive values
                    // move up the page
                    z._length * (1 - j.y) + z._offset
                  ) : z.r2p(j.y) + z._offset : le = q.h - j.y * q.h + q.t, le += U, j.sizing) {
                    case "fill":
                      ne += " slice";
                      break;
                    case "stretch":
                      ne = "none";
                      break;
                  }
                  te.attr({
                    x: se,
                    y: le,
                    width: ie,
                    height: ce,
                    preserveAspectRatio: ne,
                    opacity: j.opacity
                  });
                  var ue = re && f.getRefType(j.xref) !== "domain" ? re._id : "", ve = z && f.getRefType(j.yref) !== "domain" ? z._id : "", be = ue + ve;
                  v.setClipUrl(te, be ? "clip" + m._uid + be : null, C);
                }
                var L = m._imageLowerLayer.selectAll("image").data(S), A = m._imageUpperLayer.selectAll("image").data(h);
                L.enter().append("image"), A.enter().append("image"), L.exit().remove(), A.exit().remove(), L.each(function(j) {
                  k.bind(this)(j), I.bind(this)(j);
                }), A.each(function(j) {
                  k.bind(this)(j), I.bind(this)(j);
                });
                var O = Object.keys(m._plots);
                for (x = 0; x < O.length; x++) {
                  E = O[x];
                  var N = m._plots[E];
                  if (N.imagelayer) {
                    var Y = N.imagelayer.selectAll("image").data(w[E] || []);
                    Y.enter().append("image"), Y.exit().remove(), Y.each(function(j) {
                      k.bind(this)(j), I.bind(this)(j);
                    });
                  }
                }
              };
            }
          ),
          /***/
          7402: (
            /***/
            function(s, c, i) {
              s.exports = {
                moduleType: "component",
                name: "images",
                layoutAttributes: i(5760),
                supplyLayoutDefaults: i(7404),
                includeBasePlot: i(6632)("images"),
                draw: i(963),
                convertCoords: i(3556)
              };
            }
          ),
          /***/
          3800: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(2548);
              s.exports = {
                // not really a 'subplot' attribute container,
                // but this is the flag we use to denote attributes that
                // support yaxis, yaxis2, yaxis3, ... counters
                _isSubplotObj: !0,
                visible: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "legend"
                },
                bgcolor: {
                  valType: "color",
                  editType: "legend"
                },
                bordercolor: {
                  valType: "color",
                  dflt: v.defaultLine,
                  editType: "legend"
                },
                borderwidth: {
                  valType: "number",
                  min: 0,
                  dflt: 0,
                  editType: "legend"
                },
                font: l({
                  editType: "legend"
                }),
                grouptitlefont: l({
                  editType: "legend"
                }),
                orientation: {
                  valType: "enumerated",
                  values: ["v", "h"],
                  dflt: "v",
                  editType: "legend"
                },
                traceorder: {
                  valType: "flaglist",
                  flags: ["reversed", "grouped"],
                  extras: ["normal"],
                  editType: "legend"
                },
                tracegroupgap: {
                  valType: "number",
                  min: 0,
                  dflt: 10,
                  editType: "legend"
                },
                entrywidth: {
                  valType: "number",
                  min: 0,
                  editType: "legend"
                },
                entrywidthmode: {
                  valType: "enumerated",
                  values: ["fraction", "pixels"],
                  dflt: "pixels",
                  editType: "legend"
                },
                indentation: {
                  valType: "number",
                  min: -15,
                  dflt: 0,
                  editType: "legend"
                },
                itemsizing: {
                  valType: "enumerated",
                  values: ["trace", "constant"],
                  dflt: "trace",
                  editType: "legend"
                },
                itemwidth: {
                  valType: "number",
                  min: 30,
                  dflt: 30,
                  editType: "legend"
                },
                itemclick: {
                  valType: "enumerated",
                  values: ["toggle", "toggleothers", !1],
                  dflt: "toggle",
                  editType: "legend"
                },
                itemdoubleclick: {
                  valType: "enumerated",
                  values: ["toggle", "toggleothers", !1],
                  dflt: "toggleothers",
                  editType: "legend"
                },
                groupclick: {
                  valType: "enumerated",
                  values: ["toggleitem", "togglegroup"],
                  dflt: "togglegroup",
                  editType: "legend"
                },
                x: {
                  valType: "number",
                  editType: "legend"
                },
                xref: {
                  valType: "enumerated",
                  dflt: "paper",
                  values: ["container", "paper"],
                  editType: "layoutstyle"
                },
                xanchor: {
                  valType: "enumerated",
                  values: ["auto", "left", "center", "right"],
                  dflt: "left",
                  editType: "legend"
                },
                y: {
                  valType: "number",
                  editType: "legend"
                },
                yref: {
                  valType: "enumerated",
                  dflt: "paper",
                  values: ["container", "paper"],
                  editType: "layoutstyle"
                },
                yanchor: {
                  valType: "enumerated",
                  values: ["auto", "top", "middle", "bottom"],
                  editType: "legend"
                },
                uirevision: {
                  valType: "any",
                  editType: "none"
                },
                valign: {
                  valType: "enumerated",
                  values: ["top", "middle", "bottom"],
                  dflt: "middle",
                  editType: "legend"
                },
                title: {
                  text: {
                    valType: "string",
                    dflt: "",
                    editType: "legend"
                  },
                  font: l({
                    editType: "legend"
                  }),
                  side: {
                    valType: "enumerated",
                    values: ["top", "left", "top left", "top center", "top right"],
                    editType: "legend"
                  },
                  editType: "legend"
                },
                editType: "legend"
              };
            }
          ),
          /***/
          5196: (
            /***/
            function(s) {
              s.exports = {
                scrollBarWidth: 6,
                scrollBarMinHeight: 20,
                scrollBarColor: "#808BA4",
                scrollBarMargin: 4,
                scrollBarEnterAttrs: {
                  rx: 20,
                  ry: 3,
                  width: 0,
                  height: 0
                },
                // number of px between legend title and (left) side of legend (always in x direction and from inner border)
                titlePad: 2,
                // number of px between each legend item (x and/or y direction)
                itemGap: 5
              };
            }
          ),
          /***/
          7864: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3400), f = i(1780), p = i(5464), g = i(3800), y = i(4859), C = i(2451);
              function m(h, w, S, E) {
                var x = w[h] || {}, T = f.newContainer(S, h);
                function F(Ge, we) {
                  return v.coerce(x, T, g, Ge, we);
                }
                var P = v.coerceFont(F, "font", S.font);
                F("bgcolor", S.paper_bgcolor), F("bordercolor");
                var k = F("visible");
                if (k) {
                  for (var I, L = function(Ge, we) {
                    var Re = I._input, Ae = I;
                    return v.coerce(Re, Ae, p, Ge, we);
                  }, A = S.font || {}, O = v.coerceFont(F, "grouptitlefont", A, {
                    overrideDflt: {
                      size: Math.round(A.size * 1.1)
                    }
                  }), N = 0, Y = !1, j = "normal", te = (S.shapes || []).filter(function(Ge) {
                    return Ge.showlegend;
                  }), re = E.concat(te).filter(function(Ge) {
                    return h === (Ge.legend || "legend");
                  }), z = 0; z < re.length; z++)
                    if (I = re[z], !!I.visible) {
                      var Z = I._isShape;
                      (I.showlegend || I._dfltShowLegend && !(I._module && I._module.attributes && I._module.attributes.showlegend && I._module.attributes.showlegend.dflt === !1)) && (N++, I.showlegend && (Y = !0, (!Z && l.traceIs(I, "pie-like") || I._input.showlegend === !0) && N++), v.coerceFont(L, "legendgrouptitle.font", O)), (!Z && l.traceIs(I, "bar") && S.barmode === "stack" || ["tonextx", "tonexty"].indexOf(I.fill) !== -1) && (j = C.isGrouped({
                        traceorder: j
                      }) ? "grouped+reversed" : "reversed"), I.legendgroup !== void 0 && I.legendgroup !== "" && (j = C.isReversed({
                        traceorder: j
                      }) ? "reversed+grouped" : "grouped");
                    }
                  var W = v.coerce(w, S, y, "showlegend", Y && N > (h === "legend" ? 1 : 0));
                  if (W === !1 && (S[h] = void 0), !(W === !1 && !x.uirevision) && (F("uirevision", S.uirevision), W !== !1)) {
                    F("borderwidth");
                    var q = F("orientation"), ie = F("yref"), ce = F("xref"), X = q === "h", U = ie === "paper", ne = ce === "paper", se, le, ue, ve = "left";
                    X ? (se = 0, l.getComponentMethod("rangeslider", "isVisible")(w.xaxis) ? U ? (le = 1.1, ue = "bottom") : (le = 1, ue = "top") : U ? (le = -0.1, ue = "top") : (le = 0, ue = "bottom")) : (le = 1, ue = "auto", ne ? se = 1.02 : (se = 1, ve = "right")), v.coerce(x, T, {
                      x: {
                        valType: "number",
                        editType: "legend",
                        min: ne ? -2 : 0,
                        max: ne ? 3 : 1,
                        dflt: se
                      }
                    }, "x"), v.coerce(x, T, {
                      y: {
                        valType: "number",
                        editType: "legend",
                        min: U ? -2 : 0,
                        max: U ? 3 : 1,
                        dflt: le
                      }
                    }, "y"), F("traceorder", j), C.isGrouped(S[h]) && F("tracegroupgap"), F("entrywidth"), F("entrywidthmode"), F("indentation"), F("itemsizing"), F("itemwidth"), F("itemclick"), F("itemdoubleclick"), F("groupclick"), F("xanchor", ve), F("yanchor", ue), F("valign"), v.noneOrAll(x, T, ["x", "y"]);
                    var be = F("title.text");
                    if (be) {
                      F("title.side", X ? "left" : "top");
                      var Me = v.extendFlat({}, P, {
                        size: v.bigFont(P.size)
                      });
                      v.coerceFont(F, "title.font", Me);
                    }
                  }
                }
              }
              s.exports = function(w, S, E) {
                var x, T = E.slice(), F = S.shapes;
                if (F)
                  for (x = 0; x < F.length; x++) {
                    var P = F[x];
                    if (P.showlegend) {
                      var k = {
                        _input: P._input,
                        visible: P.visible,
                        showlegend: P.showlegend,
                        legend: P.legend
                      };
                      T.push(k);
                    }
                  }
                var I = ["legend"];
                for (x = 0; x < T.length; x++)
                  v.pushUnique(I, T[x].legend);
                for (S._legends = [], x = 0; x < I.length; x++) {
                  var L = I[x];
                  m(L, w, S, T), S[L] && S[L].visible && (S[L]._id = L), S._legends.push(L);
                }
              };
            }
          ),
          /***/
          1140: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3400), f = i(7316), p = i(4040), g = i(5924), y = i(6476), C = i(3616), m = i(6308), h = i(2736), w = i(3048), S = i(5196), E = i(4284), x = E.LINE_SPACING, T = E.FROM_TL, F = E.FROM_BR, P = i(3076), k = i(2012), I = i(2451), L = 1, A = /^legend[0-9]*$/;
              s.exports = function(le, ue) {
                if (ue)
                  N(le, ue);
                else {
                  var ve = le._fullLayout, be = ve._legends, Me = ve._infolayer.selectAll('[class^="legend"]');
                  Me.each(function() {
                    var Ae = l.select(this), K = Ae.attr("class"), ee = K.split(" ")[0];
                    ee.match(A) && be.indexOf(ee) === -1 && Ae.remove();
                  });
                  for (var Ge = 0; Ge < be.length; Ge++) {
                    var we = be[Ge], Re = le._fullLayout[we];
                    N(le, Re);
                  }
                }
              };
              function O(se, le, ue) {
                if (!(le.title.side !== "top center" && le.title.side !== "top right")) {
                  var ve = le.title.font, be = ve.size * x, Me = 0, Ge = se.node(), we = C.bBox(Ge).width;
                  le.title.side === "top center" ? Me = 0.5 * (le._width - 2 * ue - 2 * S.titlePad - we) : le.title.side === "top right" && (Me = le._width - 2 * ue - 2 * S.titlePad - we), h.positionText(se, ue + S.titlePad + Me, ue + be);
                }
              }
              function N(se, le) {
                var ue = le || {}, ve = se._fullLayout, be = ne(ue), Me, Ge, we = ue._inHover;
                if (we ? (Ge = ue.layer, Me = "hover") : (Ge = ve._infolayer, Me = be), !!Ge) {
                  Me += ve._uid, se._legendMouseDownTime || (se._legendMouseDownTime = 0);
                  var Re;
                  if (we) {
                    if (!ue.entries) return;
                    Re = P(ue.entries, ue);
                  } else {
                    for (var Ae = (se.calcdata || []).slice(), K = ve.shapes, ee = 0; ee < K.length; ee++) {
                      var oe = K[ee];
                      if (oe.showlegend) {
                        var _ = {
                          _isShape: !0,
                          _fullInput: oe,
                          index: oe._index,
                          name: oe.name || oe.label.text || "shape " + oe._index,
                          legend: oe.legend,
                          legendgroup: oe.legendgroup,
                          legendgrouptitle: oe.legendgrouptitle,
                          legendrank: oe.legendrank,
                          legendwidth: oe.legendwidth,
                          showlegend: oe.showlegend,
                          visible: oe.visible,
                          opacity: oe.opacity,
                          mode: oe.type === "line" ? "lines" : "markers",
                          line: oe.line,
                          marker: {
                            line: oe.line,
                            color: oe.fillcolor,
                            size: 12,
                            symbol: oe.type === "rect" ? "square" : oe.type === "circle" ? "circle" : (
                              // case of path
                              "hexagon2"
                            )
                          }
                        };
                        Ae.push([{
                          trace: _
                        }]);
                      }
                    }
                    Re = ve.showlegend && P(Ae, ue, ve._legends.length > 1);
                  }
                  var V = ve.hiddenlabels || [];
                  if (!we && (!ve.showlegend || !Re.length))
                    return Ge.selectAll("." + be).remove(), ve._topdefs.select("#" + Me).remove(), f.autoMargin(se, be);
                  var fe = v.ensureSingle(Ge, "g", be, function(et) {
                    we || et.attr("pointer-events", "all");
                  }), $ = v.ensureSingleById(ve._topdefs, "clipPath", Me, function(et) {
                    et.append("rect");
                  }), he = v.ensureSingle(fe, "rect", "bg", function(et) {
                    et.attr("shape-rendering", "crispEdges");
                  });
                  he.call(m.stroke, ue.bordercolor).call(m.fill, ue.bgcolor).style("stroke-width", ue.borderwidth + "px");
                  var me = v.ensureSingle(fe, "g", "scrollbox"), xe = ue.title;
                  ue._titleWidth = 0, ue._titleHeight = 0;
                  var Fe;
                  xe.text ? (Fe = v.ensureSingle(me, "text", be + "titletext"), Fe.attr("text-anchor", "start").call(C.font, xe.font).text(xe.text), Z(Fe, me, se, ue, L)) : me.selectAll("." + be + "titletext").remove();
                  var Ve = v.ensureSingle(fe, "rect", "scrollbar", function(et) {
                    et.attr(S.scrollBarEnterAttrs).call(m.fill, S.scrollBarColor);
                  }), Be = me.selectAll("g.groups").data(Re);
                  Be.enter().append("g").attr("class", "groups"), Be.exit().remove();
                  var Je = Be.selectAll("g.traces").data(v.identity);
                  Je.enter().append("g").attr("class", "traces"), Je.exit().remove(), Je.style("opacity", function(et) {
                    var at = et[0].trace;
                    return p.traceIs(at, "pie-like") ? V.indexOf(et[0].label) !== -1 ? 0.5 : 1 : at.visible === "legendonly" ? 0.5 : 1;
                  }).each(function() {
                    l.select(this).call(te, se, ue);
                  }).call(k, se, ue).each(function() {
                    we || l.select(this).call(z, se, be);
                  }), v.syncOrAsync([f.previousPromises, function() {
                    return ie(se, Be, Je, ue);
                  }, function() {
                    var et = ve._size, at = ue.borderwidth, De = ue.xref === "paper", Ne = ue.yref === "paper";
                    if (xe.text && O(Fe, ue, at), !we) {
                      var Ie, Ue;
                      De ? Ie = et.l + et.w * ue.x - T[X(ue)] * ue._width : Ie = ve.width * ue.x - T[X(ue)] * ue._width, Ne ? Ue = et.t + et.h * (1 - ue.y) - T[U(ue)] * ue._effHeight : Ue = ve.height * (1 - ue.y) - T[U(ue)] * ue._effHeight;
                      var ot = ce(se, be, Ie, Ue);
                      if (ot) return;
                      if (ve.margin.autoexpand) {
                        var ct = Ie, Tt = Ue;
                        Ie = De ? v.constrain(Ie, 0, ve.width - ue._width) : ct, Ue = Ne ? v.constrain(Ue, 0, ve.height - ue._effHeight) : Tt, Ie !== ct && v.log("Constrain " + be + ".x to make legend fit inside graph"), Ue !== Tt && v.log("Constrain " + be + ".y to make legend fit inside graph");
                      }
                      C.setTranslate(fe, Ie, Ue);
                    }
                    if (Ve.on(".drag", null), fe.on("wheel", null), we || ue._height <= ue._maxHeight || se._context.staticPlot) {
                      var kt = ue._effHeight;
                      we && (kt = ue._height), he.attr({
                        width: ue._width - at,
                        height: kt - at,
                        x: at / 2,
                        y: at / 2
                      }), C.setTranslate(me, 0, 0), $.select("rect").attr({
                        width: ue._width - 2 * at,
                        height: kt - 2 * at,
                        x: at,
                        y: at
                      }), C.setClipUrl(me, Me, se), C.setRect(Ve, 0, 0, 0, 0), delete ue._scrollY;
                    } else {
                      var Ot = Math.max(S.scrollBarMinHeight, ue._effHeight * ue._effHeight / ue._height), Rt = ue._effHeight - Ot - 2 * S.scrollBarMargin, xt = ue._height - ue._effHeight, Wt = Rt / xt, bt = Math.min(ue._scrollY || 0, xt);
                      he.attr({
                        width: ue._width - 2 * at + S.scrollBarWidth + S.scrollBarMargin,
                        height: ue._effHeight - at,
                        x: at / 2,
                        y: at / 2
                      }), $.select("rect").attr({
                        width: ue._width - 2 * at + S.scrollBarWidth + S.scrollBarMargin,
                        height: ue._effHeight - 2 * at,
                        x: at,
                        y: at + bt
                      }), C.setClipUrl(me, Me, se), Ye(bt, Ot, Wt), fe.on("wheel", function() {
                        bt = v.constrain(ue._scrollY + l.event.deltaY / Rt * xt, 0, xt), Ye(bt, Ot, Wt), bt !== 0 && bt !== xt && l.event.preventDefault();
                      });
                      var jt, qt, Yt, Ut = function(Xe, nt, it) {
                        var Nt = (it - nt) / Wt + Xe;
                        return v.constrain(Nt, 0, xt);
                      }, tt = function(Xe, nt, it) {
                        var Nt = (nt - it) / Wt + Xe;
                        return v.constrain(Nt, 0, xt);
                      }, ze = l.behavior.drag().on("dragstart", function() {
                        var Xe = l.event.sourceEvent;
                        Xe.type === "touchstart" ? jt = Xe.changedTouches[0].clientY : jt = Xe.clientY, Yt = bt;
                      }).on("drag", function() {
                        var Xe = l.event.sourceEvent;
                        Xe.buttons === 2 || Xe.ctrlKey || (Xe.type === "touchmove" ? qt = Xe.changedTouches[0].clientY : qt = Xe.clientY, bt = Ut(Yt, jt, qt), Ye(bt, Ot, Wt));
                      });
                      Ve.call(ze);
                      var _e = l.behavior.drag().on("dragstart", function() {
                        var Xe = l.event.sourceEvent;
                        Xe.type === "touchstart" && (jt = Xe.changedTouches[0].clientY, Yt = bt);
                      }).on("drag", function() {
                        var Xe = l.event.sourceEvent;
                        Xe.type === "touchmove" && (qt = Xe.changedTouches[0].clientY, bt = tt(Yt, jt, qt), Ye(bt, Ot, Wt));
                      });
                      me.call(_e);
                    }
                    function Ye(Xe, nt, it) {
                      ue._scrollY = se._fullLayout[be]._scrollY = Xe, C.setTranslate(me, 0, -Xe), C.setRect(Ve, ue._width, S.scrollBarMargin + Xe * it, S.scrollBarWidth, nt), $.select("rect").attr("y", at + Xe);
                    }
                    if (se._context.edits.legendPosition) {
                      var lt, Te, Oe, je;
                      fe.classed("cursor-move", !0), y.init({
                        element: fe.node(),
                        gd: se,
                        prepFn: function(Xe) {
                          if (Xe.target !== Ve.node()) {
                            var nt = C.getTranslate(fe);
                            Oe = nt.x, je = nt.y;
                          }
                        },
                        moveFn: function(Xe, nt) {
                          if (Oe !== void 0 && je !== void 0) {
                            var it = Oe + Xe, Nt = je + nt;
                            C.setTranslate(fe, it, Nt), lt = y.align(it, ue._width, et.l, et.l + et.w, ue.xanchor), Te = y.align(Nt + ue._height, -ue._height, et.t + et.h, et.t, ue.yanchor);
                          }
                        },
                        doneFn: function() {
                          if (lt !== void 0 && Te !== void 0) {
                            var Xe = {};
                            Xe[be + ".x"] = lt, Xe[be + ".y"] = Te, p.call("_guiRelayout", se, Xe);
                          }
                        },
                        clickFn: function(Xe, nt) {
                          var it = Ge.selectAll("g.traces").filter(function() {
                            var Nt = this.getBoundingClientRect();
                            return nt.clientX >= Nt.left && nt.clientX <= Nt.right && nt.clientY >= Nt.top && nt.clientY <= Nt.bottom;
                          });
                          it.size() > 0 && j(se, fe, it, Xe, nt);
                        }
                      });
                    }
                  }], se);
                }
              }
              function Y(se, le, ue) {
                var ve = se[0], be = ve.width, Me = le.entrywidthmode, Ge = ve.trace.legendwidth || le.entrywidth;
                return Me === "fraction" ? le._maxWidth * Ge : ue + (Ge || be);
              }
              function j(se, le, ue, ve, be) {
                var Me = ue.data()[0][0].trace, Ge = {
                  event: be,
                  node: ue.node(),
                  curveNumber: Me.index,
                  expandedIndex: Me._expandedIndex,
                  data: se.data,
                  layout: se.layout,
                  frames: se._transitionData._frames,
                  config: se._context,
                  fullData: se._fullData,
                  fullLayout: se._fullLayout
                };
                Me._group && (Ge.group = Me._group), p.traceIs(Me, "pie-like") && (Ge.label = ue.datum()[0].label);
                var we = g.triggerHandler(se, "plotly_legendclick", Ge);
                if (ve === 1) {
                  if (we === !1) return;
                  le._clickTimeout = setTimeout(function() {
                    se._fullLayout && w(ue, se, ve);
                  }, se._context.doubleClickDelay);
                } else if (ve === 2) {
                  le._clickTimeout && clearTimeout(le._clickTimeout), se._legendMouseDownTime = 0;
                  var Re = g.triggerHandler(se, "plotly_legenddoubleclick", Ge);
                  Re !== !1 && we !== !1 && w(ue, se, ve);
                }
              }
              function te(se, le, ue) {
                var ve = ne(ue), be = se.data()[0][0], Me = be.trace, Ge = p.traceIs(Me, "pie-like"), we = !ue._inHover && le._context.edits.legendText && !Ge, Re = ue._maxNameLength, Ae, K;
                be.groupTitle ? (Ae = be.groupTitle.text, K = be.groupTitle.font) : (K = ue.font, ue.entries ? Ae = be.text : (Ae = Ge ? be.label : Me.name, Me._meta && (Ae = v.templateString(Ae, Me._meta))));
                var ee = v.ensureSingle(se, "text", ve + "text");
                ee.attr("text-anchor", "start").call(C.font, K).text(we ? re(Ae, Re) : Ae);
                var oe = ue.indentation + ue.itemwidth + S.itemGap * 2;
                h.positionText(ee, oe, 0), we ? ee.call(h.makeEditable, {
                  gd: le,
                  text: Ae
                }).call(Z, se, le, ue).on("edit", function(_) {
                  this.text(re(_, Re)).call(Z, se, le, ue);
                  var V = be.trace._fullInput || {}, fe = {};
                  if (p.hasTransform(V, "groupby")) {
                    var $ = p.getTransformIndices(V, "groupby"), he = $[$.length - 1], me = v.keyedContainer(V, "transforms[" + he + "].styles", "target", "value.name");
                    me.set(be.trace._group, _), fe = me.constructUpdate();
                  } else
                    fe.name = _;
                  return V._isShape ? p.call("_guiRelayout", le, "shapes[" + Me.index + "].name", fe.name) : p.call("_guiRestyle", le, fe, Me.index);
                }) : Z(ee, se, le, ue);
              }
              function re(se, le) {
                var ue = Math.max(4, le);
                if (se && se.trim().length >= ue / 2) return se;
                se = se || "";
                for (var ve = ue - se.length; ve > 0; ve--) se += " ";
                return se;
              }
              function z(se, le, ue) {
                var ve = le._context.doubleClickDelay, be, Me = 1, Ge = v.ensureSingle(se, "rect", ue + "toggle", function(we) {
                  le._context.staticPlot || we.style("cursor", "pointer").attr("pointer-events", "all"), we.call(m.fill, "rgba(0,0,0,0)");
                });
                le._context.staticPlot || (Ge.on("mousedown", function() {
                  be = (/* @__PURE__ */ new Date()).getTime(), be - le._legendMouseDownTime < ve ? Me += 1 : (Me = 1, le._legendMouseDownTime = be);
                }), Ge.on("mouseup", function() {
                  if (!(le._dragged || le._editing)) {
                    var we = le._fullLayout[ue];
                    (/* @__PURE__ */ new Date()).getTime() - le._legendMouseDownTime > ve && (Me = Math.max(Me - 1, 1)), j(le, we, se, Me, l.event);
                  }
                }));
              }
              function Z(se, le, ue, ve, be) {
                ve._inHover && se.attr("data-notex", !0), h.convertToTspans(se, ue, function() {
                  W(le, ue, ve, be);
                });
              }
              function W(se, le, ue, ve) {
                var be = se.data()[0][0];
                if (!ue._inHover && be && !be.trace.showlegend) {
                  se.remove();
                  return;
                }
                var Me = se.select("g[class*=math-group]"), Ge = Me.node(), we = ne(ue);
                ue || (ue = le._fullLayout[we]);
                var Re = ue.borderwidth, Ae;
                ve === L ? Ae = ue.title.font : be.groupTitle ? Ae = be.groupTitle.font : Ae = ue.font;
                var K = Ae.size * x, ee, oe;
                if (Ge) {
                  var _ = C.bBox(Ge);
                  ee = _.height, oe = _.width, ve === L ? C.setTranslate(Me, Re, Re + ee * 0.75) : C.setTranslate(Me, 0, ee * 0.25);
                } else {
                  var V = "." + we + (ve === L ? "title" : "") + "text", fe = se.select(V), $ = h.lineCount(fe), he = fe.node();
                  if (ee = K * $, oe = he ? C.bBox(he).width : 0, ve === L)
                    ue.title.side === "left" && (oe += S.itemGap * 2), h.positionText(fe, Re + S.titlePad, Re + K);
                  else {
                    var me = S.itemGap * 2 + ue.indentation + ue.itemwidth;
                    be.groupTitle && (me = S.itemGap, oe -= ue.indentation + ue.itemwidth), h.positionText(fe, me, -K * (($ - 1) / 2 - 0.3));
                  }
                }
                ve === L ? (ue._titleWidth = oe, ue._titleHeight = ee) : (be.lineHeight = K, be.height = Math.max(ee, 16) + 3, be.width = oe);
              }
              function q(se) {
                var le = 0, ue = 0, ve = se.title.side;
                return ve && (ve.indexOf("left") !== -1 && (le = se._titleWidth), ve.indexOf("top") !== -1 && (ue = se._titleHeight)), [le, ue];
              }
              function ie(se, le, ue, ve) {
                var be = se._fullLayout, Me = ne(ve);
                ve || (ve = be[Me]);
                var Ge = be._size, we = I.isVertical(ve), Re = I.isGrouped(ve), Ae = ve.entrywidthmode === "fraction", K = ve.borderwidth, ee = 2 * K, oe = S.itemGap, _ = ve.indentation + ve.itemwidth + oe * 2, V = 2 * (K + oe), fe = U(ve), $ = ve.y < 0 || ve.y === 0 && fe === "top", he = ve.y > 1 || ve.y === 1 && fe === "bottom", me = ve.tracegroupgap, xe = {};
                ve._maxHeight = Math.max($ || he ? be.height / 2 : Ge.h, 30);
                var Fe = 0;
                ve._width = 0, ve._height = 0;
                var Ve = q(ve);
                if (we)
                  ue.each(function(Yt) {
                    var Ut = Yt[0].height;
                    C.setTranslate(this, K + Ve[0], K + Ve[1] + ve._height + Ut / 2 + oe), ve._height += Ut, ve._width = Math.max(ve._width, Yt[0].width);
                  }), Fe = _ + ve._width, ve._width += oe + _ + ee, ve._height += V, Re && (le.each(function(Yt, Ut) {
                    C.setTranslate(this, 0, Ut * ve.tracegroupgap);
                  }), ve._height += (ve._lgroupsLength - 1) * ve.tracegroupgap);
                else {
                  var Be = X(ve), Je = ve.x < 0 || ve.x === 0 && Be === "right", et = ve.x > 1 || ve.x === 1 && Be === "left", at = he || $, De = be.width / 2;
                  ve._maxWidth = Math.max(Je ? at && Be === "left" ? Ge.l + Ge.w : De : et ? at && Be === "right" ? Ge.r + Ge.w : De : Ge.w, 2 * _);
                  var Ne = 0, Ie = 0;
                  ue.each(function(Yt) {
                    var Ut = Y(Yt, ve, _);
                    Ne = Math.max(Ne, Ut), Ie += Ut;
                  }), Fe = null;
                  var Ue = 0;
                  if (Re) {
                    var ot = 0, ct = 0, Tt = 0;
                    le.each(function() {
                      var Yt = 0, Ut = 0;
                      l.select(this).selectAll("g.traces").each(function(ze) {
                        var _e = Y(ze, ve, _), Ye = ze[0].height;
                        C.setTranslate(this, Ve[0], Ve[1] + K + oe + Ye / 2 + Ut), Ut += Ye, Yt = Math.max(Yt, _e), xe[ze[0].trace.legendgroup] = Yt;
                      });
                      var tt = Yt + oe;
                      // not on the first column already
                      ct > 0 && // goes beyound limit
                      tt + K + ct > ve._maxWidth ? (Ue = Math.max(Ue, ct), ct = 0, Tt += ot + me, ot = Ut) : ot = Math.max(ot, Ut), C.setTranslate(this, ct, Tt), ct += tt;
                    }), ve._width = Math.max(Ue, ct) + K, ve._height = Tt + ot + V;
                  } else {
                    var kt = ue.size(), Ot = Ie + ee + (kt - 1) * oe < ve._maxWidth, Rt = 0, xt = 0, Wt = 0, bt = 0;
                    ue.each(function(Yt) {
                      var Ut = Yt[0].height, tt = Y(Yt, ve, _), ze = Ot ? tt : Ne;
                      Ae || (ze += oe), ze + K + xt - oe >= ve._maxWidth && (Ue = Math.max(Ue, bt), xt = 0, Wt += Rt, ve._height += Rt, Rt = 0), C.setTranslate(this, Ve[0] + K + xt, Ve[1] + K + Wt + Ut / 2 + oe), bt = xt + tt + oe, xt += ze, Rt = Math.max(Rt, Ut);
                    }), Ot ? (ve._width = xt + ee, ve._height = Rt + V) : (ve._width = Math.max(Ue, bt) + ee, ve._height += Rt + V);
                  }
                }
                ve._width = Math.ceil(Math.max(ve._width + Ve[0], ve._titleWidth + 2 * (K + S.titlePad))), ve._height = Math.ceil(Math.max(ve._height + Ve[1], ve._titleHeight + 2 * (K + S.itemGap))), ve._effHeight = Math.min(ve._height, ve._maxHeight);
                var jt = se._context.edits, qt = jt.legendText || jt.legendPosition;
                ue.each(function(Yt) {
                  var Ut = l.select(this).select("." + Me + "toggle"), tt = Yt[0].height, ze = Yt[0].trace.legendgroup, _e = Y(Yt, ve, _);
                  Re && ze !== "" && (_e = xe[ze]);
                  var Ye = qt ? _ : Fe || _e;
                  !we && !Ae && (Ye += oe / 2), C.setRect(Ut, 0, -tt / 2, Ye, tt);
                });
              }
              function ce(se, le, ue, ve) {
                var be = se._fullLayout, Me = be[le], Ge = X(Me), we = U(Me), Re = Me.xref === "paper", Ae = Me.yref === "paper";
                se._fullLayout._reservedMargin[le] = {};
                var K = Me.y < 0.5 ? "b" : "t", ee = Me.x < 0.5 ? "l" : "r", oe = {
                  r: be.width - ue,
                  l: ue + Me._width,
                  b: be.height - ve,
                  t: ve + Me._effHeight
                };
                if (Re && Ae)
                  return f.autoMargin(se, le, {
                    x: Me.x,
                    y: Me.y,
                    l: Me._width * T[Ge],
                    r: Me._width * F[Ge],
                    b: Me._effHeight * F[we],
                    t: Me._effHeight * T[we]
                  });
                Re ? se._fullLayout._reservedMargin[le][K] = oe[K] : Ae || Me.orientation === "v" ? se._fullLayout._reservedMargin[le][ee] = oe[ee] : se._fullLayout._reservedMargin[le][K] = oe[K];
              }
              function X(se) {
                return v.isRightAnchor(se) ? "right" : v.isCenterAnchor(se) ? "center" : "left";
              }
              function U(se) {
                return v.isBottomAnchor(se) ? "bottom" : v.isMiddleAnchor(se) ? "middle" : "top";
              }
              function ne(se) {
                return se._id || "legend";
              }
            }
          ),
          /***/
          3076: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(2451);
              s.exports = function(p, g, y) {
                var C = g._inHover, m = v.isGrouped(g), h = v.isReversed(g), w = {}, S = [], E = !1, x = {}, T = 0, F = 0, P, k;
                function I(se, le, ue) {
                  if (g.visible !== !1 && !(y && se !== g._id))
                    if (le === "" || !v.isGrouped(g)) {
                      var ve = "~~i" + T;
                      S.push(ve), w[ve] = [ue], T++;
                    } else S.indexOf(le) === -1 ? (S.push(le), E = !0, w[le] = [ue]) : w[le].push(ue);
                }
                for (P = 0; P < p.length; P++) {
                  var L = p[P], A = L[0], O = A.trace, N = O.legend, Y = O.legendgroup;
                  if (!(!C && (!O.visible || !O.showlegend)))
                    if (l.traceIs(O, "pie-like"))
                      for (x[Y] || (x[Y] = {}), k = 0; k < L.length; k++) {
                        var j = L[k].label;
                        x[Y][j] || (I(N, Y, {
                          label: j,
                          color: L[k].color,
                          i: L[k].i,
                          trace: O,
                          pts: L[k].pts
                        }), x[Y][j] = !0, F = Math.max(F, (j || "").length));
                      }
                    else
                      I(N, Y, A), F = Math.max(F, (O.name || "").length);
                }
                if (!S.length) return [];
                var te = !E || !m, re = [];
                for (P = 0; P < S.length; P++) {
                  var z = w[S[P]];
                  te ? re.push(z[0]) : re.push(z);
                }
                for (te && (re = [re]), P = 0; P < re.length; P++) {
                  var Z = 1 / 0;
                  for (k = 0; k < re[P].length; k++) {
                    var W = re[P][k].trace.legendrank;
                    Z > W && (Z = W);
                  }
                  re[P][0]._groupMinRank = Z, re[P][0]._preGroupSort = P;
                }
                var q = function(se, le) {
                  return se[0]._groupMinRank - le[0]._groupMinRank || se[0]._preGroupSort - le[0]._preGroupSort;
                }, ie = function(se, le) {
                  return se.trace.legendrank - le.trace.legendrank || se._preSort - le._preSort;
                };
                for (re.forEach(function(se, le) {
                  se[0]._preGroupSort = le;
                }), re.sort(q), P = 0; P < re.length; P++) {
                  re[P].forEach(function(se, le) {
                    se._preSort = le;
                  }), re[P].sort(ie);
                  var ce = re[P][0].trace, X = null;
                  for (k = 0; k < re[P].length; k++) {
                    var U = re[P][k].trace.legendgrouptitle;
                    if (U && U.text) {
                      X = U, C && (U.font = g._groupTitleFont);
                      break;
                    }
                  }
                  if (h && re[P].reverse(), X) {
                    var ne = !1;
                    for (k = 0; k < re[P].length; k++)
                      if (l.traceIs(re[P][k].trace, "pie-like")) {
                        ne = !0;
                        break;
                      }
                    re[P].unshift({
                      i: -1,
                      groupTitle: X,
                      noClick: ne,
                      trace: {
                        showlegend: ce.showlegend,
                        legendgroup: ce.legendgroup,
                        visible: g.groupclick === "toggleitem" ? !0 : ce.visible
                      }
                    });
                  }
                  for (k = 0; k < re[P].length; k++)
                    re[P][k] = [re[P][k]];
                }
                return g._lgroupsLength = re.length, g._maxNameLength = F, re;
              };
            }
          ),
          /***/
          3048: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3400), f = v.pushUnique, p = !0;
              s.exports = function(y, C, m) {
                var h = C._fullLayout;
                if (C._dragged || C._editing) return;
                var w = h.legend.itemclick, S = h.legend.itemdoubleclick, E = h.legend.groupclick;
                m === 1 && w === "toggle" && S === "toggleothers" && p && C.data && C._context.showTips && v.notifier(v._(C, "Double-click on legend to isolate one trace"), "long"), p = !1;
                var x;
                if (m === 1 ? x = w : m === 2 && (x = S), !x) return;
                var T = E === "togglegroup", F = h.hiddenlabels ? h.hiddenlabels.slice() : [], P = y.data()[0][0];
                if (P.groupTitle && P.noClick) return;
                var k = C._fullData, I = (h.shapes || []).filter(function(De) {
                  return De.showlegend;
                }), L = k.concat(I), A = P.trace;
                A._isShape && (A = A._fullInput);
                var O = A.legendgroup, N, Y, j, te, re, z, Z = {}, W = [], q = [], ie = [];
                function ce(De, Ne) {
                  var Ie = W.indexOf(De), Ue = Z.visible;
                  return Ue || (Ue = Z.visible = []), W.indexOf(De) === -1 && (W.push(De), Ie = W.length - 1), Ue[Ie] = Ne, Ie;
                }
                var X = (h.shapes || []).map(function(De) {
                  return De._input;
                }), U = !1;
                function ne(De, Ne) {
                  X[De].visible = Ne, U = !0;
                }
                function se(De, Ne) {
                  if (!(P.groupTitle && !T)) {
                    var Ie = De._fullInput || De, Ue = Ie._isShape, ot = Ie.index;
                    if (ot === void 0 && (ot = Ie._index), l.hasTransform(Ie, "groupby")) {
                      var ct = q[ot];
                      if (!ct) {
                        var Tt = l.getTransformIndices(Ie, "groupby"), kt = Tt[Tt.length - 1];
                        ct = v.keyedContainer(Ie, "transforms[" + kt + "].styles", "target", "value.visible"), q[ot] = ct;
                      }
                      var Ot = ct.get(De._group);
                      Ot === void 0 && (Ot = !0), Ot !== !1 && ct.set(De._group, Ne), ie[ot] = ce(ot, Ie.visible !== !1);
                    } else {
                      var Rt = Ie.visible === !1 ? !1 : Ne;
                      Ue ? ne(ot, Rt) : ce(ot, Rt);
                    }
                  }
                }
                var le = A.legend, ue = A._fullInput, ve = ue && ue._isShape;
                if (!ve && l.traceIs(A, "pie-like")) {
                  var be = P.label, Me = F.indexOf(be);
                  if (x === "toggle")
                    Me === -1 ? F.push(be) : F.splice(Me, 1);
                  else if (x === "toggleothers") {
                    var Ge = Me !== -1, we = [];
                    for (N = 0; N < C.calcdata.length; N++) {
                      var Re = C.calcdata[N];
                      for (Y = 0; Y < Re.length; Y++) {
                        var Ae = Re[Y], K = Ae.label;
                        le === Re[0].trace.legend && be !== K && (F.indexOf(K) === -1 && (Ge = !0), f(F, K), we.push(K));
                      }
                    }
                    if (!Ge)
                      for (var ee = 0; ee < we.length; ee++) {
                        var oe = F.indexOf(we[ee]);
                        oe !== -1 && F.splice(oe, 1);
                      }
                  }
                  l.call("_guiRelayout", C, "hiddenlabels", F);
                } else {
                  var _ = O && O.length, V = [], fe;
                  if (_)
                    for (N = 0; N < L.length; N++)
                      fe = L[N], fe.visible && fe.legendgroup === O && V.push(N);
                  if (x === "toggle") {
                    var $;
                    switch (A.visible) {
                      case !0:
                        $ = "legendonly";
                        break;
                      case !1:
                        $ = !1;
                        break;
                      case "legendonly":
                        $ = !0;
                        break;
                    }
                    if (_)
                      if (T)
                        for (N = 0; N < L.length; N++) {
                          var he = L[N];
                          he.visible !== !1 && he.legendgroup === O && se(he, $);
                        }
                      else
                        se(A, $);
                    else
                      se(A, $);
                  } else if (x === "toggleothers") {
                    var me, xe, Fe, Ve, Be, Je = !0;
                    for (N = 0; N < L.length; N++)
                      if (Be = L[N], me = Be === A, Fe = Be.showlegend !== !0, !(me || Fe) && (xe = _ && Be.legendgroup === O, !xe && Be.legend === le && Be.visible === !0 && !l.traceIs(Be, "notLegendIsolatable"))) {
                        Je = !1;
                        break;
                      }
                    for (N = 0; N < L.length; N++)
                      if (Be = L[N], !(Be.visible === !1 || Be.legend !== le) && !l.traceIs(Be, "notLegendIsolatable"))
                        switch (A.visible) {
                          case "legendonly":
                            se(Be, !0);
                            break;
                          case !0:
                            Ve = Je ? !0 : "legendonly", me = Be === A, Fe = Be.showlegend !== !0 && !Be.legendgroup, xe = me || _ && Be.legendgroup === O, se(Be, xe || Fe ? !0 : Ve);
                            break;
                        }
                  }
                  for (N = 0; N < q.length; N++)
                    if (j = q[N], !!j) {
                      var et = j.constructUpdate(), at = Object.keys(et);
                      for (Y = 0; Y < at.length; Y++)
                        te = at[Y], z = Z[te] = Z[te] || [], z[ie[N]] = et[te];
                    }
                  for (re = Object.keys(Z), N = 0; N < re.length; N++)
                    for (te = re[N], Y = 0; Y < W.length; Y++)
                      Z[te].hasOwnProperty(Y) || (Z[te][Y] = void 0);
                  U ? l.call("_guiUpdate", C, Z, {
                    shapes: X
                  }, W) : l.call("_guiRestyle", C, Z, W);
                }
              };
            }
          ),
          /***/
          2451: (
            /***/
            function(s, c) {
              c.isGrouped = function(l) {
                return (l.traceorder || "").indexOf("grouped") !== -1;
              }, c.isVertical = function(l) {
                return l.orientation !== "h";
              }, c.isReversed = function(l) {
                return (l.traceorder || "").indexOf("reversed") !== -1;
              };
            }
          ),
          /***/
          2780: (
            /***/
            function(s, c, i) {
              s.exports = {
                moduleType: "component",
                name: "legend",
                layoutAttributes: i(3800),
                supplyLayoutDefaults: i(7864),
                draw: i(1140),
                style: i(2012)
              };
            }
          ),
          /***/
          2012: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(3400), p = f.strTranslate, g = i(3616), y = i(6308), C = i(4288).extractOpts, m = i(3028), h = i(528), w = i(9656).castOption, S = i(5196), E = 12, x = 5, T = 2, F = 10, P = 5;
              s.exports = function(O, N, Y) {
                var j = N._fullLayout;
                Y || (Y = j.legend);
                var te = Y.itemsizing === "constant", re = Y.itemwidth, z = (re + S.itemGap * 2) / 2, Z = p(z, 0), W = function(we, Re, Ae, K) {
                  var ee;
                  if (we + 1)
                    ee = we;
                  else if (Re && Re.width > 0)
                    ee = Re.width;
                  else
                    return 0;
                  return te ? K : Math.min(ee, Ae);
                };
                O.each(function(we) {
                  var Re = l.select(this), Ae = f.ensureSingle(Re, "g", "layers");
                  Ae.style("opacity", we[0].trace.opacity);
                  var K = Y.indentation, ee = Y.valign, oe = we[0].lineHeight, _ = we[0].height;
                  if (ee === "middle" && K === 0 || !oe || !_)
                    Ae.attr("transform", null);
                  else {
                    var V = {
                      top: 1,
                      bottom: -1
                    }[ee], fe = V * (0.5 * (oe - _ + 3)) || 0, $ = Y.indentation;
                    Ae.attr("transform", p($, fe));
                  }
                  var he = Ae.selectAll("g.legendfill").data([we]);
                  he.enter().append("g").classed("legendfill", !0);
                  var me = Ae.selectAll("g.legendlines").data([we]);
                  me.enter().append("g").classed("legendlines", !0);
                  var xe = Ae.selectAll("g.legendsymbols").data([we]);
                  xe.enter().append("g").classed("legendsymbols", !0), xe.selectAll("g.legendpoints").data([we]).enter().append("g").classed("legendpoints", !0);
                }).each(Ge).each(ce).each(U).each(X).each(se).each(be).each(ve).each(q).each(ie).each(le).each(ue);
                function q(we) {
                  var Re = I(we), Ae = Re.showFill, K = Re.showLine, ee = Re.showGradientLine, oe = Re.showGradientFill, _ = Re.anyFill, V = Re.anyLine, fe = we[0], $ = fe.trace, he, me, xe = C($), Fe = xe.colorscale, Ve = xe.reversescale, Be = function(Ue) {
                    if (Ue.size())
                      if (Ae)
                        g.fillGroupStyle(Ue, N, !0);
                      else {
                        var ot = "legendfill-" + $.uid;
                        g.gradient(Ue, N, ot, k(Ve), Fe, "fill");
                      }
                  }, Je = function(Ue) {
                    if (Ue.size()) {
                      var ot = "legendline-" + $.uid;
                      g.lineGroupStyle(Ue), g.gradient(Ue, N, ot, k(Ve), Fe, "stroke");
                    }
                  }, et = m.hasMarkers($) || !_ ? "M5,0" : (
                    // with a line leave it slightly below center, to leave room for the
                    // line thickness and because the line is usually more prominent
                    V ? "M5,-2" : "M5,-3"
                  ), at = l.select(this), De = at.select(".legendfill").selectAll("path").data(Ae || oe ? [we] : []);
                  if (De.enter().append("path").classed("js-fill", !0), De.exit().remove(), De.attr("d", et + "h" + re + "v6h-" + re + "z").call(Be), K || ee) {
                    var Ne = W(void 0, $.line, F, x);
                    me = f.minExtend($, {
                      line: {
                        width: Ne
                      }
                    }), he = [f.minExtend(fe, {
                      trace: me
                    })];
                  }
                  var Ie = at.select(".legendlines").selectAll("path").data(K || ee ? [he] : []);
                  Ie.enter().append("path").classed("js-line", !0), Ie.exit().remove(), Ie.attr("d", et + (ee ? "l" + re + ",0.0001" : "h" + re)).call(K ? g.lineGroupStyle : Je);
                }
                function ie(we) {
                  var Re = I(we), Ae = Re.anyFill, K = Re.anyLine, ee = Re.showLine, oe = Re.showMarker, _ = we[0], V = _.trace, fe = !oe && !K && !Ae && m.hasText(V), $, he;
                  function me(De, Ne, Ie, Ue) {
                    var ot = f.nestedProperty(V, De).get(), ct = f.isArrayOrTypedArray(ot) && Ne ? Ne(ot) : ot;
                    if (te && ct && Ue !== void 0 && (ct = Ue), Ie) {
                      if (ct < Ie[0]) return Ie[0];
                      if (ct > Ie[1]) return Ie[1];
                    }
                    return ct;
                  }
                  function xe(De) {
                    return _._distinct && _.index && De[_.index] ? De[_.index] : De[0];
                  }
                  if (oe || fe || ee) {
                    var Fe = {}, Ve = {};
                    if (oe) {
                      Fe.mc = me("marker.color", xe), Fe.mx = me("marker.symbol", xe), Fe.mo = me("marker.opacity", f.mean, [0.2, 1]), Fe.mlc = me("marker.line.color", xe), Fe.mlw = me("marker.line.width", f.mean, [0, 5], T), Ve.marker = {
                        sizeref: 1,
                        sizemin: 1,
                        sizemode: "diameter"
                      };
                      var Be = me("marker.size", f.mean, [2, 16], E);
                      Fe.ms = Be, Ve.marker.size = Be;
                    }
                    ee && (Ve.line = {
                      width: me("line.width", xe, [0, 10], x)
                    }), fe && (Fe.tx = "Aa", Fe.tp = me("textposition", xe), Fe.ts = 10, Fe.tc = me("textfont.color", xe), Fe.tf = me("textfont.family", xe), Fe.tw = me("textfont.weight", xe), Fe.ty = me("textfont.style", xe), Fe.tv = me("textfont.variant", xe), Fe.tC = me("textfont.textcase", xe), Fe.tE = me("textfont.lineposition", xe), Fe.tS = me("textfont.shadow", xe)), $ = [f.minExtend(_, Fe)], he = f.minExtend(V, Ve), he.selectedpoints = null, he.texttemplate = null;
                  }
                  var Je = l.select(this).select("g.legendpoints"), et = Je.selectAll("path.scatterpts").data(oe ? $ : []);
                  et.enter().insert("path", ":first-child").classed("scatterpts", !0).attr("transform", Z), et.exit().remove(), et.call(g.pointStyle, he, N), oe && ($[0].mrc = 3);
                  var at = Je.selectAll("g.pointtext").data(fe ? $ : []);
                  at.enter().append("g").classed("pointtext", !0).append("text").attr("transform", Z), at.exit().remove(), at.selectAll("text").call(g.textPointStyle, he, N);
                }
                function ce(we) {
                  var Re = we[0].trace, Ae = Re.type === "waterfall";
                  if (we[0]._distinct && Ae) {
                    var K = we[0].trace[we[0].dir].marker;
                    return we[0].mc = K.color, we[0].mlw = K.line.width, we[0].mlc = K.line.color, ne(we, this, "waterfall");
                  }
                  var ee = [];
                  Re.visible && Ae && (ee = we[0].hasTotals ? [["increasing", "M-6,-6V6H0Z"], ["totals", "M6,6H0L-6,-6H-0Z"], ["decreasing", "M6,6V-6H0Z"]] : [["increasing", "M-6,-6V6H6Z"], ["decreasing", "M6,6V-6H-6Z"]]);
                  var oe = l.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(ee);
                  oe.enter().append("path").classed("legendwaterfall", !0).attr("transform", Z).style("stroke-miterlimit", 1), oe.exit().remove(), oe.each(function(_) {
                    var V = l.select(this), fe = Re[_[0]].marker, $ = W(void 0, fe.line, P, T);
                    V.attr("d", _[1]).style("stroke-width", $ + "px").call(y.fill, fe.color), $ && V.call(y.stroke, fe.line.color);
                  });
                }
                function X(we) {
                  ne(we, this);
                }
                function U(we) {
                  ne(we, this, "funnel");
                }
                function ne(we, Re, Ae) {
                  var K = we[0].trace, ee = K.marker || {}, oe = ee.line || {}, _ = ee.cornerradius ? "M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z" : (
                    // Square with rounded corners
                    "M6,6H-6V-6H6Z"
                  ), V = Ae ? K.visible && K.type === Ae : v.traceIs(K, "bar"), fe = l.select(Re).select("g.legendpoints").selectAll("path.legend" + Ae).data(V ? [we] : []);
                  fe.enter().append("path").classed("legend" + Ae, !0).attr("d", _).attr("transform", Z), fe.exit().remove(), fe.each(function($) {
                    var he = l.select(this), me = $[0], xe = W(me.mlw, ee.line, P, T);
                    he.style("stroke-width", xe + "px");
                    var Fe = me.mcc;
                    if (!Y._inHover && "mc" in me) {
                      var Ve = C(ee), Be = Ve.mid;
                      Be === void 0 && (Be = (Ve.max + Ve.min) / 2), Fe = g.tryColorscale(ee, "")(Be);
                    }
                    var Je = Fe || me.mc || ee.color, et = ee.pattern, at = et && g.getPatternAttr(et.shape, 0, "");
                    if (at) {
                      var De = g.getPatternAttr(et.bgcolor, 0, null), Ne = g.getPatternAttr(et.fgcolor, 0, null), Ie = et.fgopacity, Ue = L(et.size, 8, 10), ot = L(et.solidity, 0.5, 1), ct = "legend-" + K.uid;
                      he.call(g.pattern, "legend", N, ct, at, Ue, ot, Fe, et.fillmode, De, Ne, Ie);
                    } else
                      he.call(y.fill, Je);
                    xe && y.stroke(he, me.mlc || oe.color);
                  });
                }
                function se(we) {
                  var Re = we[0].trace, Ae = l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(Re.visible && v.traceIs(Re, "box-violin") ? [we] : []);
                  Ae.enter().append("path").classed("legendbox", !0).attr("d", "M6,6H-6V-6H6Z").attr("transform", Z), Ae.exit().remove(), Ae.each(function() {
                    var K = l.select(this);
                    if ((Re.boxpoints === "all" || Re.points === "all") && y.opacity(Re.fillcolor) === 0 && y.opacity((Re.line || {}).color) === 0) {
                      var ee = f.minExtend(Re, {
                        marker: {
                          size: te ? E : f.constrain(Re.marker.size, 2, 16),
                          sizeref: 1,
                          sizemin: 1,
                          sizemode: "diameter"
                        }
                      });
                      Ae.call(g.pointStyle, ee, N);
                    } else {
                      var oe = W(void 0, Re.line, P, T);
                      K.style("stroke-width", oe + "px").call(y.fill, Re.fillcolor), oe && y.stroke(K, Re.line.color);
                    }
                  });
                }
                function le(we) {
                  var Re = we[0].trace, Ae = l.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(Re.visible && Re.type === "candlestick" ? [we, we] : []);
                  Ae.enter().append("path").classed("legendcandle", !0).attr("d", function(K, ee) {
                    return ee ? "M-15,0H-8M-8,6V-6H8Z" : "M15,0H8M8,-6V6H-8Z";
                  }).attr("transform", Z).style("stroke-miterlimit", 1), Ae.exit().remove(), Ae.each(function(K, ee) {
                    var oe = l.select(this), _ = Re[ee ? "increasing" : "decreasing"], V = W(void 0, _.line, P, T);
                    oe.style("stroke-width", V + "px").call(y.fill, _.fillcolor), V && y.stroke(oe, _.line.color);
                  });
                }
                function ue(we) {
                  var Re = we[0].trace, Ae = l.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(Re.visible && Re.type === "ohlc" ? [we, we] : []);
                  Ae.enter().append("path").classed("legendohlc", !0).attr("d", function(K, ee) {
                    return ee ? "M-15,0H0M-8,-6V0" : "M15,0H0M8,6V0";
                  }).attr("transform", Z).style("stroke-miterlimit", 1), Ae.exit().remove(), Ae.each(function(K, ee) {
                    var oe = l.select(this), _ = Re[ee ? "increasing" : "decreasing"], V = W(void 0, _.line, P, T);
                    oe.style("fill", "none").call(g.dashLine, _.line.dash, V), V && y.stroke(oe, _.line.color);
                  });
                }
                function ve(we) {
                  Me(we, this, "pie");
                }
                function be(we) {
                  Me(we, this, "funnelarea");
                }
                function Me(we, Re, Ae) {
                  var K = we[0], ee = K.trace, oe = Ae ? ee.visible && ee.type === Ae : v.traceIs(ee, Ae), _ = l.select(Re).select("g.legendpoints").selectAll("path.legend" + Ae).data(oe ? [we] : []);
                  if (_.enter().append("path").classed("legend" + Ae, !0).attr("d", "M6,6H-6V-6H6Z").attr("transform", Z), _.exit().remove(), _.size()) {
                    var V = ee.marker || {}, fe = W(w(V.line.width, K.pts), V.line, P, T), $ = "pieLike", he = f.minExtend(ee, {
                      marker: {
                        line: {
                          width: fe
                        }
                      }
                    }, $), me = f.minExtend(K, {
                      trace: he
                    }, $);
                    h(_, me, he, N);
                  }
                }
                function Ge(we) {
                  var Re = we[0].trace, Ae, K = [];
                  if (Re.visible)
                    switch (Re.type) {
                      case "histogram2d":
                      case "heatmap":
                        K = [
                          ["M-15,-2V4H15V-2Z"]
                          // similar to contour
                        ], Ae = !0;
                        break;
                      case "choropleth":
                      case "choroplethmapbox":
                        K = [["M-6,-6V6H6V-6Z"]], Ae = !0;
                        break;
                      case "densitymapbox":
                        K = [["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]], Ae = "radial";
                        break;
                      case "cone":
                        K = [["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"], ["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"], ["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]], Ae = !1;
                        break;
                      case "streamtube":
                        K = [["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"], ["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"], ["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]], Ae = !1;
                        break;
                      case "surface":
                        K = [["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"], ["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]], Ae = !0;
                        break;
                      case "mesh3d":
                        K = [["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6H6L0,6Z"]], Ae = !1;
                        break;
                      case "volume":
                        K = [["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6H6L0,6Z"]], Ae = !0;
                        break;
                      case "isosurface":
                        K = [["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]], Ae = !1;
                        break;
                    }
                  var ee = l.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(K);
                  ee.enter().append("path").classed("legend3dandfriends", !0).attr("transform", Z).style("stroke-miterlimit", 1), ee.exit().remove(), ee.each(function(oe, _) {
                    var V = l.select(this), fe = C(Re), $ = fe.colorscale, he = fe.reversescale, me = function(Be) {
                      if (Be.size()) {
                        var Je = "legendfill-" + Re.uid;
                        g.gradient(Be, N, Je, k(he, Ae === "radial"), $, "fill");
                      }
                    }, xe;
                    if ($) {
                      if (!Ae) {
                        var Ve = $.length;
                        xe = _ === 0 ? $[he ? Ve - 1 : 0][1] : (
                          // minimum
                          _ === 1 ? $[he ? 0 : Ve - 1][1] : (
                            // maximum
                            $[Math.floor((Ve - 1) / 2)][1]
                          )
                        );
                      }
                    } else {
                      var Fe = Re.vertexcolor || Re.facecolor || Re.color;
                      xe = f.isArrayOrTypedArray(Fe) ? Fe[_] || Fe[0] : Fe;
                    }
                    V.attr("d", oe[0]), xe ? V.call(y.fill, xe) : V.call(me);
                  });
                }
              };
              function k(A, O) {
                var N = O ? "radial" : "horizontal";
                return N + (A ? "" : "reversed");
              }
              function I(A) {
                var O = A[0].trace, N = O.contours, Y = m.hasLines(O), j = m.hasMarkers(O), te = O.visible && O.fill && O.fill !== "none", re = !1, z = !1;
                if (N) {
                  var Z = N.coloring;
                  Z === "lines" ? re = !0 : Y = Z === "none" || Z === "heatmap" || N.showlines, N.type === "constraint" ? te = N._operation !== "=" : (Z === "fill" || Z === "heatmap") && (z = !0);
                }
                return {
                  showMarker: j,
                  showLine: Y,
                  showFill: te,
                  showGradientLine: re,
                  showGradientFill: z,
                  anyLine: Y || re,
                  anyFill: te || z
                };
              }
              function L(A, O, N) {
                return A && f.isArrayOrTypedArray(A) ? O : A > N ? N : A;
              }
            }
          ),
          /***/
          6540: (
            /***/
            function(s, c, i) {
              i(6052), s.exports = {
                editType: "modebar",
                orientation: {
                  valType: "enumerated",
                  values: ["v", "h"],
                  dflt: "h",
                  editType: "modebar"
                },
                bgcolor: {
                  valType: "color",
                  editType: "modebar"
                },
                color: {
                  valType: "color",
                  editType: "modebar"
                },
                activecolor: {
                  valType: "color",
                  editType: "modebar"
                },
                uirevision: {
                  valType: "any",
                  editType: "none"
                },
                add: {
                  valType: "string",
                  arrayOk: !0,
                  dflt: "",
                  editType: "modebar"
                },
                remove: {
                  valType: "string",
                  arrayOk: !0,
                  dflt: "",
                  editType: "modebar"
                }
              };
            }
          ),
          /***/
          1868: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(7316), f = i(9811), p = i(9224), g = i(4016).eraseActiveShape, y = i(3400), C = y._, m = s.exports = {};
              m.toImage = {
                name: "toImage",
                title: function(A) {
                  var O = A._context.toImageButtonOptions || {}, N = O.format || "png";
                  return N === "png" ? C(A, "Download plot as a png") : (
                    // legacy text
                    C(A, "Download plot")
                  );
                },
                icon: p.camera,
                click: function(A) {
                  var O = A._context.toImageButtonOptions, N = {
                    format: O.format || "png"
                  };
                  y.notifier(C(A, "Taking snapshot - this may take a few seconds"), "long"), N.format !== "svg" && y.isIE() && (y.notifier(C(A, "IE only supports svg.  Changing format to svg."), "long"), N.format = "svg"), ["filename", "width", "height", "scale"].forEach(function(Y) {
                    Y in O && (N[Y] = O[Y]);
                  }), l.call("downloadImage", A, N).then(function(Y) {
                    y.notifier(C(A, "Snapshot succeeded") + " - " + Y, "long");
                  }).catch(function() {
                    y.notifier(C(A, "Sorry, there was a problem downloading your snapshot!"), "long");
                  });
                }
              }, m.sendDataToCloud = {
                name: "sendDataToCloud",
                title: function(A) {
                  return C(A, "Edit in Chart Studio");
                },
                icon: p.disk,
                click: function(A) {
                  v.sendDataToCloud(A);
                }
              }, m.editInChartStudio = {
                name: "editInChartStudio",
                title: function(A) {
                  return C(A, "Edit in Chart Studio");
                },
                icon: p.pencil,
                click: function(A) {
                  v.sendDataToCloud(A);
                }
              }, m.zoom2d = {
                name: "zoom2d",
                _cat: "zoom",
                title: function(A) {
                  return C(A, "Zoom");
                },
                attr: "dragmode",
                val: "zoom",
                icon: p.zoombox,
                click: h
              }, m.pan2d = {
                name: "pan2d",
                _cat: "pan",
                title: function(A) {
                  return C(A, "Pan");
                },
                attr: "dragmode",
                val: "pan",
                icon: p.pan,
                click: h
              }, m.select2d = {
                name: "select2d",
                _cat: "select",
                title: function(A) {
                  return C(A, "Box Select");
                },
                attr: "dragmode",
                val: "select",
                icon: p.selectbox,
                click: h
              }, m.lasso2d = {
                name: "lasso2d",
                _cat: "lasso",
                title: function(A) {
                  return C(A, "Lasso Select");
                },
                attr: "dragmode",
                val: "lasso",
                icon: p.lasso,
                click: h
              }, m.drawclosedpath = {
                name: "drawclosedpath",
                title: function(A) {
                  return C(A, "Draw closed freeform");
                },
                attr: "dragmode",
                val: "drawclosedpath",
                icon: p.drawclosedpath,
                click: h
              }, m.drawopenpath = {
                name: "drawopenpath",
                title: function(A) {
                  return C(A, "Draw open freeform");
                },
                attr: "dragmode",
                val: "drawopenpath",
                icon: p.drawopenpath,
                click: h
              }, m.drawline = {
                name: "drawline",
                title: function(A) {
                  return C(A, "Draw line");
                },
                attr: "dragmode",
                val: "drawline",
                icon: p.drawline,
                click: h
              }, m.drawrect = {
                name: "drawrect",
                title: function(A) {
                  return C(A, "Draw rectangle");
                },
                attr: "dragmode",
                val: "drawrect",
                icon: p.drawrect,
                click: h
              }, m.drawcircle = {
                name: "drawcircle",
                title: function(A) {
                  return C(A, "Draw circle");
                },
                attr: "dragmode",
                val: "drawcircle",
                icon: p.drawcircle,
                click: h
              }, m.eraseshape = {
                name: "eraseshape",
                title: function(A) {
                  return C(A, "Erase active shape");
                },
                icon: p.eraseshape,
                click: g
              }, m.zoomIn2d = {
                name: "zoomIn2d",
                _cat: "zoomin",
                title: function(A) {
                  return C(A, "Zoom in");
                },
                attr: "zoom",
                val: "in",
                icon: p.zoom_plus,
                click: h
              }, m.zoomOut2d = {
                name: "zoomOut2d",
                _cat: "zoomout",
                title: function(A) {
                  return C(A, "Zoom out");
                },
                attr: "zoom",
                val: "out",
                icon: p.zoom_minus,
                click: h
              }, m.autoScale2d = {
                name: "autoScale2d",
                _cat: "autoscale",
                title: function(A) {
                  return C(A, "Autoscale");
                },
                attr: "zoom",
                val: "auto",
                icon: p.autoscale,
                click: h
              }, m.resetScale2d = {
                name: "resetScale2d",
                _cat: "resetscale",
                title: function(A) {
                  return C(A, "Reset axes");
                },
                attr: "zoom",
                val: "reset",
                icon: p.home,
                click: h
              }, m.hoverClosestCartesian = {
                name: "hoverClosestCartesian",
                _cat: "hoverclosest",
                title: function(A) {
                  return C(A, "Show closest data on hover");
                },
                attr: "hovermode",
                val: "closest",
                icon: p.tooltip_basic,
                gravity: "ne",
                click: h
              }, m.hoverCompareCartesian = {
                name: "hoverCompareCartesian",
                _cat: "hoverCompare",
                title: function(A) {
                  return C(A, "Compare data on hover");
                },
                attr: "hovermode",
                val: function(A) {
                  return A._fullLayout._isHoriz ? "y" : "x";
                },
                icon: p.tooltip_compare,
                gravity: "ne",
                click: h
              };
              function h(A, O) {
                var N = O.currentTarget, Y = N.getAttribute("data-attr"), j = N.getAttribute("data-val") || !0, te = A._fullLayout, re = {}, z = f.list(A, null, !0), Z = te._cartesianSpikesEnabled, W, q;
                if (Y === "zoom") {
                  var ie = j === "in" ? 0.5 : 2, ce = (1 + ie) / 2, X = (1 - ie) / 2, U;
                  for (q = 0; q < z.length; q++)
                    if (W = z[q], !W.fixedrange)
                      if (U = W._name, j === "auto")
                        re[U + ".autorange"] = !0;
                      else if (j === "reset")
                        W._rangeInitial0 === void 0 && W._rangeInitial1 === void 0 ? re[U + ".autorange"] = !0 : W._rangeInitial0 === void 0 ? (re[U + ".autorange"] = W._autorangeInitial, re[U + ".range"] = [null, W._rangeInitial1]) : W._rangeInitial1 === void 0 ? (re[U + ".range"] = [W._rangeInitial0, null], re[U + ".autorange"] = W._autorangeInitial) : re[U + ".range"] = [W._rangeInitial0, W._rangeInitial1], W._showSpikeInitial !== void 0 && (re[U + ".showspikes"] = W._showSpikeInitial, Z === "on" && !W._showSpikeInitial && (Z = "off"));
                      else {
                        var ne = [W.r2l(W.range[0]), W.r2l(W.range[1])], se = [ce * ne[0] + X * ne[1], ce * ne[1] + X * ne[0]];
                        re[U + ".range[0]"] = W.l2r(se[0]), re[U + ".range[1]"] = W.l2r(se[1]);
                      }
                } else
                  Y === "hovermode" && (j === "x" || j === "y") && (j = te._isHoriz ? "y" : "x", N.setAttribute("data-val", j)), re[Y] = j;
                te._cartesianSpikesEnabled = Z, l.call("_guiRelayout", A, re);
              }
              m.zoom3d = {
                name: "zoom3d",
                _cat: "zoom",
                title: function(A) {
                  return C(A, "Zoom");
                },
                attr: "scene.dragmode",
                val: "zoom",
                icon: p.zoombox,
                click: w
              }, m.pan3d = {
                name: "pan3d",
                _cat: "pan",
                title: function(A) {
                  return C(A, "Pan");
                },
                attr: "scene.dragmode",
                val: "pan",
                icon: p.pan,
                click: w
              }, m.orbitRotation = {
                name: "orbitRotation",
                title: function(A) {
                  return C(A, "Orbital rotation");
                },
                attr: "scene.dragmode",
                val: "orbit",
                icon: p["3d_rotate"],
                click: w
              }, m.tableRotation = {
                name: "tableRotation",
                title: function(A) {
                  return C(A, "Turntable rotation");
                },
                attr: "scene.dragmode",
                val: "turntable",
                icon: p["z-axis"],
                click: w
              };
              function w(A, O) {
                for (var N = O.currentTarget, Y = N.getAttribute("data-attr"), j = N.getAttribute("data-val") || !0, te = A._fullLayout._subplots.gl3d || [], re = {}, z = Y.split("."), Z = 0; Z < te.length; Z++)
                  re[te[Z] + "." + z[1]] = j;
                var W = j === "pan" ? j : "zoom";
                re.dragmode = W, l.call("_guiRelayout", A, re);
              }
              m.resetCameraDefault3d = {
                name: "resetCameraDefault3d",
                _cat: "resetCameraDefault",
                title: function(A) {
                  return C(A, "Reset camera to default");
                },
                attr: "resetDefault",
                icon: p.home,
                click: S
              }, m.resetCameraLastSave3d = {
                name: "resetCameraLastSave3d",
                _cat: "resetCameraLastSave",
                title: function(A) {
                  return C(A, "Reset camera to last save");
                },
                attr: "resetLastSave",
                icon: p.movie,
                click: S
              };
              function S(A, O) {
                for (var N = O.currentTarget, Y = N.getAttribute("data-attr"), j = Y === "resetLastSave", te = Y === "resetDefault", re = A._fullLayout, z = re._subplots.gl3d || [], Z = {}, W = 0; W < z.length; W++) {
                  var q = z[W], ie = q + ".camera", ce = q + ".aspectratio", X = q + ".aspectmode", U = re[q]._scene, ne;
                  j ? (Z[ie + ".up"] = U.viewInitial.up, Z[ie + ".eye"] = U.viewInitial.eye, Z[ie + ".center"] = U.viewInitial.center, ne = !0) : te && (Z[ie + ".up"] = null, Z[ie + ".eye"] = null, Z[ie + ".center"] = null, ne = !0), ne && (Z[ce + ".x"] = U.viewInitial.aspectratio.x, Z[ce + ".y"] = U.viewInitial.aspectratio.y, Z[ce + ".z"] = U.viewInitial.aspectratio.z, Z[X] = U.viewInitial.aspectmode);
                }
                l.call("_guiRelayout", A, Z);
              }
              m.hoverClosest3d = {
                name: "hoverClosest3d",
                _cat: "hoverclosest",
                title: function(A) {
                  return C(A, "Toggle show closest data on hover");
                },
                attr: "hovermode",
                val: null,
                toggle: !0,
                icon: p.tooltip_basic,
                gravity: "ne",
                click: x
              };
              function E(A, O) {
                var N = O.currentTarget, Y = N._previousVal, j = A._fullLayout, te = j._subplots.gl3d || [], re = ["xaxis", "yaxis", "zaxis"], z = {}, Z = {};
                if (Y)
                  Z = Y, N._previousVal = null;
                else {
                  for (var W = 0; W < te.length; W++) {
                    var q = te[W], ie = j[q], ce = q + ".hovermode";
                    z[ce] = ie.hovermode, Z[ce] = !1;
                    for (var X = 0; X < 3; X++) {
                      var U = re[X], ne = q + "." + U + ".showspikes";
                      Z[ne] = !1, z[ne] = ie[U].showspikes;
                    }
                  }
                  N._previousVal = z;
                }
                return Z;
              }
              function x(A, O) {
                var N = E(A, O);
                l.call("_guiRelayout", A, N);
              }
              m.zoomInGeo = {
                name: "zoomInGeo",
                _cat: "zoomin",
                title: function(A) {
                  return C(A, "Zoom in");
                },
                attr: "zoom",
                val: "in",
                icon: p.zoom_plus,
                click: T
              }, m.zoomOutGeo = {
                name: "zoomOutGeo",
                _cat: "zoomout",
                title: function(A) {
                  return C(A, "Zoom out");
                },
                attr: "zoom",
                val: "out",
                icon: p.zoom_minus,
                click: T
              }, m.resetGeo = {
                name: "resetGeo",
                _cat: "reset",
                title: function(A) {
                  return C(A, "Reset");
                },
                attr: "reset",
                val: null,
                icon: p.autoscale,
                click: T
              }, m.hoverClosestGeo = {
                name: "hoverClosestGeo",
                _cat: "hoverclosest",
                title: function(A) {
                  return C(A, "Toggle show closest data on hover");
                },
                attr: "hovermode",
                val: null,
                toggle: !0,
                icon: p.tooltip_basic,
                gravity: "ne",
                click: P
              };
              function T(A, O) {
                for (var N = O.currentTarget, Y = N.getAttribute("data-attr"), j = N.getAttribute("data-val") || !0, te = A._fullLayout, re = te._subplots.geo || [], z = 0; z < re.length; z++) {
                  var Z = re[z], W = te[Z];
                  if (Y === "zoom") {
                    var q = W.projection.scale, ie = j === "in" ? 2 * q : 0.5 * q;
                    l.call("_guiRelayout", A, Z + ".projection.scale", ie);
                  }
                }
                Y === "reset" && L(A, "geo");
              }
              m.hoverClosestGl2d = {
                name: "hoverClosestGl2d",
                _cat: "hoverclosest",
                title: function(A) {
                  return C(A, "Toggle show closest data on hover");
                },
                attr: "hovermode",
                val: null,
                toggle: !0,
                icon: p.tooltip_basic,
                gravity: "ne",
                click: P
              }, m.hoverClosestPie = {
                name: "hoverClosestPie",
                _cat: "hoverclosest",
                title: function(A) {
                  return C(A, "Toggle show closest data on hover");
                },
                attr: "hovermode",
                val: "closest",
                icon: p.tooltip_basic,
                gravity: "ne",
                click: P
              };
              function F(A) {
                var O = A._fullLayout;
                return O.hovermode ? !1 : O._has("cartesian") ? O._isHoriz ? "y" : "x" : "closest";
              }
              function P(A) {
                var O = F(A);
                l.call("_guiRelayout", A, "hovermode", O);
              }
              m.resetViewSankey = {
                name: "resetSankeyGroup",
                title: function(A) {
                  return C(A, "Reset view");
                },
                icon: p.home,
                click: function(A) {
                  for (var O = {
                    "node.groups": [],
                    "node.x": [],
                    "node.y": []
                  }, N = 0; N < A._fullData.length; N++) {
                    var Y = A._fullData[N]._viewInitial;
                    O["node.groups"].push(Y.node.groups.slice()), O["node.x"].push(Y.node.x.slice()), O["node.y"].push(Y.node.y.slice());
                  }
                  l.call("restyle", A, O);
                }
              }, m.toggleHover = {
                name: "toggleHover",
                title: function(A) {
                  return C(A, "Toggle show closest data on hover");
                },
                attr: "hovermode",
                val: null,
                toggle: !0,
                icon: p.tooltip_basic,
                gravity: "ne",
                click: function(A, O) {
                  var N = E(A, O);
                  N.hovermode = F(A), l.call("_guiRelayout", A, N);
                }
              }, m.resetViews = {
                name: "resetViews",
                title: function(A) {
                  return C(A, "Reset views");
                },
                icon: p.home,
                click: function(A, O) {
                  var N = O.currentTarget;
                  N.setAttribute("data-attr", "zoom"), N.setAttribute("data-val", "reset"), h(A, O), N.setAttribute("data-attr", "resetLastSave"), S(A, O), L(A, "geo"), L(A, "mapbox");
                }
              }, m.toggleSpikelines = {
                name: "toggleSpikelines",
                title: function(A) {
                  return C(A, "Toggle Spike Lines");
                },
                icon: p.spikeline,
                attr: "_cartesianSpikesEnabled",
                val: "on",
                click: function(A) {
                  var O = A._fullLayout, N = O._cartesianSpikesEnabled;
                  O._cartesianSpikesEnabled = N === "on" ? "off" : "on", l.call("_guiRelayout", A, k(A));
                }
              };
              function k(A) {
                for (var O = A._fullLayout, N = O._cartesianSpikesEnabled === "on", Y = f.list(A, null, !0), j = {}, te = 0; te < Y.length; te++) {
                  var re = Y[te];
                  j[re._name + ".showspikes"] = N ? !0 : re._showSpikeInitial;
                }
                return j;
              }
              m.resetViewMapbox = {
                name: "resetViewMapbox",
                _cat: "resetView",
                title: function(A) {
                  return C(A, "Reset view");
                },
                attr: "reset",
                icon: p.home,
                click: function(A) {
                  L(A, "mapbox");
                }
              }, m.zoomInMapbox = {
                name: "zoomInMapbox",
                _cat: "zoomin",
                title: function(A) {
                  return C(A, "Zoom in");
                },
                attr: "zoom",
                val: "in",
                icon: p.zoom_plus,
                click: I
              }, m.zoomOutMapbox = {
                name: "zoomOutMapbox",
                _cat: "zoomout",
                title: function(A) {
                  return C(A, "Zoom out");
                },
                attr: "zoom",
                val: "out",
                icon: p.zoom_minus,
                click: I
              };
              function I(A, O) {
                for (var N = O.currentTarget, Y = N.getAttribute("data-val"), j = A._fullLayout, te = j._subplots.mapbox || [], re = 1.05, z = {}, Z = 0; Z < te.length; Z++) {
                  var W = te[Z], q = j[W].zoom, ie = Y === "in" ? re * q : q / re;
                  z[W + ".zoom"] = ie;
                }
                l.call("_guiRelayout", A, z);
              }
              function L(A, O) {
                for (var N = A._fullLayout, Y = N._subplots[O] || [], j = {}, te = 0; te < Y.length; te++)
                  for (var re = Y[te], z = N[re]._subplot, Z = z.viewInitial, W = Object.keys(Z), q = 0; q < W.length; q++) {
                    var ie = W[q];
                    j[re + "." + ie] = Z[ie];
                  }
                l.call("_guiRelayout", A, j);
              }
            }
          ),
          /***/
          6052: (
            /***/
            function(s, c, i) {
              var l = i(1868), v = Object.keys(l), f = ["drawline", "drawopenpath", "drawclosedpath", "drawcircle", "drawrect", "eraseshape"], p = ["v1hovermode", "hoverclosest", "hovercompare", "togglehover", "togglespikelines"].concat(f), g = [], y = function(C) {
                if (p.indexOf(C._cat || C.name) === -1) {
                  var m = C.name, h = (C._cat || C.name).toLowerCase();
                  g.indexOf(m) === -1 && g.push(m), g.indexOf(h) === -1 && g.push(h);
                }
              };
              v.forEach(function(C) {
                y(l[C]);
              }), g.sort(), s.exports = {
                DRAW_MODES: f,
                backButtons: p,
                foreButtons: g
              };
            }
          ),
          /***/
          824: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(6308), f = i(1780), p = i(6540);
              s.exports = function(y, C) {
                var m = y.modebar || {}, h = f.newContainer(C, "modebar");
                function w(E, x) {
                  return l.coerce(m, h, p, E, x);
                }
                w("orientation"), w("bgcolor", v.addOpacity(C.paper_bgcolor, 0.5));
                var S = v.contrast(v.rgb(C.modebar.bgcolor));
                w("color", v.addOpacity(S, 0.3)), w("activecolor", v.addOpacity(S, 0.7)), w("uirevision", C.uirevision), w("add"), w("remove");
              };
            }
          ),
          /***/
          3080: (
            /***/
            function(s, c, i) {
              s.exports = {
                moduleType: "component",
                name: "modebar",
                layoutAttributes: i(6540),
                supplyLayoutDefaults: i(824),
                manage: i(8816)
              };
            }
          ),
          /***/
          8816: (
            /***/
            function(s, c, i) {
              var l = i(9811), v = i(3028), f = i(4040), p = i(624).isUnifiedHover, g = i(6400), y = i(1868), C = i(6052).DRAW_MODES, m = i(3400).extendDeep;
              s.exports = function(P) {
                var k = P._fullLayout, I = P._context, L = k._modeBar;
                if (!I.displayModeBar && !I.watermark) {
                  L && (L.destroy(), delete k._modeBar);
                  return;
                }
                if (!Array.isArray(I.modeBarButtonsToRemove))
                  throw new Error(["*modeBarButtonsToRemove* configuration options", "must be an array."].join(" "));
                if (!Array.isArray(I.modeBarButtonsToAdd))
                  throw new Error(["*modeBarButtonsToAdd* configuration options", "must be an array."].join(" "));
                var A = I.modeBarButtons, O;
                Array.isArray(A) && A.length ? O = T(A) : !I.displayModeBar && I.watermark ? O = [] : O = h(P), L ? L.update(P, O) : k._modeBar = g(P, O);
              };
              function h(F) {
                var P = F._fullLayout, k = F._fullData, I = F._context;
                function L(_, V) {
                  if (typeof V == "string") {
                    if (V.toLowerCase() === _.toLowerCase()) return !0;
                  } else {
                    var fe = V.name, $ = V._cat || V.name;
                    if (fe === _ || $ === _.toLowerCase()) return !0;
                  }
                  return !1;
                }
                var A = P.modebar.add;
                typeof A == "string" && (A = [A]);
                var O = P.modebar.remove;
                typeof O == "string" && (O = [O]);
                var N = I.modeBarButtonsToAdd.concat(A.filter(function(_) {
                  for (var V = 0; V < I.modeBarButtonsToRemove.length; V++)
                    if (L(_, I.modeBarButtonsToRemove[V])) return !1;
                  return !0;
                })), Y = I.modeBarButtonsToRemove.concat(O.filter(function(_) {
                  for (var V = 0; V < I.modeBarButtonsToAdd.length; V++)
                    if (L(_, I.modeBarButtonsToAdd[V])) return !1;
                  return !0;
                })), j = P._has("cartesian"), te = P._has("gl3d"), re = P._has("geo"), z = P._has("pie"), Z = P._has("funnelarea"), W = P._has("gl2d"), q = P._has("ternary"), ie = P._has("mapbox"), ce = P._has("polar"), X = P._has("smith"), U = P._has("sankey"), ne = w(P), se = p(P.hovermode), le = [];
                function ue(_) {
                  if (_.length) {
                    for (var V = [], fe = 0; fe < _.length; fe++) {
                      for (var $ = _[fe], he = y[$], me = he.name.toLowerCase(), xe = (he._cat || he.name).toLowerCase(), Fe = !1, Ve = 0; Ve < Y.length; Ve++) {
                        var Be = Y[Ve].toLowerCase();
                        if (Be === me || Be === xe) {
                          Fe = !0;
                          break;
                        }
                      }
                      Fe || V.push(y[$]);
                    }
                    le.push(V);
                  }
                }
                var ve = ["toImage"];
                I.showEditInChartStudio ? ve.push("editInChartStudio") : I.showSendToCloud && ve.push("sendDataToCloud"), ue(ve);
                var be = [], Me = [], Ge = [], we = [];
                (j || W || z || Z || q) + re + te + ie + ce + X > 1 ? (Me = ["toggleHover"], Ge = ["resetViews"]) : re ? (be = ["zoomInGeo", "zoomOutGeo"], Me = ["hoverClosestGeo"], Ge = ["resetGeo"]) : te ? (Me = ["hoverClosest3d"], Ge = ["resetCameraDefault3d", "resetCameraLastSave3d"]) : ie ? (be = ["zoomInMapbox", "zoomOutMapbox"], Me = ["toggleHover"], Ge = ["resetViewMapbox"]) : W ? Me = ["hoverClosestGl2d"] : z ? Me = ["hoverClosestPie"] : U ? (Me = ["hoverClosestCartesian", "hoverCompareCartesian"], Ge = ["resetViewSankey"]) : Me = ["toggleHover"], j && (Me = ["toggleSpikelines", "hoverClosestCartesian", "hoverCompareCartesian"]), (E(k) || se) && (Me = []), (j || W) && !ne && (be = ["zoomIn2d", "zoomOut2d", "autoScale2d"], Ge[0] !== "resetViews" && (Ge = ["resetScale2d"])), te ? we = ["zoom3d", "pan3d", "orbitRotation", "tableRotation"] : (j || W) && !ne || q ? we = ["zoom2d", "pan2d"] : ie || re ? we = ["pan2d"] : ce && (we = ["zoom2d"]), S(k) && we.push("select2d", "lasso2d");
                var Re = [], Ae = function(_) {
                  Re.indexOf(_) === -1 && Me.indexOf(_) !== -1 && Re.push(_);
                };
                if (Array.isArray(N)) {
                  for (var K = [], ee = 0; ee < N.length; ee++) {
                    var oe = N[ee];
                    typeof oe == "string" ? (oe = oe.toLowerCase(), C.indexOf(oe) !== -1 ? (P._has("mapbox") || // draw shapes in paper coordinate (could be improved in future to support data coordinate, when there is no pitch)
                    P._has("cartesian")) && we.push(oe) : oe === "togglespikelines" ? Ae("toggleSpikelines") : oe === "togglehover" ? Ae("toggleHover") : oe === "hovercompare" ? Ae("hoverCompareCartesian") : oe === "hoverclosest" ? (Ae("hoverClosestCartesian"), Ae("hoverClosestGeo"), Ae("hoverClosest3d"), Ae("hoverClosestGl2d"), Ae("hoverClosestPie")) : oe === "v1hovermode" && (Ae("toggleHover"), Ae("hoverClosestCartesian"), Ae("hoverCompareCartesian"), Ae("hoverClosestGeo"), Ae("hoverClosest3d"), Ae("hoverClosestGl2d"), Ae("hoverClosestPie"))) : K.push(oe);
                  }
                  N = K;
                }
                return ue(we), ue(be.concat(Ge)), ue(Re), x(le, N);
              }
              function w(F) {
                for (var P = l.list({
                  _fullLayout: F
                }, null, !0), k = 0; k < P.length; k++)
                  if (!P[k].fixedrange)
                    return !1;
                return !0;
              }
              function S(F) {
                for (var P = !1, k = 0; k < F.length && !P; k++) {
                  var I = F[k];
                  !I._module || !I._module.selectPoints || (f.traceIs(I, "scatter-like") ? (v.hasMarkers(I) || v.hasText(I)) && (P = !0) : f.traceIs(I, "box-violin") ? (I.boxpoints === "all" || I.points === "all") && (P = !0) : P = !0);
                }
                return P;
              }
              function E(F) {
                for (var P = 0; P < F.length; P++)
                  if (!f.traceIs(F[P], "noHover")) return !1;
                return !0;
              }
              function x(F, P) {
                if (P.length)
                  if (Array.isArray(P[0]))
                    for (var k = 0; k < P.length; k++)
                      F.push(P[k]);
                  else F.push(P);
                return F;
              }
              function T(F) {
                for (var P = m([], F), k = 0; k < P.length; k++)
                  for (var I = P[k], L = 0; L < I.length; L++) {
                    var A = I[L];
                    if (typeof A == "string")
                      if (y[A] !== void 0)
                        P[k][L] = y[A];
                      else
                        throw new Error(["*modeBarButtons* configuration options", "invalid button name"].join(" "));
                  }
                return P;
              }
            }
          ),
          /***/
          6400: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(3400), p = i(9224), g = i(5788).version, y = new DOMParser();
              function C(S) {
                this.container = S.container, this.element = document.createElement("div"), this.update(S.graphInfo, S.buttons), this.container.appendChild(this.element);
              }
              var m = C.prototype;
              m.update = function(S, E) {
                this.graphInfo = S;
                var x = this.graphInfo._context, T = this.graphInfo._fullLayout, F = "modebar-" + T._uid;
                this.element.setAttribute("id", F), this._uid = F, this.element.className = "modebar", x.displayModeBar === "hover" && (this.element.className += " modebar--hover ease-bg"), T.modebar.orientation === "v" && (this.element.className += " vertical", E = E.reverse());
                var P = T.modebar, k = x.displayModeBar === "hover" ? ".js-plotly-plot .plotly:hover " : "";
                f.deleteRelatedStyleRule(F), f.addRelatedStyleRule(F, k + "#" + F + " .modebar-group", "background-color: " + P.bgcolor), f.addRelatedStyleRule(F, "#" + F + " .modebar-btn .icon path", "fill: " + P.color), f.addRelatedStyleRule(F, "#" + F + " .modebar-btn:hover .icon path", "fill: " + P.activecolor), f.addRelatedStyleRule(F, "#" + F + " .modebar-btn.active .icon path", "fill: " + P.activecolor);
                var I = !this.hasButtons(E), L = this.hasLogo !== x.displaylogo, A = this.locale !== x.locale;
                if (this.locale = x.locale, (I || L || A) && (this.removeAllButtons(), this.updateButtons(E), x.watermark || x.displaylogo)) {
                  var O = this.getLogo();
                  x.watermark && (O.className = O.className + " watermark"), T.modebar.orientation === "v" ? this.element.insertBefore(O, this.element.childNodes[0]) : this.element.appendChild(O), this.hasLogo = !0;
                }
                this.updateActiveButton();
              }, m.updateButtons = function(S) {
                var E = this;
                this.buttons = S, this.buttonElements = [], this.buttonsNames = [], this.buttons.forEach(function(x) {
                  var T = E.createGroup();
                  x.forEach(function(F) {
                    var P = F.name;
                    if (!P)
                      throw new Error("must provide button 'name' in button config");
                    if (E.buttonsNames.indexOf(P) !== -1)
                      throw new Error("button name '" + P + "' is taken");
                    E.buttonsNames.push(P);
                    var k = E.createButton(F);
                    E.buttonElements.push(k), T.appendChild(k);
                  }), E.element.appendChild(T);
                });
              }, m.createGroup = function() {
                var S = document.createElement("div");
                return S.className = "modebar-group", S;
              }, m.createButton = function(S) {
                var E = this, x = document.createElement("a");
                x.setAttribute("rel", "tooltip"), x.className = "modebar-btn";
                var T = S.title;
                T === void 0 ? T = S.name : typeof T == "function" && (T = T(this.graphInfo)), (T || T === 0) && x.setAttribute("data-title", T), S.attr !== void 0 && x.setAttribute("data-attr", S.attr);
                var F = S.val;
                F !== void 0 && (typeof F == "function" && (F = F(this.graphInfo)), x.setAttribute("data-val", F));
                var P = S.click;
                if (typeof P != "function")
                  throw new Error("must provide button 'click' function in button config");
                x.addEventListener("click", function(I) {
                  S.click(E.graphInfo, I), E.updateActiveButton(I.currentTarget);
                }), x.setAttribute("data-toggle", S.toggle || !1), S.toggle && l.select(x).classed("active", !0);
                var k = S.icon;
                return typeof k == "function" ? x.appendChild(k()) : x.appendChild(this.createIcon(k || p.question)), x.setAttribute("data-gravity", S.gravity || "n"), x;
              }, m.createIcon = function(S) {
                var E = v(S.height) ? Number(S.height) : S.ascent - S.descent, x = "http://www.w3.org/2000/svg", T;
                if (S.path) {
                  T = document.createElementNS(x, "svg"), T.setAttribute("viewBox", [0, 0, S.width, E].join(" ")), T.setAttribute("class", "icon");
                  var F = document.createElementNS(x, "path");
                  F.setAttribute("d", S.path), S.transform ? F.setAttribute("transform", S.transform) : S.ascent !== void 0 && F.setAttribute("transform", "matrix(1 0 0 -1 0 " + S.ascent + ")"), T.appendChild(F);
                }
                if (S.svg) {
                  var P = y.parseFromString(S.svg, "application/xml");
                  T = P.childNodes[0];
                }
                return T.setAttribute("height", "1em"), T.setAttribute("width", "1em"), T;
              }, m.updateActiveButton = function(S) {
                var E = this.graphInfo._fullLayout, x = S !== void 0 ? S.getAttribute("data-attr") : null;
                this.buttonElements.forEach(function(T) {
                  var F = T.getAttribute("data-val") || !0, P = T.getAttribute("data-attr"), k = T.getAttribute("data-toggle") === "true", I = l.select(T);
                  if (k)
                    P === x && I.classed("active", !I.classed("active"));
                  else {
                    var L = P === null ? P : f.nestedProperty(E, P).get();
                    I.classed("active", L === F);
                  }
                });
              }, m.hasButtons = function(S) {
                var E = this.buttons;
                if (!E || S.length !== E.length) return !1;
                for (var x = 0; x < S.length; ++x) {
                  if (S[x].length !== E[x].length) return !1;
                  for (var T = 0; T < S[x].length; T++)
                    if (S[x][T].name !== E[x][T].name) return !1;
                }
                return !0;
              };
              function h(S) {
                return S + " (v" + g + ")";
              }
              m.getLogo = function() {
                var S = this.createGroup(), E = document.createElement("a");
                return E.href = "https://plotly.com/", E.target = "_blank", E.setAttribute("data-title", h(f._(this.graphInfo, "Produced with Plotly.js"))), E.className = "modebar-btn plotlyjsicon modebar-btn--logo", E.appendChild(this.createIcon(p.newplotlylogo)), S.appendChild(E), S;
              }, m.removeAllButtons = function() {
                for (; this.element.firstChild; )
                  this.element.removeChild(this.element.firstChild);
                this.hasLogo = !1;
              }, m.destroy = function() {
                f.removeElement(this.container.querySelector(".modebar")), f.deleteRelatedStyleRule(this._uid);
              };
              function w(S, E) {
                var x = S._fullLayout, T = new C({
                  graphInfo: S,
                  container: x._modebardiv.node(),
                  buttons: E
                });
                return x._privateplot && l.select(T.element).append("span").classed("badge-private float--left", !0).text("PRIVATE"), T;
              }
              s.exports = w;
            }
          ),
          /***/
          6680: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(2548), f = i(1780).templatedArray, p = f("button", {
                visible: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "plot"
                },
                step: {
                  valType: "enumerated",
                  values: ["month", "year", "day", "hour", "minute", "second", "all"],
                  dflt: "month",
                  editType: "plot"
                },
                stepmode: {
                  valType: "enumerated",
                  values: ["backward", "todate"],
                  dflt: "backward",
                  editType: "plot"
                },
                count: {
                  valType: "number",
                  min: 0,
                  dflt: 1,
                  editType: "plot"
                },
                label: {
                  valType: "string",
                  editType: "plot"
                },
                editType: "plot"
              });
              s.exports = {
                visible: {
                  valType: "boolean",
                  editType: "plot"
                },
                buttons: p,
                x: {
                  valType: "number",
                  min: -2,
                  max: 3,
                  editType: "plot"
                },
                xanchor: {
                  valType: "enumerated",
                  values: ["auto", "left", "center", "right"],
                  dflt: "left",
                  editType: "plot"
                },
                y: {
                  valType: "number",
                  min: -2,
                  max: 3,
                  editType: "plot"
                },
                yanchor: {
                  valType: "enumerated",
                  values: ["auto", "top", "middle", "bottom"],
                  dflt: "bottom",
                  editType: "plot"
                },
                font: l({
                  editType: "plot"
                }),
                bgcolor: {
                  valType: "color",
                  dflt: v.lightLine,
                  editType: "plot"
                },
                activecolor: {
                  valType: "color",
                  editType: "plot"
                },
                bordercolor: {
                  valType: "color",
                  dflt: v.defaultLine,
                  editType: "plot"
                },
                borderwidth: {
                  valType: "number",
                  min: 0,
                  dflt: 0,
                  editType: "plot"
                },
                editType: "plot"
              };
            }
          ),
          /***/
          5984: (
            /***/
            function(s) {
              s.exports = {
                // 'y' position pad above counter axis domain
                yPad: 0.02,
                // minimum button width (regardless of text size)
                minButtonWidth: 30,
                // buttons rect radii
                rx: 3,
                ry: 3,
                // light fraction used to compute the 'activecolor' default
                lightAmount: 25,
                darkAmount: 10
              };
            }
          ),
          /***/
          2148: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(6308), f = i(1780), p = i(1272), g = i(6680), y = i(5984);
              s.exports = function(w, S, E, x, T) {
                var F = w.rangeselector || {}, P = f.newContainer(S, "rangeselector");
                function k(N, Y) {
                  return l.coerce(F, P, g, N, Y);
                }
                var I = p(F, P, {
                  name: "buttons",
                  handleItemDefaults: C,
                  calendar: T
                }), L = k("visible", I.length > 0);
                if (L) {
                  var A = m(S, E, x);
                  k("x", A[0]), k("y", A[1]), l.noneOrAll(w, S, ["x", "y"]), k("xanchor"), k("yanchor"), l.coerceFont(k, "font", E.font);
                  var O = k("bgcolor");
                  k("activecolor", v.contrast(O, y.lightAmount, y.darkAmount)), k("bordercolor"), k("borderwidth");
                }
              };
              function C(h, w, S, E) {
                var x = E.calendar;
                function T(k, I) {
                  return l.coerce(h, w, g.buttons, k, I);
                }
                var F = T("visible");
                if (F) {
                  var P = T("step");
                  P !== "all" && (x && x !== "gregorian" && (P === "month" || P === "year") ? w.stepmode = "backward" : T("stepmode"), T("count")), T("label");
                }
              }
              function m(h, w, S) {
                for (var E = S.filter(function(P) {
                  return w[P].anchor === h._id;
                }), x = 0, T = 0; T < E.length; T++) {
                  var F = w[E[T]].domain;
                  F && (x = Math.max(F[1], x));
                }
                return [h.domain[0], x + y.yPad];
              }
            }
          ),
          /***/
          216: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(7316), p = i(6308), g = i(3616), y = i(3400), C = y.strTranslate, m = i(2736), h = i(9811), w = i(4284), S = w.LINE_SPACING, E = w.FROM_TL, x = w.FROM_BR, T = i(5984), F = i(8040);
              s.exports = function(te) {
                var re = te._fullLayout, z = re._infolayer.selectAll(".rangeselector").data(P(te), k);
                z.enter().append("g").classed("rangeselector", !0), z.exit().remove(), z.style({
                  cursor: "pointer",
                  "pointer-events": "all"
                }), z.each(function(Z) {
                  var W = l.select(this), q = Z, ie = q.rangeselector, ce = W.selectAll("g.button").data(y.filterVisible(ie.buttons));
                  ce.enter().append("g").classed("button", !0), ce.exit().remove(), ce.each(function(X) {
                    var U = l.select(this), ne = F(q, X);
                    X._isActive = I(q, X, ne), U.call(L, ie, X), U.call(O, ie, X, te), U.on("click", function() {
                      te._dragged || v.call("_guiRelayout", te, ne);
                    }), U.on("mouseover", function() {
                      X._isHovered = !0, U.call(L, ie, X);
                    }), U.on("mouseout", function() {
                      X._isHovered = !1, U.call(L, ie, X);
                    });
                  }), Y(te, ce, ie, q._name, W);
                });
              };
              function P(j) {
                for (var te = h.list(j, "x", !0), re = [], z = 0; z < te.length; z++) {
                  var Z = te[z];
                  Z.rangeselector && Z.rangeselector.visible && re.push(Z);
                }
                return re;
              }
              function k(j) {
                return j._id;
              }
              function I(j, te, re) {
                if (te.step === "all")
                  return j.autorange === !0;
                var z = Object.keys(re);
                return j.range[0] === re[z[0]] && j.range[1] === re[z[1]];
              }
              function L(j, te, re) {
                var z = y.ensureSingle(j, "rect", "selector-rect", function(Z) {
                  Z.attr("shape-rendering", "crispEdges");
                });
                z.attr({
                  rx: T.rx,
                  ry: T.ry
                }), z.call(p.stroke, te.bordercolor).call(p.fill, A(te, re)).style("stroke-width", te.borderwidth + "px");
              }
              function A(j, te) {
                return te._isActive || te._isHovered ? j.activecolor : j.bgcolor;
              }
              function O(j, te, re, z) {
                function Z(q) {
                  m.convertToTspans(q, z);
                }
                var W = y.ensureSingle(j, "text", "selector-text", function(q) {
                  q.attr("text-anchor", "middle");
                });
                W.call(g.font, te.font).text(N(re, z._fullLayout._meta)).call(Z);
              }
              function N(j, te) {
                return j.label ? te ? y.templateString(j.label, te) : j.label : j.step === "all" ? "all" : j.count + j.step.charAt(0);
              }
              function Y(j, te, re, z, Z) {
                var W = 0, q = 0, ie = re.borderwidth;
                te.each(function() {
                  var le = l.select(this), ue = le.select(".selector-text"), ve = re.font.size * S, be = Math.max(ve * m.lineCount(ue), 16) + 3;
                  q = Math.max(q, be);
                }), te.each(function() {
                  var le = l.select(this), ue = le.select(".selector-rect"), ve = le.select(".selector-text"), be = ve.node() && g.bBox(ve.node()).width, Me = re.font.size * S, Ge = m.lineCount(ve), we = Math.max(be + 10, T.minButtonWidth);
                  le.attr("transform", C(ie + W, ie)), ue.attr({
                    x: 0,
                    y: 0,
                    width: we,
                    height: q
                  }), m.positionText(ve, we / 2, q / 2 - (Ge - 1) * Me / 2 + 3), W += we + 5;
                });
                var ce = j._fullLayout._size, X = ce.l + ce.w * re.x, U = ce.t + ce.h * (1 - re.y), ne = "left";
                y.isRightAnchor(re) && (X -= W, ne = "right"), y.isCenterAnchor(re) && (X -= W / 2, ne = "center");
                var se = "top";
                y.isBottomAnchor(re) && (U -= q, se = "bottom"), y.isMiddleAnchor(re) && (U -= q / 2, se = "middle"), W = Math.ceil(W), q = Math.ceil(q), X = Math.round(X), U = Math.round(U), f.autoMargin(j, z + "-range-selector", {
                  x: re.x,
                  y: re.y,
                  l: W * E[ne],
                  r: W * x[ne],
                  b: q * x[se],
                  t: q * E[se]
                }), Z.attr("transform", C(X, U));
              }
            }
          ),
          /***/
          8040: (
            /***/
            function(s, c, i) {
              var l = i(3220), v = i(3400).titleCase;
              s.exports = function(g, y) {
                var C = g._name, m = {};
                if (y.step === "all")
                  m[C + ".autorange"] = !0;
                else {
                  var h = f(g, y);
                  m[C + ".range[0]"] = h[0], m[C + ".range[1]"] = h[1];
                }
                return m;
              };
              function f(p, g) {
                var y = p.range, C = new Date(p.r2l(y[1])), m = g.step, h = l["utc" + v(m)], w = g.count, S;
                switch (g.stepmode) {
                  case "backward":
                    S = p.l2r(+h.offset(C, -w));
                    break;
                  case "todate":
                    var E = h.offset(C, -w);
                    S = p.l2r(+h.ceil(E));
                    break;
                }
                var x = y[1];
                return [S, x];
              }
            }
          ),
          /***/
          1152: (
            /***/
            function(s, c, i) {
              s.exports = {
                moduleType: "component",
                name: "rangeselector",
                schema: {
                  subplots: {
                    xaxis: {
                      rangeselector: i(6680)
                    }
                  }
                },
                layoutAttributes: i(6680),
                handleDefaults: i(2148),
                draw: i(216)
              };
            }
          ),
          /***/
          8820: (
            /***/
            function(s, c, i) {
              var l = i(2548);
              s.exports = {
                bgcolor: {
                  valType: "color",
                  dflt: l.background,
                  editType: "plot"
                },
                bordercolor: {
                  valType: "color",
                  dflt: l.defaultLine,
                  editType: "plot"
                },
                borderwidth: {
                  valType: "integer",
                  dflt: 0,
                  min: 0,
                  editType: "plot"
                },
                autorange: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc",
                  impliedEdits: {
                    "range[0]": void 0,
                    "range[1]": void 0
                  }
                },
                range: {
                  valType: "info_array",
                  items: [{
                    valType: "any",
                    editType: "calc",
                    impliedEdits: {
                      "^autorange": !1
                    }
                  }, {
                    valType: "any",
                    editType: "calc",
                    impliedEdits: {
                      "^autorange": !1
                    }
                  }],
                  editType: "calc",
                  impliedEdits: {
                    autorange: !1
                  }
                },
                thickness: {
                  valType: "number",
                  dflt: 0.15,
                  min: 0,
                  max: 1,
                  editType: "plot"
                },
                visible: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc"
                },
                editType: "calc"
              };
            }
          ),
          /***/
          6652: (
            /***/
            function(s, c, i) {
              var l = i(9811).list, v = i(9280).getAutoRange, f = i(4636);
              s.exports = function(g) {
                for (var y = l(g, "x", !0), C = 0; C < y.length; C++) {
                  var m = y[C], h = m[f.name];
                  h && h.visible && h.autorange && (h._input.autorange = !0, h._input.range = h.range = v(g, m));
                }
              };
            }
          ),
          /***/
          4636: (
            /***/
            function(s) {
              s.exports = {
                // attribute container name
                name: "rangeslider",
                // class names
                containerClassName: "rangeslider-container",
                bgClassName: "rangeslider-bg",
                rangePlotClassName: "rangeslider-rangeplot",
                maskMinClassName: "rangeslider-mask-min",
                maskMaxClassName: "rangeslider-mask-max",
                slideBoxClassName: "rangeslider-slidebox",
                grabberMinClassName: "rangeslider-grabber-min",
                grabAreaMinClassName: "rangeslider-grabarea-min",
                handleMinClassName: "rangeslider-handle-min",
                grabberMaxClassName: "rangeslider-grabber-max",
                grabAreaMaxClassName: "rangeslider-grabarea-max",
                handleMaxClassName: "rangeslider-handle-max",
                maskMinOppAxisClassName: "rangeslider-mask-min-opp-axis",
                maskMaxOppAxisClassName: "rangeslider-mask-max-opp-axis",
                // style constants
                maskColor: "rgba(0,0,0,0.4)",
                maskOppAxisColor: "rgba(0,0,0,0.2)",
                slideBoxFill: "transparent",
                slideBoxCursor: "ew-resize",
                grabAreaFill: "transparent",
                grabAreaCursor: "col-resize",
                grabAreaWidth: 10,
                handleWidth: 4,
                handleRadius: 1,
                handleStrokeWidth: 1,
                extraPad: 15
              };
            }
          ),
          /***/
          1659: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(1780), f = i(9811), p = i(8820), g = i(936);
              s.exports = function(C, m, h) {
                var w = C[h], S = m[h];
                if (!(w.rangeslider || m._requestRangeslider[S._id])) return;
                l.isPlainObject(w.rangeslider) || (w.rangeslider = {});
                var E = w.rangeslider, x = v.newContainer(S, "rangeslider");
                function T(z, Z) {
                  return l.coerce(E, x, p, z, Z);
                }
                var F, P;
                function k(z, Z) {
                  return l.coerce(F, P, g, z, Z);
                }
                var I = T("visible");
                if (I) {
                  T("bgcolor", m.plot_bgcolor), T("bordercolor"), T("borderwidth"), T("thickness"), T("autorange", !S.isValidRange(E.range)), T("range");
                  var L = m._subplots;
                  if (L)
                    for (var A = L.cartesian.filter(function(z) {
                      return z.substr(0, z.indexOf("y")) === f.name2id(h);
                    }).map(function(z) {
                      return z.substr(z.indexOf("y"), z.length);
                    }), O = l.simpleMap(A, f.id2name), N = 0; N < O.length; N++) {
                      var Y = O[N];
                      F = E[Y] || {}, P = v.newContainer(x, Y, "yaxis");
                      var j = m[Y], te;
                      F.range && j.isValidRange(F.range) && (te = "fixed");
                      var re = k("rangemode", te);
                      re !== "match" && k("range", j.range.slice());
                    }
                  x._input = E;
                }
              };
            }
          ),
          /***/
          60: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(7316), p = i(3400), g = p.strTranslate, y = i(3616), C = i(6308), m = i(1668), h = i(7952), w = i(9811), S = i(6476), E = i(3972), x = i(4636);
              s.exports = function(te) {
                for (var re = te._fullLayout, z = re._rangeSliderData, Z = 0; Z < z.length; Z++) {
                  var W = z[Z][x.name];
                  W._clipId = W._id + "-" + re._uid;
                }
                function q(ce) {
                  return ce._name;
                }
                var ie = re._infolayer.selectAll("g." + x.containerClassName).data(z, q);
                ie.exit().each(function(ce) {
                  var X = ce[x.name];
                  re._topdefs.select("#" + X._clipId).remove();
                }).remove(), z.length !== 0 && (ie.enter().append("g").classed(x.containerClassName, !0).attr("pointer-events", "all"), ie.each(function(ce) {
                  var X = l.select(this), U = ce[x.name], ne = re[w.id2name(ce.anchor)], se = U[w.id2name(ce.anchor)];
                  if (U.range) {
                    var le = p.simpleMap(U.range, ce.r2l), ue = p.simpleMap(ce.range, ce.r2l), ve;
                    ue[0] < ue[1] ? ve = [Math.min(le[0], ue[0]), Math.max(le[1], ue[1])] : ve = [Math.max(le[0], ue[0]), Math.min(le[1], ue[1])], U.range = U._input.range = p.simpleMap(ve, ce.l2r);
                  }
                  ce.cleanRange("rangeslider.range");
                  var be = re._size, Me = ce.domain;
                  U._width = be.w * (Me[1] - Me[0]);
                  var Ge = Math.round(be.l + be.w * Me[0]), we = Math.round(be.t + be.h * (1 - ce._counterDomainMin) + (ce.side === "bottom" ? ce._depth : 0) + U._offsetShift + x.extraPad);
                  X.attr("transform", g(Ge, we)), U._rl = p.simpleMap(U.range, ce.r2l);
                  var Re = U._rl[0], Ae = U._rl[1], K = Ae - Re;
                  if (U.p2d = function(Fe) {
                    return Fe / U._width * K + Re;
                  }, U.d2p = function(Fe) {
                    return (Fe - Re) / K * U._width;
                  }, ce.rangebreaks) {
                    var ee = ce.locateBreaks(Re, Ae);
                    if (ee.length) {
                      var oe, _, V = 0;
                      for (oe = 0; oe < ee.length; oe++)
                        _ = ee[oe], V += _.max - _.min;
                      var fe = U._width / (Ae - Re - V), $ = [-fe * Re];
                      for (oe = 0; oe < ee.length; oe++)
                        _ = ee[oe], $.push($[$.length - 1] - fe * (_.max - _.min));
                      for (U.d2p = function(Fe) {
                        for (var Ve = $[0], Be = 0; Be < ee.length; Be++) {
                          var Je = ee[Be];
                          if (Fe >= Je.max) Ve = $[Be + 1];
                          else if (Fe < Je.min) break;
                        }
                        return Ve + fe * Fe;
                      }, oe = 0; oe < ee.length; oe++)
                        _ = ee[oe], _.pmin = U.d2p(_.min), _.pmax = U.d2p(_.max);
                      U.p2d = function(Fe) {
                        for (var Ve = $[0], Be = 0; Be < ee.length; Be++) {
                          var Je = ee[Be];
                          if (Fe >= Je.pmax) Ve = $[Be + 1];
                          else if (Fe < Je.pmin) break;
                        }
                        return (Fe - Ve) / fe;
                      };
                    }
                  }
                  if (se.rangemode !== "match") {
                    var he = ne.r2l(se.range[0]), me = ne.r2l(se.range[1]), xe = me - he;
                    U.d2pOppAxis = function(Fe) {
                      return (Fe - he) / xe * U._height;
                    };
                  }
                  X.call(I, te, ce, U).call(L, te, ce, U).call(A, te, ce, U).call(N, te, ce, U, se).call(Y, te, ce, U).call(j, te, ce, U), F(X, te, ce, U), k(X, te, ce, U, ne, se), ce.side === "bottom" && m.draw(te, ce._id + "title", {
                    propContainer: ce,
                    propName: ce._name + ".title",
                    placeholder: re._dfltTitle.x,
                    attributes: {
                      x: ce._offset + ce._length / 2,
                      y: we + U._height + U._offsetShift + 10 + 1.5 * ce.title.font.size,
                      "text-anchor": "middle"
                    }
                  });
                }));
              };
              function T(te) {
                return typeof te.clientX == "number" ? te.clientX : te.touches && te.touches.length > 0 ? te.touches[0].clientX : 0;
              }
              function F(te, re, z, Z) {
                if (re._context.staticPlot) return;
                var W = te.select("rect." + x.slideBoxClassName).node(), q = te.select("rect." + x.grabAreaMinClassName).node(), ie = te.select("rect." + x.grabAreaMaxClassName).node();
                function ce() {
                  var X = l.event, U = X.target, ne = T(X), se = ne - te.node().getBoundingClientRect().left, le = Z.d2p(z._rl[0]), ue = Z.d2p(z._rl[1]), ve = S.coverSlip();
                  this.addEventListener("touchmove", be), this.addEventListener("touchend", Me), ve.addEventListener("mousemove", be), ve.addEventListener("mouseup", Me);
                  function be(Ge) {
                    var we = T(Ge), Re = +we - ne, Ae, K, ee;
                    switch (U) {
                      case W:
                        if (ee = "ew-resize", le + Re > z._length || ue + Re < 0)
                          return;
                        Ae = le + Re, K = ue + Re;
                        break;
                      case q:
                        if (ee = "col-resize", le + Re > z._length)
                          return;
                        Ae = le + Re, K = ue;
                        break;
                      case ie:
                        if (ee = "col-resize", ue + Re < 0)
                          return;
                        Ae = le, K = ue + Re;
                        break;
                      default:
                        ee = "ew-resize", Ae = se, K = se + Re;
                        break;
                    }
                    if (K < Ae) {
                      var oe = K;
                      K = Ae, Ae = oe;
                    }
                    Z._pixelMin = Ae, Z._pixelMax = K, E(l.select(ve), ee), P(te, re, z, Z);
                  }
                  function Me() {
                    ve.removeEventListener("mousemove", be), ve.removeEventListener("mouseup", Me), this.removeEventListener("touchmove", be), this.removeEventListener("touchend", Me), p.removeElement(ve);
                  }
                }
                te.on("mousedown", ce), te.on("touchstart", ce);
              }
              function P(te, re, z, Z) {
                function W(ce) {
                  return z.l2r(p.constrain(ce, Z._rl[0], Z._rl[1]));
                }
                var q = W(Z.p2d(Z._pixelMin)), ie = W(Z.p2d(Z._pixelMax));
                window.requestAnimationFrame(function() {
                  v.call("_guiRelayout", re, z._name + ".range", [q, ie]);
                });
              }
              function k(te, re, z, Z, W, q) {
                var ie = x.handleWidth / 2;
                function ce(Ge) {
                  return p.constrain(Ge, 0, Z._width);
                }
                function X(Ge) {
                  return p.constrain(Ge, 0, Z._height);
                }
                function U(Ge) {
                  return p.constrain(Ge, -ie, Z._width + ie);
                }
                var ne = ce(Z.d2p(z._rl[0])), se = ce(Z.d2p(z._rl[1]));
                if (te.select("rect." + x.slideBoxClassName).attr("x", ne).attr("width", se - ne), te.select("rect." + x.maskMinClassName).attr("width", ne), te.select("rect." + x.maskMaxClassName).attr("x", se).attr("width", Z._width - se), q.rangemode !== "match") {
                  var le = Z._height - X(Z.d2pOppAxis(W._rl[1])), ue = Z._height - X(Z.d2pOppAxis(W._rl[0]));
                  te.select("rect." + x.maskMinOppAxisClassName).attr("x", ne).attr("height", le).attr("width", se - ne), te.select("rect." + x.maskMaxOppAxisClassName).attr("x", ne).attr("y", ue).attr("height", Z._height - ue).attr("width", se - ne), te.select("rect." + x.slideBoxClassName).attr("y", le).attr("height", ue - le);
                }
                var ve = 0.5, be = Math.round(U(ne - ie)) - ve, Me = Math.round(U(se - ie)) + ve;
                te.select("g." + x.grabberMinClassName).attr("transform", g(be, ve)), te.select("g." + x.grabberMaxClassName).attr("transform", g(Me, ve));
              }
              function I(te, re, z, Z) {
                var W = p.ensureSingle(te, "rect", x.bgClassName, function(X) {
                  X.attr({
                    x: 0,
                    y: 0,
                    "shape-rendering": "crispEdges"
                  });
                }), q = Z.borderwidth % 2 === 0 ? Z.borderwidth : Z.borderwidth - 1, ie = -Z._offsetShift, ce = y.crispRound(re, Z.borderwidth);
                W.attr({
                  width: Z._width + q,
                  height: Z._height + q,
                  transform: g(ie, ie),
                  "stroke-width": ce
                }).call(C.stroke, Z.bordercolor).call(C.fill, Z.bgcolor);
              }
              function L(te, re, z, Z) {
                var W = re._fullLayout, q = p.ensureSingleById(W._topdefs, "clipPath", Z._clipId, function(ie) {
                  ie.append("rect").attr({
                    x: 0,
                    y: 0
                  });
                });
                q.select("rect").attr({
                  width: Z._width,
                  height: Z._height
                });
              }
              function A(te, re, z, Z) {
                var W = re.calcdata, q = te.selectAll("g." + x.rangePlotClassName).data(z._subplotsWith, p.identity);
                q.enter().append("g").attr("class", function(ce) {
                  return x.rangePlotClassName + " " + ce;
                }).call(y.setClipUrl, Z._clipId, re), q.order(), q.exit().remove();
                var ie;
                q.each(function(ce, X) {
                  var U = l.select(this), ne = X === 0, se = w.getFromId(re, ce, "y"), le = se._name, ue = Z[le], ve = {
                    data: [],
                    layout: {
                      xaxis: {
                        type: z.type,
                        domain: [0, 1],
                        range: Z.range.slice(),
                        calendar: z.calendar
                      },
                      width: Z._width,
                      height: Z._height,
                      margin: {
                        t: 0,
                        b: 0,
                        l: 0,
                        r: 0
                      }
                    },
                    _context: re._context
                  };
                  z.rangebreaks && (ve.layout.xaxis.rangebreaks = z.rangebreaks), ve.layout[le] = {
                    type: se.type,
                    domain: [0, 1],
                    range: ue.rangemode !== "match" ? ue.range.slice() : se.range.slice(),
                    calendar: se.calendar
                  }, se.rangebreaks && (ve.layout[le].rangebreaks = se.rangebreaks), f.supplyDefaults(ve);
                  var be = ve._fullLayout.xaxis, Me = ve._fullLayout[le];
                  be.clearCalc(), be.setScale(), Me.clearCalc(), Me.setScale();
                  var Ge = {
                    id: ce,
                    plotgroup: U,
                    xaxis: be,
                    yaxis: Me,
                    isRangePlot: !0
                  };
                  ne ? ie = Ge : (Ge.mainplot = "xy", Ge.mainplotinfo = ie), h.rangePlot(re, Ge, O(W, ce));
                });
              }
              function O(te, re) {
                for (var z = [], Z = 0; Z < te.length; Z++) {
                  var W = te[Z], q = W[0].trace;
                  q.xaxis + q.yaxis === re && z.push(W);
                }
                return z;
              }
              function N(te, re, z, Z, W) {
                var q = p.ensureSingle(te, "rect", x.maskMinClassName, function(U) {
                  U.attr({
                    x: 0,
                    y: 0,
                    "shape-rendering": "crispEdges"
                  });
                });
                q.attr("height", Z._height).call(C.fill, x.maskColor);
                var ie = p.ensureSingle(te, "rect", x.maskMaxClassName, function(U) {
                  U.attr({
                    y: 0,
                    "shape-rendering": "crispEdges"
                  });
                });
                if (ie.attr("height", Z._height).call(C.fill, x.maskColor), W.rangemode !== "match") {
                  var ce = p.ensureSingle(te, "rect", x.maskMinOppAxisClassName, function(U) {
                    U.attr({
                      y: 0,
                      "shape-rendering": "crispEdges"
                    });
                  });
                  ce.attr("width", Z._width).call(C.fill, x.maskOppAxisColor);
                  var X = p.ensureSingle(te, "rect", x.maskMaxOppAxisClassName, function(U) {
                    U.attr({
                      y: 0,
                      "shape-rendering": "crispEdges"
                    });
                  });
                  X.attr("width", Z._width).style("border-top", x.maskOppBorder).call(C.fill, x.maskOppAxisColor);
                }
              }
              function Y(te, re, z, Z) {
                if (!re._context.staticPlot) {
                  var W = p.ensureSingle(te, "rect", x.slideBoxClassName, function(q) {
                    q.attr({
                      y: 0,
                      cursor: x.slideBoxCursor,
                      "shape-rendering": "crispEdges"
                    });
                  });
                  W.attr({
                    height: Z._height,
                    fill: x.slideBoxFill
                  });
                }
              }
              function j(te, re, z, Z) {
                var W = p.ensureSingle(te, "g", x.grabberMinClassName), q = p.ensureSingle(te, "g", x.grabberMaxClassName), ie = {
                  x: 0,
                  width: x.handleWidth,
                  rx: x.handleRadius,
                  fill: C.background,
                  stroke: C.defaultLine,
                  "stroke-width": x.handleStrokeWidth,
                  "shape-rendering": "crispEdges"
                }, ce = {
                  y: Math.round(Z._height / 4),
                  height: Math.round(Z._height / 2)
                }, X = p.ensureSingle(W, "rect", x.handleMinClassName, function(ue) {
                  ue.attr(ie);
                });
                X.attr(ce);
                var U = p.ensureSingle(q, "rect", x.handleMaxClassName, function(ue) {
                  ue.attr(ie);
                });
                U.attr(ce);
                var ne = {
                  width: x.grabAreaWidth,
                  x: 0,
                  y: 0,
                  fill: x.grabAreaFill,
                  cursor: re._context.staticPlot ? void 0 : x.grabAreaCursor
                }, se = p.ensureSingle(W, "rect", x.grabAreaMinClassName, function(ue) {
                  ue.attr(ne);
                });
                se.attr("height", Z._height);
                var le = p.ensureSingle(q, "rect", x.grabAreaMaxClassName, function(ue) {
                  ue.attr(ne);
                });
                le.attr("height", Z._height);
              }
            }
          ),
          /***/
          7944: (
            /***/
            function(s, c, i) {
              var l = i(9811), v = i(2736), f = i(4636), p = i(4284).LINE_SPACING, g = f.name;
              function y(C) {
                var m = C && C[g];
                return m && m.visible;
              }
              c.isVisible = y, c.makeData = function(C) {
                var m = l.list({
                  _fullLayout: C
                }, "x", !0), h = C.margin, w = [];
                if (!C._has("gl2d"))
                  for (var S = 0; S < m.length; S++) {
                    var E = m[S];
                    if (y(E)) {
                      w.push(E);
                      var x = E[g];
                      x._id = g + E._id, x._height = (C.height - h.b - h.t) * x.thickness, x._offsetShift = Math.floor(x.borderwidth / 2);
                    }
                  }
                C._rangeSliderData = w;
              }, c.autoMarginOpts = function(C, m) {
                var h = C._fullLayout, w = m[g], S = m._id.charAt(0), E = 0, x = 0;
                if (m.side === "bottom" && (E = m._depth, m.title.text !== h._dfltTitle[S])) {
                  x = 1.5 * m.title.font.size + 10 + w._offsetShift;
                  var T = (m.title.text.match(v.BR_TAG_ALL) || []).length;
                  x += T * m.title.font.size * p;
                }
                return {
                  x: 0,
                  y: m._counterDomainMin,
                  l: 0,
                  r: 0,
                  t: 0,
                  b: w._height + E + Math.max(h.margin.b, x),
                  pad: f.extraPad + w._offsetShift * 2
                };
              };
            }
          ),
          /***/
          9692: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(8820), f = i(936), p = i(7944);
              s.exports = {
                moduleType: "component",
                name: "rangeslider",
                schema: {
                  subplots: {
                    xaxis: {
                      rangeslider: l.extendFlat({}, v, {
                        yaxis: f
                      })
                    }
                  }
                },
                layoutAttributes: i(8820),
                handleDefaults: i(1659),
                calcAutorange: i(6652),
                draw: i(60),
                isVisible: p.isVisible,
                makeData: p.makeData,
                autoMarginOpts: p.autoMarginOpts
              };
            }
          ),
          /***/
          936: (
            /***/
            function(s) {
              s.exports = {
                // not really a 'subplot' attribute container,
                // but this is the flag we use to denote attributes that
                // support yaxis, yaxis2, yaxis3, ... counters
                _isSubplotObj: !0,
                rangemode: {
                  valType: "enumerated",
                  values: ["auto", "fixed", "match"],
                  dflt: "match",
                  editType: "calc"
                },
                range: {
                  valType: "info_array",
                  items: [{
                    valType: "any",
                    editType: "plot"
                  }, {
                    valType: "any",
                    editType: "plot"
                  }],
                  editType: "plot"
                },
                editType: "calc"
              };
            }
          ),
          /***/
          3956: (
            /***/
            function(s, c, i) {
              var l = i(3916), v = i(2904).line, f = i(8192).u, p = i(2880).extendFlat, g = i(7824).overrideAll, y = i(1780).templatedArray;
              i(6208), s.exports = g(y("selection", {
                type: {
                  valType: "enumerated",
                  values: ["rect", "path"]
                },
                xref: p({}, l.xref, {}),
                yref: p({}, l.yref, {}),
                x0: {
                  valType: "any"
                },
                x1: {
                  valType: "any"
                },
                y0: {
                  valType: "any"
                },
                y1: {
                  valType: "any"
                },
                path: {
                  valType: "string",
                  editType: "arraydraw"
                },
                opacity: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 0.7,
                  editType: "arraydraw"
                },
                line: {
                  color: v.color,
                  width: p({}, v.width, {
                    min: 1,
                    dflt: 1
                  }),
                  dash: p({}, f, {
                    dflt: "dot"
                  })
                }
              }), "arraydraw", "from-root");
            }
          ),
          /***/
          3280: (
            /***/
            function(s) {
              s.exports = {
                // max pixels off straight before a lasso select line counts as bent
                BENDPX: 1.5,
                // smallest dimension allowed for a select box
                MINSELECT: 12,
                // throttling limit (ms) for selectPoints calls
                SELECTDELAY: 100,
                // cache ID suffix for throttle
                SELECTID: "-select"
              };
            }
          ),
          /***/
          4224: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(1272), p = i(3956), g = i(5152);
              s.exports = function(m, h) {
                f(m, h, {
                  name: "selections",
                  handleItemDefaults: y
                });
                for (var w = h.selections, S = 0; S < w.length; S++) {
                  var E = w[S];
                  E && E.path === void 0 && (E.x0 === void 0 || E.x1 === void 0 || E.y0 === void 0 || E.y1 === void 0) && (h.selections[S] = null);
                }
              };
              function y(C, m, h) {
                function w(W, q) {
                  return l.coerce(C, m, p, W, q);
                }
                var S = w("path"), E = S ? "path" : "rect", x = w("type", E), T = x !== "path";
                T && delete m.path, w("opacity"), w("line.color"), w("line.width"), w("line.dash");
                for (var F = ["x", "y"], P = 0; P < 2; P++) {
                  var k = F[P], I = {
                    _fullLayout: h
                  }, L, A, O, N = v.coerceRef(C, m, I, k);
                  if (L = v.getFromId(I, N), L._selectionIndices.push(m._index), O = g.rangeToShapePosition(L), A = g.shapePositionToRange(L), T) {
                    var Y = k + "0", j = k + "1", te = C[Y], re = C[j];
                    C[Y] = A(C[Y], !0), C[j] = A(C[j], !0), v.coercePosition(m, I, w, N, Y), v.coercePosition(m, I, w, N, j);
                    var z = m[Y], Z = m[j];
                    z !== void 0 && Z !== void 0 && (m[Y] = O(z), m[j] = O(Z), C[Y] = te, C[j] = re);
                  }
                }
                T && l.noneOrAll(C, m, ["x0", "x1", "y0", "y1"]);
              }
            }
          ),
          /***/
          3640: (
            /***/
            function(s, c, i) {
              var l = i(9856).readPaths, v = i(5496), f = i(1936).clearOutlineControllers, p = i(6308), g = i(3616), y = i(1780).arrayEditor, C = i(5152), m = C.getPathString;
              s.exports = {
                draw: h,
                drawOne: S,
                activateLastSelection: T
              };
              function h(P) {
                var k = P._fullLayout;
                f(P), k._selectionLayer.selectAll("path").remove();
                for (var I in k._plots) {
                  var L = k._plots[I].selectionLayer;
                  L && L.selectAll("path").remove();
                }
                for (var A = 0; A < k.selections.length; A++)
                  S(P, A);
              }
              function w(P) {
                return P._context.editSelection;
              }
              function S(P, k) {
                P._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="' + k + '"]').remove();
                var I = C.makeSelectionsOptionsAndPlotinfo(P, k), L = I.options, A = I.plotinfo;
                if (!L._input) return;
                O(P._fullLayout._selectionLayer);
                function O(N) {
                  var Y = m(P, L), j = {
                    "data-index": k,
                    "fill-rule": "evenodd",
                    d: Y
                  }, te = L.opacity, re = "rgba(0,0,0,0)", z = L.line.color || p.contrast(P._fullLayout.plot_bgcolor), Z = L.line.width, W = L.line.dash;
                  Z || (Z = 5, W = "solid");
                  var q = w(P) && P._fullLayout._activeSelectionIndex === k;
                  q && (re = P._fullLayout.activeselection.fillcolor, te = P._fullLayout.activeselection.opacity);
                  for (var ie = [], ce = 1; ce >= 0; ce--) {
                    var X = N.append("path").attr(j).style("opacity", ce ? 0.1 : te).call(p.stroke, z).call(p.fill, re).call(g.dashLine, ce ? "solid" : W, ce ? 4 + Z : Z);
                    if (E(X, P, L), q) {
                      var U = y(P.layout, "selections", L);
                      X.style({
                        cursor: "move"
                      });
                      var ne = {
                        element: X.node(),
                        plotinfo: A,
                        gd: P,
                        editHelpers: U,
                        isActiveSelection: !0
                        // i.e. to enable controllers
                      }, se = l(Y, P);
                      v(se, X, ne);
                    } else
                      X.style("pointer-events", ce ? "all" : "none");
                    ie[ce] = X;
                  }
                  var le = ie[0], ue = ie[1];
                  ue.node().addEventListener("click", function() {
                    return x(P, le);
                  });
                }
              }
              function E(P, k, I) {
                var L = I.xref + I.yref;
                g.setClipUrl(P, "clip" + k._fullLayout._uid + L, k);
              }
              function x(P, k) {
                if (w(P)) {
                  var I = k.node(), L = +I.getAttribute("data-index");
                  if (L >= 0) {
                    if (L === P._fullLayout._activeSelectionIndex) {
                      F(P);
                      return;
                    }
                    P._fullLayout._activeSelectionIndex = L, P._fullLayout._deactivateSelection = F, h(P);
                  }
                }
              }
              function T(P) {
                if (w(P)) {
                  var k = P._fullLayout.selections.length - 1;
                  P._fullLayout._activeSelectionIndex = k, P._fullLayout._deactivateSelection = F, h(P);
                }
              }
              function F(P) {
                if (w(P)) {
                  var k = P._fullLayout._activeSelectionIndex;
                  k >= 0 && (f(P), delete P._fullLayout._activeSelectionIndex, h(P));
                }
              }
            }
          ),
          /***/
          4200: (
            /***/
            function(s, c, i) {
              var l = i(8192).u, v = i(2880).extendFlat;
              s.exports = {
                newselection: {
                  mode: {
                    valType: "enumerated",
                    values: ["immediate", "gradual"],
                    dflt: "immediate",
                    editType: "none"
                  },
                  line: {
                    color: {
                      valType: "color",
                      editType: "none"
                    },
                    width: {
                      valType: "number",
                      min: 1,
                      dflt: 1,
                      editType: "none"
                    },
                    dash: v({}, l, {
                      dflt: "dot",
                      editType: "none"
                    }),
                    editType: "none"
                  },
                  // no drawdirection here noting that layout.selectdirection is used instead.
                  editType: "none"
                },
                activeselection: {
                  fillcolor: {
                    valType: "color",
                    dflt: "rgba(0,0,0,0)",
                    editType: "none"
                  },
                  opacity: {
                    valType: "number",
                    min: 0,
                    max: 1,
                    dflt: 0.5,
                    editType: "none"
                  },
                  editType: "none"
                }
              };
            }
          ),
          /***/
          1004: (
            /***/
            function(s) {
              s.exports = function(i, l, v) {
                v("newselection.mode");
                var f = v("newselection.line.width");
                f && (v("newselection.line.color"), v("newselection.line.dash")), v("activeselection.fillcolor"), v("activeselection.opacity");
              };
            }
          ),
          /***/
          5968: (
            /***/
            function(s, c, i) {
              var l = i(2760), v = l.selectMode, f = i(1936), p = f.clearOutline, g = i(9856), y = g.readPaths, C = g.writePaths, m = g.fixDatesForPaths;
              s.exports = function(w, S) {
                if (w.length) {
                  var E = w[0][0];
                  if (E) {
                    var x = E.getAttribute("d"), T = S.gd, F = T._fullLayout.newselection, P = S.plotinfo, k = P.xaxis, I = P.yaxis, L = S.isActiveSelection, A = S.dragmode, O = (T.layout || {}).selections || [];
                    if (!v(A) && L !== void 0) {
                      var N = T._fullLayout._activeSelectionIndex;
                      if (N < O.length)
                        switch (T._fullLayout.selections[N].type) {
                          case "rect":
                            A = "select";
                            break;
                          case "path":
                            A = "lasso";
                            break;
                        }
                    }
                    var Y = y(x, T, P, L), j = {
                      xref: k._id,
                      yref: I._id,
                      opacity: F.opacity,
                      line: {
                        color: F.line.color,
                        width: F.line.width,
                        dash: F.line.dash
                      }
                    }, te;
                    Y.length === 1 && (te = Y[0]), te && te.length === 5 && // ensure we only have 4 corners for a rect
                    A === "select" ? (j.type = "rect", j.x0 = te[0][1], j.y0 = te[0][2], j.x1 = te[2][1], j.y1 = te[2][2]) : (j.type = "path", k && I && m(Y, k, I), j.path = C(Y), te = null), p(T);
                    for (var re = S.editHelpers, z = (re || {}).modifyItem, Z = [], W = 0; W < O.length; W++) {
                      var q = T._fullLayout.selections[W];
                      if (!q) {
                        Z[W] = q;
                        continue;
                      }
                      if (Z[W] = q._input, L !== void 0 && W === T._fullLayout._activeSelectionIndex) {
                        var ie = j;
                        switch (q.type) {
                          case "rect":
                            z("x0", ie.x0), z("x1", ie.x1), z("y0", ie.y0), z("y1", ie.y1);
                            break;
                          case "path":
                            z("path", ie.path);
                            break;
                        }
                      }
                    }
                    return L === void 0 ? (Z.push(j), Z) : re ? re.getUpdateObj() : {};
                  }
                }
              };
            }
          ),
          /***/
          5840: (
            /***/
            function(s, c, i) {
              var l = i(3400).strTranslate;
              function v(y, C) {
                switch (y.type) {
                  case "log":
                    return y.p2d(C);
                  case "date":
                    return y.p2r(C, 0, y.calendar);
                  default:
                    return y.p2r(C);
                }
              }
              function f(y, C) {
                switch (y.type) {
                  case "log":
                    return y.d2p(C);
                  case "date":
                    return y.r2p(C, 0, y.calendar);
                  default:
                    return y.r2p(C);
                }
              }
              function p(y) {
                var C = y._id.charAt(0) === "y" ? 1 : 0;
                return function(m) {
                  return v(y, m[C]);
                };
              }
              function g(y) {
                return l(y.xaxis._offset, y.yaxis._offset);
              }
              s.exports = {
                p2r: v,
                r2p: f,
                axValue: p,
                getTransform: g
              };
            }
          ),
          /***/
          2676: (
            /***/
            function(s, c, i) {
              var l = i(3640), v = i(3156);
              s.exports = {
                moduleType: "component",
                name: "selections",
                layoutAttributes: i(3956),
                supplyLayoutDefaults: i(4224),
                supplyDrawNewSelectionDefaults: i(1004),
                includeBasePlot: i(6632)("selections"),
                draw: l.draw,
                drawOne: l.drawOne,
                reselect: v.reselect,
                prepSelect: v.prepSelect,
                clearOutline: v.clearOutline,
                clearSelectionsCache: v.clearSelectionsCache,
                selectOnClick: v.selectOnClick
              };
            }
          ),
          /***/
          3156: (
            /***/
            function(s, c, i) {
              var l = i(4756), v = i(1456), f = i(4040), p = i(3616).dashStyle, g = i(6308), y = i(3024), C = i(624).makeEventData, m = i(2760), h = m.freeMode, w = m.rectMode, S = m.drawMode, E = m.openMode, x = m.selectMode, T = i(5152), F = i(3068), P = i(5496), k = i(1936).clearOutline, I = i(9856), L = I.handleEllipse, A = I.readPaths, O = i(3940).newShapes, N = i(5968), Y = i(3640).activateLastSelection, j = i(3400), te = j.sorterAsc, re = i(2065), z = i(1200), Z = i(9811).getFromId, W = i(3696), q = i(9172).redrawReglTraces, ie = i(3280), ce = ie.MINSELECT, X = re.filter, U = re.tester, ne = i(5840), se = ne.p2r, le = ne.axValue, ue = ne.getTransform;
              function ve(tt) {
                return tt.subplot !== void 0;
              }
              function be(tt, ze, _e, Ye, lt) {
                var Te = !ve(Ye), Oe = h(lt), je = w(lt), Xe = E(lt), nt = S(lt), it = x(lt), Nt = lt === "drawline", At = lt === "drawcircle", vt = Nt || At, ut = Ye.gd, Pt = ut._fullLayout, rr = it && Pt.newselection.mode === "immediate" && Te, lr = Pt._zoomlayer, Mr = Ye.element.getBoundingClientRect(), Rr = Ye.plotinfo, Pr = ue(Rr), ir = ze - Mr.left, Lr = _e - Mr.top;
                Pt._calcInverseTransform(ut);
                var yr = j.apply3DTransform(Pt._invTransform)(ir, Lr);
                ir = yr[0], Lr = yr[1];
                var Sr = Pt._invScaleX, Yr = Pt._invScaleY, Ar = ir, pr = Lr, kr = "M" + ir + "," + Lr, br = Ye.xaxes[0], Gr = Ye.yaxes[0], rn = br._length, cn = Gr._length, Dr = tt.altKey && !(S(lt) && Xe), Se, ae, ft, rt, gt, wt, Ct;
                K(tt, ut, Ye), Oe && (Se = X([[ir, Lr]], ie.BENDPX));
                var pt = lr.selectAll("path.select-outline-" + Rr.id).data([1]), dt = nt ? Pt.newshape : Pt.newselection;
                nt && (Ye.hasText = dt.label.text || dt.label.texttemplate);
                var St = nt && !Xe ? dt.fillcolor : "rgba(0,0,0,0)", Ft = dt.line.color || (Te ? g.contrast(ut._fullLayout.plot_bgcolor) : "#7f7f7f");
                pt.enter().append("path").attr("class", "select-outline select-outline-" + Rr.id).style({
                  opacity: nt ? dt.opacity / 2 : 1,
                  "stroke-dasharray": p(dt.line.dash, dt.line.width),
                  "stroke-width": dt.line.width + "px",
                  "shape-rendering": "crispEdges"
                }).call(g.stroke, Ft).call(g.fill, St).attr("fill-rule", "evenodd").classed("cursor-move", !!nt).attr("transform", Pr).attr("d", kr + "Z");
                var Gt = lr.append("path").attr("class", "zoombox-corners").style({
                  fill: g.background,
                  stroke: g.defaultLine,
                  "stroke-width": 1
                }).attr("transform", Pr).attr("d", "M0,0Z");
                if (nt && Ye.hasText) {
                  var Lt = lr.select(".label-temp");
                  Lt.empty() && (Lt = lr.append("g").classed("label-temp", !0).classed("select-outline", !0).style({
                    opacity: 0.8
                  }));
                }
                var $t = Pt._uid + ie.SELECTID, _t = [], zt = fe(ut, Ye.xaxes, Ye.yaxes, Ye.subplot);
                rr && !tt.shiftKey && (Ye._clearSubplotSelections = function() {
                  if (Te) {
                    var nr = br._id, xr = Gr._id;
                    ct(ut, nr, xr, zt);
                    for (var Er = (ut.layout || {}).selections || [], Jr = [], Ur = !1, Br = 0; Br < Er.length; Br++) {
                      var dn = Pt.selections[Br];
                      dn.xref !== nr || dn.yref !== xr ? Jr.push(Er[Br]) : Ur = !0;
                    }
                    Ur && (ut._fullLayout._noEmitSelectedAtStart = !0, f.call("_guiRelayout", ut, {
                      selections: Jr
                    }));
                  }
                });
                var tr = jt(Ye);
                Ye.moveFn = function(nr, xr) {
                  Ye._clearSubplotSelections && (Ye._clearSubplotSelections(), Ye._clearSubplotSelections = void 0), Ar = Math.max(0, Math.min(rn, Sr * nr + ir)), pr = Math.max(0, Math.min(cn, Yr * xr + Lr));
                  var Er = Math.abs(Ar - ir), Jr = Math.abs(pr - Lr);
                  if (je) {
                    var Ur, Br, dn;
                    if (it) {
                      var nn = Pt.selectdirection;
                      switch (nn === "any" ? Jr < Math.min(Er * 0.6, ce) ? Ur = "h" : Er < Math.min(Jr * 0.6, ce) ? Ur = "v" : Ur = "d" : Ur = nn, Ur) {
                        case "h":
                          Br = At ? cn / 2 : 0, dn = cn;
                          break;
                        case "v":
                          Br = At ? rn / 2 : 0, dn = rn;
                          break;
                      }
                    }
                    if (nt)
                      switch (Pt.newshape.drawdirection) {
                        case "vertical":
                          Ur = "h", Br = At ? cn / 2 : 0, dn = cn;
                          break;
                        case "horizontal":
                          Ur = "v", Br = At ? rn / 2 : 0, dn = rn;
                          break;
                        case "ortho":
                          Er < Jr ? (Ur = "h", Br = Lr, dn = pr) : (Ur = "v", Br = ir, dn = Ar);
                          break;
                        default:
                          Ur = "d";
                      }
                    Ur === "h" ? (rt = vt ? L(At, [Ar, Br], [Ar, dn]) : (
                      // using x1 instead of x0 allows adjusting the line while drawing
                      [[ir, Br], [ir, dn], [Ar, dn], [Ar, Br]]
                    ), rt.xmin = vt ? Ar : Math.min(ir, Ar), rt.xmax = vt ? Ar : Math.max(ir, Ar), rt.ymin = Math.min(Br, dn), rt.ymax = Math.max(Br, dn), Gt.attr("d", "M" + rt.xmin + "," + (Lr - ce) + "h-4v" + 2 * ce + "h4ZM" + (rt.xmax - 1) + "," + (Lr - ce) + "h4v" + 2 * ce + "h-4Z")) : Ur === "v" ? (rt = vt ? L(At, [Br, pr], [dn, pr]) : (
                      // using y1 instead of y0 allows adjusting the line while drawing
                      [[Br, Lr], [Br, pr], [dn, pr], [dn, Lr]]
                    ), rt.xmin = Math.min(Br, dn), rt.xmax = Math.max(Br, dn), rt.ymin = vt ? pr : Math.min(Lr, pr), rt.ymax = vt ? pr : Math.max(Lr, pr), Gt.attr("d", "M" + (ir - ce) + "," + rt.ymin + "v-4h" + 2 * ce + "v4ZM" + (ir - ce) + "," + (rt.ymax - 1) + "v4h" + 2 * ce + "v-4Z")) : Ur === "d" && (rt = vt ? L(At, [ir, Lr], [Ar, pr]) : [[ir, Lr], [ir, pr], [Ar, pr], [Ar, Lr]], rt.xmin = Math.min(ir, Ar), rt.xmax = Math.max(ir, Ar), rt.ymin = Math.min(Lr, pr), rt.ymax = Math.max(Lr, pr), Gt.attr("d", "M0,0Z"));
                  } else Oe && (Se.addPt([Ar, pr]), rt = Se.filtered);
                  if (Ye.selectionDefs && Ye.selectionDefs.length ? (ft = et(Ye.mergedPolygons, rt, Dr), rt.subtract = Dr, ae = Ae(Ye.selectionDefs.concat([rt]))) : (ft = [rt], ae = U(rt)), P(De(ft, Xe), pt, Ye), it) {
                    var Sn = Ie(ut, !1), ai = Sn.eventData ? Sn.eventData.points.slice() : [];
                    Sn = Ie(ut, !1, ae, zt, Ye), ae = Sn.selectionTesters, Ct = Sn.eventData;
                    var Dn;
                    Se ? Dn = Se.filtered : Dn = xt(ft), z.throttle($t, ie.SELECTDELAY, function() {
                      _t = Ne(ae, zt);
                      for (var on = _t.slice(), ri = 0; ri < ai.length; ri++) {
                        for (var Fi = ai[ri], Pi = !1, pn = 0; pn < on.length; pn++)
                          if (on[pn].curveNumber === Fi.curveNumber && on[pn].pointNumber === Fi.pointNumber) {
                            Pi = !0;
                            break;
                          }
                        Pi || on.push(Fi);
                      }
                      on.length && (Ct || (Ct = {}), Ct.points = on), tr(Ct, Dn), qt(ut, Ct);
                    });
                  }
                }, Ye.clickFn = function(nr, xr) {
                  if (Gt.remove(), ut._fullLayout._activeShapeIndex >= 0) {
                    ut._fullLayout._deactivateShape(ut);
                    return;
                  }
                  if (!nt) {
                    var Er = Pt.clickmode;
                    z.done($t).then(function() {
                      if (z.clear($t), nr === 2) {
                        for (pt.remove(), gt = 0; gt < zt.length; gt++)
                          wt = zt[gt], wt._module.selectPoints(wt, !1);
                        if (Be(ut, zt), _(Ye), Ut(ut), zt.length) {
                          var Jr = zt[0].xaxis, Ur = zt[0].yaxis;
                          if (Jr && Ur) {
                            for (var Br = [], dn = ut._fullLayout.selections, nn = 0; nn < dn.length; nn++) {
                              var Sn = dn[nn];
                              Sn && (Sn.xref !== Jr._id || Sn.yref !== Ur._id) && Br.push(Sn);
                            }
                            Br.length < dn.length && (ut._fullLayout._noEmitSelectedAtStart = !0, f.call("_guiRelayout", ut, {
                              selections: Br
                            }));
                          }
                        }
                      } else
                        Er.indexOf("select") > -1 && Me(xr, ut, Ye.xaxes, Ye.yaxes, Ye.subplot, Ye, pt), Er === "event" && Yt(ut, void 0);
                      y.click(ut, xr, Rr.id);
                    }).catch(j.error);
                  }
                }, Ye.doneFn = function() {
                  Gt.remove(), z.done($t).then(function() {
                    z.clear($t), !rr && rt && Ye.selectionDefs && (rt.subtract = Dr, Ye.selectionDefs.push(rt), Ye.mergedPolygons.length = 0, [].push.apply(Ye.mergedPolygons, ft)), (rr || nt) && _(Ye, rr), Ye.doneFnCompleted && Ye.doneFnCompleted(_t), it && Yt(ut, Ct);
                  }).catch(j.error);
                };
              }
              function Me(tt, ze, _e, Ye, lt, Te, Oe) {
                var je = ze._hoverdata, Xe = ze._fullLayout, nt = Xe.clickmode, it = nt.indexOf("event") > -1, Nt = [], At, vt, ut, Pt, rr, lr, Mr, Rr, Pr, ir;
                if (he(je)) {
                  K(tt, ze, Te), At = fe(ze, _e, Ye, lt);
                  var Lr = me(je, At), yr = Lr.pointNumbers.length > 0;
                  if (yr ? Fe(At, Lr) : Ve(At) && (Mr = xe(Lr))) {
                    for (Oe && Oe.remove(), ir = 0; ir < At.length; ir++)
                      vt = At[ir], vt._module.selectPoints(vt, !1);
                    Be(ze, At), _(Te), it && Ut(ze);
                  } else {
                    Rr = tt.shiftKey && (Mr !== void 0 ? Mr : xe(Lr)), ut = Ge(Lr.pointNumber, Lr.searchInfo, Rr);
                    var Sr = Te.selectionDefs.concat([ut]);
                    for (Pt = Ae(Sr), ir = 0; ir < At.length; ir++)
                      if (rr = At[ir]._module.selectPoints(At[ir], Pt), lr = at(rr, At[ir]), Nt.length)
                        for (var Yr = 0; Yr < lr.length; Yr++)
                          Nt.push(lr[Yr]);
                      else Nt = lr;
                    if (Pr = {
                      points: Nt
                    }, Be(ze, At, Pr), ut && Te && Te.selectionDefs.push(ut), Oe) {
                      var Ar = Te.mergedPolygons, pr = E(Te.dragmode);
                      P(De(Ar, pr), Oe, Te);
                    }
                    it && Yt(ze, Pr);
                  }
                }
              }
              function Ge(tt, ze, _e) {
                return {
                  pointNumber: tt,
                  searchInfo: ze,
                  subtract: !!_e
                };
              }
              function we(tt) {
                return "pointNumber" in tt && "searchInfo" in tt;
              }
              function Re(tt) {
                return {
                  xmin: 0,
                  xmax: 0,
                  ymin: 0,
                  ymax: 0,
                  pts: [],
                  contains: function(ze, _e, Ye, lt) {
                    var Te = tt.searchInfo.cd[0].trace._expandedIndex, Oe = lt.cd[0].trace._expandedIndex;
                    return Oe === Te && Ye === tt.pointNumber;
                  },
                  isRect: !1,
                  degenerate: !1,
                  subtract: !!tt.subtract
                };
              }
              function Ae(tt) {
                if (!tt.length) return;
                for (var ze = [], _e = we(tt[0]) ? 0 : tt[0][0][0], Ye = _e, lt = we(tt[0]) ? 0 : tt[0][0][1], Te = lt, Oe = 0; Oe < tt.length; Oe++)
                  if (we(tt[Oe]))
                    ze.push(Re(tt[Oe]));
                  else {
                    var je = U(tt[Oe]);
                    je.subtract = !!tt[Oe].subtract, ze.push(je), _e = Math.min(_e, je.xmin), Ye = Math.max(Ye, je.xmax), lt = Math.min(lt, je.ymin), Te = Math.max(Te, je.ymax);
                  }
                function Xe(nt, it, Nt, At) {
                  for (var vt = !1, ut = 0; ut < ze.length; ut++)
                    ze[ut].contains(nt, it, Nt, At) && (vt = !ze[ut].subtract);
                  return vt;
                }
                return {
                  xmin: _e,
                  xmax: Ye,
                  ymin: lt,
                  ymax: Te,
                  pts: [],
                  contains: Xe,
                  isRect: !1,
                  degenerate: !1
                };
              }
              function K(tt, ze, _e) {
                var Ye = ze._fullLayout, lt = _e.plotinfo, Te = _e.dragmode, Oe = Ye._lastSelectedSubplot && Ye._lastSelectedSubplot === lt.id, je = (tt.shiftKey || tt.altKey) && !(S(Te) && E(Te));
                Oe && je && lt.selection && lt.selection.selectionDefs && !_e.selectionDefs ? (_e.selectionDefs = lt.selection.selectionDefs, _e.mergedPolygons = lt.selection.mergedPolygons) : (!je || !lt.selection) && _(_e), Oe || (k(ze), Ye._lastSelectedSubplot = lt.id);
              }
              function ee(tt) {
                return tt._fullLayout._activeShapeIndex >= 0;
              }
              function oe(tt) {
                return tt._fullLayout._activeSelectionIndex >= 0;
              }
              function _(tt, ze) {
                var _e = tt.dragmode, Ye = tt.plotinfo, lt = tt.gd;
                ee(lt) && lt._fullLayout._deactivateShape(lt), oe(lt) && lt._fullLayout._deactivateSelection(lt);
                var Te = lt._fullLayout, Oe = Te._zoomlayer, je = S(_e), Xe = x(_e);
                if (je || Xe) {
                  var nt = Oe.selectAll(".select-outline-" + Ye.id);
                  if (nt && lt._fullLayout._outlining) {
                    var it;
                    je && (it = O(nt, tt)), it && f.call("_guiRelayout", lt, {
                      shapes: it
                    });
                    var Nt;
                    Xe && !ve(tt) && (Nt = N(nt, tt)), Nt && (lt._fullLayout._noEmitSelectedAtStart = !0, f.call("_guiRelayout", lt, {
                      selections: Nt
                    }).then(function() {
                      ze && Y(lt);
                    })), lt._fullLayout._outlining = !1;
                  }
                }
                Ye.selection = {}, Ye.selection.selectionDefs = tt.selectionDefs = [], Ye.selection.mergedPolygons = tt.mergedPolygons = [];
              }
              function V(tt) {
                return tt._id;
              }
              function fe(tt, ze, _e, Ye) {
                if (!tt.calcdata) return [];
                var lt = [], Te = ze.map(V), Oe = _e.map(V), je, Xe, nt;
                for (nt = 0; nt < tt.calcdata.length; nt++)
                  if (je = tt.calcdata[nt], Xe = je[0].trace, !(Xe.visible !== !0 || !Xe._module || !Xe._module.selectPoints))
                    if (ve({
                      subplot: Ye
                    }) && (Xe.subplot === Ye || Xe.geo === Ye))
                      lt.push($(Xe._module, je, ze[0], _e[0]));
                    else if (Xe.type === "splom") {
                      if (Xe._xaxes[Te[0]] && Xe._yaxes[Oe[0]]) {
                        var it = $(Xe._module, je, ze[0], _e[0]);
                        it.scene = tt._fullLayout._splomScenes[Xe.uid], lt.push(it);
                      }
                    } else if (Xe.type === "sankey") {
                      var Nt = $(Xe._module, je, ze[0], _e[0]);
                      lt.push(Nt);
                    } else {
                      if (Te.indexOf(Xe.xaxis) === -1 && (!Xe._xA || !Xe._xA.overlaying) || Oe.indexOf(Xe.yaxis) === -1 && (!Xe._yA || !Xe._yA.overlaying)) continue;
                      lt.push($(Xe._module, je, Z(tt, Xe.xaxis), Z(tt, Xe.yaxis)));
                    }
                return lt;
              }
              function $(tt, ze, _e, Ye) {
                return {
                  _module: tt,
                  cd: ze,
                  xaxis: _e,
                  yaxis: Ye
                };
              }
              function he(tt) {
                return tt && Array.isArray(tt) && tt[0].hoverOnBox !== !0;
              }
              function me(tt, ze) {
                var _e = tt[0], Ye = -1, lt = [], Te, Oe;
                for (Oe = 0; Oe < ze.length; Oe++)
                  if (Te = ze[Oe], _e.fullData._expandedIndex === Te.cd[0].trace._expandedIndex) {
                    if (_e.hoverOnBox === !0)
                      break;
                    _e.pointNumber !== void 0 ? Ye = _e.pointNumber : _e.binNumber !== void 0 && (Ye = _e.binNumber, lt = _e.pointNumbers);
                    break;
                  }
                return {
                  pointNumber: Ye,
                  pointNumbers: lt,
                  searchInfo: Te
                };
              }
              function xe(tt) {
                var ze = tt.searchInfo.cd[0].trace, _e = tt.pointNumber, Ye = tt.pointNumbers, lt = Ye.length > 0, Te = lt ? Ye[0] : _e;
                return ze.selectedpoints ? ze.selectedpoints.indexOf(Te) > -1 : !1;
              }
              function Fe(tt, ze) {
                var _e = [], Ye, lt, Te, Oe;
                for (Oe = 0; Oe < tt.length; Oe++)
                  Ye = tt[Oe], Ye.cd[0].trace.selectedpoints && Ye.cd[0].trace.selectedpoints.length > 0 && _e.push(Ye);
                if (_e.length === 1 && (Te = _e[0] === ze.searchInfo, Te && (lt = ze.searchInfo.cd[0].trace, lt.selectedpoints.length === ze.pointNumbers.length))) {
                  for (Oe = 0; Oe < ze.pointNumbers.length; Oe++)
                    if (lt.selectedpoints.indexOf(ze.pointNumbers[Oe]) < 0)
                      return !1;
                  return !0;
                }
                return !1;
              }
              function Ve(tt) {
                var ze = 0, _e, Ye, lt;
                for (lt = 0; lt < tt.length; lt++)
                  if (_e = tt[lt], Ye = _e.cd[0].trace, Ye.selectedpoints && (Ye.selectedpoints.length > 1 || (ze += Ye.selectedpoints.length, ze > 1)))
                    return !1;
                return ze === 1;
              }
              function Be(tt, ze, _e) {
                var Ye;
                for (Ye = 0; Ye < ze.length; Ye++) {
                  var lt = ze[Ye].cd[0].trace._fullInput, Te = tt._fullLayout._tracePreGUI[lt.uid] || {};
                  Te.selectedpoints === void 0 && (Te.selectedpoints = lt._input.selectedpoints || null);
                }
                var Oe;
                if (_e) {
                  var je = _e.points || [];
                  for (Ye = 0; Ye < ze.length; Ye++)
                    Oe = ze[Ye].cd[0].trace, Oe._input.selectedpoints = Oe._fullInput.selectedpoints = [], Oe._fullInput !== Oe && (Oe.selectedpoints = []);
                  for (var Xe = 0; Xe < je.length; Xe++) {
                    var nt = je[Xe], it = nt.data, Nt = nt.fullData, At = nt.pointIndex, vt = nt.pointIndices;
                    vt ? ([].push.apply(it.selectedpoints, vt), Oe._fullInput !== Oe && [].push.apply(Nt.selectedpoints, vt)) : (it.selectedpoints.push(At), Oe._fullInput !== Oe && Nt.selectedpoints.push(At));
                  }
                } else
                  for (Ye = 0; Ye < ze.length; Ye++)
                    Oe = ze[Ye].cd[0].trace, delete Oe.selectedpoints, delete Oe._input.selectedpoints, Oe._fullInput !== Oe && delete Oe._fullInput.selectedpoints;
                Je(tt, ze);
              }
              function Je(tt, ze) {
                for (var _e = !1, Ye = 0; Ye < ze.length; Ye++) {
                  var lt = ze[Ye], Te = lt.cd;
                  f.traceIs(Te[0].trace, "regl") && (_e = !0);
                  var Oe = lt._module, je = Oe.styleOnSelect || Oe.style;
                  je && (je(tt, Te, Te[0].node3), Te[0].nodeRangePlot3 && je(tt, Te, Te[0].nodeRangePlot3));
                }
                _e && (W(tt), q(tt));
              }
              function et(tt, ze, _e) {
                for (var Ye = _e ? l.difference : l.union, lt = Ye({
                  regions: tt
                }, {
                  regions: [ze]
                }), Te = lt.regions.reverse(), Oe = 0; Oe < Te.length; Oe++) {
                  var je = Te[Oe];
                  je.subtract = Ot(je, Te.slice(0, Oe));
                }
                return Te;
              }
              function at(tt, ze) {
                if (Array.isArray(tt))
                  for (var _e = ze.cd, Ye = ze.cd[0].trace, lt = 0; lt < tt.length; lt++)
                    tt[lt] = C(tt[lt], Ye, _e);
                return tt;
              }
              function De(tt, ze) {
                for (var _e = [], Ye = 0; Ye < tt.length; Ye++) {
                  _e[Ye] = [];
                  for (var lt = 0; lt < tt[Ye].length; lt++) {
                    _e[Ye][lt] = [], _e[Ye][lt][0] = lt ? "L" : "M";
                    for (var Te = 0; Te < tt[Ye][lt].length; Te++)
                      _e[Ye][lt].push(tt[Ye][lt][Te]);
                  }
                  ze || _e[Ye].push([
                    "Z",
                    _e[Ye][0][1],
                    // initial x
                    _e[Ye][0][2]
                    // initial y
                  ]);
                }
                return _e;
              }
              function Ne(tt, ze) {
                for (var _e = [], Ye, lt, Te = 0; Te < ze.length; Te++) {
                  var Oe = ze[Te];
                  lt = Oe._module.selectPoints(Oe, tt), Ye = at(lt, Oe), _e = _e.concat(Ye);
                }
                return _e;
              }
              function Ie(tt, ze, _e, Ye, lt) {
                var Te = !!Ye, Oe, je, Xe;
                lt && (Oe = lt.plotinfo, je = lt.xaxes[0]._id, Xe = lt.yaxes[0]._id);
                var nt = [], it = [], Nt = kt(tt), At = tt._fullLayout;
                if (Oe) {
                  var vt = At._zoomlayer, ut = At.dragmode, Pt = S(ut), rr = x(ut);
                  if (Pt || rr) {
                    var lr = Z(tt, je, "x"), Mr = Z(tt, Xe, "y");
                    if (lr && Mr) {
                      var Rr = vt.selectAll(".select-outline-" + Oe.id);
                      if (Rr && tt._fullLayout._outlining && Rr.length) {
                        for (var Pr = Rr[0][0], ir = Pr.getAttribute("d"), Lr = A(ir, tt, Oe), yr = [], Sr = 0; Sr < Lr.length; Sr++) {
                          for (var Yr = Lr[Sr], Ar = [], pr = 0; pr < Yr.length; pr++)
                            Ar.push([Rt(lr, Yr[pr][1]), Rt(Mr, Yr[pr][2])]);
                          Ar.xref = je, Ar.yref = Xe, Ar.subtract = Ot(Ar, yr), yr.push(Ar);
                        }
                        Nt = Nt.concat(yr);
                      }
                    }
                  }
                }
                var kr = je && Xe ? [je + Xe] : At._subplots.cartesian;
                Ue(tt);
                for (var br = {}, Gr = 0; Gr < kr.length; Gr++) {
                  var rn = kr[Gr], cn = rn.indexOf("y"), Dr = rn.slice(0, cn), Se = rn.slice(cn), ae = je && Xe ? _e : void 0;
                  if (ae = Tt(Nt, Dr, Se, ae), ae) {
                    var ft = Ye;
                    if (!Te) {
                      var rt = Z(tt, Dr, "x"), gt = Z(tt, Se, "y");
                      ft = fe(tt, [rt], [gt], rn);
                      for (var wt = 0; wt < ft.length; wt++) {
                        var Ct = ft[wt], pt = Ct.cd[0], dt = pt.trace;
                        if (Ct._module.name === "scattergl" && !pt.t.xpx) {
                          var St = dt.x, Ft = dt.y, Gt = dt._length;
                          pt.t.xpx = [], pt.t.ypx = [];
                          for (var Lt = 0; Lt < Gt; Lt++)
                            pt.t.xpx[Lt] = rt.c2p(St[Lt]), pt.t.ypx[Lt] = gt.c2p(Ft[Lt]);
                        }
                        Ct._module.name === "splom" && (br[dt.uid] || (br[dt.uid] = !0));
                      }
                    }
                    var $t = Ne(ae, ft);
                    nt = nt.concat($t), it = it.concat(ft);
                  }
                }
                var _t = {
                  points: nt
                };
                Be(tt, it, _t);
                var zt = At.clickmode, tr = zt.indexOf("event") > -1 && ze;
                if (!Oe && // get called from plot_api & plots
                ze) {
                  var nr = kt(tt, !0);
                  if (nr.length) {
                    var xr = nr[0].xref, Er = nr[0].yref;
                    if (xr && Er) {
                      var Jr = xt(nr), Ur = bt([Z(tt, xr, "x"), Z(tt, Er, "y")]);
                      Ur(_t, Jr);
                    }
                  }
                  tt._fullLayout._noEmitSelectedAtStart ? tt._fullLayout._noEmitSelectedAtStart = !1 : tr && Yt(tt, _t), At._reselect = !1;
                }
                if (!Oe && // get called from plot_api & plots
                At._deselect) {
                  var Br = At._deselect;
                  je = Br.xref, Xe = Br.yref, ot(je, Xe, it) || ct(tt, je, Xe, Ye), tr && (_t.points.length ? Yt(tt, _t) : Ut(tt)), At._deselect = !1;
                }
                return {
                  eventData: _t,
                  selectionTesters: _e
                };
              }
              function Ue(tt) {
                var ze = tt.calcdata;
                if (ze)
                  for (var _e = 0; _e < ze.length; _e++) {
                    var Ye = ze[_e][0], lt = Ye.trace, Te = tt._fullLayout._splomScenes;
                    if (Te) {
                      var Oe = Te[lt.uid];
                      Oe && (Oe.selectBatch = []);
                    }
                  }
              }
              function ot(tt, ze, _e) {
                for (var Ye = 0; Ye < _e.length; Ye++) {
                  var lt = _e[Ye];
                  if (lt.xaxis && lt.xaxis._id === tt && lt.yaxis && lt.yaxis._id === ze)
                    return !0;
                }
                return !1;
              }
              function ct(tt, ze, _e, Ye) {
                Ye = fe(tt, [Z(tt, ze, "x")], [Z(tt, _e, "y")], ze + _e);
                for (var lt = 0; lt < Ye.length; lt++) {
                  var Te = Ye[lt];
                  Te._module.selectPoints(Te, !1);
                }
                Be(tt, Ye);
              }
              function Tt(tt, ze, _e, Ye) {
                for (var lt, Te = 0; Te < tt.length; Te++) {
                  var Oe = tt[Te];
                  if (!(ze !== Oe.xref || _e !== Oe.yref))
                    if (lt) {
                      var je = !!Oe.subtract;
                      lt = et(lt, Oe, je), Ye = Ae(lt);
                    } else
                      lt = [Oe], Ye = U(Oe);
                }
                return Ye;
              }
              function kt(tt, ze) {
                for (var _e = [], Ye = tt._fullLayout, lt = Ye.selections, Te = lt.length, Oe = 0; Oe < Te; Oe++)
                  if (!(ze && Oe !== Ye._activeSelectionIndex)) {
                    var je = lt[Oe];
                    if (je) {
                      var Xe = je.xref, nt = je.yref, it = Z(tt, Xe, "x"), Nt = Z(tt, nt, "y"), At, vt, ut, Pt, rr;
                      if (je.type === "rect") {
                        rr = [];
                        var lr = Rt(it, je.x0), Mr = Rt(it, je.x1), Rr = Rt(Nt, je.y0), Pr = Rt(Nt, je.y1);
                        rr = [[lr, Rr], [lr, Pr], [Mr, Pr], [Mr, Rr]], At = Math.min(lr, Mr), vt = Math.max(lr, Mr), ut = Math.min(Rr, Pr), Pt = Math.max(Rr, Pr), rr.xmin = At, rr.xmax = vt, rr.ymin = ut, rr.ymax = Pt, rr.xref = Xe, rr.yref = nt, rr.subtract = !1, rr.isRect = !0, _e.push(rr);
                      } else if (je.type === "path")
                        for (var ir = je.path.split("Z"), Lr = [], yr = 0; yr < ir.length; yr++) {
                          var Sr = ir[yr];
                          if (Sr) {
                            Sr += "Z";
                            var Yr = T.extractPathCoords(Sr, F.paramIsX, "raw"), Ar = T.extractPathCoords(Sr, F.paramIsY, "raw");
                            At = 1 / 0, vt = -1 / 0, ut = 1 / 0, Pt = -1 / 0, rr = [];
                            for (var pr = 0; pr < Yr.length; pr++) {
                              var kr = Rt(it, Yr[pr]), br = Rt(Nt, Ar[pr]);
                              rr.push([kr, br]), At = Math.min(kr, At), vt = Math.max(kr, vt), ut = Math.min(br, ut), Pt = Math.max(br, Pt);
                            }
                            rr.xmin = At, rr.xmax = vt, rr.ymin = ut, rr.ymax = Pt, rr.xref = Xe, rr.yref = nt, rr.subtract = Ot(rr, Lr), Lr.push(rr), _e.push(rr);
                          }
                        }
                    }
                  }
                return _e;
              }
              function Ot(tt, ze) {
                for (var _e = !1, Ye = 0; Ye < ze.length; Ye++)
                  for (var lt = ze[Ye], Te = 0; Te < tt.length; Te++)
                    if (v(tt[Te], lt)) {
                      _e = !_e;
                      break;
                    }
                return _e;
              }
              function Rt(tt, ze) {
                return tt.type === "date" && (ze = ze.replace("_", " ")), tt.type === "log" ? tt.c2p(ze) : tt.r2p(ze, null, tt.calendar);
              }
              function xt(tt) {
                for (var ze = tt.length, _e = [], Ye = 0; Ye < ze; Ye++) {
                  var lt = tt[Ye];
                  _e = _e.concat(lt), _e = _e.concat([lt[0]]);
                }
                return Wt(_e);
              }
              function Wt(tt) {
                return tt.isRect = tt.length === 5 && tt[0][0] === tt[4][0] && tt[0][1] === tt[4][1] && tt[0][0] === tt[1][0] && tt[2][0] === tt[3][0] && tt[0][1] === tt[3][1] && tt[1][1] === tt[2][1] || tt[0][1] === tt[1][1] && tt[2][1] === tt[3][1] && tt[0][0] === tt[3][0] && tt[1][0] === tt[2][0], tt.isRect && (tt.xmin = Math.min(tt[0][0], tt[2][0]), tt.xmax = Math.max(tt[0][0], tt[2][0]), tt.ymin = Math.min(tt[0][1], tt[2][1]), tt.ymax = Math.max(tt[0][1], tt[2][1])), tt;
              }
              function bt(tt) {
                return function(ze, _e) {
                  for (var Ye, lt, Te = 0; Te < tt.length; Te++) {
                    var Oe = tt[Te], je = Oe._id, Xe = je.charAt(0);
                    if (_e.isRect) {
                      Ye || (Ye = {});
                      var nt = _e[Xe + "min"], it = _e[Xe + "max"];
                      nt !== void 0 && it !== void 0 && (Ye[je] = [se(Oe, nt), se(Oe, it)].sort(te));
                    } else
                      lt || (lt = {}), lt[je] = _e.map(le(Oe));
                  }
                  Ye && (ze.range = Ye), lt && (ze.lassoPoints = lt);
                };
              }
              function jt(tt) {
                var ze = tt.plotinfo;
                return ze.fillRangeItems || // allow subplots (i.e. geo, mapbox, sankey) to override fillRangeItems routine
                bt(tt.xaxes.concat(tt.yaxes));
              }
              function qt(tt, ze) {
                tt.emit("plotly_selecting", ze);
              }
              function Yt(tt, ze) {
                ze && (ze.selections = (tt.layout || {}).selections || []), tt.emit("plotly_selected", ze);
              }
              function Ut(tt) {
                tt.emit("plotly_deselect", null);
              }
              s.exports = {
                reselect: Ie,
                prepSelect: be,
                clearOutline: k,
                clearSelectionsCache: _,
                selectOnClick: Me
              };
            }
          ),
          /***/
          6056: (
            /***/
            function(s, c, i) {
              var l = i(3916), v = i(5376), f = i(2904).line, p = i(8192).u, g = i(2880).extendFlat, y = i(1780).templatedArray;
              i(6208);
              var C = i(5464), m = i(1776).ye, h = i(7728);
              s.exports = y("shape", {
                visible: g({}, C.visible, {
                  editType: "calc+arraydraw"
                }),
                showlegend: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "calc+arraydraw"
                },
                legend: g({}, C.legend, {
                  editType: "calc+arraydraw"
                }),
                legendgroup: g({}, C.legendgroup, {
                  editType: "calc+arraydraw"
                }),
                legendgrouptitle: {
                  text: g({}, C.legendgrouptitle.text, {
                    editType: "calc+arraydraw"
                  }),
                  font: v({
                    editType: "calc+arraydraw"
                  }),
                  editType: "calc+arraydraw"
                },
                legendrank: g({}, C.legendrank, {
                  editType: "calc+arraydraw"
                }),
                legendwidth: g({}, C.legendwidth, {
                  editType: "calc+arraydraw"
                }),
                type: {
                  valType: "enumerated",
                  values: ["circle", "rect", "path", "line"],
                  editType: "calc+arraydraw"
                },
                layer: {
                  valType: "enumerated",
                  values: ["below", "above", "between"],
                  dflt: "above",
                  editType: "arraydraw"
                },
                xref: g({}, l.xref, {}),
                xsizemode: {
                  valType: "enumerated",
                  values: ["scaled", "pixel"],
                  dflt: "scaled",
                  editType: "calc+arraydraw"
                },
                xanchor: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                x0: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                x1: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                yref: g({}, l.yref, {}),
                ysizemode: {
                  valType: "enumerated",
                  values: ["scaled", "pixel"],
                  dflt: "scaled",
                  editType: "calc+arraydraw"
                },
                yanchor: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                y0: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                y1: {
                  valType: "any",
                  editType: "calc+arraydraw"
                },
                path: {
                  valType: "string",
                  editType: "calc+arraydraw"
                },
                opacity: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 1,
                  editType: "arraydraw"
                },
                line: {
                  color: g({}, f.color, {
                    editType: "arraydraw"
                  }),
                  width: g({}, f.width, {
                    editType: "calc+arraydraw"
                  }),
                  dash: g({}, p, {
                    editType: "arraydraw"
                  }),
                  editType: "calc+arraydraw"
                },
                fillcolor: {
                  valType: "color",
                  dflt: "rgba(0,0,0,0)",
                  editType: "arraydraw"
                },
                fillrule: {
                  valType: "enumerated",
                  values: ["evenodd", "nonzero"],
                  dflt: "evenodd",
                  editType: "arraydraw"
                },
                editable: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "calc+arraydraw"
                },
                label: {
                  text: {
                    valType: "string",
                    dflt: "",
                    editType: "arraydraw"
                  },
                  texttemplate: m({}, {
                    keys: Object.keys(h)
                  }),
                  font: v({
                    editType: "calc+arraydraw",
                    colorEditType: "arraydraw"
                  }),
                  textposition: {
                    valType: "enumerated",
                    values: ["top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right", "start", "middle", "end"],
                    editType: "arraydraw"
                  },
                  textangle: {
                    valType: "angle",
                    dflt: "auto",
                    editType: "calc+arraydraw"
                  },
                  xanchor: {
                    valType: "enumerated",
                    values: ["auto", "left", "center", "right"],
                    dflt: "auto",
                    editType: "calc+arraydraw"
                  },
                  yanchor: {
                    valType: "enumerated",
                    values: ["top", "middle", "bottom"],
                    editType: "calc+arraydraw"
                  },
                  padding: {
                    valType: "number",
                    dflt: 3,
                    min: 0,
                    editType: "arraydraw"
                  },
                  editType: "arraydraw"
                },
                editType: "arraydraw"
              });
            }
          ),
          /***/
          6084: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(3068), p = i(5152);
              s.exports = function(w) {
                var S = w._fullLayout, E = l.filterVisible(S.shapes);
                if (!(!E.length || !w._fullData.length))
                  for (var x = 0; x < E.length; x++) {
                    var T = E[x];
                    T._extremes = {};
                    var F, P, k = v.getRefType(T.xref), I = v.getRefType(T.yref);
                    if (T.xref !== "paper" && k !== "domain") {
                      var L = T.xsizemode === "pixel" ? T.xanchor : T.x0, A = T.xsizemode === "pixel" ? T.xanchor : T.x1;
                      F = v.getFromId(w, T.xref), P = m(F, L, A, T.path, f.paramIsX), P && (T._extremes[F._id] = v.findExtremes(F, P, g(T)));
                    }
                    if (T.yref !== "paper" && I !== "domain") {
                      var O = T.ysizemode === "pixel" ? T.yanchor : T.y0, N = T.ysizemode === "pixel" ? T.yanchor : T.y1;
                      F = v.getFromId(w, T.yref), P = m(F, O, N, T.path, f.paramIsY), P && (T._extremes[F._id] = v.findExtremes(F, P, y(T)));
                    }
                  }
              };
              function g(h) {
                return C(h.line.width, h.xsizemode, h.x0, h.x1, h.path, !1);
              }
              function y(h) {
                return C(h.line.width, h.ysizemode, h.y0, h.y1, h.path, !0);
              }
              function C(h, w, S, E, x, T) {
                var F = h / 2, P = T;
                if (w === "pixel") {
                  var k = x ? p.extractPathCoords(x, T ? f.paramIsY : f.paramIsX) : [S, E], I = l.aggNums(Math.max, null, k), L = l.aggNums(Math.min, null, k), A = L < 0 ? Math.abs(L) + F : F, O = I > 0 ? I + F : F;
                  return {
                    ppad: F,
                    ppadplus: P ? A : O,
                    ppadminus: P ? O : A
                  };
                } else
                  return {
                    ppad: F
                  };
              }
              function m(h, w, S, E, x) {
                var T = h.type === "category" || h.type === "multicategory" ? h.r2c : h.d2c;
                if (w !== void 0) return [T(w), T(S)];
                if (E) {
                  var F = 1 / 0, P = -1 / 0, k = E.match(f.segmentRE), I, L, A, O, N;
                  for (h.type === "date" && (T = p.decodeDate(T)), I = 0; I < k.length; I++)
                    L = k[I], A = x[L.charAt(0)].drawn, A !== void 0 && (O = k[I].substr(1).match(f.paramRE), !(!O || O.length < A) && (N = T(O[A]), N < F && (F = N), N > P && (P = N)));
                  if (P >= F) return [F, P];
                }
              }
            }
          ),
          /***/
          3068: (
            /***/
            function(s) {
              s.exports = {
                segmentRE: /[MLHVQCTSZ][^MLHVQCTSZ]*/g,
                paramRE: /[^\s,]+/g,
                // which numbers in each path segment are x (or y) values
                // drawn is which param is a drawn point, as opposed to a
                // control point (which doesn't count toward autorange.
                // TODO: this means curved paths could extend beyond the
                // autorange bounds. This is a bit tricky to get right
                // unless we revert to bounding boxes, but perhaps there's
                // a calculation we could do...)
                paramIsX: {
                  M: {
                    0: !0,
                    drawn: 0
                  },
                  L: {
                    0: !0,
                    drawn: 0
                  },
                  H: {
                    0: !0,
                    drawn: 0
                  },
                  V: {},
                  Q: {
                    0: !0,
                    2: !0,
                    drawn: 2
                  },
                  C: {
                    0: !0,
                    2: !0,
                    4: !0,
                    drawn: 4
                  },
                  T: {
                    0: !0,
                    drawn: 0
                  },
                  S: {
                    0: !0,
                    2: !0,
                    drawn: 2
                  },
                  // A: {0: true, 5: true},
                  Z: {}
                },
                paramIsY: {
                  M: {
                    1: !0,
                    drawn: 1
                  },
                  L: {
                    1: !0,
                    drawn: 1
                  },
                  H: {},
                  V: {
                    0: !0,
                    drawn: 0
                  },
                  Q: {
                    1: !0,
                    3: !0,
                    drawn: 3
                  },
                  C: {
                    1: !0,
                    3: !0,
                    5: !0,
                    drawn: 5
                  },
                  T: {
                    1: !0,
                    drawn: 1
                  },
                  S: {
                    1: !0,
                    3: !0,
                    drawn: 5
                  },
                  // A: {1: true, 6: true},
                  Z: {}
                },
                numParams: {
                  M: 2,
                  L: 2,
                  H: 1,
                  V: 1,
                  Q: 4,
                  C: 6,
                  T: 2,
                  S: 4,
                  // A: 7,
                  Z: 0
                }
              };
            }
          ),
          /***/
          3712: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(1272), p = i(6056), g = i(5152);
              s.exports = function(h, w) {
                f(h, w, {
                  name: "shapes",
                  handleItemDefaults: C
                });
              };
              function y(m, h) {
                return m ? "bottom" : h.indexOf("top") !== -1 ? "top" : h.indexOf("bottom") !== -1 ? "bottom" : "middle";
              }
              function C(m, h, w) {
                function S(we, Re) {
                  return l.coerce(m, h, p, we, Re);
                }
                h._isShape = !0;
                var E = S("visible");
                if (E) {
                  var x = S("showlegend");
                  x && (S("legend"), S("legendwidth"), S("legendgroup"), S("legendgrouptitle.text"), l.coerceFont(S, "legendgrouptitle.font"), S("legendrank"));
                  var T = S("path"), F = T ? "path" : "rect", P = S("type", F), k = P !== "path";
                  k && delete h.path, S("editable"), S("layer"), S("opacity"), S("fillcolor"), S("fillrule");
                  var I = S("line.width");
                  I && (S("line.color"), S("line.dash"));
                  for (var L = S("xsizemode"), A = S("ysizemode"), O = ["x", "y"], N = 0; N < 2; N++) {
                    var Y = O[N], j = Y + "anchor", te = Y === "x" ? L : A, re = {
                      _fullLayout: w
                    }, z, Z, W, q = v.coerceRef(m, h, re, Y, void 0, "paper"), ie = v.getRefType(q);
                    if (ie === "range" ? (z = v.getFromId(re, q), z._shapeIndices.push(h._index), W = g.rangeToShapePosition(z), Z = g.shapePositionToRange(z)) : Z = W = l.identity, k) {
                      var ce = 0.25, X = 0.75, U = Y + "0", ne = Y + "1", se = m[U], le = m[ne];
                      m[U] = Z(m[U], !0), m[ne] = Z(m[ne], !0), te === "pixel" ? (S(U, 0), S(ne, 10)) : (v.coercePosition(h, re, S, q, U, ce), v.coercePosition(h, re, S, q, ne, X)), h[U] = W(h[U]), h[ne] = W(h[ne]), m[U] = se, m[ne] = le;
                    }
                    if (te === "pixel") {
                      var ue = m[j];
                      m[j] = Z(m[j], !0), v.coercePosition(h, re, S, q, j, 0.25), h[j] = W(h[j]), m[j] = ue;
                    }
                  }
                  k && l.noneOrAll(m, h, ["x0", "x1", "y0", "y1"]);
                  var ve = P === "line", be, Me;
                  if (k && (be = S("label.texttemplate")), be || (Me = S("label.text")), Me || be) {
                    S("label.textangle");
                    var Ge = S("label.textposition", ve ? "middle" : "middle center");
                    S("label.xanchor"), S("label.yanchor", y(ve, Ge)), S("label.padding"), l.coerceFont(S, "label.font", w.font);
                  }
                }
              }
            }
          ),
          /***/
          728: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(2736), p = i(3616), g = i(9856).readPaths, y = i(5152), C = y.getPathString, m = i(7728), h = i(4284).FROM_TL;
              s.exports = function(x, T, F, P) {
                if (P.selectAll(".shape-label").remove(), !!(F.label.text || F.label.texttemplate)) {
                  var k;
                  if (F.label.texttemplate) {
                    var I = {};
                    if (F.type !== "path") {
                      var L = v.getFromId(x, F.xref), A = v.getFromId(x, F.yref);
                      for (var O in m) {
                        var N = m[O](F, L, A);
                        N !== void 0 && (I[O] = N);
                      }
                    }
                    k = l.texttemplateStringForShapes(F.label.texttemplate, {}, x._fullLayout._d3locale, I);
                  } else
                    k = F.label.text;
                  var Y = {
                    "data-index": T
                  }, j = F.label.font, te = {
                    "data-notex": 1
                  }, re = P.append("g").attr(Y).classed("shape-label", !0), z = re.append("text").attr(te).classed("shape-label-text", !0).text(k), Z, W, q, ie;
                  if (F.path) {
                    var ce = C(x, F), X = g(ce, x);
                    Z = 1 / 0, q = 1 / 0, W = -1 / 0, ie = -1 / 0;
                    for (var U = 0; U < X.length; U++)
                      for (var ne = 0; ne < X[U].length; ne++)
                        for (var se = X[U][ne], le = 1; le < se.length; le += 2) {
                          var ue = se[le], ve = se[le + 1];
                          Z = Math.min(Z, ue), W = Math.max(W, ue), q = Math.min(q, ve), ie = Math.max(ie, ve);
                        }
                  } else {
                    var be = v.getFromId(x, F.xref), Me = v.getRefType(F.xref), Ge = v.getFromId(x, F.yref), we = v.getRefType(F.yref), Re = y.getDataToPixel(x, be, !1, Me), Ae = y.getDataToPixel(x, Ge, !0, we);
                    Z = Re(F.x0), W = Re(F.x1), q = Ae(F.y0), ie = Ae(F.y1);
                  }
                  var K = F.label.textangle;
                  K === "auto" && (F.type === "line" ? K = w(Z, q, W, ie) : K = 0), z.call(function($) {
                    return $.call(p.font, j).attr({}), f.convertToTspans($, x), $;
                  });
                  var ee = p.bBox(z.node()), oe = S(Z, q, W, ie, F, K, ee), _ = oe.textx, V = oe.texty, fe = oe.xanchor;
                  z.attr({
                    "text-anchor": {
                      left: "start",
                      center: "middle",
                      right: "end"
                    }[fe],
                    y: V,
                    x: _,
                    transform: "rotate(" + K + "," + _ + "," + V + ")"
                  }).call(f.positionText, _, V);
                }
              };
              function w(E, x, T, F) {
                var P, k;
                return k = Math.abs(T - E), T >= E ? P = x - F : P = F - x, -180 / Math.PI * Math.atan2(P, k);
              }
              function S(E, x, T, F, P, k, I) {
                var L = P.label.textposition, A = P.label.textangle, O = P.label.padding, N = P.type, Y = Math.PI / 180 * k, j = Math.sin(Y), te = Math.cos(Y), re = P.label.xanchor, z = P.label.yanchor, Z, W, q, ie;
                if (N === "line") {
                  L === "start" ? (Z = E, W = x) : L === "end" ? (Z = T, W = F) : (Z = (E + T) / 2, W = (x + F) / 2), re === "auto" && (L === "start" ? A === "auto" ? T > E ? re = "left" : T < E ? re = "right" : re = "center" : T > E ? re = "right" : T < E ? re = "left" : re = "center" : L === "end" ? A === "auto" ? T > E ? re = "right" : T < E ? re = "left" : re = "center" : T > E ? re = "left" : T < E ? re = "right" : re = "center" : re = "center");
                  var ce = {
                    left: 1,
                    center: 0,
                    right: -1
                  }, X = {
                    bottom: -1,
                    middle: 0,
                    top: 1
                  };
                  if (A === "auto") {
                    var U = X[z];
                    q = -O * j * U, ie = O * te * U;
                  } else {
                    var ne = ce[re], se = X[z];
                    q = O * ne, ie = O * se;
                  }
                  Z = Z + q, W = W + ie;
                } else
                  q = O + 3, L.indexOf("right") !== -1 ? (Z = Math.max(E, T) - q, re === "auto" && (re = "right")) : L.indexOf("left") !== -1 ? (Z = Math.min(E, T) + q, re === "auto" && (re = "left")) : (Z = (E + T) / 2, re === "auto" && (re = "center")), L.indexOf("top") !== -1 ? W = Math.min(x, F) : L.indexOf("bottom") !== -1 ? W = Math.max(x, F) : W = (x + F) / 2, ie = O, z === "bottom" ? W = W - ie : z === "top" && (W = W + ie);
                var le = h[z], ue = P.label.font.size, ve = I.height, be = (ve * le - ue) * j, Me = -(ve * le - ue) * te;
                return {
                  textx: Z + be,
                  texty: W + Me,
                  xanchor: re
                };
              }
            }
          ),
          /***/
          5496: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = l.strTranslate, f = i(6476), p = i(2760), g = p.drawMode, y = p.selectMode, C = i(4040), m = i(6308), h = i(7e3), w = h.i000, S = h.i090, E = h.i180, x = h.i270, T = i(1936), F = T.clearOutlineControllers, P = i(9856), k = P.pointsOnRectangle, I = P.pointsOnEllipse, L = P.writePaths, A = i(3940).newShapes, O = i(3940).createShapeObj, N = i(5968), Y = i(728);
              s.exports = function z(Z, W, q, ie) {
                ie || (ie = 0);
                var ce = q.gd;
                function X() {
                  z(Z, W, q, ie++), (I(Z[0]) || q.hasText) && U({
                    redrawing: !0
                  });
                }
                function U(et) {
                  var at = {};
                  q.isActiveShape !== void 0 && (q.isActiveShape = !1, at = A(W, q)), q.isActiveSelection !== void 0 && (q.isActiveSelection = !1, at = N(W, q), ce._fullLayout._reselect = !0), Object.keys(at).length && C.call((et || {}).redrawing ? "relayout" : "_guiRelayout", ce, at);
                }
                var ne = ce._fullLayout, se = ne._zoomlayer, le = q.dragmode, ue = g(le), ve = y(le);
                (ue || ve) && (ce._fullLayout._outlining = !0), F(ce), W.attr("d", L(Z));
                var be, Me, Ge, we, Re;
                if (!ie && (q.isActiveShape || q.isActiveSelection)) {
                  Re = j([], Z);
                  var Ae = se.append("g").attr("class", "outline-controllers");
                  he(Ae), Je();
                }
                if (ue && q.hasText) {
                  var K = se.select(".label-temp"), ee = O(W, q, q.dragmode);
                  Y(ce, "label-temp", ee, K);
                }
                function oe(et) {
                  Ge = +et.srcElement.getAttribute("data-i"), we = +et.srcElement.getAttribute("data-j"), be[Ge][we].moveFn = _;
                }
                function _(et, at) {
                  if (Z.length) {
                    var De = Re[Ge][we][1], Ne = Re[Ge][we][2], Ie = Z[Ge], Ue = Ie.length;
                    if (k(Ie)) {
                      var ot = et, ct = at;
                      if (q.isActiveSelection) {
                        var Tt = te(Ie, we);
                        Tt[1] === Ie[we][1] ? ct = 0 : ot = 0;
                      }
                      for (var kt = 0; kt < Ue; kt++)
                        if (kt !== we) {
                          var Ot = Ie[kt];
                          Ot[1] === Ie[we][1] && (Ot[1] = De + ot), Ot[2] === Ie[we][2] && (Ot[2] = Ne + ct);
                        }
                      if (Ie[we][1] = De + ot, Ie[we][2] = Ne + ct, !k(Ie))
                        for (var Rt = 0; Rt < Ue; Rt++)
                          for (var xt = 0; xt < Ie[Rt].length; xt++)
                            Ie[Rt][xt] = Re[Ge][Rt][xt];
                    } else
                      Ie[we][1] = De + et, Ie[we][2] = Ne + at;
                    X();
                  }
                }
                function V() {
                  U();
                }
                function fe() {
                  if (Z.length && Z[Ge] && Z[Ge].length) {
                    for (var et = [], at = 0; at < Z[Ge].length; at++)
                      at !== we && et.push(Z[Ge][at]);
                    et.length > 1 && !(et.length === 2 && et[1][0] === "Z") && (we === 0 && (et[0][0] = "M"), Z[Ge] = et, X(), U());
                  }
                }
                function $(et, at) {
                  if (et === 2) {
                    Ge = +at.srcElement.getAttribute("data-i"), we = +at.srcElement.getAttribute("data-j");
                    var De = Z[Ge];
                    !k(De) && !I(De) && fe();
                  }
                }
                function he(et) {
                  be = [];
                  for (var at = 0; at < Z.length; at++) {
                    var De = Z[at], Ne = k(De), Ie = !Ne && I(De);
                    be[at] = [];
                    for (var Ue = De.length, ot = 0; ot < Ue; ot++)
                      if (De[ot][0] !== "Z" && !(Ie && ot !== w && ot !== S && ot !== E && ot !== x)) {
                        var ct = Ne && q.isActiveSelection, Tt;
                        ct && (Tt = te(De, ot));
                        var kt = De[ot][1], Ot = De[ot][2], Rt = et.append(ct ? "rect" : "circle").attr("data-i", at).attr("data-j", ot).style({
                          fill: m.background,
                          stroke: m.defaultLine,
                          "stroke-width": 1,
                          "shape-rendering": "crispEdges"
                        });
                        if (ct) {
                          var xt = Tt[1] - kt, Wt = Tt[2] - Ot, bt = Wt ? 5 : Math.max(Math.min(25, Math.abs(xt) - 5), 5), jt = xt ? 5 : Math.max(Math.min(25, Math.abs(Wt) - 5), 5);
                          Rt.classed(Wt ? "cursor-ew-resize" : "cursor-ns-resize", !0).attr("width", bt).attr("height", jt).attr("x", kt - bt / 2).attr("y", Ot - jt / 2).attr("transform", v(xt / 2, Wt / 2));
                        } else
                          Rt.classed("cursor-grab", !0).attr("r", 5).attr("cx", kt).attr("cy", Ot);
                        be[at][ot] = {
                          element: Rt.node(),
                          gd: ce,
                          prepFn: oe,
                          doneFn: V,
                          clickFn: $
                        }, f.init(be[at][ot]);
                      }
                  }
                }
                function me(et, at) {
                  if (Z.length)
                    for (var De = 0; De < Z.length; De++)
                      for (var Ne = 0; Ne < Z[De].length; Ne++)
                        for (var Ie = 0; Ie + 2 < Z[De][Ne].length; Ie += 2)
                          Z[De][Ne][Ie + 1] = Re[De][Ne][Ie + 1] + et, Z[De][Ne][Ie + 2] = Re[De][Ne][Ie + 2] + at;
                }
                function xe(et, at) {
                  me(et, at), X();
                }
                function Fe(et) {
                  Ge = +et.srcElement.getAttribute("data-i"), Ge || (Ge = 0), Me[Ge].moveFn = xe;
                }
                function Ve() {
                  U();
                }
                function Be(et) {
                  et === 2 && re(ce);
                }
                function Je() {
                  if (Me = [], !!Z.length) {
                    var et = 0;
                    Me[et] = {
                      element: W[0][0],
                      gd: ce,
                      prepFn: Fe,
                      doneFn: Ve,
                      clickFn: Be
                    }, f.init(Me[et]);
                  }
                }
              };
              function j(z, Z) {
                for (var W = 0; W < Z.length; W++) {
                  var q = Z[W];
                  z[W] = [];
                  for (var ie = 0; ie < q.length; ie++) {
                    z[W][ie] = [];
                    for (var ce = 0; ce < q[ie].length; ce++)
                      z[W][ie][ce] = q[ie][ce];
                  }
                }
                return z;
              }
              function te(z, Z) {
                var W = z[Z][1], q = z[Z][2], ie = z.length, ce, X, U;
                return ce = (Z + 1) % ie, X = z[ce][1], U = z[ce][2], X === W && U === q && (ce = (Z + 2) % ie, X = z[ce][1], U = z[ce][2]), [ce, X, U];
              }
              function re(z) {
                if (y(z._fullLayout.dragmode)) {
                  F(z);
                  var Z = z._fullLayout._activeSelectionIndex, W = (z.layout || {}).selections || [];
                  if (Z < W.length) {
                    for (var q = [], ie = 0; ie < W.length; ie++)
                      ie !== Z && q.push(W[ie]);
                    delete z._fullLayout._activeSelectionIndex;
                    var ce = z._fullLayout.selections[Z];
                    z._fullLayout._deselect = {
                      xref: ce.xref,
                      yref: ce.yref
                    }, C.call("_guiRelayout", z, {
                      selections: q
                    });
                  }
                }
              }
            }
          ),
          /***/
          4016: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(3400), p = i(4460), g = i(9856).readPaths, y = i(5496), C = i(728), m = i(1936).clearOutlineControllers, h = i(6308), w = i(3616), S = i(1780).arrayEditor, E = i(6476), x = i(3972), T = i(3068), F = i(5152), P = F.getPathString;
              s.exports = {
                draw: k,
                drawOne: A,
                eraseActiveShape: re,
                drawLabel: C
              };
              function k(z) {
                var Z = z._fullLayout;
                Z._shapeUpperLayer.selectAll("path").remove(), Z._shapeLowerLayer.selectAll("path").remove(), Z._shapeUpperLayer.selectAll("text").remove(), Z._shapeLowerLayer.selectAll("text").remove();
                for (var W in Z._plots) {
                  var q = Z._plots[W].shapelayer;
                  q && (q.selectAll("path").remove(), q.selectAll("text").remove());
                }
                for (var ie = 0; ie < Z.shapes.length; ie++)
                  Z.shapes[ie].visible === !0 && A(z, ie);
              }
              function I(z) {
                return !!z._fullLayout._outlining;
              }
              function L(z) {
                return !z._context.edits.shapePosition;
              }
              function A(z, Z) {
                z._fullLayout._paperdiv.selectAll('.shapelayer [data-index="' + Z + '"]').remove();
                var W = F.makeShapesOptionsAndPlotinfo(z, Z), q = W.options, ie = W.plotinfo;
                if (!q._input || q.visible !== !0) return;
                if (q.layer === "above")
                  X(z._fullLayout._shapeUpperLayer);
                else if (q.xref === "paper" || q.yref === "paper")
                  X(z._fullLayout._shapeLowerLayer);
                else if (q.layer === "between")
                  X(ie.shapelayerBetween);
                else if (ie._hadPlotinfo) {
                  var ce = ie.mainplotinfo || ie;
                  X(ce.shapelayer);
                } else
                  X(z._fullLayout._shapeLowerLayer);
                function X(U) {
                  var ne = P(z, q), se = {
                    "data-index": Z,
                    "fill-rule": q.fillrule,
                    d: ne
                  }, le = q.opacity, ue = q.fillcolor, ve = q.line.width ? q.line.color : "rgba(0,0,0,0)", be = q.line.width, Me = q.line.dash;
                  !be && q.editable === !0 && (be = 5, Me = "solid");
                  var Ge = ne[ne.length - 1] !== "Z", we = L(z) && q.editable && z._fullLayout._activeShapeIndex === Z;
                  we && (ue = Ge ? "rgba(0,0,0,0)" : z._fullLayout.activeshape.fillcolor, le = z._fullLayout.activeshape.opacity);
                  var Re = U.append("g").classed("shape-group", !0).attr({
                    "data-index": Z
                  }), Ae = Re.append("path").attr(se).style("opacity", le).call(h.stroke, ve).call(h.fill, ue).call(w.dashLine, Me, be);
                  O(Re, z, q), C(z, Z, q, Re);
                  var K;
                  if ((we || z._context.edits.shapePosition) && (K = S(z.layout, "shapes", q)), we) {
                    Ae.style({
                      cursor: "move"
                    });
                    var ee = {
                      element: Ae.node(),
                      plotinfo: ie,
                      gd: z,
                      editHelpers: K,
                      hasText: q.label.text || q.label.texttemplate,
                      isActiveShape: !0
                      // i.e. to enable controllers
                    }, oe = g(ne, z);
                    y(oe, Ae, ee);
                  } else
                    z._context.edits.shapePosition ? N(z, Ae, q, Z, U, K) : q.editable === !0 && Ae.style("pointer-events", Ge || h.opacity(ue) * le <= 0.5 ? "stroke" : "all");
                  Ae.node().addEventListener("click", function() {
                    return j(z, Ae);
                  });
                }
              }
              function O(z, Z, W) {
                var q = (W.xref + W.yref).replace(/paper/g, "").replace(/[xyz][1-9]* *domain/g, "");
                w.setClipUrl(z, q ? "clip" + Z._fullLayout._uid + q : null, Z);
              }
              function N(z, Z, W, q, ie, ce) {
                var X = 10, U = 10, ne = W.xsizemode === "pixel", se = W.ysizemode === "pixel", le = W.type === "line", ue = W.type === "path", ve = ce.modifyItem, be, Me, Ge, we, Re, Ae, K, ee, oe, _, V, fe, $, he, me, xe = l.select(Z.node().parentNode), Fe = p.getFromId(z, W.xref), Ve = p.getRefType(W.xref), Be = p.getFromId(z, W.yref), Je = p.getRefType(W.yref), et = F.getDataToPixel(z, Fe, !1, Ve), at = F.getDataToPixel(z, Be, !0, Je), De = F.getPixelToData(z, Fe, !1, Ve), Ne = F.getPixelToData(z, Be, !0, Je), Ie = ct(), Ue = {
                  element: Ie.node(),
                  gd: z,
                  prepFn: Ot,
                  doneFn: Rt,
                  clickFn: xt
                }, ot;
                E.init(Ue), Ie.node().onmousemove = kt;
                function ct() {
                  return le ? Tt() : Z;
                }
                function Tt() {
                  var Ut = 10, tt = Math.max(W.line.width, Ut), ze = ie.append("g").attr("data-index", q).attr("drag-helper", !0);
                  ze.append("path").attr("d", Z.attr("d")).style({
                    cursor: "move",
                    "stroke-width": tt,
                    "stroke-opacity": "0"
                    // ensure not visible
                  });
                  var _e = {
                    "fill-opacity": "0"
                    // ensure not visible
                  }, Ye = Math.max(tt / 2, Ut);
                  return ze.append("circle").attr({
                    "data-line-point": "start-point",
                    cx: ne ? et(W.xanchor) + W.x0 : et(W.x0),
                    cy: se ? at(W.yanchor) - W.y0 : at(W.y0),
                    r: Ye
                  }).style(_e).classed("cursor-grab", !0), ze.append("circle").attr({
                    "data-line-point": "end-point",
                    cx: ne ? et(W.xanchor) + W.x1 : et(W.x1),
                    cy: se ? at(W.yanchor) - W.y1 : at(W.y1),
                    r: Ye
                  }).style(_e).classed("cursor-grab", !0), ze;
                }
                function kt(Ut) {
                  if (I(z)) {
                    ot = null;
                    return;
                  }
                  if (le)
                    Ut.target.tagName === "path" ? ot = "move" : ot = Ut.target.attributes["data-line-point"].value === "start-point" ? "resize-over-start-point" : "resize-over-end-point";
                  else {
                    var tt = Ue.element.getBoundingClientRect(), ze = tt.right - tt.left, _e = tt.bottom - tt.top, Ye = Ut.clientX - tt.left, lt = Ut.clientY - tt.top, Te = !ue && ze > X && _e > U && !Ut.shiftKey ? E.getCursor(Ye / ze, 1 - lt / _e) : "move";
                    x(Z, Te), ot = Te.split("-")[0];
                  }
                }
                function Ot(Ut) {
                  I(z) || (ne && (Re = et(W.xanchor)), se && (Ae = at(W.yanchor)), W.type === "path" ? me = W.path : (be = ne ? W.x0 : et(W.x0), Me = se ? W.y0 : at(W.y0), Ge = ne ? W.x1 : et(W.x1), we = se ? W.y1 : at(W.y1)), be < Ge ? (oe = be, $ = "x0", _ = Ge, he = "x1") : (oe = Ge, $ = "x1", _ = be, he = "x0"), !se && Me < we || se && Me > we ? (K = Me, V = "y0", ee = we, fe = "y1") : (K = we, V = "y1", ee = Me, fe = "y0"), kt(Ut), jt(ie, W), Yt(Z, W, z), Ue.moveFn = ot === "move" ? Wt : bt, Ue.altKey = Ut.altKey);
                }
                function Rt() {
                  I(z) || (x(Z), qt(ie), O(Z, z, W), v.call("_guiRelayout", z, ce.getUpdateObj()));
                }
                function xt() {
                  I(z) || qt(ie);
                }
                function Wt(Ut, tt) {
                  if (W.type === "path") {
                    var ze = function(lt) {
                      return lt;
                    }, _e = ze, Ye = ze;
                    ne ? ve("xanchor", W.xanchor = De(Re + Ut)) : (_e = function(Te) {
                      return De(et(Te) + Ut);
                    }, Fe && Fe.type === "date" && (_e = F.encodeDate(_e))), se ? ve("yanchor", W.yanchor = Ne(Ae + tt)) : (Ye = function(Te) {
                      return Ne(at(Te) + tt);
                    }, Be && Be.type === "date" && (Ye = F.encodeDate(Ye))), ve("path", W.path = Y(me, _e, Ye));
                  } else
                    ne ? ve("xanchor", W.xanchor = De(Re + Ut)) : (ve("x0", W.x0 = De(be + Ut)), ve("x1", W.x1 = De(Ge + Ut))), se ? ve("yanchor", W.yanchor = Ne(Ae + tt)) : (ve("y0", W.y0 = Ne(Me + tt)), ve("y1", W.y1 = Ne(we + tt)));
                  Z.attr("d", P(z, W)), jt(ie, W), C(z, q, W, xe);
                }
                function bt(Ut, tt) {
                  if (ue) {
                    var ze = function(lr) {
                      return lr;
                    }, _e = ze, Ye = ze;
                    ne ? ve("xanchor", W.xanchor = De(Re + Ut)) : (_e = function(Mr) {
                      return De(et(Mr) + Ut);
                    }, Fe && Fe.type === "date" && (_e = F.encodeDate(_e))), se ? ve("yanchor", W.yanchor = Ne(Ae + tt)) : (Ye = function(Mr) {
                      return Ne(at(Mr) + tt);
                    }, Be && Be.type === "date" && (Ye = F.encodeDate(Ye))), ve("path", W.path = Y(me, _e, Ye));
                  } else if (le) {
                    if (ot === "resize-over-start-point") {
                      var lt = be + Ut, Te = se ? Me - tt : Me + tt;
                      ve("x0", W.x0 = ne ? lt : De(lt)), ve("y0", W.y0 = se ? Te : Ne(Te));
                    } else if (ot === "resize-over-end-point") {
                      var Oe = Ge + Ut, je = se ? we - tt : we + tt;
                      ve("x1", W.x1 = ne ? Oe : De(Oe)), ve("y1", W.y1 = se ? je : Ne(je));
                    }
                  } else {
                    var Xe = function(lr) {
                      return ot.indexOf(lr) !== -1;
                    }, nt = Xe("n"), it = Xe("s"), Nt = Xe("w"), At = Xe("e"), vt = nt ? K + tt : K, ut = it ? ee + tt : ee, Pt = Nt ? oe + Ut : oe, rr = At ? _ + Ut : _;
                    se && (nt && (vt = K - tt), it && (ut = ee - tt)), (!se && ut - vt > U || se && vt - ut > U) && (ve(V, W[V] = se ? vt : Ne(vt)), ve(fe, W[fe] = se ? ut : Ne(ut))), rr - Pt > X && (ve($, W[$] = ne ? Pt : De(Pt)), ve(he, W[he] = ne ? rr : De(rr)));
                  }
                  Z.attr("d", P(z, W)), jt(ie, W), C(z, q, W, xe);
                }
                function jt(Ut, tt) {
                  (ne || se) && ze();
                  function ze() {
                    var _e = tt.type !== "path", Ye = Ut.selectAll(".visual-cue").data([0]), lt = 1;
                    Ye.enter().append("path").attr({
                      fill: "#fff",
                      "fill-rule": "evenodd",
                      stroke: "#000",
                      "stroke-width": lt
                    }).classed("visual-cue", !0);
                    var Te = et(ne ? tt.xanchor : f.midRange(_e ? [tt.x0, tt.x1] : F.extractPathCoords(tt.path, T.paramIsX))), Oe = at(se ? tt.yanchor : f.midRange(_e ? [tt.y0, tt.y1] : F.extractPathCoords(tt.path, T.paramIsY)));
                    if (Te = F.roundPositionForSharpStrokeRendering(Te, lt), Oe = F.roundPositionForSharpStrokeRendering(Oe, lt), ne && se) {
                      var je = "M" + (Te - 1 - lt) + "," + (Oe - 1 - lt) + "h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";
                      Ye.attr("d", je);
                    } else if (ne) {
                      var Xe = "M" + (Te - 1 - lt) + "," + (Oe - 9 - lt) + "v18 h2 v-18 Z";
                      Ye.attr("d", Xe);
                    } else {
                      var nt = "M" + (Te - 9 - lt) + "," + (Oe - 1 - lt) + "h18 v2 h-18 Z";
                      Ye.attr("d", nt);
                    }
                  }
                }
                function qt(Ut) {
                  Ut.selectAll(".visual-cue").remove();
                }
                function Yt(Ut, tt, ze) {
                  var _e = tt.xref, Ye = tt.yref, lt = p.getFromId(ze, _e), Te = p.getFromId(ze, Ye), Oe = "";
                  _e !== "paper" && !lt.autorange && (Oe += _e), Ye !== "paper" && !Te.autorange && (Oe += Ye), w.setClipUrl(Ut, Oe ? "clip" + ze._fullLayout._uid + Oe : null, ze);
                }
              }
              function Y(z, Z, W) {
                return z.replace(T.segmentRE, function(q) {
                  var ie = 0, ce = q.charAt(0), X = T.paramIsX[ce], U = T.paramIsY[ce], ne = T.numParams[ce], se = q.substr(1).replace(T.paramRE, function(le) {
                    return ie >= ne || (X[ie] ? le = Z(le) : U[ie] && (le = W(le)), ie++), le;
                  });
                  return ce + se;
                });
              }
              function j(z, Z) {
                if (L(z)) {
                  var W = Z.node(), q = +W.getAttribute("data-index");
                  if (q >= 0) {
                    if (q === z._fullLayout._activeShapeIndex) {
                      te(z);
                      return;
                    }
                    z._fullLayout._activeShapeIndex = q, z._fullLayout._deactivateShape = te, k(z);
                  }
                }
              }
              function te(z) {
                if (L(z)) {
                  var Z = z._fullLayout._activeShapeIndex;
                  Z >= 0 && (m(z), delete z._fullLayout._activeShapeIndex, k(z));
                }
              }
              function re(z) {
                if (L(z)) {
                  m(z);
                  var Z = z._fullLayout._activeShapeIndex, W = (z.layout || {}).shapes || [];
                  if (Z < W.length) {
                    for (var q = [], ie = 0; ie < W.length; ie++)
                      ie !== Z && q.push(W[ie]);
                    return delete z._fullLayout._activeShapeIndex, v.call("_guiRelayout", z, {
                      shapes: q
                    });
                  }
                }
              }
            }
          ),
          /***/
          2872: (
            /***/
            function(s, c, i) {
              var l = i(7824).overrideAll, v = i(5464), f = i(5376), p = i(8192).u, g = i(2880).extendFlat, y = i(1776).ye, C = i(7728);
              s.exports = l({
                newshape: {
                  visible: g({}, v.visible, {}),
                  showlegend: {
                    valType: "boolean",
                    dflt: !1
                  },
                  legend: g({}, v.legend, {}),
                  legendgroup: g({}, v.legendgroup, {}),
                  legendgrouptitle: {
                    text: g({}, v.legendgrouptitle.text, {}),
                    font: f({})
                  },
                  legendrank: g({}, v.legendrank, {}),
                  legendwidth: g({}, v.legendwidth, {}),
                  line: {
                    color: {
                      valType: "color"
                    },
                    width: {
                      valType: "number",
                      min: 0,
                      dflt: 4
                    },
                    dash: g({}, p, {
                      dflt: "solid"
                    })
                  },
                  fillcolor: {
                    valType: "color",
                    dflt: "rgba(0,0,0,0)"
                  },
                  fillrule: {
                    valType: "enumerated",
                    values: ["evenodd", "nonzero"],
                    dflt: "evenodd"
                  },
                  opacity: {
                    valType: "number",
                    min: 0,
                    max: 1,
                    dflt: 1
                  },
                  layer: {
                    valType: "enumerated",
                    values: ["below", "above", "between"],
                    dflt: "above"
                  },
                  drawdirection: {
                    valType: "enumerated",
                    values: ["ortho", "horizontal", "vertical", "diagonal"],
                    dflt: "diagonal"
                  },
                  name: g({}, v.name, {}),
                  label: {
                    text: {
                      valType: "string",
                      dflt: ""
                    },
                    texttemplate: y({
                      newshape: !0
                    }, {
                      keys: Object.keys(C)
                    }),
                    font: f({}),
                    textposition: {
                      valType: "enumerated",
                      values: ["top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right", "start", "middle", "end"]
                    },
                    textangle: {
                      valType: "angle",
                      dflt: "auto"
                    },
                    xanchor: {
                      valType: "enumerated",
                      values: ["auto", "left", "center", "right"],
                      dflt: "auto"
                    },
                    yanchor: {
                      valType: "enumerated",
                      values: ["top", "middle", "bottom"]
                    },
                    padding: {
                      valType: "number",
                      dflt: 3,
                      min: 0
                    }
                  }
                },
                activeshape: {
                  fillcolor: {
                    valType: "color",
                    dflt: "rgb(255,0,255)"
                  },
                  opacity: {
                    valType: "number",
                    min: 0,
                    max: 1,
                    dflt: 0.5
                  }
                }
              }, "none", "from-root");
            }
          ),
          /***/
          7e3: (
            /***/
            function(s) {
              var c = 32;
              s.exports = {
                CIRCLE_SIDES: c,
                i000: 0,
                i090: c / 4,
                i180: c / 2,
                i270: c / 4 * 3,
                cos45: Math.cos(Math.PI / 4),
                sin45: Math.sin(Math.PI / 4),
                SQRT2: Math.sqrt(2)
              };
            }
          ),
          /***/
          5144: (
            /***/
            function(s, c, i) {
              var l = i(6308), v = i(3400);
              function f(p, g) {
                return p ? "bottom" : g.indexOf("top") !== -1 ? "top" : g.indexOf("bottom") !== -1 ? "bottom" : "middle";
              }
              s.exports = function(g, y, C) {
                C("newshape.visible"), C("newshape.name"), C("newshape.showlegend"), C("newshape.legend"), C("newshape.legendwidth"), C("newshape.legendgroup"), C("newshape.legendgrouptitle.text"), v.coerceFont(C, "newshape.legendgrouptitle.font"), C("newshape.legendrank"), C("newshape.drawdirection"), C("newshape.layer"), C("newshape.fillcolor"), C("newshape.fillrule"), C("newshape.opacity");
                var m = C("newshape.line.width");
                if (m) {
                  var h = (g || {}).plot_bgcolor || "#FFF";
                  C("newshape.line.color", l.contrast(h)), C("newshape.line.dash");
                }
                var w = g.dragmode === "drawline", S = C("newshape.label.text"), E = C("newshape.label.texttemplate");
                if (S || E) {
                  C("newshape.label.textangle");
                  var x = C("newshape.label.textposition", w ? "middle" : "middle center");
                  C("newshape.label.xanchor"), C("newshape.label.yanchor", f(w, x)), C("newshape.label.padding"), v.coerceFont(C, "newshape.label.font", y.font);
                }
                C("activeshape.fillcolor"), C("activeshape.opacity");
              };
            }
          ),
          /***/
          9856: (
            /***/
            function(s, c, i) {
              var l = i(9604), v = i(7e3), f = v.CIRCLE_SIDES, p = v.SQRT2, g = i(5840), y = g.p2r, C = g.r2p, m = [0, 3, 4, 5, 6, 1, 2], h = [0, 3, 4, 1, 2];
              c.writePaths = function(E) {
                var x = E.length;
                if (!x) return "M0,0Z";
                for (var T = "", F = 0; F < x; F++)
                  for (var P = E[F].length, k = 0; k < P; k++) {
                    var I = E[F][k][0];
                    if (I === "Z")
                      T += "Z";
                    else
                      for (var L = E[F][k].length, A = 0; A < L; A++) {
                        var O = A;
                        I === "Q" || I === "S" ? O = h[A] : I === "C" && (O = m[A]), T += E[F][k][O], A > 0 && A < L - 1 && (T += ",");
                      }
                  }
                return T;
              }, c.readPaths = function(E, x, T, F) {
                var P = l(E), k = [], I = -1, L = function() {
                  I++, k[I] = [];
                }, A, O = 0, N = 0, Y, j, te = function() {
                  Y = O, j = N;
                };
                te();
                for (var re = 0; re < P.length; re++) {
                  var z = [], Z, W, q, ie, ce = P[re][0], X = ce;
                  switch (ce) {
                    case "M":
                      L(), O = +P[re][1], N = +P[re][2], z.push([X, O, N]), te();
                      break;
                    case "Q":
                    case "S":
                      Z = +P[re][1], q = +P[re][2], O = +P[re][3], N = +P[re][4], z.push([X, O, N, Z, q]);
                      break;
                    case "C":
                      Z = +P[re][1], q = +P[re][2], W = +P[re][3], ie = +P[re][4], O = +P[re][5], N = +P[re][6], z.push([X, O, N, Z, q, W, ie]);
                      break;
                    case "T":
                    case "L":
                      O = +P[re][1], N = +P[re][2], z.push([X, O, N]);
                      break;
                    case "H":
                      X = "L", O = +P[re][1], z.push([X, O, N]);
                      break;
                    case "V":
                      X = "L", N = +P[re][1], z.push([X, O, N]);
                      break;
                    case "A":
                      X = "L";
                      var U = +P[re][1], ne = +P[re][2];
                      +P[re][4] || (U = -U, ne = -ne);
                      var se = O - U, le = N;
                      for (A = 1; A <= f / 2; A++) {
                        var ue = 2 * Math.PI * A / f;
                        z.push([X, se + U * Math.cos(ue), le + ne * Math.sin(ue)]);
                      }
                      break;
                    case "Z":
                      (O !== Y || N !== j) && (O = Y, N = j, z.push([X, O, N]));
                      break;
                  }
                  for (var ve = (T || {}).domain, be = x._fullLayout._size, Me = T && T.xsizemode === "pixel", Ge = T && T.ysizemode === "pixel", we = F === !1, Re = 0; Re < z.length; Re++) {
                    for (A = 0; A + 2 < 7; A += 2) {
                      var Ae = z[Re][A + 1], K = z[Re][A + 2];
                      Ae === void 0 || K === void 0 || (O = Ae, N = K, T && (T.xaxis && T.xaxis.p2r ? (we && (Ae -= T.xaxis._offset), Me ? Ae = C(T.xaxis, T.xanchor) + Ae : Ae = y(T.xaxis, Ae)) : (we && (Ae -= be.l), ve ? Ae = ve.x[0] + Ae / be.w : Ae = Ae / be.w), T.yaxis && T.yaxis.p2r ? (we && (K -= T.yaxis._offset), Ge ? K = C(T.yaxis, T.yanchor) - K : K = y(T.yaxis, K)) : (we && (K -= be.t), ve ? K = ve.y[1] - K / be.h : K = 1 - K / be.h)), z[Re][A + 1] = Ae, z[Re][A + 2] = K);
                    }
                    k[I].push(z[Re].slice());
                  }
                }
                return k;
              };
              function w(E, x) {
                return Math.abs(E - x) <= 1e-6;
              }
              function S(E, x) {
                var T = x[1] - E[1], F = x[2] - E[2];
                return Math.sqrt(T * T + F * F);
              }
              c.pointsOnRectangle = function(E) {
                var x = E.length;
                if (x !== 5) return !1;
                for (var T = 1; T < 3; T++) {
                  var F = E[0][T] - E[1][T], P = E[3][T] - E[2][T];
                  if (!w(F, P)) return !1;
                  var k = E[0][T] - E[3][T], I = E[1][T] - E[2][T];
                  if (!w(k, I)) return !1;
                }
                return !w(E[0][1], E[1][1]) && !w(E[0][1], E[3][1]) ? !1 : !!(S(E[0], E[1]) * S(E[0], E[3]));
              }, c.pointsOnEllipse = function(E) {
                var x = E.length;
                if (x !== f + 1) return !1;
                x = f;
                for (var T = 0; T < x; T++) {
                  var F = (x * 2 - T) % x, P = (x / 2 + F) % x, k = (x / 2 + T) % x;
                  if (!w(S(E[T], E[k]), S(E[F], E[P]))) return !1;
                }
                return !0;
              }, c.handleEllipse = function(E, x, T) {
                if (!E) return [x, T];
                var F = c.ellipseOver({
                  x0: x[0],
                  y0: x[1],
                  x1: T[0],
                  y1: T[1]
                }), P = (F.x1 + F.x0) / 2, k = (F.y1 + F.y0) / 2, I = (F.x1 - F.x0) / 2, L = (F.y1 - F.y0) / 2;
                I || (I = L = L / p), L || (L = I = I / p);
                for (var A = [], O = 0; O < f; O++) {
                  var N = O * 2 * Math.PI / f;
                  A.push([P + I * Math.cos(N), k + L * Math.sin(N)]);
                }
                return A;
              }, c.ellipseOver = function(E) {
                var x = E.x0, T = E.y0, F = E.x1, P = E.y1, k = F - x, I = P - T;
                x -= k, T -= I;
                var L = (x + F) / 2, A = (T + P) / 2, O = p;
                return k *= O, I *= O, {
                  x0: L - k,
                  y0: A - I,
                  x1: L + k,
                  y1: A + I
                };
              }, c.fixDatesForPaths = function(E, x, T) {
                var F = x.type === "date", P = T.type === "date";
                if (!F && !P) return E;
                for (var k = 0; k < E.length; k++)
                  for (var I = 0; I < E[k].length; I++)
                    for (var L = 0; L + 2 < E[k][I].length; L += 2)
                      F && (E[k][I][L + 1] = E[k][I][L + 1].replace(" ", "_")), P && (E[k][I][L + 2] = E[k][I][L + 2].replace(" ", "_"));
                return E;
              };
            }
          ),
          /***/
          3940: (
            /***/
            function(s, c, i) {
              var l = i(2760), v = l.drawMode, f = l.openMode, p = i(7e3), g = p.i000, y = p.i090, C = p.i180, m = p.i270, h = p.cos45, w = p.sin45, S = i(5840), E = S.p2r, x = S.r2p, T = i(1936), F = T.clearOutline, P = i(9856), k = P.readPaths, I = P.writePaths, L = P.ellipseOver, A = P.fixDatesForPaths;
              function O(Y, j) {
                if (Y.length) {
                  var te = Y[0][0];
                  if (te) {
                    var re = j.gd, z = j.isActiveShape, Z = j.dragmode, W = (re.layout || {}).shapes || [];
                    if (!v(Z) && z !== void 0) {
                      var q = re._fullLayout._activeShapeIndex;
                      if (q < W.length)
                        switch (re._fullLayout.shapes[q].type) {
                          case "rect":
                            Z = "drawrect";
                            break;
                          case "circle":
                            Z = "drawcircle";
                            break;
                          case "line":
                            Z = "drawline";
                            break;
                          case "path":
                            var ie = W[q].path || "";
                            ie[ie.length - 1] === "Z" ? Z = "drawclosedpath" : Z = "drawopenpath";
                            break;
                        }
                    }
                    var ce = N(Y, j, Z);
                    F(re);
                    for (var X = j.editHelpers, U = (X || {}).modifyItem, ne = [], se = 0; se < W.length; se++) {
                      var le = re._fullLayout.shapes[se];
                      if (ne[se] = le._input, z !== void 0 && se === re._fullLayout._activeShapeIndex) {
                        var ue = ce;
                        switch (le.type) {
                          case "line":
                          case "rect":
                          case "circle":
                            U("x0", ue.x0), U("x1", ue.x1), U("y0", ue.y0), U("y1", ue.y1);
                            break;
                          case "path":
                            U("path", ue.path);
                            break;
                        }
                      }
                    }
                    return z === void 0 ? (ne.push(ce), ne) : X ? X.getUpdateObj() : {};
                  }
                }
              }
              function N(Y, j, te) {
                var re = Y[0][0], z = j.gd, Z = re.getAttribute("d"), W = z._fullLayout.newshape, q = j.plotinfo, ie = j.isActiveShape, ce = q.xaxis, X = q.yaxis, U = !!q.domain || !q.xaxis, ne = !!q.domain || !q.yaxis, se = f(te), le = k(Z, z, q, ie), ue = {
                  editable: !0,
                  visible: W.visible,
                  name: W.name,
                  showlegend: W.showlegend,
                  legend: W.legend,
                  legendwidth: W.legendwidth,
                  legendgroup: W.legendgroup,
                  legendgrouptitle: {
                    text: W.legendgrouptitle.text,
                    font: W.legendgrouptitle.font
                  },
                  legendrank: W.legendrank,
                  label: W.label,
                  xref: U ? "paper" : ce._id,
                  yref: ne ? "paper" : X._id,
                  layer: W.layer,
                  opacity: W.opacity,
                  line: {
                    color: W.line.color,
                    width: W.line.width,
                    dash: W.line.dash
                  }
                };
                se || (ue.fillcolor = W.fillcolor, ue.fillrule = W.fillrule);
                var ve;
                if (le.length === 1 && (ve = le[0]), ve && ve.length === 5 && // ensure we only have 4 corners for a rect
                te === "drawrect")
                  ue.type = "rect", ue.x0 = ve[0][1], ue.y0 = ve[0][2], ue.x1 = ve[2][1], ue.y1 = ve[2][2];
                else if (ve && te === "drawline")
                  ue.type = "line", ue.x0 = ve[0][1], ue.y0 = ve[0][2], ue.x1 = ve[1][1], ue.y1 = ve[1][2];
                else if (ve && te === "drawcircle") {
                  ue.type = "circle";
                  var be = ve[g][1], Me = ve[y][1], Ge = ve[C][1], we = ve[m][1], Re = ve[g][2], Ae = ve[y][2], K = ve[C][2], ee = ve[m][2], oe = q.xaxis && (q.xaxis.type === "date" || q.xaxis.type === "log"), _ = q.yaxis && (q.yaxis.type === "date" || q.yaxis.type === "log");
                  oe && (be = x(q.xaxis, be), Me = x(q.xaxis, Me), Ge = x(q.xaxis, Ge), we = x(q.xaxis, we)), _ && (Re = x(q.yaxis, Re), Ae = x(q.yaxis, Ae), K = x(q.yaxis, K), ee = x(q.yaxis, ee));
                  var V = (Me + we) / 2, fe = (Re + K) / 2, $ = (we - Me + Ge - be) / 2, he = (ee - Ae + K - Re) / 2, me = L({
                    x0: V,
                    y0: fe,
                    x1: V + $ * h,
                    y1: fe + he * w
                  });
                  oe && (me.x0 = E(q.xaxis, me.x0), me.x1 = E(q.xaxis, me.x1)), _ && (me.y0 = E(q.yaxis, me.y0), me.y1 = E(q.yaxis, me.y1)), ue.x0 = me.x0, ue.y0 = me.y0, ue.x1 = me.x1, ue.y1 = me.y1;
                } else
                  ue.type = "path", ce && X && A(le, ce, X), ue.path = I(le), ve = null;
                return ue;
              }
              s.exports = {
                newShapes: O,
                createShapeObj: N
              };
            }
          ),
          /***/
          1936: (
            /***/
            function(s) {
              function c(l) {
                var v = l._fullLayout._zoomlayer;
                v && v.selectAll(".outline-controllers").remove();
              }
              function i(l) {
                var v = l._fullLayout._zoomlayer;
                v && v.selectAll(".select-outline").remove(), l._fullLayout._outlining = !1;
              }
              s.exports = {
                clearOutlineControllers: c,
                clearOutline: i
              };
            }
          ),
          /***/
          5152: (
            /***/
            function(s, c, i) {
              var l = i(3068), v = i(3400), f = i(4460);
              c.rangeToShapePosition = function(g) {
                return g.type === "log" ? g.r2d : function(y) {
                  return y;
                };
              }, c.shapePositionToRange = function(g) {
                return g.type === "log" ? g.d2r : function(y) {
                  return y;
                };
              }, c.decodeDate = function(g) {
                return function(y) {
                  return y.replace && (y = y.replace("_", " ")), g(y);
                };
              }, c.encodeDate = function(g) {
                return function(y) {
                  return g(y).replace(" ", "_");
                };
              }, c.extractPathCoords = function(g, y, C) {
                var m = [], h = g.match(l.segmentRE);
                return h.forEach(function(w) {
                  var S = y[w.charAt(0)].drawn;
                  if (S !== void 0) {
                    var E = w.substr(1).match(l.paramRE);
                    if (!(!E || E.length < S)) {
                      var x = E[S], T = C ? x : v.cleanNumber(x);
                      m.push(T);
                    }
                  }
                }), m;
              }, c.getDataToPixel = function(g, y, C, m) {
                var h = g._fullLayout._size, w;
                if (y)
                  if (m === "domain")
                    w = function(E) {
                      return y._length * (C ? 1 - E : E) + y._offset;
                    };
                  else {
                    var S = c.shapePositionToRange(y);
                    w = function(E) {
                      return y._offset + y.r2p(S(E, !0));
                    }, y.type === "date" && (w = c.decodeDate(w));
                  }
                else C ? w = function(E) {
                  return h.t + h.h * (1 - E);
                } : w = function(E) {
                  return h.l + h.w * E;
                };
                return w;
              }, c.getPixelToData = function(g, y, C, m) {
                var h = g._fullLayout._size, w;
                if (y)
                  if (m === "domain")
                    w = function(E) {
                      var x = (E - y._offset) / y._length;
                      return C ? 1 - x : x;
                    };
                  else {
                    var S = c.rangeToShapePosition(y);
                    w = function(E) {
                      return S(y.p2r(E - y._offset));
                    };
                  }
                else C ? w = function(E) {
                  return 1 - (E - h.t) / h.h;
                } : w = function(E) {
                  return (E - h.l) / h.w;
                };
                return w;
              }, c.roundPositionForSharpStrokeRendering = function(g, y) {
                var C = Math.round(y % 2) === 1, m = Math.round(g);
                return C ? m + 0.5 : m;
              }, c.makeShapesOptionsAndPlotinfo = function(g, y) {
                var C = g._fullLayout.shapes[y] || {}, m = g._fullLayout._plots[C.xref + C.yref], h = !!m;
                return h ? m._hadPlotinfo = !0 : (m = {}, C.xref && C.xref !== "paper" && (m.xaxis = g._fullLayout[C.xref + "axis"]), C.yref && C.yref !== "paper" && (m.yaxis = g._fullLayout[C.yref + "axis"])), m.xsizemode = C.xsizemode, m.ysizemode = C.ysizemode, m.xanchor = C.xanchor, m.yanchor = C.yanchor, {
                  options: C,
                  plotinfo: m
                };
              }, c.makeSelectionsOptionsAndPlotinfo = function(g, y) {
                var C = g._fullLayout.selections[y] || {}, m = g._fullLayout._plots[C.xref + C.yref], h = !!m;
                return h ? m._hadPlotinfo = !0 : (m = {}, C.xref && (m.xaxis = g._fullLayout[C.xref + "axis"]), C.yref && (m.yaxis = g._fullLayout[C.yref + "axis"])), {
                  options: C,
                  plotinfo: m
                };
              }, c.getPathString = function(g, y) {
                var C = y.type, m = f.getRefType(y.xref), h = f.getRefType(y.yref), w = f.getFromId(g, y.xref), S = f.getFromId(g, y.yref), E = g._fullLayout._size, x, T, F, P, k, I, L, A;
                if (w ? m === "domain" ? T = function(q) {
                  return w._offset + w._length * q;
                } : (x = c.shapePositionToRange(w), T = function(q) {
                  return w._offset + w.r2p(x(q, !0));
                }) : T = function(q) {
                  return E.l + E.w * q;
                }, S ? h === "domain" ? P = function(q) {
                  return S._offset + S._length * (1 - q);
                } : (F = c.shapePositionToRange(S), P = function(q) {
                  return S._offset + S.r2p(F(q, !0));
                }) : P = function(q) {
                  return E.t + E.h * (1 - q);
                }, C === "path")
                  return w && w.type === "date" && (T = c.decodeDate(T)), S && S.type === "date" && (P = c.decodeDate(P)), p(y, T, P);
                if (y.xsizemode === "pixel") {
                  var O = T(y.xanchor);
                  k = O + y.x0, I = O + y.x1;
                } else
                  k = T(y.x0), I = T(y.x1);
                if (y.ysizemode === "pixel") {
                  var N = P(y.yanchor);
                  L = N - y.y0, A = N - y.y1;
                } else
                  L = P(y.y0), A = P(y.y1);
                if (C === "line") return "M" + k + "," + L + "L" + I + "," + A;
                if (C === "rect") return "M" + k + "," + L + "H" + I + "V" + A + "H" + k + "Z";
                var Y = (k + I) / 2, j = (L + A) / 2, te = Math.abs(Y - k), re = Math.abs(j - L), z = "A" + te + "," + re, Z = Y + te + "," + j, W = Y + "," + (j - re);
                return "M" + Z + z + " 0 1,1 " + W + z + " 0 0,1 " + Z + "Z";
              };
              function p(g, y, C) {
                var m = g.path, h = g.xsizemode, w = g.ysizemode, S = g.xanchor, E = g.yanchor;
                return m.replace(l.segmentRE, function(x) {
                  var T = 0, F = x.charAt(0), P = l.paramIsX[F], k = l.paramIsY[F], I = l.numParams[F], L = x.substr(1).replace(l.paramRE, function(A) {
                    return P[T] ? h === "pixel" ? A = y(S) + Number(A) : A = y(A) : k[T] && (w === "pixel" ? A = C(E) - Number(A) : A = C(A)), T++, T > I && (A = "X"), A;
                  });
                  return T > I && (L = L.replace(/[\s,]*X.*/, ""), v.log("Ignoring extra params in segment " + x)), F + L;
                });
              }
            }
          ),
          /***/
          1592: (
            /***/
            function(s, c, i) {
              var l = i(4016);
              s.exports = {
                moduleType: "component",
                name: "shapes",
                layoutAttributes: i(6056),
                supplyLayoutDefaults: i(3712),
                supplyDrawNewShapeDefaults: i(5144),
                includeBasePlot: i(6632)("shapes"),
                calcAutorange: i(6084),
                draw: l.draw,
                drawOne: l.drawOne
              };
            }
          ),
          /***/
          7728: (
            /***/
            function(s) {
              function c(x, T) {
                return T ? T.d2l(x) : x;
              }
              function i(x, T) {
                return T ? T.l2d(x) : x;
              }
              function l(x) {
                return x.x0;
              }
              function v(x) {
                return x.x1;
              }
              function f(x) {
                return x.y0;
              }
              function p(x) {
                return x.y1;
              }
              function g(x, T) {
                return c(x.x1, T) - c(x.x0, T);
              }
              function y(x, T, F) {
                return c(x.y1, F) - c(x.y0, F);
              }
              function C(x, T) {
                return Math.abs(g(x, T));
              }
              function m(x, T, F) {
                return Math.abs(y(x, T, F));
              }
              function h(x, T, F) {
                return x.type !== "line" ? void 0 : Math.sqrt(Math.pow(g(x, T), 2) + Math.pow(y(x, T, F), 2));
              }
              function w(x, T) {
                return i((c(x.x1, T) + c(x.x0, T)) / 2, T);
              }
              function S(x, T, F) {
                return i((c(x.y1, F) + c(x.y0, F)) / 2, F);
              }
              function E(x, T, F) {
                return x.type !== "line" ? void 0 : y(x, T, F) / g(x, T);
              }
              s.exports = {
                x0: l,
                x1: v,
                y0: f,
                y1: p,
                slope: E,
                dx: g,
                dy: y,
                width: C,
                height: m,
                length: h,
                xcenter: w,
                ycenter: S
              };
            }
          ),
          /***/
          9861: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(6741), f = i(2880).extendDeepAll, p = i(7824).overrideAll, g = i(5656), y = i(1780).templatedArray, C = i(876), m = y("step", {
                visible: {
                  valType: "boolean",
                  dflt: !0
                },
                method: {
                  valType: "enumerated",
                  values: ["restyle", "relayout", "animate", "update", "skip"],
                  dflt: "restyle"
                },
                args: {
                  valType: "info_array",
                  freeLength: !0,
                  items: [{
                    valType: "any"
                  }, {
                    valType: "any"
                  }, {
                    valType: "any"
                  }]
                },
                label: {
                  valType: "string"
                },
                value: {
                  valType: "string"
                },
                execute: {
                  valType: "boolean",
                  dflt: !0
                }
              });
              s.exports = p(y("slider", {
                visible: {
                  valType: "boolean",
                  dflt: !0
                },
                active: {
                  valType: "number",
                  min: 0,
                  dflt: 0
                },
                steps: m,
                lenmode: {
                  valType: "enumerated",
                  values: ["fraction", "pixels"],
                  dflt: "fraction"
                },
                len: {
                  valType: "number",
                  min: 0,
                  dflt: 1
                },
                x: {
                  valType: "number",
                  min: -2,
                  max: 3,
                  dflt: 0
                },
                pad: f(v({
                  editType: "arraydraw"
                }), {}, {
                  t: {
                    dflt: 20
                  }
                }),
                xanchor: {
                  valType: "enumerated",
                  values: ["auto", "left", "center", "right"],
                  dflt: "left"
                },
                y: {
                  valType: "number",
                  min: -2,
                  max: 3,
                  dflt: 0
                },
                yanchor: {
                  valType: "enumerated",
                  values: ["auto", "top", "middle", "bottom"],
                  dflt: "top"
                },
                transition: {
                  duration: {
                    valType: "number",
                    min: 0,
                    dflt: 150
                  },
                  easing: {
                    valType: "enumerated",
                    values: g.transition.easing.values,
                    dflt: "cubic-in-out"
                  }
                },
                currentvalue: {
                  visible: {
                    valType: "boolean",
                    dflt: !0
                  },
                  xanchor: {
                    valType: "enumerated",
                    values: ["left", "center", "right"],
                    dflt: "left"
                  },
                  offset: {
                    valType: "number",
                    dflt: 10
                  },
                  prefix: {
                    valType: "string"
                  },
                  suffix: {
                    valType: "string"
                  },
                  font: l({})
                },
                font: l({}),
                activebgcolor: {
                  valType: "color",
                  dflt: C.gripBgActiveColor
                },
                bgcolor: {
                  valType: "color",
                  dflt: C.railBgColor
                },
                bordercolor: {
                  valType: "color",
                  dflt: C.railBorderColor
                },
                borderwidth: {
                  valType: "number",
                  min: 0,
                  dflt: C.railBorderWidth
                },
                ticklen: {
                  valType: "number",
                  min: 0,
                  dflt: C.tickLength
                },
                tickcolor: {
                  valType: "color",
                  dflt: C.tickColor
                },
                tickwidth: {
                  valType: "number",
                  min: 0,
                  dflt: 1
                },
                minorticklen: {
                  valType: "number",
                  min: 0,
                  dflt: C.minorTickLength
                }
              }), "arraydraw", "from-root");
            }
          ),
          /***/
          876: (
            /***/
            function(s) {
              s.exports = {
                // layout attribute name
                name: "sliders",
                // class names
                containerClassName: "slider-container",
                groupClassName: "slider-group",
                inputAreaClass: "slider-input-area",
                railRectClass: "slider-rail-rect",
                railTouchRectClass: "slider-rail-touch-rect",
                gripRectClass: "slider-grip-rect",
                tickRectClass: "slider-tick-rect",
                inputProxyClass: "slider-input-proxy",
                labelsClass: "slider-labels",
                labelGroupClass: "slider-label-group",
                labelClass: "slider-label",
                currentValueClass: "slider-current-value",
                railHeight: 5,
                // DOM attribute name in button group keeping track
                // of active update menu
                menuIndexAttrName: "slider-active-index",
                // id root pass to Plots.autoMargin
                autoMarginIdRoot: "slider-",
                // min item width / height
                minWidth: 30,
                minHeight: 30,
                // padding around item text
                textPadX: 40,
                // arrow offset off right edge
                arrowOffsetX: 4,
                railRadius: 2,
                railWidth: 5,
                railBorder: 4,
                railBorderWidth: 1,
                railBorderColor: "#bec8d9",
                railBgColor: "#f8fafc",
                // The distance of the rail from the edge of the touchable area
                // Slightly less than the step inset because of the curved edges
                // of the rail
                railInset: 8,
                // The distance from the extremal tick marks to the edge of the
                // touchable area. This is basically the same as the grip radius,
                // but for other styles it wouldn't really need to be.
                stepInset: 10,
                gripRadius: 10,
                gripWidth: 20,
                gripHeight: 20,
                gripBorder: 20,
                gripBorderWidth: 1,
                gripBorderColor: "#bec8d9",
                gripBgColor: "#f6f8fa",
                gripBgActiveColor: "#dbdde0",
                labelPadding: 8,
                labelOffset: 0,
                tickWidth: 1,
                tickColor: "#333",
                tickOffset: 25,
                tickLength: 7,
                minorTickOffset: 25,
                minorTickColor: "#333",
                minorTickLength: 4,
                // Extra space below the current value label:
                currentValuePadding: 8,
                currentValueInset: 0
              };
            }
          ),
          /***/
          8132: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(1272), f = i(9861), p = i(876), g = p.name, y = f.steps;
              s.exports = function(w, S) {
                v(w, S, {
                  name: g,
                  handleItemDefaults: C
                });
              };
              function C(h, w, S) {
                function E(A, O) {
                  return l.coerce(h, w, f, A, O);
                }
                for (var x = v(h, w, {
                  name: "steps",
                  handleItemDefaults: m
                }), T = 0, F = 0; F < x.length; F++)
                  x[F].visible && T++;
                var P;
                if (T < 2 ? P = w.visible = !1 : P = E("visible"), !!P) {
                  w._stepCount = T;
                  var k = w._visibleSteps = l.filterVisible(x), I = E("active");
                  (x[I] || {}).visible || (w.active = k[0]._index), E("x"), E("y"), l.noneOrAll(h, w, ["x", "y"]), E("xanchor"), E("yanchor"), E("len"), E("lenmode"), E("pad.t"), E("pad.r"), E("pad.b"), E("pad.l"), l.coerceFont(E, "font", S.font);
                  var L = E("currentvalue.visible");
                  L && (E("currentvalue.xanchor"), E("currentvalue.prefix"), E("currentvalue.suffix"), E("currentvalue.offset"), l.coerceFont(E, "currentvalue.font", w.font)), E("transition.duration"), E("transition.easing"), E("bgcolor"), E("activebgcolor"), E("bordercolor"), E("borderwidth"), E("ticklen"), E("tickwidth"), E("tickcolor"), E("minorticklen");
                }
              }
              function m(h, w) {
                function S(T, F) {
                  return l.coerce(h, w, y, T, F);
                }
                var E;
                if (h.method !== "skip" && !Array.isArray(h.args) ? E = w.visible = !1 : E = S("visible"), E) {
                  S("method"), S("args");
                  var x = S("label", "step-" + w._index);
                  S("value", x), S("execute");
                }
              }
            }
          ),
          /***/
          9664: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(7316), f = i(6308), p = i(3616), g = i(3400), y = g.strTranslate, C = i(2736), m = i(1780).arrayEditor, h = i(876), w = i(4284), S = w.LINE_SPACING, E = w.FROM_TL, x = w.FROM_BR;
              s.exports = function(U) {
                var ne = U._context.staticPlot, se = U._fullLayout, le = F(se, U), ue = se._infolayer.selectAll("g." + h.containerClassName).data(le.length > 0 ? [0] : []);
                ue.enter().append("g").classed(h.containerClassName, !0).style("cursor", ne ? null : "ew-resize");
                function ve(we) {
                  we._commandObserver && (we._commandObserver.remove(), delete we._commandObserver), v.autoMargin(U, T(we));
                }
                if (ue.exit().each(function() {
                  l.select(this).selectAll("g." + h.groupClassName).each(ve);
                }).remove(), le.length !== 0) {
                  var be = ue.selectAll("g." + h.groupClassName).data(le, P);
                  be.enter().append("g").classed(h.groupClassName, !0), be.exit().each(ve).remove();
                  for (var Me = 0; Me < le.length; Me++) {
                    var Ge = le[Me];
                    k(U, Ge);
                  }
                  be.each(function(we) {
                    var Re = l.select(this);
                    z(we), v.manageCommandObserver(U, we, we._visibleSteps, function(Ae) {
                      var K = Re.data()[0];
                      K.active !== Ae.index && (K._dragging || j(U, Re, K, Ae.index, !1, !0));
                    }), I(U, l.select(this), we);
                  });
                }
              };
              function T(X) {
                return h.autoMarginIdRoot + X._index;
              }
              function F(X, U) {
                for (var ne = X[h.name], se = [], le = 0; le < ne.length; le++) {
                  var ue = ne[le];
                  ue.visible && (ue._gd = U, se.push(ue));
                }
                return se;
              }
              function P(X) {
                return X._index;
              }
              function k(X, U) {
                var ne = p.tester.selectAll("g." + h.labelGroupClass).data(U._visibleSteps);
                ne.enter().append("g").classed(h.labelGroupClass, !0);
                var se = 0, le = 0;
                ne.each(function(ee) {
                  var oe = l.select(this), _ = O(oe, {
                    step: ee
                  }, U), V = _.node();
                  if (V) {
                    var fe = p.bBox(V);
                    le = Math.max(le, fe.height), se = Math.max(se, fe.width);
                  }
                }), ne.remove();
                var ue = U._dims = {};
                ue.inputAreaWidth = Math.max(h.railWidth, h.gripHeight);
                var ve = X._fullLayout._size;
                ue.lx = ve.l + ve.w * U.x, ue.ly = ve.t + ve.h * (1 - U.y), U.lenmode === "fraction" ? ue.outerLength = Math.round(ve.w * U.len) : ue.outerLength = U.len, ue.inputAreaStart = 0, ue.inputAreaLength = Math.round(ue.outerLength - U.pad.l - U.pad.r);
                var be = ue.inputAreaLength - 2 * h.stepInset, Me = be / (U._stepCount - 1), Ge = se + h.labelPadding;
                if (ue.labelStride = Math.max(1, Math.ceil(Ge / Me)), ue.labelHeight = le, ue.currentValueMaxWidth = 0, ue.currentValueHeight = 0, ue.currentValueTotalHeight = 0, ue.currentValueMaxLines = 1, U.currentvalue.visible) {
                  var we = p.tester.append("g");
                  ne.each(function(ee) {
                    var oe = L(we, U, ee.label), _ = oe.node() && p.bBox(oe.node()) || {
                      width: 0,
                      height: 0
                    }, V = C.lineCount(oe);
                    ue.currentValueMaxWidth = Math.max(ue.currentValueMaxWidth, Math.ceil(_.width)), ue.currentValueHeight = Math.max(ue.currentValueHeight, Math.ceil(_.height)), ue.currentValueMaxLines = Math.max(ue.currentValueMaxLines, V);
                  }), ue.currentValueTotalHeight = ue.currentValueHeight + U.currentvalue.offset, we.remove();
                }
                ue.height = ue.currentValueTotalHeight + h.tickOffset + U.ticklen + h.labelOffset + ue.labelHeight + U.pad.t + U.pad.b;
                var Re = "left";
                g.isRightAnchor(U) && (ue.lx -= ue.outerLength, Re = "right"), g.isCenterAnchor(U) && (ue.lx -= ue.outerLength / 2, Re = "center");
                var Ae = "top";
                g.isBottomAnchor(U) && (ue.ly -= ue.height, Ae = "bottom"), g.isMiddleAnchor(U) && (ue.ly -= ue.height / 2, Ae = "middle"), ue.outerLength = Math.ceil(ue.outerLength), ue.height = Math.ceil(ue.height), ue.lx = Math.round(ue.lx), ue.ly = Math.round(ue.ly);
                var K = {
                  y: U.y,
                  b: ue.height * x[Ae],
                  t: ue.height * E[Ae]
                };
                U.lenmode === "fraction" ? (K.l = 0, K.xl = U.x - U.len * E[Re], K.r = 0, K.xr = U.x + U.len * x[Re]) : (K.x = U.x, K.l = ue.outerLength * E[Re], K.r = ue.outerLength * x[Re]), v.autoMargin(X, T(U), K);
              }
              function I(X, U, ne) {
                (ne.steps[ne.active] || {}).visible || (ne.active = ne._visibleSteps[0]._index), U.call(L, ne).call(ce, ne).call(N, ne).call(re, ne).call(ie, X, ne).call(A, X, ne);
                var se = ne._dims;
                p.setTranslate(U, se.lx + ne.pad.l, se.ly + ne.pad.t), U.call(Z, ne, !1), U.call(L, ne);
              }
              function L(X, U, ne) {
                if (U.currentvalue.visible) {
                  var se = U._dims, le, ue;
                  switch (U.currentvalue.xanchor) {
                    case "right":
                      le = se.inputAreaLength - h.currentValueInset - se.currentValueMaxWidth, ue = "left";
                      break;
                    case "center":
                      le = se.inputAreaLength * 0.5, ue = "middle";
                      break;
                    default:
                      le = h.currentValueInset, ue = "left";
                  }
                  var ve = g.ensureSingle(X, "text", h.labelClass, function(Ae) {
                    Ae.attr({
                      "text-anchor": ue,
                      "data-notex": 1
                    });
                  }), be = U.currentvalue.prefix ? U.currentvalue.prefix : "";
                  if (typeof ne == "string")
                    be += ne;
                  else {
                    var Me = U.steps[U.active].label, Ge = U._gd._fullLayout._meta;
                    Ge && (Me = g.templateString(Me, Ge)), be += Me;
                  }
                  U.currentvalue.suffix && (be += U.currentvalue.suffix), ve.call(p.font, U.currentvalue.font).text(be).call(C.convertToTspans, U._gd);
                  var we = C.lineCount(ve), Re = (se.currentValueMaxLines + 1 - we) * U.currentvalue.font.size * S;
                  return C.positionText(ve, le, Re), ve;
                }
              }
              function A(X, U, ne) {
                var se = g.ensureSingle(X, "rect", h.gripRectClass, function(le) {
                  le.call(te, U, X, ne).style("pointer-events", "all");
                });
                se.attr({
                  width: h.gripWidth,
                  height: h.gripHeight,
                  rx: h.gripRadius,
                  ry: h.gripRadius
                }).call(f.stroke, ne.bordercolor).call(f.fill, ne.bgcolor).style("stroke-width", ne.borderwidth + "px");
              }
              function O(X, U, ne) {
                var se = g.ensureSingle(X, "text", h.labelClass, function(ve) {
                  ve.attr({
                    "text-anchor": "middle",
                    "data-notex": 1
                  });
                }), le = U.step.label, ue = ne._gd._fullLayout._meta;
                return ue && (le = g.templateString(le, ue)), se.call(p.font, ne.font).text(le).call(C.convertToTspans, ne._gd), se;
              }
              function N(X, U) {
                var ne = g.ensureSingle(X, "g", h.labelsClass), se = U._dims, le = ne.selectAll("g." + h.labelGroupClass).data(se.labelSteps);
                le.enter().append("g").classed(h.labelGroupClass, !0), le.exit().remove(), le.each(function(ue) {
                  var ve = l.select(this);
                  ve.call(O, ue, U), p.setTranslate(ve, W(U, ue.fraction), h.tickOffset + U.ticklen + // position is the baseline of the top line of text only, even
                  // if the label spans multiple lines
                  U.font.size * S + h.labelOffset + se.currentValueTotalHeight);
                });
              }
              function Y(X, U, ne, se, le) {
                var ue = Math.round(se * (ne._stepCount - 1)), ve = ne._visibleSteps[ue]._index;
                ve !== ne.active && j(X, U, ne, ve, !0, le);
              }
              function j(X, U, ne, se, le, ue) {
                var ve = ne.active;
                ne.active = se, m(X.layout, h.name, ne).applyUpdate("active", se);
                var be = ne.steps[ne.active];
                U.call(Z, ne, ue), U.call(L, ne), X.emit("plotly_sliderchange", {
                  slider: ne,
                  step: ne.steps[ne.active],
                  interaction: le,
                  previousActive: ve
                }), be && be.method && le && (U._nextMethod ? (U._nextMethod.step = be, U._nextMethod.doCallback = le, U._nextMethod.doTransition = ue) : (U._nextMethod = {
                  step: be,
                  doCallback: le,
                  doTransition: ue
                }, U._nextMethodRaf = window.requestAnimationFrame(function() {
                  var Me = U._nextMethod.step;
                  Me.method && (Me.execute && v.executeAPICommand(X, Me.method, Me.args), U._nextMethod = null, U._nextMethodRaf = null);
                })));
              }
              function te(X, U, ne) {
                if (U._context.staticPlot) return;
                var se = ne.node(), le = l.select(U);
                function ue() {
                  return ne.data()[0];
                }
                function ve() {
                  var be = ue();
                  U.emit("plotly_sliderstart", {
                    slider: be
                  });
                  var Me = ne.select("." + h.gripRectClass);
                  l.event.stopPropagation(), l.event.preventDefault(), Me.call(f.fill, be.activebgcolor);
                  var Ge = q(be, l.mouse(se)[0]);
                  Y(U, ne, be, Ge, !0), be._dragging = !0;
                  function we() {
                    var Ae = ue(), K = q(Ae, l.mouse(se)[0]);
                    Y(U, ne, Ae, K, !1);
                  }
                  le.on("mousemove", we), le.on("touchmove", we);
                  function Re() {
                    var Ae = ue();
                    Ae._dragging = !1, Me.call(f.fill, Ae.bgcolor), le.on("mouseup", null), le.on("mousemove", null), le.on("touchend", null), le.on("touchmove", null), U.emit("plotly_sliderend", {
                      slider: Ae,
                      step: Ae.steps[Ae.active]
                    });
                  }
                  le.on("mouseup", Re), le.on("touchend", Re);
                }
                X.on("mousedown", ve), X.on("touchstart", ve);
              }
              function re(X, U) {
                var ne = X.selectAll("rect." + h.tickRectClass).data(U._visibleSteps), se = U._dims;
                ne.enter().append("rect").classed(h.tickRectClass, !0), ne.exit().remove(), ne.attr({
                  width: U.tickwidth + "px",
                  "shape-rendering": "crispEdges"
                }), ne.each(function(le, ue) {
                  var ve = ue % se.labelStride === 0, be = l.select(this);
                  be.attr({
                    height: ve ? U.ticklen : U.minorticklen
                  }).call(f.fill, U.tickcolor), p.setTranslate(be, W(U, ue / (U._stepCount - 1)) - 0.5 * U.tickwidth, (ve ? h.tickOffset : h.minorTickOffset) + se.currentValueTotalHeight);
                });
              }
              function z(X) {
                var U = X._dims;
                U.labelSteps = [];
                for (var ne = X._stepCount, se = 0; se < ne; se += U.labelStride)
                  U.labelSteps.push({
                    fraction: se / (ne - 1),
                    step: X._visibleSteps[se]
                  });
              }
              function Z(X, U, ne) {
                for (var se = X.select("rect." + h.gripRectClass), le = 0, ue = 0; ue < U._stepCount; ue++)
                  if (U._visibleSteps[ue]._index === U.active) {
                    le = ue;
                    break;
                  }
                var ve = W(U, le / (U._stepCount - 1));
                if (!U._invokingCommand) {
                  var be = se;
                  ne && U.transition.duration > 0 && (be = be.transition().duration(U.transition.duration).ease(U.transition.easing)), be.attr("transform", y(ve - h.gripWidth * 0.5, U._dims.currentValueTotalHeight));
                }
              }
              function W(X, U) {
                var ne = X._dims;
                return ne.inputAreaStart + h.stepInset + (ne.inputAreaLength - 2 * h.stepInset) * Math.min(1, Math.max(0, U));
              }
              function q(X, U) {
                var ne = X._dims;
                return Math.min(1, Math.max(0, (U - h.stepInset - ne.inputAreaStart) / (ne.inputAreaLength - 2 * h.stepInset - 2 * ne.inputAreaStart)));
              }
              function ie(X, U, ne) {
                var se = ne._dims, le = g.ensureSingle(X, "rect", h.railTouchRectClass, function(ue) {
                  ue.call(te, U, X, ne).style("pointer-events", "all");
                });
                le.attr({
                  width: se.inputAreaLength,
                  height: Math.max(se.inputAreaWidth, h.tickOffset + ne.ticklen + se.labelHeight)
                }).call(f.fill, ne.bgcolor).attr("opacity", 0), p.setTranslate(le, 0, se.currentValueTotalHeight);
              }
              function ce(X, U) {
                var ne = U._dims, se = ne.inputAreaLength - h.railInset * 2, le = g.ensureSingle(X, "rect", h.railRectClass);
                le.attr({
                  width: se,
                  height: h.railWidth,
                  rx: h.railRadius,
                  ry: h.railRadius,
                  "shape-rendering": "crispEdges"
                }).call(f.stroke, U.bordercolor).call(f.fill, U.bgcolor).style("stroke-width", U.borderwidth + "px"), p.setTranslate(le, h.railInset, (ne.inputAreaWidth - h.railWidth) * 0.5 + ne.currentValueTotalHeight);
              }
            }
          ),
          /***/
          7544: (
            /***/
            function(s, c, i) {
              var l = i(876);
              s.exports = {
                moduleType: "component",
                name: l.name,
                layoutAttributes: i(9861),
                supplyLayoutDefaults: i(8132),
                draw: i(9664)
              };
            }
          ),
          /***/
          1668: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(7316), p = i(4040), g = i(3400), y = g.strTranslate, C = i(3616), m = i(6308), h = i(2736), w = i(3448), S = i(4284).OPPOSITE_SIDE, E = / [XY][0-9]* /;
              function x(T, F, P) {
                var k = P.propContainer, I = P.propName, L = P.placeholder, A = P.traceIndex, O = P.avoid || {}, N = P.attributes, Y = P.transform, j = P.containerGroup, te = T._fullLayout, re = 1, z = !1, Z = k.title, W = (Z && Z.text ? Z.text : "").trim(), q = Z && Z.font ? Z.font : {}, ie = q.family, ce = q.size, X = q.color, U = q.weight, ne = q.style, se = q.variant, le = q.textcase, ue = q.lineposition, ve = q.shadow, be;
                I === "title.text" ? be = "titleText" : I.indexOf("axis") !== -1 ? be = "axisTitleText" : I.indexOf("colorbar" !== -1) && (be = "colorbarTitleText");
                var Me = T._context.edits[be];
                W === "" ? re = 0 : W.replace(E, " % ") === L.replace(E, " % ") && (re = 0.2, z = !0, Me || (W = "")), P._meta ? W = g.templateString(W, P._meta) : te._meta && (W = g.templateString(W, te._meta));
                var Ge = W || Me, we;
                j || (j = g.ensureSingle(te._infolayer, "g", "g-" + F), we = te._hColorbarMoveTitle);
                var Re = j.selectAll("text").data(Ge ? [0] : []);
                if (Re.enter().append("text"), Re.text(W).attr("class", F), Re.exit().remove(), !Ge) return j;
                function Ae(_) {
                  g.syncOrAsync([K, ee], _);
                }
                function K(_) {
                  var V;
                  return !Y && we && (Y = {}), Y ? (V = "", Y.rotate && (V += "rotate(" + [Y.rotate, N.x, N.y] + ")"), (Y.offset || we) && (V += y(0, (Y.offset || 0) - (we || 0)))) : V = null, _.attr("transform", V), _.style("opacity", re * m.opacity(X)).call(C.font, {
                    color: m.rgb(X),
                    size: l.round(ce, 2),
                    family: ie,
                    weight: U,
                    style: ne,
                    variant: se,
                    textcase: le,
                    shadow: ve,
                    lineposition: ue
                  }).attr(N).call(h.convertToTspans, T), f.previousPromises(T);
                }
                function ee(_) {
                  var V = l.select(_.node().parentNode);
                  if (O && O.selection && O.side && W) {
                    V.attr("transform", null);
                    var fe = S[O.side], $ = O.side === "left" || O.side === "top" ? -1 : 1, he = v(O.pad) ? O.pad : 2, me = C.bBox(V.node()), xe = {
                      t: 0,
                      b: 0,
                      l: 0,
                      r: 0
                    }, Fe = T._fullLayout._reservedMargin;
                    for (var Ve in Fe)
                      for (var Be in Fe[Ve]) {
                        var Je = Fe[Ve][Be];
                        xe[Be] = Math.max(xe[Be], Je);
                      }
                    var et = {
                      left: xe.l,
                      top: xe.t,
                      right: te.width - xe.r,
                      bottom: te.height - xe.b
                    }, at = O.maxShift || $ * (et[O.side] - me[O.side]), De = 0;
                    if (at < 0)
                      De = at;
                    else {
                      var Ne = O.offsetLeft || 0, Ie = O.offsetTop || 0;
                      me.left -= Ne, me.right -= Ne, me.top -= Ie, me.bottom -= Ie, O.selection.each(function() {
                        var ot = C.bBox(this);
                        g.bBoxIntersect(me, ot, he) && (De = Math.max(De, $ * (ot[O.side] - me[fe]) + he));
                      }), De = Math.min(at, De), k._titleScoot = Math.abs(De);
                    }
                    if (De > 0 || at < 0) {
                      var Ue = {
                        left: [-De, 0],
                        right: [De, 0],
                        top: [0, -De],
                        bottom: [0, De]
                      }[O.side];
                      V.attr("transform", y(Ue[0], Ue[1]));
                    }
                  }
                }
                Re.call(Ae);
                function oe() {
                  re = 0, z = !0, Re.text(L).on("mouseover.opacity", function() {
                    l.select(this).transition().duration(w.SHOW_PLACEHOLDER).style("opacity", 1);
                  }).on("mouseout.opacity", function() {
                    l.select(this).transition().duration(w.HIDE_PLACEHOLDER).style("opacity", 0);
                  });
                }
                return Me && (W ? Re.on(".opacity", null) : oe(), Re.call(h.makeEditable, {
                  gd: T
                }).on("edit", function(_) {
                  A !== void 0 ? p.call("_guiRestyle", T, I, _, A) : p.call("_guiRelayout", T, I, _);
                }).on("cancel", function() {
                  this.text(this.attr("data-unformatted")).call(Ae);
                }).on("input", function(_) {
                  this.text(_ || " ").call(h.positionText, N.x, N.y);
                })), Re.classed("js-placeholder", z), j;
              }
              s.exports = {
                draw: x
              };
            }
          ),
          /***/
          8444: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(2548), f = i(2880).extendFlat, p = i(7824).overrideAll, g = i(6741), y = i(1780).templatedArray, C = y("button", {
                visible: {
                  valType: "boolean"
                },
                method: {
                  valType: "enumerated",
                  values: ["restyle", "relayout", "animate", "update", "skip"],
                  dflt: "restyle"
                },
                args: {
                  valType: "info_array",
                  freeLength: !0,
                  items: [{
                    valType: "any"
                  }, {
                    valType: "any"
                  }, {
                    valType: "any"
                  }]
                },
                args2: {
                  valType: "info_array",
                  freeLength: !0,
                  items: [{
                    valType: "any"
                  }, {
                    valType: "any"
                  }, {
                    valType: "any"
                  }]
                },
                label: {
                  valType: "string",
                  dflt: ""
                },
                execute: {
                  valType: "boolean",
                  dflt: !0
                }
              });
              s.exports = p(y("updatemenu", {
                _arrayAttrRegexps: [/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],
                visible: {
                  valType: "boolean"
                },
                type: {
                  valType: "enumerated",
                  values: ["dropdown", "buttons"],
                  dflt: "dropdown"
                },
                direction: {
                  valType: "enumerated",
                  values: ["left", "right", "up", "down"],
                  dflt: "down"
                },
                active: {
                  valType: "integer",
                  min: -1,
                  dflt: 0
                },
                showactive: {
                  valType: "boolean",
                  dflt: !0
                },
                buttons: C,
                x: {
                  valType: "number",
                  min: -2,
                  max: 3,
                  dflt: -0.05
                },
                xanchor: {
                  valType: "enumerated",
                  values: ["auto", "left", "center", "right"],
                  dflt: "right"
                },
                y: {
                  valType: "number",
                  min: -2,
                  max: 3,
                  dflt: 1
                },
                yanchor: {
                  valType: "enumerated",
                  values: ["auto", "top", "middle", "bottom"],
                  dflt: "top"
                },
                pad: f(g({
                  editType: "arraydraw"
                }), {}),
                font: l({}),
                bgcolor: {
                  valType: "color"
                },
                bordercolor: {
                  valType: "color",
                  dflt: v.borderLine
                },
                borderwidth: {
                  valType: "number",
                  min: 0,
                  dflt: 1,
                  editType: "arraydraw"
                }
              }), "arraydraw", "from-root");
            }
          ),
          /***/
          1331: (
            /***/
            function(s) {
              s.exports = {
                // layout attribute name
                name: "updatemenus",
                // class names
                containerClassName: "updatemenu-container",
                headerGroupClassName: "updatemenu-header-group",
                headerClassName: "updatemenu-header",
                headerArrowClassName: "updatemenu-header-arrow",
                dropdownButtonGroupClassName: "updatemenu-dropdown-button-group",
                dropdownButtonClassName: "updatemenu-dropdown-button",
                buttonClassName: "updatemenu-button",
                itemRectClassName: "updatemenu-item-rect",
                itemTextClassName: "updatemenu-item-text",
                // DOM attribute name in button group keeping track
                // of active update menu
                menuIndexAttrName: "updatemenu-active-index",
                // id root pass to Plots.autoMargin
                autoMarginIdRoot: "updatemenu-",
                // options when 'active: -1'
                blankHeaderOpts: {
                  label: "  "
                },
                // min item width / height
                minWidth: 30,
                minHeight: 30,
                // padding around item text
                textPadX: 24,
                arrowPadX: 16,
                // item rect radii
                rx: 2,
                ry: 2,
                // item  text x offset off left edge
                textOffsetX: 12,
                // item  text y offset (w.r.t. middle)
                textOffsetY: 3,
                // arrow offset off right edge
                arrowOffsetX: 4,
                // gap between header and buttons
                gapButtonHeader: 5,
                // gap between between buttons
                gapButton: 2,
                // color given to active buttons
                activeColor: "#F4FAFF",
                // color given to hovered buttons
                hoverColor: "#F4FAFF",
                // symbol for menu open arrow
                arrowSymbol: {
                  left: "◄",
                  right: "►",
                  up: "▲",
                  down: "▼"
                }
              };
            }
          ),
          /***/
          1384: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(1272), f = i(8444), p = i(1331), g = p.name, y = f.buttons;
              s.exports = function(w, S) {
                var E = {
                  name: g,
                  handleItemDefaults: C
                };
                v(w, S, E);
              };
              function C(h, w, S) {
                function E(F, P) {
                  return l.coerce(h, w, f, F, P);
                }
                var x = v(h, w, {
                  name: "buttons",
                  handleItemDefaults: m
                }), T = E("visible", x.length > 0);
                T && (E("active"), E("direction"), E("type"), E("showactive"), E("x"), E("y"), l.noneOrAll(h, w, ["x", "y"]), E("xanchor"), E("yanchor"), E("pad.t"), E("pad.r"), E("pad.b"), E("pad.l"), l.coerceFont(E, "font", S.font), E("bgcolor", S.paper_bgcolor), E("bordercolor"), E("borderwidth"));
              }
              function m(h, w) {
                function S(x, T) {
                  return l.coerce(h, w, y, x, T);
                }
                var E = S("visible", h.method === "skip" || Array.isArray(h.args));
                E && (S("method"), S("args"), S("args2"), S("label"), S("execute"));
              }
            }
          ),
          /***/
          4420: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(7316), f = i(6308), p = i(3616), g = i(3400), y = i(2736), C = i(1780).arrayEditor, m = i(4284).LINE_SPACING, h = i(1331), w = i(7400);
              s.exports = function(q) {
                var ie = q._fullLayout, ce = g.filterVisible(ie[h.name]);
                function X(Me) {
                  v.autoMargin(q, re(Me));
                }
                var U = ie._menulayer.selectAll("g." + h.containerClassName).data(ce.length > 0 ? [0] : []);
                if (U.enter().append("g").classed(h.containerClassName, !0).style("cursor", "pointer"), U.exit().each(function() {
                  l.select(this).selectAll("g." + h.headerGroupClassName).each(X);
                }).remove(), ce.length !== 0) {
                  var ne = U.selectAll("g." + h.headerGroupClassName).data(ce, S);
                  ne.enter().append("g").classed(h.headerGroupClassName, !0);
                  for (var se = g.ensureSingle(U, "g", h.dropdownButtonGroupClassName, function(Me) {
                    Me.style("pointer-events", "all");
                  }), le = 0; le < ce.length; le++) {
                    var ue = ce[le];
                    te(q, ue);
                  }
                  var ve = "updatemenus" + ie._uid, be = new w(q, se, ve);
                  ne.enter().size() && (se.node().parentNode.appendChild(se.node()), se.call(Z)), ne.exit().each(function(Me) {
                    se.call(Z), X(Me);
                  }).remove(), ne.each(function(Me) {
                    var Ge = l.select(this), we = Me.type === "dropdown" ? se : null;
                    v.manageCommandObserver(q, Me, Me.buttons, function(Re) {
                      T(q, Me, Me.buttons[Re.index], Ge, we, be, Re.index, !0);
                    }), Me.type === "dropdown" ? (F(q, Ge, se, be, Me), x(se, Me) && P(q, Ge, se, be, Me)) : P(q, Ge, null, null, Me);
                  });
                }
              };
              function S(W) {
                return W._index;
              }
              function E(W) {
                return +W.attr(h.menuIndexAttrName) == -1;
              }
              function x(W, q) {
                return +W.attr(h.menuIndexAttrName) === q._index;
              }
              function T(W, q, ie, ce, X, U, ne, se) {
                q.active = ne, C(W.layout, h.name, q).applyUpdate("active", ne), q.type === "buttons" ? P(W, ce, null, null, q) : q.type === "dropdown" && (X.attr(h.menuIndexAttrName, "-1"), F(W, ce, X, U, q), se || P(W, ce, X, U, q));
              }
              function F(W, q, ie, ce, X) {
                var U = g.ensureSingle(q, "g", h.headerClassName, function(Me) {
                  Me.style("pointer-events", "all");
                }), ne = X._dims, se = X.active, le = X.buttons[se] || h.blankHeaderOpts, ue = {
                  y: X.pad.t,
                  yPad: 0,
                  x: X.pad.l,
                  xPad: 0,
                  index: 0
                }, ve = {
                  width: ne.headerWidth,
                  height: ne.headerHeight
                };
                U.call(L, X, le, W).call(z, X, ue, ve);
                var be = g.ensureSingle(q, "text", h.headerArrowClassName, function(Me) {
                  Me.attr("text-anchor", "end").call(p.font, X.font).text(h.arrowSymbol[X.direction]);
                });
                be.attr({
                  x: ne.headerWidth - h.arrowOffsetX + X.pad.l,
                  y: ne.headerHeight / 2 + h.textOffsetY + X.pad.t
                }), U.on("click", function() {
                  ie.call(Z, String(x(ie, X) ? -1 : X._index)), P(W, q, ie, ce, X);
                }), U.on("mouseover", function() {
                  U.call(Y);
                }), U.on("mouseout", function() {
                  U.call(j, X);
                }), p.setTranslate(q, ne.lx, ne.ly);
              }
              function P(W, q, ie, ce, X) {
                ie || (ie = q, ie.attr("pointer-events", "all"));
                var U = !E(ie) || X.type === "buttons" ? X.buttons : [], ne = X.type === "dropdown" ? h.dropdownButtonClassName : h.buttonClassName, se = ie.selectAll("g." + ne).data(g.filterVisible(U)), le = se.enter().append("g").classed(ne, !0), ue = se.exit();
                X.type === "dropdown" ? (le.attr("opacity", "0").transition().attr("opacity", "1"), ue.transition().attr("opacity", "0").remove()) : ue.remove();
                var ve = 0, be = 0, Me = X._dims, Ge = ["up", "down"].indexOf(X.direction) !== -1;
                X.type === "dropdown" && (Ge ? be = Me.headerHeight + h.gapButtonHeader : ve = Me.headerWidth + h.gapButtonHeader), X.type === "dropdown" && X.direction === "up" && (be = -h.gapButtonHeader + h.gapButton - Me.openHeight), X.type === "dropdown" && X.direction === "left" && (ve = -h.gapButtonHeader + h.gapButton - Me.openWidth);
                var we = {
                  x: Me.lx + ve + X.pad.l,
                  y: Me.ly + be + X.pad.t,
                  yPad: h.gapButton,
                  xPad: h.gapButton,
                  index: 0
                }, Re = {
                  l: we.x + X.borderwidth,
                  t: we.y + X.borderwidth
                };
                se.each(function(Ae, K) {
                  var ee = l.select(this);
                  ee.call(L, X, Ae, W).call(z, X, we), ee.on("click", function() {
                    l.event.defaultPrevented || (Ae.execute && (Ae.args2 && X.active === K ? (T(W, X, Ae, q, ie, ce, -1), v.executeAPICommand(W, Ae.method, Ae.args2)) : (T(W, X, Ae, q, ie, ce, K), v.executeAPICommand(W, Ae.method, Ae.args))), W.emit("plotly_buttonclicked", {
                      menu: X,
                      button: Ae,
                      active: X.active
                    }));
                  }), ee.on("mouseover", function() {
                    ee.call(Y);
                  }), ee.on("mouseout", function() {
                    ee.call(j, X), se.call(N, X);
                  });
                }), se.call(N, X), Ge ? (Re.w = Math.max(Me.openWidth, Me.headerWidth), Re.h = we.y - Re.t) : (Re.w = we.x - Re.l, Re.h = Math.max(Me.openHeight, Me.headerHeight)), Re.direction = X.direction, ce && (se.size() ? k(W, q, ie, ce, X, Re) : I(ce));
              }
              function k(W, q, ie, ce, X, U) {
                var ne = X.direction, se = ne === "up" || ne === "down", le = X._dims, ue = X.active, ve, be, Me;
                if (se)
                  for (be = 0, Me = 0; Me < ue; Me++)
                    be += le.heights[Me] + h.gapButton;
                else
                  for (ve = 0, Me = 0; Me < ue; Me++)
                    ve += le.widths[Me] + h.gapButton;
                ce.enable(U, ve, be), ce.hbar && ce.hbar.attr("opacity", "0").transition().attr("opacity", "1"), ce.vbar && ce.vbar.attr("opacity", "0").transition().attr("opacity", "1");
              }
              function I(W) {
                var q = !!W.hbar, ie = !!W.vbar;
                q && W.hbar.transition().attr("opacity", "0").each("end", function() {
                  q = !1, ie || W.disable();
                }), ie && W.vbar.transition().attr("opacity", "0").each("end", function() {
                  ie = !1, q || W.disable();
                });
              }
              function L(W, q, ie, ce) {
                W.call(A, q).call(O, q, ie, ce);
              }
              function A(W, q) {
                var ie = g.ensureSingle(W, "rect", h.itemRectClassName, function(ce) {
                  ce.attr({
                    rx: h.rx,
                    ry: h.ry,
                    "shape-rendering": "crispEdges"
                  });
                });
                ie.call(f.stroke, q.bordercolor).call(f.fill, q.bgcolor).style("stroke-width", q.borderwidth + "px");
              }
              function O(W, q, ie, ce) {
                var X = g.ensureSingle(W, "text", h.itemTextClassName, function(se) {
                  se.attr({
                    "text-anchor": "start",
                    "data-notex": 1
                  });
                }), U = ie.label, ne = ce._fullLayout._meta;
                ne && (U = g.templateString(U, ne)), X.call(p.font, q.font).text(U).call(y.convertToTspans, ce);
              }
              function N(W, q) {
                var ie = q.active;
                W.each(function(ce, X) {
                  var U = l.select(this);
                  X === ie && q.showactive && U.select("rect." + h.itemRectClassName).call(f.fill, h.activeColor);
                });
              }
              function Y(W) {
                W.select("rect." + h.itemRectClassName).call(f.fill, h.hoverColor);
              }
              function j(W, q) {
                W.select("rect." + h.itemRectClassName).call(f.fill, q.bgcolor);
              }
              function te(W, q) {
                var ie = q._dims = {
                  width1: 0,
                  height1: 0,
                  heights: [],
                  widths: [],
                  totalWidth: 0,
                  totalHeight: 0,
                  openWidth: 0,
                  openHeight: 0,
                  lx: 0,
                  ly: 0
                }, ce = p.tester.selectAll("g." + h.dropdownButtonClassName).data(g.filterVisible(q.buttons));
                ce.enter().append("g").classed(h.dropdownButtonClassName, !0);
                var X = ["up", "down"].indexOf(q.direction) !== -1;
                ce.each(function(ve, be) {
                  var Me = l.select(this);
                  Me.call(L, q, ve, W);
                  var Ge = Me.select("." + h.itemTextClassName), we = Ge.node() && p.bBox(Ge.node()).width, Re = Math.max(we + h.textPadX, h.minWidth), Ae = q.font.size * m, K = y.lineCount(Ge), ee = Math.max(Ae * K, h.minHeight) + h.textOffsetY;
                  ee = Math.ceil(ee), Re = Math.ceil(Re), ie.widths[be] = Re, ie.heights[be] = ee, ie.height1 = Math.max(ie.height1, ee), ie.width1 = Math.max(ie.width1, Re), X ? (ie.totalWidth = Math.max(ie.totalWidth, Re), ie.openWidth = ie.totalWidth, ie.totalHeight += ee + h.gapButton, ie.openHeight += ee + h.gapButton) : (ie.totalWidth += Re + h.gapButton, ie.openWidth += Re + h.gapButton, ie.totalHeight = Math.max(ie.totalHeight, ee), ie.openHeight = ie.totalHeight);
                }), X ? ie.totalHeight -= h.gapButton : ie.totalWidth -= h.gapButton, ie.headerWidth = ie.width1 + h.arrowPadX, ie.headerHeight = ie.height1, q.type === "dropdown" && (X ? (ie.width1 += h.arrowPadX, ie.totalHeight = ie.height1) : ie.totalWidth = ie.width1, ie.totalWidth += h.arrowPadX), ce.remove();
                var U = ie.totalWidth + q.pad.l + q.pad.r, ne = ie.totalHeight + q.pad.t + q.pad.b, se = W._fullLayout._size;
                ie.lx = se.l + se.w * q.x, ie.ly = se.t + se.h * (1 - q.y);
                var le = "left";
                g.isRightAnchor(q) && (ie.lx -= U, le = "right"), g.isCenterAnchor(q) && (ie.lx -= U / 2, le = "center");
                var ue = "top";
                g.isBottomAnchor(q) && (ie.ly -= ne, ue = "bottom"), g.isMiddleAnchor(q) && (ie.ly -= ne / 2, ue = "middle"), ie.totalWidth = Math.ceil(ie.totalWidth), ie.totalHeight = Math.ceil(ie.totalHeight), ie.lx = Math.round(ie.lx), ie.ly = Math.round(ie.ly), v.autoMargin(W, re(q), {
                  x: q.x,
                  y: q.y,
                  l: U * ({
                    right: 1,
                    center: 0.5
                  }[le] || 0),
                  r: U * ({
                    left: 1,
                    center: 0.5
                  }[le] || 0),
                  b: ne * ({
                    top: 1,
                    middle: 0.5
                  }[ue] || 0),
                  t: ne * ({
                    bottom: 1,
                    middle: 0.5
                  }[ue] || 0)
                });
              }
              function re(W) {
                return h.autoMarginIdRoot + W._index;
              }
              function z(W, q, ie, ce) {
                ce = ce || {};
                var X = W.select("." + h.itemRectClassName), U = W.select("." + h.itemTextClassName), ne = q.borderwidth, se = ie.index, le = q._dims;
                p.setTranslate(W, ne + ie.x, ne + ie.y);
                var ue = ["up", "down"].indexOf(q.direction) !== -1, ve = ce.height || (ue ? le.heights[se] : le.height1);
                X.attr({
                  x: 0,
                  y: 0,
                  width: ce.width || (ue ? le.width1 : le.widths[se]),
                  height: ve
                });
                var be = q.font.size * m, Me = y.lineCount(U), Ge = (Me - 1) * be / 2;
                y.positionText(U, h.textOffsetX, ve / 2 - Ge + h.textOffsetY), ue ? ie.y += le.heights[se] + ie.yPad : ie.x += le.widths[se] + ie.xPad, ie.index++;
              }
              function Z(W, q) {
                W.attr(h.menuIndexAttrName, q || "-1").selectAll("g." + h.dropdownButtonClassName).remove();
              }
            }
          ),
          /***/
          6908: (
            /***/
            function(s, c, i) {
              var l = i(1331);
              s.exports = {
                moduleType: "component",
                name: l.name,
                layoutAttributes: i(8444),
                supplyLayoutDefaults: i(1384),
                draw: i(4420)
              };
            }
          ),
          /***/
          7400: (
            /***/
            function(s, c, i) {
              s.exports = g;
              var l = i(3428), v = i(6308), f = i(3616), p = i(3400);
              function g(y, C, m) {
                this.gd = y, this.container = C, this.id = m, this.position = null, this.translateX = null, this.translateY = null, this.hbar = null, this.vbar = null, this.bg = this.container.selectAll("rect.scrollbox-bg").data([0]), this.bg.exit().on(".drag", null).on("wheel", null).remove(), this.bg.enter().append("rect").classed("scrollbox-bg", !0).style("pointer-events", "all").attr({
                  opacity: 0,
                  x: 0,
                  y: 0,
                  width: 0,
                  height: 0
                });
              }
              g.barWidth = 2, g.barLength = 20, g.barRadius = 2, g.barPad = 1, g.barColor = "#808BA4", g.prototype.enable = function(C, m, h) {
                var w = this.gd._fullLayout, S = w.width, E = w.height;
                this.position = C;
                var x = this.position.l, T = this.position.w, F = this.position.t, P = this.position.h, k = this.position.direction, I = k === "down", L = k === "left", A = k === "right", O = k === "up", N = T, Y = P, j, te, re, z;
                !I && !L && !A && !O && (this.position.direction = "down", I = !0);
                var Z = I || O;
                Z ? (j = x, te = j + N, I ? (re = F, z = Math.min(re + Y, E), Y = z - re) : (z = F + Y, re = Math.max(z - Y, 0), Y = z - re)) : (re = F, z = re + Y, L ? (te = x + N, j = Math.max(te - N, 0), N = te - j) : (j = x, te = Math.min(j + N, S), N = te - j)), this._box = {
                  l: j,
                  t: re,
                  w: N,
                  h: Y
                };
                var W = T > N, q = g.barLength + 2 * g.barPad, ie = g.barWidth + 2 * g.barPad, ce = x, X = F + P;
                X + ie > E && (X = E - ie);
                var U = this.container.selectAll("rect.scrollbar-horizontal").data(W ? [0] : []);
                U.exit().on(".drag", null).remove(), U.enter().append("rect").classed("scrollbar-horizontal", !0).call(v.fill, g.barColor), W ? (this.hbar = U.attr({
                  rx: g.barRadius,
                  ry: g.barRadius,
                  x: ce,
                  y: X,
                  width: q,
                  height: ie
                }), this._hbarXMin = ce + q / 2, this._hbarTranslateMax = N - q) : (delete this.hbar, delete this._hbarXMin, delete this._hbarTranslateMax);
                var ne = P > Y, se = g.barWidth + 2 * g.barPad, le = g.barLength + 2 * g.barPad, ue = x + T, ve = F;
                ue + se > S && (ue = S - se);
                var be = this.container.selectAll("rect.scrollbar-vertical").data(ne ? [0] : []);
                be.exit().on(".drag", null).remove(), be.enter().append("rect").classed("scrollbar-vertical", !0).call(v.fill, g.barColor), ne ? (this.vbar = be.attr({
                  rx: g.barRadius,
                  ry: g.barRadius,
                  x: ue,
                  y: ve,
                  width: se,
                  height: le
                }), this._vbarYMin = ve + le / 2, this._vbarTranslateMax = Y - le) : (delete this.vbar, delete this._vbarYMin, delete this._vbarTranslateMax);
                var Me = this.id, Ge = j - 0.5, we = ne ? te + se + 0.5 : te + 0.5, Re = re - 0.5, Ae = W ? z + ie + 0.5 : z + 0.5, K = w._topdefs.selectAll("#" + Me).data(W || ne ? [0] : []);
                if (K.exit().remove(), K.enter().append("clipPath").attr("id", Me).append("rect"), W || ne ? (this._clipRect = K.select("rect").attr({
                  x: Math.floor(Ge),
                  y: Math.floor(Re),
                  width: Math.ceil(we) - Math.floor(Ge),
                  height: Math.ceil(Ae) - Math.floor(Re)
                }), this.container.call(f.setClipUrl, Me, this.gd), this.bg.attr({
                  x,
                  y: F,
                  width: T,
                  height: P
                })) : (this.bg.attr({
                  width: 0,
                  height: 0
                }), this.container.on("wheel", null).on(".drag", null).call(f.setClipUrl, null), delete this._clipRect), W || ne) {
                  var ee = l.behavior.drag().on("dragstart", function() {
                    l.event.sourceEvent.preventDefault();
                  }).on("drag", this._onBoxDrag.bind(this));
                  this.container.on("wheel", null).on("wheel", this._onBoxWheel.bind(this)).on(".drag", null).call(ee);
                  var oe = l.behavior.drag().on("dragstart", function() {
                    l.event.sourceEvent.preventDefault(), l.event.sourceEvent.stopPropagation();
                  }).on("drag", this._onBarDrag.bind(this));
                  W && this.hbar.on(".drag", null).call(oe), ne && this.vbar.on(".drag", null).call(oe);
                }
                this.setTranslate(m, h);
              }, g.prototype.disable = function() {
                (this.hbar || this.vbar) && (this.bg.attr({
                  width: 0,
                  height: 0
                }), this.container.on("wheel", null).on(".drag", null).call(f.setClipUrl, null), delete this._clipRect), this.hbar && (this.hbar.on(".drag", null), this.hbar.remove(), delete this.hbar, delete this._hbarXMin, delete this._hbarTranslateMax), this.vbar && (this.vbar.on(".drag", null), this.vbar.remove(), delete this.vbar, delete this._vbarYMin, delete this._vbarTranslateMax);
              }, g.prototype._onBoxDrag = function() {
                var C = this.translateX, m = this.translateY;
                this.hbar && (C -= l.event.dx), this.vbar && (m -= l.event.dy), this.setTranslate(C, m);
              }, g.prototype._onBoxWheel = function() {
                var C = this.translateX, m = this.translateY;
                this.hbar && (C += l.event.deltaY), this.vbar && (m += l.event.deltaY), this.setTranslate(C, m);
              }, g.prototype._onBarDrag = function() {
                var C = this.translateX, m = this.translateY;
                if (this.hbar) {
                  var h = C + this._hbarXMin, w = h + this._hbarTranslateMax, S = p.constrain(l.event.x, h, w), E = (S - h) / (w - h), x = this.position.w - this._box.w;
                  C = E * x;
                }
                if (this.vbar) {
                  var T = m + this._vbarYMin, F = T + this._vbarTranslateMax, P = p.constrain(l.event.y, T, F), k = (P - T) / (F - T), I = this.position.h - this._box.h;
                  m = k * I;
                }
                this.setTranslate(C, m);
              }, g.prototype.setTranslate = function(C, m) {
                var h = this.position.w - this._box.w, w = this.position.h - this._box.h;
                if (C = p.constrain(C || 0, 0, h), m = p.constrain(m || 0, 0, w), this.translateX = C, this.translateY = m, this.container.call(f.setTranslate, this._box.l - this.position.l - C, this._box.t - this.position.t - m), this._clipRect && this._clipRect.attr({
                  x: Math.floor(this.position.l + C - 0.5),
                  y: Math.floor(this.position.t + m - 0.5)
                }), this.hbar) {
                  var S = C / h;
                  this.hbar.call(f.setTranslate, C + S * this._hbarTranslateMax, m);
                }
                if (this.vbar) {
                  var E = m / w;
                  this.vbar.call(f.setTranslate, C, m + E * this._vbarTranslateMax);
                }
              };
            }
          ),
          /***/
          4284: (
            /***/
            function(s) {
              s.exports = {
                // from bottom left: this is the origin of our paper-reference
                // positioning system
                FROM_BL: {
                  left: 0,
                  center: 0.5,
                  right: 1,
                  bottom: 0,
                  middle: 0.5,
                  top: 1
                },
                // from top left: this is the screen pixel positioning origin
                FROM_TL: {
                  left: 0,
                  center: 0.5,
                  right: 1,
                  bottom: 1,
                  middle: 0.5,
                  top: 0
                },
                // from bottom right: sometimes you just need the opposite of ^^
                FROM_BR: {
                  left: 1,
                  center: 0.5,
                  right: 0,
                  bottom: 0,
                  middle: 0.5,
                  top: 1
                },
                // multiple of fontSize to get the vertical offset between lines
                LINE_SPACING: 1.3,
                // multiple of fontSize to shift from the baseline
                // to the cap (captical letter) line
                // (to use when we don't calculate this shift from Drawing.bBox)
                // This is an approximation since in reality cap height can differ
                // from font to font. However, according to Wikipedia
                //   an "average" font might have a cap height of 70% of the em
                // https://en.wikipedia.org/wiki/Em_(typography)#History
                CAP_SHIFT: 0.7,
                // half the cap height (distance between baseline and cap line)
                // of an "average" font (for more info see above).
                MID_SHIFT: 0.35,
                OPPOSITE_SIDE: {
                  left: "right",
                  right: "left",
                  top: "bottom",
                  bottom: "top"
                }
              };
            }
          ),
          /***/
          6208: (
            /***/
            function(s) {
              s.exports = {
                axisRefDescription: function(c, i, l) {
                  return ["If set to a", c, "axis id (e.g. *" + c + "* or", "*" + c + "2*), the `" + c + "` position refers to a", c, "coordinate. If set to *paper*, the `" + c + "`", "position refers to the distance from the", i, "of the plotting", "area in normalized coordinates where *0* (*1*) corresponds to the", i, "(" + l + "). If set to a", c, "axis ID followed by", "*domain* (separated by a space), the position behaves like for", "*paper*, but refers to the distance in fractions of the domain", "length from the", i, "of the domain of that axis: e.g.,", "*" + c + "2 domain* refers to the domain of the second", c, " axis and a", c, "position of 0.5 refers to the", "point between the", i, "and the", l, "of the domain of the", "second", c, "axis."].join(" ");
                }
              };
            }
          ),
          /***/
          6880: (
            /***/
            function(s) {
              s.exports = {
                FORMAT_LINK: "https://github.com/d3/d3-format/tree/v1.4.5#d3-format",
                DATE_FORMAT_LINK: "https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"
              };
            }
          ),
          /***/
          9104: (
            /***/
            function(s) {
              s.exports = {
                COMPARISON_OPS: ["=", "!=", "<", ">=", ">", "<="],
                COMPARISON_OPS2: ["=", "<", ">=", ">", "<="],
                INTERVAL_OPS: ["[]", "()", "[)", "(]", "][", ")(", "](", ")["],
                SET_OPS: ["{}", "}{"],
                CONSTRAINT_REDUCTION: {
                  // for contour constraints, open/closed endpoints are equivalent
                  "=": "=",
                  "<": "<",
                  "<=": "<",
                  ">": ">",
                  ">=": ">",
                  "[]": "[]",
                  "()": "[]",
                  "[)": "[]",
                  "(]": "[]",
                  "][": "][",
                  ")(": "][",
                  "](": "][",
                  ")[": "]["
                }
              };
            }
          ),
          /***/
          3448: (
            /***/
            function(s) {
              s.exports = {
                /**
                 * Timing information for interactive elements
                 */
                SHOW_PLACEHOLDER: 100,
                HIDE_PLACEHOLDER: 1e3,
                // opacity dimming fraction for points that are not in selection
                DESELECTDIM: 0.2
              };
            }
          ),
          /***/
          9032: (
            /***/
            function(s) {
              s.exports = {
                /**
                 * Standardize all missing data in calcdata to use undefined
                 * never null or NaN.
                 * That way we can use !==undefined, or !== BADNUM,
                 * to test for real data
                 */
                BADNUM: void 0,
                /*
                 * Limit certain operations to well below floating point max value
                 * to avoid glitches: Make sure that even when you multiply it by the
                 * number of pixels on a giant screen it still works
                 */
                FP_SAFE: Number.MAX_VALUE * 1e-4,
                /*
                 * conversion of date units to milliseconds
                 * year and month constants are marked "AVG"
                 * to remind us that not all years and months
                 * have the same length
                 */
                ONEMAXYEAR: 316224e5,
                // 366 * ONEDAY
                ONEAVGYEAR: 315576e5,
                // 365.25 days
                ONEMINYEAR: 31536e6,
                // 365 * ONEDAY
                ONEMAXQUARTER: 79488e5,
                // 92 * ONEDAY
                ONEAVGQUARTER: 78894e5,
                // 1/4 of ONEAVGYEAR
                ONEMINQUARTER: 76896e5,
                // 89 * ONEDAY
                ONEMAXMONTH: 26784e5,
                // 31 * ONEDAY
                ONEAVGMONTH: 26298e5,
                // 1/12 of ONEAVGYEAR
                ONEMINMONTH: 24192e5,
                // 28 * ONEDAY
                ONEWEEK: 6048e5,
                // 7 * ONEDAY
                ONEDAY: 864e5,
                // 24 * ONEHOUR
                ONEHOUR: 36e5,
                ONEMIN: 6e4,
                ONESEC: 1e3,
                /*
                 * For fast conversion btwn world calendars and epoch ms, the Julian Day Number
                 * of the unix epoch. From calendars.instance().newDate(1970, 1, 1).toJD()
                 */
                EPOCHJD: 24405875e-1,
                /*
                 * Are two values nearly equal? Compare to 1PPM
                 */
                ALMOST_EQUAL: 0.999999,
                /*
                 * If we're asked to clip a non-positive log value, how far off-screen
                 * do we put it?
                 */
                LOG_CLIP: 10,
                /*
                 * not a number, but for displaying numbers: the "minus sign" symbol is
                 * wider than the regular ascii dash "-"
                 */
                MINUS_SIGN: "−"
              };
            }
          ),
          /***/
          9616: (
            /***/
            function(s, c) {
              c.xmlns = "http://www.w3.org/2000/xmlns/", c.svg = "http://www.w3.org/2000/svg", c.xlink = "http://www.w3.org/1999/xlink", c.svgAttrs = {
                xmlns: c.svg,
                "xmlns:xlink": c.xlink
              };
            }
          ),
          /***/
          4884: (
            /***/
            function(s, c, i) {
              c.version = i(5788).version, i(8324), i(9288);
              for (var l = i(4040), v = c.register = l.register, f = i(2448), p = Object.keys(f), g = 0; g < p.length; g++) {
                var y = p[g];
                y.charAt(0) !== "_" && (c[y] = f[y]), v({
                  moduleType: "apiMethod",
                  name: y,
                  fn: f[y]
                });
              }
              v(i(5875)), v([
                i(9180),
                i(6864),
                i(2676),
                i(1592),
                i(7402),
                i(6908),
                i(7544),
                i(9692),
                i(1152),
                i(2704),
                i(4968),
                i(8932),
                i(5080),
                i(2780),
                // legend needs to come after shape | legend defaults depends on shapes
                i(3024),
                // fx needs to come after legend | unified hover defaults depends on legends
                i(3080)
              ]), v([i(6580), i(1680)]), window.PlotlyLocales && Array.isArray(window.PlotlyLocales) && (v(window.PlotlyLocales), delete window.PlotlyLocales), c.Icons = i(9224);
              var C = i(3024), m = i(7316);
              c.Plots = {
                resize: m.resize,
                graphJson: m.graphJson,
                sendDataToCloud: m.sendDataToCloud
              }, c.Fx = {
                hover: C.hover,
                unhover: C.unhover,
                loneHover: C.loneHover,
                loneUnhover: C.loneUnhover
              }, c.Snapshot = i(8904), c.PlotSchema = i(3060);
            }
          ),
          /***/
          9224: (
            /***/
            function(s) {
              s.exports = {
                undo: {
                  width: 857.1,
                  height: 1e3,
                  path: "m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                home: {
                  width: 928.6,
                  height: 1e3,
                  path: "m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                "camera-retro": {
                  width: 1e3,
                  height: 1e3,
                  path: "m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                zoombox: {
                  width: 1e3,
                  height: 1e3,
                  path: "m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                pan: {
                  width: 1e3,
                  height: 1e3,
                  path: "m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                zoom_plus: {
                  width: 875,
                  height: 1e3,
                  path: "m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                zoom_minus: {
                  width: 875,
                  height: 1e3,
                  path: "m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                autoscale: {
                  width: 1e3,
                  height: 1e3,
                  path: "m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                tooltip_basic: {
                  width: 1500,
                  height: 1e3,
                  path: "m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                tooltip_compare: {
                  width: 1125,
                  height: 1e3,
                  path: "m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                plotlylogo: {
                  width: 1542,
                  height: 1e3,
                  path: "m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                "z-axis": {
                  width: 1e3,
                  height: 1e3,
                  path: "m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                "3d_rotate": {
                  width: 1e3,
                  height: 1e3,
                  path: "m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                camera: {
                  width: 1e3,
                  height: 1e3,
                  path: "m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                movie: {
                  width: 1e3,
                  height: 1e3,
                  path: "m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                question: {
                  width: 857.1,
                  height: 1e3,
                  path: "m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                disk: {
                  width: 857.1,
                  height: 1e3,
                  path: "m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                drawopenpath: {
                  width: 70,
                  height: 70,
                  path: "M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",
                  transform: "matrix(1 0 0 1 -15 -15)"
                },
                drawclosedpath: {
                  width: 90,
                  height: 90,
                  path: "M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",
                  transform: "matrix(1 0 0 1 -5 -5)"
                },
                lasso: {
                  width: 1031,
                  height: 1e3,
                  path: "m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                selectbox: {
                  width: 1e3,
                  height: 1e3,
                  path: "m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",
                  transform: "matrix(1 0 0 -1 0 850)"
                },
                drawline: {
                  width: 70,
                  height: 70,
                  path: "M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",
                  transform: "matrix(1 0 0 1 -15 -15)"
                },
                drawrect: {
                  width: 80,
                  height: 80,
                  path: "M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",
                  transform: "matrix(1 0 0 1 -10 -10)"
                },
                drawcircle: {
                  width: 80,
                  height: 80,
                  path: "M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",
                  transform: "matrix(1 0 0 1 -10 -10)"
                },
                eraseshape: {
                  width: 80,
                  height: 80,
                  path: "M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",
                  transform: "matrix(1 0 0 1 -10 -10)"
                },
                spikeline: {
                  width: 1e3,
                  height: 1e3,
                  path: "M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",
                  transform: "matrix(1.5 0 0 -1.5 0 850)"
                },
                pencil: {
                  width: 1792,
                  height: 1792,
                  path: "M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",
                  transform: "matrix(1 0 0 1 0 1)"
                },
                newplotlylogo: {
                  name: "newplotlylogo",
                  svg: ["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>", "<defs>", " <style>", "  .cls-0{fill:#000;}", "  .cls-1{fill:#FFF;}", "  .cls-2{fill:#F26;}", "  .cls-3{fill:#D69;}", "  .cls-4{fill:#BAC;}", "  .cls-5{fill:#9EF;}", " </style>", "</defs>", " <title>plotly-logomark</title>", " <g id='symbol'>", "  <rect class='cls-0' x='0' y='0' width='132' height='132' rx='18' ry='18'/>", "  <circle class='cls-5' cx='102' cy='30' r='6'/>", "  <circle class='cls-4' cx='78' cy='30' r='6'/>", "  <circle class='cls-4' cx='78' cy='54' r='6'/>", "  <circle class='cls-3' cx='54' cy='30' r='6'/>", "  <circle class='cls-2' cx='30' cy='30' r='6'/>", "  <circle class='cls-2' cx='30' cy='54' r='6'/>", "  <path class='cls-1' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>", "  <path class='cls-1' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>", "  <path class='cls-1' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>", "  <path class='cls-1' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>", " </g>", "</svg>"].join("")
                }
              };
            }
          ),
          /***/
          8308: (
            /***/
            function(s, c) {
              c.isLeftAnchor = function(l) {
                return l.xanchor === "left" || l.xanchor === "auto" && l.x <= 0.3333333333333333;
              }, c.isCenterAnchor = function(l) {
                return l.xanchor === "center" || l.xanchor === "auto" && l.x > 0.3333333333333333 && l.x < 0.6666666666666666;
              }, c.isRightAnchor = function(l) {
                return l.xanchor === "right" || l.xanchor === "auto" && l.x >= 0.6666666666666666;
              }, c.isTopAnchor = function(l) {
                return l.yanchor === "top" || l.yanchor === "auto" && l.y >= 0.6666666666666666;
              }, c.isMiddleAnchor = function(l) {
                return l.yanchor === "middle" || l.yanchor === "auto" && l.y > 0.3333333333333333 && l.y < 0.6666666666666666;
              }, c.isBottomAnchor = function(l) {
                return l.yanchor === "bottom" || l.yanchor === "auto" && l.y <= 0.3333333333333333;
              };
            }
          ),
          /***/
          1864: (
            /***/
            function(s, c, i) {
              var l = i(435), v = l.mod, f = l.modHalf, p = Math.PI, g = 2 * p;
              function y(k) {
                return k / 180 * p;
              }
              function C(k) {
                return k / p * 180;
              }
              function m(k) {
                return Math.abs(k[1] - k[0]) > g - 1e-14;
              }
              function h(k, I) {
                return f(I - k, g);
              }
              function w(k, I) {
                return Math.abs(h(k, I));
              }
              function S(k, I) {
                if (m(I)) return !0;
                var L, A;
                I[0] < I[1] ? (L = I[0], A = I[1]) : (L = I[1], A = I[0]), L = v(L, g), A = v(A, g), L > A && (A += g);
                var O = v(k, g), N = O + g;
                return O >= L && O <= A || N >= L && N <= A;
              }
              function E(k, I, L, A) {
                if (!S(I, A)) return !1;
                var O, N;
                return L[0] < L[1] ? (O = L[0], N = L[1]) : (O = L[1], N = L[0]), k >= O && k <= N;
              }
              function x(k, I, L, A, O, N, Y) {
                O = O || 0, N = N || 0;
                var j = m([L, A]), te, re, z, Z, W;
                j ? (te = 0, re = p, z = g) : L < A ? (te = L, z = A) : (te = A, z = L), k < I ? (Z = k, W = I) : (Z = I, W = k);
                function q(U, ne) {
                  return [U * Math.cos(ne) + O, N - U * Math.sin(ne)];
                }
                var ie = Math.abs(z - te) <= p ? 0 : 1;
                function ce(U, ne, se) {
                  return "A" + [U, U] + " " + [0, ie, se] + " " + q(U, ne);
                }
                var X;
                return j ? Z === null ? X = "M" + q(W, te) + ce(W, re, 0) + ce(W, z, 0) + "Z" : X = "M" + q(Z, te) + ce(Z, re, 0) + ce(Z, z, 0) + "ZM" + q(W, te) + ce(W, re, 1) + ce(W, z, 1) + "Z" : Z === null ? (X = "M" + q(W, te) + ce(W, z, 0), Y && (X += "L0,0Z")) : X = "M" + q(Z, te) + "L" + q(W, te) + ce(W, z, 0) + "L" + q(Z, z) + ce(Z, te, 1) + "Z", X;
              }
              function T(k, I, L, A, O) {
                return x(null, k, I, L, A, O, 0);
              }
              function F(k, I, L, A, O) {
                return x(null, k, I, L, A, O, 1);
              }
              function P(k, I, L, A, O, N) {
                return x(k, I, L, A, O, N, 1);
              }
              s.exports = {
                deg2rad: y,
                rad2deg: C,
                angleDelta: h,
                angleDist: w,
                isFullCircle: m,
                isAngleInsideSector: S,
                isPtInsideSector: E,
                pathArc: T,
                pathSector: F,
                pathAnnulus: P
              };
            }
          ),
          /***/
          8116: (
            /***/
            function(s, c, i) {
              var l = i(3160).decode, v = i(3620), f = Array.isArray, p = ArrayBuffer, g = DataView;
              function y(x) {
                return p.isView(x) && !(x instanceof g);
              }
              c.isTypedArray = y;
              function C(x) {
                return f(x) || y(x);
              }
              c.isArrayOrTypedArray = C;
              function m(x) {
                return !C(x[0]);
              }
              c.isArray1D = m, c.ensureArray = function(x, T) {
                return f(x) || (x = []), x.length = T, x;
              };
              var h = {
                u1c: typeof Uint8ClampedArray > "u" ? void 0 : Uint8ClampedArray,
                // not supported in numpy?
                i1: typeof Int8Array > "u" ? void 0 : Int8Array,
                u1: typeof Uint8Array > "u" ? void 0 : Uint8Array,
                i2: typeof Int16Array > "u" ? void 0 : Int16Array,
                u2: typeof Uint16Array > "u" ? void 0 : Uint16Array,
                i4: typeof Int32Array > "u" ? void 0 : Int32Array,
                u4: typeof Uint32Array > "u" ? void 0 : Uint32Array,
                f4: typeof Float32Array > "u" ? void 0 : Float32Array,
                f8: typeof Float64Array > "u" ? void 0 : Float64Array
                /* TODO: potentially add Big Int
                 i8: typeof BigInt64Array === 'undefined' ? undefined :
                           BigInt64Array,
                 u8: typeof BigUint64Array === 'undefined' ? undefined :
                           BigUint64Array,
                */
              };
              h.uint8c = h.u1c, h.uint8 = h.u1, h.int8 = h.i1, h.uint16 = h.u2, h.int16 = h.i2, h.uint32 = h.u4, h.int32 = h.i4, h.float32 = h.f4, h.float64 = h.f8;
              function w(x) {
                return x.constructor === ArrayBuffer;
              }
              c.isArrayBuffer = w, c.decodeTypedArraySpec = function(x) {
                var T = [], F = S(x), P = F.dtype, k = h[P];
                if (!k) throw new Error('Error in dtype: "' + P + '"');
                var I = k.BYTES_PER_ELEMENT, L = F.bdata;
                w(L) || (L = l(L));
                var A = F.shape === void 0 ? (
                  // detect 1-d length
                  [L.byteLength / I]
                ) : (
                  // convert number to string and split to array
                  ("" + F.shape).split(",")
                );
                A.reverse();
                var O = A.length, N, Y, j = +A[0], te = I * j, re = 0;
                if (O === 1)
                  T = new k(L);
                else if (O === 2)
                  for (N = +A[1], Y = 0; Y < N; Y++)
                    T[Y] = new k(L, re, j), re += te;
                else if (O === 3) {
                  N = +A[1];
                  for (var z = +A[2], Z = 0; Z < z; Z++)
                    for (T[Z] = [], Y = 0; Y < N; Y++)
                      T[Z][Y] = new k(L, re, j), re += te;
                } else
                  throw new Error("ndim: " + O + 'is not supported with the shape:"' + F.shape + '"');
                return T.bdata = F.bdata, T.dtype = F.dtype, T.shape = A.reverse().join(","), x._inputArray = T, T;
              }, c.isTypedArraySpec = function(x) {
                return v(x) && x.hasOwnProperty("dtype") && typeof x.dtype == "string" && x.hasOwnProperty("bdata") && (typeof x.bdata == "string" || w(x.bdata)) && (x.shape === void 0 || x.hasOwnProperty("shape") && (typeof x.shape == "string" || typeof x.shape == "number"));
              };
              function S(x) {
                return {
                  bdata: x.bdata,
                  dtype: x.dtype,
                  shape: x.shape
                };
              }
              c.concat = function() {
                var x = [], T = !0, F = 0, P, k, I, L, A, O, N, Y;
                for (I = 0; I < arguments.length; I++)
                  L = arguments[I], O = L.length, O && (k ? x.push(L) : (k = L, A = O), f(L) ? P = !1 : (T = !1, F ? P !== L.constructor && (P = !1) : P = L.constructor), F += O);
                if (!F) return [];
                if (!x.length) return k;
                if (T) return k.concat.apply(k, x);
                if (P) {
                  for (N = new P(F), N.set(k), I = 0; I < x.length; I++)
                    L = x[I], N.set(L, A), A += L.length;
                  return N;
                }
                for (N = new Array(F), Y = 0; Y < k.length; Y++) N[Y] = k[Y];
                for (I = 0; I < x.length; I++) {
                  for (L = x[I], Y = 0; Y < L.length; Y++) N[A + Y] = L[Y];
                  A += Y;
                }
                return N;
              }, c.maxRowLength = function(x) {
                return E(x, Math.max, 0);
              }, c.minRowLength = function(x) {
                return E(x, Math.min, 1 / 0);
              };
              function E(x, T, F) {
                if (C(x))
                  if (C(x[0])) {
                    for (var P = F, k = 0; k < x.length; k++)
                      P = T(P, x[k].length);
                    return P;
                  } else
                    return x.length;
                return 0;
              }
            }
          ),
          /***/
          4037: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(9032).BADNUM, f = /^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;
              s.exports = function(g) {
                return typeof g == "string" && (g = g.replace(f, "")), l(g) ? Number(g) : v;
              };
            }
          ),
          /***/
          3696: (
            /***/
            function(s) {
              s.exports = function(i) {
                var l = i._fullLayout;
                l._glcanvas && l._glcanvas.size() && l._glcanvas.each(function(v) {
                  v.regl && v.regl.clear({
                    color: !0,
                    depth: !0
                  });
                });
              };
            }
          ),
          /***/
          5352: (
            /***/
            function(s) {
              s.exports = function(i) {
                i._responsiveChartHandler && (window.removeEventListener("resize", i._responsiveChartHandler), delete i._responsiveChartHandler);
              };
            }
          ),
          /***/
          3064: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(9760), f = i(2880).extendFlat, p = i(5464), g = i(8304), y = i(6308), C = i(3448).DESELECTDIM, m = i(2296), h = i(3756).counter, w = i(435).modHalf, S = i(8116).isArrayOrTypedArray, E = i(8116).isTypedArraySpec, x = i(8116).decodeTypedArraySpec;
              c.valObjectMeta = {
                data_array: {
                  // You can use *dflt=[] to force said array to exist though.
                  coerceFunction: function(F, P, k) {
                    P.set(S(F) ? F : E(F) ? x(F) : k);
                  }
                },
                enumerated: {
                  coerceFunction: function(F, P, k, I) {
                    I.coerceNumber && (F = +F), I.values.indexOf(F) === -1 ? P.set(k) : P.set(F);
                  },
                  validateFunction: function(F, P) {
                    P.coerceNumber && (F = +F);
                    for (var k = P.values, I = 0; I < k.length; I++) {
                      var L = String(k[I]);
                      if (L.charAt(0) === "/" && L.charAt(L.length - 1) === "/") {
                        var A = new RegExp(L.substr(1, L.length - 2));
                        if (A.test(F)) return !0;
                      } else if (F === k[I]) return !0;
                    }
                    return !1;
                  }
                },
                boolean: {
                  coerceFunction: function(F, P, k) {
                    F === !0 || F === !1 ? P.set(F) : P.set(k);
                  }
                },
                number: {
                  coerceFunction: function(F, P, k, I) {
                    E(F) && (F = x(F)), !l(F) || I.min !== void 0 && F < I.min || I.max !== void 0 && F > I.max ? P.set(k) : P.set(+F);
                  }
                },
                integer: {
                  coerceFunction: function(F, P, k, I) {
                    if ((I.extras || []).indexOf(F) !== -1) {
                      P.set(F);
                      return;
                    }
                    E(F) && (F = x(F)), F % 1 || !l(F) || I.min !== void 0 && F < I.min || I.max !== void 0 && F > I.max ? P.set(k) : P.set(+F);
                  }
                },
                string: {
                  // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter)
                  coerceFunction: function(F, P, k, I) {
                    if (typeof F != "string") {
                      var L = typeof F == "number";
                      I.strict === !0 || !L ? P.set(k) : P.set(String(F));
                    } else I.noBlank && !F ? P.set(k) : P.set(F);
                  }
                },
                color: {
                  coerceFunction: function(F, P, k) {
                    E(F) && (F = x(F)), v(F).isValid() ? P.set(F) : P.set(k);
                  }
                },
                colorlist: {
                  coerceFunction: function(F, P, k) {
                    function I(L) {
                      return v(L).isValid();
                    }
                    !Array.isArray(F) || !F.length ? P.set(k) : F.every(I) ? P.set(F) : P.set(k);
                  }
                },
                colorscale: {
                  coerceFunction: function(F, P, k) {
                    P.set(g.get(F, k));
                  }
                },
                angle: {
                  coerceFunction: function(F, P, k) {
                    E(F) && (F = x(F)), F === "auto" ? P.set("auto") : l(F) ? P.set(w(+F, 360)) : P.set(k);
                  }
                },
                subplotid: {
                  coerceFunction: function(F, P, k, I) {
                    var L = I.regex || h(k);
                    if (typeof F == "string" && L.test(F)) {
                      P.set(F);
                      return;
                    }
                    P.set(k);
                  },
                  validateFunction: function(F, P) {
                    var k = P.dflt;
                    return F === k ? !0 : typeof F != "string" ? !1 : !!h(k).test(F);
                  }
                },
                flaglist: {
                  coerceFunction: function(F, P, k, I) {
                    if ((I.extras || []).indexOf(F) !== -1) {
                      P.set(F);
                      return;
                    }
                    if (typeof F != "string") {
                      P.set(k);
                      return;
                    }
                    for (var L = F.split("+"), A = 0; A < L.length; ) {
                      var O = L[A];
                      I.flags.indexOf(O) === -1 || L.indexOf(O) < A ? L.splice(A, 1) : A++;
                    }
                    L.length ? P.set(L.join("+")) : P.set(k);
                  }
                },
                any: {
                  coerceFunction: function(F, P, k) {
                    F === void 0 ? P.set(k) : P.set(E(F) ? x(F) : F);
                  }
                },
                info_array: {
                  // set `dimensions=2` for a 2D array or '1-2' for either
                  // `items` may be a single object instead of an array, in which case
                  // `freeLength` must be true.
                  // if `dimensions='1-2'` and items is a 1D array, then the value can
                  // either be a matching 1D array or an array of such matching 1D arrays
                  coerceFunction: function(F, P, k, I) {
                    function L(X, U, ne) {
                      var se, le = {
                        set: function(ue) {
                          se = ue;
                        }
                      };
                      return ne === void 0 && (ne = U.dflt), c.valObjectMeta[U.valType].coerceFunction(X, le, ne, U), se;
                    }
                    if (E(F) && (F = x(F)), !S(F)) {
                      P.set(k);
                      return;
                    }
                    var A = I.dimensions === 2 || I.dimensions === "1-2" && Array.isArray(F) && S(F[0]), O = I.items, N = [], Y = Array.isArray(O), j = Y && A && S(O[0]), te = A && Y && !j, re = Y && !te ? O.length : F.length, z, Z, W, q, ie, ce;
                    if (k = Array.isArray(k) ? k : [], A)
                      for (z = 0; z < re; z++)
                        for (N[z] = [], W = S(F[z]) ? F[z] : [], te ? ie = O.length : Y ? ie = O[z].length : ie = W.length, Z = 0; Z < ie; Z++)
                          te ? q = O[Z] : Y ? q = O[z][Z] : q = O, ce = L(W[Z], q, (k[z] || [])[Z]), ce !== void 0 && (N[z][Z] = ce);
                    else
                      for (z = 0; z < re; z++)
                        ce = L(F[z], Y ? O[z] : O, k[z]), ce !== void 0 && (N[z] = ce);
                    P.set(N);
                  },
                  validateFunction: function(F, P) {
                    if (!S(F)) return !1;
                    var k = P.items, I = Array.isArray(k), L = P.dimensions === 2;
                    if (!P.freeLength && F.length !== k.length) return !1;
                    for (var A = 0; A < F.length; A++)
                      if (L) {
                        if (!S(F[A]) || !P.freeLength && F[A].length !== k[A].length)
                          return !1;
                        for (var O = 0; O < F[A].length; O++)
                          if (!T(F[A][O], I ? k[A][O] : k))
                            return !1;
                      } else if (!T(F[A], I ? k[A] : k)) return !1;
                    return !0;
                  }
                }
              }, c.coerce = function(F, P, k, I, L) {
                var A = m(k, I).get(), O = m(F, I), N = m(P, I), Y = O.get(), j = P._template;
                if (Y === void 0 && j && (Y = m(j, I).get(), j = 0), L === void 0 && (L = A.dflt), A.arrayOk) {
                  if (S(Y))
                    return N.set(Y), Y;
                  if (E(Y))
                    return Y = x(Y), N.set(Y), Y;
                }
                var te = c.valObjectMeta[A.valType].coerceFunction;
                te(Y, N, L, A);
                var re = N.get();
                return j && re === L && !T(Y, A) && (Y = m(j, I).get(), te(Y, N, L, A), re = N.get()), re;
              }, c.coerce2 = function(F, P, k, I, L) {
                var A = m(F, I), O = c.coerce(F, P, k, I, L), N = A.get();
                return N != null ? O : !1;
              }, c.coerceFont = function(F, P, k, I) {
                I || (I = {}), k = f({}, k), k = f(k, I.overrideDflt || {});
                var L = {
                  family: F(P + ".family", k.family),
                  size: F(P + ".size", k.size),
                  color: F(P + ".color", k.color),
                  weight: F(P + ".weight", k.weight),
                  style: F(P + ".style", k.style)
                };
                if (I.noFontVariant || (L.variant = F(P + ".variant", k.variant)), I.noFontLineposition || (L.lineposition = F(P + ".lineposition", k.lineposition)), I.noFontTextcase || (L.textcase = F(P + ".textcase", k.textcase)), !I.noFontShadow) {
                  var A = k.shadow;
                  A === "none" && I.autoShadowDflt && (A = "auto"), L.shadow = F(P + ".shadow", A);
                }
                return L;
              }, c.coercePattern = function(F, P, k, I) {
                var L = F(P + ".shape");
                if (L) {
                  F(P + ".solidity"), F(P + ".size");
                  var A = F(P + ".fillmode"), O = A === "overlay";
                  if (!I) {
                    var N = F(P + ".bgcolor", O ? k : void 0);
                    F(P + ".fgcolor", O ? y.contrast(N) : k);
                  }
                  F(P + ".fgopacity", O ? 0.5 : 1);
                }
              }, c.coerceHoverinfo = function(F, P, k) {
                var I = P._module.attributes, L = I.hoverinfo ? I : p, A = L.hoverinfo, O;
                if (k._dataLength === 1) {
                  var N = A.dflt === "all" ? A.flags.slice() : A.dflt.split("+");
                  N.splice(N.indexOf("name"), 1), O = N.join("+");
                }
                return c.coerce(F, P, L, "hoverinfo", O);
              }, c.coerceSelectionMarkerOpacity = function(F, P) {
                if (F.marker) {
                  var k = F.marker.opacity;
                  if (k !== void 0) {
                    var I, L;
                    !S(k) && !F.selected && !F.unselected && (I = k, L = C * k), P("selected.marker.opacity", I), P("unselected.marker.opacity", L);
                  }
                }
              };
              function T(F, P) {
                var k = c.valObjectMeta[P.valType];
                if (P.arrayOk && S(F)) return !0;
                if (k.validateFunction)
                  return k.validateFunction(F, P);
                var I = {}, L = I, A = {
                  set: function(O) {
                    L = O;
                  }
                };
                return k.coerceFunction(F, A, I, P), L !== I;
              }
              c.validate = T;
            }
          ),
          /***/
          7555: (
            /***/
            function(s, c, i) {
              var l = i(4336).Yn, v = i(8248), f = i(4248), p = i(435).mod, g = i(9032), y = g.BADNUM, C = g.ONEDAY, m = g.ONEHOUR, h = g.ONEMIN, w = g.ONESEC, S = g.EPOCHJD, E = i(4040), x = i(4336).E9, T = /^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m, F = /^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m, P = (/* @__PURE__ */ new Date()).getFullYear() - 70;
              function k(X) {
                return X && E.componentsRegistry.calendars && typeof X == "string" && X !== "gregorian";
              }
              c.dateTick0 = function(X, U) {
                var ne = I(X, !!U);
                if (U < 2) return ne;
                var se = c.dateTime2ms(ne, X);
                return se += C * (U - 1), c.ms2DateTime(se, 0, X);
              };
              function I(X, U) {
                return k(X) ? U ? E.getComponentMethod("calendars", "CANONICAL_SUNDAY")[X] : E.getComponentMethod("calendars", "CANONICAL_TICK")[X] : U ? "2000-01-02" : "2000-01-01";
              }
              c.dfltRange = function(X) {
                return k(X) ? E.getComponentMethod("calendars", "DFLTRANGE")[X] : ["2000-01-01", "2001-01-01"];
              }, c.isJSDate = function(X) {
                return typeof X == "object" && X !== null && typeof X.getTime == "function";
              };
              var L, A;
              c.dateTime2ms = function(X, U) {
                if (c.isJSDate(X)) {
                  var ne = X.getTimezoneOffset() * h, se = (X.getUTCMinutes() - X.getMinutes()) * h + (X.getUTCSeconds() - X.getSeconds()) * w + (X.getUTCMilliseconds() - X.getMilliseconds());
                  if (se) {
                    var le = 3 * h;
                    ne = ne - le / 2 + p(se - ne + le / 2, le);
                  }
                  return X = Number(X) - ne, X >= L && X <= A ? X : y;
                }
                if (typeof X != "string" && typeof X != "number") return y;
                X = String(X);
                var ue = k(U), ve = X.charAt(0);
                ue && (ve === "G" || ve === "g") && (X = X.substr(1), U = "");
                var be = ue && U.substr(0, 7) === "chinese", Me = X.match(be ? F : T);
                if (!Me) return y;
                var Ge = Me[1], we = Me[3] || "1", Re = Number(Me[5] || 1), Ae = Number(Me[7] || 0), K = Number(Me[9] || 0), ee = Number(Me[11] || 0);
                if (ue) {
                  if (Ge.length === 2) return y;
                  Ge = Number(Ge);
                  var oe;
                  try {
                    var _ = E.getComponentMethod("calendars", "getCal")(U);
                    if (be) {
                      var V = we.charAt(we.length - 1) === "i";
                      we = parseInt(we, 10), oe = _.newDate(Ge, _.toMonthIndex(Ge, we, V), Re);
                    } else
                      oe = _.newDate(Ge, Number(we), Re);
                  } catch {
                    return y;
                  }
                  return oe ? (oe.toJD() - S) * C + Ae * m + K * h + ee * w : y;
                }
                Ge.length === 2 ? Ge = (Number(Ge) + 2e3 - P) % 100 + P : Ge = Number(Ge), we -= 1;
                var fe = new Date(Date.UTC(2e3, we, Re, Ae, K));
                return fe.setUTCFullYear(Ge), fe.getUTCMonth() !== we || fe.getUTCDate() !== Re ? y : fe.getTime() + ee * w;
              }, L = c.MIN_MS = c.dateTime2ms("-9999"), A = c.MAX_MS = c.dateTime2ms("9999-12-31 23:59:59.9999"), c.isDateTime = function(X, U) {
                return c.dateTime2ms(X, U) !== y;
              };
              function O(X, U) {
                return String(X + Math.pow(10, U)).substr(1);
              }
              var N = 90 * C, Y = 3 * m, j = 5 * h;
              c.ms2DateTime = function(X, U, ne) {
                if (typeof X != "number" || !(X >= L && X <= A)) return y;
                U || (U = 0);
                var se = Math.floor(p(X + 0.05, 1) * 10), le = Math.round(X - se / 10), ue, ve, be, Me, Ge, we;
                if (k(ne)) {
                  var Re = Math.floor(le / C) + S, Ae = Math.floor(p(X, C));
                  try {
                    ue = E.getComponentMethod("calendars", "getCal")(ne).fromJD(Re).formatDate("yyyy-mm-dd");
                  } catch {
                    ue = x("G%Y-%m-%d")(new Date(le));
                  }
                  if (ue.charAt(0) === "-")
                    for (; ue.length < 11; ) ue = "-0" + ue.substr(1);
                  else
                    for (; ue.length < 10; ) ue = "0" + ue;
                  ve = U < N ? Math.floor(Ae / m) : 0, be = U < N ? Math.floor(Ae % m / h) : 0, Me = U < Y ? Math.floor(Ae % h / w) : 0, Ge = U < j ? Ae % w * 10 + se : 0;
                } else
                  we = new Date(le), ue = x("%Y-%m-%d")(we), ve = U < N ? we.getUTCHours() : 0, be = U < N ? we.getUTCMinutes() : 0, Me = U < Y ? we.getUTCSeconds() : 0, Ge = U < j ? we.getUTCMilliseconds() * 10 + se : 0;
                return te(ue, ve, be, Me, Ge);
              }, c.ms2DateTimeLocal = function(X) {
                if (!(X >= L + C && X <= A - C)) return y;
                var U = Math.floor(p(X + 0.05, 1) * 10), ne = new Date(Math.round(X - U / 10)), se = l("%Y-%m-%d")(ne), le = ne.getHours(), ue = ne.getMinutes(), ve = ne.getSeconds(), be = ne.getUTCMilliseconds() * 10 + U;
                return te(se, le, ue, ve, be);
              };
              function te(X, U, ne, se, le) {
                if ((U || ne || se || le) && (X += " " + O(U, 2) + ":" + O(ne, 2), (se || le) && (X += ":" + O(se, 2), le))) {
                  for (var ue = 4; le % 10 === 0; )
                    ue -= 1, le /= 10;
                  X += "." + O(le, ue);
                }
                return X;
              }
              c.cleanDate = function(X, U, ne) {
                if (X === y) return U;
                if (c.isJSDate(X) || typeof X == "number" && isFinite(X)) {
                  if (k(ne))
                    return f.error("JS Dates and milliseconds are incompatible with world calendars", X), U;
                  if (X = c.ms2DateTimeLocal(+X), !X && U !== void 0) return U;
                } else if (!c.isDateTime(X, ne))
                  return f.error("unrecognized date", X), U;
                return X;
              };
              var re = /%\d?f/g, z = /%h/g, Z = {
                1: "1",
                2: "1",
                3: "2",
                4: "2"
              };
              function W(X, U, ne, se) {
                X = X.replace(re, function(ue) {
                  var ve = Math.min(+ue.charAt(1) || 6, 6), be = (U / 1e3 % 1 + 2).toFixed(ve).substr(2).replace(/0+$/, "") || "0";
                  return be;
                });
                var le = new Date(Math.floor(U + 0.05));
                if (X = X.replace(z, function() {
                  return Z[ne("%q")(le)];
                }), k(se))
                  try {
                    X = E.getComponentMethod("calendars", "worldCalFmt")(X, U, se);
                  } catch {
                    return "Invalid";
                  }
                return ne(X)(le);
              }
              var q = [59, 59.9, 59.99, 59.999, 59.9999];
              function ie(X, U) {
                var ne = p(X + 0.05, C), se = O(Math.floor(ne / m), 2) + ":" + O(p(Math.floor(ne / h), 60), 2);
                if (U !== "M") {
                  v(U) || (U = 0);
                  var le = Math.min(p(X / w, 60), q[U]), ue = (100 + le).toFixed(U).substr(1);
                  U > 0 && (ue = ue.replace(/0+$/, "").replace(/[\.]$/, "")), se += ":" + ue;
                }
                return se;
              }
              c.formatDate = function(X, U, ne, se, le, ue) {
                if (le = k(le) && le, !U)
                  if (ne === "y") U = ue.year;
                  else if (ne === "m") U = ue.month;
                  else if (ne === "d")
                    U = ue.dayMonth + `
` + ue.year;
                  else
                    return ie(X, ne) + `
` + W(ue.dayMonthYear, X, se, le);
                return W(U, X, se, le);
              };
              var ce = 3 * C;
              c.incrementMonth = function(X, U, ne) {
                ne = k(ne) && ne;
                var se = p(X, C);
                if (X = Math.round(X - se), ne)
                  try {
                    var le = Math.round(X / C) + S, ue = E.getComponentMethod("calendars", "getCal")(ne), ve = ue.fromJD(le);
                    return U % 12 ? ue.add(ve, U, "m") : ue.add(ve, U / 12, "y"), (ve.toJD() - S) * C + se;
                  } catch {
                    f.error("invalid ms " + X + " in calendar " + ne);
                  }
                var be = new Date(X + ce);
                return be.setUTCMonth(be.getUTCMonth() + U) + se - ce;
              }, c.findExactDates = function(X, U) {
                for (var ne = 0, se = 0, le = 0, ue = 0, ve, be, Me = k(U) && E.getComponentMethod("calendars", "getCal")(U), Ge = 0; Ge < X.length; Ge++) {
                  if (be = X[Ge], !v(be)) {
                    ue++;
                    continue;
                  }
                  if (!(be % C))
                    if (Me)
                      try {
                        ve = Me.fromJD(be / C + S), ve.day() === 1 ? ve.month() === 1 ? ne++ : se++ : le++;
                      } catch {
                      }
                    else
                      ve = new Date(be), ve.getUTCDate() === 1 ? ve.getUTCMonth() === 0 ? ne++ : se++ : le++;
                }
                se += ne, le += se;
                var we = X.length - ue;
                return {
                  exactYears: ne / we,
                  exactMonths: se / we,
                  exactDays: le / we
                };
              };
            }
          ),
          /***/
          2200: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4248), f = i(2248), p = i(6524);
              function g(P) {
                var k;
                if (typeof P == "string") {
                  if (k = document.getElementById(P), k === null)
                    throw new Error("No DOM element with id '" + P + "' exists on the page.");
                  return k;
                } else if (P == null)
                  throw new Error("DOM element provided is null or undefined");
                return P;
              }
              function y(P) {
                var k = l.select(P);
                return k.node() instanceof HTMLElement && k.size() && k.classed("js-plotly-plot");
              }
              function C(P) {
                var k = P && P.parentNode;
                k && k.removeChild(P);
              }
              function m(P, k) {
                h("global", P, k);
              }
              function h(P, k, I) {
                var L = "plotly.js-style-" + P, A = document.getElementById(L);
                A || (A = document.createElement("style"), A.setAttribute("id", L), A.appendChild(document.createTextNode("")), document.head.appendChild(A));
                var O = A.sheet;
                O.insertRule ? O.insertRule(k + "{" + I + "}", 0) : O.addRule ? O.addRule(k, I, 0) : v.warn("addStyleRule failed");
              }
              function w(P) {
                var k = "plotly.js-style-" + P, I = document.getElementById(k);
                I && C(I);
              }
              function S(P) {
                var k = x(P), I = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
                return k.forEach(function(L) {
                  var A = E(L);
                  if (A) {
                    var O = f.convertCssMatrix(A);
                    I = p.multiply(I, I, O);
                  }
                }), I;
              }
              function E(P) {
                var k = window.getComputedStyle(P, null), I = k.getPropertyValue("-webkit-transform") || k.getPropertyValue("-moz-transform") || k.getPropertyValue("-ms-transform") || k.getPropertyValue("-o-transform") || k.getPropertyValue("transform");
                return I === "none" ? null : I.replace("matrix", "").replace("3d", "").slice(1, -1).split(",").map(function(L) {
                  return +L;
                });
              }
              function x(P) {
                for (var k = []; T(P); )
                  k.push(P), P = P.parentNode, typeof ShadowRoot == "function" && P instanceof ShadowRoot && (P = P.host);
                return k;
              }
              function T(P) {
                return P && (P instanceof Element || P instanceof HTMLElement);
              }
              function F(P, k) {
                return P && k && P.top === k.top && P.left === k.left && P.right === k.right && P.bottom === k.bottom;
              }
              s.exports = {
                getGraphDiv: g,
                isPlotDiv: y,
                removeElement: C,
                addStyleRule: m,
                addRelatedStyleRule: h,
                deleteRelatedStyleRule: w,
                getFullTransformMatrix: S,
                getElementTransformMatrix: E,
                getElementAndAncestors: x,
                equalDomRects: F
              };
            }
          ),
          /***/
          5924: (
            /***/
            function(s, c, i) {
              var l = i(1252).EventEmitter, v = {
                init: function(f) {
                  if (f._ev instanceof l) return f;
                  var p = new l(), g = new l();
                  return f._ev = p, f._internalEv = g, f.on = p.on.bind(p), f.once = p.once.bind(p), f.removeListener = p.removeListener.bind(p), f.removeAllListeners = p.removeAllListeners.bind(p), f._internalOn = g.on.bind(g), f._internalOnce = g.once.bind(g), f._removeInternalListener = g.removeListener.bind(g), f._removeAllInternalListeners = g.removeAllListeners.bind(g), f.emit = function(y, C) {
                    typeof jQuery < "u" && jQuery(f).trigger(y, C), p.emit(y, C), g.emit(y, C);
                  }, f;
                },
                /*
                 * This function behaves like jQuery's triggerHandler. It calls
                 * all handlers for a particular event and returns the return value
                 * of the LAST handler. This function also triggers jQuery's
                 * triggerHandler for backwards compatibility.
                 */
                triggerHandler: function(f, p, g) {
                  var y, C;
                  typeof jQuery < "u" && (y = jQuery(f).triggerHandler(p, g));
                  var m = f._ev;
                  if (!m) return y;
                  var h = m._events[p];
                  if (!h) return y;
                  function w(E) {
                    if (E.listener) {
                      if (m.removeListener(p, E.listener), !E.fired)
                        return E.fired = !0, E.listener.apply(m, [g]);
                    } else
                      return E.apply(m, [g]);
                  }
                  h = Array.isArray(h) ? h : [h];
                  var S;
                  for (S = 0; S < h.length - 1; S++)
                    w(h[S]);
                  return C = w(h[S]), y !== void 0 ? y : C;
                },
                purge: function(f) {
                  return delete f._ev, delete f.on, delete f.once, delete f.removeListener, delete f.removeAllListeners, delete f.emit, delete f._ev, delete f._internalEv, delete f._internalOn, delete f._internalOnce, delete f._removeInternalListener, delete f._removeAllInternalListeners, f;
                }
              };
              s.exports = v;
            }
          ),
          /***/
          2880: (
            /***/
            function(s, c, i) {
              var l = i(3620), v = Array.isArray;
              function f(g, y) {
                var C, m;
                for (C = 0; C < g.length; C++) {
                  if (m = g[C], m !== null && typeof m == "object")
                    return !1;
                  m !== void 0 && (y[C] = m);
                }
                return !0;
              }
              c.extendFlat = function() {
                return p(arguments, !1, !1, !1);
              }, c.extendDeep = function() {
                return p(arguments, !0, !1, !1);
              }, c.extendDeepAll = function() {
                return p(arguments, !0, !0, !1);
              }, c.extendDeepNoArrays = function() {
                return p(arguments, !0, !1, !0);
              };
              function p(g, y, C, m) {
                var h = g[0], w = g.length, S, E, x, T, F, P, k;
                if (w === 2 && v(h) && v(g[1]) && h.length === 0) {
                  if (k = f(g[1], h), k)
                    return h;
                  h.splice(0, h.length);
                }
                for (var I = 1; I < w; I++) {
                  S = g[I];
                  for (E in S)
                    x = h[E], T = S[E], m && v(T) ? h[E] = T : y && T && (l(T) || (F = v(T))) ? (F ? (F = !1, P = x && v(x) ? x : []) : P = x && l(x) ? x : {}, h[E] = p([P, T], y, C, m)) : (typeof T < "u" || C) && (h[E] = T);
                }
                return h;
              }
            }
          ),
          /***/
          8944: (
            /***/
            function(s) {
              s.exports = function(i) {
                for (var l = {}, v = [], f = 0, p = 0; p < i.length; p++) {
                  var g = i[p];
                  l[g] !== 1 && (l[g] = 1, v[f++] = g);
                }
                return v;
              };
            }
          ),
          /***/
          3880: (
            /***/
            function(s) {
              s.exports = function(f) {
                for (var p = l(f) ? i : c, g = [], y = 0; y < f.length; y++) {
                  var C = f[y];
                  p(C) && g.push(C);
                }
                return g;
              };
              function c(v) {
                return v.visible === !0;
              }
              function i(v) {
                var f = v[0].trace;
                return f.visible === !0 && f._length !== 0;
              }
              function l(v) {
                return Array.isArray(v) && Array.isArray(v[0]) && v[0][0] && v[0][0].trace;
              }
            }
          ),
          /***/
          2348: (
            /***/
            function(s, c, i) {
              var l = i(435).mod;
              c.segmentsIntersect = v;
              function v(C, m, h, w, S, E, x, T) {
                var F = h - C, P = S - C, k = x - S, I = w - m, L = E - m, A = T - E, O = F * A - k * I;
                if (O === 0) return null;
                var N = (P * A - k * L) / O, Y = (P * I - F * L) / O;
                return Y < 0 || Y > 1 || N < 0 || N > 1 ? null : {
                  x: C + F * N,
                  y: m + I * N
                };
              }
              c.segmentDistance = function(m, h, w, S, E, x, T, F) {
                if (v(m, h, w, S, E, x, T, F)) return 0;
                var P = w - m, k = S - h, I = T - E, L = F - x, A = P * P + k * k, O = I * I + L * L, N = Math.min(f(P, k, A, E - m, x - h), f(P, k, A, T - m, F - h), f(I, L, O, m - E, h - x), f(I, L, O, w - E, S - x));
                return Math.sqrt(N);
              };
              function f(C, m, h, w, S) {
                var E = w * C + S * m;
                if (E < 0)
                  return w * w + S * S;
                if (E > h) {
                  var x = w - C, T = S - m;
                  return x * x + T * T;
                } else {
                  var F = w * m - S * C;
                  return F * F / h;
                }
              }
              var p, g, y;
              c.getTextLocation = function(m, h, w, S) {
                if ((m !== g || S !== y) && (p = {}, g = m, y = S), p[w])
                  return p[w];
                var E = m.getPointAtLength(l(w - S / 2, h)), x = m.getPointAtLength(l(w + S / 2, h)), T = Math.atan((x.y - E.y) / (x.x - E.x)), F = m.getPointAtLength(l(w, h)), P = (F.x * 4 + E.x + x.x) / 6, k = (F.y * 4 + E.y + x.y) / 6, I = {
                  x: P,
                  y: k,
                  theta: T
                };
                return p[w] = I, I;
              }, c.clearLocationCache = function() {
                g = null;
              }, c.getVisibleSegment = function(m, h, w) {
                var S = h.left, E = h.right, x = h.top, T = h.bottom, F = 0, P = m.getTotalLength(), k = P, I, L;
                function A(N) {
                  var Y = m.getPointAtLength(N);
                  N === 0 ? I = Y : N === P && (L = Y);
                  var j = Y.x < S ? S - Y.x : Y.x > E ? Y.x - E : 0, te = Y.y < x ? x - Y.y : Y.y > T ? Y.y - T : 0;
                  return Math.sqrt(j * j + te * te);
                }
                for (var O = A(F); O; ) {
                  if (F += O + w, F > k) return;
                  O = A(F);
                }
                for (O = A(k); O; ) {
                  if (k -= O + w, F > k) return;
                  O = A(k);
                }
                return {
                  min: F,
                  max: k,
                  len: k - F,
                  total: P,
                  isClosed: F === 0 && k === P && Math.abs(I.x - L.x) < 0.1 && Math.abs(I.y - L.y) < 0.1
                };
              }, c.findPointOnPath = function(m, h, w, S) {
                S = S || {};
                for (var E = S.pathLength || m.getTotalLength(), x = S.tolerance || 1e-3, T = S.iterationLimit || 30, F = m.getPointAtLength(0)[w] > m.getPointAtLength(E)[w] ? -1 : 1, P = 0, k = 0, I = E, L, A, O; P < T; ) {
                  if (L = (k + I) / 2, A = m.getPointAtLength(L), O = A[w] - h, Math.abs(O) < x)
                    return A;
                  F * O > 0 ? I = L : k = L, P++;
                }
                return A;
              };
            }
          ),
          /***/
          5536: (
            /***/
            function(s) {
              s.exports = function(i) {
                return i;
              };
            }
          ),
          /***/
          1396: (
            /***/
            function(s) {
              s.exports = function(i, l) {
                if (!l) return i;
                var v = 1 / Math.abs(l), f = v > 1 ? (v * i + v * l) / v : i + l, p = String(f).length;
                if (p > 16) {
                  var g = String(l).length, y = String(i).length;
                  if (p >= y + g) {
                    var C = parseFloat(f).toPrecision(12);
                    C.indexOf("e+") === -1 && (f = +C);
                  }
                }
                return f;
              };
            }
          ),
          /***/
          3400: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4336).E9, f = i(7624).E9, p = i(8248), g = i(9032), y = g.FP_SAFE, C = -y, m = g.BADNUM, h = s.exports = {};
              h.adjustFormat = function(oe) {
                return !oe || /^\d[.]\df/.test(oe) || /[.]\d%/.test(oe) ? oe : oe === "0.f" ? "~f" : /^\d%/.test(oe) ? "~%" : /^\ds/.test(oe) ? "~s" : !/^[~,.0$]/.test(oe) && /[&fps]/.test(oe) ? "~" + oe : oe;
              };
              var w = {};
              h.warnBadFormat = function(ee) {
                var oe = String(ee);
                w[oe] || (w[oe] = 1, h.warn('encountered bad format: "' + oe + '"'));
              }, h.noFormat = function(ee) {
                return String(ee);
              }, h.numberFormat = function(ee) {
                var oe;
                try {
                  oe = f(h.adjustFormat(ee));
                } catch {
                  return h.warnBadFormat(ee), h.noFormat;
                }
                return oe;
              }, h.nestedProperty = i(2296), h.keyedContainer = i(7804), h.relativeAttr = i(3193), h.isPlainObject = i(3620), h.toLogRange = i(6896), h.relinkPrivateKeys = i(1528);
              var S = i(8116);
              h.isArrayBuffer = S.isArrayBuffer, h.isTypedArray = S.isTypedArray, h.isArrayOrTypedArray = S.isArrayOrTypedArray, h.isArray1D = S.isArray1D, h.ensureArray = S.ensureArray, h.concat = S.concat, h.maxRowLength = S.maxRowLength, h.minRowLength = S.minRowLength;
              var E = i(435);
              h.mod = E.mod, h.modHalf = E.modHalf;
              var x = i(3064);
              h.valObjectMeta = x.valObjectMeta, h.coerce = x.coerce, h.coerce2 = x.coerce2, h.coerceFont = x.coerceFont, h.coercePattern = x.coercePattern, h.coerceHoverinfo = x.coerceHoverinfo, h.coerceSelectionMarkerOpacity = x.coerceSelectionMarkerOpacity, h.validate = x.validate;
              var T = i(7555);
              h.dateTime2ms = T.dateTime2ms, h.isDateTime = T.isDateTime, h.ms2DateTime = T.ms2DateTime, h.ms2DateTimeLocal = T.ms2DateTimeLocal, h.cleanDate = T.cleanDate, h.isJSDate = T.isJSDate, h.formatDate = T.formatDate, h.incrementMonth = T.incrementMonth, h.dateTick0 = T.dateTick0, h.dfltRange = T.dfltRange, h.findExactDates = T.findExactDates, h.MIN_MS = T.MIN_MS, h.MAX_MS = T.MAX_MS;
              var F = i(4952);
              h.findBin = F.findBin, h.sorterAsc = F.sorterAsc, h.sorterDes = F.sorterDes, h.distinctVals = F.distinctVals, h.roundUp = F.roundUp, h.sort = F.sort, h.findIndexOfMin = F.findIndexOfMin, h.sortObjectKeys = i(2996);
              var P = i(3084);
              h.aggNums = P.aggNums, h.len = P.len, h.mean = P.mean, h.median = P.median, h.midRange = P.midRange, h.variance = P.variance, h.stdev = P.stdev, h.interp = P.interp;
              var k = i(2248);
              h.init2dArray = k.init2dArray, h.transposeRagged = k.transposeRagged, h.dot = k.dot, h.translationMatrix = k.translationMatrix, h.rotationMatrix = k.rotationMatrix, h.rotationXYMatrix = k.rotationXYMatrix, h.apply3DTransform = k.apply3DTransform, h.apply2DTransform = k.apply2DTransform, h.apply2DTransform2 = k.apply2DTransform2, h.convertCssMatrix = k.convertCssMatrix, h.inverseTransformMatrix = k.inverseTransformMatrix;
              var I = i(1864);
              h.deg2rad = I.deg2rad, h.rad2deg = I.rad2deg, h.angleDelta = I.angleDelta, h.angleDist = I.angleDist, h.isFullCircle = I.isFullCircle, h.isAngleInsideSector = I.isAngleInsideSector, h.isPtInsideSector = I.isPtInsideSector, h.pathArc = I.pathArc, h.pathSector = I.pathSector, h.pathAnnulus = I.pathAnnulus;
              var L = i(8308);
              h.isLeftAnchor = L.isLeftAnchor, h.isCenterAnchor = L.isCenterAnchor, h.isRightAnchor = L.isRightAnchor, h.isTopAnchor = L.isTopAnchor, h.isMiddleAnchor = L.isMiddleAnchor, h.isBottomAnchor = L.isBottomAnchor;
              var A = i(2348);
              h.segmentsIntersect = A.segmentsIntersect, h.segmentDistance = A.segmentDistance, h.getTextLocation = A.getTextLocation, h.clearLocationCache = A.clearLocationCache, h.getVisibleSegment = A.getVisibleSegment, h.findPointOnPath = A.findPointOnPath;
              var O = i(2880);
              h.extendFlat = O.extendFlat, h.extendDeep = O.extendDeep, h.extendDeepAll = O.extendDeepAll, h.extendDeepNoArrays = O.extendDeepNoArrays;
              var N = i(4248);
              h.log = N.log, h.warn = N.warn, h.error = N.error;
              var Y = i(3756);
              h.counterRegex = Y.counter;
              var j = i(1200);
              h.throttle = j.throttle, h.throttleDone = j.done, h.clearThrottle = j.clear;
              var te = i(2200);
              h.getGraphDiv = te.getGraphDiv, h.isPlotDiv = te.isPlotDiv, h.removeElement = te.removeElement, h.addStyleRule = te.addStyleRule, h.addRelatedStyleRule = te.addRelatedStyleRule, h.deleteRelatedStyleRule = te.deleteRelatedStyleRule, h.getFullTransformMatrix = te.getFullTransformMatrix, h.getElementTransformMatrix = te.getElementTransformMatrix, h.getElementAndAncestors = te.getElementAndAncestors, h.equalDomRects = te.equalDomRects, h.clearResponsive = i(5352), h.preserveDrawingBuffer = i(4296), h.makeTraceGroups = i(988), h._ = i(8356), h.notifier = i(1792), h.filterUnique = i(8944), h.filterVisible = i(3880), h.pushUnique = i(2416), h.increment = i(1396), h.cleanNumber = i(4037), h.ensureNumber = function(oe) {
                return p(oe) ? (oe = Number(oe), oe > y || oe < C ? m : oe) : m;
              }, h.isIndex = function(ee, oe) {
                return oe !== void 0 && ee >= oe ? !1 : p(ee) && ee >= 0 && ee % 1 === 0;
              }, h.noop = i(6628), h.identity = i(5536), h.repeat = function(ee, oe) {
                for (var _ = new Array(oe), V = 0; V < oe; V++)
                  _[V] = ee;
                return _;
              }, h.swapAttrs = function(ee, oe, _, V) {
                _ || (_ = "x"), V || (V = "y");
                for (var fe = 0; fe < oe.length; fe++) {
                  var $ = oe[fe], he = h.nestedProperty(ee, $.replace("?", _)), me = h.nestedProperty(ee, $.replace("?", V)), xe = he.get();
                  he.set(me.get()), me.set(xe);
                }
              }, h.raiseToTop = function(oe) {
                oe.parentNode.appendChild(oe);
              }, h.cancelTransition = function(ee) {
                return ee.transition().duration(0);
              }, h.constrain = function(ee, oe, _) {
                return oe > _ ? Math.max(_, Math.min(oe, ee)) : Math.max(oe, Math.min(_, ee));
              }, h.bBoxIntersect = function(ee, oe, _) {
                return _ = _ || 0, ee.left <= oe.right + _ && oe.left <= ee.right + _ && ee.top <= oe.bottom + _ && oe.top <= ee.bottom + _;
              }, h.simpleMap = function(ee, oe, _, V, fe) {
                for (var $ = ee.length, he = new Array($), me = 0; me < $; me++) he[me] = oe(ee[me], _, V, fe);
                return he;
              }, h.randstr = function ee(oe, _, V, fe) {
                if (V || (V = 16), _ === void 0 && (_ = 24), _ <= 0) return "0";
                var $ = Math.log(Math.pow(2, _)) / Math.log(V), he = "", me, xe, Fe;
                for (me = 2; $ === 1 / 0; me *= 2)
                  $ = Math.log(Math.pow(2, _ / me)) / Math.log(V) * me;
                var Ve = $ - Math.floor($);
                for (me = 0; me < Math.floor($); me++)
                  Fe = Math.floor(Math.random() * V).toString(V), he = Fe + he;
                Ve && (xe = Math.pow(V, Ve), Fe = Math.floor(Math.random() * xe).toString(V), he = Fe + he);
                var Be = parseInt(he, V);
                return oe && oe[he] || Be !== 1 / 0 && Be >= Math.pow(2, _) ? fe > 10 ? (h.warn("randstr failed uniqueness"), he) : ee(oe, _, V, (fe || 0) + 1) : he;
              }, h.OptionControl = function(ee, oe) {
                ee || (ee = {}), oe || (oe = "opt");
                var _ = {};
                return _.optionList = [], _._newoption = function(V) {
                  V[oe] = ee, _[V.name] = V, _.optionList.push(V);
                }, _["_" + oe] = ee, _;
              }, h.smooth = function(ee, oe) {
                if (oe = Math.round(oe) || 0, oe < 2) return ee;
                var _ = ee.length, V = 2 * _, fe = 2 * oe - 1, $ = new Array(fe), he = new Array(_), me, xe, Fe, Ve;
                for (me = 0; me < fe; me++)
                  $[me] = (1 - Math.cos(Math.PI * (me + 1) / oe)) / (2 * oe);
                for (me = 0; me < _; me++) {
                  for (Ve = 0, xe = 0; xe < fe; xe++)
                    Fe = me + xe + 1 - oe, Fe < -_ ? Fe -= V * Math.round(Fe / V) : Fe >= V && (Fe -= V * Math.floor(Fe / V)), Fe < 0 ? Fe = -1 - Fe : Fe >= _ && (Fe = V - 1 - Fe), Ve += ee[Fe] * $[xe];
                  he[me] = Ve;
                }
                return he;
              }, h.syncOrAsync = function(ee, oe, _) {
                var V, fe;
                function $() {
                  return h.syncOrAsync(ee, oe, _);
                }
                for (; ee.length; )
                  if (fe = ee.splice(0, 1)[0], V = fe(oe), V && V.then)
                    return V.then($);
                return _ && _(oe);
              }, h.stripTrailingSlash = function(ee) {
                return ee.substr(-1) === "/" ? ee.substr(0, ee.length - 1) : ee;
              }, h.noneOrAll = function(ee, oe, _) {
                if (ee) {
                  var V = !1, fe = !0, $, he;
                  for ($ = 0; $ < _.length; $++)
                    he = ee[_[$]], he != null ? V = !0 : fe = !1;
                  if (V && !fe)
                    for ($ = 0; $ < _.length; $++)
                      ee[_[$]] = oe[_[$]];
                }
              }, h.mergeArray = function(ee, oe, _, V) {
                var fe = typeof V == "function";
                if (h.isArrayOrTypedArray(ee))
                  for (var $ = Math.min(ee.length, oe.length), he = 0; he < $; he++) {
                    var me = ee[he];
                    oe[he][_] = fe ? V(me) : me;
                  }
              }, h.mergeArrayCastPositive = function(ee, oe, _) {
                return h.mergeArray(ee, oe, _, function(V) {
                  var fe = +V;
                  return isFinite(fe) && fe > 0 ? fe : 0;
                });
              }, h.fillArray = function(ee, oe, _, V) {
                if (V = V || h.identity, h.isArrayOrTypedArray(ee))
                  for (var fe = 0; fe < oe.length; fe++)
                    oe[fe][_] = V(ee[fe]);
              }, h.castOption = function(ee, oe, _, V) {
                V = V || h.identity;
                var fe = h.nestedProperty(ee, _).get();
                return h.isArrayOrTypedArray(fe) ? Array.isArray(oe) && h.isArrayOrTypedArray(fe[oe[0]]) ? V(fe[oe[0]][oe[1]]) : V(fe[oe]) : fe;
              }, h.extractOption = function(ee, oe, _, V) {
                if (_ in ee) return ee[_];
                var fe = h.nestedProperty(oe, V).get();
                if (!Array.isArray(fe)) return fe;
              };
              function re(ee) {
                var oe = {};
                for (var _ in ee)
                  for (var V = ee[_], fe = 0; fe < V.length; fe++)
                    oe[V[fe]] = +_;
                return oe;
              }
              h.tagSelected = function(ee, oe, _) {
                var V = oe.selectedpoints, fe = oe._indexToPoints, $;
                fe && ($ = re(fe));
                function he(Be) {
                  return Be !== void 0 && Be < ee.length;
                }
                for (var me = 0; me < V.length; me++) {
                  var xe = V[me];
                  if (h.isIndex(xe) || h.isArrayOrTypedArray(xe) && h.isIndex(xe[0]) && h.isIndex(xe[1])) {
                    var Fe = $ ? $[xe] : xe, Ve = _ ? _[Fe] : Fe;
                    he(Ve) && (ee[Ve].selected = 1);
                  }
                }
              }, h.selIndices2selPoints = function(ee) {
                var oe = ee.selectedpoints, _ = ee._indexToPoints;
                if (_) {
                  for (var V = re(_), fe = [], $ = 0; $ < oe.length; $++) {
                    var he = oe[$];
                    if (h.isIndex(he)) {
                      var me = V[he];
                      h.isIndex(me) && fe.push(me);
                    }
                  }
                  return fe;
                } else
                  return oe;
              }, h.getTargetArray = function(ee, oe) {
                var _ = oe.target;
                if (typeof _ == "string" && _) {
                  var V = h.nestedProperty(ee, _).get();
                  return h.isArrayOrTypedArray(V) ? V : !1;
                } else if (h.isArrayOrTypedArray(_))
                  return _;
                return !1;
              };
              function z(ee, oe, _) {
                var V = {};
                typeof oe != "object" && (oe = {});
                var fe = _ === "pieLike" ? -1 : 3, $ = Object.keys(ee), he, me, xe;
                for (he = 0; he < $.length; he++)
                  me = $[he], xe = ee[me], !(me.charAt(0) === "_" || typeof xe == "function") && (me === "module" ? V[me] = xe : Array.isArray(xe) ? me === "colorscale" || fe === -1 ? V[me] = xe.slice() : V[me] = xe.slice(0, fe) : h.isTypedArray(xe) ? fe === -1 ? V[me] = xe.subarray() : V[me] = xe.subarray(0, fe) : xe && typeof xe == "object" ? V[me] = z(ee[me], oe[me], _) : V[me] = xe);
                for ($ = Object.keys(oe), he = 0; he < $.length; he++)
                  me = $[he], xe = oe[me], (typeof xe != "object" || !(me in V) || typeof V[me] != "object") && (V[me] = xe);
                return V;
              }
              h.minExtend = z, h.titleCase = function(ee) {
                return ee.charAt(0).toUpperCase() + ee.substr(1);
              }, h.containsAny = function(ee, oe) {
                for (var _ = 0; _ < oe.length; _++)
                  if (ee.indexOf(oe[_]) !== -1) return !0;
                return !1;
              }, h.isIE = function() {
                return typeof window.navigator.msSaveBlob < "u";
              };
              var Z = /Version\/[\d\.]+.*Safari/;
              h.isSafari = function() {
                return Z.test(window.navigator.userAgent);
              };
              var W = /iPad|iPhone|iPod/;
              h.isIOS = function() {
                return W.test(window.navigator.userAgent);
              };
              var q = /Firefox\/(\d+)\.\d+/;
              h.getFirefoxVersion = function() {
                var ee = q.exec(window.navigator.userAgent);
                if (ee && ee.length === 2) {
                  var oe = parseInt(ee[1]);
                  if (!isNaN(oe))
                    return oe;
                }
                return null;
              }, h.isD3Selection = function(ee) {
                return ee instanceof l.selection;
              }, h.ensureSingle = function(ee, oe, _, V) {
                var fe = ee.select(oe + (_ ? "." + _ : ""));
                if (fe.size()) return fe;
                var $ = ee.append(oe);
                return _ && $.classed(_, !0), V && $.call(V), $;
              }, h.ensureSingleById = function(ee, oe, _, V) {
                var fe = ee.select(oe + "#" + _);
                if (fe.size()) return fe;
                var $ = ee.append(oe).attr("id", _);
                return V && $.call(V), $;
              }, h.objectFromPath = function(ee, oe) {
                for (var _ = ee.split("."), V, fe = V = {}, $ = 0; $ < _.length; $++) {
                  var he = _[$], me = null, xe = _[$].match(/(.*)\[([0-9]+)\]/);
                  xe ? (he = xe[1], me = xe[2], V = V[he] = [], $ === _.length - 1 ? V[me] = oe : V[me] = {}, V = V[me]) : ($ === _.length - 1 ? V[he] = oe : V[he] = {}, V = V[he]);
                }
                return fe;
              };
              var ie = /^([^\[\.]+)\.(.+)?/, ce = /^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;
              function X(ee) {
                return ee.slice(0, 2) === "__";
              }
              h.expandObjectPaths = function(ee) {
                var oe, _, V, fe, $, he, me;
                if (typeof ee == "object" && !Array.isArray(ee)) {
                  for (_ in ee)
                    if (ee.hasOwnProperty(_))
                      if (oe = _.match(ie)) {
                        if (fe = ee[_], V = oe[1], X(V)) continue;
                        delete ee[_], ee[V] = h.extendDeepNoArrays(ee[V] || {}, h.objectFromPath(_, h.expandObjectPaths(fe))[V]);
                      } else if (oe = _.match(ce)) {
                        if (fe = ee[_], V = oe[1], X(V)) continue;
                        if ($ = parseInt(oe[2]), delete ee[_], ee[V] = ee[V] || [], oe[3] === ".")
                          me = oe[4], he = ee[V][$] = ee[V][$] || {}, h.extendDeepNoArrays(he, h.objectFromPath(me, h.expandObjectPaths(fe)));
                        else {
                          if (X(V)) continue;
                          ee[V][$] = h.expandObjectPaths(fe);
                        }
                      } else {
                        if (X(_)) continue;
                        ee[_] = h.expandObjectPaths(ee[_]);
                      }
                }
                return ee;
              }, h.numSeparate = function(ee, oe, _) {
                if (_ || (_ = !1), typeof oe != "string" || oe.length === 0)
                  throw new Error("Separator string required for formatting!");
                typeof ee == "number" && (ee = String(ee));
                var V = /(\d+)(\d{3})/, fe = oe.charAt(0), $ = oe.charAt(1), he = ee.split("."), me = he[0], xe = he.length > 1 ? fe + he[1] : "";
                if ($ && (he.length > 1 || me.length > 4 || _))
                  for (; V.test(me); )
                    me = me.replace(V, "$1" + $ + "$2");
                return me + xe;
              }, h.TEMPLATE_STRING_REGEX = /%{([^\s%{}:]*)([:|\|][^}]*)?}/g;
              var U = /^\w*$/;
              h.templateString = function(ee, oe) {
                var _ = {};
                return ee.replace(h.TEMPLATE_STRING_REGEX, function(V, fe) {
                  var $;
                  return U.test(fe) ? $ = oe[fe] : (_[fe] = _[fe] || h.nestedProperty(oe, fe).get, $ = _[fe]()), h.isValidTextValue($) ? $ : "";
                });
              };
              var ne = {
                max: 10,
                count: 0,
                name: "hovertemplate"
              };
              h.hovertemplateString = function() {
                return Me.apply(ne, arguments);
              };
              var se = {
                max: 10,
                count: 0,
                name: "texttemplate"
              };
              h.texttemplateString = function() {
                return Me.apply(se, arguments);
              };
              var le = /^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;
              function ue(ee) {
                var oe = ee.match(le);
                return oe ? {
                  key: oe[1],
                  op: oe[2],
                  number: Number(oe[3])
                } : {
                  key: ee,
                  op: null,
                  number: null
                };
              }
              var ve = {
                max: 10,
                count: 0,
                name: "texttemplate",
                parseMultDiv: !0
              };
              h.texttemplateStringForShapes = function() {
                return Me.apply(ve, arguments);
              };
              var be = /^[:|\|]/;
              function Me(ee, oe, _) {
                var V = this, fe = arguments;
                oe || (oe = {});
                var $ = {};
                return ee.replace(h.TEMPLATE_STRING_REGEX, function(he, me, xe) {
                  var Fe = me === "xother" || me === "yother", Ve = me === "_xother" || me === "_yother", Be = me === "_xother_" || me === "_yother_", Je = me === "xother_" || me === "yother_", et = Fe || Ve || Je || Be, at = me;
                  (Ve || Be) && (at = at.substring(1)), (Je || Be) && (at = at.substring(0, at.length - 1));
                  var De = null, Ne = null;
                  if (V.parseMultDiv) {
                    var Ie = ue(at);
                    at = Ie.key, De = Ie.op, Ne = Ie.number;
                  }
                  var Ue;
                  if (et) {
                    if (Ue = oe[at], Ue === void 0) return "";
                  } else {
                    var ot, ct;
                    for (ct = 3; ct < fe.length; ct++)
                      if (ot = fe[ct], !!ot) {
                        if (ot.hasOwnProperty(at)) {
                          Ue = ot[at];
                          break;
                        }
                        if (U.test(at) || (Ue = h.nestedProperty(ot, at).get(), Ue = $[at] || h.nestedProperty(ot, at).get(), Ue && ($[at] = Ue)), Ue !== void 0) break;
                      }
                  }
                  if (Ue !== void 0 && (De === "*" && (Ue *= Ne), De === "/" && (Ue /= Ne)), Ue === void 0 && V)
                    return V.count < V.max && (h.warn("Variable '" + at + "' in " + V.name + " could not be found!"), Ue = he), V.count === V.max && h.warn("Too many " + V.name + " warnings - additional warnings will be suppressed"), V.count++, he;
                  if (xe) {
                    var Tt;
                    if (xe[0] === ":" && (Tt = _ ? _.numberFormat : h.numberFormat, Ue !== "" && (Ue = Tt(xe.replace(be, ""))(Ue))), xe[0] === "|") {
                      Tt = _ ? _.timeFormat : v;
                      var kt = h.dateTime2ms(Ue);
                      Ue = h.formatDate(kt, xe.replace(be, ""), !1, Tt);
                    }
                  } else {
                    var Ot = at + "Label";
                    oe.hasOwnProperty(Ot) && (Ue = oe[Ot]);
                  }
                  return et && (Ue = "(" + Ue + ")", (Ve || Be) && (Ue = " " + Ue), (Je || Be) && (Ue = Ue + " ")), Ue;
                });
              }
              var Ge = 48, we = 57;
              h.subplotSort = function(ee, oe) {
                for (var _ = Math.min(ee.length, oe.length) + 1, V = 0, fe = 0, $ = 0; $ < _; $++) {
                  var he = ee.charCodeAt($) || 0, me = oe.charCodeAt($) || 0, xe = he >= Ge && he <= we, Fe = me >= Ge && me <= we;
                  if (xe && (V = 10 * V + he - Ge), Fe && (fe = 10 * fe + me - Ge), !xe || !Fe) {
                    if (V !== fe) return V - fe;
                    if (he !== me) return he - me;
                  }
                }
                return fe - V;
              };
              var Re = 2e9;
              h.seedPseudoRandom = function() {
                Re = 2e9;
              }, h.pseudoRandom = function() {
                var ee = Re;
                return Re = (69069 * Re + 1) % 4294967296, Math.abs(Re - ee) < 429496729 ? h.pseudoRandom() : Re / 4294967296;
              }, h.fillText = function(ee, oe, _) {
                var V = Array.isArray(_) ? function(he) {
                  _.push(he);
                } : function(he) {
                  _.text = he;
                }, fe = h.extractOption(ee, oe, "htx", "hovertext");
                if (h.isValidTextValue(fe)) return V(fe);
                var $ = h.extractOption(ee, oe, "tx", "text");
                if (h.isValidTextValue($)) return V($);
              }, h.isValidTextValue = function(ee) {
                return ee || ee === 0;
              }, h.formatPercent = function(ee, oe) {
                oe = oe || 0;
                for (var _ = (Math.round(100 * ee * Math.pow(10, oe)) * Math.pow(0.1, oe)).toFixed(oe) + "%", V = 0; V < oe; V++)
                  _.indexOf(".") !== -1 && (_ = _.replace("0%", "%"), _ = _.replace(".%", "%"));
                return _;
              }, h.isHidden = function(ee) {
                var oe = window.getComputedStyle(ee).display;
                return !oe || oe === "none";
              }, h.strTranslate = function(ee, oe) {
                return ee || oe ? "translate(" + ee + "," + oe + ")" : "";
              }, h.strRotate = function(ee) {
                return ee ? "rotate(" + ee + ")" : "";
              }, h.strScale = function(ee) {
                return ee !== 1 ? "scale(" + ee + ")" : "";
              }, h.getTextTransform = function(ee) {
                var oe = ee.noCenter, _ = ee.textX, V = ee.textY, fe = ee.targetX, $ = ee.targetY, he = ee.anchorX || 0, me = ee.anchorY || 0, xe = ee.rotate, Fe = ee.scale;
                return Fe ? Fe > 1 && (Fe = 1) : Fe = 0, h.strTranslate(fe - Fe * (_ + he), $ - Fe * (V + me)) + h.strScale(Fe) + (xe ? "rotate(" + xe + (oe ? "" : " " + _ + " " + V) + ")" : "");
              }, h.setTransormAndDisplay = function(ee, oe) {
                ee.attr("transform", h.getTextTransform(oe)), ee.style("display", oe.scale ? null : "none");
              }, h.ensureUniformFontSize = function(ee, oe) {
                var _ = h.extendFlat({}, oe);
                return _.size = Math.max(oe.size, ee._fullLayout.uniformtext.minsize || 0), _;
              }, h.join2 = function(ee, oe, _) {
                var V = ee.length;
                return V > 1 ? ee.slice(0, -1).join(oe) + _ + ee[V - 1] : ee.join(oe);
              }, h.bigFont = function(ee) {
                return Math.round(1.2 * ee);
              };
              var Ae = h.getFirefoxVersion(), K = Ae !== null && Ae < 86;
              h.getPositionFromD3Event = function() {
                return K ? [l.event.layerX, l.event.layerY] : [l.event.offsetX, l.event.offsetY];
              };
            }
          ),
          /***/
          3620: (
            /***/
            function(s) {
              s.exports = function(i) {
                return window && window.process && window.process.versions ? Object.prototype.toString.call(i) === "[object Object]" : Object.prototype.toString.call(i) === "[object Object]" && Object.getPrototypeOf(i).hasOwnProperty("hasOwnProperty");
              };
            }
          ),
          /***/
          7804: (
            /***/
            function(s, c, i) {
              var l = i(2296), v = /^\w*$/, f = 0, p = 1, g = 2, y = 3, C = 4;
              s.exports = function(h, w, S, E) {
                S = S || "name", E = E || "value";
                var x, T, F, P = {};
                w && w.length ? (F = l(h, w), T = F.get()) : T = h, w = w || "";
                var k = {};
                if (T)
                  for (x = 0; x < T.length; x++)
                    k[T[x][S]] = x;
                var I = v.test(E), L = {
                  set: function(A, O) {
                    var N = O === null ? C : f;
                    if (!T) {
                      if (!F || N === C) return;
                      T = [], F.set(T);
                    }
                    var Y = k[A];
                    if (Y === void 0) {
                      if (N === C) return;
                      N = N | y, Y = T.length, k[A] = Y;
                    } else O !== (I ? T[Y][E] : l(T[Y], E).get()) && (N = N | g);
                    var j = T[Y] = T[Y] || {};
                    return j[S] = A, I ? j[E] = O : l(j, E).set(O), O !== null && (N = N & ~C), P[Y] = P[Y] | N, L;
                  },
                  get: function(A) {
                    if (T) {
                      var O = k[A];
                      if (O !== void 0)
                        return I ? T[O][E] : l(T[O], E).get();
                    }
                  },
                  rename: function(A, O) {
                    var N = k[A];
                    return N === void 0 || (P[N] = P[N] | p, k[O] = N, delete k[A], T[N][S] = O), L;
                  },
                  remove: function(A) {
                    var O = k[A];
                    if (O === void 0) return L;
                    var N = T[O];
                    if (Object.keys(N).length > 2)
                      return P[O] = P[O] | g, L.set(A, null);
                    if (I) {
                      for (x = O; x < T.length; x++)
                        P[x] = P[x] | y;
                      for (x = O; x < T.length; x++)
                        k[T[x][S]]--;
                      T.splice(O, 1), delete k[A];
                    } else
                      l(N, E).set(null), P[O] = P[O] | g | C;
                    return L;
                  },
                  constructUpdate: function() {
                    for (var A, O, N = {}, Y = Object.keys(P), j = 0; j < Y.length; j++)
                      O = Y[j], A = w + "[" + O + "]", T[O] ? (P[O] & p && (N[A + "." + S] = T[O][S]), P[O] & g && (I ? N[A + "." + E] = P[O] & C ? null : T[O][E] : N[A + "." + E] = P[O] & C ? null : l(T[O], E).get())) : N[A] = null;
                    return N;
                  }
                };
                return L;
              };
            }
          ),
          /***/
          8356: (
            /***/
            function(s, c, i) {
              var l = i(4040);
              s.exports = function(f, p) {
                for (var g = f._context.locale, y = 0; y < 2; y++) {
                  for (var C = f._context.locales, m = 0; m < 2; m++) {
                    var h = (C[g] || {}).dictionary;
                    if (h) {
                      var w = h[p];
                      if (w) return w;
                    }
                    C = l.localeRegistry;
                  }
                  var S = g.split("-")[0];
                  if (S === g) break;
                  g = S;
                }
                return p;
              };
            }
          ),
          /***/
          4248: (
            /***/
            function(s, c, i) {
              var l = i(556).dfltConfig, v = i(1792), f = s.exports = {};
              f.log = function() {
                var p;
                if (l.logging > 1) {
                  var g = ["LOG:"];
                  for (p = 0; p < arguments.length; p++)
                    g.push(arguments[p]);
                  console.trace.apply(console, g);
                }
                if (l.notifyOnLogging > 1) {
                  var y = [];
                  for (p = 0; p < arguments.length; p++)
                    y.push(arguments[p]);
                  v(y.join("<br>"), "long");
                }
              }, f.warn = function() {
                var p;
                if (l.logging > 0) {
                  var g = ["WARN:"];
                  for (p = 0; p < arguments.length; p++)
                    g.push(arguments[p]);
                  console.trace.apply(console, g);
                }
                if (l.notifyOnLogging > 0) {
                  var y = [];
                  for (p = 0; p < arguments.length; p++)
                    y.push(arguments[p]);
                  v(y.join("<br>"), "stick");
                }
              }, f.error = function() {
                var p;
                if (l.logging > 0) {
                  var g = ["ERROR:"];
                  for (p = 0; p < arguments.length; p++)
                    g.push(arguments[p]);
                  console.error.apply(console, g);
                }
                if (l.notifyOnLogging > 0) {
                  var y = [];
                  for (p = 0; p < arguments.length; p++)
                    y.push(arguments[p]);
                  v(y.join("<br>"), "stick");
                }
              };
            }
          ),
          /***/
          988: (
            /***/
            function(s, c, i) {
              var l = i(3428);
              s.exports = function(f, p, g) {
                var y = f.selectAll("g." + g.replace(/\s/g, ".")).data(p, function(m) {
                  return m[0].trace.uid;
                });
                y.exit().remove(), y.enter().append("g").attr("class", g), y.order();
                var C = f.classed("rangeplot") ? "nodeRangePlot3" : "node3";
                return y.each(function(m) {
                  m[0][C] = l.select(this);
                }), y;
              };
            }
          ),
          /***/
          2248: (
            /***/
            function(s, c, i) {
              var l = i(6524);
              c.init2dArray = function(v, f) {
                for (var p = new Array(v), g = 0; g < v; g++) p[g] = new Array(f);
                return p;
              }, c.transposeRagged = function(v) {
                var f = 0, p = v.length, g, y;
                for (g = 0; g < p; g++) f = Math.max(f, v[g].length);
                var C = new Array(f);
                for (g = 0; g < f; g++)
                  for (C[g] = new Array(p), y = 0; y < p; y++) C[g][y] = v[y][g];
                return C;
              }, c.dot = function(v, f) {
                if (!(v.length && f.length) || v.length !== f.length) return null;
                var p = v.length, g, y;
                if (v[0].length)
                  for (g = new Array(p), y = 0; y < p; y++) g[y] = c.dot(v[y], f);
                else if (f[0].length) {
                  var C = c.transposeRagged(f);
                  for (g = new Array(C.length), y = 0; y < C.length; y++) g[y] = c.dot(v, C[y]);
                } else
                  for (g = 0, y = 0; y < p; y++) g += v[y] * f[y];
                return g;
              }, c.translationMatrix = function(v, f) {
                return [[1, 0, v], [0, 1, f], [0, 0, 1]];
              }, c.rotationMatrix = function(v) {
                var f = v * Math.PI / 180;
                return [[Math.cos(f), -Math.sin(f), 0], [Math.sin(f), Math.cos(f), 0], [0, 0, 1]];
              }, c.rotationXYMatrix = function(v, f, p) {
                return c.dot(c.dot(c.translationMatrix(f, p), c.rotationMatrix(v)), c.translationMatrix(-f, -p));
              }, c.apply3DTransform = function(v) {
                return function() {
                  var f = arguments, p = arguments.length === 1 ? f[0] : [f[0], f[1], f[2] || 0];
                  return c.dot(v, [p[0], p[1], p[2], 1]).slice(0, 3);
                };
              }, c.apply2DTransform = function(v) {
                return function() {
                  var f = arguments;
                  f.length === 3 && (f = f[0]);
                  var p = arguments.length === 1 ? f[0] : [f[0], f[1]];
                  return c.dot(v, [p[0], p[1], 1]).slice(0, 2);
                };
              }, c.apply2DTransform2 = function(v) {
                var f = c.apply2DTransform(v);
                return function(p) {
                  return f(p.slice(0, 2)).concat(f(p.slice(2, 4)));
                };
              }, c.convertCssMatrix = function(v) {
                if (v) {
                  var f = v.length;
                  if (f === 16) return v;
                  if (f === 6)
                    return [v[0], v[1], 0, 0, v[2], v[3], 0, 0, 0, 0, 1, 0, v[4], v[5], 0, 1];
                }
                return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
              }, c.inverseTransformMatrix = function(v) {
                var f = [];
                return l.invert(f, v), [[f[0], f[1], f[2], f[3]], [f[4], f[5], f[6], f[7]], [f[8], f[9], f[10], f[11]], [f[12], f[13], f[14], f[15]]];
              };
            }
          ),
          /***/
          435: (
            /***/
            function(s) {
              function c(l, v) {
                var f = l % v;
                return f < 0 ? f + v : f;
              }
              function i(l, v) {
                return Math.abs(l) > v / 2 ? l - Math.round(l / v) * v : l;
              }
              s.exports = {
                mod: c,
                modHalf: i
              };
            }
          ),
          /***/
          2296: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(8116).isArrayOrTypedArray;
              s.exports = function(E, x) {
                if (l(x)) x = String(x);
                else if (typeof x != "string" || x.substr(x.length - 4) === "[-1]")
                  throw "bad property string";
                var T = x.split("."), F, P, k, I;
                for (I = 0; I < T.length; I++)
                  if (String(T[I]).slice(0, 2) === "__")
                    throw "bad property string";
                for (I = 0; I < T.length; ) {
                  if (F = String(T[I]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/), F) {
                    if (F[1]) T[I] = F[1];
                    else if (I === 0) T.splice(0, 1);
                    else throw "bad property string";
                    for (P = F[2].substr(1, F[2].length - 2).split("]["), k = 0; k < P.length; k++)
                      I++, T.splice(I, 0, Number(P[k]));
                  }
                  I++;
                }
                return typeof E != "object" ? w(E, x, T) : {
                  set: y(E, T, x),
                  get: f(E, T),
                  astr: x,
                  parts: T,
                  obj: E
                };
              };
              function f(S, E) {
                return function() {
                  var x = S, T, F, P, k, I;
                  for (k = 0; k < E.length - 1; k++) {
                    if (T = E[k], T === -1) {
                      for (F = !0, P = [], I = 0; I < x.length; I++)
                        P[I] = f(x[I], E.slice(k + 1))(), P[I] !== P[0] && (F = !1);
                      return F ? P[0] : P;
                    }
                    if (typeof T == "number" && !v(x) || (x = x[T], typeof x != "object" || x === null))
                      return;
                  }
                  if (!(typeof x != "object" || x === null) && (P = x[E[k]], P !== null))
                    return P;
                };
              }
              var p = /(^|\.)args\[/;
              function g(S, E) {
                return S === void 0 || S === null && !E.match(p);
              }
              function y(S, E, x) {
                return function(T) {
                  var F = S, P = "", k = g(T, x), I, L;
                  for (L = 0; L < E.length - 1; L++) {
                    if (I = E[L], typeof I == "number" && !v(F))
                      throw "array index but container is not an array";
                    if (I === -1) {
                      if (k = !m(F, E.slice(L + 1), T, x), k) break;
                      return;
                    }
                    if (!h(F, I, E[L + 1], k))
                      break;
                    if (F = F[I], typeof F != "object" || F === null)
                      throw "container is not an object";
                    P = C(P, I);
                  }
                  if (k) {
                    if (L === E.length - 1 && (delete F[E[L]], Array.isArray(F) && +E[L] === F.length - 1))
                      for (; F.length && F[F.length - 1] === void 0; )
                        F.pop();
                  } else F[E[L]] = T;
                };
              }
              function C(S, E) {
                var x = E;
                return l(E) ? x = "[" + E + "]" : S && (x = "." + E), S + x;
              }
              function m(S, E, x, T) {
                var F = v(x), P = !0, k = x, I = T.replace("-1", 0), L = F ? !1 : g(x, I), A = E[0], O;
                for (O = 0; O < S.length; O++)
                  I = T.replace("-1", O), F && (k = x[O % x.length], L = g(k, I)), L && (P = !1), h(S, O, A, L) && y(S[O], E, T.replace("-1", O))(k);
                return P;
              }
              function h(S, E, x, T) {
                if (S[E] === void 0) {
                  if (T) return !1;
                  typeof x == "number" ? S[E] = [] : S[E] = {};
                }
                return !0;
              }
              function w(S, E, x) {
                return {
                  set: function() {
                    throw "bad container";
                  },
                  get: function() {
                  },
                  astr: E,
                  parts: x,
                  obj: S
                };
              }
            }
          ),
          /***/
          6628: (
            /***/
            function(s) {
              s.exports = function() {
              };
            }
          ),
          /***/
          1792: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = [];
              s.exports = function(p, g) {
                if (f.indexOf(p) !== -1) return;
                f.push(p);
                var y = 1e3;
                v(g) ? y = g : g === "long" && (y = 3e3);
                var C = l.select("body").selectAll(".plotly-notifier").data([0]);
                C.enter().append("div").classed("plotly-notifier", !0);
                var m = C.selectAll(".notifier-note").data(f);
                function h(w) {
                  w.duration(700).style("opacity", 0).each("end", function(S) {
                    var E = f.indexOf(S);
                    E !== -1 && f.splice(E, 1), l.select(this).remove();
                  });
                }
                m.enter().append("div").classed("notifier-note", !0).style("opacity", 0).each(function(w) {
                  var S = l.select(this);
                  S.append("button").classed("notifier-close", !0).html("&times;").on("click", function() {
                    S.transition().call(h);
                  });
                  for (var E = S.append("p"), x = w.split(/<br\s*\/?>/g), T = 0; T < x.length; T++)
                    T && E.append("br"), E.append("span").text(x[T]);
                  g === "stick" ? S.transition().duration(350).style("opacity", 1) : S.transition().duration(700).style("opacity", 1).transition().delay(y).call(h);
                });
              };
            }
          ),
          /***/
          2213: (
            /***/
            function(s, c, i) {
              var l = i(3972), v = "data-savedcursor", f = "!!";
              s.exports = function(g, y) {
                var C = g.attr(v);
                if (y) {
                  if (!C) {
                    for (var m = (g.attr("class") || "").split(" "), h = 0; h < m.length; h++) {
                      var w = m[h];
                      w.indexOf("cursor-") === 0 && g.attr(v, w.substr(7)).classed(w, !1);
                    }
                    g.attr(v) || g.attr(v, f);
                  }
                  l(g, y);
                } else C && (g.attr(v, null), C === f ? l(g) : l(g, C));
              };
            }
          ),
          /***/
          2065: (
            /***/
            function(s, c, i) {
              var l = i(2248).dot, v = i(9032).BADNUM, f = s.exports = {};
              f.tester = function(g) {
                var y = g.slice(), C = y[0][0], m = C, h = y[0][1], w = h, S;
                for ((y[y.length - 1][0] !== y[0][0] || y[y.length - 1][1] !== y[0][1]) && y.push(y[0]), S = 1; S < y.length; S++)
                  C = Math.min(C, y[S][0]), m = Math.max(m, y[S][0]), h = Math.min(h, y[S][1]), w = Math.max(w, y[S][1]);
                var E = !1, x;
                y.length === 5 && (y[0][0] === y[1][0] ? y[2][0] === y[3][0] && y[0][1] === y[3][1] && y[1][1] === y[2][1] && (E = !0, x = function(I) {
                  return I[0] === y[0][0];
                }) : y[0][1] === y[1][1] && y[2][1] === y[3][1] && y[0][0] === y[3][0] && y[1][0] === y[2][0] && (E = !0, x = function(I) {
                  return I[1] === y[0][1];
                }));
                function T(I, L) {
                  var A = I[0], O = I[1];
                  return !(A === v || A < C || A > m || O === v || O < h || O > w || L && x(I));
                }
                function F(I, L) {
                  var A = I[0], O = I[1];
                  if (A === v || A < C || A > m || O === v || O < h || O > w)
                    return !1;
                  var N = y.length, Y = y[0][0], j = y[0][1], te = 0, re, z, Z, W, q;
                  for (re = 1; re < N; re++)
                    if (z = Y, Z = j, Y = y[re][0], j = y[re][1], W = Math.min(z, Y), !(A < W || A > Math.max(z, Y) || O > Math.max(Z, j)))
                      if (O < Math.min(Z, j))
                        A !== W && te++;
                      else {
                        if (Y === z ? q = O : q = Z + (A - z) * (j - Z) / (Y - z), O === q)
                          return !(re === 1 && L);
                        O <= q && A !== W && te++;
                      }
                  return te % 2 === 1;
                }
                var P = !0, k = y[0];
                for (S = 1; S < y.length; S++)
                  if (k[0] !== y[S][0] || k[1] !== y[S][1]) {
                    P = !1;
                    break;
                  }
                return {
                  xmin: C,
                  xmax: m,
                  ymin: h,
                  ymax: w,
                  pts: y,
                  contains: E ? T : F,
                  isRect: E,
                  degenerate: P
                };
              }, f.isSegmentBent = function(g, y, C, m) {
                var h = g[y], w = [g[C][0] - h[0], g[C][1] - h[1]], S = l(w, w), E = Math.sqrt(S), x = [-w[1] / E, w[0] / E], T, F, P;
                for (T = y + 1; T < C; T++)
                  if (F = [g[T][0] - h[0], g[T][1] - h[1]], P = l(F, w), P < 0 || P > S || Math.abs(l(F, x)) > m) return !0;
                return !1;
              }, f.filter = function(g, y) {
                var C = [g[0]], m = 0, h = 0;
                function w(E) {
                  g.push(E);
                  var x = C.length, T = m;
                  C.splice(h + 1);
                  for (var F = T + 1; F < g.length; F++)
                    (F === g.length - 1 || f.isSegmentBent(g, T, F + 1, y)) && (C.push(g[F]), C.length < x - 2 && (m = F, h = C.length - 1), T = F);
                }
                if (g.length > 1) {
                  var S = g.pop();
                  w(S);
                }
                return {
                  addPt: w,
                  raw: g,
                  filtered: C
                };
              };
            }
          ),
          /***/
          4296: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(5928);
              s.exports = function(g) {
                var y;
                if (g && g.hasOwnProperty("userAgent") ? y = g.userAgent : y = f(), typeof y != "string") return !0;
                var C = v({
                  ua: {
                    headers: {
                      "user-agent": y
                    }
                  },
                  tablet: !0,
                  featureDetect: !1
                });
                if (!C)
                  for (var m = y.split(" "), h = 1; h < m.length; h++) {
                    var w = m[h];
                    if (w.indexOf("Safari") !== -1)
                      for (var S = h - 1; S > -1; S--) {
                        var E = m[S];
                        if (E.substr(0, 8) === "Version/") {
                          var x = E.substr(8).split(".")[0];
                          if (l(x) && (x = +x), x >= 13) return !0;
                        }
                      }
                  }
                return C;
              };
              function f() {
                var p;
                return typeof navigator < "u" && (p = navigator.userAgent), p && p.headers && typeof p.headers["user-agent"] == "string" && (p = p.headers["user-agent"]), p;
              }
            }
          ),
          /***/
          2416: (
            /***/
            function(s) {
              s.exports = function(i, l) {
                if (l instanceof RegExp) {
                  for (var v = l.toString(), f = 0; f < i.length; f++)
                    if (i[f] instanceof RegExp && i[f].toString() === v)
                      return i;
                  i.push(l);
                } else (l || l === 0) && i.indexOf(l) === -1 && i.push(l);
                return i;
              };
            }
          ),
          /***/
          4552: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(556).dfltConfig;
              function f(g, y) {
                for (var C = [], m, h = 0; h < y.length; h++)
                  m = y[h], m === g ? C[h] = m : typeof m == "object" ? C[h] = Array.isArray(m) ? l.extendDeep([], m) : l.extendDeepAll({}, m) : C[h] = m;
                return C;
              }
              var p = {};
              p.add = function(g, y, C, m, h) {
                var w, S;
                if (g.undoQueue = g.undoQueue || {
                  index: 0,
                  queue: [],
                  sequence: !1
                }, S = g.undoQueue.index, g.autoplay) {
                  g.undoQueue.inSequence || (g.autoplay = !1);
                  return;
                }
                !g.undoQueue.sequence || g.undoQueue.beginSequence ? (w = {
                  undo: {
                    calls: [],
                    args: []
                  },
                  redo: {
                    calls: [],
                    args: []
                  }
                }, g.undoQueue.queue.splice(S, g.undoQueue.queue.length - S, w), g.undoQueue.index += 1) : w = g.undoQueue.queue[S - 1], g.undoQueue.beginSequence = !1, w && (w.undo.calls.unshift(y), w.undo.args.unshift(C), w.redo.calls.push(m), w.redo.args.push(h)), g.undoQueue.queue.length > v.queueLength && (g.undoQueue.queue.shift(), g.undoQueue.index--);
              }, p.startSequence = function(g) {
                g.undoQueue = g.undoQueue || {
                  index: 0,
                  queue: [],
                  sequence: !1
                }, g.undoQueue.sequence = !0, g.undoQueue.beginSequence = !0;
              }, p.stopSequence = function(g) {
                g.undoQueue = g.undoQueue || {
                  index: 0,
                  queue: [],
                  sequence: !1
                }, g.undoQueue.sequence = !1, g.undoQueue.beginSequence = !1;
              }, p.undo = function(y) {
                var C, m;
                if (!(y.undoQueue === void 0 || isNaN(y.undoQueue.index) || y.undoQueue.index <= 0)) {
                  for (y.undoQueue.index--, C = y.undoQueue.queue[y.undoQueue.index], y.undoQueue.inSequence = !0, m = 0; m < C.undo.calls.length; m++)
                    p.plotDo(y, C.undo.calls[m], C.undo.args[m]);
                  y.undoQueue.inSequence = !1, y.autoplay = !1;
                }
              }, p.redo = function(y) {
                var C, m;
                if (!(y.undoQueue === void 0 || isNaN(y.undoQueue.index) || y.undoQueue.index >= y.undoQueue.queue.length)) {
                  for (C = y.undoQueue.queue[y.undoQueue.index], y.undoQueue.inSequence = !0, m = 0; m < C.redo.calls.length; m++)
                    p.plotDo(y, C.redo.calls[m], C.redo.args[m]);
                  y.undoQueue.inSequence = !1, y.autoplay = !1, y.undoQueue.index++;
                }
              }, p.plotDo = function(g, y, C) {
                g.autoplay = !0, C = f(g, C), y.apply(null, C);
              }, s.exports = p;
            }
          ),
          /***/
          3756: (
            /***/
            function(s, c) {
              c.counter = function(i, l, v, f) {
                var p = (l || "") + (v ? "" : "$"), g = f === !1 ? "" : "^";
                return i === "xy" ? new RegExp(g + "x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?" + p) : new RegExp(g + i + "([2-9]|[1-9][0-9]+)?" + p);
              };
            }
          ),
          /***/
          3193: (
            /***/
            function(s) {
              var c = /^(.*)(\.[^\.\[\]]+|\[\d\])$/, i = /^[^\.\[\]]+$/;
              s.exports = function(l, v) {
                for (; v; ) {
                  var f = l.match(c);
                  if (f) l = f[1];
                  else if (l.match(i)) l = "";
                  else throw new Error("bad relativeAttr call:" + [l, v]);
                  if (v.charAt(0) === "^") v = v.slice(1);
                  else break;
                }
                return l && v.charAt(0) !== "[" ? l + "." + v : l + v;
              };
            }
          ),
          /***/
          1528: (
            /***/
            function(s, c, i) {
              var l = i(8116).isArrayOrTypedArray, v = i(3620);
              s.exports = function f(p, g) {
                for (var y in g) {
                  var C = g[y], m = p[y];
                  if (m !== C)
                    if (y.charAt(0) === "_" || typeof C == "function") {
                      if (y in p) continue;
                      p[y] = C;
                    } else if (l(C) && l(m) && v(C[0])) {
                      if (y === "customdata" || y === "ids") continue;
                      for (var h = Math.min(C.length, m.length), w = 0; w < h; w++)
                        m[w] !== C[w] && v(C[w]) && v(m[w]) && f(m[w], C[w]);
                    } else v(C) && v(m) && (f(m, C), Object.keys(m).length || delete p[y]);
                }
              };
            }
          ),
          /***/
          4952: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(4248), f = i(5536), p = i(9032).BADNUM, g = 1e-9;
              c.findBin = function(w, S, E) {
                if (l(S.start))
                  return E ? Math.ceil((w - S.start) / S.size - g) - 1 : Math.floor((w - S.start) / S.size + g);
                var x = 0, T = S.length, F = 0, P = T > 1 ? (S[T - 1] - S[0]) / (T - 1) : 1, k, I;
                for (P >= 0 ? I = E ? y : C : I = E ? h : m, w += P * g * (E ? -1 : 1) * (P >= 0 ? 1 : -1); x < T && F++ < 100; )
                  k = Math.floor((x + T) / 2), I(S[k], w) ? x = k + 1 : T = k;
                return F > 90 && v.log("Long binary search..."), x - 1;
              };
              function y(w, S) {
                return w < S;
              }
              function C(w, S) {
                return w <= S;
              }
              function m(w, S) {
                return w > S;
              }
              function h(w, S) {
                return w >= S;
              }
              c.sorterAsc = function(w, S) {
                return w - S;
              }, c.sorterDes = function(w, S) {
                return S - w;
              }, c.distinctVals = function(w) {
                var S = w.slice();
                S.sort(c.sorterAsc);
                var E;
                for (E = S.length - 1; E > -1 && S[E] === p; E--)
                  ;
                for (var x = S[E] - S[0] || 1, T = x / (E || 1) / 1e4, F = [], P, k = 0; k <= E; k++) {
                  var I = S[k], L = I - P;
                  P === void 0 ? (F.push(I), P = I) : L > T && (x = Math.min(x, L), F.push(I), P = I);
                }
                return {
                  vals: F,
                  minDiff: x
                };
              }, c.roundUp = function(w, S, E) {
                for (var x = 0, T = S.length - 1, F, P = 0, k = E ? 0 : 1, I = E ? 1 : 0, L = E ? Math.ceil : Math.floor; x < T && P++ < 100; )
                  F = L((x + T) / 2), S[F] <= w ? x = F + k : T = F - I;
                return S[x];
              }, c.sort = function(w, S) {
                for (var E = 0, x = 0, T = 1; T < w.length; T++) {
                  var F = S(w[T], w[T - 1]);
                  if (F < 0 ? E = 1 : F > 0 && (x = 1), E && x) return w.sort(S);
                }
                return x ? w : w.reverse();
              }, c.findIndexOfMin = function(w, S) {
                S = S || f;
                for (var E = 1 / 0, x, T = 0; T < w.length; T++) {
                  var F = S(w[T]);
                  F < E && (E = F, x = T);
                }
                return x;
              };
            }
          ),
          /***/
          3972: (
            /***/
            function(s) {
              s.exports = function(i, l) {
                (i.attr("class") || "").split(" ").forEach(function(v) {
                  v.indexOf("cursor-") === 0 && i.classed(v, !1);
                }), l && i.classed("cursor-" + l, !0);
              };
            }
          ),
          /***/
          2996: (
            /***/
            function(s) {
              s.exports = function(i) {
                return Object.keys(i).sort();
              };
            }
          ),
          /***/
          3084: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(8116).isArrayOrTypedArray;
              c.aggNums = function(f, p, g, y) {
                var C, m;
                if ((!y || y > g.length) && (y = g.length), l(p) || (p = !1), v(g[0])) {
                  for (m = new Array(y), C = 0; C < y; C++) m[C] = c.aggNums(f, p, g[C]);
                  g = m;
                }
                for (C = 0; C < y; C++)
                  l(p) ? l(g[C]) && (p = f(+p, +g[C])) : p = g[C];
                return p;
              }, c.len = function(f) {
                return c.aggNums(function(p) {
                  return p + 1;
                }, 0, f);
              }, c.mean = function(f, p) {
                return p || (p = c.len(f)), c.aggNums(function(g, y) {
                  return g + y;
                }, 0, f) / p;
              }, c.midRange = function(f) {
                if (!(f === void 0 || f.length === 0))
                  return (c.aggNums(Math.max, null, f) + c.aggNums(Math.min, null, f)) / 2;
              }, c.variance = function(f, p, g) {
                return p || (p = c.len(f)), l(g) || (g = c.mean(f, p)), c.aggNums(function(y, C) {
                  return y + Math.pow(C - g, 2);
                }, 0, f) / p;
              }, c.stdev = function(f, p, g) {
                return Math.sqrt(c.variance(f, p, g));
              }, c.median = function(f) {
                var p = f.slice().sort();
                return c.interp(p, 0.5);
              }, c.interp = function(f, p) {
                if (!l(p)) throw "n should be a finite number";
                if (p = p * f.length - 0.5, p < 0) return f[0];
                if (p > f.length - 1) return f[f.length - 1];
                var g = p % 1;
                return g * f[Math.ceil(p)] + (1 - g) * f[Math.floor(p)];
              };
            }
          ),
          /***/
          2736: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3400), f = v.strTranslate, p = i(9616), g = i(4284).LINE_SPACING, y = /([^$]*)([$]+[^$]*[$]+)([^$]*)/;
              c.convertToTspans = function(ne, se, le) {
                var ue = ne.text(), ve = !ne.attr("data-notex") && se && se._context.typesetMath && typeof MathJax < "u" && ue.match(y), be = l.select(ne.node().parentNode);
                if (be.empty()) return;
                var Me = ne.attr("class") ? ne.attr("class").split(" ")[0] : "text";
                Me += "-math", be.selectAll("svg." + Me).remove(), be.selectAll("g." + Me + "-group").remove(), ne.style("display", null).attr({
                  // some callers use data-unformatted *from the <text> element* in 'cancel'
                  // so we need it here even if we're going to turn it into math
                  // these two (plus style and text-anchor attributes) form the key we're
                  // going to use for Drawing.bBox
                  "data-unformatted": ue,
                  "data-math": "N"
                });
                function Ge() {
                  be.empty() || (Me = ne.attr("class") + "-math", be.select("svg." + Me).remove()), ne.text("").style("white-space", "pre");
                  var we = ie(ne.node(), ue);
                  we && ne.style("pointer-events", "all"), c.positionText(ne), le && le.call(ne);
                }
                return ve ? (se && se._promises || []).push(new Promise(function(we) {
                  ne.style("display", "none");
                  var Re = parseInt(ne.node().style.fontSize, 10), Ae = {
                    fontSize: Re
                  };
                  S(ve[2], Ae, function(K, ee, oe) {
                    be.selectAll("svg." + Me).remove(), be.selectAll("g." + Me + "-group").remove();
                    var _ = K && K.select("svg");
                    if (!_ || !_.node()) {
                      Ge(), we();
                      return;
                    }
                    var V = be.append("g").classed(Me + "-group", !0).attr({
                      "pointer-events": "none",
                      "data-unformatted": ue,
                      "data-math": "Y"
                    });
                    V.node().appendChild(_.node()), ee && ee.node() && _.node().insertBefore(ee.node().cloneNode(!0), _.node().firstChild);
                    var fe = oe.width, $ = oe.height;
                    _.attr({
                      class: Me,
                      height: $,
                      preserveAspectRatio: "xMinYMin meet"
                    }).style({
                      overflow: "visible",
                      "pointer-events": "none"
                    });
                    var he = ne.node().style.fill || "black", me = _.select("g");
                    me.attr({
                      fill: he,
                      stroke: he
                    });
                    var xe = me.node().getBoundingClientRect(), Fe = xe.width, Ve = xe.height;
                    (Fe > fe || Ve > $) && (_.style("overflow", "hidden"), xe = _.node().getBoundingClientRect(), Fe = xe.width, Ve = xe.height);
                    var Be = +ne.attr("x"), Je = +ne.attr("y"), et = Re || ne.node().getBoundingClientRect().height, at = -et / 4;
                    if (Me[0] === "y")
                      V.attr({
                        transform: "rotate(" + [-90, Be, Je] + ")" + f(-Fe / 2, at - Ve / 2)
                      });
                    else if (Me[0] === "l")
                      Je = at - Ve / 2;
                    else if (Me[0] === "a" && Me.indexOf("atitle") !== 0)
                      Be = 0, Je = at;
                    else {
                      var De = ne.attr("text-anchor");
                      Be = Be - Fe * (De === "middle" ? 0.5 : De === "end" ? 1 : 0), Je = Je + at - Ve / 2;
                    }
                    _.attr({
                      x: Be,
                      y: Je
                    }), le && le.call(ne, V), we(V);
                  });
                })) : Ge(), ne;
              };
              var C = /(<|&lt;|&#60;)/g, m = /(>|&gt;|&#62;)/g;
              function h(ne) {
                return ne.replace(C, "\\lt ").replace(m, "\\gt ");
              }
              var w = [["$", "$"], ["\\(", "\\)"]];
              function S(ne, se, le) {
                var ue = parseInt((MathJax.version || "").split(".")[0]);
                if (ue !== 2 && ue !== 3) {
                  v.warn("No MathJax version:", MathJax.version);
                  return;
                }
                var ve, be, Me, Ge, we = function() {
                  return be = v.extendDeepAll({}, MathJax.Hub.config), Me = MathJax.Hub.processSectionDelay, MathJax.Hub.processSectionDelay !== void 0 && (MathJax.Hub.processSectionDelay = 0), MathJax.Hub.Config({
                    messageStyle: "none",
                    tex2jax: {
                      inlineMath: w
                    },
                    displayAlign: "left"
                  });
                }, Re = function() {
                  be = v.extendDeepAll({}, MathJax.config), MathJax.config.tex || (MathJax.config.tex = {}), MathJax.config.tex.inlineMath = w;
                }, Ae = function() {
                  if (ve = MathJax.Hub.config.menuSettings.renderer, ve !== "SVG")
                    return MathJax.Hub.setRenderer("SVG");
                }, K = function() {
                  ve = MathJax.config.startup.output, ve !== "svg" && (MathJax.config.startup.output = "svg");
                }, ee = function() {
                  var he = "math-output-" + v.randstr({}, 64);
                  Ge = l.select("body").append("div").attr({
                    id: he
                  }).style({
                    visibility: "hidden",
                    position: "absolute",
                    "font-size": se.fontSize + "px"
                  }).text(h(ne));
                  var me = Ge.node();
                  return ue === 2 ? MathJax.Hub.Typeset(me) : MathJax.typeset([me]);
                }, oe = function() {
                  var he = Ge.select(ue === 2 ? ".MathJax_SVG" : ".MathJax"), me = !he.empty() && Ge.select("svg").node();
                  if (!me)
                    v.log("There was an error in the tex syntax.", ne), le();
                  else {
                    var xe = me.getBoundingClientRect(), Fe;
                    ue === 2 ? Fe = l.select("body").select("#MathJax_SVG_glyphs") : Fe = he.select("defs"), le(he, Fe, xe);
                  }
                  Ge.remove();
                }, _ = function() {
                  if (ve !== "SVG")
                    return MathJax.Hub.setRenderer(ve);
                }, V = function() {
                  ve !== "svg" && (MathJax.config.startup.output = ve);
                }, fe = function() {
                  return Me !== void 0 && (MathJax.Hub.processSectionDelay = Me), MathJax.Hub.Config(be);
                }, $ = function() {
                  MathJax.config = be;
                };
                ue === 2 ? MathJax.Hub.Queue(we, Ae, ee, oe, _, fe) : ue === 3 && (Re(), K(), MathJax.startup.defaultReady(), MathJax.startup.promise.then(function() {
                  ee(), oe(), V(), $();
                }));
              }
              var E = {
                // would like to use baseline-shift for sub/sup but FF doesn't support it
                // so we need to use dy along with the uber hacky shift-back-to
                // baseline below
                sup: "font-size:70%",
                sub: "font-size:70%",
                b: "font-weight:bold",
                i: "font-style:italic",
                a: "cursor:pointer",
                span: "",
                em: "font-style:italic;font-weight:bold"
              }, x = {
                sub: "0.3em",
                sup: "-0.6em"
              }, T = {
                sub: "-0.21em",
                sup: "0.42em"
              }, F = "​", P = ["http:", "https:", "mailto:", "", void 0, ":"], k = c.NEWLINES = /(\r\n?|\n)/g, I = /(<[^<>]*>)/, L = /<(\/?)([^ >]*)(\s+(.*))?>/i, A = /<br(\s+.*)?>/i;
              c.BR_TAG_ALL = /<br(\s+.*)?>/gi;
              var O = /(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i, N = /(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i, Y = /(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i, j = /(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;
              function te(ne, se) {
                if (!ne) return null;
                var le = ne.match(se), ue = le && (le[3] || le[4]);
                return ue && W(ue);
              }
              var re = /(^|;)\s*color:/;
              c.plainText = function(ne, se) {
                se = se || {};
                for (var le = se.len !== void 0 && se.len !== -1 ? se.len : 1 / 0, ue = se.allowedTags !== void 0 ? se.allowedTags : ["br"], ve = "...", be = ve.length, Me = ne.split(I), Ge = [], we = "", Re = 0, Ae = 0; Ae < Me.length; Ae++) {
                  var K = Me[Ae], ee = K.match(L), oe = ee && ee[2].toLowerCase();
                  if (oe)
                    ue.indexOf(oe) !== -1 && (Ge.push(K), we = oe);
                  else {
                    var _ = K.length;
                    if (Re + _ < le)
                      Ge.push(K), Re += _;
                    else if (Re < le) {
                      var V = le - Re;
                      we && (we !== "br" || V <= be || _ <= be) && Ge.pop(), le > be ? Ge.push(K.substr(0, V - be) + ve) : Ge.push(K.substr(0, V));
                      break;
                    }
                    we = "";
                  }
                }
                return Ge.join("");
              };
              var z = {
                mu: "μ",
                amp: "&",
                lt: "<",
                gt: ">",
                nbsp: " ",
                times: "×",
                plusmn: "±",
                deg: "°"
              }, Z = /&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;
              function W(ne) {
                return ne.replace(Z, function(se, le) {
                  var ue;
                  return le.charAt(0) === "#" ? ue = q(le.charAt(1) === "x" ? parseInt(le.substr(2), 16) : parseInt(le.substr(1), 10)) : ue = z[le], ue || se;
                });
              }
              c.convertEntities = W;
              function q(ne) {
                if (!(ne > 1114111)) {
                  var se = String.fromCodePoint;
                  if (se) return se(ne);
                  var le = String.fromCharCode;
                  return ne <= 65535 ? le(ne) : le((ne >> 10) + 55232, ne % 1024 + 56320);
                }
              }
              function ie(ne, se) {
                se = se.replace(k, " ");
                var le = !1, ue = [], ve, be = -1;
                function Me() {
                  be++;
                  var Ve = document.createElementNS(p.svg, "tspan");
                  l.select(Ve).attr({
                    class: "line",
                    dy: be * g + "em"
                  }), ne.appendChild(Ve), ve = Ve;
                  var Be = ue;
                  if (ue = [{
                    node: Ve
                  }], Be.length > 1)
                    for (var Je = 1; Je < Be.length; Je++)
                      Ge(Be[Je]);
                }
                function Ge(Ve) {
                  var Be = Ve.type, Je = {}, et;
                  if (Be === "a") {
                    et = "a";
                    var at = Ve.target, De = Ve.href, Ne = Ve.popup;
                    De && (Je = {
                      "xlink:xlink:show": at === "_blank" || at.charAt(0) !== "_" ? "new" : "replace",
                      target: at,
                      "xlink:xlink:href": De
                    }, Ne && (Je.onclick = 'window.open(this.href.baseVal,this.target.baseVal,"' + Ne + '");return false;'));
                  } else et = "tspan";
                  Ve.style && (Je.style = Ve.style);
                  var Ie = document.createElementNS(p.svg, et);
                  if (Be === "sup" || Be === "sub") {
                    we(ve, F), ve.appendChild(Ie);
                    var Ue = document.createElementNS(p.svg, "tspan");
                    we(Ue, F), l.select(Ue).attr("dy", T[Be]), Je.dy = x[Be], ve.appendChild(Ie), ve.appendChild(Ue);
                  } else
                    ve.appendChild(Ie);
                  l.select(Ie).attr(Je), ve = Ve.node = Ie, ue.push(Ve);
                }
                function we(Ve, Be) {
                  Ve.appendChild(document.createTextNode(Be));
                }
                function Re(Ve) {
                  if (ue.length === 1) {
                    v.log("Ignoring unexpected end tag </" + Ve + ">.", se);
                    return;
                  }
                  var Be = ue.pop();
                  Ve !== Be.type && v.log("Start tag <" + Be.type + "> doesnt match end tag <" + Ve + ">. Pretending it did match.", se), ve = ue[ue.length - 1].node;
                }
                var Ae = A.test(se);
                Ae ? Me() : (ve = ne, ue = [{
                  node: ne
                }]);
                for (var K = se.split(I), ee = 0; ee < K.length; ee++) {
                  var oe = K[ee], _ = oe.match(L), V = _ && _[2].toLowerCase(), fe = E[V];
                  if (V === "br")
                    Me();
                  else if (fe === void 0)
                    we(ve, W(oe));
                  else if (_[1])
                    Re(V);
                  else {
                    var $ = _[4], he = {
                      type: V
                    }, me = te($, O);
                    if (me ? (me = me.replace(re, "$1 fill:"), fe && (me += ";" + fe)) : fe && (me = fe), me && (he.style = me), V === "a") {
                      le = !0;
                      var xe = te($, N);
                      if (xe) {
                        var Fe = ce(xe);
                        Fe && (he.href = Fe, he.target = te($, Y) || "_blank", he.popup = te($, j));
                      }
                    }
                    Ge(he);
                  }
                }
                return le;
              }
              function ce(ne) {
                var se = encodeURI(decodeURI(ne)), le = document.createElement("a"), ue = document.createElement("a");
                le.href = ne, ue.href = se;
                var ve = le.protocol, be = ue.protocol;
                return P.indexOf(ve) !== -1 && P.indexOf(be) !== -1 ? se : "";
              }
              c.sanitizeHTML = function(se) {
                se = se.replace(k, " ");
                for (var le = document.createElement("p"), ue = le, ve = [], be = se.split(I), Me = 0; Me < be.length; Me++) {
                  var Ge = be[Me], we = Ge.match(L), Re = we && we[2].toLowerCase();
                  if (Re in E)
                    if (we[1])
                      ve.length && (ue = ve.pop());
                    else {
                      var Ae = we[4], K = te(Ae, O), ee = K ? {
                        style: K
                      } : {};
                      if (Re === "a") {
                        var oe = te(Ae, N);
                        if (oe) {
                          var _ = ce(oe);
                          if (_) {
                            ee.href = _;
                            var V = te(Ae, Y);
                            V && (ee.target = V);
                          }
                        }
                      }
                      var fe = document.createElement(Re);
                      ue.appendChild(fe), l.select(fe).attr(ee), ue = fe, ve.push(fe);
                    }
                  else
                    ue.appendChild(document.createTextNode(W(Ge)));
                }
                var $ = "innerHTML";
                return le[$];
              }, c.lineCount = function(se) {
                return se.selectAll("tspan.line").size() || 1;
              }, c.positionText = function(se, le, ue) {
                return se.each(function() {
                  var ve = l.select(this);
                  function be(we, Re) {
                    return Re === void 0 ? (Re = ve.attr(we), Re === null && (ve.attr(we, 0), Re = 0)) : ve.attr(we, Re), Re;
                  }
                  var Me = be("x", le), Ge = be("y", ue);
                  this.nodeName === "text" && ve.selectAll("tspan.line").attr({
                    x: Me,
                    y: Ge
                  });
                });
              };
              function X(ne, se, le) {
                var ue = le.horizontalAlign, ve = le.verticalAlign || "top", be = ne.node().getBoundingClientRect(), Me = se.node().getBoundingClientRect(), Ge, we, Re;
                return ve === "bottom" ? we = function() {
                  return be.bottom - Ge.height;
                } : ve === "middle" ? we = function() {
                  return be.top + (be.height - Ge.height) / 2;
                } : we = function() {
                  return be.top;
                }, ue === "right" ? Re = function() {
                  return be.right - Ge.width;
                } : ue === "center" ? Re = function() {
                  return be.left + (be.width - Ge.width) / 2;
                } : Re = function() {
                  return be.left;
                }, function() {
                  Ge = this.node().getBoundingClientRect();
                  var Ae = Re() - Me.left, K = we() - Me.top, ee = le.gd || {};
                  if (le.gd) {
                    ee._fullLayout._calcInverseTransform(ee);
                    var oe = v.apply3DTransform(ee._fullLayout._invTransform)(Ae, K);
                    Ae = oe[0], K = oe[1];
                  }
                  return this.style({
                    top: K + "px",
                    left: Ae + "px",
                    "z-index": 1e3
                  }), this;
                };
              }
              var U = "1px ";
              c.makeTextShadow = function(ne) {
                var se = U, le = U, ue = U;
                return se + le + ue + ne + ", -" + se + "-" + le + ue + ne + ", " + se + "-" + le + ue + ne + ", -" + se + le + ue + ne;
              }, c.makeEditable = function(ne, se) {
                var le = se.gd, ue = se.delegate, ve = l.dispatch("edit", "input", "cancel"), be = ue || ne;
                if (ne.style({
                  "pointer-events": ue ? "none" : "all"
                }), ne.size() !== 1) throw new Error("boo");
                function Me() {
                  we(), ne.style({
                    opacity: 0
                  });
                  var Re = be.attr("class"), Ae;
                  Re ? Ae = "." + Re.split(" ")[0] + "-math-group" : Ae = "[class*=-math-group]", Ae && l.select(ne.node().parentNode).select(Ae).style({
                    opacity: 0
                  });
                }
                function Ge(Re) {
                  var Ae = Re.node(), K = document.createRange();
                  K.selectNodeContents(Ae);
                  var ee = window.getSelection();
                  ee.removeAllRanges(), ee.addRange(K), Ae.focus();
                }
                function we() {
                  var Re = l.select(le), Ae = Re.select(".svg-container"), K = Ae.append("div"), ee = ne.node().style, oe = parseFloat(ee.fontSize || 12), _ = se.text;
                  _ === void 0 && (_ = ne.attr("data-unformatted")), K.classed("plugin-editable editable", !0).style({
                    position: "absolute",
                    "font-family": ee.fontFamily || "Arial",
                    "font-size": oe,
                    color: se.fill || ee.fill || "black",
                    opacity: 1,
                    "background-color": se.background || "transparent",
                    outline: "#ffffff33 1px solid",
                    margin: [-oe / 8 + 1, 0, 0, -1].join("px ") + "px",
                    padding: "0",
                    "box-sizing": "border-box"
                  }).attr({
                    contenteditable: !0
                  }).text(_).call(X(ne, Ae, se)).on("blur", function() {
                    le._editing = !1, ne.text(this.textContent).style({
                      opacity: 1
                    });
                    var V = l.select(this).attr("class"), fe;
                    V ? fe = "." + V.split(" ")[0] + "-math-group" : fe = "[class*=-math-group]", fe && l.select(ne.node().parentNode).select(fe).style({
                      opacity: 0
                    });
                    var $ = this.textContent;
                    l.select(this).transition().duration(0).remove(), l.select(document).on("mouseup", null), ve.edit.call(ne, $);
                  }).on("focus", function() {
                    var V = this;
                    le._editing = !0, l.select(document).on("mouseup", function() {
                      if (l.event.target === V) return !1;
                      document.activeElement === K.node() && K.node().blur();
                    });
                  }).on("keyup", function() {
                    l.event.which === 27 ? (le._editing = !1, ne.style({
                      opacity: 1
                    }), l.select(this).style({
                      opacity: 0
                    }).on("blur", function() {
                      return !1;
                    }).transition().remove(), ve.cancel.call(ne, this.textContent)) : (ve.input.call(ne, this.textContent), l.select(this).call(X(ne, Ae, se)));
                  }).on("keydown", function() {
                    l.event.which === 13 && this.blur();
                  }).call(Ge);
                }
                return se.immediate ? Me() : be.on("click", Me), l.rebind(ne, ve, "on");
              };
            }
          ),
          /***/
          1200: (
            /***/
            function(s, c) {
              var i = {};
              c.throttle = function(f, p, g) {
                var y = i[f], C = Date.now();
                if (!y) {
                  for (var m in i)
                    i[m].ts < C - 6e4 && delete i[m];
                  y = i[f] = {
                    ts: 0,
                    timer: null
                  };
                }
                l(y);
                function h() {
                  g(), y.ts = Date.now(), y.onDone && (y.onDone(), y.onDone = null);
                }
                if (C > y.ts + p) {
                  h();
                  return;
                }
                y.timer = setTimeout(function() {
                  h(), y.timer = null;
                }, p);
              }, c.done = function(v) {
                var f = i[v];
                return !f || !f.timer ? Promise.resolve() : new Promise(function(p) {
                  var g = f.onDone;
                  f.onDone = function() {
                    g && g(), p(), f.onDone = null;
                  };
                });
              }, c.clear = function(v) {
                if (v)
                  l(i[v]), delete i[v];
                else
                  for (var f in i) c.clear(f);
              };
              function l(v) {
                v && v.timer !== null && (clearTimeout(v.timer), v.timer = null);
              }
            }
          ),
          /***/
          6896: (
            /***/
            function(s, c, i) {
              var l = i(8248);
              s.exports = function(f, p) {
                if (f > 0) return Math.log(f) / Math.LN10;
                var g = Math.log(Math.min(p[0], p[1])) / Math.LN10;
                return l(g) || (g = Math.log(Math.max(p[0], p[1])) / Math.LN10 - 6), g;
              };
            }
          ),
          /***/
          1680: (
            /***/
            function(s) {
              s.exports = {
                moduleType: "locale",
                name: "en-US",
                dictionary: {
                  "Click to enter Colorscale title": "Click to enter Colorscale title"
                },
                format: {
                  date: "%m/%d/%Y"
                }
              };
            }
          ),
          /***/
          6580: (
            /***/
            function(s) {
              s.exports = {
                moduleType: "locale",
                name: "en",
                dictionary: {
                  "Click to enter Colorscale title": "Click to enter Colourscale title"
                },
                format: {
                  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"],
                  periods: ["AM", "PM"],
                  dateTime: "%a %b %e %X %Y",
                  date: "%d/%m/%Y",
                  time: "%H:%M:%S",
                  decimal: ".",
                  thousands: ",",
                  grouping: [3],
                  currency: ["$", ""],
                  year: "%Y",
                  month: "%b %Y",
                  dayMonth: "%b %-d",
                  dayMonthYear: "%b %-d, %Y"
                }
              };
            }
          ),
          /***/
          9820: (
            /***/
            function(s, c, i) {
              var l = i(4040);
              s.exports = function(f) {
                for (var p = l.layoutArrayContainers, g = l.layoutArrayRegexes, y = f.split("[")[0], C, m, h = 0; h < g.length; h++)
                  if (m = f.match(g[h]), m && m.index === 0) {
                    C = m[0];
                    break;
                  }
                if (C || (C = p[p.indexOf(y)]), !C) return !1;
                var w = f.substr(C.length);
                return w ? (m = w.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/), m ? {
                  array: C,
                  index: Number(m[1]),
                  property: m[3] || ""
                } : !1) : {
                  array: C,
                  index: "",
                  property: ""
                };
              };
            }
          ),
          /***/
          7824: (
            /***/
            function(s, c, i) {
              var l = i(2880).extendFlat, v = i(3620), f = {
                valType: "flaglist",
                extras: ["none"],
                flags: ["calc", "clearAxisTypes", "plot", "style", "markerSize", "colorbars"]
              }, p = {
                valType: "flaglist",
                extras: ["none"],
                flags: ["calc", "plot", "legend", "ticks", "axrange", "layoutstyle", "modebar", "camera", "arraydraw", "colorbars"]
              }, g = f.flags.slice().concat(["fullReplot"]), y = p.flags.slice().concat("layoutReplot");
              s.exports = {
                traces: f,
                layout: p,
                /*
                 * default (all false) edit flags for restyle (traces)
                 * creates a new object each call, so the caller can mutate freely
                 */
                traceFlags: function() {
                  return C(g);
                },
                /*
                 * default (all false) edit flags for relayout
                 * creates a new object each call, so the caller can mutate freely
                 */
                layoutFlags: function() {
                  return C(y);
                },
                /*
                 * update `flags` with the `editType` values found in `attr`
                 */
                update: function(w, S) {
                  var E = S.editType;
                  if (E && E !== "none")
                    for (var x = E.split("+"), T = 0; T < x.length; T++)
                      w[x[T]] = !0;
                },
                overrideAll: m
              };
              function C(w) {
                for (var S = {}, E = 0; E < w.length; E++) S[w[E]] = !1;
                return S;
              }
              function m(w, S, E) {
                var x = l({}, w);
                for (var T in x) {
                  var F = x[T];
                  v(F) && (x[T] = h(F, S, E, T));
                }
                return E === "from-root" && (x.editType = S), x;
              }
              function h(w, S, E, x) {
                if (w.valType) {
                  var T = l({}, w);
                  if (T.editType = S, Array.isArray(w.items)) {
                    T.items = new Array(w.items.length);
                    for (var F = 0; F < w.items.length; F++)
                      T.items[F] = h(w.items[F], S);
                  }
                  return T;
                } else
                  return m(w, S, x.charAt(0) === "_" ? "nested" : "from-root");
              }
            }
          ),
          /***/
          3404: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(1784), f = i(4040), p = i(3400), g = i(7316), y = i(9811), C = i(6308), m = y.cleanId, h = y.getFromTrace, w = f.traceIs;
              c.clearPromiseQueue = function(A) {
                Array.isArray(A._promises) && A._promises.length > 0 && p.log("Clearing previous rejected promises from queue."), A._promises = [];
              }, c.cleanLayout = function(A) {
                var O, N;
                A || (A = {}), A.xaxis1 && (A.xaxis || (A.xaxis = A.xaxis1), delete A.xaxis1), A.yaxis1 && (A.yaxis || (A.yaxis = A.yaxis1), delete A.yaxis1), A.scene1 && (A.scene || (A.scene = A.scene1), delete A.scene1);
                var Y = (g.subplotsRegistry.cartesian || {}).attrRegex, j = (g.subplotsRegistry.polar || {}).attrRegex, te = (g.subplotsRegistry.ternary || {}).attrRegex, re = (g.subplotsRegistry.gl3d || {}).attrRegex, z = Object.keys(A);
                for (O = 0; O < z.length; O++) {
                  var Z = z[O];
                  if (Y && Y.test(Z)) {
                    var W = A[Z];
                    W.anchor && W.anchor !== "free" && (W.anchor = m(W.anchor)), W.overlaying && (W.overlaying = m(W.overlaying)), W.type || (W.isdate ? W.type = "date" : W.islog ? W.type = "log" : W.isdate === !1 && W.islog === !1 && (W.type = "linear")), (W.autorange === "withzero" || W.autorange === "tozero") && (W.autorange = !0, W.rangemode = "tozero"), W.insiderange && delete W.range, delete W.islog, delete W.isdate, delete W.categories, P(W, "domain") && delete W.domain, W.autotick !== void 0 && (W.tickmode === void 0 && (W.tickmode = W.autotick ? "auto" : "linear"), delete W.autotick), E(W);
                  } else if (j && j.test(Z)) {
                    var q = A[Z];
                    E(q.radialaxis);
                  } else if (te && te.test(Z)) {
                    var ie = A[Z];
                    E(ie.aaxis), E(ie.baxis), E(ie.caxis);
                  } else if (re && re.test(Z)) {
                    var ce = A[Z], X = ce.cameraposition;
                    if (Array.isArray(X) && X[0].length === 4) {
                      var U = X[0], ne = X[1], se = X[2], le = v([], U), ue = [];
                      for (N = 0; N < 3; ++N)
                        ue[N] = ne[N] + se * le[2 + 4 * N];
                      ce.camera = {
                        eye: {
                          x: ue[0],
                          y: ue[1],
                          z: ue[2]
                        },
                        center: {
                          x: ne[0],
                          y: ne[1],
                          z: ne[2]
                        },
                        up: {
                          x: 0,
                          y: 0,
                          z: 1
                        }
                        // we just ignore calculating camera z up in this case
                      }, delete ce.cameraposition;
                    }
                    E(ce.xaxis), E(ce.yaxis), E(ce.zaxis);
                  }
                }
                var ve = Array.isArray(A.annotations) ? A.annotations.length : 0;
                for (O = 0; O < ve; O++) {
                  var be = A.annotations[O];
                  p.isPlainObject(be) && (be.ref && (be.ref === "paper" ? (be.xref = "paper", be.yref = "paper") : be.ref === "data" && (be.xref = "x", be.yref = "y"), delete be.ref), S(be, "xref"), S(be, "yref"));
                }
                var Me = Array.isArray(A.shapes) ? A.shapes.length : 0;
                for (O = 0; O < Me; O++) {
                  var Ge = A.shapes[O];
                  p.isPlainObject(Ge) && (S(Ge, "xref"), S(Ge, "yref"));
                }
                var we = Array.isArray(A.images) ? A.images.length : 0;
                for (O = 0; O < we; O++) {
                  var Re = A.images[O];
                  p.isPlainObject(Re) && (S(Re, "xref"), S(Re, "yref"));
                }
                var Ae = A.legend;
                return Ae && (Ae.x > 3 ? (Ae.x = 1.02, Ae.xanchor = "left") : Ae.x < -2 && (Ae.x = -0.02, Ae.xanchor = "right"), Ae.y > 3 ? (Ae.y = 1.02, Ae.yanchor = "bottom") : Ae.y < -2 && (Ae.y = -0.02, Ae.yanchor = "top")), E(A), A.dragmode === "rotate" && (A.dragmode = "orbit"), C.clean(A), A.template && A.template.layout && c.cleanLayout(A.template.layout), A;
              };
              function S(A, O) {
                var N = A[O], Y = O.charAt(0);
                N && N !== "paper" && (A[O] = m(N, Y, !0));
              }
              function E(A) {
                A && ((typeof A.title == "string" || typeof A.title == "number") && (A.title = {
                  text: A.title
                }), O("titlefont", "font"), O("titleposition", "position"), O("titleside", "side"), O("titleoffset", "offset"));
                function O(N, Y) {
                  var j = A[N], te = A.title && A.title[Y];
                  j && !te && (A.title || (A.title = {}), A.title[Y] = A[N], delete A[N]);
                }
              }
              c.cleanData = function(A) {
                for (var O = 0; O < A.length; O++) {
                  var N = A[O], Y;
                  if (N.type === "histogramy" && "xbins" in N && !("ybins" in N) && (N.ybins = N.xbins, delete N.xbins), N.error_y && "opacity" in N.error_y) {
                    var j = C.defaults, te = N.error_y.color || (w(N, "bar") ? C.defaultLine : j[O % j.length]);
                    N.error_y.color = C.addOpacity(C.rgb(te), C.opacity(te) * N.error_y.opacity), delete N.error_y.opacity;
                  }
                  if ("bardir" in N && (N.bardir === "h" && (w(N, "bar") || N.type.substr(0, 9) === "histogram") && (N.orientation = "h", c.swapXYData(N)), delete N.bardir), N.type === "histogramy" && c.swapXYData(N), (N.type === "histogramx" || N.type === "histogramy") && (N.type = "histogram"), "scl" in N && !("colorscale" in N) && (N.colorscale = N.scl, delete N.scl), "reversescl" in N && !("reversescale" in N) && (N.reversescale = N.reversescl, delete N.reversescl), N.xaxis && (N.xaxis = m(N.xaxis, "x")), N.yaxis && (N.yaxis = m(N.yaxis, "y")), w(N, "gl3d") && N.scene && (N.scene = g.subplotsRegistry.gl3d.cleanId(N.scene)), !w(N, "pie-like") && !w(N, "bar-like"))
                    if (Array.isArray(N.textposition))
                      for (Y = 0; Y < N.textposition.length; Y++)
                        N.textposition[Y] = F(N.textposition[Y]);
                    else N.textposition && (N.textposition = F(N.textposition));
                  var re = f.getModule(N);
                  if (re && re.colorbar) {
                    var z = re.colorbar.container, Z = z ? N[z] : N;
                    Z && Z.colorscale && (Z.colorscale === "YIGnBu" && (Z.colorscale = "YlGnBu"), Z.colorscale === "YIOrRd" && (Z.colorscale = "YlOrRd"));
                  }
                  if (N.type === "surface" && p.isPlainObject(N.contours)) {
                    var W = ["x", "y", "z"];
                    for (Y = 0; Y < W.length; Y++) {
                      var q = N.contours[W[Y]];
                      p.isPlainObject(q) && (q.highlightColor && (q.highlightcolor = q.highlightColor, delete q.highlightColor), q.highlightWidth && (q.highlightwidth = q.highlightWidth, delete q.highlightWidth));
                    }
                  }
                  if (N.type === "candlestick" || N.type === "ohlc") {
                    var ie = (N.increasing || {}).showlegend !== !1, ce = (N.decreasing || {}).showlegend !== !1, X = x(N.increasing), U = x(N.decreasing);
                    if (X !== !1 && U !== !1) {
                      var ne = T(X, U, ie, ce);
                      ne && (N.name = ne);
                    } else (X || U) && !N.name && (N.name = X || U);
                  }
                  if (Array.isArray(N.transforms)) {
                    var se = N.transforms;
                    for (Y = 0; Y < se.length; Y++) {
                      var le = se[Y];
                      if (p.isPlainObject(le))
                        switch (le.type) {
                          case "filter":
                            le.filtersrc && (le.target = le.filtersrc, delete le.filtersrc), le.calendar && (le.valuecalendar || (le.valuecalendar = le.calendar), delete le.calendar);
                            break;
                          case "groupby":
                            if (le.styles = le.styles || le.style, le.styles && !Array.isArray(le.styles)) {
                              var ue = le.styles, ve = Object.keys(ue);
                              le.styles = [];
                              for (var be = 0; be < ve.length; be++)
                                le.styles.push({
                                  target: ve[be],
                                  value: ue[ve[be]]
                                });
                            }
                            break;
                        }
                    }
                  }
                  P(N, "line") && delete N.line, "marker" in N && (P(N.marker, "line") && delete N.marker.line, P(N, "marker") && delete N.marker), C.clean(N), N.autobinx && (delete N.autobinx, delete N.xbins), N.autobiny && (delete N.autobiny, delete N.ybins), E(N), N.colorbar && E(N.colorbar), N.marker && N.marker.colorbar && E(N.marker.colorbar), N.line && N.line.colorbar && E(N.line.colorbar), N.aaxis && E(N.aaxis), N.baxis && E(N.baxis);
                }
              };
              function x(A) {
                if (!p.isPlainObject(A)) return !1;
                var O = A.name;
                return delete A.name, delete A.showlegend, (typeof O == "string" || typeof O == "number") && String(O);
              }
              function T(A, O, N, Y) {
                if (N && !Y) return A;
                if (Y && !N || !A.trim()) return O;
                if (!O.trim()) return A;
                var j = Math.min(A.length, O.length), te;
                for (te = 0; te < j && A.charAt(te) === O.charAt(te); te++)
                  ;
                var re = A.substr(0, te);
                return re.trim();
              }
              function F(A) {
                var O = "middle", N = "center";
                return typeof A == "string" && (A.indexOf("top") !== -1 ? O = "top" : A.indexOf("bottom") !== -1 && (O = "bottom"), A.indexOf("left") !== -1 ? N = "left" : A.indexOf("right") !== -1 && (N = "right")), O + " " + N;
              }
              function P(A, O) {
                return O in A && typeof A[O] == "object" && Object.keys(A[O]).length === 0;
              }
              c.swapXYData = function(A) {
                var O;
                if (p.swapAttrs(A, ["?", "?0", "d?", "?bins", "nbins?", "autobin?", "?src", "error_?"]), Array.isArray(A.z) && Array.isArray(A.z[0]) && (A.transpose ? delete A.transpose : A.transpose = !0), A.error_x && A.error_y) {
                  var N = A.error_y, Y = "copy_ystyle" in N ? N.copy_ystyle : !(N.color || N.thickness || N.width);
                  p.swapAttrs(A, ["error_?.copy_ystyle"]), Y && p.swapAttrs(A, ["error_?.color", "error_?.thickness", "error_?.width"]);
                }
                if (typeof A.hoverinfo == "string") {
                  var j = A.hoverinfo.split("+");
                  for (O = 0; O < j.length; O++)
                    j[O] === "x" ? j[O] = "y" : j[O] === "y" && (j[O] = "x");
                  A.hoverinfo = j.join("+");
                }
              }, c.coerceTraceIndices = function(A, O) {
                if (l(O))
                  return [O];
                if (!Array.isArray(O) || !O.length)
                  return A.data.map(function(j, te) {
                    return te;
                  });
                if (Array.isArray(O)) {
                  for (var N = [], Y = 0; Y < O.length; Y++)
                    p.isIndex(O[Y], A.data.length) ? N.push(O[Y]) : p.warn("trace index (", O[Y], ") is not a number or is out of bounds");
                  return N;
                }
                return O;
              }, c.manageArrayContainers = function(A, O, N) {
                var Y = A.obj, j = A.parts, te = j.length, re = j[te - 1], z = l(re);
                if (z && O === null) {
                  var Z = j.slice(0, te - 1).join("."), W = p.nestedProperty(Y, Z).get();
                  W.splice(re, 1);
                } else z && A.get() === void 0 && A.get() === void 0 && (N[A.astr] = null), A.set(O);
              };
              var k = /(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;
              function I(A) {
                var O = A.search(k);
                if (O > 0) return A.substr(0, O);
              }
              c.hasParent = function(A, O) {
                for (var N = I(O); N; ) {
                  if (N in A) return !0;
                  N = I(N);
                }
                return !1;
              };
              var L = ["x", "y", "z"];
              c.clearAxisTypes = function(A, O, N) {
                for (var Y = 0; Y < O.length; Y++)
                  for (var j = A._fullData[Y], te = 0; te < 3; te++) {
                    var re = h(A, j, L[te]);
                    if (re && re.type !== "log") {
                      var z = re._name, Z = re._id.substr(1);
                      if (Z.substr(0, 5) === "scene") {
                        if (N[Z] !== void 0) continue;
                        z = Z + "." + z;
                      }
                      var W = z + ".type";
                      N[z] === void 0 && N[W] === void 0 && p.nestedProperty(A.layout, W).set(null);
                    }
                  }
              };
            }
          ),
          /***/
          2448: (
            /***/
            function(s, c, i) {
              var l = i(6424);
              c._doPlot = l._doPlot, c.newPlot = l.newPlot, c.restyle = l.restyle, c.relayout = l.relayout, c.redraw = l.redraw, c.update = l.update, c._guiRestyle = l._guiRestyle, c._guiRelayout = l._guiRelayout, c._guiUpdate = l._guiUpdate, c._storeDirectGUIEdit = l._storeDirectGUIEdit, c.react = l.react, c.extendTraces = l.extendTraces, c.prependTraces = l.prependTraces, c.addTraces = l.addTraces, c.deleteTraces = l.deleteTraces, c.moveTraces = l.moveTraces, c.purge = l.purge, c.addFrames = l.addFrames, c.deleteFrames = l.deleteFrames, c.animate = l.animate, c.setPlotConfig = l.setPlotConfig;
              var v = i(2200).getGraphDiv, f = i(4016).eraseActiveShape;
              c.deleteActiveShape = function(g) {
                return f(v(g));
              }, c.toImage = i(7024), c.validate = i(1480), c.downloadImage = i(7412);
              var p = i(4828);
              c.makeTemplate = p.makeTemplate, c.validateTemplate = p.validateTemplate;
            }
          ),
          /***/
          7680: (
            /***/
            function(s, c, i) {
              var l = i(3620), v = i(6628), f = i(4248), p = i(4952).sorterAsc, g = i(4040);
              c.containerArrayMatch = i(9820);
              var y = c.isAddVal = function(h) {
                return h === "add" || l(h);
              }, C = c.isRemoveVal = function(h) {
                return h === null || h === "remove";
              };
              c.applyContainerArrayChanges = function(h, w, S, E, x) {
                var T = w.astr, F = g.getComponentMethod(T, "supplyLayoutDefaults"), P = g.getComponentMethod(T, "draw"), k = g.getComponentMethod(T, "drawOne"), I = E.replot || E.recalc || F === v || P === v, L = h.layout, A = h._fullLayout;
                if (S[""]) {
                  Object.keys(S).length > 1 && f.warn("Full array edits are incompatible with other edits", T);
                  var O = S[""][""];
                  if (C(O)) w.set(null);
                  else if (Array.isArray(O)) w.set(O);
                  else
                    return f.warn("Unrecognized full array edit value", T, O), !0;
                  return I ? !1 : (F(L, A), P(h), !0);
                }
                var N = Object.keys(S).map(Number).sort(p), Y = w.get(), j = Y || [], te = x(A, T).get(), re = [], z = -1, Z = j.length, W, q, ie, ce, X, U, ne, se;
                for (W = 0; W < N.length; W++) {
                  if (ie = N[W], ce = S[ie], X = Object.keys(ce), U = ce[""], ne = y(U), ie < 0 || ie > j.length - (ne ? 0 : 1)) {
                    f.warn("index out of range", T, ie);
                    continue;
                  }
                  if (U !== void 0)
                    X.length > 1 && f.warn("Insertion & removal are incompatible with edits to the same index.", T, ie), C(U) ? re.push(ie) : ne ? (U === "add" && (U = {}), j.splice(ie, 0, U), te && te.splice(ie, 0, {})) : f.warn("Unrecognized full object edit value", T, ie, U), z === -1 && (z = ie);
                  else
                    for (q = 0; q < X.length; q++)
                      se = T + "[" + ie + "].", x(j[ie], X[q], se).set(ce[X[q]]);
                }
                for (W = re.length - 1; W >= 0; W--)
                  j.splice(re[W], 1), te && te.splice(re[W], 1);
                if (j.length ? Y || w.set(j) : w.set(null), I) return !1;
                if (F(L, A), k !== v) {
                  var le;
                  if (z === -1)
                    le = N;
                  else {
                    for (Z = Math.max(j.length, Z), le = [], W = 0; W < N.length && (ie = N[W], !(ie >= z)); W++)
                      le.push(ie);
                    for (W = z; W < Z; W++)
                      le.push(W);
                  }
                  for (W = 0; W < le.length; W++)
                    k(h, le[W]);
                } else P(h);
                return !0;
              };
            }
          ),
          /***/
          6424: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(2264), p = i(3400), g = p.nestedProperty, y = i(5924), C = i(4552), m = i(4040), h = i(3060), w = i(7316), S = i(4460), E = i(6312), x = i(4724), T = i(3616), F = i(6308), P = i(2464).initInteractions, k = i(9616), I = i(2676).clearOutline, L = i(556).dfltConfig, A = i(7680), O = i(3404), N = i(9172), Y = i(7824), j = i(3816).AX_NAME_PATTERN, te = 0, re = 5;
              function z(Te, Oe, je, Xe) {
                var nt;
                if (Te = p.getGraphDiv(Te), y.init(Te), p.isPlainObject(Oe)) {
                  var it = Oe;
                  Oe = it.data, je = it.layout, Xe = it.config, nt = it.frames;
                }
                var Nt = y.triggerHandler(Te, "plotly_beforeplot", [Oe, je, Xe]);
                if (Nt === !1) return Promise.reject();
                !Oe && !je && !p.isPlotDiv(Te) && p.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.", Te);
                function At() {
                  if (nt)
                    return c.addFrames(Te, nt);
                }
                ce(Te, Xe), je || (je = {}), l.select(Te).classed("js-plotly-plot", !0), T.makeTester(), Array.isArray(Te._promises) || (Te._promises = []);
                var vt = (Te.data || []).length === 0 && Array.isArray(Oe);
                Array.isArray(Oe) && (O.cleanData(Oe), vt ? Te.data = Oe : Te.data.push.apply(Te.data, Oe), Te.empty = !1), (!Te.layout || vt) && (Te.layout = O.cleanLayout(je)), w.supplyDefaults(Te);
                var ut = Te._fullLayout, Pt = ut._has("cartesian");
                ut._replotting = !0, (vt || ut._shouldCreateBgLayer) && (lt(Te), ut._shouldCreateBgLayer && delete ut._shouldCreateBgLayer), T.initGradients(Te), T.initPatterns(Te), vt && S.saveShowSpikeInitial(Te);
                var rr = !Te.calcdata || Te.calcdata.length !== (Te._fullData || []).length;
                rr && w.doCalcdata(Te);
                for (var lr = 0; lr < Te.calcdata.length; lr++)
                  Te.calcdata[lr][0].trace = Te._fullData[lr];
                Te._context.responsive ? Te._responsiveChartHandler || (Te._responsiveChartHandler = function() {
                  p.isHidden(Te) || w.resize(Te);
                }, window.addEventListener("resize", Te._responsiveChartHandler)) : p.clearResponsive(Te);
                var Mr = p.extendFlat({}, ut._size), Rr = 0;
                function Pr() {
                  for (var kr = ut._basePlotModules, br = 0; br < kr.length; br++)
                    kr[br].drawFramework && kr[br].drawFramework(Te);
                  !ut._glcanvas && ut._has("gl") && (ut._glcanvas = ut._glcontainer.selectAll(".gl-canvas").data([{
                    key: "contextLayer",
                    context: !0,
                    pick: !1
                  }, {
                    key: "focusLayer",
                    context: !1,
                    pick: !1
                  }, {
                    key: "pickLayer",
                    context: !1,
                    pick: !0
                  }], function(Dr) {
                    return Dr.key;
                  }), ut._glcanvas.enter().append("canvas").attr("class", function(Dr) {
                    return "gl-canvas gl-canvas-" + Dr.key.replace("Layer", "");
                  }).style({
                    position: "absolute",
                    top: 0,
                    left: 0,
                    overflow: "visible",
                    "pointer-events": "none"
                  }));
                  var Gr = Te._context.plotGlPixelRatio;
                  if (ut._glcanvas) {
                    ut._glcanvas.attr("width", ut.width * Gr).attr("height", ut.height * Gr).style("width", ut.width + "px").style("height", ut.height + "px");
                    var rn = ut._glcanvas.data()[0].regl;
                    if (rn && (Math.floor(ut.width * Gr) !== rn._gl.drawingBufferWidth || Math.floor(ut.height * Gr) !== rn._gl.drawingBufferHeight)) {
                      var cn = "WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";
                      if (Rr)
                        p.error(cn);
                      else
                        return p.log(cn + " Clearing graph and plotting again."), w.cleanPlot([], {}, Te._fullData, ut), w.supplyDefaults(Te), ut = Te._fullLayout, w.doCalcdata(Te), Rr++, Pr();
                    }
                  }
                  return ut.modebar.orientation === "h" ? ut._modebardiv.style("height", null).style("width", "100%") : ut._modebardiv.style("width", null).style("height", ut.height + "px"), w.previousPromises(Te);
                }
                function ir() {
                  if (w.clearAutoMarginIds(Te), N.drawMarginPushers(Te), S.allowAutoMargin(Te), Te._fullLayout.title.text && Te._fullLayout.title.automargin && w.allowAutoMargin(Te, "title.automargin"), ut._has("pie"))
                    for (var kr = Te._fullData, br = 0; br < kr.length; br++) {
                      var Gr = kr[br];
                      Gr.type === "pie" && Gr.automargin && w.allowAutoMargin(Te, "pie." + Gr.uid + ".automargin");
                    }
                  return w.doAutoMargin(Te), w.previousPromises(Te);
                }
                function Lr() {
                  if (w.didMarginChange(Mr, ut._size))
                    return p.syncOrAsync([ir, N.layoutStyles], Te);
                }
                function yr() {
                  if (!rr) {
                    Sr();
                    return;
                  }
                  return p.syncOrAsync([m.getComponentMethod("shapes", "calcAutorange"), m.getComponentMethod("annotations", "calcAutorange"), Sr], Te);
                }
                function Sr() {
                  Te._transitioning || (N.doAutoRangeAndConstraints(Te), vt && S.saveRangeInitial(Te), m.getComponentMethod("rangeslider", "calcAutorange")(Te));
                }
                function Yr() {
                  return S.draw(Te, vt ? "" : "redraw");
                }
                var Ar = [w.previousPromises, At, Pr, ir, Lr];
                Pt && Ar.push(yr), Ar.push(N.layoutStyles), Pt && Ar.push(Yr, function(br) {
                  var Gr = br._fullLayout._insideTickLabelsUpdaterange;
                  if (Gr)
                    return br._fullLayout._insideTickLabelsUpdaterange = void 0, xe(br, Gr).then(function() {
                      S.saveRangeInitial(br, !0);
                    });
                }), Ar.push(
                  N.drawData,
                  N.finalDraw,
                  P,
                  w.addLinks,
                  w.rehover,
                  w.redrag,
                  w.reselect,
                  // TODO: doAutoMargin is only needed here for axis automargin, which
                  // happens outside of marginPushers where all the other automargins are
                  // calculated. Would be much better to separate margin calculations from
                  // component drawing - see https://github.com/plotly/plotly.js/issues/2704
                  w.doAutoMargin,
                  w.previousPromises
                );
                var pr = p.syncOrAsync(Ar, Te);
                return (!pr || !pr.then) && (pr = Promise.resolve()), pr.then(function() {
                  return Z(Te), Te;
                });
              }
              function Z(Te) {
                var Oe = Te._fullLayout;
                Oe._redrawFromAutoMarginCount ? Oe._redrawFromAutoMarginCount-- : Te.emit("plotly_afterplot");
              }
              function W(Te) {
                return p.extendFlat(L, Te);
              }
              function q(Te, Oe) {
                try {
                  Te._fullLayout._paper.style("background", Oe);
                } catch (je) {
                  p.error(je);
                }
              }
              function ie(Te, Oe) {
                var je = F.combine(Oe, "white");
                q(Te, je);
              }
              function ce(Te, Oe) {
                if (!Te._context) {
                  Te._context = p.extendDeep({}, L);
                  var je = l.select("base");
                  Te._context._baseUrl = je.size() && je.attr("href") ? window.location.href.split("#")[0] : "";
                }
                var Xe = Te._context, nt, it, Nt;
                if (Oe) {
                  for (it = Object.keys(Oe), nt = 0; nt < it.length; nt++)
                    Nt = it[nt], !(Nt === "editable" || Nt === "edits") && Nt in Xe && (Nt === "setBackground" && Oe[Nt] === "opaque" ? Xe[Nt] = ie : Xe[Nt] = Oe[Nt]);
                  Oe.plot3dPixelRatio && !Xe.plotGlPixelRatio && (Xe.plotGlPixelRatio = Xe.plot3dPixelRatio);
                  var At = Oe.editable;
                  if (At !== void 0)
                    for (Xe.editable = At, it = Object.keys(Xe.edits), nt = 0; nt < it.length; nt++)
                      Xe.edits[it[nt]] = At;
                  if (Oe.edits)
                    for (it = Object.keys(Oe.edits), nt = 0; nt < it.length; nt++)
                      Nt = it[nt], Nt in Xe.edits && (Xe.edits[Nt] = Oe.edits[Nt]);
                  Xe._exportedPlot = Oe._exportedPlot;
                }
                Xe.staticPlot && (Xe.editable = !1, Xe.edits = {}, Xe.autosizable = !1, Xe.scrollZoom = !1, Xe.doubleClick = !1, Xe.showTips = !1, Xe.showLink = !1, Xe.displayModeBar = !1), Xe.displayModeBar === "hover" && !f && (Xe.displayModeBar = !0), (Xe.setBackground === "transparent" || typeof Xe.setBackground != "function") && (Xe.setBackground = q), Xe._hasZeroHeight = Xe._hasZeroHeight || Te.clientHeight === 0, Xe._hasZeroWidth = Xe._hasZeroWidth || Te.clientWidth === 0;
                var vt = Xe.scrollZoom, ut = Xe._scrollZoom = {};
                if (vt === !0)
                  ut.cartesian = 1, ut.gl3d = 1, ut.geo = 1, ut.mapbox = 1;
                else if (typeof vt == "string") {
                  var Pt = vt.split("+");
                  for (nt = 0; nt < Pt.length; nt++)
                    ut[Pt[nt]] = 1;
                } else vt !== !1 && (ut.gl3d = 1, ut.geo = 1, ut.mapbox = 1);
              }
              function X(Te) {
                if (Te = p.getGraphDiv(Te), !p.isPlotDiv(Te))
                  throw new Error("This element is not a Plotly plot: " + Te);
                return O.cleanData(Te.data), O.cleanLayout(Te.layout), Te.calcdata = void 0, c._doPlot(Te).then(function() {
                  return Te.emit("plotly_redraw"), Te;
                });
              }
              function U(Te, Oe, je, Xe) {
                return Te = p.getGraphDiv(Te), w.cleanPlot([], {}, Te._fullData || [], Te._fullLayout || {}), w.purge(Te), c._doPlot(Te, Oe, je, Xe);
              }
              function ne(Te, Oe) {
                var je = Oe + 1, Xe = [], nt, it;
                for (nt = 0; nt < Te.length; nt++)
                  it = Te[nt], it < 0 ? Xe.push(je + it) : Xe.push(it);
                return Xe;
              }
              function se(Te, Oe, je) {
                var Xe, nt;
                for (Xe = 0; Xe < Oe.length; Xe++) {
                  if (nt = Oe[Xe], nt !== parseInt(nt, 10))
                    throw new Error("all values in " + je + " must be integers");
                  if (nt >= Te.data.length || nt < -Te.data.length)
                    throw new Error(je + " must be valid indices for gd.data.");
                  if (Oe.indexOf(nt, Xe + 1) > -1 || nt >= 0 && Oe.indexOf(-Te.data.length + nt) > -1 || nt < 0 && Oe.indexOf(Te.data.length + nt) > -1)
                    throw new Error("each index in " + je + " must be unique.");
                }
              }
              function le(Te, Oe, je) {
                if (!Array.isArray(Te.data))
                  throw new Error("gd.data must be an array.");
                if (typeof Oe > "u")
                  throw new Error("currentIndices is a required argument.");
                if (Array.isArray(Oe) || (Oe = [Oe]), se(Te, Oe, "currentIndices"), typeof je < "u" && !Array.isArray(je) && (je = [je]), typeof je < "u" && se(Te, je, "newIndices"), typeof je < "u" && Oe.length !== je.length)
                  throw new Error("current and new indices must be of equal length.");
              }
              function ue(Te, Oe, je) {
                var Xe, nt;
                if (!Array.isArray(Te.data))
                  throw new Error("gd.data must be an array.");
                if (typeof Oe > "u")
                  throw new Error("traces must be defined.");
                for (Array.isArray(Oe) || (Oe = [Oe]), Xe = 0; Xe < Oe.length; Xe++)
                  if (nt = Oe[Xe], typeof nt != "object" || Array.isArray(nt) || nt === null)
                    throw new Error("all values in traces array must be non-array objects");
                if (typeof je < "u" && !Array.isArray(je) && (je = [je]), typeof je < "u" && je.length !== Oe.length)
                  throw new Error("if indices is specified, traces.length must equal indices.length");
              }
              function ve(Te, Oe, je, Xe) {
                var nt = p.isPlainObject(Xe);
                if (!Array.isArray(Te.data))
                  throw new Error("gd.data must be an array");
                if (!p.isPlainObject(Oe))
                  throw new Error("update must be a key:value object");
                if (typeof je > "u")
                  throw new Error("indices must be an integer or array of integers");
                se(Te, je, "indices");
                for (var it in Oe) {
                  if (!Array.isArray(Oe[it]) || Oe[it].length !== je.length)
                    throw new Error("attribute " + it + " must be an array of length equal to indices array length");
                  if (nt && (!(it in Xe) || !Array.isArray(Xe[it]) || Xe[it].length !== Oe[it].length))
                    throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object");
                }
              }
              function be(Te, Oe, je, Xe) {
                var nt = p.isPlainObject(Xe), it = [], Nt, At, vt, ut, Pt;
                Array.isArray(je) || (je = [je]), je = ne(je, Te.data.length - 1);
                for (var rr in Oe)
                  for (var lr = 0; lr < je.length; lr++) {
                    if (Nt = Te.data[je[lr]], vt = g(Nt, rr), At = vt.get(), ut = Oe[rr][lr], !p.isArrayOrTypedArray(ut))
                      throw new Error("attribute: " + rr + " index: " + lr + " must be an array");
                    if (!p.isArrayOrTypedArray(At))
                      throw new Error("cannot extend missing or non-array attribute: " + rr);
                    if (At.constructor !== ut.constructor)
                      throw new Error("cannot extend array with an array of a different type: " + rr);
                    Pt = nt ? Xe[rr][lr] : Xe, v(Pt) || (Pt = -1), it.push({
                      prop: vt,
                      target: At,
                      insert: ut,
                      maxp: Math.floor(Pt)
                    });
                  }
                return it;
              }
              function Me(Te, Oe, je, Xe, nt) {
                ve(Te, Oe, je, Xe);
                for (var it = be(Te, Oe, je, Xe), Nt = {}, At = {}, vt = 0; vt < it.length; vt++) {
                  var ut = it[vt].prop, Pt = it[vt].maxp, rr = nt(it[vt].target, it[vt].insert, Pt);
                  ut.set(rr[0]), Array.isArray(Nt[ut.astr]) || (Nt[ut.astr] = []), Nt[ut.astr].push(rr[1]), Array.isArray(At[ut.astr]) || (At[ut.astr] = []), At[ut.astr].push(it[vt].target.length);
                }
                return {
                  update: Nt,
                  maxPoints: At
                };
              }
              function Ge(Te, Oe) {
                var je = new Te.constructor(Te.length + Oe.length);
                return je.set(Te), je.set(Oe, Te.length), je;
              }
              function we(Te, Oe, je, Xe) {
                Te = p.getGraphDiv(Te);
                function nt(vt, ut, Pt) {
                  var rr, lr;
                  if (p.isTypedArray(vt))
                    if (Pt < 0) {
                      var Mr = new vt.constructor(0), Rr = Ge(vt, ut);
                      Pt < 0 ? (rr = Rr, lr = Mr) : (rr = Mr, lr = Rr);
                    } else if (rr = new vt.constructor(Pt), lr = new vt.constructor(vt.length + ut.length - Pt), Pt === ut.length)
                      rr.set(ut), lr.set(vt);
                    else if (Pt < ut.length) {
                      var Pr = ut.length - Pt;
                      rr.set(ut.subarray(Pr)), lr.set(vt), lr.set(ut.subarray(0, Pr), vt.length);
                    } else {
                      var ir = Pt - ut.length, Lr = vt.length - ir;
                      rr.set(vt.subarray(Lr)), rr.set(ut, ir), lr.set(vt.subarray(0, Lr));
                    }
                  else
                    rr = vt.concat(ut), lr = Pt >= 0 && Pt < rr.length ? rr.splice(0, rr.length - Pt) : [];
                  return [rr, lr];
                }
                var it = Me(Te, Oe, je, Xe, nt), Nt = c.redraw(Te), At = [Te, it.update, je, it.maxPoints];
                return C.add(Te, c.prependTraces, At, we, arguments), Nt;
              }
              function Re(Te, Oe, je, Xe) {
                Te = p.getGraphDiv(Te);
                function nt(vt, ut, Pt) {
                  var rr, lr;
                  if (p.isTypedArray(vt))
                    if (Pt <= 0) {
                      var Mr = new vt.constructor(0), Rr = Ge(ut, vt);
                      Pt < 0 ? (rr = Rr, lr = Mr) : (rr = Mr, lr = Rr);
                    } else if (rr = new vt.constructor(Pt), lr = new vt.constructor(vt.length + ut.length - Pt), Pt === ut.length)
                      rr.set(ut), lr.set(vt);
                    else if (Pt < ut.length) {
                      var Pr = ut.length - Pt;
                      rr.set(ut.subarray(0, Pr)), lr.set(ut.subarray(Pr)), lr.set(vt, Pr);
                    } else {
                      var ir = Pt - ut.length;
                      rr.set(ut), rr.set(vt.subarray(0, ir), ut.length), lr.set(vt.subarray(ir));
                    }
                  else
                    rr = ut.concat(vt), lr = Pt >= 0 && Pt < rr.length ? rr.splice(Pt, rr.length) : [];
                  return [rr, lr];
                }
                var it = Me(Te, Oe, je, Xe, nt), Nt = c.redraw(Te), At = [Te, it.update, je, it.maxPoints];
                return C.add(Te, c.extendTraces, At, Re, arguments), Nt;
              }
              function Ae(Te, Oe, je) {
                Te = p.getGraphDiv(Te);
                var Xe = [], nt = c.deleteTraces, it = Ae, Nt = [Te, Xe], At = [Te, Oe], vt, ut;
                for (ue(Te, Oe, je), Array.isArray(Oe) || (Oe = [Oe]), Oe = Oe.map(function(Pt) {
                  return p.extendFlat({}, Pt);
                }), O.cleanData(Oe), vt = 0; vt < Oe.length; vt++)
                  Te.data.push(Oe[vt]);
                for (vt = 0; vt < Oe.length; vt++)
                  Xe.push(-Oe.length + vt);
                if (typeof je > "u")
                  return ut = c.redraw(Te), C.add(Te, nt, Nt, it, At), ut;
                Array.isArray(je) || (je = [je]);
                try {
                  le(Te, Xe, je);
                } catch (Pt) {
                  throw Te.data.splice(Te.data.length - Oe.length, Oe.length), Pt;
                }
                return C.startSequence(Te), C.add(Te, nt, Nt, it, At), ut = c.moveTraces(Te, Xe, je), C.stopSequence(Te), ut;
              }
              function K(Te, Oe) {
                Te = p.getGraphDiv(Te);
                var je = [], Xe = c.addTraces, nt = K, it = [Te, je, Oe], Nt = [Te, Oe], At, vt;
                if (typeof Oe > "u")
                  throw new Error("indices must be an integer or array of integers.");
                for (Array.isArray(Oe) || (Oe = [Oe]), se(Te, Oe, "indices"), Oe = ne(Oe, Te.data.length - 1), Oe.sort(p.sorterDes), At = 0; At < Oe.length; At += 1)
                  vt = Te.data.splice(Oe[At], 1)[0], je.push(vt);
                var ut = c.redraw(Te);
                return C.add(Te, Xe, it, nt, Nt), ut;
              }
              function ee(Te, Oe, je) {
                Te = p.getGraphDiv(Te);
                var Xe = [], nt = [], it = ee, Nt = ee, At = [Te, je, Oe], vt = [Te, Oe, je], ut;
                if (le(Te, Oe, je), Oe = Array.isArray(Oe) ? Oe : [Oe], typeof je > "u")
                  for (je = [], ut = 0; ut < Oe.length; ut++)
                    je.push(-Oe.length + ut);
                for (je = Array.isArray(je) ? je : [je], Oe = ne(Oe, Te.data.length - 1), je = ne(je, Te.data.length - 1), ut = 0; ut < Te.data.length; ut++)
                  Oe.indexOf(ut) === -1 && Xe.push(Te.data[ut]);
                for (ut = 0; ut < Oe.length; ut++)
                  nt.push({
                    newIndex: je[ut],
                    trace: Te.data[Oe[ut]]
                  });
                for (nt.sort(function(rr, lr) {
                  return rr.newIndex - lr.newIndex;
                }), ut = 0; ut < nt.length; ut += 1)
                  Xe.splice(nt[ut].newIndex, 0, nt[ut].trace);
                Te.data = Xe;
                var Pt = c.redraw(Te);
                return C.add(Te, it, At, Nt, vt), Pt;
              }
              function oe(Te, Oe, je, Xe) {
                Te = p.getGraphDiv(Te), O.clearPromiseQueue(Te);
                var nt = {};
                if (typeof Oe == "string") nt[Oe] = je;
                else if (p.isPlainObject(Oe))
                  nt = p.extendFlat({}, Oe), Xe === void 0 && (Xe = je);
                else
                  return p.warn("Restyle fail.", Oe, je, Xe), Promise.reject();
                Object.keys(nt).length && (Te.changed = !0);
                var it = O.coerceTraceIndices(Te, Xe), Nt = he(Te, nt, it), At = Nt.flags;
                At.calc && (Te.calcdata = void 0), At.clearAxisTypes && O.clearAxisTypes(Te, it, {});
                var vt = [];
                At.fullReplot ? vt.push(c._doPlot) : (vt.push(w.previousPromises), w.supplyDefaults(Te), At.markerSize && (w.doCalcdata(Te), Ve(vt)), At.style && vt.push(N.doTraceStyle), At.colorbars && vt.push(N.doColorBars), vt.push(Z)), vt.push(w.rehover, w.redrag, w.reselect), C.add(Te, oe, [Te, Nt.undoit, Nt.traces], oe, [Te, Nt.redoit, Nt.traces]);
                var ut = p.syncOrAsync(vt, Te);
                return (!ut || !ut.then) && (ut = Promise.resolve()), ut.then(function() {
                  return Te.emit("plotly_restyle", Nt.eventData), Te;
                });
              }
              function _(Te) {
                return Te === void 0 ? null : Te;
              }
              function V(Te, Oe) {
                return Oe ? function(je, Xe, nt) {
                  var it = g(je, Xe), Nt = it.set;
                  return it.set = function(At) {
                    var vt = (nt || "") + Xe;
                    fe(vt, it.get(), At, Te), Nt(At);
                  }, it;
                } : g;
              }
              function fe(Te, Oe, je, Xe) {
                if (Array.isArray(Oe) || Array.isArray(je))
                  for (var nt = Array.isArray(Oe) ? Oe : [], it = Array.isArray(je) ? je : [], Nt = Math.max(nt.length, it.length), At = 0; At < Nt; At++)
                    fe(Te + "[" + At + "]", nt[At], it[At], Xe);
                else if (p.isPlainObject(Oe) || p.isPlainObject(je)) {
                  var vt = p.isPlainObject(Oe) ? Oe : {}, ut = p.isPlainObject(je) ? je : {}, Pt = p.extendFlat({}, vt, ut);
                  for (var rr in Pt)
                    fe(Te + "." + rr, vt[rr], ut[rr], Xe);
                } else Xe[Te] === void 0 && (Xe[Te] = _(Oe));
              }
              function $(Te, Oe, je) {
                for (var Xe in je) {
                  var nt = g(Te, Xe);
                  fe(Xe, nt.get(), je[Xe], Oe);
                }
              }
              function he(Te, Oe, je) {
                var Xe = Te._fullLayout, nt = Te._fullData, it = Te.data, Nt = Xe._guiEditing, At = V(Xe._preGUI, Nt), vt = p.extendDeepAll({}, Oe), ut;
                me(Oe);
                var Pt = Y.traceFlags(), rr = {}, lr = {}, Mr;
                function Rr() {
                  return je.map(function() {
                  });
                }
                function Pr(Er) {
                  var Jr = S.id2name(Er);
                  Mr.indexOf(Jr) === -1 && Mr.push(Jr);
                }
                function ir(Er) {
                  return "LAYOUT" + Er + ".autorange";
                }
                function Lr(Er) {
                  return "LAYOUT" + Er + ".range";
                }
                function yr(Er) {
                  for (var Jr = Er; Jr < nt.length; Jr++)
                    if (nt[Jr]._input === it[Er]) return nt[Jr];
                }
                function Sr(Er, Jr, Ur) {
                  if (Array.isArray(Er)) {
                    Er.forEach(function(Sn) {
                      Sr(Sn, Jr, Ur);
                    });
                    return;
                  }
                  if (!(Er in Oe || O.hasParent(Oe, Er))) {
                    var Br;
                    if (Er.substr(0, 6) === "LAYOUT")
                      Br = At(Te.layout, Er.replace("LAYOUT", ""));
                    else {
                      var dn = je[Ur], nn = Xe._tracePreGUI[yr(dn)._fullInput.uid];
                      Br = V(nn, Nt)(it[dn], Er);
                    }
                    Er in lr || (lr[Er] = Rr()), lr[Er][Ur] === void 0 && (lr[Er][Ur] = _(Br.get())), Jr !== void 0 && Br.set(Jr);
                  }
                }
                function Yr(Er) {
                  return function(Jr) {
                    return nt[Jr][Er];
                  };
                }
                function Ar(Er) {
                  return function(Jr, Ur) {
                    return Jr === !1 ? nt[je[Ur]][Er] : null;
                  };
                }
                for (var pr in Oe) {
                  if (O.hasParent(Oe, pr))
                    throw new Error("cannot set " + pr + " and a parent attribute simultaneously");
                  var kr = Oe[pr], br, Gr, rn, cn, Dr, Se;
                  if ((pr === "autobinx" || pr === "autobiny") && (pr = pr.charAt(pr.length - 1) + "bins", Array.isArray(kr) ? kr = kr.map(Ar(pr)) : kr === !1 ? kr = je.map(Yr(pr)) : kr = null), rr[pr] = kr, pr.substr(0, 6) === "LAYOUT") {
                    rn = At(Te.layout, pr.replace("LAYOUT", "")), lr[pr] = [_(rn.get())], rn.set(Array.isArray(kr) ? kr[0] : kr), Pt.calc = !0;
                    continue;
                  }
                  for (lr[pr] = Rr(), ut = 0; ut < je.length; ut++) {
                    br = it[je[ut]], Gr = yr(je[ut]);
                    var ae = Xe._tracePreGUI[Gr._fullInput.uid];
                    if (rn = V(ae, Nt)(br, pr), cn = rn.get(), Dr = Array.isArray(kr) ? kr[ut % kr.length] : kr, Dr !== void 0) {
                      var ft = rn.parts[rn.parts.length - 1], rt = pr.substr(0, pr.length - ft.length - 1), gt = rt ? rt + "." : "", wt = rt ? g(Gr, rt).get() : Gr;
                      if (Se = h.getTraceValObject(Gr, rn.parts), Se && Se.impliedEdits && Dr !== null)
                        for (var Ct in Se.impliedEdits)
                          Sr(p.relativeAttr(pr, Ct), Se.impliedEdits[Ct], ut);
                      else if ((ft === "thicknessmode" || ft === "lenmode") && cn !== Dr && (Dr === "fraction" || Dr === "pixels") && wt) {
                        var pt = Xe._size, dt = wt.orient, St = dt === "top" || dt === "bottom";
                        if (ft === "thicknessmode") {
                          var Ft = St ? pt.h : pt.w;
                          Sr(gt + "thickness", wt.thickness * (Dr === "fraction" ? 1 / Ft : Ft), ut);
                        } else {
                          var Gt = St ? pt.w : pt.h;
                          Sr(gt + "len", wt.len * (Dr === "fraction" ? 1 / Gt : Gt), ut);
                        }
                      } else if (pr === "type" && (Dr === "pie" != (cn === "pie") || Dr === "funnelarea" != (cn === "funnelarea"))) {
                        var Lt = "x", $t = "y";
                        (Dr === "bar" || cn === "bar") && br.orientation === "h" && (Lt = "y", $t = "x"), p.swapAttrs(br, ["?", "?src"], "labels", Lt), p.swapAttrs(br, ["d?", "?0"], "label", Lt), p.swapAttrs(br, ["?", "?src"], "values", $t), cn === "pie" || cn === "funnelarea" ? (g(br, "marker.color").set(g(br, "marker.colors").get()), Xe._pielayer.selectAll("g.trace").remove()) : m.traceIs(br, "cartesian") && g(br, "marker.colors").set(g(br, "marker.color").get());
                      }
                      lr[pr][ut] = _(cn);
                      var _t = ["swapxy", "swapxyaxes", "orientation", "orientationaxes"];
                      if (_t.indexOf(pr) !== -1) {
                        if (pr === "orientation") {
                          rn.set(Dr);
                          var zt = br.x && !br.y ? "h" : "v";
                          if ((rn.get() || zt) === Gr.orientation)
                            continue;
                        } else pr === "orientationaxes" && (br.orientation = {
                          v: "h",
                          h: "v"
                        }[Gr.orientation]);
                        O.swapXYData(br), Pt.calc = Pt.clearAxisTypes = !0;
                      } else w.dataArrayContainers.indexOf(rn.parts[0]) !== -1 ? (O.manageArrayContainers(rn, Dr, lr), Pt.calc = !0) : (Se ? Se.arrayOk && !m.traceIs(Gr, "regl") && (p.isArrayOrTypedArray(Dr) || p.isArrayOrTypedArray(cn)) ? Pt.calc = !0 : Y.update(Pt, Se) : Pt.calc = !0, rn.set(Dr));
                    }
                  }
                  if (["swapxyaxes", "orientationaxes"].indexOf(pr) !== -1 && S.swap(Te, je), pr === "orientationaxes") {
                    var tr = g(Te.layout, "hovermode"), nr = tr.get();
                    nr === "x" ? tr.set("y") : nr === "y" ? tr.set("x") : nr === "x unified" ? tr.set("y unified") : nr === "y unified" && tr.set("x unified");
                  }
                  if (["orientation", "type"].indexOf(pr) !== -1) {
                    for (Mr = [], ut = 0; ut < je.length; ut++) {
                      var xr = it[je[ut]];
                      m.traceIs(xr, "cartesian") && (Pr(xr.xaxis || "x"), Pr(xr.yaxis || "y"));
                    }
                    Sr(Mr.map(ir), !0, 0), Sr(Mr.map(Lr), [0, 1], 0);
                  }
                }
                return (Pt.calc || Pt.plot) && (Pt.fullReplot = !0), {
                  flags: Pt,
                  undoit: lr,
                  redoit: rr,
                  traces: je,
                  eventData: p.extendDeepNoArrays([], [vt, je])
                };
              }
              function me(Te) {
                var Oe = p.counterRegex("axis", ".title", !1, !1), je = /colorbar\.title$/, Xe = Object.keys(Te), nt, it, Nt;
                for (nt = 0; nt < Xe.length; nt++)
                  it = Xe[nt], Nt = Te[it], (it === "title" || Oe.test(it) || je.test(it)) && (typeof Nt == "string" || typeof Nt == "number") ? At(it, it.replace("title", "title.text")) : it.indexOf("titlefont") > -1 && it.indexOf("grouptitlefont") === -1 ? At(it, it.replace("titlefont", "title.font")) : it.indexOf("titleposition") > -1 ? At(it, it.replace("titleposition", "title.position")) : it.indexOf("titleside") > -1 ? At(it, it.replace("titleside", "title.side")) : it.indexOf("titleoffset") > -1 && At(it, it.replace("titleoffset", "title.offset"));
                function At(vt, ut) {
                  Te[ut] = Te[vt], delete Te[vt];
                }
              }
              function xe(Te, Oe, je) {
                Te = p.getGraphDiv(Te), O.clearPromiseQueue(Te);
                var Xe = {};
                if (typeof Oe == "string")
                  Xe[Oe] = je;
                else if (p.isPlainObject(Oe))
                  Xe = p.extendFlat({}, Oe);
                else
                  return p.warn("Relayout fail.", Oe, je), Promise.reject();
                Object.keys(Xe).length && (Te.changed = !0);
                var nt = at(Te, Xe), it = nt.flags;
                it.calc && (Te.calcdata = void 0);
                var Nt = [w.previousPromises];
                it.layoutReplot ? Nt.push(N.layoutReplot) : Object.keys(Xe).length && (Fe(Te, it, nt) || w.supplyDefaults(Te), it.legend && Nt.push(N.doLegend), it.layoutstyle && Nt.push(N.layoutStyles), it.axrange && Ve(Nt, nt.rangesAltered), it.ticks && Nt.push(N.doTicksRelayout), it.modebar && Nt.push(N.doModeBar), it.camera && Nt.push(N.doCamera), it.colorbars && Nt.push(N.doColorBars), Nt.push(Z)), Nt.push(w.rehover, w.redrag, w.reselect), C.add(Te, xe, [Te, nt.undoit], xe, [Te, nt.redoit]);
                var At = p.syncOrAsync(Nt, Te);
                return (!At || !At.then) && (At = Promise.resolve(Te)), At.then(function() {
                  return Te.emit("plotly_relayout", nt.eventData), Te;
                });
              }
              function Fe(Te, Oe, je) {
                var Xe = Te._fullLayout;
                if (!Oe.axrange) return !1;
                for (var nt in Oe)
                  if (nt !== "axrange" && Oe[nt]) return !1;
                var it, Nt, At = function(Mr, Rr) {
                  return p.coerce(it, Nt, x, Mr, Rr);
                }, vt = {};
                for (var ut in je.rangesAltered) {
                  var Pt = S.id2name(ut);
                  if (it = Te.layout[Pt], Nt = Xe[Pt], E(it, Nt, At, vt), Nt._matchGroup) {
                    for (var rr in Nt._matchGroup)
                      if (rr !== ut) {
                        var lr = Xe[S.id2name(rr)];
                        lr.autorange = Nt.autorange, lr.range = Nt.range.slice(), lr._input.range = Nt.range.slice();
                      }
                  }
                }
                return !0;
              }
              function Ve(Te, Oe) {
                var je = Oe ? function(Xe) {
                  var nt = [], it = !0;
                  for (var Nt in Oe) {
                    var At = S.getFromId(Xe, Nt);
                    if (nt.push(Nt), (At.ticklabelposition || "").indexOf("inside") !== -1 && At._anchorAxis && nt.push(At._anchorAxis._id), At._matchGroup)
                      for (var vt in At._matchGroup)
                        Oe[vt] || nt.push(vt);
                  }
                  return S.draw(Xe, nt, {
                    skipTitle: it
                  });
                } : function(Xe) {
                  return S.draw(Xe, "redraw");
                };
                Te.push(I, N.doAutoRangeAndConstraints, je, N.drawData, N.finalDraw);
              }
              var Be = /^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/, Je = /^[xyz]axis[0-9]*\.autorange$/, et = /^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;
              function at(Te, Oe) {
                var je = Te.layout, Xe = Te._fullLayout, nt = Xe._guiEditing, it = V(Xe._preGUI, nt), Nt = Object.keys(Oe), At = S.list(Te), vt = p.extendDeepAll({}, Oe), ut = {}, Pt, rr, lr;
                for (me(Oe), Nt = Object.keys(Oe), rr = 0; rr < Nt.length; rr++)
                  if (Nt[rr].indexOf("allaxes") === 0) {
                    for (lr = 0; lr < At.length; lr++) {
                      var Mr = At[lr]._id.substr(1), Rr = Mr.indexOf("scene") !== -1 ? Mr + "." : "", Pr = Nt[rr].replace("allaxes", Rr + At[lr]._name);
                      Oe[Pr] || (Oe[Pr] = Oe[Nt[rr]]);
                    }
                    delete Oe[Nt[rr]];
                  }
                var ir = Y.layoutFlags(), Lr = {}, yr = {};
                function Sr(nn, Sn) {
                  if (Array.isArray(nn)) {
                    nn.forEach(function(Dn) {
                      Sr(Dn, Sn);
                    });
                    return;
                  }
                  if (!(nn in Oe || O.hasParent(Oe, nn))) {
                    var ai = it(je, nn);
                    nn in yr || (yr[nn] = _(ai.get())), Sn !== void 0 && ai.set(Sn);
                  }
                }
                var Yr = {}, Ar;
                function pr(nn) {
                  var Sn = S.name2id(nn.split(".")[0]);
                  return Yr[Sn] = 1, Sn;
                }
                for (var kr in Oe) {
                  if (O.hasParent(Oe, kr))
                    throw new Error("cannot set " + kr + " and a parent attribute simultaneously");
                  for (var br = it(je, kr), Gr = Oe[kr], rn = br.parts.length, cn = rn - 1; cn > 0 && typeof br.parts[cn] != "string"; ) cn--;
                  var Dr = br.parts[cn], Se = br.parts[cn - 1] + "." + Dr, ae = br.parts.slice(0, cn).join("."), ft = g(Te.layout, ae).get(), rt = g(Xe, ae).get(), gt = br.get();
                  if (Gr !== void 0) {
                    Lr[kr] = Gr, yr[kr] = Dr === "reverse" ? Gr : _(gt);
                    var wt = h.getLayoutValObject(Xe, br.parts);
                    if (wt && wt.impliedEdits && Gr !== null)
                      for (var Ct in wt.impliedEdits)
                        Sr(p.relativeAttr(kr, Ct), wt.impliedEdits[Ct]);
                    if (["width", "height"].indexOf(kr) !== -1)
                      if (Gr) {
                        Sr("autosize", null);
                        var pt = kr === "height" ? "width" : "height";
                        Sr(pt, Xe[pt]);
                      } else
                        Xe[kr] = Te._initialAutoSize[kr];
                    else if (kr === "autosize")
                      Sr("width", Gr ? null : Xe.width), Sr("height", Gr ? null : Xe.height);
                    else if (Se.match(Be))
                      pr(Se), g(Xe, ae + "._inputRange").set(null);
                    else if (Se.match(Je)) {
                      pr(Se), g(Xe, ae + "._inputRange").set(null);
                      var dt = g(Xe, ae).get();
                      dt._inputDomain && (dt._input.domain = dt._inputDomain.slice());
                    } else Se.match(et) && g(Xe, ae + "._inputDomain").set(null);
                    if (Dr === "type") {
                      Ar = ft;
                      var St = rt.type === "linear" && Gr === "log", Ft = rt.type === "log" && Gr === "linear";
                      if (St || Ft) {
                        if (!Ar || !Ar.range)
                          Sr(ae + ".autorange", !0);
                        else if (rt.autorange)
                          St && (Ar.range = Ar.range[1] > Ar.range[0] ? [1, 2] : [2, 1]);
                        else {
                          var Gt = Ar.range[0], Lt = Ar.range[1];
                          St ? (Gt <= 0 && Lt <= 0 && Sr(ae + ".autorange", !0), Gt <= 0 ? Gt = Lt / 1e6 : Lt <= 0 && (Lt = Gt / 1e6), Sr(ae + ".range[0]", Math.log(Gt) / Math.LN10), Sr(ae + ".range[1]", Math.log(Lt) / Math.LN10)) : (Sr(ae + ".range[0]", Math.pow(10, Gt)), Sr(ae + ".range[1]", Math.pow(10, Lt)));
                        }
                        Array.isArray(Xe._subplots.polar) && Xe._subplots.polar.length && Xe[br.parts[0]] && br.parts[1] === "radialaxis" && delete Xe[br.parts[0]]._subplot.viewInitial["radialaxis.range"], m.getComponentMethod("annotations", "convertCoords")(Te, rt, Gr, Sr), m.getComponentMethod("images", "convertCoords")(Te, rt, Gr, Sr);
                      } else
                        Sr(ae + ".autorange", !0), Sr(ae + ".range", null);
                      g(Xe, ae + "._inputRange").set(null);
                    } else if (Dr.match(j)) {
                      var $t = g(Xe, kr).get(), _t = (Gr || {}).type;
                      (!_t || _t === "-") && (_t = "linear"), m.getComponentMethod("annotations", "convertCoords")(Te, $t, _t, Sr), m.getComponentMethod("images", "convertCoords")(Te, $t, _t, Sr);
                    }
                    var zt = A.containerArrayMatch(kr);
                    if (zt) {
                      Pt = zt.array, rr = zt.index;
                      var tr = zt.property, nr = wt || {
                        editType: "calc"
                      };
                      rr !== "" && tr === "" && (A.isAddVal(Gr) ? yr[kr] = null : A.isRemoveVal(Gr) ? yr[kr] = (g(je, Pt).get() || [])[rr] : p.warn("unrecognized full object value", Oe)), Y.update(ir, nr), ut[Pt] || (ut[Pt] = {});
                      var xr = ut[Pt][rr];
                      xr || (xr = ut[Pt][rr] = {}), xr[tr] = Gr, delete Oe[kr];
                    } else Dr === "reverse" ? (ft.range ? ft.range.reverse() : (Sr(ae + ".autorange", !0), ft.range = [1, 0]), rt.autorange ? ir.calc = !0 : ir.plot = !0) : (kr === "dragmode" && (Gr === !1 && gt !== !1 || Gr !== !1 && gt === !1) || Xe._has("scatter-like") && Xe._has("regl") && kr === "dragmode" && (Gr === "lasso" || Gr === "select") && !(gt === "lasso" || gt === "select") || Xe._has("gl2d") ? ir.plot = !0 : wt ? Y.update(ir, wt) : ir.calc = !0, br.set(Gr));
                  }
                }
                for (Pt in ut) {
                  var Er = A.applyContainerArrayChanges(Te, it(je, Pt), ut[Pt], ir, it);
                  Er || (ir.plot = !0);
                }
                for (var Jr in Yr) {
                  Ar = S.getFromId(Te, Jr);
                  var Ur = Ar && Ar._constraintGroup;
                  if (Ur) {
                    ir.calc = !0;
                    for (var Br in Ur)
                      Yr[Br] || (S.getFromId(Te, Br)._constraintShrinkable = !0);
                  }
                }
                (De(Te) || Oe.height || Oe.width) && (ir.plot = !0);
                var dn = Xe.shapes;
                for (rr = 0; rr < dn.length; rr++)
                  if (dn[rr].showlegend) {
                    ir.calc = !0;
                    break;
                  }
                return (ir.plot || ir.calc) && (ir.layoutReplot = !0), {
                  flags: ir,
                  rangesAltered: Yr,
                  undoit: yr,
                  redoit: Lr,
                  eventData: vt
                };
              }
              function De(Te) {
                var Oe = Te._fullLayout, je = Oe.width, Xe = Oe.height;
                return Te.layout.autosize && w.plotAutoSize(Te, Te.layout, Oe), Oe.width !== je || Oe.height !== Xe;
              }
              function Ne(Te, Oe, je, Xe) {
                Te = p.getGraphDiv(Te), O.clearPromiseQueue(Te), p.isPlainObject(Oe) || (Oe = {}), p.isPlainObject(je) || (je = {}), Object.keys(Oe).length && (Te.changed = !0), Object.keys(je).length && (Te.changed = !0);
                var nt = O.coerceTraceIndices(Te, Xe), it = he(Te, p.extendFlat({}, Oe), nt), Nt = it.flags, At = at(Te, p.extendFlat({}, je)), vt = At.flags;
                (Nt.calc || vt.calc) && (Te.calcdata = void 0), Nt.clearAxisTypes && O.clearAxisTypes(Te, nt, je);
                var ut = [];
                vt.layoutReplot ? ut.push(N.layoutReplot) : Nt.fullReplot ? ut.push(c._doPlot) : (ut.push(w.previousPromises), Fe(Te, vt, At) || w.supplyDefaults(Te), Nt.style && ut.push(N.doTraceStyle), (Nt.colorbars || vt.colorbars) && ut.push(N.doColorBars), vt.legend && ut.push(N.doLegend), vt.layoutstyle && ut.push(N.layoutStyles), vt.axrange && Ve(ut, At.rangesAltered), vt.ticks && ut.push(N.doTicksRelayout), vt.modebar && ut.push(N.doModeBar), vt.camera && ut.push(N.doCamera), ut.push(Z)), ut.push(w.rehover, w.redrag, w.reselect), C.add(Te, Ne, [Te, it.undoit, At.undoit, it.traces], Ne, [Te, it.redoit, At.redoit, it.traces]);
                var Pt = p.syncOrAsync(ut, Te);
                return (!Pt || !Pt.then) && (Pt = Promise.resolve(Te)), Pt.then(function() {
                  return Te.emit("plotly_update", {
                    data: it.eventData,
                    layout: At.eventData
                  }), Te;
                });
              }
              function Ie(Te) {
                return function(je) {
                  je._fullLayout._guiEditing = !0;
                  var Xe = Te.apply(null, arguments);
                  return je._fullLayout._guiEditing = !1, Xe;
                };
              }
              var Ue = [
                {
                  pattern: /^hiddenlabels/,
                  attr: "legend.uirevision"
                },
                {
                  pattern: /^((x|y)axis\d*)\.((auto)?range|title\.text)/
                },
                // showspikes and modes include those nested inside scenes
                {
                  pattern: /axis\d*\.showspikes$/,
                  attr: "modebar.uirevision"
                },
                {
                  pattern: /(hover|drag)mode$/,
                  attr: "modebar.uirevision"
                },
                {
                  pattern: /^(scene\d*)\.camera/
                },
                {
                  pattern: /^(geo\d*)\.(projection|center|fitbounds)/
                },
                {
                  pattern: /^(ternary\d*\.[abc]axis)\.(min|title\.text)$/
                },
                {
                  pattern: /^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/
                },
                {
                  pattern: /^(polar\d*\.angularaxis)\.rotation/
                },
                {
                  pattern: /^(mapbox\d*)\.(center|zoom|bearing|pitch)/
                },
                {
                  pattern: /^legend\.(x|y)$/,
                  attr: "editrevision"
                },
                {
                  pattern: /^(shapes|annotations)/,
                  attr: "editrevision"
                },
                {
                  pattern: /^title\.text$/,
                  attr: "editrevision"
                }
              ], ot = [
                {
                  pattern: /^selectedpoints$/,
                  attr: "selectionrevision"
                },
                // "visible" includes trace.transforms[i].styles[j].value.visible
                {
                  pattern: /(^|value\.)visible$/,
                  attr: "legend.uirevision"
                },
                {
                  pattern: /^dimensions\[\d+\]\.constraintrange/
                },
                {
                  pattern: /^node\.(x|y|groups)/
                },
                // for Sankey nodes
                {
                  pattern: /^level$/
                },
                // for Sunburst, Treemap and Icicle traces
                // below this you must be in editable: true mode
                // TODO: I still put name and title with `trace.uirevision`
                // reasonable or should these be `editrevision`?
                // Also applies to axis titles up in the layout section
                // "name" also includes transform.styles
                {
                  pattern: /(^|value\.)name$/
                },
                // including nested colorbar attributes (ie marker.colorbar)
                {
                  pattern: /colorbar\.title\.text$/
                },
                {
                  pattern: /colorbar\.(x|y)$/,
                  attr: "editrevision"
                }
              ];
              function ct(Te, Oe) {
                for (var je = 0; je < Oe.length; je++) {
                  var Xe = Oe[je], nt = Te.match(Xe.pattern);
                  if (nt) {
                    var it = nt[1] || "";
                    return {
                      head: it,
                      tail: Te.substr(it.length + 1),
                      attr: Xe.attr
                    };
                  }
                }
              }
              function Tt(Te, Oe) {
                var je = g(Oe, Te).get();
                if (je !== void 0) return je;
                var Xe = Te.split(".");
                for (Xe.pop(); Xe.length > 1; )
                  if (Xe.pop(), je = g(Oe, Xe.join(".") + ".uirevision").get(), je !== void 0) return je;
                return Oe.uirevision;
              }
              function kt(Te, Oe) {
                for (var je = 0; je < Oe.length; je++)
                  if (Oe[je]._fullInput.uid === Te) return je;
                return -1;
              }
              function Ot(Te, Oe, je) {
                for (var Xe = 0; Xe < Oe.length; Xe++)
                  if (Oe[Xe].uid === Te) return Xe;
                return !Oe[je] || Oe[je].uid ? -1 : je;
              }
              function Rt(Te, Oe) {
                var je = p.isPlainObject(Te), Xe = Array.isArray(Te);
                return je || Xe ? (je && p.isPlainObject(Oe) || Xe && Array.isArray(Oe)) && JSON.stringify(Te) === JSON.stringify(Oe) : Te === Oe;
              }
              function xt(Te, Oe, je, Xe) {
                var nt = Xe._preGUI, it, Nt, At, vt, ut, Pt, rr, lr, Mr, Rr, Pr = [], ir = {}, Lr = {};
                for (it in nt) {
                  if (ut = ct(it, Ue), ut) {
                    if (Mr = ut.head, Rr = ut.tail, Nt = ut.attr || Mr + ".uirevision", At = g(Xe, Nt).get(), vt = At && Tt(Nt, Oe), vt && vt === At) {
                      if (Pt = nt[it], Pt === null && (Pt = void 0), rr = g(Oe, it), lr = rr.get(), Rt(lr, Pt)) {
                        lr === void 0 && Rr === "autorange" && Pr.push(Mr), rr.set(_(g(Xe, it).get()));
                        continue;
                      } else if (Rr === "autorange" || Rr.substr(0, 6) === "range[") {
                        var yr = nt[Mr + ".range[0]"], Sr = nt[Mr + ".range[1]"], Yr = nt[Mr + ".autorange"];
                        if (Yr || Yr === null && yr === null && Sr === null) {
                          if (!(Mr in ir)) {
                            var Ar = g(Oe, Mr).get();
                            ir[Mr] = Ar && (Ar.autorange || Ar.autorange !== !1 && (!Ar.range || Ar.range.length !== 2));
                          }
                          if (ir[Mr]) {
                            rr.set(_(g(Xe, it).get()));
                            continue;
                          }
                        }
                      }
                    }
                  } else
                    p.warn("unrecognized GUI edit: " + it);
                  delete nt[it], ut && ut.tail.substr(0, 6) === "range[" && (Lr[ut.head] = 1);
                }
                for (var pr = 0; pr < Pr.length; pr++) {
                  var kr = Pr[pr];
                  if (Lr[kr]) {
                    var br = g(Oe, kr).get();
                    br && delete br.autorange;
                  }
                }
                var Gr = Xe._tracePreGUI;
                for (var rn in Gr) {
                  var cn = Gr[rn], Dr = null, Se;
                  for (it in cn) {
                    if (!Dr) {
                      var ae = kt(rn, je);
                      if (ae < 0) {
                        delete Gr[rn];
                        break;
                      }
                      var ft = je[ae];
                      Se = ft._fullInput;
                      var rt = Ot(rn, Te, Se.index);
                      if (rt < 0) {
                        delete Gr[rn];
                        break;
                      }
                      Dr = Te[rt];
                    }
                    if (ut = ct(it, ot), ut) {
                      if (ut.attr ? (At = g(Xe, ut.attr).get(), vt = At && Tt(ut.attr, Oe)) : (At = Se.uirevision, vt = Dr.uirevision, vt === void 0 && (vt = Oe.uirevision)), vt && vt === At && (Pt = cn[it], Pt === null && (Pt = void 0), rr = g(Dr, it), lr = rr.get(), Rt(lr, Pt))) {
                        rr.set(_(g(Se, it).get()));
                        continue;
                      }
                    } else
                      p.warn("unrecognized GUI edit: " + it + " in trace uid " + rn);
                    delete cn[it];
                  }
                }
              }
              function Wt(Te, Oe, je, Xe) {
                var nt, it;
                function Nt() {
                  return c.addFrames(Te, nt);
                }
                Te = p.getGraphDiv(Te), O.clearPromiseQueue(Te);
                var At = Te._fullData, vt = Te._fullLayout;
                if (!p.isPlotDiv(Te) || !At || !vt)
                  it = c.newPlot(Te, Oe, je, Xe);
                else {
                  if (p.isPlainObject(Oe)) {
                    var ut = Oe;
                    Oe = ut.data, je = ut.layout, Xe = ut.config, nt = ut.frames;
                  }
                  var Pt = !1;
                  if (Xe) {
                    var rr = p.extendDeep({}, Te._context);
                    Te._context = void 0, ce(Te, Xe), Pt = Yt(rr, Te._context);
                  }
                  Te.data = Oe || [], O.cleanData(Te.data), Te.layout = je || {}, O.cleanLayout(Te.layout), xt(Te.data, Te.layout, At, vt), w.supplyDefaults(Te, {
                    skipUpdateCalc: !0
                  });
                  var lr = Te._fullData, Mr = Te._fullLayout, Rr = Mr.datarevision === void 0, Pr = Mr.transition, ir = jt(Te, vt, Mr, Rr, Pr), Lr = ir.newDataRevision, yr = bt(Te, At, lr, Rr, Pr, Lr);
                  if (De(Te) && (ir.layoutReplot = !0), yr.calc || ir.calc) {
                    Te.calcdata = void 0;
                    for (var Sr = Object.getOwnPropertyNames(Mr), Yr = 0; Yr < Sr.length; Yr++) {
                      var Ar = Sr[Yr], pr = Ar.substring(0, 5);
                      if (pr === "xaxis" || pr === "yaxis") {
                        var kr = Mr[Ar]._emptyCategories;
                        kr && kr();
                      }
                    }
                  } else
                    w.supplyDefaultsUpdateCalc(Te.calcdata, lr);
                  var br = [];
                  if (nt && (Te._transitionData = {}, w.createTransitionData(Te), br.push(Nt)), Mr.transition && !Pt && (yr.anim || ir.anim))
                    ir.ticks && br.push(N.doTicksRelayout), w.doCalcdata(Te), N.doAutoRangeAndConstraints(Te), br.push(function() {
                      return w.transitionFromReact(Te, yr, ir, vt);
                    });
                  else if (yr.fullReplot || ir.layoutReplot || Pt)
                    Te._fullLayout._skipDefaults = !0, br.push(c._doPlot);
                  else {
                    for (var Gr in ir.arrays) {
                      var rn = ir.arrays[Gr];
                      if (rn.length) {
                        var cn = m.getComponentMethod(Gr, "drawOne");
                        if (cn !== p.noop)
                          for (var Dr = 0; Dr < rn.length; Dr++)
                            cn(Te, rn[Dr]);
                        else {
                          var Se = m.getComponentMethod(Gr, "draw");
                          if (Se === p.noop)
                            throw new Error("cannot draw components: " + Gr);
                          Se(Te);
                        }
                      }
                    }
                    br.push(w.previousPromises), yr.style && br.push(N.doTraceStyle), (yr.colorbars || ir.colorbars) && br.push(N.doColorBars), ir.legend && br.push(N.doLegend), ir.layoutstyle && br.push(N.layoutStyles), ir.axrange && Ve(br), ir.ticks && br.push(N.doTicksRelayout), ir.modebar && br.push(N.doModeBar), ir.camera && br.push(N.doCamera), br.push(Z);
                  }
                  br.push(w.rehover, w.redrag, w.reselect), it = p.syncOrAsync(br, Te), (!it || !it.then) && (it = Promise.resolve(Te));
                }
                return it.then(function() {
                  return Te.emit("plotly_react", {
                    data: Oe,
                    layout: je
                  }), Te;
                });
              }
              function bt(Te, Oe, je, Xe, nt, it) {
                var Nt = Oe.length === je.length;
                if (!nt && !Nt)
                  return {
                    fullReplot: !0,
                    calc: !0
                  };
                var At = Y.traceFlags();
                At.arrays = {}, At.nChanges = 0, At.nChangesAnim = 0;
                var vt, ut;
                function Pt(Mr) {
                  var Rr = h.getTraceValObject(ut, Mr);
                  return !ut._module.animatable && Rr.anim && (Rr.anim = !1), Rr;
                }
                var rr = {
                  getValObject: Pt,
                  flags: At,
                  immutable: Xe,
                  transition: nt,
                  newDataRevision: it,
                  gd: Te
                }, lr = {};
                for (vt = 0; vt < Oe.length; vt++)
                  if (je[vt]) {
                    if (ut = je[vt]._fullInput, w.hasMakesDataTransform(ut) && (ut = je[vt]), lr[ut.uid]) continue;
                    lr[ut.uid] = 1, qt(Oe[vt]._fullInput, ut, [], rr);
                  }
                return (At.calc || At.plot) && (At.fullReplot = !0), nt && At.nChanges && At.nChangesAnim && (At.anim = At.nChanges === At.nChangesAnim && Nt ? "all" : "some"), At;
              }
              function jt(Te, Oe, je, Xe, nt) {
                var it = Y.layoutFlags();
                it.arrays = {}, it.rangesAltered = {}, it.nChanges = 0, it.nChangesAnim = 0;
                function Nt(vt) {
                  return h.getLayoutValObject(je, vt);
                }
                var At = {
                  getValObject: Nt,
                  flags: it,
                  immutable: Xe,
                  transition: nt,
                  gd: Te
                };
                return qt(Oe, je, [], At), (it.plot || it.calc) && (it.layoutReplot = !0), nt && it.nChanges && it.nChangesAnim && (it.anim = it.nChanges === it.nChangesAnim ? "all" : "some"), it;
              }
              function qt(Te, Oe, je, Xe) {
                var nt, it, Nt, At = Xe.getValObject, vt = Xe.flags, ut = Xe.immutable, Pt = Xe.inArray, rr = Xe.arrayIndex;
                function lr() {
                  var ae = nt.editType;
                  if (Pt && ae.indexOf("arraydraw") !== -1) {
                    p.pushUnique(vt.arrays[Pt], rr);
                    return;
                  }
                  Y.update(vt, nt), ae !== "none" && vt.nChanges++, Xe.transition && nt.anim && vt.nChangesAnim++, (Be.test(Nt) || Je.test(Nt)) && (vt.rangesAltered[je[0]] = 1), et.test(Nt) && g(Oe, "_inputDomain").set(null), it === "datarevision" && (vt.newDataRevision = 1);
                }
                function Mr(ae) {
                  return ae.valType === "data_array" || ae.arrayOk;
                }
                for (it in Te) {
                  if (vt.calc && !Xe.transition) return;
                  var Rr = Te[it], Pr = Oe[it], ir = je.concat(it);
                  if (Nt = ir.join("."), !(it.charAt(0) === "_" || typeof Rr == "function" || Rr === Pr)) {
                    if ((it === "tick0" || it === "dtick") && je[0] !== "geo") {
                      var Lr = Oe.tickmode;
                      if (Lr === "auto" || Lr === "array" || !Lr) continue;
                    }
                    if (!(it === "range" && Oe.autorange) && !((it === "zmin" || it === "zmax") && Oe.type === "contourcarpet") && (nt = At(ir), !!nt && !(nt._compareAsJSON && JSON.stringify(Rr) === JSON.stringify(Pr)))) {
                      var yr = nt.valType, Sr, Yr = Mr(nt), Ar = Array.isArray(Rr), pr = Array.isArray(Pr);
                      if (Ar && pr) {
                        var kr = "_input_" + it, br = Te[kr], Gr = Oe[kr];
                        if (Array.isArray(br) && br === Gr) continue;
                      }
                      if (Pr === void 0)
                        Yr && Ar ? vt.calc = !0 : lr();
                      else if (nt._isLinkedToArray) {
                        var rn = [], cn = !1;
                        Pt || (vt.arrays[it] = rn);
                        var Dr = Math.min(Rr.length, Pr.length), Se = Math.max(Rr.length, Pr.length);
                        if (Dr !== Se)
                          if (nt.editType === "arraydraw")
                            cn = !0;
                          else {
                            lr();
                            continue;
                          }
                        for (Sr = 0; Sr < Dr; Sr++)
                          qt(
                            Rr[Sr],
                            Pr[Sr],
                            ir.concat(Sr),
                            // add array indices, but not if we're already in an array
                            p.extendFlat({
                              inArray: it,
                              arrayIndex: Sr
                            }, Xe)
                          );
                        if (cn)
                          for (Sr = Dr; Sr < Se; Sr++)
                            rn.push(Sr);
                      } else !yr && p.isPlainObject(Rr) ? qt(Rr, Pr, ir, Xe) : Yr ? Ar && pr ? (ut && (vt.calc = !0), (ut || Xe.newDataRevision) && lr()) : Ar !== pr ? vt.calc = !0 : lr() : Ar && pr ? (Rr.length !== Pr.length || String(Rr) !== String(Pr)) && lr() : lr();
                    }
                  }
                }
                for (it in Oe)
                  if (!(it in Te || it.charAt(0) === "_" || typeof Oe[it] == "function"))
                    if (nt = At(je.concat(it)), Mr(nt) && Array.isArray(Oe[it])) {
                      vt.calc = !0;
                      return;
                    } else lr();
              }
              function Yt(Te, Oe) {
                var je;
                for (je in Te)
                  if (je.charAt(0) !== "_") {
                    var Xe = Te[je], nt = Oe[je];
                    if (Xe !== nt)
                      if (p.isPlainObject(Xe) && p.isPlainObject(nt)) {
                        if (Yt(Xe, nt))
                          return !0;
                      } else if (Array.isArray(Xe) && Array.isArray(nt)) {
                        if (Xe.length !== nt.length)
                          return !0;
                        for (var it = 0; it < Xe.length; it++)
                          if (Xe[it] !== nt[it])
                            if (p.isPlainObject(Xe[it]) && p.isPlainObject(nt[it])) {
                              if (Yt(Xe[it], nt[it]))
                                return !0;
                            } else
                              return !0;
                      } else
                        return !0;
                  }
              }
              function Ut(Te, Oe, je) {
                if (Te = p.getGraphDiv(Te), !p.isPlotDiv(Te))
                  throw new Error("This element is not a Plotly plot: " + Te + ". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");
                var Xe = Te._transitionData;
                Xe._frameQueue || (Xe._frameQueue = []), je = w.supplyAnimationDefaults(je);
                var nt = je.transition, it = je.frame;
                Xe._frameWaitingCnt === void 0 && (Xe._frameWaitingCnt = 0);
                function Nt(ut) {
                  return Array.isArray(nt) ? ut >= nt.length ? nt[0] : nt[ut] : nt;
                }
                function At(ut) {
                  return Array.isArray(it) ? ut >= it.length ? it[0] : it[ut] : it;
                }
                function vt(ut, Pt) {
                  var rr = 0;
                  return function() {
                    if (ut && ++rr === Pt)
                      return ut();
                  };
                }
                return new Promise(function(ut, Pt) {
                  function rr() {
                    if (Xe._frameQueue.length !== 0) {
                      for (; Xe._frameQueue.length; ) {
                        var Dr = Xe._frameQueue.pop();
                        Dr.onInterrupt && Dr.onInterrupt();
                      }
                      Te.emit("plotly_animationinterrupted", []);
                    }
                  }
                  function lr(Dr) {
                    if (Dr.length !== 0) {
                      for (var Se = 0; Se < Dr.length; Se++) {
                        var ae;
                        Dr[Se].type === "byname" ? ae = w.computeFrame(Te, Dr[Se].name) : ae = Dr[Se].data;
                        var ft = At(Se), rt = Nt(Se);
                        rt.duration = Math.min(rt.duration, ft.duration);
                        var gt = {
                          frame: ae,
                          name: Dr[Se].name,
                          frameOpts: ft,
                          transitionOpts: rt
                        };
                        Se === Dr.length - 1 && (gt.onComplete = vt(ut, 2), gt.onInterrupt = Pt), Xe._frameQueue.push(gt);
                      }
                      je.mode === "immediate" && (Xe._lastFrameAt = -1 / 0), Xe._animationRaf || Pr();
                    }
                  }
                  function Mr() {
                    Te.emit("plotly_animated"), window.cancelAnimationFrame(Xe._animationRaf), Xe._animationRaf = null;
                  }
                  function Rr() {
                    Xe._currentFrame && Xe._currentFrame.onComplete && Xe._currentFrame.onComplete();
                    var Dr = Xe._currentFrame = Xe._frameQueue.shift();
                    if (Dr) {
                      var Se = Dr.name ? Dr.name.toString() : null;
                      Te._fullLayout._currentFrame = Se, Xe._lastFrameAt = Date.now(), Xe._timeToNext = Dr.frameOpts.duration, w.transition(Te, Dr.frame.data, Dr.frame.layout, O.coerceTraceIndices(Te, Dr.frame.traces), Dr.frameOpts, Dr.transitionOpts).then(function() {
                        Dr.onComplete && Dr.onComplete();
                      }), Te.emit("plotly_animatingframe", {
                        name: Se,
                        frame: Dr.frame,
                        animation: {
                          frame: Dr.frameOpts,
                          transition: Dr.transitionOpts
                        }
                      });
                    } else
                      Mr();
                  }
                  function Pr() {
                    Te.emit("plotly_animating"), Xe._lastFrameAt = -1 / 0, Xe._timeToNext = 0, Xe._runningTransitions = 0, Xe._currentFrame = null;
                    var Dr = function() {
                      Xe._animationRaf = window.requestAnimationFrame(Dr), Date.now() - Xe._lastFrameAt > Xe._timeToNext && Rr();
                    };
                    Dr();
                  }
                  var ir = 0;
                  function Lr(Dr) {
                    return Array.isArray(nt) ? ir >= nt.length ? Dr.transitionOpts = nt[ir] : Dr.transitionOpts = nt[0] : Dr.transitionOpts = nt, ir++, Dr;
                  }
                  var yr, Sr, Yr = [], Ar = Oe == null, pr = Array.isArray(Oe), kr = !Ar && !pr && p.isPlainObject(Oe);
                  if (kr)
                    Yr.push({
                      type: "object",
                      data: Lr(p.extendFlat({}, Oe))
                    });
                  else if (Ar || ["string", "number"].indexOf(typeof Oe) !== -1)
                    for (yr = 0; yr < Xe._frames.length; yr++)
                      Sr = Xe._frames[yr], Sr && (Ar || String(Sr.group) === String(Oe)) && Yr.push({
                        type: "byname",
                        name: String(Sr.name),
                        data: Lr({
                          name: Sr.name
                        })
                      });
                  else if (pr)
                    for (yr = 0; yr < Oe.length; yr++) {
                      var br = Oe[yr];
                      ["number", "string"].indexOf(typeof br) !== -1 ? (br = String(br), Yr.push({
                        type: "byname",
                        name: br,
                        data: Lr({
                          name: br
                        })
                      })) : p.isPlainObject(br) && Yr.push({
                        type: "object",
                        data: Lr(p.extendFlat({}, br))
                      });
                    }
                  for (yr = 0; yr < Yr.length; yr++)
                    if (Sr = Yr[yr], Sr.type === "byname" && !Xe._frameHash[Sr.data.name]) {
                      p.warn('animate failure: frame not found: "' + Sr.data.name + '"'), Pt();
                      return;
                    }
                  ["next", "immediate"].indexOf(je.mode) !== -1 && rr(), je.direction === "reverse" && Yr.reverse();
                  var Gr = Te._fullLayout._currentFrame;
                  if (Gr && je.fromcurrent) {
                    var rn = -1;
                    for (yr = 0; yr < Yr.length; yr++)
                      if (Sr = Yr[yr], Sr.type === "byname" && Sr.name === Gr) {
                        rn = yr;
                        break;
                      }
                    if (rn > 0 && rn < Yr.length - 1) {
                      var cn = [];
                      for (yr = 0; yr < Yr.length; yr++)
                        Sr = Yr[yr], (Yr[yr].type !== "byname" || yr > rn) && cn.push(Sr);
                      Yr = cn;
                    }
                  }
                  Yr.length > 0 ? lr(Yr) : (Te.emit("plotly_animated"), ut());
                });
              }
              function tt(Te, Oe, je) {
                if (Te = p.getGraphDiv(Te), Oe == null)
                  return Promise.resolve();
                if (!p.isPlotDiv(Te))
                  throw new Error("This element is not a Plotly plot: " + Te + ". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");
                var Xe, nt, it, Nt, At = Te._transitionData._frames, vt = Te._transitionData._frameHash;
                if (!Array.isArray(Oe))
                  throw new Error("addFrames failure: frameList must be an Array of frame definitions" + Oe);
                var ut = At.length + Oe.length * 2, Pt = [], rr = {};
                for (Xe = Oe.length - 1; Xe >= 0; Xe--)
                  if (p.isPlainObject(Oe[Xe])) {
                    var lr = Oe[Xe].name, Mr = (vt[lr] || rr[lr] || {}).name, Rr = Oe[Xe].name, Pr = vt[Mr] || rr[Mr];
                    Mr && Rr && typeof Rr == "number" && Pr && te < re && (te++, p.warn('addFrames: overwriting frame "' + (vt[Mr] || rr[Mr]).name + '" with a frame whose name of type "number" also equates to "' + Mr + '". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'), te === re && p.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")), rr[lr] = {
                      name: lr
                    }, Pt.push({
                      frame: w.supplyFrameDefaults(Oe[Xe]),
                      index: je && je[Xe] !== void 0 && je[Xe] !== null ? je[Xe] : ut + Xe
                    });
                  }
                Pt.sort(function(kr, br) {
                  return kr.index > br.index ? -1 : kr.index < br.index ? 1 : 0;
                });
                var ir = [], Lr = [], yr = At.length;
                for (Xe = Pt.length - 1; Xe >= 0; Xe--) {
                  if (nt = Pt[Xe].frame, typeof nt.name == "number" && p.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"), !nt.name)
                    for (; vt[nt.name = "frame " + Te._transitionData._counter++]; ) ;
                  if (vt[nt.name]) {
                    for (it = 0; it < At.length && (At[it] || {}).name !== nt.name; it++)
                      ;
                    ir.push({
                      type: "replace",
                      index: it,
                      value: nt
                    }), Lr.unshift({
                      type: "replace",
                      index: it,
                      value: At[it]
                    });
                  } else
                    Nt = Math.max(0, Math.min(Pt[Xe].index, yr)), ir.push({
                      type: "insert",
                      index: Nt,
                      value: nt
                    }), Lr.unshift({
                      type: "delete",
                      index: Nt
                    }), yr++;
                }
                var Sr = w.modifyFrames, Yr = w.modifyFrames, Ar = [Te, Lr], pr = [Te, ir];
                return C && C.add(Te, Sr, Ar, Yr, pr), w.modifyFrames(Te, ir);
              }
              function ze(Te, Oe) {
                if (Te = p.getGraphDiv(Te), !p.isPlotDiv(Te))
                  throw new Error("This element is not a Plotly plot: " + Te);
                var je, Xe, nt = Te._transitionData._frames, it = [], Nt = [];
                if (!Oe)
                  for (Oe = [], je = 0; je < nt.length; je++)
                    Oe.push(je);
                for (Oe = Oe.slice(), Oe.sort(), je = Oe.length - 1; je >= 0; je--)
                  Xe = Oe[je], it.push({
                    type: "delete",
                    index: Xe
                  }), Nt.unshift({
                    type: "insert",
                    index: Xe,
                    value: nt[Xe]
                  });
                var At = w.modifyFrames, vt = w.modifyFrames, ut = [Te, Nt], Pt = [Te, it];
                return C && C.add(Te, At, ut, vt, Pt), w.modifyFrames(Te, it);
              }
              function _e(Te) {
                Te = p.getGraphDiv(Te);
                var Oe = Te._fullLayout || {}, je = Te._fullData || [];
                return w.cleanPlot([], {}, je, Oe), w.purge(Te), y.purge(Te), Oe._container && Oe._container.remove(), delete Te._context, Te;
              }
              function Ye(Te) {
                var Oe = Te._fullLayout, je = Te.getBoundingClientRect();
                if (!p.equalDomRects(je, Oe._lastBBox)) {
                  var Xe = Oe._invTransform = p.inverseTransformMatrix(p.getFullTransformMatrix(Te));
                  Oe._invScaleX = Math.sqrt(Xe[0][0] * Xe[0][0] + Xe[0][1] * Xe[0][1] + Xe[0][2] * Xe[0][2]), Oe._invScaleY = Math.sqrt(Xe[1][0] * Xe[1][0] + Xe[1][1] * Xe[1][1] + Xe[1][2] * Xe[1][2]), Oe._lastBBox = je;
                }
              }
              function lt(Te) {
                var Oe = l.select(Te), je = Te._fullLayout;
                if (je._calcInverseTransform = Ye, je._calcInverseTransform(Te), je._container = Oe.selectAll(".plot-container").data([0]), je._container.enter().insert("div", ":first-child").classed("plot-container", !0).classed("plotly", !0), je._paperdiv = je._container.selectAll(".svg-container").data([0]), je._paperdiv.enter().append("div").classed("user-select-none", !0).classed("svg-container", !0).style("position", "relative"), je._glcontainer = je._paperdiv.selectAll(".gl-container").data([{}]), je._glcontainer.enter().append("div").classed("gl-container", !0), je._paperdiv.selectAll(".main-svg").remove(), je._paperdiv.select(".modebar-container").remove(), je._paper = je._paperdiv.insert("svg", ":first-child").classed("main-svg", !0), je._toppaper = je._paperdiv.append("svg").classed("main-svg", !0), je._modebardiv = je._paperdiv.append("div"), delete je._modeBar, je._hoverpaper = je._paperdiv.append("svg").classed("main-svg", !0), !je._uid) {
                  var Xe = {};
                  l.selectAll("defs").each(function() {
                    this.id && (Xe[this.id.split("-")[1]] = 1);
                  }), je._uid = p.randstr(Xe);
                }
                je._paperdiv.selectAll(".main-svg").attr(k.svgAttrs), je._defs = je._paper.append("defs").attr("id", "defs-" + je._uid), je._clips = je._defs.append("g").classed("clips", !0), je._topdefs = je._toppaper.append("defs").attr("id", "topdefs-" + je._uid), je._topclips = je._topdefs.append("g").classed("clips", !0), je._bgLayer = je._paper.append("g").classed("bglayer", !0), je._draggers = je._paper.append("g").classed("draglayer", !0);
                var nt = je._paper.append("g").classed("layer-below", !0);
                je._imageLowerLayer = nt.append("g").classed("imagelayer", !0), je._shapeLowerLayer = nt.append("g").classed("shapelayer", !0), je._cartesianlayer = je._paper.append("g").classed("cartesianlayer", !0), je._polarlayer = je._paper.append("g").classed("polarlayer", !0), je._smithlayer = je._paper.append("g").classed("smithlayer", !0), je._ternarylayer = je._paper.append("g").classed("ternarylayer", !0), je._geolayer = je._paper.append("g").classed("geolayer", !0), je._funnelarealayer = je._paper.append("g").classed("funnelarealayer", !0), je._pielayer = je._paper.append("g").classed("pielayer", !0), je._iciclelayer = je._paper.append("g").classed("iciclelayer", !0), je._treemaplayer = je._paper.append("g").classed("treemaplayer", !0), je._sunburstlayer = je._paper.append("g").classed("sunburstlayer", !0), je._indicatorlayer = je._toppaper.append("g").classed("indicatorlayer", !0), je._glimages = je._paper.append("g").classed("glimages", !0);
                var it = je._toppaper.append("g").classed("layer-above", !0);
                je._imageUpperLayer = it.append("g").classed("imagelayer", !0), je._shapeUpperLayer = it.append("g").classed("shapelayer", !0), je._selectionLayer = je._toppaper.append("g").classed("selectionlayer", !0), je._infolayer = je._toppaper.append("g").classed("infolayer", !0), je._menulayer = je._toppaper.append("g").classed("menulayer", !0), je._zoomlayer = je._toppaper.append("g").classed("zoomlayer", !0), je._hoverlayer = je._hoverpaper.append("g").classed("hoverlayer", !0), je._modebardiv.classed("modebar-container", !0).style("position", "absolute").style("top", "0px").style("right", "0px"), Te.emit("plotly_framework");
              }
              c.animate = Ut, c.addFrames = tt, c.deleteFrames = ze, c.addTraces = Ae, c.deleteTraces = K, c.extendTraces = we, c.moveTraces = ee, c.prependTraces = Re, c.newPlot = U, c._doPlot = z, c.purge = _e, c.react = Wt, c.redraw = X, c.relayout = xe, c.restyle = oe, c.setPlotConfig = W, c.update = Ne, c._guiRelayout = Ie(xe), c._guiRestyle = Ie(oe), c._guiUpdate = Ie(Ne), c._storeDirectGUIEdit = $;
            }
          ),
          /***/
          556: (
            /***/
            function(s) {
              var c = {
                staticPlot: {
                  valType: "boolean",
                  dflt: !1
                },
                typesetMath: {
                  valType: "boolean",
                  dflt: !0
                },
                plotlyServerURL: {
                  valType: "string",
                  dflt: ""
                },
                editable: {
                  valType: "boolean",
                  dflt: !1
                },
                edits: {
                  annotationPosition: {
                    valType: "boolean",
                    dflt: !1
                  },
                  annotationTail: {
                    valType: "boolean",
                    dflt: !1
                  },
                  annotationText: {
                    valType: "boolean",
                    dflt: !1
                  },
                  axisTitleText: {
                    valType: "boolean",
                    dflt: !1
                  },
                  colorbarPosition: {
                    valType: "boolean",
                    dflt: !1
                  },
                  colorbarTitleText: {
                    valType: "boolean",
                    dflt: !1
                  },
                  legendPosition: {
                    valType: "boolean",
                    dflt: !1
                  },
                  legendText: {
                    valType: "boolean",
                    dflt: !1
                  },
                  shapePosition: {
                    valType: "boolean",
                    dflt: !1
                  },
                  titleText: {
                    valType: "boolean",
                    dflt: !1
                  }
                },
                editSelection: {
                  valType: "boolean",
                  dflt: !0
                },
                autosizable: {
                  valType: "boolean",
                  dflt: !1
                },
                responsive: {
                  valType: "boolean",
                  dflt: !1
                },
                fillFrame: {
                  valType: "boolean",
                  dflt: !1
                },
                frameMargins: {
                  valType: "number",
                  dflt: 0,
                  min: 0,
                  max: 0.5
                },
                scrollZoom: {
                  valType: "flaglist",
                  flags: ["cartesian", "gl3d", "geo", "mapbox"],
                  extras: [!0, !1],
                  dflt: "gl3d+geo+mapbox"
                },
                doubleClick: {
                  valType: "enumerated",
                  values: [!1, "reset", "autosize", "reset+autosize"],
                  dflt: "reset+autosize"
                },
                doubleClickDelay: {
                  valType: "number",
                  dflt: 300,
                  min: 0
                },
                showAxisDragHandles: {
                  valType: "boolean",
                  dflt: !0
                },
                showAxisRangeEntryBoxes: {
                  valType: "boolean",
                  dflt: !0
                },
                showTips: {
                  valType: "boolean",
                  dflt: !0
                },
                showLink: {
                  valType: "boolean",
                  dflt: !1
                },
                linkText: {
                  valType: "string",
                  dflt: "Edit chart",
                  noBlank: !0
                },
                sendData: {
                  valType: "boolean",
                  dflt: !0
                },
                showSources: {
                  valType: "any",
                  dflt: !1
                },
                displayModeBar: {
                  valType: "enumerated",
                  values: ["hover", !0, !1],
                  dflt: "hover"
                },
                showSendToCloud: {
                  valType: "boolean",
                  dflt: !1
                },
                showEditInChartStudio: {
                  valType: "boolean",
                  dflt: !1
                },
                modeBarButtonsToRemove: {
                  valType: "any",
                  dflt: []
                },
                modeBarButtonsToAdd: {
                  valType: "any",
                  dflt: []
                },
                modeBarButtons: {
                  valType: "any",
                  dflt: !1
                },
                toImageButtonOptions: {
                  valType: "any",
                  dflt: {}
                },
                displaylogo: {
                  valType: "boolean",
                  dflt: !0
                },
                watermark: {
                  valType: "boolean",
                  dflt: !1
                },
                plotGlPixelRatio: {
                  valType: "number",
                  dflt: 2,
                  min: 1,
                  max: 4
                },
                setBackground: {
                  valType: "any",
                  dflt: "transparent"
                },
                topojsonURL: {
                  valType: "string",
                  noBlank: !0,
                  dflt: "https://cdn.plot.ly/"
                },
                mapboxAccessToken: {
                  valType: "string",
                  dflt: null
                },
                logging: {
                  valType: "integer",
                  min: 0,
                  max: 2,
                  dflt: 1
                },
                notifyOnLogging: {
                  valType: "integer",
                  min: 0,
                  max: 2,
                  dflt: 0
                },
                queueLength: {
                  valType: "integer",
                  min: 0,
                  dflt: 0
                },
                globalTransforms: {
                  valType: "any",
                  dflt: []
                },
                locale: {
                  valType: "string",
                  dflt: "en-US"
                },
                locales: {
                  valType: "any",
                  dflt: {}
                }
              }, i = {};
              function l(v, f) {
                for (var p in v) {
                  var g = v[p];
                  g.valType ? f[p] = g.dflt : (f[p] || (f[p] = {}), l(g, f[p]));
                }
              }
              l(c, i), s.exports = {
                configAttributes: c,
                dfltConfig: i
              };
            }
          ),
          /***/
          3060: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3400), f = i(5464), p = i(4859), g = i(6672), y = i(5656), C = i(556).configAttributes, m = i(7824), h = v.extendDeepAll, w = v.isPlainObject, S = v.isArrayOrTypedArray, E = v.nestedProperty, x = v.valObjectMeta, T = "_isSubplotObj", F = "_isLinkedToArray", P = "_arrayAttrRegexps", k = "_deprecated", I = [T, F, P, k];
              c.IS_SUBPLOT_OBJ = T, c.IS_LINKED_TO_ARRAY = F, c.DEPRECATED = k, c.UNDERSCORE_ATTRS = I, c.get = function() {
                var ce = {};
                l.allTypes.forEach(function(U) {
                  ce[U] = N(U);
                });
                var X = {};
                return Object.keys(l.transformsRegistry).forEach(function(U) {
                  X[U] = j(U);
                }), {
                  defs: {
                    valObjects: x,
                    metaKeys: I.concat(["description", "role", "editType", "impliedEdits"]),
                    editType: {
                      traces: m.traces,
                      layout: m.layout
                    },
                    impliedEdits: {}
                  },
                  traces: ce,
                  layout: Y(),
                  transforms: X,
                  frames: te(),
                  animation: re(y),
                  config: re(C)
                };
              }, c.crawl = function(ce, X, U, ne) {
                var se = U || 0;
                ne = ne || "", Object.keys(ce).forEach(function(le) {
                  var ue = ce[le];
                  if (I.indexOf(le) === -1) {
                    var ve = (ne ? ne + "." : "") + le;
                    X(ue, le, ce, se, ve), !c.isValObject(ue) && w(ue) && le !== "impliedEdits" && c.crawl(ue, X, se + 1, ve);
                  }
                });
              }, c.isValObject = function(ce) {
                return ce && ce.valType !== void 0;
              }, c.findArrayAttributes = function(ce) {
                var X = [], U = [], ne = [], se, le;
                function ue(Re, Ae, K, ee) {
                  U = U.slice(0, ee).concat([Ae]), ne = ne.slice(0, ee).concat([Re && Re._isLinkedToArray]);
                  var oe = Re && (Re.valType === "data_array" || Re.arrayOk === !0) && !(U[ee - 1] === "colorbar" && (Ae === "ticktext" || Ae === "tickvals"));
                  oe && ve(se, 0, "");
                }
                function ve(Re, Ae, K) {
                  var ee = Re[U[Ae]], oe = K + U[Ae];
                  if (Ae === U.length - 1)
                    S(ee) && X.push(le + oe);
                  else if (ne[Ae]) {
                    if (Array.isArray(ee))
                      for (var _ = 0; _ < ee.length; _++)
                        w(ee[_]) && ve(ee[_], Ae + 1, oe + "[" + _ + "].");
                  } else w(ee) && ve(ee, Ae + 1, oe + ".");
                }
                se = ce, le = "", c.crawl(f, ue), ce._module && ce._module.attributes && c.crawl(ce._module.attributes, ue);
                var be = ce.transforms;
                if (be)
                  for (var Me = 0; Me < be.length; Me++) {
                    var Ge = be[Me], we = Ge._module;
                    we && (le = "transforms[" + Me + "].", se = Ge, c.crawl(we.attributes, ue));
                  }
                return X;
              }, c.getTraceValObject = function(ce, X) {
                var U = X[0], ne = 1, se, le;
                if (U === "transforms") {
                  if (X.length === 1)
                    return f.transforms;
                  var ue = ce.transforms;
                  if (!Array.isArray(ue) || !ue.length) return !1;
                  var ve = X[1];
                  if (!O(ve) || ve >= ue.length)
                    return !1;
                  se = (l.transformsRegistry[ue[ve].type] || {}).attributes, le = se && se[X[2]], ne = 3;
                } else {
                  var be = ce._module;
                  if (be || (be = (l.modules[ce.type || f.type.dflt] || {})._module), !be) return !1;
                  if (se = be.attributes, le = se && se[U], !le) {
                    var Me = be.basePlotModule;
                    Me && Me.attributes && (le = Me.attributes[U]);
                  }
                  le || (le = f[U]);
                }
                return A(le, X, ne);
              }, c.getLayoutValObject = function(ce, X) {
                var U = L(ce, X[0]);
                return A(U, X, 1);
              };
              function L(ce, X) {
                var U, ne, se, le, ue = ce._basePlotModules;
                if (ue) {
                  var ve;
                  for (U = 0; U < ue.length; U++) {
                    if (se = ue[U], se.attrRegex && se.attrRegex.test(X)) {
                      if (se.layoutAttrOverrides) return se.layoutAttrOverrides;
                      !ve && se.layoutAttributes && (ve = se.layoutAttributes);
                    }
                    var be = se.baseLayoutAttrOverrides;
                    if (be && X in be) return be[X];
                  }
                  if (ve) return ve;
                }
                var Me = ce._modules;
                if (Me) {
                  for (U = 0; U < Me.length; U++)
                    if (le = Me[U].layoutAttributes, le && X in le)
                      return le[X];
                }
                for (ne in l.componentsRegistry) {
                  if (se = l.componentsRegistry[ne], se.name === "colorscale" && X.indexOf("coloraxis") === 0)
                    return se.layoutAttributes[X];
                  if (!se.schema && X === se.name)
                    return se.layoutAttributes;
                }
                return X in p ? p[X] : !1;
              }
              function A(ce, X, U) {
                if (!ce) return !1;
                if (ce._isLinkedToArray) {
                  if (O(X[U])) U++;
                  else if (U < X.length) return !1;
                }
                for (; U < X.length; U++) {
                  var ne = ce[X[U]];
                  if (w(ne)) ce = ne;
                  else break;
                  if (U === X.length - 1) break;
                  if (ce._isLinkedToArray) {
                    if (U++, !O(X[U])) return !1;
                  } else if (ce.valType === "info_array") {
                    U++;
                    var se = X[U];
                    if (!O(se)) return !1;
                    var le = ce.items;
                    if (Array.isArray(le)) {
                      if (se >= le.length) return !1;
                      if (ce.dimensions === 2) {
                        if (U++, X.length === U) return ce;
                        var ue = X[U];
                        if (!O(ue)) return !1;
                        ce = le[se][ue];
                      } else ce = le[se];
                    } else
                      ce = le;
                  }
                }
                return ce;
              }
              function O(ce) {
                return ce === Math.round(ce) && ce >= 0;
              }
              function N(ce) {
                var X, U;
                X = l.modules[ce]._module, U = X.basePlotModule;
                var ne = {};
                ne.type = null;
                var se = h({}, f), le = h({}, X.attributes);
                c.crawl(le, function(be, Me, Ge, we, Re) {
                  E(se, Re).set(void 0), be === void 0 && E(le, Re).set(void 0);
                }), h(ne, se), l.traceIs(ce, "noOpacity") && delete ne.opacity, l.traceIs(ce, "showLegend") || (delete ne.showlegend, delete ne.legendgroup), l.traceIs(ce, "noHover") && (delete ne.hoverinfo, delete ne.hoverlabel), X.selectPoints || delete ne.selectedpoints, h(ne, le), U.attributes && h(ne, U.attributes), ne.type = ce;
                var ue = {
                  meta: X.meta || {},
                  categories: X.categories || {},
                  animatable: !!X.animatable,
                  type: ce,
                  attributes: re(ne)
                };
                if (X.layoutAttributes) {
                  var ve = {};
                  h(ve, X.layoutAttributes), ue.layoutAttributes = re(ve);
                }
                return X.animatable || c.crawl(ue, function(be) {
                  c.isValObject(be) && "anim" in be && delete be.anim;
                }), ue;
              }
              function Y() {
                var ce = {}, X, U;
                h(ce, p);
                for (X in l.subplotsRegistry)
                  if (U = l.subplotsRegistry[X], !!U.layoutAttributes)
                    if (Array.isArray(U.attr))
                      for (var ne = 0; ne < U.attr.length; ne++)
                        q(ce, U, U.attr[ne]);
                    else {
                      var se = U.attr === "subplot" ? U.name : U.attr;
                      q(ce, U, se);
                    }
                for (X in l.componentsRegistry) {
                  U = l.componentsRegistry[X];
                  var le = U.schema;
                  if (le && (le.subplots || le.layout)) {
                    var ue = le.subplots;
                    if (ue && ue.xaxis && !ue.yaxis)
                      for (var ve in ue.xaxis)
                        delete ce.yaxis[ve];
                    delete ce.xaxis.shift, delete ce.xaxis.autoshift;
                  } else U.name === "colorscale" ? h(ce, U.layoutAttributes) : U.layoutAttributes && ie(ce, U.layoutAttributes, U.name);
                }
                return {
                  layoutAttributes: re(ce)
                };
              }
              function j(ce) {
                var X = l.transformsRegistry[ce], U = h({}, X.attributes);
                return Object.keys(l.componentsRegistry).forEach(function(ne) {
                  var se = l.componentsRegistry[ne];
                  se.schema && se.schema.transforms && se.schema.transforms[ce] && Object.keys(se.schema.transforms[ce]).forEach(function(le) {
                    ie(U, se.schema.transforms[ce][le], le);
                  });
                }), {
                  attributes: re(U)
                };
              }
              function te() {
                var ce = {
                  frames: h({}, g)
                };
                return re(ce), ce.frames;
              }
              function re(ce) {
                return z(ce), Z(ce), W(ce), ce;
              }
              function z(ce) {
                function X(ne) {
                  return {
                    valType: "string",
                    editType: "none"
                  };
                }
                function U(ne, se, le) {
                  c.isValObject(ne) ? (ne.arrayOk === !0 || ne.valType === "data_array") && (le[se + "src"] = X()) : w(ne) && (ne.role = "object");
                }
                c.crawl(ce, U);
              }
              function Z(ce) {
                function X(U, ne, se) {
                  if (U) {
                    var le = U[F];
                    le && (delete U[F], se[ne] = {
                      items: {}
                    }, se[ne].items[le] = U, se[ne].role = "object");
                  }
                }
                c.crawl(ce, X);
              }
              function W(ce) {
                function X(U) {
                  for (var ne in U)
                    if (w(U[ne]))
                      X(U[ne]);
                    else if (Array.isArray(U[ne]))
                      for (var se = 0; se < U[ne].length; se++)
                        X(U[ne][se]);
                    else
                      U[ne] instanceof RegExp && (U[ne] = U[ne].toString());
                }
                X(ce);
              }
              function q(ce, X, U) {
                var ne = E(ce, U), se = h({}, X.layoutAttributes);
                se[T] = !0, ne.set(se);
              }
              function ie(ce, X, U) {
                var ne = E(ce, U);
                ne.set(h(ne.get() || {}, X));
              }
            }
          ),
          /***/
          1780: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(5464), f = "templateitemname", p = {
                name: {
                  valType: "string",
                  editType: "none"
                }
              };
              p[f] = {
                valType: "string",
                editType: "calc"
              }, c.templatedArray = function(C, m) {
                return m._isLinkedToArray = C, m.name = p.name, m[f] = p[f], m;
              }, c.traceTemplater = function(C) {
                var m = {}, h, w;
                for (h in C)
                  w = C[h], Array.isArray(w) && w.length && (m[h] = 0);
                function S(E) {
                  h = l.coerce(E, {}, v, "type");
                  var x = {
                    type: h,
                    _template: null
                  };
                  if (h in m) {
                    w = C[h];
                    var T = m[h] % w.length;
                    m[h]++, x._template = w[T];
                  }
                  return x;
                }
                return {
                  newTrace: S
                  // TODO: function to figure out what's left & what didn't work
                };
              }, c.newContainer = function(C, m, h) {
                var w = C._template, S = w && (w[m] || h && w[h]);
                l.isPlainObject(S) || (S = null);
                var E = C[m] = {
                  _template: S
                };
                return E;
              }, c.arrayTemplater = function(C, m, h) {
                var w = C._template, S = w && w[y(m)], E = w && w[m];
                (!Array.isArray(E) || !E.length) && (E = []);
                var x = {};
                function T(P) {
                  var k = {
                    name: P.name,
                    _input: P
                  }, I = k[f] = P[f];
                  if (!g(I))
                    return k._template = S, k;
                  for (var L = 0; L < E.length; L++) {
                    var A = E[L];
                    if (A.name === I)
                      return x[I] = 1, k._template = A, k;
                  }
                  return k[h] = P[h] || !1, k._template = !1, k;
                }
                function F() {
                  for (var P = [], k = 0; k < E.length; k++) {
                    var I = E[k], L = I.name;
                    if (g(L) && !x[L]) {
                      var A = {
                        _template: I,
                        name: L,
                        _input: {
                          _templateitemname: L
                        }
                      };
                      A[f] = I[f], P.push(A), x[L] = 1;
                    }
                  }
                  return P;
                }
                return {
                  newItem: T,
                  defaultItems: F
                };
              };
              function g(C) {
                return C && typeof C == "string";
              }
              function y(C) {
                var m = C.length - 1;
                return C.charAt(m) !== "s" && l.warn("bad argument to arrayDefaultKey: " + C), C.substr(0, C.length - 1) + "defaults";
              }
              c.arrayDefaultKey = y, c.arrayEditor = function(C, m, h) {
                var w = (l.nestedProperty(C, m).get() || []).length, S = h._index, E = S >= w && (h._input || {})._templateitemname;
                E && (S = w);
                var x = m + "[" + S + "]", T;
                function F() {
                  T = {}, E && (T[x] = {}, T[x][f] = E);
                }
                F();
                function P(A, O) {
                  T[A] = O;
                }
                function k(A, O) {
                  E ? l.nestedProperty(T[x], A).set(O) : T[x + "." + A] = O;
                }
                function I() {
                  var A = T;
                  return F(), A;
                }
                function L(A, O) {
                  A && k(A, O);
                  var N = I();
                  for (var Y in N)
                    l.nestedProperty(C, Y).set(N[Y]);
                }
                return {
                  modifyBase: P,
                  modifyItem: k,
                  getUpdateObj: I,
                  applyUpdate: L
                };
              };
            }
          ),
          /***/
          9172: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(7316), p = i(3400), g = i(2736), y = i(3696), C = i(6308), m = i(3616), h = i(1668), w = i(3080), S = i(4460), E = i(4284), x = i(1888), T = x.enforce, F = x.clean, P = i(9280).doAutoRange, k = "start", I = "middle", L = "end";
              c.layoutStyles = function(U) {
                return p.syncOrAsync([f.doAutoMargin, O], U);
              };
              function A(U, ne, se) {
                for (var le = 0; le < se.length; le++) {
                  var ue = se[le][0], ve = se[le][1];
                  if (!(ue[0] >= U[1] || ue[1] <= U[0]) && ve[0] < ne[1] && ve[1] > ne[0])
                    return !0;
                }
                return !1;
              }
              function O(U) {
                var ne = U._fullLayout, se = ne._size, le = se.p, ue = S.list(U, "", !0), ve, be, Me, Ge, we, Re;
                if (ne._paperdiv.style({
                  width: U._context.responsive && ne.autosize && !U._context._hasZeroWidth && !U.layout.width ? "100%" : ne.width + "px",
                  height: U._context.responsive && ne.autosize && !U._context._hasZeroHeight && !U.layout.height ? "100%" : ne.height + "px"
                }).selectAll(".main-svg").call(m.setSize, ne.width, ne.height), U._context.setBackground(U, ne.paper_bgcolor), c.drawMainTitle(U), w.manage(U), !ne._has("cartesian"))
                  return f.previousPromises(U);
                function Ae(_e, Ye, lt) {
                  var Te = _e._lw / 2;
                  if (_e._id.charAt(0) === "x") {
                    if (Ye) {
                      if (lt === "top") return Ye._offset - le - Te;
                    } else return se.t + se.h * (1 - (_e.position || 0)) + Te % 1;
                    return Ye._offset + Ye._length + le + Te;
                  }
                  if (Ye) {
                    if (lt === "right") return Ye._offset + Ye._length + le + Te;
                  } else return se.l + se.w * (_e.position || 0) + Te % 1;
                  return Ye._offset - le - Te;
                }
                for (ve = 0; ve < ue.length; ve++) {
                  Ge = ue[ve];
                  var K = Ge._anchorAxis;
                  Ge._linepositions = {}, Ge._lw = m.crispRound(U, Ge.linewidth, 1), Ge._mainLinePosition = Ae(Ge, K, Ge.side), Ge._mainMirrorPosition = Ge.mirror && K ? Ae(Ge, K, E.OPPOSITE_SIDE[Ge.side]) : null;
                }
                var ee = [], oe = [], _ = [], V = C.opacity(ne.paper_bgcolor) === 1 && C.opacity(ne.plot_bgcolor) === 1 && ne.paper_bgcolor === ne.plot_bgcolor;
                for (be in ne._plots)
                  if (Me = ne._plots[be], Me.mainplot)
                    Me.bg && Me.bg.remove(), Me.bg = void 0;
                  else {
                    var fe = Me.xaxis.domain, $ = Me.yaxis.domain, he = Me.plotgroup;
                    if (A(fe, $, _)) {
                      var me = he.node(), xe = Me.bg = p.ensureSingle(he, "rect", "bg");
                      me.insertBefore(xe.node(), me.childNodes[0]), oe.push(be);
                    } else
                      he.select("rect.bg").remove(), _.push([fe, $]), V || (ee.push(be), oe.push(be));
                  }
                var Fe = ne._bgLayer.selectAll(".bg").data(ee);
                for (Fe.enter().append("rect").classed("bg", !0), Fe.exit().remove(), Fe.each(function(_e) {
                  ne._plots[_e].bg = l.select(this);
                }), ve = 0; ve < oe.length; ve++)
                  Me = ne._plots[oe[ve]], we = Me.xaxis, Re = Me.yaxis, Me.bg && we._offset !== void 0 && Re._offset !== void 0 && Me.bg.call(m.setRect, we._offset - le, Re._offset - le, we._length + 2 * le, Re._length + 2 * le).call(C.fill, ne.plot_bgcolor).style("stroke-width", 0);
                if (!ne._hasOnlyLargeSploms)
                  for (be in ne._plots) {
                    Me = ne._plots[be], we = Me.xaxis, Re = Me.yaxis;
                    var Ve = Me.clipId = "clip" + ne._uid + be + "plot", Be = p.ensureSingleById(ne._clips, "clipPath", Ve, function(_e) {
                      _e.classed("plotclip", !0).append("rect");
                    });
                    Me.clipRect = Be.select("rect").attr({
                      width: we._length,
                      height: Re._length
                    }), m.setTranslate(Me.plot, we._offset, Re._offset);
                    var Je, et;
                    Me._hasClipOnAxisFalse ? (Je = null, et = Ve) : (Je = Ve, et = null), m.setClipUrl(Me.plot, Je, U), Me.layerClipId = et;
                  }
                var at, De, Ne, Ie, Ue, ot, ct, Tt, kt, Ot, Rt, xt, Wt;
                function bt(_e) {
                  return "M" + at + "," + _e + "H" + De;
                }
                function jt(_e) {
                  return "M" + we._offset + "," + _e + "h" + we._length;
                }
                function qt(_e) {
                  return "M" + _e + "," + Tt + "V" + ct;
                }
                function Yt(_e) {
                  return Re._shift !== void 0 && (_e += Re._shift), "M" + _e + "," + Re._offset + "v" + Re._length;
                }
                function Ut(_e, Ye, lt) {
                  if (!_e.showline || be !== _e._mainSubplot) return "";
                  if (!_e._anchorAxis) return lt(_e._mainLinePosition);
                  var Te = Ye(_e._mainLinePosition);
                  return _e.mirror && (Te += Ye(_e._mainMirrorPosition)), Te;
                }
                for (be in ne._plots) {
                  Me = ne._plots[be], we = Me.xaxis, Re = Me.yaxis;
                  var tt = "M0,0";
                  N(we, be) && (Ue = j(we, "left", Re, ue), at = we._offset - (Ue ? le + Ue : 0), ot = j(we, "right", Re, ue), De = we._offset + we._length + (ot ? le + ot : 0), Ne = Ae(we, Re, "bottom"), Ie = Ae(we, Re, "top"), Wt = !we._anchorAxis || be !== we._mainSubplot, Wt && (we.mirror === "allticks" || we.mirror === "all") && (we._linepositions[be] = [Ne, Ie]), tt = Ut(we, bt, jt), Wt && we.showline && (we.mirror === "all" || we.mirror === "allticks") && (tt += bt(Ne) + bt(Ie)), Me.xlines.style("stroke-width", we._lw + "px").call(C.stroke, we.showline ? we.linecolor : "rgba(0,0,0,0)")), Me.xlines.attr("d", tt);
                  var ze = "M0,0";
                  N(Re, be) && (Rt = j(Re, "bottom", we, ue), ct = Re._offset + Re._length + (Rt ? le : 0), xt = j(Re, "top", we, ue), Tt = Re._offset - (xt ? le : 0), kt = Ae(Re, we, "left"), Ot = Ae(Re, we, "right"), Wt = !Re._anchorAxis || be !== Re._mainSubplot, Wt && (Re.mirror === "allticks" || Re.mirror === "all") && (Re._linepositions[be] = [kt, Ot]), ze = Ut(Re, qt, Yt), Wt && Re.showline && (Re.mirror === "all" || Re.mirror === "allticks") && (ze += qt(kt) + qt(Ot)), Me.ylines.style("stroke-width", Re._lw + "px").call(C.stroke, Re.showline ? Re.linecolor : "rgba(0,0,0,0)")), Me.ylines.attr("d", ze);
                }
                return S.makeClipPaths(U), f.previousPromises(U);
              }
              function N(U, ne) {
                return (U.ticks || U.showline) && (ne === U._mainSubplot || U.mirror === "all" || U.mirror === "allticks");
              }
              function Y(U, ne, se) {
                if (!se.showline || !se._lw) return !1;
                if (se.mirror === "all" || se.mirror === "allticks") return !0;
                var le = se._anchorAxis;
                if (!le) return !1;
                var ue = E.FROM_BL[ne];
                return se.side === ne ? le.domain[ue] === U.domain[ue] : se.mirror && le.domain[1 - ue] === U.domain[1 - ue];
              }
              function j(U, ne, se, le) {
                if (Y(U, ne, se))
                  return se._lw;
                for (var ue = 0; ue < le.length; ue++) {
                  var ve = le[ue];
                  if (ve._mainAxis === se._mainAxis && Y(U, ne, ve))
                    return ve._lw;
                }
                return 0;
              }
              c.drawMainTitle = function(U) {
                var ne = U._fullLayout.title, se = U._fullLayout, le = ce(se), ue = X(se), ve = q(se, ue), be = W(se, le);
                if (h.draw(U, "gtitle", {
                  propContainer: se,
                  propName: "title.text",
                  placeholder: se._dfltTitle.plot,
                  attributes: {
                    x: be,
                    y: ve,
                    "text-anchor": le,
                    dy: ue
                  }
                }), ne.text && ne.automargin) {
                  var Me = l.selectAll(".gtitle"), Ge = m.bBox(Me.node()).height, we = z(U, ne, Ge);
                  if (we > 0) {
                    Z(U, ve, we, Ge), Me.attr({
                      x: be,
                      y: ve,
                      "text-anchor": le,
                      dy: ie(ne.yanchor)
                    }).call(g.positionText, be, ve);
                    var Re = (ne.text.match(g.BR_TAG_ALL) || []).length;
                    if (Re) {
                      var Ae = E.LINE_SPACING * Re + E.MID_SHIFT;
                      ne.y === 0 && (Ae = -Ae), Me.selectAll(".line").each(function() {
                        var K = +this.getAttribute("dy").slice(0, -2) - Ae + "em";
                        this.setAttribute("dy", K);
                      });
                    }
                  }
                }
              };
              function te(U, ne, se, le, ue) {
                var ve = ne.yref === "paper" ? U._fullLayout._size.h : U._fullLayout.height, be = p.isTopAnchor(ne) ? le : le - ue, Me = se === "b" ? ve - be : be;
                return p.isTopAnchor(ne) && se === "t" || p.isBottomAnchor(ne) && se === "b" ? !1 : Me < ue;
              }
              function re(U, ne, se, le, ue) {
                var ve = 0;
                return se === "middle" && (ve += ue / 2), U === "t" ? (se === "top" && (ve += ue), ve += le - ne * le) : (se === "bottom" && (ve += ue), ve += ne * le), ve;
              }
              function z(U, ne, se) {
                var le = ne.y, ue = ne.yanchor, ve = le > 0.5 ? "t" : "b", be = U._fullLayout.margin[ve], Me = 0;
                return ne.yref === "paper" ? Me = se + ne.pad.t + ne.pad.b : ne.yref === "container" && (Me = re(ve, le, ue, U._fullLayout.height, se) + ne.pad.t + ne.pad.b), Me > be ? Me : 0;
              }
              function Z(U, ne, se, le) {
                var ue = "title.automargin", ve = U._fullLayout.title, be = ve.y > 0.5 ? "t" : "b", Me = {
                  x: ve.x,
                  y: ve.y,
                  t: 0,
                  b: 0
                }, Ge = {};
                ve.yref === "paper" && te(U, ve, be, ne, le) ? Me[be] = se : ve.yref === "container" && (Ge[be] = se, U._fullLayout._reservedMargin[ue] = Ge), f.allowAutoMargin(U, ue), f.autoMargin(U, ue, Me);
              }
              function W(U, ne) {
                var se = U.title, le = U._size, ue = 0;
                switch (ne === k ? ue = se.pad.l : ne === L && (ue = -se.pad.r), se.xref) {
                  case "paper":
                    return le.l + le.w * se.x + ue;
                  case "container":
                  default:
                    return U.width * se.x + ue;
                }
              }
              function q(U, ne) {
                var se = U.title, le = U._size, ue = 0;
                if (ne === "0em" || !ne ? ue = -se.pad.b : ne === E.CAP_SHIFT + "em" && (ue = se.pad.t), se.y === "auto")
                  return le.t / 2;
                switch (se.yref) {
                  case "paper":
                    return le.t + le.h - le.h * se.y + ue;
                  case "container":
                  default:
                    return U.height - U.height * se.y + ue;
                }
              }
              function ie(U) {
                return U === "top" ? E.CAP_SHIFT + 0.3 + "em" : U === "bottom" ? "-0.3em" : E.MID_SHIFT + "em";
              }
              function ce(U) {
                var ne = U.title, se = I;
                return p.isRightAnchor(ne) ? se = L : p.isLeftAnchor(ne) && (se = k), se;
              }
              function X(U) {
                var ne = U.title, se = "0em";
                return p.isTopAnchor(ne) ? se = E.CAP_SHIFT + "em" : p.isMiddleAnchor(ne) && (se = E.MID_SHIFT + "em"), se;
              }
              c.doTraceStyle = function(U) {
                var ne = U.calcdata, se = [], le;
                for (le = 0; le < ne.length; le++) {
                  var ue = ne[le], ve = ue[0] || {}, be = ve.trace || {}, Me = be._module || {}, Ge = Me.arraysToCalcdata;
                  Ge && Ge(ue, be);
                  var we = Me.editStyle;
                  we && se.push({
                    fn: we,
                    cd0: ve
                  });
                }
                if (se.length) {
                  for (le = 0; le < se.length; le++) {
                    var Re = se[le];
                    Re.fn(U, Re.cd0);
                  }
                  y(U), c.redrawReglTraces(U);
                }
                return f.style(U), v.getComponentMethod("legend", "draw")(U), f.previousPromises(U);
              }, c.doColorBars = function(U) {
                return v.getComponentMethod("colorbar", "draw")(U), f.previousPromises(U);
              }, c.layoutReplot = function(U) {
                var ne = U.layout;
                return U.layout = void 0, v.call("_doPlot", U, "", ne);
              }, c.doLegend = function(U) {
                return v.getComponentMethod("legend", "draw")(U), f.previousPromises(U);
              }, c.doTicksRelayout = function(U) {
                return S.draw(U, "redraw"), U._fullLayout._hasOnlyLargeSploms && (v.subplotsRegistry.splom.updateGrid(U), y(U), c.redrawReglTraces(U)), c.drawMainTitle(U), f.previousPromises(U);
              }, c.doModeBar = function(U) {
                var ne = U._fullLayout;
                w.manage(U);
                for (var se = 0; se < ne._basePlotModules.length; se++) {
                  var le = ne._basePlotModules[se].updateFx;
                  le && le(U);
                }
                return f.previousPromises(U);
              }, c.doCamera = function(U) {
                for (var ne = U._fullLayout, se = ne._subplots.gl3d, le = 0; le < se.length; le++) {
                  var ue = ne[se[le]], ve = ue._scene;
                  ve.setViewport(ue);
                }
              }, c.drawData = function(U) {
                var ne = U._fullLayout;
                y(U);
                for (var se = ne._basePlotModules, le = 0; le < se.length; le++)
                  se[le].plot(U);
                return c.redrawReglTraces(U), f.style(U), v.getComponentMethod("selections", "draw")(U), v.getComponentMethod("shapes", "draw")(U), v.getComponentMethod("annotations", "draw")(U), v.getComponentMethod("images", "draw")(U), ne._replotting = !1, f.previousPromises(U);
              }, c.redrawReglTraces = function(U) {
                var ne = U._fullLayout;
                if (ne._has("regl")) {
                  var se = U._fullData, le = [], ue = [], ve, be;
                  for (ne._hasOnlyLargeSploms && ne._splomGrid.draw(), ve = 0; ve < se.length; ve++) {
                    var Me = se[ve];
                    Me.visible === !0 && Me._length !== 0 && (Me.type === "splom" ? ne._splomScenes[Me.uid].draw() : Me.type === "scattergl" ? p.pushUnique(le, Me.xaxis + Me.yaxis) : Me.type === "scatterpolargl" && p.pushUnique(ue, Me.subplot));
                  }
                  for (ve = 0; ve < le.length; ve++)
                    be = ne._plots[le[ve]], be._scene && be._scene.draw();
                  for (ve = 0; ve < ue.length; ve++)
                    be = ne[ue[ve]]._subplot, be._scene && be._scene.draw();
                }
              }, c.doAutoRangeAndConstraints = function(U) {
                for (var ne = S.list(U, "", !0), se, le = {}, ue = 0; ue < ne.length; ue++)
                  if (se = ne[ue], !le[se._id]) {
                    le[se._id] = 1, F(U, se), P(U, se);
                    var ve = se._matchGroup;
                    if (ve)
                      for (var be in ve) {
                        var Me = S.getFromId(U, be);
                        P(U, Me, se.range), le[be] = 1;
                      }
                  }
                T(U);
              }, c.finalDraw = function(U) {
                v.getComponentMethod("rangeslider", "draw")(U), v.getComponentMethod("rangeselector", "draw")(U);
              }, c.drawMarginPushers = function(U) {
                v.getComponentMethod("legend", "draw")(U), v.getComponentMethod("rangeselector", "draw")(U), v.getComponentMethod("sliders", "draw")(U), v.getComponentMethod("updatemenus", "draw")(U), v.getComponentMethod("colorbar", "draw")(U);
              };
            }
          ),
          /***/
          4828: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = l.isPlainObject, f = i(3060), p = i(7316), g = i(5464), y = i(1780), C = i(556).dfltConfig;
              c.makeTemplate = function(P) {
                P = l.isPlainObject(P) ? P : l.getGraphDiv(P), P = l.extendDeep({
                  _context: C
                }, {
                  data: P.data,
                  layout: P.layout
                }), p.supplyDefaults(P);
                var k = P.data || [], I = P.layout || {};
                I._basePlotModules = P._fullLayout._basePlotModules, I._modules = P._fullLayout._modules;
                var L = {
                  data: {},
                  layout: {}
                };
                k.forEach(function(W) {
                  var q = {};
                  w(W, q, E.bind(null, W));
                  var ie = l.coerce(W, {}, g, "type"), ce = L.data[ie];
                  ce || (ce = L.data[ie] = []), ce.push(q);
                }), w(I, L.layout, S.bind(null, I)), delete L.layout.template;
                var A = I.template;
                if (v(A)) {
                  var O = A.layout, N, Y, j, te, re, z;
                  v(O) && m(O, L.layout);
                  var Z = A.data;
                  if (v(Z)) {
                    for (Y in L.data)
                      if (j = Z[Y], Array.isArray(j)) {
                        for (re = L.data[Y], z = re.length, te = j.length, N = 0; N < z; N++)
                          m(j[N % te], re[N]);
                        for (N = z; N < te; N++)
                          re.push(l.extendDeep({}, j[N]));
                      }
                    for (Y in Z)
                      Y in L.data || (L.data[Y] = l.extendDeep([], Z[Y]));
                  }
                }
                return L;
              };
              function m(P, k) {
                P = l.extendDeep({}, P);
                var I = Object.keys(P).sort(), L, A;
                function O(re, z, Z) {
                  if (v(z) && v(re))
                    m(re, z);
                  else if (Array.isArray(z) && Array.isArray(re)) {
                    var W = y.arrayTemplater({
                      _template: P
                    }, Z);
                    for (A = 0; A < z.length; A++) {
                      var q = z[A], ie = W.newItem(q)._template;
                      ie && m(ie, q);
                    }
                    var ce = W.defaultItems();
                    for (A = 0; A < ce.length; A++) z.push(ce[A]._template);
                    for (A = 0; A < z.length; A++) delete z[A].templateitemname;
                  }
                }
                for (L = 0; L < I.length; L++) {
                  var N = I[L], Y = P[N];
                  if (N in k ? O(Y, k[N], N) : k[N] = Y, h(N) === N)
                    for (var j in k) {
                      var te = h(j);
                      j !== te && te === N && !(j in P) && O(Y, k[j], N);
                    }
                }
              }
              function h(P) {
                return P.replace(/[0-9]+$/, "");
              }
              function w(P, k, I, L, A) {
                var O = A && I(A);
                for (var N in P) {
                  var Y = P[N], j = x(P, N, L), te = x(P, N, A), re = I(te);
                  if (!re) {
                    var z = h(N);
                    z !== N && (te = x(P, z, A), re = I(te));
                  }
                  if (!(O && O === re) && !(!re || re._noTemplating || re.valType === "data_array" || re.arrayOk && Array.isArray(Y)))
                    if (!re.valType && v(Y))
                      w(Y, k, I, j, te);
                    else if (re._isLinkedToArray && Array.isArray(Y))
                      for (var Z = !1, W = 0, q = {}, ie = 0; ie < Y.length; ie++) {
                        var ce = Y[ie];
                        if (v(ce)) {
                          var X = ce.name;
                          if (X)
                            q[X] || (w(ce, k, I, x(Y, W, j), x(Y, W, te)), W++, q[X] = 1);
                          else if (!Z) {
                            var U = y.arrayDefaultKey(N), ne = x(P, U, L), se = x(Y, W, j);
                            w(ce, k, I, se, x(Y, W, te));
                            var le = l.nestedProperty(k, se), ue = l.nestedProperty(k, ne);
                            ue.set(le.get()), le.set(null), Z = !0;
                          }
                        }
                      }
                    else {
                      var ve = l.nestedProperty(k, j);
                      ve.set(Y);
                    }
                }
              }
              function S(P, k) {
                return f.getLayoutValObject(P, l.nestedProperty({}, k).parts);
              }
              function E(P, k) {
                return f.getTraceValObject(P, l.nestedProperty({}, k).parts);
              }
              function x(P, k, I) {
                var L;
                return I ? Array.isArray(P) ? L = I + "[" + k + "]" : L = I + "." + k : L = k, L;
              }
              c.validateTemplate = function(P, k) {
                var I = l.extendDeep({}, {
                  _context: C,
                  data: P.data,
                  layout: P.layout
                }), L = I.layout || {};
                v(k) || (k = L.template || {});
                var A = k.layout, O = k.data, N = [];
                I.layout = L, I.layout.template = k, p.supplyDefaults(I);
                var Y = I._fullLayout, j = I._fullData, te = {};
                function re(ne, se) {
                  for (var le in ne)
                    if (le.charAt(0) !== "_" && v(ne[le])) {
                      var ue = h(le), ve = [], be;
                      for (be = 0; be < se.length; be++)
                        ve.push(x(ne, le, se[be])), ue !== le && ve.push(x(ne, ue, se[be]));
                      for (be = 0; be < ve.length; be++)
                        te[ve[be]] = 1;
                      re(ne[le], ve);
                    }
                }
                function z(ne, se) {
                  for (var le in ne)
                    if (le.indexOf("defaults") === -1 && v(ne[le])) {
                      var ue = x(ne, le, se);
                      te[ue] ? z(ne[le], ue) : N.push({
                        code: "unused",
                        path: ue
                      });
                    }
                }
                if (v(A) ? (re(Y, ["layout"]), z(A, "layout")) : N.push({
                  code: "layout"
                }), !v(O))
                  N.push({
                    code: "data"
                  });
                else {
                  for (var Z = {}, W, q = 0; q < j.length; q++) {
                    var ie = j[q];
                    W = ie.type, Z[W] = (Z[W] || 0) + 1, ie._fullInput._template || N.push({
                      code: "missing",
                      index: ie._fullInput.index,
                      traceType: W
                    });
                  }
                  for (W in O) {
                    var ce = O[W].length, X = Z[W] || 0;
                    ce > X ? N.push({
                      code: "unused",
                      traceType: W,
                      templateCount: ce,
                      dataCount: X
                    }) : X > ce && N.push({
                      code: "reused",
                      traceType: W,
                      templateCount: ce,
                      dataCount: X
                    });
                  }
                }
                function U(ne, se) {
                  for (var le in ne)
                    if (le.charAt(0) !== "_") {
                      var ue = ne[le], ve = x(ne, le, se);
                      v(ue) ? (Array.isArray(ne) && ue._template === !1 && ue.templateitemname && N.push({
                        code: "missing",
                        path: ve,
                        templateitemname: ue.templateitemname
                      }), U(ue, ve)) : Array.isArray(ue) && T(ue) && U(ue, ve);
                    }
                }
                if (U({
                  data: j,
                  layout: Y
                }, ""), N.length) return N.map(F);
              };
              function T(P) {
                for (var k = 0; k < P.length; k++)
                  if (v(P[k])) return !0;
              }
              function F(P) {
                var k;
                switch (P.code) {
                  case "data":
                    k = "The template has no key data.";
                    break;
                  case "layout":
                    k = "The template has no key layout.";
                    break;
                  case "missing":
                    P.path ? k = "There are no templates for item " + P.path + " with name " + P.templateitemname : k = "There are no templates for trace " + P.index + ", of type " + P.traceType + ".";
                    break;
                  case "unused":
                    P.path ? k = "The template item at " + P.path + " was not used in constructing the plot." : P.dataCount ? k = "Some of the templates of type " + P.traceType + " were not used. The template has " + P.templateCount + " traces, the data only has " + P.dataCount + " of this type." : k = "The template has " + P.templateCount + " traces of type " + P.traceType + " but there are none in the data.";
                    break;
                  case "reused":
                    k = "Some of the templates of type " + P.traceType + " were used more than once. The template has " + P.templateCount + " traces, the data has " + P.dataCount + " of this type.";
                    break;
                }
                return P.msg = k, P;
              }
            }
          ),
          /***/
          7024: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(6424), f = i(7316), p = i(3400), g = i(7030), y = i(7164), C = i(3268), m = i(5788).version, h = {
                format: {
                  valType: "enumerated",
                  values: ["png", "jpeg", "webp", "svg", "full-json"],
                  dflt: "png"
                },
                width: {
                  valType: "number",
                  min: 1
                },
                height: {
                  valType: "number",
                  min: 1
                },
                scale: {
                  valType: "number",
                  min: 0,
                  dflt: 1
                },
                setBackground: {
                  valType: "any",
                  dflt: !1
                },
                imageDataOnly: {
                  valType: "boolean",
                  dflt: !1
                }
              };
              function w(S, E) {
                E = E || {};
                var x, T, F, P;
                p.isPlainObject(S) ? (x = S.data || [], T = S.layout || {}, F = S.config || {}, P = {}) : (S = p.getGraphDiv(S), x = p.extendDeep([], S.data), T = p.extendDeep({}, S.layout), F = S._context, P = S._fullLayout || {});
                function k(X) {
                  return !(X in E) || p.validate(E[X], h[X]);
                }
                if (!k("width") && E.width !== null || !k("height") && E.height !== null)
                  throw new Error("Height and width should be pixel values.");
                if (!k("format"))
                  throw new Error("Export format is not " + p.join2(h.format.values, ", ", " or ") + ".");
                var I = {};
                function L(X, U) {
                  return p.coerce(E, I, h, X, U);
                }
                var A = L("format"), O = L("width"), N = L("height"), Y = L("scale"), j = L("setBackground"), te = L("imageDataOnly"), re = document.createElement("div");
                re.style.position = "absolute", re.style.left = "-5000px", document.body.appendChild(re);
                var z = p.extendFlat({}, T);
                O ? z.width = O : E.width === null && l(P.width) && (z.width = P.width), N ? z.height = N : E.height === null && l(P.height) && (z.height = P.height);
                var Z = p.extendFlat({}, F, {
                  _exportedPlot: !0,
                  staticPlot: !0,
                  setBackground: j
                }), W = g.getRedrawFunc(re);
                function q() {
                  return new Promise(function(X) {
                    setTimeout(X, g.getDelay(re._fullLayout));
                  });
                }
                function ie() {
                  return new Promise(function(X, U) {
                    var ne = y(re, A, Y), se = re._fullLayout.width, le = re._fullLayout.height;
                    function ue() {
                      v.purge(re), document.body.removeChild(re);
                    }
                    if (A === "full-json") {
                      var ve = f.graphJson(re, !1, "keepdata", "object", !0, !0);
                      return ve.version = m, ve = JSON.stringify(ve), ue(), X(te ? ve : g.encodeJSON(ve));
                    }
                    if (ue(), A === "svg")
                      return X(te ? ne : g.encodeSVG(ne));
                    var be = document.createElement("canvas");
                    be.id = p.randstr(), C({
                      format: A,
                      width: se,
                      height: le,
                      scale: Y,
                      canvas: be,
                      svg: ne,
                      // ask svgToImg to return a Promise
                      //  rather than EventEmitter
                      //  leave EventEmitter for backward
                      //  compatibility
                      promise: !0
                    }).then(X).catch(U);
                  });
                }
                function ce(X) {
                  return te ? X.replace(g.IMAGE_URL_PREFIX, "") : X;
                }
                return new Promise(function(X, U) {
                  v.newPlot(re, x, z, Z).then(W).then(q).then(ie).then(function(ne) {
                    X(ce(ne));
                  }).catch(function(ne) {
                    U(ne);
                  });
                });
              }
              s.exports = w;
            }
          ),
          /***/
          1480: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(7316), f = i(3060), p = i(556).dfltConfig, g = l.isPlainObject, y = Array.isArray, C = l.isArrayOrTypedArray;
              s.exports = function(L, A) {
                L === void 0 && (L = []), A === void 0 && (A = {});
                var O = f.get(), N = [], Y = {
                  _context: l.extendFlat({}, p)
                }, j, te;
                y(L) ? (Y.data = l.extendDeep([], L), j = L) : (Y.data = [], j = [], N.push(E("array", "data"))), g(A) ? (Y.layout = l.extendDeep({}, A), te = A) : (Y.layout = {}, te = {}, arguments.length > 1 && N.push(E("object", "layout"))), v.supplyDefaults(Y);
                for (var re = Y._fullData, z = j.length, Z = 0; Z < z; Z++) {
                  var W = j[Z], q = ["data", Z];
                  if (!g(W)) {
                    N.push(E("object", q));
                    continue;
                  }
                  var ie = re[Z], ce = ie.type, X = O.traces[ce].attributes;
                  X.type = {
                    valType: "enumerated",
                    values: [ce]
                  }, ie.visible === !1 && W.visible !== !1 && N.push(E("invisible", q)), m(W, ie, X, N, q);
                  var U = W.transforms, ne = ie.transforms;
                  if (U) {
                    y(U) || N.push(E("array", q, ["transforms"])), q.push("transforms");
                    for (var se = 0; se < U.length; se++) {
                      var le = ["transforms", se], ue = U[se].type;
                      if (!g(U[se])) {
                        N.push(E("object", q, le));
                        continue;
                      }
                      var ve = O.transforms[ue] ? O.transforms[ue].attributes : {};
                      ve.type = {
                        valType: "enumerated",
                        values: Object.keys(O.transforms)
                      }, m(U[se], ne[se], ve, N, q, le);
                    }
                  }
                }
                var be = Y._fullLayout, Me = h(O, re);
                return m(te, be, Me, N, "layout"), N.length === 0 ? void 0 : N;
              };
              function m(I, L, A, O, N, Y) {
                Y = Y || [];
                for (var j = Object.keys(I), te = 0; te < j.length; te++) {
                  var re = j[te];
                  if (re !== "transforms") {
                    var z = Y.slice();
                    z.push(re);
                    var Z = I[re], W = L[re], q = T(A, re), ie = (q || {}).valType, ce = ie === "info_array", X = ie === "colorscale", U = (q || {}).items;
                    if (!x(A, re))
                      O.push(E("schema", N, z));
                    else if (g(Z) && g(W) && ie !== "any")
                      m(Z, W, q, O, N, z);
                    else if (ce && y(Z)) {
                      Z.length > W.length && O.push(E("unused", N, z.concat(W.length)));
                      var ne = W.length, se = Array.isArray(U);
                      se && (ne = Math.min(ne, U.length));
                      var le, ue, ve, be, Me;
                      if (q.dimensions === 2)
                        for (ue = 0; ue < ne; ue++)
                          if (y(Z[ue])) {
                            Z[ue].length > W[ue].length && O.push(E("unused", N, z.concat(ue, W[ue].length)));
                            var Ge = W[ue].length;
                            for (le = 0; le < (se ? Math.min(Ge, U[ue].length) : Ge); le++)
                              ve = se ? U[ue][le] : U, be = Z[ue][le], Me = W[ue][le], l.validate(be, ve) ? Me !== be && Me !== +be && O.push(E("dynamic", N, z.concat(ue, le), be, Me)) : O.push(E("value", N, z.concat(ue, le), be));
                          } else
                            O.push(E("array", N, z.concat(ue), Z[ue]));
                      else
                        for (ue = 0; ue < ne; ue++)
                          ve = se ? U[ue] : U, be = Z[ue], Me = W[ue], l.validate(be, ve) ? Me !== be && Me !== +be && O.push(E("dynamic", N, z.concat(ue), be, Me)) : O.push(E("value", N, z.concat(ue), be));
                    } else if (q.items && !ce && y(Z)) {
                      var we = U[Object.keys(U)[0]], Re = [], Ae, K;
                      for (Ae = 0; Ae < W.length; Ae++) {
                        var ee = W[Ae]._index || Ae;
                        if (K = z.slice(), K.push(ee), g(Z[ee]) && g(W[Ae])) {
                          Re.push(ee);
                          var oe = Z[ee], _ = W[Ae];
                          g(oe) && oe.visible !== !1 && _.visible === !1 ? O.push(E("invisible", N, K)) : m(oe, _, we, O, N, K);
                        }
                      }
                      for (Ae = 0; Ae < Z.length; Ae++)
                        K = z.slice(), K.push(Ae), g(Z[Ae]) ? Re.indexOf(Ae) === -1 && O.push(E("unused", N, K)) : O.push(E("object", N, K, Z[Ae]));
                    } else !g(Z) && g(W) ? O.push(E("object", N, z, Z)) : !C(Z) && C(W) && !ce && !X ? O.push(E("array", N, z, Z)) : re in L ? l.validate(Z, q) ? q.valType === "enumerated" && (q.coerceNumber && Z !== +W || Z !== W) && O.push(E("dynamic", N, z, Z, W)) : O.push(E("value", N, z, Z)) : O.push(E("unused", N, z, Z));
                  }
                }
                return O;
              }
              function h(I, L) {
                for (var A = I.layout.layoutAttributes, O = 0; O < L.length; O++) {
                  var N = L[O], Y = I.traces[N.type], j = Y.layoutAttributes;
                  j && (N.subplot ? l.extendFlat(A[Y.attributes.subplot.dflt], j) : l.extendFlat(A, j));
                }
                return A;
              }
              var w = {
                object: function(I, L) {
                  var A;
                  return I === "layout" && L === "" ? A = "The layout argument" : I[0] === "data" && L === "" ? A = "Trace " + I[1] + " in the data argument" : A = S(I) + "key " + L, A + " must be linked to an object container";
                },
                array: function(I, L) {
                  var A;
                  return I === "data" ? A = "The data argument" : A = S(I) + "key " + L, A + " must be linked to an array container";
                },
                schema: function(I, L) {
                  return S(I) + "key " + L + " is not part of the schema";
                },
                unused: function(I, L, A) {
                  var O = g(A) ? "container" : "key";
                  return S(I) + O + " " + L + " did not get coerced";
                },
                dynamic: function(I, L, A, O) {
                  return [S(I) + "key", L, "(set to '" + A + "')", "got reset to", "'" + O + "'", "during defaults."].join(" ");
                },
                invisible: function(I, L) {
                  return (L ? S(I) + "item " + L : "Trace " + I[1]) + " got defaulted to be not visible";
                },
                value: function(I, L, A) {
                  return [S(I) + "key " + L, "is set to an invalid value (" + A + ")"].join(" ");
                }
              };
              function S(I) {
                return y(I) ? "In data trace " + I[1] + ", " : "In " + I + ", ";
              }
              function E(I, L, A, O, N) {
                A = A || "";
                var Y, j;
                y(L) ? (Y = L[0], j = L[1]) : (Y = L, j = null);
                var te = k(A), re = w[I](L, te, O, N);
                return l.log(re), {
                  code: I,
                  container: Y,
                  trace: j,
                  path: A,
                  astr: te,
                  msg: re
                };
              }
              function x(I, L) {
                var A = P(L), O = A.keyMinusId, N = A.id;
                return O in I && I[O]._isSubplotObj && N ? !0 : L in I;
              }
              function T(I, L) {
                if (L in I) return I[L];
                var A = P(L);
                return I[A.keyMinusId];
              }
              var F = l.counterRegex("([a-z]+)");
              function P(I) {
                var L = I.match(F);
                return {
                  keyMinusId: L && L[1],
                  id: L && L[2]
                };
              }
              function k(I) {
                if (!y(I)) return String(I);
                for (var L = "", A = 0; A < I.length; A++) {
                  var O = I[A];
                  typeof O == "number" ? L = L.substr(0, L.length - 1) + "[" + O + "]" : L += O, A < I.length - 1 && (L += ".");
                }
                return L;
              }
            }
          ),
          /***/
          5656: (
            /***/
            function(s) {
              s.exports = {
                mode: {
                  valType: "enumerated",
                  dflt: "afterall",
                  values: ["immediate", "next", "afterall"]
                },
                direction: {
                  valType: "enumerated",
                  values: ["forward", "reverse"],
                  dflt: "forward"
                },
                fromcurrent: {
                  valType: "boolean",
                  dflt: !1
                },
                frame: {
                  duration: {
                    valType: "number",
                    min: 0,
                    dflt: 500
                  },
                  redraw: {
                    valType: "boolean",
                    dflt: !0
                  }
                },
                transition: {
                  duration: {
                    valType: "number",
                    min: 0,
                    dflt: 500,
                    editType: "none"
                  },
                  easing: {
                    valType: "enumerated",
                    dflt: "cubic-in-out",
                    values: ["linear", "quad", "cubic", "sin", "exp", "circle", "elastic", "back", "bounce", "linear-in", "quad-in", "cubic-in", "sin-in", "exp-in", "circle-in", "elastic-in", "back-in", "bounce-in", "linear-out", "quad-out", "cubic-out", "sin-out", "exp-out", "circle-out", "elastic-out", "back-out", "bounce-out", "linear-in-out", "quad-in-out", "cubic-in-out", "sin-in-out", "exp-in-out", "circle-in-out", "elastic-in-out", "back-in-out", "bounce-in-out"],
                    editType: "none"
                  },
                  ordering: {
                    valType: "enumerated",
                    values: ["layout first", "traces first"],
                    dflt: "layout first",
                    editType: "none"
                  }
                }
              };
            }
          ),
          /***/
          1272: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(1780);
              s.exports = function(p, g, y) {
                var C = y.name, m = y.inclusionAttr || "visible", h = g[C], w = l.isArrayOrTypedArray(p[C]) ? p[C] : [], S = g[C] = [], E = v.arrayTemplater(g, C, m), x, T;
                for (x = 0; x < w.length; x++) {
                  var F = w[x];
                  l.isPlainObject(F) ? T = E.newItem(F) : (T = E.newItem({}), T[m] = !1), T._index = x, T[m] !== !1 && y.handleItemDefaults(F, T, g, y), S.push(T);
                }
                var P = E.defaultItems();
                for (x = 0; x < P.length; x++)
                  T = P[x], T._index = S.length, y.handleItemDefaults({}, T, g, y, {}), S.push(T);
                if (l.isArrayOrTypedArray(h)) {
                  var k = Math.min(h.length, S.length);
                  for (x = 0; x < k; x++)
                    l.relinkPrivateKeys(S[x], h[x]);
                }
                return S;
              };
            }
          ),
          /***/
          5464: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(5756);
              s.exports = {
                type: {
                  valType: "enumerated",
                  values: [],
                  // listed dynamically
                  dflt: "scatter",
                  editType: "calc+clearAxisTypes",
                  _noTemplating: !0
                  // we handle this at a higher level
                },
                visible: {
                  valType: "enumerated",
                  values: [!0, !1, "legendonly"],
                  dflt: !0,
                  editType: "calc"
                },
                showlegend: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "style"
                },
                legend: {
                  valType: "subplotid",
                  dflt: "legend",
                  editType: "style"
                },
                legendgroup: {
                  valType: "string",
                  dflt: "",
                  editType: "style"
                },
                legendgrouptitle: {
                  text: {
                    valType: "string",
                    dflt: "",
                    editType: "style"
                  },
                  font: l({
                    editType: "style"
                  }),
                  editType: "style"
                },
                legendrank: {
                  valType: "number",
                  dflt: 1e3,
                  editType: "style"
                },
                legendwidth: {
                  valType: "number",
                  min: 0,
                  editType: "style"
                },
                opacity: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 1,
                  editType: "style"
                },
                name: {
                  valType: "string",
                  editType: "style"
                },
                uid: {
                  valType: "string",
                  editType: "plot",
                  anim: !0
                },
                ids: {
                  valType: "data_array",
                  editType: "calc",
                  anim: !0
                },
                customdata: {
                  valType: "data_array",
                  editType: "calc"
                },
                meta: {
                  valType: "any",
                  arrayOk: !0,
                  editType: "plot"
                },
                // N.B. these cannot be 'data_array' as they do not have the same length as
                // other data arrays and arrayOk attributes in general
                //
                // Maybe add another valType:
                // https://github.com/plotly/plotly.js/issues/1894
                selectedpoints: {
                  valType: "any",
                  editType: "calc"
                },
                hoverinfo: {
                  valType: "flaglist",
                  flags: ["x", "y", "z", "text", "name"],
                  extras: ["all", "none", "skip"],
                  arrayOk: !0,
                  dflt: "all",
                  editType: "none"
                },
                hoverlabel: v.hoverlabel,
                stream: {
                  token: {
                    valType: "string",
                    noBlank: !0,
                    strict: !0,
                    editType: "calc"
                  },
                  maxpoints: {
                    valType: "number",
                    min: 0,
                    max: 1e4,
                    dflt: 500,
                    editType: "calc"
                  },
                  editType: "calc"
                },
                transforms: {
                  _isLinkedToArray: "transform",
                  editType: "calc"
                },
                uirevision: {
                  valType: "any",
                  editType: "none"
                }
              };
            }
          ),
          /***/
          1220: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = v.dateTime2ms, p = v.incrementMonth, g = i(9032), y = g.ONEAVGMONTH;
              s.exports = function(m, h, w, S) {
                if (h.type !== "date") return {
                  vals: S
                };
                var E = m[w + "periodalignment"];
                if (!E) return {
                  vals: S
                };
                var x = m[w + "period"], T;
                if (l(x)) {
                  if (x = +x, x <= 0) return {
                    vals: S
                  };
                } else if (typeof x == "string" && x.charAt(0) === "M") {
                  var F = +x.substring(1);
                  if (F > 0 && Math.round(F) === F)
                    T = F;
                  else return {
                    vals: S
                  };
                }
                for (var P = h.calendar, k = E === "start", I = E === "end", L = m[w + "period0"], A = f(L, P) || 0, O = [], N = [], Y = [], j = S.length, te = 0; te < j; te++) {
                  var re = S[te], z, Z, W;
                  if (T) {
                    for (z = Math.round((re - A) / (T * y)), W = p(A, T * z, P); W > re; )
                      W = p(W, -T, P);
                    for (; W <= re; )
                      W = p(W, T, P);
                    Z = p(W, -T, P);
                  } else {
                    for (z = Math.round((re - A) / x), W = A + z * x; W > re; )
                      W -= x;
                    for (; W <= re; )
                      W += x;
                    Z = W - x;
                  }
                  O[te] = k ? Z : I ? W : (Z + W) / 2, N[te] = Z, Y[te] = W;
                }
                return {
                  vals: O,
                  starts: N,
                  ends: Y
                };
              };
            }
          ),
          /***/
          6720: (
            /***/
            function(s) {
              s.exports = {
                xaxis: {
                  valType: "subplotid",
                  dflt: "x",
                  editType: "calc+clearAxisTypes"
                },
                yaxis: {
                  valType: "subplotid",
                  dflt: "y",
                  editType: "calc+clearAxisTypes"
                }
              };
            }
          ),
          /***/
          9280: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(3400), p = i(9032).FP_SAFE, g = i(4040), y = i(3616), C = i(9811), m = C.getFromId, h = C.isLinked;
              s.exports = {
                applyAutorangeOptions: z,
                getAutoRange: w,
                makePadFn: E,
                doAutoRange: P,
                findExtremes: k,
                concatExtremes: F
              };
              function w(Z, W) {
                var q, ie, ce = [], X = Z._fullLayout, U = E(X, W, 0), ne = E(X, W, 1), se = F(Z, W), le = se.min, ue = se.max;
                if (le.length === 0 || ue.length === 0)
                  return f.simpleMap(W.range, W.r2l);
                var ve = le[0].val, be = ue[0].val;
                for (q = 1; q < le.length && ve === be; q++)
                  ve = Math.min(ve, le[q].val);
                for (q = 1; q < ue.length && ve === be; q++)
                  be = Math.max(be, ue[q].val);
                var Me = W.autorange, Ge = Me === "reversed" || Me === "min reversed" || Me === "max reversed";
                if (!Ge && W.range) {
                  var we = f.simpleMap(W.range, W.r2l);
                  Ge = we[1] < we[0];
                }
                W.autorange === "reversed" && (W.autorange = !0);
                var Re = W.rangemode, Ae = Re === "tozero", K = Re === "nonnegative", ee = W._length, oe = ee / 10, _ = 0, V, fe, $, he, me, xe;
                for (q = 0; q < le.length; q++)
                  for (V = le[q], ie = 0; ie < ue.length; ie++)
                    fe = ue[ie], xe = fe.val - V.val - S(W, V.val, fe.val), xe > 0 && (me = ee - U(V) - ne(fe), me > oe ? xe / me > _ && ($ = V, he = fe, _ = xe / me) : xe / ee > _ && ($ = {
                      val: V.val,
                      nopad: 1
                    }, he = {
                      val: fe.val,
                      nopad: 1
                    }, _ = xe / ee));
                function Fe(at, De) {
                  return Math.max(at, ne(De));
                }
                if (ve === be) {
                  var Ve = ve - 1, Be = ve + 1;
                  if (Ae)
                    if (ve === 0)
                      ce = [0, 1];
                    else {
                      var Je = (ve > 0 ? ue : le).reduce(Fe, 0), et = ve / (1 - Math.min(0.5, Je / ee));
                      ce = ve > 0 ? [0, et] : [et, 0];
                    }
                  else K ? ce = [Math.max(0, Ve), Math.max(1, Be)] : ce = [Ve, Be];
                } else
                  Ae ? ($.val >= 0 && ($ = {
                    val: 0,
                    nopad: 1
                  }), he.val <= 0 && (he = {
                    val: 0,
                    nopad: 1
                  })) : K && ($.val - _ * U($) < 0 && ($ = {
                    val: 0,
                    nopad: 1
                  }), he.val <= 0 && (he = {
                    val: 1,
                    nopad: 1
                  })), _ = (he.val - $.val - S(W, V.val, fe.val)) / (ee - U($) - ne(he)), ce = [$.val - _ * U($), he.val + _ * ne(he)];
                return ce = z(ce, W), W.limitRange && W.limitRange(), Ge && ce.reverse(), f.simpleMap(ce, W.l2r || Number);
              }
              function S(Z, W, q) {
                var ie = 0;
                if (Z.rangebreaks)
                  for (var ce = Z.locateBreaks(W, q), X = 0; X < ce.length; X++) {
                    var U = ce[X];
                    ie += U.max - U.min;
                  }
                return ie;
              }
              function E(Z, W, q) {
                var ie = 0.05 * W._length, ce = W._anchorAxis || {};
                if ((W.ticklabelposition || "").indexOf("inside") !== -1 || (ce.ticklabelposition || "").indexOf("inside") !== -1) {
                  var X = W.isReversed();
                  if (!X) {
                    var U = f.simpleMap(W.range, W.r2l);
                    X = U[1] < U[0];
                  }
                  X && (q = !q);
                }
                var ne = 0;
                return h(Z, W._id) || (ne = T(Z, W, q)), ie = Math.max(ne, ie), W.constrain === "domain" && W._inputDomain && (ie *= (W._inputDomain[1] - W._inputDomain[0]) / (W.domain[1] - W.domain[0])), function(le) {
                  return le.nopad ? 0 : le.pad + (le.extrapad ? ie : ne);
                };
              }
              var x = 3;
              function T(Z, W, q) {
                var ie = 0, ce = W._id.charAt(0) === "x";
                for (var X in Z._plots) {
                  var U = Z._plots[X];
                  if (!(W._id !== U.xaxis._id && W._id !== U.yaxis._id)) {
                    var ne = (ce ? U.yaxis : U.xaxis) || {};
                    if ((ne.ticklabelposition || "").indexOf("inside") !== -1 && (!q && (ne.side === "left" || ne.side === "bottom") || q && (ne.side === "top" || ne.side === "right"))) {
                      if (ne._vals) {
                        var se = f.deg2rad(ne._tickAngles[ne._id + "tick"] || 0), le = Math.abs(Math.cos(se)), ue = Math.abs(Math.sin(se));
                        if (!ne._vals[0].bb) {
                          var ve = ne._id + "tick", be = ne._selections[ve];
                          be.each(function(K) {
                            var ee = l.select(this), oe = ee.select(".text-math-group");
                            oe.empty() && (K.bb = y.bBox(ee.node()));
                          });
                        }
                        for (var Me = 0; Me < ne._vals.length; Me++) {
                          var Ge = ne._vals[Me], we = Ge.bb;
                          if (we) {
                            var Re = 2 * x + we.width, Ae = 2 * x + we.height;
                            ie = Math.max(ie, ce ? Math.max(Re * le, Ae * ue) : Math.max(Ae * le, Re * ue));
                          }
                        }
                      }
                      ne.ticks === "inside" && ne.ticklabelposition === "inside" && (ie += ne.ticklen || 0);
                    }
                  }
                }
                return ie;
              }
              function F(Z, W, q) {
                var ie = W._id, ce = Z._fullData, X = Z._fullLayout, U = [], ne = [], se, le, ue;
                function ve(Re, Ae) {
                  for (se = 0; se < Ae.length; se++) {
                    var K = Re[Ae[se]], ee = (K._extremes || {})[ie];
                    if (K.visible === !0 && ee) {
                      for (le = 0; le < ee.min.length; le++)
                        ue = ee.min[le], I(U, ue.val, ue.pad, {
                          extrapad: ue.extrapad
                        });
                      for (le = 0; le < ee.max.length; le++)
                        ue = ee.max[le], L(ne, ue.val, ue.pad, {
                          extrapad: ue.extrapad
                        });
                    }
                  }
                }
                if (ve(ce, W._traceIndices), ve(X.annotations || [], W._annIndices || []), ve(X.shapes || [], W._shapeIndices || []), W._matchGroup && !q) {
                  for (var be in W._matchGroup)
                    if (be !== W._id) {
                      var Me = m(Z, be), Ge = F(Z, Me, !0), we = W._length / Me._length;
                      for (le = 0; le < Ge.min.length; le++)
                        ue = Ge.min[le], I(U, ue.val, ue.pad * we, {
                          extrapad: ue.extrapad
                        });
                      for (le = 0; le < Ge.max.length; le++)
                        ue = Ge.max[le], L(ne, ue.val, ue.pad * we, {
                          extrapad: ue.extrapad
                        });
                    }
                }
                return {
                  min: U,
                  max: ne
                };
              }
              function P(Z, W, q) {
                if (W.setScale(), W.autorange) {
                  W.range = q ? q.slice() : w(Z, W), W._r = W.range.slice(), W._rl = f.simpleMap(W._r, W.r2l);
                  var ie = W._input, ce = {};
                  ce[W._attr + ".range"] = W.range, ce[W._attr + ".autorange"] = W.autorange, g.call("_storeDirectGUIEdit", Z.layout, Z._fullLayout._preGUI, ce), ie.range = W.range.slice(), ie.autorange = W.autorange;
                }
                var X = W._anchorAxis;
                if (X && X.rangeslider) {
                  var U = X.rangeslider[W._name];
                  U && U.rangemode === "auto" && (U.range = w(Z, W)), X._input.rangeslider[W._name] = f.extendFlat({}, U);
                }
              }
              function k(Z, W, q) {
                q || (q = {}), Z._m || Z.setScale();
                var ie = [], ce = [], X = W.length, U = q.padded || !1, ne = q.tozero && (Z.type === "linear" || Z.type === "-"), se = Z.type === "log", le = !1, ue = q.vpadLinearized || !1, ve, be, Me, Ge, we, Re, Ae, K, ee;
                function oe(Fe) {
                  if (Array.isArray(Fe))
                    return le = !0, function(Be) {
                      return Math.max(Number(Fe[Be] || 0), 0);
                    };
                  var Ve = Math.max(Number(Fe || 0), 0);
                  return function() {
                    return Ve;
                  };
                }
                var _ = oe((Z._m > 0 ? q.ppadplus : q.ppadminus) || q.ppad || 0), V = oe((Z._m > 0 ? q.ppadminus : q.ppadplus) || q.ppad || 0), fe = oe(q.vpadplus || q.vpad), $ = oe(q.vpadminus || q.vpad);
                if (!le) {
                  if (K = 1 / 0, ee = -1 / 0, se)
                    for (ve = 0; ve < X; ve++)
                      be = W[ve], be < K && be > 0 && (K = be), be > ee && be < p && (ee = be);
                  else
                    for (ve = 0; ve < X; ve++)
                      be = W[ve], be < K && be > -p && (K = be), be > ee && be < p && (ee = be);
                  W = [K, ee], X = 2;
                }
                var he = {
                  tozero: ne,
                  extrapad: U
                };
                function me(Fe) {
                  Me = W[Fe], v(Me) && (Re = _(Fe), Ae = V(Fe), ue ? (Ge = Z.c2l(Me) - $(Fe), we = Z.c2l(Me) + fe(Fe)) : (K = Me - $(Fe), ee = Me + fe(Fe), se && K < ee / 10 && (K = ee / 10), Ge = Z.c2l(K), we = Z.c2l(ee)), ne && (Ge = Math.min(0, Ge), we = Math.max(0, we)), O(Ge) && I(ie, Ge, Ae, he), O(we) && L(ce, we, Re, he));
                }
                var xe = Math.min(6, X);
                for (ve = 0; ve < xe; ve++) me(ve);
                for (ve = X - 1; ve >= xe; ve--) me(ve);
                return {
                  min: ie,
                  max: ce,
                  opts: q
                };
              }
              function I(Z, W, q, ie) {
                A(Z, W, q, ie, N);
              }
              function L(Z, W, q, ie) {
                A(Z, W, q, ie, Y);
              }
              function A(Z, W, q, ie, ce) {
                for (var X = ie.tozero, U = ie.extrapad, ne = !0, se = 0; se < Z.length && ne; se++) {
                  var le = Z[se];
                  if (ce(le.val, W) && le.pad >= q && (le.extrapad || !U)) {
                    ne = !1;
                    break;
                  } else ce(W, le.val) && le.pad <= q && (U || !le.extrapad) && (Z.splice(se, 1), se--);
                }
                if (ne) {
                  var ue = X && W === 0;
                  Z.push({
                    val: W,
                    pad: ue ? 0 : q,
                    extrapad: ue ? !1 : U
                  });
                }
              }
              function O(Z) {
                return v(Z) && Math.abs(Z) < p;
              }
              function N(Z, W) {
                return Z <= W;
              }
              function Y(Z, W) {
                return Z >= W;
              }
              function j(Z, W) {
                var q = W.autorangeoptions;
                return q && q.minallowed !== void 0 && re(W, q.minallowed, q.maxallowed) ? q.minallowed : q && q.clipmin !== void 0 && re(W, q.clipmin, q.clipmax) ? Math.max(Z, W.d2l(q.clipmin)) : Z;
              }
              function te(Z, W) {
                var q = W.autorangeoptions;
                return q && q.maxallowed !== void 0 && re(W, q.minallowed, q.maxallowed) ? q.maxallowed : q && q.clipmax !== void 0 && re(W, q.clipmin, q.clipmax) ? Math.min(Z, W.d2l(q.clipmax)) : Z;
              }
              function re(Z, W, q) {
                return W !== void 0 && q !== void 0 ? (W = Z.d2l(W), q = Z.d2l(q), W < q) : !0;
              }
              function z(Z, W) {
                if (!W || !W.autorangeoptions) return Z;
                var q = Z[0], ie = Z[1], ce = W.autorangeoptions.include;
                if (ce !== void 0) {
                  var X = W.d2l(q), U = W.d2l(ie);
                  f.isArrayOrTypedArray(ce) || (ce = [ce]);
                  for (var ne = 0; ne < ce.length; ne++) {
                    var se = W.d2l(ce[ne]);
                    X >= se && (X = se, q = se), U <= se && (U = se, ie = se);
                  }
                }
                return q = j(q, W), ie = te(ie, W), [q, ie];
              }
            }
          ),
          /***/
          6808: (
            /***/
            function(s) {
              s.exports = function(i, l, v) {
                var f, p;
                if (v) {
                  var g = l === "reversed" || l === "min reversed" || l === "max reversed";
                  f = v[g ? 1 : 0], p = v[g ? 0 : 1];
                }
                var y = i("autorangeoptions.minallowed", p === null ? f : void 0), C = i("autorangeoptions.maxallowed", f === null ? p : void 0);
                y === void 0 && i("autorangeoptions.clipmin"), C === void 0 && i("autorangeoptions.clipmax"), i("autorangeoptions.include");
              };
            }
          ),
          /***/
          4460: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(7316), p = i(4040), g = i(3400), y = g.strTranslate, C = i(2736), m = i(1668), h = i(6308), w = i(3616), S = i(4724), E = i(8728), x = i(9032), T = x.ONEMAXYEAR, F = x.ONEAVGYEAR, P = x.ONEMINYEAR, k = x.ONEMAXQUARTER, I = x.ONEAVGQUARTER, L = x.ONEMINQUARTER, A = x.ONEMAXMONTH, O = x.ONEAVGMONTH, N = x.ONEMINMONTH, Y = x.ONEWEEK, j = x.ONEDAY, te = j / 2, re = x.ONEHOUR, z = x.ONEMIN, Z = x.ONESEC, W = x.MINUS_SIGN, q = x.BADNUM, ie = {
                K: "zeroline"
              }, ce = {
                K: "gridline",
                L: "path"
              }, X = {
                K: "minor-gridline",
                L: "path"
              }, U = {
                K: "tick",
                L: "path"
              }, ne = {
                K: "tick",
                L: "text"
              }, se = {
                width: ["x", "r", "l", "xl", "xr"],
                height: ["y", "t", "b", "yt", "yb"],
                right: ["r", "xr"],
                left: ["l", "xl"],
                top: ["t", "yt"],
                bottom: ["b", "yb"]
              }, le = i(4284), ue = le.MID_SHIFT, ve = le.CAP_SHIFT, be = le.LINE_SPACING, Me = le.OPPOSITE_SIDE, Ge = 3, we = s.exports = {};
              we.setConvert = i(8344);
              var Re = i(2976), Ae = i(9811), K = Ae.idSort, ee = Ae.isLinked;
              we.id2name = Ae.id2name, we.name2id = Ae.name2id, we.cleanId = Ae.cleanId, we.list = Ae.list, we.listIds = Ae.listIds, we.getFromId = Ae.getFromId, we.getFromTrace = Ae.getFromTrace;
              var oe = i(9280);
              we.getAutoRange = oe.getAutoRange, we.findExtremes = oe.findExtremes;
              var _ = 1e-4;
              function V(Se) {
                var ae = (Se[1] - Se[0]) * _;
                return [Se[0] - ae, Se[1] + ae];
              }
              we.coerceRef = function(Se, ae, ft, rt, gt, wt) {
                var Ct = rt.charAt(rt.length - 1), pt = ft._fullLayout._subplots[Ct + "axis"], dt = rt + "ref", St = {};
                return gt || (gt = pt[0] || (typeof wt == "string" ? wt : wt[0])), wt || (wt = gt), pt = pt.concat(pt.map(function(Ft) {
                  return Ft + " domain";
                })), St[dt] = {
                  valType: "enumerated",
                  values: pt.concat(wt ? typeof wt == "string" ? [wt] : wt : []),
                  dflt: gt
                }, g.coerce(Se, ae, St, dt);
              }, we.getRefType = function(Se) {
                return Se === void 0 ? Se : Se === "paper" ? "paper" : Se === "pixel" ? "pixel" : /( domain)$/.test(Se) ? "domain" : "range";
              }, we.coercePosition = function(Se, ae, ft, rt, gt, wt) {
                var Ct, pt, dt = we.getRefType(rt);
                if (dt !== "range")
                  Ct = g.ensureNumber, pt = ft(gt, wt);
                else {
                  var St = we.getFromId(ae, rt);
                  wt = St.fraction2r(wt), pt = ft(gt, wt), Ct = St.cleanPos;
                }
                Se[gt] = Ct(pt);
              }, we.cleanPosition = function(Se, ae, ft) {
                var rt = ft === "paper" || ft === "pixel" ? g.ensureNumber : we.getFromId(ae, ft).cleanPos;
                return rt(Se);
              }, we.redrawComponents = function(Se, ae) {
                ae = ae || we.listIds(Se);
                var ft = Se._fullLayout;
                function rt(gt, wt, Ct, pt) {
                  for (var dt = p.getComponentMethod(gt, wt), St = {}, Ft = 0; Ft < ae.length; Ft++)
                    for (var Gt = ft[we.id2name(ae[Ft])], Lt = Gt[Ct], $t = 0; $t < Lt.length; $t++) {
                      var _t = Lt[$t];
                      if (!St[_t] && (dt(Se, _t), St[_t] = 1, pt))
                        return;
                    }
                }
                rt("annotations", "drawOne", "_annIndices"), rt("shapes", "drawOne", "_shapeIndices"), rt("images", "draw", "_imgIndices", !0), rt("selections", "drawOne", "_selectionIndices");
              };
              var fe = we.getDataConversions = function(Se, ae, ft, rt) {
                var gt, wt = ft === "x" || ft === "y" || ft === "z" ? ft : rt;
                if (g.isArrayOrTypedArray(wt)) {
                  if (gt = {
                    type: Re(rt, void 0, {
                      autotypenumbers: Se._fullLayout.autotypenumbers
                    }),
                    _categories: []
                  }, we.setConvert(gt), gt.type === "category")
                    for (var Ct = 0; Ct < rt.length; Ct++)
                      gt.d2c(rt[Ct]);
                } else
                  gt = we.getFromTrace(Se, ae, wt);
                return gt ? {
                  d2c: gt.d2c,
                  c2d: gt.c2d
                } : wt === "ids" ? {
                  d2c: he,
                  c2d: he
                } : {
                  d2c: $,
                  c2d: $
                };
              };
              function $(Se) {
                return +Se;
              }
              function he(Se) {
                return String(Se);
              }
              we.getDataToCoordFunc = function(Se, ae, ft, rt) {
                return fe(Se, ae, ft, rt).d2c;
              }, we.counterLetter = function(Se) {
                var ae = Se.charAt(0);
                if (ae === "x") return "y";
                if (ae === "y") return "x";
              }, we.minDtick = function(Se, ae, ft, rt) {
                ["log", "category", "multicategory"].indexOf(Se.type) !== -1 || !rt ? Se._minDtick = 0 : Se._minDtick === void 0 ? (Se._minDtick = ae, Se._forceTick0 = ft) : Se._minDtick && ((Se._minDtick / ae + 1e-6) % 1 < 2e-6 && // existing minDtick is an integer multiple of newDiff
                // (within rounding err)
                // and forceTick0 can be shifted to newFirst
                ((ft - Se._forceTick0) / ae % 1 + 1.000001) % 1 < 2e-6 ? (Se._minDtick = ae, Se._forceTick0 = ft) : ((ae / Se._minDtick + 1e-6) % 1 > 2e-6 || // if the converse is true (newDiff is a multiple of minDtick and
                // newFirst can be shifted to forceTick0) then do nothing - same
                // forcing stands. Otherwise, cancel forced minimum
                ((ft - Se._forceTick0) / Se._minDtick % 1 + 1.000001) % 1 > 2e-6) && (Se._minDtick = 0));
              }, we.saveRangeInitial = function(Se, ae) {
                for (var ft = we.list(Se, "", !0), rt = !1, gt = 0; gt < ft.length; gt++) {
                  var wt = ft[gt], Ct = wt._rangeInitial0 === void 0 && wt._rangeInitial1 === void 0, pt = Ct || wt.range[0] !== wt._rangeInitial0 || wt.range[1] !== wt._rangeInitial1, dt = wt.autorange;
                  (Ct && dt !== !0 || ae && pt) && (wt._rangeInitial0 = dt === "min" || dt === "max reversed" ? void 0 : wt.range[0], wt._rangeInitial1 = dt === "max" || dt === "min reversed" ? void 0 : wt.range[1], wt._autorangeInitial = dt, rt = !0);
                }
                return rt;
              }, we.saveShowSpikeInitial = function(Se, ae) {
                for (var ft = we.list(Se, "", !0), rt = !1, gt = "on", wt = 0; wt < ft.length; wt++) {
                  var Ct = ft[wt], pt = Ct._showSpikeInitial === void 0, dt = pt || Ct.showspikes !== Ct._showspikes;
                  (pt || ae && dt) && (Ct._showSpikeInitial = Ct.showspikes, rt = !0), gt === "on" && !Ct.showspikes && (gt = "off");
                }
                return Se._fullLayout._cartesianSpikesEnabled = gt, rt;
              }, we.autoBin = function(Se, ae, ft, rt, gt, wt) {
                var Ct = g.aggNums(Math.min, null, Se), pt = g.aggNums(Math.max, null, Se);
                if (ae.type === "category" || ae.type === "multicategory")
                  return {
                    start: Ct - 0.5,
                    end: pt + 0.5,
                    size: Math.max(1, Math.round(wt) || 1),
                    _dataSpan: pt - Ct
                  };
                gt || (gt = ae.calendar);
                var dt;
                if (ae.type === "log" ? dt = {
                  type: "linear",
                  range: [Ct, pt]
                } : dt = {
                  type: ae.type,
                  range: g.simpleMap([Ct, pt], ae.c2r, 0, gt),
                  calendar: gt
                }, we.setConvert(dt), wt = wt && E.dtick(wt, dt.type), wt)
                  dt.dtick = wt, dt.tick0 = E.tick0(void 0, dt.type, gt);
                else {
                  var St;
                  if (ft) St = (pt - Ct) / ft;
                  else {
                    var Ft = g.distinctVals(Se), Gt = Math.pow(10, Math.floor(Math.log(Ft.minDiff) / Math.LN10)), Lt = Gt * g.roundUp(Ft.minDiff / Gt, [0.9, 1.9, 4.9, 9.9], !0);
                    St = Math.max(Lt, 2 * g.stdev(Se) / Math.pow(Se.length, rt ? 0.25 : 0.4)), v(St) || (St = 1);
                  }
                  we.autoTicks(dt, St);
                }
                var $t = dt.dtick, _t = we.tickIncrement(we.tickFirst(dt), $t, "reverse", gt), zt, tr;
                if (typeof $t == "number")
                  _t = me(_t, Se, dt, Ct, pt), tr = 1 + Math.floor((pt - _t) / $t), zt = _t + tr * $t;
                else
                  for (dt.dtick.charAt(0) === "M" && (_t = xe(_t, Se, $t, Ct, gt)), zt = _t, tr = 0; zt <= pt; )
                    zt = we.tickIncrement(zt, $t, !1, gt), tr++;
                return {
                  start: ae.c2r(_t, 0, gt),
                  end: ae.c2r(zt, 0, gt),
                  size: $t,
                  _dataSpan: pt - Ct
                };
              };
              function me(Se, ae, ft, rt, gt) {
                var wt = 0, Ct = 0, pt = 0, dt = 0;
                function St($t) {
                  return (1 + ($t - Se) * 100 / ft.dtick) % 100 < 2;
                }
                for (var Ft = 0; Ft < ae.length; Ft++)
                  ae[Ft] % 1 === 0 ? pt++ : v(ae[Ft]) || dt++, St(ae[Ft]) && wt++, St(ae[Ft] + ft.dtick / 2) && Ct++;
                var Gt = ae.length - dt;
                if (pt === Gt && ft.type !== "date")
                  ft.dtick < 1 ? Se = rt - 0.5 * ft.dtick : (Se -= 0.5, Se + ft.dtick < rt && (Se += ft.dtick));
                else if (Ct < Gt * 0.1 && (wt > Gt * 0.3 || St(rt) || St(gt))) {
                  var Lt = ft.dtick / 2;
                  Se += Se + Lt < rt ? Lt : -Lt;
                }
                return Se;
              }
              function xe(Se, ae, ft, rt, gt) {
                var wt = g.findExactDates(ae, gt), Ct = 0.8;
                if (wt.exactDays > Ct) {
                  var pt = Number(ft.substr(1));
                  wt.exactYears > Ct && pt % 12 === 0 ? Se = we.tickIncrement(Se, "M6", "reverse") + j * 1.5 : wt.exactMonths > Ct ? Se = we.tickIncrement(Se, "M1", "reverse") + j * 15.5 : Se -= te;
                  var dt = we.tickIncrement(Se, ft);
                  if (dt <= rt) return dt;
                }
                return Se;
              }
              we.prepMinorTicks = function(Se, ae, ft) {
                if (!ae.minor.dtick) {
                  delete Se.dtick;
                  var rt = ae.dtick && v(ae._tmin), gt;
                  if (rt) {
                    var wt = we.tickIncrement(ae._tmin, ae.dtick, !0);
                    gt = [ae._tmin, wt * 0.99 + ae._tmin * 0.01];
                  } else {
                    var Ct = g.simpleMap(ae.range, ae.r2l);
                    gt = [Ct[0], 0.8 * Ct[0] + 0.2 * Ct[1]];
                  }
                  if (Se.range = g.simpleMap(gt, ae.l2r), Se._isMinor = !0, we.prepTicks(Se, ft), rt) {
                    var pt = v(ae.dtick), dt = v(Se.dtick), St = pt ? ae.dtick : +ae.dtick.substring(1), Ft = dt ? Se.dtick : +Se.dtick.substring(1);
                    pt && dt ? Fe(St, Ft) ? St === 2 * Y && Ft === 2 * j && (Se.dtick = Y) : St === 2 * Y && Ft === 3 * j ? Se.dtick = Y : St === Y && !(ae._input.minor || {}).nticks ? Se.dtick = j : Ve(St / Ft, 2.5) ? Se.dtick = St / 2 : Se.dtick = St : String(ae.dtick).charAt(0) === "M" ? dt ? Se.dtick = "M1" : Fe(St, Ft) ? St >= 12 && Ft === 2 && (Se.dtick = "M3") : Se.dtick = ae.dtick : String(Se.dtick).charAt(0) === "L" ? String(ae.dtick).charAt(0) === "L" ? Fe(St, Ft) || (Se.dtick = Ve(St / Ft, 2.5) ? ae.dtick / 2 : ae.dtick) : Se.dtick = "D1" : Se.dtick === "D2" && +ae.dtick > 1 && (Se.dtick = 1);
                  }
                  Se.range = ae.range;
                }
                ae.minor._tick0Init === void 0 && (Se.tick0 = ae.tick0);
              };
              function Fe(Se, ae) {
                return Math.abs((Se / ae + 0.5) % 1 - 0.5) < 1e-3;
              }
              function Ve(Se, ae) {
                return Math.abs(Se / ae - 1) < 1e-3;
              }
              we.prepTicks = function(Se, ae) {
                var ft = g.simpleMap(Se.range, Se.r2l, void 0, void 0, ae);
                if (Se.tickmode === "auto" || !Se.dtick) {
                  var rt = Se.nticks, gt;
                  rt || (Se.type === "category" || Se.type === "multicategory" ? (gt = Se.tickfont ? g.bigFont(Se.tickfont.size || 12) : 15, rt = Se._length / gt) : (gt = Se._id.charAt(0) === "y" ? 40 : 80, rt = g.constrain(Se._length / gt, 4, 9) + 1), Se._name === "radialaxis" && (rt *= 2)), Se.minor && Se.minor.tickmode !== "array" || Se.tickmode === "array" && (rt *= 100), Se._roughDTick = Math.abs(ft[1] - ft[0]) / rt, we.autoTicks(Se, Se._roughDTick), Se._minDtick > 0 && Se.dtick < Se._minDtick * 2 && (Se.dtick = Se._minDtick, Se.tick0 = Se.l2r(Se._forceTick0));
                }
                Se.ticklabelmode === "period" && Je(Se), Se.tick0 || (Se.tick0 = Se.type === "date" ? "2000-01-01" : 0), Se.type === "date" && Se.dtick < 0.1 && (Se.dtick = 0.1), xt(Se);
              };
              function Be(Se) {
                return +Se.substring(1);
              }
              function Je(Se) {
                var ae;
                function ft() {
                  return !(v(Se.dtick) || Se.dtick.charAt(0) !== "M");
                }
                var rt = ft(), gt = we.getTickFormat(Se);
                if (gt) {
                  var wt = Se._dtickInit !== Se.dtick;
                  /%[fLQsSMX]/.test(gt) || (/%[HI]/.test(gt) ? (ae = re, wt && !rt && Se.dtick < re && (Se.dtick = re)) : /%p/.test(gt) ? (ae = te, wt && !rt && Se.dtick < te && (Se.dtick = te)) : /%[Aadejuwx]/.test(gt) ? (ae = j, wt && !rt && Se.dtick < j && (Se.dtick = j)) : /%[UVW]/.test(gt) ? (ae = Y, wt && !rt && Se.dtick < Y && (Se.dtick = Y)) : /%[Bbm]/.test(gt) ? (ae = O, wt && (rt ? Be(Se.dtick) < 1 : Se.dtick < N) && (Se.dtick = "M1")) : /%[q]/.test(gt) ? (ae = I, wt && (rt ? Be(Se.dtick) < 3 : Se.dtick < L) && (Se.dtick = "M3")) : /%[Yy]/.test(gt) && (ae = F, wt && (rt ? Be(Se.dtick) < 12 : Se.dtick < P) && (Se.dtick = "M12")));
                }
                rt = ft(), rt && Se.tick0 === Se._dowTick0 && (Se.tick0 = Se._rawTick0), Se._definedDelta = ae;
              }
              function et(Se, ae, ft) {
                for (var rt = 0; rt < Se.length; rt++) {
                  var gt = Se[rt].value, wt = rt, Ct = rt + 1;
                  rt < Se.length - 1 ? (wt = rt, Ct = rt + 1) : rt > 0 ? (wt = rt - 1, Ct = rt) : (wt = rt, Ct = rt);
                  var pt = Se[wt].value, dt = Se[Ct].value, St = Math.abs(dt - pt), Ft = ft || St, Gt = 0;
                  Ft >= P ? St >= P && St <= T ? Gt = St : Gt = F : ft === I && Ft >= L ? St >= L && St <= k ? Gt = St : Gt = I : Ft >= N ? St >= N && St <= A ? Gt = St : Gt = O : ft === Y && Ft >= Y ? Gt = Y : Ft >= j ? Gt = j : ft === te && Ft >= te ? Gt = te : ft === re && Ft >= re && (Gt = re);
                  var Lt;
                  Gt >= St && (Gt = St, Lt = !0);
                  var $t = gt + Gt;
                  if (ae.rangebreaks && Gt > 0) {
                    for (var _t = 84, zt = 0, tr = 0; tr < _t; tr++) {
                      var nr = (tr + 0.5) / _t;
                      ae.maskBreaks(gt * (1 - nr) + nr * $t) !== q && zt++;
                    }
                    Gt *= zt / _t, Gt || (Se[rt].drop = !0), Lt && St > Y && (Gt = St);
                  }
                  (Gt > 0 || // not instant
                  rt === 0) && (Se[rt].periodX = gt + Gt / 2);
                }
              }
              we.calcTicks = function(ae, ft) {
                for (var rt = ae.type, gt = ae.calendar, wt = ae.ticklabelstep, Ct = ae.ticklabelmode === "period", pt = g.simpleMap(ae.range, ae.r2l, void 0, void 0, ft), dt = pt[1] < pt[0], St = Math.min(pt[0], pt[1]), Ft = Math.max(pt[0], pt[1]), Gt = Math.max(1e3, ae._length || 0), Lt = [], $t = [], _t = [], zt = [], tr = ae.minor && (ae.minor.ticks || ae.minor.showgrid), nr = 1; nr >= (tr ? 0 : 1); nr--) {
                  var xr = !nr;
                  nr ? (ae._dtickInit = ae.dtick, ae._tick0Init = ae.tick0) : (ae.minor._dtickInit = ae.minor.dtick, ae.minor._tick0Init = ae.minor.tick0);
                  var Er = nr ? ae : g.extendFlat({}, ae, ae.minor);
                  if (xr ? we.prepMinorTicks(Er, ae, ft) : we.prepTicks(Er, ft), Er.tickmode === "array") {
                    nr ? (_t = [], Lt = Ne(ae, !xr)) : (zt = [], $t = Ne(ae, !xr));
                    continue;
                  }
                  if (Er.tickmode === "sync") {
                    _t = [], Lt = De(ae);
                    continue;
                  }
                  var Jr = V(pt), Ur = Jr[0], Br = Jr[1], dn = v(Er.dtick), nn = rt === "log" && !(dn || Er.dtick.charAt(0) === "L"), Sn = we.tickFirst(Er, ft);
                  if (nr) {
                    if (ae._tmin = Sn, Sn < Ur !== dt) break;
                    (rt === "category" || rt === "multicategory") && (Br = dt ? Math.max(-0.5, Br) : Math.min(ae._categories.length - 0.5, Br));
                  }
                  var ai = null, Dn = Sn, on;
                  if (nr) {
                    var ri;
                    dn ? ri = ae.dtick : rt === "date" ? typeof ae.dtick == "string" && ae.dtick.charAt(0) === "M" && (ri = O * ae.dtick.substring(1)) : ri = ae._roughDTick, on = Math.round((ae.r2l(Dn) - ae.r2l(ae.tick0)) / ri) - 1;
                  }
                  var Fi = Er.dtick;
                  for (Er.rangebreaks && Er._tick0Init !== Er.tick0 && (Dn = br(Dn, ae), dt || (Dn = we.tickIncrement(Dn, Fi, !dt, gt))), nr && Ct && (Dn = we.tickIncrement(Dn, Fi, !dt, gt), on--); dt ? Dn >= Br : Dn <= Br; Dn = we.tickIncrement(Dn, Fi, dt, gt)) {
                    if (nr && on++, Er.rangebreaks && !dt) {
                      if (Dn < Ur) continue;
                      if (Er.maskBreaks(Dn) === q && br(Dn, Er) >= Ft) break;
                    }
                    if (_t.length > Gt || Dn === ai) break;
                    ai = Dn;
                    var Pi = {
                      value: Dn
                    };
                    nr ? (nn && Dn !== (Dn | 0) && (Pi.simpleLabel = !0), wt > 1 && on % wt && (Pi.skipLabel = !0), _t.push(Pi)) : (Pi.minor = !0, zt.push(Pi));
                  }
                }
                if (tr) {
                  var pn = ae.minor.ticks === "inside" && ae.ticks === "outside" || ae.minor.ticks === "outside" && ae.ticks === "inside";
                  if (!pn) {
                    for (var hi = _t.map(function(ia) {
                      return ia.value;
                    }), yn = [], Pn = 0; Pn < zt.length; Pn++) {
                      var kn = zt[Pn], Wn = kn.value;
                      if (hi.indexOf(Wn) === -1) {
                        for (var Ln = !1, li = 0; !Ln && li < _t.length; li++)
                          // add 10e6 to eliminate problematic digits
                          1e7 + _t[li].value === 1e7 + Wn && (Ln = !0);
                        Ln || yn.push(kn);
                      }
                    }
                    zt = yn;
                  }
                }
                Ct && et(_t, ae, ae._definedDelta);
                var Bn;
                if (ae.rangebreaks) {
                  var ci = ae._id.charAt(0) === "y", Gi = 1;
                  ae.tickmode === "auto" && (Gi = ae.tickfont ? ae.tickfont.size : 12);
                  var pi = NaN;
                  for (Bn = _t.length - 1; Bn > -1; Bn--) {
                    if (_t[Bn].drop) {
                      _t.splice(Bn, 1);
                      continue;
                    }
                    _t[Bn].value = br(_t[Bn].value, ae);
                    var ei = ae.c2p(_t[Bn].value);
                    (ci ? pi > ei - Gi : pi < ei + Gi) ? _t.splice(dt ? Bn + 1 : Bn, 1) : pi = ei;
                  }
                }
                kr(ae) && Math.abs(pt[1] - pt[0]) === 360 && _t.pop(), ae._tmax = (_t[_t.length - 1] || {}).value, ae._prevDateHead = "", ae._inCalcTicks = !0;
                var fa, Hi = function(ia) {
                  ia.text = "", ae._prevDateHead = fa;
                };
                _t = _t.concat(zt);
                var Ti, Ui;
                for (Bn = 0; Bn < _t.length; Bn++) {
                  var la = _t[Bn].minor, za = _t[Bn].value;
                  la ? $t.push({
                    x: za,
                    minor: !0
                  }) : (fa = ae._prevDateHead, Ti = we.tickText(
                    ae,
                    za,
                    !1,
                    // hover
                    _t[Bn].simpleLabel
                    // noSuffixPrefix
                  ), Ui = _t[Bn].periodX, Ui !== void 0 && (Ti.periodX = Ui, (Ui > Ft || Ui < St) && (Ui > Ft && (Ti.periodX = Ft), Ui < St && (Ti.periodX = St), Hi(Ti))), _t[Bn].skipLabel && Hi(Ti), Lt.push(Ti));
                }
                return Lt = Lt.concat($t), ae._inCalcTicks = !1, Ct && Lt.length && (Lt[0].noTick = !0), Lt;
              };
              function at(Se, ae) {
                return Se.rangebreaks && (ae = ae.filter(function(ft) {
                  return Se.maskBreaks(ft.x) !== q;
                })), ae;
              }
              function De(Se) {
                var ae = Se._mainAxis, ft = [];
                if (ae._vals) {
                  for (var rt = 0; rt < ae._vals.length; rt++)
                    if (!ae._vals[rt].noTick) {
                      var gt = ae.l2p(ae._vals[rt].x), wt = Se.p2l(gt), Ct = we.tickText(Se, wt);
                      ae._vals[rt].minor && (Ct.minor = !0, Ct.text = ""), ft.push(Ct);
                    }
                }
                return ft = at(Se, ft), ft;
              }
              function Ne(Se, ae) {
                var ft = g.simpleMap(Se.range, Se.r2l), rt = V(ft), gt = Math.min(rt[0], rt[1]), wt = Math.max(rt[0], rt[1]), Ct = Se.type === "category" ? Se.d2l_noadd : Se.d2l;
                Se.type === "log" && String(Se.dtick).charAt(0) !== "L" && (Se.dtick = "L" + Math.pow(10, Math.floor(Math.min(Se.range[0], Se.range[1])) - 1));
                for (var pt = [], dt = 0; dt <= 1; dt++)
                  if (!(ae !== void 0 && (ae && dt || ae === !1 && !dt)) && !(dt && !Se.minor)) {
                    var St = dt ? Se.minor.tickvals : Se.tickvals, Ft = dt ? [] : Se.ticktext;
                    if (St) {
                      g.isArrayOrTypedArray(Ft) || (Ft = []);
                      for (var Gt = 0; Gt < St.length; Gt++) {
                        var Lt = Ct(St[Gt]);
                        if (Lt > gt && Lt < wt) {
                          var $t = we.tickText(Se, Lt, !1, String(Ft[Gt]));
                          dt && ($t.minor = !0, $t.text = ""), pt.push($t);
                        }
                      }
                    }
                  }
                return pt = at(Se, pt), pt;
              }
              var Ie = [2, 5, 10], Ue = [1, 2, 3, 6, 12], ot = [1, 2, 5, 10, 15, 30], ct = [1, 2, 3, 7, 14], Tt = [-0.046, 0, 0.301, 0.477, 0.602, 0.699, 0.778, 0.845, 0.903, 0.954, 1], kt = [-0.301, 0, 0.301, 0.699, 1], Ot = [15, 30, 45, 90, 180];
              function Rt(Se, ae, ft) {
                return ae * g.roundUp(Se / ae, ft);
              }
              we.autoTicks = function(Se, ae, ft) {
                var rt;
                function gt(Gt) {
                  return Math.pow(Gt, Math.floor(Math.log(ae) / Math.LN10));
                }
                if (Se.type === "date") {
                  Se.tick0 = g.dateTick0(Se.calendar, 0);
                  var wt = 2 * ae;
                  if (wt > F)
                    ae /= F, rt = gt(10), Se.dtick = "M" + 12 * Rt(ae, rt, Ie);
                  else if (wt > O)
                    ae /= O, Se.dtick = "M" + Rt(ae, 1, Ue);
                  else if (wt > j) {
                    if (Se.dtick = Rt(ae, j, Se._hasDayOfWeekBreaks ? [1, 2, 7, 14] : ct), !ft) {
                      var Ct = we.getTickFormat(Se), pt = Se.ticklabelmode === "period";
                      pt && (Se._rawTick0 = Se.tick0), /%[uVW]/.test(Ct) ? Se.tick0 = g.dateTick0(Se.calendar, 2) : Se.tick0 = g.dateTick0(Se.calendar, 1), pt && (Se._dowTick0 = Se.tick0);
                    }
                  } else wt > re ? Se.dtick = Rt(ae, re, Ue) : wt > z ? Se.dtick = Rt(ae, z, ot) : wt > Z ? Se.dtick = Rt(ae, Z, ot) : (rt = gt(10), Se.dtick = Rt(ae, rt, Ie));
                } else if (Se.type === "log") {
                  Se.tick0 = 0;
                  var dt = g.simpleMap(Se.range, Se.r2l);
                  if (Se._isMinor && (ae *= 1.5), ae > 0.7)
                    Se.dtick = Math.ceil(ae);
                  else if (Math.abs(dt[1] - dt[0]) < 1) {
                    var St = 1.5 * Math.abs((dt[1] - dt[0]) / ae);
                    ae = Math.abs(Math.pow(10, dt[1]) - Math.pow(10, dt[0])) / St, rt = gt(10), Se.dtick = "L" + Rt(ae, rt, Ie);
                  } else
                    Se.dtick = ae > 0.3 ? "D2" : "D1";
                } else Se.type === "category" || Se.type === "multicategory" ? (Se.tick0 = 0, Se.dtick = Math.ceil(Math.max(ae, 1))) : kr(Se) ? (Se.tick0 = 0, rt = 1, Se.dtick = Rt(ae, rt, Ot)) : (Se.tick0 = 0, rt = gt(10), Se.dtick = Rt(ae, rt, Ie));
                if (Se.dtick === 0 && (Se.dtick = 1), !v(Se.dtick) && typeof Se.dtick != "string") {
                  var Ft = Se.dtick;
                  throw Se.dtick = 1, "ax.dtick error: " + String(Ft);
                }
              };
              function xt(Se) {
                var ae = Se.dtick;
                if (Se._tickexponent = 0, !v(ae) && typeof ae != "string" && (ae = 1), (Se.type === "category" || Se.type === "multicategory") && (Se._tickround = null), Se.type === "date") {
                  var ft = Se.r2l(Se.tick0), rt = Se.l2r(ft).replace(/(^-|i)/g, ""), gt = rt.length;
                  if (String(ae).charAt(0) === "M")
                    gt > 10 || rt.substr(5) !== "01-01" ? Se._tickround = "d" : Se._tickround = +ae.substr(1) % 12 === 0 ? "y" : "m";
                  else if (ae >= j && gt <= 10 || ae >= j * 15) Se._tickround = "d";
                  else if (ae >= z && gt <= 16 || ae >= re) Se._tickround = "M";
                  else if (ae >= Z && gt <= 19 || ae >= z) Se._tickround = "S";
                  else {
                    var wt = Se.l2r(ft + ae).replace(/^-/, "").length;
                    Se._tickround = Math.max(gt, wt) - 20, Se._tickround < 0 && (Se._tickround = 4);
                  }
                } else if (v(ae) || ae.charAt(0) === "L") {
                  var Ct = Se.range.map(Se.r2d || Number);
                  v(ae) || (ae = Number(ae.substr(1))), Se._tickround = 2 - Math.floor(Math.log(ae) / Math.LN10 + 0.01);
                  var pt = Math.max(Math.abs(Ct[0]), Math.abs(Ct[1])), dt = Math.floor(Math.log(pt) / Math.LN10 + 0.01), St = Se.minexponent === void 0 ? 3 : Se.minexponent;
                  Math.abs(dt) > St && (Ye(Se.exponentformat) && !lt(dt) ? Se._tickexponent = 3 * Math.round((dt - 1) / 3) : Se._tickexponent = dt);
                } else
                  Se._tickround = null;
              }
              we.tickIncrement = function(Se, ae, ft, rt) {
                var gt = ft ? -1 : 1;
                if (v(ae)) return g.increment(Se, gt * ae);
                var wt = ae.charAt(0), Ct = gt * Number(ae.substr(1));
                if (wt === "M") return g.incrementMonth(Se, Ct, rt);
                if (wt === "L") return Math.log(Math.pow(10, Se) + Ct) / Math.LN10;
                if (wt === "D") {
                  var pt = ae === "D2" ? kt : Tt, dt = Se + gt * 0.01, St = g.roundUp(g.mod(dt, 1), pt, ft);
                  return Math.floor(dt) + Math.log(l.round(Math.pow(10, St), 1)) / Math.LN10;
                }
                throw "unrecognized dtick " + String(ae);
              }, we.tickFirst = function(Se, ae) {
                var ft = Se.r2l || Number, rt = g.simpleMap(Se.range, ft, void 0, void 0, ae), gt = rt[1] < rt[0], wt = gt ? Math.floor : Math.ceil, Ct = V(rt)[0], pt = Se.dtick, dt = ft(Se.tick0);
                if (v(pt)) {
                  var St = wt((Ct - dt) / pt) * pt + dt;
                  return (Se.type === "category" || Se.type === "multicategory") && (St = g.constrain(St, 0, Se._categories.length - 1)), St;
                }
                var Ft = pt.charAt(0), Gt = Number(pt.substr(1));
                if (Ft === "M") {
                  for (var Lt = 0, $t = dt, _t, zt, tr; Lt < 10; ) {
                    if (_t = we.tickIncrement($t, pt, gt, Se.calendar), (_t - Ct) * ($t - Ct) <= 0)
                      return gt ? Math.min($t, _t) : Math.max($t, _t);
                    zt = (Ct - ($t + _t) / 2) / (_t - $t), tr = Ft + (Math.abs(Math.round(zt)) || 1) * Gt, $t = we.tickIncrement($t, tr, zt < 0 ? !gt : gt, Se.calendar), Lt++;
                  }
                  return g.error("tickFirst did not converge", Se), $t;
                } else {
                  if (Ft === "L")
                    return Math.log(wt((Math.pow(10, Ct) - dt) / Gt) * Gt + dt) / Math.LN10;
                  if (Ft === "D") {
                    var nr = pt === "D2" ? kt : Tt, xr = g.roundUp(g.mod(Ct, 1), nr, gt);
                    return Math.floor(Ct) + Math.log(l.round(Math.pow(10, xr), 1)) / Math.LN10;
                  } else throw "unrecognized dtick " + String(pt);
                }
              }, we.tickText = function(Se, ae, ft, rt) {
                var gt = Wt(Se, ae), wt = Se.tickmode === "array", Ct = ft || wt, pt = Se.type, dt = pt === "category" ? Se.d2l_noadd : Se.d2l, St, Ft = function(tr) {
                  var nr = Se.l2p(tr);
                  return nr >= 0 && nr <= Se._length ? tr : null;
                };
                if (wt && g.isArrayOrTypedArray(Se.ticktext)) {
                  var Gt = g.simpleMap(Se.range, Se.r2l), Lt = (Math.abs(Gt[1] - Gt[0]) - (Se._lBreaks || 0)) / 1e4;
                  for (St = 0; St < Se.ticktext.length && !(Math.abs(ae - dt(Se.tickvals[St])) < Lt); St++)
                    ;
                  if (St < Se.ticktext.length)
                    return gt.text = String(Se.ticktext[St]), gt.xbnd = [Ft(gt.x - 0.5), Ft(gt.x + Se.dtick - 0.5)], gt;
                }
                function $t(tr) {
                  if (tr === void 0) return !0;
                  if (ft) return tr === "none";
                  var nr = {
                    first: Se._tmin,
                    last: Se._tmax
                  }[tr];
                  return tr !== "all" && ae !== nr;
                }
                var _t = ft ? "never" : Se.exponentformat !== "none" && $t(Se.showexponent) ? "hide" : "";
                if (pt === "date" ? bt(Se, gt, ft, Ct) : pt === "log" ? jt(Se, gt, ft, Ct, _t) : pt === "category" ? qt(Se, gt) : pt === "multicategory" ? Yt(Se, gt, ft) : kr(Se) ? tt(Se, gt, ft, Ct, _t) : Ut(Se, gt, ft, Ct, _t), rt || (Se.tickprefix && !$t(Se.showtickprefix) && (gt.text = Se.tickprefix + gt.text), Se.ticksuffix && !$t(Se.showticksuffix) && (gt.text += Se.ticksuffix)), Se.labelalias && Se.labelalias.hasOwnProperty(gt.text)) {
                  var zt = Se.labelalias[gt.text];
                  typeof zt == "string" && (gt.text = zt);
                }
                return (Se.tickson === "boundaries" || Se.showdividers) && (gt.xbnd = [Ft(gt.x - 0.5), Ft(gt.x + Se.dtick - 0.5)]), gt;
              }, we.hoverLabelText = function(Se, ae, ft) {
                ft && (Se = g.extendFlat({}, Se, {
                  hoverformat: ft
                }));
                var rt = g.isArrayOrTypedArray(ae) ? ae[0] : ae, gt = g.isArrayOrTypedArray(ae) ? ae[1] : void 0;
                if (gt !== void 0 && gt !== rt)
                  return we.hoverLabelText(Se, rt, ft) + " - " + we.hoverLabelText(Se, gt, ft);
                var wt = Se.type === "log" && rt <= 0, Ct = we.tickText(Se, Se.c2l(wt ? -rt : rt), "hover").text;
                return wt ? rt === 0 ? "0" : W + Ct : Ct;
              };
              function Wt(Se, ae, ft) {
                var rt = Se.tickfont || {};
                return {
                  x: ae,
                  dx: 0,
                  dy: 0,
                  text: ft || "",
                  fontSize: rt.size,
                  font: rt.family,
                  fontWeight: rt.weight,
                  fontStyle: rt.style,
                  fontVariant: rt.variant,
                  fontTextcase: rt.textcase,
                  fontLineposition: rt.lineposition,
                  fontShadow: rt.shadow,
                  fontColor: rt.color
                };
              }
              function bt(Se, ae, ft, rt) {
                var gt = Se._tickround, wt = ft && Se.hoverformat || we.getTickFormat(Se);
                rt = !wt && rt, rt && (v(gt) ? gt = 4 : gt = {
                  y: "m",
                  m: "d",
                  d: "M",
                  M: "S",
                  S: 4
                }[gt]);
                var Ct = g.formatDate(ae.x, wt, gt, Se._dateFormat, Se.calendar, Se._extraFormat), pt, dt = Ct.indexOf(`
`);
                if (dt !== -1 && (pt = Ct.substr(dt + 1), Ct = Ct.substr(0, dt)), rt && (pt !== void 0 && (Ct === "00:00:00" || Ct === "00:00") ? (Ct = pt, pt = "") : Ct.length === 8 && (Ct = Ct.replace(/:00$/, ""))), pt)
                  if (ft)
                    gt === "d" ? Ct += ", " + pt : Ct = pt + (Ct ? ", " + Ct : "");
                  else if (!Se._inCalcTicks || Se._prevDateHead !== pt)
                    Se._prevDateHead = pt, Ct += "<br>" + pt;
                  else {
                    var St = Gr(Se), Ft = Se._trueSide || Se.side;
                    (!St && Ft === "top" || St && Ft === "bottom") && (Ct += "<br> ");
                  }
                ae.text = Ct;
              }
              function jt(Se, ae, ft, rt, gt) {
                var wt = Se.dtick, Ct = ae.x, pt = Se.tickformat, dt = typeof wt == "string" && wt.charAt(0);
                if (gt === "never" && (gt = ""), rt && dt !== "L" && (wt = "L3", dt = "L"), pt || dt === "L")
                  ae.text = Te(Math.pow(10, Ct), Se, gt, rt);
                else if (v(wt) || dt === "D" && g.mod(Ct + 0.01, 1) < 0.1) {
                  var St = Math.round(Ct), Ft = Math.abs(St), Gt = Se.exponentformat;
                  Gt === "power" || Ye(Gt) && lt(St) ? (St === 0 ? ae.text = 1 : St === 1 ? ae.text = "10" : ae.text = "10<sup>" + (St > 1 ? "" : W) + Ft + "</sup>", ae.fontSize *= 1.25) : (Gt === "e" || Gt === "E") && Ft > 2 ? ae.text = "1" + Gt + (St > 0 ? "+" : W) + Ft : (ae.text = Te(Math.pow(10, Ct), Se, "", "fakehover"), wt === "D1" && Se._id.charAt(0) === "y" && (ae.dy -= ae.fontSize / 6));
                } else if (dt === "D")
                  ae.text = String(Math.round(Math.pow(10, g.mod(Ct, 1)))), ae.fontSize *= 0.75;
                else throw "unrecognized dtick " + String(wt);
                if (Se.dtick === "D1") {
                  var Lt = String(ae.text).charAt(0);
                  (Lt === "0" || Lt === "1") && (Se._id.charAt(0) === "y" ? ae.dx -= ae.fontSize / 4 : (ae.dy += ae.fontSize / 2, ae.dx += (Se.range[1] > Se.range[0] ? 1 : -1) * ae.fontSize * (Ct < 0 ? 0.5 : 0.25)));
                }
              }
              function qt(Se, ae) {
                var ft = Se._categories[Math.round(ae.x)];
                ft === void 0 && (ft = ""), ae.text = String(ft);
              }
              function Yt(Se, ae, ft) {
                var rt = Math.round(ae.x), gt = Se._categories[rt] || [], wt = gt[1] === void 0 ? "" : String(gt[1]), Ct = gt[0] === void 0 ? "" : String(gt[0]);
                ft ? ae.text = Ct + " - " + wt : (ae.text = wt, ae.text2 = Ct);
              }
              function Ut(Se, ae, ft, rt, gt) {
                gt === "never" ? gt = "" : Se.showexponent === "all" && Math.abs(ae.x / Se.dtick) < 1e-6 && (gt = "hide"), ae.text = Te(ae.x, Se, gt, rt);
              }
              function tt(Se, ae, ft, rt, gt) {
                if (Se.thetaunit === "radians" && !ft) {
                  var wt = ae.x / 180;
                  if (wt === 0)
                    ae.text = "0";
                  else {
                    var Ct = ze(wt);
                    if (Ct[1] >= 100)
                      ae.text = Te(g.deg2rad(ae.x), Se, gt, rt);
                    else {
                      var pt = ae.x < 0;
                      Ct[1] === 1 ? Ct[0] === 1 ? ae.text = "π" : ae.text = Ct[0] + "π" : ae.text = ["<sup>", Ct[0], "</sup>", "⁄", "<sub>", Ct[1], "</sub>", "π"].join(""), pt && (ae.text = W + ae.text);
                    }
                  }
                } else
                  ae.text = Te(ae.x, Se, gt, rt);
              }
              function ze(Se) {
                function ae(pt, dt) {
                  return Math.abs(pt - dt) <= 1e-6;
                }
                function ft(pt, dt) {
                  return ae(dt, 0) ? pt : ft(dt, pt % dt);
                }
                function rt(pt) {
                  for (var dt = 1; !ae(Math.round(pt * dt) / dt, pt); )
                    dt *= 10;
                  return dt;
                }
                var gt = rt(Se), wt = Se * gt, Ct = Math.abs(ft(wt, gt));
                return [
                  // numerator
                  Math.round(wt / Ct),
                  // denominator
                  Math.round(gt / Ct)
                ];
              }
              var _e = ["f", "p", "n", "μ", "m", "", "k", "M", "G", "T"];
              function Ye(Se) {
                return Se === "SI" || Se === "B";
              }
              function lt(Se) {
                return Se > 14 || Se < -15;
              }
              function Te(Se, ae, ft, rt) {
                var gt = Se < 0, wt = ae._tickround, Ct = ft || ae.exponentformat || "B", pt = ae._tickexponent, dt = we.getTickFormat(ae), St = ae.separatethousands;
                if (rt) {
                  var Ft = {
                    exponentformat: Ct,
                    minexponent: ae.minexponent,
                    dtick: ae.showexponent === "none" ? ae.dtick : v(Se) && Math.abs(Se) || 1,
                    // if not showing any exponents, don't change the exponent
                    // from what we calculate
                    range: ae.showexponent === "none" ? ae.range.map(ae.r2d) : [0, Se || 1]
                  };
                  xt(Ft), wt = (Number(Ft._tickround) || 0) + 4, pt = Ft._tickexponent, ae.hoverformat && (dt = ae.hoverformat);
                }
                if (dt) return ae._numFormat(dt)(Se).replace(/-/g, W);
                var Gt = Math.pow(10, -wt) / 2;
                if (Ct === "none" && (pt = 0), Se = Math.abs(Se), Se < Gt)
                  Se = "0", gt = !1;
                else {
                  if (Se += Gt, pt && (Se *= Math.pow(10, -pt), wt += pt), wt === 0) Se = String(Math.floor(Se));
                  else if (wt < 0) {
                    Se = String(Math.round(Se)), Se = Se.substr(0, Se.length + wt);
                    for (var Lt = wt; Lt < 0; Lt++) Se += "0";
                  } else {
                    Se = String(Se);
                    var $t = Se.indexOf(".") + 1;
                    $t && (Se = Se.substr(0, $t + wt).replace(/\.?0+$/, ""));
                  }
                  Se = g.numSeparate(Se, ae._separators, St);
                }
                if (pt && Ct !== "hide") {
                  Ye(Ct) && lt(pt) && (Ct = "power");
                  var _t;
                  pt < 0 ? _t = W + -pt : Ct !== "power" ? _t = "+" + pt : _t = String(pt), Ct === "e" || Ct === "E" ? Se += Ct + _t : Ct === "power" ? Se += "×10<sup>" + _t + "</sup>" : Ct === "B" && pt === 9 ? Se += "B" : Ye(Ct) && (Se += _e[pt / 3 + 5]);
                }
                return gt ? W + Se : Se;
              }
              we.getTickFormat = function(Se) {
                var ae;
                function ft(dt) {
                  return typeof dt != "string" ? dt : Number(dt.replace("M", "")) * O;
                }
                function rt(dt, St) {
                  var Ft = ["L", "D"];
                  if (typeof dt == typeof St) {
                    if (typeof dt == "number")
                      return dt - St;
                    var Gt = Ft.indexOf(dt.charAt(0)), Lt = Ft.indexOf(St.charAt(0));
                    return Gt === Lt ? Number(dt.replace(/(L|D)/g, "")) - Number(St.replace(/(L|D)/g, "")) : Gt - Lt;
                  } else
                    return typeof dt == "number" ? 1 : -1;
                }
                function gt(dt, St, Ft) {
                  var Gt = Ft || function(_t) {
                    return _t;
                  }, Lt = St[0], $t = St[1];
                  return (!Lt && typeof Lt != "number" || Gt(Lt) <= Gt(dt)) && (!$t && typeof $t != "number" || Gt($t) >= Gt(dt));
                }
                function wt(dt, St) {
                  var Ft = St[0] === null, Gt = St[1] === null, Lt = rt(dt, St[0]) >= 0, $t = rt(dt, St[1]) <= 0;
                  return (Ft || Lt) && (Gt || $t);
                }
                var Ct, pt;
                if (Se.tickformatstops && Se.tickformatstops.length > 0)
                  switch (Se.type) {
                    case "date":
                    case "linear": {
                      for (ae = 0; ae < Se.tickformatstops.length; ae++)
                        if (pt = Se.tickformatstops[ae], pt.enabled && gt(Se.dtick, pt.dtickrange, ft)) {
                          Ct = pt;
                          break;
                        }
                      break;
                    }
                    case "log": {
                      for (ae = 0; ae < Se.tickformatstops.length; ae++)
                        if (pt = Se.tickformatstops[ae], pt.enabled && wt(Se.dtick, pt.dtickrange)) {
                          Ct = pt;
                          break;
                        }
                      break;
                    }
                  }
                return Ct ? Ct.value : Se.tickformat;
              }, we.getSubplots = function(Se, ae) {
                var ft = Se._fullLayout._subplots, rt = ft.cartesian.concat(ft.gl2d || []), gt = ae ? we.findSubplotsWithAxis(rt, ae) : rt;
                return gt.sort(function(wt, Ct) {
                  var pt = wt.substr(1).split("y"), dt = Ct.substr(1).split("y");
                  return pt[0] === dt[0] ? +pt[1] - +dt[1] : +pt[0] - +dt[0];
                }), gt;
              }, we.findSubplotsWithAxis = function(Se, ae) {
                for (var ft = new RegExp(ae._id.charAt(0) === "x" ? "^" + ae._id + "y" : ae._id + "$"), rt = [], gt = 0; gt < Se.length; gt++) {
                  var wt = Se[gt];
                  ft.test(wt) && rt.push(wt);
                }
                return rt;
              }, we.makeClipPaths = function(Se) {
                var ae = Se._fullLayout;
                if (!ae._hasOnlyLargeSploms) {
                  var ft = {
                    _offset: 0,
                    _length: ae.width,
                    _id: ""
                  }, rt = {
                    _offset: 0,
                    _length: ae.height,
                    _id: ""
                  }, gt = we.list(Se, "x", !0), wt = we.list(Se, "y", !0), Ct = [], pt, dt;
                  for (pt = 0; pt < gt.length; pt++)
                    for (Ct.push({
                      x: gt[pt],
                      y: rt
                    }), dt = 0; dt < wt.length; dt++)
                      pt === 0 && Ct.push({
                        x: ft,
                        y: wt[dt]
                      }), Ct.push({
                        x: gt[pt],
                        y: wt[dt]
                      });
                  var St = ae._clips.selectAll(".axesclip").data(Ct, function(Ft) {
                    return Ft.x._id + Ft.y._id;
                  });
                  St.enter().append("clipPath").classed("axesclip", !0).attr("id", function(Ft) {
                    return "clip" + ae._uid + Ft.x._id + Ft.y._id;
                  }).append("rect"), St.exit().remove(), St.each(function(Ft) {
                    l.select(this).select("rect").attr({
                      x: Ft.x._offset || 0,
                      y: Ft.y._offset || 0,
                      width: Ft.x._length || 1,
                      height: Ft.y._length || 1
                    });
                  });
                }
              }, we.draw = function(Se, ae, ft) {
                var rt = Se._fullLayout;
                ae === "redraw" && rt._paper.selectAll("g.subplot").each(function(dt) {
                  var St = dt[0], Ft = rt._plots[St];
                  if (Ft) {
                    var Gt = Ft.xaxis, Lt = Ft.yaxis;
                    Ft.xaxislayer.selectAll("." + Gt._id + "tick").remove(), Ft.yaxislayer.selectAll("." + Lt._id + "tick").remove(), Ft.xaxislayer.selectAll("." + Gt._id + "tick2").remove(), Ft.yaxislayer.selectAll("." + Lt._id + "tick2").remove(), Ft.xaxislayer.selectAll("." + Gt._id + "divider").remove(), Ft.yaxislayer.selectAll("." + Lt._id + "divider").remove(), Ft.minorGridlayer && Ft.minorGridlayer.selectAll("path").remove(), Ft.gridlayer && Ft.gridlayer.selectAll("path").remove(), Ft.zerolinelayer && Ft.zerolinelayer.selectAll("path").remove(), rt._infolayer.select(".g-" + Gt._id + "title").remove(), rt._infolayer.select(".g-" + Lt._id + "title").remove();
                  }
                });
                var gt = !ae || ae === "redraw" ? we.listIds(Se) : ae, wt = we.list(Se), Ct = wt.filter(function(dt) {
                  return dt.autoshift;
                }).map(function(dt) {
                  return dt.overlaying;
                });
                gt.map(function(dt) {
                  var St = we.getFromId(Se, dt);
                  if (St.tickmode === "sync" && St.overlaying) {
                    var Ft = gt.findIndex(function(Gt) {
                      return Gt === St.overlaying;
                    });
                    Ft >= 0 && gt.unshift(gt.splice(Ft, 1).shift());
                  }
                });
                var pt = {
                  false: {
                    left: 0,
                    right: 0
                  }
                };
                return g.syncOrAsync(gt.map(function(dt) {
                  return function() {
                    if (dt) {
                      var St = we.getFromId(Se, dt);
                      ft || (ft = {}), ft.axShifts = pt, ft.overlayingShiftedAx = Ct;
                      var Ft = we.drawOne(Se, St, ft);
                      return St._shiftPusher && cn(St, St._fullDepth || 0, pt, !0), St._r = St.range.slice(), St._rl = g.simpleMap(St._r, St.r2l), Ft;
                    }
                  };
                }));
              }, we.drawOne = function(Se, ae, ft) {
                ft = ft || {};
                var rt = ft.axShifts || {}, gt = ft.overlayingShiftedAx || [], wt, Ct, pt;
                ae.setScale();
                var dt = Se._fullLayout, St = ae._id, Ft = St.charAt(0), Gt = we.counterLetter(St), Lt = dt._plots[ae._mainSubplot];
                if (!Lt) return;
                if (ae._shiftPusher = ae.autoshift || gt.indexOf(ae._id) !== -1 || gt.indexOf(ae.overlaying) !== -1, ae._shiftPusher & ae.anchor === "free") {
                  var $t = ae.linewidth / 2 || 0;
                  ae.ticks === "inside" && ($t += ae.ticklen), cn(ae, $t, rt, !0), cn(ae, ae.shift || 0, rt, !1);
                }
                (ft.skipTitle !== !0 || ae._shift === void 0) && (ae._shift = Dr(ae, rt));
                var _t = Lt[Ft + "axislayer"], zt = ae._mainLinePosition, tr = zt += ae._shift, nr = ae._mainMirrorPosition, xr = ae._vals = we.calcTicks(ae), Er = [ae.mirror, tr, nr].join("_");
                for (wt = 0; wt < xr.length; wt++)
                  xr[wt].axInfo = Er;
                ae._selections = {}, ae._tickAngles && (ae._prevTickAngles = ae._tickAngles), ae._tickAngles = {}, ae._depth = null;
                var Jr = {};
                function Ur(ji) {
                  var Bi = St + (ji || "tick");
                  return Jr[Bi] || (Jr[Bi] = it(ae, Bi, tr)), Jr[Bi];
                }
                if (ae.visible) {
                  var Br = we.makeTransTickFn(ae), dn = we.makeTransTickLabelFn(ae), nn, Sn, ai = ae.ticks === "inside", Dn = ae.ticks === "outside";
                  if (ae.tickson === "boundaries") {
                    var on = je(ae, xr);
                    Sn = we.clipEnds(ae, on), nn = ai ? Sn : on;
                  } else
                    Sn = we.clipEnds(ae, xr), nn = ai && ae.ticklabelmode !== "period" ? Sn : xr;
                  var ri = ae._gridVals = Sn, Fi = nt(ae, xr);
                  if (!dt._hasOnlyLargeSploms) {
                    var Pi = ae._subplotsWith, pn = {};
                    for (wt = 0; wt < Pi.length; wt++) {
                      Ct = Pi[wt], pt = dt._plots[Ct];
                      var hi = pt[Gt + "axis"], yn = hi._mainAxis._id;
                      if (!pn[yn]) {
                        pn[yn] = 1;
                        var Pn = Ft === "x" ? "M0," + hi._offset + "v" + hi._length : "M" + hi._offset + ",0h" + hi._length;
                        we.drawGrid(Se, ae, {
                          vals: ri,
                          counterAxis: hi,
                          layer: pt.gridlayer.select("." + St),
                          minorLayer: pt.minorGridlayer.select("." + St),
                          path: Pn,
                          transFn: Br
                        }), we.drawZeroLine(Se, ae, {
                          counterAxis: hi,
                          layer: pt.zerolinelayer,
                          path: Pn,
                          transFn: Br
                        });
                      }
                    }
                  }
                  var kn, Wn = we.getTickSigns(ae), Ln = we.getTickSigns(ae, "minor");
                  if (ae.ticks || ae.minor && ae.minor.ticks) {
                    var li = we.makeTickPath(ae, tr, Wn[2]), Bn = we.makeTickPath(ae, tr, Ln[2], {
                      minor: !0
                    }), ci, Gi, pi, ei;
                    if (ae._anchorAxis && ae.mirror && ae.mirror !== !0 ? (ci = we.makeTickPath(ae, nr, Wn[3]), Gi = we.makeTickPath(ae, nr, Ln[3], {
                      minor: !0
                    }), pi = li + ci, ei = Bn + Gi) : (ci = "", Gi = "", pi = li, ei = Bn), ae.showdividers && Dn && ae.tickson === "boundaries") {
                      var fa = {};
                      for (wt = 0; wt < Fi.length; wt++)
                        fa[Fi[wt].x] = 1;
                      kn = function(ji) {
                        return fa[ji.x] ? ci : pi;
                      };
                    } else
                      kn = function(ji) {
                        return ji.minor ? ei : pi;
                      };
                  }
                  if (we.drawTicks(Se, ae, {
                    vals: nn,
                    layer: _t,
                    path: kn,
                    transFn: Br
                  }), ae.mirror === "allticks") {
                    var Hi = Object.keys(ae._linepositions || {});
                    for (wt = 0; wt < Hi.length; wt++) {
                      Ct = Hi[wt], pt = dt._plots[Ct];
                      var Ti = ae._linepositions[Ct] || [], Ui = Ti[0], la = Ti[1], za = Ti[2], ia = we.makeTickPath(ae, Ui, za ? Wn[0] : Ln[0], {
                        minor: za
                      }) + we.makeTickPath(ae, la, za ? Wn[1] : Ln[1], {
                        minor: za
                      });
                      we.drawTicks(Se, ae, {
                        vals: nn,
                        layer: pt[Ft + "axislayer"],
                        path: ia,
                        transFn: Br
                      });
                    }
                  }
                  var aa = [];
                  if (aa.push(function() {
                    return we.drawLabels(Se, ae, {
                      vals: xr,
                      layer: _t,
                      plotinfo: pt,
                      transFn: dn,
                      labelFns: we.makeLabelFns(ae, tr)
                    });
                  }), ae.type === "multicategory") {
                    var ao = {
                      x: 2,
                      y: 10
                    }[Ft];
                    aa.push(function() {
                      var ji = {
                        x: "height",
                        y: "width"
                      }[Ft], Bi = Ur()[ji] + ao + (ae._tickAngles[St + "tick"] ? ae.tickfont.size * be : 0);
                      return we.drawLabels(Se, ae, {
                        vals: Xe(ae, xr),
                        layer: _t,
                        cls: St + "tick2",
                        repositionOnUpdate: !0,
                        secondary: !0,
                        transFn: Br,
                        labelFns: we.makeLabelFns(ae, tr + Bi * Wn[4])
                      });
                    }), aa.push(function() {
                      return ae._depth = Wn[4] * (Ur("tick2")[ae.side] - tr), ut(Se, ae, {
                        vals: Fi,
                        layer: _t,
                        path: we.makeTickPath(ae, tr, Wn[4], {
                          len: ae._depth
                        }),
                        transFn: Br
                      });
                    });
                  } else ae.title.hasOwnProperty("standoff") && aa.push(function() {
                    ae._depth = Wn[4] * (Ur()[ae.side] - tr);
                  });
                  var _o = p.getComponentMethod("rangeslider", "isVisible")(ae);
                  return !ft.skipTitle && !(_o && ae.side === "bottom") && aa.push(function() {
                    return rr(Se, ae);
                  }), aa.push(function() {
                    var ji = ae.side.charAt(0), Bi = Me[ae.side].charAt(0), ha = we.getPxPosition(Se, ae), pa = Dn ? ae.ticklen : 0, oi, Ii, Qa, vo;
                    (ae.automargin || _o || ae._shiftPusher) && (ae.type === "multicategory" ? oi = Ur("tick2") : (oi = Ur(), Ft === "x" && ji === "b" && (ae._depth = Math.max(oi.width > 0 ? oi.bottom - ha : 0, pa))));
                    var oo = 0, tl = 0;
                    if (ae._shiftPusher && (oo = Math.max(pa, oi.height > 0 ? ji === "l" ? ha - oi.left : oi.right - ha : 0), ae.title.text !== dt._dfltTitle[Ft] && (tl = (ae._titleStandoff || 0) + (ae._titleScoot || 0), ji === "l" && (tl += Pt(ae))), ae._fullDepth = Math.max(oo, tl)), ae.automargin) {
                      Ii = {
                        x: 0,
                        y: 0,
                        r: 0,
                        l: 0,
                        t: 0,
                        b: 0
                      };
                      var so = [0, 1], rl = typeof ae._shift == "number" ? ae._shift : 0;
                      if (Ft === "x") {
                        if (ji === "b" ? Ii[ji] = ae._depth : (Ii[ji] = ae._depth = Math.max(oi.width > 0 ? ha - oi.top : 0, pa), so.reverse()), oi.width > 0) {
                          var Oa = oi.right - (ae._offset + ae._length);
                          Oa > 0 && (Ii.xr = 1, Ii.r = Oa);
                          var qa = ae._offset - oi.left;
                          qa > 0 && (Ii.xl = 0, Ii.l = qa);
                        }
                      } else if (ji === "l" ? (ae._depth = Math.max(oi.height > 0 ? ha - oi.left : 0, pa), Ii[ji] = ae._depth - rl) : (ae._depth = Math.max(oi.height > 0 ? oi.right - ha : 0, pa), Ii[ji] = ae._depth + rl, so.reverse()), oi.height > 0) {
                        var oa = oi.bottom - (ae._offset + ae._length);
                        oa > 0 && (Ii.yb = 0, Ii.b = oa);
                        var eo = ae._offset - oi.top;
                        eo > 0 && (Ii.yt = 1, Ii.t = eo);
                      }
                      Ii[Gt] = ae.anchor === "free" ? ae.position : ae._anchorAxis.domain[so[0]], ae.title.text !== dt._dfltTitle[Ft] && (Ii[ji] += Pt(ae) + (ae.title.standoff || 0)), ae.mirror && ae.anchor !== "free" && (Qa = {
                        x: 0,
                        y: 0,
                        r: 0,
                        l: 0,
                        t: 0,
                        b: 0
                      }, Qa[Bi] = ae.linewidth, ae.mirror && ae.mirror !== !0 && (Qa[Bi] += pa), ae.mirror === !0 || ae.mirror === "ticks" ? Qa[Gt] = ae._anchorAxis.domain[so[1]] : (ae.mirror === "all" || ae.mirror === "allticks") && (Qa[Gt] = [ae._counterDomainMin, ae._counterDomainMax][so[1]]));
                    }
                    _o && (vo = p.getComponentMethod("rangeslider", "autoMarginOpts")(Se, ae)), typeof ae.automargin == "string" && (Oe(Ii, ae.automargin), Oe(Qa, ae.automargin)), f.autoMargin(Se, ir(ae), Ii), f.autoMargin(Se, Lr(ae), Qa), f.autoMargin(Se, yr(ae), vo);
                  }), g.syncOrAsync(aa);
                }
              };
              function Oe(Se, ae) {
                if (Se) {
                  var ft = Object.keys(se).reduce(function(rt, gt) {
                    return ae.indexOf(gt) !== -1 && se[gt].forEach(function(wt) {
                      rt[wt] = 1;
                    }), rt;
                  }, {});
                  Object.keys(Se).forEach(function(rt) {
                    ft[rt] || (rt.length === 1 ? Se[rt] = 0 : delete Se[rt]);
                  });
                }
              }
              function je(Se, ae) {
                var ft = [], rt, gt = function(wt, Ct) {
                  var pt = wt.xbnd[Ct];
                  pt !== null && ft.push(g.extendFlat({}, wt, {
                    x: pt
                  }));
                };
                if (ae.length) {
                  for (rt = 0; rt < ae.length; rt++)
                    gt(ae[rt], 0);
                  gt(ae[rt - 1], 1);
                }
                return ft;
              }
              function Xe(Se, ae) {
                for (var ft = [], rt = {}, gt = 0; gt < ae.length; gt++) {
                  var wt = ae[gt];
                  rt[wt.text2] ? rt[wt.text2].push(wt.x) : rt[wt.text2] = [wt.x];
                }
                for (var Ct in rt)
                  ft.push(Wt(Se, g.interp(rt[Ct], 0.5), Ct));
                return ft;
              }
              function nt(Se, ae) {
                var ft = [], rt, gt, wt = ae.length && ae[ae.length - 1].x < ae[0].x, Ct = function(dt, St) {
                  var Ft = dt.xbnd[St];
                  Ft !== null && ft.push(g.extendFlat({}, dt, {
                    x: Ft
                  }));
                };
                if (Se.showdividers && ae.length) {
                  for (rt = 0; rt < ae.length; rt++) {
                    var pt = ae[rt];
                    pt.text2 !== gt && Ct(pt, wt ? 1 : 0), gt = pt.text2;
                  }
                  Ct(ae[rt - 1], wt ? 0 : 1);
                }
                return ft;
              }
              function it(Se, ae, ft) {
                var rt, gt, wt, Ct;
                if (Se._selections[ae].size())
                  rt = 1 / 0, gt = -1 / 0, wt = 1 / 0, Ct = -1 / 0, Se._selections[ae].each(function() {
                    var dt = Pr(this), St = w.bBox(dt.node().parentNode);
                    rt = Math.min(rt, St.top), gt = Math.max(gt, St.bottom), wt = Math.min(wt, St.left), Ct = Math.max(Ct, St.right);
                  });
                else {
                  var pt = we.makeLabelFns(Se, ft);
                  rt = gt = pt.yFn({
                    dx: 0,
                    dy: 0,
                    fontSize: 0
                  }), wt = Ct = pt.xFn({
                    dx: 0,
                    dy: 0,
                    fontSize: 0
                  });
                }
                return {
                  top: rt,
                  bottom: gt,
                  left: wt,
                  right: Ct,
                  height: gt - rt,
                  width: Ct - wt
                };
              }
              we.getTickSigns = function(Se, ae) {
                var ft = Se._id.charAt(0), rt = {
                  x: "top",
                  y: "right"
                }[ft], gt = Se.side === rt ? 1 : -1, wt = [-1, 1, gt, -gt], Ct = ae ? (Se.minor || {}).ticks : Se.ticks;
                return Ct !== "inside" == (ft === "x") && (wt = wt.map(function(pt) {
                  return -pt;
                })), Se.side && wt.push({
                  l: -1,
                  t: -1,
                  r: 1,
                  b: 1
                }[Se.side.charAt(0)]), wt;
              }, we.makeTransTickFn = function(Se) {
                return Se._id.charAt(0) === "x" ? function(ae) {
                  return y(Se._offset + Se.l2p(ae.x), 0);
                } : function(ae) {
                  return y(0, Se._offset + Se.l2p(ae.x));
                };
              }, we.makeTransTickLabelFn = function(Se) {
                var ae = At(Se), ft = ae[0], rt = ae[1];
                return Se._id.charAt(0) === "x" ? function(gt) {
                  return y(ft + Se._offset + Se.l2p(Nt(gt)), rt);
                } : function(gt) {
                  return y(rt, ft + Se._offset + Se.l2p(Nt(gt)));
                };
              };
              function Nt(Se) {
                return Se.periodX !== void 0 ? Se.periodX : Se.x;
              }
              function At(Se) {
                var ae = Se.ticklabelposition || "", ft = function($t) {
                  return ae.indexOf($t) !== -1;
                }, rt = ft("top"), gt = ft("left"), wt = ft("right"), Ct = ft("bottom"), pt = ft("inside"), dt = Ct || gt || rt || wt;
                if (!dt && !pt) return [0, 0];
                var St = Se.side, Ft = dt ? (Se.tickwidth || 0) / 2 : 0, Gt = Ge, Lt = Se.tickfont ? Se.tickfont.size : 12;
                return (Ct || rt) && (Ft += Lt * ve, Gt += (Se.linewidth || 0) / 2), (gt || wt) && (Ft += (Se.linewidth || 0) / 2, Gt += Ge), pt && St === "top" && (Gt -= Lt * (1 - ve)), (gt || rt) && (Ft = -Ft), (St === "bottom" || St === "right") && (Gt = -Gt), [dt ? Ft : 0, pt ? Gt : 0];
              }
              we.makeTickPath = function(Se, ae, ft, rt) {
                rt || (rt = {});
                var gt = rt.minor;
                if (gt && !Se.minor) return "";
                var wt = rt.len !== void 0 ? rt.len : gt ? Se.minor.ticklen : Se.ticklen, Ct = Se._id.charAt(0), pt = (Se.linewidth || 1) / 2;
                return Ct === "x" ? "M0," + (ae + pt * ft) + "v" + wt * ft : "M" + (ae + pt * ft) + ",0h" + wt * ft;
              }, we.makeLabelFns = function(Se, ae, ft) {
                var rt = Se.ticklabelposition || "", gt = function(on) {
                  return rt.indexOf(on) !== -1;
                }, wt = gt("top"), Ct = gt("left"), pt = gt("right"), dt = gt("bottom"), St = dt || Ct || wt || pt, Ft = gt("inside"), Gt = rt === "inside" && Se.ticks === "inside" || !Ft && Se.ticks === "outside" && Se.tickson !== "boundaries", Lt = 0, $t = 0, _t = Gt ? Se.ticklen : 0;
                if (Ft ? _t *= -1 : St && (_t = 0), Gt && (Lt += _t, ft)) {
                  var zt = g.deg2rad(ft);
                  Lt = _t * Math.cos(zt) + 1, $t = _t * Math.sin(zt);
                }
                Se.showticklabels && (Gt || Se.showline) && (Lt += 0.2 * Se.tickfont.size), Lt += (Se.linewidth || 1) / 2 * (Ft ? -1 : 1);
                var tr = {
                  labelStandoff: Lt,
                  labelShift: $t
                }, nr, xr, Er, Jr, Ur = 0, Br = Se.side, dn = Se._id.charAt(0), nn = Se.tickangle, Sn;
                if (dn === "x")
                  Sn = !Ft && Br === "bottom" || Ft && Br === "top", Jr = Sn ? 1 : -1, Ft && (Jr *= -1), nr = $t * Jr, xr = ae + Lt * Jr, Er = Sn ? 1 : -0.2, Math.abs(nn) === 90 && (Ft ? Er += ue : nn === -90 && Br === "bottom" ? Er = ve : nn === 90 && Br === "top" ? Er = ue : Er = 0.5, Ur = ue / 2 * (nn / 90)), tr.xFn = function(on) {
                    return on.dx + nr + Ur * on.fontSize;
                  }, tr.yFn = function(on) {
                    return on.dy + xr + on.fontSize * Er;
                  }, tr.anchorFn = function(on, ri) {
                    if (St) {
                      if (Ct) return "end";
                      if (pt) return "start";
                    }
                    return !v(ri) || ri === 0 || ri === 180 ? "middle" : ri * Jr < 0 !== Ft ? "end" : "start";
                  }, tr.heightFn = function(on, ri, Fi) {
                    return ri < -60 || ri > 60 ? -0.5 * Fi : Se.side === "top" !== Ft ? -Fi : 0;
                  };
                else if (dn === "y") {
                  if (Sn = !Ft && Br === "left" || Ft && Br === "right", Jr = Sn ? 1 : -1, Ft && (Jr *= -1), nr = Lt, xr = $t * Jr, Er = 0, !Ft && Math.abs(nn) === 90 && (nn === -90 && Br === "left" || nn === 90 && Br === "right" ? Er = ve : Er = 0.5), Ft) {
                    var ai = v(nn) ? +nn : 0;
                    if (ai !== 0) {
                      var Dn = g.deg2rad(ai);
                      Ur = Math.abs(Math.sin(Dn)) * ve * Jr, Er = 0;
                    }
                  }
                  tr.xFn = function(on) {
                    return on.dx + ae - (nr + on.fontSize * Er) * Jr + Ur * on.fontSize;
                  }, tr.yFn = function(on) {
                    return on.dy + xr + on.fontSize * ue;
                  }, tr.anchorFn = function(on, ri) {
                    return v(ri) && Math.abs(ri) === 90 ? "middle" : Sn ? "end" : "start";
                  }, tr.heightFn = function(on, ri, Fi) {
                    return Se.side === "right" && (ri *= -1), ri < -30 ? -Fi : ri < 30 ? -0.5 * Fi : 0;
                  };
                }
                return tr;
              };
              function vt(Se) {
                return [Se.text, Se.x, Se.axInfo, Se.font, Se.fontSize, Se.fontColor].join("_");
              }
              we.drawTicks = function(Se, ae, ft) {
                ft = ft || {};
                var rt = ae._id + "tick", gt = [].concat(ae.minor && ae.minor.ticks ? (
                  // minor vals
                  ft.vals.filter(function(Ct) {
                    return Ct.minor && !Ct.noTick;
                  })
                ) : []).concat(ae.ticks ? (
                  // major vals
                  ft.vals.filter(function(Ct) {
                    return !Ct.minor && !Ct.noTick;
                  })
                ) : []), wt = ft.layer.selectAll("path." + rt).data(gt, vt);
                wt.exit().remove(), wt.enter().append("path").classed(rt, 1).classed("ticks", 1).classed("crisp", ft.crisp !== !1).each(function(Ct) {
                  return h.stroke(l.select(this), Ct.minor ? ae.minor.tickcolor : ae.tickcolor);
                }).style("stroke-width", function(Ct) {
                  return w.crispRound(Se, Ct.minor ? ae.minor.tickwidth : ae.tickwidth, 1) + "px";
                }).attr("d", ft.path).style("display", null), rn(ae, [U]), wt.attr("transform", ft.transFn);
              }, we.drawGrid = function(Se, ae, ft) {
                if (ft = ft || {}, ae.tickmode !== "sync") {
                  var rt = ae._id + "grid", gt = ae.minor && ae.minor.showgrid, wt = gt ? ft.vals.filter(function(nr) {
                    return nr.minor;
                  }) : [], Ct = ae.showgrid ? ft.vals.filter(function(nr) {
                    return !nr.minor;
                  }) : [], pt = ft.counterAxis;
                  if (pt && we.shouldShowZeroLine(Se, ae, pt))
                    for (var dt = ae.tickmode === "array", St = 0; St < Ct.length; St++) {
                      var Ft = Ct[St].x;
                      if (dt ? !Ft : Math.abs(Ft) < ae.dtick / 100)
                        if (Ct = Ct.slice(0, St).concat(Ct.slice(St + 1)), dt) St--;
                        else break;
                    }
                  ae._gw = w.crispRound(Se, ae.gridwidth, 1);
                  for (var Gt = gt ? w.crispRound(Se, ae.minor.gridwidth, 1) : 0, Lt = ft.layer, $t = ft.minorLayer, _t = 1; _t >= 0; _t--) {
                    var zt = _t ? Lt : $t;
                    if (zt) {
                      var tr = zt.selectAll("path." + rt).data(_t ? Ct : wt, vt);
                      tr.exit().remove(), tr.enter().append("path").classed(rt, 1).classed("crisp", ft.crisp !== !1), tr.attr("transform", ft.transFn).attr("d", ft.path).each(function(nr) {
                        return h.stroke(l.select(this), nr.minor ? ae.minor.gridcolor : ae.gridcolor || "#ddd");
                      }).style("stroke-dasharray", function(nr) {
                        return w.dashStyle(nr.minor ? ae.minor.griddash : ae.griddash, nr.minor ? ae.minor.gridwidth : ae.gridwidth);
                      }).style("stroke-width", function(nr) {
                        return (nr.minor ? Gt : ae._gw) + "px";
                      }).style("display", null), typeof ft.path == "function" && tr.attr("d", ft.path);
                    }
                  }
                  rn(ae, [ce, X]);
                }
              }, we.drawZeroLine = function(Se, ae, ft) {
                ft = ft || ft;
                var rt = ae._id + "zl", gt = we.shouldShowZeroLine(Se, ae, ft.counterAxis), wt = ft.layer.selectAll("path." + rt).data(gt ? [{
                  x: 0,
                  id: ae._id
                }] : []);
                wt.exit().remove(), wt.enter().append("path").classed(rt, 1).classed("zl", 1).classed("crisp", ft.crisp !== !1).each(function() {
                  ft.layer.selectAll("path").sort(function(Ct, pt) {
                    return K(Ct.id, pt.id);
                  });
                }), wt.attr("transform", ft.transFn).attr("d", ft.path).call(h.stroke, ae.zerolinecolor || h.defaultLine).style("stroke-width", w.crispRound(Se, ae.zerolinewidth, ae._gw || 1) + "px").style("display", null), rn(ae, [ie]);
              }, we.drawLabels = function(Se, ae, ft) {
                ft = ft || {};
                var rt = Se._fullLayout, gt = ae._id, wt = ft.cls || gt + "tick", Ct = ft.vals.filter(function(yn) {
                  return yn.text;
                }), pt = ft.labelFns, dt = ft.secondary ? 0 : ae.tickangle, St = (ae._prevTickAngles || {})[wt], Ft = ft.layer.selectAll("g." + wt).data(ae.showticklabels ? Ct : [], vt), Gt = [];
                Ft.enter().append("g").classed(wt, 1).append("text").attr("text-anchor", "middle").each(function(yn) {
                  var Pn = l.select(this), kn = Se._promises.length;
                  Pn.call(C.positionText, pt.xFn(yn), pt.yFn(yn)).call(w.font, {
                    family: yn.font,
                    size: yn.fontSize,
                    color: yn.fontColor,
                    weight: yn.fontWeight,
                    style: yn.fontStyle,
                    variant: yn.fontVariant,
                    textcase: yn.fontTextcase,
                    lineposition: yn.fontLineposition,
                    shadow: yn.fontShadow
                  }).text(yn.text).call(C.convertToTspans, Se), Se._promises[kn] ? Gt.push(Se._promises.pop().then(function() {
                    Lt(Pn, dt);
                  })) : Lt(Pn, dt);
                }), rn(ae, [ne]), Ft.exit().remove(), ft.repositionOnUpdate && Ft.each(function(yn) {
                  l.select(this).select("text").call(C.positionText, pt.xFn(yn), pt.yFn(yn));
                });
                function Lt(yn, Pn) {
                  yn.each(function(kn) {
                    var Wn = l.select(this), Ln = Wn.select(".text-math-group"), li = pt.anchorFn(kn, Pn), Bn = ft.transFn.call(Wn.node(), kn) + (v(Pn) && +Pn != 0 ? " rotate(" + Pn + "," + pt.xFn(kn) + "," + (pt.yFn(kn) - kn.fontSize / 2) + ")" : ""), ci = C.lineCount(Wn), Gi = be * kn.fontSize, pi = pt.heightFn(kn, v(Pn) ? +Pn : 0, (ci - 1) * Gi);
                    if (pi && (Bn += y(0, pi)), Ln.empty()) {
                      var ei = Wn.select("text");
                      ei.attr({
                        transform: Bn,
                        "text-anchor": li
                      }), ei.style("opacity", 1), ae._adjustTickLabelsOverflow && ae._adjustTickLabelsOverflow();
                    } else {
                      var fa = w.bBox(Ln.node()).width, Hi = fa * {
                        end: -0.5,
                        start: 0.5
                      }[li];
                      Ln.attr("transform", Bn + y(Hi, 0));
                    }
                  });
                }
                ae._adjustTickLabelsOverflow = function() {
                  var yn = ae.ticklabeloverflow;
                  if (!(!yn || yn === "allow")) {
                    var Pn = yn.indexOf("hide") !== -1, kn = ae._id.charAt(0) === "x", Wn = 0, Ln = kn ? Se._fullLayout.width : Se._fullLayout.height;
                    if (yn.indexOf("domain") !== -1) {
                      var li = g.simpleMap(ae.range, ae.r2l);
                      Wn = ae.l2p(li[0]) + ae._offset, Ln = ae.l2p(li[1]) + ae._offset;
                    }
                    var Bn = Math.min(Wn, Ln), ci = Math.max(Wn, Ln), Gi = ae.side, pi = 1 / 0, ei = -1 / 0;
                    Ft.each(function(Ui) {
                      var la = l.select(this), za = la.select(".text-math-group");
                      if (za.empty()) {
                        var ia = w.bBox(la.node()), aa = 0;
                        kn ? (ia.right > ci || ia.left < Bn) && (aa = 1) : (ia.bottom > ci || ia.top + (ae.tickangle ? 0 : Ui.fontSize / 4) < Bn) && (aa = 1);
                        var ao = la.select("text");
                        aa ? Pn && ao.style("opacity", 0) : (ao.style("opacity", 1), Gi === "bottom" || Gi === "right" ? pi = Math.min(pi, kn ? ia.top : ia.left) : pi = -1 / 0, Gi === "top" || Gi === "left" ? ei = Math.max(ei, kn ? ia.bottom : ia.right) : ei = 1 / 0);
                      }
                    });
                    for (var fa in rt._plots) {
                      var Hi = rt._plots[fa];
                      if (!(ae._id !== Hi.xaxis._id && ae._id !== Hi.yaxis._id)) {
                        var Ti = kn ? Hi.yaxis : Hi.xaxis;
                        Ti && (Ti["_visibleLabelMin_" + ae._id] = pi, Ti["_visibleLabelMax_" + ae._id] = ei);
                      }
                    }
                  }
                }, ae._hideCounterAxisInsideTickLabels = function(yn) {
                  var Pn = ae._id.charAt(0) === "x", kn = [];
                  for (var Wn in rt._plots) {
                    var Ln = rt._plots[Wn];
                    ae._id !== Ln.xaxis._id && ae._id !== Ln.yaxis._id || kn.push(Pn ? Ln.yaxis : Ln.xaxis);
                  }
                  kn.forEach(function(li, Bn) {
                    li && Gr(li) && (yn || [ie, X, ce, U, ne]).forEach(function(ci) {
                      var Gi = ci.K === "tick" && ci.L === "text" && ae.ticklabelmode === "period", pi = rt._plots[ae._mainSubplot], ei;
                      ci.K === ie.K ? ei = pi.zerolinelayer.selectAll("." + ae._id + "zl") : ci.K === X.K ? ei = pi.minorGridlayer.selectAll("." + ae._id) : ci.K === ce.K ? ei = pi.gridlayer.selectAll("." + ae._id) : ei = pi[ae._id.charAt(0) + "axislayer"], ei.each(function() {
                        var fa = l.select(this);
                        ci.L && (fa = fa.selectAll(ci.L)), fa.each(function(Hi) {
                          var Ti = ae.l2p(Gi ? Nt(Hi) : Hi.x) + ae._offset, Ui = l.select(this);
                          Ti < ae["_visibleLabelMax_" + li._id] && Ti > ae["_visibleLabelMin_" + li._id] ? Ui.style("display", "none") : ci.K === "tick" && !Bn && Ui.style("display", null);
                        });
                      });
                    });
                  });
                }, Lt(Ft, St + 1 ? St : dt);
                function $t() {
                  return Gt.length && Promise.all(Gt);
                }
                var _t = null;
                function zt() {
                  if (Lt(Ft, dt), Ct.length && ae.autotickangles && (ae.type !== "log" || String(ae.dtick).charAt(0) !== "D")) {
                    _t = ae.autotickangles[0];
                    var yn = 0, Pn = [], kn, Wn = 1;
                    Ft.each(function(oi) {
                      yn = Math.max(yn, oi.fontSize);
                      var Ii = ae.l2p(oi.x), Qa = Pr(this), vo = w.bBox(Qa.node());
                      Wn = Math.max(Wn, C.lineCount(Qa)), Pn.push({
                        // ignore about y, just deal with x overlaps
                        top: 0,
                        bottom: 10,
                        height: 10,
                        left: Ii - vo.width / 2,
                        // impose a 2px gap
                        right: Ii + vo.width / 2 + 2,
                        width: vo.width + 2
                      });
                    });
                    var Ln = (ae.tickson === "boundaries" || ae.showdividers) && !ft.secondary, li = Ct.length, Bn = Math.abs((Ct[li - 1].x - Ct[0].x) * ae._m) / (li - 1), ci = Ln ? Bn / 2 : Bn, Gi = Ln ? ae.ticklen : yn * 1.25 * Wn, pi = Math.sqrt(Math.pow(ci, 2) + Math.pow(Gi, 2)), ei = ci / pi, fa = ae.autotickangles.map(function(oi) {
                      return oi * Math.PI / 180;
                    }), Hi = fa.find(function(oi) {
                      return Math.abs(Math.cos(oi)) <= ei;
                    });
                    Hi === void 0 && (Hi = fa.reduce(function(oi, Ii) {
                      return Math.abs(Math.cos(oi)) < Math.abs(Math.cos(Ii)) ? oi : Ii;
                    }, fa[0]));
                    var Ti = Hi * (180 / Math.PI);
                    if (Ln) {
                      var Ui = 2;
                      for (ae.ticks && (Ui += ae.tickwidth / 2), kn = 0; kn < Pn.length; kn++) {
                        var la = Ct[kn].xbnd, za = Pn[kn];
                        if (la[0] !== null && za.left - ae.l2p(la[0]) < Ui || la[1] !== null && ae.l2p(la[1]) - za.right < Ui) {
                          _t = Ti;
                          break;
                        }
                      }
                    } else {
                      var ia = ae.ticklabelposition || "", aa = function(oi) {
                        return ia.indexOf(oi) !== -1;
                      }, ao = aa("top"), _o = aa("left"), ji = aa("right"), Bi = aa("bottom"), ha = Bi || _o || ao || ji, pa = ha ? (ae.tickwidth || 0) + 2 * Ge : 0;
                      for (kn = 0; kn < Pn.length - 1; kn++)
                        if (g.bBoxIntersect(Pn[kn], Pn[kn + 1], pa)) {
                          _t = Ti;
                          break;
                        }
                    }
                    _t && Lt(Ft, _t);
                  }
                }
                ae._selections && (ae._selections[wt] = Ft);
                var tr = [$t];
                ae.automargin && rt._redrawFromAutoMarginCount && St === 90 ? (_t = St, tr.push(function() {
                  Lt(Ft, St);
                })) : tr.push(zt), ae._tickAngles && tr.push(function() {
                  ae._tickAngles[wt] = _t === null ? v(dt) ? dt : 0 : _t;
                });
                var nr = function() {
                  var yn = 0, Pn = 0;
                  return Ft.each(function(kn, Wn) {
                    var Ln = Pr(this), li = Ln.select(".text-math-group");
                    if (li.empty()) {
                      var Bn;
                      ae._vals[Wn] && (Bn = ae._vals[Wn].bb || w.bBox(Ln.node()), ae._vals[Wn].bb = Bn), yn = Math.max(yn, Bn.width), Pn = Math.max(Pn, Bn.height);
                    }
                  }), {
                    labelsMaxW: yn,
                    labelsMaxH: Pn
                  };
                }, xr = ae._anchorAxis;
                if (xr && (xr.autorange || xr.insiderange) && Gr(ae) && !ee(rt, ae._id) && (rt._insideTickLabelsUpdaterange || (rt._insideTickLabelsUpdaterange = {}), xr.autorange && (rt._insideTickLabelsUpdaterange[xr._name + ".autorange"] = xr.autorange, tr.push(nr)), xr.insiderange)) {
                  var Er = nr(), Jr = ae._id.charAt(0) === "y" ? Er.labelsMaxW : Er.labelsMaxH;
                  Jr += 2 * Ge, ae.ticklabelposition === "inside" && (Jr += ae.ticklen || 0);
                  var Ur = ae.side === "right" || ae.side === "top" ? 1 : -1, Br = Ur === 1 ? 1 : 0, dn = Ur === 1 ? 0 : 1, nn = [];
                  nn[dn] = xr.range[dn];
                  var Sn = xr.range, ai = xr.r2p(Sn[Br]), Dn = xr.r2p(Sn[dn]), on = rt._insideTickLabelsUpdaterange[xr._name + ".range"];
                  if (on) {
                    var ri = xr.r2p(on[Br]), Fi = xr.r2p(on[dn]), Pi = Ur * (ae._id.charAt(0) === "y" ? 1 : -1);
                    Pi * ai < Pi * ri && (ai = ri, nn[Br] = Sn[Br] = on[Br]), Pi * Dn > Pi * Fi && (Dn = Fi, nn[dn] = Sn[dn] = on[dn]);
                  }
                  var pn = Math.abs(Dn - ai);
                  pn - Jr > 0 ? (pn -= Jr, Jr *= 1 + Jr / pn) : Jr = 0, ae._id.charAt(0) !== "y" && (Jr = -Jr), nn[Br] = xr.p2r(xr.r2p(Sn[Br]) + Ur * Jr), xr.autorange === "min" || xr.autorange === "max reversed" ? (nn[0] = null, xr._rangeInitial0 = void 0, xr._rangeInitial1 = void 0) : (xr.autorange === "max" || xr.autorange === "min reversed") && (nn[1] = null, xr._rangeInitial0 = void 0, xr._rangeInitial1 = void 0), rt._insideTickLabelsUpdaterange[xr._name + ".range"] = nn;
                }
                var hi = g.syncOrAsync(tr);
                return hi && hi.then && Se._promises.push(hi), hi;
              };
              function ut(Se, ae, ft) {
                var rt = ae._id + "divider", gt = ft.vals, wt = ft.layer.selectAll("path." + rt).data(gt, vt);
                wt.exit().remove(), wt.enter().insert("path", ":first-child").classed(rt, 1).classed("crisp", 1).call(h.stroke, ae.dividercolor).style("stroke-width", w.crispRound(Se, ae.dividerwidth, 1) + "px"), wt.attr("transform", ft.transFn).attr("d", ft.path);
              }
              we.getPxPosition = function(Se, ae) {
                var ft = Se._fullLayout._size, rt = ae._id.charAt(0), gt = ae.side, wt;
                if (ae.anchor !== "free" ? wt = ae._anchorAxis : rt === "x" ? wt = {
                  _offset: ft.t + (1 - (ae.position || 0)) * ft.h,
                  _length: 0
                } : rt === "y" && (wt = {
                  _offset: ft.l + (ae.position || 0) * ft.w + ae._shift,
                  _length: 0
                }), gt === "top" || gt === "left")
                  return wt._offset;
                if (gt === "bottom" || gt === "right")
                  return wt._offset + wt._length;
              };
              function Pt(Se) {
                var ae = Se.title.font.size, ft = (Se.title.text.match(C.BR_TAG_ALL) || []).length;
                return Se.title.hasOwnProperty("standoff") ? ae * (ve + ft * be) : ft ? ae * (ft + 1) * be : ae;
              }
              function rr(Se, ae) {
                var ft = Se._fullLayout, rt = ae._id, gt = rt.charAt(0), wt = ae.title.font.size, Ct, pt = (ae.title.text.match(C.BR_TAG_ALL) || []).length;
                if (ae.title.hasOwnProperty("standoff"))
                  ae.side === "bottom" || ae.side === "right" ? Ct = ae._depth + ae.title.standoff + wt * ve : (ae.side === "top" || ae.side === "left") && (Ct = ae._depth + ae.title.standoff + wt * (ue + pt * be));
                else {
                  var dt = Gr(ae);
                  if (ae.type === "multicategory")
                    Ct = ae._depth;
                  else {
                    var St = 1.5 * wt;
                    dt && (St = 0.5 * wt, ae.ticks === "outside" && (St += ae.ticklen)), Ct = 10 + St + (ae.linewidth ? ae.linewidth - 1 : 0);
                  }
                  dt || (gt === "x" ? Ct += ae.side === "top" ? wt * (ae.showticklabels ? 1 : 0) : wt * (ae.showticklabels ? 1.5 : 0.5) : Ct += ae.side === "right" ? wt * (ae.showticklabels ? 1 : 0.5) : wt * (ae.showticklabels ? 0.5 : 0));
                }
                var Ft = we.getPxPosition(Se, ae), Gt, Lt, $t;
                gt === "x" ? (Lt = ae._offset + ae._length / 2, $t = ae.side === "top" ? Ft - Ct : Ft + Ct) : ($t = ae._offset + ae._length / 2, Lt = ae.side === "right" ? Ft + Ct : Ft - Ct, Gt = {
                  rotate: "-90",
                  offset: 0
                });
                var _t;
                if (ae.type !== "multicategory") {
                  var zt = ae._selections[ae._id + "tick"];
                  if (_t = {
                    selection: zt,
                    side: ae.side
                  }, zt && zt.node() && zt.node().parentNode) {
                    var tr = w.getTranslate(zt.node().parentNode);
                    _t.offsetLeft = tr.x, _t.offsetTop = tr.y;
                  }
                  ae.title.hasOwnProperty("standoff") && (_t.pad = 0);
                }
                return ae._titleStandoff = Ct, m.draw(Se, rt + "title", {
                  propContainer: ae,
                  propName: ae._name + ".title.text",
                  placeholder: ft._dfltTitle[gt],
                  avoid: _t,
                  transform: Gt,
                  attributes: {
                    x: Lt,
                    y: $t,
                    "text-anchor": "middle"
                  }
                });
              }
              we.shouldShowZeroLine = function(Se, ae, ft) {
                var rt = g.simpleMap(ae.range, ae.r2l);
                return rt[0] * rt[1] <= 0 && ae.zeroline && (ae.type === "linear" || ae.type === "-") && !(ae.rangebreaks && ae.maskBreaks(0) === q) && (lr(ae, 0) || !Mr(Se, ae, ft, rt) || Rr(Se, ae));
              }, we.clipEnds = function(Se, ae) {
                return ae.filter(function(ft) {
                  return lr(Se, ft.x);
                });
              };
              function lr(Se, ae) {
                var ft = Se.l2p(ae);
                return ft > 1 && ft < Se._length - 1;
              }
              function Mr(Se, ae, ft, rt) {
                var gt = ft._mainAxis;
                if (!gt) return;
                var wt = Se._fullLayout, Ct = ae._id.charAt(0), pt = we.counterLetter(ae._id), dt = ae._offset + (Math.abs(rt[0]) < Math.abs(rt[1]) == (Ct === "x") ? 0 : ae._length);
                function St(_t) {
                  if (!_t.showline || !_t.linewidth) return !1;
                  var zt = Math.max((_t.linewidth + ae.zerolinewidth) / 2, 1);
                  function tr(Er) {
                    return typeof Er == "number" && Math.abs(Er - dt) < zt;
                  }
                  if (tr(_t._mainLinePosition) || tr(_t._mainMirrorPosition))
                    return !0;
                  var nr = _t._linepositions || {};
                  for (var xr in nr)
                    if (tr(nr[xr][0]) || tr(nr[xr][1]))
                      return !0;
                }
                var Ft = wt._plots[ft._mainSubplot];
                if (!(Ft.mainplotinfo || Ft).overlays.length)
                  return St(ft);
                for (var Gt = we.list(Se, pt), Lt = 0; Lt < Gt.length; Lt++) {
                  var $t = Gt[Lt];
                  if ($t._mainAxis === gt && St($t))
                    return !0;
                }
              }
              function Rr(Se, ae) {
                for (var ft = Se._fullData, rt = ae._mainSubplot, gt = ae._id.charAt(0), wt = 0; wt < ft.length; wt++) {
                  var Ct = ft[wt];
                  if (Ct.visible === !0 && Ct.xaxis + Ct.yaxis === rt && (p.traceIs(Ct, "bar-like") && Ct.orientation === {
                    x: "h",
                    y: "v"
                  }[gt] || Ct.fill && Ct.fill.charAt(Ct.fill.length - 1) === gt))
                    return !0;
                }
                return !1;
              }
              function Pr(Se) {
                var ae = l.select(Se), ft = ae.select(".text-math-group");
                return ft.empty() ? ae.select("text") : ft;
              }
              we.allowAutoMargin = function(Se) {
                for (var ae = we.list(Se, "", !0), ft = 0; ft < ae.length; ft++) {
                  var rt = ae[ft];
                  rt.automargin && (f.allowAutoMargin(Se, ir(rt)), rt.mirror && f.allowAutoMargin(Se, Lr(rt))), p.getComponentMethod("rangeslider", "isVisible")(rt) && f.allowAutoMargin(Se, yr(rt));
                }
              };
              function ir(Se) {
                return Se._id + ".automargin";
              }
              function Lr(Se) {
                return ir(Se) + ".mirror";
              }
              function yr(Se) {
                return Se._id + ".rangeslider";
              }
              we.swap = function(Se, ae) {
                for (var ft = Sr(Se, ae), rt = 0; rt < ft.length; rt++)
                  Ar(Se, ft[rt].x, ft[rt].y);
              };
              function Sr(Se, ae) {
                var ft = [], rt, gt;
                for (rt = 0; rt < ae.length; rt++) {
                  var wt = [], Ct = Se._fullData[ae[rt]].xaxis, pt = Se._fullData[ae[rt]].yaxis;
                  if (!(!Ct || !pt)) {
                    for (gt = 0; gt < ft.length; gt++)
                      (ft[gt].x.indexOf(Ct) !== -1 || ft[gt].y.indexOf(pt) !== -1) && wt.push(gt);
                    if (!wt.length) {
                      ft.push({
                        x: [Ct],
                        y: [pt]
                      });
                      continue;
                    }
                    var dt = ft[wt[0]], St;
                    if (wt.length > 1)
                      for (gt = 1; gt < wt.length; gt++)
                        St = ft[wt[gt]], Yr(dt.x, St.x), Yr(dt.y, St.y);
                    Yr(dt.x, [Ct]), Yr(dt.y, [pt]);
                  }
                }
                return ft;
              }
              function Yr(Se, ae) {
                for (var ft = 0; ft < ae.length; ft++)
                  Se.indexOf(ae[ft]) === -1 && Se.push(ae[ft]);
              }
              function Ar(Se, ae, ft) {
                var rt = [], gt = [], wt = Se.layout, Ct, pt;
                for (Ct = 0; Ct < ae.length; Ct++) rt.push(we.getFromId(Se, ae[Ct]));
                for (Ct = 0; Ct < ft.length; Ct++) gt.push(we.getFromId(Se, ft[Ct]));
                var dt = Object.keys(S), St = ["anchor", "domain", "overlaying", "position", "side", "tickangle", "editType"], Ft = ["linear", "log"];
                for (Ct = 0; Ct < dt.length; Ct++) {
                  var Gt = dt[Ct], Lt = rt[0][Gt], $t = gt[0][Gt], _t = !0, zt = !1, tr = !1;
                  if (!(Gt.charAt(0) === "_" || typeof Lt == "function" || St.indexOf(Gt) !== -1)) {
                    for (pt = 1; pt < rt.length && _t; pt++) {
                      var nr = rt[pt][Gt];
                      Gt === "type" && Ft.indexOf(Lt) !== -1 && Ft.indexOf(nr) !== -1 && Lt !== nr ? zt = !0 : nr !== Lt && (_t = !1);
                    }
                    for (pt = 1; pt < gt.length && _t; pt++) {
                      var xr = gt[pt][Gt];
                      Gt === "type" && Ft.indexOf($t) !== -1 && Ft.indexOf(xr) !== -1 && $t !== xr ? tr = !0 : gt[pt][Gt] !== $t && (_t = !1);
                    }
                    _t && (zt && (wt[rt[0]._name].type = "linear"), tr && (wt[gt[0]._name].type = "linear"), pr(wt, Gt, rt, gt, Se._fullLayout._dfltTitle));
                  }
                }
                for (Ct = 0; Ct < Se._fullLayout.annotations.length; Ct++) {
                  var Er = Se._fullLayout.annotations[Ct];
                  ae.indexOf(Er.xref) !== -1 && ft.indexOf(Er.yref) !== -1 && g.swapAttrs(wt.annotations[Ct], ["?"]);
                }
              }
              function pr(Se, ae, ft, rt, gt) {
                var wt = g.nestedProperty, Ct = wt(Se[ft[0]._name], ae).get(), pt = wt(Se[rt[0]._name], ae).get(), dt;
                for (ae === "title" && (Ct && Ct.text === gt.x && (Ct.text = gt.y), pt && pt.text === gt.y && (pt.text = gt.x)), dt = 0; dt < ft.length; dt++)
                  wt(Se, ft[dt]._name + "." + ae).set(pt);
                for (dt = 0; dt < rt.length; dt++)
                  wt(Se, rt[dt]._name + "." + ae).set(Ct);
              }
              function kr(Se) {
                return Se._id === "angularaxis";
              }
              function br(Se, ae) {
                for (var ft = ae._rangebreaks.length, rt = 0; rt < ft; rt++) {
                  var gt = ae._rangebreaks[rt];
                  if (Se >= gt.min && Se < gt.max)
                    return gt.max;
                }
                return Se;
              }
              function Gr(Se) {
                return (Se.ticklabelposition || "").indexOf("inside") !== -1;
              }
              function rn(Se, ae) {
                Gr(Se._anchorAxis || {}) && Se._hideCounterAxisInsideTickLabels && Se._hideCounterAxisInsideTickLabels(ae);
              }
              function cn(Se, ae, ft, rt) {
                var gt = Se.anchor !== "free" && (Se.overlaying === void 0 || Se.overlaying === !1) ? Se._id : Se.overlaying, wt;
                rt ? wt = Se.side === "right" ? ae : -ae : wt = ae, gt in ft || (ft[gt] = {}), Se.side in ft[gt] || (ft[gt][Se.side] = 0), ft[gt][Se.side] += wt;
              }
              function Dr(Se, ae) {
                return Se.autoshift ? ae[Se.overlaying][Se.side] : Se.shift || 0;
              }
            }
          ),
          /***/
          2976: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = i(9032).BADNUM, p = v.isArrayOrTypedArray, g = v.isDateTime, y = v.cleanNumber, C = Math.round;
              s.exports = function(F, P, k) {
                var I = F, L = k.noMultiCategory;
                if (p(I) && !I.length) return "-";
                if (!L && x(I)) return "multicategory";
                if (L && Array.isArray(I[0])) {
                  for (var A = [], O = 0; O < I.length; O++)
                    if (p(I[O]))
                      for (var N = 0; N < I[O].length; N++)
                        A.push(I[O][N]);
                  I = A;
                }
                if (w(I, P)) return "date";
                var Y = k.autotypenumbers !== "strict";
                return E(I, Y) ? "category" : h(I, Y) ? "linear" : "-";
              };
              function m(T, F) {
                return F ? l(T) : typeof T == "number";
              }
              function h(T, F) {
                for (var P = T.length, k = 0; k < P; k++)
                  if (m(T[k], F)) return !0;
                return !1;
              }
              function w(T, F) {
                for (var P = T.length, k = S(P), I = 0, L = 0, A = {}, O = 0; O < P; O += k) {
                  var N = C(O), Y = T[N], j = String(Y);
                  A[j] || (A[j] = 1, g(Y, F) && I++, l(Y) && L++);
                }
                return I > L * 2;
              }
              function S(T) {
                return Math.max(1, (T - 1) / 1e3);
              }
              function E(T, F) {
                for (var P = T.length, k = S(P), I = 0, L = 0, A = {}, O = 0; O < P; O += k) {
                  var N = C(O), Y = T[N], j = String(Y);
                  if (!A[j]) {
                    A[j] = 1;
                    var te = typeof Y;
                    te === "boolean" ? L++ : (F ? y(Y) !== f : te === "number") ? I++ : te === "string" && L++;
                  }
                }
                return L > I * 2;
              }
              function x(T) {
                return p(T[0]) && p(T[1]);
              }
            }
          ),
          /***/
          5955: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(4040), f = i(3400), p = i(1780), g = i(1272), y = i(4724), C = i(6332), m = i(5404), h = i(5936), w = i(2568), S = i(4796), E = i(2136), x = i(6312), T = i(8344), F = i(3816).WEEKDAY_PATTERN, P = i(3816).HOUR_PATTERN;
              s.exports = function(O, N, Y, j, te) {
                var re = j.letter, z = j.font || {}, Z = j.splomStash || {}, W = Y("visible", !j.visibleDflt), q = N._template || {}, ie = N.type || q.type || "-", ce;
                if (ie === "date") {
                  var X = v.getComponentMethod("calendars", "handleDefaults");
                  X(O, N, "calendar", j.calendar), j.noTicklabelmode || (ce = Y("ticklabelmode"));
                }
                var U = "";
                (!j.noTicklabelposition || ie === "multicategory") && (U = f.coerce(O, N, {
                  ticklabelposition: {
                    valType: "enumerated",
                    dflt: "outside",
                    values: ce === "period" ? ["outside", "inside"] : re === "x" ? ["outside", "inside", "outside left", "inside left", "outside right", "inside right"] : ["outside", "inside", "outside top", "inside top", "outside bottom", "inside bottom"]
                  }
                }, "ticklabelposition")), j.noTicklabeloverflow || Y("ticklabeloverflow", U.indexOf("inside") !== -1 ? "hide past domain" : ie === "category" || ie === "multicategory" ? "allow" : "hide past div"), T(N, te), x(O, N, Y, j), S(O, N, Y, j), ie !== "category" && !j.noHover && Y("hoverformat");
                var ne = Y("color"), se = ne !== y.color.dflt ? ne : z.color, le = Z.label || te._dfltTitle[re];
                if (w(O, N, Y, ie, j), !W) return N;
                Y("title.text", le), f.coerceFont(Y, "title.font", z, {
                  overrideDflt: {
                    size: f.bigFont(z.size),
                    color: se
                  }
                }), C(O, N, Y, ie);
                var ue = j.hasMinor;
                if (ue && (p.newContainer(N, "minor"), C(O, N, Y, ie, {
                  isMinor: !0
                })), h(O, N, Y, ie, j), m(O, N, Y, j), ue) {
                  var ve = j.isMinor;
                  j.isMinor = !0, m(O, N, Y, j), j.isMinor = ve;
                }
                E(O, N, Y, {
                  dfltColor: ne,
                  bgColor: j.bgColor,
                  showGrid: j.showGrid,
                  hasMinor: ue,
                  attributes: y
                }), ue && !N.minor.ticks && !N.minor.showgrid && delete N.minor, (N.showline || N.ticks) && Y("mirror");
                var be = ie === "multicategory";
                if (!j.noTickson && (ie === "category" || be) && (N.ticks || N.showgrid)) {
                  var Me;
                  be && (Me = "boundaries");
                  var Ge = Y("tickson", Me);
                  Ge === "boundaries" && delete N.ticklabelposition;
                }
                if (be) {
                  var we = Y("showdividers");
                  we && (Y("dividercolor"), Y("dividerwidth"));
                }
                if (ie === "date")
                  if (g(O, N, {
                    name: "rangebreaks",
                    inclusionAttr: "enabled",
                    handleItemDefaults: k
                  }), !N.rangebreaks.length)
                    delete N.rangebreaks;
                  else {
                    for (var Re = 0; Re < N.rangebreaks.length; Re++)
                      if (N.rangebreaks[Re].pattern === F) {
                        N._hasDayOfWeekBreaks = !0;
                        break;
                      }
                    if (T(N, te), te._has("scattergl") || te._has("splom"))
                      for (var Ae = 0; Ae < j.data.length; Ae++) {
                        var K = j.data[Ae];
                        (K.type === "scattergl" || K.type === "splom") && (K.visible = !1, f.warn(K.type + " traces do not work on axes with rangebreaks. Setting trace " + K.index + " to `visible: false`."));
                      }
                  }
                return N;
              };
              function k(A, O, N) {
                function Y(ce, X) {
                  return f.coerce(A, O, y.rangebreaks, ce, X);
                }
                var j = Y("enabled");
                if (j) {
                  var te = Y("bounds");
                  if (te && te.length >= 2) {
                    var re = "", z, Z;
                    if (te.length === 2) {
                      for (z = 0; z < 2; z++)
                        if (Z = L(te[z]), Z) {
                          re = F;
                          break;
                        }
                    }
                    var W = Y("pattern", re);
                    if (W === F)
                      for (z = 0; z < 2; z++)
                        Z = L(te[z]), Z && (O.bounds[z] = te[z] = Z - 1);
                    if (W)
                      for (z = 0; z < 2; z++)
                        switch (Z = te[z], W) {
                          case F:
                            if (!l(Z)) {
                              O.enabled = !1;
                              return;
                            }
                            if (Z = +Z, Z !== Math.floor(Z) || // don't accept fractional days for mow
                            Z < 0 || Z >= 7) {
                              O.enabled = !1;
                              return;
                            }
                            O.bounds[z] = te[z] = Z;
                            break;
                          case P:
                            if (!l(Z)) {
                              O.enabled = !1;
                              return;
                            }
                            if (Z = +Z, Z < 0 || Z > 24) {
                              O.enabled = !1;
                              return;
                            }
                            O.bounds[z] = te[z] = Z;
                            break;
                        }
                    if (N.autorange === !1) {
                      var q = N.range;
                      if (q[0] < q[1]) {
                        if (te[0] < q[0] && te[1] > q[1]) {
                          O.enabled = !1;
                          return;
                        }
                      } else if (te[0] > q[0] && te[1] < q[1]) {
                        O.enabled = !1;
                        return;
                      }
                    }
                  } else {
                    var ie = Y("values");
                    if (ie && ie.length)
                      Y("dvalue");
                    else {
                      O.enabled = !1;
                      return;
                    }
                  }
                }
              }
              var I = {
                sun: 1,
                mon: 2,
                tue: 3,
                wed: 4,
                thu: 5,
                fri: 6,
                sat: 7
              };
              function L(A) {
                if (typeof A == "string")
                  return I[A.substr(0, 3).toLowerCase()];
              }
            }
          ),
          /***/
          9736: (
            /***/
            function(s, c, i) {
              var l = i(6880), v = l.FORMAT_LINK, f = l.DATE_FORMAT_LINK;
              function p(C, m) {
                return {
                  valType: "string",
                  dflt: "",
                  editType: "none",
                  description: (m ? g : y)("hover text", C) + ["By default the values are formatted using " + (m ? "generic number format" : "`" + C + "axis.hoverformat`") + "."].join(" ")
                };
              }
              function g(C, m) {
                return ["Sets the " + C + " formatting rule" + (m ? "for `" + m + "` " : ""), "using d3 formatting mini-languages", "which are very similar to those in Python. For numbers, see: " + v + "."].join(" ");
              }
              function y(C, m) {
                return g(C, m) + [" And for dates see: " + f + ".", "We add two items to d3's date formatter:", "*%h* for half of the year as a decimal number as well as", "*%{n}f* for fractional seconds", "with n digits. For example, *2016-10-13 09:15:23.456* with tickformat", "*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ");
              }
              s.exports = {
                axisHoverFormat: p,
                descriptionOnlyNumbers: g,
                descriptionWithDates: y
              };
            }
          ),
          /***/
          9811: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3816);
              c.id2name = function(g) {
                if (!(typeof g != "string" || !g.match(v.AX_ID_PATTERN))) {
                  var y = g.split(" ")[0].substr(1);
                  return y === "1" && (y = ""), g.charAt(0) + "axis" + y;
                }
              }, c.name2id = function(g) {
                if (g.match(v.AX_NAME_PATTERN)) {
                  var y = g.substr(5);
                  return y === "1" && (y = ""), g.charAt(0) + y;
                }
              }, c.cleanId = function(g, y, C) {
                var m = /( domain)$/.test(g);
                if (!(typeof g != "string" || !g.match(v.AX_ID_PATTERN)) && !(y && g.charAt(0) !== y) && !(m && !C)) {
                  var h = g.split(" ")[0].substr(1).replace(/^0+/, "");
                  return h === "1" && (h = ""), g.charAt(0) + h + (m && C ? " domain" : "");
                }
              }, c.list = function(p, g, y) {
                var C = p._fullLayout;
                if (!C) return [];
                var m = c.listIds(p, g), h = new Array(m.length), w;
                for (w = 0; w < m.length; w++) {
                  var S = m[w];
                  h[w] = C[S.charAt(0) + "axis" + S.substr(1)];
                }
                if (!y) {
                  var E = C._subplots.gl3d || [];
                  for (w = 0; w < E.length; w++) {
                    var x = C[E[w]];
                    g ? h.push(x[g + "axis"]) : h.push(x.xaxis, x.yaxis, x.zaxis);
                  }
                }
                return h;
              }, c.listIds = function(p, g) {
                var y = p._fullLayout;
                if (!y) return [];
                var C = y._subplots;
                return g ? C[g + "axis"] : C.xaxis.concat(C.yaxis);
              }, c.getFromId = function(p, g, y) {
                var C = p._fullLayout;
                return g = g === void 0 || typeof g != "string" ? g : g.replace(" domain", ""), y === "x" ? g = g.replace(/y[0-9]*/, "") : y === "y" && (g = g.replace(/x[0-9]*/, "")), C[c.id2name(g)];
              }, c.getFromTrace = function(p, g, y) {
                var C = p._fullLayout, m = null;
                if (l.traceIs(g, "gl3d")) {
                  var h = g.scene;
                  h.substr(0, 5) === "scene" && (m = C[h][y + "axis"]);
                } else
                  m = c.getFromId(p, g[y + "axis"] || y);
                return m;
              }, c.idSort = function(p, g) {
                var y = p.charAt(0), C = g.charAt(0);
                return y !== C ? y > C ? 1 : -1 : +(p.substr(1) || 1) - +(g.substr(1) || 1);
              }, c.ref2id = function(p) {
                return /^[xyz]/.test(p) ? p.split(" ")[0] : !1;
              };
              function f(p, g) {
                if (g && g.length) {
                  for (var y = 0; y < g.length; y++)
                    if (g[y][p]) return !0;
                }
                return !1;
              }
              c.isLinked = function(p, g) {
                return f(g, p._axisMatchGroups) || f(g, p._axisConstraintGroups);
              };
            }
          ),
          /***/
          4796: (
            /***/
            function(s, c, i) {
              var l = i(8116).isTypedArraySpec;
              function v(f, p) {
                var g = p.dataAttr || f._id.charAt(0), y = {}, C, m, h;
                if (p.axData)
                  C = p.axData;
                else
                  for (C = [], m = 0; m < p.data.length; m++) {
                    var w = p.data[m];
                    w[g + "axis"] === f._id && C.push(w);
                  }
                for (m = 0; m < C.length; m++) {
                  var S = C[m][g];
                  for (h = 0; h < S.length; h++) {
                    var E = S[h];
                    E != null && (y[E] = 1);
                  }
                }
                return Object.keys(y);
              }
              s.exports = function(p, g, y, C) {
                if (g.type === "category") {
                  var m = p.categoryarray, h = Array.isArray(m) && m.length > 0 || l(m), w;
                  h && (w = "array");
                  var S = y("categoryorder", w), E;
                  S === "array" && (E = y("categoryarray")), !h && S === "array" && (S = g.categoryorder = "trace"), S === "trace" ? g._initialCategories = [] : S === "array" ? g._initialCategories = E.slice() : (E = v(g, C).sort(), S === "category ascending" ? g._initialCategories = E : S === "category descending" && (g._initialCategories = E.reverse()));
                }
              };
            }
          ),
          /***/
          8728: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = i(9032), p = f.ONEDAY, g = f.ONEWEEK;
              c.dtick = function(y, C) {
                var m = C === "log", h = C === "date", w = C === "category", S = h ? p : 1;
                if (!y) return S;
                if (l(y))
                  return y = Number(y), y <= 0 ? S : w ? Math.max(1, Math.round(y)) : h ? Math.max(0.1, y) : y;
                if (typeof y != "string" || !(h || m))
                  return S;
                var E = y.charAt(0), x = y.substr(1);
                return x = l(x) ? Number(x) : 0, x <= 0 || !// "M<n>" gives ticks every (integer) n months
                (h && E === "M" && x === Math.round(x) || // "L<f>" gives ticks linearly spaced in data (not in position) every (float) f
                m && E === "L" || // "D1" gives powers of 10 with all small digits between, "D2" gives only 2 and 5
                m && E === "D" && (x === 1 || x === 2)) ? S : y;
              }, c.tick0 = function(y, C, m, h) {
                if (C === "date")
                  return v.cleanDate(y, v.dateTick0(m, h % g === 0 ? 1 : 0));
                if (!(h === "D1" || h === "D2"))
                  return l(y) ? Number(y) : 0;
              };
            }
          ),
          /***/
          3816: (
            /***/
            function(s, c, i) {
              var l = i(3756).counter;
              s.exports = {
                idRegex: {
                  x: l("x", "( domain)?"),
                  y: l("y", "( domain)?")
                },
                attrRegex: l("[xy]axis"),
                // axis match regular expression
                xAxisMatch: l("xaxis"),
                yAxisMatch: l("yaxis"),
                // pattern matching axis ids and names
                // note that this is more permissive than counterRegex, as
                // id2name, name2id, and cleanId accept "x1" etc
                AX_ID_PATTERN: /^[xyz][0-9]*( domain)?$/,
                AX_NAME_PATTERN: /^[xyz]axis[0-9]*$/,
                // and for 2D subplots
                SUBPLOT_PATTERN: /^x([0-9]*)y([0-9]*)$/,
                HOUR_PATTERN: "hour",
                WEEKDAY_PATTERN: "day of week",
                // pixels to move mouse before you stop clamping to starting point
                MINDRAG: 8,
                // smallest dimension allowed for a zoombox
                MINZOOM: 20,
                // width of axis drag regions
                DRAGGERSIZE: 20,
                // delay before a redraw (relayout) after smooth panning and zooming
                REDRAWDELAY: 50,
                // last resort axis ranges for x and y axes if we have no data
                DFLTRANGEX: [-1, 6],
                DFLTRANGEY: [-1, 4],
                // Layers to keep trace types in the right order
                // N.B. each  'unique' plot method must have its own layer
                traceLayerClasses: ["imagelayer", "heatmaplayer", "contourcarpetlayer", "contourlayer", "funnellayer", "waterfalllayer", "barlayer", "carpetlayer", "violinlayer", "boxlayer", "ohlclayer", "scattercarpetlayer", "scatterlayer"],
                clipOnAxisFalseQuery: [".scatterlayer", ".barlayer", ".funnellayer", ".waterfalllayer"],
                layerValue2layerClass: {
                  "above traces": "above",
                  "below traces": "below"
                }
              };
            }
          ),
          /***/
          1888: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(9280), f = i(9811).id2name, p = i(4724), g = i(1160), y = i(8344), C = i(9032).ALMOST_EQUAL, m = i(4284).FROM_BL;
              c.handleDefaults = function(P, k, I) {
                var L = I.axIds, A = I.axHasImage, O = k._axisConstraintGroups = [], N = k._axisMatchGroups = [], Y, j, te, re, z, Z, W, q;
                for (Y = 0; Y < L.length; Y++)
                  re = f(L[Y]), z = P[re], Z = k[re], h(z, Z, {
                    axIds: L,
                    layoutOut: k,
                    hasImage: A[re]
                  });
                function ie(be, Me) {
                  for (Y = 0; Y < be.length; Y++) {
                    j = be[Y];
                    for (te in j)
                      k[f(te)][Me] = j;
                  }
                }
                for (ie(N, "_matchGroup"), Y = 0; Y < O.length; Y++) {
                  j = O[Y];
                  for (te in j)
                    if (Z = k[f(te)], Z.fixedrange) {
                      for (var ce in j) {
                        var X = f(ce);
                        (P[X] || {}).fixedrange === !1 && l.warn("fixedrange was specified as false for axis " + X + " but was overridden because another axis in its constraint group has fixedrange true"), k[X].fixedrange = !0;
                      }
                      break;
                    }
                }
                for (Y = 0; Y < O.length; ) {
                  j = O[Y];
                  for (te in j) {
                    Z = k[f(te)], Z._matchGroup && Object.keys(Z._matchGroup).length === Object.keys(j).length && (O.splice(Y, 1), Y--);
                    break;
                  }
                  Y++;
                }
                ie(O, "_constraintGroup");
                var U = ["constrain", "range", "autorange", "rangemode", "rangebreaks", "categoryorder", "categoryarray"], ne = !1, se = !1;
                function le() {
                  q = Z[W], W === "rangebreaks" && (se = Z._hasDayOfWeekBreaks);
                }
                for (Y = 0; Y < N.length; Y++) {
                  j = N[Y];
                  for (var ue = 0; ue < U.length; ue++) {
                    W = U[ue], q = null;
                    var ve;
                    for (te in j)
                      if (re = f(te), z = P[re], Z = k[re], W in Z) {
                        if (!Z.matches && (ve = Z, W in z)) {
                          le();
                          break;
                        }
                        q === null && W in z && le();
                      }
                    if (W === "range" && q && z.range && z.range.length === 2 && z.range[0] !== null && z.range[1] !== null && (ne = !0), W === "autorange" && q === null && ne && (q = !1), q === null && W in ve && (q = ve[W]), q !== null)
                      for (te in j)
                        Z = k[f(te)], Z[W] = W === "range" ? q.slice() : q, W === "rangebreaks" && (Z._hasDayOfWeekBreaks = se, y(Z, k));
                  }
                }
              };
              function h(P, k, I) {
                var L = I.axIds, A = I.layoutOut, O = I.hasImage, N = A._axisConstraintGroups, Y = A._axisMatchGroups, j = k._id, te = j.charAt(0), re = ((A._splomAxes || {})[te] || {})[j] || {}, z = k._id, Z = z.charAt(0) === "x";
                k._matchGroup = null, k._constraintGroup = null;
                function W(Re, Ae) {
                  return l.coerce(P, k, p, Re, Ae);
                }
                W("constrain", O ? "domain" : "range"), l.coerce(P, k, {
                  constraintoward: {
                    valType: "enumerated",
                    values: Z ? ["left", "center", "right"] : ["bottom", "middle", "top"],
                    dflt: Z ? "center" : "middle"
                  }
                }, "constraintoward");
                var q = k.type, ie, ce, X = [];
                for (ie = 0; ie < L.length; ie++)
                  if (ce = L[ie], ce !== z) {
                    var U = A[f(ce)];
                    U.type === q && X.push(ce);
                  }
                var ne = S(N, z);
                if (ne) {
                  var se = [];
                  for (ie = 0; ie < X.length; ie++)
                    ce = X[ie], ne[ce] || se.push(ce);
                  X = se;
                }
                var le = X.length, ue, ve;
                le && (P.matches || re.matches) && (ue = l.coerce(P, k, {
                  matches: {
                    valType: "enumerated",
                    values: X,
                    dflt: X.indexOf(re.matches) !== -1 ? re.matches : void 0
                  }
                }, "matches"));
                var be = O && !Z ? k.anchor : void 0;
                if (le && !ue && (P.scaleanchor || be) && (ve = l.coerce(P, k, {
                  scaleanchor: {
                    valType: "enumerated",
                    values: X.concat([!1])
                  }
                }, "scaleanchor", be)), ue) {
                  k._matchGroup = E(Y, z, ue, 1);
                  var Me = A[f(ue)], Ge = w(A, k) / w(A, Me);
                  Z !== (ue.charAt(0) === "x") && (Ge = (Z ? "x" : "y") + Ge), E(N, z, ue, Ge);
                } else P.matches && L.indexOf(P.matches) !== -1 && l.warn("ignored " + k._name + '.matches: "' + P.matches + '" to avoid an infinite loop');
                if (ve) {
                  var we = W("scaleratio");
                  we || (we = k.scaleratio = 1), E(N, z, ve, we);
                } else P.scaleanchor && L.indexOf(P.scaleanchor) !== -1 && l.warn("ignored " + k._name + '.scaleanchor: "' + P.scaleanchor + '" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.');
              }
              function w(P, k) {
                var I = k.domain;
                return I || (I = P[f(k.overlaying)].domain), I[1] - I[0];
              }
              function S(P, k) {
                for (var I = 0; I < P.length; I++)
                  if (P[I][k])
                    return P[I];
                return null;
              }
              function E(P, k, I, L) {
                var A, O, N, Y, j, te = S(P, k);
                te === null ? (te = {}, te[k] = 1, j = P.length, P.push(te)) : j = P.indexOf(te);
                var re = Object.keys(te);
                for (A = 0; A < P.length; A++)
                  if (N = P[A], A !== j && N[I]) {
                    var z = N[I];
                    for (O = 0; O < re.length; O++)
                      Y = re[O], N[Y] = x(z, x(L, te[Y]));
                    P.splice(j, 1);
                    return;
                  }
                if (L !== 1)
                  for (O = 0; O < re.length; O++) {
                    var Z = re[O];
                    te[Z] = x(L, te[Z]);
                  }
                te[I] = 1;
              }
              function x(P, k) {
                var I = "", L = "", A, O;
                typeof P == "string" && (I = P.match(/^[xy]*/)[0], A = I.length, P = +P.substr(A)), typeof k == "string" && (L = k.match(/^[xy]*/)[0], O = L.length, k = +k.substr(O));
                var N = P * k;
                return !A && !O ? N : !A || !O || I.charAt(0) === L.charAt(0) ? I + L + P * k : A === O ? N : (A > O ? I.substr(O) : L.substr(A)) + N;
              }
              function T(P, k) {
                for (var I = k._size, L = I.h / I.w, A = {}, O = Object.keys(P), N = 0; N < O.length; N++) {
                  var Y = O[N], j = P[Y];
                  if (typeof j == "string") {
                    var te = j.match(/^[xy]*/)[0], re = te.length;
                    j = +j.substr(re);
                    for (var z = te.charAt(0) === "y" ? L : 1 / L, Z = 0; Z < re; Z++)
                      j *= z;
                  }
                  A[Y] = j;
                }
                return A;
              }
              c.enforce = function(k) {
                var I = k._fullLayout, L = I._axisConstraintGroups || [], A, O, N, Y, j, te, re, z;
                for (A = 0; A < L.length; A++) {
                  N = T(L[A], I);
                  var Z = Object.keys(N), W = 1 / 0, q = 0, ie = 1 / 0, ce = {}, X = {}, U = !1;
                  for (O = 0; O < Z.length; O++)
                    Y = Z[O], X[Y] = j = I[f(Y)], j._inputDomain ? j.domain = j._inputDomain.slice() : j._inputDomain = j.domain.slice(), j._inputRange || (j._inputRange = j.range.slice()), j.setScale(), ce[Y] = te = Math.abs(j._m) / N[Y], W = Math.min(W, te), (j.constrain === "domain" || !j._constraintShrinkable) && (ie = Math.min(ie, te)), delete j._constraintShrinkable, q = Math.max(q, te), j.constrain === "domain" && (U = !0);
                  if (!(W > C * q && !U)) {
                    for (O = 0; O < Z.length; O++)
                      if (Y = Z[O], te = ce[Y], j = X[Y], re = j.constrain, te !== ie || re === "domain")
                        if (z = te / ie, re === "range")
                          g(j, z);
                        else {
                          var ne = j._inputDomain, se = (j.domain[1] - j.domain[0]) / (ne[1] - ne[0]), le = (j.r2l(j.range[1]) - j.r2l(j.range[0])) / (j.r2l(j._inputRange[1]) - j.r2l(j._inputRange[0]));
                          if (z /= se, z * le < 1) {
                            j.domain = j._input.domain = ne.slice(), g(j, z);
                            continue;
                          }
                          if (le < 1 && (j.range = j._input.range = j._inputRange.slice(), z *= le), j.autorange) {
                            var ue = j.r2l(j.range[0]), ve = j.r2l(j.range[1]), be = (ue + ve) / 2, Me = be, Ge = be, we = Math.abs(ve - be), Re = be - we * z * 1.0001, Ae = be + we * z * 1.0001, K = v.makePadFn(I, j, 0), ee = v.makePadFn(I, j, 1);
                            F(j, z);
                            var oe = Math.abs(j._m), _ = v.concatExtremes(k, j), V = _.min, fe = _.max, $, he;
                            for (he = 0; he < V.length; he++)
                              $ = V[he].val - K(V[he]) / oe, $ > Re && $ < Me && (Me = $);
                            for (he = 0; he < fe.length; he++)
                              $ = fe[he].val + ee(fe[he]) / oe, $ < Ae && $ > Ge && (Ge = $);
                            var me = (Ge - Me) / (2 * we);
                            z /= me, Me = j.l2r(Me), Ge = j.l2r(Ge), j.range = j._input.range = ue < ve ? [Me, Ge] : [Ge, Me];
                          }
                          F(j, z);
                        }
                  }
                }
              }, c.getAxisGroup = function(k, I) {
                for (var L = k._axisMatchGroups, A = 0; A < L.length; A++) {
                  var O = L[A];
                  if (O[I]) return "g" + A;
                }
                return I;
              }, c.clean = function(k, I) {
                if (I._inputDomain) {
                  for (var L = !1, A = I._id, O = k._fullLayout._axisConstraintGroups, N = 0; N < O.length; N++)
                    if (O[N][A]) {
                      L = !0;
                      break;
                    }
                  (!L || I.constrain !== "domain") && (I._input.domain = I.domain = I._inputDomain, delete I._inputDomain);
                }
              };
              function F(P, k) {
                var I = P._inputDomain, L = m[P.constraintoward], A = I[0] + (I[1] - I[0]) * L;
                P.domain = P._input.domain = [A + (I[0] - A) / k, A + (I[1] - A) / k], P.setScale();
              }
            }
          ),
          /***/
          1184: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3400), f = v.numberFormat, p = i(9760), g = i(9184), y = i(4040), C = v.strTranslate, m = i(2736), h = i(6308), w = i(3616), S = i(3024), E = i(4460), x = i(3972), T = i(6476), F = i(2760), P = F.selectingOrDrawing, k = F.freeMode, I = i(4284).FROM_TL, L = i(3696), A = i(9172).redrawReglTraces, O = i(7316), N = i(9811).getFromId, Y = i(2676).prepSelect, j = i(2676).clearOutline, te = i(2676).selectOnClick, re = i(1160), z = i(3816), Z = z.MINDRAG, W = z.MINZOOM, q = !0;
              function ie($, he, me, xe, Fe, Ve, Be, Je) {
                var et = $._fullLayout._zoomlayer, at = Be + Je === "nsew", De = (Be + Je).length === 1, Ne, Ie, Ue, ot, ct, Tt, kt, Ot, Rt, xt, Wt, bt, jt, qt, Yt, Ut, tt, ze, _e, Ye, lt, Te, Oe;
                me += he.yaxis._shift;
                function je() {
                  if (Ne = he.xaxis, Ie = he.yaxis, Rt = Ne._length, xt = Ie._length, kt = Ne._offset, Ot = Ie._offset, Ue = {}, Ue[Ne._id] = Ne, ot = {}, ot[Ie._id] = Ie, Be && Je)
                    for (var pt = he.overlays, dt = 0; dt < pt.length; dt++) {
                      var St = pt[dt].xaxis;
                      Ue[St._id] = St;
                      var Ft = pt[dt].yaxis;
                      ot[Ft._id] = Ft;
                    }
                  ct = fe(Ue), Tt = fe(ot), jt = U(ct, Je), qt = U(Tt, Be), Yt = !qt && !jt, bt = _($, $._fullLayout._axisMatchGroups, Ue, ot), Wt = _($, $._fullLayout._axisConstraintGroups, Ue, ot, bt);
                  var Gt = Wt.isSubplotConstrained || bt.isSubplotConstrained;
                  Ut = Je || Gt, tt = Be || Gt;
                  var Lt = $._fullLayout;
                  ze = Lt._has("scattergl"), _e = Lt._has("splom"), Ye = Lt._has("svg");
                }
                je();
                var Xe = ve(qt + jt, $._fullLayout.dragmode, at), nt = X(he, Be + Je + "drag", Xe, me, xe, Fe, Ve);
                if (Yt && !at)
                  return nt.onmousedown = null, nt.style.pointerEvents = "none", nt;
                var it = {
                  element: nt,
                  gd: $,
                  plotinfo: he
                };
                it.prepFn = function(pt, dt, St) {
                  var Ft = it.dragmode, Gt = $._fullLayout.dragmode;
                  Gt !== Ft && (it.dragmode = Gt), je(), Te = $._fullLayout._invScaleX, Oe = $._fullLayout._invScaleY, Yt || (at ? pt.shiftKey ? Gt === "pan" ? Gt = "zoom" : P(Gt) || (Gt = "pan") : pt.ctrlKey && (Gt = "pan") : Gt = "pan"), k(Gt) ? it.minDrag = 1 : it.minDrag = void 0, P(Gt) ? (it.xaxes = ct, it.yaxes = Tt, Y(pt, dt, St, it, Gt)) : (it.clickFn = At, P(Ft) && Nt(), Yt || (Gt === "zoom" ? (it.moveFn = Sr, it.doneFn = Ar, it.minDrag = 1, yr(pt, dt, St)) : Gt === "pan" && (it.moveFn = cn, it.doneFn = ft))), $._fullLayout._redrag = function() {
                    var Lt = $._dragdata;
                    if (Lt && Lt.element === nt) {
                      var $t = $._fullLayout.dragmode;
                      P($t) || (je(), rt([0, 0, Rt, xt]), it.moveFn(Lt.dx, Lt.dy));
                    }
                  };
                };
                function Nt() {
                  it.plotinfo.selection = !1, j($);
                }
                function At(pt, dt) {
                  var St = it.gd;
                  if (St._fullLayout._activeShapeIndex >= 0) {
                    St._fullLayout._deactivateShape(St);
                    return;
                  }
                  var Ft = St._fullLayout.clickmode;
                  if (Re(St), pt === 2 && !De && ae(), at)
                    Ft.indexOf("select") > -1 && te(dt, St, ct, Tt, he.id, it), Ft.indexOf("event") > -1 && S.click(St, dt, he.id);
                  else if (pt === 1 && De) {
                    var Gt = Be ? Ie : Ne, Lt = Be === "s" || Je === "w" ? 0 : 1, $t = Gt._name + ".range[" + Lt + "]", _t = ne(Gt, Lt), zt = "left", tr = "middle";
                    if (Gt.fixedrange) return;
                    Be ? (tr = Be === "n" ? "top" : "bottom", Gt.side === "right" && (zt = "right")) : Je === "e" && (zt = "right"), St._context.showAxisRangeEntryBoxes && l.select(nt).call(m.makeEditable, {
                      gd: St,
                      immediate: !0,
                      background: St._fullLayout.paper_bgcolor,
                      text: String(_t),
                      fill: Gt.tickfont ? Gt.tickfont.color : "#444",
                      horizontalAlign: zt,
                      verticalAlign: tr
                    }).on("edit", function(nr) {
                      var xr = Gt.d2r(nr);
                      xr !== void 0 && y.call("_guiRelayout", St, $t, xr);
                    });
                  }
                }
                T.init(it);
                var vt, ut, Pt, rr, lr, Mr, Rr, Pr, ir, Lr;
                function yr(pt, dt, St) {
                  var Ft = nt.getBoundingClientRect();
                  vt = dt - Ft.left, ut = St - Ft.top, $._fullLayout._calcInverseTransform($);
                  var Gt = v.apply3DTransform($._fullLayout._invTransform)(vt, ut);
                  vt = Gt[0], ut = Gt[1], Pt = {
                    l: vt,
                    r: vt,
                    w: 0,
                    t: ut,
                    b: ut,
                    h: 0
                  }, rr = $._hmpixcount ? $._hmlumcount / $._hmpixcount : p($._fullLayout.plot_bgcolor).getLuminance(), lr = "M0,0H" + Rt + "V" + xt + "H0V0", Mr = !1, Rr = "xy", Lr = !1, Pr = be(et, rr, kt, Ot, lr), ir = Me(et, kt, Ot);
                }
                function Sr(pt, dt) {
                  if ($._transitioningWithDuration)
                    return !1;
                  var St = Math.max(0, Math.min(Rt, Te * pt + vt)), Ft = Math.max(0, Math.min(xt, Oe * dt + ut)), Gt = Math.abs(St - vt), Lt = Math.abs(Ft - ut);
                  Pt.l = Math.min(vt, St), Pt.r = Math.max(vt, St), Pt.t = Math.min(ut, Ft), Pt.b = Math.max(ut, Ft);
                  function $t() {
                    Rr = "", Pt.r = Pt.l, Pt.t = Pt.b, ir.attr("d", "M0,0Z");
                  }
                  if (Wt.isSubplotConstrained)
                    Gt > W || Lt > W ? (Rr = "xy", Gt / Rt > Lt / xt ? (Lt = Gt * xt / Rt, ut > Ft ? Pt.t = ut - Lt : Pt.b = ut + Lt) : (Gt = Lt * Rt / xt, vt > St ? Pt.l = vt - Gt : Pt.r = vt + Gt), ir.attr("d", oe(Pt))) : $t();
                  else if (bt.isSubplotConstrained)
                    if (Gt > W || Lt > W) {
                      Rr = "xy";
                      var _t = Math.min(Pt.l / Rt, (xt - Pt.b) / xt), zt = Math.max(Pt.r / Rt, (xt - Pt.t) / xt);
                      Pt.l = _t * Rt, Pt.r = zt * Rt, Pt.b = (1 - _t) * xt, Pt.t = (1 - zt) * xt, ir.attr("d", oe(Pt));
                    } else
                      $t();
                  else !qt || Lt < Math.min(Math.max(Gt * 0.6, Z), W) ? Gt < Z || !jt ? $t() : (Pt.t = 0, Pt.b = xt, Rr = "x", ir.attr("d", K(Pt, ut))) : !jt || Gt < Math.min(Lt * 0.6, W) ? (Pt.l = 0, Pt.r = Rt, Rr = "y", ir.attr("d", ee(Pt, vt))) : (Rr = "xy", ir.attr("d", oe(Pt)));
                  Pt.w = Pt.r - Pt.l, Pt.h = Pt.b - Pt.t, Rr && (Lr = !0), $._dragged = Lr, Ge(Pr, ir, Pt, lr, Mr, rr), Yr(), $.emit("plotly_relayouting", lt), Mr = !0;
                }
                function Yr() {
                  lt = {}, (Rr === "xy" || Rr === "x") && (se(ct, Pt.l / Rt, Pt.r / Rt, lt, Wt.xaxes), Dr("x", lt)), (Rr === "xy" || Rr === "y") && (se(Tt, (xt - Pt.b) / xt, (xt - Pt.t) / xt, lt, Wt.yaxes), Dr("y", lt));
                }
                function Ar() {
                  Yr(), Re($), ft(), Ae($);
                }
                var pr = [0, 0, Rt, xt], kr = null, br = z.REDRAWDELAY, Gr = he.mainplot ? $._fullLayout._plots[he.mainplot] : he;
                function rn(pt) {
                  if (!$._context._scrollZoom.cartesian && !$._fullLayout._enablescrollzoom)
                    return;
                  if (Nt(), $._transitioningWithDuration) {
                    pt.preventDefault(), pt.stopPropagation();
                    return;
                  }
                  je(), clearTimeout(kr);
                  var dt = -pt.deltaY;
                  if (isFinite(dt) || (dt = pt.wheelDelta / 10), !isFinite(dt)) {
                    v.log("Did not find wheel motion attributes: ", pt);
                    return;
                  }
                  var St = Math.exp(-Math.min(Math.max(dt, -20), 20) / 200), Ft = Gr.draglayer.select(".nsewdrag").node().getBoundingClientRect(), Gt = (pt.clientX - Ft.left) / Ft.width, Lt = (Ft.bottom - pt.clientY) / Ft.height, $t;
                  function _t(zt, tr, nr) {
                    if (zt.fixedrange) return;
                    var xr = v.simpleMap(zt.range, zt.r2l), Er = xr[0] + (xr[1] - xr[0]) * tr;
                    function Jr(Ur) {
                      return zt.l2r(Er + (Ur - Er) * nr);
                    }
                    zt.range = xr.map(Jr);
                  }
                  if (Ut) {
                    for (Je || (Gt = 0.5), $t = 0; $t < ct.length; $t++)
                      _t(ct[$t], Gt, St);
                    Dr("x"), pr[2] *= St, pr[0] += pr[2] * Gt * (1 / St - 1);
                  }
                  if (tt) {
                    for (Be || (Lt = 0.5), $t = 0; $t < Tt.length; $t++)
                      _t(Tt[$t], Lt, St);
                    Dr("y"), pr[3] *= St, pr[1] += pr[3] * (1 - Lt) * (1 / St - 1);
                  }
                  rt(pr), Se(), $.emit("plotly_relayouting", lt), kr = setTimeout(function() {
                    $._fullLayout && (pr = [0, 0, Rt, xt], ft());
                  }, br), pt.preventDefault();
                }
                Be.length * Je.length !== 1 && V(nt, rn);
                function cn(pt, dt) {
                  if (pt = pt * Te, dt = dt * Oe, $._transitioningWithDuration)
                    return;
                  if ($._fullLayout._replotting = !0, jt === "ew" || qt === "ns") {
                    var St = jt ? -pt : 0, Ft = qt ? -dt : 0;
                    if (bt.isSubplotConstrained) {
                      if (jt && qt) {
                        var Gt = (pt / Rt - dt / xt) / 2;
                        pt = Gt * Rt, dt = -Gt * xt, St = -pt, Ft = -dt;
                      }
                      qt ? St = -Ft * Rt / xt : Ft = -St * xt / Rt;
                    }
                    jt && (le(ct, pt), Dr("x")), qt && (le(Tt, dt), Dr("y")), rt([St, Ft, Rt, xt]), Se(), $.emit("plotly_relayouting", lt);
                    return;
                  }
                  function Lt(Jr, Ur, Br) {
                    for (var dn = 1 - Ur, nn, Sn, ai = 0; ai < Jr.length; ai++) {
                      var Dn = Jr[ai];
                      if (!Dn.fixedrange) {
                        nn = Dn, Sn = Dn._rl[dn] + (Dn._rl[Ur] - Dn._rl[dn]) / ue(Br / Dn._length);
                        var on = Dn.l2r(Sn);
                        on !== !1 && on !== void 0 && (Dn.range[Ur] = on);
                      }
                    }
                    return nn._length * (nn._rl[Ur] - Sn) / (nn._rl[Ur] - nn._rl[dn]);
                  }
                  var $t = jt === "w" == (qt === "n") ? 1 : -1;
                  if (jt && qt && (Wt.isSubplotConstrained || bt.isSubplotConstrained)) {
                    var _t = (pt / Rt + $t * dt / xt) / 2;
                    pt = _t * Rt, dt = $t * _t * xt;
                  }
                  var zt, tr;
                  if (jt === "w" ? pt = Lt(ct, 0, pt) : jt === "e" ? pt = Lt(ct, 1, -pt) : jt || (pt = 0), qt === "n" ? dt = Lt(Tt, 1, dt) : qt === "s" ? dt = Lt(Tt, 0, -dt) : qt || (dt = 0), zt = jt === "w" ? pt : 0, tr = qt === "n" ? dt : 0, Wt.isSubplotConstrained && !bt.isSubplotConstrained || // NW or SE on matching axes - create a symmetric zoom
                  bt.isSubplotConstrained && jt && qt && $t > 0) {
                    var nr;
                    if (bt.isSubplotConstrained || !jt && qt.length === 1) {
                      for (nr = 0; nr < ct.length; nr++)
                        ct[nr].range = ct[nr]._r.slice(), re(ct[nr], 1 - dt / xt);
                      pt = dt * Rt / xt, zt = pt / 2;
                    }
                    if (bt.isSubplotConstrained || !qt && jt.length === 1) {
                      for (nr = 0; nr < Tt.length; nr++)
                        Tt[nr].range = Tt[nr]._r.slice(), re(Tt[nr], 1 - pt / Rt);
                      dt = pt * xt / Rt, tr = dt / 2;
                    }
                  }
                  (!bt.isSubplotConstrained || !qt) && Dr("x"), (!bt.isSubplotConstrained || !jt) && Dr("y");
                  var xr = Rt - pt, Er = xt - dt;
                  bt.isSubplotConstrained && !(jt && qt) && (jt ? (tr = zt ? 0 : pt * xt / Rt, Er = xr * xt / Rt) : (zt = tr ? 0 : dt * Rt / xt, xr = Er * Rt / xt)), rt([zt, tr, xr, Er]), Se(), $.emit("plotly_relayouting", lt);
                }
                function Dr(pt, dt) {
                  for (var St = bt.isSubplotConstrained ? {
                    x: Tt,
                    y: ct
                  }[pt] : bt[pt + "axes"], Ft = bt.isSubplotConstrained ? {
                    x: ct,
                    y: Tt
                  }[pt] : [], Gt = 0; Gt < St.length; Gt++) {
                    var Lt = St[Gt], $t = Lt._id, _t = bt.xLinks[$t] || bt.yLinks[$t], zt = Ft[0] || Ue[_t] || ot[_t];
                    zt && (dt ? (dt[Lt._name + ".range[0]"] = dt[zt._name + ".range[0]"], dt[Lt._name + ".range[1]"] = dt[zt._name + ".range[1]"]) : Lt.range = zt.range.slice());
                  }
                }
                function Se() {
                  var pt = [], dt;
                  function St($t) {
                    for (dt = 0; dt < $t.length; dt++)
                      $t[dt].fixedrange || pt.push($t[dt]._id);
                  }
                  function Ft($t, _t) {
                    for (dt = 0; dt < $t.length; dt++) {
                      var zt = $t[dt], tr = zt[_t];
                      !zt.fixedrange && tr.tickmode === "sync" && pt.push(tr._id);
                    }
                  }
                  for (Ut && (St(ct), St(Wt.xaxes), St(bt.xaxes), Ft(he.overlays, "xaxis")), tt && (St(Tt), St(Wt.yaxes), St(bt.yaxes), Ft(he.overlays, "yaxis")), lt = {}, dt = 0; dt < pt.length; dt++) {
                    var Gt = pt[dt], Lt = N($, Gt);
                    E.drawOne($, Lt, {
                      skipTitle: !0
                    }), lt[Lt._name + ".range[0]"] = Lt.range[0], lt[Lt._name + ".range[1]"] = Lt.range[1];
                  }
                  E.redrawComponents($, pt);
                }
                function ae() {
                  if (!$._transitioningWithDuration) {
                    var pt = $._context.doubleClick, dt = [];
                    jt && (dt = dt.concat(ct)), qt && (dt = dt.concat(Tt)), bt.xaxes && (dt = dt.concat(bt.xaxes)), bt.yaxes && (dt = dt.concat(bt.yaxes));
                    var St = {}, Ft, Gt;
                    if (pt === "reset+autosize")
                      for (pt = "autosize", Gt = 0; Gt < dt.length; Gt++) {
                        Ft = dt[Gt];
                        var Lt = Ft._rangeInitial0, $t = Ft._rangeInitial1, _t = Lt !== void 0 || $t !== void 0;
                        if (_t && (Lt !== void 0 && Lt !== Ft.range[0] || $t !== void 0 && $t !== Ft.range[1]) || !_t && Ft.autorange !== !0) {
                          pt = "reset";
                          break;
                        }
                      }
                    if (pt === "autosize")
                      for (Gt = 0; Gt < dt.length; Gt++)
                        Ft = dt[Gt], Ft.fixedrange || (St[Ft._name + ".autorange"] = !0);
                    else if (pt === "reset") {
                      for ((jt || Wt.isSubplotConstrained) && (dt = dt.concat(Wt.xaxes)), qt && !Wt.isSubplotConstrained && (dt = dt.concat(Wt.yaxes)), Wt.isSubplotConstrained && (jt ? qt || (dt = dt.concat(Tt)) : dt = dt.concat(ct)), Gt = 0; Gt < dt.length; Gt++)
                        if (Ft = dt[Gt], !Ft.fixedrange) {
                          var zt = Ft._name, tr = Ft._autorangeInitial;
                          Ft._rangeInitial0 === void 0 && Ft._rangeInitial1 === void 0 ? St[zt + ".autorange"] = !0 : Ft._rangeInitial0 === void 0 ? (St[zt + ".autorange"] = tr, St[zt + ".range"] = [null, Ft._rangeInitial1]) : Ft._rangeInitial1 === void 0 ? (St[zt + ".range"] = [Ft._rangeInitial0, null], St[zt + ".autorange"] = tr) : St[zt + ".range"] = [Ft._rangeInitial0, Ft._rangeInitial1];
                        }
                    }
                    $.emit("plotly_doubleclick", null), y.call("_guiRelayout", $, St);
                  }
                }
                function ft() {
                  rt([0, 0, Rt, xt]), v.syncOrAsync([O.previousPromises, function() {
                    $._fullLayout._replotting = !1, y.call("_guiRelayout", $, lt);
                  }], $);
                }
                function rt(pt) {
                  var dt = $._fullLayout, St = dt._plots, Ft = dt._subplots.cartesian, Gt, Lt, $t, _t;
                  if (_e && y.subplotsRegistry.splom.drag($), ze) {
                    for (Gt = 0; Gt < Ft.length; Gt++)
                      if (Lt = St[Ft[Gt]], $t = Lt.xaxis, _t = Lt.yaxis, Lt._scene) {
                        var zt = v.simpleMap($t.range, $t.r2l), tr = v.simpleMap(_t.range, _t.r2l);
                        $t.limitRange && $t.limitRange(), _t.limitRange && _t.limitRange(), zt = $t.range, tr = _t.range, Lt._scene.update({
                          range: [zt[0], tr[0], zt[1], tr[1]]
                        });
                      }
                  }
                  if ((_e || ze) && (L($), A($)), Ye) {
                    var nr = pt[2] / Ne._length, xr = pt[3] / Ie._length;
                    for (Gt = 0; Gt < Ft.length; Gt++) {
                      Lt = St[Ft[Gt]], $t = Lt.xaxis, _t = Lt.yaxis;
                      var Er = (Ut || bt.isSubplotConstrained) && !$t.fixedrange && Ue[$t._id], Jr = (tt || bt.isSubplotConstrained) && !_t.fixedrange && ot[_t._id], Ur, Br, dn, nn;
                      if (Er ? (Ur = nr, dn = Je || bt.isSubplotConstrained ? pt[0] : Ct($t, Ur)) : bt.xaHash[$t._id] ? (Ur = nr, dn = pt[0] * $t._length / Ne._length) : bt.yaHash[$t._id] ? (Ur = xr, dn = qt === "ns" ? -pt[1] * $t._length / Ie._length : Ct($t, Ur, {
                        n: "top",
                        s: "bottom"
                      }[qt])) : (Ur = gt($t, nr, xr), dn = wt($t, Ur)), Ur > 1 && ($t.maxallowed !== void 0 && Ut === ($t.range[0] < $t.range[1] ? "e" : "w") || $t.minallowed !== void 0 && Ut === ($t.range[0] < $t.range[1] ? "w" : "e")) && (Ur = 1, dn = 0), Jr ? (Br = xr, nn = Be || bt.isSubplotConstrained ? pt[1] : Ct(_t, Br)) : bt.yaHash[_t._id] ? (Br = xr, nn = pt[1] * _t._length / Ie._length) : bt.xaHash[_t._id] ? (Br = nr, nn = jt === "ew" ? -pt[0] * _t._length / Ne._length : Ct(_t, Br, {
                        e: "right",
                        w: "left"
                      }[jt])) : (Br = gt(_t, nr, xr), nn = wt(_t, Br)), Br > 1 && (_t.maxallowed !== void 0 && tt === (_t.range[0] < _t.range[1] ? "n" : "s") || _t.minallowed !== void 0 && tt === (_t.range[0] < _t.range[1] ? "s" : "n")) && (Br = 1, nn = 0), !(!Ur && !Br)) {
                        Ur || (Ur = 1), Br || (Br = 1);
                        var Sn = $t._offset - dn / Ur, ai = _t._offset - nn / Br;
                        Lt.clipRect.call(w.setTranslate, dn, nn).call(w.setScale, Ur, Br), Lt.plot.call(w.setTranslate, Sn, ai).call(w.setScale, 1 / Ur, 1 / Br), (Ur !== Lt.xScaleFactor || Br !== Lt.yScaleFactor) && (w.setPointGroupScale(Lt.zoomScalePts, Ur, Br), w.setTextPointsScale(Lt.zoomScaleTxt, Ur, Br)), w.hideOutsideRangePoints(Lt.clipOnAxisFalseTraces, Lt), Lt.xScaleFactor = Ur, Lt.yScaleFactor = Br;
                      }
                    }
                  }
                }
                function gt(pt, dt, St) {
                  return pt.fixedrange ? 0 : Ut && Wt.xaHash[pt._id] ? dt : tt && (Wt.isSubplotConstrained ? Wt.xaHash : Wt.yaHash)[pt._id] ? St : 0;
                }
                function wt(pt, dt) {
                  return dt ? (pt.range = pt._r.slice(), re(pt, dt), Ct(pt, dt)) : 0;
                }
                function Ct(pt, dt, St) {
                  return pt._length * (1 - dt) * I[St || pt.constraintoward || "middle"];
                }
                return nt;
              }
              function ce($, he, me, xe) {
                var Fe = v.ensureSingle($.draglayer, he, me, function(Ve) {
                  Ve.classed("drag", !0).style({
                    fill: "transparent",
                    "stroke-width": 0
                  }).attr("data-subplot", $.id);
                });
                return Fe.call(x, xe), Fe.node();
              }
              function X($, he, me, xe, Fe, Ve, Be) {
                var Je = ce($, "rect", he, me);
                return l.select(Je).call(w.setRect, xe, Fe, Ve, Be), Je;
              }
              function U($, he) {
                for (var me = 0; me < $.length; me++)
                  if (!$[me].fixedrange) return he;
                return "";
              }
              function ne($, he) {
                var me = $.range[he], xe = Math.abs(me - $.range[1 - he]), Fe;
                return $.type === "date" ? me : $.type === "log" ? (Fe = Math.ceil(Math.max(0, -Math.log(xe) / Math.LN10)) + 3, f("." + Fe + "g")(Math.pow(10, me))) : (Fe = Math.floor(Math.log(Math.abs(me)) / Math.LN10) - Math.floor(Math.log(xe) / Math.LN10) + 4, f("." + String(Fe) + "g")(me));
              }
              function se($, he, me, xe, Fe) {
                for (var Ve = 0; Ve < $.length; Ve++) {
                  var Be = $[Ve];
                  if (!Be.fixedrange)
                    if (Be.rangebreaks) {
                      var Je = Be._id.charAt(0) === "y", et = Je ? 1 - he : he, at = Je ? 1 - me : me;
                      xe[Be._name + ".range[0]"] = Be.l2r(Be.p2l(et * Be._length)), xe[Be._name + ".range[1]"] = Be.l2r(Be.p2l(at * Be._length));
                    } else {
                      var De = Be._rl[0], Ne = Be._rl[1] - De;
                      xe[Be._name + ".range[0]"] = Be.l2r(De + Ne * he), xe[Be._name + ".range[1]"] = Be.l2r(De + Ne * me);
                    }
                }
                if (Fe && Fe.length) {
                  var Ie = (he + (1 - me)) / 2;
                  se(Fe, Ie, 1 - Ie, xe, []);
                }
              }
              function le($, he) {
                for (var me = 0; me < $.length; me++) {
                  var xe = $[me];
                  if (!xe.fixedrange) {
                    if (xe.rangebreaks) {
                      var Fe = 0, Ve = xe._length, Be = xe.p2l(Fe + he) - xe.p2l(Fe), Je = xe.p2l(Ve + he) - xe.p2l(Ve), et = (Be + Je) / 2;
                      xe.range = [xe.l2r(xe._rl[0] - et), xe.l2r(xe._rl[1] - et)];
                    } else
                      xe.range = [xe.l2r(xe._rl[0] - he / xe._m), xe.l2r(xe._rl[1] - he / xe._m)];
                    xe.limitRange && xe.limitRange();
                  }
                }
              }
              function ue($) {
                return 1 - ($ >= 0 ? Math.min($, 0.9) : 1 / (1 / Math.max($, -0.3) + 3.222));
              }
              function ve($, he, me) {
                return $ ? $ === "nsew" ? me ? "" : he === "pan" ? "move" : "crosshair" : $.toLowerCase() + "-resize" : "pointer";
              }
              function be($, he, me, xe, Fe) {
                return $.append("path").attr("class", "zoombox").style({
                  fill: he > 0.2 ? "rgba(0,0,0,0)" : "rgba(255,255,255,0)",
                  "stroke-width": 0
                }).attr("transform", C(me, xe)).attr("d", Fe + "Z");
              }
              function Me($, he, me) {
                return $.append("path").attr("class", "zoombox-corners").style({
                  fill: h.background,
                  stroke: h.defaultLine,
                  "stroke-width": 1,
                  opacity: 0
                }).attr("transform", C(he, me)).attr("d", "M0,0Z");
              }
              function Ge($, he, me, xe, Fe, Ve) {
                $.attr("d", xe + "M" + me.l + "," + me.t + "v" + me.h + "h" + me.w + "v-" + me.h + "h-" + me.w + "Z"), we($, he, Fe, Ve);
              }
              function we($, he, me, xe) {
                me || ($.transition().style("fill", xe > 0.2 ? "rgba(0,0,0,0.4)" : "rgba(255,255,255,0.3)").duration(200), he.transition().style("opacity", 1).duration(200));
              }
              function Re($) {
                l.select($).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove();
              }
              function Ae($) {
                q && $.data && $._context.showTips && (v.notifier(v._($, "Double-click to zoom back out"), "long"), q = !1);
              }
              function K($, he) {
                return "M" + ($.l - 0.5) + "," + (he - W - 0.5) + "h-3v" + (2 * W + 1) + "h3ZM" + ($.r + 0.5) + "," + (he - W - 0.5) + "h3v" + (2 * W + 1) + "h-3Z";
              }
              function ee($, he) {
                return "M" + (he - W - 0.5) + "," + ($.t - 0.5) + "v-3h" + (2 * W + 1) + "v3ZM" + (he - W - 0.5) + "," + ($.b + 0.5) + "v3h" + (2 * W + 1) + "v-3Z";
              }
              function oe($) {
                var he = Math.floor(Math.min($.b - $.t, $.r - $.l, W) / 2);
                return "M" + ($.l - 3.5) + "," + ($.t - 0.5 + he) + "h3v" + -he + "h" + he + "v-3h-" + (he + 3) + "ZM" + ($.r + 3.5) + "," + ($.t - 0.5 + he) + "h-3v" + -he + "h" + -he + "v-3h" + (he + 3) + "ZM" + ($.r + 3.5) + "," + ($.b + 0.5 - he) + "h-3v" + he + "h" + -he + "v3h" + (he + 3) + "ZM" + ($.l - 3.5) + "," + ($.b + 0.5 - he) + "h3v" + he + "h" + he + "v3h-" + (he + 3) + "Z";
              }
              function _($, he, me, xe, Fe) {
                for (var Ve = !1, Be = {}, Je = {}, et, at, De, Ne, Ie = (Fe || {}).xaHash, Ue = (Fe || {}).yaHash, ot = 0; ot < he.length; ot++) {
                  var ct = he[ot];
                  for (et in me)
                    if (ct[et]) {
                      for (De in ct)
                        !(Fe && (Ie[De] || Ue[De])) && !(De.charAt(0) === "x" ? me : xe)[De] && (Be[De] = et);
                      for (at in xe)
                        !(Fe && (Ie[at] || Ue[at])) && ct[at] && (Ve = !0);
                    }
                  for (at in xe)
                    if (ct[at])
                      for (Ne in ct)
                        !(Fe && (Ie[Ne] || Ue[Ne])) && !(Ne.charAt(0) === "x" ? me : xe)[Ne] && (Je[Ne] = at);
                }
                Ve && (v.extendFlat(Be, Je), Je = {});
                var Tt = {}, kt = [];
                for (De in Be) {
                  var Ot = N($, De);
                  kt.push(Ot), Tt[Ot._id] = Ot;
                }
                var Rt = {}, xt = [];
                for (Ne in Je) {
                  var Wt = N($, Ne);
                  xt.push(Wt), Rt[Wt._id] = Wt;
                }
                return {
                  xaHash: Tt,
                  yaHash: Rt,
                  xaxes: kt,
                  yaxes: xt,
                  xLinks: Be,
                  yLinks: Je,
                  isSubplotConstrained: Ve
                };
              }
              function V($, he) {
                if (!g)
                  $.onwheel !== void 0 ? $.onwheel = he : $.onmousewheel !== void 0 ? $.onmousewheel = he : $.isAddedWheelEvent || ($.isAddedWheelEvent = !0, $.addEventListener("wheel", he, {
                    passive: !1
                  }));
                else {
                  var me = $.onwheel !== void 0 ? "wheel" : "mousewheel";
                  $._onwheel && $.removeEventListener(me, $._onwheel), $._onwheel = he, $.addEventListener(me, he, {
                    passive: !1
                  });
                }
              }
              function fe($) {
                var he = [];
                for (var me in $) he.push($[me]);
                return he;
              }
              s.exports = {
                makeDragBox: ie,
                makeDragger: ce,
                makeRectDragger: X,
                makeZoombox: be,
                makeCorners: Me,
                updateZoombox: Ge,
                xyCorners: oe,
                transitionZoombox: we,
                removeZoombox: Re,
                showDoubleClickNotifier: Ae,
                attachWheelEventHandler: V
              };
            }
          ),
          /***/
          2464: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3024), f = i(6476), p = i(3972), g = i(1184).makeDragBox, y = i(3816).DRAGGERSIZE;
              c.initInteractions = function(m) {
                var h = m._fullLayout;
                if (m._context.staticPlot) {
                  l.select(m).selectAll(".drag").remove();
                  return;
                }
                if (!(!h._has("cartesian") && !h._has("splom"))) {
                  var w = Object.keys(h._plots || {}).sort(function(E, x) {
                    if ((h._plots[E].mainplot && !0) === (h._plots[x].mainplot && !0)) {
                      var T = E.split("y"), F = x.split("y");
                      return T[0] === F[0] ? Number(T[1] || 1) - Number(F[1] || 1) : Number(T[0] || 1) - Number(F[0] || 1);
                    }
                    return h._plots[E].mainplot ? 1 : -1;
                  });
                  w.forEach(function(E) {
                    var x = h._plots[E], T = x.xaxis, F = x.yaxis;
                    if (!x.mainplot) {
                      var P = g(m, x, T._offset, F._offset, T._length, F._length, "ns", "ew");
                      P.onmousemove = function(L) {
                        m._fullLayout._rehover = function() {
                          m._fullLayout._hoversubplot === E && m._fullLayout._plots[E] && v.hover(m, L, E);
                        }, v.hover(m, L, E), m._fullLayout._lasthover = P, m._fullLayout._hoversubplot = E;
                      }, P.onmouseout = function(L) {
                        m._dragging || (m._fullLayout._hoversubplot = null, f.unhover(m, L));
                      }, m._context.showAxisDragHandles && (g(m, x, T._offset - y, F._offset - y, y, y, "n", "w"), g(m, x, T._offset + T._length, F._offset - y, y, y, "n", "e"), g(m, x, T._offset - y, F._offset + F._length, y, y, "s", "w"), g(m, x, T._offset + T._length, F._offset + F._length, y, y, "s", "e"));
                    }
                    if (m._context.showAxisDragHandles) {
                      if (E === T._mainSubplot) {
                        var k = T._mainLinePosition;
                        T.side === "top" && (k -= y), g(m, x, T._offset + T._length * 0.1, k, T._length * 0.8, y, "", "ew"), g(m, x, T._offset, k, T._length * 0.1, y, "", "w"), g(m, x, T._offset + T._length * 0.9, k, T._length * 0.1, y, "", "e");
                      }
                      if (E === F._mainSubplot) {
                        var I = F._mainLinePosition;
                        F.side !== "right" && (I -= y), g(m, x, I, F._offset + F._length * 0.1, y, F._length * 0.8, "ns", ""), g(m, x, I, F._offset + F._length * 0.9, y, F._length * 0.1, "s", ""), g(m, x, I, F._offset, y, F._length * 0.1, "n", "");
                      }
                    }
                  });
                  var S = h._hoverlayer.node();
                  S.onmousemove = function(E) {
                    E.target = m._fullLayout._lasthover, v.hover(m, E, h._hoversubplot);
                  }, S.onclick = function(E) {
                    E.target = m._fullLayout._lasthover, v.click(m, E);
                  }, S.onmousedown = function(E) {
                    m._fullLayout._lasthover.onmousedown(E);
                  }, c.updateFx(m);
                }
              }, c.updateFx = function(C) {
                var m = C._fullLayout, h = m.dragmode === "pan" ? "move" : "crosshair";
                p(m._draggers, h);
              };
            }
          ),
          /***/
          6632: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3400), f = i(9811);
              s.exports = function(g) {
                return function(C, m) {
                  var h = C[g];
                  if (Array.isArray(h))
                    for (var w = l.subplotsRegistry.cartesian, S = w.idRegex, E = m._subplots, x = E.xaxis, T = E.yaxis, F = E.cartesian, P = m._has("cartesian") || m._has("gl2d"), k = 0; k < h.length; k++) {
                      var I = h[k];
                      if (v.isPlainObject(I)) {
                        var L = f.cleanId(I.xref, "x", !1), A = f.cleanId(I.yref, "y", !1), O = S.x.test(L), N = S.y.test(A);
                        if (O || N) {
                          P || v.pushUnique(m._basePlotModules, w);
                          var Y = !1;
                          O && x.indexOf(L) === -1 && (x.push(L), Y = !0), N && T.indexOf(A) === -1 && (T.push(A), Y = !0), Y && O && N && F.push(L + A);
                        }
                      }
                    }
                };
              };
            }
          ),
          /***/
          7952: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(3400), p = i(7316), g = i(3616), y = i(4888)._M, C = i(9811), m = i(3816), h = i(9616), w = f.ensureSingle;
              function S(k, I, L) {
                return f.ensureSingle(k, I, L, function(A) {
                  A.datum(L);
                });
              }
              c.name = "cartesian", c.attr = ["xaxis", "yaxis"], c.idRoot = ["x", "y"], c.idRegex = m.idRegex, c.attrRegex = m.attrRegex, c.attributes = i(6720), c.layoutAttributes = i(4724), c.supplyLayoutDefaults = i(7352), c.transitionAxes = i(3736), c.finalizeSubplots = function(k, I) {
                var L = I._subplots, A = L.xaxis, O = L.yaxis, N = L.cartesian, Y = N.concat(L.gl2d || []), j = {}, te = {}, re, z, Z;
                for (re = 0; re < Y.length; re++) {
                  var W = Y[re].split("y");
                  j[W[0]] = 1, te["y" + W[1]] = 1;
                }
                for (re = 0; re < A.length; re++)
                  z = A[re], j[z] || (Z = (k[C.id2name(z)] || {}).anchor, m.idRegex.y.test(Z) || (Z = "y"), N.push(z + Z), Y.push(z + Z), te[Z] || (te[Z] = 1, f.pushUnique(O, Z)));
                for (re = 0; re < O.length; re++)
                  Z = O[re], te[Z] || (z = (k[C.id2name(Z)] || {}).anchor, m.idRegex.x.test(z) || (z = "x"), N.push(z + Z), Y.push(z + Z), j[z] || (j[z] = 1, f.pushUnique(A, z)));
                if (!Y.length) {
                  z = "", Z = "";
                  for (var q in k)
                    if (m.attrRegex.test(q)) {
                      var ie = q.charAt(0);
                      ie === "x" ? (!z || +q.substr(5) < +z.substr(5)) && (z = q) : (!Z || +q.substr(5) < +Z.substr(5)) && (Z = q);
                    }
                  z = z ? C.name2id(z) : "x", Z = Z ? C.name2id(Z) : "y", A.push(z), O.push(Z), N.push(z + Z);
                }
              }, c.plot = function(k, I, L, A) {
                var O = k._fullLayout, N = O._subplots.cartesian, Y = k.calcdata, j;
                if (!Array.isArray(I))
                  for (I = [], j = 0; j < Y.length; j++) I.push(j);
                for (j = 0; j < N.length; j++) {
                  for (var te = N[j], re = O._plots[te], z = [], Z, W = 0; W < Y.length; W++) {
                    var q = Y[W], ie = q[0].trace;
                    ie.xaxis + ie.yaxis === te && ((I.indexOf(ie.index) !== -1 || ie.carpet) && (Z && Z[0].trace.xaxis + Z[0].trace.yaxis === te && ["tonextx", "tonexty", "tonext"].indexOf(ie.fill) !== -1 && z.indexOf(Z) === -1 && z.push(Z), z.push(q)), Z = q);
                  }
                  E(k, re, z, L, A);
                }
              };
              function E(k, I, L, A, O) {
                for (var N = m.traceLayerClasses, Y = k._fullLayout, j = Y._modules, te, re, z, Z = {}, W = 0; W < L.length; W++) {
                  var q = L[W][0].trace, ie = q.zorder || 0;
                  Z[ie] || (Z[ie] = []), Z[ie].push(L[W]);
                }
                for (var ce = [], X = [], U = Object.keys(Z).map(Number).sort(f.sorterAsc), ne = 0; ne < U.length; ne++)
                  for (var se = U[ne], le = 0; le < j.length; le++) {
                    te = j[le];
                    var ue = te.name, ve = v.modules[ue].categories;
                    if (ve.svg) {
                      var be = te.layerName || ue + "layer", Me = be + (ne ? Number(ne) + 1 : ""), Ge = te.plot;
                      re = y(L, Ge, se), z = re[0], L = re[1], z.length && ce.push({
                        i: N.indexOf(be),
                        zorder: ne,
                        className: Me,
                        plotMethod: Ge,
                        cdModule: z
                      }), ve.zoomScale && X.push("." + Me);
                    }
                  }
                ce.sort(function(Ae, K) {
                  return (Ae.zorder || 0) - (K.zorder || 0) || Ae.i - K.i;
                });
                var we = I.plot.selectAll("g.mlayer").data(ce, function(Ae) {
                  return Ae.className;
                });
                if (we.enter().append("g").attr("class", function(Ae) {
                  return Ae.className;
                }).classed("mlayer", !0).classed("rangeplot", I.isRangePlot), we.exit().remove(), we.order(), we.each(function(Ae) {
                  var K = l.select(this), ee = Ae.className;
                  Ae.plotMethod(k, I, Ae.cdModule, K, A, O), m.clipOnAxisFalseQuery.indexOf("." + ee) === -1 && g.setClipUrl(K, I.layerClipId, k);
                }), Y._has("scattergl") && (te = v.getModule("scattergl"), z = y(L, te)[0], te.plot(k, I, z)), !k._context.staticPlot && (I._hasClipOnAxisFalse && (I.clipOnAxisFalseTraces = I.plot.selectAll(m.clipOnAxisFalseQuery.join(",")).selectAll(".trace")), X.length)) {
                  var Re = I.plot.selectAll(X.join(",")).selectAll(".trace");
                  I.zoomScalePts = Re.selectAll("path.point"), I.zoomScaleTxt = Re.selectAll(".textpoint");
                }
              }
              c.clean = function(k, I, L, A) {
                var O = A._plots || {}, N = I._plots || {}, Y = A._subplots || {}, j, te, re;
                if (A._hasOnlyLargeSploms && !I._hasOnlyLargeSploms)
                  for (re in O)
                    j = O[re], j.plotgroup && j.plotgroup.remove();
                var z = A._has && A._has("gl"), Z = I._has && I._has("gl");
                if (z && !Z)
                  for (re in O)
                    j = O[re], j._scene && j._scene.destroy();
                if (Y.xaxis && Y.yaxis) {
                  var W = C.listIds({
                    _fullLayout: A
                  });
                  for (te = 0; te < W.length; te++) {
                    var q = W[te];
                    I[C.id2name(q)] || A._infolayer.selectAll(".g-" + q + "title").remove();
                  }
                }
                var ie = A._has && A._has("cartesian"), ce = I._has && I._has("cartesian");
                if (ie && !ce)
                  F(A._cartesianlayer.selectAll(".subplot"), A), A._defs.selectAll(".axesclip").remove(), delete A._axisConstraintGroups, delete A._axisMatchGroups;
                else if (Y.cartesian)
                  for (te = 0; te < Y.cartesian.length; te++) {
                    var X = Y.cartesian[te];
                    if (!N[X]) {
                      var U = "." + X + ",." + X + "-x,." + X + "-y";
                      A._cartesianlayer.selectAll(U).remove(), P(X, A);
                    }
                  }
              }, c.drawFramework = function(k) {
                var I = k._fullLayout, L = x(k), A = I._cartesianlayer.selectAll(".subplot").data(L, String);
                A.enter().append("g").attr("class", function(O) {
                  return "subplot " + O[0];
                }), A.order(), A.exit().call(F, I), A.each(function(O) {
                  var N = O[0], Y = I._plots[N];
                  Y.plotgroup = l.select(this), T(k, Y), Y.draglayer = w(I._draggers, "g", N);
                });
              }, c.rangePlot = function(k, I, L) {
                T(k, I), E(k, I, L), p.style(k);
              };
              function x(k) {
                var I = k._fullLayout, L = I._subplots.cartesian, A = L.length, O, N, Y, j, te, re, z = [], Z = [];
                for (O = 0; O < A; O++) {
                  Y = L[O], j = I._plots[Y], te = j.xaxis, re = j.yaxis;
                  var W = te._mainAxis, q = re._mainAxis, ie = W._id + q._id, ce = I._plots[ie];
                  j.overlays = [], ie !== Y && ce ? (j.mainplot = ie, j.mainplotinfo = ce, Z.push(Y)) : (j.mainplot = void 0, j.mainplotinfo = void 0, z.push(Y));
                }
                for (O = 0; O < Z.length; O++)
                  Y = Z[O], j = I._plots[Y], j.mainplotinfo.overlays.push(j);
                var X = z.concat(Z), U = new Array(A);
                for (O = 0; O < A; O++) {
                  Y = X[O], j = I._plots[Y], te = j.xaxis, re = j.yaxis;
                  var ne = [Y, te.layer, re.layer, te.overlaying || "", re.overlaying || ""];
                  for (N = 0; N < j.overlays.length; N++)
                    ne.push(j.overlays[N].id);
                  U[O] = ne;
                }
                return U;
              }
              function T(k, I) {
                var L = I.plotgroup, A = I.id, O = m.layerValue2layerClass[I.xaxis.layer], N = m.layerValue2layerClass[I.yaxis.layer], Y = k._fullLayout._hasOnlyLargeSploms;
                if (I.mainplot) {
                  var re = I.mainplotinfo, z = re.plotgroup, Z = A + "-x", W = A + "-y";
                  I.minorGridlayer = re.minorGridlayer, I.gridlayer = re.gridlayer, I.zerolinelayer = re.zerolinelayer, w(re.overlinesBelow, "path", Z), w(re.overlinesBelow, "path", W), w(re.overaxesBelow, "g", Z), w(re.overaxesBelow, "g", W), I.plot = w(re.overplot, "g", A), w(re.overlinesAbove, "path", Z), w(re.overlinesAbove, "path", W), w(re.overaxesAbove, "g", Z), w(re.overaxesAbove, "g", W), I.xlines = z.select(".overlines-" + O).select("." + Z), I.ylines = z.select(".overlines-" + N).select("." + W), I.xaxislayer = z.select(".overaxes-" + O).select("." + Z), I.yaxislayer = z.select(".overaxes-" + N).select("." + W);
                } else if (Y)
                  I.xlines = w(L, "path", "xlines-above"), I.ylines = w(L, "path", "ylines-above"), I.xaxislayer = w(L, "g", "xaxislayer-above"), I.yaxislayer = w(L, "g", "yaxislayer-above");
                else {
                  var j = w(L, "g", "layer-subplot");
                  I.shapelayer = w(j, "g", "shapelayer"), I.imagelayer = w(j, "g", "imagelayer"), I.minorGridlayer = w(L, "g", "minor-gridlayer"), I.gridlayer = w(L, "g", "gridlayer"), I.zerolinelayer = w(L, "g", "zerolinelayer");
                  var te = w(L, "g", "layer-between");
                  I.shapelayerBetween = w(te, "g", "shapelayer"), I.imagelayerBetween = w(te, "g", "imagelayer"), w(L, "path", "xlines-below"), w(L, "path", "ylines-below"), I.overlinesBelow = w(L, "g", "overlines-below"), w(L, "g", "xaxislayer-below"), w(L, "g", "yaxislayer-below"), I.overaxesBelow = w(L, "g", "overaxes-below"), I.plot = w(L, "g", "plot"), I.overplot = w(L, "g", "overplot"), I.xlines = w(L, "path", "xlines-above"), I.ylines = w(L, "path", "ylines-above"), I.overlinesAbove = w(L, "g", "overlines-above"), w(L, "g", "xaxislayer-above"), w(L, "g", "yaxislayer-above"), I.overaxesAbove = w(L, "g", "overaxes-above"), I.xlines = L.select(".xlines-" + O), I.ylines = L.select(".ylines-" + N), I.xaxislayer = L.select(".xaxislayer-" + O), I.yaxislayer = L.select(".yaxislayer-" + N);
                }
                Y || (S(I.minorGridlayer, "g", I.xaxis._id), S(I.minorGridlayer, "g", I.yaxis._id), I.minorGridlayer.selectAll("g").map(function(q) {
                  return q[0];
                }).sort(C.idSort), S(I.gridlayer, "g", I.xaxis._id), S(I.gridlayer, "g", I.yaxis._id), I.gridlayer.selectAll("g").map(function(q) {
                  return q[0];
                }).sort(C.idSort)), I.xlines.style("fill", "none").classed("crisp", !0), I.ylines.style("fill", "none").classed("crisp", !0);
              }
              function F(k, I) {
                if (k) {
                  var L = {};
                  k.each(function(te) {
                    var re = te[0], z = l.select(this);
                    z.remove(), P(re, I), L[re] = !0;
                  });
                  for (var A in I._plots)
                    for (var O = I._plots[A], N = O.overlays || [], Y = 0; Y < N.length; Y++) {
                      var j = N[Y];
                      L[j.id] && j.plot.selectAll(".trace").remove();
                    }
                }
              }
              function P(k, I) {
                I._draggers.selectAll("g." + k).remove(), I._defs.select("#clip" + I._uid + k + "plot").remove();
              }
              c.toSVG = function(k) {
                var I = k._fullLayout._glimages, L = l.select(k).selectAll(".svg-container"), A = L.filter(function(N, Y) {
                  return Y === L.size() - 1;
                }).selectAll(".gl-canvas-context, .gl-canvas-focus");
                function O() {
                  var N = this, Y = N.toDataURL("image/png"), j = I.append("svg:image");
                  j.attr({
                    xmlns: h.svg,
                    "xlink:href": Y,
                    preserveAspectRatio: "none",
                    x: 0,
                    y: 0,
                    width: N.style.width,
                    height: N.style.height
                  });
                }
                A.each(O);
              }, c.updateFx = i(2464).updateFx;
            }
          ),
          /***/
          4724: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(2548), f = i(8192).u, p = i(2880).extendFlat, g = i(1780).templatedArray, y = i(9736).descriptionWithDates, C = i(9032).ONEDAY, m = i(3816), h = m.HOUR_PATTERN, w = m.WEEKDAY_PATTERN, S = {
                valType: "enumerated",
                values: ["auto", "linear", "array"],
                editType: "ticks",
                impliedEdits: {
                  tick0: void 0,
                  dtick: void 0
                }
              }, E = p({}, S, {
                values: S.values.slice().concat(["sync"])
              });
              function x(te) {
                return {
                  valType: "integer",
                  min: 0,
                  dflt: te ? 5 : 0,
                  editType: "ticks"
                };
              }
              var T = {
                valType: "any",
                editType: "ticks",
                impliedEdits: {
                  tickmode: "linear"
                }
              }, F = {
                valType: "any",
                editType: "ticks",
                impliedEdits: {
                  tickmode: "linear"
                }
              }, P = {
                valType: "data_array",
                editType: "ticks"
              }, k = {
                valType: "enumerated",
                values: ["outside", "inside", ""],
                editType: "ticks"
              };
              function I(te) {
                var re = {
                  valType: "number",
                  min: 0,
                  editType: "ticks"
                };
                return te || (re.dflt = 5), re;
              }
              function L(te) {
                var re = {
                  valType: "number",
                  min: 0,
                  editType: "ticks"
                };
                return te || (re.dflt = 1), re;
              }
              var A = {
                valType: "color",
                dflt: v.defaultLine,
                editType: "ticks"
              }, O = {
                valType: "color",
                dflt: v.lightLine,
                editType: "ticks"
              };
              function N(te) {
                var re = {
                  valType: "number",
                  min: 0,
                  editType: "ticks"
                };
                return te || (re.dflt = 1), re;
              }
              var Y = p({}, f, {
                editType: "ticks"
              }), j = {
                valType: "boolean",
                editType: "ticks"
              };
              s.exports = {
                visible: {
                  valType: "boolean",
                  editType: "plot"
                },
                color: {
                  valType: "color",
                  dflt: v.defaultLine,
                  editType: "ticks"
                },
                title: {
                  text: {
                    valType: "string",
                    editType: "ticks"
                  },
                  font: l({
                    editType: "ticks"
                  }),
                  standoff: {
                    valType: "number",
                    min: 0,
                    editType: "ticks"
                  },
                  editType: "ticks"
                },
                type: {
                  valType: "enumerated",
                  // '-' means we haven't yet run autotype or couldn't find any data
                  // it gets turned into linear in gd._fullLayout but not copied back
                  // to gd.data like the others are.
                  values: ["-", "linear", "log", "date", "category", "multicategory"],
                  dflt: "-",
                  editType: "calc",
                  // we forget when an axis has been autotyped, just writing the auto
                  // value back to the input - so it doesn't make sense to template this.
                  // Note: we do NOT prohibit this in `coerce`, so if someone enters a
                  // type in the template explicitly it will be honored as the default.
                  _noTemplating: !0
                },
                autotypenumbers: {
                  valType: "enumerated",
                  values: ["convert types", "strict"],
                  dflt: "convert types",
                  editType: "calc"
                },
                autorange: {
                  valType: "enumerated",
                  values: [!0, !1, "reversed", "min reversed", "max reversed", "min", "max"],
                  dflt: !0,
                  editType: "axrange",
                  impliedEdits: {
                    "range[0]": void 0,
                    "range[1]": void 0
                  }
                },
                autorangeoptions: {
                  minallowed: {
                    valType: "any",
                    editType: "plot",
                    impliedEdits: {
                      "range[0]": void 0,
                      "range[1]": void 0
                    }
                  },
                  maxallowed: {
                    valType: "any",
                    editType: "plot",
                    impliedEdits: {
                      "range[0]": void 0,
                      "range[1]": void 0
                    }
                  },
                  clipmin: {
                    valType: "any",
                    editType: "plot",
                    impliedEdits: {
                      "range[0]": void 0,
                      "range[1]": void 0
                    }
                  },
                  clipmax: {
                    valType: "any",
                    editType: "plot",
                    impliedEdits: {
                      "range[0]": void 0,
                      "range[1]": void 0
                    }
                  },
                  include: {
                    valType: "any",
                    arrayOk: !0,
                    editType: "plot",
                    impliedEdits: {
                      "range[0]": void 0,
                      "range[1]": void 0
                    }
                  },
                  editType: "plot"
                },
                rangemode: {
                  valType: "enumerated",
                  values: ["normal", "tozero", "nonnegative"],
                  dflt: "normal",
                  editType: "plot"
                },
                range: {
                  valType: "info_array",
                  items: [{
                    valType: "any",
                    editType: "axrange",
                    impliedEdits: {
                      "^autorange": !1
                    },
                    anim: !0
                  }, {
                    valType: "any",
                    editType: "axrange",
                    impliedEdits: {
                      "^autorange": !1
                    },
                    anim: !0
                  }],
                  editType: "axrange",
                  impliedEdits: {
                    autorange: !1
                  },
                  anim: !0
                },
                minallowed: {
                  valType: "any",
                  editType: "plot",
                  impliedEdits: {
                    "^autorange": !1
                  }
                },
                maxallowed: {
                  valType: "any",
                  editType: "plot",
                  impliedEdits: {
                    "^autorange": !1
                  }
                },
                fixedrange: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "calc"
                },
                insiderange: {
                  valType: "info_array",
                  items: [{
                    valType: "any",
                    editType: "plot"
                  }, {
                    valType: "any",
                    editType: "plot"
                  }],
                  editType: "plot"
                },
                // scaleanchor: not used directly, just put here for reference
                // values are any opposite-letter axis id, or `false`.
                scaleanchor: {
                  valType: "enumerated",
                  values: [m.idRegex.x.toString(), m.idRegex.y.toString(), !1],
                  editType: "plot"
                },
                scaleratio: {
                  valType: "number",
                  min: 0,
                  dflt: 1,
                  editType: "plot"
                },
                constrain: {
                  valType: "enumerated",
                  values: ["range", "domain"],
                  editType: "plot"
                },
                // constraintoward: not used directly, just put here for reference
                constraintoward: {
                  valType: "enumerated",
                  values: ["left", "center", "right", "top", "middle", "bottom"],
                  editType: "plot"
                },
                matches: {
                  valType: "enumerated",
                  values: [m.idRegex.x.toString(), m.idRegex.y.toString()],
                  editType: "calc"
                },
                rangebreaks: g("rangebreak", {
                  enabled: {
                    valType: "boolean",
                    dflt: !0,
                    editType: "calc"
                  },
                  bounds: {
                    valType: "info_array",
                    items: [{
                      valType: "any",
                      editType: "calc"
                    }, {
                      valType: "any",
                      editType: "calc"
                    }],
                    editType: "calc"
                  },
                  pattern: {
                    valType: "enumerated",
                    values: [w, h, ""],
                    editType: "calc"
                  },
                  values: {
                    valType: "info_array",
                    freeLength: !0,
                    editType: "calc",
                    items: {
                      valType: "any",
                      editType: "calc"
                    }
                  },
                  dvalue: {
                    // TODO could become 'any' to add support for 'months', 'years'
                    valType: "number",
                    editType: "calc",
                    min: 0,
                    dflt: C
                  },
                  /*
                  gap: {
                      valType: 'number',
                      min: 0,
                      dflt: 0, // for *date* axes, maybe something else for *linear*
                      editType: 'calc',
                  },
                  gapmode: {
                      valType: 'enumerated',
                      values: ['pixels', 'fraction'],
                      dflt: 'pixels',
                      editType: 'calc',
                  },
                  */
                  // To complete https://github.com/plotly/plotly.js/issues/4210
                  // we additionally need `gap` and make this work on *linear*, and
                  // possibly all other cartesian axis types. We possibly would also need
                  // some style attributes controlling the zig-zag on the corresponding
                  // axis.
                  editType: "calc"
                }),
                // ticks
                tickmode: E,
                nticks: x(),
                tick0: T,
                dtick: F,
                ticklabelstep: {
                  valType: "integer",
                  min: 1,
                  dflt: 1,
                  editType: "ticks"
                },
                tickvals: P,
                ticktext: {
                  valType: "data_array",
                  editType: "ticks"
                },
                ticks: k,
                tickson: {
                  valType: "enumerated",
                  values: ["labels", "boundaries"],
                  dflt: "labels",
                  editType: "ticks"
                },
                ticklabelmode: {
                  valType: "enumerated",
                  values: ["instant", "period"],
                  dflt: "instant",
                  editType: "ticks"
                },
                // ticklabelposition: not used directly, as values depend on direction (similar to side)
                // left/right options are for x axes, and top/bottom options are for y axes
                ticklabelposition: {
                  valType: "enumerated",
                  values: ["outside", "inside", "outside top", "inside top", "outside left", "inside left", "outside right", "inside right", "outside bottom", "inside bottom"],
                  dflt: "outside",
                  editType: "calc"
                },
                ticklabeloverflow: {
                  valType: "enumerated",
                  values: ["allow", "hide past div", "hide past domain"],
                  editType: "calc"
                },
                mirror: {
                  valType: "enumerated",
                  values: [!0, "ticks", !1, "all", "allticks"],
                  dflt: !1,
                  editType: "ticks+layoutstyle"
                },
                ticklen: I(),
                tickwidth: L(),
                tickcolor: A,
                showticklabels: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "ticks"
                },
                labelalias: {
                  valType: "any",
                  dflt: !1,
                  editType: "ticks"
                },
                automargin: {
                  valType: "flaglist",
                  flags: ["height", "width", "left", "right", "top", "bottom"],
                  extras: [!0, !1],
                  dflt: !1,
                  editType: "ticks"
                },
                showspikes: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "modebar"
                },
                spikecolor: {
                  valType: "color",
                  dflt: null,
                  editType: "none"
                },
                spikethickness: {
                  valType: "number",
                  dflt: 3,
                  editType: "none"
                },
                spikedash: p({}, f, {
                  dflt: "dash",
                  editType: "none"
                }),
                spikemode: {
                  valType: "flaglist",
                  flags: ["toaxis", "across", "marker"],
                  dflt: "toaxis",
                  editType: "none"
                },
                spikesnap: {
                  valType: "enumerated",
                  values: ["data", "cursor", "hovered data"],
                  dflt: "hovered data",
                  editType: "none"
                },
                tickfont: l({
                  editType: "ticks"
                }),
                tickangle: {
                  valType: "angle",
                  dflt: "auto",
                  editType: "ticks"
                },
                autotickangles: {
                  valType: "info_array",
                  freeLength: !0,
                  items: {
                    valType: "angle"
                  },
                  dflt: [0, 30, 90],
                  editType: "ticks"
                },
                tickprefix: {
                  valType: "string",
                  dflt: "",
                  editType: "ticks"
                },
                showtickprefix: {
                  valType: "enumerated",
                  values: ["all", "first", "last", "none"],
                  dflt: "all",
                  editType: "ticks"
                },
                ticksuffix: {
                  valType: "string",
                  dflt: "",
                  editType: "ticks"
                },
                showticksuffix: {
                  valType: "enumerated",
                  values: ["all", "first", "last", "none"],
                  dflt: "all",
                  editType: "ticks"
                },
                showexponent: {
                  valType: "enumerated",
                  values: ["all", "first", "last", "none"],
                  dflt: "all",
                  editType: "ticks"
                },
                exponentformat: {
                  valType: "enumerated",
                  values: ["none", "e", "E", "power", "SI", "B"],
                  dflt: "B",
                  editType: "ticks"
                },
                minexponent: {
                  valType: "number",
                  dflt: 3,
                  min: 0,
                  editType: "ticks"
                },
                separatethousands: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "ticks"
                },
                tickformat: {
                  valType: "string",
                  dflt: "",
                  editType: "ticks",
                  description: y("tick label")
                },
                tickformatstops: g("tickformatstop", {
                  enabled: {
                    valType: "boolean",
                    dflt: !0,
                    editType: "ticks"
                  },
                  dtickrange: {
                    valType: "info_array",
                    items: [{
                      valType: "any",
                      editType: "ticks"
                    }, {
                      valType: "any",
                      editType: "ticks"
                    }],
                    editType: "ticks"
                  },
                  value: {
                    valType: "string",
                    dflt: "",
                    editType: "ticks"
                  },
                  editType: "ticks"
                }),
                hoverformat: {
                  valType: "string",
                  dflt: "",
                  editType: "none",
                  description: y("hover text")
                },
                // lines and grids
                showline: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "ticks+layoutstyle"
                },
                linecolor: {
                  valType: "color",
                  dflt: v.defaultLine,
                  editType: "layoutstyle"
                },
                linewidth: {
                  valType: "number",
                  min: 0,
                  dflt: 1,
                  editType: "ticks+layoutstyle"
                },
                showgrid: j,
                gridcolor: O,
                gridwidth: N(),
                griddash: Y,
                zeroline: {
                  valType: "boolean",
                  editType: "ticks"
                },
                zerolinecolor: {
                  valType: "color",
                  dflt: v.defaultLine,
                  editType: "ticks"
                },
                zerolinewidth: {
                  valType: "number",
                  dflt: 1,
                  editType: "ticks"
                },
                showdividers: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "ticks"
                },
                dividercolor: {
                  valType: "color",
                  dflt: v.defaultLine,
                  editType: "ticks"
                },
                dividerwidth: {
                  valType: "number",
                  dflt: 1,
                  editType: "ticks"
                },
                // TODO dividerlen: that would override "to label base" length?
                // positioning attributes
                // anchor: not used directly, just put here for reference
                // values are any opposite-letter axis id
                anchor: {
                  valType: "enumerated",
                  values: ["free", m.idRegex.x.toString(), m.idRegex.y.toString()],
                  editType: "plot"
                },
                // side: not used directly, as values depend on direction
                // values are top, bottom for x axes, and left, right for y
                side: {
                  valType: "enumerated",
                  values: ["top", "bottom", "left", "right"],
                  editType: "plot"
                },
                // overlaying: not used directly, just put here for reference
                // values are false and any other same-letter axis id that's not
                // itself overlaying anything
                overlaying: {
                  valType: "enumerated",
                  values: ["free", m.idRegex.x.toString(), m.idRegex.y.toString()],
                  editType: "plot"
                },
                minor: {
                  tickmode: S,
                  nticks: x("minor"),
                  tick0: T,
                  dtick: F,
                  tickvals: P,
                  ticks: k,
                  ticklen: I("minor"),
                  tickwidth: L("minor"),
                  tickcolor: A,
                  gridcolor: O,
                  gridwidth: N("minor"),
                  griddash: Y,
                  showgrid: j,
                  editType: "ticks"
                },
                layer: {
                  valType: "enumerated",
                  values: ["above traces", "below traces"],
                  dflt: "above traces",
                  editType: "plot"
                },
                domain: {
                  valType: "info_array",
                  items: [{
                    valType: "number",
                    min: 0,
                    max: 1,
                    editType: "plot"
                  }, {
                    valType: "number",
                    min: 0,
                    max: 1,
                    editType: "plot"
                  }],
                  dflt: [0, 1],
                  editType: "plot"
                },
                position: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 0,
                  editType: "plot"
                },
                autoshift: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "plot"
                },
                shift: {
                  valType: "number",
                  editType: "plot"
                },
                categoryorder: {
                  valType: "enumerated",
                  values: ["trace", "category ascending", "category descending", "array", "total ascending", "total descending", "min ascending", "min descending", "max ascending", "max descending", "sum ascending", "sum descending", "mean ascending", "mean descending", "median ascending", "median descending"],
                  dflt: "trace",
                  editType: "calc"
                },
                categoryarray: {
                  valType: "data_array",
                  editType: "calc"
                },
                uirevision: {
                  valType: "any",
                  editType: "none"
                },
                editType: "calc",
                _deprecated: {
                  autotick: {
                    valType: "boolean",
                    editType: "ticks"
                  },
                  title: {
                    valType: "string",
                    editType: "ticks"
                  },
                  titlefont: l({
                    editType: "ticks"
                  })
                }
              };
            }
          ),
          /***/
          7352: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(6308), f = i(624).isUnifiedHover, p = i(1008), g = i(1780), y = i(4859), C = i(4724), m = i(4944), h = i(5955), w = i(1888), S = i(7668), E = i(9811), x = E.id2name, T = E.name2id, F = i(3816).AX_ID_PATTERN, P = i(4040), k = P.traceIs, I = P.getComponentMethod;
              function L(A, O, N) {
                Array.isArray(A[O]) ? A[O].push(N) : A[O] = [N];
              }
              s.exports = function(O, N, Y) {
                var j = N.autotypenumbers, te = {}, re = {}, z = {}, Z = {}, W = {}, q = {}, ie = {}, ce = {}, X = {}, U = {}, ne, se;
                for (ne = 0; ne < Y.length; ne++) {
                  var le = Y[ne];
                  if (!(!k(le, "cartesian") && !k(le, "gl2d"))) {
                    var ue;
                    if (le.xaxis)
                      ue = x(le.xaxis), L(te, ue, le);
                    else if (le.xaxes)
                      for (se = 0; se < le.xaxes.length; se++)
                        L(te, x(le.xaxes[se]), le);
                    var ve;
                    if (le.yaxis)
                      ve = x(le.yaxis), L(te, ve, le);
                    else if (le.yaxes)
                      for (se = 0; se < le.yaxes.length; se++)
                        L(te, x(le.yaxes[se]), le);
                    if (le.type === "funnel" ? le.orientation === "h" ? (ue && (re[ue] = !0), ve && (ie[ve] = !0)) : ve && (z[ve] = !0) : le.type === "image" ? (ve && (ce[ve] = !0), ue && (ce[ue] = !0)) : (ve && (W[ve] = !0, q[ve] = !0), (!k(le, "carpet") || le.type === "carpet" && !le._cheater) && ue && (Z[ue] = !0)), le.type === "carpet" && le._cheater && ue && (re[ue] = !0), k(le, "2dMap") && (X[ue] = !0, X[ve] = !0), k(le, "oriented")) {
                      var be = le.orientation === "h" ? ve : ue;
                      U[be] = !0;
                    }
                  }
                }
                var Me = N._subplots, Ge = Me.xaxis, we = Me.yaxis, Re = l.simpleMap(Ge, x), Ae = l.simpleMap(we, x), K = Re.concat(Ae), ee = v.background;
                Ge.length && we.length && (ee = l.coerce(O, N, y, "plot_bgcolor"));
                var oe = v.combine(ee, N.paper_bgcolor), _, V, fe, $, he;
                function me() {
                  var Te = te[_] || [];
                  he._traceIndices = Te.map(function(Oe) {
                    return Oe._expandedIndex;
                  }), he._annIndices = [], he._shapeIndices = [], he._selectionIndices = [], he._imgIndices = [], he._subplotsWith = [], he._counterAxes = [], he._name = he._attr = _, he._id = V;
                }
                function xe(Te, Oe) {
                  return l.coerce($, he, C, Te, Oe);
                }
                function Fe(Te, Oe) {
                  return l.coerce2($, he, C, Te, Oe);
                }
                function Ve(Te) {
                  return Te === "x" ? we : Ge;
                }
                function Be(Te, Oe) {
                  for (var je = Te === "x" ? Re : Ae, Xe = [], nt = 0; nt < je.length; nt++) {
                    var it = je[nt];
                    it !== Oe && !(O[it] || {}).overlaying && Xe.push(T(it));
                  }
                  return Xe;
                }
                var Je = {
                  x: Ve("x"),
                  y: Ve("y")
                }, et = Je.x.concat(Je.y), at = {}, De = [];
                function Ne() {
                  var Te = $.matches;
                  F.test(Te) && et.indexOf(Te) === -1 && (at[Te] = $.type, De = Object.keys(at));
                }
                var Ie = p(O, N), Ue = f(Ie);
                for (ne = 0; ne < K.length; ne++) {
                  _ = K[ne], V = T(_), fe = _.charAt(0), l.isPlainObject(O[_]) || (O[_] = {}), $ = O[_], he = g.newContainer(N, _, fe + "axis"), me();
                  var ot = fe === "x" && !Z[_] && re[_] || fe === "y" && !W[_] && z[_], ct = fe === "y" && (!q[_] && ie[_] || ce[_]), Tt = {
                    hasMinor: !0,
                    letter: fe,
                    font: N.font,
                    outerTicks: X[_],
                    showGrid: !U[_],
                    data: te[_] || [],
                    bgColor: oe,
                    calendar: N.calendar,
                    automargin: !0,
                    visibleDflt: ot,
                    reverseDflt: ct,
                    autotypenumbersDflt: j,
                    splomStash: ((N._splomAxes || {})[fe] || {})[V],
                    noAutotickangles: fe === "y"
                  };
                  xe("uirevision", N.uirevision), m($, he, xe, Tt), h($, he, xe, Tt, N);
                  var kt = Ue && fe === Ie.charAt(0), Ot = Fe("spikecolor", Ue ? he.color : void 0), Rt = Fe("spikethickness", Ue ? 1.5 : void 0), xt = Fe("spikedash", Ue ? "dot" : void 0), Wt = Fe("spikemode", Ue ? "across" : void 0), bt = Fe("spikesnap"), jt = xe("showspikes", !!kt || !!Ot || !!Rt || !!xt || !!Wt || !!bt);
                  jt || (delete he.spikecolor, delete he.spikethickness, delete he.spikedash, delete he.spikemode, delete he.spikesnap);
                  var qt = x($.overlaying), Yt = [0, 1];
                  if (N[qt] !== void 0) {
                    var Ut = x(N[qt].anchor);
                    N[Ut] !== void 0 && (Yt = N[Ut].domain);
                  }
                  S($, he, xe, {
                    letter: fe,
                    counterAxes: Je[fe],
                    overlayableAxes: Be(fe, _),
                    grid: N.grid,
                    overlayingDomain: Yt
                  }), xe("title.standoff"), Ne(), he._input = $;
                }
                for (ne = 0; ne < De.length; ) {
                  V = De[ne++], _ = x(V), fe = _.charAt(0), l.isPlainObject(O[_]) || (O[_] = {}), $ = O[_], he = g.newContainer(N, _, fe + "axis"), me();
                  var tt = {
                    letter: fe,
                    font: N.font,
                    outerTicks: X[_],
                    showGrid: !U[_],
                    data: [],
                    bgColor: oe,
                    calendar: N.calendar,
                    automargin: !0,
                    visibleDflt: !1,
                    reverseDflt: !1,
                    autotypenumbersDflt: j,
                    splomStash: ((N._splomAxes || {})[fe] || {})[V]
                  };
                  xe("uirevision", N.uirevision), he.type = at[V] || "linear", h($, he, xe, tt, N), S($, he, xe, {
                    letter: fe,
                    counterAxes: Je[fe],
                    overlayableAxes: Be(fe, _),
                    grid: N.grid
                  }), xe("fixedrange"), Ne(), he._input = $;
                }
                var ze = I("rangeslider", "handleDefaults"), _e = I("rangeselector", "handleDefaults");
                for (ne = 0; ne < Re.length; ne++)
                  _ = Re[ne], $ = O[_], he = N[_], ze(O, N, _), he.type === "date" && _e($, he, N, Ae, he.calendar), xe("fixedrange");
                for (ne = 0; ne < Ae.length; ne++) {
                  _ = Ae[ne], $ = O[_], he = N[_];
                  var Ye = N[x(he.anchor)], lt = I("rangeslider", "isVisible")(Ye);
                  xe("fixedrange", lt);
                }
                w.handleDefaults(O, N, {
                  axIds: et.concat(De).sort(E.idSort),
                  axHasImage: ce
                });
              };
            }
          ),
          /***/
          2136: (
            /***/
            function(s, c, i) {
              var l = i(9760).mix, v = i(2548), f = i(3400);
              s.exports = function(g, y, C, m) {
                m = m || {};
                var h = m.dfltColor;
                function w(z, Z) {
                  return f.coerce2(g, y, m.attributes, z, Z);
                }
                var S = w("linecolor", h), E = w("linewidth"), x = C("showline", m.showLine || !!S || !!E);
                x || (delete y.linecolor, delete y.linewidth);
                var T = l(h, m.bgColor, m.blend || v.lightFraction).toRgbString(), F = w("gridcolor", T), P = w("gridwidth"), k = w("griddash"), I = C("showgrid", m.showGrid || !!F || !!P || !!k);
                if (I || (delete y.gridcolor, delete y.gridwidth, delete y.griddash), m.hasMinor) {
                  var L = l(y.gridcolor, m.bgColor, 67).toRgbString(), A = w("minor.gridcolor", L), O = w("minor.gridwidth", y.gridwidth || 1), N = w("minor.griddash", y.griddash || "solid"), Y = C("minor.showgrid", !!A || !!O || !!N);
                  Y || (delete y.minor.gridcolor, delete y.minor.gridwidth, delete y.minor.griddash);
                }
                if (!m.noZeroLine) {
                  var j = w("zerolinecolor", h), te = w("zerolinewidth"), re = C("zeroline", m.showGrid || !!j || !!te);
                  re || (delete y.zerolinecolor, delete y.zerolinewidth);
                }
              };
            }
          ),
          /***/
          7668: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400);
              s.exports = function(p, g, y, C) {
                var m = C.counterAxes || [], h = C.overlayableAxes || [], w = C.letter, S = C.grid, E = C.overlayingDomain, x, T, F, P, k, I;
                S && (T = S._domains[w][S._axisMap[g._id]], x = S._anchors[g._id], T && (F = S[w + "side"].split(" ")[0], P = S.domain[w][F === "right" || F === "top" ? 1 : 0])), T = T || [0, 1], x = x || (l(p.position) ? "free" : m[0] || "free"), F = F || (w === "x" ? "bottom" : "left"), P = P || 0, k = 0, I = !1;
                var L = v.coerce(p, g, {
                  anchor: {
                    valType: "enumerated",
                    values: ["free"].concat(m),
                    dflt: x
                  }
                }, "anchor"), A = v.coerce(p, g, {
                  side: {
                    valType: "enumerated",
                    values: w === "x" ? ["bottom", "top"] : ["left", "right"],
                    dflt: F
                  }
                }, "side");
                if (L === "free") {
                  if (w === "y") {
                    var O = y("autoshift");
                    O && (P = A === "left" ? E[0] : E[1], I = g.automargin ? g.automargin : !0, k = A === "left" ? -3 : 3), y("shift", k);
                  }
                  y("position", P);
                }
                y("automargin", I);
                var N = !1;
                if (h.length && (N = v.coerce(p, g, {
                  overlaying: {
                    valType: "enumerated",
                    values: [!1].concat(h),
                    dflt: !1
                  }
                }, "overlaying")), !N) {
                  var Y = y("domain", T);
                  Y[0] > Y[1] - 244140625e-12 && (g.domain = T), v.noneOrAll(p.domain, g.domain, T), g.tickmode === "sync" && (g.tickmode = "auto");
                }
                return y("layer"), g;
              };
            }
          ),
          /***/
          2568: (
            /***/
            function(s, c, i) {
              var l = i(5024);
              s.exports = function(f, p, g, y, C) {
                C || (C = {});
                var m = C.tickSuffixDflt, h = l(f), w = g("tickprefix");
                w && g("showtickprefix", h);
                var S = g("ticksuffix", m);
                S && g("showticksuffix", h);
              };
            }
          ),
          /***/
          6312: (
            /***/
            function(s, c, i) {
              var l = i(6808);
              s.exports = function(f, p, g, y) {
                var C = p._template || {}, m = p.type || C.type || "-";
                g("minallowed"), g("maxallowed");
                var h = g("range");
                if (!h) {
                  var w;
                  !y.noInsiderange && m !== "log" && (w = g("insiderange"), w && (w[0] === null || w[1] === null) && (p.insiderange = !1, w = void 0), w && (h = g("range", w)));
                }
                var S = p.getAutorangeDflt(h, y), E = g("autorange", S), x;
                h && (h[0] === null && h[1] === null || (h[0] === null || h[1] === null) && (E === "reversed" || E === !0) || h[0] !== null && (E === "min" || E === "max reversed") || h[1] !== null && (E === "max" || E === "min reversed")) && (h = void 0, delete p.range, p.autorange = !0, x = !0), x || (S = p.getAutorangeDflt(h, y), E = g("autorange", S)), E && (l(g, E, h), (m === "linear" || m === "-") && g("rangemode")), p.cleanRange();
              };
            }
          ),
          /***/
          1160: (
            /***/
            function(s, c, i) {
              var l = i(4284).FROM_BL;
              s.exports = function(f, p, g) {
                g === void 0 && (g = l[f.constraintoward || "center"]);
                var y = [f.r2l(f.range[0]), f.r2l(f.range[1])], C = y[0] + (y[1] - y[0]) * g;
                f.range = f._input.range = [f.l2r(C + (y[0] - C) * p), f.l2r(C + (y[1] - C) * p)], f.setScale();
              };
            }
          ),
          /***/
          8344: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4336).E9, f = i(3400), p = f.numberFormat, g = i(8248), y = f.cleanNumber, C = f.ms2DateTime, m = f.dateTime2ms, h = f.ensureNumber, w = f.isArrayOrTypedArray, S = i(9032), E = S.FP_SAFE, x = S.BADNUM, T = S.LOG_CLIP, F = S.ONEWEEK, P = S.ONEDAY, k = S.ONEHOUR, I = S.ONEMIN, L = S.ONESEC, A = i(9811), O = i(3816), N = O.HOUR_PATTERN, Y = O.WEEKDAY_PATTERN;
              function j(re) {
                return Math.pow(10, re);
              }
              function te(re) {
                return re != null;
              }
              s.exports = function(z, Z) {
                Z = Z || {};
                var W = z._id || "x", q = W.charAt(0);
                function ie(K, ee) {
                  if (K > 0) return Math.log(K) / Math.LN10;
                  if (K <= 0 && ee && z.range && z.range.length === 2) {
                    var oe = z.range[0], _ = z.range[1];
                    return 0.5 * (oe + _ - 2 * T * Math.abs(oe - _));
                  } else return x;
                }
                function ce(K, ee, oe, _) {
                  if ((_ || {}).msUTC && g(K))
                    return +K;
                  var V = m(K, oe || z.calendar);
                  if (V === x)
                    if (g(K)) {
                      K = +K;
                      var fe = Math.floor(f.mod(K + 0.05, 1) * 10), $ = Math.round(K - fe / 10);
                      V = m(new Date($)) + fe / 10;
                    } else return x;
                  return V;
                }
                function X(K, ee, oe) {
                  return C(K, ee, oe || z.calendar);
                }
                function U(K) {
                  return z._categories[Math.round(K)];
                }
                function ne(K) {
                  if (te(K)) {
                    if (z._categoriesMap === void 0 && (z._categoriesMap = {}), z._categoriesMap[K] !== void 0)
                      return z._categoriesMap[K];
                    z._categories.push(typeof K == "number" ? String(K) : K);
                    var ee = z._categories.length - 1;
                    return z._categoriesMap[K] = ee, ee;
                  }
                  return x;
                }
                function se(K, ee) {
                  for (var oe = new Array(ee), _ = 0; _ < ee; _++) {
                    var V = (K[0] || [])[_], fe = (K[1] || [])[_];
                    oe[_] = le([V, fe]);
                  }
                  return oe;
                }
                function le(K) {
                  if (z._categoriesMap)
                    return z._categoriesMap[K];
                }
                function ue(K) {
                  var ee = le(K);
                  if (ee !== void 0) return ee;
                  if (g(K)) return +K;
                }
                function ve(K) {
                  return g(K) ? +K : le(K);
                }
                function be(K, ee, oe) {
                  return l.round(oe + ee * K, 2);
                }
                function Me(K, ee, oe) {
                  return (K - oe) / ee;
                }
                var Ge = function(ee) {
                  return g(ee) ? be(ee, z._m, z._b) : x;
                }, we = function(K) {
                  return Me(K, z._m, z._b);
                };
                if (z.rangebreaks) {
                  var Re = q === "y";
                  Ge = function(K) {
                    if (!g(K)) return x;
                    var ee = z._rangebreaks.length;
                    if (!ee) return be(K, z._m, z._b);
                    var oe = Re;
                    z.range[0] > z.range[1] && (oe = !oe);
                    for (var _ = oe ? -1 : 1, V = _ * K, fe = 0, $ = 0; $ < ee; $++) {
                      var he = _ * z._rangebreaks[$].min, me = _ * z._rangebreaks[$].max;
                      if (V < he) break;
                      if (V > me) fe = $ + 1;
                      else {
                        fe = V < (he + me) / 2 ? $ : $ + 1;
                        break;
                      }
                    }
                    var xe = z._B[fe] || 0;
                    return isFinite(xe) ? be(K, z._m2, xe) : 0;
                  }, we = function(K) {
                    var ee = z._rangebreaks.length;
                    if (!ee) return Me(K, z._m, z._b);
                    for (var oe = 0, _ = 0; _ < ee && !(K < z._rangebreaks[_].pmin); _++)
                      K > z._rangebreaks[_].pmax && (oe = _ + 1);
                    return Me(K, z._m2, z._B[oe]);
                  };
                }
                z.c2l = z.type === "log" ? ie : h, z.l2c = z.type === "log" ? j : h, z.l2p = Ge, z.p2l = we, z.c2p = z.type === "log" ? function(K, ee) {
                  return Ge(ie(K, ee));
                } : Ge, z.p2c = z.type === "log" ? function(K) {
                  return j(we(K));
                } : we, ["linear", "-"].indexOf(z.type) !== -1 ? (z.d2r = z.r2d = z.d2c = z.r2c = z.d2l = z.r2l = y, z.c2d = z.c2r = z.l2d = z.l2r = h, z.d2p = z.r2p = function(K) {
                  return z.l2p(y(K));
                }, z.p2d = z.p2r = we, z.cleanPos = h) : z.type === "log" ? (z.d2r = z.d2l = function(K, ee) {
                  return ie(y(K), ee);
                }, z.r2d = z.r2c = function(K) {
                  return j(y(K));
                }, z.d2c = z.r2l = y, z.c2d = z.l2r = h, z.c2r = ie, z.l2d = j, z.d2p = function(K, ee) {
                  return z.l2p(z.d2r(K, ee));
                }, z.p2d = function(K) {
                  return j(we(K));
                }, z.r2p = function(K) {
                  return z.l2p(y(K));
                }, z.p2r = we, z.cleanPos = h) : z.type === "date" ? (z.d2r = z.r2d = f.identity, z.d2c = z.r2c = z.d2l = z.r2l = ce, z.c2d = z.c2r = z.l2d = z.l2r = X, z.d2p = z.r2p = function(K, ee, oe) {
                  return z.l2p(ce(K, 0, oe));
                }, z.p2d = z.p2r = function(K, ee, oe) {
                  return X(we(K), ee, oe);
                }, z.cleanPos = function(K) {
                  return f.cleanDate(K, x, z.calendar);
                }) : z.type === "category" ? (z.d2c = z.d2l = ne, z.r2d = z.c2d = z.l2d = U, z.d2r = z.d2l_noadd = ue, z.r2c = function(K) {
                  var ee = ve(K);
                  return ee !== void 0 ? ee : z.fraction2r(0.5);
                }, z.l2r = z.c2r = h, z.r2l = ve, z.d2p = function(K) {
                  return z.l2p(z.r2c(K));
                }, z.p2d = function(K) {
                  return U(we(K));
                }, z.r2p = z.d2p, z.p2r = we, z.cleanPos = function(K) {
                  return typeof K == "string" && K !== "" ? K : h(K);
                }) : z.type === "multicategory" && (z.r2d = z.c2d = z.l2d = U, z.d2r = z.d2l_noadd = ue, z.r2c = function(K) {
                  var ee = ue(K);
                  return ee !== void 0 ? ee : z.fraction2r(0.5);
                }, z.r2c_just_indices = le, z.l2r = z.c2r = h, z.r2l = ue, z.d2p = function(K) {
                  return z.l2p(z.r2c(K));
                }, z.p2d = function(K) {
                  return U(we(K));
                }, z.r2p = z.d2p, z.p2r = we, z.cleanPos = function(K) {
                  return Array.isArray(K) || typeof K == "string" && K !== "" ? K : h(K);
                }, z.setupMultiCategory = function(K) {
                  var ee = z._traceIndices, oe, _, V = z._matchGroup;
                  if (V && z._categories.length === 0) {
                    for (var fe in V)
                      if (fe !== W) {
                        var $ = Z[A.id2name(fe)];
                        ee = ee.concat($._traceIndices);
                      }
                  }
                  var he = [[0, {}], [0, {}]], me = [];
                  for (oe = 0; oe < ee.length; oe++) {
                    var xe = K[ee[oe]];
                    if (q in xe) {
                      var Fe = xe[q], Ve = xe._length || f.minRowLength(Fe);
                      if (w(Fe[0]) && w(Fe[1]))
                        for (_ = 0; _ < Ve; _++) {
                          var Be = Fe[0][_], Je = Fe[1][_];
                          te(Be) && te(Je) && (me.push([Be, Je]), Be in he[0][1] || (he[0][1][Be] = he[0][0]++), Je in he[1][1] || (he[1][1][Je] = he[1][0]++));
                        }
                    }
                  }
                  for (me.sort(function(et, at) {
                    var De = he[0][1], Ne = De[et[0]] - De[at[0]];
                    if (Ne) return Ne;
                    var Ie = he[1][1];
                    return Ie[et[1]] - Ie[at[1]];
                  }), oe = 0; oe < me.length; oe++)
                    ne(me[oe]);
                }), z.fraction2r = function(K) {
                  var ee = z.r2l(z.range[0]), oe = z.r2l(z.range[1]);
                  return z.l2r(ee + K * (oe - ee));
                }, z.r2fraction = function(K) {
                  var ee = z.r2l(z.range[0]), oe = z.r2l(z.range[1]);
                  return (z.r2l(K) - ee) / (oe - ee);
                }, z.limitRange = function(K) {
                  var ee = z.minallowed, oe = z.maxallowed;
                  if (!(ee === void 0 && oe === void 0)) {
                    K || (K = "range");
                    var _ = f.nestedProperty(z, K).get(), V = f.simpleMap(_, z.r2l), fe = V[1] < V[0];
                    fe && V.reverse();
                    var $ = f.simpleMap([ee, oe], z.r2l);
                    if (ee !== void 0 && V[0] < $[0] && (_[fe ? 1 : 0] = ee), oe !== void 0 && V[1] > $[1] && (_[fe ? 0 : 1] = oe), _[0] === _[1]) {
                      var he = z.l2r(ee), me = z.l2r(oe);
                      if (ee !== void 0) {
                        var xe = he + 1;
                        oe !== void 0 && (xe = Math.min(xe, me)), _[fe ? 1 : 0] = xe;
                      }
                      if (oe !== void 0) {
                        var Fe = me + 1;
                        ee !== void 0 && (Fe = Math.max(Fe, he)), _[fe ? 0 : 1] = Fe;
                      }
                    }
                  }
                }, z.cleanRange = function(K, ee) {
                  z._cleanRange(K, ee), z.limitRange(K);
                }, z._cleanRange = function(K, ee) {
                  ee || (ee = {}), K || (K = "range");
                  var oe = f.nestedProperty(z, K).get(), _, V;
                  if (z.type === "date" ? V = f.dfltRange(z.calendar) : q === "y" ? V = O.DFLTRANGEY : z._name === "realaxis" ? V = [0, 1] : V = ee.dfltRange || O.DFLTRANGEX, V = V.slice(), (z.rangemode === "tozero" || z.rangemode === "nonnegative") && (V[0] = 0), !oe || oe.length !== 2) {
                    f.nestedProperty(z, K).set(V);
                    return;
                  }
                  var fe = oe[0] === null, $ = oe[1] === null;
                  for (z.type === "date" && !z.autorange && (oe[0] = f.cleanDate(oe[0], x, z.calendar), oe[1] = f.cleanDate(oe[1], x, z.calendar)), _ = 0; _ < 2; _++)
                    if (z.type === "date") {
                      if (!f.isDateTime(oe[_], z.calendar)) {
                        z[K] = V;
                        break;
                      }
                      if (z.r2l(oe[0]) === z.r2l(oe[1])) {
                        var he = f.constrain(z.r2l(oe[0]), f.MIN_MS + 1e3, f.MAX_MS - 1e3);
                        oe[0] = z.l2r(he - 1e3), oe[1] = z.l2r(he + 1e3);
                        break;
                      }
                    } else {
                      if (!g(oe[_]))
                        if (!(fe || $) && g(oe[1 - _]))
                          oe[_] = oe[1 - _] * (_ ? 10 : 0.1);
                        else {
                          z[K] = V;
                          break;
                        }
                      if (oe[_] < -E ? oe[_] = -E : oe[_] > E && (oe[_] = E), oe[0] === oe[1]) {
                        var me = Math.max(1, Math.abs(oe[0] * 1e-6));
                        oe[0] -= me, oe[1] += me;
                      }
                    }
                }, z.setScale = function(K) {
                  var ee = Z._size;
                  if (z.overlaying) {
                    var oe = A.getFromId({
                      _fullLayout: Z
                    }, z.overlaying);
                    z.domain = oe.domain;
                  }
                  var _ = K && z._r ? "_r" : "range", V = z.calendar;
                  z.cleanRange(_);
                  var fe = z.r2l(z[_][0], V), $ = z.r2l(z[_][1], V), he = q === "y";
                  if (he ? (z._offset = ee.t + (1 - z.domain[1]) * ee.h, z._length = ee.h * (z.domain[1] - z.domain[0]), z._m = z._length / (fe - $), z._b = -z._m * $) : (z._offset = ee.l + z.domain[0] * ee.w, z._length = ee.w * (z.domain[1] - z.domain[0]), z._m = z._length / ($ - fe), z._b = -z._m * fe), z._rangebreaks = [], z._lBreaks = 0, z._m2 = 0, z._B = [], z.rangebreaks) {
                    var me, xe;
                    if (z._rangebreaks = z.locateBreaks(Math.min(fe, $), Math.max(fe, $)), z._rangebreaks.length) {
                      for (me = 0; me < z._rangebreaks.length; me++)
                        xe = z._rangebreaks[me], z._lBreaks += Math.abs(xe.max - xe.min);
                      var Fe = he;
                      fe > $ && (Fe = !Fe), Fe && z._rangebreaks.reverse();
                      var Ve = Fe ? -1 : 1;
                      for (z._m2 = Ve * z._length / (Math.abs($ - fe) - z._lBreaks), z._B.push(-z._m2 * (he ? $ : fe)), me = 0; me < z._rangebreaks.length; me++)
                        xe = z._rangebreaks[me], z._B.push(z._B[z._B.length - 1] - Ve * z._m2 * (xe.max - xe.min));
                      for (me = 0; me < z._rangebreaks.length; me++)
                        xe = z._rangebreaks[me], xe.pmin = Ge(xe.min), xe.pmax = Ge(xe.max);
                    }
                  }
                  if (!isFinite(z._m) || !isFinite(z._b) || z._length < 0)
                    throw Z._replotting = !1, new Error("Something went wrong with axis scaling");
                }, z.maskBreaks = function(K) {
                  var ee = z.rangebreaks || [], oe, _, V, fe, $;
                  ee._cachedPatterns || (ee._cachedPatterns = ee.map(function(De) {
                    return De.enabled && De.bounds ? f.simpleMap(
                      De.bounds,
                      De.pattern ? y : z.d2c
                      // case of pattern: ''
                    ) : null;
                  })), ee._cachedValues || (ee._cachedValues = ee.map(function(De) {
                    return De.enabled && De.values ? f.simpleMap(De.values, z.d2c).sort(f.sorterAsc) : null;
                  }));
                  for (var he = 0; he < ee.length; he++) {
                    var me = ee[he];
                    if (me.enabled) {
                      if (me.bounds) {
                        var xe = me.pattern;
                        switch (oe = ee._cachedPatterns[he], _ = oe[0], V = oe[1], xe) {
                          case Y:
                            $ = new Date(K), fe = $.getUTCDay(), _ > V && (V += 7, fe < _ && (fe += 7));
                            break;
                          case N:
                            $ = new Date(K);
                            var Fe = $.getUTCHours(), Ve = $.getUTCMinutes(), Be = $.getUTCSeconds(), Je = $.getUTCMilliseconds();
                            fe = Fe + (Ve / 60 + Be / 3600 + Je / 36e5), _ > V && (V += 24, fe < _ && (fe += 24));
                            break;
                          case "":
                            fe = K;
                            break;
                        }
                        if (fe >= _ && fe < V) return x;
                      } else
                        for (var et = ee._cachedValues[he], at = 0; at < et.length; at++)
                          if (_ = et[at], V = _ + me.dvalue, K >= _ && K < V) return x;
                    }
                  }
                  return K;
                }, z.locateBreaks = function(K, ee) {
                  var oe, _, V, fe, $ = [];
                  if (!z.rangebreaks) return $;
                  var he = z.rangebreaks.slice().sort(function(Ie, Ue) {
                    return Ie.pattern === Y && Ue.pattern === N ? -1 : Ue.pattern === Y && Ie.pattern === N ? 1 : 0;
                  }), me = function(Ie, Ue) {
                    if (Ie = f.constrain(Ie, K, ee), Ue = f.constrain(Ue, K, ee), Ie !== Ue) {
                      for (var ot = !0, ct = 0; ct < $.length; ct++) {
                        var Tt = $[ct];
                        Ie < Tt.max && Ue >= Tt.min && (Ie < Tt.min && (Tt.min = Ie), Ue > Tt.max && (Tt.max = Ue), ot = !1);
                      }
                      ot && $.push({
                        min: Ie,
                        max: Ue
                      });
                    }
                  };
                  for (oe = 0; oe < he.length; oe++) {
                    var xe = he[oe];
                    if (xe.enabled)
                      if (xe.bounds) {
                        var Fe = K, Ve = ee;
                        xe.pattern && (Fe = Math.floor(Fe)), _ = f.simpleMap(xe.bounds, xe.pattern ? y : z.r2l), V = _[0], fe = _[1];
                        var Be = new Date(Fe), Je, et;
                        switch (xe.pattern) {
                          case Y:
                            et = F, Je = ((fe < V ? 7 : 0) + (fe - V)) * P, Fe += V * P - (Be.getUTCDay() * P + Be.getUTCHours() * k + Be.getUTCMinutes() * I + Be.getUTCSeconds() * L + Be.getUTCMilliseconds());
                            break;
                          case N:
                            et = P, Je = ((fe < V ? 24 : 0) + (fe - V)) * k, Fe += V * k - (Be.getUTCHours() * k + Be.getUTCMinutes() * I + Be.getUTCSeconds() * L + Be.getUTCMilliseconds());
                            break;
                          default:
                            Fe = Math.min(_[0], _[1]), Ve = Math.max(_[0], _[1]), et = Ve - Fe, Je = et;
                        }
                        for (var at = Fe; at < Ve; at += et)
                          me(at, at + Je);
                      } else
                        for (var De = f.simpleMap(xe.values, z.d2c), Ne = 0; Ne < De.length; Ne++)
                          V = De[Ne], fe = V + xe.dvalue, me(V, fe);
                  }
                  return $.sort(function(Ie, Ue) {
                    return Ie.min - Ue.min;
                  }), $;
                }, z.makeCalcdata = function(K, ee, oe) {
                  var _, V, fe, $, he = z.type, me = he === "date" && K[ee + "calendar"];
                  if (ee in K) {
                    if (_ = K[ee], $ = K._length || f.minRowLength(_), f.isTypedArray(_) && (he === "linear" || he === "log")) {
                      if ($ === _.length)
                        return _;
                      if (_.subarray)
                        return _.subarray(0, $);
                    }
                    if (he === "multicategory")
                      return se(_, $);
                    for (V = new Array($), fe = 0; fe < $; fe++)
                      V[fe] = z.d2c(_[fe], 0, me, oe);
                  } else {
                    var xe = ee + "0" in K ? z.d2c(K[ee + "0"], 0, me) : 0, Fe = K["d" + ee] ? Number(K["d" + ee]) : 1;
                    for (_ = K[{
                      x: "y",
                      y: "x"
                    }[ee]], $ = K._length || _.length, V = new Array($), fe = 0; fe < $; fe++)
                      V[fe] = xe + fe * Fe;
                  }
                  if (z.rangebreaks)
                    for (fe = 0; fe < $; fe++)
                      V[fe] = z.maskBreaks(V[fe]);
                  return V;
                }, z.isValidRange = function(K, ee) {
                  return Array.isArray(K) && K.length === 2 && (ee && K[0] === null || g(z.r2l(K[0]))) && (ee && K[1] === null || g(z.r2l(K[1])));
                }, z.getAutorangeDflt = function(K, ee) {
                  var oe = !z.isValidRange(K, "nullOk");
                  return oe && ee && ee.reverseDflt ? oe = "reversed" : K && (K[0] === null && K[1] === null ? oe = !0 : K[0] === null && K[1] !== null ? oe = "min" : K[0] !== null && K[1] === null && (oe = "max")), oe;
                }, z.isReversed = function() {
                  var K = z.autorange;
                  return K === "reversed" || K === "min reversed" || K === "max reversed";
                }, z.isPtWithinRange = function(K, ee) {
                  var oe = z.c2l(K[q], null, ee), _ = z.r2l(z.range[0]), V = z.r2l(z.range[1]);
                  return _ < V ? _ <= oe && oe <= V : V <= oe && oe <= _;
                }, z._emptyCategories = function() {
                  z._categories = [], z._categoriesMap = {};
                }, z.clearCalc = function() {
                  var K = z._matchGroup;
                  if (K) {
                    var ee = null, oe = null;
                    for (var _ in K) {
                      var V = Z[A.id2name(_)];
                      if (V._categories) {
                        ee = V._categories, oe = V._categoriesMap;
                        break;
                      }
                    }
                    ee && oe ? (z._categories = ee, z._categoriesMap = oe) : z._emptyCategories();
                  } else
                    z._emptyCategories();
                  if (z._initialCategories)
                    for (var fe = 0; fe < z._initialCategories.length; fe++)
                      ne(z._initialCategories[fe]);
                }, z.sortByInitialCategories = function() {
                  var K = [];
                  if (z._emptyCategories(), z._initialCategories)
                    for (var ee = 0; ee < z._initialCategories.length; ee++)
                      ne(z._initialCategories[ee]);
                  K = K.concat(z._traceIndices);
                  var oe = z._matchGroup;
                  for (var _ in oe)
                    if (W !== _) {
                      var V = Z[A.id2name(_)];
                      V._categories = z._categories, V._categoriesMap = z._categoriesMap, K = K.concat(V._traceIndices);
                    }
                  return K;
                };
                var Ae = Z._d3locale;
                z.type === "date" && (z._dateFormat = Ae ? Ae.timeFormat : v, z._extraFormat = Z._extraFormat), z._separators = Z.separators, z._numFormat = Ae ? Ae.numberFormat : p, delete z._minDtick, delete z._forceTick0;
              };
            }
          ),
          /***/
          5024: (
            /***/
            function(s) {
              s.exports = function(i) {
                var l = ["showexponent", "showtickprefix", "showticksuffix"], v = l.filter(function(p) {
                  return i[p] !== void 0;
                }), f = function(p) {
                  return i[p] === i[v[0]];
                };
                if (v.every(f) || v.length === 1)
                  return i[v[0]];
              };
            }
          ),
          /***/
          5936: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(6308).contrast, f = i(4724), p = i(5024), g = i(1272);
              s.exports = function(m, h, w, S, E) {
                E || (E = {});
                var x = w("labelalias");
                l.isPlainObject(x) || delete h.labelalias;
                var T = p(m), F = w("showticklabels");
                if (F) {
                  var P = E.font || {}, k = h.color, I = h.ticklabelposition || "", L = I.indexOf("inside") !== -1 ? v(E.bgColor) : (
                    // as with titlefont.color, inherit axis.color only if one was
                    // explicitly provided
                    k && k !== f.color.dflt ? k : P.color
                  );
                  if (l.coerceFont(w, "tickfont", P, {
                    overrideDflt: {
                      color: L
                    }
                  }), !E.noTicklabelstep && S !== "multicategory" && S !== "log" && w("ticklabelstep"), !E.noAng) {
                    var A = w("tickangle");
                    !E.noAutotickangles && A === "auto" && w("autotickangles");
                  }
                  if (S !== "category") {
                    var O = w("tickformat");
                    g(m, h, {
                      name: "tickformatstops",
                      inclusionAttr: "enabled",
                      handleItemDefaults: y
                    }), h.tickformatstops.length || delete h.tickformatstops, !E.noExp && !O && S !== "date" && (w("showexponent", T), w("exponentformat"), w("minexponent"), w("separatethousands"));
                  }
                }
              };
              function y(C, m) {
                function h(S, E) {
                  return l.coerce(C, m, f.tickformatstops, S, E);
                }
                var w = h("enabled");
                w && (h("dtickrange"), h("value"));
              }
            }
          ),
          /***/
          5404: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4724);
              s.exports = function(p, g, y, C) {
                var m = C.isMinor, h = m ? p.minor || {} : p, w = m ? g.minor : g, S = m ? v.minor : v, E = m ? "minor." : "", x = l.coerce2(h, w, S, "ticklen", m ? (g.ticklen || 5) * 0.6 : void 0), T = l.coerce2(h, w, S, "tickwidth", m ? g.tickwidth || 1 : void 0), F = l.coerce2(h, w, S, "tickcolor", (m ? g.tickcolor : void 0) || w.color), P = y(E + "ticks", !m && C.outerTicks || x || T || F ? "outside" : "");
                P || (delete w.ticklen, delete w.tickwidth, delete w.tickcolor);
              };
            }
          ),
          /***/
          6332: (
            /***/
            function(s, c, i) {
              var l = i(8728), v = i(3400).isArrayOrTypedArray, f = i(8116).isTypedArraySpec, p = i(8116).decodeTypedArraySpec;
              s.exports = function(y, C, m, h, w) {
                w || (w = {});
                var S = w.isMinor, E = S ? y.minor || {} : y, x = S ? C.minor : C, T = S ? "minor." : "";
                function F(Y) {
                  var j = E[Y];
                  return f(j) && (j = p(j)), j !== void 0 ? j : (x._template || {})[Y];
                }
                var P = F("tick0"), k = F("dtick"), I = F("tickvals"), L = v(I) ? "array" : k ? "linear" : "auto", A = m(T + "tickmode", L);
                if (A === "auto" || A === "sync")
                  m(T + "nticks");
                else if (A === "linear") {
                  var O = x.dtick = l.dtick(k, h);
                  x.tick0 = l.tick0(P, h, C.calendar, O);
                } else if (h !== "multicategory") {
                  var N = m(T + "tickvals");
                  N === void 0 ? x.tickmode = "auto" : S || m("ticktext");
                }
              };
            }
          ),
          /***/
          3736: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(3400), p = i(3616), g = i(4460);
              s.exports = function(C, m, h, w) {
                var S = C._fullLayout;
                if (m.length === 0) {
                  g.redrawComponents(C);
                  return;
                }
                function E(N) {
                  var Y = N.xaxis, j = N.yaxis;
                  S._defs.select("#" + N.clipId + "> rect").call(p.setTranslate, 0, 0).call(p.setScale, 1, 1), N.plot.call(p.setTranslate, Y._offset, j._offset).call(p.setScale, 1, 1);
                  var te = N.plot.selectAll(".scatterlayer .trace");
                  te.selectAll(".point").call(p.setPointGroupScale, 1, 1), te.selectAll(".textpoint").call(p.setTextPointsScale, 1, 1), te.call(p.hideOutsideRangePoints, N);
                }
                function x(N, Y) {
                  var j = N.plotinfo, te = j.xaxis, re = j.yaxis, z = te._length, Z = re._length, W = !!N.xr1, q = !!N.yr1, ie = [];
                  if (W) {
                    var ce = f.simpleMap(N.xr0, te.r2l), X = f.simpleMap(N.xr1, te.r2l), U = ce[1] - ce[0], ne = X[1] - X[0];
                    ie[0] = (ce[0] * (1 - Y) + Y * X[0] - ce[0]) / (ce[1] - ce[0]) * z, ie[2] = z * (1 - Y + Y * ne / U), te.range[0] = te.l2r(ce[0] * (1 - Y) + Y * X[0]), te.range[1] = te.l2r(ce[1] * (1 - Y) + Y * X[1]);
                  } else
                    ie[0] = 0, ie[2] = z;
                  if (q) {
                    var se = f.simpleMap(N.yr0, re.r2l), le = f.simpleMap(N.yr1, re.r2l), ue = se[1] - se[0], ve = le[1] - le[0];
                    ie[1] = (se[1] * (1 - Y) + Y * le[1] - se[1]) / (se[0] - se[1]) * Z, ie[3] = Z * (1 - Y + Y * ve / ue), re.range[0] = te.l2r(se[0] * (1 - Y) + Y * le[0]), re.range[1] = re.l2r(se[1] * (1 - Y) + Y * le[1]);
                  } else
                    ie[1] = 0, ie[3] = Z;
                  g.drawOne(C, te, {
                    skipTitle: !0
                  }), g.drawOne(C, re, {
                    skipTitle: !0
                  }), g.redrawComponents(C, [te._id, re._id]);
                  var be = W ? z / ie[2] : 1, Me = q ? Z / ie[3] : 1, Ge = W ? ie[0] : 0, we = q ? ie[1] : 0, Re = W ? ie[0] / ie[2] * z : 0, Ae = q ? ie[1] / ie[3] * Z : 0, K = te._offset - Re, ee = re._offset - Ae;
                  j.clipRect.call(p.setTranslate, Ge, we).call(p.setScale, 1 / be, 1 / Me), j.plot.call(p.setTranslate, K, ee).call(p.setScale, be, Me), p.setPointGroupScale(j.zoomScalePts, 1 / be, 1 / Me), p.setTextPointsScale(j.zoomScaleTxt, 1 / be, 1 / Me);
                }
                var T;
                w && (T = w());
                function F() {
                  for (var N = {}, Y = 0; Y < m.length; Y++) {
                    var j = m[Y], te = j.plotinfo.xaxis, re = j.plotinfo.yaxis;
                    j.xr1 && (N[te._name + ".range"] = j.xr1.slice()), j.yr1 && (N[re._name + ".range"] = j.yr1.slice());
                  }
                  return T && T(), v.call("relayout", C, N).then(function() {
                    for (var z = 0; z < m.length; z++)
                      E(m[z].plotinfo);
                  });
                }
                function P() {
                  for (var N = {}, Y = 0; Y < m.length; Y++) {
                    var j = m[Y], te = j.plotinfo.xaxis, re = j.plotinfo.yaxis;
                    j.xr0 && (N[te._name + ".range"] = j.xr0.slice()), j.yr0 && (N[re._name + ".range"] = j.yr0.slice());
                  }
                  return v.call("relayout", C, N).then(function() {
                    for (var z = 0; z < m.length; z++)
                      E(m[z].plotinfo);
                  });
                }
                var k, I, L, A = l.ease(h.easing);
                C._transitionData._interruptCallbacks.push(function() {
                  return window.cancelAnimationFrame(L), L = null, P();
                });
                function O() {
                  I = Date.now();
                  for (var N = Math.min(1, (I - k) / h.duration), Y = A(N), j = 0; j < m.length; j++)
                    x(m[j], Y);
                  I - k > h.duration ? (F(), L = window.cancelAnimationFrame(O)) : L = window.requestAnimationFrame(O);
                }
                return k = Date.now(), L = window.requestAnimationFrame(O), Promise.resolve();
              };
            }
          ),
          /***/
          4944: (
            /***/
            function(s, c, i) {
              var l = i(4040).traceIs, v = i(2976);
              s.exports = function(m, h, w, S) {
                w("autotypenumbers", S.autotypenumbersDflt);
                var E = w("type", (S.splomStash || {}).type);
                E === "-" && (f(h, S.data), h.type === "-" ? h.type = "linear" : m.type = h.type);
              };
              function f(C, m) {
                if (C.type === "-") {
                  var h = C._id, w = h.charAt(0), S;
                  h.indexOf("scene") !== -1 && (h = w);
                  var E = p(m, h, w);
                  if (E) {
                    if (E.type === "histogram" && w === {
                      v: "y",
                      h: "x"
                    }[E.orientation || "v"]) {
                      C.type = "linear";
                      return;
                    }
                    var x = w + "calendar", T = E[x], F = {
                      noMultiCategory: !l(E, "cartesian") || l(E, "noMultiCategory")
                    };
                    if (E.type === "box" && E._hasPreCompStats && w === {
                      h: "x",
                      v: "y"
                    }[E.orientation || "v"] && (F.noMultiCategory = !0), F.autotypenumbers = C.autotypenumbers, y(E, w)) {
                      var P = g(E), k = [];
                      for (S = 0; S < m.length; S++) {
                        var I = m[S];
                        !l(I, "box-violin") || (I[w + "axis"] || w) !== h || (I[P] !== void 0 ? k.push(I[P][0]) : I.name !== void 0 ? k.push(I.name) : k.push("text"), I[x] !== T && (T = void 0));
                      }
                      C.type = v(k, T, F);
                    } else if (E.type === "splom") {
                      var L = E.dimensions, A = L[E._axesDim[h]];
                      A.visible && (C.type = v(A.values, T, F));
                    } else
                      C.type = v(E[w] || [E[w + "0"]], T, F);
                  }
                }
              }
              function p(C, m, h) {
                for (var w = 0; w < C.length; w++) {
                  var S = C[w];
                  if (S.type === "splom" && S._length > 0 && (S["_" + h + "axes"] || {})[m])
                    return S;
                  if ((S[h + "axis"] || h) === m) {
                    if (y(S, h))
                      return S;
                    if ((S[h] || []).length || S[h + "0"])
                      return S;
                  }
                }
              }
              function g(C) {
                return {
                  v: "x",
                  h: "y"
                }[C.orientation || "v"];
              }
              function y(C, m) {
                var h = g(C), w = l(C, "box-violin"), S = l(C._fullInput || {}, "candlestick");
                return w && !S && m === h && C[h] === void 0 && C[h + "0"] === void 0;
              }
            }
          ),
          /***/
          2460: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3400);
              c.manageCommandObserver = function(m, h, w, S) {
                var E = {}, x = !0;
                h && h._commandObserver && (E = h._commandObserver), E.cache || (E.cache = {}), E.lookupTable = {};
                var T = c.hasSimpleAPICommandBindings(m, w, E.lookupTable);
                if (h && h._commandObserver) {
                  if (T)
                    return E;
                  if (h._commandObserver.remove)
                    return h._commandObserver.remove(), h._commandObserver = null, E;
                }
                if (T) {
                  f(m, T, E.cache), E.check = function() {
                    if (x) {
                      var I = f(m, T, E.cache);
                      return I.changed && S && E.lookupTable[I.value] !== void 0 && (E.disable(), Promise.resolve(S({
                        value: I.value,
                        type: T.type,
                        prop: T.prop,
                        traces: T.traces,
                        index: E.lookupTable[I.value]
                      })).then(E.enable, E.enable)), I.changed;
                    }
                  };
                  for (var F = ["plotly_relayout", "plotly_redraw", "plotly_restyle", "plotly_update", "plotly_animatingframe", "plotly_afterplot"], P = 0; P < F.length; P++)
                    m._internalOn(F[P], E.check);
                  E.remove = function() {
                    for (var k = 0; k < F.length; k++)
                      m._removeInternalListener(F[k], E.check);
                  };
                } else
                  v.log("Unable to automatically bind plot updates to API command"), E.lookupTable = {}, E.remove = function() {
                  };
                return E.disable = function() {
                  x = !1;
                }, E.enable = function() {
                  x = !0;
                }, h && (h._commandObserver = E), E;
              }, c.hasSimpleAPICommandBindings = function(m, h, w) {
                var S, E = h.length, x;
                for (S = 0; S < E; S++) {
                  var T, F = h[S], P = F.method, k = F.args;
                  if (Array.isArray(k) || (k = []), !P)
                    return !1;
                  var I = c.computeAPICommandBindings(m, P, k);
                  if (I.length !== 1)
                    return !1;
                  if (!x)
                    x = I[0], Array.isArray(x.traces) && x.traces.sort();
                  else {
                    if (T = I[0], T.type !== x.type || T.prop !== x.prop)
                      return !1;
                    if (Array.isArray(x.traces))
                      if (Array.isArray(T.traces)) {
                        T.traces.sort();
                        for (var L = 0; L < x.traces.length; L++)
                          if (x.traces[L] !== T.traces[L])
                            return !1;
                      } else
                        return !1;
                    else if (T.prop !== x.prop)
                      return !1;
                  }
                  T = I[0];
                  var A = T.value;
                  if (Array.isArray(A))
                    if (A.length === 1)
                      A = A[0];
                    else
                      return !1;
                  w && (w[A] = S);
                }
                return x;
              };
              function f(m, h, w) {
                var S, E, x, T = !1;
                if (h.type === "data")
                  S = m._fullData[h.traces !== null ? h.traces[0] : 0];
                else if (h.type === "layout")
                  S = m._fullLayout;
                else
                  return !1;
                return E = v.nestedProperty(S, h.prop).get(), x = w[h.type] = w[h.type] || {}, x.hasOwnProperty(h.prop) && x[h.prop] !== E && (T = !0), x[h.prop] = E, {
                  changed: T,
                  value: E
                };
              }
              c.executeAPICommand = function(m, h, w) {
                if (h === "skip") return Promise.resolve();
                var S = l.apiMethodRegistry[h], E = [m];
                Array.isArray(w) || (w = []);
                for (var x = 0; x < w.length; x++)
                  E.push(w[x]);
                return S.apply(null, E).catch(function(T) {
                  return v.warn("API call to Plotly." + h + " rejected.", T), Promise.reject(T);
                });
              }, c.computeAPICommandBindings = function(m, h, w) {
                var S;
                switch (Array.isArray(w) || (w = []), h) {
                  case "restyle":
                    S = y(m, w);
                    break;
                  case "relayout":
                    S = g(m, w);
                    break;
                  case "update":
                    S = y(m, [w[0], w[2]]).concat(g(m, [w[1]]));
                    break;
                  case "animate":
                    S = p(m, w);
                    break;
                  default:
                    S = [];
                }
                return S;
              };
              function p(m, h) {
                return Array.isArray(h[0]) && h[0].length === 1 && ["string", "number"].indexOf(typeof h[0][0]) !== -1 ? [{
                  type: "layout",
                  prop: "_currentFrame",
                  value: h[0][0].toString()
                }] : [];
              }
              function g(m, h) {
                var w = [], S = h[0], E = {};
                if (typeof S == "string")
                  E[S] = h[1];
                else if (v.isPlainObject(S))
                  E = S;
                else
                  return w;
                return C(E, function(x, T, F) {
                  w.push({
                    type: "layout",
                    prop: x,
                    value: F
                  });
                }, "", 0), w;
              }
              function y(m, h) {
                var w, S, E, x, T = [];
                if (S = h[0], E = h[1], w = h[2], x = {}, typeof S == "string")
                  x[S] = E;
                else if (v.isPlainObject(S))
                  x = S, w === void 0 && (w = E);
                else
                  return T;
                return w === void 0 && (w = null), C(x, function(F, P, k) {
                  var I, L;
                  if (Array.isArray(k)) {
                    L = k.slice();
                    var A = Math.min(L.length, m.data.length);
                    w && (A = Math.min(A, w.length)), I = [];
                    for (var O = 0; O < A; O++)
                      I[O] = w ? w[O] : O;
                  } else
                    L = k, I = w ? w.slice() : null;
                  if (I === null)
                    Array.isArray(L) && (L = L[0]);
                  else if (Array.isArray(I)) {
                    if (!Array.isArray(L)) {
                      var N = L;
                      L = [];
                      for (var Y = 0; Y < I.length; Y++)
                        L[Y] = N;
                    }
                    L.length = Math.min(I.length, L.length);
                  }
                  T.push({
                    type: "data",
                    prop: F,
                    traces: I,
                    value: L
                  });
                }, "", 0), T;
              }
              function C(m, h, w, S) {
                Object.keys(m).forEach(function(E) {
                  var x = m[E];
                  if (E[0] !== "_") {
                    var T = w + (S > 0 ? "." : "") + E;
                    v.isPlainObject(x) ? C(x, h, T, S + 1) : h(T, E, x);
                  }
                });
              }
            }
          ),
          /***/
          6968: (
            /***/
            function(s, c, i) {
              var l = i(2880).extendFlat;
              c.u = function(v, f) {
                v = v || {}, f = f || {};
                var p = {
                  valType: "info_array",
                  editType: v.editType,
                  items: [{
                    valType: "number",
                    min: 0,
                    max: 1,
                    editType: v.editType
                  }, {
                    valType: "number",
                    min: 0,
                    max: 1,
                    editType: v.editType
                  }],
                  dflt: [0, 1]
                };
                v.name && v.name + "", v.trace, f.description && "" + f.description;
                var g = {
                  x: l({}, p, {}),
                  y: l({}, p, {}),
                  editType: v.editType
                };
                return v.noGridCell || (g.row = {
                  valType: "integer",
                  min: 0,
                  dflt: 0,
                  editType: v.editType
                }, g.column = {
                  valType: "integer",
                  min: 0,
                  dflt: 0,
                  editType: v.editType
                }), g;
              }, c.Q = function(v, f, p, g) {
                var y = g && g.x || [0, 1], C = g && g.y || [0, 1], m = f.grid;
                if (m) {
                  var h = p("domain.column");
                  h !== void 0 && (h < m.columns ? y = m._domains.x[h] : delete v.domain.column);
                  var w = p("domain.row");
                  w !== void 0 && (w < m.rows ? C = m._domains.y[w] : delete v.domain.row);
                }
                var S = p("domain.x", y), E = p("domain.y", C);
                S[0] < S[1] || (v.domain.x = y.slice()), E[0] < E[1] || (v.domain.y = C.slice());
              };
            }
          ),
          /***/
          5376: (
            /***/
            function(s) {
              s.exports = function(c) {
                var i = c.variantValues, l = c.editType, v = c.colorEditType;
                v === void 0 && (v = l);
                var f = {
                  editType: l,
                  valType: "integer",
                  min: 1,
                  max: 1e3,
                  extras: ["normal", "bold"],
                  dflt: "normal"
                };
                c.noNumericWeightValues && (f.valType = "enumerated", f.values = f.extras, f.extras = void 0, f.min = void 0, f.max = void 0);
                var p = {
                  family: {
                    valType: "string",
                    noBlank: !0,
                    strict: !0,
                    editType: l
                  },
                  size: {
                    valType: "number",
                    min: 1,
                    editType: l
                  },
                  color: {
                    valType: "color",
                    editType: v
                  },
                  weight: f,
                  style: {
                    editType: l,
                    valType: "enumerated",
                    values: ["normal", "italic"],
                    dflt: "normal"
                  },
                  variant: c.noFontVariant ? void 0 : {
                    editType: l,
                    valType: "enumerated",
                    values: i || ["normal", "small-caps", "all-small-caps", "all-petite-caps", "petite-caps", "unicase"],
                    dflt: "normal"
                  },
                  textcase: c.noFontTextcase ? void 0 : {
                    editType: l,
                    valType: "enumerated",
                    values: ["normal", "word caps", "upper", "lower"],
                    dflt: "normal"
                  },
                  lineposition: c.noFontLineposition ? void 0 : {
                    editType: l,
                    valType: "flaglist",
                    flags: ["under", "over", "through"],
                    extras: ["none"],
                    dflt: "none"
                  },
                  shadow: c.noFontShadow ? void 0 : {
                    editType: l,
                    valType: "string",
                    dflt: c.autoShadowDflt ? "auto" : "none"
                  },
                  editType: l
                  // blank strings so compress_attributes can remove
                  // TODO - that's uber hacky... better solution?
                };
                return c.autoSize && (p.size.dflt = "auto"), c.autoColor && (p.color.dflt = "auto"), c.arrayOk && (p.family.arrayOk = !0, p.weight.arrayOk = !0, p.style.arrayOk = !0, c.noFontVariant || (p.variant.arrayOk = !0), c.noFontTextcase || (p.textcase.arrayOk = !0), c.noFontLineposition || (p.lineposition.arrayOk = !0), c.noFontShadow || (p.shadow.arrayOk = !0), p.size.arrayOk = !0, p.color.arrayOk = !0), p;
              };
            }
          ),
          /***/
          6672: (
            /***/
            function(s) {
              s.exports = {
                _isLinkedToArray: "frames_entry",
                group: {
                  valType: "string"
                },
                name: {
                  valType: "string"
                },
                traces: {
                  valType: "any"
                },
                baseframe: {
                  valType: "string"
                },
                data: {
                  valType: "any"
                },
                layout: {
                  valType: "any"
                }
              };
            }
          ),
          /***/
          4888: (
            /***/
            function(s, c, i) {
              var l = i(4040);
              i(3816).SUBPLOT_PATTERN, c._M = function(v, f, p) {
                var g = [], y = [], C;
                if (typeof f == "string" ? C = l.getModule(f).plot : typeof f == "function" ? C = f : C = f.plot, !C)
                  return [g, v];
                for (var m = p, h = 0; h < v.length; h++) {
                  var w = v[h], S = w[0].trace, E = S.zorder !== void 0;
                  S.visible !== !0 || S._length === 0 || (S._module && S._module.plot === C && (!E || S.zorder === m) ? g.push(w) : y.push(w));
                }
                return [g, y];
              };
            }
          ),
          /***/
          4424: (
            /***/
            function(s) {
              function c(l, v) {
                var f = [0, 0, 0, 0], p, g;
                for (p = 0; p < 4; ++p)
                  for (g = 0; g < 4; ++g)
                    f[g] += l[4 * p + g] * v[p];
                return f;
              }
              function i(l, v) {
                var f = c(l.projection, c(l.view, c(l.model, [v[0], v[1], v[2], 1])));
                return f;
              }
              s.exports = i;
            }
          ),
          /***/
          4859: (
            /***/
            function(s, c, i) {
              var l = i(5376), v = i(5656), f = i(2548), p = i(2872), g = i(4200), y = i(6741), C = i(2880).extendFlat, m = l({
                editType: "calc"
              });
              m.family.dflt = '"Open Sans", verdana, arial, sans-serif', m.size.dflt = 12, m.color.dflt = f.defaultLine, s.exports = {
                font: m,
                title: {
                  text: {
                    valType: "string",
                    editType: "layoutstyle"
                  },
                  font: l({
                    editType: "layoutstyle"
                  }),
                  xref: {
                    valType: "enumerated",
                    dflt: "container",
                    values: ["container", "paper"],
                    editType: "layoutstyle"
                  },
                  yref: {
                    valType: "enumerated",
                    dflt: "container",
                    values: ["container", "paper"],
                    editType: "layoutstyle"
                  },
                  x: {
                    valType: "number",
                    min: 0,
                    max: 1,
                    dflt: 0.5,
                    editType: "layoutstyle"
                  },
                  y: {
                    valType: "number",
                    min: 0,
                    max: 1,
                    dflt: "auto",
                    editType: "layoutstyle"
                  },
                  xanchor: {
                    valType: "enumerated",
                    dflt: "auto",
                    values: ["auto", "left", "center", "right"],
                    editType: "layoutstyle"
                  },
                  yanchor: {
                    valType: "enumerated",
                    dflt: "auto",
                    values: ["auto", "top", "middle", "bottom"],
                    editType: "layoutstyle"
                  },
                  pad: C(y({
                    editType: "layoutstyle"
                  }), {}),
                  automargin: {
                    valType: "boolean",
                    dflt: !1,
                    editType: "plot"
                  },
                  editType: "layoutstyle"
                },
                uniformtext: {
                  mode: {
                    valType: "enumerated",
                    values: [!1, "hide", "show"],
                    dflt: !1,
                    editType: "plot"
                  },
                  minsize: {
                    valType: "number",
                    min: 0,
                    dflt: 0,
                    editType: "plot"
                  },
                  editType: "plot"
                },
                autosize: {
                  valType: "boolean",
                  dflt: !1,
                  // autosize, width, and height get special editType treatment in _relayout
                  // so we can handle noop resizes more efficiently
                  editType: "none"
                },
                width: {
                  valType: "number",
                  min: 10,
                  dflt: 700,
                  editType: "plot"
                },
                height: {
                  valType: "number",
                  min: 10,
                  dflt: 450,
                  editType: "plot"
                },
                minreducedwidth: {
                  valType: "number",
                  min: 2,
                  dflt: 64,
                  editType: "plot"
                },
                minreducedheight: {
                  valType: "number",
                  min: 2,
                  dflt: 64,
                  editType: "plot"
                },
                margin: {
                  l: {
                    valType: "number",
                    min: 0,
                    dflt: 80,
                    editType: "plot"
                  },
                  r: {
                    valType: "number",
                    min: 0,
                    dflt: 80,
                    editType: "plot"
                  },
                  t: {
                    valType: "number",
                    min: 0,
                    dflt: 100,
                    editType: "plot"
                  },
                  b: {
                    valType: "number",
                    min: 0,
                    dflt: 80,
                    editType: "plot"
                  },
                  pad: {
                    valType: "number",
                    min: 0,
                    dflt: 0,
                    editType: "plot"
                  },
                  autoexpand: {
                    valType: "boolean",
                    dflt: !0,
                    editType: "plot"
                  },
                  editType: "plot"
                },
                computed: {
                  valType: "any",
                  editType: "none"
                },
                paper_bgcolor: {
                  valType: "color",
                  dflt: f.background,
                  editType: "plot"
                },
                plot_bgcolor: {
                  // defined here, but set in cartesian.supplyLayoutDefaults
                  // because it needs to know if there are (2D) axes or not
                  valType: "color",
                  dflt: f.background,
                  editType: "layoutstyle"
                },
                autotypenumbers: {
                  valType: "enumerated",
                  values: ["convert types", "strict"],
                  dflt: "convert types",
                  editType: "calc"
                },
                separators: {
                  valType: "string",
                  editType: "plot"
                },
                hidesources: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "plot"
                },
                showlegend: {
                  // handled in legend.supplyLayoutDefaults
                  // but included here because it's not in the legend object
                  valType: "boolean",
                  editType: "legend"
                },
                colorway: {
                  valType: "colorlist",
                  dflt: f.defaults,
                  editType: "calc"
                },
                datarevision: {
                  valType: "any",
                  editType: "calc"
                },
                uirevision: {
                  valType: "any",
                  editType: "none"
                },
                editrevision: {
                  valType: "any",
                  editType: "none"
                },
                selectionrevision: {
                  valType: "any",
                  editType: "none"
                },
                template: {
                  valType: "any",
                  editType: "calc"
                },
                newshape: p.newshape,
                activeshape: p.activeshape,
                newselection: g.newselection,
                activeselection: g.activeselection,
                meta: {
                  valType: "any",
                  arrayOk: !0,
                  editType: "plot"
                },
                transition: C({}, v.transition, {
                  editType: "none"
                }),
                _deprecated: {
                  title: {
                    valType: "string",
                    editType: "layoutstyle"
                  },
                  titlefont: l({
                    editType: "layoutstyle"
                  })
                }
              };
            }
          ),
          /***/
          6741: (
            /***/
            function(s) {
              s.exports = function(c) {
                var i = c.editType;
                return {
                  t: {
                    valType: "number",
                    dflt: 0,
                    editType: i
                  },
                  r: {
                    valType: "number",
                    dflt: 0,
                    editType: i
                  },
                  b: {
                    valType: "number",
                    dflt: 0,
                    editType: i
                  },
                  l: {
                    valType: "number",
                    dflt: 0,
                    editType: i
                  },
                  editType: i
                };
              };
            }
          ),
          /***/
          7316: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4336).m_, f = i(7624).SO, p = i(8248), g = i(3160), y = i(4040), C = i(3060), m = i(1780), h = i(3400), w = i(6308), S = i(9032).BADNUM, E = i(9811), x = i(1936).clearOutline, T = i(5308), F = i(5656), P = i(6672), k = i(4888)._M, I = h.relinkPrivateKeys, L = h._, A = s.exports = {};
              h.extendFlat(A, y), A.attributes = i(5464), A.attributes.type.values = A.allTypes, A.fontAttrs = i(5376), A.layoutAttributes = i(4859);
              var O = A.transformsRegistry, N = i(2460);
              A.executeAPICommand = N.executeAPICommand, A.computeAPICommandBindings = N.computeAPICommandBindings, A.manageCommandObserver = N.manageCommandObserver, A.hasSimpleAPICommandBindings = N.hasSimpleAPICommandBindings, A.redrawText = function(K) {
                return K = h.getGraphDiv(K), new Promise(function(ee) {
                  setTimeout(function() {
                    K._fullLayout && (y.getComponentMethod("annotations", "draw")(K), y.getComponentMethod("legend", "draw")(K), y.getComponentMethod("colorbar", "draw")(K), ee(A.previousPromises(K)));
                  }, 300);
                });
              }, A.resize = function(K) {
                K = h.getGraphDiv(K);
                var ee, oe = new Promise(function(_, V) {
                  (!K || h.isHidden(K)) && V(new Error("Resize must be passed a displayed plot div element.")), K._redrawTimer && clearTimeout(K._redrawTimer), K._resolveResize && (ee = K._resolveResize), K._resolveResize = _, K._redrawTimer = setTimeout(function() {
                    if (!K.layout || K.layout.width && K.layout.height || h.isHidden(K)) {
                      _(K);
                      return;
                    }
                    delete K.layout.width, delete K.layout.height;
                    var fe = K.changed;
                    K.autoplay = !0, y.call("relayout", K, {
                      autosize: !0
                    }).then(function() {
                      K.changed = fe, K._resolveResize === _ && (delete K._resolveResize, _(K));
                    });
                  }, 100);
                });
                return ee && ee(oe), oe;
              }, A.previousPromises = function(K) {
                if ((K._promises || []).length)
                  return Promise.all(K._promises).then(function() {
                    K._promises = [];
                  });
              }, A.addLinks = function(K) {
                if (!(!K._context.showLink && !K._context.showSources)) {
                  var ee = K._fullLayout, oe = h.ensureSingle(ee._paper, "text", "js-plot-link-container", function(me) {
                    me.style({
                      "font-family": '"Open Sans", Arial, sans-serif',
                      "font-size": "12px",
                      fill: w.defaultLine,
                      "pointer-events": "all"
                    }).each(function() {
                      var xe = l.select(this);
                      xe.append("tspan").classed("js-link-to-tool", !0), xe.append("tspan").classed("js-link-spacer", !0), xe.append("tspan").classed("js-sourcelinks", !0);
                    });
                  }), _ = oe.node(), V = {
                    y: ee._paper.attr("height") - 9
                  };
                  document.body.contains(_) && _.getComputedTextLength() >= ee.width - 20 ? (V["text-anchor"] = "start", V.x = 5) : (V["text-anchor"] = "end", V.x = ee._paper.attr("width") - 7), oe.attr(V);
                  var fe = oe.select(".js-link-to-tool"), $ = oe.select(".js-link-spacer"), he = oe.select(".js-sourcelinks");
                  K._context.showSources && K._context.showSources(K), K._context.showLink && Y(K, fe), $.text(fe.text() && he.text() ? " - " : "");
                }
              };
              function Y(K, ee) {
                ee.text("");
                var oe = ee.append("a").attr({
                  "xlink:xlink:href": "#",
                  class: "link--impt link--embedview",
                  "font-weight": "bold"
                }).text(K._context.linkText + " »");
                if (K._context.sendData)
                  oe.on("click", function() {
                    A.sendDataToCloud(K);
                  });
                else {
                  var _ = window.location.pathname.split("/"), V = window.location.search;
                  oe.attr({
                    "xlink:xlink:show": "new",
                    "xlink:xlink:href": "/" + _[2].split(".")[0] + "/" + _[1] + V
                  });
                }
              }
              A.sendDataToCloud = function(K) {
                var ee = (window.PLOTLYENV || {}).BASE_URL || K._context.plotlyServerURL;
                if (ee) {
                  K.emit("plotly_beforeexport");
                  var oe = l.select(K).append("div").attr("id", "hiddenform").style("display", "none"), _ = oe.append("form").attr({
                    action: ee + "/external",
                    method: "post",
                    target: "_blank"
                  }), V = _.append("input").attr({
                    type: "text",
                    name: "data"
                  });
                  return V.node().value = A.graphJson(K, !1, "keepdata"), _.node().submit(), oe.remove(), K.emit("plotly_afterexport"), !1;
                }
              };
              var j = ["days", "shortDays", "months", "shortMonths", "periods", "dateTime", "date", "time", "decimal", "thousands", "grouping", "currency"], te = ["year", "month", "dayMonth", "dayMonthYear"];
              A.supplyDefaults = function(K, ee) {
                var oe = ee && ee.skipUpdateCalc, _ = K._fullLayout || {};
                if (_._skipDefaults) {
                  delete _._skipDefaults;
                  return;
                }
                var V = K._fullLayout = {}, fe = K.layout || {}, $ = K._fullData || [], he = K._fullData = [], me = K.data || [], xe = K.calcdata || [], Fe = K._context || {}, Ve;
                K._transitionData || A.createTransitionData(K), V._dfltTitle = {
                  plot: L(K, "Click to enter Plot title"),
                  x: L(K, "Click to enter X axis title"),
                  y: L(K, "Click to enter Y axis title"),
                  colorbar: L(K, "Click to enter Colorscale title"),
                  annotation: L(K, "new text")
                }, V._traceWord = L(K, "trace");
                var Be = Z(K, j);
                if (V._mapboxAccessToken = Fe.mapboxAccessToken, _._initialAutoSizeIsDone) {
                  var Je = _.width, et = _.height;
                  A.supplyLayoutGlobalDefaults(fe, V, Be), fe.width || (V.width = Je), fe.height || (V.height = et), A.sanitizeMargins(V);
                } else {
                  A.supplyLayoutGlobalDefaults(fe, V, Be);
                  var at = !fe.width || !fe.height, De = V.autosize, Ne = Fe.autosizable, Ie = at && (De || Ne);
                  Ie ? A.plotAutoSize(K, fe, V) : at && A.sanitizeMargins(V), !De && at && (fe.width = V.width, fe.height = V.height);
                }
                V._d3locale = W(Be, V.separators), V._extraFormat = Z(K, te), V._initialAutoSizeIsDone = !0, V._dataLength = me.length, V._modules = [], V._visibleModules = [], V._basePlotModules = [];
                var Ue = V._subplots = z(), ot = V._splomAxes = {
                  x: {},
                  y: {}
                }, ct = V._splomSubplots = {};
                V._splomGridDflt = {}, V._scatterStackOpts = {}, V._firstScatter = {}, V._alignmentOpts = {}, V._colorAxes = {}, V._requestRangeslider = {}, V._traceUids = re($, me), V._globalTransforms = (K._context || {}).globalTransforms, A.supplyDataDefaults(me, he, fe, V);
                var Tt = Object.keys(ot.x), kt = Object.keys(ot.y);
                if (Tt.length > 1 && kt.length > 1) {
                  for (y.getComponentMethod("grid", "sizeDefaults")(fe, V), Ve = 0; Ve < Tt.length; Ve++)
                    h.pushUnique(Ue.xaxis, Tt[Ve]);
                  for (Ve = 0; Ve < kt.length; Ve++)
                    h.pushUnique(Ue.yaxis, kt[Ve]);
                  for (var Ot in ct)
                    h.pushUnique(Ue.cartesian, Ot);
                }
                if (V._has = A._hasPlotType.bind(V), $.length === he.length)
                  for (Ve = 0; Ve < he.length; Ve++)
                    I(he[Ve], $[Ve]);
                A.supplyLayoutModuleDefaults(fe, V, he, K._transitionData);
                var Rt = V._visibleModules, xt = [];
                for (Ve = 0; Ve < Rt.length; Ve++) {
                  var Wt = Rt[Ve].crossTraceDefaults;
                  Wt && h.pushUnique(xt, Wt);
                }
                for (Ve = 0; Ve < xt.length; Ve++)
                  xt[Ve](he, V);
                V._hasOnlyLargeSploms = V._basePlotModules.length === 1 && V._basePlotModules[0].name === "splom" && Tt.length > 15 && kt.length > 15 && V.shapes.length === 0 && V.images.length === 0, A.linkSubplots(he, V, $, _), A.cleanPlot(he, V, $, _);
                var bt = !!(_._has && _._has("gl2d")), jt = !!(V._has && V._has("gl2d")), qt = !!(_._has && _._has("cartesian")), Yt = !!(V._has && V._has("cartesian")), Ut = qt || bt, tt = Yt || jt;
                Ut && !tt ? _._bgLayer.remove() : tt && !Ut && (V._shouldCreateBgLayer = !0), _._zoomlayer && !K._dragging && x({
                  // mock old gd
                  _fullLayout: _
                }), q(he, V), I(V, _), y.getComponentMethod("colorscale", "crossTraceDefaults")(he, V), V._preGUI || (V._preGUI = {}), V._tracePreGUI || (V._tracePreGUI = {});
                var ze = V._tracePreGUI, _e = {}, Ye;
                for (Ye in ze) _e[Ye] = "old";
                for (Ve = 0; Ve < he.length; Ve++)
                  Ye = he[Ve]._fullInput.uid, _e[Ye] || (ze[Ye] = {}), _e[Ye] = "new";
                for (Ye in _e)
                  _e[Ye] === "old" && delete ze[Ye];
                ne(V), y.getComponentMethod("rangeslider", "makeData")(V), !oe && xe.length === he.length && A.supplyDefaultsUpdateCalc(xe, he);
              }, A.supplyDefaultsUpdateCalc = function(K, ee) {
                for (var oe = 0; oe < ee.length; oe++) {
                  var _ = ee[oe], V = (K[oe] || [])[0];
                  if (V && V.trace) {
                    var fe = V.trace;
                    if (fe._hasCalcTransform) {
                      var $ = fe._arrayAttrs, he, me, xe;
                      for (he = 0; he < $.length; he++)
                        me = $[he], xe = h.nestedProperty(fe, me).get().slice(), h.nestedProperty(_, me).set(xe);
                    }
                    V.trace = _;
                  }
                }
              };
              function re(K, ee) {
                var oe = ee.length, _ = [], V, fe;
                for (V = 0; V < K.length; V++) {
                  var $ = K[V]._fullInput;
                  $ !== fe && _.push($), fe = $;
                }
                var he = _.length, me = new Array(oe), xe = {};
                function Fe(Je, et) {
                  me[et] = Je, xe[Je] = 1;
                }
                function Ve(Je, et) {
                  if (Je && typeof Je == "string" && !xe[Je])
                    return Fe(Je, et), !0;
                }
                for (V = 0; V < oe; V++) {
                  var Be = ee[V].uid;
                  typeof Be == "number" && (Be = String(Be)), !Ve(Be, V) && (V < he && Ve(_[V].uid, V) || Fe(h.randstr(xe), V));
                }
                return me;
              }
              function z() {
                var K = y.collectableSubplotTypes, ee = {}, oe, _;
                if (!K) {
                  K = [];
                  var V = y.subplotsRegistry;
                  for (var fe in V) {
                    var $ = V[fe], he = $.attr;
                    if (he && (K.push(fe), Array.isArray(he)))
                      for (_ = 0; _ < he.length; _++)
                        h.pushUnique(K, he[_]);
                  }
                }
                for (oe = 0; oe < K.length; oe++)
                  ee[K[oe]] = [];
                return ee;
              }
              function Z(K, ee) {
                var oe = K._context.locale;
                oe || (oe = "en-US");
                var _ = !1, V = {};
                function fe(Ve) {
                  for (var Be = !0, Je = 0; Je < ee.length; Je++) {
                    var et = ee[Je];
                    V[et] || (Ve[et] ? V[et] = Ve[et] : Be = !1);
                  }
                  Be && (_ = !0);
                }
                for (var $ = 0; $ < 2; $++) {
                  for (var he = K._context.locales, me = 0; me < 2; me++) {
                    var xe = (he[oe] || {}).format;
                    if (xe && (fe(xe), _))
                      break;
                    he = y.localeRegistry;
                  }
                  var Fe = oe.split("-")[0];
                  if (_ || Fe === oe) break;
                  oe = Fe;
                }
                return _ || fe(y.localeRegistry.en.format), V;
              }
              function W(K, ee) {
                return K.decimal = ee.charAt(0), K.thousands = ee.charAt(1), {
                  numberFormat: function(oe) {
                    try {
                      oe = f(K).format(h.adjustFormat(oe));
                    } catch {
                      return h.warnBadFormat(oe), h.noFormat;
                    }
                    return oe;
                  },
                  timeFormat: v(K).utcFormat
                };
              }
              function q(K, ee) {
                var oe, _ = [];
                ee.meta && (oe = ee._meta = {
                  meta: ee.meta,
                  layout: {
                    meta: ee.meta
                  }
                });
                for (var V = 0; V < K.length; V++) {
                  var fe = K[V];
                  fe.meta ? _[fe.index] = fe._meta = {
                    meta: fe.meta
                  } : ee.meta && (fe._meta = {
                    meta: ee.meta
                  }), ee.meta && (fe._meta.layout = {
                    meta: ee.meta
                  });
                }
                _.length && (oe || (oe = ee._meta = {}), oe.data = _);
              }
              A.createTransitionData = function(K) {
                K._transitionData || (K._transitionData = {}), K._transitionData._frames || (K._transitionData._frames = []), K._transitionData._frameHash || (K._transitionData._frameHash = {}), K._transitionData._counter || (K._transitionData._counter = 0), K._transitionData._interruptCallbacks || (K._transitionData._interruptCallbacks = []);
              }, A._hasPlotType = function(K) {
                var ee, oe = this._basePlotModules || [];
                for (ee = 0; ee < oe.length; ee++)
                  if (oe[ee].name === K) return !0;
                var _ = this._modules || [];
                for (ee = 0; ee < _.length; ee++) {
                  var V = _[ee].name;
                  if (V === K) return !0;
                  var fe = y.modules[V];
                  if (fe && fe.categories[K]) return !0;
                }
                return !1;
              }, A.cleanPlot = function(K, ee, oe, _) {
                var V, fe, $ = _._basePlotModules || [];
                for (V = 0; V < $.length; V++) {
                  var he = $[V];
                  he.clean && he.clean(K, ee, oe, _);
                }
                var me = _._has && _._has("gl"), xe = ee._has && ee._has("gl");
                me && !xe && _._glcontainer !== void 0 && (_._glcontainer.selectAll(".gl-canvas").remove(), _._glcontainer.selectAll(".no-webgl").remove(), _._glcanvas = null);
                var Fe = !!_._infolayer;
                e: for (V = 0; V < oe.length; V++) {
                  var Ve = oe[V], Be = Ve.uid;
                  for (fe = 0; fe < K.length; fe++) {
                    var Je = K[fe];
                    if (Be === Je.uid) continue e;
                  }
                  Fe && _._infolayer.select(".cb" + Be).remove();
                }
              }, A.linkSubplots = function(K, ee, oe, _) {
                var V, fe, $ = _._plots || {}, he = ee._plots = {}, me = ee._subplots, xe = {
                  _fullData: K,
                  _fullLayout: ee
                }, Fe = me.cartesian.concat(me.gl2d || []);
                for (V = 0; V < Fe.length; V++) {
                  var Ve = Fe[V], Be = $[Ve], Je = E.getFromId(xe, Ve, "x"), et = E.getFromId(xe, Ve, "y"), at;
                  for (Be ? at = he[Ve] = Be : (at = he[Ve] = {}, at.id = Ve), Je._counterAxes.push(et._id), et._counterAxes.push(Je._id), Je._subplotsWith.push(Ve), et._subplotsWith.push(Ve), at.xaxis = Je, at.yaxis = et, at._hasClipOnAxisFalse = !1, fe = 0; fe < K.length; fe++) {
                    var De = K[fe];
                    if (De.xaxis === at.xaxis._id && De.yaxis === at.yaxis._id && De.cliponaxis === !1) {
                      at._hasClipOnAxisFalse = !0;
                      break;
                    }
                  }
                }
                var Ne = E.list(xe, null, !0), Ie;
                for (V = 0; V < Ne.length; V++) {
                  Ie = Ne[V];
                  var Ue = null;
                  Ie.overlaying && (Ue = E.getFromId(xe, Ie.overlaying), Ue && Ue.overlaying && (Ie.overlaying = !1, Ue = null)), Ie._mainAxis = Ue || Ie, Ue && (Ie.domain = Ue.domain.slice()), Ie._anchorAxis = Ie.anchor === "free" ? null : E.getFromId(xe, Ie.anchor);
                }
                for (V = 0; V < Ne.length; V++)
                  if (Ie = Ne[V], Ie._counterAxes.sort(E.idSort), Ie._subplotsWith.sort(h.subplotSort), Ie._mainSubplot = ie(Ie, ee), Ie._counterAxes.length && (Ie.spikemode && Ie.spikemode.indexOf("across") !== -1 || Ie.automargin && Ie.mirror && Ie.anchor !== "free" || y.getComponentMethod("rangeslider", "isVisible")(Ie))) {
                    var ot = 1, ct = 0;
                    for (fe = 0; fe < Ie._counterAxes.length; fe++) {
                      var Tt = E.getFromId(xe, Ie._counterAxes[fe]);
                      ot = Math.min(ot, Tt.domain[0]), ct = Math.max(ct, Tt.domain[1]);
                    }
                    ot < ct && (Ie._counterDomainMin = ot, Ie._counterDomainMax = ct);
                  }
              };
              function ie(K, ee) {
                var oe = {
                  _fullLayout: ee
                }, _ = K._id.charAt(0) === "x", V = K._mainAxis._anchorAxis, fe = "", $ = "", he = "";
                if (V && (he = V._mainAxis._id, fe = _ ? K._id + he : he + K._id), !fe || !ee._plots[fe]) {
                  fe = "";
                  for (var me = K._counterAxes, xe = 0; xe < me.length; xe++) {
                    var Fe = me[xe], Ve = _ ? K._id + Fe : Fe + K._id;
                    $ || ($ = Ve);
                    var Be = E.getFromId(oe, Fe);
                    if (he && Be.overlaying === he) {
                      fe = Ve;
                      break;
                    }
                  }
                }
                return fe || $;
              }
              A.clearExpandedTraceDefaultColors = function(K) {
                var ee, oe, _;
                function V($, he, me, xe) {
                  oe[xe] = he, oe.length = xe + 1, $.valType === "color" && $.dflt === void 0 && ee.push(oe.join("."));
                }
                for (oe = [], ee = K._module._colorAttrs, ee || (K._module._colorAttrs = ee = [], C.crawl(K._module.attributes, V)), _ = 0; _ < ee.length; _++) {
                  var fe = h.nestedProperty(K, "_input." + ee[_]);
                  fe.get() || h.nestedProperty(K, ee[_]).set(null);
                }
              }, A.supplyDataDefaults = function(K, ee, oe, _) {
                var V = _._modules, fe = _._visibleModules, $ = _._basePlotModules, he = 0, me = 0, xe, Fe, Ve;
                _._transformModules = [];
                function Be(kt) {
                  ee.push(kt);
                  var Ot = kt._module;
                  Ot && (h.pushUnique(V, Ot), kt.visible === !0 && h.pushUnique(fe, Ot), h.pushUnique($, kt._module.basePlotModule), he++, kt._input.visible !== !1 && me++);
                }
                var Je = {}, et = [], at = (oe.template || {}).data || {}, De = m.traceTemplater(at);
                for (xe = 0; xe < K.length; xe++) {
                  if (Ve = K[xe], Fe = De.newTrace(Ve), Fe.uid = _._traceUids[xe], A.supplyTraceDefaults(Ve, Fe, me, _, xe), Fe.index = xe, Fe._input = Ve, Fe._expandedIndex = he, Fe.transforms && Fe.transforms.length)
                    for (var Ne = Ve.visible !== !1 && Fe.visible === !1, Ie = X(Fe, ee, oe, _), Ue = 0; Ue < Ie.length; Ue++) {
                      var ot = Ie[Ue], ct = {
                        _template: Fe._template,
                        type: Fe.type,
                        // set uid using parent uid and expanded index
                        // to promote consistency between update calls
                        uid: Fe.uid + Ue
                      };
                      Ne && ot.visible === !1 && delete ot.visible, A.supplyTraceDefaults(ot, ct, he, _, xe), I(ct, ot), ct.index = xe, ct._input = Ve, ct._fullInput = Fe, ct._expandedIndex = he, ct._expandedInput = ot, Be(ct);
                    }
                  else
                    Fe._fullInput = Fe, Fe._expandedInput = Fe, Be(Fe);
                  y.traceIs(Fe, "carpetAxis") && (Je[Fe.carpet] = Fe), y.traceIs(Fe, "carpetDependent") && et.push(xe);
                }
                for (xe = 0; xe < et.length; xe++)
                  if (Fe = ee[et[xe]], !!Fe.visible) {
                    var Tt = Je[Fe.carpet];
                    if (Fe._carpet = Tt, !Tt || !Tt.visible) {
                      Fe.visible = !1;
                      continue;
                    }
                    Fe.xaxis = Tt.xaxis, Fe.yaxis = Tt.yaxis;
                  }
              }, A.supplyAnimationDefaults = function(K) {
                K = K || {};
                var ee, oe = {};
                function _(V, fe) {
                  return h.coerce(K || {}, oe, F, V, fe);
                }
                if (_("mode"), _("direction"), _("fromcurrent"), Array.isArray(K.frame))
                  for (oe.frame = [], ee = 0; ee < K.frame.length; ee++)
                    oe.frame[ee] = A.supplyAnimationFrameDefaults(K.frame[ee] || {});
                else
                  oe.frame = A.supplyAnimationFrameDefaults(K.frame || {});
                if (Array.isArray(K.transition))
                  for (oe.transition = [], ee = 0; ee < K.transition.length; ee++)
                    oe.transition[ee] = A.supplyAnimationTransitionDefaults(K.transition[ee] || {});
                else
                  oe.transition = A.supplyAnimationTransitionDefaults(K.transition || {});
                return oe;
              }, A.supplyAnimationFrameDefaults = function(K) {
                var ee = {};
                function oe(_, V) {
                  return h.coerce(K || {}, ee, F.frame, _, V);
                }
                return oe("duration"), oe("redraw"), ee;
              }, A.supplyAnimationTransitionDefaults = function(K) {
                var ee = {};
                function oe(_, V) {
                  return h.coerce(K || {}, ee, F.transition, _, V);
                }
                return oe("duration"), oe("easing"), ee;
              }, A.supplyFrameDefaults = function(K) {
                var ee = {};
                function oe(_, V) {
                  return h.coerce(K, ee, P, _, V);
                }
                return oe("group"), oe("name"), oe("traces"), oe("baseframe"), oe("data"), oe("layout"), ee;
              }, A.supplyTraceDefaults = function(K, ee, oe, _, V) {
                var fe = _.colorway || w.defaults, $ = fe[oe % fe.length], he;
                function me(Ue, ot) {
                  return h.coerce(K, ee, A.attributes, Ue, ot);
                }
                var xe = me("visible");
                me("type"), me("name", _._traceWord + " " + V), me("uirevision", _.uirevision);
                var Fe = A.getModule(ee);
                if (ee._module = Fe, Fe) {
                  var Ve = Fe.basePlotModule, Be = Ve.attr, Je = Ve.attributes;
                  if (Be && Je) {
                    var et = _._subplots, at = "";
                    if (xe || Ve.name !== "gl2d") {
                      if (Array.isArray(Be))
                        for (he = 0; he < Be.length; he++) {
                          var De = Be[he], Ne = h.coerce(K, ee, Je, De);
                          et[De] && h.pushUnique(et[De], Ne), at += Ne;
                        }
                      else
                        at = h.coerce(K, ee, Je, Be);
                      et[Ve.name] && h.pushUnique(et[Ve.name], at);
                    }
                  }
                }
                if (xe) {
                  if (me("customdata"), me("ids"), me("meta"), y.traceIs(ee, "showLegend") ? (h.coerce(K, ee, Fe.attributes.showlegend ? Fe.attributes : A.attributes, "showlegend"), me("legend"), me("legendwidth"), me("legendgroup"), me("legendgrouptitle.text"), me("legendrank"), ee._dfltShowLegend = !0) : ee._dfltShowLegend = !1, Fe && Fe.supplyDefaults(K, ee, $, _), y.traceIs(ee, "noOpacity") || me("opacity"), y.traceIs(ee, "notLegendIsolatable") && (ee.visible = !!ee.visible), y.traceIs(ee, "noHover") || (ee.hovertemplate || h.coerceHoverinfo(K, ee, _), ee.type !== "parcats" && y.getComponentMethod("fx", "supplyDefaults")(K, ee, $, _)), Fe && Fe.selectPoints) {
                    var Ie = me("selectedpoints");
                    h.isTypedArray(Ie) && (ee.selectedpoints = Array.from(Ie));
                  }
                  A.supplyTransformDefaults(K, ee, _);
                }
                return ee;
              };
              function ce(K) {
                var ee = K.transforms;
                if (Array.isArray(ee) && ee.length)
                  for (var oe = 0; oe < ee.length; oe++) {
                    var _ = ee[oe], V = _._module || O[_.type];
                    if (V && V.makesData) return !0;
                  }
                return !1;
              }
              A.hasMakesDataTransform = ce, A.supplyTransformDefaults = function(K, ee, oe) {
                if (ee._length || ce(K)) {
                  var _ = oe._globalTransforms || [], V = oe._transformModules || [];
                  if (!(!Array.isArray(K.transforms) && _.length === 0))
                    for (var fe = K.transforms || [], $ = _.concat(fe), he = ee.transforms = [], me = 0; me < $.length; me++) {
                      var xe = $[me], Fe = xe.type, Ve = O[Fe], Be, Je = !(xe._module && xe._module === Ve), et = Ve && typeof Ve.transform == "function";
                      Ve || h.warn("Unrecognized transform type " + Fe + "."), Ve && Ve.supplyDefaults && (Je || et) ? (Be = Ve.supplyDefaults(xe, ee, oe, K), Be.type = Fe, Be._module = Ve, h.pushUnique(V, Ve)) : Be = h.extendFlat({}, xe), he.push(Be);
                    }
                }
              };
              function X(K, ee, oe, _) {
                for (var V = K.transforms, fe = [K], $ = 0; $ < V.length; $++) {
                  var he = V[$], me = O[he.type];
                  me && me.transform && (fe = me.transform(fe, {
                    transform: he,
                    fullTrace: K,
                    fullData: ee,
                    layout: oe,
                    fullLayout: _,
                    transformIndex: $
                  }));
                }
                return fe;
              }
              A.supplyLayoutGlobalDefaults = function(K, ee, oe) {
                function _(Ve, Be) {
                  return h.coerce(K, ee, A.layoutAttributes, Ve, Be);
                }
                var V = K.template;
                h.isPlainObject(V) && (ee.template = V, ee._template = V.layout, ee._dataTemplate = V.data), _("autotypenumbers");
                var fe = h.coerceFont(_, "font"), $ = fe.size;
                h.coerceFont(_, "title.font", fe, {
                  overrideDflt: {
                    size: Math.round($ * 1.4)
                  }
                }), _("title.text", ee._dfltTitle.plot), _("title.xref");
                var he = _("title.yref");
                _("title.pad.t"), _("title.pad.r"), _("title.pad.b"), _("title.pad.l");
                var me = _("title.automargin");
                _("title.x"), _("title.xanchor"), _("title.y"), _("title.yanchor"), me && (he === "paper" && (ee.title.y !== 0 && (ee.title.y = 1), ee.title.yanchor === "auto" && (ee.title.yanchor = ee.title.y === 0 ? "top" : "bottom")), he === "container" && (ee.title.y === "auto" && (ee.title.y = 1), ee.title.yanchor === "auto" && (ee.title.yanchor = ee.title.y < 0.5 ? "bottom" : "top")));
                var xe = _("uniformtext.mode");
                xe && _("uniformtext.minsize"), _("autosize", !(K.width && K.height)), _("width"), _("height"), _("minreducedwidth"), _("minreducedheight"), _("margin.l"), _("margin.r"), _("margin.t"), _("margin.b"), _("margin.pad"), _("margin.autoexpand"), K.width && K.height && A.sanitizeMargins(ee), y.getComponentMethod("grid", "sizeDefaults")(K, ee), _("paper_bgcolor"), _("separators", oe.decimal + oe.thousands), _("hidesources"), _("colorway"), _("datarevision");
                var Fe = _("uirevision");
                _("editrevision", Fe), _("selectionrevision", Fe), y.getComponentMethod("modebar", "supplyLayoutDefaults")(K, ee), y.getComponentMethod("shapes", "supplyDrawNewShapeDefaults")(K, ee, _), y.getComponentMethod("selections", "supplyDrawNewSelectionDefaults")(K, ee, _), _("meta"), h.isPlainObject(K.transition) && (_("transition.duration"), _("transition.easing"), _("transition.ordering")), y.getComponentMethod("calendars", "handleDefaults")(K, ee, "calendar"), y.getComponentMethod("fx", "supplyLayoutGlobalDefaults")(K, ee, _), h.coerce(K, ee, T, "scattermode");
              };
              function U(K) {
                return typeof K == "string" && K.substr(K.length - 2) === "px" && parseFloat(K);
              }
              A.plotAutoSize = function(ee, oe, _) {
                var V = ee._context || {}, fe = V.frameMargins, $, he, me = h.isPlotDiv(ee);
                if (me && ee.emit("plotly_autosize"), V.fillFrame)
                  $ = window.innerWidth, he = window.innerHeight, document.body.style.overflow = "hidden";
                else {
                  var xe = me ? window.getComputedStyle(ee) : {};
                  if ($ = U(xe.width) || U(xe.maxWidth) || _.width, he = U(xe.height) || U(xe.maxHeight) || _.height, p(fe) && fe > 0) {
                    var Fe = 1 - 2 * fe;
                    $ = Math.round(Fe * $), he = Math.round(Fe * he);
                  }
                }
                var Ve = A.layoutAttributes.width.min, Be = A.layoutAttributes.height.min;
                $ < Ve && ($ = Ve), he < Be && (he = Be);
                var Je = !oe.width && Math.abs(_.width - $) > 1, et = !oe.height && Math.abs(_.height - he) > 1;
                (et || Je) && (Je && (_.width = $), et && (_.height = he)), ee._initialAutoSize || (ee._initialAutoSize = {
                  width: $,
                  height: he
                }), A.sanitizeMargins(_);
              }, A.supplyLayoutModuleDefaults = function(K, ee, oe, _) {
                var V = y.componentsRegistry, fe = ee._basePlotModules, $, he, me, xe = y.subplotsRegistry.cartesian;
                for ($ in V)
                  me = V[$], me.includeBasePlot && me.includeBasePlot(K, ee);
                fe.length || fe.push(xe), ee._has("cartesian") && (y.getComponentMethod("grid", "contentDefaults")(K, ee), xe.finalizeSubplots(K, ee));
                for (var Fe in ee._subplots)
                  ee._subplots[Fe].sort(h.subplotSort);
                for (he = 0; he < fe.length; he++)
                  me = fe[he], me.supplyLayoutDefaults && me.supplyLayoutDefaults(K, ee, oe);
                var Ve = ee._modules;
                for (he = 0; he < Ve.length; he++)
                  me = Ve[he], me.supplyLayoutDefaults && me.supplyLayoutDefaults(K, ee, oe);
                var Be = ee._transformModules;
                for (he = 0; he < Be.length; he++)
                  me = Be[he], me.supplyLayoutDefaults && me.supplyLayoutDefaults(K, ee, oe, _);
                for ($ in V)
                  me = V[$], me.supplyLayoutDefaults && me.supplyLayoutDefaults(K, ee, oe);
              }, A.purge = function(K) {
                var ee = K._fullLayout || {};
                ee._glcontainer !== void 0 && (ee._glcontainer.selectAll(".gl-canvas").remove(), ee._glcontainer.remove(), ee._glcanvas = null), ee._modeBar && ee._modeBar.destroy(), K._transitionData && (K._transitionData._interruptCallbacks && (K._transitionData._interruptCallbacks.length = 0), K._transitionData._animationRaf && window.cancelAnimationFrame(K._transitionData._animationRaf)), h.clearThrottle(), h.clearResponsive(K), delete K.data, delete K.layout, delete K._fullData, delete K._fullLayout, delete K.calcdata, delete K.empty, delete K.fid, delete K.undoqueue, delete K.undonum, delete K.autoplay, delete K.changed, delete K._promises, delete K._redrawTimer, delete K._hmlumcount, delete K._hmpixcount, delete K._transitionData, delete K._transitioning, delete K._initialAutoSize, delete K._transitioningWithDuration, delete K._dragging, delete K._dragged, delete K._dragdata, delete K._hoverdata, delete K._snapshotInProgress, delete K._editing, delete K._mouseDownTime, delete K._legendMouseDownTime, K.removeAllListeners && K.removeAllListeners();
              }, A.style = function(K) {
                var ee = K._fullLayout._visibleModules, oe = [], _;
                for (_ = 0; _ < ee.length; _++) {
                  var V = ee[_];
                  V.style && h.pushUnique(oe, V.style);
                }
                for (_ = 0; _ < oe.length; _++)
                  oe[_](K);
              }, A.sanitizeMargins = function(K) {
                if (!(!K || !K.margin)) {
                  var ee = K.width, oe = K.height, _ = K.margin, V = ee - (_.l + _.r), fe = oe - (_.t + _.b), $;
                  V < 0 && ($ = (ee - 1) / (_.l + _.r), _.l = Math.floor($ * _.l), _.r = Math.floor($ * _.r)), fe < 0 && ($ = (oe - 1) / (_.t + _.b), _.t = Math.floor($ * _.t), _.b = Math.floor($ * _.b));
                }
              }, A.clearAutoMarginIds = function(K) {
                K._fullLayout._pushmarginIds = {};
              }, A.allowAutoMargin = function(K, ee) {
                K._fullLayout._pushmarginIds[ee] = 1;
              };
              function ne(K) {
                var ee = K.margin;
                if (!K._size) {
                  var oe = K._size = {
                    l: Math.round(ee.l),
                    r: Math.round(ee.r),
                    t: Math.round(ee.t),
                    b: Math.round(ee.b),
                    p: Math.round(ee.pad)
                  };
                  oe.w = Math.round(K.width) - oe.l - oe.r, oe.h = Math.round(K.height) - oe.t - oe.b;
                }
                K._pushmargin || (K._pushmargin = {}), K._pushmarginIds || (K._pushmarginIds = {}), K._reservedMargin || (K._reservedMargin = {});
              }
              var se = 2, le = 2;
              A.autoMargin = function(K, ee, oe) {
                var _ = K._fullLayout, V = _.width, fe = _.height, $ = _.margin, he = _.minreducedwidth, me = _.minreducedheight, xe = h.constrain(V - $.l - $.r, se, he), Fe = h.constrain(fe - $.t - $.b, le, me), Ve = Math.max(0, V - xe), Be = Math.max(0, fe - Fe), Je = _._pushmargin, et = _._pushmarginIds;
                if ($.autoexpand !== !1) {
                  if (!oe)
                    delete Je[ee], delete et[ee];
                  else {
                    var at = oe.pad;
                    if (at === void 0 && (at = Math.min(12, $.l, $.r, $.t, $.b)), Ve) {
                      var De = (oe.l + oe.r) / Ve;
                      De > 1 && (oe.l /= De, oe.r /= De);
                    }
                    if (Be) {
                      var Ne = (oe.t + oe.b) / Be;
                      Ne > 1 && (oe.t /= Ne, oe.b /= Ne);
                    }
                    var Ie = oe.xl !== void 0 ? oe.xl : oe.x, Ue = oe.xr !== void 0 ? oe.xr : oe.x, ot = oe.yt !== void 0 ? oe.yt : oe.y, ct = oe.yb !== void 0 ? oe.yb : oe.y;
                    Je[ee] = {
                      l: {
                        val: Ie,
                        size: oe.l + at
                      },
                      r: {
                        val: Ue,
                        size: oe.r + at
                      },
                      b: {
                        val: ct,
                        size: oe.b + at
                      },
                      t: {
                        val: ot,
                        size: oe.t + at
                      }
                    }, et[ee] = 1;
                  }
                  if (!_._replotting)
                    return A.doAutoMargin(K);
                }
              };
              function ue(K) {
                if ("_redrawFromAutoMarginCount" in K._fullLayout)
                  return !1;
                var ee = E.list(K, "", !0);
                for (var oe in ee)
                  if (ee[oe].autoshift || ee[oe].shift) return !0;
                return !1;
              }
              A.doAutoMargin = function(K) {
                var ee = K._fullLayout, oe = ee.width, _ = ee.height;
                ee._size || (ee._size = {}), ne(ee);
                var V = ee._size, fe = ee.margin, $ = {
                  t: 0,
                  b: 0,
                  l: 0,
                  r: 0
                }, he = h.extendFlat({}, V), me = fe.l, xe = fe.r, Fe = fe.t, Ve = fe.b, Be = ee._pushmargin, Je = ee._pushmarginIds, et = ee.minreducedwidth, at = ee.minreducedheight;
                if (fe.autoexpand !== !1) {
                  for (var De in Be)
                    Je[De] || delete Be[De];
                  var Ne = K._fullLayout._reservedMargin;
                  for (var Ie in Ne)
                    for (var Ue in Ne[Ie]) {
                      var ot = Ne[Ie][Ue];
                      $[Ue] = Math.max($[Ue], ot);
                    }
                  Be.base = {
                    l: {
                      val: 0,
                      size: me
                    },
                    r: {
                      val: 1,
                      size: xe
                    },
                    t: {
                      val: 1,
                      size: Fe
                    },
                    b: {
                      val: 0,
                      size: Ve
                    }
                  };
                  for (var ct in $) {
                    var Tt = 0;
                    for (var kt in Be)
                      kt !== "base" && p(Be[kt][ct].size) && (Tt = Be[kt][ct].size > Tt ? Be[kt][ct].size : Tt);
                    var Ot = Math.max(0, fe[ct] - Tt);
                    $[ct] = Math.max(0, $[ct] - Ot);
                  }
                  for (var Rt in Be) {
                    var xt = Be[Rt].l || {}, Wt = Be[Rt].b || {}, bt = xt.val, jt = xt.size, qt = Wt.val, Yt = Wt.size, Ut = oe - $.r - $.l, tt = _ - $.t - $.b;
                    for (var ze in Be) {
                      if (p(jt) && Be[ze].r) {
                        var _e = Be[ze].r.val, Ye = Be[ze].r.size;
                        if (_e > bt) {
                          var lt = (jt * _e + (Ye - Ut) * bt) / (_e - bt), Te = (Ye * (1 - bt) + (jt - Ut) * (1 - _e)) / (_e - bt);
                          lt + Te > me + xe && (me = lt, xe = Te);
                        }
                      }
                      if (p(Yt) && Be[ze].t) {
                        var Oe = Be[ze].t.val, je = Be[ze].t.size;
                        if (Oe > qt) {
                          var Xe = (Yt * Oe + (je - tt) * qt) / (Oe - qt), nt = (je * (1 - qt) + (Yt - tt) * (1 - Oe)) / (Oe - qt);
                          Xe + nt > Ve + Fe && (Ve = Xe, Fe = nt);
                        }
                      }
                    }
                  }
                }
                var it = h.constrain(oe - fe.l - fe.r, se, et), Nt = h.constrain(_ - fe.t - fe.b, le, at), At = Math.max(0, oe - it), vt = Math.max(0, _ - Nt);
                if (At) {
                  var ut = (me + xe) / At;
                  ut > 1 && (me /= ut, xe /= ut);
                }
                if (vt) {
                  var Pt = (Ve + Fe) / vt;
                  Pt > 1 && (Ve /= Pt, Fe /= Pt);
                }
                if (V.l = Math.round(me) + $.l, V.r = Math.round(xe) + $.r, V.t = Math.round(Fe) + $.t, V.b = Math.round(Ve) + $.b, V.p = Math.round(fe.pad), V.w = Math.round(oe) - V.l - V.r, V.h = Math.round(_) - V.t - V.b, !ee._replotting && (A.didMarginChange(he, V) || ue(K))) {
                  "_redrawFromAutoMarginCount" in ee ? ee._redrawFromAutoMarginCount++ : ee._redrawFromAutoMarginCount = 1;
                  var rr = 3 * (1 + Object.keys(Je).length);
                  if (ee._redrawFromAutoMarginCount < rr)
                    return y.call("_doPlot", K);
                  ee._size = he, h.warn("Too many auto-margin redraws.");
                }
                ve(K);
              };
              function ve(K) {
                var ee = E.list(K, "", !0);
                ["_adjustTickLabelsOverflow", "_hideCounterAxisInsideTickLabels"].forEach(function(oe) {
                  for (var _ = 0; _ < ee.length; _++) {
                    var V = ee[_][oe];
                    V && V();
                  }
                });
              }
              var be = ["l", "r", "t", "b", "p", "w", "h"];
              A.didMarginChange = function(K, ee) {
                for (var oe = 0; oe < be.length; oe++) {
                  var _ = be[oe], V = K[_], fe = ee[_];
                  if (!p(V) || Math.abs(fe - V) > 1)
                    return !0;
                }
                return !1;
              }, A.graphJson = function(K, ee, oe, _, V, fe) {
                (V && ee && !K._fullData || V && !ee && !K._fullLayout) && A.supplyDefaults(K);
                var $ = V ? K._fullData : K.data, he = V ? K._fullLayout : K.layout, me = (K._transitionData || {})._frames;
                function xe(Be, Je) {
                  if (typeof Be == "function")
                    return Je ? "_function_" : null;
                  if (h.isPlainObject(Be)) {
                    var et = {}, at;
                    return Object.keys(Be).sort().forEach(function(Ue) {
                      if (["_", "["].indexOf(Ue.charAt(0)) === -1) {
                        if (typeof Be[Ue] == "function") {
                          Je && (et[Ue] = "_function");
                          return;
                        }
                        if (oe === "keepdata") {
                          if (Ue.substr(Ue.length - 3) === "src")
                            return;
                        } else if (oe === "keepstream") {
                          if (at = Be[Ue + "src"], typeof at == "string" && at.indexOf(":") > 0 && !h.isPlainObject(Be.stream))
                            return;
                        } else if (oe !== "keepall" && (at = Be[Ue + "src"], typeof at == "string" && at.indexOf(":") > 0))
                          return;
                        et[Ue] = xe(Be[Ue], Je);
                      }
                    }), et;
                  }
                  var De = Array.isArray(Be), Ne = h.isTypedArray(Be);
                  if ((De || Ne) && Be.dtype && Be.shape) {
                    var Ie = Be.bdata;
                    return xe({
                      dtype: Be.dtype,
                      shape: Be.shape,
                      bdata: (
                        // case of ArrayBuffer
                        h.isArrayBuffer(Ie) ? g.encode(Ie) : (
                          // case of b64 string
                          Ie
                        )
                      )
                    }, Je);
                  }
                  return De ? Be.map(function(Ue) {
                    return xe(Ue, Je);
                  }) : Ne ? h.simpleMap(Be, h.identity) : h.isJSDate(Be) ? h.ms2DateTimeLocal(+Be) : Be;
                }
                var Fe = {
                  data: ($ || []).map(function(Be) {
                    var Je = xe(Be);
                    return ee && delete Je.fit, Je;
                  })
                };
                if (!ee && (Fe.layout = xe(he), V)) {
                  var Ve = he._size;
                  Fe.layout.computed = {
                    margin: {
                      b: Ve.b,
                      l: Ve.l,
                      r: Ve.r,
                      t: Ve.t
                    }
                  };
                }
                return me && (Fe.frames = xe(me)), fe && (Fe.config = xe(K._context, !0)), _ === "object" ? Fe : JSON.stringify(Fe);
              }, A.modifyFrames = function(K, ee) {
                var oe, _, V, fe = K._transitionData._frames, $ = K._transitionData._frameHash;
                for (oe = 0; oe < ee.length; oe++)
                  switch (_ = ee[oe], _.type) {
                    case "replace":
                      V = _.value;
                      var he = (fe[_.index] || {}).name, me = V.name;
                      fe[_.index] = $[me] = V, me !== he && (delete $[he], $[me] = V);
                      break;
                    case "insert":
                      V = _.value, $[V.name] = V, fe.splice(_.index, 0, V);
                      break;
                    case "delete":
                      V = fe[_.index], delete $[V.name], fe.splice(_.index, 1);
                      break;
                  }
                return Promise.resolve();
              }, A.computeFrame = function(K, ee) {
                var oe = K._transitionData._frameHash, _, V, fe, $;
                if (!ee)
                  throw new Error("computeFrame must be given a string frame name");
                var he = oe[ee.toString()];
                if (!he)
                  return !1;
                for (var me = [he], xe = [he.name]; he.baseframe && (he = oe[he.baseframe.toString()]) && xe.indexOf(he.name) === -1; )
                  me.push(he), xe.push(he.name);
                for (var Fe = {}; he = me.pop(); )
                  if (he.layout && (Fe.layout = A.extendLayout(Fe.layout, he.layout)), he.data) {
                    if (Fe.data || (Fe.data = []), V = he.traces, !V)
                      for (V = [], _ = 0; _ < he.data.length; _++)
                        V[_] = _;
                    for (Fe.traces || (Fe.traces = []), _ = 0; _ < he.data.length; _++)
                      fe = V[_], fe != null && ($ = Fe.traces.indexOf(fe), $ === -1 && ($ = Fe.data.length, Fe.traces[$] = fe), Fe.data[$] = A.extendTrace(Fe.data[$], he.data[_]));
                  }
                return Fe;
              }, A.recomputeFrameHash = function(K) {
                for (var ee = K._transitionData._frameHash = {}, oe = K._transitionData._frames, _ = 0; _ < oe.length; _++) {
                  var V = oe[_];
                  V && V.name && (ee[V.name] = V);
                }
              }, A.extendObjectWithContainers = function(K, ee, oe) {
                var _, V, fe, $, he, me, xe, Fe, Ve = h.extendDeepNoArrays({}, ee || {}), Be = h.expandObjectPaths(Ve), Je = {};
                if (oe && oe.length)
                  for (fe = 0; fe < oe.length; fe++)
                    _ = h.nestedProperty(Be, oe[fe]), V = _.get(), V === void 0 ? h.nestedProperty(Je, oe[fe]).set(null) : (_.set(null), h.nestedProperty(Je, oe[fe]).set(V));
                if (K = h.extendDeepNoArrays(K || {}, Be), oe && oe.length) {
                  for (fe = 0; fe < oe.length; fe++)
                    if (he = h.nestedProperty(Je, oe[fe]), xe = he.get(), !!xe) {
                      for (me = h.nestedProperty(K, oe[fe]), Fe = me.get(), Array.isArray(Fe) || (Fe = [], me.set(Fe)), $ = 0; $ < xe.length; $++) {
                        var et = xe[$];
                        et === null ? Fe[$] = null : Fe[$] = A.extendObjectWithContainers(Fe[$], et);
                      }
                      me.set(Fe);
                    }
                }
                return K;
              }, A.dataArrayContainers = ["transforms", "dimensions"], A.layoutArrayContainers = y.layoutArrayContainers, A.extendTrace = function(K, ee) {
                return A.extendObjectWithContainers(K, ee, A.dataArrayContainers);
              }, A.extendLayout = function(K, ee) {
                return A.extendObjectWithContainers(K, ee, A.layoutArrayContainers);
              }, A.transition = function(K, ee, oe, _, V, fe) {
                var $ = {
                  redraw: V.redraw
                }, he = {}, me = [];
                return $.prepareFn = function() {
                  for (var xe = Array.isArray(ee) ? ee.length : 0, Fe = _.slice(0, xe), Ve = 0; Ve < Fe.length; Ve++) {
                    var Be = Fe[Ve], Je = K._fullData[Be], et = Je._module;
                    if (et) {
                      if (et.animatable) {
                        var at = et.basePlotModule.name;
                        he[at] || (he[at] = []), he[at].push(Be);
                      }
                      K.data[Fe[Ve]] = A.extendTrace(K.data[Fe[Ve]], ee[Ve]);
                    }
                  }
                  var De = h.expandObjectPaths(h.extendDeepNoArrays({}, oe)), Ne = /^[xy]axis[0-9]*$/;
                  for (var Ie in De)
                    Ne.test(Ie) && delete De[Ie].range;
                  A.extendLayout(K.layout, De), delete K.calcdata, A.supplyDefaults(K), A.doCalcdata(K);
                  var Ue = h.expandObjectPaths(oe);
                  if (Ue) {
                    var ot = K._fullLayout._plots;
                    for (var ct in ot) {
                      var Tt = ot[ct], kt = Tt.xaxis, Ot = Tt.yaxis, Rt = kt.range.slice(), xt = Ot.range.slice(), Wt = null, bt = null, jt = null, qt = null;
                      Array.isArray(Ue[kt._name + ".range"]) ? Wt = Ue[kt._name + ".range"].slice() : Array.isArray((Ue[kt._name] || {}).range) && (Wt = Ue[kt._name].range.slice()), Array.isArray(Ue[Ot._name + ".range"]) ? bt = Ue[Ot._name + ".range"].slice() : Array.isArray((Ue[Ot._name] || {}).range) && (bt = Ue[Ot._name].range.slice()), Rt && Wt && (kt.r2l(Rt[0]) !== kt.r2l(Wt[0]) || kt.r2l(Rt[1]) !== kt.r2l(Wt[1])) && (jt = {
                        xr0: Rt,
                        xr1: Wt
                      }), xt && bt && (Ot.r2l(xt[0]) !== Ot.r2l(bt[0]) || Ot.r2l(xt[1]) !== Ot.r2l(bt[1])) && (qt = {
                        yr0: xt,
                        yr1: bt
                      }), (jt || qt) && me.push(h.extendFlat({
                        plotinfo: Tt
                      }, jt, qt));
                    }
                  }
                  return Promise.resolve();
                }, $.runFn = function(xe) {
                  var Fe, Ve = K._fullLayout._basePlotModules, Be = me.length, Je;
                  if (oe)
                    for (Je = 0; Je < Ve.length; Je++)
                      Ve[Je].transitionAxes && Ve[Je].transitionAxes(K, me, fe, xe);
                  Be ? (Fe = h.extendFlat({}, fe), Fe.duration = 0, delete he.cartesian) : Fe = fe;
                  for (var et in he) {
                    var at = he[et], De = K._fullData[at[0]]._module;
                    De.basePlotModule.plot(K, at, Fe, xe);
                  }
                }, Me(K, fe, $);
              }, A.transitionFromReact = function(K, ee, oe, _) {
                var V = K._fullLayout, fe = V.transition, $ = {}, he = [];
                return $.prepareFn = function() {
                  var me = V._plots;
                  $.redraw = !1, ee.anim === "some" && ($.redraw = !0), oe.anim === "some" && ($.redraw = !0);
                  for (var xe in me) {
                    var Fe = me[xe], Ve = Fe.xaxis, Be = Fe.yaxis, Je = _[Ve._name].range.slice(), et = _[Be._name].range.slice(), at = Ve.range.slice(), De = Be.range.slice();
                    Ve.setScale(), Be.setScale();
                    var Ne = null, Ie = null;
                    (Ve.r2l(Je[0]) !== Ve.r2l(at[0]) || Ve.r2l(Je[1]) !== Ve.r2l(at[1])) && (Ne = {
                      xr0: Je,
                      xr1: at
                    }), (Be.r2l(et[0]) !== Be.r2l(De[0]) || Be.r2l(et[1]) !== Be.r2l(De[1])) && (Ie = {
                      yr0: et,
                      yr1: De
                    }), (Ne || Ie) && he.push(h.extendFlat({
                      plotinfo: Fe
                    }, Ne, Ie));
                  }
                  return Promise.resolve();
                }, $.runFn = function(me) {
                  for (var xe = K._fullData, Fe = K._fullLayout, Ve = Fe._basePlotModules, Be, Je, et, at = [], De = 0; De < xe.length; De++)
                    at.push(De);
                  function Ne() {
                    if (K._fullLayout)
                      for (var Ue = 0; Ue < Ve.length; Ue++)
                        Ve[Ue].transitionAxes && Ve[Ue].transitionAxes(K, he, Be, me);
                  }
                  function Ie() {
                    if (K._fullLayout)
                      for (var Ue = 0; Ue < Ve.length; Ue++)
                        Ve[Ue].plot(K, et, Je, me);
                  }
                  he.length && ee.anim ? fe.ordering === "traces first" ? (Be = h.extendFlat({}, fe, {
                    duration: 0
                  }), et = at, Je = fe, setTimeout(Ne, fe.duration), Ie()) : (Be = fe, et = null, Je = h.extendFlat({}, fe, {
                    duration: 0
                  }), setTimeout(Ie, Be.duration), Ne()) : he.length ? (Be = fe, Ne()) : ee.anim && (et = at, Je = fe, Ie());
                }, Me(K, fe, $);
              };
              function Me(K, ee, oe) {
                var _ = !1;
                function V(Ve) {
                  var Be = Promise.resolve();
                  if (!Ve) return Be;
                  for (; Ve.length; )
                    Be = Be.then(Ve.shift());
                  return Be;
                }
                function fe(Ve) {
                  if (Ve)
                    for (; Ve.length; )
                      Ve.shift();
                }
                function $() {
                  return K.emit("plotly_transitioning", []), new Promise(function(Ve) {
                    K._transitioning = !0, ee.duration > 0 && (K._transitioningWithDuration = !0), K._transitionData._interruptCallbacks.push(function() {
                      _ = !0;
                    }), oe.redraw && K._transitionData._interruptCallbacks.push(function() {
                      return y.call("redraw", K);
                    }), K._transitionData._interruptCallbacks.push(function() {
                      K.emit("plotly_transitioninterrupted", []);
                    });
                    var Be = 0, Je = 0;
                    function et() {
                      return Be++, function() {
                        Je++, !_ && Je === Be && he(Ve);
                      };
                    }
                    oe.runFn(et), setTimeout(et());
                  });
                }
                function he(Ve) {
                  if (K._transitionData)
                    return fe(K._transitionData._interruptCallbacks), Promise.resolve().then(function() {
                      if (oe.redraw)
                        return y.call("redraw", K);
                    }).then(function() {
                      K._transitioning = !1, K._transitioningWithDuration = !1, K.emit("plotly_transitioned", []);
                    }).then(Ve);
                }
                function me() {
                  if (K._transitionData)
                    return K._transitioning = !1, V(K._transitionData._interruptCallbacks);
                }
                var xe = [A.previousPromises, me, oe.prepareFn, A.rehover, A.reselect, $], Fe = h.syncOrAsync(xe, K);
                return (!Fe || !Fe.then) && (Fe = Promise.resolve()), Fe.then(function() {
                  return K;
                });
              }
              A.doCalcdata = function(K, ee) {
                var oe = E.list(K), _ = K._fullData, V = K._fullLayout, fe, $, he, me, xe = new Array(_.length), Fe = (K.calcdata || []).slice();
                for (K.calcdata = xe, V._numBoxes = 0, V._numViolins = 0, V._violinScaleGroupStats = {}, K._hmpixcount = 0, K._hmlumcount = 0, V._piecolormap = {}, V._sunburstcolormap = {}, V._treemapcolormap = {}, V._iciclecolormap = {}, V._funnelareacolormap = {}, he = 0; he < _.length; he++)
                  if (Array.isArray(ee) && ee.indexOf(he) === -1) {
                    xe[he] = Fe[he];
                    continue;
                  }
                for (he = 0; he < _.length; he++)
                  fe = _[he], fe._arrayAttrs = C.findArrayAttributes(fe), fe._extremes = {};
                var Ve = V._subplots.polar || [];
                for (he = 0; he < Ve.length; he++)
                  oe.push(V[Ve[he]].radialaxis, V[Ve[he]].angularaxis);
                for (var Be in V._colorAxes) {
                  var Je = V[Be];
                  Je.cauto !== !1 && (delete Je.cmin, delete Je.cmax);
                }
                var et = !1;
                function at(Ie) {
                  if (fe = _[Ie], $ = fe._module, fe.visible === !0 && fe.transforms) {
                    if ($ && $.calc) {
                      var Ue = $.calc(K, fe);
                      Ue[0] && Ue[0].t && Ue[0].t._scene && delete Ue[0].t._scene.dirty;
                    }
                    for (me = 0; me < fe.transforms.length; me++) {
                      var ot = fe.transforms[me];
                      $ = O[ot.type], $ && $.calcTransform && (fe._hasCalcTransform = !0, et = !0, $.calcTransform(K, fe, ot));
                    }
                  }
                }
                function De(Ie, Ue) {
                  if (fe = _[Ie], $ = fe._module, !!$.isContainer === Ue) {
                    var ot = [];
                    if (fe.visible === !0 && fe._length !== 0) {
                      delete fe._indexToPoints;
                      var ct = fe.transforms || [];
                      for (me = ct.length - 1; me >= 0; me--)
                        if (ct[me].enabled) {
                          fe._indexToPoints = ct[me]._indexToPoints;
                          break;
                        }
                      $ && $.calc && (ot = $.calc(K, fe));
                    }
                    (!Array.isArray(ot) || !ot[0]) && (ot = [{
                      x: S,
                      y: S
                    }]), ot[0].t || (ot[0].t = {}), ot[0].trace = fe, xe[Ie] = ot;
                  }
                }
                for (Re(oe, _, V), he = 0; he < _.length; he++) De(he, !0);
                for (he = 0; he < _.length; he++) at(he);
                for (et && Re(oe, _, V), he = 0; he < _.length; he++) De(he, !0);
                for (he = 0; he < _.length; he++) De(he, !1);
                Ae(K);
                var Ne = we(oe, K);
                if (Ne.length) {
                  for (V._numBoxes = 0, V._numViolins = 0, he = 0; he < Ne.length; he++) De(Ne[he], !0);
                  for (he = 0; he < Ne.length; he++) De(Ne[he], !1);
                  Ae(K);
                }
                y.getComponentMethod("fx", "calc")(K), y.getComponentMethod("errorbars", "calc")(K);
              };
              var Ge = /(total|sum|min|max|mean|median) (ascending|descending)/;
              function we(K, ee) {
                var oe = [], _, V, fe, $, he;
                function me(ze, _e, Ye) {
                  var lt = _e._id.charAt(0);
                  if (ze === "histogram2dcontour") {
                    var Te = _e._counterAxes[0], Oe = E.getFromId(ee, Te), je = lt === "x" || Te === "x" && Oe.type === "category", Xe = lt === "y" || Te === "y" && Oe.type === "category";
                    return function(nt, it) {
                      return nt === 0 || it === 0 || je && nt === Ye[it].length - 1 || Xe && it === Ye.length - 1 ? -1 : (lt === "y" ? it : nt) - 1;
                    };
                  } else
                    return function(nt, it) {
                      return lt === "y" ? it : nt;
                    };
                }
                var xe = {
                  min: function(ze) {
                    return h.aggNums(Math.min, null, ze);
                  },
                  max: function(ze) {
                    return h.aggNums(Math.max, null, ze);
                  },
                  sum: function(ze) {
                    return h.aggNums(function(_e, Ye) {
                      return _e + Ye;
                    }, null, ze);
                  },
                  total: function(ze) {
                    return h.aggNums(function(_e, Ye) {
                      return _e + Ye;
                    }, null, ze);
                  },
                  mean: function(ze) {
                    return h.mean(ze);
                  },
                  median: function(ze) {
                    return h.median(ze);
                  }
                };
                function Fe(ze, _e) {
                  return ze[1] - _e[1];
                }
                function Ve(ze, _e) {
                  return _e[1] - ze[1];
                }
                for (_ = 0; _ < K.length; _++) {
                  var Be = K[_];
                  if (Be.type === "category") {
                    var Je = Be.categoryorder.match(Ge);
                    if (Je) {
                      var et = Je[1], at = Je[2], De = Be._id.charAt(0), Ne = De === "x", Ie = [];
                      for (V = 0; V < Be._categories.length; V++)
                        Ie.push([Be._categories[V], []]);
                      for (V = 0; V < Be._traceIndices.length; V++) {
                        var Ue = Be._traceIndices[V], ot = ee._fullData[Ue];
                        if (ot.visible === !0) {
                          var ct = ot.type;
                          y.traceIs(ot, "histogram") && (delete ot._xautoBinFinished, delete ot._yautoBinFinished);
                          var Tt = ct === "splom", kt = ct === "scattergl", Ot = ee.calcdata[Ue];
                          for (fe = 0; fe < Ot.length; fe++) {
                            var Rt = Ot[fe], xt, Wt;
                            if (Tt) {
                              var bt = ot._axesDim[Be._id];
                              if (!Ne) {
                                var jt = ot._diag[bt][0];
                                jt && (Be = ee._fullLayout[E.id2name(jt)]);
                              }
                              var qt = Rt.trace.dimensions[bt].values;
                              for ($ = 0; $ < qt.length; $++)
                                for (xt = Be._categoriesMap[qt[$]], he = 0; he < Rt.trace.dimensions.length; he++)
                                  if (he !== bt) {
                                    var Yt = Rt.trace.dimensions[he];
                                    Ie[xt][1].push(Yt.values[$]);
                                  }
                            } else if (kt) {
                              for ($ = 0; $ < Rt.t.x.length; $++)
                                Ne ? (xt = Rt.t.x[$], Wt = Rt.t.y[$]) : (xt = Rt.t.y[$], Wt = Rt.t.x[$]), Ie[xt][1].push(Wt);
                              Rt.t && Rt.t._scene && delete Rt.t._scene.dirty;
                            } else if (Rt.hasOwnProperty("z")) {
                              Wt = Rt.z;
                              var Ut = me(ot.type, Be, Wt);
                              for ($ = 0; $ < Wt.length; $++)
                                for (he = 0; he < Wt[$].length; he++)
                                  xt = Ut(he, $), xt + 1 && Ie[xt][1].push(Wt[$][he]);
                            } else
                              for (xt = Rt.p, xt === void 0 && (xt = Rt[De]), Wt = Rt.s, Wt === void 0 && (Wt = Rt.v), Wt === void 0 && (Wt = Ne ? Rt.y : Rt.x), Array.isArray(Wt) || (Wt === void 0 ? Wt = [] : Wt = [Wt]), $ = 0; $ < Wt.length; $++)
                                Ie[xt][1].push(Wt[$]);
                          }
                        }
                      }
                      Be._categoriesValue = Ie;
                      var tt = [];
                      for (V = 0; V < Ie.length; V++)
                        tt.push([Ie[V][0], xe[et](Ie[V][1])]);
                      tt.sort(at === "descending" ? Ve : Fe), Be._categoriesAggregatedValue = tt, Be._initialCategories = tt.map(function(ze) {
                        return ze[0];
                      }), oe = oe.concat(Be.sortByInitialCategories());
                    }
                  }
                }
                return oe;
              }
              function Re(K, ee, oe) {
                var _ = {};
                function V(me) {
                  me.clearCalc(), me.type === "multicategory" && me.setupMultiCategory(ee), _[me._id] = 1;
                }
                h.simpleMap(K, V);
                for (var fe = oe._axisMatchGroups || [], $ = 0; $ < fe.length; $++)
                  for (var he in fe[$])
                    _[he] || V(oe[E.id2name(he)]);
              }
              function Ae(K) {
                var ee = K._fullLayout, oe = ee._visibleModules, _ = {}, V, fe, $;
                for (fe = 0; fe < oe.length; fe++) {
                  var he = oe[fe], me = he.crossTraceCalc;
                  if (me) {
                    var xe = he.basePlotModule.name;
                    _[xe] ? h.pushUnique(_[xe], me) : _[xe] = [me];
                  }
                }
                for ($ in _) {
                  var Fe = _[$], Ve = ee._subplots[$];
                  if (Array.isArray(Ve))
                    for (V = 0; V < Ve.length; V++) {
                      var Be = Ve[V], Je = $ === "cartesian" ? ee._plots[Be] : ee[Be];
                      for (fe = 0; fe < Fe.length; fe++)
                        Fe[fe](K, Je, Be);
                    }
                  else
                    for (fe = 0; fe < Fe.length; fe++)
                      Fe[fe](K);
                }
              }
              A.rehover = function(K) {
                K._fullLayout._rehover && K._fullLayout._rehover();
              }, A.redrag = function(K) {
                K._fullLayout._redrag && K._fullLayout._redrag();
              }, A.reselect = function(K) {
                var ee = K._fullLayout, oe = (K.layout || {}).selections, _ = ee._previousSelections;
                ee._previousSelections = oe;
                var V = ee._reselect || JSON.stringify(oe) !== JSON.stringify(_);
                y.getComponentMethod("selections", "reselect")(K, V);
              }, A.generalUpdatePerTraceModule = function(K, ee, oe, _) {
                var V = ee.traceHash, fe = {}, $;
                for ($ = 0; $ < oe.length; $++) {
                  var he = oe[$], me = he[0].trace;
                  me.visible && (fe[me.type] = fe[me.type] || [], fe[me.type].push(he));
                }
                for (var xe in V)
                  if (!fe[xe]) {
                    var Fe = V[xe][0], Ve = Fe[0].trace;
                    Ve.visible = !1, fe[xe] = [Fe];
                  }
                for (var Be in fe) {
                  var Je = fe[Be], et = Je[0][0].trace._module;
                  et.plot(K, ee, h.filterVisible(Je), _);
                }
                ee.traceHash = fe;
              }, A.plotBasePlot = function(K, ee, oe, _, V) {
                var fe = y.getModule(K), $ = k(ee.calcdata, fe)[0];
                fe.plot(ee, $, _, V);
              }, A.cleanBasePlot = function(K, ee, oe, _, V) {
                var fe = V._has && V._has(K), $ = oe._has && oe._has(K);
                fe && !$ && V["_" + K + "layer"].selectAll("g.trace").remove();
              };
            }
          ),
          /***/
          1776: (
            /***/
            function(s, c, i) {
              var l = i(6880);
              l.FORMAT_LINK, l.DATE_FORMAT_LINK;
              function v(f) {
                var p = f.description ? " " + f.description : "", g = f.keys || [];
                if (g.length > 0) {
                  for (var y = [], C = 0; C < g.length; C++)
                    y[C] = "`" + g[C] + "`";
                  p = p + "Finally, the template string has access to ", g.length === 1 ? p = p + "variable " + y[0] : p = p + "variables " + y.slice(0, -1).join(", ") + " and " + y.slice(-1) + ".";
                }
                return p;
              }
              c.Ks = function(f, p) {
                f = f || {}, p = p || {}, v(p);
                var g = {
                  valType: "string",
                  dflt: "",
                  editType: f.editType || "none"
                };
                return f.arrayOk !== !1 && (g.arrayOk = !0), g;
              }, c.Gw = function(f, p) {
                f = f || {}, p = p || {}, v(p);
                var g = {
                  valType: "string",
                  dflt: "",
                  editType: f.editType || "calc"
                };
                return f.arrayOk !== !1 && (g.arrayOk = !0), g;
              }, c.ye = function(f, p) {
                f = f || {}, p = p || {}, f.newshape, v(p);
                var g = {
                  valType: "string",
                  dflt: "",
                  editType: f.editType || "arraydraw"
                };
                return g;
              };
            }
          ),
          /***/
          4040: (
            /***/
            function(s, c, i) {
              var l = i(4248), v = i(6628), f = i(2416), p = i(3620), g = i(2200).addStyleRule, y = i(2880), C = i(5464), m = i(4859), h = y.extendFlat, w = y.extendDeepAll;
              c.modules = {}, c.allCategories = {}, c.allTypes = [], c.subplotsRegistry = {}, c.transformsRegistry = {}, c.componentsRegistry = {}, c.layoutArrayContainers = [], c.layoutArrayRegexes = [], c.traceLayoutAttributes = {}, c.localeRegistry = {}, c.apiMethodRegistry = {}, c.collectableSubplotTypes = null, c.register = function(N) {
                if (c.collectableSubplotTypes = null, N)
                  N && !Array.isArray(N) && (N = [N]);
                else throw new Error("No argument passed to Plotly.register.");
                for (var Y = 0; Y < N.length; Y++) {
                  var j = N[Y];
                  if (!j)
                    throw new Error("Invalid module was attempted to be registered!");
                  switch (j.moduleType) {
                    case "trace":
                      S(j);
                      break;
                    case "transform":
                      T(j);
                      break;
                    case "component":
                      x(j);
                      break;
                    case "locale":
                      F(j);
                      break;
                    case "apiMethod":
                      var te = j.name;
                      c.apiMethodRegistry[te] = j.fn;
                      break;
                    default:
                      throw new Error("Invalid module was attempted to be registered!");
                  }
                }
              }, c.getModule = function(O) {
                var N = c.modules[A(O)];
                return N ? N._module : !1;
              }, c.traceIs = function(O, N) {
                if (O = A(O), O === "various") return !1;
                var Y = c.modules[O];
                return Y || (O && l.log("Unrecognized trace type " + O + "."), Y = c.modules[C.type.dflt]), !!Y.categories[N];
              }, c.getTransformIndices = function(O, N) {
                for (var Y = [], j = O.transforms || [], te = 0; te < j.length; te++)
                  j[te].type === N && Y.push(te);
                return Y;
              }, c.hasTransform = function(O, N) {
                for (var Y = O.transforms || [], j = 0; j < Y.length; j++)
                  if (Y[j].type === N)
                    return !0;
                return !1;
              }, c.getComponentMethod = function(O, N) {
                var Y = c.componentsRegistry[O];
                return Y && Y[N] || v;
              }, c.call = function() {
                var O = arguments[0], N = [].slice.call(arguments, 1);
                return c.apiMethodRegistry[O].apply(null, N);
              };
              function S(O) {
                var N = O.name, Y = O.categories, j = O.meta;
                if (c.modules[N]) {
                  l.log("Type " + N + " already registered");
                  return;
                }
                c.subplotsRegistry[O.basePlotModule.name] || E(O.basePlotModule);
                for (var te = {}, re = 0; re < Y.length; re++)
                  te[Y[re]] = !0, c.allCategories[Y[re]] = !0;
                c.modules[N] = {
                  _module: O,
                  categories: te
                }, j && Object.keys(j).length && (c.modules[N].meta = j), c.allTypes.push(N);
                for (var z in c.componentsRegistry)
                  k(z, N);
                O.layoutAttributes && h(c.traceLayoutAttributes, O.layoutAttributes);
                var Z = O.basePlotModule, W = Z.name;
                if (W === "mapbox") {
                  var q = Z.constants.styleRules;
                  for (var ie in q)
                    g(".js-plotly-plot .plotly .mapboxgl-" + ie, q[ie]);
                }
                (W === "geo" || W === "mapbox") && window.PlotlyGeoAssets === void 0 && (window.PlotlyGeoAssets = {
                  topojson: {}
                });
              }
              function E(O) {
                var N = O.name;
                if (c.subplotsRegistry[N]) {
                  l.log("Plot type " + N + " already registered.");
                  return;
                }
                P(O), c.subplotsRegistry[N] = O;
                for (var Y in c.componentsRegistry)
                  L(Y, O.name);
              }
              function x(O) {
                if (typeof O.name != "string")
                  throw new Error("Component module *name* must be a string.");
                var N = O.name;
                c.componentsRegistry[N] = O, O.layoutAttributes && (O.layoutAttributes._isLinkedToArray && f(c.layoutArrayContainers, N), P(O));
                for (var Y in c.modules)
                  k(N, Y);
                for (var j in c.subplotsRegistry)
                  L(N, j);
                for (var te in c.transformsRegistry)
                  I(N, te);
                O.schema && O.schema.layout && w(m, O.schema.layout);
              }
              function T(O) {
                if (typeof O.name != "string")
                  throw new Error("Transform module *name* must be a string.");
                var N = "Transform module " + O.name, Y = typeof O.transform == "function", j = typeof O.calcTransform == "function";
                if (!Y && !j)
                  throw new Error(N + " is missing a *transform* or *calcTransform* method.");
                Y && j && l.log([N + " has both a *transform* and *calcTransform* methods.", "Please note that all *transform* methods are executed", "before all *calcTransform* methods."].join(" ")), p(O.attributes) || l.log(N + " registered without an *attributes* object."), typeof O.supplyDefaults != "function" && l.log(N + " registered without a *supplyDefaults* method."), c.transformsRegistry[O.name] = O;
                for (var te in c.componentsRegistry)
                  I(te, O.name);
              }
              function F(O) {
                var N = O.name, Y = N.split("-")[0], j = O.dictionary, te = O.format, re = j && Object.keys(j).length, z = te && Object.keys(te).length, Z = c.localeRegistry, W = Z[N];
                if (W || (Z[N] = W = {}), Y !== N) {
                  var q = Z[Y];
                  q || (Z[Y] = q = {}), re && q.dictionary === W.dictionary && (q.dictionary = j), z && q.format === W.format && (q.format = te);
                }
                re && (W.dictionary = j), z && (W.format = te);
              }
              function P(O) {
                if (O.layoutAttributes) {
                  var N = O.layoutAttributes._arrayAttrRegexps;
                  if (N)
                    for (var Y = 0; Y < N.length; Y++)
                      f(c.layoutArrayRegexes, N[Y]);
                }
              }
              function k(O, N) {
                var Y = c.componentsRegistry[O].schema;
                if (!(!Y || !Y.traces)) {
                  var j = Y.traces[N];
                  j && w(c.modules[N]._module.attributes, j);
                }
              }
              function I(O, N) {
                var Y = c.componentsRegistry[O].schema;
                if (!(!Y || !Y.transforms)) {
                  var j = Y.transforms[N];
                  j && w(c.transformsRegistry[N].attributes, j);
                }
              }
              function L(O, N) {
                var Y = c.componentsRegistry[O].schema;
                if (!(!Y || !Y.subplots)) {
                  var j = c.subplotsRegistry[N], te = j.layoutAttributes, re = j.attr === "subplot" ? j.name : j.attr;
                  Array.isArray(re) && (re = re[0]);
                  var z = Y.subplots[re];
                  te && z && w(te, z);
                }
              }
              function A(O) {
                return typeof O == "object" && (O = O.type), O;
              }
            }
          ),
          /***/
          1536: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(3400), f = v.extendFlat, p = v.extendDeep;
              function g(C) {
                var m;
                switch (C) {
                  case "themes__thumb":
                    m = {
                      autosize: !0,
                      width: 150,
                      height: 150,
                      title: {
                        text: ""
                      },
                      showlegend: !1,
                      margin: {
                        l: 5,
                        r: 5,
                        t: 5,
                        b: 5,
                        pad: 0
                      },
                      annotations: []
                    };
                    break;
                  case "thumbnail":
                    m = {
                      title: {
                        text: ""
                      },
                      hidesources: !0,
                      showlegend: !1,
                      borderwidth: 0,
                      bordercolor: "",
                      margin: {
                        l: 1,
                        r: 1,
                        t: 1,
                        b: 1,
                        pad: 0
                      },
                      annotations: []
                    };
                    break;
                  default:
                    m = {};
                }
                return m;
              }
              function y(C) {
                var m = ["xaxis", "yaxis", "zaxis"];
                return m.indexOf(C.slice(0, 5)) > -1;
              }
              s.exports = function(m, h) {
                var w, S = m.data, E = m.layout, x = p([], S), T = p({}, E, g(h.tileClass)), F = m._context || {};
                if (h.width && (T.width = h.width), h.height && (T.height = h.height), h.tileClass === "thumbnail" || h.tileClass === "themes__thumb") {
                  T.annotations = [];
                  var P = Object.keys(T);
                  for (w = 0; w < P.length; w++)
                    y(P[w]) && (T[P[w]].title = {
                      text: ""
                    });
                  for (w = 0; w < x.length; w++) {
                    var k = x[w];
                    k.showscale = !1, k.marker && (k.marker.showscale = !1), l.traceIs(k, "pie-like") && (k.textposition = "none");
                  }
                }
                if (Array.isArray(h.annotations))
                  for (w = 0; w < h.annotations.length; w++)
                    T.annotations.push(h.annotations[w]);
                var I = Object.keys(T).filter(function(Y) {
                  return Y.match(/^scene\d*$/);
                });
                if (I.length) {
                  var L = {};
                  for (h.tileClass === "thumbnail" && (L = {
                    title: {
                      text: ""
                    },
                    showaxeslabels: !1,
                    showticklabels: !1,
                    linetickenable: !1
                  }), w = 0; w < I.length; w++) {
                    var A = T[I[w]];
                    A.xaxis || (A.xaxis = {}), A.yaxis || (A.yaxis = {}), A.zaxis || (A.zaxis = {}), f(A.xaxis, L), f(A.yaxis, L), f(A.zaxis, L), A._scene = null;
                  }
                }
                var O = document.createElement("div");
                h.tileClass && (O.className = h.tileClass);
                var N = {
                  gd: O,
                  td: O,
                  // for external (image server) compatibility
                  layout: T,
                  data: x,
                  config: {
                    staticPlot: h.staticPlot === void 0 ? !0 : h.staticPlot,
                    plotGlPixelRatio: h.plotGlPixelRatio === void 0 ? 2 : h.plotGlPixelRatio,
                    displaylogo: h.displaylogo || !1,
                    showLink: h.showLink || !1,
                    showTips: h.showTips || !1,
                    mapboxAccessToken: F.mapboxAccessToken
                  }
                };
                return h.setBackground !== "transparent" && (N.config.setBackground = h.setBackground || "opaque"), N.gd.defaultLayout = g(h.tileClass), N;
              };
            }
          ),
          /***/
          7412: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(7024), f = i(8616), p = i(7030);
              function g(y, C) {
                var m;
                return l.isPlainObject(y) || (m = l.getGraphDiv(y)), C = C || {}, C.format = C.format || "png", C.width = C.width || null, C.height = C.height || null, C.imageDataOnly = !0, new Promise(function(h, w) {
                  m && m._snapshotInProgress && w(new Error("Snapshotting already in progress.")), l.isIE() && C.format !== "svg" && w(new Error(p.MSG_IE_BAD_FORMAT)), m && (m._snapshotInProgress = !0);
                  var S = v(y, C), E = C.filename || y.fn || "newplot";
                  E += "." + C.format.replace("-", "."), S.then(function(x) {
                    return m && (m._snapshotInProgress = !1), f(x, E, C.format);
                  }).then(function(x) {
                    h(x);
                  }).catch(function(x) {
                    m && (m._snapshotInProgress = !1), w(x);
                  });
                });
              }
              s.exports = g;
            }
          ),
          /***/
          8616: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(7030);
              function f(p, g, y) {
                var C = document.createElement("a"), m = "download" in C, h = new Promise(function(w, S) {
                  var E, x;
                  if (l.isIE())
                    return E = v.createBlob(p, "svg"), window.navigator.msSaveBlob(E, g), E = null, w(g);
                  if (m)
                    return E = v.createBlob(p, y), x = v.createObjectURL(E), C.href = x, C.download = g, document.body.appendChild(C), C.click(), document.body.removeChild(C), v.revokeObjectURL(x), E = null, w(g);
                  if (l.isSafari()) {
                    var T = y === "svg" ? "," : ";base64,";
                    return v.octetStream(T + encodeURIComponent(p)), w(g);
                  }
                  S(new Error("download error"));
                });
                return h;
              }
              s.exports = f;
            }
          ),
          /***/
          7030: (
            /***/
            function(s, c, i) {
              var l = i(4040);
              c.getDelay = function(p) {
                return p._has && (p._has("gl3d") || p._has("gl2d") || p._has("mapbox")) ? 500 : 0;
              }, c.getRedrawFunc = function(p) {
                return function() {
                  l.getComponentMethod("colorbar", "draw")(p);
                };
              }, c.encodeSVG = function(p) {
                return "data:image/svg+xml," + encodeURIComponent(p);
              }, c.encodeJSON = function(p) {
                return "data:application/json," + encodeURIComponent(p);
              };
              var v = window.URL || window.webkitURL;
              c.createObjectURL = function(p) {
                return v.createObjectURL(p);
              }, c.revokeObjectURL = function(p) {
                return v.revokeObjectURL(p);
              }, c.createBlob = function(p, g) {
                if (g === "svg")
                  return new window.Blob([p], {
                    type: "image/svg+xml;charset=utf-8"
                  });
                if (g === "full-json")
                  return new window.Blob([p], {
                    type: "application/json;charset=utf-8"
                  });
                var y = f(window.atob(p));
                return new window.Blob([y], {
                  type: "image/" + g
                });
              }, c.octetStream = function(p) {
                document.location.href = "data:application/octet-stream" + p;
              };
              function f(p) {
                for (var g = p.length, y = new ArrayBuffer(g), C = new Uint8Array(y), m = 0; m < g; m++)
                  C[m] = p.charCodeAt(m);
                return y;
              }
              c.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/, c.MSG_IE_BAD_FORMAT = "Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.";
            }
          ),
          /***/
          8904: (
            /***/
            function(s, c, i) {
              var l = i(7030), v = {
                getDelay: l.getDelay,
                getRedrawFunc: l.getRedrawFunc,
                clone: i(1536),
                toSVG: i(7164),
                svgToImg: i(3268),
                toImage: i(1808),
                downloadImage: i(7412)
              };
              s.exports = v;
            }
          ),
          /***/
          3268: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(1252).EventEmitter, f = i(7030);
              function p(g) {
                var y = g.emitter || new v(), C = new Promise(function(m, h) {
                  var w = window.Image, S = g.svg, E = g.format || "png";
                  if (l.isIE() && E !== "svg") {
                    var x = new Error(f.MSG_IE_BAD_FORMAT);
                    return h(x), g.promise ? C : y.emit("error", x);
                  }
                  var T = g.canvas, F = g.scale || 1, P = g.width || 300, k = g.height || 150, I = F * P, L = F * k, A = T.getContext("2d", {
                    willReadFrequently: !0
                  }), O = new w(), N, Y;
                  E === "svg" || l.isSafari() ? Y = f.encodeSVG(S) : (N = f.createBlob(S, "svg"), Y = f.createObjectURL(N)), T.width = I, T.height = L, O.onload = function() {
                    var j;
                    switch (N = null, f.revokeObjectURL(Y), E !== "svg" && A.drawImage(O, 0, 0, I, L), E) {
                      case "jpeg":
                        j = T.toDataURL("image/jpeg");
                        break;
                      case "png":
                        j = T.toDataURL("image/png");
                        break;
                      case "webp":
                        j = T.toDataURL("image/webp");
                        break;
                      case "svg":
                        j = Y;
                        break;
                      default:
                        var te = "Image format is not jpeg, png, svg or webp.";
                        if (h(new Error(te)), !g.promise)
                          return y.emit("error", te);
                    }
                    m(j), g.promise || y.emit("success", j);
                  }, O.onerror = function(j) {
                    if (N = null, f.revokeObjectURL(Y), h(j), !g.promise)
                      return y.emit("error", j);
                  }, O.src = Y;
                });
                return g.promise ? C : y;
              }
              s.exports = p;
            }
          ),
          /***/
          1808: (
            /***/
            function(s, c, i) {
              var l = i(1252).EventEmitter, v = i(4040), f = i(3400), p = i(7030), g = i(1536), y = i(7164), C = i(3268);
              function m(h, w) {
                var S = new l(), E = g(h, {
                  format: "png"
                }), x = E.gd;
                x.style.position = "absolute", x.style.left = "-5000px", document.body.appendChild(x);
                function T() {
                  var P = p.getDelay(x._fullLayout);
                  setTimeout(function() {
                    var k = y(x), I = document.createElement("canvas");
                    I.id = f.randstr(), S = C({
                      format: w.format,
                      width: x._fullLayout.width,
                      height: x._fullLayout.height,
                      canvas: I,
                      emitter: S,
                      svg: k
                    }), S.clean = function() {
                      x && document.body.removeChild(x);
                    };
                  }, P);
                }
                var F = p.getRedrawFunc(x);
                return v.call("_doPlot", x, E.data, E.layout, E.config).then(F).then(T).catch(function(P) {
                  S.emit("error", P);
                }), S;
              }
              s.exports = m;
            }
          ),
          /***/
          7164: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3400), f = i(3616), p = i(6308), g = i(9616), y = /"/g, C = "TOBESTRIPPED", m = new RegExp('("' + C + ")|(" + C + '")', "g");
              function h(S) {
                var E = l.select("body").append("div").style({
                  display: "none"
                }).html(""), x = S.replace(/(&[^;]*;)/gi, function(T) {
                  return T === "&lt;" ? "&#60;" : T === "&rt;" ? "&#62;" : T.indexOf("<") !== -1 || T.indexOf(">") !== -1 ? "" : E.html(T).text();
                });
                return E.remove(), x;
              }
              function w(S) {
                return S.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g, "&amp;");
              }
              s.exports = function(E, x, T) {
                var F = E._fullLayout, P = F._paper, k = F._toppaper, I = F.width, L = F.height, A;
                P.insert("rect", ":first-child").call(f.setRect, 0, 0, I, L).call(p.fill, F.paper_bgcolor);
                var O = F._basePlotModules || [];
                for (A = 0; A < O.length; A++) {
                  var N = O[A];
                  N.toSVG && N.toSVG(E);
                }
                if (k) {
                  var Y = k.node().childNodes, j = Array.prototype.slice.call(Y);
                  for (A = 0; A < j.length; A++) {
                    var te = j[A];
                    te.childNodes.length && P.node().appendChild(te);
                  }
                }
                F._draggers && F._draggers.remove(), P.node().style.background = "", P.selectAll("text").attr({
                  "data-unformatted": null,
                  "data-math": null
                }).each(function() {
                  var z = l.select(this);
                  if (this.style.visibility === "hidden" || this.style.display === "none") {
                    z.remove();
                    return;
                  } else
                    z.style({
                      visibility: null,
                      display: null
                    });
                  var Z = this.style.fontFamily;
                  Z && Z.indexOf('"') !== -1 && z.style("font-family", Z.replace(y, C));
                  var W = this.style.fontWeight;
                  W && (W === "normal" || W === "400") && z.style("font-weight", void 0);
                  var q = this.style.fontStyle;
                  q && q === "normal" && z.style("font-style", void 0);
                  var ie = this.style.fontVariant;
                  ie && ie === "normal" && z.style("font-variant", void 0);
                }), P.selectAll(".gradient_filled,.pattern_filled").each(function() {
                  var z = l.select(this), Z = this.style.fill;
                  Z && Z.indexOf("url(") !== -1 && z.style("fill", Z.replace(y, C));
                  var W = this.style.stroke;
                  W && W.indexOf("url(") !== -1 && z.style("stroke", W.replace(y, C));
                }), (x === "pdf" || x === "eps") && P.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width", 0), P.node().setAttributeNS(g.xmlns, "xmlns", g.svg), P.node().setAttributeNS(g.xmlns, "xmlns:xlink", g.xlink), x === "svg" && T && (P.attr("width", T * I), P.attr("height", T * L), P.attr("viewBox", "0 0 " + I + " " + L));
                var re = new window.XMLSerializer().serializeToString(P.node());
                return re = h(re), re = w(re), re = re.replace(m, "'"), v.isIE() && (re = re.replace(/"/gi, "'"), re = re.replace(/(\('#)([^']*)('\))/gi, '("#$2")'), re = re.replace(/(\\')/gi, '"')), re;
              };
            }
          ),
          /***/
          4664: (
            /***/
            function(s, c, i) {
              var l = i(3400);
              s.exports = function(f, p) {
                for (var g = 0; g < f.length; g++) f[g].i = g;
                l.mergeArray(p.text, f, "tx"), l.mergeArray(p.hovertext, f, "htx");
                var y = p.marker;
                if (y) {
                  l.mergeArray(y.opacity, f, "mo", !0), l.mergeArray(y.color, f, "mc");
                  var C = y.line;
                  C && (l.mergeArray(C.color, f, "mlc"), l.mergeArrayCastPositive(C.width, f, "mlw"));
                }
              };
            }
          ),
          /***/
          832: (
            /***/
            function(s, c, i) {
              var l = i(2904), v = i(9736).axisHoverFormat, f = i(1776).Ks, p = i(1776).Gw, g = i(9084), y = i(5376), C = i(8048), m = i(8192).c, h = i(2880).extendFlat, w = y({
                editType: "calc",
                arrayOk: !0,
                colorEditType: "style"
              }), S = l.marker, E = S.line, x = h({}, E.width, {
                dflt: 0
              }), T = h({
                width: x,
                editType: "calc"
              }, g("marker.line")), F = h({
                line: T,
                editType: "calc"
              }, g("marker"), {
                opacity: {
                  valType: "number",
                  arrayOk: !0,
                  dflt: 1,
                  min: 0,
                  max: 1,
                  editType: "style"
                },
                pattern: m,
                cornerradius: {
                  valType: "any",
                  editType: "calc"
                }
              });
              s.exports = {
                x: l.x,
                x0: l.x0,
                dx: l.dx,
                y: l.y,
                y0: l.y0,
                dy: l.dy,
                xperiod: l.xperiod,
                yperiod: l.yperiod,
                xperiod0: l.xperiod0,
                yperiod0: l.yperiod0,
                xperiodalignment: l.xperiodalignment,
                yperiodalignment: l.yperiodalignment,
                xhoverformat: v("x"),
                yhoverformat: v("y"),
                text: l.text,
                texttemplate: p({
                  editType: "plot"
                }, {
                  keys: C.eventDataKeys
                }),
                hovertext: l.hovertext,
                hovertemplate: f({}, {
                  keys: C.eventDataKeys
                }),
                textposition: {
                  valType: "enumerated",
                  values: ["inside", "outside", "auto", "none"],
                  dflt: "auto",
                  arrayOk: !0,
                  editType: "calc"
                },
                insidetextanchor: {
                  valType: "enumerated",
                  values: ["end", "middle", "start"],
                  dflt: "end",
                  editType: "plot"
                },
                textangle: {
                  valType: "angle",
                  dflt: "auto",
                  editType: "plot"
                },
                textfont: h({}, w, {}),
                insidetextfont: h({}, w, {}),
                outsidetextfont: h({}, w, {}),
                constraintext: {
                  valType: "enumerated",
                  values: ["inside", "outside", "both", "none"],
                  dflt: "both",
                  editType: "calc"
                },
                cliponaxis: h({}, l.cliponaxis, {}),
                orientation: {
                  valType: "enumerated",
                  values: ["v", "h"],
                  editType: "calc+clearAxisTypes"
                },
                base: {
                  valType: "any",
                  dflt: null,
                  arrayOk: !0,
                  editType: "calc"
                },
                offset: {
                  valType: "number",
                  dflt: null,
                  arrayOk: !0,
                  editType: "calc"
                },
                width: {
                  valType: "number",
                  dflt: null,
                  min: 0,
                  arrayOk: !0,
                  editType: "calc"
                },
                marker: F,
                offsetgroup: l.offsetgroup,
                alignmentgroup: l.alignmentgroup,
                selected: {
                  marker: {
                    opacity: l.selected.marker.opacity,
                    color: l.selected.marker.color,
                    editType: "style"
                  },
                  textfont: l.selected.textfont,
                  editType: "style"
                },
                unselected: {
                  marker: {
                    opacity: l.unselected.marker.opacity,
                    color: l.unselected.marker.color,
                    editType: "style"
                  },
                  textfont: l.unselected.textfont,
                  editType: "style"
                },
                zorder: l.zorder,
                _deprecated: {
                  bardir: {
                    valType: "enumerated",
                    editType: "calc",
                    values: ["v", "h"]
                  }
                }
              };
            }
          ),
          /***/
          9439: (
            /***/
            function(s, c, i) {
              var l = i(4460), v = i(1220), f = i(4288).hasColorscale, p = i(7128), g = i(4664), y = i(4500);
              s.exports = function(m, h) {
                var w = l.getFromId(m, h.xaxis || "x"), S = l.getFromId(m, h.yaxis || "y"), E, x, T, F, P, k, I = {
                  msUTC: !!(h.base || h.base === 0)
                };
                h.orientation === "h" ? (E = w.makeCalcdata(h, "x", I), T = S.makeCalcdata(h, "y"), F = v(h, S, "y", T), P = !!h.yperiodalignment, k = "y") : (E = S.makeCalcdata(h, "y", I), T = w.makeCalcdata(h, "x"), F = v(h, w, "x", T), P = !!h.xperiodalignment, k = "x"), x = F.vals;
                for (var L = Math.min(x.length, E.length), A = new Array(L), O = 0; O < L; O++)
                  A[O] = {
                    p: x[O],
                    s: E[O]
                  }, P && (A[O].orig_p = T[O], A[O][k + "End"] = F.ends[O], A[O][k + "Start"] = F.starts[O]), h.ids && (A[O].id = String(h.ids[O]));
                return f(h, "marker") && p(m, h, {
                  vals: h.marker.color,
                  containerStr: "marker",
                  cLetter: "c"
                }), f(h, "marker.line") && p(m, h, {
                  vals: h.marker.line.color,
                  containerStr: "marker.line",
                  cLetter: "c"
                }), g(A, h), y(A, h), A;
              };
            }
          ),
          /***/
          8048: (
            /***/
            function(s) {
              s.exports = {
                // padding in pixels around text
                TEXTPAD: 3,
                // 'value' and 'label' are not really necessary for bar traces,
                // but they were made available to `texttemplate` (maybe by accident)
                // via tokens `%{value}` and `%{label}` starting in 1.50.0,
                // so let's include them in the event data also.
                eventDataKeys: ["value", "label"]
              };
            }
          ),
          /***/
          6376: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400).isArrayOrTypedArray, f = i(9032).BADNUM, p = i(4040), g = i(4460), y = i(1888).getAxisGroup, C = i(2592);
              function m(W, q) {
                for (var ie = q.xaxis, ce = q.yaxis, X = W._fullLayout, U = W._fullData, ne = W.calcdata, se = [], le = [], ue = 0; ue < U.length; ue++) {
                  var ve = U[ue];
                  if (ve.visible === !0 && p.traceIs(ve, "bar") && ve.xaxis === ie._id && ve.yaxis === ce._id && (ve.orientation === "h" ? se.push(ne[ue]) : le.push(ne[ue]), ve._computePh))
                    for (var be = W.calcdata[ue], Me = 0; Me < be.length; Me++)
                      typeof be[Me].ph0 == "function" && (be[Me].ph0 = be[Me].ph0()), typeof be[Me].ph1 == "function" && (be[Me].ph1 = be[Me].ph1());
                }
                var Ge = {
                  xCat: ie.type === "category" || ie.type === "multicategory",
                  yCat: ce.type === "category" || ce.type === "multicategory",
                  mode: X.barmode,
                  norm: X.barnorm,
                  gap: X.bargap,
                  groupgap: X.bargroupgap
                };
                h(W, ie, ce, le, Ge), h(W, ce, ie, se, Ge);
              }
              function h(W, q, ie, ce, X) {
                if (ce.length) {
                  var U, ne, se, le, ue;
                  switch (E(ie, ce), X.mode) {
                    case "overlay":
                      x(q, ie, ce, X);
                      break;
                    case "group":
                      for (U = [], ne = [], se = 0; se < ce.length; se++)
                        le = ce[se], ue = le[0].trace, ue.offset === void 0 ? ne.push(le) : U.push(le);
                      ne.length && T(W, q, ie, ne, X), U.length && x(q, ie, U, X);
                      break;
                    case "stack":
                    case "relative":
                      for (U = [], ne = [], se = 0; se < ce.length; se++)
                        le = ce[se], ue = le[0].trace, ue.base === void 0 ? ne.push(le) : U.push(le);
                      S(ne), ne.length && F(W, q, ie, ne, X), U.length && x(q, ie, U, X);
                      break;
                  }
                  w(ce), z(ce, q);
                }
              }
              function w(W) {
                var q, ie, ce, X, U, ne, se;
                for (q = 0; q < W.length; q++)
                  ie = W[q], ce = ie[0].trace, X = ie[0].t, X.cornerradiusvalue === void 0 && (U = ce.marker ? ce.marker.cornerradius : void 0, U !== void 0 && (ne = l(U) ? +U : +U.slice(0, -1), se = l(U) ? "px" : "%", X.cornerradiusvalue = ne, X.cornerradiusform = se));
              }
              function S(W) {
                if (!(W.length < 2)) {
                  var q, ie, ce, X, U, ne, se;
                  for (q = 0; q < W.length && (ie = W[q], ce = ie[0].trace, U = ce.marker ? ce.marker.cornerradius : void 0, U === void 0); q++)
                    ;
                  if (U !== void 0)
                    for (ne = l(U) ? +U : +U.slice(0, -1), se = l(U) ? "px" : "%", q = 0; q < W.length; q++)
                      ie = W[q], X = ie[0].t, X.cornerradiusvalue = ne, X.cornerradiusform = se;
                }
              }
              function E(W, q) {
                var ie, ce;
                for (ie = 0; ie < q.length; ie++) {
                  var X = q[ie], U = X[0].trace, ne = U.type === "funnel" ? U._base : U.base, se, le = U.orientation === "h" ? U.xcalendar : U.ycalendar, ue = W.type === "category" || W.type === "multicategory" ? function() {
                    return null;
                  } : W.d2c;
                  if (v(ne)) {
                    for (ce = 0; ce < Math.min(ne.length, X.length); ce++)
                      se = ue(ne[ce], 0, le), l(se) ? (X[ce].b = +se, X[ce].hasB = 1) : X[ce].b = 0;
                    for (; ce < X.length; ce++)
                      X[ce].b = 0;
                  } else {
                    se = ue(ne, 0, le);
                    var ve = l(se);
                    for (se = ve ? se : 0, ce = 0; ce < X.length; ce++)
                      X[ce].b = se, ve && (X[ce].hasB = 1);
                  }
                }
              }
              function x(W, q, ie, ce) {
                for (var X = 0; X < ie.length; X++) {
                  var U = ie[X], ne = new C([U], {
                    posAxis: W,
                    sepNegVal: !1,
                    overlapNoMerge: !ce.norm
                  });
                  P(W, ne, ce), ce.norm ? (Y(ne), te(q, ne, ce)) : O(q, ne);
                }
              }
              function T(W, q, ie, ce, X) {
                var U = new C(ce, {
                  posAxis: q,
                  sepNegVal: !1,
                  overlapNoMerge: !X.norm
                });
                k(W, q, U, X), j(U, q), X.norm ? (Y(U), te(ie, U, X)) : O(ie, U);
              }
              function F(W, q, ie, ce, X) {
                var U = new C(ce, {
                  posAxis: q,
                  sepNegVal: X.mode === "relative",
                  overlapNoMerge: !(X.norm || X.mode === "stack" || X.mode === "relative")
                });
                P(q, U, X), N(ie, U, X);
                for (var ne = 0; ne < ce.length; ne++)
                  for (var se = ce[ne], le = 0; le < se.length; le++) {
                    var ue = se[le];
                    if (ue.s !== f) {
                      var ve = ue.b + ue.s === U.get(ue.p, ue.s);
                      ve && (ue._outmost = !0);
                    }
                  }
                X.norm && te(ie, U, X);
              }
              function P(W, q, ie) {
                for (var ce = q.minDiff, X = q.traces, U = ce * (1 - ie.gap), ne = U, se = ne * (1 - (ie.groupgap || 0)), le = -se / 2, ue = 0; ue < X.length; ue++) {
                  var ve = X[ue], be = ve[0].t;
                  be.barwidth = se, be.poffset = le, be.bargroupwidth = U, be.bardelta = ce;
                }
                q.binWidth = X[0][0].t.barwidth / 100, I(q), L(W, q), A(W, q);
              }
              function k(W, q, ie, ce) {
                for (var X = W._fullLayout, U = ie.positions, ne = ie.distinctPositions, se = ie.minDiff, le = ie.traces, ue = le.length, ve = U.length !== ne.length, be = se * (1 - ce.gap), Me = y(X, q._id) + le[0][0].trace.orientation, Ge = X._alignmentOpts[Me] || {}, we = 0; we < ue; we++) {
                  var Re = le[we], Ae = Re[0].trace, K = Ge[Ae.alignmentgroup] || {}, ee = Object.keys(K.offsetGroups || {}).length, oe;
                  ee ? oe = be / ee : oe = ve ? be / ue : be;
                  var _ = oe * (1 - (ce.groupgap || 0)), V;
                  ee ? V = ((2 * Ae._offsetIndex + 1 - ee) * oe - _) / 2 : V = ve ? ((2 * we + 1 - ue) * oe - _) / 2 : -_ / 2;
                  var fe = Re[0].t;
                  fe.barwidth = _, fe.poffset = V, fe.bargroupwidth = be, fe.bardelta = se;
                }
                ie.binWidth = le[0][0].t.barwidth / 100, I(ie), L(q, ie), A(q, ie, ve);
              }
              function I(W) {
                var q = W.traces, ie, ce;
                for (ie = 0; ie < q.length; ie++) {
                  var X = q[ie], U = X[0], ne = U.trace, se = U.t, le = ne._offset || ne.offset, ue = se.poffset, ve;
                  if (v(le)) {
                    for (ve = Array.prototype.slice.call(le, 0, X.length), ce = 0; ce < ve.length; ce++)
                      l(ve[ce]) || (ve[ce] = ue);
                    for (ce = ve.length; ce < X.length; ce++)
                      ve.push(ue);
                    se.poffset = ve;
                  } else le !== void 0 && (se.poffset = le);
                  var be = ne._width || ne.width, Me = se.barwidth;
                  if (v(be)) {
                    var Ge = Array.prototype.slice.call(be, 0, X.length);
                    for (ce = 0; ce < Ge.length; ce++)
                      l(Ge[ce]) || (Ge[ce] = Me);
                    for (ce = Ge.length; ce < X.length; ce++)
                      Ge.push(Me);
                    if (se.barwidth = Ge, le === void 0) {
                      for (ve = [], ce = 0; ce < X.length; ce++)
                        ve.push(ue + (Me - Ge[ce]) / 2);
                      se.poffset = ve;
                    }
                  } else be !== void 0 && (se.barwidth = be, le === void 0 && (se.poffset = ue + (Me - be) / 2));
                }
              }
              function L(W, q) {
                for (var ie = q.traces, ce = Z(W), X = 0; X < ie.length; X++)
                  for (var U = ie[X], ne = U[0].t, se = ne.poffset, le = v(se), ue = ne.barwidth, ve = v(ue), be = 0; be < U.length; be++) {
                    var Me = U[be], Ge = Me.w = ve ? ue[be] : ue;
                    Me.p === void 0 && (Me.p = Me[ce], Me["orig_" + ce] = Me[ce]);
                    var we = (le ? se[be] : se) + Ge / 2;
                    Me[ce] = Me.p + we;
                  }
              }
              function A(W, q, ie) {
                var ce = q.traces, X = q.minDiff, U = X / 2;
                g.minDtick(W, q.minDiff, q.distinctPositions[0], ie);
                for (var ne = 0; ne < ce.length; ne++) {
                  var se = ce[ne], le = se[0], ue = le.trace, ve = [], be, Me, Ge, we;
                  for (we = 0; we < se.length; we++)
                    be = se[we], Me = be.p - U, Ge = be.p + U, ve.push(Me, Ge);
                  if (ue.width || ue.offset) {
                    var Re = le.t, Ae = Re.poffset, K = Re.barwidth, ee = v(Ae), oe = v(K);
                    for (we = 0; we < se.length; we++) {
                      be = se[we];
                      var _ = ee ? Ae[we] : Ae, V = oe ? K[we] : K;
                      Me = be.p + _, Ge = Me + V, ve.push(Me, Ge);
                    }
                  }
                  ue._extremes[W._id] = g.findExtremes(W, ve, {
                    padded: !1
                  });
                }
              }
              function O(W, q) {
                for (var ie = q.traces, ce = Z(W), X = 0; X < ie.length; X++) {
                  for (var U = ie[X], ne = U[0].trace, se = ne.type === "scatter", le = ne.orientation === "v", ue = [], ve = !1, be = 0; be < U.length; be++) {
                    var Me = U[be], Ge = se ? 0 : Me.b, we = se ? le ? Me.y : Me.x : Ge + Me.s;
                    Me[ce] = we, ue.push(we), Me.hasB && ue.push(Ge), (!Me.hasB || !Me.b) && (ve = !0);
                  }
                  ne._extremes[W._id] = g.findExtremes(W, ue, {
                    tozero: ve,
                    padded: !0
                  });
                }
              }
              function N(W, q, ie) {
                var ce = Z(W), X = q.traces, U, ne, se, le, ue, ve;
                for (le = 0; le < X.length; le++)
                  if (U = X[le], ne = U[0].trace, ne.type === "funnel")
                    for (ue = 0; ue < U.length; ue++)
                      ve = U[ue], ve.s !== f && q.put(ve.p, -0.5 * ve.s);
                for (le = 0; le < X.length; le++) {
                  U = X[le], ne = U[0].trace, se = ne.type === "funnel";
                  var be = [];
                  for (ue = 0; ue < U.length; ue++)
                    if (ve = U[ue], ve.s !== f) {
                      var Me;
                      se ? Me = ve.s : Me = ve.s + ve.b;
                      var Ge = q.put(ve.p, Me), we = Ge + Me;
                      ve.b = Ge, ve[ce] = we, ie.norm || (be.push(we), ve.hasB && be.push(Ge));
                    }
                  ie.norm || (ne._extremes[W._id] = g.findExtremes(W, be, {
                    // N.B. we don't stack base with 'base',
                    // so set tozero:true always!
                    tozero: !0,
                    padded: !0
                  }));
                }
              }
              function Y(W) {
                for (var q = W.traces, ie = 0; ie < q.length; ie++)
                  for (var ce = q[ie], X = 0; X < ce.length; X++) {
                    var U = ce[X];
                    U.s !== f && W.put(U.p, U.b + U.s);
                  }
              }
              function j(W, q) {
                for (var ie = W.traces, ce = 0; ce < ie.length; ce++) {
                  var X = ie[ce], U = X[0].trace;
                  if (U.base === void 0)
                    for (var ne = new C([X], {
                      posAxis: q,
                      sepNegVal: !0,
                      overlapNoMerge: !0
                    }), se = 0; se < X.length; se++) {
                      var le = X[se];
                      if (le.p !== f) {
                        var ue = ne.put(le.p, le.b + le.s);
                        ue && (le.b = ue);
                      }
                    }
                }
              }
              function te(W, q, ie) {
                var ce = q.traces, X = Z(W), U = ie.norm === "fraction" ? 1 : 100, ne = U / 1e9, se = W.l2c(W.c2l(0)), le = ie.mode === "stack" ? U : se;
                function ue(V) {
                  return l(W.c2l(V)) && (V < se - ne || V > le + ne || !l(se));
                }
                for (var ve = 0; ve < ce.length; ve++) {
                  for (var be = ce[ve], Me = be[0].trace, Ge = [], we = !1, Re = !1, Ae = 0; Ae < be.length; Ae++) {
                    var K = be[Ae];
                    if (K.s !== f) {
                      var ee = Math.abs(U / q.get(K.p, K.s));
                      K.b *= ee, K.s *= ee;
                      var oe = K.b, _ = oe + K.s;
                      K[X] = _, Ge.push(_), Re = Re || ue(_), K.hasB && (Ge.push(oe), Re = Re || ue(oe)), (!K.hasB || !K.b) && (we = !0);
                    }
                  }
                  Me._extremes[W._id] = g.findExtremes(W, Ge, {
                    tozero: we,
                    padded: Re
                  });
                }
              }
              function re(W, q, ie, ce) {
                for (var X = Z(ce), U = 0; U < W.length; U++)
                  for (var ne = W[U], se = 0; se < ne.length; se++) {
                    var le = ne[se], ue = le[X];
                    le._sMin = q[ue], le._sMax = ie[ue];
                  }
              }
              function z(W, q) {
                var ie = Z(q), ce = {}, X, U, ne, se = 1 / 0, le = -1 / 0;
                for (X = 0; X < W.length; X++)
                  for (ne = W[X], U = 0; U < ne.length; U++) {
                    var ue = ne[U].p;
                    l(ue) && (se = Math.min(se, ue), le = Math.max(le, ue));
                  }
                var ve = 1e4 / (le - se), be = ce.round = function(he) {
                  return String(Math.round(ve * (he - se)));
                }, Me = {}, Ge = {}, we = W.some(function(he) {
                  var me = he[0].trace;
                  return "marker" in me && me.marker.cornerradius;
                });
                for (X = 0; X < W.length; X++) {
                  ne = W[X], ne[0].t.extents = ce;
                  var Re = ne[0].t.poffset, Ae = v(Re);
                  for (U = 0; U < ne.length; U++) {
                    var K = ne[U], ee = K[ie] - K.w / 2;
                    if (l(ee)) {
                      var oe = K[ie] + K.w / 2, _ = be(K.p);
                      ce[_] ? ce[_] = [Math.min(ee, ce[_][0]), Math.max(oe, ce[_][1])] : ce[_] = [ee, oe];
                    }
                    if (K.p0 = K.p + (Ae ? Re[U] : Re), K.p1 = K.p0 + K.w, K.s0 = K.b, K.s1 = K.s0 + K.s, we) {
                      var V = Math.min(K.s0, K.s1) || 0, fe = Math.max(K.s0, K.s1) || 0, $ = K[ie];
                      Me[$] = $ in Me ? Math.min(Me[$], V) : V, Ge[$] = $ in Ge ? Math.max(Ge[$], fe) : fe;
                    }
                  }
                }
                we && re(W, Me, Ge, q);
              }
              function Z(W) {
                return W._id.charAt(0);
              }
              s.exports = {
                crossTraceCalc: m,
                setGroupPositions: h
              };
            }
          ),
          /***/
          1508: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = i(6308), p = i(4040), g = i(3980), y = i(1147), C = i(5592), m = i(11), h = i(832), w = v.coerceFont;
              function S(F, P, k, I) {
                function L(j, te) {
                  return v.coerce(F, P, h, j, te);
                }
                var A = g(F, P, I, L);
                if (!A) {
                  P.visible = !1;
                  return;
                }
                y(F, P, I, L), L("xhoverformat"), L("yhoverformat"), L("zorder"), L("orientation", P.x && !P.y ? "h" : "v"), L("base"), L("offset"), L("width"), L("text"), L("hovertext"), L("hovertemplate");
                var O = L("textposition");
                T(F, P, I, L, O, {
                  moduleHasSelected: !0,
                  moduleHasUnselected: !0,
                  moduleHasConstrain: !0,
                  moduleHasCliponaxis: !0,
                  moduleHasTextangle: !0,
                  moduleHasInsideanchor: !0
                }), C(F, P, L, k, I);
                var N = (P.marker.line || {}).color, Y = p.getComponentMethod("errorbars", "supplyDefaults");
                Y(F, P, N || f.defaultLine, {
                  axis: "y"
                }), Y(F, P, N || f.defaultLine, {
                  axis: "x",
                  inherit: "y"
                }), v.coerceSelectionMarkerOpacity(P, L);
              }
              function E(F, P) {
                var k, I;
                function L(N, Y) {
                  return v.coerce(I._input, I, h, N, Y);
                }
                for (var A = 0; A < F.length; A++)
                  if (I = F[A], I.type === "bar") {
                    k = I._input;
                    var O = L("marker.cornerradius", P.barcornerradius);
                    I.marker && (I.marker.cornerradius = x(O)), P.barmode === "group" && m(k, I, P, L);
                  }
              }
              function x(F) {
                if (l(F)) {
                  if (F = +F, F >= 0) return F;
                } else if (typeof F == "string" && (F = F.trim(), F.slice(-1) === "%" && l(F.slice(0, -1)) && (F = +F.slice(0, -1), F >= 0)))
                  return F + "%";
              }
              function T(F, P, k, I, L, A) {
                A = A || {};
                var O = A.moduleHasSelected !== !1, N = A.moduleHasUnselected !== !1, Y = A.moduleHasConstrain !== !1, j = A.moduleHasCliponaxis !== !1, te = A.moduleHasTextangle !== !1, re = A.moduleHasInsideanchor !== !1, z = !!A.hasPathbar, Z = Array.isArray(L) || L === "auto", W = Z || L === "inside", q = Z || L === "outside";
                if (W || q) {
                  var ie = w(I, "textfont", k.font), ce = v.extendFlat({}, ie), X = F.textfont && F.textfont.color, U = !X;
                  if (U && delete ce.color, w(I, "insidetextfont", ce), z) {
                    var ne = v.extendFlat({}, ie);
                    U && delete ne.color, w(I, "pathbar.textfont", ne);
                  }
                  q && w(I, "outsidetextfont", ie), O && I("selected.textfont.color"), N && I("unselected.textfont.color"), Y && I("constraintext"), j && I("cliponaxis"), te && I("textangle"), I("texttemplate");
                }
                W && re && I("insidetextanchor");
              }
              s.exports = {
                supplyDefaults: S,
                crossTraceDefaults: E,
                handleText: T,
                validateCornerradius: x
              };
            }
          ),
          /***/
          2160: (
            /***/
            function(s) {
              s.exports = function(i, l, v) {
                return i.x = "xVal" in l ? l.xVal : l.x, i.y = "yVal" in l ? l.yVal : l.y, l.xa && (i.xaxis = l.xa), l.ya && (i.yaxis = l.ya), v.orientation === "h" ? (i.label = i.y, i.value = i.x) : (i.label = i.x, i.value = i.y), i;
              };
            }
          ),
          /***/
          444: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(9760), f = i(3400).isArrayOrTypedArray;
              c.coerceString = function(p, g, y) {
                if (typeof g == "string") {
                  if (g || !p.noBlank) return g;
                } else if ((typeof g == "number" || g === !0) && !p.strict)
                  return String(g);
                return y !== void 0 ? y : p.dflt;
              }, c.coerceNumber = function(p, g, y) {
                if (l(g)) {
                  g = +g;
                  var C = p.min, m = p.max, h = C !== void 0 && g < C || m !== void 0 && g > m;
                  if (!h) return g;
                }
                return y !== void 0 ? y : p.dflt;
              }, c.coerceColor = function(p, g, y) {
                return v(g).isValid() ? g : y !== void 0 ? y : p.dflt;
              }, c.coerceEnumerated = function(p, g, y) {
                return p.coerceNumber && (g = +g), p.values.indexOf(g) !== -1 ? g : y !== void 0 ? y : p.dflt;
              }, c.getValue = function(p, g) {
                var y;
                return f(p) ? g < p.length && (y = p[g]) : y = p, y;
              }, c.getLineWidth = function(p, g) {
                var y = 0 < g.mlw ? g.mlw : f(p.marker.line.width) ? 0 : p.marker.line.width;
                return y;
              };
            }
          ),
          /***/
          1020: (
            /***/
            function(s, c, i) {
              var l = i(3024), v = i(4040), f = i(6308), p = i(3400).fillText, g = i(444).getLineWidth, y = i(4460).hoverLabelText, C = i(9032).BADNUM;
              function m(S, E, x, T, F) {
                var P = h(S, E, x, T, F);
                if (P) {
                  var k = P.cd, I = k[0].trace, L = k[P.index];
                  return P.color = w(I, L), v.getComponentMethod("errorbars", "hoverInfo")(L, I, P), [P];
                }
              }
              function h(S, E, x, T, F) {
                var P = S.cd, k = P[0].trace, I = P[0].t, L = T === "closest", A = k.type === "waterfall", O = S.maxHoverDistance, N = S.maxSpikeDistance, Y, j, te, re, z, Z, W;
                k.orientation === "h" ? (Y = x, j = E, te = "y", re = "x", z = Ge, Z = ve) : (Y = E, j = x, te = "x", re = "y", Z = Ge, z = ve);
                var q = k[te + "period"], ie = L || q;
                function ce(he) {
                  return U(he, -1);
                }
                function X(he) {
                  return U(he, 1);
                }
                function U(he, me) {
                  var xe = he.w;
                  return he[te] + me * xe / 2;
                }
                function ne(he) {
                  return he[te + "End"] - he[te + "Start"];
                }
                var se = L ? ce : q ? function(he) {
                  return he.p - ne(he) / 2;
                } : function(he) {
                  return Math.min(ce(he), he.p - I.bardelta / 2);
                }, le = L ? X : q ? function(he) {
                  return he.p + ne(he) / 2;
                } : function(he) {
                  return Math.max(X(he), he.p + I.bardelta / 2);
                };
                function ue(he, me, xe) {
                  return F.finiteRange && (xe = 0), l.inbox(he - Y, me - Y, xe + Math.min(1, Math.abs(me - he) / W) - 1);
                }
                function ve(he) {
                  return ue(se(he), le(he), O);
                }
                function be(he) {
                  return ue(ce(he), X(he), N);
                }
                function Me(he) {
                  var me = he[re];
                  if (A) {
                    var xe = Math.abs(he.rawS) || 0;
                    j > 0 ? me += xe : j < 0 && (me -= xe);
                  }
                  return me;
                }
                function Ge(he) {
                  var me = j, xe = he.b, Fe = Me(he);
                  return l.inbox(xe - me, Fe - me, O + (Fe - me) / (Fe - xe) - 1);
                }
                function we(he) {
                  var me = j, xe = he.b, Fe = Me(he);
                  return l.inbox(xe - me, Fe - me, N + (Fe - me) / (Fe - xe) - 1);
                }
                var Re = S[te + "a"], Ae = S[re + "a"];
                W = Math.abs(Re.r2c(Re.range[1]) - Re.r2c(Re.range[0]));
                function K(he) {
                  return (z(he) + Z(he)) / 2;
                }
                var ee = l.getDistanceFunction(T, z, Z, K);
                if (l.getClosest(P, ee, S), S.index !== !1 && P[S.index].p !== C) {
                  ie || (se = function(he) {
                    return Math.min(ce(he), he.p - I.bargroupwidth / 2);
                  }, le = function(he) {
                    return Math.max(X(he), he.p + I.bargroupwidth / 2);
                  });
                  var oe = S.index, _ = P[oe], V = k.base ? _.b + _.s : _.s;
                  S[re + "0"] = S[re + "1"] = Ae.c2p(_[re], !0), S[re + "LabelVal"] = V;
                  var fe = I.extents[I.extents.round(_.p)];
                  S[te + "0"] = Re.c2p(L ? se(_) : fe[0], !0), S[te + "1"] = Re.c2p(L ? le(_) : fe[1], !0);
                  var $ = _.orig_p !== void 0;
                  return S[te + "LabelVal"] = $ ? _.orig_p : _.p, S.labelLabel = y(Re, S[te + "LabelVal"], k[te + "hoverformat"]), S.valueLabel = y(Ae, S[re + "LabelVal"], k[re + "hoverformat"]), S.baseLabel = y(Ae, _.b, k[re + "hoverformat"]), S.spikeDistance = (we(_) + be(_)) / 2, S[te + "Spike"] = Re.c2p(_.p, !0), p(_, k, S), S.hovertemplate = k.hovertemplate, S;
                }
              }
              function w(S, E) {
                var x = E.mcc || S.marker.color, T = E.mlcc || S.marker.line.color, F = g(S, E);
                if (f.opacity(x)) return x;
                if (f.opacity(T) && F) return T;
              }
              s.exports = {
                hoverPoints: m,
                hoverOnBars: h,
                getTraceColor: w
              };
            }
          ),
          /***/
          1132: (
            /***/
            function(s, c, i) {
              s.exports = {
                attributes: i(832),
                layoutAttributes: i(9324),
                supplyDefaults: i(1508).supplyDefaults,
                crossTraceDefaults: i(1508).crossTraceDefaults,
                supplyLayoutDefaults: i(7156),
                calc: i(9439),
                crossTraceCalc: i(6376).crossTraceCalc,
                colorbar: i(5528),
                arraysToCalcdata: i(4664),
                plot: i(8184).plot,
                style: i(100).style,
                styleOnSelect: i(100).styleOnSelect,
                hoverPoints: i(1020).hoverPoints,
                eventData: i(2160),
                selectPoints: i(5784),
                moduleType: "trace",
                name: "bar",
                basePlotModule: i(7952),
                categories: ["bar-like", "cartesian", "svg", "bar", "oriented", "errorBarsOK", "showLegend", "zoomScale"],
                animatable: !0,
                meta: {}
              };
            }
          ),
          /***/
          9324: (
            /***/
            function(s) {
              s.exports = {
                barmode: {
                  valType: "enumerated",
                  values: ["stack", "group", "overlay", "relative"],
                  dflt: "group",
                  editType: "calc"
                },
                barnorm: {
                  valType: "enumerated",
                  values: ["", "fraction", "percent"],
                  dflt: "",
                  editType: "calc"
                },
                bargap: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  editType: "calc"
                },
                bargroupgap: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 0,
                  editType: "calc"
                },
                barcornerradius: {
                  valType: "any",
                  editType: "calc"
                }
              };
            }
          ),
          /***/
          7156: (
            /***/
            function(s, c, i) {
              var l = i(4040), v = i(4460), f = i(3400), p = i(9324), g = i(1508).validateCornerradius;
              s.exports = function(y, C, m) {
                function h(A, O) {
                  return f.coerce(y, C, p, A, O);
                }
                for (var w = !1, S = !1, E = !1, x = {}, T = h("barmode"), F = 0; F < m.length; F++) {
                  var P = m[F];
                  if (l.traceIs(P, "bar") && P.visible) w = !0;
                  else continue;
                  if (T === "group") {
                    var k = P.xaxis + P.yaxis;
                    x[k] && (E = !0), x[k] = !0;
                  }
                  if (P.visible && P.type === "histogram") {
                    var I = v.getFromId({
                      _fullLayout: C
                    }, P[P.orientation === "v" ? "xaxis" : "yaxis"]);
                    I.type !== "category" && (S = !0);
                  }
                }
                if (!w) {
                  delete C.barmode;
                  return;
                }
                T !== "overlay" && h("barnorm"), h("bargap", S && !E ? 0 : 0.2), h("bargroupgap");
                var L = h("barcornerradius");
                C.barcornerradius = g(L);
              };
            }
          ),
          /***/
          8184: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(8248), f = i(3400), p = i(2736), g = i(6308), y = i(3616), C = i(4040), m = i(4460).tickText, h = i(2744), w = h.recordMinTextSize, S = h.clearMinTextSize, E = i(100), x = i(444), T = i(8048), F = i(832), P = F.text, k = F.textposition, I = i(624).appendArrayPointValue, L = T.TEXTPAD;
              function A(ve) {
                return ve.id;
              }
              function O(ve) {
                if (ve.ids)
                  return A;
              }
              function N(ve) {
                return (ve > 0) - (ve < 0);
              }
              function Y(ve, be) {
                return ve < be ? 1 : -1;
              }
              function j(ve, be, Me, Ge) {
                var we = [], Re = [], Ae = Ge ? be : Me, K = Ge ? Me : be;
                return we[0] = Ae.c2p(ve.s0, !0), Re[0] = K.c2p(ve.p0, !0), we[1] = Ae.c2p(ve.s1, !0), Re[1] = K.c2p(ve.p1, !0), Ge ? [we, Re] : [Re, we];
              }
              function te(ve, be, Me, Ge) {
                if (!be.uniformtext.mode && re(Me)) {
                  var we;
                  return Ge && (we = Ge()), ve.transition().duration(Me.duration).ease(Me.easing).each("end", function() {
                    we && we();
                  }).each("interrupt", function() {
                    we && we();
                  });
                } else
                  return ve;
              }
              function re(ve) {
                return ve && ve.duration > 0;
              }
              function z(ve, be, Me, Ge, we, Re) {
                var Ae = be.xaxis, K = be.yaxis, ee = ve._fullLayout, oe = ve._context.staticPlot;
                we || (we = {
                  mode: ee.barmode,
                  norm: ee.barmode,
                  gap: ee.bargap,
                  groupgap: ee.bargroupgap
                }, S("bar", ee));
                var _ = f.makeTraceGroups(Ge, Me, "trace bars").each(function(V) {
                  var fe = l.select(this), $ = V[0].trace, he = V[0].t, me = $.type === "waterfall", xe = $.type === "funnel", Fe = $.type === "histogram", Ve = $.type === "bar", Be = Ve || xe, Je = 0;
                  me && $.connector.visible && $.connector.mode === "between" && (Je = $.connector.line.width / 2);
                  var et = $.orientation === "h", at = re(we), De = f.ensureSingle(fe, "g", "points"), Ne = O($), Ie = De.selectAll("g.point").data(f.identity, Ne);
                  Ie.enter().append("g").classed("point", !0), Ie.exit().remove(), Ie.each(function(ot, ct) {
                    var Tt = l.select(this), kt = j(ot, Ae, K, et), Ot = kt[0][0], Rt = kt[0][1], xt = kt[1][0], Wt = kt[1][1], bt = (et ? Rt - Ot : Wt - xt) === 0;
                    bt && Be && x.getLineWidth($, ot) && (bt = !1), bt || (bt = !v(Ot) || !v(Rt) || !v(xt) || !v(Wt)), ot.isBlank = bt, bt && (et ? Rt = Ot : Wt = xt), Je && !bt && (et ? (Ot -= Y(Ot, Rt) * Je, Rt += Y(Ot, Rt) * Je) : (xt -= Y(xt, Wt) * Je, Wt += Y(xt, Wt) * Je));
                    var jt, qt;
                    if ($.type === "waterfall") {
                      if (!bt) {
                        var Yt = $[ot.dir].marker;
                        jt = Yt.line.width, qt = Yt.color;
                      }
                    } else
                      jt = x.getLineWidth($, ot), qt = ot.mc || $.marker.color;
                    function Ut(yr) {
                      var Sr = l.round(jt / 2 % 1, 2);
                      return we.gap === 0 && we.groupgap === 0 ? l.round(Math.round(yr) - Sr, 2) : yr;
                    }
                    function tt(yr, Sr, Yr) {
                      return Yr && yr === Sr ? yr : Math.abs(yr - Sr) >= 2 ? Ut(yr) : (
                        // but if it's very thin, expand it so it's
                        // necessarily visible, even if it might overlap
                        // its neighbor
                        yr > Sr ? Math.ceil(yr) : Math.floor(yr)
                      );
                    }
                    var ze = g.opacity(qt), _e = ze < 1 || jt > 0.01 ? Ut : tt;
                    ve._context.staticPlot || (Ot = _e(Ot, Rt, et), Rt = _e(Rt, Ot, et), xt = _e(xt, Wt, !et), Wt = _e(Wt, xt, !et));
                    var Ye = et ? Ae.c2p : K.c2p, lt;
                    ot.s0 > 0 ? lt = ot._sMax : ot.s0 < 0 ? lt = ot._sMin : lt = ot.s1 > 0 ? ot._sMax : ot._sMin;
                    function Te(yr, Sr) {
                      if (!yr) return 0;
                      var Yr = Math.abs(et ? Wt - xt : Rt - Ot), Ar = Math.abs(et ? Rt - Ot : Wt - xt), pr = _e(Math.abs(Ye(lt, !0) - Ye(0, !0))), kr = ot.hasB ? Math.min(Yr / 2, Ar / 2) : Math.min(Yr / 2, pr), br;
                      if (Sr === "%") {
                        var Gr = Math.min(50, yr);
                        br = Yr * (Gr / 100);
                      } else
                        br = yr;
                      return _e(Math.max(Math.min(br, kr), 0));
                    }
                    var Oe = Ve || Fe ? Te(he.cornerradiusvalue, he.cornerradiusform) : 0, je, Xe, nt = "M" + Ot + "," + xt + "V" + Wt + "H" + Rt + "V" + xt + "Z", it = 0;
                    if (Oe && ot.s) {
                      var Nt = N(ot.s0) === 0 || N(ot.s) === N(ot.s0) ? ot.s1 : ot.s0;
                      if (it = _e(ot.hasB ? 0 : Math.abs(Ye(lt, !0) - Ye(Nt, !0))), it < Oe) {
                        var At = Y(Ot, Rt), vt = Y(xt, Wt), ut = At === -vt ? 1 : 0;
                        if (et)
                          if (ot.hasB)
                            je = "M" + (Ot + Oe * At) + "," + xt + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + Ot + "," + (xt + Oe * vt) + "V" + (Wt - Oe * vt) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + (Ot + Oe * At) + "," + Wt + "H" + (Rt - Oe * At) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + Rt + "," + (Wt - Oe * vt) + "V" + (xt + Oe * vt) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + (Rt - Oe * At) + "," + xt + "Z";
                          else {
                            Xe = Math.abs(Rt - Ot) + it;
                            var Pt = Xe < Oe ? Oe - Math.sqrt(Xe * (2 * Oe - Xe)) : 0, rr = it > 0 ? Math.sqrt(it * (2 * Oe - it)) : 0, lr = At > 0 ? Math.max : Math.min;
                            je = "M" + Ot + "," + xt + "V" + (Wt - Pt * vt) + "H" + lr(Rt - (Oe - it) * At, Ot) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + Rt + "," + (Wt - Oe * vt - rr) + "V" + (xt + Oe * vt + rr) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + lr(Rt - (Oe - it) * At, Ot) + "," + (xt + Pt * vt) + "Z";
                          }
                        else if (ot.hasB)
                          je = "M" + (Ot + Oe * At) + "," + xt + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + Ot + "," + (xt + Oe * vt) + "V" + (Wt - Oe * vt) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + (Ot + Oe * At) + "," + Wt + "H" + (Rt - Oe * At) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + Rt + "," + (Wt - Oe * vt) + "V" + (xt + Oe * vt) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + (Rt - Oe * At) + "," + xt + "Z";
                        else {
                          Xe = Math.abs(Wt - xt) + it;
                          var Mr = Xe < Oe ? Oe - Math.sqrt(Xe * (2 * Oe - Xe)) : 0, Rr = it > 0 ? Math.sqrt(it * (2 * Oe - it)) : 0, Pr = vt > 0 ? Math.max : Math.min;
                          je = "M" + (Ot + Mr * At) + "," + xt + "V" + Pr(Wt - (Oe - it) * vt, xt) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + (Ot + Oe * At - Rr) + "," + Wt + "H" + (Rt - Oe * At + Rr) + "A " + Oe + "," + Oe + " 0 0 " + ut + " " + (Rt - Mr * At) + "," + Pr(Wt - (Oe - it) * vt, xt) + "V" + xt + "Z";
                        }
                      } else
                        je = nt;
                    } else
                      je = nt;
                    var ir = te(f.ensureSingle(Tt, "path"), ee, we, Re);
                    if (ir.style("vector-effect", oe ? "none" : "non-scaling-stroke").attr("d", isNaN((Rt - Ot) * (Wt - xt)) || bt && ve._context.staticPlot ? "M0,0Z" : je).call(y.setClipUrl, be.layerClipId, ve), !ee.uniformtext.mode && at) {
                      var Lr = y.makePointStyleFns($);
                      y.singlePointStyle(ot, ir, $, Lr, ve);
                    }
                    Z(ve, be, Tt, V, ct, Ot, Rt, xt, Wt, Oe, it, we, Re), be.layerClipId && y.hideOutsideRangePoint(ot, Tt.select("text"), Ae, K, $.xcalendar, $.ycalendar);
                  });
                  var Ue = $.cliponaxis === !1;
                  y.setClipUrl(fe, Ue ? null : be.layerClipId, ve);
                });
                C.getComponentMethod("errorbars", "plot")(ve, _, be, we);
              }
              function Z(ve, be, Me, Ge, we, Re, Ae, K, ee, oe, _, V, fe) {
                var $ = be.xaxis, he = be.yaxis, me = ve._fullLayout, xe;
                function Fe(Xe, nt, it) {
                  var Nt = f.ensureSingle(Xe, "text").text(nt).attr({
                    class: "bartext bartext-" + xe,
                    "text-anchor": "middle",
                    // prohibit tex interpretation until we can handle
                    // tex and regular text together
                    "data-notex": 1
                  }).call(y.font, it).call(p.convertToTspans, ve);
                  return Nt;
                }
                var Ve = Ge[0].trace, Be = Ve.orientation === "h", Je = ne(me, Ge, we, $, he);
                xe = se(Ve, we);
                var et = V.mode === "stack" || V.mode === "relative", at = Ge[we], De = !et || at._outmost, Ne = at.hasB, Ie = oe && oe - _ > L;
                if (!Je || xe === "none" || (at.isBlank || Re === Ae || K === ee) && (xe === "auto" || xe === "inside")) {
                  Me.select("text").remove();
                  return;
                }
                var Ue = me.font, ot = E.getBarColor(Ge[we], Ve), ct = E.getInsideTextFont(Ve, we, Ue, ot), Tt = E.getOutsideTextFont(Ve, we, Ue), kt = Ve.insidetextanchor || "end", Ot = Me.datum();
                Be ? $.type === "log" && Ot.s0 <= 0 && ($.range[0] < $.range[1] ? Re = 0 : Re = $._length) : he.type === "log" && Ot.s0 <= 0 && (he.range[0] < he.range[1] ? K = he._length : K = 0);
                var Rt = Math.abs(Ae - Re), xt = Math.abs(ee - K), Wt = Rt - 2 * L, bt = xt - 2 * L, jt, qt, Yt, Ut, tt;
                if (xe === "outside" && !De && !at.hasB && (xe = "inside"), xe === "auto")
                  if (De) {
                    xe = "inside", tt = f.ensureUniformFontSize(ve, ct), jt = Fe(Me, Je, tt), qt = y.bBox(jt.node()), Yt = qt.width, Ut = qt.height;
                    var ze = Yt > 0 && Ut > 0, _e;
                    Ie ? Ne ? _e = W(Wt - 2 * oe, bt, Yt, Ut, Be) || W(Wt, bt - 2 * oe, Yt, Ut, Be) : Be ? _e = W(Wt - (oe - _), bt, Yt, Ut, Be) || W(Wt, bt - 2 * (oe - _), Yt, Ut, Be) : _e = W(Wt, bt - (oe - _), Yt, Ut, Be) || W(Wt - 2 * (oe - _), bt, Yt, Ut, Be) : _e = W(Wt, bt, Yt, Ut, Be), ze && _e ? xe = "inside" : (xe = "outside", jt.remove(), jt = null);
                  } else
                    xe = "inside";
                if (!jt) {
                  tt = f.ensureUniformFontSize(ve, xe === "outside" ? Tt : ct), jt = Fe(Me, Je, tt);
                  var Ye = jt.attr("transform");
                  if (jt.attr("transform", ""), qt = y.bBox(jt.node()), Yt = qt.width, Ut = qt.height, jt.attr("transform", Ye), Yt <= 0 || Ut <= 0) {
                    jt.remove();
                    return;
                  }
                }
                var lt = Ve.textangle, Te, Oe;
                xe === "outside" ? (Oe = Ve.constraintext === "both" || Ve.constraintext === "outside", Te = U(Re, Ae, K, ee, qt, {
                  isHorizontal: Be,
                  constrained: Oe,
                  angle: lt
                })) : (Oe = Ve.constraintext === "both" || Ve.constraintext === "inside", Te = ce(Re, Ae, K, ee, qt, {
                  isHorizontal: Be,
                  constrained: Oe,
                  angle: lt,
                  anchor: kt,
                  hasB: Ne,
                  r: oe,
                  overhead: _
                })), Te.fontSize = tt.size, w(Ve.type === "histogram" ? "bar" : Ve.type, Te, me), at.transform = Te;
                var je = te(jt, me, V, fe);
                f.setTransormAndDisplay(je, Te);
              }
              function W(ve, be, Me, Ge, we) {
                if (ve < 0 || be < 0) return !1;
                var Re = Me <= ve && Ge <= be, Ae = Me <= be && Ge <= ve, K = we ? ve >= Me * (be / Ge) : be >= Ge * (ve / Me);
                return Re || Ae || K;
              }
              function q(ve) {
                return ve === "auto" ? 0 : ve;
              }
              function ie(ve, be) {
                var Me = Math.PI / 180 * be, Ge = Math.abs(Math.sin(Me)), we = Math.abs(Math.cos(Me));
                return {
                  x: ve.width * we + ve.height * Ge,
                  y: ve.width * Ge + ve.height * we
                };
              }
              function ce(ve, be, Me, Ge, we, Re) {
                var Ae = !!Re.isHorizontal, K = !!Re.constrained, ee = Re.angle || 0, oe = Re.anchor, _ = oe === "end", V = oe === "start", fe = Re.leftToRight || 0, $ = (fe + 1) / 2, he = 1 - $, me = Re.hasB, xe = Re.r, Fe = Re.overhead, Ve = we.width, Be = we.height, Je = Math.abs(be - ve), et = Math.abs(Ge - Me), at = Je > 2 * L && et > 2 * L ? L : 0;
                Je -= 2 * at, et -= 2 * at;
                var De = q(ee);
                ee === "auto" && !(Ve <= Je && Be <= et) && (Ve > Je || Be > et) && (!(Ve > et || Be > Je) || Ve < Be != Je < et) && (De += 90);
                var Ne = ie(we, De), Ie, Ue;
                if (xe && xe - Fe > L) {
                  var ot = X(ve, be, Me, Ge, Ne, xe, Fe, Ae, me);
                  Ie = ot.scale, Ue = ot.pad;
                } else
                  Ie = 1, K && (Ie = Math.min(1, Je / Ne.x, et / Ne.y)), Ue = 0;
                var ct = we.left * he + we.right * $, Tt = (we.top + we.bottom) / 2, kt = (ve + L) * he + (be - L) * $, Ot = (Me + Ge) / 2, Rt = 0, xt = 0;
                if (V || _) {
                  var Wt = (Ae ? Ne.x : Ne.y) / 2;
                  xe && (_ || me) && (at += Ue);
                  var bt = Ae ? Y(ve, be) : Y(Me, Ge);
                  Ae ? V ? (kt = ve + bt * at, Rt = -bt * Wt) : (kt = be - bt * at, Rt = bt * Wt) : V ? (Ot = Me + bt * at, xt = -bt * Wt) : (Ot = Ge - bt * at, xt = bt * Wt);
                }
                return {
                  textX: ct,
                  textY: Tt,
                  targetX: kt,
                  targetY: Ot,
                  anchorX: Rt,
                  anchorY: xt,
                  scale: Ie,
                  rotate: De
                };
              }
              function X(ve, be, Me, Ge, we, Re, Ae, K, ee) {
                var oe = Math.max(0, Math.abs(be - ve) - 2 * L), _ = Math.max(0, Math.abs(Ge - Me) - 2 * L), V = Re - L, fe = Ae ? V - Math.sqrt(V * V - (V - Ae) * (V - Ae)) : V, $ = ee ? V * 2 : K ? V - Ae : 2 * fe, he = ee ? V * 2 : K ? 2 * fe : V - Ae, me, xe, Fe, Ve, Be;
                return we.y / we.x >= _ / (oe - $) ? Ve = _ / we.y : we.y / we.x <= (_ - he) / oe ? Ve = oe / we.x : !ee && K ? (me = we.x * we.x + we.y * we.y / 4, xe = -2 * we.x * (oe - V) - we.y * (_ / 2 - V), Fe = (oe - V) * (oe - V) + (_ / 2 - V) * (_ / 2 - V) - V * V, Ve = (-xe + Math.sqrt(xe * xe - 4 * me * Fe)) / (2 * me)) : ee ? (me = (we.x * we.x + we.y * we.y) / 4, xe = -we.x * (oe / 2 - V) - we.y * (_ / 2 - V), Fe = (oe / 2 - V) * (oe / 2 - V) + (_ / 2 - V) * (_ / 2 - V) - V * V, Ve = (-xe + Math.sqrt(xe * xe - 4 * me * Fe)) / (2 * me)) : (me = we.x * we.x / 4 + we.y * we.y, xe = -we.x * (oe / 2 - V) - 2 * we.y * (_ - V), Fe = (oe / 2 - V) * (oe / 2 - V) + (_ - V) * (_ - V) - V * V, Ve = (-xe + Math.sqrt(xe * xe - 4 * me * Fe)) / (2 * me)), Ve = Math.min(1, Ve), K ? Be = Math.max(0, V - Math.sqrt(Math.max(0, V * V - (V - (_ - we.y * Ve) / 2) * (V - (_ - we.y * Ve) / 2))) - Ae) : Be = Math.max(0, V - Math.sqrt(Math.max(0, V * V - (V - (oe - we.x * Ve) / 2) * (V - (oe - we.x * Ve) / 2))) - Ae), {
                  scale: Ve,
                  pad: Be
                };
              }
              function U(ve, be, Me, Ge, we, Re) {
                var Ae = !!Re.isHorizontal, K = !!Re.constrained, ee = Re.angle || 0, oe = we.width, _ = we.height, V = Math.abs(be - ve), fe = Math.abs(Ge - Me), $;
                Ae ? $ = fe > 2 * L ? L : 0 : $ = V > 2 * L ? L : 0;
                var he = 1;
                K && (he = Ae ? Math.min(1, fe / _) : Math.min(1, V / oe));
                var me = q(ee), xe = ie(we, me), Fe = (Ae ? xe.x : xe.y) / 2, Ve = (we.left + we.right) / 2, Be = (we.top + we.bottom) / 2, Je = (ve + be) / 2, et = (Me + Ge) / 2, at = 0, De = 0, Ne = Ae ? Y(be, ve) : Y(Me, Ge);
                return Ae ? (Je = be - Ne * $, at = Ne * Fe) : (et = Ge + Ne * $, De = -Ne * Fe), {
                  textX: Ve,
                  textY: Be,
                  targetX: Je,
                  targetY: et,
                  anchorX: at,
                  anchorY: De,
                  scale: he,
                  rotate: me
                };
              }
              function ne(ve, be, Me, Ge, we) {
                var Re = be[0].trace, Ae = Re.texttemplate, K;
                return Ae ? K = le(ve, be, Me, Ge, we) : Re.textinfo ? K = ue(be, Me, Ge, we) : K = x.getValue(Re.text, Me), x.coerceString(P, K);
              }
              function se(ve, be) {
                var Me = x.getValue(ve.textposition, be);
                return x.coerceEnumerated(k, Me);
              }
              function le(ve, be, Me, Ge, we) {
                var Re = be[0].trace, Ae = f.castOption(Re, Me, "texttemplate");
                if (!Ae) return "";
                var K = Re.type === "histogram", ee = Re.type === "waterfall", oe = Re.type === "funnel", _ = Re.orientation === "h", V, fe, $, he;
                _ ? (V = "y", fe = we, $ = "x", he = Ge) : (V = "x", fe = Ge, $ = "y", he = we);
                function me(at) {
                  return m(fe, fe.c2l(at), !0).text;
                }
                function xe(at) {
                  return m(he, he.c2l(at), !0).text;
                }
                var Fe = be[Me], Ve = {};
                Ve.label = Fe.p, Ve.labelLabel = Ve[V + "Label"] = me(Fe.p);
                var Be = f.castOption(Re, Fe.i, "text");
                (Be === 0 || Be) && (Ve.text = Be), Ve.value = Fe.s, Ve.valueLabel = Ve[$ + "Label"] = xe(Fe.s);
                var Je = {};
                I(Je, Re, Fe.i), (K || Je.x === void 0) && (Je.x = _ ? Ve.value : Ve.label), (K || Je.y === void 0) && (Je.y = _ ? Ve.label : Ve.value), (K || Je.xLabel === void 0) && (Je.xLabel = _ ? Ve.valueLabel : Ve.labelLabel), (K || Je.yLabel === void 0) && (Je.yLabel = _ ? Ve.labelLabel : Ve.valueLabel), ee && (Ve.delta = +Fe.rawS || Fe.s, Ve.deltaLabel = xe(Ve.delta), Ve.final = Fe.v, Ve.finalLabel = xe(Ve.final), Ve.initial = Ve.final - Ve.delta, Ve.initialLabel = xe(Ve.initial)), oe && (Ve.value = Fe.s, Ve.valueLabel = xe(Ve.value), Ve.percentInitial = Fe.begR, Ve.percentInitialLabel = f.formatPercent(Fe.begR), Ve.percentPrevious = Fe.difR, Ve.percentPreviousLabel = f.formatPercent(Fe.difR), Ve.percentTotal = Fe.sumR, Ve.percenTotalLabel = f.formatPercent(Fe.sumR));
                var et = f.castOption(Re, Fe.i, "customdata");
                return et && (Ve.customdata = et), f.texttemplateString(Ae, Ve, ve._d3locale, Je, Ve, Re._meta || {});
              }
              function ue(ve, be, Me, Ge) {
                var we = ve[0].trace, Re = we.orientation === "h", Ae = we.type === "waterfall", K = we.type === "funnel";
                function ee(et) {
                  var at = Re ? Ge : Me;
                  return m(at, et, !0).text;
                }
                function oe(et) {
                  var at = Re ? Me : Ge;
                  return m(at, +et, !0).text;
                }
                var _ = we.textinfo, V = ve[be], fe = _.split("+"), $ = [], he, me = function(et) {
                  return fe.indexOf(et) !== -1;
                };
                if (me("label") && $.push(ee(ve[be].p)), me("text") && (he = f.castOption(we, V.i, "text"), (he === 0 || he) && $.push(he)), Ae) {
                  var xe = +V.rawS || V.s, Fe = V.v, Ve = Fe - xe;
                  me("initial") && $.push(oe(Ve)), me("delta") && $.push(oe(xe)), me("final") && $.push(oe(Fe));
                }
                if (K) {
                  me("value") && $.push(oe(V.s));
                  var Be = 0;
                  me("percent initial") && Be++, me("percent previous") && Be++, me("percent total") && Be++;
                  var Je = Be > 1;
                  me("percent initial") && (he = f.formatPercent(V.begR), Je && (he += " of initial"), $.push(he)), me("percent previous") && (he = f.formatPercent(V.difR), Je && (he += " of previous"), $.push(he)), me("percent total") && (he = f.formatPercent(V.sumR), Je && (he += " of total"), $.push(he));
                }
                return $.join("<br>");
              }
              s.exports = {
                plot: z,
                toMoveInsideBar: ce
              };
            }
          ),
          /***/
          5784: (
            /***/
            function(s) {
              s.exports = function(l, v) {
                var f = l.cd, p = l.xaxis, g = l.yaxis, y = f[0].trace, C = y.type === "funnel", m = y.orientation === "h", h = [], w;
                if (v === !1)
                  for (w = 0; w < f.length; w++)
                    f[w].selected = 0;
                else
                  for (w = 0; w < f.length; w++) {
                    var S = f[w], E = "ct" in S ? S.ct : c(S, p, g, m, C);
                    v.contains(E, !1, w, l) ? (h.push({
                      pointNumber: w,
                      x: p.c2d(S.x),
                      y: g.c2d(S.y)
                    }), S.selected = 1) : S.selected = 0;
                  }
                return h;
              };
              function c(i, l, v, f, p) {
                var g = l.c2p(f ? i.s0 : i.p0, !0), y = l.c2p(f ? i.s1 : i.p1, !0), C = v.c2p(f ? i.p0 : i.s0, !0), m = v.c2p(f ? i.p1 : i.s1, !0);
                return p ? [(g + y) / 2, (C + m) / 2] : f ? [y, (C + m) / 2] : [(g + y) / 2, m];
              }
            }
          ),
          /***/
          2592: (
            /***/
            function(s, c, i) {
              s.exports = v;
              var l = i(3400).distinctVals;
              function v(f, p) {
                this.traces = f, this.sepNegVal = p.sepNegVal, this.overlapNoMerge = p.overlapNoMerge;
                for (var g = 1 / 0, y = p.posAxis._id.charAt(0), C = [], m = 0; m < f.length; m++) {
                  for (var h = f[m], w = 0; w < h.length; w++) {
                    var S = h[w], E = S.p;
                    E === void 0 && (E = S[y]), E !== void 0 && C.push(E);
                  }
                  h[0] && h[0].width1 && (g = Math.min(h[0].width1, g));
                }
                this.positions = C;
                var x = l(C);
                this.distinctPositions = x.vals, x.vals.length === 1 && g !== 1 / 0 ? this.minDiff = g : this.minDiff = Math.min(x.minDiff, g);
                var T = (p.posAxis || {}).type;
                (T === "category" || T === "multicategory") && (this.minDiff = 1), this.binWidth = this.minDiff, this.bins = {};
              }
              v.prototype.put = function(p, g) {
                var y = this.getLabel(p, g), C = this.bins[y] || 0;
                return this.bins[y] = C + g, C;
              }, v.prototype.get = function(p, g) {
                var y = this.getLabel(p, g);
                return this.bins[y] || 0;
              }, v.prototype.getLabel = function(p, g) {
                var y = g < 0 && this.sepNegVal ? "v" : "^", C = this.overlapNoMerge ? p : Math.round(p / this.binWidth);
                return y + C;
              };
            }
          ),
          /***/
          100: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(6308), f = i(3616), p = i(3400), g = i(4040), y = i(2744).resizeText, C = i(832), m = C.textfont, h = C.insidetextfont, w = C.outsidetextfont, S = i(444);
              function E(j) {
                var te = l.select(j).selectAll('g[class^="barlayer"]').selectAll("g.trace");
                y(j, te, "bar");
                var re = te.size(), z = j._fullLayout;
                te.style("opacity", function(Z) {
                  return Z[0].trace.opacity;
                }).each(function(Z) {
                  (z.barmode === "stack" && re > 1 || z.bargap === 0 && z.bargroupgap === 0 && !Z[0].trace.marker.line.width) && l.select(this).attr("shape-rendering", "crispEdges");
                }), te.selectAll("g.points").each(function(Z) {
                  var W = l.select(this), q = Z[0].trace;
                  x(W, q, j);
                }), g.getComponentMethod("errorbars", "style")(te);
              }
              function x(j, te, re) {
                f.pointStyle(j.selectAll("path"), te, re), T(j, te, re);
              }
              function T(j, te, re) {
                j.selectAll("text").each(function(z) {
                  var Z = l.select(this), W = p.ensureUniformFontSize(re, I(Z, z, te, re));
                  f.font(Z, W);
                });
              }
              function F(j, te, re) {
                var z = te[0].trace;
                z.selectedpoints ? P(re, z, j) : (x(re, z, j), g.getComponentMethod("errorbars", "style")(re));
              }
              function P(j, te, re) {
                f.selectedPointStyle(j.selectAll("path"), te), k(j.selectAll("text"), te, re);
              }
              function k(j, te, re) {
                j.each(function(z) {
                  var Z = l.select(this), W;
                  if (z.selected) {
                    W = p.ensureUniformFontSize(re, I(Z, z, te, re));
                    var q = te.selected.textfont && te.selected.textfont.color;
                    q && (W.color = q), f.font(Z, W);
                  } else
                    f.selectedTextStyle(Z, te);
                });
              }
              function I(j, te, re, z) {
                var Z = z._fullLayout.font, W = re.textfont;
                if (j.classed("bartext-inside")) {
                  var q = Y(te, re);
                  W = A(re, te.i, Z, q);
                } else j.classed("bartext-outside") && (W = O(re, te.i, Z));
                return W;
              }
              function L(j, te, re) {
                return N(m, j.textfont, te, re);
              }
              function A(j, te, re, z) {
                var Z = L(j, te, re), W = j._input.textfont === void 0 || j._input.textfont.color === void 0 || Array.isArray(j.textfont.color) && j.textfont.color[te] === void 0;
                return W && (Z = {
                  color: v.contrast(z),
                  family: Z.family,
                  size: Z.size,
                  weight: Z.weight,
                  style: Z.style,
                  variant: Z.variant,
                  textcase: Z.textcase,
                  lineposition: Z.lineposition,
                  shadow: Z.shadow
                }), N(h, j.insidetextfont, te, Z);
              }
              function O(j, te, re) {
                var z = L(j, te, re);
                return N(w, j.outsidetextfont, te, z);
              }
              function N(j, te, re, z) {
                te = te || {};
                var Z = S.getValue(te.family, re), W = S.getValue(te.size, re), q = S.getValue(te.color, re), ie = S.getValue(te.weight, re), ce = S.getValue(te.style, re), X = S.getValue(te.variant, re), U = S.getValue(te.textcase, re), ne = S.getValue(te.lineposition, re), se = S.getValue(te.shadow, re);
                return {
                  family: S.coerceString(j.family, Z, z.family),
                  size: S.coerceNumber(j.size, W, z.size),
                  color: S.coerceColor(j.color, q, z.color),
                  weight: S.coerceString(j.weight, ie, z.weight),
                  style: S.coerceString(j.style, ce, z.style),
                  variant: S.coerceString(j.variant, X, z.variant),
                  textcase: S.coerceString(j.variant, U, z.textcase),
                  lineposition: S.coerceString(j.variant, ne, z.lineposition),
                  shadow: S.coerceString(j.variant, se, z.shadow)
                };
              }
              function Y(j, te) {
                return te.type === "waterfall" ? te[j.dir].marker.color : j.mcc || j.mc || te.marker.color;
              }
              s.exports = {
                style: E,
                styleTextPoints: T,
                styleOnSelect: F,
                getInsideTextFont: A,
                getOutsideTextFont: O,
                getBarColor: Y,
                resizeText: y
              };
            }
          ),
          /***/
          5592: (
            /***/
            function(s, c, i) {
              var l = i(6308), v = i(4288).hasColorscale, f = i(7260), p = i(3400).coercePattern;
              s.exports = function(y, C, m, h, w) {
                var S = m("marker.color", h), E = v(y, "marker");
                E && f(y, C, w, m, {
                  prefix: "marker.",
                  cLetter: "c"
                }), m("marker.line.color", l.defaultLine), v(y, "marker.line") && f(y, C, w, m, {
                  prefix: "marker.line.",
                  cLetter: "c"
                }), m("marker.line.width"), m("marker.opacity"), p(m, "marker.pattern", S, E), m("selected.marker.color"), m("unselected.marker.color");
              };
            }
          ),
          /***/
          2744: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3400);
              function f(C, m, h) {
                var w = C._fullLayout, S = w["_" + h + "Text_minsize"];
                if (S) {
                  var E = w.uniformtext.mode === "hide", x;
                  switch (h) {
                    case "funnelarea":
                    case "pie":
                    case "sunburst":
                      x = "g.slice";
                      break;
                    case "treemap":
                    case "icicle":
                      x = "g.slice, g.pathbar";
                      break;
                    default:
                      x = "g.points > g.point";
                  }
                  m.selectAll(x).each(function(T) {
                    var F = T.transform;
                    if (F) {
                      F.scale = E && F.hide ? 0 : S / F.fontSize;
                      var P = l.select(this).select("text");
                      v.setTransormAndDisplay(P, F);
                    }
                  });
                }
              }
              function p(C, m, h) {
                if (h.uniformtext.mode) {
                  var w = y(C), S = h.uniformtext.minsize, E = m.scale * m.fontSize;
                  m.hide = E < S, h[w] = h[w] || 1 / 0, m.hide || (h[w] = Math.min(h[w], Math.max(E, S)));
                }
              }
              function g(C, m) {
                var h = y(C);
                m[h] = void 0;
              }
              function y(C) {
                return "_" + C + "Text_minsize";
              }
              s.exports = {
                recordMinTextSize: p,
                clearMinTextSize: g,
                resizeText: f
              };
            }
          ),
          /***/
          4996: (
            /***/
            function(s, c, i) {
              var l = i(5464), v = i(6968).u, f = i(5376), p = i(2548), g = i(1776).Ks, y = i(1776).Gw, C = i(2880).extendFlat, m = i(8192).c, h = f({
                editType: "plot",
                arrayOk: !0,
                colorEditType: "plot"
              });
              s.exports = {
                labels: {
                  valType: "data_array",
                  editType: "calc"
                },
                // equivalent of x0 and dx, if label is missing
                label0: {
                  valType: "number",
                  dflt: 0,
                  editType: "calc"
                },
                dlabel: {
                  valType: "number",
                  dflt: 1,
                  editType: "calc"
                },
                values: {
                  valType: "data_array",
                  editType: "calc"
                },
                marker: {
                  colors: {
                    valType: "data_array",
                    // TODO 'color_array' ?
                    editType: "calc"
                  },
                  line: {
                    color: {
                      valType: "color",
                      dflt: p.defaultLine,
                      arrayOk: !0,
                      editType: "style"
                    },
                    width: {
                      valType: "number",
                      min: 0,
                      dflt: 0,
                      arrayOk: !0,
                      editType: "style"
                    },
                    editType: "calc"
                  },
                  pattern: m,
                  editType: "calc"
                },
                text: {
                  valType: "data_array",
                  editType: "plot"
                },
                hovertext: {
                  valType: "string",
                  dflt: "",
                  arrayOk: !0,
                  editType: "style"
                },
                // 'see eg:'
                // 'https://www.e-education.psu.edu/natureofgeoinfo/sites/www.e-education.psu.edu.natureofgeoinfo/files/image/hisp_pies.gif',
                // '(this example involves a map too - may someday be a whole trace type',
                // 'of its own. but the point is the size of the whole pie is important.)'
                scalegroup: {
                  valType: "string",
                  dflt: "",
                  editType: "calc"
                },
                // labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels)
                textinfo: {
                  valType: "flaglist",
                  flags: ["label", "text", "value", "percent"],
                  extras: ["none"],
                  editType: "calc"
                },
                hoverinfo: C({}, l.hoverinfo, {
                  flags: ["label", "text", "value", "percent", "name"]
                }),
                hovertemplate: g({}, {
                  keys: ["label", "color", "value", "percent", "text"]
                }),
                texttemplate: y({
                  editType: "plot"
                }, {
                  keys: ["label", "color", "value", "percent", "text"]
                }),
                textposition: {
                  valType: "enumerated",
                  values: ["inside", "outside", "auto", "none"],
                  dflt: "auto",
                  arrayOk: !0,
                  editType: "plot"
                },
                textfont: C({}, h, {}),
                insidetextorientation: {
                  valType: "enumerated",
                  values: ["horizontal", "radial", "tangential", "auto"],
                  dflt: "auto",
                  editType: "plot"
                },
                insidetextfont: C({}, h, {}),
                outsidetextfont: C({}, h, {}),
                automargin: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "plot"
                },
                title: {
                  text: {
                    valType: "string",
                    dflt: "",
                    editType: "plot"
                  },
                  font: C({}, h, {}),
                  position: {
                    valType: "enumerated",
                    values: ["top left", "top center", "top right", "middle center", "bottom left", "bottom center", "bottom right"],
                    editType: "plot"
                  },
                  editType: "plot"
                },
                // position and shape
                domain: v({
                  name: "pie",
                  trace: !0,
                  editType: "calc"
                }),
                hole: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 0,
                  editType: "calc"
                },
                // ordering and direction
                sort: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc"
                },
                direction: {
                  /**
                   * there are two common conventions, both of which place the first
                   * (largest, if sorted) slice with its left edge at 12 o'clock but
                   * succeeding slices follow either cw or ccw from there.
                   *
                   * see http://visage.co/data-visualization-101-pie-charts/
                   */
                  valType: "enumerated",
                  values: ["clockwise", "counterclockwise"],
                  dflt: "counterclockwise",
                  editType: "calc"
                },
                rotation: {
                  valType: "angle",
                  dflt: 0,
                  editType: "calc"
                },
                pull: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  dflt: 0,
                  arrayOk: !0,
                  editType: "calc"
                },
                _deprecated: {
                  title: {
                    valType: "string",
                    dflt: "",
                    editType: "calc"
                  },
                  titlefont: C({}, h, {}),
                  titleposition: {
                    valType: "enumerated",
                    values: ["top left", "top center", "top right", "middle center", "bottom left", "bottom center", "bottom right"],
                    editType: "calc"
                  }
                }
              };
            }
          ),
          /***/
          36: (
            /***/
            function(s, c, i) {
              var l = i(7316);
              c.name = "pie", c.plot = function(v, f, p, g) {
                l.plotBasePlot(c.name, v, f, p, g);
              }, c.clean = function(v, f, p, g) {
                l.cleanBasePlot(c.name, v, f, p, g);
              };
            }
          ),
          /***/
          5768: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(9760), f = i(6308), p = {};
              function g(h, w) {
                var S = [], E = h._fullLayout, x = E.hiddenlabels || [], T = w.labels, F = w.marker.colors || [], P = w.values, k = w._length, I = w._hasValues && k, L, A;
                if (w.dlabel)
                  for (T = new Array(k), L = 0; L < k; L++)
                    T[L] = String(w.label0 + L * w.dlabel);
                var O = {}, N = y(E["_" + w.type + "colormap"]), Y = 0, j = !1;
                for (L = 0; L < k; L++) {
                  var te, re, z;
                  if (I) {
                    if (te = P[L], !l(te)) continue;
                    te = +te;
                  } else te = 1;
                  re = T[L], (re === void 0 || re === "") && (re = L), re = String(re);
                  var Z = O[re];
                  Z === void 0 ? (O[re] = S.length, z = x.indexOf(re) !== -1, z || (Y += te), S.push({
                    v: te,
                    label: re,
                    color: N(F[L], re),
                    i: L,
                    pts: [L],
                    hidden: z
                  })) : (j = !0, A = S[Z], A.v += te, A.pts.push(L), A.hidden || (Y += te), A.color === !1 && F[L] && (A.color = N(F[L], re)));
                }
                S = S.filter(function(q) {
                  return q.v >= 0;
                });
                var W = w.type === "funnelarea" ? j : w.sort;
                return W && S.sort(function(q, ie) {
                  return ie.v - q.v;
                }), S[0] && (S[0].vTotal = Y), S;
              }
              function y(h) {
                return function(S, E) {
                  return !S || (S = v(S), !S.isValid()) ? !1 : (S = f.addOpacity(S, S.getAlpha()), h[E] || (h[E] = S), S);
                };
              }
              function C(h, w) {
                var S = (w || {}).type;
                S || (S = "pie");
                var E = h._fullLayout, x = h.calcdata, T = E[S + "colorway"], F = E["_" + S + "colormap"];
                E["extend" + S + "colors"] && (T = m(T, p));
                for (var P = 0, k = 0; k < x.length; k++) {
                  var I = x[k], L = I[0].trace.type;
                  if (L === S)
                    for (var A = 0; A < I.length; A++) {
                      var O = I[A];
                      O.color === !1 && (F[O.label] ? O.color = F[O.label] : (F[O.label] = O.color = T[P % T.length], P++));
                    }
                }
              }
              function m(h, w) {
                var S, E = JSON.stringify(h), x = w[E];
                if (!x) {
                  for (x = h.slice(), S = 0; S < h.length; S++)
                    x.push(v(h[S]).lighten(20).toHexString());
                  for (S = 0; S < h.length; S++)
                    x.push(v(h[S]).darken(20).toHexString());
                  w[E] = x;
                }
                return x;
              }
              s.exports = {
                calc: g,
                crossTraceCalc: C,
                makePullColorFn: y,
                generateExtendedColors: m
              };
            }
          ),
          /***/
          4174: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = i(4996), p = i(6968).Q, g = i(1508).handleText, y = i(3400).coercePattern;
              function C(w, S) {
                var E = v.isArrayOrTypedArray(w), x = v.isArrayOrTypedArray(S), T = Math.min(E ? w.length : 1 / 0, x ? S.length : 1 / 0);
                if (isFinite(T) || (T = 0), T && x) {
                  for (var F, P = 0; P < T; P++) {
                    var k = S[P];
                    if (l(k) && k > 0) {
                      F = !0;
                      break;
                    }
                  }
                  F || (T = 0);
                }
                return {
                  hasLabels: E,
                  hasValues: x,
                  len: T
                };
              }
              function m(w, S, E, x, T) {
                var F = x("marker.line.width");
                F && x(
                  "marker.line.color",
                  T ? void 0 : E.paper_bgcolor
                  // case of funnelarea, sunburst, icicle, treemap
                );
                var P = x("marker.colors");
                y(x, "marker.pattern", P), w.marker && !S.marker.pattern.fgcolor && (S.marker.pattern.fgcolor = w.marker.colors), S.marker.pattern.bgcolor || (S.marker.pattern.bgcolor = E.paper_bgcolor);
              }
              function h(w, S, E, x) {
                function T(Z, W) {
                  return v.coerce(w, S, f, Z, W);
                }
                var F = T("labels"), P = T("values"), k = C(F, P), I = k.len;
                if (S._hasLabels = k.hasLabels, S._hasValues = k.hasValues, !S._hasLabels && S._hasValues && (T("label0"), T("dlabel")), !I) {
                  S.visible = !1;
                  return;
                }
                S._length = I, m(w, S, x, T, !0), T("scalegroup");
                var L = T("text"), A = T("texttemplate"), O;
                if (A || (O = T("textinfo", v.isArrayOrTypedArray(L) ? "text+percent" : "percent")), T("hovertext"), T("hovertemplate"), A || O && O !== "none") {
                  var N = T("textposition");
                  g(w, S, x, T, N, {
                    moduleHasSelected: !1,
                    moduleHasUnselected: !1,
                    moduleHasConstrain: !1,
                    moduleHasCliponaxis: !1,
                    moduleHasTextangle: !1,
                    moduleHasInsideanchor: !1
                  });
                  var Y = Array.isArray(N) || N === "auto", j = Y || N === "outside";
                  j && T("automargin"), (N === "inside" || N === "auto" || Array.isArray(N)) && T("insidetextorientation");
                } else O === "none" && T("textposition", "none");
                p(S, x, T);
                var te = T("hole"), re = T("title.text");
                if (re) {
                  var z = T("title.position", te ? "middle center" : "top center");
                  !te && z === "middle center" && (S.title.position = "top center"), v.coerceFont(T, "title.font", x.font);
                }
                T("sort"), T("direction"), T("rotation"), T("pull");
              }
              s.exports = {
                handleLabelsAndValues: C,
                handleMarkerDefaults: m,
                supplyDefaults: h
              };
            }
          ),
          /***/
          3644: (
            /***/
            function(s, c, i) {
              var l = i(624).appendArrayMultiPointValues;
              s.exports = function(f, p) {
                var g = {
                  curveNumber: p.index,
                  pointNumbers: f.pts,
                  data: p._input,
                  fullData: p,
                  label: f.label,
                  color: f.color,
                  value: f.v,
                  percent: f.percent,
                  text: f.text,
                  bbox: f.bbox,
                  // pt.v (and pt.i below) for backward compatibility
                  v: f.v
                };
                return f.pts.length === 1 && (g.pointNumber = g.i = f.pts[0]), l(g, p, f.pts), p.type === "funnelarea" && (delete g.v, delete g.i), g;
              };
            }
          ),
          /***/
          1552: (
            /***/
            function(s, c, i) {
              var l = i(3616), v = i(6308);
              s.exports = function(p, g, y, C) {
                var m = y.marker.pattern;
                m && m.shape ? l.pointStyle(p, y, C, g) : v.fill(p, g.color);
              };
            }
          ),
          /***/
          9656: (
            /***/
            function(s, c, i) {
              var l = i(3400);
              function v(f) {
                return f.indexOf("e") !== -1 ? f.replace(/[.]?0+e/, "e") : f.indexOf(".") !== -1 ? f.replace(/[.]?0+$/, "") : f;
              }
              c.formatPiePercent = function(p, g) {
                var y = v((p * 100).toPrecision(3));
                return l.numSeparate(y, g) + "%";
              }, c.formatPieValue = function(p, g) {
                var y = v(p.toPrecision(10));
                return l.numSeparate(y, g);
              }, c.getFirstFilled = function(p, g) {
                if (l.isArrayOrTypedArray(p))
                  for (var y = 0; y < g.length; y++) {
                    var C = p[g[y]];
                    if (C || C === 0 || C === "") return C;
                  }
              }, c.castOption = function(p, g) {
                if (l.isArrayOrTypedArray(p)) return c.getFirstFilled(p, g);
                if (p) return p;
              }, c.getRotationAngle = function(f) {
                return (f === "auto" ? 0 : f) * Math.PI / 180;
              };
            }
          ),
          /***/
          5792: (
            /***/
            function(s, c, i) {
              s.exports = {
                attributes: i(4996),
                supplyDefaults: i(4174).supplyDefaults,
                supplyLayoutDefaults: i(248),
                layoutAttributes: i(5204),
                calc: i(5768).calc,
                crossTraceCalc: i(5768).crossTraceCalc,
                plot: i(7820).plot,
                style: i(2152),
                styleOne: i(528),
                moduleType: "trace",
                name: "pie",
                basePlotModule: i(36),
                categories: ["pie-like", "pie", "showLegend"],
                meta: {}
              };
            }
          ),
          /***/
          5204: (
            /***/
            function(s) {
              s.exports = {
                hiddenlabels: {
                  valType: "data_array",
                  editType: "calc"
                },
                piecolorway: {
                  valType: "colorlist",
                  editType: "calc"
                },
                extendpiecolors: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc"
                }
              };
            }
          ),
          /***/
          248: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(5204);
              s.exports = function(p, g) {
                function y(C, m) {
                  return l.coerce(p, g, v, C, m);
                }
                y("hiddenlabels"), y("piecolorway", g.colorway), y("extendpiecolors");
              };
            }
          ),
          /***/
          7820: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(7316), f = i(3024), p = i(6308), g = i(3616), y = i(3400), C = y.strScale, m = y.strTranslate, h = i(2736), w = i(2744), S = w.recordMinTextSize, E = w.clearMinTextSize, x = i(8048).TEXTPAD, T = i(9656), F = i(3644), P = i(3400).isValidTextValue;
              function k(Re, Ae) {
                var K = Re._context.staticPlot, ee = Re._fullLayout, oe = ee._size;
                E("pie", ee), N(Ae, Re), ue(Ae, oe);
                var _ = y.makeTraceGroups(ee._pielayer, Ae, "trace").each(function(V) {
                  var fe = l.select(this), $ = V[0], he = $.trace;
                  be(V), fe.attr("stroke-linejoin", "round"), fe.each(function() {
                    var me = l.select(this).selectAll("g.slice").data(V);
                    me.enter().append("g").classed("slice", !0), me.exit().remove();
                    var xe = [
                      [[], []],
                      // y<0: x<0, x>=0
                      [[], []]
                      // y>=0: x<0, x>=0
                    ], Fe = !1;
                    me.each(function(Ie, Ue) {
                      if (Ie.hidden) {
                        l.select(this).selectAll("path,g").remove();
                        return;
                      }
                      Ie.pointNumber = Ie.i, Ie.curveNumber = he.index, xe[Ie.pxmid[1] < 0 ? 0 : 1][Ie.pxmid[0] < 0 ? 0 : 1].push(Ie);
                      var ot = $.cx, ct = $.cy, Tt = l.select(this), kt = Tt.selectAll("path.surface").data([Ie]);
                      if (kt.enter().append("path").classed("surface", !0).style({
                        "pointer-events": K ? "none" : "all"
                      }), Tt.call(L, Re, V), he.pull) {
                        var Ot = +T.castOption(he.pull, Ie.pts) || 0;
                        Ot > 0 && (ot += Ot * Ie.pxmid[0], ct += Ot * Ie.pxmid[1]);
                      }
                      Ie.cxFinal = ot, Ie.cyFinal = ct;
                      function Rt(Ut, tt, ze, _e) {
                        var Ye = _e * (tt[0] - Ut[0]), lt = _e * (tt[1] - Ut[1]);
                        return "a" + _e * $.r + "," + _e * $.r + " 0 " + Ie.largeArc + (ze ? " 1 " : " 0 ") + Ye + "," + lt;
                      }
                      var xt = he.hole;
                      if (Ie.v === $.vTotal) {
                        var Wt = "M" + (ot + Ie.px0[0]) + "," + (ct + Ie.px0[1]) + Rt(Ie.px0, Ie.pxmid, !0, 1) + Rt(Ie.pxmid, Ie.px0, !0, 1) + "Z";
                        xt ? kt.attr("d", "M" + (ot + xt * Ie.px0[0]) + "," + (ct + xt * Ie.px0[1]) + Rt(Ie.px0, Ie.pxmid, !1, xt) + Rt(Ie.pxmid, Ie.px0, !1, xt) + "Z" + Wt) : kt.attr("d", Wt);
                      } else {
                        var bt = Rt(Ie.px0, Ie.px1, !0, 1);
                        if (xt) {
                          var jt = 1 - xt;
                          kt.attr("d", "M" + (ot + xt * Ie.px1[0]) + "," + (ct + xt * Ie.px1[1]) + Rt(Ie.px1, Ie.px0, !1, xt) + "l" + jt * Ie.px0[0] + "," + jt * Ie.px0[1] + bt + "Z");
                        } else
                          kt.attr("d", "M" + ot + "," + ct + "l" + Ie.px0[0] + "," + Ie.px0[1] + bt + "Z");
                      }
                      Ge(Re, Ie, $);
                      var qt = T.castOption(he.textposition, Ie.pts), Yt = Tt.selectAll("g.slicetext").data(Ie.text && qt !== "none" ? [0] : []);
                      Yt.enter().append("g").classed("slicetext", !0), Yt.exit().remove(), Yt.each(function() {
                        var Ut = y.ensureSingle(l.select(this), "text", "", function(je) {
                          je.attr("data-notex", 1);
                        }), tt = y.ensureUniformFontSize(Re, qt === "outside" ? A(he, Ie, ee.font) : O(he, Ie, ee.font));
                        Ut.text(Ie.text).attr({
                          class: "slicetext",
                          transform: "",
                          "text-anchor": "middle"
                        }).call(g.font, tt).call(h.convertToTspans, Re);
                        var ze = g.bBox(Ut.node()), _e;
                        if (qt === "outside")
                          _e = ie(ze, Ie);
                        else if (_e = Y(ze, Ie, $), qt === "auto" && _e.scale < 1) {
                          var Ye = y.ensureUniformFontSize(Re, he.outsidetextfont);
                          Ut.call(g.font, Ye), ze = g.bBox(Ut.node()), _e = ie(ze, Ie);
                        }
                        var lt = _e.textPosAngle, Te = lt === void 0 ? Ie.pxmid : Me($.r, lt);
                        if (_e.targetX = ot + Te[0] * _e.rCenter + (_e.x || 0), _e.targetY = ct + Te[1] * _e.rCenter + (_e.y || 0), we(_e, ze), _e.outside) {
                          var Oe = _e.targetY;
                          Ie.yLabelMin = Oe - ze.height / 2, Ie.yLabelMid = Oe, Ie.yLabelMax = Oe + ze.height / 2, Ie.labelExtraX = 0, Ie.labelExtraY = 0, Fe = !0;
                        }
                        _e.fontSize = tt.size, S(he.type, _e, ee), V[Ue].transform = _e, y.setTransormAndDisplay(Ut, _e);
                      });
                    });
                    var Ve = l.select(this).selectAll("g.titletext").data(he.title.text ? [0] : []);
                    if (Ve.enter().append("g").classed("titletext", !0), Ve.exit().remove(), Ve.each(function() {
                      var Ie = y.ensureSingle(l.select(this), "text", "", function(ct) {
                        ct.attr("data-notex", 1);
                      }), Ue = he.title.text;
                      he._meta && (Ue = y.templateString(Ue, he._meta)), Ie.text(Ue).attr({
                        class: "titletext",
                        transform: "",
                        "text-anchor": "middle"
                      }).call(g.font, he.title.font).call(h.convertToTspans, Re);
                      var ot;
                      he.title.position === "middle center" ? ot = ce($) : ot = X($, oe), Ie.attr("transform", m(ot.x, ot.y) + C(Math.min(1, ot.scale)) + m(ot.tx, ot.ty));
                    }), Fe && le(xe, he), I(me, he), Fe && he.automargin) {
                      var Be = g.bBox(fe.node()), Je = he.domain, et = oe.w * (Je.x[1] - Je.x[0]), at = oe.h * (Je.y[1] - Je.y[0]), De = (0.5 * et - $.r) / oe.w, Ne = (0.5 * at - $.r) / oe.h;
                      v.autoMargin(Re, "pie." + he.uid + ".automargin", {
                        xl: Je.x[0] - De,
                        xr: Je.x[1] + De,
                        yb: Je.y[0] - Ne,
                        yt: Je.y[1] + Ne,
                        l: Math.max($.cx - $.r - Be.left, 0),
                        r: Math.max(Be.right - ($.cx + $.r), 0),
                        b: Math.max(Be.bottom - ($.cy + $.r), 0),
                        t: Math.max($.cy - $.r - Be.top, 0),
                        pad: 5
                      });
                    }
                  });
                });
                setTimeout(function() {
                  _.selectAll("tspan").each(function() {
                    var V = l.select(this);
                    V.attr("dy") && V.attr("dy", V.attr("dy"));
                  });
                }, 0);
              }
              function I(Re, Ae) {
                Re.each(function(K) {
                  var ee = l.select(this);
                  if (!K.labelExtraX && !K.labelExtraY) {
                    ee.select("path.textline").remove();
                    return;
                  }
                  var oe = ee.select("g.slicetext text");
                  K.transform.targetX += K.labelExtraX, K.transform.targetY += K.labelExtraY, y.setTransormAndDisplay(oe, K.transform);
                  var _ = K.cxFinal + K.pxmid[0], V = K.cyFinal + K.pxmid[1], fe = "M" + _ + "," + V, $ = (K.yLabelMax - K.yLabelMin) * (K.pxmid[0] < 0 ? -1 : 1) / 4;
                  if (K.labelExtraX) {
                    var he = K.labelExtraX * K.pxmid[1] / K.pxmid[0], me = K.yLabelMid + K.labelExtraY - (K.cyFinal + K.pxmid[1]);
                    Math.abs(he) > Math.abs(me) ? fe += "l" + me * K.pxmid[0] / K.pxmid[1] + "," + me + "H" + (_ + K.labelExtraX + $) : fe += "l" + K.labelExtraX + "," + he + "v" + (me - he) + "h" + $;
                  } else
                    fe += "V" + (K.yLabelMid + K.labelExtraY) + "h" + $;
                  y.ensureSingle(ee, "path", "textline").call(p.stroke, Ae.outsidetextfont.color).attr({
                    "stroke-width": Math.min(2, Ae.outsidetextfont.size / 8),
                    d: fe,
                    fill: "none"
                  });
                });
              }
              function L(Re, Ae, K) {
                var ee = K[0], oe = ee.cx, _ = ee.cy, V = ee.trace, fe = V.type === "funnelarea";
                "_hasHoverLabel" in V || (V._hasHoverLabel = !1), "_hasHoverEvent" in V || (V._hasHoverEvent = !1), Re.on("mouseover", function($) {
                  var he = Ae._fullLayout, me = Ae._fullData[V.index];
                  if (!(Ae._dragging || he.hovermode === !1)) {
                    var xe = me.hoverinfo;
                    if (Array.isArray(xe) && (xe = f.castHoverinfo({
                      hoverinfo: [T.castOption(xe, $.pts)],
                      _module: V._module
                    }, he, 0)), xe === "all" && (xe = "label+text+value+percent+name"), me.hovertemplate || xe !== "none" && xe !== "skip" && xe) {
                      var Fe = $.rInscribed || 0, Ve = oe + $.pxmid[0] * (1 - Fe), Be = _ + $.pxmid[1] * (1 - Fe), Je = he.separators, et = [];
                      if (xe && xe.indexOf("label") !== -1 && et.push($.label), $.text = T.castOption(me.hovertext || me.text, $.pts), xe && xe.indexOf("text") !== -1) {
                        var at = $.text;
                        y.isValidTextValue(at) && et.push(at);
                      }
                      $.value = $.v, $.valueLabel = T.formatPieValue($.v, Je), xe && xe.indexOf("value") !== -1 && et.push($.valueLabel), $.percent = $.v / ee.vTotal, $.percentLabel = T.formatPiePercent($.percent, Je), xe && xe.indexOf("percent") !== -1 && et.push($.percentLabel);
                      var De = me.hoverlabel, Ne = De.font, Ie = [];
                      f.loneHover({
                        trace: V,
                        x0: Ve - Fe * ee.r,
                        x1: Ve + Fe * ee.r,
                        y: Be,
                        _x0: fe ? oe + $.TL[0] : Ve - Fe * ee.r,
                        _x1: fe ? oe + $.TR[0] : Ve + Fe * ee.r,
                        _y0: fe ? _ + $.TL[1] : Be - Fe * ee.r,
                        _y1: fe ? _ + $.BL[1] : Be + Fe * ee.r,
                        text: et.join("<br>"),
                        name: me.hovertemplate || xe.indexOf("name") !== -1 ? me.name : void 0,
                        idealAlign: $.pxmid[0] < 0 ? "left" : "right",
                        color: T.castOption(De.bgcolor, $.pts) || $.color,
                        borderColor: T.castOption(De.bordercolor, $.pts),
                        fontFamily: T.castOption(Ne.family, $.pts),
                        fontSize: T.castOption(Ne.size, $.pts),
                        fontColor: T.castOption(Ne.color, $.pts),
                        nameLength: T.castOption(De.namelength, $.pts),
                        textAlign: T.castOption(De.align, $.pts),
                        hovertemplate: T.castOption(me.hovertemplate, $.pts),
                        hovertemplateLabels: $,
                        eventData: [F($, me)]
                      }, {
                        container: he._hoverlayer.node(),
                        outerContainer: he._paper.node(),
                        gd: Ae,
                        inOut_bbox: Ie
                      }), $.bbox = Ie[0], V._hasHoverLabel = !0;
                    }
                    V._hasHoverEvent = !0, Ae.emit("plotly_hover", {
                      points: [F($, me)],
                      event: l.event
                    });
                  }
                }), Re.on("mouseout", function($) {
                  var he = Ae._fullLayout, me = Ae._fullData[V.index], xe = l.select(this).datum();
                  V._hasHoverEvent && ($.originalEvent = l.event, Ae.emit("plotly_unhover", {
                    points: [F(xe, me)],
                    event: l.event
                  }), V._hasHoverEvent = !1), V._hasHoverLabel && (f.loneUnhover(he._hoverlayer.node()), V._hasHoverLabel = !1);
                }), Re.on("click", function($) {
                  var he = Ae._fullLayout, me = Ae._fullData[V.index];
                  Ae._dragging || he.hovermode === !1 || (Ae._hoverdata = [F($, me)], f.click(Ae, l.event));
                });
              }
              function A(Re, Ae, K) {
                var ee = T.castOption(Re.outsidetextfont.color, Ae.pts) || T.castOption(Re.textfont.color, Ae.pts) || K.color, oe = T.castOption(Re.outsidetextfont.family, Ae.pts) || T.castOption(Re.textfont.family, Ae.pts) || K.family, _ = T.castOption(Re.outsidetextfont.size, Ae.pts) || T.castOption(Re.textfont.size, Ae.pts) || K.size, V = T.castOption(Re.outsidetextfont.weight, Ae.pts) || T.castOption(Re.textfont.weight, Ae.pts) || K.weight, fe = T.castOption(Re.outsidetextfont.style, Ae.pts) || T.castOption(Re.textfont.style, Ae.pts) || K.style, $ = T.castOption(Re.outsidetextfont.variant, Ae.pts) || T.castOption(Re.textfont.variant, Ae.pts) || K.variant, he = T.castOption(Re.outsidetextfont.textcase, Ae.pts) || T.castOption(Re.textfont.textcase, Ae.pts) || K.textcase, me = T.castOption(Re.outsidetextfont.lineposition, Ae.pts) || T.castOption(Re.textfont.lineposition, Ae.pts) || K.lineposition, xe = T.castOption(Re.outsidetextfont.shadow, Ae.pts) || T.castOption(Re.textfont.shadow, Ae.pts) || K.shadow;
                return {
                  color: ee,
                  family: oe,
                  size: _,
                  weight: V,
                  style: fe,
                  variant: $,
                  textcase: he,
                  lineposition: me,
                  shadow: xe
                };
              }
              function O(Re, Ae, K) {
                var ee = T.castOption(Re.insidetextfont.color, Ae.pts);
                !ee && Re._input.textfont && (ee = T.castOption(Re._input.textfont.color, Ae.pts));
                var oe = T.castOption(Re.insidetextfont.family, Ae.pts) || T.castOption(Re.textfont.family, Ae.pts) || K.family, _ = T.castOption(Re.insidetextfont.size, Ae.pts) || T.castOption(Re.textfont.size, Ae.pts) || K.size, V = T.castOption(Re.insidetextfont.weight, Ae.pts) || T.castOption(Re.textfont.weight, Ae.pts) || K.weight, fe = T.castOption(Re.insidetextfont.style, Ae.pts) || T.castOption(Re.textfont.style, Ae.pts) || K.style, $ = T.castOption(Re.insidetextfont.variant, Ae.pts) || T.castOption(Re.textfont.variant, Ae.pts) || K.variant, he = T.castOption(Re.insidetextfont.textcase, Ae.pts) || T.castOption(Re.textfont.textcase, Ae.pts) || K.textcase, me = T.castOption(Re.insidetextfont.lineposition, Ae.pts) || T.castOption(Re.textfont.lineposition, Ae.pts) || K.lineposition, xe = T.castOption(Re.insidetextfont.shadow, Ae.pts) || T.castOption(Re.textfont.shadow, Ae.pts) || K.shadow;
                return {
                  color: ee || p.contrast(Ae.color),
                  family: oe,
                  size: _,
                  weight: V,
                  style: fe,
                  variant: $,
                  textcase: he,
                  lineposition: me,
                  shadow: xe
                };
              }
              function N(Re, Ae) {
                for (var K, ee, oe = 0; oe < Re.length; oe++)
                  if (K = Re[oe][0], ee = K.trace, ee.title.text) {
                    var _ = ee.title.text;
                    ee._meta && (_ = y.templateString(_, ee._meta));
                    var V = g.tester.append("text").attr("data-notex", 1).text(_).call(g.font, ee.title.font).call(h.convertToTspans, Ae), fe = g.bBox(V.node(), !0);
                    K.titleBox = {
                      width: fe.width,
                      height: fe.height
                    }, V.remove();
                  }
              }
              function Y(Re, Ae, K) {
                var ee = K.r || Ae.rpx1, oe = Ae.rInscribed, _ = Ae.startangle === Ae.stopangle;
                if (_)
                  return {
                    rCenter: 1 - oe,
                    scale: 0,
                    rotate: 0,
                    textPosAngle: 0
                  };
                var V = Ae.ring, fe = V === 1 && Math.abs(Ae.startangle - Ae.stopangle) === Math.PI * 2, $ = Ae.halfangle, he = Ae.midangle, me = K.trace.insidetextorientation, xe = me === "horizontal", Fe = me === "tangential", Ve = me === "radial", Be = me === "auto", Je = [], et;
                if (!Be) {
                  var at = function(Tt, kt) {
                    if (j(Ae, Tt)) {
                      var Ot = Math.abs(Tt - Ae.startangle), Rt = Math.abs(Tt - Ae.stopangle), xt = Ot < Rt ? Ot : Rt;
                      kt === "tan" ? et = re(Re, ee, V, xt, 0) : et = te(Re, ee, V, xt, Math.PI / 2), et.textPosAngle = Tt, Je.push(et);
                    }
                  }, De;
                  if (xe || Fe) {
                    for (De = 4; De >= -4; De -= 2) at(Math.PI * De, "tan");
                    for (De = 4; De >= -4; De -= 2) at(Math.PI * (De + 1), "tan");
                  }
                  if (xe || Ve) {
                    for (De = 4; De >= -4; De -= 2) at(Math.PI * (De + 1.5), "rad");
                    for (De = 4; De >= -4; De -= 2) at(Math.PI * (De + 0.5), "rad");
                  }
                }
                if (fe || Be || xe) {
                  var Ne = Math.sqrt(Re.width * Re.width + Re.height * Re.height);
                  if (et = {
                    scale: oe * ee * 2 / Ne,
                    // and the center position and rotation in this case
                    rCenter: 1 - oe,
                    rotate: 0
                  }, et.textPosAngle = (Ae.startangle + Ae.stopangle) / 2, et.scale >= 1) return et;
                  Je.push(et);
                }
                (Be || Ve) && (et = te(Re, ee, V, $, he), et.textPosAngle = (Ae.startangle + Ae.stopangle) / 2, Je.push(et)), (Be || Fe) && (et = re(Re, ee, V, $, he), et.textPosAngle = (Ae.startangle + Ae.stopangle) / 2, Je.push(et));
                for (var Ie = 0, Ue = 0, ot = 0; ot < Je.length; ot++) {
                  var ct = Je[ot].scale;
                  if (Ue < ct && (Ue = ct, Ie = ot), !Be && Ue >= 1)
                    break;
                }
                return Je[Ie];
              }
              function j(Re, Ae) {
                var K = Re.startangle, ee = Re.stopangle;
                return K > Ae && Ae > ee || K < Ae && Ae < ee;
              }
              function te(Re, Ae, K, ee, oe) {
                Ae = Math.max(0, Ae - 2 * x);
                var _ = Re.width / Re.height, V = W(_, ee, Ae, K);
                return {
                  scale: V * 2 / Re.height,
                  rCenter: z(_, V / Ae),
                  rotate: Z(oe)
                };
              }
              function re(Re, Ae, K, ee, oe) {
                Ae = Math.max(0, Ae - 2 * x);
                var _ = Re.height / Re.width, V = W(_, ee, Ae, K);
                return {
                  scale: V * 2 / Re.width,
                  rCenter: z(_, V / Ae),
                  rotate: Z(oe + Math.PI / 2)
                };
              }
              function z(Re, Ae) {
                return Math.cos(Ae) - Re * Ae;
              }
              function Z(Re) {
                return (180 / Math.PI * Re + 720) % 180 - 90;
              }
              function W(Re, Ae, K, ee) {
                var oe = Re + 1 / (2 * Math.tan(Ae));
                return K * Math.min(1 / (Math.sqrt(oe * oe + 0.5) + oe), ee / (Math.sqrt(Re * Re + ee / 2) + Re));
              }
              function q(Re, Ae) {
                return Re.v === Ae.vTotal && !Ae.trace.hole ? 1 : Math.min(1 / (1 + 1 / Math.sin(Re.halfangle)), Re.ring / 2);
              }
              function ie(Re, Ae) {
                var K = Ae.pxmid[0], ee = Ae.pxmid[1], oe = Re.width / 2, _ = Re.height / 2;
                return K < 0 && (oe *= -1), ee < 0 && (_ *= -1), {
                  scale: 1,
                  rCenter: 1,
                  rotate: 0,
                  x: oe + Math.abs(_) * (oe > 0 ? 1 : -1) / 2,
                  y: _ / (1 + K * K / (ee * ee)),
                  outside: !0
                };
              }
              function ce(Re) {
                var Ae = Math.sqrt(Re.titleBox.width * Re.titleBox.width + Re.titleBox.height * Re.titleBox.height);
                return {
                  x: Re.cx,
                  y: Re.cy,
                  scale: Re.trace.hole * Re.r * 2 / Ae,
                  tx: 0,
                  ty: -Re.titleBox.height / 2 + Re.trace.title.font.size
                };
              }
              function X(Re, Ae) {
                var K = 1, ee = 1, oe, _ = Re.trace, V = {
                  x: Re.cx,
                  y: Re.cy
                }, fe = {
                  tx: 0,
                  ty: 0
                };
                fe.ty += _.title.font.size, oe = se(_), _.title.position.indexOf("top") !== -1 ? (V.y -= (1 + oe) * Re.r, fe.ty -= Re.titleBox.height) : _.title.position.indexOf("bottom") !== -1 && (V.y += (1 + oe) * Re.r);
                var $ = U(Re.r, Re.trace.aspectratio), he = Ae.w * (_.domain.x[1] - _.domain.x[0]) / 2;
                return _.title.position.indexOf("left") !== -1 ? (he = he + $, V.x -= (1 + oe) * $, fe.tx += Re.titleBox.width / 2) : _.title.position.indexOf("center") !== -1 ? he *= 2 : _.title.position.indexOf("right") !== -1 && (he = he + $, V.x += (1 + oe) * $, fe.tx -= Re.titleBox.width / 2), K = he / Re.titleBox.width, ee = ne(Re, Ae) / Re.titleBox.height, {
                  x: V.x,
                  y: V.y,
                  scale: Math.min(K, ee),
                  tx: fe.tx,
                  ty: fe.ty
                };
              }
              function U(Re, Ae) {
                return Re / (Ae === void 0 ? 1 : Ae);
              }
              function ne(Re, Ae) {
                var K = Re.trace, ee = Ae.h * (K.domain.y[1] - K.domain.y[0]);
                return Math.min(Re.titleBox.height, ee / 2);
              }
              function se(Re) {
                var Ae = Re.pull;
                if (!Ae) return 0;
                var K;
                if (y.isArrayOrTypedArray(Ae))
                  for (Ae = 0, K = 0; K < Re.pull.length; K++)
                    Re.pull[K] > Ae && (Ae = Re.pull[K]);
                return Ae;
              }
              function le(Re, Ae) {
                var K, ee, oe, _, V, fe, $, he, me, xe, Fe, Ve, Be;
                function Je(Ne, Ie) {
                  return Ne.pxmid[1] - Ie.pxmid[1];
                }
                function et(Ne, Ie) {
                  return Ie.pxmid[1] - Ne.pxmid[1];
                }
                function at(Ne, Ie) {
                  Ie || (Ie = {});
                  var Ue = Ie.labelExtraY + (ee ? Ie.yLabelMax : Ie.yLabelMin), ot = ee ? Ne.yLabelMin : Ne.yLabelMax, ct = ee ? Ne.yLabelMax : Ne.yLabelMin, Tt = Ne.cyFinal + V(Ne.px0[1], Ne.px1[1]), kt = Ue - ot, Ot, Rt, xt, Wt, bt, jt;
                  if (kt * $ > 0 && (Ne.labelExtraY = kt), !!y.isArrayOrTypedArray(Ae.pull))
                    for (Rt = 0; Rt < xe.length; Rt++)
                      xt = xe[Rt], !(xt === Ne || (T.castOption(Ae.pull, Ne.pts) || 0) >= (T.castOption(Ae.pull, xt.pts) || 0)) && ((Ne.pxmid[1] - xt.pxmid[1]) * $ > 0 ? (Wt = xt.cyFinal + V(xt.px0[1], xt.px1[1]), kt = Wt - ot - Ne.labelExtraY, kt * $ > 0 && (Ne.labelExtraY += kt)) : (ct + Ne.labelExtraY - Tt) * $ > 0 && (Ot = 3 * fe * Math.abs(Rt - xe.indexOf(Ne)), bt = xt.cxFinal + _(xt.px0[0], xt.px1[0]), jt = bt + Ot - (Ne.cxFinal + Ne.pxmid[0]) - Ne.labelExtraX, jt * fe > 0 && (Ne.labelExtraX += jt)));
                }
                for (ee = 0; ee < 2; ee++)
                  for (oe = ee ? Je : et, V = ee ? Math.max : Math.min, $ = ee ? 1 : -1, K = 0; K < 2; K++) {
                    for (_ = K ? Math.max : Math.min, fe = K ? 1 : -1, he = Re[ee][K], he.sort(oe), me = Re[1 - ee][K], xe = me.concat(he), Ve = [], Fe = 0; Fe < he.length; Fe++)
                      he[Fe].yLabelMid !== void 0 && Ve.push(he[Fe]);
                    for (Be = !1, Fe = 0; ee && Fe < me.length; Fe++)
                      if (me[Fe].yLabelMid !== void 0) {
                        Be = me[Fe];
                        break;
                      }
                    for (Fe = 0; Fe < Ve.length; Fe++) {
                      var De = Fe && Ve[Fe - 1];
                      Be && !Fe && (De = Be), at(Ve[Fe], De);
                    }
                  }
              }
              function ue(Re, Ae) {
                for (var K = [], ee = 0; ee < Re.length; ee++) {
                  var oe = Re[ee][0], _ = oe.trace, V = _.domain, fe = Ae.w * (V.x[1] - V.x[0]), $ = Ae.h * (V.y[1] - V.y[0]);
                  _.title.text && _.title.position !== "middle center" && ($ -= ne(oe, Ae));
                  var he = fe / 2, me = $ / 2;
                  _.type === "funnelarea" && !_.scalegroup && (me /= _.aspectratio), oe.r = Math.min(he, me) / (1 + se(_)), oe.cx = Ae.l + Ae.w * (_.domain.x[1] + _.domain.x[0]) / 2, oe.cy = Ae.t + Ae.h * (1 - _.domain.y[0]) - $ / 2, _.title.text && _.title.position.indexOf("bottom") !== -1 && (oe.cy -= ne(oe, Ae)), _.scalegroup && K.indexOf(_.scalegroup) === -1 && K.push(_.scalegroup);
                }
                ve(Re, K);
              }
              function ve(Re, Ae) {
                for (var K, ee, oe, _ = 0; _ < Ae.length; _++) {
                  var V = 1 / 0, fe = Ae[_];
                  for (ee = 0; ee < Re.length; ee++)
                    if (K = Re[ee][0], oe = K.trace, oe.scalegroup === fe) {
                      var $;
                      if (oe.type === "pie")
                        $ = K.r * K.r;
                      else if (oe.type === "funnelarea") {
                        var he, me;
                        oe.aspectratio > 1 ? (he = K.r, me = he / oe.aspectratio) : (me = K.r, he = me * oe.aspectratio), he *= (1 + oe.baseratio) / 2, $ = he * me;
                      }
                      V = Math.min(V, $ / K.vTotal);
                    }
                  for (ee = 0; ee < Re.length; ee++)
                    if (K = Re[ee][0], oe = K.trace, oe.scalegroup === fe) {
                      var xe = V * K.vTotal;
                      oe.type === "funnelarea" && (xe /= (1 + oe.baseratio) / 2, xe /= oe.aspectratio), K.r = Math.sqrt(xe);
                    }
                }
              }
              function be(Re) {
                var Ae = Re[0], K = Ae.r, ee = Ae.trace, oe = T.getRotationAngle(ee.rotation), _ = 2 * Math.PI / Ae.vTotal, V = "px0", fe = "px1", $, he, me;
                if (ee.direction === "counterclockwise") {
                  for ($ = 0; $ < Re.length && Re[$].hidden; $++)
                    ;
                  if ($ === Re.length) return;
                  oe += _ * Re[$].v, _ *= -1, V = "px1", fe = "px0";
                }
                for (me = Me(K, oe), $ = 0; $ < Re.length; $++)
                  he = Re[$], !he.hidden && (he[V] = me, he.startangle = oe, oe += _ * he.v / 2, he.pxmid = Me(K, oe), he.midangle = oe, oe += _ * he.v / 2, me = Me(K, oe), he.stopangle = oe, he[fe] = me, he.largeArc = he.v > Ae.vTotal / 2 ? 1 : 0, he.halfangle = Math.PI * Math.min(he.v / Ae.vTotal, 0.5), he.ring = 1 - ee.hole, he.rInscribed = q(he, Ae));
              }
              function Me(Re, Ae) {
                return [Re * Math.sin(Ae), -Re * Math.cos(Ae)];
              }
              function Ge(Re, Ae, K) {
                var ee = Re._fullLayout, oe = K.trace, _ = oe.texttemplate, V = oe.textinfo;
                if (!_ && V && V !== "none") {
                  var fe = V.split("+"), $ = function(Ie) {
                    return fe.indexOf(Ie) !== -1;
                  }, he = $("label"), me = $("text"), xe = $("value"), Fe = $("percent"), Ve = ee.separators, Be;
                  if (Be = he ? [Ae.label] : [], me) {
                    var Je = T.getFirstFilled(oe.text, Ae.pts);
                    P(Je) && Be.push(Je);
                  }
                  xe && Be.push(T.formatPieValue(Ae.v, Ve)), Fe && Be.push(T.formatPiePercent(Ae.v / K.vTotal, Ve)), Ae.text = Be.join("<br>");
                }
                function et(Ie) {
                  return {
                    label: Ie.label,
                    value: Ie.v,
                    valueLabel: T.formatPieValue(Ie.v, ee.separators),
                    percent: Ie.v / K.vTotal,
                    percentLabel: T.formatPiePercent(Ie.v / K.vTotal, ee.separators),
                    color: Ie.color,
                    text: Ie.text,
                    customdata: y.castOption(oe, Ie.i, "customdata")
                  };
                }
                if (_) {
                  var at = y.castOption(oe, Ae.i, "texttemplate");
                  if (!at)
                    Ae.text = "";
                  else {
                    var De = et(Ae), Ne = T.getFirstFilled(oe.text, Ae.pts);
                    (P(Ne) || Ne === "") && (De.text = Ne), Ae.text = y.texttemplateString(at, De, Re._fullLayout._d3locale, De, oe._meta || {});
                  }
                }
              }
              function we(Re, Ae) {
                var K = Re.rotate * Math.PI / 180, ee = Math.cos(K), oe = Math.sin(K), _ = (Ae.left + Ae.right) / 2, V = (Ae.top + Ae.bottom) / 2;
                Re.textX = _ * ee - V * oe, Re.textY = _ * oe + V * ee, Re.noCenter = !0;
              }
              s.exports = {
                plot: k,
                formatSliceLabel: Ge,
                transformInsideText: Y,
                determineInsideTextFont: O,
                positionTitleOutside: X,
                prerenderTitles: N,
                layoutAreas: ue,
                attachFxHandlers: L,
                computeTransform: we
              };
            }
          ),
          /***/
          2152: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(528), f = i(2744).resizeText;
              s.exports = function(g) {
                var y = g._fullLayout._pielayer.selectAll(".trace");
                f(g, y, "pie"), y.each(function(C) {
                  var m = C[0], h = m.trace, w = l.select(this);
                  w.style({
                    opacity: h.opacity
                  }), w.selectAll("path.surface").each(function(S) {
                    l.select(this).call(v, S, h, g);
                  });
                });
              };
            }
          ),
          /***/
          528: (
            /***/
            function(s, c, i) {
              var l = i(6308), v = i(9656).castOption, f = i(1552);
              s.exports = function(g, y, C, m) {
                var h = C.marker.line, w = v(h.color, y.pts) || l.defaultLine, S = v(h.width, y.pts) || 0;
                g.call(f, y, C, m).style("stroke-width", S).call(l.stroke, w);
              };
            }
          ),
          /***/
          148: (
            /***/
            function(s, c, i) {
              var l = i(3400);
              s.exports = function(f, p) {
                for (var g = 0; g < f.length; g++) f[g].i = g;
                l.mergeArray(p.text, f, "tx"), l.mergeArray(p.texttemplate, f, "txt"), l.mergeArray(p.hovertext, f, "htx"), l.mergeArray(p.customdata, f, "data"), l.mergeArray(p.textposition, f, "tp"), p.textfont && (l.mergeArrayCastPositive(p.textfont.size, f, "ts"), l.mergeArray(p.textfont.color, f, "tc"), l.mergeArray(p.textfont.family, f, "tf"), l.mergeArray(p.textfont.weight, f, "tw"), l.mergeArray(p.textfont.style, f, "ty"), l.mergeArray(p.textfont.variant, f, "tv"), l.mergeArray(p.textfont.textcase, f, "tC"), l.mergeArray(p.textfont.lineposition, f, "tE"), l.mergeArray(p.textfont.shadow, f, "tS"));
                var y = p.marker;
                if (y) {
                  l.mergeArrayCastPositive(y.size, f, "ms"), l.mergeArrayCastPositive(y.opacity, f, "mo"), l.mergeArray(y.symbol, f, "mx"), l.mergeArray(y.angle, f, "ma"), l.mergeArray(y.standoff, f, "mf"), l.mergeArray(y.color, f, "mc");
                  var C = y.line;
                  y.line && (l.mergeArray(C.color, f, "mlc"), l.mergeArrayCastPositive(C.width, f, "mlw"));
                  var m = y.gradient;
                  m && m.type !== "none" && (l.mergeArray(m.type, f, "mgt"), l.mergeArray(m.color, f, "mgc"));
                }
              };
            }
          ),
          /***/
          2904: (
            /***/
            function(s, c, i) {
              var l = i(9736).axisHoverFormat, v = i(1776).Gw, f = i(1776).Ks, p = i(9084), g = i(5376), y = i(8192).u, C = i(8192).c, m = i(3616), h = i(8200), w = i(2880).extendFlat, S = i(3544);
              function E(F) {
                return {
                  valType: "any",
                  dflt: 0,
                  editType: "calc"
                };
              }
              function x(F) {
                return {
                  valType: "any",
                  editType: "calc"
                };
              }
              function T(F) {
                return {
                  valType: "enumerated",
                  values: ["start", "middle", "end"],
                  dflt: "middle",
                  editType: "calc"
                };
              }
              s.exports = {
                x: {
                  valType: "data_array",
                  editType: "calc+clearAxisTypes",
                  anim: !0
                },
                x0: {
                  valType: "any",
                  dflt: 0,
                  editType: "calc+clearAxisTypes",
                  anim: !0
                },
                dx: {
                  valType: "number",
                  dflt: 1,
                  editType: "calc",
                  anim: !0
                },
                y: {
                  valType: "data_array",
                  editType: "calc+clearAxisTypes",
                  anim: !0
                },
                y0: {
                  valType: "any",
                  dflt: 0,
                  editType: "calc+clearAxisTypes",
                  anim: !0
                },
                dy: {
                  valType: "number",
                  dflt: 1,
                  editType: "calc",
                  anim: !0
                },
                xperiod: E(),
                yperiod: E(),
                xperiod0: x(),
                yperiod0: x(),
                xperiodalignment: T(),
                yperiodalignment: T(),
                xhoverformat: l("x"),
                yhoverformat: l("y"),
                offsetgroup: {
                  valType: "string",
                  dflt: "",
                  editType: "calc"
                },
                alignmentgroup: {
                  valType: "string",
                  dflt: "",
                  editType: "calc"
                },
                stackgroup: {
                  valType: "string",
                  dflt: "",
                  editType: "calc"
                },
                orientation: {
                  valType: "enumerated",
                  values: ["v", "h"],
                  editType: "calc"
                },
                groupnorm: {
                  valType: "enumerated",
                  values: ["", "fraction", "percent"],
                  dflt: "",
                  editType: "calc"
                },
                stackgaps: {
                  valType: "enumerated",
                  values: ["infer zero", "interpolate"],
                  dflt: "infer zero",
                  editType: "calc"
                },
                text: {
                  valType: "string",
                  dflt: "",
                  arrayOk: !0,
                  editType: "calc"
                },
                texttemplate: v({}, {}),
                hovertext: {
                  valType: "string",
                  dflt: "",
                  arrayOk: !0,
                  editType: "style"
                },
                mode: {
                  valType: "flaglist",
                  flags: ["lines", "markers", "text"],
                  extras: ["none"],
                  editType: "calc"
                },
                hoveron: {
                  valType: "flaglist",
                  flags: ["points", "fills"],
                  editType: "style"
                },
                hovertemplate: f({}, {
                  keys: h.eventDataKeys
                }),
                line: {
                  color: {
                    valType: "color",
                    editType: "style",
                    anim: !0
                  },
                  width: {
                    valType: "number",
                    min: 0,
                    dflt: 2,
                    editType: "style",
                    anim: !0
                  },
                  shape: {
                    valType: "enumerated",
                    values: ["linear", "spline", "hv", "vh", "hvh", "vhv"],
                    dflt: "linear",
                    editType: "plot"
                  },
                  smoothing: {
                    valType: "number",
                    min: 0,
                    max: 1.3,
                    dflt: 1,
                    editType: "plot"
                  },
                  dash: w({}, y, {
                    editType: "style"
                  }),
                  backoff: {
                    // we want to have a similar option for the start of the line
                    valType: "number",
                    min: 0,
                    dflt: "auto",
                    arrayOk: !0,
                    editType: "plot"
                  },
                  simplify: {
                    valType: "boolean",
                    dflt: !0,
                    editType: "plot"
                  },
                  editType: "plot"
                },
                connectgaps: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "calc"
                },
                cliponaxis: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "plot"
                },
                fill: {
                  valType: "enumerated",
                  values: ["none", "tozeroy", "tozerox", "tonexty", "tonextx", "toself", "tonext"],
                  editType: "calc"
                },
                fillcolor: S(!0),
                fillgradient: w({
                  type: {
                    valType: "enumerated",
                    values: ["radial", "horizontal", "vertical", "none"],
                    dflt: "none",
                    editType: "calc"
                  },
                  start: {
                    valType: "number",
                    editType: "calc"
                  },
                  stop: {
                    valType: "number",
                    editType: "calc"
                  },
                  colorscale: {
                    valType: "colorscale",
                    editType: "style"
                  },
                  editType: "calc"
                }),
                fillpattern: C,
                marker: w({
                  symbol: {
                    valType: "enumerated",
                    values: m.symbolList,
                    dflt: "circle",
                    arrayOk: !0,
                    editType: "style"
                  },
                  opacity: {
                    valType: "number",
                    min: 0,
                    max: 1,
                    arrayOk: !0,
                    editType: "style",
                    anim: !0
                  },
                  angle: {
                    valType: "angle",
                    dflt: 0,
                    arrayOk: !0,
                    editType: "plot",
                    anim: !1
                    // TODO: possibly set to true in future
                  },
                  angleref: {
                    valType: "enumerated",
                    values: ["previous", "up"],
                    dflt: "up",
                    editType: "plot",
                    anim: !1
                  },
                  standoff: {
                    valType: "number",
                    min: 0,
                    dflt: 0,
                    arrayOk: !0,
                    editType: "plot",
                    anim: !0
                  },
                  size: {
                    valType: "number",
                    min: 0,
                    dflt: 6,
                    arrayOk: !0,
                    editType: "calc",
                    anim: !0
                  },
                  maxdisplayed: {
                    valType: "number",
                    min: 0,
                    dflt: 0,
                    editType: "plot"
                  },
                  sizeref: {
                    valType: "number",
                    dflt: 1,
                    editType: "calc"
                  },
                  sizemin: {
                    valType: "number",
                    min: 0,
                    dflt: 0,
                    editType: "calc"
                  },
                  sizemode: {
                    valType: "enumerated",
                    values: ["diameter", "area"],
                    dflt: "diameter",
                    editType: "calc"
                  },
                  line: w({
                    width: {
                      valType: "number",
                      min: 0,
                      arrayOk: !0,
                      editType: "style",
                      anim: !0
                    },
                    editType: "calc"
                  }, p("marker.line", {
                    anim: !0
                  })),
                  gradient: {
                    type: {
                      valType: "enumerated",
                      values: ["radial", "horizontal", "vertical", "none"],
                      arrayOk: !0,
                      dflt: "none",
                      editType: "calc"
                    },
                    color: {
                      valType: "color",
                      arrayOk: !0,
                      editType: "calc"
                    },
                    editType: "calc"
                  },
                  editType: "calc"
                }, p("marker", {
                  anim: !0
                })),
                selected: {
                  marker: {
                    opacity: {
                      valType: "number",
                      min: 0,
                      max: 1,
                      editType: "style"
                    },
                    color: {
                      valType: "color",
                      editType: "style"
                    },
                    size: {
                      valType: "number",
                      min: 0,
                      editType: "style"
                    },
                    editType: "style"
                  },
                  textfont: {
                    color: {
                      valType: "color",
                      editType: "style"
                    },
                    editType: "style"
                  },
                  editType: "style"
                },
                unselected: {
                  marker: {
                    opacity: {
                      valType: "number",
                      min: 0,
                      max: 1,
                      editType: "style"
                    },
                    color: {
                      valType: "color",
                      editType: "style"
                    },
                    size: {
                      valType: "number",
                      min: 0,
                      editType: "style"
                    },
                    editType: "style"
                  },
                  textfont: {
                    color: {
                      valType: "color",
                      editType: "style"
                    },
                    editType: "style"
                  },
                  editType: "style"
                },
                textposition: {
                  valType: "enumerated",
                  values: ["top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right"],
                  dflt: "middle center",
                  arrayOk: !0,
                  editType: "calc"
                },
                textfont: g({
                  editType: "calc",
                  colorEditType: "style",
                  arrayOk: !0
                }),
                zorder: {
                  valType: "integer",
                  dflt: 0,
                  editType: "plot"
                }
              };
            }
          ),
          /***/
          6356: (
            /***/
            function(s, c, i) {
              var l = i(8248), v = i(3400), f = i(4460), p = i(1220), g = i(9032).BADNUM, y = i(3028), C = i(136), m = i(148), h = i(4500);
              function w(P, k) {
                var I = P._fullLayout, L = k._xA = f.getFromId(P, k.xaxis || "x", "x"), A = k._yA = f.getFromId(P, k.yaxis || "y", "y"), O = L.makeCalcdata(k, "x"), N = A.makeCalcdata(k, "y"), Y = p(k, L, "x", O), j = p(k, A, "y", N), te = Y.vals, re = j.vals, z = k._length, Z = new Array(z), W = k.ids, q = F(k, I, L, A), ie = !1, ce, X, U, ne, se, le;
                x(I, k);
                var ue = "x", ve = "y", be;
                if (q)
                  v.pushUnique(q.traceIndices, k._expandedIndex), ce = q.orientation === "v", ce ? (ve = "s", be = "x") : (ue = "s", be = "y"), se = q.stackgaps === "interpolate";
                else {
                  var Me = E(k, z);
                  S(P, k, L, A, te, re, Me);
                }
                var Ge = !!k.xperiodalignment, we = !!k.yperiodalignment;
                for (X = 0; X < z; X++) {
                  var Re = Z[X] = {}, Ae = l(te[X]), K = l(re[X]);
                  Ae && K ? (Re[ue] = te[X], Re[ve] = re[X], Ge && (Re.orig_x = O[X], Re.xEnd = Y.ends[X], Re.xStart = Y.starts[X]), we && (Re.orig_y = N[X], Re.yEnd = j.ends[X], Re.yStart = j.starts[X])) : q && (ce ? Ae : K) ? (Re[be] = ce ? te[X] : re[X], Re.gap = !0, se ? (Re.s = g, ie = !0) : Re.s = 0) : Re[ue] = Re[ve] = g, W && (Re.id = String(W[X]));
                }
                if (m(Z, k), C(P, k), h(Z, k), q) {
                  for (X = 0; X < Z.length; )
                    Z[X][be] === g ? Z.splice(X, 1) : X++;
                  if (v.sort(Z, function(V, fe) {
                    return V[be] - fe[be] || V.i - fe.i;
                  }), ie) {
                    for (X = 0; X < Z.length - 1 && Z[X].gap; )
                      X++;
                    for (le = Z[X].s, le || (le = Z[X].s = 0), U = 0; U < X; U++)
                      Z[U].s = le;
                    for (ne = Z.length - 1; ne > X && Z[ne].gap; )
                      ne--;
                    for (le = Z[ne].s, U = Z.length - 1; U > ne; U--)
                      Z[U].s = le;
                    for (; X < ne; )
                      if (X++, Z[X].gap) {
                        for (U = X + 1; Z[U].gap; )
                          U++;
                        for (var ee = Z[X - 1][be], oe = Z[X - 1].s, _ = (Z[U].s - oe) / (Z[U][be] - ee); X < U; )
                          Z[X].s = oe + (Z[X][be] - ee) * _, X++;
                      }
                  }
                }
                return Z;
              }
              function S(P, k, I, L, A, O, N) {
                var Y = k._length, j = P._fullLayout, te = I._id, re = L._id, z = j._firstScatter[T(k)] === k.uid, Z = (F(k, j, I, L) || {}).orientation, W = k.fill;
                I._minDtick = 0, L._minDtick = 0;
                var q = {
                  padded: !0
                }, ie = {
                  padded: !0
                };
                N && (q.ppad = ie.ppad = N);
                var ce = Y < 2 || A[0] !== A[Y - 1] || O[0] !== O[Y - 1];
                ce && (W === "tozerox" || W === "tonextx" && (z || Z === "h")) ? q.tozero = !0 : !(k.error_y || {}).visible && // if no error bars, markers or text, or fill to y=0 remove x padding
                (W === "tonexty" || W === "tozeroy" || !y.hasMarkers(k) && !y.hasText(k)) && (q.padded = !1, q.ppad = 0), ce && (W === "tozeroy" || W === "tonexty" && (z || Z === "v")) ? ie.tozero = !0 : (W === "tonextx" || W === "tozerox") && (ie.padded = !1), te && (k._extremes[te] = f.findExtremes(I, A, q)), re && (k._extremes[re] = f.findExtremes(L, O, ie));
              }
              function E(P, k) {
                if (y.hasMarkers(P)) {
                  var I = P.marker, L = 1.6 * (P.marker.sizeref || 1), A;
                  if (P.marker.sizemode === "area" ? A = function(te) {
                    return Math.max(Math.sqrt((te || 0) / L), 3);
                  } : A = function(te) {
                    return Math.max((te || 0) / L, 3);
                  }, v.isArrayOrTypedArray(I.size)) {
                    var O = {
                      type: "linear"
                    };
                    f.setConvert(O);
                    for (var N = O.makeCalcdata(P.marker, "size"), Y = new Array(k), j = 0; j < k; j++)
                      Y[j] = A(N[j]);
                    return Y;
                  } else
                    return A(I.size);
                }
              }
              function x(P, k) {
                var I = T(k), L = P._firstScatter;
                L[I] || (L[I] = k.uid);
              }
              function T(P) {
                var k = P.stackgroup;
                return P.xaxis + P.yaxis + P.type + (k ? "-" + k : "");
              }
              function F(P, k, I, L) {
                var A = P.stackgroup;
                if (A) {
                  var O = k._scatterStackOpts[I._id + L._id][A], N = O.orientation === "v" ? L : I;
                  if (N.type === "linear" || N.type === "log") return O;
                }
              }
              s.exports = {
                calc: w,
                calcMarkerSize: E,
                calcAxisExpansion: S,
                setFirstScatter: x,
                getStackOpts: F
              };
            }
          ),
          /***/
          4500: (
            /***/
            function(s, c, i) {
              var l = i(3400);
              s.exports = function(f, p) {
                l.isArrayOrTypedArray(p.selectedpoints) && l.tagSelected(f, p);
              };
            }
          ),
          /***/
          136: (
            /***/
            function(s, c, i) {
              var l = i(4288).hasColorscale, v = i(7128), f = i(3028);
              s.exports = function(g, y) {
                f.hasLines(y) && l(y, "line") && v(g, y, {
                  vals: y.line.color,
                  containerStr: "line",
                  cLetter: "c"
                }), f.hasMarkers(y) && (l(y, "marker") && v(g, y, {
                  vals: y.marker.color,
                  containerStr: "marker",
                  cLetter: "c"
                }), l(y, "marker.line") && v(g, y, {
                  vals: y.marker.line.color,
                  containerStr: "marker.line",
                  cLetter: "c"
                }));
              };
            }
          ),
          /***/
          8200: (
            /***/
            function(s) {
              s.exports = {
                PTS_LINESONLY: 20,
                // fixed parameters of clustering and clipping algorithms
                // fraction of clustering tolerance "so close we don't even consider it a new point"
                minTolerance: 0.2,
                // how fast does clustering tolerance increase as you get away from the visible region
                toleranceGrowth: 10,
                // number of viewport sizes away from the visible region
                // at which we clip all lines to the perimeter
                maxScreensAway: 20,
                eventDataKeys: []
              };
            }
          ),
          /***/
          6664: (
            /***/
            function(s, c, i) {
              var l = i(6356), v = i(6376).setGroupPositions;
              function f(y, C) {
                for (var m = C.xaxis, h = C.yaxis, w = y._fullLayout, S = y._fullData, E = y.calcdata, x = [], T = [], F = 0; F < S.length; F++) {
                  var P = S[F];
                  P.visible === !0 && P.type === "scatter" && P.xaxis === m._id && P.yaxis === h._id && (P.orientation === "h" ? x.push(E[F]) : P.orientation === "v" && T.push(E[F]));
                }
                var k = {
                  mode: w.scattermode,
                  gap: w.scattergap
                };
                v(y, m, h, T, k), v(y, h, m, x, k);
              }
              s.exports = function(C, m) {
                C._fullLayout.scattermode === "group" && f(C, m);
                var h = m.xaxis, w = m.yaxis, S = h._id + w._id, E = C._fullLayout._scatterStackOpts[S];
                if (E) {
                  var x = C.calcdata, T, F, P, k, I, L, A, O, N, Y, j, te, re, z, Z;
                  for (var W in E) {
                    Y = E[W];
                    var q = Y.traceIndices;
                    if (q.length) {
                      for (j = Y.stackgaps === "interpolate", te = Y.groupnorm, Y.orientation === "v" ? (re = "x", z = "y") : (re = "y", z = "x"), Z = new Array(q.length), T = 0; T < Z.length; T++)
                        Z[T] = !1;
                      L = x[q[0]];
                      var ie = new Array(L.length);
                      for (T = 0; T < L.length; T++)
                        ie[T] = L[T][re];
                      for (T = 1; T < q.length; T++) {
                        for (I = x[q[T]], F = P = 0; F < I.length; F++) {
                          for (A = I[F][re]; A > ie[P] && P < ie.length; P++)
                            p(I, F, ie[P], T, Z, j, re), F++;
                          if (A !== ie[P]) {
                            for (k = 0; k < T; k++)
                              p(x[q[k]], P, A, k, Z, j, re);
                            ie.splice(P, 0, A);
                          }
                          P++;
                        }
                        for (; P < ie.length; P++)
                          p(I, F, ie[P], T, Z, j, re), F++;
                      }
                      var ce = ie.length;
                      for (F = 0; F < L.length; F++) {
                        for (O = L[F][z] = L[F].s, T = 1; T < q.length; T++)
                          I = x[q[T]], I[0].trace._rawLength = I[0].trace._length, I[0].trace._length = ce, O += I[F].s, I[F][z] = O;
                        if (te)
                          for (N = (te === "fraction" ? O : O / 100) || 1, T = 0; T < q.length; T++) {
                            var X = x[q[T]][F];
                            X[z] /= N, X.sNorm = X.s / N;
                          }
                      }
                      for (T = 0; T < q.length; T++) {
                        I = x[q[T]];
                        var U = I[0].trace, ne = l.calcMarkerSize(U, U._rawLength), se = Array.isArray(ne);
                        if (ne && Z[T] || se) {
                          var le = ne;
                          for (ne = new Array(ce), F = 0; F < ce; F++)
                            ne[F] = I[F].gap ? 0 : se ? le[I[F].i] : le;
                        }
                        var ue = new Array(ce), ve = new Array(ce);
                        for (F = 0; F < ce; F++)
                          ue[F] = I[F].x, ve[F] = I[F].y;
                        l.calcAxisExpansion(C, U, h, w, ue, ve, ne), I[0].t.orientation = Y.orientation;
                      }
                    }
                  }
                }
              };
              function p(y, C, m, h, w, S, E) {
                w[h] = !0;
                var x = {
                  i: null,
                  gap: !0,
                  s: 0
                };
                if (x[E] = m, y.splice(C, 0, x), C && m === y[C - 1][E]) {
                  var T = y[C - 1];
                  x.s = T.s, x.i = T.i, x.gap = T.gap;
                } else S && (x.s = g(y, C, m, E));
                C || (y[0].t = y[1].t, y[0].trace = y[1].trace, delete y[1].t, delete y[1].trace);
              }
              function g(y, C, m, h) {
                var w = y[C - 1], S = y[C + 1];
                return S ? w ? w.s + (S.s - w.s) * (m - w[h]) / (S[h] - w[h]) : S.s : w.s;
              }
            }
          ),
          /***/
          5036: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(11), f = i(2904);
              s.exports = function(g, y) {
                var C, m, h;
                function w(F) {
                  return l.coerce(m._input, m, f, F);
                }
                if (y.scattermode === "group")
                  for (h = 0; h < g.length; h++)
                    m = g[h], m.type === "scatter" && (C = m._input, v(C, m, y, w));
                for (h = 0; h < g.length; h++) {
                  var S = g[h];
                  if (S.type === "scatter") {
                    var E = S.fill;
                    if (!(E === "none" || E === "toself") && (S.opacity = void 0, E === "tonexty" || E === "tonextx"))
                      for (var x = h - 1; x >= 0; x--) {
                        var T = g[x];
                        if (T.type === "scatter" && T.xaxis === S.xaxis && T.yaxis === S.yaxis) {
                          T.opacity = void 0;
                          break;
                        }
                      }
                  }
                }
              };
            }
          ),
          /***/
          8800: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4040), f = i(2904), p = i(8200), g = i(3028), y = i(3980), C = i(1147), m = i(3912), h = i(4428), w = i(6828), S = i(1731), E = i(124), x = i(840), T = i(3400).coercePattern;
              s.exports = function(P, k, I, L) {
                function A(Z, W) {
                  return l.coerce(P, k, f, Z, W);
                }
                var O = y(P, k, L, A);
                if (O || (k.visible = !1), !!k.visible) {
                  C(P, k, L, A), A("xhoverformat"), A("yhoverformat"), A("zorder");
                  var N = m(P, k, L, A);
                  L.scattermode === "group" && k.orientation === void 0 && A("orientation", "v");
                  var Y = !N && O < p.PTS_LINESONLY ? "lines+markers" : "lines";
                  A("text"), A("hovertext"), A("mode", Y), g.hasMarkers(k) && h(P, k, I, L, A, {
                    gradient: !0
                  }), g.hasLines(k) && (w(P, k, I, L, A, {
                    backoff: !0
                  }), S(P, k, A), A("connectgaps"), A("line.simplify")), g.hasText(k) && (A("texttemplate"), E(P, k, L, A));
                  var j = [];
                  (g.hasMarkers(k) || g.hasText(k)) && (A("cliponaxis"), A("marker.maxdisplayed"), j.push("points")), A("fill", N ? N.fillDflt : "none"), k.fill !== "none" && (x(P, k, I, A, {
                    moduleHasFillgradient: !0
                  }), g.hasLines(k) || S(P, k, A), T(A, "fillpattern", k.fillcolor, !1));
                  var te = (k.line || {}).color, re = (k.marker || {}).color;
                  (k.fill === "tonext" || k.fill === "toself") && j.push("fills"), A("hoveron", j.join("+") || "points"), k.hoveron !== "fills" && A("hovertemplate");
                  var z = v.getComponentMethod("errorbars", "supplyDefaults");
                  z(P, k, te || re || I, {
                    axis: "y"
                  }), z(P, k, te || re || I, {
                    axis: "x",
                    inherit: "y"
                  }), l.coerceSelectionMarkerOpacity(k, A);
                }
              };
            }
          ),
          /***/
          3544: (
            /***/
            function(s) {
              s.exports = function(i) {
                return {
                  valType: "color",
                  editType: "style",
                  anim: !0
                };
              };
            }
          ),
          /***/
          840: (
            /***/
            function(s, c, i) {
              var l = i(6308), v = i(3400).isArrayOrTypedArray;
              function f(p) {
                for (var g = l.interpolate(p[0][1], p[1][1], 0.5), y = 2; y < p.length; y++) {
                  var C = l.interpolate(p[y - 1][1], p[y][1], 0.5);
                  g = l.interpolate(g, C, p[y - 1][0] / p[y][0]);
                }
                return g;
              }
              s.exports = function(g, y, C, m, h) {
                h || (h = {});
                var w = !1;
                if (y.marker) {
                  var S = y.marker.color, E = (y.marker.line || {}).color;
                  S && !v(S) ? w = S : E && !v(E) && (w = E);
                }
                var x;
                if (h.moduleHasFillgradient) {
                  var T = m("fillgradient.type");
                  if (T !== "none") {
                    m("fillgradient.start"), m("fillgradient.stop");
                    var F = m("fillgradient.colorscale");
                    F && (x = f(F));
                  }
                }
                m("fillcolor", l.addOpacity((y.line || {}).color || w || x || C, 0.5));
              };
            }
          ),
          /***/
          6688: (
            /***/
            function(s, c, i) {
              var l = i(4460);
              s.exports = function(f, p, g) {
                var y = {}, C = {
                  _fullLayout: g
                }, m = l.getFromTrace(C, p, "x"), h = l.getFromTrace(C, p, "y"), w = f.orig_x;
                w === void 0 && (w = f.x);
                var S = f.orig_y;
                return S === void 0 && (S = f.y), y.xLabel = l.tickText(m, m.c2l(w), !0).text, y.yLabel = l.tickText(h, h.c2l(S), !0).text, y;
              };
            }
          ),
          /***/
          4928: (
            /***/
            function(s, c, i) {
              var l = i(6308), v = i(3028);
              s.exports = function(p, g) {
                var y, C;
                if (p.mode === "lines")
                  return y = p.line.color, y && l.opacity(y) ? y : p.fillcolor;
                if (p.mode === "none")
                  return p.fill ? p.fillcolor : "";
                var m = g.mcc || (p.marker || {}).color, h = g.mlcc || ((p.marker || {}).line || {}).color;
                return C = m && l.opacity(m) ? m : h && l.opacity(h) && (g.mlw || ((p.marker || {}).line || {}).width) ? h : "", C ? l.opacity(C) < 0.3 ? l.addOpacity(C, 0.3) : C : (y = (p.line || {}).color, y && l.opacity(y) && v.hasLines(p) && p.line.width ? y : p.fillcolor);
              };
            }
          ),
          /***/
          11: (
            /***/
            function(s, c, i) {
              var l = i(1888).getAxisGroup;
              s.exports = function(f, p, g, y) {
                var C = p.orientation, m = p[{
                  v: "x",
                  h: "y"
                }[C] + "axis"], h = l(g, m) + C, w = g._alignmentOpts || {}, S = y("alignmentgroup"), E = w[h];
                E || (E = w[h] = {});
                var x = E[S];
                x ? x.traces.push(p) : x = E[S] = {
                  traces: [p],
                  alignmentIndex: Object.keys(E).length,
                  offsetGroups: {}
                };
                var T = y("offsetgroup"), F = x.offsetGroups, P = F[T];
                T && (P || (P = F[T] = {
                  offsetIndex: Object.keys(F).length
                }), p._offsetIndex = P.offsetIndex);
              };
            }
          ),
          /***/
          8723: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(3024), f = i(4040), p = i(4928), g = i(6308), y = l.fillText;
              s.exports = function(m, h, w, S) {
                var E = m.cd, x = E[0].trace, T = m.xa, F = m.ya, P = T.c2p(h), k = F.c2p(w), I = [P, k], L = x.hoveron || "", A = x.mode.indexOf("markers") !== -1 ? 3 : 0.5, O = !!x.xperiodalignment, N = !!x.yperiodalignment;
                if (L.indexOf("points") !== -1) {
                  var Y = function(be) {
                    if (O) {
                      var Me = T.c2p(be.xStart), Ge = T.c2p(be.xEnd);
                      return P >= Math.min(Me, Ge) && P <= Math.max(Me, Ge) ? 0 : 1 / 0;
                    }
                    var we = Math.max(3, be.mrc || 0), Re = 1 - 1 / we, Ae = Math.abs(T.c2p(be.x) - P);
                    return Ae < we ? Re * Ae / we : Ae - we + Re;
                  }, j = function(be) {
                    if (N) {
                      var Me = F.c2p(be.yStart), Ge = F.c2p(be.yEnd);
                      return k >= Math.min(Me, Ge) && k <= Math.max(Me, Ge) ? 0 : 1 / 0;
                    }
                    var we = Math.max(3, be.mrc || 0), Re = 1 - 1 / we, Ae = Math.abs(F.c2p(be.y) - k);
                    return Ae < we ? Re * Ae / we : Ae - we + Re;
                  }, te = function(be) {
                    var Me = Math.max(A, be.mrc || 0), Ge = T.c2p(be.x) - P, we = F.c2p(be.y) - k;
                    return Math.max(Math.sqrt(Ge * Ge + we * we) - Me, 1 - A / Me);
                  }, re = v.getDistanceFunction(S, Y, j, te);
                  if (v.getClosest(E, re, m), m.index !== !1) {
                    var z = E[m.index], Z = T.c2p(z.x, !0), W = F.c2p(z.y, !0), q = z.mrc || 1;
                    m.index = z.i;
                    var ie = E[0].t.orientation, ce = ie && (z.sNorm || z.s), X = ie === "h" ? ce : z.orig_x !== void 0 ? z.orig_x : z.x, U = ie === "v" ? ce : z.orig_y !== void 0 ? z.orig_y : z.y;
                    return l.extendFlat(m, {
                      color: p(x, z),
                      x0: Z - q,
                      x1: Z + q,
                      xLabelVal: X,
                      y0: W - q,
                      y1: W + q,
                      yLabelVal: U,
                      spikeDistance: te(z),
                      hovertemplate: x.hovertemplate
                    }), y(z, x, m), f.getComponentMethod("errorbars", "hoverInfo")(z, x, m), [m];
                  }
                }
                function ne(be) {
                  if (!be)
                    return !1;
                  var Me = be.node();
                  try {
                    var Ge = new DOMPoint(I[0], I[1]);
                    return Me.isPointInFill(Ge);
                  } catch {
                    var we = Me.ownerSVGElement.createSVGPoint();
                    return we.x = I[0], we.y = I[1], Me.isPointInFill(we);
                  }
                }
                function se(be) {
                  var Me, Ge = [], we = 1 / 0, Re = -1 / 0, Ae = 1 / 0, K = -1 / 0, ee;
                  for (Me = 0; Me < be.length; Me++) {
                    var oe = be[Me];
                    oe.contains(I) && (Ge.push(oe), Ae = Math.min(Ae, oe.ymin), K = Math.max(K, oe.ymax));
                  }
                  if (Ge.length === 0)
                    return null;
                  Ae = Math.max(Ae, 0), K = Math.min(K, F._length), ee = (Ae + K) / 2;
                  var _, V, fe, $, he, me, xe;
                  for (Me = 0; Me < Ge.length; Me++)
                    for (V = Ge[Me].pts, _ = 1; _ < V.length; _++)
                      me = V[_ - 1][1], xe = V[_][1], me > ee != xe >= ee && ($ = V[_ - 1][0], he = V[_][0], xe - me && (fe = $ + (he - $) * (ee - me) / (xe - me), we = Math.min(we, fe), Re = Math.max(Re, fe)));
                  return we = Math.max(we, 0), Re = Math.min(Re, T._length), {
                    x0: we,
                    x1: Re,
                    y0: ee,
                    y1: ee
                  };
                }
                if (L.indexOf("fills") !== -1 && x._fillElement) {
                  var le = ne(x._fillElement) && !ne(x._fillExclusionElement);
                  if (le) {
                    var ue = se(x._polygons);
                    ue === null && (ue = {
                      x0: I[0],
                      x1: I[0],
                      y0: I[1],
                      y1: I[1]
                    });
                    var ve = g.defaultLine;
                    return g.opacity(x.fillcolor) ? ve = x.fillcolor : g.opacity((x.line || {}).color) && (ve = x.line.color), l.extendFlat(m, {
                      // never let a 2D override 1D type as closest point
                      // also: no spikeDistance, it's not allowed for fills
                      distance: m.maxHoverDistance,
                      x0: ue.x0,
                      x1: ue.x1,
                      y0: ue.y0,
                      y1: ue.y1,
                      color: ve,
                      hovertemplate: !1
                    }), delete m.index, x.text && !l.isArrayOrTypedArray(x.text) ? m.text = String(x.text) : m.text = x.name, [m];
                  }
                }
              };
            }
          ),
          /***/
          5875: (
            /***/
            function(s, c, i) {
              var l = i(3028);
              s.exports = {
                hasLines: l.hasLines,
                hasMarkers: l.hasMarkers,
                hasText: l.hasText,
                isBubble: l.isBubble,
                attributes: i(2904),
                layoutAttributes: i(5308),
                supplyDefaults: i(8800),
                crossTraceDefaults: i(5036),
                supplyLayoutDefaults: i(9748),
                calc: i(6356).calc,
                crossTraceCalc: i(6664),
                arraysToCalcdata: i(148),
                plot: i(6504),
                colorbar: i(5528),
                formatLabels: i(6688),
                style: i(6844).style,
                styleOnSelect: i(6844).styleOnSelect,
                hoverPoints: i(8723),
                selectPoints: i(1560),
                animatable: !0,
                moduleType: "trace",
                name: "scatter",
                basePlotModule: i(7952),
                categories: ["cartesian", "svg", "symbols", "errorBarsOK", "showLegend", "scatter-like", "zoomScale"],
                meta: {}
              };
            }
          ),
          /***/
          5308: (
            /***/
            function(s) {
              s.exports = {
                scattermode: {
                  valType: "enumerated",
                  values: ["group", "overlay"],
                  dflt: "overlay",
                  editType: "calc"
                },
                scattergap: {
                  valType: "number",
                  min: 0,
                  max: 1,
                  editType: "calc"
                }
              };
            }
          ),
          /***/
          9748: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(5308);
              s.exports = function(f, p) {
                function g(C, m) {
                  return l.coerce(f, p, v, C, m);
                }
                var y = p.barmode === "group";
                p.scattermode === "group" && g("scattergap", y ? p.bargap : 0.2);
              };
            }
          ),
          /***/
          6828: (
            /***/
            function(s, c, i) {
              var l = i(3400).isArrayOrTypedArray, v = i(4288).hasColorscale, f = i(7260);
              s.exports = function(g, y, C, m, h, w) {
                w || (w = {});
                var S = (g.marker || {}).color;
                if (S && S._inputArray && (S = S._inputArray), h("line.color", C), v(g, "line"))
                  f(g, y, m, h, {
                    prefix: "line.",
                    cLetter: "c"
                  });
                else {
                  var E = (l(S) ? !1 : S) || C;
                  h("line.color", E);
                }
                h("line.width"), w.noDash || h("line.dash"), w.backoff && h("line.backoff");
              };
            }
          ),
          /***/
          2340: (
            /***/
            function(s, c, i) {
              var l = i(3616), v = i(9032), f = v.BADNUM, p = v.LOG_CLIP, g = p + 0.5, y = p - 0.5, C = i(3400), m = C.segmentsIntersect, h = C.constrain, w = i(8200);
              s.exports = function(E, x) {
                var T = x.trace || {}, F = x.xaxis, P = x.yaxis, k = F.type === "log", I = P.type === "log", L = F._length, A = P._length, O = x.backoff, N = T.marker, Y = x.connectGaps, j = x.baseTolerance, te = x.shape, re = te === "linear", z = T.fill && T.fill !== "none", Z = [], W = w.minTolerance, q = E.length, ie = new Array(q), ce = 0, X, U, ne, se, le, ue, ve, be, Me, Ge, we, Re, Ae, K, ee, oe;
                function _(nt) {
                  var it = E[nt];
                  if (!it) return !1;
                  var Nt = x.linearized ? F.l2p(it.x) : F.c2p(it.x), At = x.linearized ? P.l2p(it.y) : P.c2p(it.y);
                  if (Nt === f) {
                    if (k && (Nt = F.c2p(it.x, !0)), Nt === f) return !1;
                    I && At === f && (Nt *= Math.abs(F._m * A * (F._m > 0 ? g : y) / (P._m * L * (P._m > 0 ? g : y)))), Nt *= 1e3;
                  }
                  if (At === f) {
                    if (I && (At = P.c2p(it.y, !0)), At === f) return !1;
                    At *= 1e3;
                  }
                  return [Nt, At];
                }
                function V(nt, it, Nt, At) {
                  var vt = Nt - nt, ut = At - it, Pt = 0.5 - nt, rr = 0.5 - it, lr = vt * vt + ut * ut, Mr = vt * Pt + ut * rr;
                  if (Mr > 0 && Mr < lr) {
                    var Rr = Pt * ut - rr * vt;
                    if (Rr * Rr < lr) return !0;
                  }
                }
                var fe, $;
                function he(nt, it) {
                  var Nt = nt[0] / L, At = nt[1] / A, vt = Math.max(0, -Nt, Nt - 1, -At, At - 1);
                  return vt && fe !== void 0 && V(Nt, At, fe, $) && (vt = 0), vt && it && V(Nt, At, it[0] / L, it[1] / A) && (vt = 0), (1 + w.toleranceGrowth * vt) * j;
                }
                function me(nt, it) {
                  var Nt = nt[0] - it[0], At = nt[1] - it[1];
                  return Math.sqrt(Nt * Nt + At * At);
                }
                var xe = w.maxScreensAway, Fe = -L * xe, Ve = L * (1 + xe), Be = -A * xe, Je = A * (1 + xe), et = [[Fe, Be, Ve, Be], [Ve, Be, Ve, Je], [Ve, Je, Fe, Je], [Fe, Je, Fe, Be]], at, De, Ne, Ie, Ue, ot;
                function ct(nt, it) {
                  for (var Nt = [], At = 0, vt = 0; vt < 4; vt++) {
                    var ut = et[vt], Pt = m(nt[0], nt[1], it[0], it[1], ut[0], ut[1], ut[2], ut[3]);
                    Pt && (!At || Math.abs(Pt.x - Nt[0][0]) > 1 || Math.abs(Pt.y - Nt[0][1]) > 1) && (Pt = [Pt.x, Pt.y], At && me(Pt, nt) < me(Nt[0], nt) ? Nt.unshift(Pt) : Nt.push(Pt), At++);
                  }
                  return Nt;
                }
                function Tt(nt) {
                  if (nt[0] < Fe || nt[0] > Ve || nt[1] < Be || nt[1] > Je)
                    return [h(nt[0], Fe, Ve), h(nt[1], Be, Je)];
                }
                function kt(nt, it) {
                  if (nt[0] === it[0] && (nt[0] === Fe || nt[0] === Ve) || nt[1] === it[1] && (nt[1] === Be || nt[1] === Je)) return !0;
                }
                function Ot(nt, it) {
                  var Nt = [], At = Tt(nt), vt = Tt(it);
                  return At && vt && kt(At, vt) || (At && Nt.push(At), vt && Nt.push(vt)), Nt;
                }
                function Rt(nt, it, Nt) {
                  return function(At, vt) {
                    var ut = Tt(At), Pt = Tt(vt), rr = [];
                    if (ut && Pt && kt(ut, Pt)) return rr;
                    ut && rr.push(ut), Pt && rr.push(Pt);
                    var lr = 2 * C.constrain((At[nt] + vt[nt]) / 2, it, Nt) - ((ut || At)[nt] + (Pt || vt)[nt]);
                    if (lr) {
                      var Mr;
                      ut && Pt ? Mr = lr > 0 == ut[nt] > Pt[nt] ? ut : Pt : Mr = ut || Pt, Mr[nt] += lr;
                    }
                    return rr;
                  };
                }
                var xt;
                te === "linear" || te === "spline" ? xt = ct : te === "hv" || te === "vh" ? xt = Ot : te === "hvh" ? xt = Rt(0, Fe, Ve) : te === "vhv" && (xt = Rt(1, Be, Je));
                function Wt(nt, it) {
                  var Nt = it[0] - nt[0], At = (it[1] - nt[1]) / Nt, vt = (nt[1] * it[0] - it[1] * nt[0]) / Nt;
                  return vt > 0 ? [At > 0 ? Fe : Ve, Je] : [At > 0 ? Ve : Fe, Be];
                }
                function bt(nt) {
                  var it = nt[0], Nt = nt[1], At = it === ie[ce - 1][0], vt = Nt === ie[ce - 1][1];
                  if (!(At && vt))
                    if (ce > 1) {
                      var ut = it === ie[ce - 2][0], Pt = Nt === ie[ce - 2][1];
                      At && (it === Fe || it === Ve) && ut ? Pt ? ce-- : ie[ce - 1] = nt : vt && (Nt === Be || Nt === Je) && Pt ? ut ? ce-- : ie[ce - 1] = nt : ie[ce++] = nt;
                    } else ie[ce++] = nt;
                }
                function jt(nt) {
                  ie[ce - 1][0] !== nt[0] && ie[ce - 1][1] !== nt[1] && bt([Ne, Ie]), bt(nt), Ue = null, Ne = Ie = 0;
                }
                var qt = C.isArrayOrTypedArray(N);
                function Yt(nt) {
                  if (nt && O && (nt.i = X, nt.d = E, nt.trace = T, nt.marker = qt ? N[nt.i] : N, nt.backoff = O), fe = nt[0] / L, $ = nt[1] / A, at = nt[0] < Fe ? Fe : nt[0] > Ve ? Ve : 0, De = nt[1] < Be ? Be : nt[1] > Je ? Je : 0, at || De) {
                    if (!ce)
                      ie[ce++] = [at || nt[0], De || nt[1]];
                    else if (Ue) {
                      var it = xt(Ue, nt);
                      it.length > 1 && (jt(it[0]), ie[ce++] = it[1]);
                    } else
                      ot = xt(ie[ce - 1], nt)[0], ie[ce++] = ot;
                    var Nt = ie[ce - 1];
                    at && De && (Nt[0] !== at || Nt[1] !== De) ? (Ue && (Ne !== at && Ie !== De ? bt(Ne && Ie ? Wt(Ue, nt) : [Ne || at, Ie || De]) : Ne && Ie && bt([Ne, Ie])), bt([at, De])) : Ne - at && Ie - De && bt([at || Ne, De || Ie]), Ue = nt, Ne = at, Ie = De;
                  } else
                    Ue && jt(xt(Ue, nt)[0]), ie[ce++] = nt;
                }
                for (X = 0; X < q; X++)
                  if (U = _(X), !!U) {
                    for (ce = 0, Ue = null, Yt(U), X++; X < q; X++) {
                      if (se = _(X), !se) {
                        if (Y) continue;
                        break;
                      }
                      if (!re || !x.simplify) {
                        Yt(se);
                        continue;
                      }
                      var Ut = _(X + 1);
                      if (Ge = me(se, U), !(!(z && (ce === 0 || ce === q - 1)) && Ge < he(se, Ut) * W)) {
                        for (be = [(se[0] - U[0]) / Ge, (se[1] - U[1]) / Ge], le = U, we = Ge, Re = K = ee = 0, ve = !1, ne = se, X++; X < E.length; X++) {
                          if (ue = Ut, Ut = _(X + 1), !ue) {
                            if (Y) continue;
                            break;
                          }
                          if (Me = [ue[0] - U[0], ue[1] - U[1]], oe = Me[0] * be[1] - Me[1] * be[0], K = Math.min(K, oe), ee = Math.max(ee, oe), ee - K > he(ue, Ut)) break;
                          ne = ue, Ae = Me[0] * be[0] + Me[1] * be[1], Ae > we ? (we = Ae, se = ue, ve = !1) : Ae < Re && (Re = Ae, le = ue, ve = !0);
                        }
                        if (ve ? (Yt(se), ne !== le && Yt(le)) : (le !== U && Yt(le), ne !== se && Yt(se)), Yt(ne), X >= E.length || !ue) break;
                        Yt(ue), U = ue;
                      }
                    }
                    Ue && bt([Ne || Ue[0], Ie || Ue[1]]), Z.push(ie.slice(0, ce));
                  }
                var tt = te.slice(te.length - 1);
                if (O && tt !== "h" && tt !== "v") {
                  for (var ze = !1, _e = -1, Ye = [], lt = 0; lt < Z.length; lt++)
                    for (var Te = 0; Te < Z[lt].length - 1; Te++) {
                      var Oe = Z[lt][Te], je = Z[lt][Te + 1], Xe = l.applyBackoff(je, Oe);
                      (Xe[0] !== je[0] || Xe[1] !== je[1]) && (ze = !0), Ye[_e + 1] || (_e++, Ye[_e] = [Oe, [Xe[0], Xe[1]]]);
                    }
                  return ze ? Ye : Z;
                }
                return Z;
              };
            }
          ),
          /***/
          1731: (
            /***/
            function(s) {
              s.exports = function(i, l, v) {
                var f = v("line.shape");
                f === "spline" && v("line.smoothing");
              };
            }
          ),
          /***/
          4328: (
            /***/
            function(s) {
              var c = {
                tonextx: 1,
                tonexty: 1,
                tonext: 1
              };
              s.exports = function(l, v, f) {
                var p, g, y, C, m, h = {}, w = !1, S = -1, E = 0, x = -1;
                for (g = 0; g < f.length; g++)
                  p = f[g][0].trace, y = p.stackgroup || "", y ? y in h ? m = h[y] : (m = h[y] = E, E++) : p.fill in c && x >= 0 ? m = x : (m = x = E, E++), m < S && (w = !0), p._groupIndex = S = m;
                var T = f.slice();
                w && T.sort(function(P, k) {
                  var I = P[0].trace, L = k[0].trace;
                  return I._groupIndex - L._groupIndex || I.index - L.index;
                });
                var F = {};
                for (g = 0; g < T.length; g++)
                  p = T[g][0].trace, y = p.stackgroup || "", p.visible === !0 ? (p._nexttrace = null, p.fill in c && (C = F[y], p._prevtrace = C || null, C && (C._nexttrace = p)), p._ownfill = p.fill && (p.fill.substr(0, 6) === "tozero" || p.fill === "toself" || p.fill.substr(0, 2) === "to" && !p._prevtrace), F[y] = p) : p._prevtrace = p._nexttrace = p._ownfill = null;
                return T;
              };
            }
          ),
          /***/
          7152: (
            /***/
            function(s, c, i) {
              var l = i(8248);
              s.exports = function(f, p) {
                p || (p = 2);
                var g = f.marker, y = g.sizeref || 1, C = g.sizemin || 0, m = g.sizemode === "area" ? function(h) {
                  return Math.sqrt(h / y);
                } : function(h) {
                  return h / y;
                };
                return function(h) {
                  var w = m(h / p);
                  return l(w) && w > 0 ? Math.max(w, C) : 0;
                };
              };
            }
          ),
          /***/
          5528: (
            /***/
            function(s) {
              s.exports = {
                container: "marker",
                min: "cmin",
                max: "cmax"
              };
            }
          ),
          /***/
          4428: (
            /***/
            function(s, c, i) {
              var l = i(6308), v = i(4288).hasColorscale, f = i(7260), p = i(3028);
              s.exports = function(y, C, m, h, w, S) {
                var E = p.isBubble(y), x = (y.line || {}).color, T;
                if (S = S || {}, x && (m = x), w("marker.symbol"), w("marker.opacity", E ? 0.7 : 1), w("marker.size"), S.noAngle || (w("marker.angle"), S.noAngleRef || w("marker.angleref"), S.noStandOff || w("marker.standoff")), w("marker.color", m), v(y, "marker") && f(y, C, h, w, {
                  prefix: "marker.",
                  cLetter: "c"
                }), S.noSelect || (w("selected.marker.color"), w("unselected.marker.color"), w("selected.marker.size"), w("unselected.marker.size")), S.noLine || (x && !Array.isArray(x) && C.marker.color !== x ? T = x : E ? T = l.background : T = l.defaultLine, w("marker.line.color", T), v(y, "marker.line") && f(y, C, h, w, {
                  prefix: "marker.line.",
                  cLetter: "c"
                }), w("marker.line.width", E ? 1 : 0)), E && (w("marker.sizeref"), w("marker.sizemin"), w("marker.sizemode")), S.gradient) {
                  var F = w("marker.gradient.type");
                  F !== "none" && w("marker.gradient.color");
                }
              };
            }
          ),
          /***/
          1147: (
            /***/
            function(s, c, i) {
              var l = i(3400).dateTick0, v = i(9032), f = v.ONEWEEK;
              function p(g, y) {
                return g % f === 0 ? l(y, 1) : l(y, 0);
              }
              s.exports = function(y, C, m, h, w) {
                if (w || (w = {
                  x: !0,
                  y: !0
                }), w.x) {
                  var S = h("xperiod");
                  S && (h("xperiod0", p(S, C.xcalendar)), h("xperiodalignment"));
                }
                if (w.y) {
                  var E = h("yperiod");
                  E && (h("yperiod0", p(E, C.ycalendar)), h("yperiodalignment"));
                }
              };
            }
          ),
          /***/
          6504: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(4040), f = i(3400), p = f.ensureSingle, g = f.identity, y = i(3616), C = i(3028), m = i(2340), h = i(4328), w = i(2065).tester;
              s.exports = function(F, P, k, I, L, A) {
                var O, N, Y = !L, j = !!L && L.duration > 0, te = h(F, P, k);
                if (O = I.selectAll("g.trace").data(te, function(z) {
                  return z[0].trace.uid;
                }), O.enter().append("g").attr("class", function(z) {
                  return "trace scatter trace" + z[0].trace.uid;
                }).style("stroke-miterlimit", 2), O.order(), S(F, O, P), j) {
                  A && (N = A());
                  var re = l.transition().duration(L.duration).ease(L.easing).each("end", function() {
                    N && N();
                  }).each("interrupt", function() {
                    N && N();
                  });
                  re.each(function() {
                    I.selectAll("g.trace").each(function(z, Z) {
                      E(F, Z, P, z, te, this, L);
                    });
                  });
                } else
                  O.each(function(z, Z) {
                    E(F, Z, P, z, te, this, L);
                  });
                Y && O.exit().remove(), I.selectAll("path:not([d])").remove();
              };
              function S(T, F, P) {
                F.each(function(k) {
                  var I = p(l.select(this), "g", "fills");
                  y.setClipUrl(I, P.layerClipId, T);
                  var L = k[0].trace, A = [];
                  L._ownfill && A.push("_ownFill"), L._nexttrace && A.push("_nextFill");
                  var O = I.selectAll("g").data(A, g);
                  O.enter().append("g"), O.exit().each(function(N) {
                    L[N] = null;
                  }).remove(), O.order().each(function(N) {
                    L[N] = p(l.select(this), "path", "js-fill");
                  });
                });
              }
              function E(T, F, P, k, I, L, A) {
                var O = T._context.staticPlot, N;
                x(T, F, P, k, I);
                var Y = !!A && A.duration > 0;
                function j(bt) {
                  return Y ? bt.transition() : bt;
                }
                var te = P.xaxis, re = P.yaxis, z = k[0].trace, Z = z.line, W = l.select(L), q = p(W, "g", "errorbars"), ie = p(W, "g", "lines"), ce = p(W, "g", "points"), X = p(W, "g", "text");
                if (v.getComponentMethod("errorbars", "plot")(T, q, P, A), z.visible !== !0) return;
                j(W).style("opacity", z.opacity);
                var U, ne, se = z.fill.charAt(z.fill.length - 1);
                se !== "x" && se !== "y" && (se = "");
                var le, ue;
                se === "y" ? (le = 1, ue = re.c2p(0, !0)) : se === "x" && (le = 0, ue = te.c2p(0, !0)), k[0][P.isRangePlot ? "nodeRangePlot3" : "node3"] = W;
                var ve = "", be = [], Me = z._prevtrace, Ge = null, we = null;
                Me && (ve = Me._prevRevpath || "", ne = Me._nextFill, be = Me._ownPolygons, Ge = Me._fillsegments, we = Me._fillElement);
                var Re, Ae, K = "", ee = "", oe, _, V, fe, $, he, me = [];
                z._polygons = [];
                var xe = [], Fe = [], Ve = f.noop;
                if (U = z._ownFill, C.hasLines(z) || z.fill !== "none") {
                  ne && ne.datum(k), ["hv", "vh", "hvh", "vhv"].indexOf(Z.shape) !== -1 ? (oe = y.steps(Z.shape), _ = y.steps(Z.shape.split("").reverse().join(""))) : Z.shape === "spline" ? oe = _ = function(bt) {
                    var jt = bt[bt.length - 1];
                    return bt.length > 1 && bt[0][0] === jt[0] && bt[0][1] === jt[1] ? y.smoothclosed(bt.slice(1), Z.smoothing) : y.smoothopen(bt, Z.smoothing);
                  } : oe = _ = function(bt) {
                    return "M" + bt.join("L");
                  }, V = function(bt) {
                    return _(bt.reverse());
                  }, Fe = m(k, {
                    xaxis: te,
                    yaxis: re,
                    trace: z,
                    connectGaps: z.connectgaps,
                    baseTolerance: Math.max(Z.width || 1, 3) / 4,
                    shape: Z.shape,
                    backoff: Z.backoff,
                    simplify: Z.simplify,
                    fill: z.fill
                  }), xe = new Array(Fe.length);
                  var Be = 0;
                  for (N = 0; N < Fe.length; N++) {
                    var Je, et = Fe[N];
                    !Je || !se ? (Je = et.slice(), xe[Be] = Je, Be++) : Je.push.apply(Je, et);
                  }
                  z._fillElement = null, z._fillExclusionElement = we, z._fillsegments = xe.slice(0, Be), xe = z._fillsegments, Fe.length && (fe = Fe[0][0].slice(), $ = Fe[Fe.length - 1], he = $[$.length - 1].slice()), Ve = function(bt) {
                    return function(jt) {
                      if (Re = oe(jt), Ae = V(jt), K ? se ? (K += "L" + Re.substr(1), ee = Ae + ("L" + ee.substr(1))) : (K += "Z" + Re, ee = Ae + "Z" + ee) : (K = Re, ee = Ae), C.hasLines(z)) {
                        var qt = l.select(this);
                        if (qt.datum(k), bt)
                          j(qt.style("opacity", 0).attr("d", Re).call(y.lineGroupStyle)).style("opacity", 1);
                        else {
                          var Yt = j(qt);
                          Yt.attr("d", Re), y.singleLineStyle(k, Yt);
                        }
                      }
                    };
                  };
                }
                var at = ie.selectAll(".js-line").data(Fe);
                j(at.exit()).style("opacity", 0).remove(), at.each(Ve(!1)), at.enter().append("path").classed("js-line", !0).style("vector-effect", O ? "none" : "non-scaling-stroke").call(y.lineGroupStyle).each(Ve(!0)), y.setClipUrl(at, P.layerClipId, T);
                function De(bt) {
                  j(bt).attr("d", "M0,0Z");
                }
                var Ne = function() {
                  var bt = new Array(xe.length);
                  for (N = 0; N < xe.length; N++)
                    bt[N] = w(xe[N]);
                  return bt;
                }, Ie = function(bt) {
                  var jt, qt;
                  if (!bt || bt.length === 0)
                    for (jt = new Array(xe.length), qt = 0; qt < xe.length; qt++) {
                      var Yt = xe[qt][0].slice(), Ut = xe[qt][xe[qt].length - 1].slice();
                      Yt[le] = Ut[le] = ue;
                      var tt = [Ut, Yt], ze = tt.concat(xe[qt]);
                      jt[qt] = w(ze);
                    }
                  else {
                    for (jt = new Array(bt.length - 1 + xe.length), qt = 0; qt < bt.length - 1; qt++)
                      jt[qt] = w(bt[qt]);
                    var _e = bt[bt.length - 1].slice();
                    for (_e.reverse(), qt = 0; qt < xe.length; qt++)
                      jt[bt.length - 1 + qt] = w(xe[qt].concat(_e));
                  }
                  return jt;
                };
                Fe.length ? (U ? (U.datum(k), fe && he && (se ? (fe[le] = he[le] = ue, j(U).attr("d", "M" + he + "L" + fe + "L" + K.substr(1)).call(y.singleFillStyle, T), me = Ie(null)) : (j(U).attr("d", K + "Z").call(y.singleFillStyle, T), me = Ne())), z._polygons = me, z._fillElement = U) : ne && (z.fill.substr(0, 6) === "tonext" && K && ve ? (z.fill === "tonext" ? (j(ne).attr("d", K + "Z" + ve + "Z").call(y.singleFillStyle, T), me = Ne(), z._polygons = me.concat(be)) : (j(ne).attr("d", K + "L" + ve.substr(1) + "Z").call(y.singleFillStyle, T), me = Ie(Ge), z._polygons = me), z._fillElement = ne) : De(ne)), z._prevRevpath = ee) : (U ? De(U) : ne && De(ne), z._prevRevpath = null), z._ownPolygons = me;
                function Ue(bt) {
                  return bt.filter(function(jt) {
                    return !jt.gap && jt.vis;
                  });
                }
                function ot(bt) {
                  return bt.filter(function(jt) {
                    return jt.vis;
                  });
                }
                function ct(bt) {
                  return bt.filter(function(jt) {
                    return !jt.gap;
                  });
                }
                function Tt(bt) {
                  return bt.id;
                }
                function kt(bt) {
                  if (bt.ids)
                    return Tt;
                }
                function Ot() {
                  return !1;
                }
                function Rt(bt, jt, qt) {
                  var Yt, Ut, tt, ze = qt[0].trace, _e = C.hasMarkers(ze), Ye = C.hasText(ze), lt = kt(ze), Te = Ot, Oe = Ot;
                  if (_e || Ye) {
                    var je = g, Xe = ze.stackgroup, nt = Xe && T._fullLayout._scatterStackOpts[te._id + re._id][Xe].stackgaps === "infer zero";
                    ze.marker.maxdisplayed || ze._needsCull ? je = nt ? ot : Ue : Xe && !nt && (je = ct), _e && (Te = je), Ye && (Oe = je);
                  }
                  Ut = bt.selectAll("path.point"), Yt = Ut.data(Te, lt);
                  var it = Yt.enter().append("path").classed("point", !0);
                  Y && it.call(y.pointStyle, ze, T).call(y.translatePoints, te, re).style("opacity", 0).transition().style("opacity", 1), Yt.order();
                  var Nt;
                  _e && (Nt = y.makePointStyleFns(ze)), Yt.each(function(At) {
                    var vt = l.select(this), ut = j(vt);
                    tt = y.translatePoint(At, ut, te, re), tt ? (y.singlePointStyle(At, ut, ze, Nt, T), P.layerClipId && y.hideOutsideRangePoint(At, ut, te, re, ze.xcalendar, ze.ycalendar), ze.customdata && vt.classed("plotly-customdata", At.data !== null && At.data !== void 0)) : ut.remove();
                  }), Y ? Yt.exit().transition().style("opacity", 0).remove() : Yt.exit().remove(), Ut = jt.selectAll("g"), Yt = Ut.data(Oe, lt), Yt.enter().append("g").classed("textpoint", !0).append("text"), Yt.order(), Yt.each(function(At) {
                    var vt = l.select(this), ut = j(vt.select("text"));
                    tt = y.translatePoint(At, ut, te, re), tt ? P.layerClipId && y.hideOutsideRangePoint(At, vt, te, re, ze.xcalendar, ze.ycalendar) : vt.remove();
                  }), Yt.selectAll("text").call(y.textPointStyle, ze, T).each(function(At) {
                    var vt = te.c2p(At.x), ut = re.c2p(At.y);
                    l.select(this).selectAll("tspan.line").each(function() {
                      j(l.select(this)).attr({
                        x: vt,
                        y: ut
                      });
                    });
                  }), Yt.exit().remove();
                }
                ce.datum(k), X.datum(k), Rt(ce, X, k);
                var xt = z.cliponaxis === !1, Wt = xt ? null : P.layerClipId;
                y.setClipUrl(ce, Wt, T), y.setClipUrl(X, Wt, T);
              }
              function x(T, F, P, k, I) {
                var L = P.xaxis, A = P.yaxis, O = l.extent(f.simpleMap(L.range, L.r2c)), N = l.extent(f.simpleMap(A.range, A.r2c)), Y = k[0].trace;
                if (C.hasMarkers(Y)) {
                  var j = Y.marker.maxdisplayed;
                  if (j !== 0) {
                    var te = k.filter(function(W) {
                      return W.x >= O[0] && W.x <= O[1] && W.y >= N[0] && W.y <= N[1];
                    }), re = Math.ceil(te.length / j), z = 0;
                    I.forEach(function(W, q) {
                      var ie = W[0].trace;
                      C.hasMarkers(ie) && ie.marker.maxdisplayed > 0 && q < F && z++;
                    });
                    var Z = Math.round(z * re / 3 + Math.floor(z / 3) * re / 7.1);
                    k.forEach(function(W) {
                      delete W.vis;
                    }), te.forEach(function(W, q) {
                      Math.round((q + Z) % re) === 0 && (W.vis = !0);
                    });
                  }
                }
              }
            }
          ),
          /***/
          1560: (
            /***/
            function(s, c, i) {
              var l = i(3028);
              s.exports = function(f, p) {
                var g = f.cd, y = f.xaxis, C = f.yaxis, m = [], h = g[0].trace, w, S, E, x, T = !l.hasMarkers(h) && !l.hasText(h);
                if (T) return [];
                if (p === !1)
                  for (w = 0; w < g.length; w++)
                    g[w].selected = 0;
                else
                  for (w = 0; w < g.length; w++)
                    S = g[w], E = y.c2p(S.x), x = C.c2p(S.y), S.i !== null && p.contains([E, x], !1, w, f) ? (m.push({
                      pointNumber: S.i,
                      x: y.c2d(S.x),
                      y: C.c2d(S.y)
                    }), S.selected = 1) : S.selected = 0;
                return m;
              };
            }
          ),
          /***/
          3912: (
            /***/
            function(s) {
              var c = ["orientation", "groupnorm", "stackgaps"];
              s.exports = function(l, v, f, p) {
                var g = f._scatterStackOpts, y = p("stackgroup");
                if (y) {
                  var C = v.xaxis + v.yaxis, m = g[C];
                  m || (m = g[C] = {});
                  var h = m[y], w = !1;
                  h ? h.traces.push(v) : (h = m[y] = {
                    // keep track of trace indices for use during stacking calculations
                    // this will be filled in during `calc` and used during `crossTraceCalc`
                    // so it's OK if we don't recreate it during a non-calc edit
                    traceIndices: [],
                    // Hold on to the whole set of prior traces
                    // First one is most important, so we can clear defaults
                    // there if we find explicit values only in later traces.
                    // We're only going to *use* the values stored in groupOpts,
                    // but for the editor and validate we want things self-consistent
                    // The full set of traces is used only to fix `fill` default if
                    // we find `orientation: 'h'` beyond the first trace
                    traces: [v]
                  }, w = !0);
                  for (var S = {
                    orientation: v.x && !v.y ? "h" : "v"
                  }, E = 0; E < c.length; E++) {
                    var x = c[E], T = x + "Found";
                    if (!h[T]) {
                      var F = l[x] !== void 0, P = x === "orientation";
                      if ((F || w) && (h[x] = p(x, S[x]), P && (h.fillDflt = h[x] === "h" ? "tonextx" : "tonexty"), F && (h[T] = !0, !w && (delete h.traces[0][x], P))))
                        for (var k = 0; k < h.traces.length - 1; k++) {
                          var I = h.traces[k];
                          I._input.fill !== I.fill && (I.fill = h.fillDflt);
                        }
                    }
                  }
                  return h;
                }
              };
            }
          ),
          /***/
          6844: (
            /***/
            function(s, c, i) {
              var l = i(3428), v = i(3616), f = i(4040);
              function p(m) {
                var h = l.select(m).selectAll("g.trace.scatter");
                h.style("opacity", function(w) {
                  return w[0].trace.opacity;
                }), h.selectAll("g.points").each(function(w) {
                  var S = l.select(this), E = w.trace || w[0].trace;
                  g(S, E, m);
                }), h.selectAll("g.text").each(function(w) {
                  var S = l.select(this), E = w.trace || w[0].trace;
                  y(S, E, m);
                }), h.selectAll("g.trace path.js-line").call(v.lineGroupStyle), h.selectAll("g.trace path.js-fill").call(v.fillGroupStyle, m, !1), f.getComponentMethod("errorbars", "style")(h);
              }
              function g(m, h, w) {
                v.pointStyle(m.selectAll("path.point"), h, w);
              }
              function y(m, h, w) {
                v.textPointStyle(m.selectAll("text"), h, w);
              }
              function C(m, h, w) {
                var S = h[0].trace;
                S.selectedpoints ? (v.selectedPointStyle(w.selectAll("path.point"), S), v.selectedTextStyle(w.selectAll("text"), S)) : (g(w, S, m), y(w, S, m));
              }
              s.exports = {
                style: p,
                stylePoints: g,
                styleText: y,
                styleOnSelect: C
              };
            }
          ),
          /***/
          3028: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(8116).isTypedArraySpec;
              s.exports = {
                hasLines: function(f) {
                  return f.visible && f.mode && f.mode.indexOf("lines") !== -1;
                },
                hasMarkers: function(f) {
                  return f.visible && (f.mode && f.mode.indexOf("markers") !== -1 || // until splom implements 'mode'
                  f.type === "splom");
                },
                hasText: function(f) {
                  return f.visible && f.mode && f.mode.indexOf("text") !== -1;
                },
                isBubble: function(f) {
                  var p = f.marker;
                  return l.isPlainObject(p) && (l.isArrayOrTypedArray(p.size) || v(p.size));
                }
              };
            }
          ),
          /***/
          124: (
            /***/
            function(s, c, i) {
              var l = i(3400);
              s.exports = function(v, f, p, g, y) {
                y = y || {}, g("textposition"), l.coerceFont(g, "textfont", y.font || p.font, y), y.noSelect || (g("selected.textfont.color"), g("unselected.textfont.color"));
              };
            }
          ),
          /***/
          3980: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4040);
              s.exports = function(p, g, y, C) {
                var m = C("x"), h = C("y"), w, S = v.getComponentMethod("calendars", "handleTraceDefaults");
                if (S(p, g, ["x", "y"], y), m) {
                  var E = l.minRowLength(m);
                  h ? w = Math.min(E, l.minRowLength(h)) : (w = E, C("y0"), C("dy"));
                } else {
                  if (!h) return 0;
                  w = l.minRowLength(h), C("x0"), C("dx");
                }
                return g._length = w, w;
              };
            }
          ),
          /***/
          1843: (
            /***/
            function(s, c, i) {
              var l = i(4460), v = i(3400), f = i(3060), p = i(468).W, g = i(9032).BADNUM;
              c.moduleType = "transform", c.name = "aggregate";
              var y = c.attributes = {
                enabled: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc"
                },
                groups: {
                  // TODO: groupby should support string or array grouping this way too
                  // currently groupby only allows a grouping array
                  valType: "string",
                  strict: !0,
                  noBlank: !0,
                  arrayOk: !0,
                  dflt: "x",
                  editType: "calc"
                },
                aggregations: {
                  _isLinkedToArray: "aggregation",
                  target: {
                    valType: "string",
                    editType: "calc"
                  },
                  func: {
                    valType: "enumerated",
                    values: ["count", "sum", "avg", "median", "mode", "rms", "stddev", "min", "max", "first", "last", "change", "range"],
                    dflt: "first",
                    editType: "calc"
                  },
                  funcmode: {
                    valType: "enumerated",
                    values: ["sample", "population"],
                    dflt: "sample",
                    editType: "calc"
                  },
                  enabled: {
                    valType: "boolean",
                    dflt: !0,
                    editType: "calc"
                  },
                  editType: "calc"
                },
                editType: "calc"
              }, C = y.aggregations;
              c.supplyDefaults = function(x, T) {
                var F = {}, P;
                function k(W, q) {
                  return v.coerce(x, F, y, W, q);
                }
                var I = k("enabled");
                if (!I) return F;
                var L = f.findArrayAttributes(T), A = {};
                for (P = 0; P < L.length; P++) A[L[P]] = 1;
                var O = k("groups");
                if (!Array.isArray(O)) {
                  if (!A[O])
                    return F.enabled = !1, F;
                  A[O] = 0;
                }
                var N = x.aggregations || [], Y = F.aggregations = new Array(N.length), j;
                function te(W, q) {
                  return v.coerce(N[P], j, C, W, q);
                }
                for (P = 0; P < N.length; P++) {
                  j = {
                    _index: P
                  };
                  var re = te("target"), z = te("func"), Z = te("enabled");
                  Z && re && (A[re] || z === "count" && A[re] === void 0) ? (z === "stddev" && te("funcmode"), A[re] = 0, Y[P] = j) : Y[P] = {
                    enabled: !1,
                    _index: P
                  };
                }
                for (P = 0; P < L.length; P++)
                  A[L[P]] && Y.push({
                    target: L[P],
                    func: C.func.dflt,
                    enabled: !0,
                    _index: -1
                  });
                return F;
              }, c.calcTransform = function(x, T, F) {
                if (F.enabled) {
                  var P = F.groups, k = v.getTargetArray(T, {
                    target: P
                  });
                  if (k) {
                    var I, L, A, O, N = {}, Y = {}, j = [], te = p(T.transforms, F), re = k.length;
                    for (T._length && (re = Math.min(re, T._length)), I = 0; I < re; I++)
                      L = k[I], A = N[L], A === void 0 ? (N[L] = j.length, O = [I], j.push(O), Y[N[L]] = te(I)) : (j[A].push(I), Y[N[L]] = (Y[N[L]] || []).concat(te(I)));
                    F._indexToPoints = Y;
                    var z = F.aggregations;
                    for (I = 0; I < z.length; I++)
                      m(x, T, j, z[I]);
                    typeof P == "string" && m(x, T, j, {
                      target: P,
                      func: "first",
                      enabled: !0
                    }), T._length = j.length;
                  }
                }
              };
              function m(x, T, F, P) {
                if (P.enabled) {
                  for (var k = P.target, I = v.nestedProperty(T, k), L = I.get(), A = l.getDataConversions(x, T, k, L), O = h(P, A), N = new Array(F.length), Y = 0; Y < F.length; Y++)
                    N[Y] = O(L, F[Y]);
                  I.set(N), P.func === "count" && v.pushUnique(T._arrayAttrs, k);
                }
              }
              function h(x, T) {
                var F = x.func, P = T.d2c, k = T.c2d;
                switch (F) {
                  case "count":
                    return w;
                  case "first":
                    return S;
                  case "last":
                    return E;
                  case "sum":
                    return function(I, L) {
                      for (var A = 0, O = 0; O < L.length; O++) {
                        var N = P(I[L[O]]);
                        N !== g && (A += N);
                      }
                      return k(A);
                    };
                  case "avg":
                    return function(I, L) {
                      for (var A = 0, O = 0, N = 0; N < L.length; N++) {
                        var Y = P(I[L[N]]);
                        Y !== g && (A += Y, O++);
                      }
                      return O ? k(A / O) : g;
                    };
                  case "min":
                    return function(I, L) {
                      for (var A = 1 / 0, O = 0; O < L.length; O++) {
                        var N = P(I[L[O]]);
                        N !== g && (A = Math.min(A, N));
                      }
                      return A === 1 / 0 ? g : k(A);
                    };
                  case "max":
                    return function(I, L) {
                      for (var A = -1 / 0, O = 0; O < L.length; O++) {
                        var N = P(I[L[O]]);
                        N !== g && (A = Math.max(A, N));
                      }
                      return A === -1 / 0 ? g : k(A);
                    };
                  case "range":
                    return function(I, L) {
                      for (var A = 1 / 0, O = -1 / 0, N = 0; N < L.length; N++) {
                        var Y = P(I[L[N]]);
                        Y !== g && (A = Math.min(A, Y), O = Math.max(O, Y));
                      }
                      return O === -1 / 0 || A === 1 / 0 ? g : k(O - A);
                    };
                  case "change":
                    return function(I, L) {
                      var A = P(I[L[0]]), O = P(I[L[L.length - 1]]);
                      return A === g || O === g ? g : k(O - A);
                    };
                  case "median":
                    return function(I, L) {
                      for (var A = [], O = 0; O < L.length; O++) {
                        var N = P(I[L[O]]);
                        N !== g && A.push(N);
                      }
                      if (!A.length) return g;
                      A.sort(v.sorterAsc);
                      var Y = (A.length - 1) / 2;
                      return k((A[Math.floor(Y)] + A[Math.ceil(Y)]) / 2);
                    };
                  case "mode":
                    return function(I, L) {
                      for (var A = {}, O = 0, N = g, Y = 0; Y < L.length; Y++) {
                        var j = P(I[L[Y]]);
                        if (j !== g) {
                          var te = A[j] = (A[j] || 0) + 1;
                          te > O && (O = te, N = j);
                        }
                      }
                      return O ? k(N) : g;
                    };
                  case "rms":
                    return function(I, L) {
                      for (var A = 0, O = 0, N = 0; N < L.length; N++) {
                        var Y = P(I[L[N]]);
                        Y !== g && (A += Y * Y, O++);
                      }
                      return O ? k(Math.sqrt(A / O)) : g;
                    };
                  case "stddev":
                    return function(I, L) {
                      var A = 0, O = 0, N = 1, Y = g, j;
                      for (j = 0; j < L.length && Y === g; j++)
                        Y = P(I[L[j]]);
                      if (Y === g) return g;
                      for (; j < L.length; j++) {
                        var te = P(I[L[j]]);
                        if (te !== g) {
                          var re = te - Y;
                          A += re, O += re * re, N++;
                        }
                      }
                      var z = x.funcmode === "sample" ? N - 1 : N;
                      return z ? Math.sqrt((O - A * A / N) / z) : 0;
                    };
                }
              }
              function w(x, T) {
                return T.length;
              }
              function S(x, T) {
                return x[T[0]];
              }
              function E(x, T) {
                return x[T[T.length - 1]];
              }
            }
          ),
          /***/
          6744: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4040), f = i(4460), p = i(468).W, g = i(9104), y = g.COMPARISON_OPS, C = g.INTERVAL_OPS, m = g.SET_OPS;
              c.moduleType = "transform", c.name = "filter", c.attributes = {
                enabled: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc"
                },
                target: {
                  valType: "string",
                  strict: !0,
                  noBlank: !0,
                  arrayOk: !0,
                  dflt: "x",
                  editType: "calc"
                },
                operation: {
                  valType: "enumerated",
                  values: [].concat(y).concat(C).concat(m),
                  dflt: "=",
                  editType: "calc"
                },
                value: {
                  valType: "any",
                  dflt: 0,
                  editType: "calc"
                },
                preservegaps: {
                  valType: "boolean",
                  dflt: !1,
                  editType: "calc"
                },
                editType: "calc"
              }, c.supplyDefaults = function(w) {
                var S = {};
                function E(P, k) {
                  return l.coerce(w, S, c.attributes, P, k);
                }
                var x = E("enabled");
                if (x) {
                  var T = E("target");
                  if (l.isArrayOrTypedArray(T) && T.length === 0)
                    return S.enabled = !1, S;
                  E("preservegaps"), E("operation"), E("value");
                  var F = v.getComponentMethod("calendars", "handleDefaults");
                  F(w, S, "valuecalendar", null), F(w, S, "targetcalendar", null);
                }
                return S;
              }, c.calcTransform = function(w, S, E) {
                if (!E.enabled) return;
                var x = l.getTargetArray(S, E);
                if (!x) return;
                var T = E.target, F = x.length;
                S._length && (F = Math.min(F, S._length));
                var P = E.targetcalendar, k = S._arrayAttrs, I = E.preservegaps;
                if (typeof T == "string") {
                  var L = l.nestedProperty(S, T + "calendar").get();
                  L && (P = L);
                }
                var A = f.getDataToCoordFunc(w, S, T, x), O = h(E, A, P), N = {}, Y = {}, j = 0;
                function te(ie, ce) {
                  for (var X = 0; X < k.length; X++) {
                    var U = l.nestedProperty(S, k[X]);
                    ie(U, ce);
                  }
                }
                var re, z;
                I ? (re = function(ie) {
                  N[ie.astr] = l.extendDeep([], ie.get()), ie.set(new Array(F));
                }, z = function(ie, ce) {
                  var X = N[ie.astr][ce];
                  ie.get()[ce] = X;
                }) : (re = function(ie) {
                  N[ie.astr] = l.extendDeep([], ie.get()), ie.set([]);
                }, z = function(ie, ce) {
                  var X = N[ie.astr][ce];
                  ie.get().push(X);
                }), te(re);
                for (var Z = p(S.transforms, E), W = 0; W < F; W++) {
                  var q = O(x[W]);
                  q ? (te(z, W), Y[j++] = Z(W)) : I && j++;
                }
                E._indexToPoints = Y, S._length = j;
              };
              function h(w, S, E) {
                var x = w.operation, T = w.value, F = l.isArrayOrTypedArray(T);
                function P(A) {
                  return A.indexOf(x) !== -1;
                }
                var k = function(A) {
                  return S(A, 0, w.valuecalendar);
                }, I = function(A) {
                  return S(A, 0, E);
                }, L;
                switch (P(y) ? L = k(F ? T[0] : T) : P(C) ? L = F ? [k(T[0]), k(T[1])] : [k(T), k(T)] : P(m) && (L = F ? T.map(k) : [k(T)]), x) {
                  case "=":
                    return function(A) {
                      return I(A) === L;
                    };
                  case "!=":
                    return function(A) {
                      return I(A) !== L;
                    };
                  case "<":
                    return function(A) {
                      return I(A) < L;
                    };
                  case "<=":
                    return function(A) {
                      return I(A) <= L;
                    };
                  case ">":
                    return function(A) {
                      return I(A) > L;
                    };
                  case ">=":
                    return function(A) {
                      return I(A) >= L;
                    };
                  case "[]":
                    return function(A) {
                      var O = I(A);
                      return O >= L[0] && O <= L[1];
                    };
                  case "()":
                    return function(A) {
                      var O = I(A);
                      return O > L[0] && O < L[1];
                    };
                  case "[)":
                    return function(A) {
                      var O = I(A);
                      return O >= L[0] && O < L[1];
                    };
                  case "(]":
                    return function(A) {
                      var O = I(A);
                      return O > L[0] && O <= L[1];
                    };
                  case "][":
                    return function(A) {
                      var O = I(A);
                      return O <= L[0] || O >= L[1];
                    };
                  case ")(":
                    return function(A) {
                      var O = I(A);
                      return O < L[0] || O > L[1];
                    };
                  case "](":
                    return function(A) {
                      var O = I(A);
                      return O <= L[0] || O > L[1];
                    };
                  case ")[":
                    return function(A) {
                      var O = I(A);
                      return O < L[0] || O >= L[1];
                    };
                  case "{}":
                    return function(A) {
                      return L.indexOf(I(A)) !== -1;
                    };
                  case "}{":
                    return function(A) {
                      return L.indexOf(I(A)) === -1;
                    };
                }
              }
            }
          ),
          /***/
          2028: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(3060), f = i(7316), p = i(468).W;
              c.moduleType = "transform", c.name = "groupby", c.attributes = {
                enabled: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc"
                },
                groups: {
                  valType: "data_array",
                  dflt: [],
                  editType: "calc"
                },
                nameformat: {
                  valType: "string",
                  editType: "calc"
                },
                styles: {
                  _isLinkedToArray: "style",
                  target: {
                    valType: "string",
                    editType: "calc"
                  },
                  value: {
                    valType: "any",
                    dflt: {},
                    editType: "calc",
                    _compareAsJSON: !0
                  },
                  editType: "calc"
                },
                editType: "calc"
              }, c.supplyDefaults = function(y, C, m) {
                var h, w = {};
                function S(k, I) {
                  return l.coerce(y, w, c.attributes, k, I);
                }
                var E = S("enabled");
                if (!E) return w;
                S("groups"), S("nameformat", m._dataLength > 1 ? "%{group} (%{trace})" : "%{group}");
                var x = y.styles, T = w.styles = [];
                if (x)
                  for (h = 0; h < x.length; h++) {
                    var F = T[h] = {};
                    l.coerce(x[h], T[h], c.attributes.styles, "target");
                    var P = l.coerce(x[h], T[h], c.attributes.styles, "value");
                    l.isPlainObject(P) ? F.value = l.extendDeep({}, P) : P && delete F.value;
                  }
                return w;
              }, c.transform = function(y, C) {
                var m, h, w, S = [];
                for (h = 0; h < y.length; h++)
                  for (m = g(y[h], C), w = 0; w < m.length; w++)
                    S.push(m[w]);
                return S;
              };
              function g(y, C) {
                var m, h, w, S, E, x, T, F, P, k, I = C.transform, L = C.transformIndex, A = y.transforms[L].groups, O = p(y.transforms, I);
                if (!l.isArrayOrTypedArray(A) || A.length === 0)
                  return [y];
                var N = l.filterUnique(A), Y = new Array(N.length), j = A.length, te = v.findArrayAttributes(y), re = I.styles || [], z = {};
                for (m = 0; m < re.length; m++)
                  z[re[m].target] = re[m].value;
                I.styles && (k = l.keyedContainer(I, "styles", "target", "value.name"));
                var Z = {}, W = {};
                for (m = 0; m < N.length; m++) {
                  x = N[m], Z[x] = m, W[x] = 0, T = Y[m] = l.extendDeepNoArrays({}, y), T._group = x, T.transforms[L]._indexToPoints = {};
                  var q = null;
                  for (k && (q = k.get(x)), q || q === "" ? T.name = q : T.name = l.templateString(I.nameformat, {
                    trace: y.name,
                    group: x
                  }), F = T.transforms, T.transforms = [], h = 0; h < F.length; h++)
                    T.transforms[h] = l.extendDeepNoArrays({}, F[h]);
                  for (h = 0; h < te.length; h++)
                    l.nestedProperty(T, te[h]).set([]);
                }
                for (w = 0; w < te.length; w++) {
                  for (S = te[w], h = 0, P = []; h < N.length; h++)
                    P[h] = l.nestedProperty(Y[h], S).get();
                  for (E = l.nestedProperty(y, S).get(), h = 0; h < j; h++)
                    P[Z[A[h]]].push(E[h]);
                }
                for (h = 0; h < j; h++) {
                  T = Y[Z[A[h]]];
                  var ie = T.transforms[L]._indexToPoints;
                  ie[W[A[h]]] = O(h), W[A[h]]++;
                }
                for (m = 0; m < N.length; m++)
                  x = N[m], T = Y[m], f.clearExpandedTraceDefaultColors(T), T = l.extendDeepNoArrays(T, z[x] || {});
                return Y;
              }
            }
          ),
          /***/
          468: (
            /***/
            function(s, c) {
              c.W = function(i, l) {
                for (var v, f, p = 0; p < i.length && (v = i[p], v !== l); p++)
                  !v._indexToPoints || v.enabled === !1 || (f = v._indexToPoints);
                var g = f ? function(y) {
                  return f[y];
                } : function(y) {
                  return [y];
                };
                return g;
              };
            }
          ),
          /***/
          6272: (
            /***/
            function(s, c, i) {
              var l = i(3400), v = i(4460), f = i(468).W, p = i(9032).BADNUM;
              c.moduleType = "transform", c.name = "sort", c.attributes = {
                enabled: {
                  valType: "boolean",
                  dflt: !0,
                  editType: "calc"
                },
                target: {
                  valType: "string",
                  strict: !0,
                  noBlank: !0,
                  arrayOk: !0,
                  dflt: "x",
                  editType: "calc"
                },
                order: {
                  valType: "enumerated",
                  values: ["ascending", "descending"],
                  dflt: "ascending",
                  editType: "calc"
                },
                editType: "calc"
              }, c.supplyDefaults = function(C) {
                var m = {};
                function h(S, E) {
                  return l.coerce(C, m, c.attributes, S, E);
                }
                var w = h("enabled");
                return w && (h("target"), h("order")), m;
              }, c.calcTransform = function(C, m, h) {
                if (h.enabled) {
                  var w = l.getTargetArray(m, h);
                  if (w) {
                    var S = h.target, E = w.length;
                    m._length && (E = Math.min(E, m._length));
                    var x = m._arrayAttrs, T = v.getDataToCoordFunc(C, m, S, w), F = g(h, w, T, E), P = f(m.transforms, h), k = {}, I, L;
                    for (I = 0; I < x.length; I++) {
                      var A = l.nestedProperty(m, x[I]), O = A.get(), N = new Array(E);
                      for (L = 0; L < E; L++)
                        N[L] = O[F[L]];
                      A.set(N);
                    }
                    for (L = 0; L < E; L++)
                      k[L] = P(F[L]);
                    h._indexToPoints = k, m._length = E;
                  }
                }
              };
              function g(C, m, h, w) {
                var S = new Array(w), E = new Array(w), x;
                for (x = 0; x < w; x++)
                  S[x] = {
                    v: m[x],
                    i: x
                  };
                for (S.sort(y(C, h)), x = 0; x < w; x++)
                  E[x] = S[x].i;
                return E;
              }
              function y(C, m) {
                switch (C.order) {
                  case "ascending":
                    return function(h, w) {
                      var S = m(h.v), E = m(w.v);
                      return S === p ? 1 : E === p ? -1 : S - E;
                    };
                  case "descending":
                    return function(h, w) {
                      var S = m(h.v), E = m(w.v);
                      return S === p ? 1 : E === p ? -1 : E - S;
                    };
                }
              }
            }
          ),
          /***/
          5788: (
            /***/
            function(s, c) {
              c.version = "2.33.0";
            }
          ),
          /***/
          5928: (
            /***/
            function(s) {
              s.exports = v, s.exports.isMobile = v, s.exports.default = v;
              var c = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, i = /CrOS/, l = /android|ipad|playbook|silk/i;
              function v(f) {
                f || (f = {});
                var p = f.ua;
                if (!p && typeof navigator < "u" && (p = navigator.userAgent), p && p.headers && typeof p.headers["user-agent"] == "string" && (p = p.headers["user-agent"]), typeof p != "string") return !1;
                var g = c.test(p) && !i.test(p) || !!f.tablet && l.test(p);
                return !g && f.tablet && f.featureDetect && navigator && navigator.maxTouchPoints > 1 && p.indexOf("Macintosh") !== -1 && p.indexOf("Safari") !== -1 && (g = !0), g;
              }
            }
          ),
          /***/
          3428: (
            /***/
            function(s, c, i) {
              var l, v;
              (function() {
                var f = {
                  version: "3.8.2"
                }, p = [].slice, g = function(R) {
                  return p.call(R);
                }, y = self.document;
                function C(R) {
                  return R && (R.ownerDocument || R.document || R).documentElement;
                }
                function m(R) {
                  return R && (R.ownerDocument && R.ownerDocument.defaultView || R.document && R || R.defaultView);
                }
                if (y)
                  try {
                    g(y.documentElement.childNodes)[0].nodeType;
                  } catch {
                    g = function(B) {
                      for (var J = B.length, de = new Array(J); J--; ) de[J] = B[J];
                      return de;
                    };
                  }
                if (Date.now || (Date.now = function() {
                  return +/* @__PURE__ */ new Date();
                }), y)
                  try {
                    y.createElement("DIV").style.setProperty("opacity", 0, "");
                  } catch {
                    var h = this.Element.prototype, w = h.setAttribute, S = h.setAttributeNS, E = this.CSSStyleDeclaration.prototype, x = E.setProperty;
                    h.setAttribute = function(B, J) {
                      w.call(this, B, J + "");
                    }, h.setAttributeNS = function(B, J, de) {
                      S.call(this, B, J, de + "");
                    }, E.setProperty = function(B, J, de) {
                      x.call(this, B, J + "", de);
                    };
                  }
                f.ascending = T;
                function T(R, B) {
                  return R < B ? -1 : R > B ? 1 : R >= B ? 0 : NaN;
                }
                f.descending = function(R, B) {
                  return B < R ? -1 : B > R ? 1 : B >= R ? 0 : NaN;
                }, f.min = function(R, B) {
                  var J = -1, de = R.length, pe, ye;
                  if (arguments.length === 1) {
                    for (; ++J < de; ) if ((ye = R[J]) != null && ye >= ye) {
                      pe = ye;
                      break;
                    }
                    for (; ++J < de; ) (ye = R[J]) != null && pe > ye && (pe = ye);
                  } else {
                    for (; ++J < de; ) if ((ye = B.call(R, R[J], J)) != null && ye >= ye) {
                      pe = ye;
                      break;
                    }
                    for (; ++J < de; ) (ye = B.call(R, R[J], J)) != null && pe > ye && (pe = ye);
                  }
                  return pe;
                }, f.max = function(R, B) {
                  var J = -1, de = R.length, pe, ye;
                  if (arguments.length === 1) {
                    for (; ++J < de; ) if ((ye = R[J]) != null && ye >= ye) {
                      pe = ye;
                      break;
                    }
                    for (; ++J < de; ) (ye = R[J]) != null && ye > pe && (pe = ye);
                  } else {
                    for (; ++J < de; ) if ((ye = B.call(R, R[J], J)) != null && ye >= ye) {
                      pe = ye;
                      break;
                    }
                    for (; ++J < de; ) (ye = B.call(R, R[J], J)) != null && ye > pe && (pe = ye);
                  }
                  return pe;
                }, f.extent = function(R, B) {
                  var J = -1, de = R.length, pe, ye, ke;
                  if (arguments.length === 1) {
                    for (; ++J < de; ) if ((ye = R[J]) != null && ye >= ye) {
                      pe = ke = ye;
                      break;
                    }
                    for (; ++J < de; ) (ye = R[J]) != null && (pe > ye && (pe = ye), ke < ye && (ke = ye));
                  } else {
                    for (; ++J < de; ) if ((ye = B.call(R, R[J], J)) != null && ye >= ye) {
                      pe = ke = ye;
                      break;
                    }
                    for (; ++J < de; ) (ye = B.call(R, R[J], J)) != null && (pe > ye && (pe = ye), ke < ye && (ke = ye));
                  }
                  return [pe, ke];
                };
                function F(R) {
                  return R === null ? NaN : +R;
                }
                function P(R) {
                  return !isNaN(R);
                }
                f.sum = function(R, B) {
                  var J = 0, de = R.length, pe, ye = -1;
                  if (arguments.length === 1)
                    for (; ++ye < de; ) P(pe = +R[ye]) && (J += pe);
                  else
                    for (; ++ye < de; ) P(pe = +B.call(R, R[ye], ye)) && (J += pe);
                  return J;
                }, f.mean = function(R, B) {
                  var J = 0, de = R.length, pe, ye = -1, ke = de;
                  if (arguments.length === 1)
                    for (; ++ye < de; ) P(pe = F(R[ye])) ? J += pe : --ke;
                  else
                    for (; ++ye < de; ) P(pe = F(B.call(R, R[ye], ye))) ? J += pe : --ke;
                  if (ke) return J / ke;
                }, f.quantile = function(R, B) {
                  var J = (R.length - 1) * B + 1, de = Math.floor(J), pe = +R[de - 1], ye = J - de;
                  return ye ? pe + ye * (R[de] - pe) : pe;
                }, f.median = function(R, B) {
                  var J = [], de = R.length, pe, ye = -1;
                  if (arguments.length === 1)
                    for (; ++ye < de; ) P(pe = F(R[ye])) && J.push(pe);
                  else
                    for (; ++ye < de; ) P(pe = F(B.call(R, R[ye], ye))) && J.push(pe);
                  if (J.length) return f.quantile(J.sort(T), 0.5);
                }, f.variance = function(R, B) {
                  var J = R.length, de = 0, pe, ye, ke = 0, Ee = -1, He = 0;
                  if (arguments.length === 1)
                    for (; ++Ee < J; )
                      P(pe = F(R[Ee])) && (ye = pe - de, de += ye / ++He, ke += ye * (pe - de));
                  else
                    for (; ++Ee < J; )
                      P(pe = F(B.call(R, R[Ee], Ee))) && (ye = pe - de, de += ye / ++He, ke += ye * (pe - de));
                  if (He > 1) return ke / (He - 1);
                }, f.deviation = function() {
                  var R = f.variance.apply(this, arguments);
                  return R && Math.sqrt(R);
                };
                function k(R) {
                  return {
                    left: function(B, J, de, pe) {
                      for (arguments.length < 3 && (de = 0), arguments.length < 4 && (pe = B.length); de < pe; ) {
                        var ye = de + pe >>> 1;
                        R(B[ye], J) < 0 ? de = ye + 1 : pe = ye;
                      }
                      return de;
                    },
                    right: function(B, J, de, pe) {
                      for (arguments.length < 3 && (de = 0), arguments.length < 4 && (pe = B.length); de < pe; ) {
                        var ye = de + pe >>> 1;
                        R(B[ye], J) > 0 ? pe = ye : de = ye + 1;
                      }
                      return de;
                    }
                  };
                }
                var I = k(T);
                f.bisectLeft = I.left, f.bisect = f.bisectRight = I.right, f.bisector = function(R) {
                  return k(R.length === 1 ? function(B, J) {
                    return T(R(B), J);
                  } : R);
                }, f.shuffle = function(R, B, J) {
                  (de = arguments.length) < 3 && (J = R.length, de < 2 && (B = 0));
                  for (var de = J - B, pe, ye; de; )
                    ye = Math.random() * de-- | 0, pe = R[de + B], R[de + B] = R[ye + B], R[ye + B] = pe;
                  return R;
                }, f.permute = function(R, B) {
                  for (var J = B.length, de = new Array(J); J--; ) de[J] = R[B[J]];
                  return de;
                }, f.pairs = function(R) {
                  for (var B = 0, J = R.length - 1, de = R[0], pe = new Array(J < 0 ? 0 : J); B < J; ) pe[B] = [de, de = R[++B]];
                  return pe;
                }, f.transpose = function(R) {
                  if (!(ye = R.length)) return [];
                  for (var B = -1, J = f.min(R, L), de = new Array(J); ++B < J; )
                    for (var pe = -1, ye, ke = de[B] = new Array(ye); ++pe < ye; )
                      ke[pe] = R[pe][B];
                  return de;
                };
                function L(R) {
                  return R.length;
                }
                f.zip = function() {
                  return f.transpose(arguments);
                }, f.keys = function(R) {
                  var B = [];
                  for (var J in R) B.push(J);
                  return B;
                }, f.values = function(R) {
                  var B = [];
                  for (var J in R) B.push(R[J]);
                  return B;
                }, f.entries = function(R) {
                  var B = [];
                  for (var J in R) B.push({
                    key: J,
                    value: R[J]
                  });
                  return B;
                }, f.merge = function(R) {
                  for (var B = R.length, J, de = -1, pe = 0, ye, ke; ++de < B; ) pe += R[de].length;
                  for (ye = new Array(pe); --B >= 0; )
                    for (ke = R[B], J = ke.length; --J >= 0; )
                      ye[--pe] = ke[J];
                  return ye;
                };
                var A = Math.abs;
                f.range = function(R, B, J) {
                  if (arguments.length < 3 && (J = 1, arguments.length < 2 && (B = R, R = 0)), (B - R) / J === 1 / 0) throw new Error("infinite range");
                  var de = [], pe = O(A(J)), ye = -1, ke;
                  if (R *= pe, B *= pe, J *= pe, J < 0) for (; (ke = R + J * ++ye) > B; ) de.push(ke / pe);
                  else for (; (ke = R + J * ++ye) < B; ) de.push(ke / pe);
                  return de;
                };
                function O(R) {
                  for (var B = 1; R * B % 1; ) B *= 10;
                  return B;
                }
                function N(R, B) {
                  for (var J in B)
                    Object.defineProperty(R.prototype, J, {
                      value: B[J],
                      enumerable: !1
                    });
                }
                f.map = function(R, B) {
                  var J = new Y();
                  if (R instanceof Y)
                    R.forEach(function(Ee, He) {
                      J.set(Ee, He);
                    });
                  else if (Array.isArray(R)) {
                    var de = -1, pe = R.length, ye;
                    if (arguments.length === 1) for (; ++de < pe; ) J.set(de, R[de]);
                    else for (; ++de < pe; ) J.set(B.call(R, ye = R[de], de), ye);
                  } else
                    for (var ke in R) J.set(ke, R[ke]);
                  return J;
                };
                function Y() {
                  this._ = /* @__PURE__ */ Object.create(null);
                }
                var j = "__proto__", te = "\0";
                N(Y, {
                  has: Z,
                  get: function(R) {
                    return this._[re(R)];
                  },
                  set: function(R, B) {
                    return this._[re(R)] = B;
                  },
                  remove: W,
                  keys: q,
                  values: function() {
                    var R = [];
                    for (var B in this._) R.push(this._[B]);
                    return R;
                  },
                  entries: function() {
                    var R = [];
                    for (var B in this._) R.push({
                      key: z(B),
                      value: this._[B]
                    });
                    return R;
                  },
                  size: ie,
                  empty: ce,
                  forEach: function(R) {
                    for (var B in this._) R.call(this, z(B), this._[B]);
                  }
                });
                function re(R) {
                  return (R += "") === j || R[0] === te ? te + R : R;
                }
                function z(R) {
                  return (R += "")[0] === te ? R.slice(1) : R;
                }
                function Z(R) {
                  return re(R) in this._;
                }
                function W(R) {
                  return (R = re(R)) in this._ && delete this._[R];
                }
                function q() {
                  var R = [];
                  for (var B in this._) R.push(z(B));
                  return R;
                }
                function ie() {
                  var R = 0;
                  for (var B in this._) ++R;
                  return R;
                }
                function ce() {
                  for (var R in this._) return !1;
                  return !0;
                }
                f.nest = function() {
                  var R = {}, B = [], J = [], de, pe;
                  function ye(Ee, He, Ke) {
                    if (Ke >= B.length) return pe ? pe.call(R, He) : de ? He.sort(de) : He;
                    for (var Qe = -1, yt = He.length, mt = B[Ke++], Bt, Zt, qe, Et = new Y(), Dt; ++Qe < yt; )
                      (Dt = Et.get(Bt = mt(Zt = He[Qe]))) ? Dt.push(Zt) : Et.set(Bt, [Zt]);
                    return Ee ? (Zt = Ee(), qe = function(Xt, Kt) {
                      Zt.set(Xt, ye(Ee, Kt, Ke));
                    }) : (Zt = {}, qe = function(Xt, Kt) {
                      Zt[Xt] = ye(Ee, Kt, Ke);
                    }), Et.forEach(qe), Zt;
                  }
                  function ke(Ee, He) {
                    if (He >= B.length) return Ee;
                    var Ke = [], Qe = J[He++];
                    return Ee.forEach(function(yt, mt) {
                      Ke.push({
                        key: yt,
                        values: ke(mt, He)
                      });
                    }), Qe ? Ke.sort(function(yt, mt) {
                      return Qe(yt.key, mt.key);
                    }) : Ke;
                  }
                  return R.map = function(Ee, He) {
                    return ye(He, Ee, 0);
                  }, R.entries = function(Ee) {
                    return ke(ye(f.map, Ee, 0), 0);
                  }, R.key = function(Ee) {
                    return B.push(Ee), R;
                  }, R.sortKeys = function(Ee) {
                    return J[B.length - 1] = Ee, R;
                  }, R.sortValues = function(Ee) {
                    return de = Ee, R;
                  }, R.rollup = function(Ee) {
                    return pe = Ee, R;
                  }, R;
                }, f.set = function(R) {
                  var B = new X();
                  if (R) for (var J = 0, de = R.length; J < de; ++J) B.add(R[J]);
                  return B;
                };
                function X() {
                  this._ = /* @__PURE__ */ Object.create(null);
                }
                N(X, {
                  has: Z,
                  add: function(R) {
                    return this._[re(R += "")] = !0, R;
                  },
                  remove: W,
                  values: q,
                  size: ie,
                  empty: ce,
                  forEach: function(R) {
                    for (var B in this._) R.call(this, z(B));
                  }
                }), f.behavior = {};
                function U(R) {
                  return R;
                }
                f.rebind = function(R, B) {
                  for (var J = 1, de = arguments.length, pe; ++J < de; ) R[pe = arguments[J]] = ne(R, B, B[pe]);
                  return R;
                };
                function ne(R, B, J) {
                  return function() {
                    var de = J.apply(B, arguments);
                    return de === B ? R : de;
                  };
                }
                function se(R, B) {
                  if (B in R) return B;
                  B = B.charAt(0).toUpperCase() + B.slice(1);
                  for (var J = 0, de = le.length; J < de; ++J) {
                    var pe = le[J] + B;
                    if (pe in R) return pe;
                  }
                }
                var le = ["webkit", "ms", "moz", "Moz", "o", "O"];
                function ue() {
                }
                f.dispatch = function() {
                  for (var R = new ve(), B = -1, J = arguments.length; ++B < J; ) R[arguments[B]] = be(R);
                  return R;
                };
                function ve() {
                }
                ve.prototype.on = function(R, B) {
                  var J = R.indexOf("."), de = "";
                  if (J >= 0 && (de = R.slice(J + 1), R = R.slice(0, J)), R) return arguments.length < 2 ? this[R].on(de) : this[R].on(de, B);
                  if (arguments.length === 2) {
                    if (B == null) for (R in this)
                      this.hasOwnProperty(R) && this[R].on(de, null);
                    return this;
                  }
                };
                function be(R) {
                  var B = [], J = new Y();
                  function de() {
                    for (var pe = B, ye = -1, ke = pe.length, Ee; ++ye < ke; ) (Ee = pe[ye].on) && Ee.apply(this, arguments);
                    return R;
                  }
                  return de.on = function(pe, ye) {
                    var ke = J.get(pe), Ee;
                    return arguments.length < 2 ? ke && ke.on : (ke && (ke.on = null, B = B.slice(0, Ee = B.indexOf(ke)).concat(B.slice(Ee + 1)), J.remove(pe)), ye && B.push(J.set(pe, {
                      on: ye
                    })), R);
                  }, de;
                }
                f.event = null;
                function Me() {
                  f.event.preventDefault();
                }
                function Ge() {
                  for (var R = f.event, B; B = R.sourceEvent; ) R = B;
                  return R;
                }
                function we(R) {
                  for (var B = new ve(), J = 0, de = arguments.length; ++J < de; ) B[arguments[J]] = be(B);
                  return B.of = function(pe, ye) {
                    return function(ke) {
                      try {
                        var Ee = ke.sourceEvent = f.event;
                        ke.target = R, f.event = ke, B[ke.type].apply(pe, ye);
                      } finally {
                        f.event = Ee;
                      }
                    };
                  }, B;
                }
                f.requote = function(R) {
                  return R.replace(Re, "\\$&");
                };
                var Re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g, Ae = {}.__proto__ ? function(R, B) {
                  R.__proto__ = B;
                } : function(R, B) {
                  for (var J in B) R[J] = B[J];
                };
                function K(R) {
                  return Ae(R, V), R;
                }
                var ee = function(R, B) {
                  return B.querySelector(R);
                }, oe = function(R, B) {
                  return B.querySelectorAll(R);
                }, _ = function(R, B) {
                  var J = R.matches || R[se(R, "matchesSelector")];
                  return _ = function(de, pe) {
                    return J.call(de, pe);
                  }, _(R, B);
                };
                typeof Sizzle == "function" && (ee = function(R, B) {
                  return Sizzle(R, B)[0] || null;
                }, oe = Sizzle, _ = Sizzle.matchesSelector), f.selection = function() {
                  return f.select(y.documentElement);
                };
                var V = f.selection.prototype = [];
                V.select = function(R) {
                  var B = [], J, de, pe, ye;
                  R = fe(R);
                  for (var ke = -1, Ee = this.length; ++ke < Ee; ) {
                    B.push(J = []), J.parentNode = (pe = this[ke]).parentNode;
                    for (var He = -1, Ke = pe.length; ++He < Ke; )
                      (ye = pe[He]) ? (J.push(de = R.call(ye, ye.__data__, He, ke)), de && "__data__" in ye && (de.__data__ = ye.__data__)) : J.push(null);
                  }
                  return K(B);
                };
                function fe(R) {
                  return typeof R == "function" ? R : function() {
                    return ee(R, this);
                  };
                }
                V.selectAll = function(R) {
                  var B = [], J, de;
                  R = $(R);
                  for (var pe = -1, ye = this.length; ++pe < ye; )
                    for (var ke = this[pe], Ee = -1, He = ke.length; ++Ee < He; )
                      (de = ke[Ee]) && (B.push(J = g(R.call(de, de.__data__, Ee, pe))), J.parentNode = de);
                  return K(B);
                };
                function $(R) {
                  return typeof R == "function" ? R : function() {
                    return oe(R, this);
                  };
                }
                var he = "http://www.w3.org/1999/xhtml", me = {
                  svg: "http://www.w3.org/2000/svg",
                  xhtml: he,
                  xlink: "http://www.w3.org/1999/xlink",
                  xml: "http://www.w3.org/XML/1998/namespace",
                  xmlns: "http://www.w3.org/2000/xmlns/"
                };
                f.ns = {
                  prefix: me,
                  qualify: function(R) {
                    var B = R.indexOf(":"), J = R;
                    return B >= 0 && (J = R.slice(0, B)) !== "xmlns" && (R = R.slice(B + 1)), me.hasOwnProperty(J) ? {
                      space: me[J],
                      local: R
                    } : R;
                  }
                }, V.attr = function(R, B) {
                  if (arguments.length < 2) {
                    if (typeof R == "string") {
                      var J = this.node();
                      return R = f.ns.qualify(R), R.local ? J.getAttributeNS(R.space, R.local) : J.getAttribute(R);
                    }
                    for (B in R) this.each(xe(B, R[B]));
                    return this;
                  }
                  return this.each(xe(R, B));
                };
                function xe(R, B) {
                  R = f.ns.qualify(R);
                  function J() {
                    this.removeAttribute(R);
                  }
                  function de() {
                    this.removeAttributeNS(R.space, R.local);
                  }
                  function pe() {
                    this.setAttribute(R, B);
                  }
                  function ye() {
                    this.setAttributeNS(R.space, R.local, B);
                  }
                  function ke() {
                    var He = B.apply(this, arguments);
                    He == null ? this.removeAttribute(R) : this.setAttribute(R, He);
                  }
                  function Ee() {
                    var He = B.apply(this, arguments);
                    He == null ? this.removeAttributeNS(R.space, R.local) : this.setAttributeNS(R.space, R.local, He);
                  }
                  return B == null ? R.local ? de : J : typeof B == "function" ? R.local ? Ee : ke : R.local ? ye : pe;
                }
                function Fe(R) {
                  return R.trim().replace(/\s+/g, " ");
                }
                V.classed = function(R, B) {
                  if (arguments.length < 2) {
                    if (typeof R == "string") {
                      var J = this.node(), de = (R = Be(R)).length, pe = -1;
                      if (B = J.classList) {
                        for (; ++pe < de; ) if (!B.contains(R[pe])) return !1;
                      } else
                        for (B = J.getAttribute("class"); ++pe < de; ) if (!Ve(R[pe]).test(B)) return !1;
                      return !0;
                    }
                    for (B in R) this.each(Je(B, R[B]));
                    return this;
                  }
                  return this.each(Je(R, B));
                };
                function Ve(R) {
                  return new RegExp("(?:^|\\s+)" + f.requote(R) + "(?:\\s+|$)", "g");
                }
                function Be(R) {
                  return (R + "").trim().split(/^|\s+/);
                }
                function Je(R, B) {
                  R = Be(R).map(et);
                  var J = R.length;
                  function de() {
                    for (var ye = -1; ++ye < J; ) R[ye](this, B);
                  }
                  function pe() {
                    for (var ye = -1, ke = B.apply(this, arguments); ++ye < J; ) R[ye](this, ke);
                  }
                  return typeof B == "function" ? pe : de;
                }
                function et(R) {
                  var B = Ve(R);
                  return function(J, de) {
                    if (pe = J.classList) return de ? pe.add(R) : pe.remove(R);
                    var pe = J.getAttribute("class") || "";
                    de ? (B.lastIndex = 0, B.test(pe) || J.setAttribute("class", Fe(pe + " " + R))) : J.setAttribute("class", Fe(pe.replace(B, " ")));
                  };
                }
                V.style = function(R, B, J) {
                  var de = arguments.length;
                  if (de < 3) {
                    if (typeof R != "string") {
                      de < 2 && (B = "");
                      for (J in R) this.each(at(J, R[J], B));
                      return this;
                    }
                    if (de < 2) {
                      var pe = this.node();
                      return m(pe).getComputedStyle(pe, null).getPropertyValue(R);
                    }
                    J = "";
                  }
                  return this.each(at(R, B, J));
                };
                function at(R, B, J) {
                  function de() {
                    this.style.removeProperty(R);
                  }
                  function pe() {
                    this.style.setProperty(R, B, J);
                  }
                  function ye() {
                    var ke = B.apply(this, arguments);
                    ke == null ? this.style.removeProperty(R) : this.style.setProperty(R, ke, J);
                  }
                  return B == null ? de : typeof B == "function" ? ye : pe;
                }
                V.property = function(R, B) {
                  if (arguments.length < 2) {
                    if (typeof R == "string") return this.node()[R];
                    for (B in R) this.each(De(B, R[B]));
                    return this;
                  }
                  return this.each(De(R, B));
                };
                function De(R, B) {
                  function J() {
                    delete this[R];
                  }
                  function de() {
                    this[R] = B;
                  }
                  function pe() {
                    var ye = B.apply(this, arguments);
                    ye == null ? delete this[R] : this[R] = ye;
                  }
                  return B == null ? J : typeof B == "function" ? pe : de;
                }
                V.text = function(R) {
                  return arguments.length ? this.each(typeof R == "function" ? function() {
                    var B = R.apply(this, arguments);
                    this.textContent = B ?? "";
                  } : R == null ? function() {
                    this.textContent = "";
                  } : function() {
                    this.textContent = R;
                  }) : this.node().textContent;
                }, V.html = function(R) {
                  return arguments.length ? this.each(typeof R == "function" ? function() {
                    var B = R.apply(this, arguments);
                    this.innerHTML = B ?? "";
                  } : R == null ? function() {
                    this.innerHTML = "";
                  } : function() {
                    this.innerHTML = R;
                  }) : this.node().innerHTML;
                }, V.append = function(R) {
                  return R = Ne(R), this.select(function() {
                    return this.appendChild(R.apply(this, arguments));
                  });
                };
                function Ne(R) {
                  function B() {
                    var de = this.ownerDocument, pe = this.namespaceURI;
                    return pe === he && de.documentElement.namespaceURI === he ? de.createElement(R) : de.createElementNS(pe, R);
                  }
                  function J() {
                    return this.ownerDocument.createElementNS(R.space, R.local);
                  }
                  return typeof R == "function" ? R : (R = f.ns.qualify(R)).local ? J : B;
                }
                V.insert = function(R, B) {
                  return R = Ne(R), B = fe(B), this.select(function() {
                    return this.insertBefore(R.apply(this, arguments), B.apply(this, arguments) || null);
                  });
                }, V.remove = function() {
                  return this.each(Ie);
                };
                function Ie() {
                  var R = this.parentNode;
                  R && R.removeChild(this);
                }
                V.data = function(R, B) {
                  var J = -1, de = this.length, pe, ye;
                  if (!arguments.length) {
                    for (R = new Array(de = (pe = this[0]).length); ++J < de; )
                      (ye = pe[J]) && (R[J] = ye.__data__);
                    return R;
                  }
                  function ke(Qe, yt) {
                    var mt, Bt = Qe.length, Zt = yt.length, qe = Math.min(Bt, Zt), Et = new Array(Zt), Dt = new Array(Zt), Xt = new Array(Bt), Kt, Vt;
                    if (B) {
                      var wr = new Y(), Wr = new Array(Bt), Xr;
                      for (mt = -1; ++mt < Bt; )
                        (Kt = Qe[mt]) && (wr.has(Xr = B.call(Kt, Kt.__data__, mt)) ? Xt[mt] = Kt : wr.set(Xr, Kt), Wr[mt] = Xr);
                      for (mt = -1; ++mt < Zt; )
                        (Kt = wr.get(Xr = B.call(yt, Vt = yt[mt], mt))) ? Kt !== !0 && (Et[mt] = Kt, Kt.__data__ = Vt) : Dt[mt] = Ue(Vt), wr.set(Xr, !0);
                      for (mt = -1; ++mt < Bt; )
                        mt in Wr && wr.get(Wr[mt]) !== !0 && (Xt[mt] = Qe[mt]);
                    } else {
                      for (mt = -1; ++mt < qe; )
                        Kt = Qe[mt], Vt = yt[mt], Kt ? (Kt.__data__ = Vt, Et[mt] = Kt) : Dt[mt] = Ue(Vt);
                      for (; mt < Zt; ++mt)
                        Dt[mt] = Ue(yt[mt]);
                      for (; mt < Bt; ++mt)
                        Xt[mt] = Qe[mt];
                    }
                    Dt.update = Et, Dt.parentNode = Et.parentNode = Xt.parentNode = Qe.parentNode, Ee.push(Dt), He.push(Et), Ke.push(Xt);
                  }
                  var Ee = kt([]), He = K([]), Ke = K([]);
                  if (typeof R == "function")
                    for (; ++J < de; )
                      ke(pe = this[J], R.call(pe, pe.parentNode.__data__, J));
                  else
                    for (; ++J < de; )
                      ke(pe = this[J], R);
                  return He.enter = function() {
                    return Ee;
                  }, He.exit = function() {
                    return Ke;
                  }, He;
                };
                function Ue(R) {
                  return {
                    __data__: R
                  };
                }
                V.datum = function(R) {
                  return arguments.length ? this.property("__data__", R) : this.property("__data__");
                }, V.filter = function(R) {
                  var B = [], J, de, pe;
                  typeof R != "function" && (R = ot(R));
                  for (var ye = 0, ke = this.length; ye < ke; ye++) {
                    B.push(J = []), J.parentNode = (de = this[ye]).parentNode;
                    for (var Ee = 0, He = de.length; Ee < He; Ee++)
                      (pe = de[Ee]) && R.call(pe, pe.__data__, Ee, ye) && J.push(pe);
                  }
                  return K(B);
                };
                function ot(R) {
                  return function() {
                    return _(this, R);
                  };
                }
                V.order = function() {
                  for (var R = -1, B = this.length; ++R < B; )
                    for (var J = this[R], de = J.length - 1, pe = J[de], ye; --de >= 0; )
                      (ye = J[de]) && (pe && pe !== ye.nextSibling && pe.parentNode.insertBefore(ye, pe), pe = ye);
                  return this;
                }, V.sort = function(R) {
                  R = ct.apply(this, arguments);
                  for (var B = -1, J = this.length; ++B < J; ) this[B].sort(R);
                  return this.order();
                };
                function ct(R) {
                  return arguments.length || (R = T), function(B, J) {
                    return B && J ? R(B.__data__, J.__data__) : !B - !J;
                  };
                }
                V.each = function(R) {
                  return Tt(this, function(B, J, de) {
                    R.call(B, B.__data__, J, de);
                  });
                };
                function Tt(R, B) {
                  for (var J = 0, de = R.length; J < de; J++)
                    for (var pe = R[J], ye = 0, ke = pe.length, Ee; ye < ke; ye++)
                      (Ee = pe[ye]) && B(Ee, ye, J);
                  return R;
                }
                V.call = function(R) {
                  var B = g(arguments);
                  return R.apply(B[0] = this, B), this;
                }, V.empty = function() {
                  return !this.node();
                }, V.node = function() {
                  for (var R = 0, B = this.length; R < B; R++)
                    for (var J = this[R], de = 0, pe = J.length; de < pe; de++) {
                      var ye = J[de];
                      if (ye) return ye;
                    }
                  return null;
                }, V.size = function() {
                  var R = 0;
                  return Tt(this, function() {
                    ++R;
                  }), R;
                };
                function kt(R) {
                  return Ae(R, Ot), R;
                }
                var Ot = [];
                f.selection.enter = kt, f.selection.enter.prototype = Ot, Ot.append = V.append, Ot.empty = V.empty, Ot.node = V.node, Ot.call = V.call, Ot.size = V.size, Ot.select = function(R) {
                  for (var B = [], J, de, pe, ye, ke, Ee = -1, He = this.length; ++Ee < He; ) {
                    pe = (ye = this[Ee]).update, B.push(J = []), J.parentNode = ye.parentNode;
                    for (var Ke = -1, Qe = ye.length; ++Ke < Qe; )
                      (ke = ye[Ke]) ? (J.push(pe[Ke] = de = R.call(ye.parentNode, ke.__data__, Ke, Ee)), de.__data__ = ke.__data__) : J.push(null);
                  }
                  return K(B);
                }, Ot.insert = function(R, B) {
                  return arguments.length < 2 && (B = Rt(this)), V.insert.call(this, R, B);
                };
                function Rt(R) {
                  var B, J;
                  return function(de, pe, ye) {
                    var ke = R[ye].update, Ee = ke.length, He;
                    for (ye != J && (J = ye, B = 0), pe >= B && (B = pe + 1); !(He = ke[B]) && ++B < Ee; ) ;
                    return He;
                  };
                }
                f.select = function(R) {
                  var B;
                  return typeof R == "string" ? (B = [ee(R, y)], B.parentNode = y.documentElement) : (B = [R], B.parentNode = C(R)), K([B]);
                }, f.selectAll = function(R) {
                  var B;
                  return typeof R == "string" ? (B = g(oe(R, y)), B.parentNode = y.documentElement) : (B = g(R), B.parentNode = null), K([B]);
                }, V.on = function(R, B, J) {
                  var de = arguments.length;
                  if (de < 3) {
                    if (typeof R != "string") {
                      de < 2 && (B = !1);
                      for (J in R) this.each(xt(J, R[J], B));
                      return this;
                    }
                    if (de < 2) return (de = this.node()["__on" + R]) && de._;
                    J = !1;
                  }
                  return this.each(xt(R, B, J));
                };
                function xt(R, B, J) {
                  var de = "__on" + R, pe = R.indexOf("."), ye = bt;
                  pe > 0 && (R = R.slice(0, pe));
                  var ke = Wt.get(R);
                  ke && (R = ke, ye = jt);
                  function Ee() {
                    var Qe = this[de];
                    Qe && (this.removeEventListener(R, Qe, Qe.$), delete this[de]);
                  }
                  function He() {
                    var Qe = ye(B, g(arguments));
                    Ee.call(this), this.addEventListener(R, this[de] = Qe, Qe.$ = J), Qe._ = B;
                  }
                  function Ke() {
                    var Qe = new RegExp("^__on([^.]+)" + f.requote(R) + "$"), yt;
                    for (var mt in this)
                      if (yt = mt.match(Qe)) {
                        var Bt = this[mt];
                        this.removeEventListener(yt[1], Bt, Bt.$), delete this[mt];
                      }
                  }
                  return pe ? B ? He : Ee : B ? ue : Ke;
                }
                var Wt = f.map({
                  mouseenter: "mouseover",
                  mouseleave: "mouseout"
                });
                y && Wt.forEach(function(R) {
                  "on" + R in y && Wt.remove(R);
                });
                function bt(R, B) {
                  return function(J) {
                    var de = f.event;
                    f.event = J, B[0] = this.__data__;
                    try {
                      R.apply(this, B);
                    } finally {
                      f.event = de;
                    }
                  };
                }
                function jt(R, B) {
                  var J = bt(R, B);
                  return function(de) {
                    var pe = this, ye = de.relatedTarget;
                    (!ye || ye !== pe && !(ye.compareDocumentPosition(pe) & 8)) && J.call(pe, de);
                  };
                }
                var qt, Yt = 0;
                function Ut(R) {
                  var B = ".dragsuppress-" + ++Yt, J = "click" + B, de = f.select(m(R)).on("touchmove" + B, Me).on("dragstart" + B, Me).on("selectstart" + B, Me);
                  if (qt == null && (qt = "onselectstart" in R ? !1 : se(R.style, "userSelect")), qt) {
                    var pe = C(R).style, ye = pe[qt];
                    pe[qt] = "none";
                  }
                  return function(ke) {
                    if (de.on(B, null), qt && (pe[qt] = ye), ke) {
                      var Ee = function() {
                        de.on(J, null);
                      };
                      de.on(J, function() {
                        Me(), Ee();
                      }, !0), setTimeout(Ee, 0);
                    }
                  };
                }
                f.mouse = function(R) {
                  return ze(R, Ge());
                };
                var tt = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
                function ze(R, B) {
                  B.changedTouches && (B = B.changedTouches[0]);
                  var J = R.ownerSVGElement || R;
                  if (J.createSVGPoint) {
                    var de = J.createSVGPoint();
                    if (tt < 0) {
                      var pe = m(R);
                      if (pe.scrollX || pe.scrollY) {
                        J = f.select("body").append("svg").style({
                          position: "absolute",
                          top: 0,
                          left: 0,
                          margin: 0,
                          padding: 0,
                          border: "none"
                        }, "important");
                        var ye = J[0][0].getScreenCTM();
                        tt = !(ye.f || ye.e), J.remove();
                      }
                    }
                    return tt ? (de.x = B.pageX, de.y = B.pageY) : (de.x = B.clientX, de.y = B.clientY), de = de.matrixTransform(R.getScreenCTM().inverse()), [de.x, de.y];
                  }
                  var ke = R.getBoundingClientRect();
                  return [B.clientX - ke.left - R.clientLeft, B.clientY - ke.top - R.clientTop];
                }
                f.touch = function(R, B, J) {
                  if (arguments.length < 3 && (J = B, B = Ge().changedTouches), B) {
                    for (var de = 0, pe = B.length, ye; de < pe; ++de)
                      if ((ye = B[de]).identifier === J)
                        return ze(R, ye);
                  }
                }, f.behavior.drag = function() {
                  var R = we(pe, "drag", "dragstart", "dragend"), B = null, J = ye(ue, f.mouse, m, "mousemove", "mouseup"), de = ye(_e, f.touch, U, "touchmove", "touchend");
                  function pe() {
                    this.on("mousedown.drag", J).on("touchstart.drag", de);
                  }
                  function ye(ke, Ee, He, Ke, Qe) {
                    return function() {
                      var yt = this, mt = f.event.target.correspondingElement || f.event.target, Bt = yt.parentNode, Zt = R.of(yt, arguments), qe = 0, Et = ke(), Dt = ".drag" + (Et == null ? "" : "-" + Et), Xt, Kt = f.select(He(mt)).on(Ke + Dt, Wr).on(Qe + Dt, Xr), Vt = Ut(mt), wr = Ee(Bt, Et);
                      B ? (Xt = B.apply(yt, arguments), Xt = [Xt.x - wr[0], Xt.y - wr[1]]) : Xt = [0, 0], Zt({
                        type: "dragstart"
                      });
                      function Wr() {
                        var _r = Ee(Bt, Et), en, Qr;
                        _r && (en = _r[0] - wr[0], Qr = _r[1] - wr[1], qe |= en | Qr, wr = _r, Zt({
                          type: "drag",
                          x: _r[0] + Xt[0],
                          y: _r[1] + Xt[1],
                          dx: en,
                          dy: Qr
                        }));
                      }
                      function Xr() {
                        Ee(Bt, Et) && (Kt.on(Ke + Dt, null).on(Qe + Dt, null), Vt(qe), Zt({
                          type: "dragend"
                        }));
                      }
                    };
                  }
                  return pe.origin = function(ke) {
                    return arguments.length ? (B = ke, pe) : B;
                  }, f.rebind(pe, R, "on");
                };
                function _e() {
                  return f.event.changedTouches[0].identifier;
                }
                f.touches = function(R, B) {
                  return arguments.length < 2 && (B = Ge().touches), B ? g(B).map(function(J) {
                    var de = ze(R, J);
                    return de.identifier = J.identifier, de;
                  }) : [];
                };
                var Ye = 1e-6, lt = Ye * Ye, Te = Math.PI, Oe = 2 * Te, je = Oe - Ye, Xe = Te / 2, nt = Te / 180, it = 180 / Te;
                function Nt(R, B, J) {
                  return (B[0] - R[0]) * (J[1] - R[1]) - (B[1] - R[1]) * (J[0] - R[0]);
                }
                function At(R) {
                  return R > 1 ? Xe : R < -1 ? -Xe : Math.asin(R);
                }
                function vt(R) {
                  return ((R = Math.exp(R)) - 1 / R) / 2;
                }
                function ut(R) {
                  return ((R = Math.exp(R)) + 1 / R) / 2;
                }
                function Pt(R) {
                  return ((R = Math.exp(2 * R)) - 1) / (R + 1);
                }
                var rr = Math.SQRT2, lr = 2, Mr = 4;
                f.interpolateZoom = function(R, B) {
                  var J = R[0], de = R[1], pe = R[2], ye = B[0], ke = B[1], Ee = B[2], He = ye - J, Ke = ke - de, Qe = He * He + Ke * Ke, yt, mt;
                  if (Qe < lt)
                    mt = Math.log(Ee / pe) / rr, yt = function(Xt) {
                      return [J + Xt * He, de + Xt * Ke, pe * Math.exp(rr * Xt * mt)];
                    };
                  else {
                    var Bt = Math.sqrt(Qe), Zt = (Ee * Ee - pe * pe + Mr * Qe) / (2 * pe * lr * Bt), qe = (Ee * Ee - pe * pe - Mr * Qe) / (2 * Ee * lr * Bt), Et = Math.log(Math.sqrt(Zt * Zt + 1) - Zt), Dt = Math.log(Math.sqrt(qe * qe + 1) - qe);
                    mt = (Dt - Et) / rr, yt = function(Xt) {
                      var Kt = Xt * mt, Vt = ut(Et), wr = pe / (lr * Bt) * (Vt * Pt(rr * Kt + Et) - vt(Et));
                      return [J + wr * He, de + wr * Ke, pe * Vt / ut(rr * Kt + Et)];
                    };
                  }
                  return yt.duration = mt * 1e3, yt;
                }, f.behavior.zoom = function() {
                  var R = {
                    x: 0,
                    y: 0,
                    k: 1
                  }, B, J, de, pe = [960, 500], ye = Rr, ke = 250, Ee = 0, He = "mousedown.zoom", Ke = "mousemove.zoom", Qe = "mouseup.zoom", yt, mt = "touchstart.zoom", Bt, Zt = we(Kt, "zoomstart", "zoom", "zoomend"), qe, Et, Dt, Xt;
                  ir || (ir = "onwheel" in y ? (Pr = function() {
                    return -f.event.deltaY * (f.event.deltaMode ? 120 : 1);
                  }, "wheel") : "onmousewheel" in y ? (Pr = function() {
                    return f.event.wheelDelta;
                  }, "mousewheel") : (Pr = function() {
                    return -f.event.detail;
                  }, "MozMousePixelScroll"));
                  function Kt(Nr) {
                    Nr.on(He, An).on(ir + ".zoom", $i).on("dblclick.zoom", ui).on(mt, ti);
                  }
                  Kt.event = function(Nr) {
                    Nr.each(function() {
                      var un = Zt.of(this, arguments), Nn = R;
                      bo ? f.select(this).transition().each("start.zoom", function() {
                        R = this.__chart__ || {
                          x: 0,
                          y: 0,
                          k: 1
                        }, Qr(un);
                      }).tween("zoom:zoom", function() {
                        var xn = pe[0], wi = pe[1], ea = J ? J[0] : xn / 2, ua = J ? J[1] : wi / 2, ga = f.interpolateZoom([(ea - R.x) / R.k, (ua - R.y) / R.k, xn / R.k], [(ea - Nn.x) / Nn.k, (ua - Nn.y) / Nn.k, xn / Nn.k]);
                        return function(ro) {
                          var ja = ga(ro), co = xn / ja[2];
                          this.__chart__ = R = {
                            x: ea - ja[0] * co,
                            y: ua - ja[1] * co,
                            k: co
                          }, En(un);
                        };
                      }).each("interrupt.zoom", function() {
                        qr(un);
                      }).each("end.zoom", function() {
                        qr(un);
                      }) : (this.__chart__ = R, Qr(un), En(un), qr(un));
                    });
                  }, Kt.translate = function(Nr) {
                    return arguments.length ? (R = {
                      x: +Nr[0],
                      y: +Nr[1],
                      k: R.k
                    }, en(), Kt) : [R.x, R.y];
                  }, Kt.scale = function(Nr) {
                    return arguments.length ? (R = {
                      x: R.x,
                      y: R.y,
                      k: null
                    }, Wr(+Nr), en(), Kt) : R.k;
                  }, Kt.scaleExtent = function(Nr) {
                    return arguments.length ? (ye = Nr == null ? Rr : [+Nr[0], +Nr[1]], Kt) : ye;
                  }, Kt.center = function(Nr) {
                    return arguments.length ? (de = Nr && [+Nr[0], +Nr[1]], Kt) : de;
                  }, Kt.size = function(Nr) {
                    return arguments.length ? (pe = Nr && [+Nr[0], +Nr[1]], Kt) : pe;
                  }, Kt.duration = function(Nr) {
                    return arguments.length ? (ke = +Nr, Kt) : ke;
                  }, Kt.x = function(Nr) {
                    return arguments.length ? (Et = Nr, qe = Nr.copy(), R = {
                      x: 0,
                      y: 0,
                      k: 1
                    }, Kt) : Et;
                  }, Kt.y = function(Nr) {
                    return arguments.length ? (Xt = Nr, Dt = Nr.copy(), R = {
                      x: 0,
                      y: 0,
                      k: 1
                    }, Kt) : Xt;
                  };
                  function Vt(Nr) {
                    return [(Nr[0] - R.x) / R.k, (Nr[1] - R.y) / R.k];
                  }
                  function wr(Nr) {
                    return [Nr[0] * R.k + R.x, Nr[1] * R.k + R.y];
                  }
                  function Wr(Nr) {
                    R.k = Math.max(ye[0], Math.min(ye[1], Nr));
                  }
                  function Xr(Nr, un) {
                    un = wr(un), R.x += Nr[0] - un[0], R.y += Nr[1] - un[1];
                  }
                  function _r(Nr, un, Nn, xn) {
                    Nr.__chart__ = {
                      x: R.x,
                      y: R.y,
                      k: R.k
                    }, Wr(Math.pow(2, xn)), Xr(J = un, Nn), Nr = f.select(Nr), ke > 0 && (Nr = Nr.transition().duration(ke)), Nr.call(Kt.event);
                  }
                  function en() {
                    Et && Et.domain(qe.range().map(function(Nr) {
                      return (Nr - R.x) / R.k;
                    }).map(qe.invert)), Xt && Xt.domain(Dt.range().map(function(Nr) {
                      return (Nr - R.y) / R.k;
                    }).map(Dt.invert));
                  }
                  function Qr(Nr) {
                    Ee++ || Nr({
                      type: "zoomstart"
                    });
                  }
                  function En(Nr) {
                    en(), Nr({
                      type: "zoom",
                      scale: R.k,
                      translate: [R.x, R.y]
                    });
                  }
                  function qr(Nr) {
                    --Ee || (Nr({
                      type: "zoomend"
                    }), J = null);
                  }
                  function An() {
                    var Nr = this, un = Zt.of(Nr, arguments), Nn = 0, xn = f.select(m(Nr)).on(Ke, ua).on(Qe, ga), wi = Vt(f.mouse(Nr)), ea = Ut(Nr);
                    Fu.call(Nr), Qr(un);
                    function ua() {
                      Nn = 1, Xr(f.mouse(Nr), wi), En(un);
                    }
                    function ga() {
                      xn.on(Ke, null).on(Qe, null), ea(Nn), qr(un);
                    }
                  }
                  function ti() {
                    var Nr = this, un = Zt.of(Nr, arguments), Nn = {}, xn = 0, wi, ea = ".zoom-" + f.event.changedTouches[0].identifier, ua = "touchmove" + ea, ga = "touchend" + ea, ro = [], ja = f.select(Nr), co = Ut(Nr);
                    Li(), Qr(un), ja.on(He, null).on(mt, Li);
                    function Ri() {
                      var Lo = f.touches(Nr);
                      return wi = R.k, Lo.forEach(function(ta) {
                        ta.identifier in Nn && (Nn[ta.identifier] = Vt(ta));
                      }), Lo;
                    }
                    function Li() {
                      var Lo = f.event.target;
                      f.select(Lo).on(ua, Bs).on(ga, zf), ro.push(Lo);
                      for (var ta = f.event.changedTouches, wo = 0, ko = ta.length; wo < ko; ++wo)
                        Nn[ta[wo].identifier] = null;
                      var So = Ri(), wl = Date.now();
                      if (So.length === 1) {
                        if (wl - Bt < 500) {
                          var Sl = So[0];
                          _r(Nr, Sl, Nn[Sl.identifier], Math.floor(Math.log(R.k) / Math.LN2) + 1), Me();
                        }
                        Bt = wl;
                      } else if (So.length > 1) {
                        var Sl = So[0], Zi = So[1], Zo = Sl[0] - Zi[0], Wf = Sl[1] - Zi[1];
                        xn = Zo * Zo + Wf * Wf;
                      }
                    }
                    function Bs() {
                      var Lo = f.touches(Nr), ta, wo, ko, So;
                      Fu.call(Nr);
                      for (var wl = 0, Sl = Lo.length; wl < Sl; ++wl, So = null)
                        if (ko = Lo[wl], So = Nn[ko.identifier]) {
                          if (wo) break;
                          ta = ko, wo = So;
                        }
                      if (So) {
                        var Zi = (Zi = ko[0] - ta[0]) * Zi + (Zi = ko[1] - ta[1]) * Zi, Zo = xn && Math.sqrt(Zi / xn);
                        ta = [(ta[0] + ko[0]) / 2, (ta[1] + ko[1]) / 2], wo = [(wo[0] + So[0]) / 2, (wo[1] + So[1]) / 2], Wr(Zo * wi);
                      }
                      Bt = null, Xr(ta, wo), En(un);
                    }
                    function zf() {
                      if (f.event.touches.length) {
                        for (var Lo = f.event.changedTouches, ta = 0, wo = Lo.length; ta < wo; ++ta)
                          delete Nn[Lo[ta].identifier];
                        for (var ko in Nn)
                          return void Ri();
                      }
                      f.selectAll(ro).on(ea, null), ja.on(He, An).on(mt, ti), co(), qr(un);
                    }
                  }
                  function $i() {
                    var Nr = Zt.of(this, arguments);
                    yt ? clearTimeout(yt) : (Fu.call(this), B = Vt(J = de || f.mouse(this)), Qr(Nr)), yt = setTimeout(function() {
                      yt = null, qr(Nr);
                    }, 50), Me(), Wr(Math.pow(2, Pr() * 2e-3) * R.k), Xr(J, B), En(Nr);
                  }
                  function ui() {
                    var Nr = f.mouse(this), un = Math.log(R.k) / Math.LN2;
                    _r(this, Nr, Vt(Nr), f.event.shiftKey ? Math.ceil(un) - 1 : Math.floor(un) + 1);
                  }
                  return f.rebind(Kt, Zt, "on");
                };
                var Rr = [0, 1 / 0], Pr, ir;
                f.color = Lr;
                function Lr() {
                }
                Lr.prototype.toString = function() {
                  return this.rgb() + "";
                }, f.hsl = yr;
                function yr(R, B, J) {
                  return this instanceof yr ? (this.h = +R, this.s = +B, void (this.l = +J)) : arguments.length < 2 ? R instanceof yr ? new yr(R.h, R.s, R.l) : Gt("" + R, Lt, yr) : new yr(R, B, J);
                }
                var Sr = yr.prototype = new Lr();
                Sr.brighter = function(R) {
                  return R = Math.pow(0.7, arguments.length ? R : 1), new yr(this.h, this.s, this.l / R);
                }, Sr.darker = function(R) {
                  return R = Math.pow(0.7, arguments.length ? R : 1), new yr(this.h, this.s, R * this.l);
                }, Sr.rgb = function() {
                  return Yr(this.h, this.s, this.l);
                };
                function Yr(R, B, J) {
                  var de, pe;
                  R = isNaN(R) ? 0 : (R %= 360) < 0 ? R + 360 : R, B = isNaN(B) || B < 0 ? 0 : B > 1 ? 1 : B, J = J < 0 ? 0 : J > 1 ? 1 : J, pe = J <= 0.5 ? J * (1 + B) : J + B - J * B, de = 2 * J - pe;
                  function ye(Ee) {
                    return Ee > 360 ? Ee -= 360 : Ee < 0 && (Ee += 360), Ee < 60 ? de + (pe - de) * Ee / 60 : Ee < 180 ? pe : Ee < 240 ? de + (pe - de) * (240 - Ee) / 60 : de;
                  }
                  function ke(Ee) {
                    return Math.round(ye(Ee) * 255);
                  }
                  return new Ct(ke(R + 120), ke(R), ke(R - 120));
                }
                f.hcl = Ar;
                function Ar(R, B, J) {
                  return this instanceof Ar ? (this.h = +R, this.c = +B, void (this.l = +J)) : arguments.length < 2 ? R instanceof Ar ? new Ar(R.h, R.c, R.l) : R instanceof br ? ft(R.l, R.a, R.b) : ft((R = $t((R = f.rgb(R)).r, R.g, R.b)).l, R.a, R.b) : new Ar(R, B, J);
                }
                var pr = Ar.prototype = new Lr();
                pr.brighter = function(R) {
                  return new Ar(this.h, this.c, Math.min(100, this.l + Gr * (arguments.length ? R : 1)));
                }, pr.darker = function(R) {
                  return new Ar(this.h, this.c, Math.max(0, this.l - Gr * (arguments.length ? R : 1)));
                }, pr.rgb = function() {
                  return kr(this.h, this.c, this.l).rgb();
                };
                function kr(R, B, J) {
                  return isNaN(R) && (R = 0), isNaN(B) && (B = 0), new br(J, Math.cos(R *= nt) * B, Math.sin(R) * B);
                }
                f.lab = br;
                function br(R, B, J) {
                  return this instanceof br ? (this.l = +R, this.a = +B, void (this.b = +J)) : arguments.length < 2 ? R instanceof br ? new br(R.l, R.a, R.b) : R instanceof Ar ? kr(R.h, R.c, R.l) : $t((R = Ct(R)).r, R.g, R.b) : new br(R, B, J);
                }
                var Gr = 18, rn = 0.95047, cn = 1, Dr = 1.08883, Se = br.prototype = new Lr();
                Se.brighter = function(R) {
                  return new br(Math.min(100, this.l + Gr * (arguments.length ? R : 1)), this.a, this.b);
                }, Se.darker = function(R) {
                  return new br(Math.max(0, this.l - Gr * (arguments.length ? R : 1)), this.a, this.b);
                }, Se.rgb = function() {
                  return ae(this.l, this.a, this.b);
                };
                function ae(R, B, J) {
                  var de = (R + 16) / 116, pe = de + B / 500, ye = de - J / 200;
                  return pe = rt(pe) * rn, de = rt(de) * cn, ye = rt(ye) * Dr, new Ct(wt(3.2404542 * pe - 1.5371385 * de - 0.4985314 * ye), wt(-0.969266 * pe + 1.8760108 * de + 0.041556 * ye), wt(0.0556434 * pe - 0.2040259 * de + 1.0572252 * ye));
                }
                function ft(R, B, J) {
                  return R > 0 ? new Ar(Math.atan2(J, B) * it, Math.sqrt(B * B + J * J), R) : new Ar(NaN, NaN, R);
                }
                function rt(R) {
                  return R > 0.206893034 ? R * R * R : (R - 0.13793103448275862) / 7.787037;
                }
                function gt(R) {
                  return R > 8856e-6 ? Math.pow(R, 0.3333333333333333) : 7.787037 * R + 0.13793103448275862;
                }
                function wt(R) {
                  return Math.round(255 * (R <= 304e-5 ? 12.92 * R : 1.055 * Math.pow(R, 0.4166666666666667) - 0.055));
                }
                f.rgb = Ct;
                function Ct(R, B, J) {
                  return this instanceof Ct ? (this.r = ~~R, this.g = ~~B, void (this.b = ~~J)) : arguments.length < 2 ? R instanceof Ct ? new Ct(R.r, R.g, R.b) : Gt("" + R, Ct, Yr) : new Ct(R, B, J);
                }
                function pt(R) {
                  return new Ct(R >> 16, R >> 8 & 255, R & 255);
                }
                function dt(R) {
                  return pt(R) + "";
                }
                var St = Ct.prototype = new Lr();
                St.brighter = function(R) {
                  R = Math.pow(0.7, arguments.length ? R : 1);
                  var B = this.r, J = this.g, de = this.b, pe = 30;
                  return !B && !J && !de ? new Ct(pe, pe, pe) : (B && B < pe && (B = pe), J && J < pe && (J = pe), de && de < pe && (de = pe), new Ct(Math.min(255, B / R), Math.min(255, J / R), Math.min(255, de / R)));
                }, St.darker = function(R) {
                  return R = Math.pow(0.7, arguments.length ? R : 1), new Ct(R * this.r, R * this.g, R * this.b);
                }, St.hsl = function() {
                  return Lt(this.r, this.g, this.b);
                }, St.toString = function() {
                  return "#" + Ft(this.r) + Ft(this.g) + Ft(this.b);
                };
                function Ft(R) {
                  return R < 16 ? "0" + Math.max(0, R).toString(16) : Math.min(255, R).toString(16);
                }
                function Gt(R, B, J) {
                  var de = 0, pe = 0, ye = 0, ke, Ee, He;
                  if (ke = /([a-z]+)\((.*)\)/.exec(R = R.toLowerCase()), ke)
                    switch (Ee = ke[2].split(","), ke[1]) {
                      case "hsl":
                        return J(parseFloat(Ee[0]), parseFloat(Ee[1]) / 100, parseFloat(Ee[2]) / 100);
                      case "rgb":
                        return B(zt(Ee[0]), zt(Ee[1]), zt(Ee[2]));
                    }
                  return (He = tr.get(R)) ? B(He.r, He.g, He.b) : (R != null && R.charAt(0) === "#" && !isNaN(He = parseInt(R.slice(1), 16)) && (R.length === 4 ? (de = (He & 3840) >> 4, de = de >> 4 | de, pe = He & 240, pe = pe >> 4 | pe, ye = He & 15, ye = ye << 4 | ye) : R.length === 7 && (de = (He & 16711680) >> 16, pe = (He & 65280) >> 8, ye = He & 255)), B(de, pe, ye));
                }
                function Lt(R, B, J) {
                  var de = Math.min(R /= 255, B /= 255, J /= 255), pe = Math.max(R, B, J), ye = pe - de, ke, Ee, He = (pe + de) / 2;
                  return ye ? (Ee = He < 0.5 ? ye / (pe + de) : ye / (2 - pe - de), R == pe ? ke = (B - J) / ye + (B < J ? 6 : 0) : B == pe ? ke = (J - R) / ye + 2 : ke = (R - B) / ye + 4, ke *= 60) : (ke = NaN, Ee = He > 0 && He < 1 ? 0 : ke), new yr(ke, Ee, He);
                }
                function $t(R, B, J) {
                  R = _t(R), B = _t(B), J = _t(J);
                  var de = gt((0.4124564 * R + 0.3575761 * B + 0.1804375 * J) / rn), pe = gt((0.2126729 * R + 0.7151522 * B + 0.072175 * J) / cn), ye = gt((0.0193339 * R + 0.119192 * B + 0.9503041 * J) / Dr);
                  return br(116 * pe - 16, 500 * (de - pe), 200 * (pe - ye));
                }
                function _t(R) {
                  return (R /= 255) <= 0.04045 ? R / 12.92 : Math.pow((R + 0.055) / 1.055, 2.4);
                }
                function zt(R) {
                  var B = parseFloat(R);
                  return R.charAt(R.length - 1) === "%" ? Math.round(B * 2.55) : B;
                }
                var tr = f.map({
                  aliceblue: 15792383,
                  antiquewhite: 16444375,
                  aqua: 65535,
                  aquamarine: 8388564,
                  azure: 15794175,
                  beige: 16119260,
                  bisque: 16770244,
                  black: 0,
                  blanchedalmond: 16772045,
                  blue: 255,
                  blueviolet: 9055202,
                  brown: 10824234,
                  burlywood: 14596231,
                  cadetblue: 6266528,
                  chartreuse: 8388352,
                  chocolate: 13789470,
                  coral: 16744272,
                  cornflowerblue: 6591981,
                  cornsilk: 16775388,
                  crimson: 14423100,
                  cyan: 65535,
                  darkblue: 139,
                  darkcyan: 35723,
                  darkgoldenrod: 12092939,
                  darkgray: 11119017,
                  darkgreen: 25600,
                  darkgrey: 11119017,
                  darkkhaki: 12433259,
                  darkmagenta: 9109643,
                  darkolivegreen: 5597999,
                  darkorange: 16747520,
                  darkorchid: 10040012,
                  darkred: 9109504,
                  darksalmon: 15308410,
                  darkseagreen: 9419919,
                  darkslateblue: 4734347,
                  darkslategray: 3100495,
                  darkslategrey: 3100495,
                  darkturquoise: 52945,
                  darkviolet: 9699539,
                  deeppink: 16716947,
                  deepskyblue: 49151,
                  dimgray: 6908265,
                  dimgrey: 6908265,
                  dodgerblue: 2003199,
                  firebrick: 11674146,
                  floralwhite: 16775920,
                  forestgreen: 2263842,
                  fuchsia: 16711935,
                  gainsboro: 14474460,
                  ghostwhite: 16316671,
                  gold: 16766720,
                  goldenrod: 14329120,
                  gray: 8421504,
                  green: 32768,
                  greenyellow: 11403055,
                  grey: 8421504,
                  honeydew: 15794160,
                  hotpink: 16738740,
                  indianred: 13458524,
                  indigo: 4915330,
                  ivory: 16777200,
                  khaki: 15787660,
                  lavender: 15132410,
                  lavenderblush: 16773365,
                  lawngreen: 8190976,
                  lemonchiffon: 16775885,
                  lightblue: 11393254,
                  lightcoral: 15761536,
                  lightcyan: 14745599,
                  lightgoldenrodyellow: 16448210,
                  lightgray: 13882323,
                  lightgreen: 9498256,
                  lightgrey: 13882323,
                  lightpink: 16758465,
                  lightsalmon: 16752762,
                  lightseagreen: 2142890,
                  lightskyblue: 8900346,
                  lightslategray: 7833753,
                  lightslategrey: 7833753,
                  lightsteelblue: 11584734,
                  lightyellow: 16777184,
                  lime: 65280,
                  limegreen: 3329330,
                  linen: 16445670,
                  magenta: 16711935,
                  maroon: 8388608,
                  mediumaquamarine: 6737322,
                  mediumblue: 205,
                  mediumorchid: 12211667,
                  mediumpurple: 9662683,
                  mediumseagreen: 3978097,
                  mediumslateblue: 8087790,
                  mediumspringgreen: 64154,
                  mediumturquoise: 4772300,
                  mediumvioletred: 13047173,
                  midnightblue: 1644912,
                  mintcream: 16121850,
                  mistyrose: 16770273,
                  moccasin: 16770229,
                  navajowhite: 16768685,
                  navy: 128,
                  oldlace: 16643558,
                  olive: 8421376,
                  olivedrab: 7048739,
                  orange: 16753920,
                  orangered: 16729344,
                  orchid: 14315734,
                  palegoldenrod: 15657130,
                  palegreen: 10025880,
                  paleturquoise: 11529966,
                  palevioletred: 14381203,
                  papayawhip: 16773077,
                  peachpuff: 16767673,
                  peru: 13468991,
                  pink: 16761035,
                  plum: 14524637,
                  powderblue: 11591910,
                  purple: 8388736,
                  rebeccapurple: 6697881,
                  red: 16711680,
                  rosybrown: 12357519,
                  royalblue: 4286945,
                  saddlebrown: 9127187,
                  salmon: 16416882,
                  sandybrown: 16032864,
                  seagreen: 3050327,
                  seashell: 16774638,
                  sienna: 10506797,
                  silver: 12632256,
                  skyblue: 8900331,
                  slateblue: 6970061,
                  slategray: 7372944,
                  slategrey: 7372944,
                  snow: 16775930,
                  springgreen: 65407,
                  steelblue: 4620980,
                  tan: 13808780,
                  teal: 32896,
                  thistle: 14204888,
                  tomato: 16737095,
                  turquoise: 4251856,
                  violet: 15631086,
                  wheat: 16113331,
                  white: 16777215,
                  whitesmoke: 16119285,
                  yellow: 16776960,
                  yellowgreen: 10145074
                });
                tr.forEach(function(R, B) {
                  tr.set(R, pt(B));
                });
                function nr(R) {
                  return typeof R == "function" ? R : function() {
                    return R;
                  };
                }
                f.functor = nr, f.xhr = xr(U);
                function xr(R) {
                  return function(B, J, de) {
                    return arguments.length === 2 && typeof J == "function" && (de = J, J = null), Er(B, J, R, de);
                  };
                }
                function Er(R, B, J, de) {
                  var pe = {}, ye = f.dispatch("beforesend", "progress", "load", "error"), ke = {}, Ee = new XMLHttpRequest(), He = null;
                  self.XDomainRequest && !("withCredentials" in Ee) && /^(http(s)?:)?\/\//.test(R) && (Ee = new XDomainRequest()), "onload" in Ee ? Ee.onload = Ee.onerror = Ke : Ee.onreadystatechange = function() {
                    Ee.readyState > 3 && Ke();
                  };
                  function Ke() {
                    var Qe = Ee.status, yt;
                    if (!Qe && Ur(Ee) || Qe >= 200 && Qe < 300 || Qe === 304) {
                      try {
                        yt = J.call(pe, Ee);
                      } catch (mt) {
                        ye.error.call(pe, mt);
                        return;
                      }
                      ye.load.call(pe, yt);
                    } else
                      ye.error.call(pe, Ee);
                  }
                  return Ee.onprogress = function(Qe) {
                    var yt = f.event;
                    f.event = Qe;
                    try {
                      ye.progress.call(pe, Ee);
                    } finally {
                      f.event = yt;
                    }
                  }, pe.header = function(Qe, yt) {
                    return Qe = (Qe + "").toLowerCase(), arguments.length < 2 ? ke[Qe] : (yt == null ? delete ke[Qe] : ke[Qe] = yt + "", pe);
                  }, pe.mimeType = function(Qe) {
                    return arguments.length ? (B = Qe == null ? null : Qe + "", pe) : B;
                  }, pe.responseType = function(Qe) {
                    return arguments.length ? (He = Qe, pe) : He;
                  }, pe.response = function(Qe) {
                    return J = Qe, pe;
                  }, ["get", "post"].forEach(function(Qe) {
                    pe[Qe] = function() {
                      return pe.send.apply(pe, [Qe].concat(g(arguments)));
                    };
                  }), pe.send = function(Qe, yt, mt) {
                    if (arguments.length === 2 && typeof yt == "function" && (mt = yt, yt = null), Ee.open(Qe, R, !0), B != null && !("accept" in ke) && (ke.accept = B + ",*/*"), Ee.setRequestHeader) for (var Bt in ke) Ee.setRequestHeader(Bt, ke[Bt]);
                    return B != null && Ee.overrideMimeType && Ee.overrideMimeType(B), He != null && (Ee.responseType = He), mt != null && pe.on("error", mt).on("load", function(Zt) {
                      mt(null, Zt);
                    }), ye.beforesend.call(pe, Ee), Ee.send(yt ?? null), pe;
                  }, pe.abort = function() {
                    return Ee.abort(), pe;
                  }, f.rebind(pe, ye, "on"), de == null ? pe : pe.get(Jr(de));
                }
                function Jr(R) {
                  return R.length === 1 ? function(B, J) {
                    R(B == null ? J : null);
                  } : R;
                }
                function Ur(R) {
                  var B = R.responseType;
                  return B && B !== "text" ? R.response : R.responseText;
                }
                f.dsv = function(R, B) {
                  var J = new RegExp('["' + R + `
]`), de = R.charCodeAt(0);
                  function pe(Ke, Qe, yt) {
                    arguments.length < 3 && (yt = Qe, Qe = null);
                    var mt = Er(Ke, B, Qe == null ? ye : ke(Qe), yt);
                    return mt.row = function(Bt) {
                      return arguments.length ? mt.response((Qe = Bt) == null ? ye : ke(Bt)) : Qe;
                    }, mt;
                  }
                  function ye(Ke) {
                    return pe.parse(Ke.responseText);
                  }
                  function ke(Ke) {
                    return function(Qe) {
                      return pe.parse(Qe.responseText, Ke);
                    };
                  }
                  pe.parse = function(Ke, Qe) {
                    var yt;
                    return pe.parseRows(Ke, function(mt, Bt) {
                      if (yt) return yt(mt, Bt - 1);
                      var Zt = function(qe) {
                        for (var Et = {}, Dt = mt.length, Xt = 0; Xt < Dt; ++Xt)
                          Et[mt[Xt]] = qe[Xt];
                        return Et;
                      };
                      yt = Qe ? function(qe, Et) {
                        return Qe(Zt(qe), Et);
                      } : Zt;
                    });
                  }, pe.parseRows = function(Ke, Qe) {
                    var yt = {}, mt = {}, Bt = [], Zt = Ke.length, qe = 0, Et = 0, Dt, Xt;
                    function Kt() {
                      if (qe >= Zt) return mt;
                      if (Xt) return Xt = !1, yt;
                      var wr = qe;
                      if (Ke.charCodeAt(wr) === 34) {
                        for (var Wr = wr; Wr++ < Zt; )
                          if (Ke.charCodeAt(Wr) === 34) {
                            if (Ke.charCodeAt(Wr + 1) !== 34) break;
                            ++Wr;
                          }
                        qe = Wr + 2;
                        var Xr = Ke.charCodeAt(Wr + 1);
                        return Xr === 13 ? (Xt = !0, Ke.charCodeAt(Wr + 2) === 10 && ++qe) : Xr === 10 && (Xt = !0), Ke.slice(wr + 1, Wr).replace(/""/g, '"');
                      }
                      for (; qe < Zt; ) {
                        var Xr = Ke.charCodeAt(qe++), _r = 1;
                        if (Xr === 10) Xt = !0;
                        else if (Xr === 13)
                          Xt = !0, Ke.charCodeAt(qe) === 10 && (++qe, ++_r);
                        else if (Xr !== de) continue;
                        return Ke.slice(wr, qe - _r);
                      }
                      return Ke.slice(wr);
                    }
                    for (; (Dt = Kt()) !== mt; ) {
                      for (var Vt = []; Dt !== yt && Dt !== mt; )
                        Vt.push(Dt), Dt = Kt();
                      Qe && (Vt = Qe(Vt, Et++)) == null || Bt.push(Vt);
                    }
                    return Bt;
                  }, pe.format = function(Ke) {
                    if (Array.isArray(Ke[0])) return pe.formatRows(Ke);
                    var Qe = new X(), yt = [];
                    return Ke.forEach(function(mt) {
                      for (var Bt in mt)
                        Qe.has(Bt) || yt.push(Qe.add(Bt));
                    }), [yt.map(He).join(R)].concat(Ke.map(function(mt) {
                      return yt.map(function(Bt) {
                        return He(mt[Bt]);
                      }).join(R);
                    })).join(`
`);
                  }, pe.formatRows = function(Ke) {
                    return Ke.map(Ee).join(`
`);
                  };
                  function Ee(Ke) {
                    return Ke.map(He).join(R);
                  }
                  function He(Ke) {
                    return J.test(Ke) ? '"' + Ke.replace(/\"/g, '""') + '"' : Ke;
                  }
                  return pe;
                }, f.csv = f.dsv(",", "text/csv"), f.tsv = f.dsv("	", "text/tab-separated-values");
                var Br, dn, nn, Sn, ai = this[se(this, "requestAnimationFrame")] || function(R) {
                  setTimeout(R, 17);
                };
                f.timer = function() {
                  Dn.apply(this, arguments);
                };
                function Dn(R, B, J) {
                  var de = arguments.length;
                  de < 2 && (B = 0), de < 3 && (J = Date.now());
                  var pe = J + B, ye = {
                    c: R,
                    t: pe,
                    n: null
                  };
                  return dn ? dn.n = ye : Br = ye, dn = ye, nn || (Sn = clearTimeout(Sn), nn = 1, ai(on)), ye;
                }
                function on() {
                  var R = ri(), B = Fi() - R;
                  B > 24 ? (isFinite(B) && (clearTimeout(Sn), Sn = setTimeout(on, B)), nn = 0) : (nn = 1, ai(on));
                }
                f.timer.flush = function() {
                  ri(), Fi();
                };
                function ri() {
                  for (var R = Date.now(), B = Br; B; )
                    R >= B.t && B.c(R - B.t) && (B.c = null), B = B.n;
                  return R;
                }
                function Fi() {
                  for (var R, B = Br, J = 1 / 0; B; )
                    B.c ? (B.t < J && (J = B.t), B = (R = B).n) : B = R ? R.n = B.n : Br = B.n;
                  return dn = R, J;
                }
                f.round = function(R, B) {
                  return B ? Math.round(R * (B = Math.pow(10, B))) / B : Math.round(R);
                }, f.geom = {};
                function Pi(R) {
                  return R[0];
                }
                function pn(R) {
                  return R[1];
                }
                f.geom.hull = function(R) {
                  var B = Pi, J = pn;
                  if (arguments.length) return de(R);
                  function de(pe) {
                    if (pe.length < 3) return [];
                    var ye = nr(B), ke = nr(J), Ee, He = pe.length, Ke = [], Qe = [];
                    for (Ee = 0; Ee < He; Ee++)
                      Ke.push([+ye.call(this, pe[Ee], Ee), +ke.call(this, pe[Ee], Ee), Ee]);
                    for (Ke.sort(yn), Ee = 0; Ee < He; Ee++) Qe.push([Ke[Ee][0], -Ke[Ee][1]]);
                    var yt = hi(Ke), mt = hi(Qe), Bt = mt[0] === yt[0], Zt = mt[mt.length - 1] === yt[yt.length - 1], qe = [];
                    for (Ee = yt.length - 1; Ee >= 0; --Ee) qe.push(pe[Ke[yt[Ee]][2]]);
                    for (Ee = +Bt; Ee < mt.length - Zt; ++Ee) qe.push(pe[Ke[mt[Ee]][2]]);
                    return qe;
                  }
                  return de.x = function(pe) {
                    return arguments.length ? (B = pe, de) : B;
                  }, de.y = function(pe) {
                    return arguments.length ? (J = pe, de) : J;
                  }, de;
                };
                function hi(R) {
                  for (var B = R.length, J = [0, 1], de = 2, pe = 2; pe < B; pe++) {
                    for (; de > 1 && Nt(R[J[de - 2]], R[J[de - 1]], R[pe]) <= 0; ) --de;
                    J[de++] = pe;
                  }
                  return J.slice(0, de);
                }
                function yn(R, B) {
                  return R[0] - B[0] || R[1] - B[1];
                }
                f.geom.polygon = function(R) {
                  return Ae(R, Pn), R;
                };
                var Pn = f.geom.polygon.prototype = [];
                Pn.area = function() {
                  for (var R = -1, B = this.length, J, de = this[B - 1], pe = 0; ++R < B; )
                    J = de, de = this[R], pe += J[1] * de[0] - J[0] * de[1];
                  return pe * 0.5;
                }, Pn.centroid = function(R) {
                  var B = -1, J = this.length, de = 0, pe = 0, ye, ke = this[J - 1], Ee;
                  for (arguments.length || (R = -1 / (6 * this.area())); ++B < J; )
                    ye = ke, ke = this[B], Ee = ye[0] * ke[1] - ke[0] * ye[1], de += (ye[0] + ke[0]) * Ee, pe += (ye[1] + ke[1]) * Ee;
                  return [de * R, pe * R];
                }, Pn.clip = function(R) {
                  for (var B, J = Ln(R), de = -1, pe = this.length - Ln(this), ye, ke, Ee = this[pe - 1], He, Ke, Qe; ++de < pe; ) {
                    for (B = R.slice(), R.length = 0, He = this[de], Ke = B[(ke = B.length - J) - 1], ye = -1; ++ye < ke; )
                      Qe = B[ye], kn(Qe, Ee, He) ? (kn(Ke, Ee, He) || R.push(Wn(Ke, Qe, Ee, He)), R.push(Qe)) : kn(Ke, Ee, He) && R.push(Wn(Ke, Qe, Ee, He)), Ke = Qe;
                    J && R.push(R[0]), Ee = He;
                  }
                  return R;
                };
                function kn(R, B, J) {
                  return (J[0] - B[0]) * (R[1] - B[1]) < (J[1] - B[1]) * (R[0] - B[0]);
                }
                function Wn(R, B, J, de) {
                  var pe = R[0], ye = J[0], ke = B[0] - pe, Ee = de[0] - ye, He = R[1], Ke = J[1], Qe = B[1] - He, yt = de[1] - Ke, mt = (Ee * (He - Ke) - yt * (pe - ye)) / (yt * ke - Ee * Qe);
                  return [pe + mt * ke, He + mt * Qe];
                }
                function Ln(R) {
                  var B = R[0], J = R[R.length - 1];
                  return !(B[0] - J[0] || B[1] - J[1]);
                }
                var li, Bn, ci, Gi = [], pi, ei, fa = [];
                function Hi() {
                  qa(this), this.edge = this.site = this.circle = null;
                }
                function Ti(R) {
                  var B = Gi.pop() || new Hi();
                  return B.site = R, B;
                }
                function Ui(R) {
                  pa(R), ci.remove(R), Gi.push(R), qa(R);
                }
                function la(R) {
                  var B = R.circle, J = B.x, de = B.cy, pe = {
                    x: J,
                    y: de
                  }, ye = R.P, ke = R.N, Ee = [R];
                  Ui(R);
                  for (var He = ye; He.circle && A(J - He.circle.x) < Ye && A(de - He.circle.cy) < Ye; )
                    ye = He.P, Ee.unshift(He), Ui(He), He = ye;
                  Ee.unshift(He), pa(He);
                  for (var Ke = ke; Ke.circle && A(J - Ke.circle.x) < Ye && A(de - Ke.circle.cy) < Ye; )
                    ke = Ke.N, Ee.push(Ke), Ui(Ke), Ke = ke;
                  Ee.push(Ke), pa(Ke);
                  var Qe = Ee.length, yt;
                  for (yt = 1; yt < Qe; ++yt)
                    Ke = Ee[yt], He = Ee[yt - 1], so(Ke.edge, He.site, Ke.site, pe);
                  He = Ee[0], Ke = Ee[Qe - 1], Ke.edge = oo(He.site, Ke.site, null, pe), ha(He), ha(Ke);
                }
                function za(R) {
                  for (var B = R.x, J = R.y, de, pe, ye, ke, Ee = ci._; Ee; )
                    if (ye = ia(Ee, J) - B, ye > Ye) Ee = Ee.L;
                    else if (ke = B - aa(Ee, J), ke > Ye) {
                      if (!Ee.R) {
                        de = Ee;
                        break;
                      }
                      Ee = Ee.R;
                    } else {
                      ye > -Ye ? (de = Ee.P, pe = Ee) : ke > -Ye ? (de = Ee, pe = Ee.N) : de = pe = Ee;
                      break;
                    }
                  var He = Ti(R);
                  if (ci.insert(de, He), !(!de && !pe)) {
                    if (de === pe) {
                      pa(de), pe = Ti(de.site), ci.insert(He, pe), He.edge = pe.edge = oo(de.site, He.site), ha(de), ha(pe);
                      return;
                    }
                    if (!pe) {
                      He.edge = oo(de.site, He.site);
                      return;
                    }
                    pa(de), pa(pe);
                    var Ke = de.site, Qe = Ke.x, yt = Ke.y, mt = R.x - Qe, Bt = R.y - yt, Zt = pe.site, qe = Zt.x - Qe, Et = Zt.y - yt, Dt = 2 * (mt * Et - Bt * qe), Xt = mt * mt + Bt * Bt, Kt = qe * qe + Et * Et, Vt = {
                      x: (Et * Xt - Bt * Kt) / Dt + Qe,
                      y: (mt * Kt - qe * Xt) / Dt + yt
                    };
                    so(pe.edge, Ke, Zt, Vt), He.edge = oo(Ke, R, null, Vt), pe.edge = oo(R, Zt, null, Vt), ha(de), ha(pe);
                  }
                }
                function ia(R, B) {
                  var J = R.site, de = J.x, pe = J.y, ye = pe - B;
                  if (!ye) return de;
                  var ke = R.P;
                  if (!ke) return -1 / 0;
                  J = ke.site;
                  var Ee = J.x, He = J.y, Ke = He - B;
                  if (!Ke) return Ee;
                  var Qe = Ee - de, yt = 1 / ye - 1 / Ke, mt = Qe / Ke;
                  return yt ? (-mt + Math.sqrt(mt * mt - 2 * yt * (Qe * Qe / (-2 * Ke) - He + Ke / 2 + pe - ye / 2))) / yt + de : (de + Ee) / 2;
                }
                function aa(R, B) {
                  var J = R.N;
                  if (J) return ia(J, B);
                  var de = R.site;
                  return de.y === B ? de.x : 1 / 0;
                }
                function ao(R) {
                  this.site = R, this.edges = [];
                }
                ao.prototype.prepare = function() {
                  for (var R = this.edges, B = R.length, J; B--; )
                    J = R[B].edge, (!J.b || !J.a) && R.splice(B, 1);
                  return R.sort(ji), R.length;
                };
                function _o(R) {
                  for (var B = R[0][0], J = R[1][0], de = R[0][1], pe = R[1][1], ye, ke, Ee, He, Ke = Bn, Qe = Ke.length, yt, mt, Bt, Zt, qe, Et; Qe--; )
                    if (yt = Ke[Qe], !(!yt || !yt.prepare()))
                      for (Bt = yt.edges, Zt = Bt.length, mt = 0; mt < Zt; )
                        Et = Bt[mt].end(), Ee = Et.x, He = Et.y, qe = Bt[++mt % Zt].start(), ye = qe.x, ke = qe.y, (A(Ee - ye) > Ye || A(He - ke) > Ye) && (Bt.splice(mt, 0, new rl(tl(yt.site, Et, A(Ee - B) < Ye && pe - He > Ye ? {
                          x: B,
                          y: A(ye - B) < Ye ? ke : pe
                        } : A(He - pe) < Ye && J - Ee > Ye ? {
                          x: A(ke - pe) < Ye ? ye : J,
                          y: pe
                        } : A(Ee - J) < Ye && He - de > Ye ? {
                          x: J,
                          y: A(ye - J) < Ye ? ke : de
                        } : A(He - de) < Ye && Ee - B > Ye ? {
                          x: A(ke - de) < Ye ? ye : B,
                          y: de
                        } : null), yt.site, null)), ++Zt);
                }
                function ji(R, B) {
                  return B.angle - R.angle;
                }
                function Bi() {
                  qa(this), this.x = this.y = this.arc = this.site = this.cy = null;
                }
                function ha(R) {
                  var B = R.P, J = R.N;
                  if (!(!B || !J)) {
                    var de = B.site, pe = R.site, ye = J.site;
                    if (de !== ye) {
                      var ke = pe.x, Ee = pe.y, He = de.x - ke, Ke = de.y - Ee, Qe = ye.x - ke, Et = ye.y - Ee, yt = 2 * (He * Et - Ke * Qe);
                      if (!(yt >= -lt)) {
                        var mt = He * He + Ke * Ke, Bt = Qe * Qe + Et * Et, Zt = (Et * mt - Ke * Bt) / yt, qe = (He * Bt - Qe * mt) / yt, Et = qe + Ee, Dt = fa.pop() || new Bi();
                        Dt.arc = R, Dt.site = pe, Dt.x = Zt + ke, Dt.y = Et + Math.sqrt(Zt * Zt + qe * qe), Dt.cy = Et, R.circle = Dt;
                        for (var Xt = null, Kt = ei._; Kt; )
                          if (Dt.y < Kt.y || Dt.y === Kt.y && Dt.x <= Kt.x)
                            if (Kt.L) Kt = Kt.L;
                            else {
                              Xt = Kt.P;
                              break;
                            }
                          else if (Kt.R) Kt = Kt.R;
                          else {
                            Xt = Kt;
                            break;
                          }
                        ei.insert(Xt, Dt), Xt || (pi = Dt);
                      }
                    }
                  }
                }
                function pa(R) {
                  var B = R.circle;
                  B && (B.P || (pi = B.N), ei.remove(B), fa.push(B), qa(B), R.circle = null);
                }
                function oi(R, B, J, de) {
                  return function(pe) {
                    var ye = pe.a, ke = pe.b, Ee = ye.x, He = ye.y, Ke = ke.x, Qe = ke.y, yt = 0, mt = 1, Bt = Ke - Ee, Zt = Qe - He, qe;
                    if (qe = R - Ee, !(!Bt && qe > 0)) {
                      if (qe /= Bt, Bt < 0) {
                        if (qe < yt) return;
                        qe < mt && (mt = qe);
                      } else if (Bt > 0) {
                        if (qe > mt) return;
                        qe > yt && (yt = qe);
                      }
                      if (qe = J - Ee, !(!Bt && qe < 0)) {
                        if (qe /= Bt, Bt < 0) {
                          if (qe > mt) return;
                          qe > yt && (yt = qe);
                        } else if (Bt > 0) {
                          if (qe < yt) return;
                          qe < mt && (mt = qe);
                        }
                        if (qe = B - He, !(!Zt && qe > 0)) {
                          if (qe /= Zt, Zt < 0) {
                            if (qe < yt) return;
                            qe < mt && (mt = qe);
                          } else if (Zt > 0) {
                            if (qe > mt) return;
                            qe > yt && (yt = qe);
                          }
                          if (qe = de - He, !(!Zt && qe < 0)) {
                            if (qe /= Zt, Zt < 0) {
                              if (qe > mt) return;
                              qe > yt && (yt = qe);
                            } else if (Zt > 0) {
                              if (qe < yt) return;
                              qe < mt && (mt = qe);
                            }
                            return yt > 0 && (pe.a = {
                              x: Ee + yt * Bt,
                              y: He + yt * Zt
                            }), mt < 1 && (pe.b = {
                              x: Ee + mt * Bt,
                              y: He + mt * Zt
                            }), pe;
                          }
                        }
                      }
                    }
                  };
                }
                function Ii(R) {
                  for (var B = li, J = oi(R[0][0], R[0][1], R[1][0], R[1][1]), de = B.length, pe; de--; )
                    pe = B[de], (!Qa(pe, R) || !J(pe) || A(pe.a.x - pe.b.x) < Ye && A(pe.a.y - pe.b.y) < Ye) && (pe.a = pe.b = null, B.splice(de, 1));
                }
                function Qa(R, B) {
                  var J = R.b;
                  if (J) return !0;
                  var de = R.a, pe = B[0][0], ye = B[1][0], ke = B[0][1], Ee = B[1][1], He = R.l, Ke = R.r, Qe = He.x, yt = He.y, mt = Ke.x, Bt = Ke.y, Zt = (Qe + mt) / 2, qe = (yt + Bt) / 2, Et, Dt;
                  if (Bt === yt) {
                    if (Zt < pe || Zt >= ye) return;
                    if (Qe > mt) {
                      if (!de) de = {
                        x: Zt,
                        y: ke
                      };
                      else if (de.y >= Ee) return;
                      J = {
                        x: Zt,
                        y: Ee
                      };
                    } else {
                      if (!de) de = {
                        x: Zt,
                        y: Ee
                      };
                      else if (de.y < ke) return;
                      J = {
                        x: Zt,
                        y: ke
                      };
                    }
                  } else if (Et = (Qe - mt) / (Bt - yt), Dt = qe - Et * Zt, Et < -1 || Et > 1)
                    if (Qe > mt) {
                      if (!de) de = {
                        x: (ke - Dt) / Et,
                        y: ke
                      };
                      else if (de.y >= Ee) return;
                      J = {
                        x: (Ee - Dt) / Et,
                        y: Ee
                      };
                    } else {
                      if (!de) de = {
                        x: (Ee - Dt) / Et,
                        y: Ee
                      };
                      else if (de.y < ke) return;
                      J = {
                        x: (ke - Dt) / Et,
                        y: ke
                      };
                    }
                  else if (yt < Bt) {
                    if (!de) de = {
                      x: pe,
                      y: Et * pe + Dt
                    };
                    else if (de.x >= ye) return;
                    J = {
                      x: ye,
                      y: Et * ye + Dt
                    };
                  } else {
                    if (!de) de = {
                      x: ye,
                      y: Et * ye + Dt
                    };
                    else if (de.x < pe) return;
                    J = {
                      x: pe,
                      y: Et * pe + Dt
                    };
                  }
                  return R.a = de, R.b = J, !0;
                }
                function vo(R, B) {
                  this.l = R, this.r = B, this.a = this.b = null;
                }
                function oo(R, B, J, de) {
                  var pe = new vo(R, B);
                  return li.push(pe), J && so(pe, R, B, J), de && so(pe, B, R, de), Bn[R.i].edges.push(new rl(pe, R, B)), Bn[B.i].edges.push(new rl(pe, B, R)), pe;
                }
                function tl(R, B, J) {
                  var de = new vo(R, null);
                  return de.a = B, de.b = J, li.push(de), de;
                }
                function so(R, B, J, de) {
                  !R.a && !R.b ? (R.a = de, R.l = B, R.r = J) : R.l === J ? R.b = de : R.a = de;
                }
                function rl(R, B, J) {
                  var de = R.a, pe = R.b;
                  this.edge = R, this.site = B, this.angle = J ? Math.atan2(J.y - B.y, J.x - B.x) : R.l === B ? Math.atan2(pe.x - de.x, de.y - pe.y) : Math.atan2(de.x - pe.x, pe.y - de.y);
                }
                rl.prototype = {
                  start: function() {
                    return this.edge.l === this.site ? this.edge.a : this.edge.b;
                  },
                  end: function() {
                    return this.edge.l === this.site ? this.edge.b : this.edge.a;
                  }
                };
                function Oa() {
                  this._ = null;
                }
                function qa(R) {
                  R.U = R.C = R.L = R.R = R.P = R.N = null;
                }
                Oa.prototype = {
                  insert: function(R, B) {
                    var J, de, pe;
                    if (R) {
                      if (B.P = R, B.N = R.N, R.N && (R.N.P = B), R.N = B, R.R) {
                        for (R = R.R; R.L; ) R = R.L;
                        R.L = B;
                      } else
                        R.R = B;
                      J = R;
                    } else this._ ? (R = ff(this._), B.P = null, B.N = R, R.P = R.L = B, J = R) : (B.P = B.N = null, this._ = B, J = null);
                    for (B.L = B.R = null, B.U = J, B.C = !0, R = B; J && J.C; )
                      de = J.U, J === de.L ? (pe = de.R, pe && pe.C ? (J.C = pe.C = !1, de.C = !0, R = de) : (R === J.R && (oa(this, J), R = J, J = R.U), J.C = !1, de.C = !0, eo(this, de))) : (pe = de.L, pe && pe.C ? (J.C = pe.C = !1, de.C = !0, R = de) : (R === J.L && (eo(this, J), R = J, J = R.U), J.C = !1, de.C = !0, oa(this, de))), J = R.U;
                    this._.C = !1;
                  },
                  remove: function(R) {
                    R.N && (R.N.P = R.P), R.P && (R.P.N = R.N), R.N = R.P = null;
                    var B = R.U, J, de = R.L, pe = R.R, ye, ke;
                    if (de ? pe ? ye = ff(pe) : ye = de : ye = pe, B ? B.L === R ? B.L = ye : B.R = ye : this._ = ye, de && pe ? (ke = ye.C, ye.C = R.C, ye.L = de, de.U = ye, ye !== pe ? (B = ye.U, ye.U = R.U, R = ye.R, B.L = R, ye.R = pe, pe.U = ye) : (ye.U = B, B = ye, R = ye.R)) : (ke = R.C, R = ye), R && (R.U = B), !ke) {
                      if (R && R.C) {
                        R.C = !1;
                        return;
                      }
                      do {
                        if (R === this._) break;
                        if (R === B.L) {
                          if (J = B.R, J.C && (J.C = !1, B.C = !0, oa(this, B), J = B.R), J.L && J.L.C || J.R && J.R.C) {
                            (!J.R || !J.R.C) && (J.L.C = !1, J.C = !0, eo(this, J), J = B.R), J.C = B.C, B.C = J.R.C = !1, oa(this, B), R = this._;
                            break;
                          }
                        } else if (J = B.L, J.C && (J.C = !1, B.C = !0, eo(this, B), J = B.L), J.L && J.L.C || J.R && J.R.C) {
                          (!J.L || !J.L.C) && (J.R.C = !1, J.C = !0, oa(this, J), J = B.L), J.C = B.C, B.C = J.L.C = !1, eo(this, B), R = this._;
                          break;
                        }
                        J.C = !0, R = B, B = B.U;
                      } while (!R.C);
                      R && (R.C = !1);
                    }
                  }
                };
                function oa(R, B) {
                  var J = B, de = B.R, pe = J.U;
                  pe ? pe.L === J ? pe.L = de : pe.R = de : R._ = de, de.U = pe, J.U = de, J.R = de.L, J.R && (J.R.U = J), de.L = J;
                }
                function eo(R, B) {
                  var J = B, de = B.L, pe = J.U;
                  pe ? pe.L === J ? pe.L = de : pe.R = de : R._ = de, de.U = pe, J.U = de, J.L = de.R, J.L && (J.L.U = J), de.R = J;
                }
                function ff(R) {
                  for (; R.L; ) R = R.L;
                  return R;
                }
                function gu(R, B) {
                  var J = R.sort(jv).pop(), de, pe, ye;
                  for (li = [], Bn = new Array(R.length), ci = new Oa(), ei = new Oa(); ; )
                    if (ye = pi, J && (!ye || J.y < ye.y || J.y === ye.y && J.x < ye.x))
                      (J.x !== de || J.y !== pe) && (Bn[J.i] = new ao(J), za(J), de = J.x, pe = J.y), J = R.pop();
                    else if (ye)
                      la(ye.arc);
                    else
                      break;
                  B && (Ii(B), _o(B));
                  var ke = {
                    cells: Bn,
                    edges: li
                  };
                  return ci = ei = li = Bn = null, ke;
                }
                function jv(R, B) {
                  return B.y - R.y || B.x - R.x;
                }
                f.geom.voronoi = function(R) {
                  var B = Pi, J = pn, de = B, pe = J, ye = nl;
                  if (R) return ke(R);
                  function ke(He) {
                    var Ke = new Array(He.length), Qe = ye[0][0], yt = ye[0][1], mt = ye[1][0], Bt = ye[1][1];
                    return gu(Ee(He), ye).cells.forEach(function(Zt, qe) {
                      var Et = Zt.edges, Dt = Zt.site, Xt = Ke[qe] = Et.length ? Et.map(function(Kt) {
                        var Vt = Kt.start();
                        return [Vt.x, Vt.y];
                      }) : Dt.x >= Qe && Dt.x <= mt && Dt.y >= yt && Dt.y <= Bt ? [[Qe, Bt], [mt, Bt], [mt, yt], [Qe, yt]] : [];
                      Xt.point = He[qe];
                    }), Ke;
                  }
                  function Ee(He) {
                    return He.map(function(Ke, Qe) {
                      return {
                        x: Math.round(de(Ke, Qe) / Ye) * Ye,
                        y: Math.round(pe(Ke, Qe) / Ye) * Ye,
                        i: Qe
                      };
                    });
                  }
                  return ke.links = function(He) {
                    return gu(Ee(He)).edges.filter(function(Ke) {
                      return Ke.l && Ke.r;
                    }).map(function(Ke) {
                      return {
                        source: He[Ke.l.i],
                        target: He[Ke.r.i]
                      };
                    });
                  }, ke.triangles = function(He) {
                    var Ke = [];
                    return gu(Ee(He)).cells.forEach(function(Qe, yt) {
                      for (var mt = Qe.site, Bt = Qe.edges.sort(ji), Zt = -1, qe = Bt.length, Et, Dt = Bt[qe - 1].edge, Xt = Dt.l === mt ? Dt.r : Dt.l; ++Zt < qe; )
                        Et = Xt, Dt = Bt[Zt].edge, Xt = Dt.l === mt ? Dt.r : Dt.l, yt < Et.i && yt < Xt.i && Jh(mt, Et, Xt) < 0 && Ke.push([He[yt], He[Et.i], He[Xt.i]]);
                    }), Ke;
                  }, ke.x = function(He) {
                    return arguments.length ? (de = nr(B = He), ke) : B;
                  }, ke.y = function(He) {
                    return arguments.length ? (pe = nr(J = He), ke) : J;
                  }, ke.clipExtent = function(He) {
                    return arguments.length ? (ye = He ?? nl, ke) : ye === nl ? null : ye;
                  }, ke.size = function(He) {
                    return arguments.length ? ke.clipExtent(He && [[0, 0], He]) : ye === nl ? null : ye && ye[1];
                  }, ke;
                };
                var nl = [[-1e6, -1e6], [1e6, 1e6]];
                function Jh(R, B, J) {
                  return (R.x - J.x) * (B.y - R.y) - (R.x - B.x) * (J.y - R.y);
                }
                f.geom.delaunay = function(R) {
                  return f.geom.voronoi().triangles(R);
                }, f.geom.quadtree = function(R, B, J, de, pe) {
                  var ye = Pi, ke = pn, Ee;
                  if (Ee = arguments.length)
                    return ye = Yv, ke = hf, Ee === 3 && (pe = J, de = B, J = B = 0), He(R);
                  function He(Ke) {
                    var Qe, yt = nr(ye), mt = nr(ke), Bt, Zt, qe, Et, Dt, Xt, Kt, Vt;
                    if (B != null)
                      Dt = B, Xt = J, Kt = de, Vt = pe;
                    else if (Kt = Vt = -(Dt = Xt = 1 / 0), Bt = [], Zt = [], Et = Ke.length, Ee) for (qe = 0; qe < Et; ++qe)
                      Qe = Ke[qe], Qe.x < Dt && (Dt = Qe.x), Qe.y < Xt && (Xt = Qe.y), Qe.x > Kt && (Kt = Qe.x), Qe.y > Vt && (Vt = Qe.y), Bt.push(Qe.x), Zt.push(Qe.y);
                    else for (qe = 0; qe < Et; ++qe) {
                      var wr = +yt(Qe = Ke[qe], qe), Wr = +mt(Qe, qe);
                      wr < Dt && (Dt = wr), Wr < Xt && (Xt = Wr), wr > Kt && (Kt = wr), Wr > Vt && (Vt = Wr), Bt.push(wr), Zt.push(Wr);
                    }
                    var Xr = Kt - Dt, _r = Vt - Xt;
                    Xr > _r ? Vt = Xt + Xr : Kt = Dt + _r;
                    function en(qr, An, ti, $i, ui, Nr, un, Nn) {
                      if (!(isNaN(ti) || isNaN($i)))
                        if (qr.leaf) {
                          var xn = qr.x, wi = qr.y;
                          if (xn != null)
                            if (A(xn - ti) + A(wi - $i) < 0.01)
                              Qr(qr, An, ti, $i, ui, Nr, un, Nn);
                            else {
                              var ea = qr.point;
                              qr.x = qr.y = qr.point = null, Qr(qr, ea, xn, wi, ui, Nr, un, Nn), Qr(qr, An, ti, $i, ui, Nr, un, Nn);
                            }
                          else
                            qr.x = ti, qr.y = $i, qr.point = An;
                        } else
                          Qr(qr, An, ti, $i, ui, Nr, un, Nn);
                    }
                    function Qr(qr, An, ti, $i, ui, Nr, un, Nn) {
                      var xn = (ui + un) * 0.5, wi = (Nr + Nn) * 0.5, ea = ti >= xn, ua = $i >= wi, ga = ua << 1 | ea;
                      qr.leaf = !1, qr = qr.nodes[ga] || (qr.nodes[ga] = Qh()), ea ? ui = xn : un = xn, ua ? Nr = wi : Nn = wi, en(qr, An, ti, $i, ui, Nr, un, Nn);
                    }
                    var En = Qh();
                    if (En.add = function(qr) {
                      en(En, qr, +yt(qr, ++qe), +mt(qr, qe), Dt, Xt, Kt, Vt);
                    }, En.visit = function(qr) {
                      fc(qr, En, Dt, Xt, Kt, Vt);
                    }, En.find = function(qr) {
                      return pf(En, qr[0], qr[1], Dt, Xt, Kt, Vt);
                    }, qe = -1, B == null) {
                      for (; ++qe < Et; )
                        en(En, Ke[qe], Bt[qe], Zt[qe], Dt, Xt, Kt, Vt);
                      --qe;
                    } else Ke.forEach(En.add);
                    return Bt = Zt = Ke = Qe = null, En;
                  }
                  return He.x = function(Ke) {
                    return arguments.length ? (ye = Ke, He) : ye;
                  }, He.y = function(Ke) {
                    return arguments.length ? (ke = Ke, He) : ke;
                  }, He.extent = function(Ke) {
                    return arguments.length ? (Ke == null ? B = J = de = pe = null : (B = +Ke[0][0], J = +Ke[0][1], de = +Ke[1][0], pe = +Ke[1][1]), He) : B == null ? null : [[B, J], [de, pe]];
                  }, He.size = function(Ke) {
                    return arguments.length ? (Ke == null ? B = J = de = pe = null : (B = J = 0, de = +Ke[0], pe = +Ke[1]), He) : B == null ? null : [de - B, pe - J];
                  }, He;
                };
                function Yv(R) {
                  return R.x;
                }
                function hf(R) {
                  return R.y;
                }
                function Qh() {
                  return {
                    leaf: !0,
                    nodes: [],
                    point: null,
                    x: null,
                    y: null
                  };
                }
                function fc(R, B, J, de, pe, ye) {
                  if (!R(B, J, de, pe, ye)) {
                    var ke = (J + pe) * 0.5, Ee = (de + ye) * 0.5, He = B.nodes;
                    He[0] && fc(R, He[0], J, de, ke, Ee), He[1] && fc(R, He[1], ke, de, pe, Ee), He[2] && fc(R, He[2], J, Ee, ke, ye), He[3] && fc(R, He[3], ke, Ee, pe, ye);
                  }
                }
                function pf(R, B, J, de, pe, ye, ke) {
                  var Ee = 1 / 0, He;
                  return function Ke(Qe, yt, mt, Bt, Zt) {
                    if (!(yt > ye || mt > ke || Bt < de || Zt < pe)) {
                      if (qe = Qe.point) {
                        var qe, Et = B - Qe.x, Dt = J - Qe.y, Xt = Et * Et + Dt * Dt;
                        if (Xt < Ee) {
                          var Kt = Math.sqrt(Ee = Xt);
                          de = B - Kt, pe = J - Kt, ye = B + Kt, ke = J + Kt, He = qe;
                        }
                      }
                      for (var Vt = Qe.nodes, wr = (yt + Bt) * 0.5, Wr = (mt + Zt) * 0.5, Xr = B >= wr, _r = J >= Wr, en = _r << 1 | Xr, Qr = en + 4; en < Qr; ++en)
                        if (Qe = Vt[en & 3]) switch (en & 3) {
                          case 0:
                            Ke(Qe, yt, mt, wr, Wr);
                            break;
                          case 1:
                            Ke(Qe, wr, mt, Bt, Wr);
                            break;
                          case 2:
                            Ke(Qe, yt, Wr, wr, Zt);
                            break;
                          case 3:
                            Ke(Qe, wr, Wr, Bt, Zt);
                            break;
                        }
                    }
                  }(R, de, pe, ye, ke), He;
                }
                f.interpolateRgb = ud;
                function ud(R, B) {
                  R = f.rgb(R), B = f.rgb(B);
                  var J = R.r, de = R.g, pe = R.b, ye = B.r - J, ke = B.g - de, Ee = B.b - pe;
                  return function(He) {
                    return "#" + Ft(Math.round(J + ye * He)) + Ft(Math.round(de + ke * He)) + Ft(Math.round(pe + Ee * He));
                  };
                }
                f.interpolateObject = qh;
                function qh(R, B) {
                  var J = {}, de = {}, pe;
                  for (pe in R)
                    pe in B ? J[pe] = Ds(R[pe], B[pe]) : de[pe] = R[pe];
                  for (pe in B)
                    pe in R || (de[pe] = B[pe]);
                  return function(ye) {
                    for (pe in J) de[pe] = J[pe](ye);
                    return de;
                  };
                }
                f.interpolateNumber = Ms;
                function Ms(R, B) {
                  return R = +R, B = +B, function(J) {
                    return R * (1 - J) + B * J;
                  };
                }
                f.interpolateString = vf;
                function vf(R, B) {
                  var J = cd.lastIndex = il.lastIndex = 0, de, pe, ye, ke = -1, Ee = [], He = [];
                  for (R = R + "", B = B + ""; (de = cd.exec(R)) && (pe = il.exec(B)); )
                    (ye = pe.index) > J && (ye = B.slice(J, ye), Ee[ke] ? Ee[ke] += ye : Ee[++ke] = ye), (de = de[0]) === (pe = pe[0]) ? Ee[ke] ? Ee[ke] += pe : Ee[++ke] = pe : (Ee[++ke] = null, He.push({
                      i: ke,
                      x: Ms(de, pe)
                    })), J = il.lastIndex;
                  return J < B.length && (ye = B.slice(J), Ee[ke] ? Ee[ke] += ye : Ee[++ke] = ye), Ee.length < 2 ? He[0] ? (B = He[0].x, function(Ke) {
                    return B(Ke) + "";
                  }) : function() {
                    return B;
                  } : (B = He.length, function(Ke) {
                    for (var Qe = 0, yt; Qe < B; ++Qe) Ee[(yt = He[Qe]).i] = yt.x(Ke);
                    return Ee.join("");
                  });
                }
                var cd = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, il = new RegExp(cd.source, "g");
                f.interpolate = Ds;
                function Ds(R, B) {
                  for (var J = f.interpolators.length, de; --J >= 0 && !(de = f.interpolators[J](R, B)); ) ;
                  return de;
                }
                f.interpolators = [function(R, B) {
                  var J = typeof B;
                  return (J === "string" ? tr.has(B.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(B) ? ud : vf : B instanceof Lr ? ud : Array.isArray(B) ? hc : J === "object" && isNaN(B) ? qh : Ms)(R, B);
                }], f.interpolateArray = hc;
                function hc(R, B) {
                  var J = [], de = [], pe = R.length, ye = B.length, ke = Math.min(R.length, B.length), Ee;
                  for (Ee = 0; Ee < ke; ++Ee) J.push(Ds(R[Ee], B[Ee]));
                  for (; Ee < pe; ++Ee) de[Ee] = R[Ee];
                  for (; Ee < ye; ++Ee) de[Ee] = B[Ee];
                  return function(He) {
                    for (Ee = 0; Ee < ke; ++Ee) de[Ee] = J[Ee](He);
                    return de;
                  };
                }
                var gf = function() {
                  return U;
                }, Xv = f.map({
                  linear: gf,
                  poly: yf,
                  quad: function() {
                    return tp;
                  },
                  cubic: function() {
                    return rp;
                  },
                  sin: function() {
                    return ip;
                  },
                  exp: function() {
                    return Ul;
                  },
                  circle: function() {
                    return Zv;
                  },
                  elastic: Kv,
                  back: Jv,
                  bounce: function() {
                    return ap;
                  }
                }), $v = f.map({
                  in: U,
                  out: mu,
                  "in-out": ep,
                  "out-in": function(R) {
                    return ep(mu(R));
                  }
                });
                f.ease = function(R) {
                  var B = R.indexOf("-"), J = B >= 0 ? R.slice(0, B) : R, de = B >= 0 ? R.slice(B + 1) : "in";
                  return J = Xv.get(J) || gf, de = $v.get(de) || U, mf(de(J.apply(null, p.call(arguments, 1))));
                };
                function mf(R) {
                  return function(B) {
                    return B <= 0 ? 0 : B >= 1 ? 1 : R(B);
                  };
                }
                function mu(R) {
                  return function(B) {
                    return 1 - R(1 - B);
                  };
                }
                function ep(R) {
                  return function(B) {
                    return 0.5 * (B < 0.5 ? R(2 * B) : 2 - R(2 - 2 * B));
                  };
                }
                function tp(R) {
                  return R * R;
                }
                function rp(R) {
                  return R * R * R;
                }
                function np(R) {
                  if (R <= 0) return 0;
                  if (R >= 1) return 1;
                  var B = R * R, J = B * R;
                  return 4 * (R < 0.5 ? J : 3 * (R - B) + J - 0.75);
                }
                function yf(R) {
                  return function(B) {
                    return Math.pow(B, R);
                  };
                }
                function ip(R) {
                  return 1 - Math.cos(R * Xe);
                }
                function Ul(R) {
                  return Math.pow(2, 10 * (R - 1));
                }
                function Zv(R) {
                  return 1 - Math.sqrt(1 - R * R);
                }
                function Kv(R, B) {
                  var J;
                  return arguments.length < 2 && (B = 0.45), arguments.length ? J = B / Oe * Math.asin(1 / R) : (R = 1, J = B / 4), function(de) {
                    return 1 + R * Math.pow(2, -10 * de) * Math.sin((de - J) * Oe / B);
                  };
                }
                function Jv(R) {
                  return R || (R = 1.70158), function(B) {
                    return B * B * ((R + 1) * B - R);
                  };
                }
                function ap(R) {
                  return R < 0.36363636363636365 ? 7.5625 * R * R : R < 0.7272727272727273 ? 7.5625 * (R -= 0.5454545454545454) * R + 0.75 : R < 0.9090909090909091 ? 7.5625 * (R -= 0.8181818181818182) * R + 0.9375 : 7.5625 * (R -= 0.9545454545454546) * R + 0.984375;
                }
                f.interpolateHcl = dd;
                function dd(R, B) {
                  R = f.hcl(R), B = f.hcl(B);
                  var J = R.h, de = R.c, pe = R.l, ye = B.h - J, ke = B.c - de, Ee = B.l - pe;
                  return isNaN(ke) && (ke = 0, de = isNaN(de) ? B.c : de), isNaN(ye) ? (ye = 0, J = isNaN(J) ? B.h : J) : ye > 180 ? ye -= 360 : ye < -180 && (ye += 360), function(He) {
                    return kr(J + ye * He, de + ke * He, pe + Ee * He) + "";
                  };
                }
                f.interpolateHsl = Uo;
                function Uo(R, B) {
                  R = f.hsl(R), B = f.hsl(B);
                  var J = R.h, de = R.s, pe = R.l, ye = B.h - J, ke = B.s - de, Ee = B.l - pe;
                  return isNaN(ke) && (ke = 0, de = isNaN(de) ? B.s : de), isNaN(ye) ? (ye = 0, J = isNaN(J) ? B.h : J) : ye > 180 ? ye -= 360 : ye < -180 && (ye += 360), function(He) {
                    return Yr(J + ye * He, de + ke * He, pe + Ee * He) + "";
                  };
                }
                f.interpolateLab = al;
                function al(R, B) {
                  R = f.lab(R), B = f.lab(B);
                  var J = R.l, de = R.a, pe = R.b, ye = B.l - J, ke = B.a - de, Ee = B.b - pe;
                  return function(He) {
                    return ae(J + ye * He, de + ke * He, pe + Ee * He) + "";
                  };
                }
                f.interpolateRound = Cf;
                function Cf(R, B) {
                  return B -= R, function(J) {
                    return Math.round(R + B * J);
                  };
                }
                f.transform = function(R) {
                  var B = y.createElementNS(f.ns.prefix.svg, "g");
                  return (f.transform = function(J) {
                    if (J != null) {
                      B.setAttribute("transform", J);
                      var de = B.transform.baseVal.consolidate();
                    }
                    return new as(de ? de.matrix : Sf);
                  })(R);
                };
                function as(R) {
                  var B = [R.a, R.b], J = [R.c, R.d], de = bf(B), pe = op(B, J), ye = bf(wf(J, B, -pe)) || 0;
                  B[0] * J[1] < J[0] * B[1] && (B[0] *= -1, B[1] *= -1, de *= -1, pe *= -1), this.rotate = (de ? Math.atan2(B[1], B[0]) : Math.atan2(-J[0], J[1])) * it, this.translate = [R.e, R.f], this.scale = [de, ye], this.skew = ye ? Math.atan2(pe, ye) * it : 0;
                }
                as.prototype.toString = function() {
                  return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")";
                };
                function op(R, B) {
                  return R[0] * B[0] + R[1] * B[1];
                }
                function bf(R) {
                  var B = Math.sqrt(op(R, R));
                  return B && (R[0] /= B, R[1] /= B), B;
                }
                function wf(R, B, J) {
                  return R[0] += J * B[0], R[1] += J * B[1], R;
                }
                var Sf = {
                  a: 1,
                  b: 0,
                  c: 0,
                  d: 1,
                  e: 0,
                  f: 0
                };
                f.interpolateTransform = Wa;
                function jl(R) {
                  return R.length ? R.pop() + "," : "";
                }
                function sp(R, B, J, de) {
                  if (R[0] !== B[0] || R[1] !== B[1]) {
                    var pe = J.push("translate(", null, ",", null, ")");
                    de.push({
                      i: pe - 4,
                      x: Ms(R[0], B[0])
                    }, {
                      i: pe - 2,
                      x: Ms(R[1], B[1])
                    });
                  } else (B[0] || B[1]) && J.push("translate(" + B + ")");
                }
                function xf(R, B, J, de) {
                  R !== B ? (R - B > 180 ? B += 360 : B - R > 180 && (R += 360), de.push({
                    i: J.push(jl(J) + "rotate(", null, ")") - 2,
                    x: Ms(R, B)
                  })) : B && J.push(jl(J) + "rotate(" + B + ")");
                }
                function Qv(R, B, J, de) {
                  R !== B ? de.push({
                    i: J.push(jl(J) + "skewX(", null, ")") - 2,
                    x: Ms(R, B)
                  }) : B && J.push(jl(J) + "skewX(" + B + ")");
                }
                function lp(R, B, J, de) {
                  if (R[0] !== B[0] || R[1] !== B[1]) {
                    var pe = J.push(jl(J) + "scale(", null, ",", null, ")");
                    de.push({
                      i: pe - 4,
                      x: Ms(R[0], B[0])
                    }, {
                      i: pe - 2,
                      x: Ms(R[1], B[1])
                    });
                  } else (B[0] !== 1 || B[1] !== 1) && J.push(jl(J) + "scale(" + B + ")");
                }
                function Wa(R, B) {
                  var J = [], de = [];
                  return R = f.transform(R), B = f.transform(B), sp(R.translate, B.translate, J, de), xf(R.rotate, B.rotate, J, de), Qv(R.skew, B.skew, J, de), lp(R.scale, B.scale, J, de), R = B = null, function(pe) {
                    for (var ye = -1, ke = de.length, Ee; ++ye < ke; ) J[(Ee = de[ye]).i] = Ee.x(pe);
                    return J.join("");
                  };
                }
                function qv(R, B) {
                  return B = (B -= R = +R) || 1 / B, function(J) {
                    return (J - R) / B;
                  };
                }
                function up(R, B) {
                  return B = (B -= R = +R) || 1 / B, function(J) {
                    return Math.max(0, Math.min(1, (J - R) / B));
                  };
                }
                f.layout = {}, f.layout.bundle = function() {
                  return function(R) {
                    for (var B = [], J = -1, de = R.length; ++J < de; ) B.push(Eo(R[J]));
                    return B;
                  };
                };
                function Eo(R) {
                  for (var B = R.source, J = R.target, de = pc(B, J), pe = [B]; B !== de; )
                    B = B.parent, pe.push(B);
                  for (var ye = pe.length; J !== de; )
                    pe.splice(ye, 0, J), J = J.parent;
                  return pe;
                }
                function cp(R) {
                  for (var B = [], J = R.parent; J != null; )
                    B.push(R), R = J, J = J.parent;
                  return B.push(R), B;
                }
                function pc(R, B) {
                  if (R === B) return R;
                  for (var J = cp(R), de = cp(B), pe = J.pop(), ye = de.pop(), ke = null; pe === ye; )
                    ke = pe, pe = J.pop(), ye = de.pop();
                  return ke;
                }
                f.layout.chord = function() {
                  var R = {}, B, J, de, pe, ye = 0, ke, Ee, He;
                  function Ke() {
                    var yt = {}, mt = [], Bt = f.range(pe), Zt = [], qe, Et, Dt, Xt, Kt;
                    for (B = [], J = [], qe = 0, Xt = -1; ++Xt < pe; ) {
                      for (Et = 0, Kt = -1; ++Kt < pe; )
                        Et += de[Xt][Kt];
                      mt.push(Et), Zt.push(f.range(pe)), qe += Et;
                    }
                    for (ke && Bt.sort(function(En, qr) {
                      return ke(mt[En], mt[qr]);
                    }), Ee && Zt.forEach(function(En, qr) {
                      En.sort(function(An, ti) {
                        return Ee(de[qr][An], de[qr][ti]);
                      });
                    }), qe = (Oe - ye * pe) / qe, Et = 0, Xt = -1; ++Xt < pe; ) {
                      for (Dt = Et, Kt = -1; ++Kt < pe; ) {
                        var Vt = Bt[Xt], wr = Zt[Vt][Kt], Wr = de[Vt][wr], Xr = Et, _r = Et += Wr * qe;
                        yt[Vt + "-" + wr] = {
                          index: Vt,
                          subindex: wr,
                          startAngle: Xr,
                          endAngle: _r,
                          value: Wr
                        };
                      }
                      J[Vt] = {
                        index: Vt,
                        startAngle: Dt,
                        endAngle: Et,
                        value: mt[Vt]
                      }, Et += ye;
                    }
                    for (Xt = -1; ++Xt < pe; )
                      for (Kt = Xt - 1; ++Kt < pe; ) {
                        var en = yt[Xt + "-" + Kt], Qr = yt[Kt + "-" + Xt];
                        (en.value || Qr.value) && B.push(en.value < Qr.value ? {
                          source: Qr,
                          target: en
                        } : {
                          source: en,
                          target: Qr
                        });
                      }
                    He && Qe();
                  }
                  function Qe() {
                    B.sort(function(yt, mt) {
                      return He((yt.source.value + yt.target.value) / 2, (mt.source.value + mt.target.value) / 2);
                    });
                  }
                  return R.matrix = function(yt) {
                    return arguments.length ? (pe = (de = yt) && de.length, B = J = null, R) : de;
                  }, R.padding = function(yt) {
                    return arguments.length ? (ye = yt, B = J = null, R) : ye;
                  }, R.sortGroups = function(yt) {
                    return arguments.length ? (ke = yt, B = J = null, R) : ke;
                  }, R.sortSubgroups = function(yt) {
                    return arguments.length ? (Ee = yt, B = null, R) : Ee;
                  }, R.sortChords = function(yt) {
                    return arguments.length ? (He = yt, B && Qe(), R) : He;
                  }, R.chords = function() {
                    return B || Ke(), B;
                  }, R.groups = function() {
                    return J || Ke(), J;
                  }, R;
                }, f.layout.force = function() {
                  var R = {}, B = f.dispatch("start", "tick", "end"), J, de = [1, 1], pe, ye, ke = 0.9, Ee = hp, He = yu, Ke = -30, Qe = vc, yt = 0.1, mt = 0.64, Bt = [], Zt = [], qe, Et, Dt;
                  function Xt(Vt) {
                    return function(wr, Wr, Xr, _r) {
                      if (wr.point !== Vt) {
                        var en = wr.cx - Vt.x, Qr = wr.cy - Vt.y, En = _r - Wr, qr = en * en + Qr * Qr;
                        if (En * En / mt < qr) {
                          if (qr < Qe) {
                            var An = wr.charge / qr;
                            Vt.px -= en * An, Vt.py -= Qr * An;
                          }
                          return !0;
                        }
                        if (wr.point && qr && qr < Qe) {
                          var An = wr.pointCharge / qr;
                          Vt.px -= en * An, Vt.py -= Qr * An;
                        }
                      }
                      return !wr.charge;
                    };
                  }
                  R.tick = function() {
                    if ((ye *= 0.99) < 5e-3)
                      return J = null, B.end({
                        type: "end",
                        alpha: ye = 0
                      }), !0;
                    var Vt = Bt.length, wr = Zt.length, Wr, Xr, _r, en, Qr, En, qr, An, ti;
                    for (Xr = 0; Xr < wr; ++Xr)
                      _r = Zt[Xr], en = _r.source, Qr = _r.target, An = Qr.x - en.x, ti = Qr.y - en.y, (En = An * An + ti * ti) && (En = ye * Et[Xr] * ((En = Math.sqrt(En)) - qe[Xr]) / En, An *= En, ti *= En, Qr.x -= An * (qr = en.weight + Qr.weight ? en.weight / (en.weight + Qr.weight) : 0.5), Qr.y -= ti * qr, en.x += An * (qr = 1 - qr), en.y += ti * qr);
                    if ((qr = ye * yt) && (An = de[0] / 2, ti = de[1] / 2, Xr = -1, qr))
                      for (; ++Xr < Vt; )
                        _r = Bt[Xr], _r.x += (An - _r.x) * qr, _r.y += (ti - _r.y) * qr;
                    if (Ke)
                      for (ol(Wr = f.geom.quadtree(Bt), ye, Dt), Xr = -1; ++Xr < Vt; )
                        (_r = Bt[Xr]).fixed || Wr.visit(Xt(_r));
                    for (Xr = -1; ++Xr < Vt; )
                      _r = Bt[Xr], _r.fixed ? (_r.x = _r.px, _r.y = _r.py) : (_r.x -= (_r.px - (_r.px = _r.x)) * ke, _r.y -= (_r.py - (_r.py = _r.y)) * ke);
                    B.tick({
                      type: "tick",
                      alpha: ye
                    });
                  }, R.nodes = function(Vt) {
                    return arguments.length ? (Bt = Vt, R) : Bt;
                  }, R.links = function(Vt) {
                    return arguments.length ? (Zt = Vt, R) : Zt;
                  }, R.size = function(Vt) {
                    return arguments.length ? (de = Vt, R) : de;
                  }, R.linkDistance = function(Vt) {
                    return arguments.length ? (Ee = typeof Vt == "function" ? Vt : +Vt, R) : Ee;
                  }, R.distance = R.linkDistance, R.linkStrength = function(Vt) {
                    return arguments.length ? (He = typeof Vt == "function" ? Vt : +Vt, R) : He;
                  }, R.friction = function(Vt) {
                    return arguments.length ? (ke = +Vt, R) : ke;
                  }, R.charge = function(Vt) {
                    return arguments.length ? (Ke = typeof Vt == "function" ? Vt : +Vt, R) : Ke;
                  }, R.chargeDistance = function(Vt) {
                    return arguments.length ? (Qe = Vt * Vt, R) : Math.sqrt(Qe);
                  }, R.gravity = function(Vt) {
                    return arguments.length ? (yt = +Vt, R) : yt;
                  }, R.theta = function(Vt) {
                    return arguments.length ? (mt = Vt * Vt, R) : Math.sqrt(mt);
                  }, R.alpha = function(Vt) {
                    return arguments.length ? (Vt = +Vt, ye ? Vt > 0 ? ye = Vt : (J.c = null, J.t = NaN, J = null, B.end({
                      type: "end",
                      alpha: ye = 0
                    })) : Vt > 0 && (B.start({
                      type: "start",
                      alpha: ye = Vt
                    }), J = Dn(R.tick)), R) : ye;
                  }, R.start = function() {
                    var Vt, wr = Bt.length, Wr = Zt.length, Xr = de[0], _r = de[1], en, Qr;
                    for (Vt = 0; Vt < wr; ++Vt)
                      (Qr = Bt[Vt]).index = Vt, Qr.weight = 0;
                    for (Vt = 0; Vt < Wr; ++Vt)
                      Qr = Zt[Vt], typeof Qr.source == "number" && (Qr.source = Bt[Qr.source]), typeof Qr.target == "number" && (Qr.target = Bt[Qr.target]), ++Qr.source.weight, ++Qr.target.weight;
                    for (Vt = 0; Vt < wr; ++Vt)
                      Qr = Bt[Vt], isNaN(Qr.x) && (Qr.x = En("x", Xr)), isNaN(Qr.y) && (Qr.y = En("y", _r)), isNaN(Qr.px) && (Qr.px = Qr.x), isNaN(Qr.py) && (Qr.py = Qr.y);
                    if (qe = [], typeof Ee == "function") for (Vt = 0; Vt < Wr; ++Vt) qe[Vt] = +Ee.call(this, Zt[Vt], Vt);
                    else for (Vt = 0; Vt < Wr; ++Vt) qe[Vt] = Ee;
                    if (Et = [], typeof He == "function") for (Vt = 0; Vt < Wr; ++Vt) Et[Vt] = +He.call(this, Zt[Vt], Vt);
                    else for (Vt = 0; Vt < Wr; ++Vt) Et[Vt] = He;
                    if (Dt = [], typeof Ke == "function") for (Vt = 0; Vt < wr; ++Vt) Dt[Vt] = +Ke.call(this, Bt[Vt], Vt);
                    else for (Vt = 0; Vt < wr; ++Vt) Dt[Vt] = Ke;
                    function En(qr, An) {
                      if (!en) {
                        for (en = new Array(wr), ui = 0; ui < wr; ++ui)
                          en[ui] = [];
                        for (ui = 0; ui < Wr; ++ui) {
                          var ti = Zt[ui];
                          en[ti.source.index].push(ti.target), en[ti.target.index].push(ti.source);
                        }
                      }
                      for (var $i = en[Vt], ui = -1, Nr = $i.length, un; ++ui < Nr; ) if (!isNaN(un = $i[ui][qr])) return un;
                      return Math.random() * An;
                    }
                    return R.resume();
                  }, R.resume = function() {
                    return R.alpha(0.1);
                  }, R.stop = function() {
                    return R.alpha(0);
                  }, R.drag = function() {
                    if (pe || (pe = f.behavior.drag().origin(U).on("dragstart.force", dp).on("drag.force", Kt).on("dragend.force", fp)), !arguments.length) return pe;
                    this.on("mouseover.force", Tf).on("mouseout.force", fd).call(pe);
                  };
                  function Kt(Vt) {
                    Vt.px = f.event.x, Vt.py = f.event.y, R.resume();
                  }
                  return f.rebind(R, B, "on");
                };
                function dp(R) {
                  R.fixed |= 2;
                }
                function fp(R) {
                  R.fixed &= -7;
                }
                function Tf(R) {
                  R.fixed |= 4, R.px = R.x, R.py = R.y;
                }
                function fd(R) {
                  R.fixed &= -5;
                }
                function ol(R, B, J) {
                  var de = 0, pe = 0;
                  if (R.charge = 0, !R.leaf)
                    for (var ye = R.nodes, ke = ye.length, Ee = -1, He; ++Ee < ke; )
                      He = ye[Ee], He != null && (ol(He, B, J), R.charge += He.charge, de += He.charge * He.cx, pe += He.charge * He.cy);
                  if (R.point) {
                    R.leaf || (R.point.x += Math.random() - 0.5, R.point.y += Math.random() - 0.5);
                    var Ke = B * J[R.point.index];
                    R.charge += R.pointCharge = Ke, de += Ke * R.point.x, pe += Ke * R.point.y;
                  }
                  R.cx = de / R.charge, R.cy = pe / R.charge;
                }
                var hp = 20, yu = 1, vc = 1 / 0;
                f.layout.hierarchy = function() {
                  var R = Cu, B = Rf, J = Af;
                  function de(pe) {
                    var ye = [pe], ke = [], Ee;
                    for (pe.depth = 0; (Ee = ye.pop()) != null; )
                      if (ke.push(Ee), (Ke = B.call(de, Ee, Ee.depth)) && (He = Ke.length)) {
                        for (var He, Ke, Qe; --He >= 0; )
                          ye.push(Qe = Ke[He]), Qe.parent = Ee, Qe.depth = Ee.depth + 1;
                        J && (Ee.value = 0), Ee.children = Ke;
                      } else
                        J && (Ee.value = +J.call(de, Ee, Ee.depth) || 0), delete Ee.children;
                    return _a(pe, function(yt) {
                      var mt, Bt;
                      R && (mt = yt.children) && mt.sort(R), J && (Bt = yt.parent) && (Bt.value += yt.value);
                    }), ke;
                  }
                  return de.sort = function(pe) {
                    return arguments.length ? (R = pe, de) : R;
                  }, de.children = function(pe) {
                    return arguments.length ? (B = pe, de) : B;
                  }, de.value = function(pe) {
                    return arguments.length ? (J = pe, de) : J;
                  }, de.revalue = function(pe) {
                    return J && (Mo(pe, function(ye) {
                      ye.children && (ye.value = 0);
                    }), _a(pe, function(ye) {
                      var ke;
                      ye.children || (ye.value = +J.call(de, ye, ye.depth) || 0), (ke = ye.parent) && (ke.value += ye.value);
                    })), pe;
                  }, de;
                };
                function jo(R, B) {
                  return f.rebind(R, B, "sort", "children", "value"), R.nodes = R, R.links = eg, R;
                }
                function Mo(R, B) {
                  for (var J = [R]; (R = J.pop()) != null; )
                    if (B(R), (pe = R.children) && (de = pe.length))
                      for (var de, pe; --de >= 0; ) J.push(pe[de]);
                }
                function _a(R, B) {
                  for (var J = [R], de = []; (R = J.pop()) != null; )
                    if (de.push(R), (ke = R.children) && (ye = ke.length))
                      for (var pe = -1, ye, ke; ++pe < ye; ) J.push(ke[pe]);
                  for (; (R = de.pop()) != null; )
                    B(R);
                }
                function Rf(R) {
                  return R.children;
                }
                function Af(R) {
                  return R.value;
                }
                function Cu(R, B) {
                  return B.value - R.value;
                }
                function eg(R) {
                  return f.merge(R.map(function(B) {
                    return (B.children || []).map(function(J) {
                      return {
                        source: B,
                        target: J
                      };
                    });
                  }));
                }
                f.layout.partition = function() {
                  var R = f.layout.hierarchy(), B = [1, 1];
                  function J(ye, ke, Ee, He) {
                    var Ke = ye.children;
                    if (ye.x = ke, ye.y = ye.depth * He, ye.dx = Ee, ye.dy = He, Ke && (yt = Ke.length)) {
                      var Qe = -1, yt, mt, Bt;
                      for (Ee = ye.value ? Ee / ye.value : 0; ++Qe < yt; )
                        J(mt = Ke[Qe], ke, Bt = mt.value * Ee, He), ke += Bt;
                    }
                  }
                  function de(ye) {
                    var ke = ye.children, Ee = 0;
                    if (ke && (Ke = ke.length))
                      for (var He = -1, Ke; ++He < Ke; ) Ee = Math.max(Ee, de(ke[He]));
                    return 1 + Ee;
                  }
                  function pe(ye, ke) {
                    var Ee = R.call(this, ye, ke);
                    return J(Ee[0], 0, B[0], B[1] / de(Ee[0])), Ee;
                  }
                  return pe.size = function(ye) {
                    return arguments.length ? (B = ye, pe) : B;
                  }, jo(pe, R);
                }, f.layout.pie = function() {
                  var R = Number, B = hd, J = 0, de = Oe, pe = 0;
                  function ye(ke) {
                    var Ee = ke.length, He = ke.map(function(Xt, Kt) {
                      return +R.call(ye, Xt, Kt);
                    }), Ke = +(typeof J == "function" ? J.apply(this, arguments) : J), Qe = (typeof de == "function" ? de.apply(this, arguments) : de) - Ke, yt = Math.min(Math.abs(Qe) / Ee, +(typeof pe == "function" ? pe.apply(this, arguments) : pe)), mt = yt * (Qe < 0 ? -1 : 1), Bt = f.sum(He), Zt = Bt ? (Qe - Ee * mt) / Bt : 0, qe = f.range(Ee), Et = [], Dt;
                    return B != null && qe.sort(B === hd ? function(Xt, Kt) {
                      return He[Kt] - He[Xt];
                    } : function(Xt, Kt) {
                      return B(ke[Xt], ke[Kt]);
                    }), qe.forEach(function(Xt) {
                      Et[Xt] = {
                        data: ke[Xt],
                        value: Dt = He[Xt],
                        startAngle: Ke,
                        endAngle: Ke += Dt * Zt + mt,
                        padAngle: yt
                      };
                    }), Et;
                  }
                  return ye.value = function(ke) {
                    return arguments.length ? (R = ke, ye) : R;
                  }, ye.sort = function(ke) {
                    return arguments.length ? (B = ke, ye) : B;
                  }, ye.startAngle = function(ke) {
                    return arguments.length ? (J = ke, ye) : J;
                  }, ye.endAngle = function(ke) {
                    return arguments.length ? (de = ke, ye) : de;
                  }, ye.padAngle = function(ke) {
                    return arguments.length ? (pe = ke, ye) : pe;
                  }, ye;
                };
                var hd = {};
                f.layout.stack = function() {
                  var R = U, B = bu, J = wu, de = vd, pe = pd, ye = Vi;
                  function ke(Ee, He) {
                    if (!(Zt = Ee.length)) return Ee;
                    var Ke = Ee.map(function(Xt, Kt) {
                      return R.call(ke, Xt, Kt);
                    }), Qe = Ke.map(function(Xt) {
                      return Xt.map(function(Kt, Vt) {
                        return [pe.call(ke, Kt, Vt), ye.call(ke, Kt, Vt)];
                      });
                    }), yt = B.call(ke, Qe, He);
                    Ke = f.permute(Ke, yt), Qe = f.permute(Qe, yt);
                    var mt = J.call(ke, Qe, He), Bt = Ke[0].length, Zt, qe, Et, Dt;
                    for (Et = 0; Et < Bt; ++Et)
                      for (de.call(ke, Ke[0][Et], Dt = mt[Et], Qe[0][Et][1]), qe = 1; qe < Zt; ++qe)
                        de.call(ke, Ke[qe][Et], Dt += Qe[qe - 1][Et][1], Qe[qe][Et][1]);
                    return Ee;
                  }
                  return ke.values = function(Ee) {
                    return arguments.length ? (R = Ee, ke) : R;
                  }, ke.order = function(Ee) {
                    return arguments.length ? (B = typeof Ee == "function" ? Ee : Ef.get(Ee) || bu, ke) : B;
                  }, ke.offset = function(Ee) {
                    return arguments.length ? (J = typeof Ee == "function" ? Ee : Fs.get(Ee) || wu, ke) : J;
                  }, ke.x = function(Ee) {
                    return arguments.length ? (pe = Ee, ke) : pe;
                  }, ke.y = function(Ee) {
                    return arguments.length ? (ye = Ee, ke) : ye;
                  }, ke.out = function(Ee) {
                    return arguments.length ? (de = Ee, ke) : de;
                  }, ke;
                };
                function pd(R) {
                  return R.x;
                }
                function Vi(R) {
                  return R.y;
                }
                function vd(R, B, J) {
                  R.y0 = B, R.y = J;
                }
                var Ef = f.map({
                  "inside-out": function(R) {
                    var B = R.length, J, de, pe = R.map(gc), ye = R.map(gd), ke = f.range(B).sort(function(yt, mt) {
                      return pe[yt] - pe[mt];
                    }), Ee = 0, He = 0, Ke = [], Qe = [];
                    for (J = 0; J < B; ++J)
                      de = ke[J], Ee < He ? (Ee += ye[de], Ke.push(de)) : (He += ye[de], Qe.push(de));
                    return Qe.reverse().concat(Ke);
                  },
                  reverse: function(R) {
                    return f.range(R.length).reverse();
                  },
                  default: bu
                }), Fs = f.map({
                  silhouette: function(R) {
                    var B = R.length, J = R[0].length, de = [], pe = 0, ye, ke, Ee, He = [];
                    for (ke = 0; ke < J; ++ke) {
                      for (ye = 0, Ee = 0; ye < B; ye++) Ee += R[ye][ke][1];
                      Ee > pe && (pe = Ee), de.push(Ee);
                    }
                    for (ke = 0; ke < J; ++ke)
                      He[ke] = (pe - de[ke]) / 2;
                    return He;
                  },
                  wiggle: function(R) {
                    var B = R.length, J = R[0], de = J.length, pe, ye, ke, Ee, He, Ke, Qe, yt, mt, Bt = [];
                    for (Bt[0] = yt = mt = 0, ye = 1; ye < de; ++ye) {
                      for (pe = 0, Ee = 0; pe < B; ++pe) Ee += R[pe][ye][1];
                      for (pe = 0, He = 0, Qe = J[ye][0] - J[ye - 1][0]; pe < B; ++pe) {
                        for (ke = 0, Ke = (R[pe][ye][1] - R[pe][ye - 1][1]) / (2 * Qe); ke < pe; ++ke)
                          Ke += (R[ke][ye][1] - R[ke][ye - 1][1]) / Qe;
                        He += Ke * R[pe][ye][1];
                      }
                      Bt[ye] = yt -= Ee ? He / Ee * Qe : 0, yt < mt && (mt = yt);
                    }
                    for (ye = 0; ye < de; ++ye) Bt[ye] -= mt;
                    return Bt;
                  },
                  expand: function(R) {
                    var B = R.length, J = R[0].length, de = 1 / B, pe, ye, ke, Ee = [];
                    for (ye = 0; ye < J; ++ye) {
                      for (pe = 0, ke = 0; pe < B; pe++) ke += R[pe][ye][1];
                      if (ke) for (pe = 0; pe < B; pe++) R[pe][ye][1] /= ke;
                      else for (pe = 0; pe < B; pe++) R[pe][ye][1] = de;
                    }
                    for (ye = 0; ye < J; ++ye) Ee[ye] = 0;
                    return Ee;
                  },
                  zero: wu
                });
                function bu(R) {
                  return f.range(R.length);
                }
                function wu(R) {
                  for (var B = -1, J = R[0].length, de = []; ++B < J; ) de[B] = 0;
                  return de;
                }
                function gc(R) {
                  for (var B = 1, J = 0, de = R[0][1], pe, ye = R.length; B < ye; ++B)
                    (pe = R[B][1]) > de && (J = B, de = pe);
                  return J;
                }
                function gd(R) {
                  return R.reduce(Su, 0);
                }
                function Su(R, B) {
                  return R + B[1];
                }
                f.layout.histogram = function() {
                  var R = !0, B = Number, J = Mf, de = pp;
                  function pe(ye, mt) {
                    for (var Ee = [], He = ye.map(B, this), Ke = J.call(this, He, mt), Qe = de.call(this, Ke, He, mt), yt, mt = -1, Bt = He.length, Zt = Qe.length - 1, qe = R ? 1 : 1 / Bt, Et; ++mt < Zt; )
                      yt = Ee[mt] = [], yt.dx = Qe[mt + 1] - (yt.x = Qe[mt]), yt.y = 0;
                    if (Zt > 0)
                      for (mt = -1; ++mt < Bt; )
                        Et = He[mt], Et >= Ke[0] && Et <= Ke[1] && (yt = Ee[f.bisect(Qe, Et, 1, Zt) - 1], yt.y += qe, yt.push(ye[mt]));
                    return Ee;
                  }
                  return pe.value = function(ye) {
                    return arguments.length ? (B = ye, pe) : B;
                  }, pe.range = function(ye) {
                    return arguments.length ? (J = nr(ye), pe) : J;
                  }, pe.bins = function(ye) {
                    return arguments.length ? (de = typeof ye == "number" ? function(ke) {
                      return mc(ke, ye);
                    } : nr(ye), pe) : de;
                  }, pe.frequency = function(ye) {
                    return arguments.length ? (R = !!ye, pe) : R;
                  }, pe;
                };
                function pp(R, B) {
                  return mc(R, Math.ceil(Math.log(B.length) / Math.LN2 + 1));
                }
                function mc(R, B) {
                  for (var J = -1, de = +R[0], pe = (R[1] - de) / B, ye = []; ++J <= B; ) ye[J] = pe * J + de;
                  return ye;
                }
                function Mf(R) {
                  return [f.min(R), f.max(R)];
                }
                f.layout.pack = function() {
                  var R = f.layout.hierarchy().sort(Df), B = 0, J = [1, 1], de;
                  function pe(ye, ke) {
                    var Ee = R.call(this, ye, ke), He = Ee[0], Ke = J[0], Qe = J[1], yt = de == null ? Math.sqrt : typeof de == "function" ? de : function() {
                      return de;
                    };
                    if (He.x = He.y = 0, _a(He, function(Bt) {
                      Bt.r = +yt(Bt.value);
                    }), _a(He, Ff), B) {
                      var mt = B * (de ? 1 : Math.max(2 * He.r / Ke, 2 * He.r / Qe)) / 2;
                      _a(He, function(Bt) {
                        Bt.r += mt;
                      }), _a(He, Ff), _a(He, function(Bt) {
                        Bt.r -= mt;
                      });
                    }
                    return Pf(He, Ke / 2, Qe / 2, de ? 1 : 1 / Math.max(2 * He.r / Ke, 2 * He.r / Qe)), Ee;
                  }
                  return pe.size = function(ye) {
                    return arguments.length ? (J = ye, pe) : J;
                  }, pe.radius = function(ye) {
                    return arguments.length ? (de = ye == null || typeof ye == "function" ? ye : +ye, pe) : de;
                  }, pe.padding = function(ye) {
                    return arguments.length ? (B = +ye, pe) : B;
                  }, jo(pe, R);
                };
                function Df(R, B) {
                  return R.value - B.value;
                }
                function sl(R, B) {
                  var J = R._pack_next;
                  R._pack_next = B, B._pack_prev = R, B._pack_next = J, J._pack_prev = B;
                }
                function xu(R, B) {
                  R._pack_next = B, B._pack_prev = R;
                }
                function Yl(R, B) {
                  var J = B.x - R.x, de = B.y - R.y, pe = R.r + B.r;
                  return 0.999 * pe * pe > J * J + de * de;
                }
                function Ff(R) {
                  if (!(B = R.children) || !(mt = B.length)) return;
                  var B, J = 1 / 0, de = -1 / 0, pe = 1 / 0, ye = -1 / 0, ke, Ee, He, Ke, Qe, yt, mt;
                  function Bt(Vt) {
                    J = Math.min(Vt.x - Vt.r, J), de = Math.max(Vt.x + Vt.r, de), pe = Math.min(Vt.y - Vt.r, pe), ye = Math.max(Vt.y + Vt.r, ye);
                  }
                  if (B.forEach(md), ke = B[0], ke.x = -ke.r, ke.y = 0, Bt(ke), mt > 1 && (Ee = B[1], Ee.x = Ee.r, Ee.y = 0, Bt(Ee), mt > 2))
                    for (He = B[2], Ps(ke, Ee, He), Bt(He), sl(ke, He), ke._pack_prev = He, sl(He, Ee), Ee = ke._pack_next, Ke = 3; Ke < mt; Ke++) {
                      Ps(ke, Ee, He = B[Ke]);
                      var Zt = 0, qe = 1, Et = 1;
                      for (Qe = Ee._pack_next; Qe !== Ee; Qe = Qe._pack_next, qe++)
                        if (Yl(Qe, He)) {
                          Zt = 1;
                          break;
                        }
                      if (Zt == 1)
                        for (yt = ke._pack_prev; yt !== Qe._pack_prev && !Yl(yt, He); yt = yt._pack_prev, Et++)
                          ;
                      Zt ? (qe < Et || qe == Et && Ee.r < ke.r ? xu(ke, Ee = Qe) : xu(ke = yt, Ee), Ke--) : (sl(ke, He), Ee = He, Bt(He));
                    }
                  var Dt = (J + de) / 2, Xt = (pe + ye) / 2, Kt = 0;
                  for (Ke = 0; Ke < mt; Ke++)
                    He = B[Ke], He.x -= Dt, He.y -= Xt, Kt = Math.max(Kt, He.r + Math.sqrt(He.x * He.x + He.y * He.y));
                  R.r = Kt, B.forEach(ll);
                }
                function md(R) {
                  R._pack_next = R._pack_prev = R;
                }
                function ll(R) {
                  delete R._pack_next, delete R._pack_prev;
                }
                function Pf(R, B, J, de) {
                  var pe = R.children;
                  if (R.x = B += de * R.x, R.y = J += de * R.y, R.r *= de, pe)
                    for (var ye = -1, ke = pe.length; ++ye < ke; ) Pf(pe[ye], B, J, de);
                }
                function Ps(R, B, J) {
                  var de = R.r + J.r, pe = B.x - R.x, ye = B.y - R.y;
                  if (de && (pe || ye)) {
                    var ke = B.r + J.r, Ee = pe * pe + ye * ye;
                    ke *= ke, de *= de;
                    var He = 0.5 + (de - ke) / (2 * Ee), Ke = Math.sqrt(Math.max(0, 2 * ke * (de + Ee) - (de -= Ee) * de - ke * ke)) / (2 * Ee);
                    J.x = R.x + He * pe + Ke * ye, J.y = R.y + He * ye - Ke * pe;
                  } else
                    J.x = R.x + de, J.y = R.y;
                }
                f.layout.tree = function() {
                  var R = f.layout.hierarchy().sort(null).value(null), B = yc, J = [1, 1], de = null;
                  function pe(Qe, yt) {
                    var mt = R.call(this, Qe, yt), Bt = mt[0], Zt = ye(Bt);
                    if (_a(Zt, ke), Zt.parent.m = -Zt.z, Mo(Zt, Ee), de) Mo(Bt, Ke);
                    else {
                      var qe = Bt, Et = Bt, Dt = Bt;
                      Mo(Bt, function(wr) {
                        wr.x < qe.x && (qe = wr), wr.x > Et.x && (Et = wr), wr.depth > Dt.depth && (Dt = wr);
                      });
                      var Xt = B(qe, Et) / 2 - qe.x, Kt = J[0] / (Et.x + B(Et, qe) / 2 + Xt), Vt = J[1] / (Dt.depth || 1);
                      Mo(Bt, function(wr) {
                        wr.x = (wr.x + Xt) * Kt, wr.y = wr.depth * Vt;
                      });
                    }
                    return mt;
                  }
                  function ye(Qe) {
                    for (var yt = {
                      A: null,
                      children: [Qe]
                    }, mt = [yt], Bt; (Bt = mt.pop()) != null; )
                      for (var Zt = Bt.children, qe, Et = 0, Dt = Zt.length; Et < Dt; ++Et)
                        mt.push((Zt[Et] = qe = {
                          _: Zt[Et],
                          parent: Bt,
                          children: (qe = Zt[Et].children) && qe.slice() || [],
                          A: null,
                          a: null,
                          z: 0,
                          m: 0,
                          c: 0,
                          s: 0,
                          t: null,
                          i: Et
                        }).a = qe);
                    return yt.children[0];
                  }
                  function ke(Qe) {
                    var yt = Qe.children, mt = Qe.parent.children, Bt = Qe.i ? mt[Qe.i - 1] : null;
                    if (yt.length) {
                      to(Qe);
                      var Zt = (yt[0].z + yt[yt.length - 1].z) / 2;
                      Bt ? (Qe.z = Bt.z + B(Qe._, Bt._), Qe.m = Qe.z - Zt) : Qe.z = Zt;
                    } else Bt && (Qe.z = Bt.z + B(Qe._, Bt._));
                    Qe.parent.A = He(Qe, Bt, Qe.parent.A || mt[0]);
                  }
                  function Ee(Qe) {
                    Qe._.x = Qe.z + Qe.parent.m, Qe.m += Qe.parent.m;
                  }
                  function He(Qe, yt, mt) {
                    if (yt) {
                      for (var Bt = Qe, Zt = Qe, qe = yt, Et = Bt.parent.children[0], Dt = Bt.m, Xt = Zt.m, Kt = qe.m, Vt = Et.m, wr; qe = Do(qe), Bt = Is(Bt), qe && Bt; )
                        Et = Is(Et), Zt = Do(Zt), Zt.a = Qe, wr = qe.z + Kt - Bt.z - Dt + B(qe._, Bt._), wr > 0 && (yd(vp(qe, Qe, mt), Qe, wr), Dt += wr, Xt += wr), Kt += qe.m, Dt += Bt.m, Vt += Et.m, Xt += Zt.m;
                      qe && !Do(Zt) && (Zt.t = qe, Zt.m += Kt - Xt), Bt && !Is(Et) && (Et.t = Bt, Et.m += Dt - Vt, mt = Qe);
                    }
                    return mt;
                  }
                  function Ke(Qe) {
                    Qe.x *= J[0], Qe.y = Qe.depth * J[1];
                  }
                  return pe.separation = function(Qe) {
                    return arguments.length ? (B = Qe, pe) : B;
                  }, pe.size = function(Qe) {
                    return arguments.length ? (de = (J = Qe) == null ? Ke : null, pe) : de ? null : J;
                  }, pe.nodeSize = function(Qe) {
                    return arguments.length ? (de = (J = Qe) == null ? null : Ke, pe) : de ? J : null;
                  }, jo(pe, R);
                };
                function yc(R, B) {
                  return R.parent == B.parent ? 1 : 2;
                }
                function Is(R) {
                  var B = R.children;
                  return B.length ? B[0] : R.t;
                }
                function Do(R) {
                  var B = R.children, J;
                  return (J = B.length) ? B[J - 1] : R.t;
                }
                function yd(R, B, J) {
                  var de = J / (B.i - R.i);
                  B.c -= de, B.s += J, R.c += de, B.z += J, B.m += J;
                }
                function to(R) {
                  for (var B = 0, J = 0, de = R.children, pe = de.length, ye; --pe >= 0; )
                    ye = de[pe], ye.z += B, ye.m += B, B += ye.s + (J += ye.c);
                }
                function vp(R, B, J) {
                  return R.a.parent === B.parent ? R.a : J;
                }
                f.layout.cluster = function() {
                  var R = f.layout.hierarchy().sort(null).value(null), B = yc, J = [1, 1], de = !1;
                  function pe(ye, ke) {
                    var Ee = R.call(this, ye, ke), He = Ee[0], Ke, Qe = 0;
                    _a(He, function(qe) {
                      var Et = qe.children;
                      Et && Et.length ? (qe.x = go(Et), qe.y = Xl(Et)) : (qe.x = Ke ? Qe += B(qe, Ke) : 0, qe.y = 0, Ke = qe);
                    });
                    var yt = Ua(He), mt = os(He), Bt = yt.x - B(yt, mt) / 2, Zt = mt.x + B(mt, yt) / 2;
                    return _a(He, de ? function(qe) {
                      qe.x = (qe.x - He.x) * J[0], qe.y = (He.y - qe.y) * J[1];
                    } : function(qe) {
                      qe.x = (qe.x - Bt) / (Zt - Bt) * J[0], qe.y = (1 - (He.y ? qe.y / He.y : 1)) * J[1];
                    }), Ee;
                  }
                  return pe.separation = function(ye) {
                    return arguments.length ? (B = ye, pe) : B;
                  }, pe.size = function(ye) {
                    return arguments.length ? (de = (J = ye) == null, pe) : de ? null : J;
                  }, pe.nodeSize = function(ye) {
                    return arguments.length ? (de = (J = ye) != null, pe) : de ? J : null;
                  }, jo(pe, R);
                };
                function Xl(R) {
                  return 1 + f.max(R, function(B) {
                    return B.y;
                  });
                }
                function go(R) {
                  return R.reduce(function(B, J) {
                    return B + J.x;
                  }, 0) / R.length;
                }
                function Ua(R) {
                  var B = R.children;
                  return B && B.length ? Ua(B[0]) : R;
                }
                function os(R) {
                  var B = R.children, J;
                  return B && (J = B.length) ? os(B[J - 1]) : R;
                }
                f.layout.treemap = function() {
                  var R = f.layout.hierarchy(), B = Math.round, J = [1, 1], de = null, pe = Cd, ye = !1, ke, Ee = "squarify", He = 0.5 * (1 + Math.sqrt(5));
                  function Ke(qe, Et) {
                    for (var Dt = -1, Xt = qe.length, Kt, Vt; ++Dt < Xt; )
                      Vt = (Kt = qe[Dt]).value * (Et < 0 ? 0 : Et), Kt.area = isNaN(Vt) || Vt <= 0 ? 0 : Vt;
                  }
                  function Qe(qe) {
                    var Et = qe.children;
                    if (Et && Et.length) {
                      var Dt = pe(qe), Xt = [], Kt = Et.slice(), Vt, wr = 1 / 0, Wr, Xr = Ee === "slice" ? Dt.dx : Ee === "dice" ? Dt.dy : Ee === "slice-dice" ? qe.depth & 1 ? Dt.dy : Dt.dx : Math.min(Dt.dx, Dt.dy), _r;
                      for (Ke(Kt, Dt.dx * Dt.dy / qe.value), Xt.area = 0; (_r = Kt.length) > 0; )
                        Xt.push(Vt = Kt[_r - 1]), Xt.area += Vt.area, Ee !== "squarify" || (Wr = mt(Xt, Xr)) <= wr ? (Kt.pop(), wr = Wr) : (Xt.area -= Xt.pop().area, Bt(Xt, Xr, Dt, !1), Xr = Math.min(Dt.dx, Dt.dy), Xt.length = Xt.area = 0, wr = 1 / 0);
                      Xt.length && (Bt(Xt, Xr, Dt, !0), Xt.length = Xt.area = 0), Et.forEach(Qe);
                    }
                  }
                  function yt(qe) {
                    var Et = qe.children;
                    if (Et && Et.length) {
                      var Dt = pe(qe), Xt = Et.slice(), Kt, Vt = [];
                      for (Ke(Xt, Dt.dx * Dt.dy / qe.value), Vt.area = 0; Kt = Xt.pop(); )
                        Vt.push(Kt), Vt.area += Kt.area, Kt.z != null && (Bt(Vt, Kt.z ? Dt.dx : Dt.dy, Dt, !Xt.length), Vt.length = Vt.area = 0);
                      Et.forEach(yt);
                    }
                  }
                  function mt(qe, Et) {
                    for (var Dt = qe.area, Xt, Kt = 0, Vt = 1 / 0, wr = -1, Wr = qe.length; ++wr < Wr; )
                      (Xt = qe[wr].area) && (Xt < Vt && (Vt = Xt), Xt > Kt && (Kt = Xt));
                    return Dt *= Dt, Et *= Et, Dt ? Math.max(Et * Kt * He / Dt, Dt / (Et * Vt * He)) : 1 / 0;
                  }
                  function Bt(qe, Et, Dt, Xt) {
                    var Kt = -1, Vt = qe.length, wr = Dt.x, Wr = Dt.y, Xr = Et ? B(qe.area / Et) : 0, _r;
                    if (Et == Dt.dx) {
                      for ((Xt || Xr > Dt.dy) && (Xr = Dt.dy); ++Kt < Vt; )
                        _r = qe[Kt], _r.x = wr, _r.y = Wr, _r.dy = Xr, wr += _r.dx = Math.min(Dt.x + Dt.dx - wr, Xr ? B(_r.area / Xr) : 0);
                      _r.z = !0, _r.dx += Dt.x + Dt.dx - wr, Dt.y += Xr, Dt.dy -= Xr;
                    } else {
                      for ((Xt || Xr > Dt.dx) && (Xr = Dt.dx); ++Kt < Vt; )
                        _r = qe[Kt], _r.x = wr, _r.y = Wr, _r.dx = Xr, Wr += _r.dy = Math.min(Dt.y + Dt.dy - Wr, Xr ? B(_r.area / Xr) : 0);
                      _r.z = !1, _r.dy += Dt.y + Dt.dy - Wr, Dt.x += Xr, Dt.dx -= Xr;
                    }
                  }
                  function Zt(qe) {
                    var Et = ke || R(qe), Dt = Et[0];
                    return Dt.x = Dt.y = 0, Dt.value ? (Dt.dx = J[0], Dt.dy = J[1]) : Dt.dx = Dt.dy = 0, ke && R.revalue(Dt), Ke([Dt], Dt.dx * Dt.dy / Dt.value), (ke ? yt : Qe)(Dt), ye && (ke = Et), Et;
                  }
                  return Zt.size = function(qe) {
                    return arguments.length ? (J = qe, Zt) : J;
                  }, Zt.padding = function(qe) {
                    if (!arguments.length) return de;
                    function Et(Kt) {
                      var Vt = qe.call(Zt, Kt, Kt.depth);
                      return Vt == null ? Cd(Kt) : bd(Kt, typeof Vt == "number" ? [Vt, Vt, Vt, Vt] : Vt);
                    }
                    function Dt(Kt) {
                      return bd(Kt, qe);
                    }
                    var Xt;
                    return pe = (de = qe) == null ? Cd : (Xt = typeof qe) == "function" ? Et : (Xt === "number" && (qe = [qe, qe, qe, qe]), Dt), Zt;
                  }, Zt.round = function(qe) {
                    return arguments.length ? (B = qe ? Math.round : Number, Zt) : B != Number;
                  }, Zt.sticky = function(qe) {
                    return arguments.length ? (ye = qe, ke = null, Zt) : ye;
                  }, Zt.ratio = function(qe) {
                    return arguments.length ? (He = qe, Zt) : He;
                  }, Zt.mode = function(qe) {
                    return arguments.length ? (Ee = qe + "", Zt) : Ee;
                  }, jo(Zt, R);
                };
                function Cd(R) {
                  return {
                    x: R.x,
                    y: R.y,
                    dx: R.dx,
                    dy: R.dy
                  };
                }
                function bd(R, B) {
                  var J = R.x + B[3], de = R.y + B[0], pe = R.dx - B[1] - B[3], ye = R.dy - B[0] - B[2];
                  return pe < 0 && (J += pe / 2, pe = 0), ye < 0 && (de += ye / 2, ye = 0), {
                    x: J,
                    y: de,
                    dx: pe,
                    dy: ye
                  };
                }
                f.random = {
                  normal: function(R, B) {
                    var J = arguments.length;
                    return J < 2 && (B = 1), J < 1 && (R = 0), function() {
                      var de, pe, ye;
                      do
                        de = Math.random() * 2 - 1, pe = Math.random() * 2 - 1, ye = de * de + pe * pe;
                      while (!ye || ye > 1);
                      return R + B * de * Math.sqrt(-2 * Math.log(ye) / ye);
                    };
                  },
                  logNormal: function() {
                    var R = f.random.normal.apply(f, arguments);
                    return function() {
                      return Math.exp(R());
                    };
                  },
                  bates: function(R) {
                    var B = f.random.irwinHall(R);
                    return function() {
                      return B() / R;
                    };
                  },
                  irwinHall: function(R) {
                    return function() {
                      for (var B = 0, J = 0; J < R; J++) B += Math.random();
                      return B;
                    };
                  }
                }, f.scale = {};
                function Ci(R) {
                  var B = R[0], J = R[R.length - 1];
                  return B < J ? [B, J] : [J, B];
                }
                function xa(R) {
                  return R.rangeExtent ? R.rangeExtent() : Ci(R.range());
                }
                function Yn(R, B, J, de) {
                  var pe = J(R[0], R[1]), ye = de(B[0], B[1]);
                  return function(ke) {
                    return ye(pe(ke));
                  };
                }
                function On(R, B) {
                  var J = 0, de = R.length - 1, pe = R[J], ye = R[de], ke;
                  return ye < pe && (ke = J, J = de, de = ke, ke = pe, pe = ye, ye = ke), R[J] = B.floor(pe), R[de] = B.ceil(ye), R;
                }
                function Ls(R) {
                  return R ? {
                    floor: function(B) {
                      return Math.floor(B / R) * R;
                    },
                    ceil: function(B) {
                      return Math.ceil(B / R) * R;
                    }
                  } : Ji;
                }
                var Ji = {
                  floor: U,
                  ceil: U
                };
                function Na(R, B, J, de) {
                  var pe = [], ye = [], ke = 0, Ee = Math.min(R.length, B.length) - 1;
                  for (R[Ee] < R[0] && (R = R.slice().reverse(), B = B.slice().reverse()); ++ke <= Ee; )
                    pe.push(J(R[ke - 1], R[ke])), ye.push(de(B[ke - 1], B[ke]));
                  return function(He) {
                    var Ke = f.bisect(R, He, 1, Ee) - 1;
                    return ye[Ke](pe[Ke](He));
                  };
                }
                f.scale.linear = function() {
                  return ks([0, 1], [0, 1], Ds, !1);
                };
                function ks(R, B, J, de) {
                  var pe, ye;
                  function ke() {
                    var He = Math.min(R.length, B.length) > 2 ? Na : Yn, Ke = de ? up : qv;
                    return pe = He(R, B, Ke, J), ye = He(B, R, Ke, Ds), Ee;
                  }
                  function Ee(He) {
                    return pe(He);
                  }
                  return Ee.invert = function(He) {
                    return ye(He);
                  }, Ee.domain = function(He) {
                    return arguments.length ? (R = He.map(Number), ke()) : R;
                  }, Ee.range = function(He) {
                    return arguments.length ? (B = He, ke()) : B;
                  }, Ee.rangeRound = function(He) {
                    return Ee.range(He).interpolate(Cf);
                  }, Ee.clamp = function(He) {
                    return arguments.length ? (de = He, ke()) : de;
                  }, Ee.interpolate = function(He) {
                    return arguments.length ? (J = He, ke()) : J;
                  }, Ee.ticks = function(He) {
                    return ul(R, He);
                  }, Ee.tickFormat = function(He, Ke) {
                    return d3_scale_linearTickFormat(R, He, Ke);
                  }, Ee.nice = function(He) {
                    return Ta(R, He), ke();
                  }, Ee.copy = function() {
                    return ks(R, B, J, de);
                  }, ke();
                }
                function bi(R, B) {
                  return f.rebind(R, B, "range", "rangeRound", "interpolate", "clamp");
                }
                function Ta(R, B) {
                  return On(R, Ls(Fo(R, B)[2])), On(R, Ls(Fo(R, B)[2])), R;
                }
                function Fo(R, B) {
                  B == null && (B = 10);
                  var J = Ci(R), de = J[1] - J[0], pe = Math.pow(10, Math.floor(Math.log(de / B) / Math.LN10)), ye = B / de * pe;
                  return ye <= 0.15 ? pe *= 10 : ye <= 0.35 ? pe *= 5 : ye <= 0.75 && (pe *= 2), J[0] = Math.ceil(J[0] / pe) * pe, J[1] = Math.floor(J[1] / pe) * pe + pe * 0.5, J[2] = pe, J;
                }
                function ul(R, B) {
                  return f.range.apply(f, Fo(R, B));
                }
                f.scale.log = function() {
                  return $l(f.scale.linear().domain([0, 1]), 10, !0, [1, 10]);
                };
                function $l(R, B, J, de) {
                  function pe(Ee) {
                    return (J ? Math.log(Ee < 0 ? 0 : Ee) : -Math.log(Ee > 0 ? 0 : -Ee)) / Math.log(B);
                  }
                  function ye(Ee) {
                    return J ? Math.pow(B, Ee) : -Math.pow(B, -Ee);
                  }
                  function ke(Ee) {
                    return R(pe(Ee));
                  }
                  return ke.invert = function(Ee) {
                    return ye(R.invert(Ee));
                  }, ke.domain = function(Ee) {
                    return arguments.length ? (J = Ee[0] >= 0, R.domain((de = Ee.map(Number)).map(pe)), ke) : de;
                  }, ke.base = function(Ee) {
                    return arguments.length ? (B = +Ee, R.domain(de.map(pe)), ke) : B;
                  }, ke.nice = function() {
                    var Ee = On(de.map(pe), J ? Math : Po);
                    return R.domain(Ee), de = Ee.map(ye), ke;
                  }, ke.ticks = function() {
                    var Ee = Ci(de), He = [], Ke = Ee[0], Qe = Ee[1], yt = Math.floor(pe(Ke)), mt = Math.ceil(pe(Qe)), Bt = B % 1 ? 2 : B;
                    if (isFinite(mt - yt)) {
                      if (J) {
                        for (; yt < mt; yt++) for (var Zt = 1; Zt < Bt; Zt++) He.push(ye(yt) * Zt);
                        He.push(ye(yt));
                      } else
                        for (He.push(ye(yt)); yt++ < mt; ) for (var Zt = Bt - 1; Zt > 0; Zt--) He.push(ye(yt) * Zt);
                      for (yt = 0; He[yt] < Ke; yt++)
                        ;
                      for (mt = He.length; He[mt - 1] > Qe; mt--)
                        ;
                      He = He.slice(yt, mt);
                    }
                    return He;
                  }, ke.copy = function() {
                    return $l(R.copy(), B, J, de);
                  }, bi(ke, R);
                }
                var Po = {
                  floor: function(R) {
                    return -Math.ceil(-R);
                  },
                  ceil: function(R) {
                    return -Math.floor(-R);
                  }
                };
                f.scale.pow = function() {
                  return If(f.scale.linear(), 1, [0, 1]);
                };
                function If(R, B, J) {
                  var de = Tu(B), pe = Tu(1 / B);
                  function ye(ke) {
                    return R(de(ke));
                  }
                  return ye.invert = function(ke) {
                    return pe(R.invert(ke));
                  }, ye.domain = function(ke) {
                    return arguments.length ? (R.domain((J = ke.map(Number)).map(de)), ye) : J;
                  }, ye.ticks = function(ke) {
                    return ul(J, ke);
                  }, ye.tickFormat = function(ke, Ee) {
                    return d3_scale_linearTickFormat(J, ke, Ee);
                  }, ye.nice = function(ke) {
                    return ye.domain(Ta(J, ke));
                  }, ye.exponent = function(ke) {
                    return arguments.length ? (de = Tu(B = ke), pe = Tu(1 / B), R.domain(J.map(de)), ye) : B;
                  }, ye.copy = function() {
                    return If(R.copy(), B, J);
                  }, bi(ye, R);
                }
                function Tu(R) {
                  return function(B) {
                    return B < 0 ? -Math.pow(-B, R) : Math.pow(B, R);
                  };
                }
                f.scale.sqrt = function() {
                  return f.scale.pow().exponent(0.5);
                }, f.scale.ordinal = function() {
                  return cl([], {
                    t: "range",
                    a: [[]]
                  });
                };
                function cl(R, B) {
                  var J, de, pe;
                  function ye(Ee) {
                    return de[((J.get(Ee) || (B.t === "range" ? J.set(Ee, R.push(Ee)) : NaN)) - 1) % de.length];
                  }
                  function ke(Ee, He) {
                    return f.range(R.length).map(function(Ke) {
                      return Ee + He * Ke;
                    });
                  }
                  return ye.domain = function(Ee) {
                    if (!arguments.length) return R;
                    R = [], J = new Y();
                    for (var He = -1, Ke = Ee.length, Qe; ++He < Ke; ) J.has(Qe = Ee[He]) || J.set(Qe, R.push(Qe));
                    return ye[B.t].apply(ye, B.a);
                  }, ye.range = function(Ee) {
                    return arguments.length ? (de = Ee, pe = 0, B = {
                      t: "range",
                      a: arguments
                    }, ye) : de;
                  }, ye.rangePoints = function(Ee, He) {
                    arguments.length < 2 && (He = 0);
                    var Ke = Ee[0], Qe = Ee[1], yt = R.length < 2 ? (Ke = (Ke + Qe) / 2, 0) : (Qe - Ke) / (R.length - 1 + He);
                    return de = ke(Ke + yt * He / 2, yt), pe = 0, B = {
                      t: "rangePoints",
                      a: arguments
                    }, ye;
                  }, ye.rangeRoundPoints = function(Ee, He) {
                    arguments.length < 2 && (He = 0);
                    var Ke = Ee[0], Qe = Ee[1], yt = R.length < 2 ? (Ke = Qe = Math.round((Ke + Qe) / 2), 0) : (Qe - Ke) / (R.length - 1 + He) | 0;
                    return de = ke(Ke + Math.round(yt * He / 2 + (Qe - Ke - (R.length - 1 + He) * yt) / 2), yt), pe = 0, B = {
                      t: "rangeRoundPoints",
                      a: arguments
                    }, ye;
                  }, ye.rangeBands = function(Ee, He, Ke) {
                    arguments.length < 2 && (He = 0), arguments.length < 3 && (Ke = He);
                    var Qe = Ee[1] < Ee[0], yt = Ee[Qe - 0], mt = Ee[1 - Qe], Bt = (mt - yt) / (R.length - He + 2 * Ke);
                    return de = ke(yt + Bt * Ke, Bt), Qe && de.reverse(), pe = Bt * (1 - He), B = {
                      t: "rangeBands",
                      a: arguments
                    }, ye;
                  }, ye.rangeRoundBands = function(Ee, He, Ke) {
                    arguments.length < 2 && (He = 0), arguments.length < 3 && (Ke = He);
                    var Qe = Ee[1] < Ee[0], yt = Ee[Qe - 0], mt = Ee[1 - Qe], Bt = Math.floor((mt - yt) / (R.length - He + 2 * Ke));
                    return de = ke(yt + Math.round((mt - yt - (R.length - He) * Bt) / 2), Bt), Qe && de.reverse(), pe = Math.round(Bt * (1 - He)), B = {
                      t: "rangeRoundBands",
                      a: arguments
                    }, ye;
                  }, ye.rangeBand = function() {
                    return pe;
                  }, ye.rangeExtent = function() {
                    return Ci(B.a[0]);
                  }, ye.copy = function() {
                    return cl(R, B);
                  }, ye.domain(R);
                }
                f.scale.category10 = function() {
                  return f.scale.ordinal().range(Cc);
                }, f.scale.category20 = function() {
                  return f.scale.ordinal().range(Yo);
                }, f.scale.category20b = function() {
                  return f.scale.ordinal().range(bc);
                }, f.scale.category20c = function() {
                  return f.scale.ordinal().range(tg);
                };
                var Cc = [2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175].map(dt), Yo = [2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725].map(dt), bc = [3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654].map(dt), tg = [3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081].map(dt);
                f.scale.quantile = function() {
                  return Os([], []);
                };
                function Os(R, B) {
                  var J;
                  function de() {
                    var ye = 0, ke = B.length;
                    for (J = []; ++ye < ke; ) J[ye - 1] = f.quantile(R, ye / ke);
                    return pe;
                  }
                  function pe(ye) {
                    if (!isNaN(ye = +ye)) return B[f.bisect(J, ye)];
                  }
                  return pe.domain = function(ye) {
                    return arguments.length ? (R = ye.map(F).filter(P).sort(T), de()) : R;
                  }, pe.range = function(ye) {
                    return arguments.length ? (B = ye, de()) : B;
                  }, pe.quantiles = function() {
                    return J;
                  }, pe.invertExtent = function(ye) {
                    return ye = B.indexOf(ye), ye < 0 ? [NaN, NaN] : [ye > 0 ? J[ye - 1] : R[0], ye < J.length ? J[ye] : R[R.length - 1]];
                  }, pe.copy = function() {
                    return Os(R, B);
                  }, de();
                }
                f.scale.quantize = function() {
                  return wc(0, 1, [0, 1]);
                };
                function wc(R, B, J) {
                  var de, pe;
                  function ye(Ee) {
                    return J[Math.max(0, Math.min(pe, Math.floor(de * (Ee - R))))];
                  }
                  function ke() {
                    return de = J.length / (B - R), pe = J.length - 1, ye;
                  }
                  return ye.domain = function(Ee) {
                    return arguments.length ? (R = +Ee[0], B = +Ee[Ee.length - 1], ke()) : [R, B];
                  }, ye.range = function(Ee) {
                    return arguments.length ? (J = Ee, ke()) : J;
                  }, ye.invertExtent = function(Ee) {
                    return Ee = J.indexOf(Ee), Ee = Ee < 0 ? NaN : Ee / de + R, [Ee, Ee + 1 / de];
                  }, ye.copy = function() {
                    return wc(R, B, J);
                  }, ke();
                }
                f.scale.threshold = function() {
                  return Lf([0.5], [0, 1]);
                };
                function Lf(R, B) {
                  function J(de) {
                    if (de <= de) return B[f.bisect(R, de)];
                  }
                  return J.domain = function(de) {
                    return arguments.length ? (R = de, J) : R;
                  }, J.range = function(de) {
                    return arguments.length ? (B = de, J) : B;
                  }, J.invertExtent = function(de) {
                    return de = B.indexOf(de), [R[de - 1], R[de]];
                  }, J.copy = function() {
                    return Lf(R, B);
                  }, J;
                }
                f.scale.identity = function() {
                  return Sc([0, 1]);
                };
                function Sc(R) {
                  function B(J) {
                    return +J;
                  }
                  return B.invert = B, B.domain = B.range = function(J) {
                    return arguments.length ? (R = J.map(B), B) : R;
                  }, B.ticks = function(J) {
                    return ul(R, J);
                  }, B.tickFormat = function(J, de) {
                    return d3_scale_linearTickFormat(R, J, de);
                  }, B.copy = function() {
                    return Sc(R);
                  }, B;
                }
                f.svg = {};
                function gp() {
                  return 0;
                }
                f.svg.arc = function() {
                  var R = kf, B = Of, J = gp, de = Ru, pe = wd, ye = Nf, ke = ss;
                  function Ee() {
                    var Ke = Math.max(0, +R.apply(this, arguments)), Qe = Math.max(0, +B.apply(this, arguments)), yt = pe.apply(this, arguments) - Xe, mt = ye.apply(this, arguments) - Xe, Bt = Math.abs(mt - yt), Zt = yt > mt ? 0 : 1;
                    if (Qe < Ke && (qe = Qe, Qe = Ke, Ke = qe), Bt >= je) return He(Qe, Zt) + (Ke ? He(Ke, 1 - Zt) : "") + "Z";
                    var qe, Et, Dt, Xt, Kt = 0, Vt = 0, wr, Wr, Xr, _r, en, Qr, En, qr, An = [];
                    if ((Xt = (+ke.apply(this, arguments) || 0) / 2) && (Dt = de === Ru ? Math.sqrt(Ke * Ke + Qe * Qe) : +de.apply(this, arguments), Zt || (Vt *= -1), Qe && (Vt = At(Dt / Qe * Math.sin(Xt))), Ke && (Kt = At(Dt / Ke * Math.sin(Xt)))), Qe) {
                      wr = Qe * Math.cos(yt + Vt), Wr = Qe * Math.sin(yt + Vt), Xr = Qe * Math.cos(mt - Vt), _r = Qe * Math.sin(mt - Vt);
                      var ti = Math.abs(mt - yt - 2 * Vt) <= Te ? 0 : 1;
                      if (Vt && Zl(wr, Wr, Xr, _r) === Zt ^ ti) {
                        var $i = (yt + mt) / 2;
                        wr = Qe * Math.cos($i), Wr = Qe * Math.sin($i), Xr = _r = null;
                      }
                    } else
                      wr = Wr = 0;
                    if (Ke) {
                      en = Ke * Math.cos(mt - Kt), Qr = Ke * Math.sin(mt - Kt), En = Ke * Math.cos(yt + Kt), qr = Ke * Math.sin(yt + Kt);
                      var ui = Math.abs(yt - mt + 2 * Kt) <= Te ? 0 : 1;
                      if (Kt && Zl(en, Qr, En, qr) === 1 - Zt ^ ui) {
                        var Nr = (yt + mt) / 2;
                        en = Ke * Math.cos(Nr), Qr = Ke * Math.sin(Nr), En = qr = null;
                      }
                    } else
                      en = Qr = 0;
                    if (Bt > Ye && (qe = Math.min(Math.abs(Qe - Ke) / 2, +J.apply(this, arguments))) > 1e-3) {
                      Et = Ke < Qe ^ Zt ? 0 : 1;
                      var un = qe, Nn = qe;
                      if (Bt < Te) {
                        var xn = En == null ? [en, Qr] : Xr == null ? [wr, Wr] : Wn([wr, Wr], [En, qr], [Xr, _r], [en, Qr]), wi = wr - xn[0], ea = Wr - xn[1], ua = Xr - xn[0], ga = _r - xn[1], ro = 1 / Math.sin(Math.acos((wi * ua + ea * ga) / (Math.sqrt(wi * wi + ea * ea) * Math.sqrt(ua * ua + ga * ga))) / 2), ja = Math.sqrt(xn[0] * xn[0] + xn[1] * xn[1]);
                        Nn = Math.min(qe, (Ke - ja) / (ro - 1)), un = Math.min(qe, (Qe - ja) / (ro + 1));
                      }
                      if (Xr != null) {
                        var co = dl(En == null ? [en, Qr] : [En, qr], [wr, Wr], Qe, un, Zt), Ri = dl([Xr, _r], [en, Qr], Qe, un, Zt);
                        qe === un ? An.push("M", co[0], "A", un, ",", un, " 0 0,", Et, " ", co[1], "A", Qe, ",", Qe, " 0 ", 1 - Zt ^ Zl(co[1][0], co[1][1], Ri[1][0], Ri[1][1]), ",", Zt, " ", Ri[1], "A", un, ",", un, " 0 0,", Et, " ", Ri[0]) : An.push("M", co[0], "A", un, ",", un, " 0 1,", Et, " ", Ri[0]);
                      } else
                        An.push("M", wr, ",", Wr);
                      if (En != null) {
                        var Li = dl([wr, Wr], [En, qr], Ke, -Nn, Zt), Bs = dl([en, Qr], Xr == null ? [wr, Wr] : [Xr, _r], Ke, -Nn, Zt);
                        qe === Nn ? An.push("L", Bs[0], "A", Nn, ",", Nn, " 0 0,", Et, " ", Bs[1], "A", Ke, ",", Ke, " 0 ", Zt ^ Zl(Bs[1][0], Bs[1][1], Li[1][0], Li[1][1]), ",", 1 - Zt, " ", Li[1], "A", Nn, ",", Nn, " 0 0,", Et, " ", Li[0]) : An.push("L", Bs[0], "A", Nn, ",", Nn, " 0 0,", Et, " ", Li[0]);
                      } else
                        An.push("L", en, ",", Qr);
                    } else
                      An.push("M", wr, ",", Wr), Xr != null && An.push("A", Qe, ",", Qe, " 0 ", ti, ",", Zt, " ", Xr, ",", _r), An.push("L", en, ",", Qr), En != null && An.push("A", Ke, ",", Ke, " 0 ", ui, ",", 1 - Zt, " ", En, ",", qr);
                    return An.push("Z"), An.join("");
                  }
                  function He(Ke, Qe) {
                    return "M0," + Ke + "A" + Ke + "," + Ke + " 0 1," + Qe + " 0," + -Ke + "A" + Ke + "," + Ke + " 0 1," + Qe + " 0," + Ke;
                  }
                  return Ee.innerRadius = function(Ke) {
                    return arguments.length ? (R = nr(Ke), Ee) : R;
                  }, Ee.outerRadius = function(Ke) {
                    return arguments.length ? (B = nr(Ke), Ee) : B;
                  }, Ee.cornerRadius = function(Ke) {
                    return arguments.length ? (J = nr(Ke), Ee) : J;
                  }, Ee.padRadius = function(Ke) {
                    return arguments.length ? (de = Ke == Ru ? Ru : nr(Ke), Ee) : de;
                  }, Ee.startAngle = function(Ke) {
                    return arguments.length ? (pe = nr(Ke), Ee) : pe;
                  }, Ee.endAngle = function(Ke) {
                    return arguments.length ? (ye = nr(Ke), Ee) : ye;
                  }, Ee.padAngle = function(Ke) {
                    return arguments.length ? (ke = nr(Ke), Ee) : ke;
                  }, Ee.centroid = function() {
                    var Ke = (+R.apply(this, arguments) + +B.apply(this, arguments)) / 2, Qe = (+pe.apply(this, arguments) + +ye.apply(this, arguments)) / 2 - Xe;
                    return [Math.cos(Qe) * Ke, Math.sin(Qe) * Ke];
                  }, Ee;
                };
                var Ru = "auto";
                function kf(R) {
                  return R.innerRadius;
                }
                function Of(R) {
                  return R.outerRadius;
                }
                function wd(R) {
                  return R.startAngle;
                }
                function Nf(R) {
                  return R.endAngle;
                }
                function ss(R) {
                  return R && R.padAngle;
                }
                function Zl(R, B, J, de) {
                  return (R - J) * B - (B - de) * R > 0 ? 0 : 1;
                }
                function dl(R, B, J, de, pe) {
                  var ye = R[0] - B[0], ke = R[1] - B[1], Ee = (pe ? de : -de) / Math.sqrt(ye * ye + ke * ke), He = Ee * ke, Ke = -Ee * ye, Qe = R[0] + He, yt = R[1] + Ke, mt = B[0] + He, Bt = B[1] + Ke, Zt = (Qe + mt) / 2, qe = (yt + Bt) / 2, Et = mt - Qe, Dt = Bt - yt, Xt = Et * Et + Dt * Dt, Kt = J - de, Vt = Qe * Bt - mt * yt, wr = (Dt < 0 ? -1 : 1) * Math.sqrt(Math.max(0, Kt * Kt * Xt - Vt * Vt)), Wr = (Vt * Dt - Et * wr) / Xt, Xr = (-Vt * Et - Dt * wr) / Xt, _r = (Vt * Dt + Et * wr) / Xt, en = (-Vt * Et + Dt * wr) / Xt, Qr = Wr - Zt, En = Xr - qe, qr = _r - Zt, An = en - qe;
                  return Qr * Qr + En * En > qr * qr + An * An && (Wr = _r, Xr = en), [[Wr - He, Xr - Ke], [Wr * J / Kt, Xr * J / Kt]];
                }
                function Gf() {
                  return !0;
                }
                function Ra(R) {
                  var B = Pi, J = pn, de = Gf, pe = mo, ye = pe.key, ke = 0.7;
                  function Ee(He) {
                    var Ke = [], Qe = [], yt = -1, mt = He.length, Bt, Zt = nr(B), qe = nr(J);
                    function Et() {
                      Ke.push("M", pe(R(Qe), ke));
                    }
                    for (; ++yt < mt; )
                      de.call(this, Bt = He[yt], yt) ? Qe.push([+Zt.call(this, Bt, yt), +qe.call(this, Bt, yt)]) : Qe.length && (Et(), Qe = []);
                    return Qe.length && Et(), Ke.length ? Ke.join("") : null;
                  }
                  return Ee.x = function(He) {
                    return arguments.length ? (B = He, Ee) : B;
                  }, Ee.y = function(He) {
                    return arguments.length ? (J = He, Ee) : J;
                  }, Ee.defined = function(He) {
                    return arguments.length ? (de = He, Ee) : de;
                  }, Ee.interpolate = function(He) {
                    return arguments.length ? (typeof He == "function" ? ye = pe = He : ye = (pe = fl.get(He) || mo).key, Ee) : ye;
                  }, Ee.tension = function(He) {
                    return arguments.length ? (ke = He, Ee) : ke;
                  }, Ee;
                }
                f.svg.line = function() {
                  return Ra(U);
                };
                var fl = f.map({
                  linear: mo,
                  "linear-closed": hl,
                  step: Kl,
                  "step-before": va,
                  "step-after": Xo,
                  basis: xc,
                  "basis-open": Hf,
                  "basis-closed": Sd,
                  bundle: Bf,
                  cardinal: vl,
                  "cardinal-open": pl,
                  "cardinal-closed": Aa,
                  monotone: Gs
                });
                fl.forEach(function(R, B) {
                  B.key = R, B.closed = /-closed$/.test(R);
                });
                function mo(R) {
                  return R.length > 1 ? R.join("L") : R + "Z";
                }
                function hl(R) {
                  return R.join("L") + "Z";
                }
                function Kl(R) {
                  for (var B = 0, J = R.length, de = R[0], pe = [de[0], ",", de[1]]; ++B < J; ) pe.push("H", (de[0] + (de = R[B])[0]) / 2, "V", de[1]);
                  return J > 1 && pe.push("H", de[0]), pe.join("");
                }
                function va(R) {
                  for (var B = 0, J = R.length, de = R[0], pe = [de[0], ",", de[1]]; ++B < J; ) pe.push("V", (de = R[B])[1], "H", de[0]);
                  return pe.join("");
                }
                function Xo(R) {
                  for (var B = 0, J = R.length, de = R[0], pe = [de[0], ",", de[1]]; ++B < J; ) pe.push("H", (de = R[B])[0], "V", de[1]);
                  return pe.join("");
                }
                function pl(R, B) {
                  return R.length < 4 ? mo(R) : R[1] + $o(R.slice(1, -1), Io(R, B));
                }
                function Aa(R, B) {
                  return R.length < 3 ? hl(R) : R[0] + $o((R.push(R[0]), R), Io([R[R.length - 2]].concat(R, [R[1]]), B));
                }
                function vl(R, B) {
                  return R.length < 3 ? mo(R) : R[0] + $o(R, Io(R, B));
                }
                function $o(R, B) {
                  if (B.length < 1 || R.length != B.length && R.length != B.length + 2)
                    return mo(R);
                  var J = R.length != B.length, de = "", pe = R[0], ye = R[1], ke = B[0], Ee = ke, He = 1;
                  if (J && (de += "Q" + (ye[0] - ke[0] * 2 / 3) + "," + (ye[1] - ke[1] * 2 / 3) + "," + ye[0] + "," + ye[1], pe = R[1], He = 2), B.length > 1) {
                    Ee = B[1], ye = R[He], He++, de += "C" + (pe[0] + ke[0]) + "," + (pe[1] + ke[1]) + "," + (ye[0] - Ee[0]) + "," + (ye[1] - Ee[1]) + "," + ye[0] + "," + ye[1];
                    for (var Ke = 2; Ke < B.length; Ke++, He++)
                      ye = R[He], Ee = B[Ke], de += "S" + (ye[0] - Ee[0]) + "," + (ye[1] - Ee[1]) + "," + ye[0] + "," + ye[1];
                  }
                  if (J) {
                    var Qe = R[He];
                    de += "Q" + (ye[0] + Ee[0] * 2 / 3) + "," + (ye[1] + Ee[1] * 2 / 3) + "," + Qe[0] + "," + Qe[1];
                  }
                  return de;
                }
                function Io(R, B) {
                  for (var J = [], de = (1 - B) / 2, pe, ye = R[0], ke = R[1], Ee = 1, He = R.length; ++Ee < He; )
                    pe = ye, ye = ke, ke = R[Ee], J.push([de * (ke[0] - pe[0]), de * (ke[1] - pe[1])]);
                  return J;
                }
                function xc(R) {
                  if (R.length < 3) return mo(R);
                  var B = 1, J = R.length, de = R[0], pe = de[0], ye = de[1], ke = [pe, pe, pe, (de = R[1])[0]], Ee = [ye, ye, ye, de[1]], He = [pe, ",", ye, "L", Ea(ls, ke), ",", Ea(ls, Ee)];
                  for (R.push(R[J - 1]); ++B <= J; )
                    de = R[B], ke.shift(), ke.push(de[0]), Ee.shift(), Ee.push(de[1]), xd(He, ke, Ee);
                  return R.pop(), He.push("L", de), He.join("");
                }
                function Hf(R) {
                  if (R.length < 4) return mo(R);
                  for (var B = [], J = -1, de = R.length, pe, ye = [0], ke = [0]; ++J < 3; )
                    pe = R[J], ye.push(pe[0]), ke.push(pe[1]);
                  for (B.push(Ea(ls, ye) + "," + Ea(ls, ke)), --J; ++J < de; )
                    pe = R[J], ye.shift(), ye.push(pe[0]), ke.shift(), ke.push(pe[1]), xd(B, ye, ke);
                  return B.join("");
                }
                function Sd(R) {
                  for (var B, J = -1, de = R.length, pe = de + 4, ye, ke = [], Ee = []; ++J < 4; )
                    ye = R[J % de], ke.push(ye[0]), Ee.push(ye[1]);
                  for (B = [Ea(ls, ke), ",", Ea(ls, Ee)], --J; ++J < pe; )
                    ye = R[J % de], ke.shift(), ke.push(ye[0]), Ee.shift(), Ee.push(ye[1]), xd(B, ke, Ee);
                  return B.join("");
                }
                function Bf(R, B) {
                  var J = R.length - 1;
                  if (J)
                    for (var de = R[0][0], pe = R[0][1], ye = R[J][0] - de, ke = R[J][1] - pe, Ee = -1, He, Ke; ++Ee <= J; )
                      He = R[Ee], Ke = Ee / J, He[0] = B * He[0] + (1 - B) * (de + Ke * ye), He[1] = B * He[1] + (1 - B) * (pe + Ke * ke);
                  return xc(R);
                }
                function Ea(R, B) {
                  return R[0] * B[0] + R[1] * B[1] + R[2] * B[2] + R[3] * B[3];
                }
                var lo = [0, 2 / 3, 1 / 3, 0], yo = [0, 1 / 3, 2 / 3, 0], ls = [0, 1 / 6, 2 / 3, 1 / 6];
                function xd(R, B, J) {
                  R.push("C", Ea(lo, B), ",", Ea(lo, J), ",", Ea(yo, B), ",", Ea(yo, J), ",", Ea(ls, B), ",", Ea(ls, J));
                }
                function Co(R, B) {
                  return (B[1] - R[1]) / (B[0] - R[0]);
                }
                function Ns(R) {
                  for (var B = 0, J = R.length - 1, de = [], pe = R[0], ye = R[1], ke = de[0] = Co(pe, ye); ++B < J; )
                    de[B] = (ke + (ke = Co(pe = ye, ye = R[B + 1]))) / 2;
                  return de[B] = ke, de;
                }
                function mp(R) {
                  for (var B = [], J, de, pe, ye, ke = Ns(R), Ee = -1, He = R.length - 1; ++Ee < He; )
                    J = Co(R[Ee], R[Ee + 1]), A(J) < Ye ? ke[Ee] = ke[Ee + 1] = 0 : (de = ke[Ee] / J, pe = ke[Ee + 1] / J, ye = de * de + pe * pe, ye > 9 && (ye = J * 3 / Math.sqrt(ye), ke[Ee] = ye * de, ke[Ee + 1] = ye * pe));
                  for (Ee = -1; ++Ee <= He; )
                    ye = (R[Math.min(He, Ee + 1)][0] - R[Math.max(0, Ee - 1)][0]) / (6 * (1 + ke[Ee] * ke[Ee])), B.push([ye || 0, ke[Ee] * ye || 0]);
                  return B;
                }
                function Gs(R) {
                  return R.length < 3 ? mo(R) : R[0] + $o(R, mp(R));
                }
                f.svg.line.radial = function() {
                  var R = Ra(Td);
                  return R.radius = R.x, delete R.x, R.angle = R.y, delete R.y, R;
                };
                function Td(R) {
                  for (var B, J = -1, de = R.length, pe, ye; ++J < de; )
                    B = R[J], pe = B[0], ye = B[1] - Xe, B[0] = pe * Math.cos(ye), B[1] = pe * Math.sin(ye);
                  return R;
                }
                function Tc(R) {
                  var B = Pi, J = Pi, de = 0, pe = pn, ye = Gf, ke = mo, Ee = ke.key, He = ke, Ke = "L", Qe = 0.7;
                  function yt(mt) {
                    var Bt = [], Zt = [], qe = [], Et = -1, Dt = mt.length, Xt, Kt = nr(B), Vt = nr(de), wr = B === J ? function() {
                      return Xr;
                    } : nr(J), Wr = de === pe ? function() {
                      return _r;
                    } : nr(pe), Xr, _r;
                    function en() {
                      Bt.push("M", ke(R(qe), Qe), Ke, He(R(Zt.reverse()), Qe), "Z");
                    }
                    for (; ++Et < Dt; )
                      ye.call(this, Xt = mt[Et], Et) ? (Zt.push([Xr = +Kt.call(this, Xt, Et), _r = +Vt.call(this, Xt, Et)]), qe.push([+wr.call(this, Xt, Et), +Wr.call(this, Xt, Et)])) : Zt.length && (en(), Zt = [], qe = []);
                    return Zt.length && en(), Bt.length ? Bt.join("") : null;
                  }
                  return yt.x = function(mt) {
                    return arguments.length ? (B = J = mt, yt) : J;
                  }, yt.x0 = function(mt) {
                    return arguments.length ? (B = mt, yt) : B;
                  }, yt.x1 = function(mt) {
                    return arguments.length ? (J = mt, yt) : J;
                  }, yt.y = function(mt) {
                    return arguments.length ? (de = pe = mt, yt) : pe;
                  }, yt.y0 = function(mt) {
                    return arguments.length ? (de = mt, yt) : de;
                  }, yt.y1 = function(mt) {
                    return arguments.length ? (pe = mt, yt) : pe;
                  }, yt.defined = function(mt) {
                    return arguments.length ? (ye = mt, yt) : ye;
                  }, yt.interpolate = function(mt) {
                    return arguments.length ? (typeof mt == "function" ? Ee = ke = mt : Ee = (ke = fl.get(mt) || mo).key, He = ke.reverse || ke, Ke = ke.closed ? "M" : "L", yt) : Ee;
                  }, yt.tension = function(mt) {
                    return arguments.length ? (Qe = mt, yt) : Qe;
                  }, yt;
                }
                va.reverse = Xo, Xo.reverse = va, f.svg.area = function() {
                  return Tc(U);
                }, f.svg.area.radial = function() {
                  var R = Tc(Td);
                  return R.radius = R.x, delete R.x, R.innerRadius = R.x0, delete R.x0, R.outerRadius = R.x1, delete R.x1, R.angle = R.y, delete R.y, R.startAngle = R.y0, delete R.y0, R.endAngle = R.y1, delete R.y1, R;
                };
                function Au(R) {
                  return R.source;
                }
                function Jl(R) {
                  return R.target;
                }
                f.svg.chord = function() {
                  var R = Au, B = Jl, J = Rc, de = wd, pe = Nf;
                  function ye(Qe, yt) {
                    var mt = ke(this, R, Qe, yt), Bt = ke(this, B, Qe, yt);
                    return "M" + mt.p0 + He(mt.r, mt.p1, mt.a1 - mt.a0) + (Ee(mt, Bt) ? Ke(mt.r, mt.p1, mt.r, mt.p0) : Ke(mt.r, mt.p1, Bt.r, Bt.p0) + He(Bt.r, Bt.p1, Bt.a1 - Bt.a0) + Ke(Bt.r, Bt.p1, mt.r, mt.p0)) + "Z";
                  }
                  function ke(Qe, yt, mt, Bt) {
                    var Zt = yt.call(Qe, mt, Bt), qe = J.call(Qe, Zt, Bt), Et = de.call(Qe, Zt, Bt) - Xe, Dt = pe.call(Qe, Zt, Bt) - Xe;
                    return {
                      r: qe,
                      a0: Et,
                      a1: Dt,
                      p0: [qe * Math.cos(Et), qe * Math.sin(Et)],
                      p1: [qe * Math.cos(Dt), qe * Math.sin(Dt)]
                    };
                  }
                  function Ee(Qe, yt) {
                    return Qe.a0 == yt.a0 && Qe.a1 == yt.a1;
                  }
                  function He(Qe, yt, mt) {
                    return "A" + Qe + "," + Qe + " 0 " + +(mt > Te) + ",1 " + yt;
                  }
                  function Ke(Qe, yt, mt, Bt) {
                    return "Q 0,0 " + Bt;
                  }
                  return ye.radius = function(Qe) {
                    return arguments.length ? (J = nr(Qe), ye) : J;
                  }, ye.source = function(Qe) {
                    return arguments.length ? (R = nr(Qe), ye) : R;
                  }, ye.target = function(Qe) {
                    return arguments.length ? (B = nr(Qe), ye) : B;
                  }, ye.startAngle = function(Qe) {
                    return arguments.length ? (de = nr(Qe), ye) : de;
                  }, ye.endAngle = function(Qe) {
                    return arguments.length ? (pe = nr(Qe), ye) : pe;
                  }, ye;
                };
                function Rc(R) {
                  return R.radius;
                }
                f.svg.diagonal = function() {
                  var R = Au, B = Jl, J = gl;
                  function de(pe, ye) {
                    var ke = R.call(this, pe, ye), Ee = B.call(this, pe, ye), He = (ke.y + Ee.y) / 2, Ke = [ke, {
                      x: ke.x,
                      y: He
                    }, {
                      x: Ee.x,
                      y: He
                    }, Ee];
                    return Ke = Ke.map(J), "M" + Ke[0] + "C" + Ke[1] + " " + Ke[2] + " " + Ke[3];
                  }
                  return de.source = function(pe) {
                    return arguments.length ? (R = nr(pe), de) : R;
                  }, de.target = function(pe) {
                    return arguments.length ? (B = nr(pe), de) : B;
                  }, de.projection = function(pe) {
                    return arguments.length ? (J = pe, de) : J;
                  }, de;
                };
                function gl(R) {
                  return [R.x, R.y];
                }
                f.svg.diagonal.radial = function() {
                  var R = f.svg.diagonal(), B = gl, J = R.projection;
                  return R.projection = function(de) {
                    return arguments.length ? J(Rd(B = de)) : B;
                  }, R;
                };
                function Rd(R) {
                  return function() {
                    var B = R.apply(this, arguments), J = B[0], de = B[1] - Xe;
                    return [J * Math.cos(de), J * Math.sin(de)];
                  };
                }
                f.svg.symbol = function() {
                  var R = Ql, B = Ad;
                  function J(de, pe) {
                    return (Eu.get(R.call(this, de, pe)) || ql)(B.call(this, de, pe));
                  }
                  return J.type = function(de) {
                    return arguments.length ? (R = nr(de), J) : R;
                  }, J.size = function(de) {
                    return arguments.length ? (B = nr(de), J) : B;
                  }, J;
                };
                function Ad() {
                  return 64;
                }
                function Ql() {
                  return "circle";
                }
                function ql(R) {
                  var B = Math.sqrt(R / Te);
                  return "M0," + B + "A" + B + "," + B + " 0 1,1 0," + -B + "A" + B + "," + B + " 0 1,1 0," + B + "Z";
                }
                var Eu = f.map({
                  circle: ql,
                  cross: function(R) {
                    var B = Math.sqrt(R / 5) / 2;
                    return "M" + -3 * B + "," + -B + "H" + -B + "V" + -3 * B + "H" + B + "V" + -B + "H" + 3 * B + "V" + B + "H" + B + "V" + 3 * B + "H" + -B + "V" + B + "H" + -3 * B + "Z";
                  },
                  diamond: function(R) {
                    var B = Math.sqrt(R / (2 * Du)), J = B * Du;
                    return "M0," + -B + "L" + J + ",0 0," + B + " " + -J + ",0Z";
                  },
                  square: function(R) {
                    var B = Math.sqrt(R) / 2;
                    return "M" + -B + "," + -B + "L" + B + "," + -B + " " + B + "," + B + " " + -B + "," + B + "Z";
                  },
                  "triangle-down": function(R) {
                    var B = Math.sqrt(R / Mu), J = B * Mu / 2;
                    return "M0," + J + "L" + B + "," + -J + " " + -B + "," + -J + "Z";
                  },
                  "triangle-up": function(R) {
                    var B = Math.sqrt(R / Mu), J = B * Mu / 2;
                    return "M0," + -J + "L" + B + "," + J + " " + -B + "," + J + "Z";
                  }
                });
                f.svg.symbolTypes = Eu.keys();
                var Mu = Math.sqrt(3), Du = Math.tan(30 * nt);
                V.transition = function(R) {
                  for (var B = bo || ++Pu, J = Ac(R), de = [], pe, ye, ke = yl || {
                    time: Date.now(),
                    ease: np,
                    delay: 0,
                    duration: 250
                  }, Ee = -1, He = this.length; ++Ee < He; ) {
                    de.push(pe = []);
                    for (var Ke = this[Ee], Qe = -1, yt = Ke.length; ++Qe < yt; )
                      (ye = Ke[Qe]) && Xi(ye, Qe, J, B, ke), pe.push(ye);
                  }
                  return uo(de, J, B);
                }, V.interrupt = function(R) {
                  return this.each(R == null ? Fu : ml(Ac(R)));
                };
                var Fu = ml(Ac());
                function ml(R) {
                  return function() {
                    var B, J, de;
                    (B = this[R]) && (de = B[J = B.active]) && (de.timer.c = null, de.timer.t = NaN, --B.count ? delete B[J] : delete this[R], B.active += 0.5, de.event && de.event.interrupt.call(this, this.__data__, de.index));
                  };
                }
                function uo(R, B, J) {
                  return Ae(R, Yi), R.namespace = B, R.id = J, R;
                }
                var Yi = [], Pu = 0, bo, yl;
                Yi.call = V.call, Yi.empty = V.empty, Yi.node = V.node, Yi.size = V.size, f.transition = function(R, B) {
                  return R && R.transition ? bo ? R.transition(B) : R : f.selection().transition(R);
                }, f.transition.prototype = Yi, Yi.select = function(R) {
                  var B = this.id, J = this.namespace, de = [], pe, ye, ke;
                  R = fe(R);
                  for (var Ee = -1, He = this.length; ++Ee < He; ) {
                    de.push(pe = []);
                    for (var Ke = this[Ee], Qe = -1, yt = Ke.length; ++Qe < yt; )
                      (ke = Ke[Qe]) && (ye = R.call(ke, ke.__data__, Qe, Ee)) ? ("__data__" in ke && (ye.__data__ = ke.__data__), Xi(ye, Qe, J, B, ke[J][B]), pe.push(ye)) : pe.push(null);
                  }
                  return uo(de, J, B);
                }, Yi.selectAll = function(R) {
                  var B = this.id, J = this.namespace, de = [], pe, ye, ke, Ee, He;
                  R = $(R);
                  for (var Ke = -1, Qe = this.length; ++Ke < Qe; )
                    for (var yt = this[Ke], mt = -1, Bt = yt.length; ++mt < Bt; )
                      if (ke = yt[mt]) {
                        He = ke[J][B], ye = R.call(ke, ke.__data__, mt, Ke), de.push(pe = []);
                        for (var Zt = -1, qe = ye.length; ++Zt < qe; )
                          (Ee = ye[Zt]) && Xi(Ee, Zt, J, B, He), pe.push(Ee);
                      }
                  return uo(de, J, B);
                }, Yi.filter = function(R) {
                  var B = [], J, de, pe;
                  typeof R != "function" && (R = ot(R));
                  for (var ye = 0, ke = this.length; ye < ke; ye++) {
                    B.push(J = []);
                    for (var de = this[ye], Ee = 0, He = de.length; Ee < He; Ee++)
                      (pe = de[Ee]) && R.call(pe, pe.__data__, Ee, ye) && J.push(pe);
                  }
                  return uo(B, this.namespace, this.id);
                }, Yi.tween = function(R, B) {
                  var J = this.id, de = this.namespace;
                  return arguments.length < 2 ? this.node()[de][J].tween.get(R) : Tt(this, B == null ? function(pe) {
                    pe[de][J].tween.remove(R);
                  } : function(pe) {
                    pe[de][J].tween.set(R, B);
                  });
                };
                function Cl(R, B, J, de) {
                  var pe = R.id, ye = R.namespace;
                  return Tt(R, typeof J == "function" ? function(ke, Ee, He) {
                    ke[ye][pe].tween.set(B, de(J.call(ke, ke.__data__, Ee, He)));
                  } : (J = de(J), function(ke) {
                    ke[ye][pe].tween.set(B, J);
                  }));
                }
                Yi.attr = function(R, B) {
                  if (arguments.length < 2) {
                    for (B in R) this.attr(B, R[B]);
                    return this;
                  }
                  var J = R == "transform" ? Wa : Ds, de = f.ns.qualify(R);
                  function pe() {
                    this.removeAttribute(de);
                  }
                  function ye() {
                    this.removeAttributeNS(de.space, de.local);
                  }
                  function ke(He) {
                    return He == null ? pe : (He += "", function() {
                      var Ke = this.getAttribute(de), Qe;
                      return Ke !== He && (Qe = J(Ke, He), function(yt) {
                        this.setAttribute(de, Qe(yt));
                      });
                    });
                  }
                  function Ee(He) {
                    return He == null ? ye : (He += "", function() {
                      var Ke = this.getAttributeNS(de.space, de.local), Qe;
                      return Ke !== He && (Qe = J(Ke, He), function(yt) {
                        this.setAttributeNS(de.space, de.local, Qe(yt));
                      });
                    });
                  }
                  return Cl(this, "attr." + R, B, de.local ? Ee : ke);
                }, Yi.attrTween = function(R, B) {
                  var J = f.ns.qualify(R);
                  function de(ye, ke) {
                    var Ee = B.call(this, ye, ke, this.getAttribute(J));
                    return Ee && function(He) {
                      this.setAttribute(J, Ee(He));
                    };
                  }
                  function pe(ye, ke) {
                    var Ee = B.call(this, ye, ke, this.getAttributeNS(J.space, J.local));
                    return Ee && function(He) {
                      this.setAttributeNS(J.space, J.local, Ee(He));
                    };
                  }
                  return this.tween("attr." + R, J.local ? pe : de);
                }, Yi.style = function(R, B, J) {
                  var de = arguments.length;
                  if (de < 3) {
                    if (typeof R != "string") {
                      de < 2 && (B = "");
                      for (J in R) this.style(J, R[J], B);
                      return this;
                    }
                    J = "";
                  }
                  function pe() {
                    this.style.removeProperty(R);
                  }
                  function ye(ke) {
                    return ke == null ? pe : (ke += "", function() {
                      var Ee = m(this).getComputedStyle(this, null).getPropertyValue(R), He;
                      return Ee !== ke && (He = Ds(Ee, ke), function(Ke) {
                        this.style.setProperty(R, He(Ke), J);
                      });
                    });
                  }
                  return Cl(this, "style." + R, B, ye);
                }, Yi.styleTween = function(R, B, J) {
                  arguments.length < 3 && (J = "");
                  function de(pe, ye) {
                    var ke = B.call(this, pe, ye, m(this).getComputedStyle(this, null).getPropertyValue(R));
                    return ke && function(Ee) {
                      this.style.setProperty(R, ke(Ee), J);
                    };
                  }
                  return this.tween("style." + R, de);
                }, Yi.text = function(R) {
                  return Cl(this, "text", R, yp);
                };
                function yp(R) {
                  return R == null && (R = ""), function() {
                    this.textContent = R;
                  };
                }
                Yi.remove = function() {
                  var R = this.namespace;
                  return this.each("end.transition", function() {
                    var B;
                    this[R].count < 2 && (B = this.parentNode) && B.removeChild(this);
                  });
                }, Yi.ease = function(R) {
                  var B = this.id, J = this.namespace;
                  return arguments.length < 1 ? this.node()[J][B].ease : (typeof R != "function" && (R = f.ease.apply(f, arguments)), Tt(this, function(de) {
                    de[J][B].ease = R;
                  }));
                }, Yi.delay = function(R) {
                  var B = this.id, J = this.namespace;
                  return arguments.length < 1 ? this.node()[J][B].delay : Tt(this, typeof R == "function" ? function(de, pe, ye) {
                    de[J][B].delay = +R.call(de, de.__data__, pe, ye);
                  } : (R = +R, function(de) {
                    de[J][B].delay = R;
                  }));
                }, Yi.duration = function(R) {
                  var B = this.id, J = this.namespace;
                  return arguments.length < 1 ? this.node()[J][B].duration : Tt(this, typeof R == "function" ? function(de, pe, ye) {
                    de[J][B].duration = Math.max(1, R.call(de, de.__data__, pe, ye));
                  } : (R = Math.max(1, R), function(de) {
                    de[J][B].duration = R;
                  }));
                }, Yi.each = function(R, B) {
                  var J = this.id, de = this.namespace;
                  if (arguments.length < 2) {
                    var pe = yl, ye = bo;
                    try {
                      bo = J, Tt(this, function(ke, Ee, He) {
                        yl = ke[de][J], R.call(ke, ke.__data__, Ee, He);
                      });
                    } finally {
                      yl = pe, bo = ye;
                    }
                  } else
                    Tt(this, function(ke) {
                      var Ee = ke[de][J];
                      (Ee.event || (Ee.event = f.dispatch("start", "end", "interrupt"))).on(R, B);
                    });
                  return this;
                }, Yi.transition = function() {
                  for (var R = this.id, B = ++Pu, J = this.namespace, de = [], pe, ye, ke, Ee, He = 0, Ke = this.length; He < Ke; He++) {
                    de.push(pe = []);
                    for (var ye = this[He], Qe = 0, yt = ye.length; Qe < yt; Qe++)
                      (ke = ye[Qe]) && (Ee = ke[J][R], Xi(ke, Qe, J, B, {
                        time: Ee.time,
                        ease: Ee.ease,
                        delay: Ee.delay + Ee.duration,
                        duration: Ee.duration
                      })), pe.push(ke);
                  }
                  return uo(de, J, B);
                };
                function Ac(R) {
                  return R == null ? "__transition__" : "__transition_" + R + "__";
                }
                function Xi(R, B, J, de, pe) {
                  var ye = R[J] || (R[J] = {
                    active: 0,
                    count: 0
                  }), ke = ye[de], Ee, He, Ke, Qe, yt;
                  function mt(qe) {
                    var Et = ke.delay;
                    if (He.t = Et + Ee, Et <= qe) return Bt(qe - Et);
                    He.c = Bt;
                  }
                  function Bt(qe) {
                    var Et = ye.active, Dt = ye[Et];
                    Dt && (Dt.timer.c = null, Dt.timer.t = NaN, --ye.count, delete ye[Et], Dt.event && Dt.event.interrupt.call(R, R.__data__, Dt.index));
                    for (var Xt in ye)
                      if (+Xt < de) {
                        var Kt = ye[Xt];
                        Kt.timer.c = null, Kt.timer.t = NaN, --ye.count, delete ye[Xt];
                      }
                    He.c = Zt, Dn(function() {
                      return He.c && Zt(qe || 1) && (He.c = null, He.t = NaN), 1;
                    }, 0, Ee), ye.active = de, ke.event && ke.event.start.call(R, R.__data__, B), yt = [], ke.tween.forEach(function(Vt, wr) {
                      (wr = wr.call(R, R.__data__, B)) && yt.push(wr);
                    }), Qe = ke.ease, Ke = ke.duration;
                  }
                  function Zt(qe) {
                    for (var Et = qe / Ke, Dt = Qe(Et), Xt = yt.length; Xt > 0; )
                      yt[--Xt].call(R, Dt);
                    if (Et >= 1)
                      return ke.event && ke.event.end.call(R, R.__data__, B), --ye.count ? delete ye[de] : delete R[J], 1;
                  }
                  ke || (Ee = pe.time, He = Dn(mt, 0, Ee), ke = ye[de] = {
                    tween: new Y(),
                    time: Ee,
                    timer: He,
                    delay: pe.delay,
                    duration: pe.duration,
                    ease: pe.ease,
                    index: B
                  }, pe = null, ++ye.count);
                }
                f.svg.axis = function() {
                  var R = f.scale.linear(), B = Iu, J = 6, de = 6, pe = 3, ye = [10], ke = null, Ee;
                  function He(Ke) {
                    Ke.each(function() {
                      var Qe = f.select(this), yt = this.__chart__ || R, mt = this.__chart__ = R.copy(), Bt = ke ?? (mt.ticks ? mt.ticks.apply(mt, ye) : mt.domain()), Zt = Ee ?? (mt.tickFormat ? mt.tickFormat.apply(mt, ye) : U), qe = Qe.selectAll(".tick").data(Bt, mt), Et = qe.enter().insert("g", ".domain").attr("class", "tick").style("opacity", Ye), Dt = f.transition(qe.exit()).style("opacity", Ye).remove(), Xt = f.transition(qe.order()).style("opacity", 1), Kt = Math.max(J, 0) + pe, Vt, wr = xa(mt), Wr = Qe.selectAll(".domain").data([0]), Xr = (Wr.enter().append("path").attr("class", "domain"), f.transition(Wr));
                      Et.append("line"), Et.append("text");
                      var _r = Et.select("line"), en = Xt.select("line"), Qr = qe.select("text").text(Zt), En = Et.select("text"), qr = Xt.select("text"), An = B === "top" || B === "left" ? -1 : 1, ti, $i, ui, Nr;
                      if (B === "bottom" || B === "top" ? (Vt = Hs, ti = "x", ui = "y", $i = "x2", Nr = "y2", Qr.attr("dy", An < 0 ? "0em" : ".71em").style("text-anchor", "middle"), Xr.attr("d", "M" + wr[0] + "," + An * de + "V0H" + wr[1] + "V" + An * de)) : (Vt = cs, ti = "y", ui = "x", $i = "y2", Nr = "x2", Qr.attr("dy", ".32em").style("text-anchor", An < 0 ? "end" : "start"), Xr.attr("d", "M" + An * de + "," + wr[0] + "H0V" + wr[1] + "H" + An * de)), _r.attr(Nr, An * J), En.attr(ui, An * Kt), en.attr($i, 0).attr(Nr, An * J), qr.attr(ti, 0).attr(ui, An * Kt), mt.rangeBand) {
                        var un = mt, Nn = un.rangeBand() / 2;
                        yt = mt = function(xn) {
                          return un(xn) + Nn;
                        };
                      } else yt.rangeBand ? yt = mt : Dt.call(Vt, mt, yt);
                      Et.call(Vt, yt, mt), Xt.call(Vt, mt, mt);
                    });
                  }
                  return He.scale = function(Ke) {
                    return arguments.length ? (R = Ke, He) : R;
                  }, He.orient = function(Ke) {
                    return arguments.length ? (B = Ke in us ? Ke + "" : Iu, He) : B;
                  }, He.ticks = function() {
                    return arguments.length ? (ye = g(arguments), He) : ye;
                  }, He.tickValues = function(Ke) {
                    return arguments.length ? (ke = Ke, He) : ke;
                  }, He.tickFormat = function(Ke) {
                    return arguments.length ? (Ee = Ke, He) : Ee;
                  }, He.tickSize = function(Ke) {
                    var Qe = arguments.length;
                    return Qe ? (J = +Ke, de = +arguments[Qe - 1], He) : J;
                  }, He.innerTickSize = function(Ke) {
                    return arguments.length ? (J = +Ke, He) : J;
                  }, He.outerTickSize = function(Ke) {
                    return arguments.length ? (de = +Ke, He) : de;
                  }, He.tickPadding = function(Ke) {
                    return arguments.length ? (pe = +Ke, He) : pe;
                  }, He.tickSubdivide = function() {
                    return arguments.length && He;
                  }, He;
                };
                var Iu = "bottom", us = {
                  top: 1,
                  right: 1,
                  bottom: 1,
                  left: 1
                };
                function Hs(R, B, J) {
                  R.attr("transform", function(de) {
                    var pe = B(de);
                    return "translate(" + (isFinite(pe) ? pe : J(de)) + ",0)";
                  });
                }
                function cs(R, B, J) {
                  R.attr("transform", function(de) {
                    var pe = B(de);
                    return "translate(0," + (isFinite(pe) ? pe : J(de)) + ")";
                  });
                }
                f.svg.brush = function() {
                  var R = we(Qe, "brushstart", "brush", "brushend"), B = null, J = null, de = [0, 0], pe = [0, 0], ye, ke, Ee = !0, He = !0, Ke = Ed[0];
                  function Qe(qe) {
                    qe.each(function() {
                      var Et = f.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", Zt).on("touchstart.brush", Zt), Dt = Et.selectAll(".background").data([0]);
                      Dt.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"), Et.selectAll(".extent").data([0]).enter().append("rect").attr("class", "extent").style("cursor", "move");
                      var Xt = Et.selectAll(".resize").data(Ke, U);
                      Xt.exit().remove(), Xt.enter().append("g").attr("class", function(Wr) {
                        return "resize " + Wr;
                      }).style("cursor", function(Wr) {
                        return Vf[Wr];
                      }).append("rect").attr("x", function(Wr) {
                        return /[ew]$/.test(Wr) ? -3 : null;
                      }).attr("y", function(Wr) {
                        return /^[ns]/.test(Wr) ? -3 : null;
                      }).attr("width", 6).attr("height", 6).style("visibility", "hidden"), Xt.style("display", Qe.empty() ? "none" : null);
                      var Kt = f.transition(Et), Vt = f.transition(Dt), wr;
                      B && (wr = xa(B), Vt.attr("x", wr[0]).attr("width", wr[1] - wr[0]), mt(Kt)), J && (wr = xa(J), Vt.attr("y", wr[0]).attr("height", wr[1] - wr[0]), Bt(Kt)), yt(Kt);
                    });
                  }
                  Qe.event = function(qe) {
                    qe.each(function() {
                      var Et = R.of(this, arguments), Dt = {
                        x: de,
                        y: pe,
                        i: ye,
                        j: ke
                      }, Xt = this.__chart__ || Dt;
                      this.__chart__ = Dt, bo ? f.select(this).transition().each("start.brush", function() {
                        ye = Xt.i, ke = Xt.j, de = Xt.x, pe = Xt.y, Et({
                          type: "brushstart"
                        });
                      }).tween("brush:brush", function() {
                        var Kt = hc(de, Dt.x), Vt = hc(pe, Dt.y);
                        return ye = ke = null, function(wr) {
                          de = Dt.x = Kt(wr), pe = Dt.y = Vt(wr), Et({
                            type: "brush",
                            mode: "resize"
                          });
                        };
                      }).each("end.brush", function() {
                        ye = Dt.i, ke = Dt.j, Et({
                          type: "brush",
                          mode: "resize"
                        }), Et({
                          type: "brushend"
                        });
                      }) : (Et({
                        type: "brushstart"
                      }), Et({
                        type: "brush",
                        mode: "resize"
                      }), Et({
                        type: "brushend"
                      }));
                    });
                  };
                  function yt(qe) {
                    qe.selectAll(".resize").attr("transform", function(Et) {
                      return "translate(" + de[+/e$/.test(Et)] + "," + pe[+/^s/.test(Et)] + ")";
                    });
                  }
                  function mt(qe) {
                    qe.select(".extent").attr("x", de[0]), qe.selectAll(".extent,.n>rect,.s>rect").attr("width", de[1] - de[0]);
                  }
                  function Bt(qe) {
                    qe.select(".extent").attr("y", pe[0]), qe.selectAll(".extent,.e>rect,.w>rect").attr("height", pe[1] - pe[0]);
                  }
                  function Zt() {
                    var qe = this, Et = f.select(f.event.target), Dt = R.of(qe, arguments), Xt = f.select(qe), Kt = Et.datum(), Vt = !/^(n|s)$/.test(Kt) && B, wr = !/^(e|w)$/.test(Kt) && J, Wr = Et.classed("extent"), Xr = Ut(qe), _r, en = f.mouse(qe), Qr, En = f.select(m(qe)).on("keydown.brush", ti).on("keyup.brush", $i);
                    if (f.event.changedTouches ? En.on("touchmove.brush", ui).on("touchend.brush", un) : En.on("mousemove.brush", ui).on("mouseup.brush", un), Xt.interrupt().selectAll("*").interrupt(), Wr)
                      en[0] = de[0] - en[0], en[1] = pe[0] - en[1];
                    else if (Kt) {
                      var qr = +/w$/.test(Kt), An = +/^n/.test(Kt);
                      Qr = [de[1 - qr] - en[0], pe[1 - An] - en[1]], en[0] = de[qr], en[1] = pe[An];
                    } else f.event.altKey && (_r = en.slice());
                    Xt.style("pointer-events", "none").selectAll(".resize").style("display", null), f.select("body").style("cursor", Et.style("cursor")), Dt({
                      type: "brushstart"
                    }), ui();
                    function ti() {
                      f.event.keyCode == 32 && (Wr || (_r = null, en[0] -= de[1], en[1] -= pe[1], Wr = 2), Me());
                    }
                    function $i() {
                      f.event.keyCode == 32 && Wr == 2 && (en[0] += de[1], en[1] += pe[1], Wr = 0, Me());
                    }
                    function ui() {
                      var Nn = f.mouse(qe), xn = !1;
                      Qr && (Nn[0] += Qr[0], Nn[1] += Qr[1]), Wr || (f.event.altKey ? (_r || (_r = [(de[0] + de[1]) / 2, (pe[0] + pe[1]) / 2]), en[0] = de[+(Nn[0] < _r[0])], en[1] = pe[+(Nn[1] < _r[1])]) : _r = null), Vt && Nr(Nn, B, 0) && (mt(Xt), xn = !0), wr && Nr(Nn, J, 1) && (Bt(Xt), xn = !0), xn && (yt(Xt), Dt({
                        type: "brush",
                        mode: Wr ? "move" : "resize"
                      }));
                    }
                    function Nr(Nn, xn, wi) {
                      var ea = xa(xn), ua = ea[0], ga = ea[1], ro = en[wi], ja = wi ? pe : de, co = ja[1] - ja[0], Ri, Li;
                      if (Wr && (ua -= ro, ga -= co + ro), Ri = (wi ? He : Ee) ? Math.max(ua, Math.min(ga, Nn[wi])) : Nn[wi], Wr ? Li = (Ri += ro) + co : (_r && (ro = Math.max(ua, Math.min(ga, 2 * _r[wi] - Ri))), ro < Ri ? (Li = Ri, Ri = ro) : Li = ro), ja[0] != Ri || ja[1] != Li)
                        return wi ? ke = null : ye = null, ja[0] = Ri, ja[1] = Li, !0;
                    }
                    function un() {
                      ui(), Xt.style("pointer-events", "all").selectAll(".resize").style("display", Qe.empty() ? "none" : null), f.select("body").style("cursor", null), En.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null), Xr(), Dt({
                        type: "brushend"
                      });
                    }
                  }
                  return Qe.x = function(qe) {
                    return arguments.length ? (B = qe, Ke = Ed[!B << 1 | !J], Qe) : B;
                  }, Qe.y = function(qe) {
                    return arguments.length ? (J = qe, Ke = Ed[!B << 1 | !J], Qe) : J;
                  }, Qe.clamp = function(qe) {
                    return arguments.length ? (B && J ? (Ee = !!qe[0], He = !!qe[1]) : B ? Ee = !!qe : J && (He = !!qe), Qe) : B && J ? [Ee, He] : B ? Ee : J ? He : null;
                  }, Qe.extent = function(qe) {
                    var Et, Dt, Xt, Kt, Vt;
                    return arguments.length ? (B && (Et = qe[0], Dt = qe[1], J && (Et = Et[0], Dt = Dt[0]), ye = [Et, Dt], B.invert && (Et = B(Et), Dt = B(Dt)), Dt < Et && (Vt = Et, Et = Dt, Dt = Vt), (Et != de[0] || Dt != de[1]) && (de = [Et, Dt])), J && (Xt = qe[0], Kt = qe[1], B && (Xt = Xt[1], Kt = Kt[1]), ke = [Xt, Kt], J.invert && (Xt = J(Xt), Kt = J(Kt)), Kt < Xt && (Vt = Xt, Xt = Kt, Kt = Vt), (Xt != pe[0] || Kt != pe[1]) && (pe = [Xt, Kt])), Qe) : (B && (ye ? (Et = ye[0], Dt = ye[1]) : (Et = de[0], Dt = de[1], B.invert && (Et = B.invert(Et), Dt = B.invert(Dt)), Dt < Et && (Vt = Et, Et = Dt, Dt = Vt))), J && (ke ? (Xt = ke[0], Kt = ke[1]) : (Xt = pe[0], Kt = pe[1], J.invert && (Xt = J.invert(Xt), Kt = J.invert(Kt)), Kt < Xt && (Vt = Xt, Xt = Kt, Kt = Vt))), B && J ? [[Et, Xt], [Dt, Kt]] : B ? [Et, Dt] : J && [Xt, Kt]);
                  }, Qe.clear = function() {
                    return Qe.empty() || (de = [0, 0], pe = [0, 0], ye = ke = null), Qe;
                  }, Qe.empty = function() {
                    return !!B && de[0] == de[1] || !!J && pe[0] == pe[1];
                  }, f.rebind(Qe, R, "on");
                };
                var Vf = {
                  n: "ns-resize",
                  e: "ew-resize",
                  s: "ns-resize",
                  w: "ew-resize",
                  nw: "nwse-resize",
                  ne: "nesw-resize",
                  se: "nwse-resize",
                  sw: "nesw-resize"
                }, Ed = [["n", "e", "s", "w", "nw", "ne", "se", "sw"], ["e", "w"], ["n", "s"], []];
                f.text = xr(function(R) {
                  return R.responseText;
                }), f.json = function(R, B) {
                  return Er(R, "application/json", bl, B);
                };
                function bl(R) {
                  return JSON.parse(R.responseText);
                }
                f.html = function(R, B) {
                  return Er(R, "text/html", Ec, B);
                };
                function Ec(R) {
                  var B = y.createRange();
                  return B.selectNode(y.body), B.createContextualFragment(R.responseText);
                }
                f.xml = xr(function(R) {
                  return R.responseXML;
                }), l = f, v = typeof l == "function" ? l.call(c, i, c, s) : l, v !== void 0 && (s.exports = v);
              }).apply(self);
            }
          ),
          /***/
          3160: (
            /***/
            function(s, c, i) {
              i.r(c), i.d(c, {
                /* harmony export */
                decode: function() {
                  return (
                    /* binding */
                    g
                  );
                },
                /* harmony export */
                encode: function() {
                  return (
                    /* binding */
                    p
                  );
                }
                /* harmony export */
              });
              for (var l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", v = typeof Uint8Array > "u" ? [] : new Uint8Array(256), f = 0; f < l.length; f++)
                v[l.charCodeAt(f)] = f;
              var p = function(y) {
                var C = new Uint8Array(y), m, h = C.length, w = "";
                for (m = 0; m < h; m += 3)
                  w += l[C[m] >> 2], w += l[(C[m] & 3) << 4 | C[m + 1] >> 4], w += l[(C[m + 1] & 15) << 2 | C[m + 2] >> 6], w += l[C[m + 2] & 63];
                return h % 3 === 2 ? w = w.substring(0, w.length - 1) + "=" : h % 3 === 1 && (w = w.substring(0, w.length - 2) + "=="), w;
              }, g = function(y) {
                var C = y.length * 0.75, m = y.length, h, w = 0, S, E, x, T;
                y[y.length - 1] === "=" && (C--, y[y.length - 2] === "=" && C--);
                var F = new ArrayBuffer(C), P = new Uint8Array(F);
                for (h = 0; h < m; h += 4)
                  S = v[y.charCodeAt(h)], E = v[y.charCodeAt(h + 1)], x = v[y.charCodeAt(h + 2)], T = v[y.charCodeAt(h + 3)], P[w++] = S << 2 | E >> 4, P[w++] = (E & 15) << 4 | x >> 2, P[w++] = (x & 3) << 6 | T & 63;
                return F;
              };
            }
          ),
          /***/
          7624: (
            /***/
            function(s, c, i) {
              i.d(c, {
                E9: function() {
                  return (
                    /* reexport */
                    L
                  );
                },
                SO: function() {
                  return (
                    /* reexport */
                    k
                  );
                }
              });
              function l(O) {
                return Math.abs(O = Math.round(O)) >= 1e21 ? O.toLocaleString("en").replace(/,/g, "") : O.toString(10);
              }
              function v(O, N) {
                if ((Y = (O = N ? O.toExponential(N - 1) : O.toExponential()).indexOf("e")) < 0) return null;
                var Y, j = O.slice(0, Y);
                return [
                  j.length > 1 ? j[0] + j.slice(2) : j,
                  +O.slice(Y + 1)
                ];
              }
              function f(O) {
                return O = v(Math.abs(O)), O ? O[1] : NaN;
              }
              function p(O, N) {
                return function(Y, j) {
                  for (var te = Y.length, re = [], z = 0, Z = O[0], W = 0; te > 0 && Z > 0 && (W + Z + 1 > j && (Z = Math.max(1, j - W)), re.push(Y.substring(te -= Z, te + Z)), !((W += Z + 1) > j)); )
                    Z = O[z = (z + 1) % O.length];
                  return re.reverse().join(N);
                };
              }
              function g(O) {
                return function(N) {
                  return N.replace(/[0-9]/g, function(Y) {
                    return O[+Y];
                  });
                };
              }
              var y = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
              function C(O) {
                if (!(N = y.exec(O))) throw new Error("invalid format: " + O);
                var N;
                return new m({
                  fill: N[1],
                  align: N[2],
                  sign: N[3],
                  symbol: N[4],
                  zero: N[5],
                  width: N[6],
                  comma: N[7],
                  precision: N[8] && N[8].slice(1),
                  trim: N[9],
                  type: N[10]
                });
              }
              C.prototype = m.prototype;
              function m(O) {
                this.fill = O.fill === void 0 ? " " : O.fill + "", this.align = O.align === void 0 ? ">" : O.align + "", this.sign = O.sign === void 0 ? "-" : O.sign + "", this.symbol = O.symbol === void 0 ? "" : O.symbol + "", this.zero = !!O.zero, this.width = O.width === void 0 ? void 0 : +O.width, this.comma = !!O.comma, this.precision = O.precision === void 0 ? void 0 : +O.precision, this.trim = !!O.trim, this.type = O.type === void 0 ? "" : O.type + "";
              }
              m.prototype.toString = function() {
                return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
              };
              function h(O) {
                e: for (var N = O.length, Y = 1, j = -1, te; Y < N; ++Y)
                  switch (O[Y]) {
                    case ".":
                      j = te = Y;
                      break;
                    case "0":
                      j === 0 && (j = Y), te = Y;
                      break;
                    default:
                      if (!+O[Y]) break e;
                      j > 0 && (j = 0);
                      break;
                  }
                return j > 0 ? O.slice(0, j) + O.slice(te + 1) : O;
              }
              var w;
              function S(O, N) {
                var Y = v(O, N);
                if (!Y) return O + "";
                var j = Y[0], te = Y[1], re = te - (w = Math.max(-8, Math.min(8, Math.floor(te / 3))) * 3) + 1, z = j.length;
                return re === z ? j : re > z ? j + new Array(re - z + 1).join("0") : re > 0 ? j.slice(0, re) + "." + j.slice(re) : "0." + new Array(1 - re).join("0") + v(O, Math.max(0, N + re - 1))[0];
              }
              function E(O, N) {
                var Y = v(O, N);
                if (!Y) return O + "";
                var j = Y[0], te = Y[1];
                return te < 0 ? "0." + new Array(-te).join("0") + j : j.length > te + 1 ? j.slice(0, te + 1) + "." + j.slice(te + 1) : j + new Array(te - j.length + 2).join("0");
              }
              var x = {
                "%": function(O, N) {
                  return (O * 100).toFixed(N);
                },
                b: function(O) {
                  return Math.round(O).toString(2);
                },
                c: function(O) {
                  return O + "";
                },
                d: l,
                e: function(O, N) {
                  return O.toExponential(N);
                },
                f: function(O, N) {
                  return O.toFixed(N);
                },
                g: function(O, N) {
                  return O.toPrecision(N);
                },
                o: function(O) {
                  return Math.round(O).toString(8);
                },
                p: function(O, N) {
                  return E(O * 100, N);
                },
                r: E,
                s: S,
                X: function(O) {
                  return Math.round(O).toString(16).toUpperCase();
                },
                x: function(O) {
                  return Math.round(O).toString(16);
                }
              };
              function T(O) {
                return O;
              }
              var F = Array.prototype.map, P = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
              function k(O) {
                var N = O.grouping === void 0 || O.thousands === void 0 ? T : p(F.call(O.grouping, Number), O.thousands + ""), Y = O.currency === void 0 ? "" : O.currency[0] + "", j = O.currency === void 0 ? "" : O.currency[1] + "", te = O.decimal === void 0 ? "." : O.decimal + "", re = O.numerals === void 0 ? T : g(F.call(O.numerals, String)), z = O.percent === void 0 ? "%" : O.percent + "", Z = O.minus === void 0 ? "-" : O.minus + "", W = O.nan === void 0 ? "NaN" : O.nan + "";
                function q(ce) {
                  ce = C(ce);
                  var X = ce.fill, U = ce.align, ne = ce.sign, se = ce.symbol, le = ce.zero, ue = ce.width, ve = ce.comma, be = ce.precision, Me = ce.trim, Ge = ce.type;
                  Ge === "n" ? (ve = !0, Ge = "g") : x[Ge] || (be === void 0 && (be = 12), Me = !0, Ge = "g"), (le || X === "0" && U === "=") && (le = !0, X = "0", U = "=");
                  var we = se === "$" ? Y : se === "#" && /[boxX]/.test(Ge) ? "0" + Ge.toLowerCase() : "", Re = se === "$" ? j : /[%p]/.test(Ge) ? z : "", Ae = x[Ge], K = /[defgprs%]/.test(Ge);
                  be = be === void 0 ? 6 : /[gprs]/.test(Ge) ? Math.max(1, Math.min(21, be)) : Math.max(0, Math.min(20, be));
                  function ee(oe) {
                    var _ = we, V = Re, fe, $, he;
                    if (Ge === "c")
                      V = Ae(oe) + V, oe = "";
                    else {
                      oe = +oe;
                      var me = oe < 0 || 1 / oe < 0;
                      if (oe = isNaN(oe) ? W : Ae(Math.abs(oe), be), Me && (oe = h(oe)), me && +oe == 0 && ne !== "+" && (me = !1), _ = (me ? ne === "(" ? ne : Z : ne === "-" || ne === "(" ? "" : ne) + _, V = (Ge === "s" ? P[8 + w / 3] : "") + V + (me && ne === "(" ? ")" : ""), K) {
                        for (fe = -1, $ = oe.length; ++fe < $; )
                          if (he = oe.charCodeAt(fe), 48 > he || he > 57) {
                            V = (he === 46 ? te + oe.slice(fe + 1) : oe.slice(fe)) + V, oe = oe.slice(0, fe);
                            break;
                          }
                      }
                    }
                    ve && !le && (oe = N(oe, 1 / 0));
                    var xe = _.length + oe.length + V.length, Fe = xe < ue ? new Array(ue - xe + 1).join(X) : "";
                    switch (ve && le && (oe = N(Fe + oe, Fe.length ? ue - V.length : 1 / 0), Fe = ""), U) {
                      case "<":
                        oe = _ + oe + V + Fe;
                        break;
                      case "=":
                        oe = _ + Fe + oe + V;
                        break;
                      case "^":
                        oe = Fe.slice(0, xe = Fe.length >> 1) + _ + oe + V + Fe.slice(xe);
                        break;
                      default:
                        oe = Fe + _ + oe + V;
                        break;
                    }
                    return re(oe);
                  }
                  return ee.toString = function() {
                    return ce + "";
                  }, ee;
                }
                function ie(ce, X) {
                  var U = q((ce = C(ce), ce.type = "f", ce)), ne = Math.max(-8, Math.min(8, Math.floor(f(X) / 3))) * 3, se = Math.pow(10, -ne), le = P[8 + ne / 3];
                  return function(ue) {
                    return U(se * ue) + le;
                  };
                }
                return {
                  format: q,
                  formatPrefix: ie
                };
              }
              var I, L;
              A({
                decimal: ".",
                thousands: ",",
                grouping: [3],
                currency: ["$", ""],
                minus: "-"
              });
              function A(O) {
                return I = k(O), L = I.format, I.formatPrefix, I;
              }
            }
          ),
          /***/
          4336: (
            /***/
            function(s, c, i) {
              i.d(c, {
                Yn: function() {
                  return (
                    /* reexport */
                    Yt
                  );
                },
                m_: function() {
                  return (
                    /* reexport */
                    w
                  );
                },
                E9: function() {
                  return (
                    /* reexport */
                    Ut
                  );
                }
              });
              var l = i(8208), v = i(8931), f = i(6192), p = i(8936), g = i(2171), y = i(3528);
              function C(ze) {
                if (0 <= ze.y && ze.y < 100) {
                  var _e = new Date(-1, ze.m, ze.d, ze.H, ze.M, ze.S, ze.L);
                  return _e.setFullYear(ze.y), _e;
                }
                return new Date(ze.y, ze.m, ze.d, ze.H, ze.M, ze.S, ze.L);
              }
              function m(ze) {
                if (0 <= ze.y && ze.y < 100) {
                  var _e = new Date(Date.UTC(-1, ze.m, ze.d, ze.H, ze.M, ze.S, ze.L));
                  return _e.setUTCFullYear(ze.y), _e;
                }
                return new Date(Date.UTC(ze.y, ze.m, ze.d, ze.H, ze.M, ze.S, ze.L));
              }
              function h(ze, _e, Ye) {
                return { y: ze, m: _e, d: Ye, H: 0, M: 0, S: 0, L: 0 };
              }
              function w(ze) {
                var _e = ze.dateTime, Ye = ze.date, lt = ze.time, Te = ze.periods, Oe = ze.days, je = ze.shortDays, Xe = ze.months, nt = ze.shortMonths, it = k(Te), Nt = I(Te), At = k(Oe), vt = I(Oe), ut = k(je), Pt = I(je), rr = k(Xe), lr = I(Xe), Mr = k(nt), Rr = I(nt), Pr = {
                  a: Se,
                  A: ae,
                  b: ft,
                  B: rt,
                  c: null,
                  d: ve,
                  e: ve,
                  f: Re,
                  H: be,
                  I: Me,
                  j: Ge,
                  L: we,
                  m: Ae,
                  M: K,
                  p: gt,
                  q: wt,
                  Q: bt,
                  s: jt,
                  S: ee,
                  u: oe,
                  U: _,
                  V,
                  w: fe,
                  W: $,
                  x: null,
                  X: null,
                  y: he,
                  Y: me,
                  Z: xe,
                  "%": Wt
                }, ir = {
                  a: Ct,
                  A: pt,
                  b: dt,
                  B: St,
                  c: null,
                  d: Fe,
                  e: Fe,
                  f: at,
                  H: Ve,
                  I: Be,
                  j: Je,
                  L: et,
                  m: De,
                  M: Ne,
                  p: Ft,
                  q: Gt,
                  Q: bt,
                  s: jt,
                  S: Ie,
                  u: Ue,
                  U: ot,
                  V: ct,
                  w: Tt,
                  W: kt,
                  x: null,
                  X: null,
                  y: Ot,
                  Y: Rt,
                  Z: xt,
                  "%": Wt
                }, Lr = {
                  a: pr,
                  A: kr,
                  b: br,
                  B: Gr,
                  c: rn,
                  d: W,
                  e: W,
                  f: ne,
                  H: ie,
                  I: ie,
                  j: q,
                  L: U,
                  m: Z,
                  M: ce,
                  p: Ar,
                  q: z,
                  Q: le,
                  s: ue,
                  S: X,
                  u: A,
                  U: O,
                  V: N,
                  w: L,
                  W: Y,
                  x: cn,
                  X: Dr,
                  y: te,
                  Y: j,
                  Z: re,
                  "%": se
                };
                Pr.x = yr(Ye, Pr), Pr.X = yr(lt, Pr), Pr.c = yr(_e, Pr), ir.x = yr(Ye, ir), ir.X = yr(lt, ir), ir.c = yr(_e, ir);
                function yr(Lt, $t) {
                  return function(_t) {
                    var zt = [], tr = -1, nr = 0, xr = Lt.length, Er, Jr, Ur;
                    for (_t instanceof Date || (_t = /* @__PURE__ */ new Date(+_t)); ++tr < xr; )
                      Lt.charCodeAt(tr) === 37 && (zt.push(Lt.slice(nr, tr)), (Jr = S[Er = Lt.charAt(++tr)]) != null ? Er = Lt.charAt(++tr) : Jr = Er === "e" ? " " : "0", (Ur = $t[Er]) && (Er = Ur(_t, Jr)), zt.push(Er), nr = tr + 1);
                    return zt.push(Lt.slice(nr, tr)), zt.join("");
                  };
                }
                function Sr(Lt, $t) {
                  return function(_t) {
                    var zt = h(1900, void 0, 1), tr = Yr(zt, Lt, _t += "", 0), nr, xr;
                    if (tr != _t.length) return null;
                    if ("Q" in zt) return new Date(zt.Q);
                    if ("s" in zt) return new Date(zt.s * 1e3 + ("L" in zt ? zt.L : 0));
                    if ($t && !("Z" in zt) && (zt.Z = 0), "p" in zt && (zt.H = zt.H % 12 + zt.p * 12), zt.m === void 0 && (zt.m = "q" in zt ? zt.q : 0), "V" in zt) {
                      if (zt.V < 1 || zt.V > 53) return null;
                      "w" in zt || (zt.w = 1), "Z" in zt ? (nr = m(h(zt.y, 0, 1)), xr = nr.getUTCDay(), nr = xr > 4 || xr === 0 ? l.ot.ceil(nr) : (0, l.ot)(nr), nr = v.c.offset(nr, (zt.V - 1) * 7), zt.y = nr.getUTCFullYear(), zt.m = nr.getUTCMonth(), zt.d = nr.getUTCDate() + (zt.w + 6) % 7) : (nr = C(h(zt.y, 0, 1)), xr = nr.getDay(), nr = xr > 4 || xr === 0 ? f.qT.ceil(nr) : (0, f.qT)(nr), nr = p.c.offset(nr, (zt.V - 1) * 7), zt.y = nr.getFullYear(), zt.m = nr.getMonth(), zt.d = nr.getDate() + (zt.w + 6) % 7);
                    } else ("W" in zt || "U" in zt) && ("w" in zt || (zt.w = "u" in zt ? zt.u % 7 : "W" in zt ? 1 : 0), xr = "Z" in zt ? m(h(zt.y, 0, 1)).getUTCDay() : C(h(zt.y, 0, 1)).getDay(), zt.m = 0, zt.d = "W" in zt ? (zt.w + 6) % 7 + zt.W * 7 - (xr + 5) % 7 : zt.w + zt.U * 7 - (xr + 6) % 7);
                    return "Z" in zt ? (zt.H += zt.Z / 100 | 0, zt.M += zt.Z % 100, m(zt)) : C(zt);
                  };
                }
                function Yr(Lt, $t, _t, zt) {
                  for (var tr = 0, nr = $t.length, xr = _t.length, Er, Jr; tr < nr; ) {
                    if (zt >= xr) return -1;
                    if (Er = $t.charCodeAt(tr++), Er === 37) {
                      if (Er = $t.charAt(tr++), Jr = Lr[Er in S ? $t.charAt(tr++) : Er], !Jr || (zt = Jr(Lt, _t, zt)) < 0) return -1;
                    } else if (Er != _t.charCodeAt(zt++))
                      return -1;
                  }
                  return zt;
                }
                function Ar(Lt, $t, _t) {
                  var zt = it.exec($t.slice(_t));
                  return zt ? (Lt.p = Nt[zt[0].toLowerCase()], _t + zt[0].length) : -1;
                }
                function pr(Lt, $t, _t) {
                  var zt = ut.exec($t.slice(_t));
                  return zt ? (Lt.w = Pt[zt[0].toLowerCase()], _t + zt[0].length) : -1;
                }
                function kr(Lt, $t, _t) {
                  var zt = At.exec($t.slice(_t));
                  return zt ? (Lt.w = vt[zt[0].toLowerCase()], _t + zt[0].length) : -1;
                }
                function br(Lt, $t, _t) {
                  var zt = Mr.exec($t.slice(_t));
                  return zt ? (Lt.m = Rr[zt[0].toLowerCase()], _t + zt[0].length) : -1;
                }
                function Gr(Lt, $t, _t) {
                  var zt = rr.exec($t.slice(_t));
                  return zt ? (Lt.m = lr[zt[0].toLowerCase()], _t + zt[0].length) : -1;
                }
                function rn(Lt, $t, _t) {
                  return Yr(Lt, _e, $t, _t);
                }
                function cn(Lt, $t, _t) {
                  return Yr(Lt, Ye, $t, _t);
                }
                function Dr(Lt, $t, _t) {
                  return Yr(Lt, lt, $t, _t);
                }
                function Se(Lt) {
                  return je[Lt.getDay()];
                }
                function ae(Lt) {
                  return Oe[Lt.getDay()];
                }
                function ft(Lt) {
                  return nt[Lt.getMonth()];
                }
                function rt(Lt) {
                  return Xe[Lt.getMonth()];
                }
                function gt(Lt) {
                  return Te[+(Lt.getHours() >= 12)];
                }
                function wt(Lt) {
                  return 1 + ~~(Lt.getMonth() / 3);
                }
                function Ct(Lt) {
                  return je[Lt.getUTCDay()];
                }
                function pt(Lt) {
                  return Oe[Lt.getUTCDay()];
                }
                function dt(Lt) {
                  return nt[Lt.getUTCMonth()];
                }
                function St(Lt) {
                  return Xe[Lt.getUTCMonth()];
                }
                function Ft(Lt) {
                  return Te[+(Lt.getUTCHours() >= 12)];
                }
                function Gt(Lt) {
                  return 1 + ~~(Lt.getUTCMonth() / 3);
                }
                return {
                  format: function(Lt) {
                    var $t = yr(Lt += "", Pr);
                    return $t.toString = function() {
                      return Lt;
                    }, $t;
                  },
                  parse: function(Lt) {
                    var $t = Sr(Lt += "", !1);
                    return $t.toString = function() {
                      return Lt;
                    }, $t;
                  },
                  utcFormat: function(Lt) {
                    var $t = yr(Lt += "", ir);
                    return $t.toString = function() {
                      return Lt;
                    }, $t;
                  },
                  utcParse: function(Lt) {
                    var $t = Sr(Lt += "", !0);
                    return $t.toString = function() {
                      return Lt;
                    }, $t;
                  }
                };
              }
              var S = { "-": "", _: " ", 0: "0" }, E = /^\s*\d+/, x = /^%/, T = /[\\^$*+?|[\]().{}]/g;
              function F(ze, _e, Ye) {
                var lt = ze < 0 ? "-" : "", Te = (lt ? -ze : ze) + "", Oe = Te.length;
                return lt + (Oe < Ye ? new Array(Ye - Oe + 1).join(_e) + Te : Te);
              }
              function P(ze) {
                return ze.replace(T, "\\$&");
              }
              function k(ze) {
                return new RegExp("^(?:" + ze.map(P).join("|") + ")", "i");
              }
              function I(ze) {
                for (var _e = {}, Ye = -1, lt = ze.length; ++Ye < lt; ) _e[ze[Ye].toLowerCase()] = Ye;
                return _e;
              }
              function L(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 1));
                return lt ? (ze.w = +lt[0], Ye + lt[0].length) : -1;
              }
              function A(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 1));
                return lt ? (ze.u = +lt[0], Ye + lt[0].length) : -1;
              }
              function O(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.U = +lt[0], Ye + lt[0].length) : -1;
              }
              function N(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.V = +lt[0], Ye + lt[0].length) : -1;
              }
              function Y(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.W = +lt[0], Ye + lt[0].length) : -1;
              }
              function j(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 4));
                return lt ? (ze.y = +lt[0], Ye + lt[0].length) : -1;
              }
              function te(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.y = +lt[0] + (+lt[0] > 68 ? 1900 : 2e3), Ye + lt[0].length) : -1;
              }
              function re(ze, _e, Ye) {
                var lt = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(_e.slice(Ye, Ye + 6));
                return lt ? (ze.Z = lt[1] ? 0 : -(lt[2] + (lt[3] || "00")), Ye + lt[0].length) : -1;
              }
              function z(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 1));
                return lt ? (ze.q = lt[0] * 3 - 3, Ye + lt[0].length) : -1;
              }
              function Z(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.m = lt[0] - 1, Ye + lt[0].length) : -1;
              }
              function W(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.d = +lt[0], Ye + lt[0].length) : -1;
              }
              function q(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 3));
                return lt ? (ze.m = 0, ze.d = +lt[0], Ye + lt[0].length) : -1;
              }
              function ie(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.H = +lt[0], Ye + lt[0].length) : -1;
              }
              function ce(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.M = +lt[0], Ye + lt[0].length) : -1;
              }
              function X(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 2));
                return lt ? (ze.S = +lt[0], Ye + lt[0].length) : -1;
              }
              function U(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 3));
                return lt ? (ze.L = +lt[0], Ye + lt[0].length) : -1;
              }
              function ne(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye, Ye + 6));
                return lt ? (ze.L = Math.floor(lt[0] / 1e3), Ye + lt[0].length) : -1;
              }
              function se(ze, _e, Ye) {
                var lt = x.exec(_e.slice(Ye, Ye + 1));
                return lt ? Ye + lt[0].length : -1;
              }
              function le(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye));
                return lt ? (ze.Q = +lt[0], Ye + lt[0].length) : -1;
              }
              function ue(ze, _e, Ye) {
                var lt = E.exec(_e.slice(Ye));
                return lt ? (ze.s = +lt[0], Ye + lt[0].length) : -1;
              }
              function ve(ze, _e) {
                return F(ze.getDate(), _e, 2);
              }
              function be(ze, _e) {
                return F(ze.getHours(), _e, 2);
              }
              function Me(ze, _e) {
                return F(ze.getHours() % 12 || 12, _e, 2);
              }
              function Ge(ze, _e) {
                return F(1 + p.c.count((0, g.c)(ze), ze), _e, 3);
              }
              function we(ze, _e) {
                return F(ze.getMilliseconds(), _e, 3);
              }
              function Re(ze, _e) {
                return we(ze, _e) + "000";
              }
              function Ae(ze, _e) {
                return F(ze.getMonth() + 1, _e, 2);
              }
              function K(ze, _e) {
                return F(ze.getMinutes(), _e, 2);
              }
              function ee(ze, _e) {
                return F(ze.getSeconds(), _e, 2);
              }
              function oe(ze) {
                var _e = ze.getDay();
                return _e === 0 ? 7 : _e;
              }
              function _(ze, _e) {
                return F(f.uU.count((0, g.c)(ze) - 1, ze), _e, 2);
              }
              function V(ze, _e) {
                var Ye = ze.getDay();
                return ze = Ye >= 4 || Ye === 0 ? (0, f.kD)(ze) : f.kD.ceil(ze), F(f.kD.count((0, g.c)(ze), ze) + ((0, g.c)(ze).getDay() === 4), _e, 2);
              }
              function fe(ze) {
                return ze.getDay();
              }
              function $(ze, _e) {
                return F(f.qT.count((0, g.c)(ze) - 1, ze), _e, 2);
              }
              function he(ze, _e) {
                return F(ze.getFullYear() % 100, _e, 2);
              }
              function me(ze, _e) {
                return F(ze.getFullYear() % 1e4, _e, 4);
              }
              function xe(ze) {
                var _e = ze.getTimezoneOffset();
                return (_e > 0 ? "-" : (_e *= -1, "+")) + F(_e / 60 | 0, "0", 2) + F(_e % 60, "0", 2);
              }
              function Fe(ze, _e) {
                return F(ze.getUTCDate(), _e, 2);
              }
              function Ve(ze, _e) {
                return F(ze.getUTCHours(), _e, 2);
              }
              function Be(ze, _e) {
                return F(ze.getUTCHours() % 12 || 12, _e, 2);
              }
              function Je(ze, _e) {
                return F(1 + v.c.count((0, y.c)(ze), ze), _e, 3);
              }
              function et(ze, _e) {
                return F(ze.getUTCMilliseconds(), _e, 3);
              }
              function at(ze, _e) {
                return et(ze, _e) + "000";
              }
              function De(ze, _e) {
                return F(ze.getUTCMonth() + 1, _e, 2);
              }
              function Ne(ze, _e) {
                return F(ze.getUTCMinutes(), _e, 2);
              }
              function Ie(ze, _e) {
                return F(ze.getUTCSeconds(), _e, 2);
              }
              function Ue(ze) {
                var _e = ze.getUTCDay();
                return _e === 0 ? 7 : _e;
              }
              function ot(ze, _e) {
                return F(l.EV.count((0, y.c)(ze) - 1, ze), _e, 2);
              }
              function ct(ze, _e) {
                var Ye = ze.getUTCDay();
                return ze = Ye >= 4 || Ye === 0 ? (0, l.yA)(ze) : l.yA.ceil(ze), F(l.yA.count((0, y.c)(ze), ze) + ((0, y.c)(ze).getUTCDay() === 4), _e, 2);
              }
              function Tt(ze) {
                return ze.getUTCDay();
              }
              function kt(ze, _e) {
                return F(l.ot.count((0, y.c)(ze) - 1, ze), _e, 2);
              }
              function Ot(ze, _e) {
                return F(ze.getUTCFullYear() % 100, _e, 2);
              }
              function Rt(ze, _e) {
                return F(ze.getUTCFullYear() % 1e4, _e, 4);
              }
              function xt() {
                return "+0000";
              }
              function Wt() {
                return "%";
              }
              function bt(ze) {
                return +ze;
              }
              function jt(ze) {
                return Math.floor(+ze / 1e3);
              }
              var qt, Yt, Ut;
              tt({
                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 tt(ze) {
                return qt = w(ze), Yt = qt.format, qt.parse, Ut = qt.utcFormat, qt.utcParse, qt;
              }
            }
          ),
          /***/
          8936: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                m: function() {
                  return (
                    /* binding */
                    p
                  );
                }
                /* harmony export */
              });
              var l = i(1628), v = i(9792), f = (0, l.c)(function(g) {
                g.setHours(0, 0, 0, 0);
              }, function(g, y) {
                g.setDate(g.getDate() + y);
              }, function(g, y) {
                return (y - g - (y.getTimezoneOffset() - g.getTimezoneOffset()) * v.iy) / v.SK;
              }, function(g) {
                return g.getDate() - 1;
              });
              c.c = f;
              var p = f.range;
            }
          ),
          /***/
          9792: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                KK: function() {
                  return (
                    /* binding */
                    g
                  );
                },
                /* harmony export */
                SK: function() {
                  return (
                    /* binding */
                    p
                  );
                },
                /* harmony export */
                cg: function() {
                  return (
                    /* binding */
                    f
                  );
                },
                /* harmony export */
                iy: function() {
                  return (
                    /* binding */
                    v
                  );
                },
                /* harmony export */
                yc: function() {
                  return (
                    /* binding */
                    l
                  );
                }
                /* harmony export */
              });
              var l = 1e3, v = 6e4, f = 36e5, p = 864e5, g = 6048e5;
            }
          ),
          /***/
          3220: (
            /***/
            function(s, c, i) {
              i.r(c), i.d(c, {
                timeDay: function() {
                  return (
                    /* reexport */
                    F.c
                  );
                },
                timeDays: function() {
                  return (
                    /* reexport */
                    F.m
                  );
                },
                timeFriday: function() {
                  return (
                    /* reexport */
                    P.iB
                  );
                },
                timeFridays: function() {
                  return (
                    /* reexport */
                    P.sJ
                  );
                },
                timeHour: function() {
                  return (
                    /* reexport */
                    x
                  );
                },
                timeHours: function() {
                  return (
                    /* reexport */
                    T
                  );
                },
                timeInterval: function() {
                  return (
                    /* reexport */
                    l.c
                  );
                },
                timeMillisecond: function() {
                  return (
                    /* reexport */
                    f
                  );
                },
                timeMilliseconds: function() {
                  return (
                    /* reexport */
                    p
                  );
                },
                timeMinute: function() {
                  return (
                    /* reexport */
                    w
                  );
                },
                timeMinutes: function() {
                  return (
                    /* reexport */
                    S
                  );
                },
                timeMonday: function() {
                  return (
                    /* reexport */
                    P.qT
                  );
                },
                timeMondays: function() {
                  return (
                    /* reexport */
                    P.QP
                  );
                },
                timeMonth: function() {
                  return (
                    /* reexport */
                    I
                  );
                },
                timeMonths: function() {
                  return (
                    /* reexport */
                    L
                  );
                },
                timeSaturday: function() {
                  return (
                    /* reexport */
                    P.Wc
                  );
                },
                timeSaturdays: function() {
                  return (
                    /* reexport */
                    P.aI
                  );
                },
                timeSecond: function() {
                  return (
                    /* reexport */
                    C
                  );
                },
                timeSeconds: function() {
                  return (
                    /* reexport */
                    m
                  );
                },
                timeSunday: function() {
                  return (
                    /* reexport */
                    P.uU
                  );
                },
                timeSundays: function() {
                  return (
                    /* reexport */
                    P.Ab
                  );
                },
                timeThursday: function() {
                  return (
                    /* reexport */
                    P.kD
                  );
                },
                timeThursdays: function() {
                  return (
                    /* reexport */
                    P.eC
                  );
                },
                timeTuesday: function() {
                  return (
                    /* reexport */
                    P.Mf
                  );
                },
                timeTuesdays: function() {
                  return (
                    /* reexport */
                    P.Oc
                  );
                },
                timeWednesday: function() {
                  return (
                    /* reexport */
                    P.eg
                  );
                },
                timeWednesdays: function() {
                  return (
                    /* reexport */
                    P.sn
                  );
                },
                timeWeek: function() {
                  return (
                    /* reexport */
                    P.uU
                  );
                },
                timeWeeks: function() {
                  return (
                    /* reexport */
                    P.Ab
                  );
                },
                timeYear: function() {
                  return (
                    /* reexport */
                    A.c
                  );
                },
                timeYears: function() {
                  return (
                    /* reexport */
                    A.Q
                  );
                },
                utcDay: function() {
                  return (
                    /* reexport */
                    z.c
                  );
                },
                utcDays: function() {
                  return (
                    /* reexport */
                    z.o
                  );
                },
                utcFriday: function() {
                  return (
                    /* reexport */
                    Z.od
                  );
                },
                utcFridays: function() {
                  return (
                    /* reexport */
                    Z.iG
                  );
                },
                utcHour: function() {
                  return (
                    /* reexport */
                    te
                  );
                },
                utcHours: function() {
                  return (
                    /* reexport */
                    re
                  );
                },
                utcMillisecond: function() {
                  return (
                    /* reexport */
                    f
                  );
                },
                utcMilliseconds: function() {
                  return (
                    /* reexport */
                    p
                  );
                },
                utcMinute: function() {
                  return (
                    /* reexport */
                    N
                  );
                },
                utcMinutes: function() {
                  return (
                    /* reexport */
                    Y
                  );
                },
                utcMonday: function() {
                  return (
                    /* reexport */
                    Z.ot
                  );
                },
                utcMondays: function() {
                  return (
                    /* reexport */
                    Z.iO
                  );
                },
                utcMonth: function() {
                  return (
                    /* reexport */
                    q
                  );
                },
                utcMonths: function() {
                  return (
                    /* reexport */
                    ie
                  );
                },
                utcSaturday: function() {
                  return (
                    /* reexport */
                    Z.Ad
                  );
                },
                utcSaturdays: function() {
                  return (
                    /* reexport */
                    Z.K8
                  );
                },
                utcSecond: function() {
                  return (
                    /* reexport */
                    C
                  );
                },
                utcSeconds: function() {
                  return (
                    /* reexport */
                    m
                  );
                },
                utcSunday: function() {
                  return (
                    /* reexport */
                    Z.EV
                  );
                },
                utcSundays: function() {
                  return (
                    /* reexport */
                    Z.Wq
                  );
                },
                utcThursday: function() {
                  return (
                    /* reexport */
                    Z.yA
                  );
                },
                utcThursdays: function() {
                  return (
                    /* reexport */
                    Z.ob
                  );
                },
                utcTuesday: function() {
                  return (
                    /* reexport */
                    Z.sG
                  );
                },
                utcTuesdays: function() {
                  return (
                    /* reexport */
                    Z.kl
                  );
                },
                utcWednesday: function() {
                  return (
                    /* reexport */
                    Z._6
                  );
                },
                utcWednesdays: function() {
                  return (
                    /* reexport */
                    Z.W_
                  );
                },
                utcWeek: function() {
                  return (
                    /* reexport */
                    Z.EV
                  );
                },
                utcWeeks: function() {
                  return (
                    /* reexport */
                    Z.Wq
                  );
                },
                utcYear: function() {
                  return (
                    /* reexport */
                    ce.c
                  );
                },
                utcYears: function() {
                  return (
                    /* reexport */
                    ce.i
                  );
                }
              });
              var l = i(1628), v = (0, l.c)(function() {
              }, function(X, U) {
                X.setTime(+X + U);
              }, function(X, U) {
                return U - X;
              });
              v.every = function(X) {
                return X = Math.floor(X), !isFinite(X) || !(X > 0) ? null : X > 1 ? (0, l.c)(function(U) {
                  U.setTime(Math.floor(U / X) * X);
                }, function(U, ne) {
                  U.setTime(+U + ne * X);
                }, function(U, ne) {
                  return (ne - U) / X;
                }) : v;
              };
              var f = v, p = v.range, g = i(9792), y = (0, l.c)(function(X) {
                X.setTime(X - X.getMilliseconds());
              }, function(X, U) {
                X.setTime(+X + U * g.yc);
              }, function(X, U) {
                return (U - X) / g.yc;
              }, function(X) {
                return X.getUTCSeconds();
              }), C = y, m = y.range, h = (0, l.c)(function(X) {
                X.setTime(X - X.getMilliseconds() - X.getSeconds() * g.yc);
              }, function(X, U) {
                X.setTime(+X + U * g.iy);
              }, function(X, U) {
                return (U - X) / g.iy;
              }, function(X) {
                return X.getMinutes();
              }), w = h, S = h.range, E = (0, l.c)(function(X) {
                X.setTime(X - X.getMilliseconds() - X.getSeconds() * g.yc - X.getMinutes() * g.iy);
              }, function(X, U) {
                X.setTime(+X + U * g.cg);
              }, function(X, U) {
                return (U - X) / g.cg;
              }, function(X) {
                return X.getHours();
              }), x = E, T = E.range, F = i(8936), P = i(6192), k = (0, l.c)(function(X) {
                X.setDate(1), X.setHours(0, 0, 0, 0);
              }, function(X, U) {
                X.setMonth(X.getMonth() + U);
              }, function(X, U) {
                return U.getMonth() - X.getMonth() + (U.getFullYear() - X.getFullYear()) * 12;
              }, function(X) {
                return X.getMonth();
              }), I = k, L = k.range, A = i(2171), O = (0, l.c)(function(X) {
                X.setUTCSeconds(0, 0);
              }, function(X, U) {
                X.setTime(+X + U * g.iy);
              }, function(X, U) {
                return (U - X) / g.iy;
              }, function(X) {
                return X.getUTCMinutes();
              }), N = O, Y = O.range, j = (0, l.c)(function(X) {
                X.setUTCMinutes(0, 0, 0);
              }, function(X, U) {
                X.setTime(+X + U * g.cg);
              }, function(X, U) {
                return (U - X) / g.cg;
              }, function(X) {
                return X.getUTCHours();
              }), te = j, re = j.range, z = i(8931), Z = i(8208), W = (0, l.c)(function(X) {
                X.setUTCDate(1), X.setUTCHours(0, 0, 0, 0);
              }, function(X, U) {
                X.setUTCMonth(X.getUTCMonth() + U);
              }, function(X, U) {
                return U.getUTCMonth() - X.getUTCMonth() + (U.getUTCFullYear() - X.getUTCFullYear()) * 12;
              }, function(X) {
                return X.getUTCMonth();
              }), q = W, ie = W.range, ce = i(3528);
            }
          ),
          /***/
          1628: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                c: function() {
                  return (
                    /* binding */
                    f
                  );
                }
                /* harmony export */
              });
              var l = /* @__PURE__ */ new Date(), v = /* @__PURE__ */ new Date();
              function f(p, g, y, C) {
                function m(h) {
                  return p(h = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+h)), h;
                }
                return m.floor = function(h) {
                  return p(h = /* @__PURE__ */ new Date(+h)), h;
                }, m.ceil = function(h) {
                  return p(h = new Date(h - 1)), g(h, 1), p(h), h;
                }, m.round = function(h) {
                  var w = m(h), S = m.ceil(h);
                  return h - w < S - h ? w : S;
                }, m.offset = function(h, w) {
                  return g(h = /* @__PURE__ */ new Date(+h), w == null ? 1 : Math.floor(w)), h;
                }, m.range = function(h, w, S) {
                  var E = [], x;
                  if (h = m.ceil(h), S = S == null ? 1 : Math.floor(S), !(h < w) || !(S > 0)) return E;
                  do
                    E.push(x = /* @__PURE__ */ new Date(+h)), g(h, S), p(h);
                  while (x < h && h < w);
                  return E;
                }, m.filter = function(h) {
                  return f(function(w) {
                    if (w >= w) for (; p(w), !h(w); ) w.setTime(w - 1);
                  }, function(w, S) {
                    if (w >= w)
                      if (S < 0) for (; ++S <= 0; )
                        for (; g(w, -1), !h(w); )
                          ;
                      else for (; --S >= 0; )
                        for (; g(w, 1), !h(w); )
                          ;
                  });
                }, y && (m.count = function(h, w) {
                  return l.setTime(+h), v.setTime(+w), p(l), p(v), Math.floor(y(l, v));
                }, m.every = function(h) {
                  return h = Math.floor(h), !isFinite(h) || !(h > 0) ? null : h > 1 ? m.filter(C ? function(w) {
                    return C(w) % h === 0;
                  } : function(w) {
                    return m.count(0, w) % h === 0;
                  }) : m;
                }), m;
              }
            }
          ),
          /***/
          8931: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                o: function() {
                  return (
                    /* binding */
                    p
                  );
                }
                /* harmony export */
              });
              var l = i(1628), v = i(9792), f = (0, l.c)(function(g) {
                g.setUTCHours(0, 0, 0, 0);
              }, function(g, y) {
                g.setUTCDate(g.getUTCDate() + y);
              }, function(g, y) {
                return (y - g) / v.SK;
              }, function(g) {
                return g.getUTCDate() - 1;
              });
              c.c = f;
              var p = f.range;
            }
          ),
          /***/
          8208: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                Ad: function() {
                  return (
                    /* binding */
                    w
                  );
                },
                /* harmony export */
                EV: function() {
                  return (
                    /* binding */
                    p
                  );
                },
                /* harmony export */
                K8: function() {
                  return (
                    /* binding */
                    k
                  );
                },
                /* harmony export */
                W_: function() {
                  return (
                    /* binding */
                    T
                  );
                },
                /* harmony export */
                Wq: function() {
                  return (
                    /* binding */
                    S
                  );
                },
                /* harmony export */
                _6: function() {
                  return (
                    /* binding */
                    C
                  );
                },
                /* harmony export */
                iG: function() {
                  return (
                    /* binding */
                    P
                  );
                },
                /* harmony export */
                iO: function() {
                  return (
                    /* binding */
                    E
                  );
                },
                /* harmony export */
                kl: function() {
                  return (
                    /* binding */
                    x
                  );
                },
                /* harmony export */
                ob: function() {
                  return (
                    /* binding */
                    F
                  );
                },
                /* harmony export */
                od: function() {
                  return (
                    /* binding */
                    h
                  );
                },
                /* harmony export */
                ot: function() {
                  return (
                    /* binding */
                    g
                  );
                },
                /* harmony export */
                sG: function() {
                  return (
                    /* binding */
                    y
                  );
                },
                /* harmony export */
                yA: function() {
                  return (
                    /* binding */
                    m
                  );
                }
                /* harmony export */
              });
              var l = i(1628), v = i(9792);
              function f(I) {
                return (0, l.c)(function(L) {
                  L.setUTCDate(L.getUTCDate() - (L.getUTCDay() + 7 - I) % 7), L.setUTCHours(0, 0, 0, 0);
                }, function(L, A) {
                  L.setUTCDate(L.getUTCDate() + A * 7);
                }, function(L, A) {
                  return (A - L) / v.KK;
                });
              }
              var p = f(0), g = f(1), y = f(2), C = f(3), m = f(4), h = f(5), w = f(6), S = p.range, E = g.range, x = y.range, T = C.range, F = m.range, P = h.range, k = w.range;
            }
          ),
          /***/
          3528: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                i: function() {
                  return (
                    /* binding */
                    f
                  );
                }
                /* harmony export */
              });
              var l = i(1628), v = (0, l.c)(function(p) {
                p.setUTCMonth(0, 1), p.setUTCHours(0, 0, 0, 0);
              }, function(p, g) {
                p.setUTCFullYear(p.getUTCFullYear() + g);
              }, function(p, g) {
                return g.getUTCFullYear() - p.getUTCFullYear();
              }, function(p) {
                return p.getUTCFullYear();
              });
              v.every = function(p) {
                return !isFinite(p = Math.floor(p)) || !(p > 0) ? null : (0, l.c)(function(g) {
                  g.setUTCFullYear(Math.floor(g.getUTCFullYear() / p) * p), g.setUTCMonth(0, 1), g.setUTCHours(0, 0, 0, 0);
                }, function(g, y) {
                  g.setUTCFullYear(g.getUTCFullYear() + y * p);
                });
              }, c.c = v;
              var f = v.range;
            }
          ),
          /***/
          6192: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                Ab: function() {
                  return (
                    /* binding */
                    S
                  );
                },
                /* harmony export */
                Mf: function() {
                  return (
                    /* binding */
                    y
                  );
                },
                /* harmony export */
                Oc: function() {
                  return (
                    /* binding */
                    x
                  );
                },
                /* harmony export */
                QP: function() {
                  return (
                    /* binding */
                    E
                  );
                },
                /* harmony export */
                Wc: function() {
                  return (
                    /* binding */
                    w
                  );
                },
                /* harmony export */
                aI: function() {
                  return (
                    /* binding */
                    k
                  );
                },
                /* harmony export */
                eC: function() {
                  return (
                    /* binding */
                    F
                  );
                },
                /* harmony export */
                eg: function() {
                  return (
                    /* binding */
                    C
                  );
                },
                /* harmony export */
                iB: function() {
                  return (
                    /* binding */
                    h
                  );
                },
                /* harmony export */
                kD: function() {
                  return (
                    /* binding */
                    m
                  );
                },
                /* harmony export */
                qT: function() {
                  return (
                    /* binding */
                    g
                  );
                },
                /* harmony export */
                sJ: function() {
                  return (
                    /* binding */
                    P
                  );
                },
                /* harmony export */
                sn: function() {
                  return (
                    /* binding */
                    T
                  );
                },
                /* harmony export */
                uU: function() {
                  return (
                    /* binding */
                    p
                  );
                }
                /* harmony export */
              });
              var l = i(1628), v = i(9792);
              function f(I) {
                return (0, l.c)(function(L) {
                  L.setDate(L.getDate() - (L.getDay() + 7 - I) % 7), L.setHours(0, 0, 0, 0);
                }, function(L, A) {
                  L.setDate(L.getDate() + A * 7);
                }, function(L, A) {
                  return (A - L - (A.getTimezoneOffset() - L.getTimezoneOffset()) * v.iy) / v.KK;
                });
              }
              var p = f(0), g = f(1), y = f(2), C = f(3), m = f(4), h = f(5), w = f(6), S = p.range, E = g.range, x = y.range, T = C.range, F = m.range, P = h.range, k = w.range;
            }
          ),
          /***/
          2171: (
            /***/
            function(s, c, i) {
              i.d(c, {
                /* harmony export */
                Q: function() {
                  return (
                    /* binding */
                    f
                  );
                }
                /* harmony export */
              });
              var l = i(1628), v = (0, l.c)(function(p) {
                p.setMonth(0, 1), p.setHours(0, 0, 0, 0);
              }, function(p, g) {
                p.setFullYear(p.getFullYear() + g);
              }, function(p, g) {
                return g.getFullYear() - p.getFullYear();
              }, function(p) {
                return p.getFullYear();
              });
              v.every = function(p) {
                return !isFinite(p = Math.floor(p)) || !(p > 0) ? null : (0, l.c)(function(g) {
                  g.setFullYear(Math.floor(g.getFullYear() / p) * p), g.setMonth(0, 1), g.setHours(0, 0, 0, 0);
                }, function(g, y) {
                  g.setFullYear(g.getFullYear() + y * p);
                });
              }, c.c = v;
              var f = v.range;
            }
          ),
          /***/
          1252: (
            /***/
            function(s) {
              var c = typeof Reflect == "object" ? Reflect : null, i = c && typeof c.apply == "function" ? c.apply : function(A, O, N) {
                return Function.prototype.apply.call(A, O, N);
              }, l;
              c && typeof c.ownKeys == "function" ? l = c.ownKeys : Object.getOwnPropertySymbols ? l = function(A) {
                return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A));
              } : l = function(A) {
                return Object.getOwnPropertyNames(A);
              };
              function v(L) {
                console && console.warn && console.warn(L);
              }
              var f = Number.isNaN || function(A) {
                return A !== A;
              };
              function p() {
                p.init.call(this);
              }
              s.exports = p, s.exports.once = P, p.EventEmitter = p, p.prototype._events = void 0, p.prototype._eventsCount = 0, p.prototype._maxListeners = void 0;
              var g = 10;
              function y(L) {
                if (typeof L != "function")
                  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof L);
              }
              Object.defineProperty(p, "defaultMaxListeners", {
                enumerable: !0,
                get: function() {
                  return g;
                },
                set: function(L) {
                  if (typeof L != "number" || L < 0 || f(L))
                    throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + L + ".");
                  g = L;
                }
              }), p.init = function() {
                (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
              }, p.prototype.setMaxListeners = function(A) {
                if (typeof A != "number" || A < 0 || f(A))
                  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + A + ".");
                return this._maxListeners = A, this;
              };
              function C(L) {
                return L._maxListeners === void 0 ? p.defaultMaxListeners : L._maxListeners;
              }
              p.prototype.getMaxListeners = function() {
                return C(this);
              }, p.prototype.emit = function(A) {
                for (var O = [], N = 1; N < arguments.length; N++) O.push(arguments[N]);
                var Y = A === "error", j = this._events;
                if (j !== void 0)
                  Y = Y && j.error === void 0;
                else if (!Y)
                  return !1;
                if (Y) {
                  var te;
                  if (O.length > 0 && (te = O[0]), te instanceof Error)
                    throw te;
                  var re = new Error("Unhandled error." + (te ? " (" + te.message + ")" : ""));
                  throw re.context = te, re;
                }
                var z = j[A];
                if (z === void 0)
                  return !1;
                if (typeof z == "function")
                  i(z, this, O);
                else
                  for (var Z = z.length, W = x(z, Z), N = 0; N < Z; ++N)
                    i(W[N], this, O);
                return !0;
              };
              function m(L, A, O, N) {
                var Y, j, te;
                if (y(O), j = L._events, j === void 0 ? (j = L._events = /* @__PURE__ */ Object.create(null), L._eventsCount = 0) : (j.newListener !== void 0 && (L.emit(
                  "newListener",
                  A,
                  O.listener ? O.listener : O
                ), j = L._events), te = j[A]), te === void 0)
                  te = j[A] = O, ++L._eventsCount;
                else if (typeof te == "function" ? te = j[A] = N ? [O, te] : [te, O] : N ? te.unshift(O) : te.push(O), Y = C(L), Y > 0 && te.length > Y && !te.warned) {
                  te.warned = !0;
                  var re = new Error("Possible EventEmitter memory leak detected. " + te.length + " " + String(A) + " listeners added. Use emitter.setMaxListeners() to increase limit");
                  re.name = "MaxListenersExceededWarning", re.emitter = L, re.type = A, re.count = te.length, v(re);
                }
                return L;
              }
              p.prototype.addListener = function(A, O) {
                return m(this, A, O, !1);
              }, p.prototype.on = p.prototype.addListener, p.prototype.prependListener = function(A, O) {
                return m(this, A, O, !0);
              };
              function h() {
                if (!this.fired)
                  return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
              }
              function w(L, A, O) {
                var N = { fired: !1, wrapFn: void 0, target: L, type: A, listener: O }, Y = h.bind(N);
                return Y.listener = O, N.wrapFn = Y, Y;
              }
              p.prototype.once = function(A, O) {
                return y(O), this.on(A, w(this, A, O)), this;
              }, p.prototype.prependOnceListener = function(A, O) {
                return y(O), this.prependListener(A, w(this, A, O)), this;
              }, p.prototype.removeListener = function(A, O) {
                var N, Y, j, te, re;
                if (y(O), Y = this._events, Y === void 0)
                  return this;
                if (N = Y[A], N === void 0)
                  return this;
                if (N === O || N.listener === O)
                  --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete Y[A], Y.removeListener && this.emit("removeListener", A, N.listener || O));
                else if (typeof N != "function") {
                  for (j = -1, te = N.length - 1; te >= 0; te--)
                    if (N[te] === O || N[te].listener === O) {
                      re = N[te].listener, j = te;
                      break;
                    }
                  if (j < 0)
                    return this;
                  j === 0 ? N.shift() : T(N, j), N.length === 1 && (Y[A] = N[0]), Y.removeListener !== void 0 && this.emit("removeListener", A, re || O);
                }
                return this;
              }, p.prototype.off = p.prototype.removeListener, p.prototype.removeAllListeners = function(A) {
                var O, N, Y;
                if (N = this._events, N === void 0)
                  return this;
                if (N.removeListener === void 0)
                  return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : N[A] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete N[A]), this;
                if (arguments.length === 0) {
                  var j = Object.keys(N), te;
                  for (Y = 0; Y < j.length; ++Y)
                    te = j[Y], te !== "removeListener" && this.removeAllListeners(te);
                  return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
                }
                if (O = N[A], typeof O == "function")
                  this.removeListener(A, O);
                else if (O !== void 0)
                  for (Y = O.length - 1; Y >= 0; Y--)
                    this.removeListener(A, O[Y]);
                return this;
              };
              function S(L, A, O) {
                var N = L._events;
                if (N === void 0)
                  return [];
                var Y = N[A];
                return Y === void 0 ? [] : typeof Y == "function" ? O ? [Y.listener || Y] : [Y] : O ? F(Y) : x(Y, Y.length);
              }
              p.prototype.listeners = function(A) {
                return S(this, A, !0);
              }, p.prototype.rawListeners = function(A) {
                return S(this, A, !1);
              }, p.listenerCount = function(L, A) {
                return typeof L.listenerCount == "function" ? L.listenerCount(A) : E.call(L, A);
              }, p.prototype.listenerCount = E;
              function E(L) {
                var A = this._events;
                if (A !== void 0) {
                  var O = A[L];
                  if (typeof O == "function")
                    return 1;
                  if (O !== void 0)
                    return O.length;
                }
                return 0;
              }
              p.prototype.eventNames = function() {
                return this._eventsCount > 0 ? l(this._events) : [];
              };
              function x(L, A) {
                for (var O = new Array(A), N = 0; N < A; ++N)
                  O[N] = L[N];
                return O;
              }
              function T(L, A) {
                for (; A + 1 < L.length; A++)
                  L[A] = L[A + 1];
                L.pop();
              }
              function F(L) {
                for (var A = new Array(L.length), O = 0; O < A.length; ++O)
                  A[O] = L[O].listener || L[O];
                return A;
              }
              function P(L, A) {
                return new Promise(function(O, N) {
                  function Y(te) {
                    L.removeListener(A, j), N(te);
                  }
                  function j() {
                    typeof L.removeListener == "function" && L.removeListener("error", Y), O([].slice.call(arguments));
                  }
                  I(L, A, j, { once: !0 }), A !== "error" && k(L, Y, { once: !0 });
                });
              }
              function k(L, A, O) {
                typeof L.on == "function" && I(L, "error", A, O);
              }
              function I(L, A, O, N) {
                if (typeof L.on == "function")
                  N.once ? L.once(A, O) : L.on(A, O);
                else if (typeof L.addEventListener == "function")
                  L.addEventListener(A, function Y(j) {
                    N.once && L.removeEventListener(A, Y), O(j);
                  });
                else
                  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof L);
              }
            }
          ),
          /***/
          8248: (
            /***/
            function(s, c, i) {
              var l = i(4576);
              s.exports = function(v) {
                var f = typeof v;
                if (f === "string") {
                  var p = v;
                  if (v = +v, v === 0 && l(p)) return !1;
                } else if (f !== "number") return !1;
                return v - v < 1;
              };
            }
          ),
          /***/
          2408: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                var v = l[0], f = l[1], p = l[2], g = l[3], y = l[4], C = l[5], m = l[6], h = l[7], w = l[8], S = l[9], E = l[10], x = l[11], T = l[12], F = l[13], P = l[14], k = l[15];
                return i[0] = C * (E * k - x * P) - S * (m * k - h * P) + F * (m * x - h * E), i[1] = -(f * (E * k - x * P) - S * (p * k - g * P) + F * (p * x - g * E)), i[2] = f * (m * k - h * P) - C * (p * k - g * P) + F * (p * h - g * m), i[3] = -(f * (m * x - h * E) - C * (p * x - g * E) + S * (p * h - g * m)), i[4] = -(y * (E * k - x * P) - w * (m * k - h * P) + T * (m * x - h * E)), i[5] = v * (E * k - x * P) - w * (p * k - g * P) + T * (p * x - g * E), i[6] = -(v * (m * k - h * P) - y * (p * k - g * P) + T * (p * h - g * m)), i[7] = v * (m * x - h * E) - y * (p * x - g * E) + w * (p * h - g * m), i[8] = y * (S * k - x * F) - w * (C * k - h * F) + T * (C * x - h * S), i[9] = -(v * (S * k - x * F) - w * (f * k - g * F) + T * (f * x - g * S)), i[10] = v * (C * k - h * F) - y * (f * k - g * F) + T * (f * h - g * C), i[11] = -(v * (C * x - h * S) - y * (f * x - g * S) + w * (f * h - g * C)), i[12] = -(y * (S * P - E * F) - w * (C * P - m * F) + T * (C * E - m * S)), i[13] = v * (S * P - E * F) - w * (f * P - p * F) + T * (f * E - p * S), i[14] = -(v * (C * P - m * F) - y * (f * P - p * F) + T * (f * m - p * C)), i[15] = v * (C * E - m * S) - y * (f * E - p * S) + w * (f * m - p * C), i;
              }
            }
          ),
          /***/
          6860: (
            /***/
            function(s) {
              s.exports = c;
              function c(i) {
                var l = new Float32Array(16);
                return l[0] = i[0], l[1] = i[1], l[2] = i[2], l[3] = i[3], l[4] = i[4], l[5] = i[5], l[6] = i[6], l[7] = i[7], l[8] = i[8], l[9] = i[9], l[10] = i[10], l[11] = i[11], l[12] = i[12], l[13] = i[13], l[14] = i[14], l[15] = i[15], l;
              }
            }
          ),
          /***/
          4492: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                return i[0] = l[0], i[1] = l[1], i[2] = l[2], i[3] = l[3], i[4] = l[4], i[5] = l[5], i[6] = l[6], i[7] = l[7], i[8] = l[8], i[9] = l[9], i[10] = l[10], i[11] = l[11], i[12] = l[12], i[13] = l[13], i[14] = l[14], i[15] = l[15], i;
              }
            }
          ),
          /***/
          4212: (
            /***/
            function(s) {
              s.exports = c;
              function c() {
                var i = new Float32Array(16);
                return i[0] = 1, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = 1, i[6] = 0, i[7] = 0, i[8] = 0, i[9] = 0, i[10] = 1, i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i;
              }
            }
          ),
          /***/
          800: (
            /***/
            function(s) {
              s.exports = c;
              function c(i) {
                var l = i[0], v = i[1], f = i[2], p = i[3], g = i[4], y = i[5], C = i[6], m = i[7], h = i[8], w = i[9], S = i[10], E = i[11], x = i[12], T = i[13], F = i[14], P = i[15], k = l * y - v * g, I = l * C - f * g, L = l * m - p * g, A = v * C - f * y, O = v * m - p * y, N = f * m - p * C, Y = h * T - w * x, j = h * F - S * x, te = h * P - E * x, re = w * F - S * T, z = w * P - E * T, Z = S * P - E * F;
                return k * Z - I * z + L * re + A * te - O * j + N * Y;
              }
            }
          ),
          /***/
          1784: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                var v = l[0], f = l[1], p = l[2], g = l[3], y = v + v, C = f + f, m = p + p, h = v * y, w = f * y, S = f * C, E = p * y, x = p * C, T = p * m, F = g * y, P = g * C, k = g * m;
                return i[0] = 1 - S - T, i[1] = w + k, i[2] = E - P, i[3] = 0, i[4] = w - k, i[5] = 1 - h - T, i[6] = x + F, i[7] = 0, i[8] = E + P, i[9] = x - F, i[10] = 1 - h - S, i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i;
              }
            }
          ),
          /***/
          1616: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f, p, g, y = v[0], C = v[1], m = v[2], h = Math.sqrt(y * y + C * C + m * m);
                return Math.abs(h) < 1e-6 ? null : (h = 1 / h, y *= h, C *= h, m *= h, f = Math.sin(l), p = Math.cos(l), g = 1 - p, i[0] = y * y * g + p, i[1] = C * y * g + m * f, i[2] = m * y * g - C * f, i[3] = 0, i[4] = y * C * g - m * f, i[5] = C * C * g + p, i[6] = m * C * g + y * f, i[7] = 0, i[8] = y * m * g + C * f, i[9] = C * m * g - y * f, i[10] = m * m * g + p, i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i);
              }
            }
          ),
          /***/
          1944: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f = l[0], p = l[1], g = l[2], y = l[3], C = f + f, m = p + p, h = g + g, w = f * C, S = f * m, E = f * h, x = p * m, T = p * h, F = g * h, P = y * C, k = y * m, I = y * h;
                return i[0] = 1 - (x + F), i[1] = S + I, i[2] = E - k, i[3] = 0, i[4] = S - I, i[5] = 1 - (w + F), i[6] = T + P, i[7] = 0, i[8] = E + k, i[9] = T - P, i[10] = 1 - (w + x), i[11] = 0, i[12] = v[0], i[13] = v[1], i[14] = v[2], i[15] = 1, i;
              }
            }
          ),
          /***/
          9444: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                return i[0] = l[0], i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = l[1], i[6] = 0, i[7] = 0, i[8] = 0, i[9] = 0, i[10] = l[2], i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i;
              }
            }
          ),
          /***/
          8268: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                return i[0] = 1, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = 1, i[6] = 0, i[7] = 0, i[8] = 0, i[9] = 0, i[10] = 1, i[11] = 0, i[12] = l[0], i[13] = l[1], i[14] = l[2], i[15] = 1, i;
              }
            }
          ),
          /***/
          1856: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                var v = Math.sin(l), f = Math.cos(l);
                return i[0] = 1, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = f, i[6] = v, i[7] = 0, i[8] = 0, i[9] = -v, i[10] = f, i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i;
              }
            }
          ),
          /***/
          9216: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                var v = Math.sin(l), f = Math.cos(l);
                return i[0] = f, i[1] = 0, i[2] = -v, i[3] = 0, i[4] = 0, i[5] = 1, i[6] = 0, i[7] = 0, i[8] = v, i[9] = 0, i[10] = f, i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i;
              }
            }
          ),
          /***/
          7736: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                var v = Math.sin(l), f = Math.cos(l);
                return i[0] = f, i[1] = v, i[2] = 0, i[3] = 0, i[4] = -v, i[5] = f, i[6] = 0, i[7] = 0, i[8] = 0, i[9] = 0, i[10] = 1, i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i;
              }
            }
          ),
          /***/
          8848: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v, f, p, g, y) {
                var C = 1 / (v - l), m = 1 / (p - f), h = 1 / (g - y);
                return i[0] = g * 2 * C, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = g * 2 * m, i[6] = 0, i[7] = 0, i[8] = (v + l) * C, i[9] = (p + f) * m, i[10] = (y + g) * h, i[11] = -1, i[12] = 0, i[13] = 0, i[14] = y * g * 2 * h, i[15] = 0, i;
              }
            }
          ),
          /***/
          6635: (
            /***/
            function(s) {
              s.exports = c;
              function c(i) {
                return i[0] = 1, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = 1, i[6] = 0, i[7] = 0, i[8] = 0, i[9] = 0, i[10] = 1, i[11] = 0, i[12] = 0, i[13] = 0, i[14] = 0, i[15] = 1, i;
              }
            }
          ),
          /***/
          6524: (
            /***/
            function(s, c, i) {
              s.exports = {
                create: i(4212),
                clone: i(6860),
                copy: i(4492),
                identity: i(6635),
                transpose: i(6520),
                invert: i(4308),
                adjoint: i(2408),
                determinant: i(800),
                multiply: i(944),
                translate: i(5176),
                scale: i(8152),
                rotate: i(16),
                rotateX: i(5456),
                rotateY: i(4840),
                rotateZ: i(4192),
                fromRotation: i(1616),
                fromRotationTranslation: i(1944),
                fromScaling: i(9444),
                fromTranslation: i(8268),
                fromXRotation: i(1856),
                fromYRotation: i(9216),
                fromZRotation: i(7736),
                fromQuat: i(1784),
                frustum: i(8848),
                perspective: i(1296),
                perspectiveFromFieldOfView: i(3688),
                ortho: i(7688),
                lookAt: i(6508),
                str: i(9412)
              };
            }
          ),
          /***/
          4308: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                var v = l[0], f = l[1], p = l[2], g = l[3], y = l[4], C = l[5], m = l[6], h = l[7], w = l[8], S = l[9], E = l[10], x = l[11], T = l[12], F = l[13], P = l[14], k = l[15], I = v * C - f * y, L = v * m - p * y, A = v * h - g * y, O = f * m - p * C, N = f * h - g * C, Y = p * h - g * m, j = w * F - S * T, te = w * P - E * T, re = w * k - x * T, z = S * P - E * F, Z = S * k - x * F, W = E * k - x * P, q = I * W - L * Z + A * z + O * re - N * te + Y * j;
                return q ? (q = 1 / q, i[0] = (C * W - m * Z + h * z) * q, i[1] = (p * Z - f * W - g * z) * q, i[2] = (F * Y - P * N + k * O) * q, i[3] = (E * N - S * Y - x * O) * q, i[4] = (m * re - y * W - h * te) * q, i[5] = (v * W - p * re + g * te) * q, i[6] = (P * A - T * Y - k * L) * q, i[7] = (w * Y - E * A + x * L) * q, i[8] = (y * Z - C * re + h * j) * q, i[9] = (f * re - v * Z - g * j) * q, i[10] = (T * N - F * A + k * I) * q, i[11] = (S * A - w * N - x * I) * q, i[12] = (C * te - y * z - m * j) * q, i[13] = (v * z - f * te + p * j) * q, i[14] = (F * L - T * O - P * I) * q, i[15] = (w * O - S * L + E * I) * q, i) : null;
              }
            }
          ),
          /***/
          6508: (
            /***/
            function(s, c, i) {
              var l = i(6635);
              s.exports = v;
              function v(f, p, g, y) {
                var C, m, h, w, S, E, x, T, F, P, k = p[0], I = p[1], L = p[2], A = y[0], O = y[1], N = y[2], Y = g[0], j = g[1], te = g[2];
                return Math.abs(k - Y) < 1e-6 && Math.abs(I - j) < 1e-6 && Math.abs(L - te) < 1e-6 ? l(f) : (x = k - Y, T = I - j, F = L - te, P = 1 / Math.sqrt(x * x + T * T + F * F), x *= P, T *= P, F *= P, C = O * F - N * T, m = N * x - A * F, h = A * T - O * x, P = Math.sqrt(C * C + m * m + h * h), P ? (P = 1 / P, C *= P, m *= P, h *= P) : (C = 0, m = 0, h = 0), w = T * h - F * m, S = F * C - x * h, E = x * m - T * C, P = Math.sqrt(w * w + S * S + E * E), P ? (P = 1 / P, w *= P, S *= P, E *= P) : (w = 0, S = 0, E = 0), f[0] = C, f[1] = w, f[2] = x, f[3] = 0, f[4] = m, f[5] = S, f[6] = T, f[7] = 0, f[8] = h, f[9] = E, f[10] = F, f[11] = 0, f[12] = -(C * k + m * I + h * L), f[13] = -(w * k + S * I + E * L), f[14] = -(x * k + T * I + F * L), f[15] = 1, f);
              }
            }
          ),
          /***/
          944: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f = l[0], p = l[1], g = l[2], y = l[3], C = l[4], m = l[5], h = l[6], w = l[7], S = l[8], E = l[9], x = l[10], T = l[11], F = l[12], P = l[13], k = l[14], I = l[15], L = v[0], A = v[1], O = v[2], N = v[3];
                return i[0] = L * f + A * C + O * S + N * F, i[1] = L * p + A * m + O * E + N * P, i[2] = L * g + A * h + O * x + N * k, i[3] = L * y + A * w + O * T + N * I, L = v[4], A = v[5], O = v[6], N = v[7], i[4] = L * f + A * C + O * S + N * F, i[5] = L * p + A * m + O * E + N * P, i[6] = L * g + A * h + O * x + N * k, i[7] = L * y + A * w + O * T + N * I, L = v[8], A = v[9], O = v[10], N = v[11], i[8] = L * f + A * C + O * S + N * F, i[9] = L * p + A * m + O * E + N * P, i[10] = L * g + A * h + O * x + N * k, i[11] = L * y + A * w + O * T + N * I, L = v[12], A = v[13], O = v[14], N = v[15], i[12] = L * f + A * C + O * S + N * F, i[13] = L * p + A * m + O * E + N * P, i[14] = L * g + A * h + O * x + N * k, i[15] = L * y + A * w + O * T + N * I, i;
              }
            }
          ),
          /***/
          7688: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v, f, p, g, y) {
                var C = 1 / (l - v), m = 1 / (f - p), h = 1 / (g - y);
                return i[0] = -2 * C, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = -2 * m, i[6] = 0, i[7] = 0, i[8] = 0, i[9] = 0, i[10] = 2 * h, i[11] = 0, i[12] = (l + v) * C, i[13] = (p + f) * m, i[14] = (y + g) * h, i[15] = 1, i;
              }
            }
          ),
          /***/
          1296: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v, f, p) {
                var g = 1 / Math.tan(l / 2), y = 1 / (f - p);
                return i[0] = g / v, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = g, i[6] = 0, i[7] = 0, i[8] = 0, i[9] = 0, i[10] = (p + f) * y, i[11] = -1, i[12] = 0, i[13] = 0, i[14] = 2 * p * f * y, i[15] = 0, i;
              }
            }
          ),
          /***/
          3688: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v, f) {
                var p = Math.tan(l.upDegrees * Math.PI / 180), g = Math.tan(l.downDegrees * Math.PI / 180), y = Math.tan(l.leftDegrees * Math.PI / 180), C = Math.tan(l.rightDegrees * Math.PI / 180), m = 2 / (y + C), h = 2 / (p + g);
                return i[0] = m, i[1] = 0, i[2] = 0, i[3] = 0, i[4] = 0, i[5] = h, i[6] = 0, i[7] = 0, i[8] = -((y - C) * m * 0.5), i[9] = (p - g) * h * 0.5, i[10] = f / (v - f), i[11] = -1, i[12] = 0, i[13] = 0, i[14] = f * v / (v - f), i[15] = 0, i;
              }
            }
          ),
          /***/
          16: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v, f) {
                var p = f[0], g = f[1], y = f[2], C = Math.sqrt(p * p + g * g + y * y), m, h, w, S, E, x, T, F, P, k, I, L, A, O, N, Y, j, te, re, z, Z, W, q, ie;
                return Math.abs(C) < 1e-6 ? null : (C = 1 / C, p *= C, g *= C, y *= C, m = Math.sin(v), h = Math.cos(v), w = 1 - h, S = l[0], E = l[1], x = l[2], T = l[3], F = l[4], P = l[5], k = l[6], I = l[7], L = l[8], A = l[9], O = l[10], N = l[11], Y = p * p * w + h, j = g * p * w + y * m, te = y * p * w - g * m, re = p * g * w - y * m, z = g * g * w + h, Z = y * g * w + p * m, W = p * y * w + g * m, q = g * y * w - p * m, ie = y * y * w + h, i[0] = S * Y + F * j + L * te, i[1] = E * Y + P * j + A * te, i[2] = x * Y + k * j + O * te, i[3] = T * Y + I * j + N * te, i[4] = S * re + F * z + L * Z, i[5] = E * re + P * z + A * Z, i[6] = x * re + k * z + O * Z, i[7] = T * re + I * z + N * Z, i[8] = S * W + F * q + L * ie, i[9] = E * W + P * q + A * ie, i[10] = x * W + k * q + O * ie, i[11] = T * W + I * q + N * ie, l !== i && (i[12] = l[12], i[13] = l[13], i[14] = l[14], i[15] = l[15]), i);
              }
            }
          ),
          /***/
          5456: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f = Math.sin(v), p = Math.cos(v), g = l[4], y = l[5], C = l[6], m = l[7], h = l[8], w = l[9], S = l[10], E = l[11];
                return l !== i && (i[0] = l[0], i[1] = l[1], i[2] = l[2], i[3] = l[3], i[12] = l[12], i[13] = l[13], i[14] = l[14], i[15] = l[15]), i[4] = g * p + h * f, i[5] = y * p + w * f, i[6] = C * p + S * f, i[7] = m * p + E * f, i[8] = h * p - g * f, i[9] = w * p - y * f, i[10] = S * p - C * f, i[11] = E * p - m * f, i;
              }
            }
          ),
          /***/
          4840: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f = Math.sin(v), p = Math.cos(v), g = l[0], y = l[1], C = l[2], m = l[3], h = l[8], w = l[9], S = l[10], E = l[11];
                return l !== i && (i[4] = l[4], i[5] = l[5], i[6] = l[6], i[7] = l[7], i[12] = l[12], i[13] = l[13], i[14] = l[14], i[15] = l[15]), i[0] = g * p - h * f, i[1] = y * p - w * f, i[2] = C * p - S * f, i[3] = m * p - E * f, i[8] = g * f + h * p, i[9] = y * f + w * p, i[10] = C * f + S * p, i[11] = m * f + E * p, i;
              }
            }
          ),
          /***/
          4192: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f = Math.sin(v), p = Math.cos(v), g = l[0], y = l[1], C = l[2], m = l[3], h = l[4], w = l[5], S = l[6], E = l[7];
                return l !== i && (i[8] = l[8], i[9] = l[9], i[10] = l[10], i[11] = l[11], i[12] = l[12], i[13] = l[13], i[14] = l[14], i[15] = l[15]), i[0] = g * p + h * f, i[1] = y * p + w * f, i[2] = C * p + S * f, i[3] = m * p + E * f, i[4] = h * p - g * f, i[5] = w * p - y * f, i[6] = S * p - C * f, i[7] = E * p - m * f, i;
              }
            }
          ),
          /***/
          8152: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f = v[0], p = v[1], g = v[2];
                return i[0] = l[0] * f, i[1] = l[1] * f, i[2] = l[2] * f, i[3] = l[3] * f, i[4] = l[4] * p, i[5] = l[5] * p, i[6] = l[6] * p, i[7] = l[7] * p, i[8] = l[8] * g, i[9] = l[9] * g, i[10] = l[10] * g, i[11] = l[11] * g, i[12] = l[12], i[13] = l[13], i[14] = l[14], i[15] = l[15], i;
              }
            }
          ),
          /***/
          9412: (
            /***/
            function(s) {
              s.exports = c;
              function c(i) {
                return "mat4(" + i[0] + ", " + i[1] + ", " + i[2] + ", " + i[3] + ", " + i[4] + ", " + i[5] + ", " + i[6] + ", " + i[7] + ", " + i[8] + ", " + i[9] + ", " + i[10] + ", " + i[11] + ", " + i[12] + ", " + i[13] + ", " + i[14] + ", " + i[15] + ")";
              }
            }
          ),
          /***/
          5176: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l, v) {
                var f = v[0], p = v[1], g = v[2], y, C, m, h, w, S, E, x, T, F, P, k;
                return l === i ? (i[12] = l[0] * f + l[4] * p + l[8] * g + l[12], i[13] = l[1] * f + l[5] * p + l[9] * g + l[13], i[14] = l[2] * f + l[6] * p + l[10] * g + l[14], i[15] = l[3] * f + l[7] * p + l[11] * g + l[15]) : (y = l[0], C = l[1], m = l[2], h = l[3], w = l[4], S = l[5], E = l[6], x = l[7], T = l[8], F = l[9], P = l[10], k = l[11], i[0] = y, i[1] = C, i[2] = m, i[3] = h, i[4] = w, i[5] = S, i[6] = E, i[7] = x, i[8] = T, i[9] = F, i[10] = P, i[11] = k, i[12] = y * f + w * p + T * g + l[12], i[13] = C * f + S * p + F * g + l[13], i[14] = m * f + E * p + P * g + l[14], i[15] = h * f + x * p + k * g + l[15]), i;
              }
            }
          ),
          /***/
          6520: (
            /***/
            function(s) {
              s.exports = c;
              function c(i, l) {
                if (i === l) {
                  var v = l[1], f = l[2], p = l[3], g = l[6], y = l[7], C = l[11];
                  i[1] = l[4], i[2] = l[8], i[3] = l[12], i[4] = v, i[6] = l[9], i[7] = l[13], i[8] = f, i[9] = g, i[11] = l[14], i[12] = p, i[13] = y, i[14] = C;
                } else
                  i[0] = l[0], i[1] = l[4], i[2] = l[8], i[3] = l[12], i[4] = l[1], i[5] = l[5], i[6] = l[9], i[7] = l[13], i[8] = l[2], i[9] = l[6], i[10] = l[10], i[11] = l[14], i[12] = l[3], i[13] = l[7], i[14] = l[11], i[15] = l[15];
                return i;
              }
            }
          ),
          /***/
          2264: (
            /***/
            function(s, c, i) {
              var l = i(1820), v;
              typeof i.g.matchMedia == "function" ? v = !i.g.matchMedia("(hover: none)").matches : v = l, s.exports = v;
            }
          ),
          /***/
          9184: (
            /***/
            function(s, c, i) {
              var l = i(1820);
              function v() {
                var f = !1;
                try {
                  var p = Object.defineProperty({}, "passive", {
                    get: function() {
                      f = !0;
                    }
                  });
                  window.addEventListener("test", null, p), window.removeEventListener("test", null, p);
                } catch {
                  f = !1;
                }
                return f;
              }
              s.exports = l && v();
            }
          ),
          /***/
          1820: (
            /***/
            function(s) {
              s.exports = !0;
            }
          ),
          /***/
          4576: (
            /***/
            function(s) {
              s.exports = function(c) {
                for (var i = c.length, l, v = 0; v < i; v++)
                  if (l = c.charCodeAt(v), (l < 9 || l > 13) && l !== 32 && l !== 133 && l !== 160 && l !== 5760 && l !== 6158 && (l < 8192 || l > 8205) && l !== 8232 && l !== 8233 && l !== 8239 && l !== 8287 && l !== 8288 && l !== 12288 && l !== 65279)
                    return !1;
                return !0;
              };
            }
          ),
          /***/
          9128: (
            /***/
            function(s) {
              var c = { left: 0, top: 0 };
              s.exports = i;
              function i(v, f, p) {
                f = f || v.currentTarget || v.srcElement, Array.isArray(p) || (p = [0, 0]);
                var g = v.clientX || 0, y = v.clientY || 0, C = l(f);
                return p[0] = g - C.left, p[1] = y - C.top, p;
              }
              function l(v) {
                return v === window || v === document || v === document.body ? c : v.getBoundingClientRect();
              }
            }
          ),
          /***/
          8324: (
            /***/
            function(s, c, i) {
              var l;
              /*! Native Promise Only
                  v0.8.1 (c) Kyle Simpson
                  MIT License: http://getify.mit-license.org
              */
              (function(f, p, g) {
                p[f] = p[f] || g(), s.exports ? s.exports = p[f] : (l = (function() {
                  return p[f];
                }).call(c, i, c, s), l !== void 0 && (s.exports = l));
              })("Promise", typeof i.g < "u" ? i.g : this, function() {
                var f, p, g, y = Object.prototype.toString, C = typeof setImmediate < "u" ? function(A) {
                  return setImmediate(A);
                } : setTimeout;
                try {
                  Object.defineProperty({}, "x", {}), f = function(A, O, N, Y) {
                    return Object.defineProperty(A, O, {
                      value: N,
                      writable: !0,
                      configurable: Y !== !1
                    });
                  };
                } catch {
                  f = function(O, N, Y) {
                    return O[N] = Y, O;
                  };
                }
                g = /* @__PURE__ */ function() {
                  var A, O, N;
                  function Y(j, te) {
                    this.fn = j, this.self = te, this.next = void 0;
                  }
                  return {
                    add: function(te, re) {
                      N = new Y(te, re), O ? O.next = N : A = N, O = N, N = void 0;
                    },
                    drain: function() {
                      var te = A;
                      for (A = O = p = void 0; te; )
                        te.fn.call(te.self), te = te.next;
                    }
                  };
                }();
                function m(L, A) {
                  g.add(L, A), p || (p = C(g.drain));
                }
                function h(L) {
                  var A, O = typeof L;
                  return L != null && (O == "object" || O == "function") && (A = L.then), typeof A == "function" ? A : !1;
                }
                function w() {
                  for (var L = 0; L < this.chain.length; L++)
                    S(
                      this,
                      this.state === 1 ? this.chain[L].success : this.chain[L].failure,
                      this.chain[L]
                    );
                  this.chain.length = 0;
                }
                function S(L, A, O) {
                  var N, Y;
                  try {
                    A === !1 ? O.reject(L.msg) : (A === !0 ? N = L.msg : N = A.call(void 0, L.msg), N === O.promise ? O.reject(TypeError("Promise-chain cycle")) : (Y = h(N)) ? Y.call(N, O.resolve, O.reject) : O.resolve(N));
                  } catch (j) {
                    O.reject(j);
                  }
                }
                function E(L) {
                  var A, O = this;
                  if (!O.triggered) {
                    O.triggered = !0, O.def && (O = O.def);
                    try {
                      (A = h(L)) ? m(function() {
                        var N = new F(O);
                        try {
                          A.call(
                            L,
                            function() {
                              E.apply(N, arguments);
                            },
                            function() {
                              x.apply(N, arguments);
                            }
                          );
                        } catch (Y) {
                          x.call(N, Y);
                        }
                      }) : (O.msg = L, O.state = 1, O.chain.length > 0 && m(w, O));
                    } catch (N) {
                      x.call(new F(O), N);
                    }
                  }
                }
                function x(L) {
                  var A = this;
                  A.triggered || (A.triggered = !0, A.def && (A = A.def), A.msg = L, A.state = 2, A.chain.length > 0 && m(w, A));
                }
                function T(L, A, O, N) {
                  for (var Y = 0; Y < A.length; Y++)
                    (function(te) {
                      L.resolve(A[te]).then(
                        function(z) {
                          O(te, z);
                        },
                        N
                      );
                    })(Y);
                }
                function F(L) {
                  this.def = L, this.triggered = !1;
                }
                function P(L) {
                  this.promise = L, this.state = 0, this.triggered = !1, this.chain = [], this.msg = void 0;
                }
                function k(L) {
                  if (typeof L != "function")
                    throw TypeError("Not a function");
                  if (this.__NPO__ !== 0)
                    throw TypeError("Not a promise");
                  this.__NPO__ = 1;
                  var A = new P(this);
                  this.then = function(N, Y) {
                    var j = {
                      success: typeof N == "function" ? N : !0,
                      failure: typeof Y == "function" ? Y : !1
                    };
                    return j.promise = new this.constructor(function(re, z) {
                      if (typeof re != "function" || typeof z != "function")
                        throw TypeError("Not a function");
                      j.resolve = re, j.reject = z;
                    }), A.chain.push(j), A.state !== 0 && m(w, A), j.promise;
                  }, this.catch = function(N) {
                    return this.then(void 0, N);
                  };
                  try {
                    L.call(
                      void 0,
                      function(N) {
                        E.call(A, N);
                      },
                      function(N) {
                        x.call(A, N);
                      }
                    );
                  } catch (O) {
                    x.call(A, O);
                  }
                }
                var I = f(
                  {},
                  "constructor",
                  k,
                  /*configurable=*/
                  !1
                );
                return k.prototype = I, f(
                  I,
                  "__NPO__",
                  0,
                  /*configurable=*/
                  !1
                ), f(k, "resolve", function(A) {
                  var O = this;
                  return A && typeof A == "object" && A.__NPO__ === 1 ? A : new O(function(Y, j) {
                    if (typeof Y != "function" || typeof j != "function")
                      throw TypeError("Not a function");
                    Y(A);
                  });
                }), f(k, "reject", function(A) {
                  return new this(function(N, Y) {
                    if (typeof N != "function" || typeof Y != "function")
                      throw TypeError("Not a function");
                    Y(A);
                  });
                }), f(k, "all", function(A) {
                  var O = this;
                  return y.call(A) != "[object Array]" ? O.reject(TypeError("Not an array")) : A.length === 0 ? O.resolve([]) : new O(function(Y, j) {
                    if (typeof Y != "function" || typeof j != "function")
                      throw TypeError("Not a function");
                    var te = A.length, re = Array(te), z = 0;
                    T(O, A, function(W, q) {
                      re[W] = q, ++z === te && Y(re);
                    }, j);
                  });
                }), f(k, "race", function(A) {
                  var O = this;
                  return y.call(A) != "[object Array]" ? O.reject(TypeError("Not an array")) : new O(function(Y, j) {
                    if (typeof Y != "function" || typeof j != "function")
                      throw TypeError("Not a function");
                    T(O, A, function(re, z) {
                      Y(z);
                    }, j);
                  });
                }), k;
              });
            }
          ),
          /***/
          896: (
            /***/
            function(s) {
              /*
              object-assign
              (c) Sindre Sorhus
              @license MIT
              */
              var c = Object.getOwnPropertySymbols, i = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
              function v(p) {
                if (p == null)
                  throw new TypeError("Object.assign cannot be called with null or undefined");
                return Object(p);
              }
              function f() {
                try {
                  if (!Object.assign)
                    return !1;
                  var p = new String("abc");
                  if (p[5] = "de", Object.getOwnPropertyNames(p)[0] === "5")
                    return !1;
                  for (var g = {}, y = 0; y < 10; y++)
                    g["_" + String.fromCharCode(y)] = y;
                  var C = Object.getOwnPropertyNames(g).map(function(h) {
                    return g[h];
                  });
                  if (C.join("") !== "0123456789")
                    return !1;
                  var m = {};
                  return "abcdefghijklmnopqrst".split("").forEach(function(h) {
                    m[h] = h;
                  }), Object.keys(Object.assign({}, m)).join("") === "abcdefghijklmnopqrst";
                } catch {
                  return !1;
                }
              }
              s.exports = f() ? Object.assign : function(p, g) {
                for (var y, C = v(p), m, h = 1; h < arguments.length; h++) {
                  y = Object(arguments[h]);
                  for (var w in y)
                    i.call(y, w) && (C[w] = y[w]);
                  if (c) {
                    m = c(y);
                    for (var S = 0; S < m.length; S++)
                      l.call(y, m[S]) && (C[m[S]] = y[m[S]]);
                  }
                }
                return C;
              };
            }
          ),
          /***/
          9604: (
            /***/
            function(s) {
              s.exports = l;
              var c = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, i = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
              function l(p) {
                var g = [];
                return p.replace(i, function(y, C, m) {
                  var h = C.toLowerCase();
                  for (m = f(m), h == "m" && m.length > 2 && (g.push([C].concat(m.splice(0, 2))), h = "l", C = C == "m" ? "l" : "L"); ; ) {
                    if (m.length == c[h])
                      return m.unshift(C), g.push(m);
                    if (m.length < c[h]) throw new Error("malformed path data");
                    g.push([C].concat(m.splice(0, c[h])));
                  }
                }), g;
              }
              var v = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
              function f(p) {
                var g = p.match(v);
                return g ? g.map(Number) : [];
              }
            }
          ),
          /***/
          1456: (
            /***/
            function(s) {
              s.exports = function(i, l, v, f) {
                var p = i[0], g = i[1], y = !1;
                v === void 0 && (v = 0), f === void 0 && (f = l.length);
                for (var C = f - v, m = 0, h = C - 1; m < C; h = m++) {
                  var w = l[m + v][0], S = l[m + v][1], E = l[h + v][0], x = l[h + v][1], T = S > g != x > g && p < (E - w) * (g - S) / (x - S) + w;
                  T && (y = !y);
                }
                return y;
              };
            }
          ),
          /***/
          4756: (
            /***/
            function(s, c, i) {
              /*
               * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
               * @license MIT
               * @preserve Project Home: https://github.com/voidqk/polybooljs
               */
              var l = i(2928), v = i(8648), f = i(9819), p = i(1403), g = i(2368), y = i(7792), C = !1, m = v(), h;
              h = {
                // getter/setter for buildLog
                buildLog: function(S) {
                  return S === !0 ? C = l() : S === !1 && (C = !1), C === !1 ? !1 : C.list;
                },
                // getter/setter for epsilon
                epsilon: function(S) {
                  return m.epsilon(S);
                },
                // core API
                segments: function(S) {
                  var E = f(!0, m, C);
                  return S.regions.forEach(E.addRegion), {
                    segments: E.calculate(S.inverted),
                    inverted: S.inverted
                  };
                },
                combine: function(S, E) {
                  var x = f(!1, m, C);
                  return {
                    combined: x.calculate(
                      S.segments,
                      S.inverted,
                      E.segments,
                      E.inverted
                    ),
                    inverted1: S.inverted,
                    inverted2: E.inverted
                  };
                },
                selectUnion: function(S) {
                  return {
                    segments: g.union(S.combined, C),
                    inverted: S.inverted1 || S.inverted2
                  };
                },
                selectIntersect: function(S) {
                  return {
                    segments: g.intersect(S.combined, C),
                    inverted: S.inverted1 && S.inverted2
                  };
                },
                selectDifference: function(S) {
                  return {
                    segments: g.difference(S.combined, C),
                    inverted: S.inverted1 && !S.inverted2
                  };
                },
                selectDifferenceRev: function(S) {
                  return {
                    segments: g.differenceRev(S.combined, C),
                    inverted: !S.inverted1 && S.inverted2
                  };
                },
                selectXor: function(S) {
                  return {
                    segments: g.xor(S.combined, C),
                    inverted: S.inverted1 !== S.inverted2
                  };
                },
                polygon: function(S) {
                  return {
                    regions: p(S.segments, m, C),
                    inverted: S.inverted
                  };
                },
                // GeoJSON converters
                polygonFromGeoJSON: function(S) {
                  return y.toPolygon(h, S);
                },
                polygonToGeoJSON: function(S) {
                  return y.fromPolygon(h, m, S);
                },
                // helper functions for common operations
                union: function(S, E) {
                  return w(S, E, h.selectUnion);
                },
                intersect: function(S, E) {
                  return w(S, E, h.selectIntersect);
                },
                difference: function(S, E) {
                  return w(S, E, h.selectDifference);
                },
                differenceRev: function(S, E) {
                  return w(S, E, h.selectDifferenceRev);
                },
                xor: function(S, E) {
                  return w(S, E, h.selectXor);
                }
              };
              function w(S, E, x) {
                var T = h.segments(S), F = h.segments(E), P = h.combine(T, F), k = x(P);
                return h.polygon(k);
              }
              typeof window == "object" && (window.PolyBool = h), s.exports = h;
            }
          ),
          /***/
          2928: (
            /***/
            function(s) {
              function c() {
                var i, l = 0, v = !1;
                function f(p, g) {
                  return i.list.push({
                    type: p,
                    data: g ? JSON.parse(JSON.stringify(g)) : void 0
                  }), i;
                }
                return i = {
                  list: [],
                  segmentId: function() {
                    return l++;
                  },
                  checkIntersection: function(p, g) {
                    return f("check", { seg1: p, seg2: g });
                  },
                  segmentChop: function(p, g) {
                    return f("div_seg", { seg: p, pt: g }), f("chop", { seg: p, pt: g });
                  },
                  statusRemove: function(p) {
                    return f("pop_seg", { seg: p });
                  },
                  segmentUpdate: function(p) {
                    return f("seg_update", { seg: p });
                  },
                  segmentNew: function(p, g) {
                    return f("new_seg", { seg: p, primary: g });
                  },
                  segmentRemove: function(p) {
                    return f("rem_seg", { seg: p });
                  },
                  tempStatus: function(p, g, y) {
                    return f("temp_status", { seg: p, above: g, below: y });
                  },
                  rewind: function(p) {
                    return f("rewind", { seg: p });
                  },
                  status: function(p, g, y) {
                    return f("status", { seg: p, above: g, below: y });
                  },
                  vert: function(p) {
                    return p === v ? i : (v = p, f("vert", { x: p }));
                  },
                  log: function(p) {
                    return typeof p != "string" && (p = JSON.stringify(p, !1, "  ")), f("log", { txt: p });
                  },
                  reset: function() {
                    return f("reset");
                  },
                  selected: function(p) {
                    return f("selected", { segs: p });
                  },
                  chainStart: function(p) {
                    return f("chain_start", { seg: p });
                  },
                  chainRemoveHead: function(p, g) {
                    return f("chain_rem_head", { index: p, pt: g });
                  },
                  chainRemoveTail: function(p, g) {
                    return f("chain_rem_tail", { index: p, pt: g });
                  },
                  chainNew: function(p, g) {
                    return f("chain_new", { pt1: p, pt2: g });
                  },
                  chainMatch: function(p) {
                    return f("chain_match", { index: p });
                  },
                  chainClose: function(p) {
                    return f("chain_close", { index: p });
                  },
                  chainAddHead: function(p, g) {
                    return f("chain_add_head", { index: p, pt: g });
                  },
                  chainAddTail: function(p, g) {
                    return f("chain_add_tail", { index: p, pt: g });
                  },
                  chainConnect: function(p, g) {
                    return f("chain_con", { index1: p, index2: g });
                  },
                  chainReverse: function(p) {
                    return f("chain_rev", { index: p });
                  },
                  chainJoin: function(p, g) {
                    return f("chain_join", { index1: p, index2: g });
                  },
                  done: function() {
                    return f("done");
                  }
                }, i;
              }
              s.exports = c;
            }
          ),
          /***/
          8648: (
            /***/
            function(s) {
              function c(i) {
                typeof i != "number" && (i = 1e-10);
                var l = {
                  epsilon: function(v) {
                    return typeof v == "number" && (i = v), i;
                  },
                  pointAboveOrOnLine: function(v, f, p) {
                    var g = f[0], y = f[1], C = p[0], m = p[1], h = v[0], w = v[1];
                    return (C - g) * (w - y) - (m - y) * (h - g) >= -i;
                  },
                  pointBetween: function(v, f, p) {
                    var g = v[1] - f[1], y = p[0] - f[0], C = v[0] - f[0], m = p[1] - f[1], h = C * y + g * m;
                    if (h < i)
                      return !1;
                    var w = y * y + m * m;
                    return !(h - w > -i);
                  },
                  pointsSameX: function(v, f) {
                    return Math.abs(v[0] - f[0]) < i;
                  },
                  pointsSameY: function(v, f) {
                    return Math.abs(v[1] - f[1]) < i;
                  },
                  pointsSame: function(v, f) {
                    return l.pointsSameX(v, f) && l.pointsSameY(v, f);
                  },
                  pointsCompare: function(v, f) {
                    return l.pointsSameX(v, f) ? l.pointsSameY(v, f) ? 0 : v[1] < f[1] ? -1 : 1 : v[0] < f[0] ? -1 : 1;
                  },
                  pointsCollinear: function(v, f, p) {
                    var g = v[0] - f[0], y = v[1] - f[1], C = f[0] - p[0], m = f[1] - p[1];
                    return Math.abs(g * m - C * y) < i;
                  },
                  linesIntersect: function(v, f, p, g) {
                    var y = f[0] - v[0], C = f[1] - v[1], m = g[0] - p[0], h = g[1] - p[1], w = y * h - C * m;
                    if (Math.abs(w) < i)
                      return !1;
                    var S = v[0] - p[0], E = v[1] - p[1], x = (m * E - h * S) / w, T = (y * E - C * S) / w, F = {
                      alongA: 0,
                      alongB: 0,
                      pt: [
                        v[0] + x * y,
                        v[1] + x * C
                      ]
                    };
                    return x <= -i ? F.alongA = -2 : x < i ? F.alongA = -1 : x - 1 <= -i ? F.alongA = 0 : x - 1 < i ? F.alongA = 1 : F.alongA = 2, T <= -i ? F.alongB = -2 : T < i ? F.alongB = -1 : T - 1 <= -i ? F.alongB = 0 : T - 1 < i ? F.alongB = 1 : F.alongB = 2, F;
                  },
                  pointInsideRegion: function(v, f) {
                    for (var p = v[0], g = v[1], y = f[f.length - 1][0], C = f[f.length - 1][1], m = !1, h = 0; h < f.length; h++) {
                      var w = f[h][0], S = f[h][1];
                      S - g > i != C - g > i && (y - w) * (g - S) / (C - S) + w - p > i && (m = !m), y = w, C = S;
                    }
                    return m;
                  }
                };
                return l;
              }
              s.exports = c;
            }
          ),
          /***/
          7792: (
            /***/
            function(s) {
              var c = {
                // convert a GeoJSON object to a PolyBool polygon
                toPolygon: function(i, l) {
                  function v(g) {
                    if (g.length <= 0)
                      return i.segments({ inverted: !1, regions: [] });
                    function y(h) {
                      var w = h.slice(0, h.length - 1);
                      return i.segments({ inverted: !1, regions: [w] });
                    }
                    for (var C = y(g[0]), m = 1; m < g.length; m++)
                      C = i.selectDifference(i.combine(C, y(g[m])));
                    return C;
                  }
                  if (l.type === "Polygon")
                    return i.polygon(v(l.coordinates));
                  if (l.type === "MultiPolygon") {
                    for (var f = i.segments({ inverted: !1, regions: [] }), p = 0; p < l.coordinates.length; p++)
                      f = i.selectUnion(i.combine(f, v(l.coordinates[p])));
                    return i.polygon(f);
                  }
                  throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon");
                },
                // convert a PolyBool polygon to a GeoJSON object
                fromPolygon: function(i, l, v) {
                  v = i.polygon(i.segments(v));
                  function f(x, T) {
                    return l.pointInsideRegion([
                      (x[0][0] + x[1][0]) * 0.5,
                      (x[0][1] + x[1][1]) * 0.5
                    ], T);
                  }
                  function p(x) {
                    return {
                      region: x,
                      children: []
                    };
                  }
                  var g = p(null);
                  function y(x, T) {
                    for (var F = 0; F < x.children.length; F++) {
                      var P = x.children[F];
                      if (f(T, P.region)) {
                        y(P, T);
                        return;
                      }
                    }
                    for (var k = p(T), F = 0; F < x.children.length; F++) {
                      var P = x.children[F];
                      f(P.region, T) && (k.children.push(P), x.children.splice(F, 1), F--);
                    }
                    x.children.push(k);
                  }
                  for (var C = 0; C < v.regions.length; C++) {
                    var m = v.regions[C];
                    m.length < 3 || y(g, m);
                  }
                  function h(x, T) {
                    for (var F = 0, P = x[x.length - 1][0], k = x[x.length - 1][1], I = [], L = 0; L < x.length; L++) {
                      var A = x[L][0], O = x[L][1];
                      I.push([A, O]), F += O * P - A * k, P = A, k = O;
                    }
                    var N = F < 0;
                    return N !== T && I.reverse(), I.push([I[0][0], I[0][1]]), I;
                  }
                  var w = [];
                  function S(x) {
                    var T = [h(x.region, !1)];
                    w.push(T);
                    for (var F = 0; F < x.children.length; F++)
                      T.push(E(x.children[F]));
                  }
                  function E(x) {
                    for (var T = 0; T < x.children.length; T++)
                      S(x.children[T]);
                    return h(x.region, !0);
                  }
                  for (var C = 0; C < g.children.length; C++)
                    S(g.children[C]);
                  return w.length <= 0 ? { type: "Polygon", coordinates: [] } : w.length == 1 ? { type: "Polygon", coordinates: w[0] } : {
                    // otherwise, use a GeoJSON MultiPolygon
                    type: "MultiPolygon",
                    coordinates: w
                  };
                }
              };
              s.exports = c;
            }
          ),
          /***/
          9819: (
            /***/
            function(s, c, i) {
              var l = i(8088);
              function v(f, p, g) {
                function y(k, I) {
                  return {
                    id: g ? g.segmentId() : -1,
                    start: k,
                    end: I,
                    myFill: {
                      above: null,
                      // is there fill above us?
                      below: null
                      // is there fill below us?
                    },
                    otherFill: null
                  };
                }
                function C(k, I, L) {
                  return {
                    id: g ? g.segmentId() : -1,
                    start: k,
                    end: I,
                    myFill: {
                      above: L.myFill.above,
                      below: L.myFill.below
                    },
                    otherFill: null
                  };
                }
                var m = l.create();
                function h(k, I, L, A, O, N) {
                  var Y = p.pointsCompare(I, O);
                  return Y !== 0 ? Y : p.pointsSame(L, N) ? 0 : k !== A ? k ? 1 : -1 : p.pointAboveOrOnLine(
                    L,
                    A ? O : N,
                    // order matters
                    A ? N : O
                  ) ? 1 : -1;
                }
                function w(k, I) {
                  m.insertBefore(k, function(L) {
                    var A = h(
                      k.isStart,
                      k.pt,
                      I,
                      L.isStart,
                      L.pt,
                      L.other.pt
                    );
                    return A < 0;
                  });
                }
                function S(k, I) {
                  var L = l.node({
                    isStart: !0,
                    pt: k.start,
                    seg: k,
                    primary: I,
                    other: null,
                    status: null
                  });
                  return w(L, k.end), L;
                }
                function E(k, I, L) {
                  var A = l.node({
                    isStart: !1,
                    pt: I.end,
                    seg: I,
                    primary: L,
                    other: k,
                    status: null
                  });
                  k.other = A, w(A, k.pt);
                }
                function x(k, I) {
                  var L = S(k, I);
                  return E(L, k, I), L;
                }
                function T(k, I) {
                  g && g.segmentChop(k.seg, I), k.other.remove(), k.seg.end = I, k.other.pt = I, w(k.other, k.pt);
                }
                function F(k, I) {
                  var L = C(I, k.seg.end, k.seg);
                  return T(k, I), x(L, k.primary);
                }
                function P(k, I) {
                  var L = l.create();
                  function A(X, U) {
                    var ne = X.seg.start, se = X.seg.end, le = U.seg.start, ue = U.seg.end;
                    return p.pointsCollinear(ne, le, ue) ? p.pointsCollinear(se, le, ue) || p.pointAboveOrOnLine(se, le, ue) ? 1 : -1 : p.pointAboveOrOnLine(ne, le, ue) ? 1 : -1;
                  }
                  function O(X) {
                    return L.findTransition(function(U) {
                      var ne = A(X, U.ev);
                      return ne > 0;
                    });
                  }
                  function N(X, U) {
                    var ne = X.seg, se = U.seg, le = ne.start, ue = ne.end, ve = se.start, be = se.end;
                    g && g.checkIntersection(ne, se);
                    var Me = p.linesIntersect(le, ue, ve, be);
                    if (Me === !1) {
                      if (!p.pointsCollinear(le, ue, ve) || p.pointsSame(le, be) || p.pointsSame(ue, ve))
                        return !1;
                      var Ge = p.pointsSame(le, ve), we = p.pointsSame(ue, be);
                      if (Ge && we)
                        return U;
                      var Re = !Ge && p.pointBetween(le, ve, be), Ae = !we && p.pointBetween(ue, ve, be);
                      if (Ge)
                        return Ae ? F(U, ue) : F(X, be), U;
                      Re && (we || (Ae ? F(U, ue) : F(X, be)), F(U, le));
                    } else
                      Me.alongA === 0 && (Me.alongB === -1 ? F(X, ve) : Me.alongB === 0 ? F(X, Me.pt) : Me.alongB === 1 && F(X, be)), Me.alongB === 0 && (Me.alongA === -1 ? F(U, le) : Me.alongA === 0 ? F(U, Me.pt) : Me.alongA === 1 && F(U, ue));
                    return !1;
                  }
                  for (var Y = []; !m.isEmpty(); ) {
                    var j = m.getHead();
                    if (g && g.vert(j.pt[0]), j.isStart) {
                      let X = function() {
                        if (re) {
                          var U = N(j, re);
                          if (U)
                            return U;
                        }
                        return z ? N(j, z) : !1;
                      };
                      g && g.segmentNew(j.seg, j.primary);
                      var te = O(j), re = te.before ? te.before.ev : null, z = te.after ? te.after.ev : null;
                      g && g.tempStatus(
                        j.seg,
                        re ? re.seg : !1,
                        z ? z.seg : !1
                      );
                      var Z = X();
                      if (Z) {
                        if (f) {
                          var W;
                          j.seg.myFill.below === null ? W = !0 : W = j.seg.myFill.above !== j.seg.myFill.below, W && (Z.seg.myFill.above = !Z.seg.myFill.above);
                        } else
                          Z.seg.otherFill = j.seg.myFill;
                        g && g.segmentUpdate(Z.seg), j.other.remove(), j.remove();
                      }
                      if (m.getHead() !== j) {
                        g && g.rewind(j.seg);
                        continue;
                      }
                      if (f) {
                        var W;
                        j.seg.myFill.below === null ? W = !0 : W = j.seg.myFill.above !== j.seg.myFill.below, z ? j.seg.myFill.below = z.seg.myFill.above : j.seg.myFill.below = k, W ? j.seg.myFill.above = !j.seg.myFill.below : j.seg.myFill.above = j.seg.myFill.below;
                      } else if (j.seg.otherFill === null) {
                        var q;
                        z ? j.primary === z.primary ? q = z.seg.otherFill.above : q = z.seg.myFill.above : q = j.primary ? I : k, j.seg.otherFill = {
                          above: q,
                          below: q
                        };
                      }
                      g && g.status(
                        j.seg,
                        re ? re.seg : !1,
                        z ? z.seg : !1
                      ), j.other.status = te.insert(l.node({ ev: j }));
                    } else {
                      var ie = j.status;
                      if (ie === null)
                        throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");
                      if (L.exists(ie.prev) && L.exists(ie.next) && N(ie.prev.ev, ie.next.ev), g && g.statusRemove(ie.ev.seg), ie.remove(), !j.primary) {
                        var ce = j.seg.myFill;
                        j.seg.myFill = j.seg.otherFill, j.seg.otherFill = ce;
                      }
                      Y.push(j.seg);
                    }
                    m.getHead().remove();
                  }
                  return g && g.done(), Y;
                }
                return f ? {
                  addRegion: function(k) {
                    for (var I, L = k[k.length - 1], A = 0; A < k.length; A++) {
                      I = L, L = k[A];
                      var O = p.pointsCompare(I, L);
                      O !== 0 && x(
                        y(
                          O < 0 ? I : L,
                          O < 0 ? L : I
                        ),
                        !0
                      );
                    }
                  },
                  calculate: function(k) {
                    return P(k, !1);
                  }
                } : {
                  calculate: function(k, I, L, A) {
                    return k.forEach(function(O) {
                      x(C(O.start, O.end, O), !0);
                    }), L.forEach(function(O) {
                      x(C(O.start, O.end, O), !1);
                    }), P(I, A);
                  }
                };
              }
              s.exports = v;
            }
          ),
          /***/
          8088: (
            /***/
            function(s) {
              var c = {
                create: function() {
                  var i = {
                    root: { root: !0, next: null },
                    exists: function(l) {
                      return !(l === null || l === i.root);
                    },
                    isEmpty: function() {
                      return i.root.next === null;
                    },
                    getHead: function() {
                      return i.root.next;
                    },
                    insertBefore: function(l, v) {
                      for (var f = i.root, p = i.root.next; p !== null; ) {
                        if (v(p)) {
                          l.prev = p.prev, l.next = p, p.prev.next = l, p.prev = l;
                          return;
                        }
                        f = p, p = p.next;
                      }
                      f.next = l, l.prev = f, l.next = null;
                    },
                    findTransition: function(l) {
                      for (var v = i.root, f = i.root.next; f !== null && !l(f); )
                        v = f, f = f.next;
                      return {
                        before: v === i.root ? null : v,
                        after: f,
                        insert: function(p) {
                          return p.prev = v, p.next = f, v.next = p, f !== null && (f.prev = p), p;
                        }
                      };
                    }
                  };
                  return i;
                },
                node: function(i) {
                  return i.prev = null, i.next = null, i.remove = function() {
                    i.prev.next = i.next, i.next && (i.next.prev = i.prev), i.prev = null, i.next = null;
                  }, i;
                }
              };
              s.exports = c;
            }
          ),
          /***/
          1403: (
            /***/
            function(s) {
              function c(i, l, v) {
                var f = [], p = [];
                return i.forEach(function(g) {
                  var y = g.start, C = g.end;
                  if (l.pointsSame(y, C)) {
                    console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");
                    return;
                  }
                  v && v.chainStart(g);
                  var m = {
                    index: 0,
                    matches_head: !1,
                    matches_pt1: !1
                  }, h = {
                    index: 0,
                    matches_head: !1,
                    matches_pt1: !1
                  }, w = m;
                  function S(Z, W, q) {
                    return w.index = Z, w.matches_head = W, w.matches_pt1 = q, w === m ? (w = h, !1) : (w = null, !0);
                  }
                  for (var E = 0; E < f.length; E++) {
                    var x = f[E], T = x[0];
                    x[1];
                    var F = x[x.length - 1];
                    if (x[x.length - 2], l.pointsSame(T, y)) {
                      if (S(E, !0, !0))
                        break;
                    } else if (l.pointsSame(T, C)) {
                      if (S(E, !0, !1))
                        break;
                    } else if (l.pointsSame(F, y)) {
                      if (S(E, !1, !0))
                        break;
                    } else if (l.pointsSame(F, C) && S(E, !1, !1))
                      break;
                  }
                  if (w === m) {
                    f.push([y, C]), v && v.chainNew(y, C);
                    return;
                  }
                  if (w === h) {
                    v && v.chainMatch(m.index);
                    var P = m.index, k = m.matches_pt1 ? C : y, I = m.matches_head, x = f[P], L = I ? x[0] : x[x.length - 1], A = I ? x[1] : x[x.length - 2], O = I ? x[x.length - 1] : x[0], N = I ? x[x.length - 2] : x[1];
                    if (l.pointsCollinear(A, L, k) && (I ? (v && v.chainRemoveHead(m.index, k), x.shift()) : (v && v.chainRemoveTail(m.index, k), x.pop()), L = A), l.pointsSame(O, k)) {
                      f.splice(P, 1), l.pointsCollinear(N, O, L) && (I ? (v && v.chainRemoveTail(m.index, L), x.pop()) : (v && v.chainRemoveHead(m.index, L), x.shift())), v && v.chainClose(m.index), p.push(x);
                      return;
                    }
                    I ? (v && v.chainAddHead(m.index, k), x.unshift(k)) : (v && v.chainAddTail(m.index, k), x.push(k));
                    return;
                  }
                  function Y(Z) {
                    v && v.chainReverse(Z), f[Z].reverse();
                  }
                  function j(Z, W) {
                    var q = f[Z], ie = f[W], ce = q[q.length - 1], X = q[q.length - 2], U = ie[0], ne = ie[1];
                    l.pointsCollinear(X, ce, U) && (v && v.chainRemoveTail(Z, ce), q.pop(), ce = X), l.pointsCollinear(ce, U, ne) && (v && v.chainRemoveHead(W, U), ie.shift()), v && v.chainJoin(Z, W), f[Z] = q.concat(ie), f.splice(W, 1);
                  }
                  var te = m.index, re = h.index;
                  v && v.chainConnect(te, re);
                  var z = f[te].length < f[re].length;
                  m.matches_head ? h.matches_head ? z ? (Y(te), j(te, re)) : (Y(re), j(re, te)) : j(re, te) : h.matches_head ? j(te, re) : z ? (Y(te), j(re, te)) : (Y(re), j(te, re));
                }), p;
              }
              s.exports = c;
            }
          ),
          /***/
          2368: (
            /***/
            function(s) {
              function c(l, v, f) {
                var p = [];
                return l.forEach(function(g) {
                  var y = (g.myFill.above ? 8 : 0) + (g.myFill.below ? 4 : 0) + (g.otherFill && g.otherFill.above ? 2 : 0) + (g.otherFill && g.otherFill.below ? 1 : 0);
                  v[y] !== 0 && p.push({
                    id: f ? f.segmentId() : -1,
                    start: g.start,
                    end: g.end,
                    myFill: {
                      above: v[y] === 1,
                      // 1 if filled above
                      below: v[y] === 2
                      // 2 if filled below
                    },
                    otherFill: null
                  });
                }), f && f.selected(p), p;
              }
              var i = {
                union: function(l, v) {
                  return c(l, [
                    0,
                    2,
                    1,
                    0,
                    2,
                    2,
                    0,
                    0,
                    1,
                    0,
                    1,
                    0,
                    0,
                    0,
                    0,
                    0
                  ], v);
                },
                intersect: function(l, v) {
                  return c(l, [
                    0,
                    0,
                    0,
                    0,
                    0,
                    2,
                    0,
                    2,
                    0,
                    0,
                    1,
                    1,
                    0,
                    2,
                    1,
                    0
                  ], v);
                },
                difference: function(l, v) {
                  return c(l, [
                    0,
                    0,
                    0,
                    0,
                    2,
                    0,
                    2,
                    0,
                    1,
                    1,
                    0,
                    0,
                    0,
                    1,
                    2,
                    0
                  ], v);
                },
                differenceRev: function(l, v) {
                  return c(l, [
                    0,
                    2,
                    1,
                    0,
                    0,
                    0,
                    1,
                    1,
                    0,
                    2,
                    0,
                    2,
                    0,
                    0,
                    0,
                    0
                  ], v);
                },
                xor: function(l, v) {
                  return c(l, [
                    0,
                    2,
                    1,
                    0,
                    2,
                    0,
                    0,
                    1,
                    1,
                    0,
                    0,
                    2,
                    0,
                    1,
                    2,
                    0
                  ], v);
                }
              };
              s.exports = i;
            }
          ),
          /***/
          9760: (
            /***/
            function(s, c, i) {
              var l;
              (function(v) {
                var f = /^\s+/, p = /\s+$/, g = 0, y = v.round, C = v.min, m = v.max, h = v.random;
                function w(V, fe) {
                  if (V = V || "", fe = fe || {}, V instanceof w)
                    return V;
                  if (!(this instanceof w))
                    return new w(V, fe);
                  var $ = S(V);
                  this._originalInput = V, this._r = $.r, this._g = $.g, this._b = $.b, this._a = $.a, this._roundA = y(100 * this._a) / 100, this._format = fe.format || $.format, this._gradientType = fe.gradientType, this._r < 1 && (this._r = y(this._r)), this._g < 1 && (this._g = y(this._g)), this._b < 1 && (this._b = y(this._b)), this._ok = $.ok, this._tc_id = g++;
                }
                w.prototype = {
                  isDark: function() {
                    return this.getBrightness() < 128;
                  },
                  isLight: function() {
                    return !this.isDark();
                  },
                  isValid: function() {
                    return this._ok;
                  },
                  getOriginalInput: function() {
                    return this._originalInput;
                  },
                  getFormat: function() {
                    return this._format;
                  },
                  getAlpha: function() {
                    return this._a;
                  },
                  getBrightness: function() {
                    var V = this.toRgb();
                    return (V.r * 299 + V.g * 587 + V.b * 114) / 1e3;
                  },
                  getLuminance: function() {
                    var V = this.toRgb(), fe, $, he, me, xe, Fe;
                    return fe = V.r / 255, $ = V.g / 255, he = V.b / 255, fe <= 0.03928 ? me = fe / 12.92 : me = v.pow((fe + 0.055) / 1.055, 2.4), $ <= 0.03928 ? xe = $ / 12.92 : xe = v.pow(($ + 0.055) / 1.055, 2.4), he <= 0.03928 ? Fe = he / 12.92 : Fe = v.pow((he + 0.055) / 1.055, 2.4), 0.2126 * me + 0.7152 * xe + 0.0722 * Fe;
                  },
                  setAlpha: function(V) {
                    return this._a = se(V), this._roundA = y(100 * this._a) / 100, this;
                  },
                  toHsv: function() {
                    var V = F(this._r, this._g, this._b);
                    return { h: V.h * 360, s: V.s, v: V.v, a: this._a };
                  },
                  toHsvString: function() {
                    var V = F(this._r, this._g, this._b), fe = y(V.h * 360), $ = y(V.s * 100), he = y(V.v * 100);
                    return this._a == 1 ? "hsv(" + fe + ", " + $ + "%, " + he + "%)" : "hsva(" + fe + ", " + $ + "%, " + he + "%, " + this._roundA + ")";
                  },
                  toHsl: function() {
                    var V = x(this._r, this._g, this._b);
                    return { h: V.h * 360, s: V.s, l: V.l, a: this._a };
                  },
                  toHslString: function() {
                    var V = x(this._r, this._g, this._b), fe = y(V.h * 360), $ = y(V.s * 100), he = y(V.l * 100);
                    return this._a == 1 ? "hsl(" + fe + ", " + $ + "%, " + he + "%)" : "hsla(" + fe + ", " + $ + "%, " + he + "%, " + this._roundA + ")";
                  },
                  toHex: function(V) {
                    return k(this._r, this._g, this._b, V);
                  },
                  toHexString: function(V) {
                    return "#" + this.toHex(V);
                  },
                  toHex8: function(V) {
                    return I(this._r, this._g, this._b, this._a, V);
                  },
                  toHex8String: function(V) {
                    return "#" + this.toHex8(V);
                  },
                  toRgb: function() {
                    return { r: y(this._r), g: y(this._g), b: y(this._b), a: this._a };
                  },
                  toRgbString: function() {
                    return this._a == 1 ? "rgb(" + y(this._r) + ", " + y(this._g) + ", " + y(this._b) + ")" : "rgba(" + y(this._r) + ", " + y(this._g) + ", " + y(this._b) + ", " + this._roundA + ")";
                  },
                  toPercentageRgb: function() {
                    return { r: y(le(this._r, 255) * 100) + "%", g: y(le(this._g, 255) * 100) + "%", b: y(le(this._b, 255) * 100) + "%", a: this._a };
                  },
                  toPercentageRgbString: function() {
                    return this._a == 1 ? "rgb(" + y(le(this._r, 255) * 100) + "%, " + y(le(this._g, 255) * 100) + "%, " + y(le(this._b, 255) * 100) + "%)" : "rgba(" + y(le(this._r, 255) * 100) + "%, " + y(le(this._g, 255) * 100) + "%, " + y(le(this._b, 255) * 100) + "%, " + this._roundA + ")";
                  },
                  toName: function() {
                    return this._a === 0 ? "transparent" : this._a < 1 ? !1 : U[k(this._r, this._g, this._b, !0)] || !1;
                  },
                  toFilter: function(V) {
                    var fe = "#" + L(this._r, this._g, this._b, this._a), $ = fe, he = this._gradientType ? "GradientType = 1, " : "";
                    if (V) {
                      var me = w(V);
                      $ = "#" + L(me._r, me._g, me._b, me._a);
                    }
                    return "progid:DXImageTransform.Microsoft.gradient(" + he + "startColorstr=" + fe + ",endColorstr=" + $ + ")";
                  },
                  toString: function(V) {
                    var fe = !!V;
                    V = V || this._format;
                    var $ = !1, he = this._a < 1 && this._a >= 0, me = !fe && he && (V === "hex" || V === "hex6" || V === "hex3" || V === "hex4" || V === "hex8" || V === "name");
                    return me ? V === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (V === "rgb" && ($ = this.toRgbString()), V === "prgb" && ($ = this.toPercentageRgbString()), (V === "hex" || V === "hex6") && ($ = this.toHexString()), V === "hex3" && ($ = this.toHexString(!0)), V === "hex4" && ($ = this.toHex8String(!0)), V === "hex8" && ($ = this.toHex8String()), V === "name" && ($ = this.toName()), V === "hsl" && ($ = this.toHslString()), V === "hsv" && ($ = this.toHsvString()), $ || this.toHexString());
                  },
                  clone: function() {
                    return w(this.toString());
                  },
                  _applyModification: function(V, fe) {
                    var $ = V.apply(null, [this].concat([].slice.call(fe)));
                    return this._r = $._r, this._g = $._g, this._b = $._b, this.setAlpha($._a), this;
                  },
                  lighten: function() {
                    return this._applyModification(Y, arguments);
                  },
                  brighten: function() {
                    return this._applyModification(j, arguments);
                  },
                  darken: function() {
                    return this._applyModification(te, arguments);
                  },
                  desaturate: function() {
                    return this._applyModification(A, arguments);
                  },
                  saturate: function() {
                    return this._applyModification(O, arguments);
                  },
                  greyscale: function() {
                    return this._applyModification(N, arguments);
                  },
                  spin: function() {
                    return this._applyModification(re, arguments);
                  },
                  _applyCombination: function(V, fe) {
                    return V.apply(null, [this].concat([].slice.call(fe)));
                  },
                  analogous: function() {
                    return this._applyCombination(ie, arguments);
                  },
                  complement: function() {
                    return this._applyCombination(z, arguments);
                  },
                  monochromatic: function() {
                    return this._applyCombination(ce, arguments);
                  },
                  splitcomplement: function() {
                    return this._applyCombination(q, arguments);
                  },
                  triad: function() {
                    return this._applyCombination(Z, arguments);
                  },
                  tetrad: function() {
                    return this._applyCombination(W, arguments);
                  }
                }, w.fromRatio = function(V, fe) {
                  if (typeof V == "object") {
                    var $ = {};
                    for (var he in V)
                      V.hasOwnProperty(he) && (he === "a" ? $[he] = V[he] : $[he] = we(V[he]));
                    V = $;
                  }
                  return w(V, fe);
                };
                function S(V) {
                  var fe = { r: 0, g: 0, b: 0 }, $ = 1, he = null, me = null, xe = null, Fe = !1, Ve = !1;
                  return typeof V == "string" && (V = oe(V)), typeof V == "object" && (ee(V.r) && ee(V.g) && ee(V.b) ? (fe = E(V.r, V.g, V.b), Fe = !0, Ve = String(V.r).substr(-1) === "%" ? "prgb" : "rgb") : ee(V.h) && ee(V.s) && ee(V.v) ? (he = we(V.s), me = we(V.v), fe = P(V.h, he, me), Fe = !0, Ve = "hsv") : ee(V.h) && ee(V.s) && ee(V.l) && (he = we(V.s), xe = we(V.l), fe = T(V.h, he, xe), Fe = !0, Ve = "hsl"), V.hasOwnProperty("a") && ($ = V.a)), $ = se($), {
                    ok: Fe,
                    format: V.format || Ve,
                    r: C(255, m(fe.r, 0)),
                    g: C(255, m(fe.g, 0)),
                    b: C(255, m(fe.b, 0)),
                    a: $
                  };
                }
                function E(V, fe, $) {
                  return {
                    r: le(V, 255) * 255,
                    g: le(fe, 255) * 255,
                    b: le($, 255) * 255
                  };
                }
                function x(V, fe, $) {
                  V = le(V, 255), fe = le(fe, 255), $ = le($, 255);
                  var he = m(V, fe, $), me = C(V, fe, $), xe, Fe, Ve = (he + me) / 2;
                  if (he == me)
                    xe = Fe = 0;
                  else {
                    var Be = he - me;
                    switch (Fe = Ve > 0.5 ? Be / (2 - he - me) : Be / (he + me), he) {
                      case V:
                        xe = (fe - $) / Be + (fe < $ ? 6 : 0);
                        break;
                      case fe:
                        xe = ($ - V) / Be + 2;
                        break;
                      case $:
                        xe = (V - fe) / Be + 4;
                        break;
                    }
                    xe /= 6;
                  }
                  return { h: xe, s: Fe, l: Ve };
                }
                function T(V, fe, $) {
                  var he, me, xe;
                  V = le(V, 360), fe = le(fe, 100), $ = le($, 100);
                  function Fe(Je, et, at) {
                    return at < 0 && (at += 1), at > 1 && (at -= 1), at < 0.16666666666666666 ? Je + (et - Je) * 6 * at : at < 0.5 ? et : at < 0.6666666666666666 ? Je + (et - Je) * (0.6666666666666666 - at) * 6 : Je;
                  }
                  if (fe === 0)
                    he = me = xe = $;
                  else {
                    var Ve = $ < 0.5 ? $ * (1 + fe) : $ + fe - $ * fe, Be = 2 * $ - Ve;
                    he = Fe(Be, Ve, V + 0.3333333333333333), me = Fe(Be, Ve, V), xe = Fe(Be, Ve, V - 0.3333333333333333);
                  }
                  return { r: he * 255, g: me * 255, b: xe * 255 };
                }
                function F(V, fe, $) {
                  V = le(V, 255), fe = le(fe, 255), $ = le($, 255);
                  var he = m(V, fe, $), me = C(V, fe, $), xe, Fe, Ve = he, Be = he - me;
                  if (Fe = he === 0 ? 0 : Be / he, he == me)
                    xe = 0;
                  else {
                    switch (he) {
                      case V:
                        xe = (fe - $) / Be + (fe < $ ? 6 : 0);
                        break;
                      case fe:
                        xe = ($ - V) / Be + 2;
                        break;
                      case $:
                        xe = (V - fe) / Be + 4;
                        break;
                    }
                    xe /= 6;
                  }
                  return { h: xe, s: Fe, v: Ve };
                }
                function P(V, fe, $) {
                  V = le(V, 360) * 6, fe = le(fe, 100), $ = le($, 100);
                  var he = v.floor(V), me = V - he, xe = $ * (1 - fe), Fe = $ * (1 - me * fe), Ve = $ * (1 - (1 - me) * fe), Be = he % 6, Je = [$, Fe, xe, xe, Ve, $][Be], et = [Ve, $, $, Fe, xe, xe][Be], at = [xe, xe, Ve, $, $, Fe][Be];
                  return { r: Je * 255, g: et * 255, b: at * 255 };
                }
                function k(V, fe, $, he) {
                  var me = [
                    Ge(y(V).toString(16)),
                    Ge(y(fe).toString(16)),
                    Ge(y($).toString(16))
                  ];
                  return he && me[0].charAt(0) == me[0].charAt(1) && me[1].charAt(0) == me[1].charAt(1) && me[2].charAt(0) == me[2].charAt(1) ? me[0].charAt(0) + me[1].charAt(0) + me[2].charAt(0) : me.join("");
                }
                function I(V, fe, $, he, me) {
                  var xe = [
                    Ge(y(V).toString(16)),
                    Ge(y(fe).toString(16)),
                    Ge(y($).toString(16)),
                    Ge(Re(he))
                  ];
                  return me && xe[0].charAt(0) == xe[0].charAt(1) && xe[1].charAt(0) == xe[1].charAt(1) && xe[2].charAt(0) == xe[2].charAt(1) && xe[3].charAt(0) == xe[3].charAt(1) ? xe[0].charAt(0) + xe[1].charAt(0) + xe[2].charAt(0) + xe[3].charAt(0) : xe.join("");
                }
                function L(V, fe, $, he) {
                  var me = [
                    Ge(Re(he)),
                    Ge(y(V).toString(16)),
                    Ge(y(fe).toString(16)),
                    Ge(y($).toString(16))
                  ];
                  return me.join("");
                }
                w.equals = function(V, fe) {
                  return !V || !fe ? !1 : w(V).toRgbString() == w(fe).toRgbString();
                }, w.random = function() {
                  return w.fromRatio({
                    r: h(),
                    g: h(),
                    b: h()
                  });
                };
                function A(V, fe) {
                  fe = fe === 0 ? 0 : fe || 10;
                  var $ = w(V).toHsl();
                  return $.s -= fe / 100, $.s = ue($.s), w($);
                }
                function O(V, fe) {
                  fe = fe === 0 ? 0 : fe || 10;
                  var $ = w(V).toHsl();
                  return $.s += fe / 100, $.s = ue($.s), w($);
                }
                function N(V) {
                  return w(V).desaturate(100);
                }
                function Y(V, fe) {
                  fe = fe === 0 ? 0 : fe || 10;
                  var $ = w(V).toHsl();
                  return $.l += fe / 100, $.l = ue($.l), w($);
                }
                function j(V, fe) {
                  fe = fe === 0 ? 0 : fe || 10;
                  var $ = w(V).toRgb();
                  return $.r = m(0, C(255, $.r - y(255 * -(fe / 100)))), $.g = m(0, C(255, $.g - y(255 * -(fe / 100)))), $.b = m(0, C(255, $.b - y(255 * -(fe / 100)))), w($);
                }
                function te(V, fe) {
                  fe = fe === 0 ? 0 : fe || 10;
                  var $ = w(V).toHsl();
                  return $.l -= fe / 100, $.l = ue($.l), w($);
                }
                function re(V, fe) {
                  var $ = w(V).toHsl(), he = ($.h + fe) % 360;
                  return $.h = he < 0 ? 360 + he : he, w($);
                }
                function z(V) {
                  var fe = w(V).toHsl();
                  return fe.h = (fe.h + 180) % 360, w(fe);
                }
                function Z(V) {
                  var fe = w(V).toHsl(), $ = fe.h;
                  return [
                    w(V),
                    w({ h: ($ + 120) % 360, s: fe.s, l: fe.l }),
                    w({ h: ($ + 240) % 360, s: fe.s, l: fe.l })
                  ];
                }
                function W(V) {
                  var fe = w(V).toHsl(), $ = fe.h;
                  return [
                    w(V),
                    w({ h: ($ + 90) % 360, s: fe.s, l: fe.l }),
                    w({ h: ($ + 180) % 360, s: fe.s, l: fe.l }),
                    w({ h: ($ + 270) % 360, s: fe.s, l: fe.l })
                  ];
                }
                function q(V) {
                  var fe = w(V).toHsl(), $ = fe.h;
                  return [
                    w(V),
                    w({ h: ($ + 72) % 360, s: fe.s, l: fe.l }),
                    w({ h: ($ + 216) % 360, s: fe.s, l: fe.l })
                  ];
                }
                function ie(V, fe, $) {
                  fe = fe || 6, $ = $ || 30;
                  var he = w(V).toHsl(), me = 360 / $, xe = [w(V)];
                  for (he.h = (he.h - (me * fe >> 1) + 720) % 360; --fe; )
                    he.h = (he.h + me) % 360, xe.push(w(he));
                  return xe;
                }
                function ce(V, fe) {
                  fe = fe || 6;
                  for (var $ = w(V).toHsv(), he = $.h, me = $.s, xe = $.v, Fe = [], Ve = 1 / fe; fe--; )
                    Fe.push(w({ h: he, s: me, v: xe })), xe = (xe + Ve) % 1;
                  return Fe;
                }
                w.mix = function(V, fe, $) {
                  $ = $ === 0 ? 0 : $ || 50;
                  var he = w(V).toRgb(), me = w(fe).toRgb(), xe = $ / 100, Fe = {
                    r: (me.r - he.r) * xe + he.r,
                    g: (me.g - he.g) * xe + he.g,
                    b: (me.b - he.b) * xe + he.b,
                    a: (me.a - he.a) * xe + he.a
                  };
                  return w(Fe);
                }, w.readability = function(V, fe) {
                  var $ = w(V), he = w(fe);
                  return (v.max($.getLuminance(), he.getLuminance()) + 0.05) / (v.min($.getLuminance(), he.getLuminance()) + 0.05);
                }, w.isReadable = function(V, fe, $) {
                  var he = w.readability(V, fe), me, xe;
                  switch (xe = !1, me = _($), me.level + me.size) {
                    case "AAsmall":
                    case "AAAlarge":
                      xe = he >= 4.5;
                      break;
                    case "AAlarge":
                      xe = he >= 3;
                      break;
                    case "AAAsmall":
                      xe = he >= 7;
                      break;
                  }
                  return xe;
                }, w.mostReadable = function(V, fe, $) {
                  var he = null, me = 0, xe, Fe, Ve, Be;
                  $ = $ || {}, Fe = $.includeFallbackColors, Ve = $.level, Be = $.size;
                  for (var Je = 0; Je < fe.length; Je++)
                    xe = w.readability(V, fe[Je]), xe > me && (me = xe, he = w(fe[Je]));
                  return w.isReadable(V, he, { level: Ve, size: Be }) || !Fe ? he : ($.includeFallbackColors = !1, w.mostReadable(V, ["#fff", "#000"], $));
                };
                var X = w.names = {
                  aliceblue: "f0f8ff",
                  antiquewhite: "faebd7",
                  aqua: "0ff",
                  aquamarine: "7fffd4",
                  azure: "f0ffff",
                  beige: "f5f5dc",
                  bisque: "ffe4c4",
                  black: "000",
                  blanchedalmond: "ffebcd",
                  blue: "00f",
                  blueviolet: "8a2be2",
                  brown: "a52a2a",
                  burlywood: "deb887",
                  burntsienna: "ea7e5d",
                  cadetblue: "5f9ea0",
                  chartreuse: "7fff00",
                  chocolate: "d2691e",
                  coral: "ff7f50",
                  cornflowerblue: "6495ed",
                  cornsilk: "fff8dc",
                  crimson: "dc143c",
                  cyan: "0ff",
                  darkblue: "00008b",
                  darkcyan: "008b8b",
                  darkgoldenrod: "b8860b",
                  darkgray: "a9a9a9",
                  darkgreen: "006400",
                  darkgrey: "a9a9a9",
                  darkkhaki: "bdb76b",
                  darkmagenta: "8b008b",
                  darkolivegreen: "556b2f",
                  darkorange: "ff8c00",
                  darkorchid: "9932cc",
                  darkred: "8b0000",
                  darksalmon: "e9967a",
                  darkseagreen: "8fbc8f",
                  darkslateblue: "483d8b",
                  darkslategray: "2f4f4f",
                  darkslategrey: "2f4f4f",
                  darkturquoise: "00ced1",
                  darkviolet: "9400d3",
                  deeppink: "ff1493",
                  deepskyblue: "00bfff",
                  dimgray: "696969",
                  dimgrey: "696969",
                  dodgerblue: "1e90ff",
                  firebrick: "b22222",
                  floralwhite: "fffaf0",
                  forestgreen: "228b22",
                  fuchsia: "f0f",
                  gainsboro: "dcdcdc",
                  ghostwhite: "f8f8ff",
                  gold: "ffd700",
                  goldenrod: "daa520",
                  gray: "808080",
                  green: "008000",
                  greenyellow: "adff2f",
                  grey: "808080",
                  honeydew: "f0fff0",
                  hotpink: "ff69b4",
                  indianred: "cd5c5c",
                  indigo: "4b0082",
                  ivory: "fffff0",
                  khaki: "f0e68c",
                  lavender: "e6e6fa",
                  lavenderblush: "fff0f5",
                  lawngreen: "7cfc00",
                  lemonchiffon: "fffacd",
                  lightblue: "add8e6",
                  lightcoral: "f08080",
                  lightcyan: "e0ffff",
                  lightgoldenrodyellow: "fafad2",
                  lightgray: "d3d3d3",
                  lightgreen: "90ee90",
                  lightgrey: "d3d3d3",
                  lightpink: "ffb6c1",
                  lightsalmon: "ffa07a",
                  lightseagreen: "20b2aa",
                  lightskyblue: "87cefa",
                  lightslategray: "789",
                  lightslategrey: "789",
                  lightsteelblue: "b0c4de",
                  lightyellow: "ffffe0",
                  lime: "0f0",
                  limegreen: "32cd32",
                  linen: "faf0e6",
                  magenta: "f0f",
                  maroon: "800000",
                  mediumaquamarine: "66cdaa",
                  mediumblue: "0000cd",
                  mediumorchid: "ba55d3",
                  mediumpurple: "9370db",
                  mediumseagreen: "3cb371",
                  mediumslateblue: "7b68ee",
                  mediumspringgreen: "00fa9a",
                  mediumturquoise: "48d1cc",
                  mediumvioletred: "c71585",
                  midnightblue: "191970",
                  mintcream: "f5fffa",
                  mistyrose: "ffe4e1",
                  moccasin: "ffe4b5",
                  navajowhite: "ffdead",
                  navy: "000080",
                  oldlace: "fdf5e6",
                  olive: "808000",
                  olivedrab: "6b8e23",
                  orange: "ffa500",
                  orangered: "ff4500",
                  orchid: "da70d6",
                  palegoldenrod: "eee8aa",
                  palegreen: "98fb98",
                  paleturquoise: "afeeee",
                  palevioletred: "db7093",
                  papayawhip: "ffefd5",
                  peachpuff: "ffdab9",
                  peru: "cd853f",
                  pink: "ffc0cb",
                  plum: "dda0dd",
                  powderblue: "b0e0e6",
                  purple: "800080",
                  rebeccapurple: "663399",
                  red: "f00",
                  rosybrown: "bc8f8f",
                  royalblue: "4169e1",
                  saddlebrown: "8b4513",
                  salmon: "fa8072",
                  sandybrown: "f4a460",
                  seagreen: "2e8b57",
                  seashell: "fff5ee",
                  sienna: "a0522d",
                  silver: "c0c0c0",
                  skyblue: "87ceeb",
                  slateblue: "6a5acd",
                  slategray: "708090",
                  slategrey: "708090",
                  snow: "fffafa",
                  springgreen: "00ff7f",
                  steelblue: "4682b4",
                  tan: "d2b48c",
                  teal: "008080",
                  thistle: "d8bfd8",
                  tomato: "ff6347",
                  turquoise: "40e0d0",
                  violet: "ee82ee",
                  wheat: "f5deb3",
                  white: "fff",
                  whitesmoke: "f5f5f5",
                  yellow: "ff0",
                  yellowgreen: "9acd32"
                }, U = w.hexNames = ne(X);
                function ne(V) {
                  var fe = {};
                  for (var $ in V)
                    V.hasOwnProperty($) && (fe[V[$]] = $);
                  return fe;
                }
                function se(V) {
                  return V = parseFloat(V), (isNaN(V) || V < 0 || V > 1) && (V = 1), V;
                }
                function le(V, fe) {
                  be(V) && (V = "100%");
                  var $ = Me(V);
                  return V = C(fe, m(0, parseFloat(V))), $ && (V = parseInt(V * fe, 10) / 100), v.abs(V - fe) < 1e-6 ? 1 : V % fe / parseFloat(fe);
                }
                function ue(V) {
                  return C(1, m(0, V));
                }
                function ve(V) {
                  return parseInt(V, 16);
                }
                function be(V) {
                  return typeof V == "string" && V.indexOf(".") != -1 && parseFloat(V) === 1;
                }
                function Me(V) {
                  return typeof V == "string" && V.indexOf("%") != -1;
                }
                function Ge(V) {
                  return V.length == 1 ? "0" + V : "" + V;
                }
                function we(V) {
                  return V <= 1 && (V = V * 100 + "%"), V;
                }
                function Re(V) {
                  return v.round(parseFloat(V) * 255).toString(16);
                }
                function Ae(V) {
                  return ve(V) / 255;
                }
                var K = function() {
                  var V = "[-\\+]?\\d+%?", fe = "[-\\+]?\\d*\\.\\d+%?", $ = "(?:" + fe + ")|(?:" + V + ")", he = "[\\s|\\(]+(" + $ + ")[,|\\s]+(" + $ + ")[,|\\s]+(" + $ + ")\\s*\\)?", me = "[\\s|\\(]+(" + $ + ")[,|\\s]+(" + $ + ")[,|\\s]+(" + $ + ")[,|\\s]+(" + $ + ")\\s*\\)?";
                  return {
                    CSS_UNIT: new RegExp($),
                    rgb: new RegExp("rgb" + he),
                    rgba: new RegExp("rgba" + me),
                    hsl: new RegExp("hsl" + he),
                    hsla: new RegExp("hsla" + me),
                    hsv: new RegExp("hsv" + he),
                    hsva: new RegExp("hsva" + me),
                    hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
                    hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
                    hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
                    hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
                  };
                }();
                function ee(V) {
                  return !!K.CSS_UNIT.exec(V);
                }
                function oe(V) {
                  V = V.replace(f, "").replace(p, "").toLowerCase();
                  var fe = !1;
                  if (X[V])
                    V = X[V], fe = !0;
                  else if (V == "transparent")
                    return { r: 0, g: 0, b: 0, a: 0, format: "name" };
                  var $;
                  return ($ = K.rgb.exec(V)) ? { r: $[1], g: $[2], b: $[3] } : ($ = K.rgba.exec(V)) ? { r: $[1], g: $[2], b: $[3], a: $[4] } : ($ = K.hsl.exec(V)) ? { h: $[1], s: $[2], l: $[3] } : ($ = K.hsla.exec(V)) ? { h: $[1], s: $[2], l: $[3], a: $[4] } : ($ = K.hsv.exec(V)) ? { h: $[1], s: $[2], v: $[3] } : ($ = K.hsva.exec(V)) ? { h: $[1], s: $[2], v: $[3], a: $[4] } : ($ = K.hex8.exec(V)) ? {
                    r: ve($[1]),
                    g: ve($[2]),
                    b: ve($[3]),
                    a: Ae($[4]),
                    format: fe ? "name" : "hex8"
                  } : ($ = K.hex6.exec(V)) ? {
                    r: ve($[1]),
                    g: ve($[2]),
                    b: ve($[3]),
                    format: fe ? "name" : "hex"
                  } : ($ = K.hex4.exec(V)) ? {
                    r: ve($[1] + "" + $[1]),
                    g: ve($[2] + "" + $[2]),
                    b: ve($[3] + "" + $[3]),
                    a: Ae($[4] + "" + $[4]),
                    format: fe ? "name" : "hex8"
                  } : ($ = K.hex3.exec(V)) ? {
                    r: ve($[1] + "" + $[1]),
                    g: ve($[2] + "" + $[2]),
                    b: ve($[3] + "" + $[3]),
                    format: fe ? "name" : "hex"
                  } : !1;
                }
                function _(V) {
                  var fe, $;
                  return V = V || { level: "AA", size: "small" }, fe = (V.level || "AA").toUpperCase(), $ = (V.size || "small").toLowerCase(), fe !== "AA" && fe !== "AAA" && (fe = "AA"), $ !== "small" && $ !== "large" && ($ = "small"), { level: fe, size: $ };
                }
                s.exports ? s.exports = w : (l = (function() {
                  return w;
                }).call(c, i, c, s), l !== void 0 && (s.exports = l));
              })(Math);
            }
          ),
          /***/
          7020: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896), f = l.instance();
              function p(x) {
                this.local = this.regionalOptions[x || ""] || this.regionalOptions[""];
              }
              p.prototype = new l.baseCalendar(), v(p.prototype, {
                /** The calendar name.
                    @memberof ChineseCalendar */
                name: "Chinese",
                /** Julian date of start of Gregorian epoch: 1 January 0001 CE.
                   @memberof GregorianCalendar */
                jdEpoch: 17214255e-1,
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof ChineseCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    This calendar uses month indices to account for intercalary months. 
                    @memberof ChineseCalendar */
                minMonth: 0,
                /** The first month in the year.
                    This calendar uses month indices to account for intercalary months. 
                    @memberof ChineseCalendar */
                firstMonth: 0,
                /** The minimum day number.
                    @memberof ChineseCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof ChineseCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Chinese",
                    epochs: ["BEC", "EC"],
                    monthNumbers: function(x, T) {
                      if (typeof x == "string") {
                        var F = x.match(y);
                        return F ? F[0] : "";
                      }
                      var P = this._validateYear(x), k = x.month(), I = "" + this.toChineseMonth(P, k);
                      return T && I.length < 2 && (I = "0" + I), this.isIntercalaryMonth(P, k) && (I += "i"), I;
                    },
                    monthNames: function(x) {
                      if (typeof x == "string") {
                        var T = x.match(C);
                        return T ? T[0] : "";
                      }
                      var F = this._validateYear(x), P = x.month(), k = this.toChineseMonth(F, P), I = [
                        "一月",
                        "二月",
                        "三月",
                        "四月",
                        "五月",
                        "六月",
                        "七月",
                        "八月",
                        "九月",
                        "十月",
                        "十一月",
                        "十二月"
                      ][k - 1];
                      return this.isIntercalaryMonth(F, P) && (I = "闰" + I), I;
                    },
                    monthNamesShort: function(x) {
                      if (typeof x == "string") {
                        var T = x.match(m);
                        return T ? T[0] : "";
                      }
                      var F = this._validateYear(x), P = x.month(), k = this.toChineseMonth(F, P), I = [
                        "一",
                        "二",
                        "三",
                        "四",
                        "五",
                        "六",
                        "七",
                        "八",
                        "九",
                        "十",
                        "十一",
                        "十二"
                      ][k - 1];
                      return this.isIntercalaryMonth(F, P) && (I = "闰" + I), I;
                    },
                    parseMonth: function(x, T) {
                      x = this._validateYear(x);
                      var F = parseInt(T), P;
                      if (isNaN(F))
                        T[0] === "闰" && (P = !0, T = T.substring(1)), T[T.length - 1] === "月" && (T = T.substring(0, T.length - 1)), F = 1 + [
                          "一",
                          "二",
                          "三",
                          "四",
                          "五",
                          "六",
                          "七",
                          "八",
                          "九",
                          "十",
                          "十一",
                          "十二"
                        ].indexOf(T);
                      else {
                        var k = T[T.length - 1];
                        P = k === "i" || k === "I";
                      }
                      var I = this.toMonthIndex(x, F, P);
                      return I;
                    },
                    dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                    dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                    dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
                    digits: null,
                    dateFormat: "yyyy/mm/dd",
                    firstDay: 1,
                    isRTL: !1
                  }
                },
                /** Check that a candidate date is from the same calendar and is valid.
                    @memberof BaseCalendar
                    @private
                    @param year {CDate|number} The date or the year to validate.
                    @param error {string} Error message if invalid.
                    @return {number} The year.
                    @throws Error if year out of range. */
                _validateYear: function(x, T) {
                  if (x.year && (x = x.year()), typeof x != "number" || x < 1888 || x > 2111)
                    throw T.replace(/\{0\}/, this.local.name);
                  return x;
                },
                /** Retrieve the month index (i.e. accounting for intercalary months).
                    @memberof ChineseCalendar
                    @param year {number} The year.
                    @param month {number} The month (1 for first month).
                    @param [isIntercalary=false] {boolean} If month is intercalary.
                    @return {number} The month index (0 for first month).
                    @throws Error if an invalid month/year or a different calendar used. */
                toMonthIndex: function(x, T, F) {
                  var P = this.intercalaryMonth(x), k = F && T !== P;
                  if (k || T < 1 || T > 12)
                    throw l.local.invalidMonth.replace(/\{0\}/, this.local.name);
                  var I;
                  return P ? !F && T <= P ? I = T - 1 : I = T : I = T - 1, I;
                },
                /** Retrieve the month (i.e. accounting for intercalary months).
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date or the year to examine.
                    @param monthIndex {number} The month index (0 for first month).
                    @return {number} The month (1 for first month).
                    @throws Error if an invalid month/year or a different calendar used. */
                toChineseMonth: function(x, T) {
                  x.year && (x = x.year(), T = x.month());
                  var F = this.intercalaryMonth(x), P = F ? 12 : 11;
                  if (T < 0 || T > P)
                    throw l.local.invalidMonth.replace(/\{0\}/, this.local.name);
                  var k;
                  return F ? T < F ? k = T + 1 : k = T : k = T + 1, k;
                },
                /** Determine the intercalary month of a year (if any).
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The intercalary month number, or 0 if none.
                    @throws Error if an invalid year or a different calendar used. */
                intercalaryMonth: function(x) {
                  x = this._validateYear(x);
                  var T = h[x - h[0]], F = T >> 13;
                  return F;
                },
                /** Determine whether this date is an intercalary month.
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [monthIndex] {number} The month index to examine.
                    @return {boolean} <code>true</code> if this is an intercalary month, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                isIntercalaryMonth: function(x, T) {
                  x.year && (x = x.year(), T = x.month());
                  var F = this.intercalaryMonth(x);
                  return !!F && F === T;
                },
                /** Determine whether this date is in a leap year.
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(x) {
                  return this.intercalaryMonth(x) !== 0;
                },
                /** Determine the week of the year for a date - ISO 8601.
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [monthIndex] {number} The month index to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(x, T, F) {
                  var P = this._validateYear(x, l.local.invalidyear), k = w[P - w[0]], I = k >> 9 & 4095, L = k >> 5 & 15, A = k & 31, O;
                  O = f.newDate(I, L, A), O.add(4 - (O.dayOfWeek() || 7), "d");
                  var N = this.toJD(x, T, F) - O.toJD();
                  return 1 + Math.floor(N / 7);
                },
                /** Retrieve the number of months in a year.
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of months.
                    @throws Error if an invalid year or a different calendar used. */
                monthsInYear: function(x) {
                  return this.leapYear(x) ? 13 : 12;
                },
                /** Retrieve the number of days in a month.
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [monthIndex] {number} The month index.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(x, T) {
                  x.year && (T = x.month(), x = x.year()), x = this._validateYear(x);
                  var F = h[x - h[0]], P = F >> 13, k = P ? 12 : 11;
                  if (T > k)
                    throw l.local.invalidMonth.replace(/\{0\}/, this.local.name);
                  var I = F & 1 << 12 - T ? 30 : 29;
                  return I;
                },
                /** Determine whether this date is a week day.
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [monthIndex] {number} The month index to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(x, T, F) {
                  return (this.dayOfWeek(x, T, F) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof ChineseCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [monthIndex] {number} The month index to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(x, T, F) {
                  var P = this._validate(x, I, F, l.local.invalidDate);
                  x = this._validateYear(P.year()), T = P.month(), F = P.day();
                  var k = this.isIntercalaryMonth(x, T), I = this.toChineseMonth(x, T), L = E(x, I, F, k);
                  return f.toJD(L.year, L.month, L.day);
                },
                /** Create a new date from a Julian date.
                    @memberof ChineseCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(x) {
                  var T = f.fromJD(x), F = S(T.year(), T.month(), T.day()), P = this.toMonthIndex(
                    F.year,
                    F.month,
                    F.isIntercalary
                  );
                  return this.newDate(F.year, P, F.day);
                },
                /** Create a new date from a string.
                    @memberof ChineseCalendar
                    @param dateString {string} String representing a Chinese date
                    @return {CDate} The new date.
                    @throws Error if an invalid date. */
                fromString: function(x) {
                  var T = x.match(g), F = this._validateYear(+T[1]), P = +T[2], k = !!T[3], I = this.toMonthIndex(F, P, k), L = +T[4];
                  return this.newDate(F, I, L);
                },
                /** Add period(s) to a date.
                    Cater for no year zero.
                    @memberof ChineseCalendar
                    @param date {CDate} The starting date.
                    @param offset {number} The number of periods to adjust by.
                    @param period {string} One of 'y' for year, 'm' for month, 'w' for week, 'd' for day.
                    @return {CDate} The updated date.
                    @throws Error if a different calendar used. */
                add: function(x, T, F) {
                  var P = x.year(), k = x.month(), I = this.isIntercalaryMonth(P, k), L = this.toChineseMonth(P, k), A = Object.getPrototypeOf(p.prototype).add.call(this, x, T, F);
                  if (F === "y") {
                    var O = A.year(), N = A.month(), Y = this.isIntercalaryMonth(O, L), j = I && Y ? this.toMonthIndex(O, L, !0) : this.toMonthIndex(O, L, !1);
                    j !== N && A.month(j);
                  }
                  return A;
                }
              });
              var g = /^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m, y = /^\d?\d[iI]?/m, C = /^闰?十?[一二三四五六七八九]?月/m, m = /^闰?十?[一二三四五六七八九]?/m;
              l.calendars.chinese = p;
              var h = [
                1887,
                5780,
                5802,
                19157,
                2742,
                50359,
                1198,
                2646,
                46378,
                7466,
                3412,
                30122,
                5482,
                67949,
                2396,
                5294,
                43597,
                6732,
                6954,
                36181,
                2772,
                4954,
                18781,
                2396,
                54427,
                5274,
                6730,
                47781,
                5800,
                6868,
                21210,
                4790,
                59703,
                2350,
                5270,
                46667,
                3402,
                3496,
                38325,
                1388,
                4782,
                18735,
                2350,
                52374,
                6804,
                7498,
                44457,
                2906,
                1388,
                29294,
                4700,
                63789,
                6442,
                6804,
                56138,
                5802,
                2772,
                38235,
                1210,
                4698,
                22827,
                5418,
                63125,
                3476,
                5802,
                43701,
                2484,
                5302,
                27223,
                2646,
                70954,
                7466,
                3412,
                54698,
                5482,
                2412,
                38062,
                5294,
                2636,
                32038,
                6954,
                60245,
                2772,
                4826,
                43357,
                2394,
                5274,
                39501,
                6730,
                72357,
                5800,
                5844,
                53978,
                4790,
                2358,
                38039,
                5270,
                87627,
                3402,
                3496,
                54708,
                5484,
                4782,
                43311,
                2350,
                3222,
                27978,
                7498,
                68965,
                2904,
                5484,
                45677,
                4700,
                6444,
                39573,
                6804,
                6986,
                19285,
                2772,
                62811,
                1210,
                4698,
                47403,
                5418,
                5780,
                38570,
                5546,
                76469,
                2420,
                5302,
                51799,
                2646,
                5414,
                36501,
                3412,
                5546,
                18869,
                2412,
                54446,
                5276,
                6732,
                48422,
                6822,
                2900,
                28010,
                4826,
                92509,
                2394,
                5274,
                55883,
                6730,
                6820,
                47956,
                5812,
                2778,
                18779,
                2358,
                62615,
                5270,
                5450,
                46757,
                3492,
                5556,
                27318,
                4718,
                67887,
                2350,
                3222,
                52554,
                7498,
                3428,
                38252,
                5468,
                4700,
                31022,
                6444,
                64149,
                6804,
                6986,
                43861,
                2772,
                5338,
                35421,
                2650,
                70955,
                5418,
                5780,
                54954,
                5546,
                2740,
                38074,
                5302,
                2646,
                29991,
                3366,
                61011,
                3412,
                5546,
                43445,
                2412,
                5294,
                35406,
                6732,
                72998,
                6820,
                6996,
                52586,
                2778,
                2396,
                38045,
                5274,
                6698,
                23333,
                6820,
                64338,
                5812,
                2746,
                43355,
                2358,
                5270,
                39499,
                5450,
                79525,
                3492,
                5548
              ], w = [
                1887,
                966732,
                967231,
                967733,
                968265,
                968766,
                969297,
                969798,
                970298,
                970829,
                971330,
                971830,
                972362,
                972863,
                973395,
                973896,
                974397,
                974928,
                975428,
                975929,
                976461,
                976962,
                977462,
                977994,
                978494,
                979026,
                979526,
                980026,
                980558,
                981059,
                981559,
                982091,
                982593,
                983124,
                983624,
                984124,
                984656,
                985157,
                985656,
                986189,
                986690,
                987191,
                987722,
                988222,
                988753,
                989254,
                989754,
                990286,
                990788,
                991288,
                991819,
                992319,
                992851,
                993352,
                993851,
                994383,
                994885,
                995385,
                995917,
                996418,
                996918,
                997450,
                997949,
                998481,
                998982,
                999483,
                1000014,
                1000515,
                1001016,
                1001548,
                1002047,
                1002578,
                1003080,
                1003580,
                1004111,
                1004613,
                1005113,
                1005645,
                1006146,
                1006645,
                1007177,
                1007678,
                1008209,
                1008710,
                1009211,
                1009743,
                1010243,
                1010743,
                1011275,
                1011775,
                1012306,
                1012807,
                1013308,
                1013840,
                1014341,
                1014841,
                1015373,
                1015874,
                1016404,
                1016905,
                1017405,
                1017937,
                1018438,
                1018939,
                1019471,
                1019972,
                1020471,
                1021002,
                1021503,
                1022035,
                1022535,
                1023036,
                1023568,
                1024069,
                1024568,
                1025100,
                1025601,
                1026102,
                1026633,
                1027133,
                1027666,
                1028167,
                1028666,
                1029198,
                1029699,
                1030199,
                1030730,
                1031231,
                1031763,
                1032264,
                1032764,
                1033296,
                1033797,
                1034297,
                1034828,
                1035329,
                1035830,
                1036362,
                1036861,
                1037393,
                1037894,
                1038394,
                1038925,
                1039427,
                1039927,
                1040459,
                1040959,
                1041491,
                1041992,
                1042492,
                1043023,
                1043524,
                1044024,
                1044556,
                1045057,
                1045558,
                1046090,
                1046590,
                1047121,
                1047622,
                1048122,
                1048654,
                1049154,
                1049655,
                1050187,
                1050689,
                1051219,
                1051720,
                1052220,
                1052751,
                1053252,
                1053752,
                1054284,
                1054786,
                1055285,
                1055817,
                1056317,
                1056849,
                1057349,
                1057850,
                1058382,
                1058883,
                1059383,
                1059915,
                1060415,
                1060947,
                1061447,
                1061947,
                1062479,
                1062981,
                1063480,
                1064012,
                1064514,
                1065014,
                1065545,
                1066045,
                1066577,
                1067078,
                1067578,
                1068110,
                1068611,
                1069112,
                1069642,
                1070142,
                1070674,
                1071175,
                1071675,
                1072207,
                1072709,
                1073209,
                1073740,
                1074241,
                1074741,
                1075273,
                1075773,
                1076305,
                1076807,
                1077308,
                1077839,
                1078340,
                1078840,
                1079372,
                1079871,
                1080403,
                1080904
              ];
              function S(x, T, F, P) {
                var k, I;
                if (typeof x == "object")
                  k = x, I = T || {};
                else {
                  var L = typeof x == "number" && x >= 1888 && x <= 2111;
                  if (!L)
                    throw new Error("Solar year outside range 1888-2111");
                  var A = typeof T == "number" && T >= 1 && T <= 12;
                  if (!A)
                    throw new Error("Solar month outside range 1 - 12");
                  var O = typeof F == "number" && F >= 1 && F <= 31;
                  if (!O)
                    throw new Error("Solar day outside range 1 - 31");
                  k = {
                    year: x,
                    month: T,
                    day: F
                  }, I = {};
                }
                var N = w[k.year - w[0]], Y = k.year << 9 | k.month << 5 | k.day;
                I.year = Y >= N ? k.year : k.year - 1, N = w[I.year - w[0]];
                var j = N >> 9 & 4095, te = N >> 5 & 15, re = N & 31, z, Z = new Date(j, te - 1, re), W = new Date(k.year, k.month - 1, k.day);
                z = Math.round(
                  (W - Z) / 864e5
                );
                var q = h[I.year - h[0]], ie;
                for (ie = 0; ie < 13; ie++) {
                  var ce = q & 1 << 12 - ie ? 30 : 29;
                  if (z < ce)
                    break;
                  z -= ce;
                }
                var X = q >> 13;
                return !X || ie < X ? (I.isIntercalary = !1, I.month = 1 + ie) : ie === X ? (I.isIntercalary = !0, I.month = ie) : (I.isIntercalary = !1, I.month = ie), I.day = 1 + z, I;
              }
              function E(x, T, F, P, k) {
                var I, L;
                if (typeof x == "object")
                  L = x, I = T || {};
                else {
                  var A = typeof x == "number" && x >= 1888 && x <= 2111;
                  if (!A)
                    throw new Error("Lunar year outside range 1888-2111");
                  var O = typeof T == "number" && T >= 1 && T <= 12;
                  if (!O)
                    throw new Error("Lunar month outside range 1 - 12");
                  var N = typeof F == "number" && F >= 1 && F <= 30;
                  if (!N)
                    throw new Error("Lunar day outside range 1 - 30");
                  var Y;
                  typeof P == "object" ? (Y = !1, I = P) : (Y = !!P, I = {}), L = {
                    year: x,
                    month: T,
                    day: F,
                    isIntercalary: Y
                  };
                }
                var j;
                j = L.day - 1;
                var te = h[L.year - h[0]], re = te >> 13, z;
                re && (L.month > re || L.isIntercalary) ? z = L.month : z = L.month - 1;
                for (var Z = 0; Z < z; Z++) {
                  var W = te & 1 << 12 - Z ? 30 : 29;
                  j += W;
                }
                var q = w[L.year - w[0]], ie = q >> 9 & 4095, ce = q >> 5 & 15, X = q & 31, U = new Date(ie, ce - 1, X + j);
                return I.year = U.getFullYear(), I.month = 1 + U.getMonth(), I.day = U.getDate(), I;
              }
            }
          ),
          /***/
          7411: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(p) {
                this.local = this.regionalOptions[p || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof CopticCalendar */
                name: "Coptic",
                /** Julian date of start of Coptic epoch: 29 August 284 CE (Gregorian).
                    @memberof CopticCalendar */
                jdEpoch: 18250295e-1,
                /** Days per month in a common year.
                    @memberof CopticCalendar */
                daysPerMonth: [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 5],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof CopticCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof CopticCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof CopticCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof CopticCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof CopticCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Coptic",
                    epochs: ["BAM", "AM"],
                    monthNames: [
                      "Thout",
                      "Paopi",
                      "Hathor",
                      "Koiak",
                      "Tobi",
                      "Meshir",
                      "Paremhat",
                      "Paremoude",
                      "Pashons",
                      "Paoni",
                      "Epip",
                      "Mesori",
                      "Pi Kogi Enavot"
                    ],
                    monthNamesShort: [
                      "Tho",
                      "Pao",
                      "Hath",
                      "Koi",
                      "Tob",
                      "Mesh",
                      "Pat",
                      "Pad",
                      "Pash",
                      "Pao",
                      "Epi",
                      "Meso",
                      "PiK"
                    ],
                    dayNames: ["Tkyriaka", "Pesnau", "Pshoment", "Peftoou", "Ptiou", "Psoou", "Psabbaton"],
                    dayNamesShort: ["Tky", "Pes", "Psh", "Pef", "Pti", "Pso", "Psa"],
                    dayNamesMin: ["Tk", "Pes", "Psh", "Pef", "Pt", "Pso", "Psa"],
                    digits: null,
                    dateFormat: "dd/mm/yyyy",
                    firstDay: 0,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof CopticCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(y) {
                  var g = this._validate(y, this.minMonth, this.minDay, l.local.invalidYear), y = g.year() + (g.year() < 0 ? 1 : 0);
                  return y % 4 === 3 || y % 4 === -1;
                },
                /** Retrieve the number of months in a year.
                    @memberof CopticCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of months.
                    @throws Error if an invalid year or a different calendar used. */
                monthsInYear: function(p) {
                  return this._validate(
                    p,
                    this.minMonth,
                    this.minDay,
                    l.local.invalidYear || l.regionalOptions[""].invalidYear
                  ), 13;
                },
                /** Determine the week of the year for a date.
                    @memberof CopticCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number) the month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(p, g, y) {
                  var C = this.newDate(p, g, y);
                  return C.add(-C.dayOfWeek(), "d"), Math.floor((C.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a month.
                    @memberof CopticCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(p, g) {
                  var y = this._validate(p, g, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[y.month() - 1] + (y.month() === 13 && this.leapYear(y.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof CopticCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param month {number} The month to examine.
                    @param day {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(p, g, y) {
                  return (this.dayOfWeek(p, g, y) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof CopticCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number) the month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(p, g, y) {
                  var C = this._validate(p, g, y, l.local.invalidDate);
                  return p = C.year(), p < 0 && p++, C.day() + (C.month() - 1) * 30 + (p - 1) * 365 + Math.floor(p / 4) + this.jdEpoch - 1;
                },
                /** Create a new date from a Julian date.
                    @memberof CopticCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(p) {
                  var g = Math.floor(p) + 0.5 - this.jdEpoch, y = Math.floor((g - Math.floor((g + 366) / 1461)) / 365) + 1;
                  y <= 0 && y--, g = Math.floor(p) + 0.5 - this.newDate(y, 1, 1).toJD();
                  var C = Math.floor(g / 30) + 1, m = g - (C - 1) * 30 + 1;
                  return this.newDate(y, C, m);
                }
              }), l.calendars.coptic = f;
            }
          ),
          /***/
          5668: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(g) {
                this.local = this.regionalOptions[g || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof DiscworldCalendar */
                name: "Discworld",
                /** Julian date of start of Discworld epoch: 1 January 0001 CE.
                    @memberof DiscworldCalendar */
                jdEpoch: 17214255e-1,
                /** Days per month in a common year.
                    @memberof DiscworldCalendar */
                daysPerMonth: [16, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof DiscworldCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof DiscworldCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof DiscworldCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof DiscworldCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof DiscworldCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Discworld",
                    epochs: ["BUC", "UC"],
                    monthNames: [
                      "Ick",
                      "Offle",
                      "February",
                      "March",
                      "April",
                      "May",
                      "June",
                      "Grune",
                      "August",
                      "Spune",
                      "Sektober",
                      "Ember",
                      "December"
                    ],
                    monthNamesShort: ["Ick", "Off", "Feb", "Mar", "Apr", "May", "Jun", "Gru", "Aug", "Spu", "Sek", "Emb", "Dec"],
                    dayNames: ["Sunday", "Octeday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                    dayNamesShort: ["Sun", "Oct", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                    dayNamesMin: ["Su", "Oc", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
                    digits: null,
                    dateFormat: "yyyy/mm/dd",
                    firstDay: 2,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(g) {
                  return this._validate(g, this.minMonth, this.minDay, l.local.invalidYear), !1;
                },
                /** Retrieve the number of months in a year.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of months.
                    @throws Error if an invalid year or a different calendar used. */
                monthsInYear: function(g) {
                  return this._validate(g, this.minMonth, this.minDay, l.local.invalidYear), 13;
                },
                /** Retrieve the number of days in a year.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of days.
                    @throws Error if an invalid year or a different calendar used. */
                daysInYear: function(g) {
                  return this._validate(g, this.minMonth, this.minDay, l.local.invalidYear), 400;
                },
                /** Determine the week of the year for a date.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(g, y, C) {
                  var m = this.newDate(g, y, C);
                  return m.add(-m.dayOfWeek(), "d"), Math.floor((m.dayOfYear() - 1) / 8) + 1;
                },
                /** Retrieve the number of days in a month.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(g, y) {
                  var C = this._validate(g, y, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[C.month() - 1];
                },
                /** Retrieve the number of days in a week.
                    @memberof DiscworldCalendar
                    @return {number} The number of days. */
                daysInWeek: function() {
                  return 8;
                },
                /** Retrieve the day of the week for a date.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The day of the week: 0 to number of days - 1.
                    @throws Error if an invalid date or a different calendar used. */
                dayOfWeek: function(g, y, C) {
                  var m = this._validate(g, y, C, l.local.invalidDate);
                  return (m.day() + 1) % 8;
                },
                /** Determine whether this date is a week day.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(g, y, C) {
                  var m = this.dayOfWeek(g, y, C);
                  return m >= 2 && m <= 6;
                },
                /** Retrieve additional information about a date.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {object} Additional information - contents depends on calendar.
                    @throws Error if an invalid date or a different calendar used. */
                extraInfo: function(g, y, C) {
                  var m = this._validate(g, y, C, l.local.invalidDate);
                  return { century: p[Math.floor((m.year() - 1) / 100) + 1] || "" };
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof DiscworldCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(g, y, C) {
                  var m = this._validate(g, y, C, l.local.invalidDate);
                  return g = m.year() + (m.year() < 0 ? 1 : 0), y = m.month(), C = m.day(), C + (y > 1 ? 16 : 0) + (y > 2 ? (y - 2) * 32 : 0) + (g - 1) * 400 + this.jdEpoch - 1;
                },
                /** Create a new date from a Julian date.
                    @memberof DiscworldCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(g) {
                  g = Math.floor(g + 0.5) - Math.floor(this.jdEpoch) - 1;
                  var y = Math.floor(g / 400) + 1;
                  g -= (y - 1) * 400, g += g > 15 ? 16 : 0;
                  var C = Math.floor(g / 32) + 1, m = g - (C - 1) * 32 + 1;
                  return this.newDate(y <= 0 ? y - 1 : y, C, m);
                }
              });
              var p = {
                20: "Fruitbat",
                21: "Anchovy"
              };
              l.calendars.discworld = f;
            }
          ),
          /***/
          2787: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(p) {
                this.local = this.regionalOptions[p || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof EthiopianCalendar */
                name: "Ethiopian",
                /** Julian date of start of Ethiopian epoch: 27 August 8 CE (Gregorian).
                    @memberof EthiopianCalendar */
                jdEpoch: 17242205e-1,
                /** Days per month in a common year.
                    @memberof EthiopianCalendar */
                daysPerMonth: [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 5],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof EthiopianCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof EthiopianCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof EthiopianCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof EthiopianCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof EthiopianCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Ethiopian",
                    epochs: ["BEE", "EE"],
                    monthNames: [
                      "Meskerem",
                      "Tikemet",
                      "Hidar",
                      "Tahesas",
                      "Tir",
                      "Yekatit",
                      "Megabit",
                      "Miazia",
                      "Genbot",
                      "Sene",
                      "Hamle",
                      "Nehase",
                      "Pagume"
                    ],
                    monthNamesShort: [
                      "Mes",
                      "Tik",
                      "Hid",
                      "Tah",
                      "Tir",
                      "Yek",
                      "Meg",
                      "Mia",
                      "Gen",
                      "Sen",
                      "Ham",
                      "Neh",
                      "Pag"
                    ],
                    dayNames: ["Ehud", "Segno", "Maksegno", "Irob", "Hamus", "Arb", "Kidame"],
                    dayNamesShort: ["Ehu", "Seg", "Mak", "Iro", "Ham", "Arb", "Kid"],
                    dayNamesMin: ["Eh", "Se", "Ma", "Ir", "Ha", "Ar", "Ki"],
                    digits: null,
                    dateFormat: "dd/mm/yyyy",
                    firstDay: 0,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof EthiopianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(y) {
                  var g = this._validate(y, this.minMonth, this.minDay, l.local.invalidYear), y = g.year() + (g.year() < 0 ? 1 : 0);
                  return y % 4 === 3 || y % 4 === -1;
                },
                /** Retrieve the number of months in a year.
                    @memberof EthiopianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of months.
                    @throws Error if an invalid year or a different calendar used. */
                monthsInYear: function(p) {
                  return this._validate(
                    p,
                    this.minMonth,
                    this.minDay,
                    l.local.invalidYear || l.regionalOptions[""].invalidYear
                  ), 13;
                },
                /** Determine the week of the year for a date.
                    @memberof EthiopianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(p, g, y) {
                  var C = this.newDate(p, g, y);
                  return C.add(-C.dayOfWeek(), "d"), Math.floor((C.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a month.
                    @memberof EthiopianCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(p, g) {
                  var y = this._validate(p, g, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[y.month() - 1] + (y.month() === 13 && this.leapYear(y.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof EthiopianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(p, g, y) {
                  return (this.dayOfWeek(p, g, y) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof EthiopianCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(p, g, y) {
                  var C = this._validate(p, g, y, l.local.invalidDate);
                  return p = C.year(), p < 0 && p++, C.day() + (C.month() - 1) * 30 + (p - 1) * 365 + Math.floor(p / 4) + this.jdEpoch - 1;
                },
                /** Create a new date from a Julian date.
                    @memberof EthiopianCalendar
                    @param jd {number} the Julian date to convert.
                    @return {CDate} the equivalent date. */
                fromJD: function(p) {
                  var g = Math.floor(p) + 0.5 - this.jdEpoch, y = Math.floor((g - Math.floor((g + 366) / 1461)) / 365) + 1;
                  y <= 0 && y--, g = Math.floor(p) + 0.5 - this.newDate(y, 1, 1).toJD();
                  var C = Math.floor(g / 30) + 1, m = g - (C - 1) * 30 + 1;
                  return this.newDate(y, C, m);
                }
              }), l.calendars.ethiopian = f;
            }
          ),
          /***/
          2084: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(g) {
                this.local = this.regionalOptions[g || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof HebrewCalendar */
                name: "Hebrew",
                /** Julian date of start of Hebrew epoch: 7 October 3761 BCE.
                    @memberof HebrewCalendar */
                jdEpoch: 347995.5,
                /** Days per month in a common year.
                    @memberof HebrewCalendar */
                daysPerMonth: [30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 29],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof HebrewCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof HebrewCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof HebrewCalendar */
                firstMonth: 7,
                /** The minimum day number.
                    @memberof HebrewCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof HebrewCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Hebrew",
                    epochs: ["BAM", "AM"],
                    monthNames: [
                      "Nisan",
                      "Iyar",
                      "Sivan",
                      "Tammuz",
                      "Av",
                      "Elul",
                      "Tishrei",
                      "Cheshvan",
                      "Kislev",
                      "Tevet",
                      "Shevat",
                      "Adar",
                      "Adar II"
                    ],
                    monthNamesShort: ["Nis", "Iya", "Siv", "Tam", "Av", "Elu", "Tis", "Che", "Kis", "Tev", "She", "Ada", "Ad2"],
                    dayNames: ["Yom Rishon", "Yom Sheni", "Yom Shlishi", "Yom Revi'i", "Yom Chamishi", "Yom Shishi", "Yom Shabbat"],
                    dayNamesShort: ["Ris", "She", "Shl", "Rev", "Cha", "Shi", "Sha"],
                    dayNamesMin: ["Ri", "She", "Shl", "Re", "Ch", "Shi", "Sha"],
                    digits: null,
                    dateFormat: "dd/mm/yyyy",
                    firstDay: 0,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof HebrewCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(g) {
                  var y = this._validate(g, this.minMonth, this.minDay, l.local.invalidYear);
                  return this._leapYear(y.year());
                },
                /** Determine whether this date is in a leap year.
                    @memberof HebrewCalendar
                    @private
                    @param year {number} The year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                _leapYear: function(g) {
                  return g = g < 0 ? g + 1 : g, p(g * 7 + 1, 19) < 7;
                },
                /** Retrieve the number of months in a year.
                    @memberof HebrewCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of months.
                    @throws Error if an invalid year or a different calendar used. */
                monthsInYear: function(g) {
                  return this._validate(g, this.minMonth, this.minDay, l.local.invalidYear), this._leapYear(g.year ? g.year() : g) ? 13 : 12;
                },
                /** Determine the week of the year for a date.
                    @memberof HebrewCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(g, y, C) {
                  var m = this.newDate(g, y, C);
                  return m.add(-m.dayOfWeek(), "d"), Math.floor((m.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a year.
                    @memberof HebrewCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of days.
                    @throws Error if an invalid year or a different calendar used. */
                daysInYear: function(g) {
                  var y = this._validate(g, this.minMonth, this.minDay, l.local.invalidYear);
                  return g = y.year(), this.toJD(g === -1 ? 1 : g + 1, 7, 1) - this.toJD(g, 7, 1);
                },
                /** Retrieve the number of days in a month.
                    @memberof HebrewCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(g, y) {
                  return g.year && (y = g.month(), g = g.year()), this._validate(g, y, this.minDay, l.local.invalidMonth), y === 12 && this.leapYear(g) || // Adar I
                  y === 8 && p(this.daysInYear(g), 10) === 5 ? 30 : (
                    // Cheshvan in shlemah year
                    y === 9 && p(this.daysInYear(g), 10) === 3 ? 29 : (
                      // Kislev in chaserah year
                      this.daysPerMonth[y - 1]
                    )
                  );
                },
                /** Determine whether this date is a week day.
                    @memberof HebrewCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(g, y, C) {
                  return this.dayOfWeek(g, y, C) !== 6;
                },
                /** Retrieve additional information about a date - year type.
                    @memberof HebrewCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {object} Additional information - contents depends on calendar.
                    @throws Error if an invalid date or a different calendar used. */
                extraInfo: function(g, y, C) {
                  var m = this._validate(g, y, C, l.local.invalidDate);
                  return { yearType: (this.leapYear(m) ? "embolismic" : "common") + " " + ["deficient", "regular", "complete"][this.daysInYear(m) % 10 - 3] };
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof HebrewCalendar
                    @param year {CDate)|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(g, y, C) {
                  var m = this._validate(g, y, C, l.local.invalidDate);
                  g = m.year(), y = m.month(), C = m.day();
                  var h = g <= 0 ? g + 1 : g, w = this.jdEpoch + this._delay1(h) + this._delay2(h) + C + 1;
                  if (y < 7) {
                    for (var S = 7; S <= this.monthsInYear(g); S++)
                      w += this.daysInMonth(g, S);
                    for (var S = 1; S < y; S++)
                      w += this.daysInMonth(g, S);
                  } else
                    for (var S = 7; S < y; S++)
                      w += this.daysInMonth(g, S);
                  return w;
                },
                /** Test for delay of start of new year and to avoid
                    Sunday, Wednesday, or Friday as start of the new year.
                    @memberof HebrewCalendar
                    @private
                    @param year {number} The year to examine.
                    @return {number} The days to offset by. */
                _delay1: function(g) {
                  var y = Math.floor((235 * g - 234) / 19), C = 12084 + 13753 * y, m = y * 29 + Math.floor(C / 25920);
                  return p(3 * (m + 1), 7) < 3 && m++, m;
                },
                /** Check for delay in start of new year due to length of adjacent years.
                    @memberof HebrewCalendar
                    @private
                    @param year {number} The year to examine.
                    @return {number} The days to offset by. */
                _delay2: function(g) {
                  var y = this._delay1(g - 1), C = this._delay1(g), m = this._delay1(g + 1);
                  return m - C === 356 ? 2 : C - y === 382 ? 1 : 0;
                },
                /** Create a new date from a Julian date.
                    @memberof HebrewCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(g) {
                  g = Math.floor(g) + 0.5;
                  for (var y = Math.floor((g - this.jdEpoch) * 98496 / 35975351) - 1; g >= this.toJD(y === -1 ? 1 : y + 1, 7, 1); )
                    y++;
                  for (var C = g < this.toJD(y, 1, 1) ? 7 : 1; g > this.toJD(y, C, this.daysInMonth(y, C)); )
                    C++;
                  var m = g - this.toJD(y, C, 1) + 1;
                  return this.newDate(y, C, m);
                }
              });
              function p(g, y) {
                return g - y * Math.floor(g / y);
              }
              l.calendars.hebrew = f;
            }
          ),
          /***/
          6368: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(p) {
                this.local = this.regionalOptions[p || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof IslamicCalendar */
                name: "Islamic",
                /** Julian date of start of Islamic epoch: 16 July 622 CE.
                    @memberof IslamicCalendar */
                jdEpoch: 19484395e-1,
                /** Days per month in a common year.
                    @memberof IslamicCalendar */
                daysPerMonth: [30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof IslamicCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof IslamicCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof IslamicCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof IslamicCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof IslamicCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Islamic",
                    epochs: ["BH", "AH"],
                    monthNames: [
                      "Muharram",
                      "Safar",
                      "Rabi' al-awwal",
                      "Rabi' al-thani",
                      "Jumada al-awwal",
                      "Jumada al-thani",
                      "Rajab",
                      "Sha'aban",
                      "Ramadan",
                      "Shawwal",
                      "Dhu al-Qi'dah",
                      "Dhu al-Hijjah"
                    ],
                    monthNamesShort: ["Muh", "Saf", "Rab1", "Rab2", "Jum1", "Jum2", "Raj", "Sha'", "Ram", "Shaw", "DhuQ", "DhuH"],
                    dayNames: [
                      "Yawm al-ahad",
                      "Yawm al-ithnayn",
                      "Yawm ath-thulaathaa'",
                      "Yawm al-arbi'aa'",
                      "Yawm al-khamīs",
                      "Yawm al-jum'a",
                      "Yawm as-sabt"
                    ],
                    dayNamesShort: ["Aha", "Ith", "Thu", "Arb", "Kha", "Jum", "Sab"],
                    dayNamesMin: ["Ah", "It", "Th", "Ar", "Kh", "Ju", "Sa"],
                    digits: null,
                    dateFormat: "yyyy/mm/dd",
                    firstDay: 6,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof IslamicCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(p) {
                  var g = this._validate(p, this.minMonth, this.minDay, l.local.invalidYear);
                  return (g.year() * 11 + 14) % 30 < 11;
                },
                /** Determine the week of the year for a date.
                    @memberof IslamicCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(p, g, y) {
                  var C = this.newDate(p, g, y);
                  return C.add(-C.dayOfWeek(), "d"), Math.floor((C.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a year.
                    @memberof IslamicCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of days.
                    @throws Error if an invalid year or a different calendar used. */
                daysInYear: function(p) {
                  return this.leapYear(p) ? 355 : 354;
                },
                /** Retrieve the number of days in a month.
                    @memberof IslamicCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(p, g) {
                  var y = this._validate(p, g, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[y.month() - 1] + (y.month() === 12 && this.leapYear(y.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof IslamicCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(p, g, y) {
                  return this.dayOfWeek(p, g, y) !== 5;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof IslamicCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(p, g, y) {
                  var C = this._validate(p, g, y, l.local.invalidDate);
                  return p = C.year(), g = C.month(), y = C.day(), p = p <= 0 ? p + 1 : p, y + Math.ceil(29.5 * (g - 1)) + (p - 1) * 354 + Math.floor((3 + 11 * p) / 30) + this.jdEpoch - 1;
                },
                /** Create a new date from a Julian date.
                    @memberof IslamicCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(p) {
                  p = Math.floor(p) + 0.5;
                  var g = Math.floor((30 * (p - this.jdEpoch) + 10646) / 10631);
                  g = g <= 0 ? g - 1 : g;
                  var y = Math.min(12, Math.ceil((p - 29 - this.toJD(g, 1, 1)) / 29.5) + 1), C = p - this.toJD(g, y, 1) + 1;
                  return this.newDate(g, y, C);
                }
              }), l.calendars.islamic = f;
            }
          ),
          /***/
          4747: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(p) {
                this.local = this.regionalOptions[p || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof JulianCalendar */
                name: "Julian",
                /** Julian date of start of Julian epoch: 1 January 0001 AD = 30 December 0001 BCE.
                    @memberof JulianCalendar */
                jdEpoch: 17214235e-1,
                /** Days per month in a common year.
                    @memberof JulianCalendar */
                daysPerMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof JulianCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof JulianCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof JulianCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof JulianCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof JulianCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Julian",
                    epochs: ["BC", "AD"],
                    monthNames: [
                      "January",
                      "February",
                      "March",
                      "April",
                      "May",
                      "June",
                      "July",
                      "August",
                      "September",
                      "October",
                      "November",
                      "December"
                    ],
                    monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
                    dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                    dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                    dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
                    digits: null,
                    dateFormat: "mm/dd/yyyy",
                    firstDay: 0,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof JulianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(y) {
                  var g = this._validate(y, this.minMonth, this.minDay, l.local.invalidYear), y = g.year() < 0 ? g.year() + 1 : g.year();
                  return y % 4 === 0;
                },
                /** Determine the week of the year for a date - ISO 8601.
                    @memberof JulianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(p, g, y) {
                  var C = this.newDate(p, g, y);
                  return C.add(4 - (C.dayOfWeek() || 7), "d"), Math.floor((C.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a month.
                    @memberof JulianCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(p, g) {
                  var y = this._validate(p, g, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[y.month() - 1] + (y.month() === 2 && this.leapYear(y.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof JulianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} True if a week day, false if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(p, g, y) {
                  return (this.dayOfWeek(p, g, y) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof JulianCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(p, g, y) {
                  var C = this._validate(p, g, y, l.local.invalidDate);
                  return p = C.year(), g = C.month(), y = C.day(), p < 0 && p++, g <= 2 && (p--, g += 12), Math.floor(365.25 * (p + 4716)) + Math.floor(30.6001 * (g + 1)) + y - 1524.5;
                },
                /** Create a new date from a Julian date.
                    @memberof JulianCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(p) {
                  var g = Math.floor(p + 0.5), y = g + 1524, C = Math.floor((y - 122.1) / 365.25), m = Math.floor(365.25 * C), h = Math.floor((y - m) / 30.6001), w = h - Math.floor(h < 14 ? 1 : 13), S = C - Math.floor(w > 2 ? 4716 : 4715), E = y - m - Math.floor(30.6001 * h);
                  return S <= 0 && S--, this.newDate(S, w, E);
                }
              }), l.calendars.julian = f;
            }
          ),
          /***/
          5616: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(y) {
                this.local = this.regionalOptions[y || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof MayanCalendar */
                name: "Mayan",
                /** Julian date of start of Mayan epoch: 11 August 3114 BCE.
                    @memberof MayanCalendar */
                jdEpoch: 584282.5,
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof MayanCalendar */
                hasYearZero: !0,
                /** The minimum month number.
                    @memberof MayanCalendar */
                minMonth: 0,
                /** The first month in the year.
                    @memberof MayanCalendar */
                firstMonth: 0,
                /** The minimum day number.
                    @memberof MayanCalendar */
                minDay: 0,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof MayanCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left.
                    @property haabMonths {string[]} The names of the Haab months.
                    @property tzolkinMonths {string[]} The names of the Tzolkin months. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Mayan",
                    epochs: ["", ""],
                    monthNames: [
                      "0",
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7",
                      "8",
                      "9",
                      "10",
                      "11",
                      "12",
                      "13",
                      "14",
                      "15",
                      "16",
                      "17"
                    ],
                    monthNamesShort: [
                      "0",
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7",
                      "8",
                      "9",
                      "10",
                      "11",
                      "12",
                      "13",
                      "14",
                      "15",
                      "16",
                      "17"
                    ],
                    dayNames: [
                      "0",
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7",
                      "8",
                      "9",
                      "10",
                      "11",
                      "12",
                      "13",
                      "14",
                      "15",
                      "16",
                      "17",
                      "18",
                      "19"
                    ],
                    dayNamesShort: [
                      "0",
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7",
                      "8",
                      "9",
                      "10",
                      "11",
                      "12",
                      "13",
                      "14",
                      "15",
                      "16",
                      "17",
                      "18",
                      "19"
                    ],
                    dayNamesMin: [
                      "0",
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7",
                      "8",
                      "9",
                      "10",
                      "11",
                      "12",
                      "13",
                      "14",
                      "15",
                      "16",
                      "17",
                      "18",
                      "19"
                    ],
                    digits: null,
                    dateFormat: "YYYY.m.d",
                    firstDay: 0,
                    isRTL: !1,
                    haabMonths: [
                      "Pop",
                      "Uo",
                      "Zip",
                      "Zotz",
                      "Tzec",
                      "Xul",
                      "Yaxkin",
                      "Mol",
                      "Chen",
                      "Yax",
                      "Zac",
                      "Ceh",
                      "Mac",
                      "Kankin",
                      "Muan",
                      "Pax",
                      "Kayab",
                      "Cumku",
                      "Uayeb"
                    ],
                    tzolkinMonths: [
                      "Imix",
                      "Ik",
                      "Akbal",
                      "Kan",
                      "Chicchan",
                      "Cimi",
                      "Manik",
                      "Lamat",
                      "Muluc",
                      "Oc",
                      "Chuen",
                      "Eb",
                      "Ben",
                      "Ix",
                      "Men",
                      "Cib",
                      "Caban",
                      "Etznab",
                      "Cauac",
                      "Ahau"
                    ]
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(y) {
                  return this._validate(y, this.minMonth, this.minDay, l.local.invalidYear), !1;
                },
                /** Format the year, if not a simple sequential number.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to format or the year to format.
                    @return {string} The formatted year.
                    @throws Error if an invalid year or a different calendar used. */
                formatYear: function(y) {
                  var C = this._validate(y, this.minMonth, this.minDay, l.local.invalidYear);
                  y = C.year();
                  var m = Math.floor(y / 400);
                  y = y % 400, y += y < 0 ? 400 : 0;
                  var h = Math.floor(y / 20);
                  return m + "." + h + "." + y % 20;
                },
                /** Convert from the formatted year back to a single number.
                    @memberof MayanCalendar
                    @param years {string} The year as n.n.n.
                    @return {number} The sequential year.
                    @throws Error if an invalid value is supplied. */
                forYear: function(y) {
                  if (y = y.split("."), y.length < 3)
                    throw "Invalid Mayan year";
                  for (var C = 0, m = 0; m < y.length; m++) {
                    var h = parseInt(y[m], 10);
                    if (Math.abs(h) > 19 || m > 0 && h < 0)
                      throw "Invalid Mayan year";
                    C = C * 20 + h;
                  }
                  return C;
                },
                /** Retrieve the number of months in a year.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of months.
                    @throws Error if an invalid year or a different calendar used. */
                monthsInYear: function(y) {
                  return this._validate(y, this.minMonth, this.minDay, l.local.invalidYear), 18;
                },
                /** Determine the week of the year for a date.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(y, C, m) {
                  return this._validate(y, C, m, l.local.invalidDate), 0;
                },
                /** Retrieve the number of days in a year.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of days.
                    @throws Error if an invalid year or a different calendar used. */
                daysInYear: function(y) {
                  return this._validate(y, this.minMonth, this.minDay, l.local.invalidYear), 360;
                },
                /** Retrieve the number of days in a month.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(y, C) {
                  return this._validate(y, C, this.minDay, l.local.invalidMonth), 20;
                },
                /** Retrieve the number of days in a week.
                    @memberof MayanCalendar
                    @return {number} The number of days. */
                daysInWeek: function() {
                  return 5;
                },
                /** Retrieve the day of the week for a date.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The day of the week: 0 to number of days - 1.
                    @throws Error if an invalid date or a different calendar used. */
                dayOfWeek: function(y, C, m) {
                  var h = this._validate(y, C, m, l.local.invalidDate);
                  return h.day();
                },
                /** Determine whether this date is a week day.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(y, C, m) {
                  return this._validate(y, C, m, l.local.invalidDate), !0;
                },
                /** Retrieve additional information about a date - Haab and Tzolkin equivalents.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {object} Additional information - contents depends on calendar.
                    @throws Error if an invalid date or a different calendar used. */
                extraInfo: function(y, C, m) {
                  var h = this._validate(y, C, m, l.local.invalidDate), w = h.toJD(), S = this._toHaab(w), E = this._toTzolkin(w);
                  return {
                    haabMonthName: this.local.haabMonths[S[0] - 1],
                    haabMonth: S[0],
                    haabDay: S[1],
                    tzolkinDayName: this.local.tzolkinMonths[E[0] - 1],
                    tzolkinDay: E[0],
                    tzolkinTrecena: E[1]
                  };
                },
                /** Retrieve Haab date from a Julian date.
                    @memberof MayanCalendar
                    @private
                    @param jd  {number} The Julian date.
                    @return {number[]} Corresponding Haab month and day. */
                _toHaab: function(y) {
                  y -= this.jdEpoch;
                  var C = p(y + 8 + 17 * 20, 365);
                  return [Math.floor(C / 20) + 1, p(C, 20)];
                },
                /** Retrieve Tzolkin date from a Julian date.
                    @memberof MayanCalendar
                    @private
                    @param jd {number} The Julian date.
                    @return {number[]} Corresponding Tzolkin day and trecena. */
                _toTzolkin: function(y) {
                  return y -= this.jdEpoch, [g(y + 20, 20), g(y + 4, 13)];
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof MayanCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(y, C, m) {
                  var h = this._validate(y, C, m, l.local.invalidDate);
                  return h.day() + h.month() * 20 + h.year() * 360 + this.jdEpoch;
                },
                /** Create a new date from a Julian date.
                    @memberof MayanCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(y) {
                  y = Math.floor(y) + 0.5 - this.jdEpoch;
                  var C = Math.floor(y / 360);
                  y = y % 360, y += y < 0 ? 360 : 0;
                  var m = Math.floor(y / 20), h = y % 20;
                  return this.newDate(C, m, h);
                }
              });
              function p(y, C) {
                return y - C * Math.floor(y / C);
              }
              function g(y, C) {
                return p(y - 1, C) + 1;
              }
              l.calendars.mayan = f;
            }
          ),
          /***/
          632: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(g) {
                this.local = this.regionalOptions[g || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar();
              var p = l.instance("gregorian");
              v(f.prototype, {
                /** The calendar name.
                    @memberof NanakshahiCalendar */
                name: "Nanakshahi",
                /** Julian date of start of Nanakshahi epoch: 14 March 1469 CE.
                    @memberof NanakshahiCalendar */
                jdEpoch: 22576735e-1,
                /** Days per month in a common year.
                    @memberof NanakshahiCalendar */
                daysPerMonth: [31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof NanakshahiCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof NanakshahiCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof NanakshahiCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof NanakshahiCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof NanakshahiCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Nanakshahi",
                    epochs: ["BN", "AN"],
                    monthNames: [
                      "Chet",
                      "Vaisakh",
                      "Jeth",
                      "Harh",
                      "Sawan",
                      "Bhadon",
                      "Assu",
                      "Katak",
                      "Maghar",
                      "Poh",
                      "Magh",
                      "Phagun"
                    ],
                    monthNamesShort: ["Che", "Vai", "Jet", "Har", "Saw", "Bha", "Ass", "Kat", "Mgr", "Poh", "Mgh", "Pha"],
                    dayNames: ["Somvaar", "Mangalvar", "Budhvaar", "Veervaar", "Shukarvaar", "Sanicharvaar", "Etvaar"],
                    dayNamesShort: ["Som", "Mangal", "Budh", "Veer", "Shukar", "Sanichar", "Et"],
                    dayNamesMin: ["So", "Ma", "Bu", "Ve", "Sh", "Sa", "Et"],
                    digits: null,
                    dateFormat: "dd-mm-yyyy",
                    firstDay: 0,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof NanakshahiCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(g) {
                  var y = this._validate(
                    g,
                    this.minMonth,
                    this.minDay,
                    l.local.invalidYear || l.regionalOptions[""].invalidYear
                  );
                  return p.leapYear(y.year() + (y.year() < 1 ? 1 : 0) + 1469);
                },
                /** Determine the week of the year for a date.
                    @memberof NanakshahiCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(g, y, C) {
                  var m = this.newDate(g, y, C);
                  return m.add(1 - (m.dayOfWeek() || 7), "d"), Math.floor((m.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a month.
                    @memberof NanakshahiCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(g, y) {
                  var C = this._validate(g, y, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[C.month() - 1] + (C.month() === 12 && this.leapYear(C.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof NanakshahiCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(g, y, C) {
                  return (this.dayOfWeek(g, y, C) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof NanakshahiCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(h, y, C) {
                  var m = this._validate(h, y, C, l.local.invalidMonth), h = m.year();
                  h < 0 && h++;
                  for (var w = m.day(), S = 1; S < m.month(); S++)
                    w += this.daysPerMonth[S - 1];
                  return w + p.toJD(h + 1468, 3, 13);
                },
                /** Create a new date from a Julian date.
                    @memberof NanakshahiCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(g) {
                  g = Math.floor(g + 0.5);
                  for (var y = Math.floor((g - (this.jdEpoch - 1)) / 366); g >= this.toJD(y + 1, 1, 1); )
                    y++;
                  for (var C = g - Math.floor(this.toJD(y, 1, 1) + 0.5) + 1, m = 1; C > this.daysInMonth(y, m); )
                    C -= this.daysInMonth(y, m), m++;
                  return this.newDate(y, m, C);
                }
              }), l.calendars.nanakshahi = f;
            }
          ),
          /***/
          3040: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(p) {
                this.local = this.regionalOptions[p || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof NepaliCalendar */
                name: "Nepali",
                /** Julian date of start of Nepali epoch: 14 April 57 BCE.
                    @memberof NepaliCalendar */
                jdEpoch: 17007095e-1,
                /** Days per month in a common year.
                    @memberof NepaliCalendar */
                daysPerMonth: [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof NepaliCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof NepaliCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof NepaliCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof NepaliCalendar */
                minDay: 1,
                /** The number of days in the year.
                    @memberof NepaliCalendar */
                daysPerYear: 365,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof NepaliCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Nepali",
                    epochs: ["BBS", "ABS"],
                    monthNames: [
                      "Baisakh",
                      "Jestha",
                      "Ashadh",
                      "Shrawan",
                      "Bhadra",
                      "Ashwin",
                      "Kartik",
                      "Mangsir",
                      "Paush",
                      "Mangh",
                      "Falgun",
                      "Chaitra"
                    ],
                    monthNamesShort: ["Bai", "Je", "As", "Shra", "Bha", "Ash", "Kar", "Mang", "Pau", "Ma", "Fal", "Chai"],
                    dayNames: ["Aaitabaar", "Sombaar", "Manglbaar", "Budhabaar", "Bihibaar", "Shukrabaar", "Shanibaar"],
                    dayNamesShort: ["Aaita", "Som", "Mangl", "Budha", "Bihi", "Shukra", "Shani"],
                    dayNamesMin: ["Aai", "So", "Man", "Bu", "Bi", "Shu", "Sha"],
                    digits: null,
                    dateFormat: "dd/mm/yyyy",
                    firstDay: 1,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof NepaliCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(p) {
                  return this.daysInYear(p) !== this.daysPerYear;
                },
                /** Determine the week of the year for a date.
                    @memberof NepaliCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(p, g, y) {
                  var C = this.newDate(p, g, y);
                  return C.add(-C.dayOfWeek(), "d"), Math.floor((C.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a year.
                    @memberof NepaliCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of days.
                    @throws Error if an invalid year or a different calendar used. */
                daysInYear: function(p) {
                  var g = this._validate(p, this.minMonth, this.minDay, l.local.invalidYear);
                  if (p = g.year(), typeof this.NEPALI_CALENDAR_DATA[p] > "u")
                    return this.daysPerYear;
                  for (var y = 0, C = this.minMonth; C <= 12; C++)
                    y += this.NEPALI_CALENDAR_DATA[p][C];
                  return y;
                },
                /** Retrieve the number of days in a month.
                    @memberof NepaliCalendar
                    @param year {CDate|number| The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(p, g) {
                  return p.year && (g = p.month(), p = p.year()), this._validate(p, g, this.minDay, l.local.invalidMonth), typeof this.NEPALI_CALENDAR_DATA[p] > "u" ? this.daysPerMonth[g - 1] : this.NEPALI_CALENDAR_DATA[p][g];
                },
                /** Determine whether this date is a week day.
                    @memberof NepaliCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(p, g, y) {
                  return this.dayOfWeek(p, g, y) !== 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof NepaliCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(p, g, y) {
                  var C = this._validate(p, g, y, l.local.invalidDate);
                  p = C.year(), g = C.month(), y = C.day();
                  var m = l.instance(), h = 0, w = g, S = p;
                  this._createMissingCalendarData(p);
                  var E = p - (w > 9 || w === 9 && y >= this.NEPALI_CALENDAR_DATA[S][0] ? 56 : 57);
                  for (g !== 9 && (h = y, w--); w !== 9; )
                    w <= 0 && (w = 12, S--), h += this.NEPALI_CALENDAR_DATA[S][w], w--;
                  return g === 9 ? (h += y - this.NEPALI_CALENDAR_DATA[S][0], h < 0 && (h += m.daysInYear(E))) : h += this.NEPALI_CALENDAR_DATA[S][9] - this.NEPALI_CALENDAR_DATA[S][0], m.newDate(E, 1, 1).add(h, "d").toJD();
                },
                /** Create a new date from a Julian date.
                    @memberof NepaliCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(p) {
                  var g = l.instance(), y = g.fromJD(p), C = y.year(), m = y.dayOfYear(), h = C + 56;
                  this._createMissingCalendarData(h);
                  for (var w = 9, S = this.NEPALI_CALENDAR_DATA[h][0], E = this.NEPALI_CALENDAR_DATA[h][w] - S + 1; m > E; )
                    w++, w > 12 && (w = 1, h++), E += this.NEPALI_CALENDAR_DATA[h][w];
                  var x = this.NEPALI_CALENDAR_DATA[h][w] - (E - m);
                  return this.newDate(h, w, x);
                },
                /** Creates missing data in the NEPALI_CALENDAR_DATA table.
                    This data will not be correct but just give an estimated result. Mostly -/+ 1 day
                    @private
                    @param nepaliYear {number} The missing year number. */
                _createMissingCalendarData: function(p) {
                  var g = this.daysPerMonth.slice(0);
                  g.unshift(17);
                  for (var y = p - 1; y < p + 2; y++)
                    typeof this.NEPALI_CALENDAR_DATA[y] > "u" && (this.NEPALI_CALENDAR_DATA[y] = g);
                },
                NEPALI_CALENDAR_DATA: {
                  // These data are from http://www.ashesh.com.np
                  1970: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1971: [18, 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
                  1972: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
                  1973: [19, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  1974: [19, 31, 31, 32, 30, 31, 31, 30, 29, 30, 29, 30, 30],
                  1975: [18, 31, 31, 32, 32, 30, 31, 30, 29, 30, 29, 30, 30],
                  1976: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  1977: [18, 31, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31],
                  1978: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1979: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  1980: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  1981: [18, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
                  1982: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1983: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  1984: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  1985: [18, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
                  1986: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1987: [18, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  1988: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  1989: [18, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  1990: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1991: [18, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  // These data are from http://nepalicalendar.rat32.com/index.php
                  1992: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  1993: [18, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  1994: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1995: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
                  1996: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  1997: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1998: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  1999: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2e3: [17, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2001: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2002: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2003: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2004: [17, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2005: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2006: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2007: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2008: [17, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
                  2009: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2010: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2011: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2012: [17, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
                  2013: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2014: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2015: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2016: [17, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
                  2017: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2018: [18, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2019: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2020: [17, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  2021: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2022: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
                  2023: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2024: [17, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  2025: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2026: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2027: [17, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2028: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2029: [18, 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
                  2030: [17, 31, 32, 31, 32, 31, 30, 30, 30, 30, 30, 30, 31],
                  2031: [17, 31, 32, 31, 32, 31, 31, 31, 31, 31, 31, 31, 31],
                  2032: [17, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32],
                  2033: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2034: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2035: [17, 30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
                  2036: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2037: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2038: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2039: [17, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
                  2040: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2041: [18, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2042: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2043: [17, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
                  2044: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2045: [18, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2046: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2047: [17, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  2048: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2049: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
                  2050: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2051: [17, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  2052: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2053: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
                  2054: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2055: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 30, 29, 30],
                  2056: [17, 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
                  2057: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2058: [17, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2059: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2060: [17, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2061: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2062: [17, 30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31],
                  2063: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2064: [17, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2065: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2066: [17, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
                  2067: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2068: [17, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2069: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2070: [17, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
                  2071: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2072: [17, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2073: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
                  2074: [17, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  2075: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2076: [16, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
                  2077: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
                  2078: [17, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
                  2079: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
                  2080: [16, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
                  // These data are from http://www.ashesh.com.np/nepali-calendar/
                  2081: [17, 31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2082: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2083: [17, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
                  2084: [17, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
                  2085: [17, 31, 32, 31, 32, 31, 31, 30, 30, 29, 30, 30, 30],
                  2086: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2087: [16, 31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30],
                  2088: [16, 30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30],
                  2089: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2090: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2091: [16, 31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30],
                  2092: [16, 31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2093: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2094: [17, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
                  2095: [17, 31, 31, 32, 31, 31, 31, 30, 29, 30, 30, 30, 30],
                  2096: [17, 30, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
                  2097: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
                  2098: [17, 31, 31, 32, 31, 31, 31, 29, 30, 29, 30, 30, 31],
                  2099: [17, 31, 31, 32, 31, 31, 31, 30, 29, 29, 30, 30, 30],
                  2100: [17, 31, 32, 31, 32, 30, 31, 30, 29, 30, 29, 30, 30]
                }
              }), l.calendars.nepali = f;
            }
          ),
          /***/
          1104: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(g) {
                this.local = this.regionalOptions[g || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof PersianCalendar */
                name: "Persian",
                /** Julian date of start of Persian epoch: 19 March 622 CE.
                    @memberof PersianCalendar */
                jdEpoch: 19483205e-1,
                /** Days per month in a common year.
                    @memberof PersianCalendar */
                daysPerMonth: [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof PersianCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof PersianCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof PersianCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof PersianCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof PersianCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Persian",
                    epochs: ["BP", "AP"],
                    monthNames: [
                      "Farvardin",
                      "Ordibehesht",
                      "Khordad",
                      "Tir",
                      "Mordad",
                      "Shahrivar",
                      "Mehr",
                      "Aban",
                      "Azar",
                      "Day",
                      "Bahman",
                      "Esfand"
                    ],
                    monthNamesShort: ["Far", "Ord", "Kho", "Tir", "Mor", "Sha", "Meh", "Aba", "Aza", "Day", "Bah", "Esf"],
                    dayNames: ["Yekshambe", "Doshambe", "Seshambe", "Chæharshambe", "Panjshambe", "Jom'e", "Shambe"],
                    dayNamesShort: ["Yek", "Do", "Se", "Chæ", "Panj", "Jom", "Sha"],
                    dayNamesMin: ["Ye", "Do", "Se", "Ch", "Pa", "Jo", "Sh"],
                    digits: null,
                    dateFormat: "yyyy/mm/dd",
                    firstDay: 6,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof PersianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(g) {
                  var y = this._validate(g, this.minMonth, this.minDay, l.local.invalidYear);
                  return ((y.year() - (y.year() > 0 ? 474 : 473)) % 2820 + 474 + 38) * 682 % 2816 < 682;
                },
                /** Determine the week of the year for a date.
                    @memberof PersianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(g, y, C) {
                  var m = this.newDate(g, y, C);
                  return m.add(-((m.dayOfWeek() + 1) % 7), "d"), Math.floor((m.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a month.
                    @memberof PersianCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(g, y) {
                  var C = this._validate(g, y, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[C.month() - 1] + (C.month() === 12 && this.leapYear(C.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof PersianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(g, y, C) {
                  return this.dayOfWeek(g, y, C) !== 5;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof PersianCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(g, y, C) {
                  var m = this._validate(g, y, C, l.local.invalidDate);
                  g = m.year(), y = m.month(), C = m.day();
                  var h = g - (g >= 0 ? 474 : 473), w = 474 + p(h, 2820);
                  return C + (y <= 7 ? (y - 1) * 31 : (y - 1) * 30 + 6) + Math.floor((w * 682 - 110) / 2816) + (w - 1) * 365 + Math.floor(h / 2820) * 1029983 + this.jdEpoch - 1;
                },
                /** Create a new date from a Julian date.
                    @memberof PersianCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(g) {
                  g = Math.floor(g) + 0.5;
                  var y = g - this.toJD(475, 1, 1), C = Math.floor(y / 1029983), m = p(y, 1029983), h = 2820;
                  if (m !== 1029982) {
                    var w = Math.floor(m / 366), S = p(m, 366);
                    h = Math.floor((2134 * w + 2816 * S + 2815) / 1028522) + w + 1;
                  }
                  var E = h + 2820 * C + 474;
                  E = E <= 0 ? E - 1 : E;
                  var x = g - this.toJD(E, 1, 1) + 1, T = x <= 186 ? Math.ceil(x / 31) : Math.ceil((x - 6) / 30), F = g - this.toJD(E, T, 1) + 1;
                  return this.newDate(E, T, F);
                }
              });
              function p(g, y) {
                return g - y * Math.floor(g / y);
              }
              l.calendars.persian = f, l.calendars.jalali = f;
            }
          ),
          /***/
          9075: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896), f = l.instance();
              function p(g) {
                this.local = this.regionalOptions[g || ""] || this.regionalOptions[""];
              }
              p.prototype = new l.baseCalendar(), v(p.prototype, {
                /** The calendar name.
                    @memberof TaiwanCalendar */
                name: "Taiwan",
                /** Julian date of start of Taiwan epoch: 1 January 1912 CE (Gregorian).
                    @memberof TaiwanCalendar */
                jdEpoch: 24194025e-1,
                /** Difference in years between Taiwan and Gregorian calendars.
                    @memberof TaiwanCalendar */
                yearsOffset: 1911,
                /** Days per month in a common year.
                    @memberof TaiwanCalendar */
                daysPerMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof TaiwanCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof TaiwanCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof TaiwanCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof TaiwanCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof TaiwanCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Taiwan",
                    epochs: ["BROC", "ROC"],
                    monthNames: [
                      "January",
                      "February",
                      "March",
                      "April",
                      "May",
                      "June",
                      "July",
                      "August",
                      "September",
                      "October",
                      "November",
                      "December"
                    ],
                    monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
                    dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                    dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                    dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
                    digits: null,
                    dateFormat: "yyyy/mm/dd",
                    firstDay: 1,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof TaiwanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(C) {
                  var y = this._validate(C, this.minMonth, this.minDay, l.local.invalidYear), C = this._t2gYear(y.year());
                  return f.leapYear(C);
                },
                /** Determine the week of the year for a date - ISO 8601.
                    @memberof TaiwanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(h, y, C) {
                  var m = this._validate(h, this.minMonth, this.minDay, l.local.invalidYear), h = this._t2gYear(m.year());
                  return f.weekOfYear(h, m.month(), m.day());
                },
                /** Retrieve the number of days in a month.
                    @memberof TaiwanCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(g, y) {
                  var C = this._validate(g, y, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[C.month() - 1] + (C.month() === 2 && this.leapYear(C.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof TaiwanCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(g, y, C) {
                  return (this.dayOfWeek(g, y, C) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof TaiwanCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(h, y, C) {
                  var m = this._validate(h, y, C, l.local.invalidDate), h = this._t2gYear(m.year());
                  return f.toJD(h, m.month(), m.day());
                },
                /** Create a new date from a Julian date.
                    @memberof TaiwanCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(g) {
                  var y = f.fromJD(g), C = this._g2tYear(y.year());
                  return this.newDate(C, y.month(), y.day());
                },
                /** Convert Taiwanese to Gregorian year.
                    @memberof TaiwanCalendar
                    @private
                    @param year {number} The Taiwanese year.
                    @return {number} The corresponding Gregorian year. */
                _t2gYear: function(g) {
                  return g + this.yearsOffset + (g >= -this.yearsOffset && g <= -1 ? 1 : 0);
                },
                /** Convert Gregorian to Taiwanese year.
                    @memberof TaiwanCalendar
                    @private
                    @param year {number} The Gregorian year.
                    @return {number} The corresponding Taiwanese year. */
                _g2tYear: function(g) {
                  return g - this.yearsOffset - (g >= 1 && g <= this.yearsOffset ? 1 : 0);
                }
              }), l.calendars.taiwan = p;
            }
          ),
          /***/
          4592: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896), f = l.instance();
              function p(g) {
                this.local = this.regionalOptions[g || ""] || this.regionalOptions[""];
              }
              p.prototype = new l.baseCalendar(), v(p.prototype, {
                /** The calendar name.
                    @memberof ThaiCalendar */
                name: "Thai",
                /** Julian date of start of Thai epoch: 1 January 543 BCE (Gregorian).
                    @memberof ThaiCalendar */
                jdEpoch: 15230985e-1,
                /** Difference in years between Thai and Gregorian calendars.
                    @memberof ThaiCalendar */
                yearsOffset: 543,
                /** Days per month in a common year.
                    @memberof ThaiCalendar */
                daysPerMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof ThaiCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof ThaiCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof ThaiCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof ThaiCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof ThaiCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Thai",
                    epochs: ["BBE", "BE"],
                    monthNames: [
                      "January",
                      "February",
                      "March",
                      "April",
                      "May",
                      "June",
                      "July",
                      "August",
                      "September",
                      "October",
                      "November",
                      "December"
                    ],
                    monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
                    dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                    dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                    dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
                    digits: null,
                    dateFormat: "dd/mm/yyyy",
                    firstDay: 0,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof ThaiCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(C) {
                  var y = this._validate(C, this.minMonth, this.minDay, l.local.invalidYear), C = this._t2gYear(y.year());
                  return f.leapYear(C);
                },
                /** Determine the week of the year for a date - ISO 8601.
                    @memberof ThaiCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(h, y, C) {
                  var m = this._validate(h, this.minMonth, this.minDay, l.local.invalidYear), h = this._t2gYear(m.year());
                  return f.weekOfYear(h, m.month(), m.day());
                },
                /** Retrieve the number of days in a month.
                    @memberof ThaiCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(g, y) {
                  var C = this._validate(g, y, this.minDay, l.local.invalidMonth);
                  return this.daysPerMonth[C.month() - 1] + (C.month() === 2 && this.leapYear(C.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof ThaiCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(g, y, C) {
                  return (this.dayOfWeek(g, y, C) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof ThaiCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(h, y, C) {
                  var m = this._validate(h, y, C, l.local.invalidDate), h = this._t2gYear(m.year());
                  return f.toJD(h, m.month(), m.day());
                },
                /** Create a new date from a Julian date.
                    @memberof ThaiCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(g) {
                  var y = f.fromJD(g), C = this._g2tYear(y.year());
                  return this.newDate(C, y.month(), y.day());
                },
                /** Convert Thai to Gregorian year.
                    @memberof ThaiCalendar
                    @private
                    @param year {number} The Thai year.
                    @return {number} The corresponding Gregorian year. */
                _t2gYear: function(g) {
                  return g - this.yearsOffset - (g >= 1 && g <= this.yearsOffset ? 1 : 0);
                },
                /** Convert Gregorian to Thai year.
                    @memberof ThaiCalendar
                    @private
                    @param year {number} The Gregorian year.
                    @return {number} The corresponding Thai year. */
                _g2tYear: function(g) {
                  return g + this.yearsOffset + (g >= -this.yearsOffset && g <= -1 ? 1 : 0);
                }
              }), l.calendars.thai = p;
            }
          ),
          /***/
          5348: (
            /***/
            function(s, c, i) {
              var l = i(8700), v = i(896);
              function f(g) {
                this.local = this.regionalOptions[g || ""] || this.regionalOptions[""];
              }
              f.prototype = new l.baseCalendar(), v(f.prototype, {
                /** The calendar name.
                    @memberof UmmAlQuraCalendar */
                name: "UmmAlQura",
                //jdEpoch: 1948440, // Julian date of start of UmmAlQura epoch: 14 March 1937 CE
                //daysPerMonth: // Days per month in a common year, replaced by a method.
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                    @memberof UmmAlQuraCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof UmmAlQuraCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof UmmAlQuraCalendar */
                firstMonth: 1,
                /** The minimum day number.
                    @memberof UmmAlQuraCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof UmmAlQuraCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Umm al-Qura",
                    epochs: ["BH", "AH"],
                    monthNames: [
                      "Al-Muharram",
                      "Safar",
                      "Rabi' al-awwal",
                      "Rabi' Al-Thani",
                      "Jumada Al-Awwal",
                      "Jumada Al-Thani",
                      "Rajab",
                      "Sha'aban",
                      "Ramadan",
                      "Shawwal",
                      "Dhu al-Qi'dah",
                      "Dhu al-Hijjah"
                    ],
                    monthNamesShort: ["Muh", "Saf", "Rab1", "Rab2", "Jum1", "Jum2", "Raj", "Sha'", "Ram", "Shaw", "DhuQ", "DhuH"],
                    dayNames: ["Yawm al-Ahad", "Yawm al-Ithnain", "Yawm al-Thalāthā’", "Yawm al-Arba‘ā’", "Yawm al-Khamīs", "Yawm al-Jum‘a", "Yawm al-Sabt"],
                    dayNamesMin: ["Ah", "Ith", "Th", "Ar", "Kh", "Ju", "Sa"],
                    digits: null,
                    dateFormat: "yyyy/mm/dd",
                    firstDay: 6,
                    isRTL: !0
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof UmmAlQuraCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(g) {
                  var y = this._validate(g, this.minMonth, this.minDay, l.local.invalidYear);
                  return this.daysInYear(y.year()) === 355;
                },
                /** Determine the week of the year for a date.
                    @memberof UmmAlQuraCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(g, y, C) {
                  var m = this.newDate(g, y, C);
                  return m.add(-m.dayOfWeek(), "d"), Math.floor((m.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a year.
                    @memberof UmmAlQuraCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of days.
                    @throws Error if an invalid year or a different calendar used. */
                daysInYear: function(g) {
                  for (var y = 0, C = 1; C <= 12; C++)
                    y += this.daysInMonth(g, C);
                  return y;
                },
                /** Retrieve the number of days in a month.
                    @memberof UmmAlQuraCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(g, y) {
                  for (var C = this._validate(g, y, this.minDay, l.local.invalidMonth), m = C.toJD() - 24e5 + 0.5, h = 0, w = 0; w < p.length; w++) {
                    if (p[w] > m)
                      return p[h] - p[h - 1];
                    h++;
                  }
                  return 30;
                },
                /** Determine whether this date is a week day.
                    @memberof UmmAlQuraCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(g, y, C) {
                  return this.dayOfWeek(g, y, C) !== 5;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof UmmAlQuraCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(g, y, C) {
                  var m = this._validate(g, y, C, l.local.invalidDate), h = 12 * (m.year() - 1) + m.month() - 15292, w = m.day() + p[h - 1] - 1;
                  return w + 24e5 - 0.5;
                },
                /** Create a new date from a Julian date.
                    @memberof UmmAlQuraCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(g) {
                  for (var y = g - 24e5 + 0.5, C = 0, m = 0; m < p.length && !(p[m] > y); m++)
                    C++;
                  var h = C + 15292, w = Math.floor((h - 1) / 12), S = w + 1, E = h - 12 * w, x = y - p[C - 1] + 1;
                  return this.newDate(S, E, x);
                },
                /** Determine whether a date is valid for this calendar.
                    @memberof UmmAlQuraCalendar
                    @param year {number} The year to examine.
                    @param month {number} The month to examine.
                    @param day {number} The day to examine.
                    @return {boolean} <code>true</code> if a valid date, <code>false</code> if not. */
                isValid: function(g, y, C) {
                  var m = l.baseCalendar.prototype.isValid.apply(this, arguments);
                  return m && (g = g.year != null ? g.year : g, m = g >= 1276 && g <= 1500), m;
                },
                /** Check that a candidate date is from the same calendar and is valid.
                    @memberof UmmAlQuraCalendar
                    @private
                    @param year {CDate|number} The date to validate or the year to validate.
                    @param month {number} The month to validate.
                    @param day {number} The day to validate.
                    @param error {string} Error message if invalid.
                    @throws Error if different calendars used or invalid date. */
                _validate: function(g, y, C, m) {
                  var h = l.baseCalendar.prototype._validate.apply(this, arguments);
                  if (h.year < 1276 || h.year > 1500)
                    throw m.replace(/\{0\}/, this.local.name);
                  return h;
                }
              }), l.calendars.ummalqura = f;
              var p = [
                20,
                50,
                79,
                109,
                138,
                168,
                197,
                227,
                256,
                286,
                315,
                345,
                374,
                404,
                433,
                463,
                492,
                522,
                551,
                581,
                611,
                641,
                670,
                700,
                729,
                759,
                788,
                818,
                847,
                877,
                906,
                936,
                965,
                995,
                1024,
                1054,
                1083,
                1113,
                1142,
                1172,
                1201,
                1231,
                1260,
                1290,
                1320,
                1350,
                1379,
                1409,
                1438,
                1468,
                1497,
                1527,
                1556,
                1586,
                1615,
                1645,
                1674,
                1704,
                1733,
                1763,
                1792,
                1822,
                1851,
                1881,
                1910,
                1940,
                1969,
                1999,
                2028,
                2058,
                2087,
                2117,
                2146,
                2176,
                2205,
                2235,
                2264,
                2294,
                2323,
                2353,
                2383,
                2413,
                2442,
                2472,
                2501,
                2531,
                2560,
                2590,
                2619,
                2649,
                2678,
                2708,
                2737,
                2767,
                2796,
                2826,
                2855,
                2885,
                2914,
                2944,
                2973,
                3003,
                3032,
                3062,
                3091,
                3121,
                3150,
                3180,
                3209,
                3239,
                3268,
                3298,
                3327,
                3357,
                3386,
                3416,
                3446,
                3476,
                3505,
                3535,
                3564,
                3594,
                3623,
                3653,
                3682,
                3712,
                3741,
                3771,
                3800,
                3830,
                3859,
                3889,
                3918,
                3948,
                3977,
                4007,
                4036,
                4066,
                4095,
                4125,
                4155,
                4185,
                4214,
                4244,
                4273,
                4303,
                4332,
                4362,
                4391,
                4421,
                4450,
                4480,
                4509,
                4539,
                4568,
                4598,
                4627,
                4657,
                4686,
                4716,
                4745,
                4775,
                4804,
                4834,
                4863,
                4893,
                4922,
                4952,
                4981,
                5011,
                5040,
                5070,
                5099,
                5129,
                5158,
                5188,
                5218,
                5248,
                5277,
                5307,
                5336,
                5366,
                5395,
                5425,
                5454,
                5484,
                5513,
                5543,
                5572,
                5602,
                5631,
                5661,
                5690,
                5720,
                5749,
                5779,
                5808,
                5838,
                5867,
                5897,
                5926,
                5956,
                5985,
                6015,
                6044,
                6074,
                6103,
                6133,
                6162,
                6192,
                6221,
                6251,
                6281,
                6311,
                6340,
                6370,
                6399,
                6429,
                6458,
                6488,
                6517,
                6547,
                6576,
                6606,
                6635,
                6665,
                6694,
                6724,
                6753,
                6783,
                6812,
                6842,
                6871,
                6901,
                6930,
                6960,
                6989,
                7019,
                7048,
                7078,
                7107,
                7137,
                7166,
                7196,
                7225,
                7255,
                7284,
                7314,
                7344,
                7374,
                7403,
                7433,
                7462,
                7492,
                7521,
                7551,
                7580,
                7610,
                7639,
                7669,
                7698,
                7728,
                7757,
                7787,
                7816,
                7846,
                7875,
                7905,
                7934,
                7964,
                7993,
                8023,
                8053,
                8083,
                8112,
                8142,
                8171,
                8201,
                8230,
                8260,
                8289,
                8319,
                8348,
                8378,
                8407,
                8437,
                8466,
                8496,
                8525,
                8555,
                8584,
                8614,
                8643,
                8673,
                8702,
                8732,
                8761,
                8791,
                8821,
                8850,
                8880,
                8909,
                8938,
                8968,
                8997,
                9027,
                9056,
                9086,
                9115,
                9145,
                9175,
                9205,
                9234,
                9264,
                9293,
                9322,
                9352,
                9381,
                9410,
                9440,
                9470,
                9499,
                9529,
                9559,
                9589,
                9618,
                9648,
                9677,
                9706,
                9736,
                9765,
                9794,
                9824,
                9853,
                9883,
                9913,
                9943,
                9972,
                10002,
                10032,
                10061,
                10090,
                10120,
                10149,
                10178,
                10208,
                10237,
                10267,
                10297,
                10326,
                10356,
                10386,
                10415,
                10445,
                10474,
                10504,
                10533,
                10562,
                10592,
                10621,
                10651,
                10680,
                10710,
                10740,
                10770,
                10799,
                10829,
                10858,
                10888,
                10917,
                10947,
                10976,
                11005,
                11035,
                11064,
                11094,
                11124,
                11153,
                11183,
                11213,
                11242,
                11272,
                11301,
                11331,
                11360,
                11389,
                11419,
                11448,
                11478,
                11507,
                11537,
                11567,
                11596,
                11626,
                11655,
                11685,
                11715,
                11744,
                11774,
                11803,
                11832,
                11862,
                11891,
                11921,
                11950,
                11980,
                12010,
                12039,
                12069,
                12099,
                12128,
                12158,
                12187,
                12216,
                12246,
                12275,
                12304,
                12334,
                12364,
                12393,
                12423,
                12453,
                12483,
                12512,
                12542,
                12571,
                12600,
                12630,
                12659,
                12688,
                12718,
                12747,
                12777,
                12807,
                12837,
                12866,
                12896,
                12926,
                12955,
                12984,
                13014,
                13043,
                13072,
                13102,
                13131,
                13161,
                13191,
                13220,
                13250,
                13280,
                13310,
                13339,
                13368,
                13398,
                13427,
                13456,
                13486,
                13515,
                13545,
                13574,
                13604,
                13634,
                13664,
                13693,
                13723,
                13752,
                13782,
                13811,
                13840,
                13870,
                13899,
                13929,
                13958,
                13988,
                14018,
                14047,
                14077,
                14107,
                14136,
                14166,
                14195,
                14224,
                14254,
                14283,
                14313,
                14342,
                14372,
                14401,
                14431,
                14461,
                14490,
                14520,
                14550,
                14579,
                14609,
                14638,
                14667,
                14697,
                14726,
                14756,
                14785,
                14815,
                14844,
                14874,
                14904,
                14933,
                14963,
                14993,
                15021,
                15051,
                15081,
                15110,
                15140,
                15169,
                15199,
                15228,
                15258,
                15287,
                15317,
                15347,
                15377,
                15406,
                15436,
                15465,
                15494,
                15524,
                15553,
                15582,
                15612,
                15641,
                15671,
                15701,
                15731,
                15760,
                15790,
                15820,
                15849,
                15878,
                15908,
                15937,
                15966,
                15996,
                16025,
                16055,
                16085,
                16114,
                16144,
                16174,
                16204,
                16233,
                16262,
                16292,
                16321,
                16350,
                16380,
                16409,
                16439,
                16468,
                16498,
                16528,
                16558,
                16587,
                16617,
                16646,
                16676,
                16705,
                16734,
                16764,
                16793,
                16823,
                16852,
                16882,
                16912,
                16941,
                16971,
                17001,
                17030,
                17060,
                17089,
                17118,
                17148,
                17177,
                17207,
                17236,
                17266,
                17295,
                17325,
                17355,
                17384,
                17414,
                17444,
                17473,
                17502,
                17532,
                17561,
                17591,
                17620,
                17650,
                17679,
                17709,
                17738,
                17768,
                17798,
                17827,
                17857,
                17886,
                17916,
                17945,
                17975,
                18004,
                18034,
                18063,
                18093,
                18122,
                18152,
                18181,
                18211,
                18241,
                18270,
                18300,
                18330,
                18359,
                18388,
                18418,
                18447,
                18476,
                18506,
                18535,
                18565,
                18595,
                18625,
                18654,
                18684,
                18714,
                18743,
                18772,
                18802,
                18831,
                18860,
                18890,
                18919,
                18949,
                18979,
                19008,
                19038,
                19068,
                19098,
                19127,
                19156,
                19186,
                19215,
                19244,
                19274,
                19303,
                19333,
                19362,
                19392,
                19422,
                19452,
                19481,
                19511,
                19540,
                19570,
                19599,
                19628,
                19658,
                19687,
                19717,
                19746,
                19776,
                19806,
                19836,
                19865,
                19895,
                19924,
                19954,
                19983,
                20012,
                20042,
                20071,
                20101,
                20130,
                20160,
                20190,
                20219,
                20249,
                20279,
                20308,
                20338,
                20367,
                20396,
                20426,
                20455,
                20485,
                20514,
                20544,
                20573,
                20603,
                20633,
                20662,
                20692,
                20721,
                20751,
                20780,
                20810,
                20839,
                20869,
                20898,
                20928,
                20957,
                20987,
                21016,
                21046,
                21076,
                21105,
                21135,
                21164,
                21194,
                21223,
                21253,
                21282,
                21312,
                21341,
                21371,
                21400,
                21430,
                21459,
                21489,
                21519,
                21548,
                21578,
                21607,
                21637,
                21666,
                21696,
                21725,
                21754,
                21784,
                21813,
                21843,
                21873,
                21902,
                21932,
                21962,
                21991,
                22021,
                22050,
                22080,
                22109,
                22138,
                22168,
                22197,
                22227,
                22256,
                22286,
                22316,
                22346,
                22375,
                22405,
                22434,
                22464,
                22493,
                22522,
                22552,
                22581,
                22611,
                22640,
                22670,
                22700,
                22730,
                22759,
                22789,
                22818,
                22848,
                22877,
                22906,
                22936,
                22965,
                22994,
                23024,
                23054,
                23083,
                23113,
                23143,
                23173,
                23202,
                23232,
                23261,
                23290,
                23320,
                23349,
                23379,
                23408,
                23438,
                23467,
                23497,
                23527,
                23556,
                23586,
                23616,
                23645,
                23674,
                23704,
                23733,
                23763,
                23792,
                23822,
                23851,
                23881,
                23910,
                23940,
                23970,
                23999,
                24029,
                24058,
                24088,
                24117,
                24147,
                24176,
                24206,
                24235,
                24265,
                24294,
                24324,
                24353,
                24383,
                24413,
                24442,
                24472,
                24501,
                24531,
                24560,
                24590,
                24619,
                24648,
                24678,
                24707,
                24737,
                24767,
                24796,
                24826,
                24856,
                24885,
                24915,
                24944,
                24974,
                25003,
                25032,
                25062,
                25091,
                25121,
                25150,
                25180,
                25210,
                25240,
                25269,
                25299,
                25328,
                25358,
                25387,
                25416,
                25446,
                25475,
                25505,
                25534,
                25564,
                25594,
                25624,
                25653,
                25683,
                25712,
                25742,
                25771,
                25800,
                25830,
                25859,
                25888,
                25918,
                25948,
                25977,
                26007,
                26037,
                26067,
                26096,
                26126,
                26155,
                26184,
                26214,
                26243,
                26272,
                26302,
                26332,
                26361,
                26391,
                26421,
                26451,
                26480,
                26510,
                26539,
                26568,
                26598,
                26627,
                26656,
                26686,
                26715,
                26745,
                26775,
                26805,
                26834,
                26864,
                26893,
                26923,
                26952,
                26982,
                27011,
                27041,
                27070,
                27099,
                27129,
                27159,
                27188,
                27218,
                27248,
                27277,
                27307,
                27336,
                27366,
                27395,
                27425,
                27454,
                27484,
                27513,
                27542,
                27572,
                27602,
                27631,
                27661,
                27691,
                27720,
                27750,
                27779,
                27809,
                27838,
                27868,
                27897,
                27926,
                27956,
                27985,
                28015,
                28045,
                28074,
                28104,
                28134,
                28163,
                28193,
                28222,
                28252,
                28281,
                28310,
                28340,
                28369,
                28399,
                28428,
                28458,
                28488,
                28517,
                28547,
                28577,
                // From 1356
                28607,
                28636,
                28665,
                28695,
                28724,
                28754,
                28783,
                28813,
                28843,
                28872,
                28901,
                28931,
                28960,
                28990,
                29019,
                29049,
                29078,
                29108,
                29137,
                29167,
                29196,
                29226,
                29255,
                29285,
                29315,
                29345,
                29375,
                29404,
                29434,
                29463,
                29492,
                29522,
                29551,
                29580,
                29610,
                29640,
                29669,
                29699,
                29729,
                29759,
                29788,
                29818,
                29847,
                29876,
                29906,
                29935,
                29964,
                29994,
                30023,
                30053,
                30082,
                30112,
                30141,
                30171,
                30200,
                30230,
                30259,
                30289,
                30318,
                30348,
                30378,
                30408,
                30437,
                30467,
                30496,
                30526,
                30555,
                30585,
                30614,
                30644,
                30673,
                30703,
                30732,
                30762,
                30791,
                30821,
                30850,
                30880,
                30909,
                30939,
                30968,
                30998,
                31027,
                31057,
                31086,
                31116,
                31145,
                31175,
                31204,
                31234,
                31263,
                31293,
                31322,
                31352,
                31381,
                31411,
                31441,
                31471,
                31500,
                31530,
                31559,
                31589,
                31618,
                31648,
                31676,
                31706,
                31736,
                31766,
                31795,
                31825,
                31854,
                31884,
                31913,
                31943,
                31972,
                32002,
                32031,
                32061,
                32090,
                32120,
                32150,
                32180,
                32209,
                32239,
                32268,
                32298,
                32327,
                32357,
                32386,
                32416,
                32445,
                32475,
                32504,
                32534,
                32563,
                32593,
                32622,
                32652,
                32681,
                32711,
                32740,
                32770,
                32799,
                32829,
                32858,
                32888,
                32917,
                32947,
                32976,
                33006,
                33035,
                33065,
                33094,
                33124,
                33153,
                33183,
                33213,
                33243,
                33272,
                33302,
                33331,
                33361,
                33390,
                33420,
                33450,
                33479,
                33509,
                33539,
                33568,
                33598,
                33627,
                33657,
                33686,
                33716,
                33745,
                33775,
                33804,
                33834,
                33863,
                33893,
                33922,
                33952,
                33981,
                34011,
                34040,
                34069,
                34099,
                34128,
                34158,
                34187,
                34217,
                34247,
                34277,
                34306,
                34336,
                34365,
                34395,
                34424,
                34454,
                34483,
                34512,
                34542,
                34571,
                34601,
                34631,
                34660,
                34690,
                34719,
                34749,
                34778,
                34808,
                34837,
                34867,
                34896,
                34926,
                34955,
                34985,
                35015,
                35044,
                35074,
                35103,
                35133,
                35162,
                35192,
                35222,
                35251,
                35280,
                35310,
                35340,
                35370,
                35399,
                35429,
                35458,
                35488,
                35517,
                35547,
                35576,
                35605,
                35635,
                35665,
                35694,
                35723,
                35753,
                35782,
                35811,
                35841,
                35871,
                35901,
                35930,
                35960,
                35989,
                36019,
                36048,
                36078,
                36107,
                36136,
                36166,
                36195,
                36225,
                36254,
                36284,
                36314,
                36343,
                36373,
                36403,
                36433,
                36462,
                36492,
                36521,
                36551,
                36580,
                36610,
                36639,
                36669,
                36698,
                36728,
                36757,
                36786,
                36816,
                36845,
                36875,
                36904,
                36934,
                36963,
                36993,
                37022,
                37052,
                37081,
                37111,
                37141,
                37170,
                37200,
                37229,
                37259,
                37288,
                37318,
                37347,
                37377,
                37406,
                37436,
                37465,
                37495,
                37524,
                37554,
                37584,
                37613,
                37643,
                37672,
                37701,
                37731,
                37760,
                37790,
                37819,
                37849,
                37878,
                37908,
                37938,
                37967,
                37997,
                38027,
                38056,
                38085,
                38115,
                38144,
                38174,
                38203,
                38233,
                38262,
                38292,
                38322,
                38351,
                38381,
                38410,
                38440,
                38469,
                38499,
                38528,
                38558,
                38587,
                38617,
                38646,
                38676,
                38705,
                38735,
                38764,
                38794,
                38823,
                38853,
                38882,
                38912,
                38941,
                38971,
                39001,
                39030,
                39059,
                39089,
                39118,
                39148,
                39178,
                39208,
                39237,
                39267,
                39297,
                39326,
                39355,
                39385,
                39414,
                39444,
                39473,
                39503,
                39532,
                39562,
                39592,
                39621,
                39650,
                39680,
                39709,
                39739,
                39768,
                39798,
                39827,
                39857,
                39886,
                39916,
                39946,
                39975,
                40005,
                40035,
                40064,
                40094,
                40123,
                40153,
                40182,
                40212,
                40241,
                40271,
                40300,
                40330,
                40359,
                40389,
                40418,
                40448,
                40477,
                40507,
                40536,
                40566,
                40595,
                40625,
                40655,
                40685,
                40714,
                40744,
                40773,
                40803,
                40832,
                40862,
                40892,
                40921,
                40951,
                40980,
                41009,
                41039,
                41068,
                41098,
                41127,
                41157,
                41186,
                41216,
                41245,
                41275,
                41304,
                41334,
                41364,
                41393,
                41422,
                41452,
                41481,
                41511,
                41540,
                41570,
                41599,
                41629,
                41658,
                41688,
                41718,
                41748,
                41777,
                41807,
                41836,
                41865,
                41894,
                41924,
                41953,
                41983,
                42012,
                42042,
                42072,
                42102,
                42131,
                42161,
                42190,
                42220,
                42249,
                42279,
                42308,
                42337,
                42367,
                42397,
                42426,
                42456,
                42485,
                42515,
                42545,
                42574,
                42604,
                42633,
                42662,
                42692,
                42721,
                42751,
                42780,
                42810,
                42839,
                42869,
                42899,
                42929,
                42958,
                42988,
                43017,
                43046,
                43076,
                43105,
                43135,
                43164,
                43194,
                43223,
                43253,
                43283,
                43312,
                43342,
                43371,
                43401,
                43430,
                43460,
                43489,
                43519,
                43548,
                43578,
                43607,
                43637,
                43666,
                43696,
                43726,
                43755,
                43785,
                43814,
                43844,
                43873,
                43903,
                43932,
                43962,
                43991,
                44021,
                44050,
                44080,
                44109,
                44139,
                44169,
                44198,
                44228,
                44258,
                44287,
                44317,
                44346,
                44375,
                44405,
                44434,
                44464,
                44493,
                44523,
                44553,
                44582,
                44612,
                44641,
                44671,
                44700,
                44730,
                44759,
                44788,
                44818,
                44847,
                44877,
                44906,
                44936,
                44966,
                44996,
                45025,
                45055,
                45084,
                45114,
                45143,
                45172,
                45202,
                45231,
                45261,
                45290,
                45320,
                45350,
                45380,
                45409,
                45439,
                45468,
                45498,
                45527,
                45556,
                45586,
                45615,
                45644,
                45674,
                45704,
                45733,
                45763,
                45793,
                45823,
                45852,
                45882,
                45911,
                45940,
                45970,
                45999,
                46028,
                46058,
                46088,
                46117,
                46147,
                46177,
                46206,
                46236,
                46265,
                46295,
                46324,
                46354,
                46383,
                46413,
                46442,
                46472,
                46501,
                46531,
                46560,
                46590,
                46620,
                46649,
                46679,
                46708,
                46738,
                46767,
                46797,
                46826,
                46856,
                46885,
                46915,
                46944,
                46974,
                47003,
                47033,
                47063,
                47092,
                47122,
                47151,
                47181,
                47210,
                47240,
                47269,
                47298,
                47328,
                47357,
                47387,
                47417,
                47446,
                47476,
                47506,
                47535,
                47565,
                47594,
                47624,
                47653,
                47682,
                47712,
                47741,
                47771,
                47800,
                47830,
                47860,
                47890,
                47919,
                47949,
                47978,
                48008,
                48037,
                48066,
                48096,
                48125,
                48155,
                48184,
                48214,
                48244,
                48273,
                48303,
                48333,
                48362,
                48392,
                48421,
                48450,
                48480,
                48509,
                48538,
                48568,
                48598,
                48627,
                48657,
                48687,
                48717,
                48746,
                48776,
                48805,
                48834,
                48864,
                48893,
                48922,
                48952,
                48982,
                49011,
                49041,
                49071,
                49100,
                49130,
                49160,
                49189,
                49218,
                49248,
                49277,
                49306,
                49336,
                49365,
                49395,
                49425,
                49455,
                49484,
                49514,
                49543,
                49573,
                49602,
                49632,
                49661,
                49690,
                49720,
                49749,
                49779,
                49809,
                49838,
                49868,
                49898,
                49927,
                49957,
                49986,
                50016,
                50045,
                50075,
                50104,
                50133,
                50163,
                50192,
                50222,
                50252,
                50281,
                50311,
                50340,
                50370,
                50400,
                50429,
                50459,
                50488,
                50518,
                50547,
                50576,
                50606,
                50635,
                50665,
                50694,
                50724,
                50754,
                50784,
                50813,
                50843,
                50872,
                50902,
                50931,
                50960,
                50990,
                51019,
                51049,
                51078,
                51108,
                51138,
                51167,
                51197,
                51227,
                51256,
                51286,
                51315,
                51345,
                51374,
                51403,
                51433,
                51462,
                51492,
                51522,
                51552,
                51582,
                51611,
                51641,
                51670,
                51699,
                51729,
                51758,
                51787,
                51816,
                51846,
                51876,
                51906,
                51936,
                51965,
                51995,
                52025,
                52054,
                52083,
                52113,
                52142,
                52171,
                52200,
                52230,
                52260,
                52290,
                52319,
                52349,
                52379,
                52408,
                52438,
                52467,
                52497,
                52526,
                52555,
                52585,
                52614,
                52644,
                52673,
                52703,
                52733,
                52762,
                52792,
                52822,
                52851,
                52881,
                52910,
                52939,
                52969,
                52998,
                53028,
                53057,
                53087,
                53116,
                53146,
                53176,
                53205,
                53235,
                53264,
                53294,
                53324,
                53353,
                53383,
                53412,
                53441,
                53471,
                53500,
                53530,
                53559,
                53589,
                53619,
                53648,
                53678,
                53708,
                53737,
                53767,
                53796,
                53825,
                53855,
                53884,
                53913,
                53943,
                53973,
                54003,
                54032,
                54062,
                54092,
                54121,
                54151,
                54180,
                54209,
                54239,
                54268,
                54297,
                54327,
                54357,
                54387,
                54416,
                54446,
                54476,
                54505,
                54535,
                54564,
                54593,
                54623,
                54652,
                54681,
                54711,
                54741,
                54770,
                54800,
                54830,
                54859,
                54889,
                54919,
                54948,
                54977,
                55007,
                55036,
                55066,
                55095,
                55125,
                55154,
                55184,
                55213,
                55243,
                55273,
                55302,
                55332,
                55361,
                55391,
                55420,
                55450,
                55479,
                55508,
                55538,
                55567,
                55597,
                55627,
                55657,
                55686,
                55716,
                55745,
                55775,
                55804,
                55834,
                55863,
                55892,
                55922,
                55951,
                55981,
                56011,
                56040,
                56070,
                56100,
                56129,
                56159,
                56188,
                56218,
                56247,
                56276,
                56306,
                56335,
                56365,
                56394,
                56424,
                56454,
                56483,
                56513,
                56543,
                56572,
                56601,
                56631,
                56660,
                56690,
                56719,
                56749,
                56778,
                56808,
                56837,
                56867,
                56897,
                56926,
                56956,
                56985,
                57015,
                57044,
                57074,
                57103,
                57133,
                57162,
                57192,
                57221,
                57251,
                57280,
                57310,
                57340,
                57369,
                57399,
                57429,
                57458,
                57487,
                57517,
                57546,
                57576,
                57605,
                57634,
                57664,
                57694,
                57723,
                57753,
                57783,
                57813,
                57842,
                57871,
                57901,
                57930,
                57959,
                57989,
                58018,
                58048,
                58077,
                58107,
                58137,
                58167,
                58196,
                58226,
                58255,
                58285,
                58314,
                58343,
                58373,
                58402,
                58432,
                58461,
                58491,
                58521,
                58551,
                58580,
                58610,
                58639,
                58669,
                58698,
                58727,
                58757,
                58786,
                58816,
                58845,
                58875,
                58905,
                58934,
                58964,
                58994,
                59023,
                59053,
                59082,
                59111,
                59141,
                59170,
                59200,
                59229,
                59259,
                59288,
                59318,
                59348,
                59377,
                59407,
                59436,
                59466,
                59495,
                59525,
                59554,
                59584,
                59613,
                59643,
                59672,
                59702,
                59731,
                59761,
                59791,
                59820,
                59850,
                59879,
                59909,
                59939,
                59968,
                59997,
                60027,
                60056,
                60086,
                60115,
                60145,
                60174,
                60204,
                60234,
                60264,
                60293,
                60323,
                60352,
                60381,
                60411,
                60440,
                60469,
                60499,
                60528,
                60558,
                60588,
                60618,
                60648,
                60677,
                60707,
                60736,
                60765,
                60795,
                60824,
                60853,
                60883,
                60912,
                60942,
                60972,
                61002,
                61031,
                61061,
                61090,
                61120,
                61149,
                61179,
                61208,
                61237,
                61267,
                61296,
                61326,
                61356,
                61385,
                61415,
                61445,
                61474,
                61504,
                61533,
                61563,
                61592,
                61621,
                61651,
                61680,
                61710,
                61739,
                61769,
                61799,
                61828,
                61858,
                61888,
                61917,
                61947,
                61976,
                62006,
                62035,
                62064,
                62094,
                62123,
                62153,
                62182,
                62212,
                62242,
                62271,
                62301,
                62331,
                62360,
                62390,
                62419,
                62448,
                62478,
                62507,
                62537,
                62566,
                62596,
                62625,
                62655,
                62685,
                62715,
                62744,
                62774,
                62803,
                62832,
                62862,
                62891,
                62921,
                62950,
                62980,
                63009,
                63039,
                63069,
                63099,
                63128,
                63157,
                63187,
                63216,
                63246,
                63275,
                63305,
                63334,
                63363,
                63393,
                63423,
                63453,
                63482,
                63512,
                63541,
                63571,
                63600,
                63630,
                63659,
                63689,
                63718,
                63747,
                63777,
                63807,
                63836,
                63866,
                63895,
                63925,
                63955,
                63984,
                64014,
                64043,
                64073,
                64102,
                64131,
                64161,
                64190,
                64220,
                64249,
                64279,
                64309,
                64339,
                64368,
                64398,
                64427,
                64457,
                64486,
                64515,
                64545,
                64574,
                64603,
                64633,
                64663,
                64692,
                64722,
                64752,
                64782,
                64811,
                64841,
                64870,
                64899,
                64929,
                64958,
                64987,
                65017,
                65047,
                65076,
                65106,
                65136,
                65166,
                65195,
                65225,
                65254,
                65283,
                65313,
                65342,
                65371,
                65401,
                65431,
                65460,
                65490,
                65520,
                65549,
                65579,
                65608,
                65638,
                65667,
                65697,
                65726,
                65755,
                65785,
                65815,
                65844,
                65874,
                65903,
                65933,
                65963,
                65992,
                66022,
                66051,
                66081,
                66110,
                66140,
                66169,
                66199,
                66228,
                66258,
                66287,
                66317,
                66346,
                66376,
                66405,
                66435,
                66465,
                66494,
                66524,
                66553,
                66583,
                66612,
                66641,
                66671,
                66700,
                66730,
                66760,
                66789,
                66819,
                66849,
                66878,
                66908,
                66937,
                66967,
                66996,
                67025,
                67055,
                67084,
                67114,
                67143,
                67173,
                67203,
                67233,
                67262,
                67292,
                67321,
                67351,
                67380,
                67409,
                67439,
                67468,
                67497,
                67527,
                67557,
                67587,
                67617,
                67646,
                67676,
                67705,
                67735,
                67764,
                67793,
                67823,
                67852,
                67882,
                67911,
                67941,
                67971,
                68e3,
                68030,
                68060,
                68089,
                68119,
                68148,
                68177,
                68207,
                68236,
                68266,
                68295,
                68325,
                68354,
                68384,
                68414,
                68443,
                68473,
                68502,
                68532,
                68561,
                68591,
                68620,
                68650,
                68679,
                68708,
                68738,
                68768,
                68797,
                68827,
                68857,
                68886,
                68916,
                68946,
                68975,
                69004,
                69034,
                69063,
                69092,
                69122,
                69152,
                69181,
                69211,
                69240,
                69270,
                69300,
                69330,
                69359,
                69388,
                69418,
                69447,
                69476,
                69506,
                69535,
                69565,
                69595,
                69624,
                69654,
                69684,
                69713,
                69743,
                69772,
                69802,
                69831,
                69861,
                69890,
                69919,
                69949,
                69978,
                70008,
                70038,
                70067,
                70097,
                70126,
                70156,
                70186,
                70215,
                70245,
                70274,
                70303,
                70333,
                70362,
                70392,
                70421,
                70451,
                70481,
                70510,
                70540,
                70570,
                70599,
                70629,
                70658,
                70687,
                70717,
                70746,
                70776,
                70805,
                70835,
                70864,
                70894,
                70924,
                70954,
                70983,
                71013,
                71042,
                71071,
                71101,
                71130,
                71159,
                71189,
                71218,
                71248,
                71278,
                71308,
                71337,
                71367,
                71397,
                71426,
                71455,
                71485,
                71514,
                71543,
                71573,
                71602,
                71632,
                71662,
                71691,
                71721,
                71751,
                71781,
                71810,
                71839,
                71869,
                71898,
                71927,
                71957,
                71986,
                72016,
                72046,
                72075,
                72105,
                72135,
                72164,
                72194,
                72223,
                72253,
                72282,
                72311,
                72341,
                72370,
                72400,
                72429,
                72459,
                72489,
                72518,
                72548,
                72577,
                72607,
                72637,
                72666,
                72695,
                72725,
                72754,
                72784,
                72813,
                72843,
                72872,
                72902,
                72931,
                72961,
                72991,
                73020,
                73050,
                73080,
                73109,
                73139,
                73168,
                73197,
                73227,
                73256,
                73286,
                73315,
                73345,
                73375,
                73404,
                73434,
                73464,
                73493,
                73523,
                73552,
                73581,
                73611,
                73640,
                73669,
                73699,
                73729,
                73758,
                73788,
                73818,
                73848,
                73877,
                73907,
                73936,
                73965,
                73995,
                74024,
                74053,
                74083,
                74113,
                74142,
                74172,
                74202,
                74231,
                74261,
                74291,
                74320,
                74349,
                74379,
                74408,
                74437,
                74467,
                74497,
                74526,
                74556,
                74586,
                74615,
                74645,
                74675,
                74704,
                74733,
                74763,
                74792,
                74822,
                74851,
                74881,
                74910,
                74940,
                74969,
                74999,
                75029,
                75058,
                75088,
                75117,
                75147,
                75176,
                75206,
                75235,
                75264,
                75294,
                75323,
                75353,
                75383,
                75412,
                75442,
                75472,
                75501,
                75531,
                75560,
                75590,
                75619,
                75648,
                75678,
                75707,
                75737,
                75766,
                75796,
                75826,
                75856,
                75885,
                75915,
                75944,
                75974,
                76003,
                76032,
                76062,
                76091,
                76121,
                76150,
                76180,
                76210,
                76239,
                76269,
                76299,
                76328,
                76358,
                76387,
                76416,
                76446,
                76475,
                76505,
                76534,
                76564,
                76593,
                76623,
                76653,
                76682,
                76712,
                76741,
                76771,
                76801,
                76830,
                76859,
                76889,
                76918,
                76948,
                76977,
                77007,
                77036,
                77066,
                77096,
                77125,
                77155,
                77185,
                77214,
                77243,
                77273,
                77302,
                77332,
                77361,
                77390,
                77420,
                77450,
                77479,
                77509,
                77539,
                77569,
                77598,
                77627,
                77657,
                77686,
                77715,
                77745,
                77774,
                77804,
                77833,
                77863,
                77893,
                77923,
                77952,
                77982,
                78011,
                78041,
                78070,
                78099,
                78129,
                78158,
                78188,
                78217,
                78247,
                78277,
                78307,
                78336,
                78366,
                78395,
                78425,
                78454,
                78483,
                78513,
                78542,
                78572,
                78601,
                78631,
                78661,
                78690,
                78720,
                78750,
                78779,
                78808,
                78838,
                78867,
                78897,
                78926,
                78956,
                78985,
                79015,
                79044,
                79074,
                79104,
                79133,
                79163,
                79192,
                79222,
                79251,
                79281,
                79310,
                79340,
                79369,
                79399,
                79428,
                79458,
                79487,
                79517,
                79546,
                79576,
                79606,
                79635,
                79665,
                79695,
                79724,
                79753,
                79783,
                79812,
                79841,
                79871,
                79900,
                79930,
                79960,
                79990
              ];
            }
          ),
          /***/
          8700: (
            /***/
            function(s, c, i) {
              var l = i(896);
              function v() {
                this.regionalOptions = [], this.regionalOptions[""] = {
                  invalidCalendar: "Calendar {0} not found",
                  invalidDate: "Invalid {0} date",
                  invalidMonth: "Invalid {0} month",
                  invalidYear: "Invalid {0} year",
                  differentCalendars: "Cannot mix {0} and {1} dates"
                }, this.local = this.regionalOptions[""], this.calendars = {}, this._localCals = {};
              }
              l(v.prototype, {
                /** Obtain a calendar implementation and localisation.
                    @memberof Calendars
                    @param [name='gregorian'] {string} The name of the calendar, e.g. 'gregorian', 'persian', 'islamic'.
                    @param [language=''] {string} The language code to use for localisation (default is English).
                    @return {Calendar} The calendar and localisation.
                    @throws Error if calendar not found. */
                instance: function(m, h) {
                  m = (m || "gregorian").toLowerCase(), h = h || "";
                  var w = this._localCals[m + "-" + h];
                  if (!w && this.calendars[m] && (w = new this.calendars[m](h), this._localCals[m + "-" + h] = w), !w)
                    throw (this.local.invalidCalendar || this.regionalOptions[""].invalidCalendar).replace(/\{0\}/, m);
                  return w;
                },
                /** Create a new date - for today if no other parameters given.
                    @memberof Calendars
                    @param year {CDate|number} The date to copy or the year for the date.
                    @param [month] {number} The month for the date.
                    @param [day] {number} The day for the date.
                    @param [calendar='gregorian'] {BaseCalendar|string} The underlying calendar or the name of the calendar.
                    @param [language=''] {string} The language to use for localisation (default English).
                    @return {CDate} The new date.
                    @throws Error if an invalid date. */
                newDate: function(m, h, w, S, E) {
                  return S = (m != null && m.year ? m.calendar() : typeof S == "string" ? this.instance(S, E) : S) || this.instance(), S.newDate(m, h, w);
                },
                /** A simple digit substitution function for localising numbers via the Calendar digits option.
                    @member Calendars
                    @param digits {string[]} The substitute digits, for 0 through 9.
                    @return {function} The substitution function. */
                substituteDigits: function(m) {
                  return function(h) {
                    return (h + "").replace(/[0-9]/g, function(w) {
                      return m[w];
                    });
                  };
                },
                /** Digit substitution function for localising Chinese style numbers via the Calendar digits option.
                    @member Calendars
                    @param digits {string[]} The substitute digits, for 0 through 9.
                    @param powers {string[]} The characters denoting powers of 10, i.e. 1, 10, 100, 1000.
                    @return {function} The substitution function. */
                substituteChineseDigits: function(m, h) {
                  return function(w) {
                    for (var S = "", E = 0; w > 0; ) {
                      var x = w % 10;
                      S = (x === 0 ? "" : m[x] + h[E]) + S, E++, w = Math.floor(w / 10);
                    }
                    return S.indexOf(m[1] + h[1]) === 0 && (S = S.substr(1)), S || m[0];
                  };
                }
              });
              function f(m, h, w, S) {
                if (this._calendar = m, this._year = h, this._month = w, this._day = S, this._calendar._validateLevel === 0 && !this._calendar.isValid(this._year, this._month, this._day))
                  throw (C.local.invalidDate || C.regionalOptions[""].invalidDate).replace(/\{0\}/, this._calendar.local.name);
              }
              function p(m, h) {
                return m = "" + m, "000000".substring(0, h - m.length) + m;
              }
              l(f.prototype, {
                /** Create a new date.
                    @memberof CDate
                    @param [year] {CDate|number} The date to copy or the year for the date (default this date).
                    @param [month] {number} The month for the date.
                    @param [day] {number} The day for the date.
                    @return {CDate} The new date.
                    @throws Error if an invalid date. */
                newDate: function(m, h, w) {
                  return this._calendar.newDate(m ?? this, h, w);
                },
                /** Set or retrieve the year for this date.
                    @memberof CDate
                    @param [year] {number} The year for the date.
                    @return {number|CDate} The date's year (if no parameter) or the updated date.
                    @throws Error if an invalid date. */
                year: function(m) {
                  return arguments.length === 0 ? this._year : this.set(m, "y");
                },
                /** Set or retrieve the month for this date.
                    @memberof CDate
                    @param [month] {number} The month for the date.
                    @return {number|CDate} The date's month (if no parameter) or the updated date.
                    @throws Error if an invalid date. */
                month: function(m) {
                  return arguments.length === 0 ? this._month : this.set(m, "m");
                },
                /** Set or retrieve the day for this date.
                    @memberof CDate
                    @param [day] {number} The day for the date.
                    @return {number|CData} The date's day (if no parameter) or the updated date.
                    @throws Error if an invalid date. */
                day: function(m) {
                  return arguments.length === 0 ? this._day : this.set(m, "d");
                },
                /** Set new values for this date.
                    @memberof CDate
                    @param year {number} The year for the date.
                    @param month {number} The month for the date.
                    @param day {number} The day for the date.
                    @return {CDate} The updated date.
                    @throws Error if an invalid date. */
                date: function(m, h, w) {
                  if (!this._calendar.isValid(m, h, w))
                    throw (C.local.invalidDate || C.regionalOptions[""].invalidDate).replace(/\{0\}/, this._calendar.local.name);
                  return this._year = m, this._month = h, this._day = w, this;
                },
                /** Determine whether this date is in a leap year.
                    @memberof CDate
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not. */
                leapYear: function() {
                  return this._calendar.leapYear(this);
                },
                /** Retrieve the epoch designator for this date, e.g. BCE or CE.
                    @memberof CDate
                    @return {string} The current epoch. */
                epoch: function() {
                  return this._calendar.epoch(this);
                },
                /** Format the year, if not a simple sequential number.
                    @memberof CDate
                    @return {string} The formatted year. */
                formatYear: function() {
                  return this._calendar.formatYear(this);
                },
                /** Retrieve the month of the year for this date,
                    i.e. the month's position within a numbered year.
                    @memberof CDate
                    @return {number} The month of the year: <code>minMonth</code> to months per year. */
                monthOfYear: function() {
                  return this._calendar.monthOfYear(this);
                },
                /** Retrieve the week of the year for this date.
                    @memberof CDate
                    @return {number} The week of the year: 1 to weeks per year. */
                weekOfYear: function() {
                  return this._calendar.weekOfYear(this);
                },
                /** Retrieve the number of days in the year for this date.
                    @memberof CDate
                    @return {number} The number of days in this year. */
                daysInYear: function() {
                  return this._calendar.daysInYear(this);
                },
                /** Retrieve the day of the year for this date.
                    @memberof CDate
                    @return {number} The day of the year: 1 to days per year. */
                dayOfYear: function() {
                  return this._calendar.dayOfYear(this);
                },
                /** Retrieve the number of days in the month for this date.
                    @memberof CDate
                    @return {number} The number of days. */
                daysInMonth: function() {
                  return this._calendar.daysInMonth(this);
                },
                /** Retrieve the day of the week for this date.
                    @memberof CDate
                    @return {number} The day of the week: 0 to number of days - 1. */
                dayOfWeek: function() {
                  return this._calendar.dayOfWeek(this);
                },
                /** Determine whether this date is a week day.
                    @memberof CDate
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not. */
                weekDay: function() {
                  return this._calendar.weekDay(this);
                },
                /** Retrieve additional information about this date.
                    @memberof CDate
                    @return {object} Additional information - contents depends on calendar. */
                extraInfo: function() {
                  return this._calendar.extraInfo(this);
                },
                /** Add period(s) to a date.
                    @memberof CDate
                    @param offset {number} The number of periods to adjust by.
                    @param period {string} One of 'y' for year, 'm' for month, 'w' for week, 'd' for day.
                    @return {CDate} The updated date. */
                add: function(m, h) {
                  return this._calendar.add(this, m, h);
                },
                /** Set a portion of the date.
                    @memberof CDate
                    @param value {number} The new value for the period.
                    @param period {string} One of 'y' for year, 'm' for month, 'd' for day.
                    @return {CDate} The updated date.
                    @throws Error if not a valid date. */
                set: function(m, h) {
                  return this._calendar.set(this, m, h);
                },
                /** Compare this date to another date.
                    @memberof CDate
                    @param date {CDate} The other date.
                    @return {number} -1 if this date is before the other date,
                            0 if they are equal, or +1 if this date is after the other date. */
                compareTo: function(m) {
                  if (this._calendar.name !== m._calendar.name)
                    throw (C.local.differentCalendars || C.regionalOptions[""].differentCalendars).replace(/\{0\}/, this._calendar.local.name).replace(/\{1\}/, m._calendar.local.name);
                  var h = this._year !== m._year ? this._year - m._year : this._month !== m._month ? this.monthOfYear() - m.monthOfYear() : this._day - m._day;
                  return h === 0 ? 0 : h < 0 ? -1 : 1;
                },
                /** Retrieve the calendar backing this date.
                    @memberof CDate
                    @return {BaseCalendar} The calendar implementation. */
                calendar: function() {
                  return this._calendar;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof CDate
                    @return {number} The equivalent Julian date. */
                toJD: function() {
                  return this._calendar.toJD(this);
                },
                /** Create a new date from a Julian date.
                    @memberof CDate
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(m) {
                  return this._calendar.fromJD(m);
                },
                /** Convert this date to a standard (Gregorian) JavaScript Date.
                    @memberof CDate
                    @return {Date} The equivalent JavaScript date. */
                toJSDate: function() {
                  return this._calendar.toJSDate(this);
                },
                /** Create a new date from a standard (Gregorian) JavaScript Date.
                    @memberof CDate
                    @param jsd {Date} The JavaScript date to convert.
                    @return {CDate} The equivalent date. */
                fromJSDate: function(m) {
                  return this._calendar.fromJSDate(m);
                },
                /** Convert to a string for display.
                    @memberof CDate
                    @return {string} This date as a string. */
                toString: function() {
                  return (this.year() < 0 ? "-" : "") + p(Math.abs(this.year()), 4) + "-" + p(this.month(), 2) + "-" + p(this.day(), 2);
                }
              });
              function g() {
                this.shortYearCutoff = "+10";
              }
              l(g.prototype, {
                _validateLevel: 0,
                // "Stack" to turn validation on/off
                /** Create a new date within this calendar - today if no parameters given.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to duplicate or the year for the date.
                    @param [month] {number} The month for the date.
                    @param [day] {number} The day for the date.
                    @return {CDate} The new date.
                    @throws Error if not a valid date or a different calendar used. */
                newDate: function(m, h, w) {
                  return m == null ? this.today() : (m.year && (this._validate(
                    m,
                    h,
                    w,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  ), w = m.day(), h = m.month(), m = m.year()), new f(this, m, h, w));
                },
                /** Create a new date for today.
                    @memberof BaseCalendar
                    @return {CDate} Today's date. */
                today: function() {
                  return this.fromJSDate(/* @__PURE__ */ new Date());
                },
                /** Retrieve the epoch designator for this date.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {string} The current epoch.
                    @throws Error if an invalid year or a different calendar used. */
                epoch: function(m) {
                  var h = this._validate(
                    m,
                    this.minMonth,
                    this.minDay,
                    C.local.invalidYear || C.regionalOptions[""].invalidYear
                  );
                  return h.year() < 0 ? this.local.epochs[0] : this.local.epochs[1];
                },
                /** Format the year, if not a simple sequential number
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to format or the year to format.
                    @return {string} The formatted year.
                    @throws Error if an invalid year or a different calendar used. */
                formatYear: function(m) {
                  var h = this._validate(
                    m,
                    this.minMonth,
                    this.minDay,
                    C.local.invalidYear || C.regionalOptions[""].invalidYear
                  );
                  return (h.year() < 0 ? "-" : "") + p(Math.abs(h.year()), 4);
                },
                /** Retrieve the number of months in a year.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of months.
                    @throws Error if an invalid year or a different calendar used. */
                monthsInYear: function(m) {
                  return this._validate(
                    m,
                    this.minMonth,
                    this.minDay,
                    C.local.invalidYear || C.regionalOptions[""].invalidYear
                  ), 12;
                },
                /** Calculate the month's ordinal position within the year -
                    for those calendars that don't start at month 1!
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param month {number} The month to examine.
                    @return {number} The ordinal position, starting from <code>minMonth</code>.
                    @throws Error if an invalid year/month or a different calendar used. */
                monthOfYear: function(m, h) {
                  var w = this._validate(
                    m,
                    h,
                    this.minDay,
                    C.local.invalidMonth || C.regionalOptions[""].invalidMonth
                  );
                  return (w.month() + this.monthsInYear(w) - this.firstMonth) % this.monthsInYear(w) + this.minMonth;
                },
                /** Calculate actual month from ordinal position, starting from minMonth.
                    @memberof BaseCalendar
                    @param year {number} The year to examine.
                    @param ord {number} The month's ordinal position.
                    @return {number} The month's number.
                    @throws Error if an invalid year/month. */
                fromMonthOfYear: function(m, h) {
                  var w = (h + this.firstMonth - 2 * this.minMonth) % this.monthsInYear(m) + this.minMonth;
                  return this._validate(
                    m,
                    w,
                    this.minDay,
                    C.local.invalidMonth || C.regionalOptions[""].invalidMonth
                  ), w;
                },
                /** Retrieve the number of days in a year.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {number} The number of days.
                    @throws Error if an invalid year or a different calendar used. */
                daysInYear: function(m) {
                  var h = this._validate(
                    m,
                    this.minMonth,
                    this.minDay,
                    C.local.invalidYear || C.regionalOptions[""].invalidYear
                  );
                  return this.leapYear(h) ? 366 : 365;
                },
                /** Retrieve the day of the year for a date.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The day of the year.
                    @throws Error if an invalid date or a different calendar used. */
                dayOfYear: function(m, h, w) {
                  var S = this._validate(
                    m,
                    h,
                    w,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  );
                  return S.toJD() - this.newDate(
                    S.year(),
                    this.fromMonthOfYear(S.year(), this.minMonth),
                    this.minDay
                  ).toJD() + 1;
                },
                /** Retrieve the number of days in a week.
                    @memberof BaseCalendar
                    @return {number} The number of days. */
                daysInWeek: function() {
                  return 7;
                },
                /** Retrieve the day of the week for a date.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The day of the week: 0 to number of days - 1.
                    @throws Error if an invalid date or a different calendar used. */
                dayOfWeek: function(m, h, w) {
                  var S = this._validate(
                    m,
                    h,
                    w,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  );
                  return (Math.floor(this.toJD(S)) + 2) % this.daysInWeek();
                },
                /** Retrieve additional information about a date.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {object} Additional information - contents depends on calendar.
                    @throws Error if an invalid date or a different calendar used. */
                extraInfo: function(m, h, w) {
                  return this._validate(
                    m,
                    h,
                    w,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  ), {};
                },
                /** Add period(s) to a date.
                    Cater for no year zero.
                    @memberof BaseCalendar
                    @param date {CDate} The starting date.
                    @param offset {number} The number of periods to adjust by.
                    @param period {string} One of 'y' for year, 'm' for month, 'w' for week, 'd' for day.
                    @return {CDate} The updated date.
                    @throws Error if a different calendar used. */
                add: function(m, h, w) {
                  return this._validate(
                    m,
                    this.minMonth,
                    this.minDay,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  ), this._correctAdd(m, this._add(m, h, w), h, w);
                },
                /** Add period(s) to a date.
                    @memberof BaseCalendar
                    @private
                    @param date {CDate} The starting date.
                    @param offset {number} The number of periods to adjust by.
                    @param period {string} One of 'y' for year, 'm' for month, 'w' for week, 'd' for day.
                    @return {CDate} The updated date. */
                _add: function(m, h, w) {
                  if (this._validateLevel++, w === "d" || w === "w") {
                    var S = m.toJD() + h * (w === "w" ? this.daysInWeek() : 1), E = m.calendar().fromJD(S);
                    return this._validateLevel--, [E.year(), E.month(), E.day()];
                  }
                  try {
                    var x = m.year() + (w === "y" ? h : 0), T = m.monthOfYear() + (w === "m" ? h : 0), E = m.day(), F = function(I) {
                      for (; T < I.minMonth; )
                        x--, T += I.monthsInYear(x);
                      for (var L = I.monthsInYear(x); T > L - 1 + I.minMonth; )
                        x++, T -= L, L = I.monthsInYear(x);
                    };
                    w === "y" ? (m.month() !== this.fromMonthOfYear(x, T) && (T = this.newDate(x, m.month(), this.minDay).monthOfYear()), T = Math.min(T, this.monthsInYear(x)), E = Math.min(E, this.daysInMonth(x, this.fromMonthOfYear(x, T)))) : w === "m" && (F(this), E = Math.min(E, this.daysInMonth(x, this.fromMonthOfYear(x, T))));
                    var P = [x, this.fromMonthOfYear(x, T), E];
                    return this._validateLevel--, P;
                  } catch (k) {
                    throw this._validateLevel--, k;
                  }
                },
                /** Correct a candidate date after adding period(s) to a date.
                    Handle no year zero if necessary.
                    @memberof BaseCalendar
                    @private
                    @param date {CDate} The starting date.
                    @param ymd {number[]} The added date.
                    @param offset {number} The number of periods to adjust by.
                    @param period {string} One of 'y' for year, 'm' for month, 'w' for week, 'd' for day.
                    @return {CDate} The updated date. */
                _correctAdd: function(m, h, w, S) {
                  if (!this.hasYearZero && (S === "y" || S === "m") && (h[0] === 0 || // In year zero
                  m.year() > 0 != h[0] > 0)) {
                    var E = {
                      y: [1, 1, "y"],
                      m: [1, this.monthsInYear(-1), "m"],
                      w: [this.daysInWeek(), this.daysInYear(-1), "d"],
                      d: [1, this.daysInYear(-1), "d"]
                    }[S], x = w < 0 ? -1 : 1;
                    h = this._add(m, w * E[0] + x * E[1], E[2]);
                  }
                  return m.date(h[0], h[1], h[2]);
                },
                /** Set a portion of the date.
                    @memberof BaseCalendar
                    @param date {CDate} The starting date.
                    @param value {number} The new value for the period.
                    @param period {string} One of 'y' for year, 'm' for month, 'd' for day.
                    @return {CDate} The updated date.
                    @throws Error if an invalid date or a different calendar used. */
                set: function(m, h, w) {
                  this._validate(
                    m,
                    this.minMonth,
                    this.minDay,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  );
                  var S = w === "y" ? h : m.year(), E = w === "m" ? h : m.month(), x = w === "d" ? h : m.day();
                  return (w === "y" || w === "m") && (x = Math.min(x, this.daysInMonth(S, E))), m.date(S, E, x);
                },
                /** Determine whether a date is valid for this calendar.
                    @memberof BaseCalendar
                    @param year {number} The year to examine.
                    @param month {number} The month to examine.
                    @param day {number} The day to examine.
                    @return {boolean} <code>true</code> if a valid date, <code>false</code> if not. */
                isValid: function(m, h, w) {
                  this._validateLevel++;
                  var S = this.hasYearZero || m !== 0;
                  if (S) {
                    var E = this.newDate(m, h, this.minDay);
                    S = h >= this.minMonth && h - this.minMonth < this.monthsInYear(E) && w >= this.minDay && w - this.minDay < this.daysInMonth(E);
                  }
                  return this._validateLevel--, S;
                },
                /** Convert the date to a standard (Gregorian) JavaScript Date.
                    @memberof BaseCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {Date} The equivalent JavaScript date.
                    @throws Error if an invalid date or a different calendar used. */
                toJSDate: function(m, h, w) {
                  var S = this._validate(
                    m,
                    h,
                    w,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  );
                  return C.instance().fromJD(this.toJD(S)).toJSDate();
                },
                /** Convert the date from a standard (Gregorian) JavaScript Date.
                    @memberof BaseCalendar
                    @param jsd {Date} The JavaScript date.
                    @return {CDate} The equivalent calendar date. */
                fromJSDate: function(m) {
                  return this.fromJD(C.instance().fromJSDate(m).toJD());
                },
                /** Check that a candidate date is from the same calendar and is valid.
                    @memberof BaseCalendar
                    @private
                    @param year {CDate|number} The date to validate or the year to validate.
                    @param [month] {number} The month to validate.
                    @param [day] {number} The day to validate.
                    @param error {string} Rrror message if invalid.
                    @throws Error if different calendars used or invalid date. */
                _validate: function(m, h, w, S) {
                  if (m.year) {
                    if (this._validateLevel === 0 && this.name !== m.calendar().name)
                      throw (C.local.differentCalendars || C.regionalOptions[""].differentCalendars).replace(/\{0\}/, this.local.name).replace(/\{1\}/, m.calendar().local.name);
                    return m;
                  }
                  try {
                    if (this._validateLevel++, this._validateLevel === 1 && !this.isValid(m, h, w))
                      throw S.replace(/\{0\}/, this.local.name);
                    var E = this.newDate(m, h, w);
                    return this._validateLevel--, E;
                  } catch (x) {
                    throw this._validateLevel--, x;
                  }
                }
              });
              function y(m) {
                this.local = this.regionalOptions[m] || this.regionalOptions[""];
              }
              y.prototype = new g(), l(y.prototype, {
                /** The calendar name.
                    @memberof GregorianCalendar */
                name: "Gregorian",
                /** Julian date of start of Gregorian epoch: 1 January 0001 CE.
                   @memberof GregorianCalendar */
                jdEpoch: 17214255e-1,
                /** Days per month in a common year.
                   @memberof GregorianCalendar */
                daysPerMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
                /** <code>true</code> if has a year zero, <code>false</code> if not.
                   @memberof GregorianCalendar */
                hasYearZero: !1,
                /** The minimum month number.
                    @memberof GregorianCalendar */
                minMonth: 1,
                /** The first month in the year.
                    @memberof GregorianCalendar */
                firstMonth: 1,
                /** The minimum day number.
                   @memberof GregorianCalendar */
                minDay: 1,
                /** Localisations for the plugin.
                    Entries are objects indexed by the language code ('' being the default US/English).
                    Each object has the following attributes.
                    @memberof GregorianCalendar
                    @property name {string} The calendar name.
                    @property epochs {string[]} The epoch names.
                    @property monthNames {string[]} The long names of the months of the year.
                    @property monthNamesShort {string[]} The short names of the months of the year.
                    @property dayNames {string[]} The long names of the days of the week.
                    @property dayNamesShort {string[]} The short names of the days of the week.
                    @property dayNamesMin {string[]} The minimal names of the days of the week.
                    @property dateFormat {string} The date format for this calendar.
                            See the options on <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a> for details.
                    @property firstDay {number} The number of the first day of the week, starting at 0.
                    @property isRTL {number} <code>true</code> if this localisation reads right-to-left. */
                regionalOptions: {
                  // Localisations
                  "": {
                    name: "Gregorian",
                    epochs: ["BCE", "CE"],
                    monthNames: [
                      "January",
                      "February",
                      "March",
                      "April",
                      "May",
                      "June",
                      "July",
                      "August",
                      "September",
                      "October",
                      "November",
                      "December"
                    ],
                    monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
                    dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                    dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                    dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
                    digits: null,
                    dateFormat: "mm/dd/yyyy",
                    firstDay: 0,
                    isRTL: !1
                  }
                },
                /** Determine whether this date is in a leap year.
                    @memberof GregorianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @return {boolean} <code>true</code> if this is a leap year, <code>false</code> if not.
                    @throws Error if an invalid year or a different calendar used. */
                leapYear: function(w) {
                  var h = this._validate(
                    w,
                    this.minMonth,
                    this.minDay,
                    C.local.invalidYear || C.regionalOptions[""].invalidYear
                  ), w = h.year() + (h.year() < 0 ? 1 : 0);
                  return w % 4 === 0 && (w % 100 !== 0 || w % 400 === 0);
                },
                /** Determine the week of the year for a date - ISO 8601.
                    @memberof GregorianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {number} The week of the year, starting from 1.
                    @throws Error if an invalid date or a different calendar used. */
                weekOfYear: function(m, h, w) {
                  var S = this.newDate(m, h, w);
                  return S.add(4 - (S.dayOfWeek() || 7), "d"), Math.floor((S.dayOfYear() - 1) / 7) + 1;
                },
                /** Retrieve the number of days in a month.
                    @memberof GregorianCalendar
                    @param year {CDate|number} The date to examine or the year of the month.
                    @param [month] {number} The month.
                    @return {number} The number of days in this month.
                    @throws Error if an invalid month/year or a different calendar used. */
                daysInMonth: function(m, h) {
                  var w = this._validate(
                    m,
                    h,
                    this.minDay,
                    C.local.invalidMonth || C.regionalOptions[""].invalidMonth
                  );
                  return this.daysPerMonth[w.month() - 1] + (w.month() === 2 && this.leapYear(w.year()) ? 1 : 0);
                },
                /** Determine whether this date is a week day.
                    @memberof GregorianCalendar
                    @param year {CDate|number} The date to examine or the year to examine.
                    @param [month] {number} The month to examine.
                    @param [day] {number} The day to examine.
                    @return {boolean} <code>true</code> if a week day, <code>false</code> if not.
                    @throws Error if an invalid date or a different calendar used. */
                weekDay: function(m, h, w) {
                  return (this.dayOfWeek(m, h, w) || 7) < 6;
                },
                /** Retrieve the Julian date equivalent for this date,
                    i.e. days since January 1, 4713 BCE Greenwich noon.
                    @memberof GregorianCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {number} The equivalent Julian date.
                    @throws Error if an invalid date or a different calendar used. */
                toJD: function(m, h, w) {
                  var S = this._validate(
                    m,
                    h,
                    w,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  );
                  m = S.year(), h = S.month(), w = S.day(), m < 0 && m++, h < 3 && (h += 12, m--);
                  var E = Math.floor(m / 100), x = 2 - E + Math.floor(E / 4);
                  return Math.floor(365.25 * (m + 4716)) + Math.floor(30.6001 * (h + 1)) + w + x - 1524.5;
                },
                /** Create a new date from a Julian date.
                    @memberof GregorianCalendar
                    @param jd {number} The Julian date to convert.
                    @return {CDate} The equivalent date. */
                fromJD: function(m) {
                  var h = Math.floor(m + 0.5), w = Math.floor((h - 186721625e-2) / 36524.25);
                  w = h + 1 + w - Math.floor(w / 4);
                  var S = w + 1524, E = Math.floor((S - 122.1) / 365.25), x = Math.floor(365.25 * E), T = Math.floor((S - x) / 30.6001), F = S - x - Math.floor(T * 30.6001), P = T - (T > 13.5 ? 13 : 1), k = E - (P > 2.5 ? 4716 : 4715);
                  return k <= 0 && k--, this.newDate(k, P, F);
                },
                /** Convert this date to a standard (Gregorian) JavaScript Date.
                    @memberof GregorianCalendar
                    @param year {CDate|number} The date to convert or the year to convert.
                    @param [month] {number} The month to convert.
                    @param [day] {number} The day to convert.
                    @return {Date} The equivalent JavaScript date.
                    @throws Error if an invalid date or a different calendar used. */
                toJSDate: function(m, h, w) {
                  var S = this._validate(
                    m,
                    h,
                    w,
                    C.local.invalidDate || C.regionalOptions[""].invalidDate
                  ), E = new Date(S.year(), S.month() - 1, S.day());
                  return E.setHours(0), E.setMinutes(0), E.setSeconds(0), E.setMilliseconds(0), E.setHours(E.getHours() > 12 ? E.getHours() + 2 : 0), E;
                },
                /** Create a new date from a standard (Gregorian) JavaScript Date.
                    @memberof GregorianCalendar
                    @param jsd {Date} The JavaScript date to convert.
                    @return {CDate} The equivalent date. */
                fromJSDate: function(m) {
                  return this.newDate(m.getFullYear(), m.getMonth() + 1, m.getDate());
                }
              });
              var C = s.exports = new v();
              C.cdate = f, C.baseCalendar = g, C.calendars.gregorian = y;
            }
          ),
          /***/
          5168: (
            /***/
            function(s, c, i) {
              var l = i(896), v = i(8700);
              l(v.regionalOptions[""], {
                invalidArguments: "Invalid arguments",
                invalidFormat: "Cannot format a date from another calendar",
                missingNumberAt: "Missing number at position {0}",
                unknownNameAt: "Unknown name at position {0}",
                unexpectedLiteralAt: "Unexpected literal at position {0}",
                unexpectedText: "Additional text found at end"
              }), v.local = v.regionalOptions[""], l(v.cdate.prototype, {
                /** Format this date.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof CDate
                    @param [format] {string} The date format to use (see <a href="BaseCalendar.html#formatDate"><code>formatDate</code></a>).
                    @param [settings] {object} Options for the <code>formatDate</code> function.
                    @return {string} The formatted date. */
                formatDate: function(f, p) {
                  return typeof f != "string" && (p = f, f = ""), this._calendar.formatDate(f || "", this, p);
                }
              }), l(v.baseCalendar.prototype, {
                UNIX_EPOCH: v.instance().newDate(1970, 1, 1).toJD(),
                SECS_PER_DAY: 86400,
                TICKS_EPOCH: v.instance().jdEpoch,
                // 1 January 0001 CE
                TICKS_PER_DAY: 864e9,
                /** Date form for ATOM (RFC 3339/ISO 8601).
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                ATOM: "yyyy-mm-dd",
                /** Date form for cookies.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                COOKIE: "D, dd M yyyy",
                /** Date form for full date.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                FULL: "DD, MM d, yyyy",
                /** Date form for ISO 8601.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                ISO_8601: "yyyy-mm-dd",
                /** Date form for Julian date.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                JULIAN: "J",
                /** Date form for RFC 822.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                RFC_822: "D, d M yy",
                /** Date form for RFC 850.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                RFC_850: "DD, dd-M-yy",
                /** Date form for RFC 1036.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                RFC_1036: "D, d M yy",
                /** Date form for RFC 1123.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                RFC_1123: "D, d M yyyy",
                /** Date form for RFC 2822.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                RFC_2822: "D, d M yyyy",
                /** Date form for RSS (RFC 822).
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                RSS: "D, d M yy",
                /** Date form for Windows ticks.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                TICKS: "!",
                /** Date form for Unix timestamp.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                TIMESTAMP: "@",
                /** Date form for W3c (ISO 8601).
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar */
                W3C: "yyyy-mm-dd",
                /** Format a date object into a string value.
                    The format can be combinations of the following:
                    <ul>
                    <li>d  - day of month (no leading zero)</li>
                    <li>dd - day of month (two digit)</li>
                    <li>o  - day of year (no leading zeros)</li>
                    <li>oo - day of year (three digit)</li>
                    <li>D  - day name short</li>
                    <li>DD - day name long</li>
                    <li>w  - week of year (no leading zero)</li>
                    <li>ww - week of year (two digit)</li>
                    <li>m  - month of year (no leading zero)</li>
                    <li>mm - month of year (two digit)</li>
                    <li>M  - month name short</li>
                    <li>MM - month name long</li>
                    <li>yy - year (two digit)</li>
                    <li>yyyy - year (four digit)</li>
                    <li>YYYY - formatted year</li>
                    <li>J  - Julian date (days since January 1, 4713 BCE Greenwich noon)</li>
                    <li>@  - Unix timestamp (s since 01/01/1970)</li>
                    <li>!  - Windows ticks (100ns since 01/01/0001)</li>
                    <li>'...' - literal text</li>
                    <li>'' - single quote</li>
                    </ul>
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar
                    @param [format] {string} The desired format of the date (defaults to calendar format).
                    @param date {CDate} The date value to format.
                    @param [settings] {object} Addition options, whose attributes include:
                    @property [dayNamesShort] {string[]} Abbreviated names of the days from Sunday.
                    @property [dayNames] {string[]} Names of the days from Sunday.
                    @property [monthNamesShort] {string[]} Abbreviated names of the months.
                    @property [monthNames] {string[]} Names of the months.
                    @property [calculateWeek] {CalendarsPickerCalculateWeek} Function that determines week of the year.
                    @property [localNumbers=false] {boolean} <code>true</code> to localise numbers (if available),
                              <code>false</code> to use normal Arabic numerals.
                    @return {string} The date in the above format.
                    @throws Errors if the date is from a different calendar. */
                formatDate: function(f, p, g) {
                  if (typeof f != "string" && (g = p, p = f, f = ""), !p)
                    return "";
                  if (p.calendar() !== this)
                    throw v.local.invalidFormat || v.regionalOptions[""].invalidFormat;
                  f = f || this.local.dateFormat, g = g || {};
                  var y = g.dayNamesShort || this.local.dayNamesShort, C = g.dayNames || this.local.dayNames, m = g.monthNumbers || this.local.monthNumbers, h = g.monthNamesShort || this.local.monthNamesShort, w = g.monthNames || this.local.monthNames;
                  g.calculateWeek || this.local.calculateWeek;
                  for (var S = function(N, Y) {
                    for (var j = 1; O + j < f.length && f.charAt(O + j) === N; )
                      j++;
                    return O += j - 1, Math.floor(j / (Y || 1)) > 1;
                  }, E = function(N, Y, j, te) {
                    var re = "" + Y;
                    if (S(N, te))
                      for (; re.length < j; )
                        re = "0" + re;
                    return re;
                  }, x = function(N, Y, j, te) {
                    return S(N) ? te[Y] : j[Y];
                  }, T = this, F = function(N) {
                    return typeof m == "function" ? m.call(T, N, S("m")) : I(E("m", N.month(), 2));
                  }, P = function(N, Y) {
                    return Y ? typeof w == "function" ? w.call(T, N) : w[N.month() - T.minMonth] : typeof h == "function" ? h.call(T, N) : h[N.month() - T.minMonth];
                  }, k = this.local.digits, I = function(N) {
                    return g.localNumbers && k ? k(N) : N;
                  }, L = "", A = !1, O = 0; O < f.length; O++)
                    if (A)
                      f.charAt(O) === "'" && !S("'") ? A = !1 : L += f.charAt(O);
                    else
                      switch (f.charAt(O)) {
                        case "d":
                          L += I(E("d", p.day(), 2));
                          break;
                        case "D":
                          L += x(
                            "D",
                            p.dayOfWeek(),
                            y,
                            C
                          );
                          break;
                        case "o":
                          L += E("o", p.dayOfYear(), 3);
                          break;
                        case "w":
                          L += E("w", p.weekOfYear(), 2);
                          break;
                        case "m":
                          L += F(p);
                          break;
                        case "M":
                          L += P(p, S("M"));
                          break;
                        case "y":
                          L += S("y", 2) ? p.year() : (p.year() % 100 < 10 ? "0" : "") + p.year() % 100;
                          break;
                        case "Y":
                          S("Y", 2), L += p.formatYear();
                          break;
                        case "J":
                          L += p.toJD();
                          break;
                        case "@":
                          L += (p.toJD() - this.UNIX_EPOCH) * this.SECS_PER_DAY;
                          break;
                        case "!":
                          L += (p.toJD() - this.TICKS_EPOCH) * this.TICKS_PER_DAY;
                          break;
                        case "'":
                          S("'") ? L += "'" : A = !0;
                          break;
                        default:
                          L += f.charAt(O);
                      }
                  return L;
                },
                /** Parse a string value into a date object.
                    See <a href="#formatDate"><code>formatDate</code></a> for the possible formats, plus:
                    <ul>
                    <li>* - ignore rest of string</li>
                    </ul>
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar
                    @param format {string} The expected format of the date ('' for default calendar format).
                    @param value {string} The date in the above format.
                    @param [settings] {object} Additional options whose attributes include:
                    @property [shortYearCutoff] {number} The cutoff year for determining the century.
                    @property [dayNamesShort] {string[]} Abbreviated names of the days from Sunday.
                    @property [dayNames] {string[]} Names of the days from Sunday.
                    @property [monthNamesShort] {string[]} Abbreviated names of the months.
                    @property [monthNames] {string[]} Names of the months.
                    @return {CDate} The extracted date value or <code>null</code> if value is blank.
                    @throws Errors if the format and/or value are missing,
                            if the value doesn't match the format, or if the date is invalid. */
                parseDate: function(f, p, g) {
                  if (p == null)
                    throw v.local.invalidArguments || v.regionalOptions[""].invalidArguments;
                  if (p = typeof p == "object" ? p.toString() : p + "", p === "")
                    return null;
                  f = f || this.local.dateFormat, g = g || {};
                  var y = g.shortYearCutoff || this.shortYearCutoff;
                  y = typeof y != "string" ? y : this.today().year() % 100 + parseInt(y, 10);
                  for (var C = g.dayNamesShort || this.local.dayNamesShort, m = g.dayNames || this.local.dayNames, h = g.parseMonth || this.local.parseMonth, w = g.monthNumbers || this.local.monthNumbers, S = g.monthNamesShort || this.local.monthNamesShort, E = g.monthNames || this.local.monthNames, x = -1, T = -1, F = -1, P = -1, k = -1, I = !1, L = !1, A = function(ie, ce) {
                    for (var X = 1; Z + X < f.length && f.charAt(Z + X) === ie; )
                      X++;
                    return Z += X - 1, Math.floor(X / (ce || 1)) > 1;
                  }, O = function(ie, ce) {
                    var X = A(ie, ce), U = [2, 3, X ? 4 : 2, X ? 4 : 2, 10, 11, 20]["oyYJ@!".indexOf(ie) + 1], ne = new RegExp("^-?\\d{1," + U + "}"), se = p.substring(z).match(ne);
                    if (!se)
                      throw (v.local.missingNumberAt || v.regionalOptions[""].missingNumberAt).replace(/\{0\}/, z);
                    return z += se[0].length, parseInt(se[0], 10);
                  }, N = this, Y = function() {
                    if (typeof w == "function") {
                      A("m");
                      var ie = w.call(N, p.substring(z));
                      return z += ie.length, ie;
                    }
                    return O("m");
                  }, j = function(ie, ce, X, U) {
                    for (var ne = A(ie, U) ? X : ce, se = 0; se < ne.length; se++)
                      if (p.substr(z, ne[se].length).toLowerCase() === ne[se].toLowerCase())
                        return z += ne[se].length, se + N.minMonth;
                    throw (v.local.unknownNameAt || v.regionalOptions[""].unknownNameAt).replace(/\{0\}/, z);
                  }, te = function() {
                    if (typeof E == "function") {
                      var ie = A("M") ? E.call(N, p.substring(z)) : S.call(N, p.substring(z));
                      return z += ie.length, ie;
                    }
                    return j("M", S, E);
                  }, re = function() {
                    if (p.charAt(z) !== f.charAt(Z))
                      throw (v.local.unexpectedLiteralAt || v.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/, z);
                    z++;
                  }, z = 0, Z = 0; Z < f.length; Z++)
                    if (L)
                      f.charAt(Z) === "'" && !A("'") ? L = !1 : re();
                    else
                      switch (f.charAt(Z)) {
                        case "d":
                          P = O("d");
                          break;
                        case "D":
                          j("D", C, m);
                          break;
                        case "o":
                          k = O("o");
                          break;
                        case "w":
                          O("w");
                          break;
                        case "m":
                          F = Y();
                          break;
                        case "M":
                          F = te();
                          break;
                        case "y":
                          var W = Z;
                          I = !A("y", 2), Z = W, T = O("y", 2);
                          break;
                        case "Y":
                          T = O("Y", 2);
                          break;
                        case "J":
                          x = O("J") + 0.5, p.charAt(z) === "." && (z++, O("J"));
                          break;
                        case "@":
                          x = O("@") / this.SECS_PER_DAY + this.UNIX_EPOCH;
                          break;
                        case "!":
                          x = O("!") / this.TICKS_PER_DAY + this.TICKS_EPOCH;
                          break;
                        case "*":
                          z = p.length;
                          break;
                        case "'":
                          A("'") ? re() : L = !0;
                          break;
                        default:
                          re();
                      }
                  if (z < p.length)
                    throw v.local.unexpectedText || v.regionalOptions[""].unexpectedText;
                  if (T === -1 ? T = this.today().year() : T < 100 && I && (T += y === -1 ? 1900 : this.today().year() - this.today().year() % 100 - (T <= y ? 0 : 100)), typeof F == "string" && (F = h.call(this, T, F)), k > -1) {
                    F = 1, P = k;
                    for (var q = this.daysInMonth(T, F); P > q; q = this.daysInMonth(T, F))
                      F++, P -= q;
                  }
                  return x > -1 ? this.fromJD(x) : this.newDate(T, F, P);
                },
                /** A date may be specified as an exact value or a relative one.
                    Found in the <code>jquery.calendars.plus.js</code> module.
                    @memberof BaseCalendar
                    @param dateSpec {CDate|number|string} The date as an object or string in the given format or
                            an offset - numeric days from today, or string amounts and periods, e.g. '+1m +2w'.
                    @param defaultDate {CDate} The date to use if no other supplied, may be <code>null</code>.
                    @param currentDate {CDate} The current date as a possible basis for relative dates,
                            if <code>null</code> today is used (optional)
                    @param [dateFormat] {string} The expected date format - see <a href="#formatDate"><code>formatDate</code></a>.
                    @param [settings] {object} Additional options whose attributes include:
                    @property [shortYearCutoff] {number} The cutoff year for determining the century.
                    @property [dayNamesShort] {string[]} Abbreviated names of the days from Sunday.
                    @property [dayNames] {string[]} Names of the days from Sunday.
                    @property [monthNamesShort] {string[]} Abbreviated names of the months.
                    @property [monthNames] {string[]} Names of the months.
                    @return {CDate} The decoded date. */
                determineDate: function(f, p, g, y, C) {
                  g && typeof g != "object" && (C = y, y = g, g = null), typeof y != "string" && (C = y, y = "");
                  var m = this, h = function(w) {
                    try {
                      return m.parseDate(y, w, C);
                    } catch {
                    }
                    w = w.toLowerCase();
                    for (var S = (w.match(/^c/) && g ? g.newDate() : null) || m.today(), E = /([+-]?[0-9]+)\s*(d|w|m|y)?/g, x = E.exec(w); x; )
                      S.add(parseInt(x[1], 10), x[2] || "d"), x = E.exec(w);
                    return S;
                  };
                  return p = p ? p.newDate() : null, f = f == null ? p : typeof f == "string" ? h(f) : typeof f == "number" ? isNaN(f) || f === 1 / 0 || f === -1 / 0 ? p : m.today().add(f, "d") : m.newDate(f), f;
                }
              });
            }
          )
          /******/
        }, n = {};
        function a(s) {
          var c = n[s];
          if (c !== void 0)
            return c.exports;
          var i = n[s] = {
            /******/
            // no module.id needed
            /******/
            // no module.loaded needed
            /******/
            exports: {}
            /******/
          };
          return r[s].call(i.exports, i, i.exports, a), i.exports;
        }
        (function() {
          a.d = function(s, c) {
            for (var i in c)
              a.o(c, i) && !a.o(s, i) && Object.defineProperty(s, i, { enumerable: !0, get: c[i] });
          };
        })(), function() {
          a.g = function() {
            if (typeof globalThis == "object") return globalThis;
            try {
              return this || new Function("return this")();
            } catch {
              if (typeof window == "object") return window;
            }
          }();
        }(), function() {
          a.o = function(s, c) {
            return Object.prototype.hasOwnProperty.call(s, c);
          };
        }(), function() {
          a.r = function(s) {
            typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
          };
        }();
        var u = a(3472);
        return u;
      }()
    );
  });
})(Z4);
var hre = Z4.exports;
const pre = /* @__PURE__ */ jh(hre);
var K4 = {};
(function(e) {
  function t(x) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(T) {
      return typeof T;
    } : function(T) {
      return T && typeof Symbol == "function" && T.constructor === Symbol && T !== Symbol.prototype ? "symbol" : typeof T;
    }, t(x);
  }
  Object.defineProperty(e, "__esModule", {
    value: !0
  }), e.default = E;
  var r = s((react__WEBPACK_IMPORTED_MODULE_1___default())), n = a(NF);
  function a(x) {
    return x && x.__esModule ? x : { default: x };
  }
  function u(x) {
    if (typeof WeakMap != "function") return null;
    var T = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap();
    return (u = function(k) {
      return k ? F : T;
    })(x);
  }
  function s(x, T) {
    if (x && x.__esModule)
      return x;
    if (x === null || t(x) !== "object" && typeof x != "function")
      return { default: x };
    var F = u(T);
    if (F && F.has(x))
      return F.get(x);
    var P = {}, k = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var I in x)
      if (I !== "default" && Object.prototype.hasOwnProperty.call(x, I)) {
        var L = k ? Object.getOwnPropertyDescriptor(x, I) : null;
        L && (L.get || L.set) ? Object.defineProperty(P, I, L) : P[I] = x[I];
      }
    return P.default = x, F && F.set(x, P), P;
  }
  function c(x, T) {
    if (!(x instanceof T))
      throw new TypeError("Cannot call a class as a function");
  }
  function i(x, T) {
    for (var F = 0; F < T.length; F++) {
      var P = T[F];
      P.enumerable = P.enumerable || !1, P.configurable = !0, "value" in P && (P.writable = !0), Object.defineProperty(x, P.key, P);
    }
  }
  function l(x, T, F) {
    return T && i(x.prototype, T), Object.defineProperty(x, "prototype", { writable: !1 }), x;
  }
  function v(x, T) {
    if (typeof T != "function" && T !== null)
      throw new TypeError("Super expression must either be null or a function");
    x.prototype = Object.create(T && T.prototype, { constructor: { value: x, writable: !0, configurable: !0 } }), Object.defineProperty(x, "prototype", { writable: !1 }), T && f(x, T);
  }
  function f(x, T) {
    return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(P, k) {
      return P.__proto__ = k, P;
    }, f(x, T);
  }
  function p(x) {
    var T = C();
    return function() {
      var P = m(x), k;
      if (T) {
        var I = m(this).constructor;
        k = Reflect.construct(P, arguments, I);
      } else
        k = P.apply(this, arguments);
      return g(this, k);
    };
  }
  function g(x, T) {
    if (T && (t(T) === "object" || typeof T == "function"))
      return T;
    if (T !== void 0)
      throw new TypeError("Derived constructors may only return object or undefined");
    return y(x);
  }
  function y(x) {
    if (x === void 0)
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return x;
  }
  function C() {
    if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
    if (typeof Proxy == "function") return !0;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), !0;
    } catch {
      return !1;
    }
  }
  function m(x) {
    return m = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(F) {
      return F.__proto__ || Object.getPrototypeOf(F);
    }, m(x);
  }
  var h = ["AfterExport", "AfterPlot", "Animated", "AnimatingFrame", "AnimationInterrupted", "AutoSize", "BeforeExport", "BeforeHover", "ButtonClicked", "Click", "ClickAnnotation", "Deselect", "DoubleClick", "Framework", "Hover", "LegendClick", "LegendDoubleClick", "Relayout", "Relayouting", "Restyle", "Redraw", "Selected", "Selecting", "SliderChange", "SliderEnd", "SliderStart", "SunburstClick", "Transitioning", "TransitionInterrupted", "Unhover", "WebGlContextLost"], w = ["plotly_restyle", "plotly_redraw", "plotly_relayout", "plotly_relayouting", "plotly_doubleclick", "plotly_animated", "plotly_sunburstclick"], S = typeof window < "u";
  function E(x) {
    var T = /* @__PURE__ */ function(F) {
      v(k, F);
      var P = p(k);
      function k(I) {
        var L;
        return c(this, k), L = P.call(this, I), L.p = Promise.resolve(), L.resizeHandler = null, L.handlers = {}, L.syncWindowResize = L.syncWindowResize.bind(y(L)), L.syncEventHandlers = L.syncEventHandlers.bind(y(L)), L.attachUpdateEvents = L.attachUpdateEvents.bind(y(L)), L.getRef = L.getRef.bind(y(L)), L.handleUpdate = L.handleUpdate.bind(y(L)), L.figureCallback = L.figureCallback.bind(y(L)), L.updatePlotly = L.updatePlotly.bind(y(L)), L;
      }
      return l(k, [{
        key: "updatePlotly",
        value: function(L, A, O) {
          var N = this;
          this.p = this.p.then(function() {
            if (!N.unmounting) {
              if (!N.el)
                throw new Error("Missing element reference");
              return x.react(N.el, {
                data: N.props.data,
                layout: N.props.layout,
                config: N.props.config,
                frames: N.props.frames
              });
            }
          }).then(function() {
            N.unmounting || (N.syncWindowResize(L), N.syncEventHandlers(), N.figureCallback(A), O && N.attachUpdateEvents());
          }).catch(function(Y) {
            N.props.onError && N.props.onError(Y);
          });
        }
      }, {
        key: "componentDidMount",
        value: function() {
          this.unmounting = !1, this.updatePlotly(!0, this.props.onInitialized, !0);
        }
      }, {
        key: "componentDidUpdate",
        value: function(L) {
          this.unmounting = !1;
          var A = L.frames && L.frames.length ? L.frames.length : 0, O = this.props.frames && this.props.frames.length ? this.props.frames.length : 0, N = !(L.layout === this.props.layout && L.data === this.props.data && L.config === this.props.config && O === A), Y = L.revision !== void 0, j = L.revision !== this.props.revision;
          !N && (!Y || Y && !j) || this.updatePlotly(!1, this.props.onUpdate, !1);
        }
      }, {
        key: "componentWillUnmount",
        value: function() {
          this.unmounting = !0, this.figureCallback(this.props.onPurge), this.resizeHandler && S && (window.removeEventListener("resize", this.resizeHandler), this.resizeHandler = null), this.removeUpdateEvents(), x.purge(this.el);
        }
      }, {
        key: "attachUpdateEvents",
        value: function() {
          var L = this;
          !this.el || !this.el.removeListener || w.forEach(function(A) {
            L.el.on(A, L.handleUpdate);
          });
        }
      }, {
        key: "removeUpdateEvents",
        value: function() {
          var L = this;
          !this.el || !this.el.removeListener || w.forEach(function(A) {
            L.el.removeListener(A, L.handleUpdate);
          });
        }
      }, {
        key: "handleUpdate",
        value: function() {
          this.figureCallback(this.props.onUpdate);
        }
      }, {
        key: "figureCallback",
        value: function(L) {
          if (typeof L == "function") {
            var A = this.el, O = A.data, N = A.layout, Y = this.el._transitionData ? this.el._transitionData._frames : null, j = {
              data: O,
              layout: N,
              frames: Y
            };
            L(j, this.el);
          }
        }
      }, {
        key: "syncWindowResize",
        value: function(L) {
          var A = this;
          S && (this.props.useResizeHandler && !this.resizeHandler ? (this.resizeHandler = function() {
            return x.Plots.resize(A.el);
          }, window.addEventListener("resize", this.resizeHandler), L && this.resizeHandler()) : !this.props.useResizeHandler && this.resizeHandler && (window.removeEventListener("resize", this.resizeHandler), this.resizeHandler = null));
        }
      }, {
        key: "getRef",
        value: function(L) {
          this.el = L, this.props.debug && S && (window.gd = this.el);
        }
        // Attach and remove event handlers as they're added or removed from props:
      }, {
        key: "syncEventHandlers",
        value: function() {
          var L = this;
          h.forEach(function(A) {
            var O = L.props["on" + A], N = L.handlers[A], Y = !!N;
            O && !Y ? L.addEventHandler(A, O) : !O && Y ? L.removeEventHandler(A) : O && Y && O !== N && (L.removeEventHandler(A), L.addEventHandler(A, O));
          });
        }
      }, {
        key: "addEventHandler",
        value: function(L, A) {
          this.handlers[L] = A, this.el.on(this.getPlotlyEventName(L), this.handlers[L]);
        }
      }, {
        key: "removeEventHandler",
        value: function(L) {
          this.el.removeListener(this.getPlotlyEventName(L), this.handlers[L]), delete this.handlers[L];
        }
      }, {
        key: "getPlotlyEventName",
        value: function(L) {
          return "plotly_" + L.toLowerCase();
        }
      }, {
        key: "render",
        value: function() {
          return /* @__PURE__ */ r.default.createElement("div", {
            id: this.props.divId,
            style: this.props.style,
            ref: this.getRef,
            className: this.props.className
          });
        }
      }]), k;
    }(r.Component);
    return T.propTypes = {
      data: n.default.arrayOf(n.default.object),
      config: n.default.object,
      layout: n.default.object,
      frames: n.default.arrayOf(n.default.object),
      revision: n.default.number,
      onInitialized: n.default.func,
      onPurge: n.default.func,
      onError: n.default.func,
      onUpdate: n.default.func,
      debug: n.default.bool,
      style: n.default.object,
      className: n.default.string,
      useResizeHandler: n.default.bool,
      divId: n.default.string
    }, h.forEach(function(F) {
      T.propTypes["on" + F] = n.default.func;
    }), T.defaultProps = {
      debug: !1,
      useResizeHandler: !1,
      data: [],
      style: {
        position: "relative",
        display: "inline-block"
      }
    }, T;
  }
})(K4);
const vre = /* @__PURE__ */ jh(K4), gre = {
  layout: {
    font: {
      color: "#dee2e6"
      // bs-body-color
    },
    paper_bgcolor: "#000",
    // bs-body-bg
    plot_bgcolor: "#000",
    // bs-body-bg
    xaxis: {
      gridcolor: "#212529",
      // bs-gray-900
      zerolinecolor: "#6c757d"
      // bs-gray-600
    },
    yaxis: {
      gridcolor: "#212529",
      // bs-gray-900
      zerolinecolor: "#6c757d"
      // bs-gray-600
    }
  }
}, mre = vre(pre), MR = (e) => Nl({
  queryKey: ["results", e.project, e.graphConfig.field],
  queryFn: async () => e.httpPathHandler(
    `projects/${e.project}/?summarise=${e.graphConfig.field}`
  ).then((t) => t.json()).then((t) => {
    const r = t.data.map((a) => {
      let u = a[e.graphConfig.field];
      return u === null ? u = "" : u = u.toString(), u;
    }), n = t.data.map(
      (a) => a.count
    );
    return { field_data: r, count_data: n };
  }),
  enabled: !!e.project,
  staleTime: 1 * 60 * 1e3
}), J4 = (e) => Nl({
  queryKey: [
    "results",
    e.project,
    e.graphConfig.field,
    e.graphConfig.groupBy
  ],
  queryFn: async () => e.httpPathHandler(
    `projects/${e.project}/?summarise=${e.graphConfig.field}&summarise=${e.graphConfig.groupBy}`
  ).then((t) => t.json()).then((t) => {
    const r = /* @__PURE__ */ new Map();
    return t.data.forEach((n) => {
      let a = n[e.graphConfig.field];
      a === null ? a = "" : a = a.toString();
      let u = n[e.graphConfig.groupBy];
      u === null ? u = "" : u = u.toString();
      const s = r.get(u);
      if (s)
        s.field_data.push(a), s.count_data.push(n.count);
      else {
        r.set(u, {
          field_data: [a],
          count_data: [n.count]
        });
        return;
      }
    }), r;
  }),
  enabled: !!e.project,
  staleTime: 1 * 60 * 1e3
});
function DR(e, t, r) {
  var a;
  let n = "";
  if (((a = e.get(t)) == null ? void 0 : a.type) === "date") {
    const u = r.count_data[r.field_data.indexOf("")] || 0;
    u && (n += `Excluding ${u} records with no ${t}.`);
  }
  return n;
}
function Q4(e, t, r) {
  var a;
  let n = "";
  if (((a = e.get(t)) == null ? void 0 : a.type) === "date") {
    let u = 0;
    r.forEach(({ field_data: s, count_data: c }) => {
      u += c[s.indexOf("")] || 0;
    }), u && (n += `Excluding ${u} records with no ${t}.`);
  }
  return n;
}
function Uv(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    mre,
    {
      data: e.data,
      layout: {
        ...e.layout,
        autosize: !0,
        title: e.title,
        titlefont: { size: 14, color: "grey" },
        margin: {
          l: 60,
          r: 60,
          b: 60,
          t: 60,
          pad: 4
        },
        template: e.darkMode ? gre : void 0,
        xaxis: { title: e.xTitle },
        yaxis: {
          title: e.yTitle,
          type: e.yAxisType ? e.yAxisType : "linear"
        },
        legend: { title: { text: e.legendTitle } },
        showlegend: !!e.legendTitle,
        colorway: [
          "#00cc96",
          "#636efa",
          "#EF553B",
          "#ab63fa",
          "#FFA15A",
          "#19d3f3",
          "#FF6692",
          "#B6E880",
          "#FF97FF",
          "#FECB52"
        ],
        uirevision: e.uirevision
      },
      useResizeHandler: !0,
      style: { width: "100%", height: "100%" },
      config: {
        modeBarButtonsToRemove: [
          "toImage",
          "lasso2d",
          "select2d",
          "sendDataToCloud"
        ]
      }
    }
  );
}
function yre(e) {
  const {
    data: t = {
      field_data: [],
      count_data: []
    }
  } = MR(e);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Uv,
    {
      ...e,
      data: [
        {
          x: t.field_data,
          y: t.count_data,
          type: "scatter",
          mode: "lines+markers"
        }
      ],
      title: DR(e.projectFields, e.graphConfig.field, t),
      xTitle: e.graphConfig.field,
      yTitle: "count",
      yAxisType: e.graphConfig.yAxisType,
      uirevision: e.graphConfig.field
    }
  );
}
function Cre(e) {
  const {
    data: t = {
      field_data: [],
      count_data: []
    }
  } = MR(e);
  let r = {}, n = "count";
  return e.graphConfig.groupMode === "stack" ? r = { barmode: "stack" } : e.graphConfig.groupMode === "group" ? r = { barmode: "group" } : e.graphConfig.groupMode === "norm" && (r = { barmode: "stack", barnorm: "percent" }, n = "percentage"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Uv,
    {
      ...e,
      data: [
        {
          x: t.field_data,
          y: t.count_data,
          type: "bar"
        }
      ],
      title: DR(e.projectFields, e.graphConfig.field, t),
      xTitle: e.graphConfig.field,
      yTitle: n,
      yAxisType: e.graphConfig.yAxisType,
      layout: r,
      uirevision: e.graphConfig.field
    }
  );
}
function bre(e) {
  const {
    data: t = {
      field_data: [],
      count_data: []
    }
  } = MR(e);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Uv,
    {
      ...e,
      data: [
        {
          labels: t.field_data,
          values: t.count_data,
          type: "pie",
          marker: { color: "#198754" }
        }
      ],
      title: DR(e.projectFields, e.graphConfig.field, t),
      legendTitle: e.graphConfig.field,
      uirevision: e.graphConfig.field
    }
  );
}
function wre(e) {
  const {
    data: t = /* @__PURE__ */ new Map()
  } = J4(e), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => Array.from(t.entries()).map(([n, { field_data: a, count_data: u }]) => ({
      x: a,
      y: u,
      name: n,
      type: "scatter",
      mode: "lines+markers"
    })),
    [t]
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Uv,
    {
      ...e,
      data: r,
      title: Q4(
        e.projectFields,
        e.graphConfig.field,
        t
      ),
      xTitle: e.graphConfig.field,
      yTitle: "count",
      yAxisType: e.graphConfig.yAxisType,
      legendTitle: e.graphConfig.groupBy,
      uirevision: `${e.graphConfig.field}-${e.graphConfig.groupBy}`
    }
  );
}
function Sre(e) {
  const {
    data: t = /* @__PURE__ */ new Map()
  } = J4(e), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => Array.from(t.entries()).map(([u, { field_data: s, count_data: c }]) => ({
      x: s,
      y: c,
      name: u,
      type: "bar"
    })),
    [t]
  );
  let n = {}, a = "count";
  return e.graphConfig.groupMode === "stack" ? n = { barmode: "stack" } : e.graphConfig.groupMode === "group" ? n = { barmode: "group" } : e.graphConfig.groupMode === "norm" && (n = { barmode: "stack", barnorm: "percent" }, a = "percentage"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Uv,
    {
      ...e,
      data: r,
      title: Q4(
        e.projectFields,
        e.graphConfig.field,
        t
      ),
      xTitle: e.graphConfig.field,
      yTitle: a,
      yAxisType: e.graphConfig.yAxisType,
      legendTitle: e.graphConfig.groupBy,
      layout: n,
      uirevision: `${e.graphConfig.field}-${e.graphConfig.groupBy}`
    }
  );
}
function xre(e) {
  let t;
  switch (!0) {
    case (e.graphConfig.type === "line" && !!e.graphConfig.field && !!e.graphConfig.groupBy):
      t = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(wre, { ...e });
      break;
    case (e.graphConfig.type === "line" && !!e.graphConfig.field):
      t = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(yre, { ...e });
      break;
    case (e.graphConfig.type === "bar" && !!e.graphConfig.field && !!e.graphConfig.groupBy):
      t = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Sre, { ...e });
      break;
    case (e.graphConfig.type === "bar" && !!e.graphConfig.field):
      t = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Cre, { ...e });
      break;
    case (e.graphConfig.type === "pie" && !!e.graphConfig.field):
      t = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(bre, { ...e });
      break;
    default:
      t = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Uv, { ...e, data: [], uirevision: "" });
  }
  return t;
}
function Tre(e) {
  const t = {
    line: {
      fields: ["date"],
      groupBy: ["choice", "bool"]
    },
    bar: {
      fields: ["choice", "date", "bool"],
      groupBy: ["choice", "bool"]
    },
    pie: {
      fields: ["choice", "bool"],
      groupBy: []
    }
  };
  let r = [], n = [];
  return e.graphConfig.type && (r = e.graphFieldOptions.filter(
    (a) => {
      var u;
      return t[e.graphConfig.type].fields.includes(((u = e.projectFields.get(a)) == null ? void 0 : u.type) || "");
    }
  ), n = e.graphFieldOptions.filter(
    (a) => {
      var u;
      return t[e.graphConfig.type].groupBy.includes(((u = e.projectFields.get(a)) == null ? void 0 : u.type) || "");
    }
  )), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di, { children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { children: "Graph Type" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        $c,
        {
          isClearable: !0,
          options: ["line", "bar", "pie"],
          value: e.graphConfig.type,
          placeholder: "Select graph type...",
          onChange: e.handleGraphConfigTypeChange
        }
      )
    ] }),
    e.graphConfig.type && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { children: "Field" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        $c,
        {
          isClearable: !0,
          options: r,
          titles: e.fieldDescriptions,
          value: e.graphConfig.field,
          placeholder: "Select field...",
          onChange: e.handleGraphConfigFieldChange
        }
      )
    ] }),
    (e.graphConfig.type === "line" || e.graphConfig.type === "bar") && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { children: "Group By" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        $c,
        {
          isClearable: !0,
          options: n,
          titles: e.fieldDescriptions,
          value: e.graphConfig.groupBy,
          placeholder: "Select field...",
          onChange: e.handleGraphConfigGroupByChange
        }
      )
    ] }),
    e.graphConfig.type === "bar" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { children: "Group Mode" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        $c,
        {
          options: ["stack", "group", "norm"],
          value: e.graphConfig.groupMode,
          onChange: e.handleGraphConfigGroupModeChange
        }
      )
    ] }),
    (e.graphConfig.type === "line" || e.graphConfig.type === "bar") && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Di.Group, { className: "mb-3", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Di.Label, { children: "Axis Type" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Di.Check,
        {
          type: "checkbox",
          label: "Logarithmic Y Axis",
          onChange: e.handleGraphConfigYAxisTypeChange
        }
      )
    ] })
  ] });
}
function Rre(e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    let r = "Empty Graph";
    return e.graphConfig.field && (r = `Records by ${e.graphConfig.field}`, e.graphConfig.groupBy && (r += `, grouped by ${e.graphConfig.groupBy}`)), r;
  }, [e.graphConfig.field, e.graphConfig.groupBy]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl, { children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl.Header, { children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 1, className: "float-end", children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Ki,
          {
            size: "sm",
            variant: "dark",
            disabled: e.firstGraph,
            title: e.viewMode === "list" ? "Move Graph Up" : "Move Graph Left",
            onClick: e.handleGraphConfigSwapLeft,
            children: e.viewMode === "list" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(mB, {}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(pB, {})
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Ki,
          {
            size: "sm",
            variant: "dark",
            disabled: e.lastGraph,
            title: e.viewMode === "list" ? "Move Graph Down" : "Move Graph Right",
            onClick: e.handleGraphConfigSwapRight,
            children: e.viewMode === "list" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(vB, {}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(gB, {})
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Ki,
          {
            size: "sm",
            variant: "dark",
            title: "Remove Graph",
            onClick: e.handleGraphConfigRemove,
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(c2, {})
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Gl.Body, { className: "p-2", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Yh, { className: "g-2", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { xl: 12, xxl: e.viewMode === "list" ? 3 : 4, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Gl, { body: !0, style: { height: "440px" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Tre, { ...e }) }) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { xl: 12, xxl: e.viewMode === "list" ? 9 : 8, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { style: { height: "440px" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(xre, { ...e }) }) })
    ] }) })
  ] });
}
function Are(e) {
  const t = () => [
    {
      key: dv(),
      type: "bar",
      field: "published_date",
      groupBy: "",
      groupMode: "stack",
      yAxisType: ""
    },
    {
      key: dv(),
      type: "bar",
      field: "published_date",
      groupBy: "site",
      groupMode: "stack",
      yAxisType: ""
    },
    {
      key: dv(),
      type: "pie",
      field: "site",
      groupBy: "",
      groupMode: "",
      yAxisType: ""
    },
    {
      key: dv(),
      type: "line",
      field: "published_date",
      groupBy: "site",
      groupMode: "",
      yAxisType: ""
    }
  ], [r, n] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("list"), [a, u] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(t()), s = Array.from(e.projectFields.entries()).filter(([, m]) => m.actions.includes("list")).map(([m]) => m);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    u(t());
  }, [e.project]);
  const c = (m, h) => {
    const w = [...a];
    w[h].type !== m.target.value && (w[h].field = "", w[h].groupBy = "", m.target.value === "bar" ? w[h].groupMode = "stack" : w[h].groupMode = ""), w[h].type = m.target.value, u(w);
  }, i = (m, h) => {
    const w = [...a];
    w[h].field = m.target.value, u(w);
  }, l = (m, h) => {
    const w = [...a];
    w[h].groupBy = m.target.value, u(w);
  }, v = (m, h) => {
    const w = [...a];
    w[h].groupMode = m.target.value, u(w);
  }, f = (m, h) => {
    const w = [...a];
    w[h].yAxisType = m.target.checked ? "log" : "", u(w);
  }, p = (m) => {
    u([
      ...a.slice(0, m),
      {
        key: dv(),
        type: "",
        field: "",
        groupBy: "",
        groupMode: "",
        yAxisType: ""
      },
      ...a.slice(m)
    ]);
  }, g = (m) => {
    if (m > 0) {
      const h = [...a];
      [h[m], h[m - 1]] = [h[m - 1], h[m]], u(h);
    }
  }, y = (m) => {
    if (m < a.length - 1) {
      const h = [...a];
      [h[m], h[m + 1]] = [h[m + 1], h[m]], u(h);
    }
  }, C = (m) => {
    const h = [...a];
    h.splice(m, 1), u(h);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "g-2 h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl, { className: "h-100", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Gl.Header, { children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "Graphs" }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(La, { direction: "horizontal", gap: 1, className: "float-end", children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Ki,
          {
            size: "sm",
            variant: "dark",
            title: "Add Graph",
            onClick: () => p(a.length),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(d2, {})
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Za, { title: "Change View Mode", children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Toggle, { size: "sm", variant: "dark", children: r === "grid" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(dB, {}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(yB, {}) }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Za.Menu, { children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Item, { onClick: () => n("list"), children: "List View" }, "list"),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Za.Item, { onClick: () => n("grid"), children: "Grid View" }, "grid")
          ] })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "overflow-y-scroll p-2 h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Yh, { className: "g-2", children: a.map((m, h) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ks, { lg: r === "list" ? 12 : 6, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Rre,
      {
        ...e,
        graphConfig: m,
        graphFieldOptions: s,
        handleGraphConfigTypeChange: (w) => c(w, h),
        handleGraphConfigFieldChange: (w) => i(w, h),
        handleGraphConfigGroupByChange: (w) => l(w, h),
        handleGraphConfigGroupModeChange: (w) => v(w, h),
        handleGraphConfigYAxisTypeChange: (w) => f(w, h),
        handleGraphConfigAdd: () => p(h + 1),
        handleGraphConfigSwapLeft: () => g(h),
        handleGraphConfigSwapRight: () => y(h),
        handleGraphConfigRemove: () => C(h),
        viewMode: r,
        firstGraph: h === 0,
        lastGraph: h === a.length - 1
      }
    ) }, m.key)) }) })
  ] }) });
}
const Ere = "0.13.0";
function Mre(e) {
  const t = {}, r = (n, a = "") => {
    for (const [u, s] of Object.entries(n))
      t[a + u] = s, s.type === "relation" && r(
        s.fields,
        a + u + "__"
      );
  };
  return r(e), t;
}
function Dre(e) {
  const [t, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    localStorage.getItem("onyx-theme") === "dark"
  ), [n, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [u, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("data");
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const C = document.querySelector("html");
    C == null || C.setAttribute("data-bs-theme", t ? "dark" : "light");
  }, [t]);
  const c = () => {
    const C = !t;
    r(C), localStorage.setItem("onyx-theme", C ? "dark" : "light");
  }, { data: i = [] } = Nl({
    queryKey: ["projects"],
    queryFn: async () => e.httpPathHandler("projects/").then((C) => C.json()).then((C) => [
      ...new Set(
        C.data.map((m) => m.project)
      )
    ])
  });
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    !n && i.length > 0 && a(i[0]);
  }, [n, i]);
  const { data: l = /* @__PURE__ */ new Map() } = Nl({
    queryKey: ["types"],
    queryFn: async () => e.httpPathHandler("projects/types/").then((C) => C.json()).then((C) => new Map(
      C.data.map((m) => [
        m.type,
        m.lookups
      ])
    ))
  }), { data: v = /* @__PURE__ */ new Map() } = Nl({
    queryKey: ["lookups"],
    queryFn: async () => e.httpPathHandler("projects/lookups/").then((C) => C.json()).then((C) => new Map(
      C.data.map((m) => [
        m.lookup,
        m.description
      ])
    ))
  }), {
    isFetching: f,
    data: { projectName: p, projectFields: g, fieldDescriptions: y } = {
      projectName: "",
      projectFields: /* @__PURE__ */ new Map(),
      fieldDescriptions: /* @__PURE__ */ new Map()
    }
  } = Nl({
    queryKey: ["fields", n],
    queryFn: async () => e.httpPathHandler(`projects/${n}/fields/`).then((C) => C.json()).then((C) => {
      const m = Mre(C.data.fields), h = C.data.name, w = new Map(
        Object.keys(m).map((E) => [
          E,
          {
            type: m[E].type,
            description: m[E].description,
            actions: m[E].actions,
            values: m[E].values
          }
        ])
      ), S = new Map(
        Array.from(w.entries()).map(([E, x]) => [
          E,
          x.description
        ])
      );
      return { projectName: h, projectFields: w, fieldDescriptions: S };
    }),
    enabled: !!n,
    staleTime: 1 * 60 * 1e3
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "Onyx h-100", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      CB,
      {
        ...e,
        projectName: f ? "Loading..." : p,
        projectList: i,
        handleProjectChange: a,
        guiVersion: Ere,
        tabKey: u,
        setTabKey: s,
        darkMode: t,
        handleThemeChange: c
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "h-100", style: { paddingTop: "60px" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(is, { fluid: !0, className: "h-100 px-0 py-1", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(hu.Container, { activeKey: u, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(hu.Content, { className: "h-100", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(hu.Pane, { eventKey: "data", className: "h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        fre,
        {
          ...e,
          project: n,
          projectFields: g,
          typeLookups: l,
          fieldDescriptions: y,
          lookupDescriptions: v
        }
      ) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(hu.Pane, { eventKey: "stats", className: "h-100", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Are,
        {
          ...e,
          project: n,
          projectFields: g,
          fieldDescriptions: y,
          darkMode: t
        }
      ) })
    ] }) }) }) })
  ] });
}
const Fre = new QG({
  defaultOptions: {
    queries: {
      refetchOnWindowFocus: !1,
      refetchOnMount: !1
    }
  }
});
function Gre(e) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s8, { client: Fre, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Dre, { ...e }) });
}



/***/ })

}]);
//# sourceMappingURL=vendors-node_modules_climb-onyx-gui_dist_climb-onyx-gui_js.b71f627b72458972d764.js.map