// ../dist/preact.mjs
var n;
var t;
var i;
var r;
var u;
var f;
var o;
var e;
var l;
var c;
var a;
var s;
var h;
var p;
var v = {};
var y = [];
var w = /^m(i|n|o|s|text|space)$/;
var d = Array.isArray;
var _ = y.slice;
var g = Object.assign;
function b(n2) {
  n2 && n2.parentNode && n2.remove();
}
function k(n2, t2, i2) {
  var r2, u2, f2, o2 = {}, e2 = arguments.length;
  for (f2 in t2) "key" == f2 ? r2 = t2[f2] : "ref" == f2 && "function" != typeof n2 ? u2 = t2[f2] : o2[f2] = t2[f2];
  return e2 > 2 && (o2.children = e2 > 3 ? _.call(arguments, 2) : i2), M(n2, o2, r2, u2, null);
}
function m(n2, t2, i2) {
  var r2, u2, f2, o2 = g({}, n2.props), e2 = arguments.length;
  for (f2 in t2) "key" == f2 ? r2 = t2[f2] : "ref" == f2 && "function" != typeof n2.type ? u2 = t2[f2] : o2[f2] = t2[f2];
  return e2 > 2 && (o2.children = e2 > 3 ? _.call(arguments, 2) : i2), M(n2.type, o2, void 0 !== r2 ? r2 : n2.key, void 0 !== u2 ? u2 : n2.ref, null);
}
function M(i2, r2, u2, f2, o2) {
  var e2 = { type: i2, props: r2, key: u2, ref: f2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o2 || ++t, __i: -1, __u: 0 };
  return !o2 && n.vnode && n.vnode(e2), e2;
}
function $() {
  return { current: null };
}
function x(n2) {
  return n2.children;
}
function S(n2, t2) {
  this.props = n2, this.context = t2, this.__g = 0;
}
function C(n2, t2) {
  if (null == t2) return n2.__ ? C(n2.__, n2.__i + 1) : null;
  for (var i2; t2 < n2.__k.length; t2++) if ((i2 = n2.__k[t2]) && i2.__e) return i2.__e;
  return "function" != typeof n2.type || n2.props.__P ? null : C(n2);
}
function j(n2) {
  if ((n2 = n2.__) && n2.__c && !n2.props.__P) return n2.__e = null, n2.__k.some(function(t2) {
    return t2 && (n2.__e = t2.__e);
  }), j(n2);
}
function L(t2) {
  (8 & t2.__g || !(t2.__g |= 8) || !r.push(t2) || f++) && u == n.debounceRendering || ((u = n.debounceRendering) || queueMicrotask)(H);
}
function H() {
  var t2, i2, u2, e2, l2, c2, a2, s2, h2;
  try {
    for (i2 = 1; r.length; ) r.length > i2 && r.sort(o), t2 = r.shift(), i2 = r.length, 8 & t2.__g && (e2 = void 0, l2 = void 0, c2 = (l2 = (u2 = t2).__v).__e, a2 = [], s2 = [], (h2 = u2.__P) && ((e2 = g({ constructor: void 0 }, l2)).__v = l2.__v + 1, n.vnode && n.vnode(e2), z(h2, e2, l2, u2.__n, h2.namespaceURI, 32 & l2.__u ? [c2] : null, a2, c2 || C(l2), 32 & l2.__u, s2), e2.__v = l2.__v, e2.__.__k[e2.__i] = e2, D(a2, e2, s2), l2.__ = l2.__e = null, e2.__e != c2 && j(e2)));
  } finally {
    r.length = f = 0;
  }
}
function I(n2, t2, i2, r2, u2, f2, o2, e2, l2, c2, a2) {
  var s2, h2, p2, w2, d2, _2, g2 = r2.__k || y, b2 = t2.length;
  for (l2 = A(i2, t2, g2, l2, b2), s2 = 0; s2 < b2; s2++) null != (p2 = i2.__k[s2]) && (h2 = ~p2.__i && g2[p2.__i] || v, p2.__i = s2, _2 = z(n2, p2, h2, u2, f2, o2, e2, l2, c2, a2), w2 = p2.__e, p2.ref && (h2.ref != p2.ref || 8 & h2.__u) && (h2.ref != p2.ref && h2.ref && F(h2.ref, null, p2), a2.push(p2.ref, p2.__c || w2, p2)), d2 = d2 || w2, 4 & p2.__u ? (l2 = O(p2, l2, n2, !h2.__v), h2.__e && (h2.__e = null)) : "function" == typeof p2.type && void 0 !== _2 ? l2 = _2 : w2 && (l2 = w2.nextSibling), p2.__u &= -7);
  return i2.__e = d2, l2;
}
function A(n2, t2, i2, r2, u2) {
  var f2, o2, e2, l2, c2, a2, s2, h2, p2, v2, y2 = i2.length, w2 = y2, _2 = 0, g2 = false, b2 = n2.__k = Array(u2);
  for (f2 = 0; f2 < u2; f2++) null != (o2 = t2[f2]) && "boolean" != typeof o2 && "function" != typeof o2 ? ("object" != typeof o2 || o2.constructor == String ? o2 = b2[f2] = M(null, o2) : d(o2) ? o2 = b2[f2] = M(x, { children: o2 }) : void 0 === o2.constructor && o2.__b ? o2 = b2[f2] = M(o2.type, o2.props, o2.key, o2.ref, o2.__v) : b2[f2] = o2, l2 = f2 + _2, o2.__ = n2, o2.__b = n2.__b + 1, e2 = null, ~(c2 = o2.__i = T(o2, i2, l2, w2)) && (w2--, (e2 = i2[c2]) && (e2.__u |= 2)), e2 && e2.__v ? (o2.__u |= 2, c2 == l2 - 1 ? _2-- : c2 == l2 + 1 ? _2++ : c2 != l2 && (c2 > l2 ? _2-- : _2++, g2 = true)) : (~c2 || (u2 > y2 ? _2-- : u2 < y2 && _2++), "function" != typeof o2.type && (o2.__u |= 4))) : b2[f2] = null;
  if (g2) {
    for (a2 = [], s2 = [], f2 = 0; f2 < u2; f2++) if ((o2 = b2[f2]) && 2 & o2.__u) {
      for (h2 = 0, p2 = a2.length; h2 < p2; ) a2[v2 = h2 + p2 >> 1] < o2.__i ? h2 = v2 + 1 : p2 = v2;
      a2[h2] = o2.__i, s2[f2] = h2 + 1;
    }
    for (_2 = a2.length; f2--; ) s2[f2] && (s2[f2] == _2 ? _2-- : b2[f2].__u |= 4);
  }
  if (w2) for (f2 = 0; f2 < y2; f2++) !(e2 = i2[f2]) || 2 & e2.__u || (e2.__e == r2 && (r2 = C(e2)), G(e2, e2));
  return r2;
}
function O(n2, t2, i2, r2) {
  var u2, f2;
  if ("function" == typeof n2.type) {
    if (n2.props.__P) return t2;
    if (u2 = n2.__k) for (f2 = 0; f2 < u2.length; f2++) u2[f2] && (u2[f2].__ = n2, t2 = O(u2[f2], t2, i2, false));
    return t2;
  }
  for (t2 && !t2.parentNode && (t2 = C(n2)) && !t2.parentNode && (t2 = null), n2.__e != t2 && (!r2 && i2.moveBefore && n2.__e.parentNode ? i2.moveBefore(n2.__e, t2) : i2.insertBefore(n2.__e, t2 || null)), t2 = n2.__e; (t2 = t2 && t2.nextSibling) && 8 == t2.nodeType; ) ;
  return t2;
}
function P(n2, t2) {
  return t2 = t2 || [], null != n2 && "boolean" != typeof n2 && (d(n2) ? n2.some(function(n3) {
    P(n3, t2);
  }) : t2.push(n2)), t2;
}
function T(n2, t2, i2, r2) {
  var u2, f2, o2, e2 = n2.key, l2 = n2.type, c2 = t2[i2], a2 = c2 && !(2 & c2.__u);
  if (null === c2 && null == e2 || a2 && e2 == c2.key && l2 == c2.type) return i2;
  if (r2 > (a2 ? 1 : 0)) {
    for (u2 = i2 - 1, f2 = i2 + 1; u2 >= 0 || f2 < t2.length; ) if ((c2 = t2[o2 = u2 >= 0 ? u2-- : f2++]) && !(2 & c2.__u) && e2 == c2.key && l2 == c2.type) return o2;
  }
  return -1;
}
function q(n2, t2, i2) {
  null == i2 && (i2 = ""), "-" == t2[0] ? n2.setProperty(t2, i2) : n2[t2] = i2;
}
function N(n2, t2, i2, r2, u2) {
  var f2;
  n: if ("style" == t2) if ("string" == typeof i2) n2.style.cssText = i2;
  else {
    if ("string" == typeof r2 && (n2.style.cssText = r2 = ""), r2) for (t2 in r2) i2 && t2 in i2 || q(n2.style, t2, "");
    if (i2) for (t2 in i2) r2 && i2[t2] == r2[t2] || q(n2.style, t2, i2[t2]);
  }
  else if ("o" == t2[0] && "n" == t2[1]) f2 = t2 != (t2 = t2.replace(c, "$1")), (t2 = t2.slice(2))[0] < "a" && (t2 = t2.toLowerCase()), (n2.__e || (n2.__e = {}))[t2 + f2] = i2, i2 ? r2 ? i2[l] = r2[l] : (i2[l] = a, n2.addEventListener(t2, f2 ? h : s, f2)) : n2.removeEventListener(t2, f2 ? h : s, f2);
  else {
    if ("http://www.w3.org/2000/svg" == u2) t2 = t2.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
    else if ("width" != t2 && "height" != t2 && "href" != t2 && "list" != t2 && "form" != t2 && "tabIndex" != t2 && "download" != t2 && "rowSpan" != t2 && "colSpan" != t2 && "role" != t2 && "popover" != t2 && t2 in n2) try {
      n2[t2] = null == i2 ? "" : i2;
      break n;
    } catch (n3) {
    }
    "function" == typeof i2 || (null == i2 || false === i2 && "-" != t2[4] ? n2.removeAttribute(t2) : n2.setAttribute(t2, "popover" == t2 && 1 == i2 ? "" : i2));
  }
}
function V(t2) {
  return function(i2) {
    if (this.__e) {
      var r2 = this.__e[i2.type + t2];
      if (null == i2[e]) i2[e] = a++;
      else if (i2[e] < r2[l]) return;
      return r2(n.event ? n.event(i2) : i2);
    }
  };
}
function z(t2, i2, r2, u2, f2, o2, e2, l2, c2, a2) {
  var s2, h2, p2, v2, w2, _2, k2, m2, M2, $2, j2, L2, H2, A2, O2, P2, T2, q2, N2, V2, z2 = i2.type;
  if (void 0 !== i2.constructor) return null;
  if (128 & r2.__u && (c2 = 32 & r2.__u, s2 = r2.__c.__z)) {
    if (i2.__u |= c2, h2 = o2 = [], 8 == s2.nodeType) for (p2 = 1, v2 = s2.nextSibling; v2; v2 = v2.nextSibling) {
      if (8 == v2.nodeType) {
        if (v2.data.startsWith("$s")) p2++;
        else if (v2.data.startsWith("/$s") && !--p2) break;
      }
      o2.push(v2);
    }
    else o2.push(s2);
    l2 = o2[0];
  }
  (s2 = n.__b) && s2(i2);
  n: if ("function" == typeof z2) {
    w2 = e2.length;
    try {
      if ($2 = i2.props, j2 = (s2 = z2.prototype) && s2.render, L2 = (s2 = z2.contextType) && u2[s2.__c], H2 = s2 ? L2 ? L2.props.value : s2.__ : u2, r2.__c ? 2 & (_2 = i2.__c = r2.__c).__g && (_2.__g |= 1) : (j2 ? i2.__c = _2 = new z2($2, H2) : (i2.__c = _2 = new S($2, H2), _2.constructor = z2, _2.render = J), L2 && L2.sub(_2), _2.state || (_2.state = {}), _2.__n = u2, _2.__g |= 8, _2.__h = [], _2.__k = []), j2 && (_2.__s || (_2.__s = _2.state), z2.getDerivedStateFromProps && (_2.__s == _2.state && (_2.__s = g({}, _2.__s)), g(_2.__s, z2.getDerivedStateFromProps($2, _2.__s)))), k2 = _2.props, m2 = _2.state, _2.__v = i2, r2.__c) {
        if (j2 && !z2.getDerivedStateFromProps && $2 !== k2 && _2.componentWillReceiveProps && _2.componentWillReceiveProps($2, H2), i2.__v == r2.__v && !(8 & _2.__g) || !(4 & _2.__g) && _2.shouldComponentUpdate && false === _2.shouldComponentUpdate($2, _2.__s, H2)) {
          i2.__v != r2.__v && (_2.props = $2, _2.state = _2.__s, _2.__g &= -9), i2.__e = r2.__e, i2.__k = r2.__k, i2.__k.some(function(n2) {
            n2 && (n2.__ = i2);
          }), y.push.apply(_2.__h, _2.__k), _2.__k = [], _2.__h.length && e2.push(_2), l2 = C(r2);
          break n;
        }
        _2.componentWillUpdate && _2.componentWillUpdate($2, _2.__s, H2), j2 && _2.componentDidUpdate && _2.__h.push(function() {
          _2.componentDidUpdate(k2, m2, M2);
        });
      } else j2 && !z2.getDerivedStateFromProps && _2.componentWillMount && _2.componentWillMount(), j2 && _2.componentDidMount && _2.__h.push(_2.componentDidMount);
      if (_2.context = H2, _2.props = $2, _2.__P = t2, _2.__g &= -5, A2 = n.__r, O2 = 0, j2) _2.state = _2.__s, _2.__g &= -9, A2 && A2(i2), s2 = _2.render(_2.props, _2.state, _2.context), y.push.apply(_2.__h, _2.__k), _2.__k = [];
      else do {
        _2.__g &= -9, A2 && A2(i2), s2 = _2.render(_2.props, _2.state, _2.context), _2.state = _2.__s;
      } while (8 & _2.__g && ++O2 < 25);
      _2.state = _2.__s, _2.getChildContext && (u2 = g({}, u2, _2.getChildContext())), j2 && r2.__c && _2.getSnapshotBeforeUpdate && (M2 = _2.getSnapshotBeforeUpdate(k2, m2)), P2 = s2 && s2.type === x && null == s2.key ? s2.props.children : s2, $2.__P && (s2 = l2, f2 = (t2 = $2.__P).namespaceURI, c2 = o2 = null, r2.props && r2.props.__P != t2 && (r2.__k.some(function(n2) {
        n2 && G(n2, n2);
      }), r2.__k = null), l2 = r2.__k ? C(r2, 0) : null), l2 = I(t2, d(P2) ? P2 : [P2], i2, r2, u2, f2, o2, e2, l2, c2, a2), $2.__P && (i2.__e = null, l2 = s2), i2.__u &= -161, 128 & r2.__u && (_2.__z = null), h2 && h2.some(b), _2.__h.length && e2.push(_2), 1 & _2.__g && (_2.__g &= -4);
    } catch (t3) {
      if (e2.length = w2, i2.__v = null, c2 || o2) if (t3.then) {
        if (T2 = 0, i2.__u |= c2 ? 160 : 128, o2) {
          for (N2 = 0; N2 < o2.length; N2++) if (V2 = o2[N2]) if (8 == V2.nodeType) {
            if (o2[N2] = null, V2.data.startsWith("$s")) T2++ || (q2 = V2);
            else if (V2.data.startsWith("/$s") && !--T2) {
              l2 = V2;
              break;
            }
          } else T2 && (o2[N2] = null);
        }
        if (!q2) {
          for (; l2 && 8 == l2.nodeType && l2.nextSibling; ) l2 = l2.nextSibling;
          o2 && (o2[o2.indexOf(l2)] = null), q2 = l2;
        }
        i2.__c.__z || (i2.__c.__z = q2), i2.__e = l2;
      } else o2 && o2.some(b);
      else i2.__e = r2.__e;
      i2.__k || (i2.__k = r2.__k || []), t3.then || B(i2), n.__e(t3, i2, r2);
    }
  } else l2 = i2.__e = E(r2.__e, i2, r2, u2, f2, o2, e2, c2, a2, t2);
  return (s2 = n.diffed) && s2(i2), 128 & i2.__u ? void 0 : l2;
}
function B(n2) {
  n2 && (n2.__c && (n2.__c.__g |= 4), n2.__k && n2.__k.some(B));
}
function D(t2, i2, r2) {
  for (var u2 = 0; u2 < r2.length; ) F(r2[u2++], r2[u2++], r2[u2++]);
  n.__c && n.__c(i2, t2), t2.some(function(i3) {
    try {
      t2 = i3.__h, i3.__h = [], t2.some(function(n2) {
        n2.call(i3);
      });
    } catch (t3) {
      n.__e(t3, i3.__v);
    }
  });
}
function E(t2, i2, r2, u2, f2, o2, e2, l2, c2, a2) {
  var s2, h2, p2, y2, g2, k2, m2, M2, $2, x2 = r2.props || v, S2 = i2.props, j2 = i2.type;
  if ("svg" == j2 ? f2 = "http://www.w3.org/2000/svg" : "math" == j2 ? f2 = "http://www.w3.org/1998/Math/MathML" : f2 || (f2 = "http://www.w3.org/1999/xhtml"), o2) {
    for (s2 = 0; s2 < o2.length; s2++) if ((g2 = o2[s2]) && (j2 ? g2.localName == j2 : 3 == g2.nodeType)) {
      t2 = g2, o2[s2] = null;
      break;
    }
  }
  if (!t2) {
    if (M2 = a2.ownerDocument || document, !j2) return M2.createTextNode(S2);
    t2 = M2.createElementNS(f2, j2, S2.is && S2), l2 && (n.__m && n.__m(i2, o2), l2 = false), o2 = null;
  }
  if (j2) {
    if (a2 = "template" == j2 ? t2.content : t2, o2 = "textarea" == j2 && null != S2.defaultValue ? null : o2 && _.call(a2.childNodes), !l2 && o2) for (x2 = {}, s2 = 0; s2 < t2.attributes.length; s2++) x2[(g2 = t2.attributes[s2]).name] = g2.value;
    for (s2 in x2) g2 = x2[s2], "dangerouslySetInnerHTML" == s2 ? p2 = g2 : "children" == s2 || s2 in S2 || "value" == s2 && "defaultValue" in S2 || "checked" == s2 && "defaultChecked" in S2 || N(t2, s2, null, g2, f2);
    for (s2 in $2 = 1 & r2.__u, S2) g2 = S2[s2], "children" == s2 ? y2 = g2 : "dangerouslySetInnerHTML" == s2 ? h2 = g2 : "value" == s2 ? k2 = g2 : "checked" == s2 ? m2 = g2 : l2 && "function" != typeof g2 || !(x2[s2] !== g2 || $2 && null != g2) || N(t2, s2, g2, x2[s2], f2);
    h2 ? (l2 || p2 && (h2.__html == p2.__html || h2.__html == t2.innerHTML) || (t2.innerHTML = h2.__html), i2.__k = []) : (p2 && (t2.textContent = ""), ("foreignObject" == j2 || "http://www.w3.org/1998/Math/MathML" == f2 && w.test(j2)) && (f2 = "http://www.w3.org/1999/xhtml"), I(a2, d(y2) ? y2 : [y2], i2, r2, u2, f2, o2, e2, o2 ? o2[0] : r2.__k && C(r2, 0), l2, c2), o2 && o2.some(b)), l2 && "textarea" != j2 || (s2 = "value", "progress" == j2 && null == k2 ? t2.removeAttribute(s2) : null == k2 || k2 === t2[s2] && ("progress" != j2 || k2) || N(t2, s2, k2, x2[s2], f2), s2 = "checked", null != m2 && m2 != t2[s2] && N(t2, s2, m2, x2[s2], f2));
  } else x2 === S2 || l2 && t2.data == S2 || (t2.data = S2);
  return t2;
}
function F(t2, i2, r2) {
  try {
    "function" == typeof t2 ? ("function" == typeof t2.__u && t2.__u(), ("function" != typeof t2.__u || i2) && (t2.__u = t2(i2))) : t2.current = i2;
  } catch (t3) {
    n.__e(t3, r2);
  }
}
function G(t2, i2, r2) {
  var u2, f2;
  if (n.unmount && n.unmount(t2), !(u2 = t2.ref) || u2.current && u2.current != t2.__e || F(u2, null, i2), u2 = t2.__c) {
    if (u2.componentWillUnmount) try {
      u2.componentWillUnmount();
    } catch (t3) {
      n.__e(t3, i2);
    }
    u2.__P = u2.__n = null;
  }
  if (u2 = t2.__k) for (f2 = 0; f2 < u2.length; f2++) u2[f2] && G(u2[f2], i2, "function" != typeof t2.type || r2 && !t2.props.__P);
  (u2 = t2.__e) && (r2 || b(u2), u2.__e && (u2.__e = null)), t2.__e = t2.__c = t2.__ = null;
}
function J(n2, t2, i2) {
  return this.constructor(n2, i2);
}
function K(t2, i2) {
  var r2, u2, f2, o2;
  n.__ && n.__(t2, i2), 9 == i2.nodeType && (i2 = i2.documentElement), u2 = (r2 = t2 && 32 & t2.__u) ? null : i2.__k, i2.__k = M(x, { children: [t2] }), f2 = [], o2 = [], z(i2, i2.__k, u2 || v, v, i2.namespaceURI, u2 ? null : i2.firstChild ? _.call(i2.childNodes) : null, f2, u2 ? u2.__e : i2.firstChild, r2, o2), D(f2, i2.__k, o2), i2.__k.props.children = null;
}
function Q(n2, t2) {
  n2 && "object" == typeof n2 && (n2.__u |= 32), K(n2, t2);
}
function R(n2) {
  function t2(n3) {
    var i2, r2;
    return this.getChildContext || (i2 = /* @__PURE__ */ new Set(), (r2 = {})[t2.__c] = this, this.getChildContext = function() {
      return r2;
    }, this.shouldComponentUpdate = function(n4) {
      this.props.value != n4.value && i2.forEach(function(n5) {
        n5.__g |= 4, L(n5);
      });
    }, this.sub = function(n4) {
      i2.add(n4);
      var t3 = n4.componentWillUnmount;
      n4.componentWillUnmount = function() {
        i2.delete(n4), t3 && t3.call(n4);
      };
    }), n3.children;
  }
  return t2.__c = "__cC" + p++, t2.__ = n2, t2.Provider = (t2.Consumer = function(n3, t3) {
    return n3.children(t3);
  }).contextType = t2, t2;
}
function U(n2) {
  return n2.children;
}
function W(n2, t2) {
  return M(U, { __P: t2, children: n2 });
}
n = { __e: function(n2, t2, i2, r2) {
  for (var u2, o2, e2; t2 = t2.__; ) if ((u2 = t2.__c) && !(1 & u2.__g)) {
    u2.__g |= 4;
    try {
      if ((o2 = u2.constructor) && o2.getDerivedStateFromError && (u2.setState(o2.getDerivedStateFromError(n2)), e2 = 8 & u2.__g), u2.componentDidCatch && (u2.componentDidCatch(n2, r2 || {}), e2 = 8 & u2.__g), e2) return void (u2.__g |= 2);
    } catch (t3) {
      n2 = t3, e2 = 0;
    }
  }
  throw f = 0, n2;
} }, t = 0, i = function(n2) {
  return null != n2 && void 0 === n2.constructor;
}, S.prototype.setState = function(n2, t2) {
  var i2 = this.__s;
  i2 && i2 != this.state || (i2 = this.__s = g({}, this.state)), "function" == typeof n2 && (n2 = n2(g({}, i2), this.props)), n2 && (g(i2, n2), this.__v && (t2 && this.__k.push(t2), L(this)));
}, S.prototype.forceUpdate = function(n2) {
  this.__v && (this.__g |= 4, n2 && this.__h.push(n2), L(this));
}, S.prototype.render = x, r = [], f = 0, o = function(n2, t2) {
  return n2.__v.__b - t2.__v.__b;
}, e = Symbol(), l = Symbol(), c = /(PointerCapture)$|Capture$/i, a = 0, s = V(false), h = V(true), p = 0;
export {
  S as Component,
  x as Fragment,
  m as cloneElement,
  R as createContext,
  k as createElement,
  W as createPortal,
  $ as createRef,
  k as h,
  Q as hydrate,
  i as isValidElement,
  n as options,
  K as render,
  P as toChildArray
};
