import { $ as Rr } from "./Button-C9AKe3Kt.es.js";
import { $ as ee, a as te, e as U, c as Kr, g as he, b as Ir } from "./utils-CrjF8U_E.es.js";
import { b as Ie, c as Lr, $ as Nr } from "./RSPContexts-DLgb84PF.es.js";
import { e as _r, c as Vr, b as Hr, a as Ce, $ as je, d as Ur } from "./OverlayArrow-DQTbb80n.es.js";
import { c as ge, p as zr, g as jr, $ as We, a as Wr, b as Ge, h as Me, i as Gr, k as Zr } from "./SelectionManager-GNsyMc-q.es.js";
import { $ as qr, a as Jr, b as Xr } from "./Header-BQ99pNEi.es.js";
import { $ as Yr } from "./Keyboard-Clnp4zAC.es.js";
import { a as Qr, $ as en } from "./SelectionIndicator-B27AsfqE.es.js";
import { a as tn } from "./Separator-DFaT-SpI.es.js";
import { $ as rn } from "./Text-DOcU1ycg.es.js";
import { c as Ze, d as nn, $ as on, e as an, f as ln, g as sn, a as un } from "./CollectionBuilder-CTjJUDzO.es.js";
import { $ as I, a as G, b as re, d as qe, c as ue } from "./mergeProps-B-cqsBhL.es.js";
import { $ as _ } from "./filterDOMProps-Cxz9cAAv.es.js";
import { $ as ke } from "./useObjectRef-CaJ5pgjX.es.js";
import { c as Pe, $ as cn } from "./usePress-UxAvyvOO.es.js";
import { $ as dn } from "./useSyncRef-BGo3C9WN.es.js";
import g, { useMemo as H, useRef as M, useContext as S, useEffect as L, useState as K, useCallback as R, forwardRef as Se, createContext as O } from "react";
import { $ as Je } from "./useHover-BiPYlZr_.es.js";
import { $ as Ee } from "./useEffectEvent-B4Fd4l1o.es.js";
import { $ as Le, f as fn } from "./useFocusVisible-_CKiSck5.es.js";
import { $ as V } from "./focusWithoutScrolling-CDw3JYiq.es.js";
import { $ as pn } from "./useEvent-CKoH5wGJ.es.js";
import { $ as Xe } from "./context-BfHy4NgG.es.js";
import { $ as Ye } from "./useLocalizedStringFormatter-CYDf7GZk.es.js";
import { i as bn, e as $n, f as mn, g as gn } from "./openLink-m90p5mer.es.js";
import { $ as vn } from "./useFocus-DWn32Fi6.es.js";
import { c as xn } from "./useFocusable-C4Re42UX.es.js";
import { $ as yn } from "./useControlledState-3TGZUXux.es.js";
import { c as hn, b as Qe } from "./FocusScope-DI1zU4s2.es.js";
import { $ as De } from "./focusSafely-hLKtxoJI.es.js";
import Pn from "react-dom";
import { $ as En } from "./SSRProvider-CQ9PmFV6.es.js";
import { $ as Dn, a as Cn } from "./animation-BfmkkMe7.es.js";
import { b as Mn } from "./Hidden-X9vuhkMZ.es.js";
import { $ as kn, j as Sn } from "./utils-V7nfNEif.es.js";
import { $ as wn } from "./useFocusWithin-CdBYoNiQ.es.js";
import { $ as et } from "./getScrollParent-vifdmp1X.es.js";
import { $ as An } from "./scrollIntoView-Btu7DgIo.es.js";
import { $ as Tn } from "./useLabels-BOBP8-HM.es.js";
import { $ as Bn } from "./VisuallyHidden-BW_C1pFq.es.js";
const tt = /* @__PURE__ */ g.forwardRef(({ children: r, ...e }, t) => {
  let o = M(!1), n = S(Pe);
  t = ke(t || n?.ref);
  let i = I(n || {}, {
    ...e,
    ref: t,
    register() {
      o.current = !0, n && n.register();
    }
  });
  return dn(n, t), L(() => {
    o.current || (process.env.NODE_ENV !== "production" && console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component."), o.current = !0);
  }, []), /* @__PURE__ */ g.createElement(Pe.Provider, {
    value: i
  }, r);
});
function On({ children: r }) {
  let e = H(() => ({
    register: () => {
    }
  }), []);
  return /* @__PURE__ */ g.createElement(Pe.Provider, {
    value: e
  }, r);
}
function Fn(r) {
  let { ref: e, onInteractOutside: t, isDisabled: o, onInteractOutsideStart: n } = r, i = M({
    isPointerDown: !1,
    ignoreEmulatedMouseEvents: !1
  }), l = Ee((a) => {
    t && ie(a, e) && (n && n(a), i.current.isPointerDown = !0);
  }), s = Ee((a) => {
    t && t(a);
  });
  L(() => {
    let a = i.current;
    if (o) return;
    const d = e.current, c = kn(d);
    if (typeof PointerEvent < "u") {
      let b = (m) => {
        a.isPointerDown && ie(m, e) && s(m), a.isPointerDown = !1;
      };
      return c.addEventListener("pointerdown", l, !0), c.addEventListener("click", b, !0), () => {
        c.removeEventListener("pointerdown", l, !0), c.removeEventListener("click", b, !0);
      };
    } else if (process.env.NODE_ENV === "test") {
      let b = (u) => {
        a.ignoreEmulatedMouseEvents ? a.ignoreEmulatedMouseEvents = !1 : a.isPointerDown && ie(u, e) && s(u), a.isPointerDown = !1;
      }, m = (u) => {
        a.ignoreEmulatedMouseEvents = !0, a.isPointerDown && ie(u, e) && s(u), a.isPointerDown = !1;
      };
      return c.addEventListener("mousedown", l, !0), c.addEventListener("mouseup", b, !0), c.addEventListener("touchstart", l, !0), c.addEventListener("touchend", m, !0), () => {
        c.removeEventListener("mousedown", l, !0), c.removeEventListener("mouseup", b, !0), c.removeEventListener("touchstart", l, !0), c.removeEventListener("touchend", m, !0);
      };
    }
  }, [
    e,
    o
  ]);
}
function ie(r, e) {
  if (r.button > 0) return !1;
  if (r.target) {
    const t = r.target.ownerDocument;
    if (!t || !t.documentElement.contains(r.target) || r.target.closest("[data-react-aria-top-layer]")) return !1;
  }
  return e.current ? !r.composedPath().includes(e.current) : !1;
}
const B = [];
function Rn(r, e) {
  let { onClose: t, shouldCloseOnBlur: o, isOpen: n, isDismissable: i = !1, isKeyboardDismissDisabled: l = !1, shouldCloseOnInteractOutside: s } = r;
  L(() => {
    if (n && !B.includes(e))
      return B.push(e), () => {
        let f = B.indexOf(e);
        f >= 0 && B.splice(f, 1);
      };
  }, [
    n,
    e
  ]);
  let a = () => {
    B[B.length - 1] === e && t && t();
  }, d = (f) => {
    (!s || s(f.target)) && B[B.length - 1] === e && (f.stopPropagation(), f.preventDefault());
  }, c = (f) => {
    (!s || s(f.target)) && (B[B.length - 1] === e && (f.stopPropagation(), f.preventDefault()), a());
  }, b = (f) => {
    f.key === "Escape" && !l && !f.nativeEvent.isComposing && (f.stopPropagation(), f.preventDefault(), a());
  };
  Fn({
    ref: e,
    onInteractOutside: i && n ? c : void 0,
    onInteractOutsideStart: d
  });
  let { focusWithinProps: m } = wn({
    isDisabled: !o,
    onBlurWithin: (f) => {
      !f.relatedTarget || hn(f.relatedTarget) || (!s || s(f.relatedTarget)) && t?.();
    }
  }), u = (f) => {
    f.target === f.currentTarget && f.preventDefault();
  };
  return {
    overlayProps: {
      onKeyDown: b,
      ...m
    },
    underlayProps: {
      onPointerDown: u
    }
  };
}
function rt(r, e, t) {
  let { type: o } = r, { isOpen: n } = e;
  L(() => {
    t && t.current && _r.set(t.current, e.close);
  });
  let i;
  o === "menu" ? i = !0 : o === "listbox" && (i = "listbox");
  let l = G();
  return {
    triggerProps: {
      "aria-haspopup": i,
      "aria-expanded": n,
      "aria-controls": n ? l : void 0,
      onPress: e.toggle
    },
    overlayProps: {
      id: l
    }
  };
}
const Y = typeof document < "u" && window.visualViewport;
let le = 0, ve;
function Kn(r = {}) {
  let { isDisabled: e } = r;
  re(() => {
    if (!e)
      return le++, le === 1 && (bn() ? ve = Ln() : ve = In()), () => {
        le--, le === 0 && ve();
      };
  }, [
    e
  ]);
}
function In() {
  let r = window.innerWidth - document.documentElement.clientWidth;
  return qe(r > 0 && // Use scrollbar-gutter when supported because it also works for fixed positioned elements.
  ("scrollbarGutter" in document.documentElement.style ? xe(document.documentElement, "scrollbarGutter", "stable") : xe(document.documentElement, "paddingRight", `${r}px`)), xe(document.documentElement, "overflow", "hidden"));
}
function Ln() {
  let r, e = !1, t = (a) => {
    let d = a.target;
    r = An(d) ? d : et(d, !0), e = !1;
    let c = d.ownerDocument.defaultView.getSelection();
    c && !c.isCollapsed && c.containsNode(d, !0) && (e = !0), "selectionStart" in d && "selectionEnd" in d && d.selectionStart < d.selectionEnd && d.ownerDocument.activeElement === d && (e = !0);
  }, o = document.createElement("style");
  o.textContent = `
@layer {
  * {
    overscroll-behavior: contain;
  }
}`.trim(), document.head.prepend(o);
  let n = (a) => {
    if (!(a.touches.length === 2 || e)) {
      if (!r || r === document.documentElement || r === document.body) {
        a.preventDefault();
        return;
      }
      r.scrollHeight === r.clientHeight && r.scrollWidth === r.clientWidth && a.preventDefault();
    }
  }, i = (a) => {
    let d = a.target, c = a.relatedTarget;
    if (c && ge(c))
      c.focus({
        preventScroll: !0
      }), Ne(c, ge(d));
    else if (!c) {
      var b;
      let m = (b = d.parentElement) === null || b === void 0 ? void 0 : b.closest("[tabindex]");
      m?.focus({
        preventScroll: !0
      });
    }
  }, l = HTMLElement.prototype.focus;
  HTMLElement.prototype.focus = function(a) {
    let d = document.activeElement != null && ge(document.activeElement);
    l.call(this, {
      ...a,
      preventScroll: !0
    }), (!a || !a.preventScroll) && Ne(this, d);
  };
  let s = qe(ye(document, "touchstart", t, {
    passive: !1,
    capture: !0
  }), ye(document, "touchmove", n, {
    passive: !1,
    capture: !0
  }), ye(document, "blur", i, !0));
  return () => {
    s(), o.remove(), HTMLElement.prototype.focus = l;
  };
}
function xe(r, e, t) {
  let o = r.style[e];
  return r.style[e] = t, () => {
    r.style[e] = o;
  };
}
function ye(r, e, t, o) {
  return r.addEventListener(e, t, o), () => {
    r.removeEventListener(e, t, o);
  };
}
function Ne(r, e) {
  e || !Y ? _e(r) : Y.addEventListener("resize", () => _e(r), {
    once: !0
  });
}
function _e(r) {
  let e = document.scrollingElement || document.documentElement, t = r;
  for (; t && t !== e; ) {
    let o = et(t);
    if (o !== document.documentElement && o !== document.body && o !== t) {
      let n = o.getBoundingClientRect(), i = t.getBoundingClientRect();
      if (i.top < n.top || i.bottom > n.top + t.clientHeight) {
        let l = n.bottom;
        Y && (l = Math.min(l, Y.offsetTop + Y.height));
        let s = i.top - n.top - ((l - n.top) / 2 - i.height / 2);
        o.scrollTo({
          // Clamp to the valid range to prevent over-scrolling.
          top: Math.max(0, Math.min(o.scrollHeight - o.clientHeight, o.scrollTop + s)),
          behavior: "smooth"
        });
      }
    }
    t = o.parentElement;
  }
}
var nt = {};
nt = {
  dismiss: "تجاهل"
};
var ot = {};
ot = {
  dismiss: "Отхвърляне"
};
var at = {};
at = {
  dismiss: "Odstranit"
};
var it = {};
it = {
  dismiss: "Luk"
};
var lt = {};
lt = {
  dismiss: "Schließen"
};
var st = {};
st = {
  dismiss: "Απόρριψη"
};
var ut = {};
ut = {
  dismiss: "Dismiss"
};
var ct = {};
ct = {
  dismiss: "Descartar"
};
var dt = {};
dt = {
  dismiss: "Lõpeta"
};
var ft = {};
ft = {
  dismiss: "Hylkää"
};
var pt = {};
pt = {
  dismiss: "Rejeter"
};
var bt = {};
bt = {
  dismiss: "התעלם"
};
var $t = {};
$t = {
  dismiss: "Odbaci"
};
var mt = {};
mt = {
  dismiss: "Elutasítás"
};
var gt = {};
gt = {
  dismiss: "Ignora"
};
var vt = {};
vt = {
  dismiss: "閉じる"
};
var xt = {};
xt = {
  dismiss: "무시"
};
var yt = {};
yt = {
  dismiss: "Atmesti"
};
var ht = {};
ht = {
  dismiss: "Nerādīt"
};
var Pt = {};
Pt = {
  dismiss: "Lukk"
};
var Et = {};
Et = {
  dismiss: "Negeren"
};
var Dt = {};
Dt = {
  dismiss: "Zignoruj"
};
var Ct = {};
Ct = {
  dismiss: "Descartar"
};
var Mt = {};
Mt = {
  dismiss: "Dispensar"
};
var kt = {};
kt = {
  dismiss: "Revocare"
};
var St = {};
St = {
  dismiss: "Пропустить"
};
var wt = {};
wt = {
  dismiss: "Zrušiť"
};
var At = {};
At = {
  dismiss: "Opusti"
};
var Tt = {};
Tt = {
  dismiss: "Odbaci"
};
var Bt = {};
Bt = {
  dismiss: "Avvisa"
};
var Ot = {};
Ot = {
  dismiss: "Kapat"
};
var Ft = {};
Ft = {
  dismiss: "Скасувати"
};
var Rt = {};
Rt = {
  dismiss: "取消"
};
var Kt = {};
Kt = {
  dismiss: "關閉"
};
var It = {};
It = {
  "ar-AE": nt,
  "bg-BG": ot,
  "cs-CZ": at,
  "da-DK": it,
  "de-DE": lt,
  "el-GR": st,
  "en-US": ut,
  "es-ES": ct,
  "et-EE": dt,
  "fi-FI": ft,
  "fr-FR": pt,
  "he-IL": bt,
  "hr-HR": $t,
  "hu-HU": mt,
  "it-IT": gt,
  "ja-JP": vt,
  "ko-KR": xt,
  "lt-LT": yt,
  "lv-LV": ht,
  "nb-NO": Pt,
  "nl-NL": Et,
  "pl-PL": Dt,
  "pt-BR": Ct,
  "pt-PT": Mt,
  "ro-RO": kt,
  "ru-RU": St,
  "sk-SK": wt,
  "sl-SI": At,
  "sr-SP": Tt,
  "sv-SE": Bt,
  "tr-TR": Ot,
  "uk-UA": Ft,
  "zh-CN": Rt,
  "zh-TW": Kt
};
function Nn(r) {
  return r && r.__esModule ? r.default : r;
}
function Ve(r) {
  let { onDismiss: e, ...t } = r, o = Ye(Nn(It), "@react-aria/overlays"), n = Tn(t, o.format("dismiss")), i = () => {
    e && e();
  };
  return /* @__PURE__ */ g.createElement(Bn, null, /* @__PURE__ */ g.createElement("button", {
    ...n,
    tabIndex: -1,
    onClick: i,
    style: {
      width: 1,
      height: 1
    }
  }));
}
const _n = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
let X = /* @__PURE__ */ new WeakMap(), w = [];
function Vn(r, e) {
  let t = Sn(r?.[0]), o = e instanceof t.Element ? {
    root: e
  } : e;
  var n;
  let i = (n = o?.root) !== null && n !== void 0 ? n : document.body, l = o?.shouldUseInert && _n, s = new Set(r), a = /* @__PURE__ */ new Set(), d = (p) => l && p instanceof t.HTMLElement ? p.inert : p.getAttribute("aria-hidden") === "true", c = (p, x) => {
    l && p instanceof t.HTMLElement ? p.inert = x : x ? p.setAttribute("aria-hidden", "true") : (p.removeAttribute("aria-hidden"), p instanceof t.HTMLElement && (p.inert = !1));
  }, b = (p) => {
    for (let y of p.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) s.add(y);
    let x = (y) => {
      if (a.has(y) || s.has(y) || y.parentElement && a.has(y.parentElement) && y.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
      for (let T of s)
        if (y.contains(T)) return NodeFilter.FILTER_SKIP;
      return NodeFilter.FILTER_ACCEPT;
    }, v = document.createTreeWalker(p, NodeFilter.SHOW_ELEMENT, {
      acceptNode: x
    }), k = x(p);
    if (k === NodeFilter.FILTER_ACCEPT && m(p), k !== NodeFilter.FILTER_REJECT) {
      let y = v.nextNode();
      for (; y != null; )
        m(y), y = v.nextNode();
    }
  }, m = (p) => {
    var x;
    let v = (x = X.get(p)) !== null && x !== void 0 ? x : 0;
    d(p) && v === 0 || (v === 0 && c(p, !0), a.add(p), X.set(p, v + 1));
  };
  w.length && w[w.length - 1].disconnect(), b(i);
  let u = new MutationObserver((p) => {
    for (let x of p)
      if (x.type === "childList" && ![
        ...s,
        ...a
      ].some((v) => v.contains(x.target)))
        for (let v of x.addedNodes)
          (v instanceof HTMLElement || v instanceof SVGElement) && (v.dataset.liveAnnouncer === "true" || v.dataset.reactAriaTopLayer === "true") ? s.add(v) : v instanceof Element && b(v);
  });
  u.observe(i, {
    childList: !0,
    subtree: !0
  });
  let f = {
    visibleNodes: s,
    hiddenNodes: a,
    observe() {
      u.observe(i, {
        childList: !0,
        subtree: !0
      });
    },
    disconnect() {
      u.disconnect();
    }
  };
  return w.push(f), () => {
    u.disconnect();
    for (let p of a) {
      let x = X.get(p);
      x != null && (x === 1 ? (c(p, !1), X.delete(p)) : X.set(p, x - 1));
    }
    f === w[w.length - 1] ? (w.pop(), w.length && w[w.length - 1].observe()) : w.splice(w.indexOf(f), 1);
  };
}
function Hn(r) {
  let e = w[w.length - 1];
  if (e && !e.visibleNodes.has(r))
    return e.visibleNodes.add(r), () => {
      e.visibleNodes.delete(r);
    };
}
function Un(r, e) {
  let { triggerRef: t, popoverRef: o, groupRef: n, isNonModal: i, isKeyboardDismissDisabled: l, shouldCloseOnInteractOutside: s, ...a } = r, d = a.trigger === "SubmenuTrigger", { overlayProps: c, underlayProps: b } = Rn({
    isOpen: e.isOpen,
    onClose: e.close,
    shouldCloseOnBlur: !0,
    isDismissable: !i || d,
    isKeyboardDismissDisabled: l,
    shouldCloseOnInteractOutside: s
  }, n ?? o), { overlayProps: m, arrowProps: u, placement: f, triggerAnchorPoint: p } = Vr({
    ...a,
    targetRef: t,
    overlayRef: o,
    isOpen: e.isOpen,
    onClose: i && !d ? e.close : null
  });
  return Kn({
    isDisabled: i || !e.isOpen
  }), L(() => {
    if (e.isOpen && o.current) {
      var x, v;
      return i ? Hn((x = n?.current) !== null && x !== void 0 ? x : o.current) : Vn([
        (v = n?.current) !== null && v !== void 0 ? v : o.current
      ], {
        shouldUseInert: !0
      });
    }
  }, [
    i,
    e.isOpen,
    o,
    n
  ]), {
    popoverProps: I(c, m),
    arrowProps: u,
    underlayProps: b,
    placement: f,
    triggerAnchorPoint: p
  };
}
const Lt = /* @__PURE__ */ g.createContext(null);
function He(r) {
  let e = En(), { portalContainer: t = e ? null : document.body, isExiting: o } = r, [n, i] = K(!1), l = H(() => ({
    contain: n,
    setContain: i
  }), [
    n,
    i
  ]), { getContainer: s } = Hr();
  if (!r.portalContainer && s && (t = s()), !t) return null;
  let a = r.children;
  return r.disableFocusManagement || (a = /* @__PURE__ */ g.createElement(Qe, {
    restoreFocus: !0,
    contain: (r.shouldContainFocus || n) && !o
  }, a)), a = /* @__PURE__ */ g.createElement(Lt.Provider, {
    value: l
  }, /* @__PURE__ */ g.createElement(On, null, a)), /* @__PURE__ */ Pn.createPortal(a, t);
}
function zn() {
  let r = S(Lt), e = r?.setContain;
  re(() => {
    e?.(!0);
  }, [
    e
  ]);
}
var Nt = {};
Nt = {
  longPressMessage: "اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"
};
var _t = {};
_t = {
  longPressMessage: "Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"
};
var Vt = {};
Vt = {
  longPressMessage: "Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"
};
var Ht = {};
Ht = {
  longPressMessage: "Langt tryk eller tryk på Alt + pil ned for at åbne menuen"
};
var Ut = {};
Ut = {
  longPressMessage: "Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"
};
var zt = {};
zt = {
  longPressMessage: "Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"
};
var jt = {};
jt = {
  longPressMessage: "Long press or press Alt + ArrowDown to open menu"
};
var Wt = {};
Wt = {
  longPressMessage: "Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"
};
var Gt = {};
Gt = {
  longPressMessage: "Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"
};
var Zt = {};
Zt = {
  longPressMessage: "Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"
};
var qt = {};
qt = {
  longPressMessage: "Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."
};
var Jt = {};
Jt = {
  longPressMessage: "לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"
};
var Xt = {};
Xt = {
  longPressMessage: "Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"
};
var Yt = {};
Yt = {
  longPressMessage: "Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"
};
var Qt = {};
Qt = {
  longPressMessage: "Premi a lungo o premi Alt + Freccia giù per aprire il menu"
};
var er = {};
er = {
  longPressMessage: "長押しまたは Alt+下矢印キーでメニューを開く"
};
var tr = {};
tr = {
  longPressMessage: "길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"
};
var rr = {};
rr = {
  longPressMessage: "Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."
};
var nr = {};
nr = {
  longPressMessage: "Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"
};
var or = {};
or = {
  longPressMessage: "Langt trykk eller trykk Alt + PilNed for å åpne menyen"
};
var ar = {};
ar = {
  longPressMessage: "Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"
};
var ir = {};
ir = {
  longPressMessage: "Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"
};
var lr = {};
lr = {
  longPressMessage: "Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"
};
var sr = {};
sr = {
  longPressMessage: "Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"
};
var ur = {};
ur = {
  longPressMessage: "Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"
};
var cr = {};
cr = {
  longPressMessage: "Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"
};
var dr = {};
dr = {
  longPressMessage: "Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"
};
var fr = {};
fr = {
  longPressMessage: "Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"
};
var pr = {};
pr = {
  longPressMessage: "Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"
};
var br = {};
br = {
  longPressMessage: "Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"
};
var $r = {};
$r = {
  longPressMessage: "Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"
};
var mr = {};
mr = {
  longPressMessage: "Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"
};
var gr = {};
gr = {
  longPressMessage: "长按或按 Alt + 向下方向键以打开菜单"
};
var vr = {};
vr = {
  longPressMessage: "長按或按 Alt+向下鍵以開啟功能表"
};
var xr = {};
xr = {
  "ar-AE": Nt,
  "bg-BG": _t,
  "cs-CZ": Vt,
  "da-DK": Ht,
  "de-DE": Ut,
  "el-GR": zt,
  "en-US": jt,
  "es-ES": Wt,
  "et-EE": Gt,
  "fi-FI": Zt,
  "fr-FR": qt,
  "he-IL": Jt,
  "hr-HR": Xt,
  "hu-HU": Yt,
  "it-IT": Qt,
  "ja-JP": er,
  "ko-KR": tr,
  "lt-LT": rr,
  "lv-LV": nr,
  "nb-NO": or,
  "nl-NL": ar,
  "pl-PL": ir,
  "pt-BR": lr,
  "pt-PT": sr,
  "ro-RO": ur,
  "ru-RU": cr,
  "sk-SK": dr,
  "sl-SI": fr,
  "sr-SP": pr,
  "sv-SE": br,
  "tr-TR": $r,
  "uk-UA": mr,
  "zh-CN": gr,
  "zh-TW": vr
};
function jn(r) {
  return r && r.__esModule ? r.default : r;
}
function Wn(r, e, t) {
  let { type: o = "menu", isDisabled: n, trigger: i = "press" } = r, l = G(), { triggerProps: s, overlayProps: a } = rt({
    type: o
  }, e, t), d = (u) => {
    if (!n && !(i === "longPress" && !u.altKey) && t && t.current)
      switch (u.key) {
        case "Enter":
        case " ":
          if (i === "longPress" || u.isDefaultPrevented()) return;
        // fallthrough
        case "ArrowDown":
          "continuePropagation" in u || u.stopPropagation(), u.preventDefault(), e.toggle("first");
          break;
        case "ArrowUp":
          "continuePropagation" in u || u.stopPropagation(), u.preventDefault(), e.toggle("last");
          break;
        default:
          "continuePropagation" in u && u.continuePropagation();
      }
  }, c = Ye(jn(xr), "@react-aria/menu"), { longPressProps: b } = zr({
    isDisabled: n || i !== "longPress",
    accessibilityDescription: c.format("longPressMessage"),
    onLongPressStart() {
      e.close();
    },
    onLongPress() {
      e.open("first");
    }
  }), m = {
    preventFocusOnPress: !0,
    onPressStart(u) {
      u.pointerType !== "touch" && u.pointerType !== "keyboard" && !n && (V(u.target), e.open(u.pointerType === "virtual" ? "first" : null));
    },
    onPress(u) {
      u.pointerType === "touch" && !n && (V(u.target), e.toggle());
    }
  };
  return delete s.onPress, {
    // @ts-ignore - TODO we pass out both DOMAttributes AND AriaButtonProps, but useButton will discard the longPress event handlers, it's only through PressResponder magic that this works for RSP and RAC. it does not work in aria examples
    menuTriggerProps: {
      ...s,
      ...i === "press" ? m : b,
      id: l,
      onKeyDown: d
    },
    menuProps: {
      ...a,
      "aria-labelledby": l,
      autoFocus: e.focusStrategy || !0,
      onClose: e.close
    }
  };
}
const yr = /* @__PURE__ */ new WeakMap();
function Gn(r, e, t) {
  let { shouldFocusWrap: o = !0, onKeyDown: n, onKeyUp: i, ...l } = r;
  !r["aria-label"] && !r["aria-labelledby"] && process.env.NODE_ENV !== "production" && console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
  let s = _(r, {
    labelable: !0
  }), { listProps: a } = qr({
    ...l,
    ref: t,
    selectionManager: e.selectionManager,
    collection: e.collection,
    disabledKeys: e.disabledKeys,
    shouldFocusWrap: o,
    linkBehavior: "override"
  });
  return yr.set(e, {
    onClose: r.onClose,
    onAction: r.onAction,
    shouldUseVirtualFocus: r.shouldUseVirtualFocus
  }), {
    menuProps: I(s, {
      onKeyDown: n,
      onKeyUp: i
    }, {
      role: "menu",
      ...a,
      onKeyDown: (d) => {
        var c;
        (d.key !== "Escape" || r.shouldUseVirtualFocus) && ((c = a.onKeyDown) === null || c === void 0 || c.call(a, d));
      }
    })
  };
}
function Zn(r, e, t) {
  let { id: o, key: n, closeOnSelect: i, isVirtualized: l, "aria-haspopup": s, onPressStart: a, onPressUp: d, onPress: c, onPressChange: b, onPressEnd: m, onClick: u, onHoverStart: f, onHoverChange: p, onHoverEnd: x, onKeyDown: v, onKeyUp: k, onFocus: y, onFocusChange: T, onBlur: F, selectionManager: E = e.selectionManager } = r, P = !!s, $ = P && r["aria-expanded"] === "true";
  var D;
  let A = (D = r.isDisabled) !== null && D !== void 0 ? D : E.isDisabled(n);
  var z;
  let oe = (z = r.isSelected) !== null && z !== void 0 ? z : E.isSelected(n), N = yr.get(e), C = e.collection.getItem(n), Z = r.onClose || N.onClose, q = $n(), Cr = () => {
    var h;
    if (!P && (!(C == null || (h = C.props) === null || h === void 0) && h.onAction ? C.props.onAction() : r.onAction && r.onAction(n), N.onAction)) {
      let J = N.onAction;
      J(n);
    }
  }, be = "menuitem";
  P || (E.selectionMode === "single" ? be = "menuitemradio" : E.selectionMode === "multiple" && (be = "menuitemcheckbox"));
  let Te = ue(), Be = ue(), Oe = ue(), ae = {
    id: o,
    "aria-disabled": A || void 0,
    role: be,
    "aria-label": r["aria-label"],
    "aria-labelledby": Te,
    "aria-describedby": [
      Be,
      Oe
    ].filter(Boolean).join(" ") || void 0,
    "aria-controls": r["aria-controls"],
    "aria-haspopup": s,
    "aria-expanded": r["aria-expanded"]
  };
  E.selectionMode !== "none" && !P && (ae["aria-checked"] = oe), l && (ae["aria-posinset"] = C?.index, ae["aria-setsize"] = Jr(e.collection));
  let Fe = M(!1), Mr = (h) => {
    b?.(h), Fe.current = h;
  }, j = M(null), kr = (h) => {
    h.pointerType !== "keyboard" && (j.current = {
      pointerType: h.pointerType
    }), h.pointerType === "mouse" && (Fe.current || h.target.click()), d?.(h);
  }, Sr = (h) => {
    var J, $e;
    u?.(h), Cr(), gn(h, q, C.props.href, C?.props.routerOptions);
    let me = ((J = j.current) === null || J === void 0 ? void 0 : J.pointerType) === "keyboard" ? (($e = j.current) === null || $e === void 0 ? void 0 : $e.key) === "Enter" || E.selectionMode === "none" || E.isLink(n) : E.selectionMode !== "multiple" || E.isLink(n);
    me = i ?? me, Z && !P && me && Z(), j.current = null;
  }, { itemProps: W, isFocused: Re } = jr({
    id: o,
    selectionManager: E,
    key: n,
    ref: t,
    shouldSelectOnPressUp: !0,
    allowsDifferentPressOrigin: !0,
    // Disable all handling of links in useSelectable item
    // because we handle it ourselves. The behavior of menus
    // is slightly different from other collections because
    // actions are performed on key down rather than key up.
    linkBehavior: "none",
    shouldUseVirtualFocus: N.shouldUseVirtualFocus
  }), { pressProps: wr, isPressed: Ar } = cn({
    onPressStart: a,
    onPress: c,
    onPressUp: kr,
    onPressChange: Mr,
    onPressEnd: m,
    isDisabled: A
  }), { hoverProps: Tr } = Je({
    isDisabled: A,
    onHoverStart(h) {
      !Le() && !($ && s) && (E.setFocused(!0), E.setFocusedKey(n)), f?.(h);
    },
    onHoverChange: p,
    onHoverEnd: x
  }), { keyboardProps: Br } = xn({
    onKeyDown: (h) => {
      if (h.repeat) {
        h.continuePropagation();
        return;
      }
      switch (h.key) {
        case " ":
          j.current = {
            pointerType: "keyboard",
            key: " "
          }, h.target.click();
          break;
        case "Enter":
          j.current = {
            pointerType: "keyboard",
            key: "Enter"
          }, h.target.tagName !== "A" && h.target.click();
          break;
        default:
          P || h.continuePropagation(), v?.(h);
          break;
      }
    },
    onKeyUp: k
  }), { focusProps: Or } = vn({
    onBlur: F,
    onFocus: y,
    onFocusChange: T
  }), Ke = _(C?.props);
  delete Ke.id;
  let Fr = mn(C?.props);
  return {
    menuItemProps: {
      ...ae,
      ...I(
        Ke,
        Fr,
        P ? {
          onFocus: W.onFocus,
          "data-collection": W["data-collection"],
          "data-key": W["data-key"]
        } : W,
        wr,
        Tr,
        Br,
        Or,
        // Prevent DOM focus from moving on mouse down when using virtual focus or this is a submenu/subdialog trigger.
        N.shouldUseVirtualFocus || P ? {
          onMouseDown: (h) => h.preventDefault()
        } : void 0,
        A ? void 0 : {
          onClick: Sr
        }
      ),
      // If a submenu is expanded, set the tabIndex to -1 so that shift tabbing goes out of the menu instead of the parent menu item.
      tabIndex: W.tabIndex != null && $ && !N.shouldUseVirtualFocus ? -1 : W.tabIndex
    },
    labelProps: {
      id: Te
    },
    descriptionProps: {
      id: Be
    },
    keyboardShortcutProps: {
      id: Oe
    },
    isFocused: Re,
    isFocusVisible: Re && E.isFocused && Le() && !$,
    isSelected: oe,
    isPressed: Ar,
    isDisabled: A
  };
}
function qn(r) {
  let { heading: e, "aria-label": t } = r, o = G();
  return {
    itemProps: {
      role: "presentation"
    },
    headingProps: e ? {
      // Techincally, menus cannot contain headings according to ARIA.
      // We hide the heading from assistive technology, using role="presentation",
      // and only use it as a label for the nested group.
      id: o,
      role: "presentation"
    } : {},
    groupProps: {
      role: "group",
      "aria-label": t,
      "aria-labelledby": e ? o : void 0
    }
  };
}
const se = 2, Jn = 50, Xn = 1e3, Ue = Math.PI / 12;
function Yn(r) {
  let { menuRef: e, submenuRef: t, isOpen: o, isDisabled: n } = r, i = M(void 0), l = M(void 0), s = M(0), a = M(void 0), d = M(void 0), c = M(void 0), b = M(2), [m, u] = K(!1);
  Ce({
    ref: t,
    onResize: () => {
      t.current && (l.current = t.current.getBoundingClientRect(), c.current = void 0);
    }
  });
  let p = () => {
    u(!1), b.current = se, i.current = void 0;
  }, x = fn(), v = Ee((k) => {
    m && k.preventDefault();
  });
  L(() => {
    m && e.current ? e.current.style.pointerEvents = "none" : e.current.style.pointerEvents = "";
  }, [
    e,
    m
  ]), re(() => {
    let k = t.current, y = e.current;
    if (n || !k || !o || x !== "pointer" || !y) {
      p();
      return;
    }
    l.current = k.getBoundingClientRect();
    let T = (F) => {
      if (F.pointerType === "touch" || F.pointerType === "pen") return;
      let E = Date.now();
      if (E - s.current < Jn) return;
      clearTimeout(a.current), clearTimeout(d.current);
      let { clientX: P, clientY: $ } = F;
      if (!i.current) {
        i.current = {
          x: P,
          y: $
        };
        return;
      }
      if (!l.current) return;
      if (c.current || (c.current = P > l.current.right ? "left" : "right"), P < y.getBoundingClientRect().left || P > y.getBoundingClientRect().right || $ < y.getBoundingClientRect().top || $ > y.getBoundingClientRect().bottom) {
        p();
        return;
      }
      let D = i.current.x, A = i.current.y, z = c.current === "right" ? l.current.left - D : D - l.current.right, oe = Math.atan2(A - l.current.top, z) + Ue, N = Math.atan2(A - l.current.bottom, z) - Ue, C = Math.atan2(A - $, c.current === "left" ? -(P - D) : P - D), Z = C < oe && C > N;
      b.current = Z ? Math.min(b.current + 1, se) : Math.max(b.current - 1, 0), b.current >= se ? u(!0) : u(!1), s.current = E, i.current = {
        x: P,
        y: $
      }, Z && (a.current = setTimeout(() => {
        p(), d.current = setTimeout(() => {
          let q = document.elementFromPoint(P, $);
          q && y.contains(q) && q.dispatchEvent(new PointerEvent("pointerover", {
            bubbles: !0,
            cancelable: !0
          }));
        }, 100);
      }, Xn));
    };
    return window.addEventListener("pointermove", T), process.env.NODE_ENV !== "test" && window.addEventListener("pointerdown", v, !0), () => {
      window.removeEventListener("pointermove", T), process.env.NODE_ENV !== "test" && window.removeEventListener("pointerdown", v, !0), clearTimeout(a.current), clearTimeout(d.current), b.current = se;
    };
  }, [
    n,
    o,
    e,
    x,
    u,
    t
  ]);
}
function Qn(r, e, t) {
  let { parentMenuRef: o, submenuRef: n, type: i = "menu", isDisabled: l, delay: s = 200, shouldUseVirtualFocus: a } = r, d = G(), c = G(), { direction: b } = Xe(), m = M(void 0), u = R(() => {
    m.current && (clearTimeout(m.current), m.current = void 0);
  }, [
    m
  ]), f = R(($) => {
    u(), e.open($);
  }, [
    e,
    u
  ]), p = R(() => {
    u(), e.close();
  }, [
    e,
    u
  ]);
  re(() => () => {
    u();
  }, [
    u
  ]);
  let x = ($) => {
    if ($.currentTarget.contains(document.activeElement))
      switch ($.key) {
        case "ArrowLeft":
          b === "ltr" && $.currentTarget.contains($.target) && ($.preventDefault(), $.stopPropagation(), p(), !a && t.current && V(t.current));
          break;
        case "ArrowRight":
          b === "rtl" && $.currentTarget.contains($.target) && ($.preventDefault(), $.stopPropagation(), p(), !a && t.current && V(t.current));
          break;
        case "Escape":
          var D;
          !((D = n.current) === null || D === void 0) && D.contains($.target) && ($.stopPropagation(), p(), !a && t.current && V(t.current));
          break;
      }
  };
  var v;
  let k = {
    id: c,
    "aria-labelledby": d,
    submenuLevel: e.submenuLevel,
    ...i === "menu" && {
      onClose: e.closeAll,
      autoFocus: (v = e.focusStrategy) !== null && v !== void 0 ? v : void 0,
      onKeyDown: x
    }
  }, y = ($) => {
    switch ($.key) {
      case "ArrowRight":
        l || (b === "ltr" ? ($.preventDefault(), e.isOpen || f("first"), i === "menu" && n?.current && document.activeElement === t?.current && V(n.current)) : e.isOpen ? p() : $.continuePropagation());
        break;
      case "ArrowLeft":
        l || (b === "rtl" ? ($.preventDefault(), e.isOpen || f("first"), i === "menu" && n?.current && document.activeElement === t?.current && V(n.current)) : e.isOpen ? p() : $.continuePropagation());
        break;
      default:
        $.continuePropagation();
        break;
    }
  }, T = ($) => {
    !l && ($.pointerType === "virtual" || $.pointerType === "keyboard") && f("first");
  }, F = ($) => {
    !l && ($.pointerType === "touch" || $.pointerType === "mouse") && f();
  }, E = ($) => {
    l || ($ && !e.isOpen ? m.current || (m.current = setTimeout(() => {
      f();
    }, s)) : $ || u());
  };
  pn(o, "focusin", ($) => {
    var D;
    e.isOpen && (!((D = o.current) === null || D === void 0) && D.contains($.target)) && $.target !== t.current && p();
  });
  let P = ($) => $ !== t.current;
  return Yn({
    menuRef: o,
    submenuRef: n,
    isOpen: e.isOpen,
    isDisabled: l
  }), {
    submenuTriggerProps: {
      id: d,
      "aria-controls": e.isOpen ? c : void 0,
      "aria-haspopup": l ? void 0 : i,
      "aria-expanded": e.isOpen ? "true" : "false",
      onPressStart: T,
      onPress: F,
      onHoverChange: E,
      onKeyDown: y,
      isOpen: e.isOpen
    },
    submenuProps: k,
    popoverProps: {
      isNonModal: !0,
      shouldCloseOnInteractOutside: P
    }
  };
}
function eo(r, e) {
  let { role: t = "dialog" } = r, o = ue();
  o = r["aria-label"] ? void 0 : o;
  let n = M(!1);
  return L(() => {
    if (e.current && !e.current.contains(document.activeElement)) {
      De(e.current);
      let i = setTimeout(() => {
        (document.activeElement === e.current || document.activeElement === document.body) && (n.current = !0, e.current && (e.current.blur(), De(e.current)), n.current = !1);
      }, 500);
      return () => {
        clearTimeout(i);
      };
    }
  }, [
    e
  ]), zn(), {
    dialogProps: {
      ..._(r, {
        labelable: !0
      }),
      role: t,
      tabIndex: -1,
      "aria-labelledby": r["aria-labelledby"] || o,
      // Prevent blur events from reaching useOverlay, which may cause
      // popovers to close. Since focus is contained within the dialog,
      // we don't want this to occur due to the above useEffect.
      onBlur: (i) => {
        n.current && i.stopPropagation();
      }
    },
    titleProps: {
      id: o
    }
  };
}
function we(r) {
  let e = je(r), [t, o] = K(null), [n, i] = K([]), l = () => {
    i([]), e.close();
  };
  return {
    focusStrategy: t,
    ...e,
    open(d = null) {
      o(d), e.open();
    },
    toggle(d = null) {
      o(d), e.toggle();
    },
    close() {
      l();
    },
    expandedKeysStack: n,
    openSubmenu: (d, c) => {
      i((b) => c > b.length ? b : [
        ...b.slice(0, c),
        d
      ]);
    },
    closeSubmenu: (d, c) => {
      i((b) => b[c] === d ? b.slice(0, c) : b);
    }
  };
}
function to(r, e) {
  let { triggerKey: t } = r, { expandedKeysStack: o, openSubmenu: n, closeSubmenu: i, close: l } = e, [s] = K(o?.length), a = H(() => o[s] === t, [
    o,
    t,
    s
  ]), [d, c] = K(null), b = R((f) => {
    c(f ?? null), n(t, s);
  }, [
    n,
    s,
    t
  ]), m = R(() => {
    c(null), i(t, s);
  }, [
    i,
    s,
    t
  ]), u = R((f) => {
    c(f ?? null), a ? m() : b(f);
  }, [
    m,
    b,
    a
  ]);
  return H(() => ({
    focusStrategy: d,
    isOpen: a,
    open: b,
    close: m,
    closeAll: l,
    submenuLevel: s,
    // TODO: Placeholders that aren't used but give us parity with OverlayTriggerState so we can use this in Popover. Refactor if we update Popover via
    // https://github.com/adobe/react-spectrum/pull/4976#discussion_r1336472863
    setOpen: () => {
    },
    toggle: u
  }), [
    a,
    b,
    m,
    l,
    d,
    u,
    s
  ]);
}
class ro {
  *[Symbol.iterator]() {
    yield* this.iterable;
  }
  get size() {
    return this.keyMap.size;
  }
  getKeys() {
    return this.keyMap.keys();
  }
  getKeyBefore(e) {
    let t = this.keyMap.get(e);
    var o;
    return t && (o = t.prevKey) !== null && o !== void 0 ? o : null;
  }
  getKeyAfter(e) {
    let t = this.keyMap.get(e);
    var o;
    return t && (o = t.nextKey) !== null && o !== void 0 ? o : null;
  }
  getFirstKey() {
    return this.firstKey;
  }
  getLastKey() {
    return this.lastKey;
  }
  getItem(e) {
    var t;
    return (t = this.keyMap.get(e)) !== null && t !== void 0 ? t : null;
  }
  at(e) {
    const t = [
      ...this.getKeys()
    ];
    return this.getItem(t[e]);
  }
  constructor(e, { expandedKeys: t } = {}) {
    this.keyMap = /* @__PURE__ */ new Map(), this.firstKey = null, this.lastKey = null, this.iterable = e, t = t || /* @__PURE__ */ new Set();
    let o = (s) => {
      if (this.keyMap.set(s.key, s), s.childNodes && (s.type === "section" || t.has(s.key))) for (let a of s.childNodes) o(a);
    };
    for (let s of e) o(s);
    let n = null, i = 0;
    for (let [s, a] of this.keyMap)
      n ? (n.nextKey = s, a.prevKey = n.key) : (this.firstKey = s, a.prevKey = void 0), a.type === "item" && (a.index = i++), n = a, n.nextKey = void 0;
    var l;
    this.lastKey = (l = n?.key) !== null && l !== void 0 ? l : null;
  }
}
function no(r) {
  let { onExpandedChange: e } = r, [t, o] = yn(r.expandedKeys ? new Set(r.expandedKeys) : void 0, r.defaultExpandedKeys ? new Set(r.defaultExpandedKeys) : /* @__PURE__ */ new Set(), e), n = We(r), i = H(() => r.disabledKeys ? new Set(r.disabledKeys) : /* @__PURE__ */ new Set(), [
    r.disabledKeys
  ]), l = Wr(r, R((a) => new ro(a, {
    expandedKeys: t
  }), [
    t
  ]), null);
  return L(() => {
    n.focusedKey != null && !l.getItem(n.focusedKey) && n.setFocusedKey(null);
  }, [
    l,
    n.focusedKey
  ]), {
    collection: l,
    expandedKeys: t,
    disabledKeys: i,
    toggleKey: (a) => {
      o(oo(t, a));
    },
    setExpandedKeys: o,
    selectionManager: new Ge(l, n)
  };
}
function oo(r, e) {
  let t = new Set(r);
  return t.has(e) ? t.delete(e) : t.add(e), t;
}
const fe = /* @__PURE__ */ O(null), ze = /* @__PURE__ */ O(null), qo = /* @__PURE__ */ Se(function(e, t) {
  [e, t] = ee(e, t, fe);
  let o = S(ne), n = je(e), i = e.isOpen != null || e.defaultOpen != null || !o ? n : o, l = Dn(t, i.isOpen) || e.isExiting || !1, s = Mn(), { direction: a } = Xe();
  if (s) {
    let d = e.children;
    return typeof d == "function" && (d = d({
      trigger: e.trigger || null,
      placement: "bottom",
      isEntering: !1,
      isExiting: !1,
      defaultChildren: null
    })), /* @__PURE__ */ g.createElement(g.Fragment, null, d);
  }
  return i && !i.isOpen && !l ? null : /* @__PURE__ */ g.createElement(ao, {
    ...e,
    triggerRef: e.triggerRef,
    state: i,
    popoverRef: t,
    isExiting: l,
    dir: a
  });
});
function ao({ state: r, isExiting: e, UNSTABLE_portalContainer: t, clearContexts: o, ...n }) {
  let i = M(null), l = M(null), s = S(ze), a = s && n.trigger === "SubmenuTrigger";
  var d;
  let { popoverProps: c, underlayProps: b, arrowProps: m, placement: u, triggerAnchorPoint: f } = Un({
    ...n,
    offset: (d = n.offset) !== null && d !== void 0 ? d : 8,
    arrowRef: i,
    // If this is a submenu/subdialog, use the root popover's container
    // to detect outside interaction and add aria-hidden.
    groupRef: a ? s : l
  }, r), p = n.popoverRef, x = Cn(p, !!u) || n.isEntering || !1, v = te({
    ...n,
    defaultClassName: "react-aria-Popover",
    values: {
      trigger: n.trigger || null,
      placement: u,
      isEntering: x,
      isExiting: e
    }
  }), k = !n.isNonModal || n.trigger === "SubmenuTrigger", [y, T] = K(!1);
  re(() => {
    p.current && T(k && !p.current.querySelector("[role=dialog]"));
  }, [
    p,
    k
  ]), L(() => {
    y && n.trigger !== "SubmenuTrigger" && p.current && !p.current.contains(document.activeElement) && De(p.current);
  }, [
    y,
    p,
    n.trigger
  ]);
  let F = H(() => {
    let D = v.children;
    if (o) for (let A of o) D = /* @__PURE__ */ g.createElement(A.Provider, {
      value: null
    }, D);
    return D;
  }, [
    v.children,
    o
  ]), E = {
    ...c.style,
    "--trigger-anchor-point": f ? `${f.x}px ${f.y}px` : void 0,
    ...v.style
  }, P = /* @__PURE__ */ g.createElement("div", {
    ...I(_(n, {
      global: !0
    }), c),
    ...v,
    role: y ? "dialog" : void 0,
    tabIndex: y ? -1 : void 0,
    "aria-label": n["aria-label"],
    "aria-labelledby": n["aria-labelledby"],
    ref: p,
    slot: n.slot || void 0,
    style: E,
    dir: n.dir,
    "data-trigger": n.trigger,
    "data-placement": u,
    "data-entering": x || void 0,
    "data-exiting": e || void 0
  }, !n.isNonModal && /* @__PURE__ */ g.createElement(Ve, {
    onDismiss: r.close
  }), /* @__PURE__ */ g.createElement(Ur.Provider, {
    value: {
      ...m,
      placement: u,
      ref: i
    }
  }, F), /* @__PURE__ */ g.createElement(Ve, {
    onDismiss: r.close
  }));
  if (!a) return /* @__PURE__ */ g.createElement(He, {
    ...n,
    shouldContainFocus: y,
    isExiting: e,
    portalContainer: t
  }, !n.isNonModal && r.isOpen && /* @__PURE__ */ g.createElement("div", {
    "data-testid": "underlay",
    ...b,
    style: {
      position: "fixed",
      inset: 0
    }
  }), /* @__PURE__ */ g.createElement("div", {
    ref: l,
    style: {
      display: "contents"
    }
  }, /* @__PURE__ */ g.createElement(ze.Provider, {
    value: l
  }, P)));
  var $;
  return /* @__PURE__ */ g.createElement(He, {
    ...n,
    shouldContainFocus: y,
    isExiting: e,
    portalContainer: ($ = t ?? s?.current) !== null && $ !== void 0 ? $ : void 0
  }, P);
}
const Ae = /* @__PURE__ */ O(null), pe = /* @__PURE__ */ O(null), Q = /* @__PURE__ */ O(null), ce = /* @__PURE__ */ O(null);
function Jo(r) {
  let e = we(r), t = M(null), { menuTriggerProps: o, menuProps: n } = Wn({
    ...r,
    type: "menu"
  }, e, t), [i, l] = K(null), s = R(() => {
    t.current && l(t.current.offsetWidth + "px");
  }, [
    t
  ]);
  Ce({
    ref: t,
    onResize: s
  });
  let a = M(null);
  return /* @__PURE__ */ g.createElement(U, {
    values: [
      [
        Ae,
        {
          ...n,
          ref: a
        }
      ],
      [
        ne,
        e
      ],
      [
        Q,
        e
      ],
      [
        fe,
        {
          trigger: "MenuTrigger",
          triggerRef: t,
          scrollRef: a,
          placement: "bottom start",
          style: {
            "--trigger-width": i
          },
          "aria-labelledby": n["aria-labelledby"]
        }
      ]
    ]
  }, /* @__PURE__ */ g.createElement(tt, {
    ...o,
    ref: t,
    isPressed: e.isOpen
  }, r.children));
}
const hr = /* @__PURE__ */ O(null);
class Pr extends un {
  filter(e, t, o) {
    let n = e.getItem(this.firstChildKey);
    if (n && o(n.textValue, this)) {
      let i = this.clone();
      return t.addDescendants(i, e), i;
    }
    return null;
  }
}
Pr.type = "submenutrigger";
const Xo = /* @__PURE__ */ Ze(Pr, (r, e, t) => {
  let { CollectionBranch: o } = S(Me), n = S(pe), i = S(Q), l = to({
    triggerKey: t.key
  }, i), s = M(null), a = ke(e), { parentMenuRef: d, shouldUseVirtualFocus: c } = S(hr), { submenuTriggerProps: b, submenuProps: m, popoverProps: u } = Qn({
    parentMenuRef: d,
    submenuRef: s,
    delay: r.delay,
    shouldUseVirtualFocus: c
  }, l, a);
  return /* @__PURE__ */ g.createElement(U, {
    values: [
      [
        de,
        {
          ...b,
          onAction: void 0,
          ref: a
        }
      ],
      [
        Ae,
        {
          ref: s,
          ...m
        }
      ],
      [
        ne,
        l
      ],
      [
        fe,
        {
          trigger: "SubmenuTrigger",
          triggerRef: a,
          placement: "end top",
          "aria-labelledby": m["aria-labelledby"],
          ...u
        }
      ]
    ]
  }, /* @__PURE__ */ g.createElement(o, {
    collection: n.collection,
    parent: t
  }), r.children[1]);
}, (r) => r.children[0]), Yo = /* @__PURE__ */ Se(function(e, t) {
  return [e, t] = ee(e, t, Ae), /* @__PURE__ */ g.createElement(ln, {
    content: /* @__PURE__ */ g.createElement(sn, e)
  }, (o) => /* @__PURE__ */ g.createElement(io, {
    props: e,
    collection: o,
    menuRef: t
  }));
});
function io({ props: r, collection: e, menuRef: t }) {
  [r, t] = ee(r, t, Ie);
  let { filter: o, ...n } = r, i = H(() => o ? e.filter(o) : e, [
    e,
    o
  ]), l = no({
    ...r,
    collection: i,
    children: void 0
  }), s = S(Q), { isVirtualized: a, CollectionRoot: d } = S(Me), { menuProps: c } = Gn({
    ...r,
    isVirtualized: a,
    onClose: r.onClose || s?.close
  }, l, t), b = te({
    defaultClassName: "react-aria-Menu",
    className: r.className,
    style: r.style,
    values: {
      isEmpty: l.collection.size === 0
    }
  }), m = null;
  l.collection.size === 0 && r.renderEmptyState && (m = /* @__PURE__ */ g.createElement("div", {
    role: "menuitem",
    style: {
      display: "contents"
    }
  }, r.renderEmptyState()));
  let u = _(r, {
    global: !0
  });
  return /* @__PURE__ */ g.createElement(Qe, null, /* @__PURE__ */ g.createElement("div", {
    ...I(u, b, c),
    ref: t,
    slot: r.slot || void 0,
    "data-empty": l.collection.size === 0 || void 0,
    onScroll: r.onScroll
  }, /* @__PURE__ */ g.createElement(U, {
    values: [
      [
        pe,
        l
      ],
      [
        tn,
        {
          elementType: "div"
        }
      ],
      [
        Gr,
        {
          name: "MenuSection",
          render: Er
        }
      ],
      [
        hr,
        {
          parentMenuRef: t,
          shouldUseVirtualFocus: n?.shouldUseVirtualFocus
        }
      ],
      [
        de,
        null
      ],
      [
        Ie,
        null
      ],
      [
        Lr,
        null
      ],
      [
        ce,
        l.selectionManager
      ],
      /* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */
      /* We assume the context can never change between defined and undefined. */
      /* eslint-disable-next-line react-hooks/rules-of-hooks */
      [
        Q,
        s ?? we({})
      ]
    ]
  }, /* @__PURE__ */ g.createElement(en, null, /* @__PURE__ */ g.createElement(d, {
    collection: l.collection,
    persistedKeys: Zr(l.selectionManager.focusedKey),
    scrollRef: t
  }))), m));
}
class lo extends Ge {
  get focusedKey() {
    return this.parent.focusedKey;
  }
  get isFocused() {
    return this.parent.isFocused;
  }
  setFocusedKey(e, t) {
    return this.parent.setFocusedKey(e, t);
  }
  setFocused(e) {
    this.parent.setFocused(e);
  }
  get childFocusStrategy() {
    return this.parent.childFocusStrategy;
  }
  constructor(e, t) {
    super(e.collection, t), this.parent = e;
  }
}
function Er(r, e, t, o = "react-aria-MenuSection") {
  var n, i;
  let l = S(pe), { CollectionBranch: s } = S(Me), [a, d] = Ir();
  var c;
  let { headingProps: b, groupProps: m } = qn({
    heading: d,
    "aria-label": (c = t.props["aria-label"]) !== null && c !== void 0 ? c : void 0
  }), u = te({
    defaultClassName: o,
    className: (n = t.props) === null || n === void 0 ? void 0 : n.className,
    style: (i = t.props) === null || i === void 0 ? void 0 : i.style,
    values: {}
  }), f = S(ce), p = We(r), x = r.selectionMode != null ? new lo(f, p) : f, v = _(r, {
    global: !0
  });
  return delete v.id, /* @__PURE__ */ g.createElement("section", {
    ...I(v, u, m),
    ref: e
  }, /* @__PURE__ */ g.createElement(U, {
    values: [
      [
        Xr,
        {
          ...b,
          ref: a
        }
      ],
      [
        ce,
        x
      ]
    ]
  }, /* @__PURE__ */ g.createElement(s, {
    collection: l.collection,
    parent: t
  })));
}
const Qo = /* @__PURE__ */ Ze(nn, Er), de = /* @__PURE__ */ O(null), ea = /* @__PURE__ */ on(an, function(e, t, o) {
  var n;
  [e, t] = ee(e, t, de);
  let i = (n = Kr(de)) === null || n === void 0 ? void 0 : n.id, l = S(pe), s = ke(t), a = S(ce), { menuItemProps: d, labelProps: c, descriptionProps: b, keyboardShortcutProps: m, ...u } = Zn({
    ...e,
    id: i,
    key: o.key,
    selectionManager: a
  }, l, s), { hoverProps: f, isHovered: p } = Je({
    isDisabled: u.isDisabled
  }), x = te({
    ...e,
    id: void 0,
    children: o.rendered,
    defaultClassName: "react-aria-MenuItem",
    values: {
      ...u,
      isHovered: p,
      isFocusVisible: u.isFocusVisible,
      selectionMode: a.selectionMode,
      selectionBehavior: a.selectionBehavior,
      hasSubmenu: !!e["aria-haspopup"],
      isOpen: e["aria-expanded"] === "true"
    }
  }), v = e.href ? "a" : "div", k = _(e, {
    global: !0
  });
  return delete k.id, delete k.onClick, /* @__PURE__ */ g.createElement(v, {
    ...I(k, x, d, f),
    ref: s,
    "data-disabled": u.isDisabled || void 0,
    "data-hovered": p || void 0,
    "data-focused": u.isFocused || void 0,
    "data-focus-visible": u.isFocusVisible || void 0,
    "data-pressed": u.isPressed || void 0,
    "data-selected": u.isSelected || void 0,
    "data-selection-mode": a.selectionMode === "none" ? void 0 : a.selectionMode,
    "data-has-submenu": !!e["aria-haspopup"] || void 0,
    "data-open": e["aria-expanded"] === "true" || void 0
  }, /* @__PURE__ */ g.createElement(U, {
    values: [
      [
        rn,
        {
          slots: {
            [he]: c,
            label: c,
            description: b
          }
        }
      ],
      [
        Yr,
        m
      ],
      [
        Qr,
        {
          isSelected: u.isSelected
        }
      ]
    ]
  }, x.children));
}), Dr = /* @__PURE__ */ O(null), ne = /* @__PURE__ */ O(null);
function ta(r) {
  let e = we(r), t = M(null), { triggerProps: o, overlayProps: n } = rt({
    type: "dialog"
  }, e, t), [i, l] = K(null), s = R(() => {
    t.current && l(t.current.offsetWidth + "px");
  }, [
    t
  ]);
  return Ce({
    ref: t,
    onResize: s
  }), o.id = G(), n["aria-labelledby"] = o.id, /* @__PURE__ */ g.createElement(U, {
    values: [
      [
        ne,
        e
      ],
      [
        Q,
        e
      ],
      [
        Dr,
        n
      ],
      [
        fe,
        {
          trigger: "DialogTrigger",
          triggerRef: t,
          "aria-labelledby": n["aria-labelledby"],
          style: {
            "--trigger-width": i
          }
        }
      ]
    ]
  }, /* @__PURE__ */ g.createElement(tt, {
    ...o,
    ref: t,
    isPressed: e.isOpen
  }, r.children));
}
const ra = /* @__PURE__ */ Se(function(e, t) {
  let o = e["aria-labelledby"];
  [e, t] = ee(e, t, Dr);
  let { dialogProps: n, titleProps: i } = eo({
    ...e,
    // Only pass aria-labelledby from props, not context.
    // Context is used as a fallback below.
    "aria-labelledby": o
  }, t), l = S(ne);
  !n["aria-label"] && !n["aria-labelledby"] && (e["aria-labelledby"] ? n["aria-labelledby"] = e["aria-labelledby"] : process.env.NODE_ENV !== "production" && console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));
  let s = te({
    defaultClassName: "react-aria-Dialog",
    className: e.className,
    style: e.style,
    children: e.children,
    values: {
      close: l?.close || (() => {
      })
    }
  }), a = _(e, {
    global: !0
  });
  return /* @__PURE__ */ g.createElement("section", {
    ...I(a, s, n),
    ref: t,
    slot: e.slot || void 0
  }, /* @__PURE__ */ g.createElement(U, {
    values: [
      [
        Nr,
        {
          slots: {
            [he]: {},
            title: {
              ...i,
              level: 2
            }
          }
        }
      ],
      [
        Rr,
        {
          slots: {
            [he]: {},
            close: {
              onPress: () => l?.close()
            }
          }
        }
      ]
    ]
  }, s.children));
});
export {
  qo as $,
  Rn as a,
  Kn as b,
  zn as c,
  Vn as d,
  ne as e,
  Ve as f,
  He as g,
  fe as h,
  Dr as i,
  ta as j,
  ra as k,
  Jo as l,
  Yo as m,
  ea as n,
  Qo as o,
  Xo as p,
  Wn as q,
  On as r
};
//# sourceMappingURL=Dialog-7Yf08giu.es.js.map
