import * as c from "react";
import { useState as Oe } from "react";
import { c as H } from "./index-DlIFg0Eu.mjs";
import { P as $, d as Pe } from "./index-MSR-vgWR.mjs";
import { u as J } from "./index-DhGWNzsz.mjs";
import { a as N } from "./index-BRi38DTc.mjs";
import { jsx as ee } from "react/jsx-runtime";
function Re(e, t = globalThis?.document) {
  const n = N(e);
  c.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 Le = "DismissableLayer", q = "dismissableLayer.update", Te = "dismissableLayer.pointerDownOutside", Ae = "dismissableLayer.focusOutside", te, ve = c.createContext({
  layers: /* @__PURE__ */ new Set(),
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
  branches: /* @__PURE__ */ new Set()
}), ke = c.forwardRef(
  (e, t) => {
    const {
      disableOutsidePointerEvents: n = !1,
      onEscapeKeyDown: r,
      onPointerDownOutside: a,
      onFocusOutside: u,
      onInteractOutside: s,
      onDismiss: o,
      ...S
    } = e, l = c.useContext(ve), [f, h] = c.useState(null), v = f?.ownerDocument ?? globalThis?.document, [, y] = c.useState({}), C = J(t, (p) => h(p)), i = Array.from(l.layers), [d] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), m = i.indexOf(d), E = f ? i.indexOf(f) : -1, g = l.layersWithOutsidePointerEventsDisabled.size > 0, b = E >= m, w = Ne((p) => {
      const R = p.target, F = [...l.branches].some((K) => K.contains(R));
      !b || F || (a?.(p), s?.(p), p.defaultPrevented || o?.());
    }, v), P = Me((p) => {
      const R = p.target;
      [...l.branches].some((K) => K.contains(R)) || (u?.(p), s?.(p), p.defaultPrevented || o?.());
    }, v);
    return Re((p) => {
      E === l.layers.size - 1 && (r?.(p), !p.defaultPrevented && o && (p.preventDefault(), o()));
    }, v), c.useEffect(() => {
      if (f)
        return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (te = v.body.style.pointerEvents, v.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(f)), l.layers.add(f), ne(), () => {
          n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents = te);
        };
    }, [f, v, n, l]), c.useEffect(() => () => {
      f && (l.layers.delete(f), l.layersWithOutsidePointerEventsDisabled.delete(f), ne());
    }, [f, l]), c.useEffect(() => {
      const p = () => y({});
      return document.addEventListener(q, p), () => document.removeEventListener(q, p);
    }, []), /* @__PURE__ */ ee(
      $.div,
      {
        ...S,
        ref: C,
        style: {
          pointerEvents: g ? b ? "auto" : "none" : void 0,
          ...e.style
        },
        onFocusCapture: H(e.onFocusCapture, P.onFocusCapture),
        onBlurCapture: H(e.onBlurCapture, P.onBlurCapture),
        onPointerDownCapture: H(
          e.onPointerDownCapture,
          w.onPointerDownCapture
        )
      }
    );
  }
);
ke.displayName = Le;
var De = "DismissableLayerBranch", Fe = c.forwardRef((e, t) => {
  const n = c.useContext(ve), r = c.useRef(null), a = J(t, r);
  return c.useEffect(() => {
    const u = r.current;
    if (u)
      return n.branches.add(u), () => {
        n.branches.delete(u);
      };
  }, [n.branches]), /* @__PURE__ */ ee($.div, { ...e, ref: a });
});
Fe.displayName = De;
function Ne(e, t = globalThis?.document) {
  const n = N(e), r = c.useRef(!1), a = c.useRef(() => {
  });
  return c.useEffect(() => {
    const u = (o) => {
      if (o.target && !r.current) {
        let S = function() {
          he(
            Te,
            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 Me(e, t = globalThis?.document) {
  const n = N(e), r = c.useRef(!1);
  return c.useEffect(() => {
    const a = (u) => {
      u.target && !r.current && he(Ae, 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 ne() {
  const e = new CustomEvent(q);
  document.dispatchEvent(e);
}
function he(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 ? Pe(a, u) : a.dispatchEvent(u);
}
var j = "focusScope.autoFocusOnMount", V = "focusScope.autoFocusOnUnmount", re = { bubbles: !1, cancelable: !0 }, Ie = "FocusScope", xe = c.forwardRef((e, t) => {
  const {
    loop: n = !1,
    trapped: r = !1,
    onMountAutoFocus: a,
    onUnmountAutoFocus: u,
    ...s
  } = e, [o, S] = c.useState(null), l = N(a), f = N(u), h = c.useRef(null), v = J(t, (i) => S(i)), y = c.useRef({
    paused: !1,
    pause() {
      this.paused = !0;
    },
    resume() {
      this.paused = !1;
    }
  }).current;
  c.useEffect(() => {
    if (r) {
      let i = function(g) {
        if (y.paused || !o) return;
        const b = g.target;
        o.contains(b) ? h.current = b : L(h.current, { select: !0 });
      }, d = function(g) {
        if (y.paused || !o) return;
        const b = g.relatedTarget;
        b !== null && (o.contains(b) || L(h.current, { select: !0 }));
      }, m = function(g) {
        if (document.activeElement === document.body)
          for (const w of g)
            w.removedNodes.length > 0 && L(o);
      };
      document.addEventListener("focusin", i), document.addEventListener("focusout", d);
      const E = new MutationObserver(m);
      return o && E.observe(o, { childList: !0, subtree: !0 }), () => {
        document.removeEventListener("focusin", i), document.removeEventListener("focusout", d), E.disconnect();
      };
    }
  }, [r, o, y.paused]), c.useEffect(() => {
    if (o) {
      oe.add(y);
      const i = document.activeElement;
      if (!o.contains(i)) {
        const m = new CustomEvent(j, re);
        o.addEventListener(j, l), o.dispatchEvent(m), m.defaultPrevented || (Be(He(me(o)), { select: !0 }), document.activeElement === i && L(o));
      }
      return () => {
        o.removeEventListener(j, l), setTimeout(() => {
          const m = new CustomEvent(V, re);
          o.addEventListener(V, f), o.dispatchEvent(m), m.defaultPrevented || L(i ?? document.body, { select: !0 }), o.removeEventListener(V, f), oe.remove(y);
        }, 0);
      };
    }
  }, [o, l, f, y]);
  const C = c.useCallback(
    (i) => {
      if (!n && !r || y.paused) return;
      const d = i.key === "Tab" && !i.altKey && !i.ctrlKey && !i.metaKey, m = document.activeElement;
      if (d && m) {
        const E = i.currentTarget, [g, b] = We(E);
        g && b ? !i.shiftKey && m === b ? (i.preventDefault(), n && L(g, { select: !0 })) : i.shiftKey && m === g && (i.preventDefault(), n && L(b, { select: !0 })) : m === E && i.preventDefault();
      }
    },
    [n, r, y.paused]
  );
  return /* @__PURE__ */ ee($.div, { tabIndex: -1, ...s, ref: v, onKeyDown: C });
});
xe.displayName = Ie;
function Be(e, { select: t = !1 } = {}) {
  const n = document.activeElement;
  for (const r of e)
    if (L(r, { select: t }), document.activeElement !== n) return;
}
function We(e) {
  const t = me(e), n = ae(t, e), r = ae(t.reverse(), e);
  return [n, r];
}
function me(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 ae(e, t) {
  for (const n of e)
    if (!_e(n, { upTo: t })) return n;
}
function _e(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 Ue(e) {
  return e instanceof HTMLInputElement && "select" in e;
}
function L(e, { select: t = !1 } = {}) {
  if (e && e.focus) {
    const n = document.activeElement;
    e.focus({ preventScroll: !0 }), e !== n && Ue(e) && t && e.select();
  }
}
var oe = Ke();
function Ke() {
  let e = [];
  return {
    add(t) {
      const n = e[0];
      t !== n && n?.pause(), e = ie(e, t), e.unshift(t);
    },
    remove(t) {
      e = ie(e, t), e[0]?.resume();
    }
  };
}
function ie(e, t) {
  const n = [...e], r = n.indexOf(t);
  return r !== -1 && n.splice(r, 1), n;
}
function He(e) {
  return e.filter((t) => t.tagName !== "A");
}
var X = 0;
function It() {
  c.useEffect(() => {
    const e = document.querySelectorAll("[data-radix-focus-guard]");
    return document.body.insertAdjacentElement("afterbegin", e[0] ?? ce()), document.body.insertAdjacentElement("beforeend", e[1] ?? ce()), X++, () => {
      X === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), X--;
    };
  }, []);
}
function ce() {
  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 pe(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 je(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 W = "right-scroll-bar-position", _ = "width-before-scroll-bar", Ve = "with-scroll-bars-hidden", Xe = "--removed-body-scroll-bar-size";
function Y(e, t) {
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
}
function Ye(e, t) {
  var n = Oe(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 ze = typeof window < "u" ? c.useLayoutEffect : c.useEffect, ue = /* @__PURE__ */ new WeakMap();
function Ge(e, t) {
  var n = Ye(null, function(r) {
    return e.forEach(function(a) {
      return Y(a, r);
    });
  });
  return ze(function() {
    var r = ue.get(n);
    if (r) {
      var a = new Set(r), u = new Set(e), s = n.current;
      a.forEach(function(o) {
        u.has(o) || Y(o, null);
      }), u.forEach(function(o) {
        a.has(o) || Y(o, s);
      });
    }
    ue.set(n, e);
  }, [e]), n;
}
function Ze(e) {
  return e;
}
function qe(e, t) {
  t === void 0 && (t = Ze);
  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 Qe(e) {
  e === void 0 && (e = {});
  var t = qe(null);
  return t.options = O({ async: !0, ssr: !1 }, e), t;
}
var ye = function(e) {
  var t = e.sideCar, n = pe(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 c.createElement(r, O({}, n));
};
ye.isSideCarExport = !0;
function $e(e, t) {
  return e.useMedium(t), ye;
}
var Ee = Qe(), z = function() {
}, U = c.forwardRef(function(e, t) {
  var n = c.useRef(null), r = c.useState({
    onScrollCapture: z,
    onWheelCapture: z,
    onTouchMoveCapture: z
  }), 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, i = e.inert, d = e.allowPinchZoom, m = e.as, E = m === void 0 ? "div" : m, g = e.gapMode, b = pe(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), w = v, P = Ge([n, t]), p = O(O({}, b), a);
  return c.createElement(
    c.Fragment,
    null,
    f && c.createElement(w, { sideCar: Ee, removeScrollBar: l, shards: h, noRelative: y, noIsolation: C, inert: i, setCallbacks: u, allowPinchZoom: !!d, lockRef: n, gapMode: g }),
    s ? c.cloneElement(c.Children.only(o), O(O({}, p), { ref: P })) : c.createElement(E, O({}, p, { className: S, ref: P }), o)
  );
});
U.defaultProps = {
  enabled: !0,
  removeScrollBar: !0,
  inert: !1
};
U.classNames = {
  fullWidth: _,
  zeroRight: W
};
var Je = function() {
  if (typeof __webpack_nonce__ < "u")
    return __webpack_nonce__;
};
function et() {
  if (!document)
    return null;
  var e = document.createElement("style");
  e.type = "text/css";
  var t = Je();
  return t && e.setAttribute("nonce", t), e;
}
function tt(e, t) {
  e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
}
function nt(e) {
  var t = document.head || document.getElementsByTagName("head")[0];
  t.appendChild(e);
}
var rt = function() {
  var e = 0, t = null;
  return {
    add: function(n) {
      e == 0 && (t = et()) && (tt(t, n), nt(t)), e++;
    },
    remove: function() {
      e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
    }
  };
}, at = function() {
  var e = rt();
  return function(t, n) {
    c.useEffect(function() {
      return e.add(t), function() {
        e.remove();
      };
    }, [t && n]);
  };
}, ge = function() {
  var e = at(), t = function(n) {
    var r = n.styles, a = n.dynamic;
    return e(r, a), null;
  };
  return t;
}, ot = {
  left: 0,
  top: 0,
  right: 0,
  gap: 0
}, G = function(e) {
  return parseInt(e || "", 10) || 0;
}, it = 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 [G(n), G(r), G(a)];
}, ct = function(e) {
  if (e === void 0 && (e = "margin"), typeof window > "u")
    return ot;
  var t = it(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])
  };
}, ut = ge(), D = "data-scroll-locked", st = 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(Ve, ` {
   overflow: hidden `).concat(r, `;
   padding-right: `).concat(o, "px ").concat(r, `;
  }
  body[`).concat(D, `] {
    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(W, ` {
    right: `).concat(o, "px ").concat(r, `;
  }
  
  .`).concat(_, ` {
    margin-right: `).concat(o, "px ").concat(r, `;
  }
  
  .`).concat(W, " .").concat(W, ` {
    right: 0 `).concat(r, `;
  }
  
  .`).concat(_, " .").concat(_, ` {
    margin-right: 0 `).concat(r, `;
  }
  
  body[`).concat(D, `] {
    `).concat(Xe, ": ").concat(o, `px;
  }
`);
}, se = function() {
  var e = parseInt(document.body.getAttribute(D) || "0", 10);
  return isFinite(e) ? e : 0;
}, lt = function() {
  c.useEffect(function() {
    return document.body.setAttribute(D, (se() + 1).toString()), function() {
      var e = se() - 1;
      e <= 0 ? document.body.removeAttribute(D) : document.body.setAttribute(D, e.toString());
    };
  }, []);
}, dt = function(e) {
  var t = e.noRelative, n = e.noImportant, r = e.gapMode, a = r === void 0 ? "margin" : r;
  lt();
  var u = c.useMemo(function() {
    return ct(a);
  }, [a]);
  return c.createElement(ut, { styles: st(u, !t, a, n ? "" : "!important") });
}, Q = !1;
if (typeof window < "u")
  try {
    var M = Object.defineProperty({}, "passive", {
      get: function() {
        return Q = !0, !0;
      }
    });
    window.addEventListener("test", M, M), window.removeEventListener("test", M, M);
  } catch {
    Q = !1;
  }
var T = Q ? { passive: !1 } : !1, ft = function(e) {
  return e.tagName === "TEXTAREA";
}, be = 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 && !ft(e) && n[t] === "visible")
  );
}, vt = function(e) {
  return be(e, "overflowY");
}, ht = function(e) {
  return be(e, "overflowX");
}, le = function(e, t) {
  var n = t.ownerDocument, r = t;
  do {
    typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
    var a = Se(e, r);
    if (a) {
      var u = we(e, r), s = u[1], o = u[2];
      if (s > o)
        return !0;
    }
    r = r.parentNode;
  } while (r && r !== n.body);
  return !1;
}, mt = function(e) {
  var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
  return [
    t,
    n,
    r
  ];
}, pt = function(e) {
  var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
  return [
    t,
    n,
    r
  ];
}, Se = function(e, t) {
  return e === "v" ? vt(t) : ht(t);
}, we = function(e, t) {
  return e === "v" ? mt(t) : pt(t);
}, yt = function(e, t) {
  return e === "h" && t === "rtl" ? -1 : 1;
}, Et = function(e, t, n, r, a) {
  var u = yt(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 = we(e, o), C = y[0], i = y[1], d = y[2], m = i - d - u * C;
    (C || m) && Se(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;
}, I = function(e) {
  return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
}, de = function(e) {
  return [e.deltaX, e.deltaY];
}, fe = function(e) {
  return e && "current" in e ? e.current : e;
}, gt = function(e, t) {
  return e[0] === t[0] && e[1] === t[1];
}, bt = function(e) {
  return `
  .block-interactivity-`.concat(e, ` {pointer-events: none;}
  .allow-interactivity-`).concat(e, ` {pointer-events: all;}
`);
}, St = 0, A = [];
function wt(e) {
  var t = c.useRef([]), n = c.useRef([0, 0]), r = c.useRef(), a = c.useState(St++)[0], u = c.useState(ge)[0], s = c.useRef(e);
  c.useEffect(function() {
    s.current = e;
  }, [e]), c.useEffect(function() {
    if (e.inert) {
      document.body.classList.add("block-interactivity-".concat(a));
      var i = je([e.lockRef.current], (e.shards || []).map(fe), !0).filter(Boolean);
      return i.forEach(function(d) {
        return d.classList.add("allow-interactivity-".concat(a));
      }), function() {
        document.body.classList.remove("block-interactivity-".concat(a)), i.forEach(function(d) {
          return d.classList.remove("allow-interactivity-".concat(a));
        });
      };
    }
  }, [e.inert, e.lockRef.current, e.shards]);
  var o = c.useCallback(function(i, d) {
    if ("touches" in i && i.touches.length === 2 || i.type === "wheel" && i.ctrlKey)
      return !s.current.allowPinchZoom;
    var m = I(i), E = n.current, g = "deltaX" in i ? i.deltaX : E[0] - m[0], b = "deltaY" in i ? i.deltaY : E[1] - m[1], w, P = i.target, p = Math.abs(g) > Math.abs(b) ? "h" : "v";
    if ("touches" in i && p === "h" && P.type === "range")
      return !1;
    var R = le(p, P);
    if (!R)
      return !0;
    if (R ? w = p : (w = p === "v" ? "h" : "v", R = le(p, P)), !R)
      return !1;
    if (!r.current && "changedTouches" in i && (g || b) && (r.current = w), !w)
      return !0;
    var F = r.current || w;
    return Et(F, d, i, F === "h" ? g : b);
  }, []), S = c.useCallback(function(i) {
    var d = i;
    if (!(!A.length || A[A.length - 1] !== u)) {
      var m = "deltaY" in d ? de(d) : I(d), E = t.current.filter(function(w) {
        return w.name === d.type && (w.target === d.target || d.target === w.shadowParent) && gt(w.delta, m);
      })[0];
      if (E && E.should) {
        d.cancelable && d.preventDefault();
        return;
      }
      if (!E) {
        var g = (s.current.shards || []).map(fe).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 = c.useCallback(function(i, d, m, E) {
    var g = { name: i, delta: d, target: m, should: E, shadowParent: Ct(m) };
    t.current.push(g), setTimeout(function() {
      t.current = t.current.filter(function(b) {
        return b !== g;
      });
    }, 1);
  }, []), f = c.useCallback(function(i) {
    n.current = I(i), r.current = void 0;
  }, []), h = c.useCallback(function(i) {
    l(i.type, de(i), i.target, o(i, e.lockRef.current));
  }, []), v = c.useCallback(function(i) {
    l(i.type, I(i), i.target, o(i, e.lockRef.current));
  }, []);
  c.useEffect(function() {
    return A.push(u), e.setCallbacks({
      onScrollCapture: h,
      onWheelCapture: h,
      onTouchMoveCapture: v
    }), document.addEventListener("wheel", S, T), document.addEventListener("touchmove", S, T), document.addEventListener("touchstart", f, T), function() {
      A = A.filter(function(i) {
        return i !== u;
      }), document.removeEventListener("wheel", S, T), document.removeEventListener("touchmove", S, T), document.removeEventListener("touchstart", f, T);
    };
  }, []);
  var y = e.removeScrollBar, C = e.inert;
  return c.createElement(
    c.Fragment,
    null,
    C ? c.createElement(u, { styles: bt(a) }) : null,
    y ? c.createElement(dt, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
  );
}
function Ct(e) {
  for (var t = null; e !== null; )
    e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
  return t;
}
const Ot = $e(Ee, wt);
var Pt = c.forwardRef(function(e, t) {
  return c.createElement(U, O({}, e, { ref: t, sideCar: Ot }));
});
Pt.classNames = U.classNames;
var Rt = function(e) {
  if (typeof document > "u")
    return null;
  var t = Array.isArray(e) ? e[0] : e;
  return t.ownerDocument.body;
}, k = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), B = {}, Z = 0, Ce = function(e) {
  return e && (e.host || Ce(e.parentNode));
}, Lt = function(e, t) {
  return t.map(function(n) {
    if (e.contains(n))
      return n;
    var r = Ce(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;
  });
}, Tt = function(e, t, n, r) {
  var a = Lt(t, Array.isArray(e) ? e : [e]);
  B[n] || (B[n] = /* @__PURE__ */ new WeakMap());
  var u = B[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", i = (k.get(v) || 0) + 1, d = (u.get(v) || 0) + 1;
          k.set(v, i), u.set(v, d), s.push(v), i === 1 && C && x.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(), Z++, 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 || (x.has(h) || h.removeAttribute(r), x.delete(h)), y || h.removeAttribute(n);
    }), Z--, Z || (k = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), B = {});
  };
}, xt = function(e, t, n) {
  n === void 0 && (n = "data-aria-hidden");
  var r = Array.from(Array.isArray(e) ? e : [e]), a = Rt(e);
  return a ? (r.push.apply(r, Array.from(a.querySelectorAll("[aria-live], script"))), Tt(r, a, n, "aria-hidden")) : function() {
    return null;
  };
};
export {
  ke as D,
  xe as F,
  Pt as R,
  O as _,
  xt as h,
  It as u
};
//# sourceMappingURL=index-D_lWkK39.mjs.map
