import * as i from "react";
import { useState as Re } from "react";
import { P as H, c as X, d as Le } from "./index-DCcK_d4W.mjs";
import { u as te } from "./index-DLcqcWxM.mjs";
import { u as M, b as Te } from "./index-DOfn3ixy.mjs";
import { jsx as j } from "react/jsx-runtime";
import Ae from "react-dom";
function De(e, t = globalThis?.document) {
  const n = M(e);
  i.useEffect(() => {
    const r = (a) => {
      a.key === "Escape" && n(a);
    };
    return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
  }, [n, t]);
}
var ke = "DismissableLayer", J = "dismissableLayer.update", Ne = "dismissableLayer.pointerDownOutside", Fe = "dismissableLayer.focusOutside", re, me = i.createContext({
  layers: /* @__PURE__ */ new Set(),
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
  branches: /* @__PURE__ */ new Set()
}), Me = i.forwardRef(
  (e, t) => {
    const {
      disableOutsidePointerEvents: n = !1,
      onEscapeKeyDown: r,
      onPointerDownOutside: a,
      onFocusOutside: u,
      onInteractOutside: s,
      onDismiss: o,
      ...S
    } = e, l = i.useContext(me), [f, h] = i.useState(null), v = f?.ownerDocument ?? globalThis?.document, [, y] = i.useState({}), C = te(t, (p) => h(p)), c = Array.from(l.layers), [d] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), m = c.indexOf(d), E = f ? c.indexOf(f) : -1, g = l.layersWithOutsidePointerEventsDisabled.size > 0, b = E >= m, w = Be((p) => {
      const L = p.target, T = [...l.branches].some((F) => F.contains(L));
      !b || T || (a?.(p), s?.(p), p.defaultPrevented || o?.());
    }, v), P = We((p) => {
      const L = p.target;
      [...l.branches].some((F) => F.contains(L)) || (u?.(p), s?.(p), p.defaultPrevented || o?.());
    }, v);
    return De((p) => {
      E === l.layers.size - 1 && (r?.(p), !p.defaultPrevented && o && (p.preventDefault(), o()));
    }, v), i.useEffect(() => {
      if (f)
        return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (re = v.body.style.pointerEvents, v.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(f)), l.layers.add(f), ae(), () => {
          n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents = re);
        };
    }, [f, v, n, l]), i.useEffect(() => () => {
      f && (l.layers.delete(f), l.layersWithOutsidePointerEventsDisabled.delete(f), ae());
    }, [f, l]), i.useEffect(() => {
      const p = () => y({});
      return document.addEventListener(J, p), () => document.removeEventListener(J, p);
    }, []), /* @__PURE__ */ j(
      H.div,
      {
        ...S,
        ref: C,
        style: {
          pointerEvents: g ? b ? "auto" : "none" : void 0,
          ...e.style
        },
        onFocusCapture: X(e.onFocusCapture, P.onFocusCapture),
        onBlurCapture: X(e.onBlurCapture, P.onBlurCapture),
        onPointerDownCapture: X(
          e.onPointerDownCapture,
          w.onPointerDownCapture
        )
      }
    );
  }
);
Me.displayName = ke;
var Ie = "DismissableLayerBranch", xe = i.forwardRef((e, t) => {
  const n = i.useContext(me), r = i.useRef(null), a = te(t, r);
  return i.useEffect(() => {
    const u = r.current;
    if (u)
      return n.branches.add(u), () => {
        n.branches.delete(u);
      };
  }, [n.branches]), /* @__PURE__ */ j(H.div, { ...e, ref: a });
});
xe.displayName = Ie;
function Be(e, t = globalThis?.document) {
  const n = M(e), r = i.useRef(!1), a = i.useRef(() => {
  });
  return i.useEffect(() => {
    const u = (o) => {
      if (o.target && !r.current) {
        let S = function() {
          pe(
            Ne,
            n,
            l,
            { discrete: !0 }
          );
        };
        const l = { originalEvent: o };
        o.pointerType === "touch" ? (t.removeEventListener("click", a.current), a.current = S, t.addEventListener("click", a.current, { once: !0 })) : S();
      } else
        t.removeEventListener("click", a.current);
      r.current = !1;
    }, s = window.setTimeout(() => {
      t.addEventListener("pointerdown", u);
    }, 0);
    return () => {
      window.clearTimeout(s), t.removeEventListener("pointerdown", u), t.removeEventListener("click", a.current);
    };
  }, [t, n]), {
    // ensures we check React component tree (not just DOM tree)
    onPointerDownCapture: () => r.current = !0
  };
}
function We(e, t = globalThis?.document) {
  const n = M(e), r = i.useRef(!1);
  return i.useEffect(() => {
    const a = (u) => {
      u.target && !r.current && pe(Fe, n, { originalEvent: u }, {
        discrete: !1
      });
    };
    return t.addEventListener("focusin", a), () => t.removeEventListener("focusin", a);
  }, [t, n]), {
    onFocusCapture: () => r.current = !0,
    onBlurCapture: () => r.current = !1
  };
}
function ae() {
  const e = new CustomEvent(J);
  document.dispatchEvent(e);
}
function pe(e, t, n, { discrete: r }) {
  const a = n.originalEvent.target, u = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
  t && a.addEventListener(e, t, { once: !0 }), r ? Le(a, u) : a.dispatchEvent(u);
}
var Y = "focusScope.autoFocusOnMount", z = "focusScope.autoFocusOnUnmount", oe = { bubbles: !1, cancelable: !0 }, _e = "FocusScope", Ue = i.forwardRef((e, t) => {
  const {
    loop: n = !1,
    trapped: r = !1,
    onMountAutoFocus: a,
    onUnmountAutoFocus: u,
    ...s
  } = e, [o, S] = i.useState(null), l = M(a), f = M(u), h = i.useRef(null), v = te(t, (c) => S(c)), y = i.useRef({
    paused: !1,
    pause() {
      this.paused = !0;
    },
    resume() {
      this.paused = !1;
    }
  }).current;
  i.useEffect(() => {
    if (r) {
      let c = function(g) {
        if (y.paused || !o) return;
        const b = g.target;
        o.contains(b) ? h.current = b : R(h.current, { select: !0 });
      }, d = function(g) {
        if (y.paused || !o) return;
        const b = g.relatedTarget;
        b !== null && (o.contains(b) || R(h.current, { select: !0 }));
      }, m = function(g) {
        if (document.activeElement === document.body)
          for (const w of g)
            w.removedNodes.length > 0 && R(o);
      };
      document.addEventListener("focusin", c), document.addEventListener("focusout", d);
      const E = new MutationObserver(m);
      return o && E.observe(o, { childList: !0, subtree: !0 }), () => {
        document.removeEventListener("focusin", c), document.removeEventListener("focusout", d), E.disconnect();
      };
    }
  }, [r, o, y.paused]), i.useEffect(() => {
    if (o) {
      ce.add(y);
      const c = document.activeElement;
      if (!o.contains(c)) {
        const m = new CustomEvent(Y, oe);
        o.addEventListener(Y, l), o.dispatchEvent(m), m.defaultPrevented || (Ke(Ye(ye(o)), { select: !0 }), document.activeElement === c && R(o));
      }
      return () => {
        o.removeEventListener(Y, l), setTimeout(() => {
          const m = new CustomEvent(z, oe);
          o.addEventListener(z, f), o.dispatchEvent(m), m.defaultPrevented || R(c ?? document.body, { select: !0 }), o.removeEventListener(z, f), ce.remove(y);
        }, 0);
      };
    }
  }, [o, l, f, y]);
  const C = i.useCallback(
    (c) => {
      if (!n && !r || y.paused) return;
      const d = c.key === "Tab" && !c.altKey && !c.ctrlKey && !c.metaKey, m = document.activeElement;
      if (d && m) {
        const E = c.currentTarget, [g, b] = He(E);
        g && b ? !c.shiftKey && m === b ? (c.preventDefault(), n && R(g, { select: !0 })) : c.shiftKey && m === g && (c.preventDefault(), n && R(b, { select: !0 })) : m === E && c.preventDefault();
      }
    },
    [n, r, y.paused]
  );
  return /* @__PURE__ */ j(H.div, { tabIndex: -1, ...s, ref: v, onKeyDown: C });
});
Ue.displayName = _e;
function Ke(e, { select: t = !1 } = {}) {
  const n = document.activeElement;
  for (const r of e)
    if (R(r, { select: t }), document.activeElement !== n) return;
}
function He(e) {
  const t = ye(e), n = ie(t, e), r = ie(t.reverse(), e);
  return [n, r];
}
function ye(e) {
  const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (r) => {
      const a = r.tagName === "INPUT" && r.type === "hidden";
      return r.disabled || r.hidden || a ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
    }
  });
  for (; n.nextNode(); ) t.push(n.currentNode);
  return t;
}
function ie(e, t) {
  for (const n of e)
    if (!je(n, { upTo: t })) return n;
}
function je(e, { upTo: t }) {
  if (getComputedStyle(e).visibility === "hidden") return !0;
  for (; e; ) {
    if (t !== void 0 && e === t) return !1;
    if (getComputedStyle(e).display === "none") return !0;
    e = e.parentElement;
  }
  return !1;
}
function Ve(e) {
  return e instanceof HTMLInputElement && "select" in e;
}
function R(e, { select: t = !1 } = {}) {
  if (e && e.focus) {
    const n = document.activeElement;
    e.focus({ preventScroll: !0 }), e !== n && Ve(e) && t && e.select();
  }
}
var ce = Xe();
function Xe() {
  let e = [];
  return {
    add(t) {
      const n = e[0];
      t !== n && n?.pause(), e = ue(e, t), e.unshift(t);
    },
    remove(t) {
      e = ue(e, t), e[0]?.resume();
    }
  };
}
function ue(e, t) {
  const n = [...e], r = n.indexOf(t);
  return r !== -1 && n.splice(r, 1), n;
}
function Ye(e) {
  return e.filter((t) => t.tagName !== "A");
}
var ze = "Portal", Ge = i.forwardRef((e, t) => {
  const { container: n, ...r } = e, [a, u] = i.useState(!1);
  Te(() => u(!0), []);
  const s = n || a && globalThis?.document?.body;
  return s ? Ae.createPortal(/* @__PURE__ */ j(H.div, { ...r, ref: t }), s) : null;
});
Ge.displayName = ze;
var G = 0;
function Kt() {
  i.useEffect(() => {
    const e = document.querySelectorAll("[data-radix-focus-guard]");
    return document.body.insertAdjacentElement("afterbegin", e[0] ?? se()), document.body.insertAdjacentElement("beforeend", e[1] ?? se()), G++, () => {
      G === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), G--;
    };
  }, []);
}
function se() {
  const e = document.createElement("span");
  return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
}
var O = function() {
  return O = Object.assign || function(t) {
    for (var n, r = 1, a = arguments.length; r < a; r++) {
      n = arguments[r];
      for (var u in n) Object.prototype.hasOwnProperty.call(n, u) && (t[u] = n[u]);
    }
    return t;
  }, O.apply(this, arguments);
};
function Ee(e, t) {
  var n = {};
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
      t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
  return n;
}
function Ze(e, t, n) {
  if (n || arguments.length === 2) for (var r = 0, a = t.length, u; r < a; r++)
    (u || !(r in t)) && (u || (u = Array.prototype.slice.call(t, 0, r)), u[r] = t[r]);
  return e.concat(u || Array.prototype.slice.call(t));
}
var U = "right-scroll-bar-position", K = "width-before-scroll-bar", qe = "with-scroll-bars-hidden", Qe = "--removed-body-scroll-bar-size";
function Z(e, t) {
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
}
function $e(e, t) {
  var n = Re(function() {
    return {
      // value
      value: e,
      // last callback
      callback: t,
      // "memoized" public interface
      facade: {
        get current() {
          return n.value;
        },
        set current(r) {
          var a = n.value;
          a !== r && (n.value = r, n.callback(r, a));
        }
      }
    };
  })[0];
  return n.callback = t, n.facade;
}
var Je = typeof window < "u" ? i.useLayoutEffect : i.useEffect, le = /* @__PURE__ */ new WeakMap();
function et(e, t) {
  var n = $e(null, function(r) {
    return e.forEach(function(a) {
      return Z(a, r);
    });
  });
  return Je(function() {
    var r = le.get(n);
    if (r) {
      var a = new Set(r), u = new Set(e), s = n.current;
      a.forEach(function(o) {
        u.has(o) || Z(o, null);
      }), u.forEach(function(o) {
        a.has(o) || Z(o, s);
      });
    }
    le.set(n, e);
  }, [e]), n;
}
function tt(e) {
  return e;
}
function nt(e, t) {
  t === void 0 && (t = tt);
  var n = [], r = !1, a = {
    read: function() {
      if (r)
        throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
      return n.length ? n[n.length - 1] : e;
    },
    useMedium: function(u) {
      var s = t(u, r);
      return n.push(s), function() {
        n = n.filter(function(o) {
          return o !== s;
        });
      };
    },
    assignSyncMedium: function(u) {
      for (r = !0; n.length; ) {
        var s = n;
        n = [], s.forEach(u);
      }
      n = {
        push: function(o) {
          return u(o);
        },
        filter: function() {
          return n;
        }
      };
    },
    assignMedium: function(u) {
      r = !0;
      var s = [];
      if (n.length) {
        var o = n;
        n = [], o.forEach(u), s = n;
      }
      var S = function() {
        var f = s;
        s = [], f.forEach(u);
      }, l = function() {
        return Promise.resolve().then(S);
      };
      l(), n = {
        push: function(f) {
          s.push(f), l();
        },
        filter: function(f) {
          return s = s.filter(f), n;
        }
      };
    }
  };
  return a;
}
function rt(e) {
  e === void 0 && (e = {});
  var t = nt(null);
  return t.options = O({ async: !0, ssr: !1 }, e), t;
}
var ge = function(e) {
  var t = e.sideCar, n = Ee(e, ["sideCar"]);
  if (!t)
    throw new Error("Sidecar: please provide `sideCar` property to import the right car");
  var r = t.read();
  if (!r)
    throw new Error("Sidecar medium not found");
  return i.createElement(r, O({}, n));
};
ge.isSideCarExport = !0;
function at(e, t) {
  return e.useMedium(t), ge;
}
var be = rt(), q = function() {
}, V = i.forwardRef(function(e, t) {
  var n = i.useRef(null), r = i.useState({
    onScrollCapture: q,
    onWheelCapture: q,
    onTouchMoveCapture: q
  }), a = r[0], u = r[1], s = e.forwardProps, o = e.children, S = e.className, l = e.removeScrollBar, f = e.enabled, h = e.shards, v = e.sideCar, y = e.noRelative, C = e.noIsolation, c = e.inert, d = e.allowPinchZoom, m = e.as, E = m === void 0 ? "div" : m, g = e.gapMode, b = Ee(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), w = v, P = et([n, t]), p = O(O({}, b), a);
  return i.createElement(
    i.Fragment,
    null,
    f && i.createElement(w, { sideCar: be, removeScrollBar: l, shards: h, noRelative: y, noIsolation: C, inert: c, setCallbacks: u, allowPinchZoom: !!d, lockRef: n, gapMode: g }),
    s ? i.cloneElement(i.Children.only(o), O(O({}, p), { ref: P })) : i.createElement(E, O({}, p, { className: S, ref: P }), o)
  );
});
V.defaultProps = {
  enabled: !0,
  removeScrollBar: !0,
  inert: !1
};
V.classNames = {
  fullWidth: K,
  zeroRight: U
};
var ot = function() {
  if (typeof __webpack_nonce__ < "u")
    return __webpack_nonce__;
};
function it() {
  if (!document)
    return null;
  var e = document.createElement("style");
  e.type = "text/css";
  var t = ot();
  return t && e.setAttribute("nonce", t), e;
}
function ct(e, t) {
  e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
}
function ut(e) {
  var t = document.head || document.getElementsByTagName("head")[0];
  t.appendChild(e);
}
var st = function() {
  var e = 0, t = null;
  return {
    add: function(n) {
      e == 0 && (t = it()) && (ct(t, n), ut(t)), e++;
    },
    remove: function() {
      e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
    }
  };
}, lt = function() {
  var e = st();
  return function(t, n) {
    i.useEffect(function() {
      return e.add(t), function() {
        e.remove();
      };
    }, [t && n]);
  };
}, Se = function() {
  var e = lt(), t = function(n) {
    var r = n.styles, a = n.dynamic;
    return e(r, a), null;
  };
  return t;
}, dt = {
  left: 0,
  top: 0,
  right: 0,
  gap: 0
}, Q = function(e) {
  return parseInt(e || "", 10) || 0;
}, ft = function(e) {
  var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], a = t[e === "padding" ? "paddingRight" : "marginRight"];
  return [Q(n), Q(r), Q(a)];
}, vt = function(e) {
  if (e === void 0 && (e = "margin"), typeof window > "u")
    return dt;
  var t = ft(e), n = document.documentElement.clientWidth, r = window.innerWidth;
  return {
    left: t[0],
    top: t[1],
    right: t[2],
    gap: Math.max(0, r - n + t[2] - t[0])
  };
}, ht = Se(), N = "data-scroll-locked", mt = function(e, t, n, r) {
  var a = e.left, u = e.top, s = e.right, o = e.gap;
  return n === void 0 && (n = "margin"), `
  .`.concat(qe, ` {
   overflow: hidden `).concat(r, `;
   padding-right: `).concat(o, "px ").concat(r, `;
  }
  body[`).concat(N, `] {
    overflow: hidden `).concat(r, `;
    overscroll-behavior: contain;
    `).concat([
    t && "position: relative ".concat(r, ";"),
    n === "margin" && `
    padding-left: `.concat(a, `px;
    padding-top: `).concat(u, `px;
    padding-right: `).concat(s, `px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o, "px ").concat(r, `;
    `),
    n === "padding" && "padding-right: ".concat(o, "px ").concat(r, ";")
  ].filter(Boolean).join(""), `
  }
  
  .`).concat(U, ` {
    right: `).concat(o, "px ").concat(r, `;
  }
  
  .`).concat(K, ` {
    margin-right: `).concat(o, "px ").concat(r, `;
  }
  
  .`).concat(U, " .").concat(U, ` {
    right: 0 `).concat(r, `;
  }
  
  .`).concat(K, " .").concat(K, ` {
    margin-right: 0 `).concat(r, `;
  }
  
  body[`).concat(N, `] {
    `).concat(Qe, ": ").concat(o, `px;
  }
`);
}, de = function() {
  var e = parseInt(document.body.getAttribute(N) || "0", 10);
  return isFinite(e) ? e : 0;
}, pt = function() {
  i.useEffect(function() {
    return document.body.setAttribute(N, (de() + 1).toString()), function() {
      var e = de() - 1;
      e <= 0 ? document.body.removeAttribute(N) : document.body.setAttribute(N, e.toString());
    };
  }, []);
}, yt = function(e) {
  var t = e.noRelative, n = e.noImportant, r = e.gapMode, a = r === void 0 ? "margin" : r;
  pt();
  var u = i.useMemo(function() {
    return vt(a);
  }, [a]);
  return i.createElement(ht, { styles: mt(u, !t, a, n ? "" : "!important") });
}, ee = !1;
if (typeof window < "u")
  try {
    var x = Object.defineProperty({}, "passive", {
      get: function() {
        return ee = !0, !0;
      }
    });
    window.addEventListener("test", x, x), window.removeEventListener("test", x, x);
  } catch {
    ee = !1;
  }
var A = ee ? { passive: !1 } : !1, Et = function(e) {
  return e.tagName === "TEXTAREA";
}, we = function(e, t) {
  if (!(e instanceof Element))
    return !1;
  var n = window.getComputedStyle(e);
  return (
    // not-not-scrollable
    n[t] !== "hidden" && // contains scroll inside self
    !(n.overflowY === n.overflowX && !Et(e) && n[t] === "visible")
  );
}, gt = function(e) {
  return we(e, "overflowY");
}, bt = function(e) {
  return we(e, "overflowX");
}, fe = function(e, t) {
  var n = t.ownerDocument, r = t;
  do {
    typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
    var a = Ce(e, r);
    if (a) {
      var u = Pe(e, r), s = u[1], o = u[2];
      if (s > o)
        return !0;
    }
    r = r.parentNode;
  } while (r && r !== n.body);
  return !1;
}, St = function(e) {
  var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
  return [
    t,
    n,
    r
  ];
}, wt = function(e) {
  var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
  return [
    t,
    n,
    r
  ];
}, Ce = function(e, t) {
  return e === "v" ? gt(t) : bt(t);
}, Pe = function(e, t) {
  return e === "v" ? St(t) : wt(t);
}, Ct = function(e, t) {
  return e === "h" && t === "rtl" ? -1 : 1;
}, Pt = function(e, t, n, r, a) {
  var u = Ct(e, window.getComputedStyle(t).direction), s = u * r, o = n.target, S = t.contains(o), l = !1, f = s > 0, h = 0, v = 0;
  do {
    if (!o)
      break;
    var y = Pe(e, o), C = y[0], c = y[1], d = y[2], m = c - d - u * C;
    (C || m) && Ce(e, o) && (h += m, v += C);
    var E = o.parentNode;
    o = E && E.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? E.host : E;
  } while (
    // portaled content
    !S && o !== document.body || // self content
    S && (t.contains(o) || t === o)
  );
  return (f && Math.abs(h) < 1 || !f && Math.abs(v) < 1) && (l = !0), l;
}, B = function(e) {
  return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
}, ve = function(e) {
  return [e.deltaX, e.deltaY];
}, he = function(e) {
  return e && "current" in e ? e.current : e;
}, Ot = function(e, t) {
  return e[0] === t[0] && e[1] === t[1];
}, Rt = function(e) {
  return `
  .block-interactivity-`.concat(e, ` {pointer-events: none;}
  .allow-interactivity-`).concat(e, ` {pointer-events: all;}
`);
}, Lt = 0, D = [];
function Tt(e) {
  var t = i.useRef([]), n = i.useRef([0, 0]), r = i.useRef(), a = i.useState(Lt++)[0], u = i.useState(Se)[0], s = i.useRef(e);
  i.useEffect(function() {
    s.current = e;
  }, [e]), i.useEffect(function() {
    if (e.inert) {
      document.body.classList.add("block-interactivity-".concat(a));
      var c = Ze([e.lockRef.current], (e.shards || []).map(he), !0).filter(Boolean);
      return c.forEach(function(d) {
        return d.classList.add("allow-interactivity-".concat(a));
      }), function() {
        document.body.classList.remove("block-interactivity-".concat(a)), c.forEach(function(d) {
          return d.classList.remove("allow-interactivity-".concat(a));
        });
      };
    }
  }, [e.inert, e.lockRef.current, e.shards]);
  var o = i.useCallback(function(c, d) {
    if ("touches" in c && c.touches.length === 2 || c.type === "wheel" && c.ctrlKey)
      return !s.current.allowPinchZoom;
    var m = B(c), E = n.current, g = "deltaX" in c ? c.deltaX : E[0] - m[0], b = "deltaY" in c ? c.deltaY : E[1] - m[1], w, P = c.target, p = Math.abs(g) > Math.abs(b) ? "h" : "v";
    if ("touches" in c && p === "h" && P.type === "range")
      return !1;
    var L = window.getSelection(), T = L && L.anchorNode, F = T ? T === P || T.contains(P) : !1;
    if (F)
      return !1;
    var I = fe(p, P);
    if (!I)
      return !0;
    if (I ? w = p : (w = p === "v" ? "h" : "v", I = fe(p, P)), !I)
      return !1;
    if (!r.current && "changedTouches" in c && (g || b) && (r.current = w), !w)
      return !0;
    var ne = r.current || w;
    return Pt(ne, d, c, ne === "h" ? g : b);
  }, []), S = i.useCallback(function(c) {
    var d = c;
    if (!(!D.length || D[D.length - 1] !== u)) {
      var m = "deltaY" in d ? ve(d) : B(d), E = t.current.filter(function(w) {
        return w.name === d.type && (w.target === d.target || d.target === w.shadowParent) && Ot(w.delta, m);
      })[0];
      if (E && E.should) {
        d.cancelable && d.preventDefault();
        return;
      }
      if (!E) {
        var g = (s.current.shards || []).map(he).filter(Boolean).filter(function(w) {
          return w.contains(d.target);
        }), b = g.length > 0 ? o(d, g[0]) : !s.current.noIsolation;
        b && d.cancelable && d.preventDefault();
      }
    }
  }, []), l = i.useCallback(function(c, d, m, E) {
    var g = { name: c, delta: d, target: m, should: E, shadowParent: At(m) };
    t.current.push(g), setTimeout(function() {
      t.current = t.current.filter(function(b) {
        return b !== g;
      });
    }, 1);
  }, []), f = i.useCallback(function(c) {
    n.current = B(c), r.current = void 0;
  }, []), h = i.useCallback(function(c) {
    l(c.type, ve(c), c.target, o(c, e.lockRef.current));
  }, []), v = i.useCallback(function(c) {
    l(c.type, B(c), c.target, o(c, e.lockRef.current));
  }, []);
  i.useEffect(function() {
    return D.push(u), e.setCallbacks({
      onScrollCapture: h,
      onWheelCapture: h,
      onTouchMoveCapture: v
    }), document.addEventListener("wheel", S, A), document.addEventListener("touchmove", S, A), document.addEventListener("touchstart", f, A), function() {
      D = D.filter(function(c) {
        return c !== u;
      }), document.removeEventListener("wheel", S, A), document.removeEventListener("touchmove", S, A), document.removeEventListener("touchstart", f, A);
    };
  }, []);
  var y = e.removeScrollBar, C = e.inert;
  return i.createElement(
    i.Fragment,
    null,
    C ? i.createElement(u, { styles: Rt(a) }) : null,
    y ? i.createElement(yt, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
  );
}
function At(e) {
  for (var t = null; e !== null; )
    e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
  return t;
}
const Dt = at(be, Tt);
var kt = i.forwardRef(function(e, t) {
  return i.createElement(V, O({}, e, { ref: t, sideCar: Dt }));
});
kt.classNames = V.classNames;
var Nt = function(e) {
  if (typeof document > "u")
    return null;
  var t = Array.isArray(e) ? e[0] : e;
  return t.ownerDocument.body;
}, k = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), _ = {}, $ = 0, Oe = function(e) {
  return e && (e.host || Oe(e.parentNode));
}, Ft = function(e, t) {
  return t.map(function(n) {
    if (e.contains(n))
      return n;
    var r = Oe(n);
    return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
  }).filter(function(n) {
    return !!n;
  });
}, Mt = function(e, t, n, r) {
  var a = Ft(t, Array.isArray(e) ? e : [e]);
  _[n] || (_[n] = /* @__PURE__ */ new WeakMap());
  var u = _[n], s = [], o = /* @__PURE__ */ new Set(), S = new Set(a), l = function(h) {
    !h || o.has(h) || (o.add(h), l(h.parentNode));
  };
  a.forEach(l);
  var f = function(h) {
    !h || S.has(h) || Array.prototype.forEach.call(h.children, function(v) {
      if (o.has(v))
        f(v);
      else
        try {
          var y = v.getAttribute(r), C = y !== null && y !== "false", c = (k.get(v) || 0) + 1, d = (u.get(v) || 0) + 1;
          k.set(v, c), u.set(v, d), s.push(v), c === 1 && C && W.set(v, !0), d === 1 && v.setAttribute(n, "true"), C || v.setAttribute(r, "true");
        } catch (m) {
          console.error("aria-hidden: cannot operate on ", v, m);
        }
    });
  };
  return f(t), o.clear(), $++, function() {
    s.forEach(function(h) {
      var v = k.get(h) - 1, y = u.get(h) - 1;
      k.set(h, v), u.set(h, y), v || (W.has(h) || h.removeAttribute(r), W.delete(h)), y || h.removeAttribute(n);
    }), $--, $ || (k = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), _ = {});
  };
}, Ht = function(e, t, n) {
  n === void 0 && (n = "data-aria-hidden");
  var r = Array.from(Array.isArray(e) ? e : [e]), a = Nt(e);
  return a ? (r.push.apply(r, Array.from(a.querySelectorAll("[aria-live], script"))), Mt(r, a, n, "aria-hidden")) : function() {
    return null;
  };
};
export {
  Me as D,
  Ue as F,
  Ge as P,
  kt as R,
  Ht as h,
  Kt as u
};
//# sourceMappingURL=index-CLMd7NJE.mjs.map
