var E, d, X, se, x, J, Y, Z, ee, j, R, $, _e, A = {}, F = [], ue = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, M = Array.isArray;
function b(_, e) {
  for (var t in e) _[t] = e[t];
  return _;
}
function V(_) {
  _ && _.parentNode && _.parentNode.removeChild(_);
}
function ce(_, e, t) {
  var o, l, n, i = {};
  for (n in e) n == "key" ? o = e[n] : n == "ref" ? l = e[n] : i[n] = e[n];
  if (arguments.length > 2 && (i.children = arguments.length > 3 ? E.call(arguments, 2) : t), typeof _ == "function" && _.defaultProps != null) for (n in _.defaultProps) i[n] === void 0 && (i[n] = _.defaultProps[n]);
  return T(_, i, o, l, null);
}
function T(_, e, t, o, l) {
  var n = { type: _, props: e, key: t, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: l ?? ++X, __i: -1, __u: 0 };
  return l == null && d.vnode != null && d.vnode(n), n;
}
function H(_) {
  return _.children;
}
function W(_, e) {
  this.props = _, this.context = e;
}
function S(_, e) {
  if (e == null) return _.__ ? S(_.__, _.__i + 1) : null;
  for (var t; e < _.__k.length; e++) if ((t = _.__k[e]) != null && t.__e != null) return t.__e;
  return typeof _.type == "function" ? S(_) : null;
}
function pe(_) {
  if (_.__P && _.__d) {
    var e = _.__v, t = e.__e, o = [], l = [], n = b({}, e);
    n.__v = e.__v + 1, d.vnode && d.vnode(n), z(_.__P, n, e, _.__n, _.__P.namespaceURI, 32 & e.__u ? [t] : null, o, t ?? S(e), !!(32 & e.__u), l), n.__v = e.__v, n.__.__k[n.__i] = n, oe(o, n, l), e.__e = e.__ = null, n.__e != t && te(n);
  }
}
function te(_) {
  if ((_ = _.__) != null && _.__c != null) return _.__e = _.__c.base = null, _.__k.some(function(e) {
    if (e != null && e.__e != null) return _.__e = _.__c.base = e.__e;
  }), te(_);
}
function B(_) {
  (!_.__d && (_.__d = !0) && x.push(_) && !N.__r++ || J != d.debounceRendering) && ((J = d.debounceRendering) || Y)(N);
}
function N() {
  try {
    for (var _, e = 1; x.length; ) x.length > e && x.sort(Z), _ = x.shift(), e = x.length, pe(_);
  } finally {
    x.length = N.__r = 0;
  }
}
function ne(_, e, t, o, l, n, i, u, f, s, p) {
  var r, v, c, y, g, m, h, a = o && o.__k || F, w = e.length;
  for (f = fe(t, e, a, f, w), r = 0; r < w; r++) (c = t.__k[r]) != null && (v = c.__i != -1 && a[c.__i] || A, c.__i = r, m = z(_, c, v, l, n, i, u, f, s, p), y = c.__e, c.ref && v.ref != c.ref && (v.ref && q(v.ref, null, c), p.push(c.ref, c.__c || y, c)), g == null && y != null && (g = y), (h = !!(4 & c.__u)) || v.__k === c.__k ? f = re(c, f, _, h) : typeof c.type == "function" && m !== void 0 ? f = m : y && (f = y.nextSibling), c.__u &= -7);
  return t.__e = g, f;
}
function fe(_, e, t, o, l) {
  var n, i, u, f, s, p = t.length, r = p, v = 0;
  for (_.__k = new Array(l), n = 0; n < l; n++) (i = e[n]) != null && typeof i != "boolean" && typeof i != "function" ? (typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? i = _.__k[n] = T(null, i, null, null, null) : M(i) ? i = _.__k[n] = T(H, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? i = _.__k[n] = T(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : _.__k[n] = i, f = n + v, i.__ = _, i.__b = _.__b + 1, u = null, (s = i.__i = he(i, t, f, r)) != -1 && (r--, (u = t[s]) && (u.__u |= 2)), u == null || u.__v == null ? (s == -1 && (l > p ? v-- : l < p && v++), typeof i.type != "function" && (i.__u |= 4)) : s != f && (s == f - 1 ? v-- : s == f + 1 ? v++ : (s > f ? v-- : v++, i.__u |= 4))) : _.__k[n] = null;
  if (r) for (n = 0; n < p; n++) (u = t[n]) != null && (2 & u.__u) == 0 && (u.__e == o && (o = S(u)), ie(u, u));
  return o;
}
function re(_, e, t, o) {
  var l, n;
  if (typeof _.type == "function") {
    for (l = _.__k, n = 0; l && n < l.length; n++) l[n] && (l[n].__ = _, e = re(l[n], e, t, o));
    return e;
  }
  _.__e != e && (o && (e && _.type && !e.parentNode && (e = S(_)), t.insertBefore(_.__e, e || null)), e = _.__e);
  do
    e = e && e.nextSibling;
  while (e != null && e.nodeType == 8);
  return e;
}
function ae(_, e) {
  return e = e || [], _ == null || typeof _ == "boolean" || (M(_) ? _.some(function(t) {
    ae(t, e);
  }) : e.push(_)), e;
}
function he(_, e, t, o) {
  var l, n, i, u = _.key, f = _.type, s = e[t], p = s != null && (2 & s.__u) == 0;
  if (s === null && u == null || p && u == s.key && f == s.type) return t;
  if (o > (p ? 1 : 0)) {
    for (l = t - 1, n = t + 1; l >= 0 || n < e.length; ) if ((s = e[i = l >= 0 ? l-- : n++]) != null && (2 & s.__u) == 0 && u == s.key && f == s.type) return i;
  }
  return -1;
}
function K(_, e, t) {
  e[0] == "-" ? _.setProperty(e, t ?? "") : _[e] = t == null ? "" : typeof t != "number" || ue.test(e) ? t : t + "px";
}
function L(_, e, t, o, l) {
  var n, i;
  e: if (e == "style") if (typeof t == "string") _.style.cssText = t;
  else {
    if (typeof o == "string" && (_.style.cssText = o = ""), o) for (e in o) t && e in t || K(_.style, e, "");
    if (t) for (e in t) o && t[e] == o[e] || K(_.style, e, t[e]);
  }
  else if (e[0] == "o" && e[1] == "n") n = e != (e = e.replace(ee, "$1")), i = e.toLowerCase(), e = i in _ || e == "onFocusOut" || e == "onFocusIn" ? i.slice(2) : e.slice(2), _.l || (_.l = {}), _.l[e + n] = t, t ? o ? t.u = o.u : (t.u = j, _.addEventListener(e, n ? $ : R, n)) : _.removeEventListener(e, n ? $ : R, n);
  else {
    if (l == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
    else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in _) try {
      _[e] = t ?? "";
      break e;
    } catch {
    }
    typeof t == "function" || (t == null || t === !1 && e[4] != "-" ? _.removeAttribute(e) : _.setAttribute(e, e == "popover" && t == 1 ? "" : t));
  }
}
function Q(_) {
  return function(e) {
    if (this.l) {
      var t = this.l[e.type + _];
      if (e.t == null) e.t = j++;
      else if (e.t < t.u) return;
      return t(d.event ? d.event(e) : e);
    }
  };
}
function z(_, e, t, o, l, n, i, u, f, s) {
  var p, r, v, c, y, g, m, h, a, w, C, U, G, D, I, k = e.type;
  if (e.constructor !== void 0) return null;
  128 & t.__u && (f = !!(32 & t.__u), n = [u = e.__e = t.__e]), (p = d.__b) && p(e);
  e: if (typeof k == "function") try {
    if (h = e.props, a = k.prototype && k.prototype.render, w = (p = k.contextType) && o[p.__c], C = p ? w ? w.props.value : p.__ : o, t.__c ? m = (r = e.__c = t.__c).__ = r.__E : (a ? e.__c = r = new k(h, C) : (e.__c = r = new W(h, C), r.constructor = k, r.render = ve), w && w.sub(r), r.state || (r.state = {}), r.__n = o, v = r.__d = !0, r.__h = [], r._sb = []), a && r.__s == null && (r.__s = r.state), a && k.getDerivedStateFromProps != null && (r.__s == r.state && (r.__s = b({}, r.__s)), b(r.__s, k.getDerivedStateFromProps(h, r.__s))), c = r.props, y = r.state, r.__v = e, v) a && k.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), a && r.componentDidMount != null && r.__h.push(r.componentDidMount);
    else {
      if (a && k.getDerivedStateFromProps == null && h !== c && r.componentWillReceiveProps != null && r.componentWillReceiveProps(h, C), e.__v == t.__v || !r.__e && r.shouldComponentUpdate != null && r.shouldComponentUpdate(h, r.__s, C) === !1) {
        e.__v != t.__v && (r.props = h, r.state = r.__s, r.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.some(function(P) {
          P && (P.__ = e);
        }), F.push.apply(r.__h, r._sb), r._sb = [], r.__h.length && i.push(r);
        break e;
      }
      r.componentWillUpdate != null && r.componentWillUpdate(h, r.__s, C), a && r.componentDidUpdate != null && r.__h.push(function() {
        r.componentDidUpdate(c, y, g);
      });
    }
    if (r.context = C, r.props = h, r.__P = _, r.__e = !1, U = d.__r, G = 0, a) r.state = r.__s, r.__d = !1, U && U(e), p = r.render(r.props, r.state, r.context), F.push.apply(r.__h, r._sb), r._sb = [];
    else do
      r.__d = !1, U && U(e), p = r.render(r.props, r.state, r.context), r.state = r.__s;
    while (r.__d && ++G < 25);
    r.state = r.__s, r.getChildContext != null && (o = b(b({}, o), r.getChildContext())), a && !v && r.getSnapshotBeforeUpdate != null && (g = r.getSnapshotBeforeUpdate(c, y)), D = p != null && p.type === H && p.key == null ? le(p.props.children) : p, u = ne(_, M(D) ? D : [D], e, t, o, l, n, i, u, f, s), r.base = e.__e, e.__u &= -161, r.__h.length && i.push(r), m && (r.__E = r.__ = null);
  } catch (P) {
    if (e.__v = null, f || n != null) if (P.then) {
      for (e.__u |= f ? 160 : 128; u && u.nodeType == 8 && u.nextSibling; ) u = u.nextSibling;
      n[n.indexOf(u)] = null, e.__e = u;
    } else {
      for (I = n.length; I--; ) V(n[I]);
      O(e);
    }
    else e.__e = t.__e, e.__k = t.__k, P.then || O(e);
    d.__e(P, e, t);
  }
  else n == null && e.__v == t.__v ? (e.__k = t.__k, e.__e = t.__e) : u = e.__e = de(t.__e, e, t, o, l, n, i, f, s);
  return (p = d.diffed) && p(e), 128 & e.__u ? void 0 : u;
}
function O(_) {
  _ && (_.__c && (_.__c.__e = !0), _.__k && _.__k.some(O));
}
function oe(_, e, t) {
  for (var o = 0; o < t.length; o++) q(t[o], t[++o], t[++o]);
  d.__c && d.__c(e, _), _.some(function(l) {
    try {
      _ = l.__h, l.__h = [], _.some(function(n) {
        n.call(l);
      });
    } catch (n) {
      d.__e(n, l.__v);
    }
  });
}
function le(_) {
  return typeof _ != "object" || _ == null || _.__b > 0 ? _ : M(_) ? _.map(le) : b({}, _);
}
function de(_, e, t, o, l, n, i, u, f) {
  var s, p, r, v, c, y, g, m = t.props || A, h = e.props, a = e.type;
  if (a == "svg" ? l = "http://www.w3.org/2000/svg" : a == "math" ? l = "http://www.w3.org/1998/Math/MathML" : l || (l = "http://www.w3.org/1999/xhtml"), n != null) {
    for (s = 0; s < n.length; s++) if ((c = n[s]) && "setAttribute" in c == !!a && (a ? c.localName == a : c.nodeType == 3)) {
      _ = c, n[s] = null;
      break;
    }
  }
  if (_ == null) {
    if (a == null) return document.createTextNode(h);
    _ = document.createElementNS(l, a, h.is && h), u && (d.__m && d.__m(e, n), u = !1), n = null;
  }
  if (a == null) m === h || u && _.data == h || (_.data = h);
  else {
    if (n = n && E.call(_.childNodes), !u && n != null) for (m = {}, s = 0; s < _.attributes.length; s++) m[(c = _.attributes[s]).name] = c.value;
    for (s in m) c = m[s], s == "dangerouslySetInnerHTML" ? r = c : s == "children" || s in h || s == "value" && "defaultValue" in h || s == "checked" && "defaultChecked" in h || L(_, s, null, c, l);
    for (s in h) c = h[s], s == "children" ? v = c : s == "dangerouslySetInnerHTML" ? p = c : s == "value" ? y = c : s == "checked" ? g = c : u && typeof c != "function" || m[s] === c || L(_, s, c, m[s], l);
    if (p) u || r && (p.__html == r.__html || p.__html == _.innerHTML) || (_.innerHTML = p.__html), e.__k = [];
    else if (r && (_.innerHTML = ""), ne(e.type == "template" ? _.content : _, M(v) ? v : [v], e, t, o, a == "foreignObject" ? "http://www.w3.org/1999/xhtml" : l, n, i, n ? n[0] : t.__k && S(t, 0), u, f), n != null) for (s = n.length; s--; ) V(n[s]);
    u || (s = "value", a == "progress" && y == null ? _.removeAttribute("value") : y != null && (y !== _[s] || a == "progress" && !y || a == "option" && y != m[s]) && L(_, s, y, m[s], l), s = "checked", g != null && g != _[s] && L(_, s, g, m[s], l));
  }
  return _;
}
function q(_, e, t) {
  try {
    if (typeof _ == "function") {
      var o = typeof _.__u == "function";
      o && _.__u(), o && e == null || (_.__u = _(e));
    } else _.current = e;
  } catch (l) {
    d.__e(l, t);
  }
}
function ie(_, e, t) {
  var o, l;
  if (d.unmount && d.unmount(_), (o = _.ref) && (o.current && o.current != _.__e || q(o, null, e)), (o = _.__c) != null) {
    if (o.componentWillUnmount) try {
      o.componentWillUnmount();
    } catch (n) {
      d.__e(n, e);
    }
    o.base = o.__P = null;
  }
  if (o = _.__k) for (l = 0; l < o.length; l++) o[l] && ie(o[l], e, t || typeof _.type != "function");
  t || V(_.__e), _.__c = _.__ = _.__e = void 0;
}
function ve(_, e, t) {
  return this.constructor(_, t);
}
function ye(_, e, t) {
  var o, l, n, i;
  e == document && (e = document.documentElement), d.__ && d.__(_, e), l = (o = typeof t == "function") ? null : t && t.__k || e.__k, n = [], i = [], z(e, _ = (!o && t || e).__k = ce(H, null, [_]), l || A, A, e.namespaceURI, !o && t ? [t] : l ? null : e.firstChild ? E.call(e.childNodes) : null, n, !o && t ? t : l ? l.__e : e.firstChild, o, i), oe(n, _, i);
}
function me(_, e) {
  ye(_, e, me);
}
function ge(_, e, t) {
  var o, l, n, i, u = b({}, _.props);
  for (n in _.type && _.type.defaultProps && (i = _.type.defaultProps), e) n == "key" ? o = e[n] : n == "ref" ? l = e[n] : u[n] = e[n] === void 0 && i != null ? i[n] : e[n];
  return arguments.length > 2 && (u.children = arguments.length > 3 ? E.call(arguments, 2) : t), T(_.type, u, o || _.key, l || _.ref, null);
}
function ke(_) {
  function e(t) {
    var o, l;
    return this.getChildContext || (o = /* @__PURE__ */ new Set(), (l = {})[e.__c] = this, this.getChildContext = function() {
      return l;
    }, this.componentWillUnmount = function() {
      o = null;
    }, this.shouldComponentUpdate = function(n) {
      this.props.value != n.value && o.forEach(function(i) {
        i.__e = !0, B(i);
      });
    }, this.sub = function(n) {
      o.add(n);
      var i = n.componentWillUnmount;
      n.componentWillUnmount = function() {
        o && o.delete(n), i && i.call(n);
      };
    }), t.children;
  }
  return e.__c = "__cC" + _e++, e.__ = _, e.Provider = e.__l = (e.Consumer = function(t, o) {
    return t.children(o);
  }).contextType = e, e;
}
E = F.slice, d = { __e: function(_, e, t, o) {
  for (var l, n, i; e = e.__; ) if ((l = e.__c) && !l.__) try {
    if ((n = l.constructor) && n.getDerivedStateFromError != null && (l.setState(n.getDerivedStateFromError(_)), i = l.__d), l.componentDidCatch != null && (l.componentDidCatch(_, o || {}), i = l.__d), i) return l.__E = l;
  } catch (u) {
    _ = u;
  }
  throw _;
} }, X = 0, se = function(_) {
  return _ != null && _.constructor === void 0;
}, W.prototype.setState = function(_, e) {
  var t;
  t = this.__s != null && this.__s != this.state ? this.__s : this.__s = b({}, this.state), typeof _ == "function" && (_ = _(b({}, t), this.props)), _ && b(t, _), _ != null && this.__v && (e && this._sb.push(e), B(this));
}, W.prototype.forceUpdate = function(_) {
  this.__v && (this.__e = !0, _ && this.__h.push(_), B(this));
}, W.prototype.render = H, x = [], Y = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Z = function(_, e) {
  return _.__v.__b - e.__v.__b;
}, N.__r = 0, ee = /(PointerCapture)$|Capture$/i, j = 0, R = Q(!1), $ = Q(!0), _e = 0;
export {
  W as Component,
  H as Fragment,
  ge as cloneElement,
  ke as createContext,
  ce as createElement,
  ce as h,
  me as hydrate,
  se as isValidElement,
  d as options,
  ye as render,
  ae as toChildArray
};
