import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "./Button-npzfSoYo.js";
import { l as $df56164dff5785e2$export$4338b53315abf666, b as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $8ae05eaa5c114e9c$export$7f54fc3180508a52, d as $bdb11010cef70236$export$f680877a34711e37, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, p as $ff5963eb1fccf552$export$e08e3b67e392101e, n as $b5e257d569688ac6$export$535bd6ca7f90a273, j as $bdb11010cef70236$export$b4cc09c592e8fdb8, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, o as $64fa3d84918910a7$export$c62b8e45d58ddad9, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 } from "./utils-cvK1vxO7.js";
import { $ as $4e85f108e88277b8$export$d688439359537581 } from "./RSPContexts-2lR5GG9p.js";
import { g as $dd149f63282afbbf$export$f6211563215e3b37, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, f as $9daab02d461809db$export$683480f191c0e3ea, $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f } from "./OverlayArrow-DivvkAVb.js";
import { B as $8a26561d2877236e$export$c24ed0104d07eab9, c as $880e95eb8b93ba9a$export$ecf600387e221c37, $ as $7af3f5b51489e0b5$export$253fe78d46329472, a as $7613b1592d41b092$export$6cd28814d92fa9c9, b as $d496c0a20b6e58ec$export$6c8a5aaad13c9852, d as $e1995378a142960e$export$18af5c7a9e9b3664, C as $e1995378a142960e$export$e953bb1cd0f19726, e as $e1995378a142960e$export$bf788dd355e3a401, f as $e1995378a142960e$export$fb8073518f34e6ec, g as $23b9f4fcf0fe224b$export$fd11f34e1d07f134, D as $23b9f4fcf0fe224b$export$437f11dc9b403b78, h as $7135fc7d473fd974$export$4feb769f8ddf26c5, i as $7135fc7d473fd974$export$d40e14dec8b060a8, n as $7135fc7d473fd974$export$90e00781bc59d8f9, m as $23b9f4fcf0fe224b$export$d68d59712b04d9d1 } from "./SelectionManager-CabSdgMq.js";
import { a as $8e6cc465cc68f603$export$b0d3ecf7112093a7, $ as $8e6cc465cc68f603$export$698f465ec27e93df } from "./context-DCAZLyDS.js";
import { c as $62d8ded9296f3872$export$cfa2225e87938781, d as $982254629710d113$export$b95089534ab7c1fd, e as $453cc9f0df89c0a5$export$77d5aafae4e095b2, g as $431f98aba6844401$export$6615d83f6de245ce, h as $72a5793c14baf454$export$e0e4026c12a8bdbb } from "./Separator-BPvqJny4.js";
import React__default, { useRef, useContext, useEffect, useMemo, useState, useCallback, forwardRef, createContext } from "react";
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-AxKZjtFm.js";
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-D2C6R0DK.js";
import { d as $ae1eeba8b9eafd08$export$5165eccb35aaadb5, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, $ as $f6c31cce2adf654f$export$45712eceda6fad21, a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, e as $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f } from "./usePress-CBQIDzpQ.js";
import { I as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, c as $431fbd86ca7dc216$export$b204af158042fbac, b as $c87311424ea30a05$export$fedb369cb70207f1, x as $431fbd86ca7dc216$export$f21a1ffae260145a, z as $7215afc6de606d6b$export$de79e2c695e052f3, w as $6179b936705e76d3$export$ae780daf29e6d456, l as $507fabe10e71c6fb$export$b9b3dfddab17db27, A as $46d819fcbaf35654$export$8f71654801c2f7cd, n as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, L as $507fabe10e71c6fb$export$98e20ec92f614cfe, r as $3ad3f6e1647bc98d$export$80f3e147d781571c, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-LmGemtHE.js";
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-eaZiN2tE.js";
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-BifIGnVS.js";
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-DMOmz986.js";
import { c as $9bf71ea28793e738$export$1258395f99bf9cbf, b as $9bf71ea28793e738$export$20e40289641fbbb6 } from "./FocusScope-DJApHXhY.js";
import { a as $96b38030c423d352$export$9fc1347d4195ccb3 } from "./PortalProvider---wyKpMr.js";
import { $ as $dbSRa$reactdom } from "./index-D8-Zjpbd.js";
import { b as $f39a9eba43920ace$export$b5d7cc18bb8d2b59 } from "./Hidden-rE6uR-lr.js";
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "./useFocusRing-CUxgjvAY.js";
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "./useLabels-Cdxi6JSa.js";
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-X6SggVVO.js";
const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /* @__PURE__ */ React__default.forwardRef(({ children, ...props }, ref) => {
  let isRegistered = useRef(false);
  let prevContext = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
  ref = $df56164dff5785e2$export$4338b53315abf666(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
  let context = $3ef42575df84b30b$export$9d1611c77c2fe928(prevContext || {}, {
    ...props,
    ref,
    register() {
      isRegistered.current = true;
      if (prevContext) prevContext.register();
    }
  });
  $e7801be82b4b2a53$export$4debdb1a3f0fa79e(prevContext, ref);
  useEffect(() => {
    if (!isRegistered.current) {
      if (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.");
      isRegistered.current = true;
    }
  }, []);
  return /* @__PURE__ */ React__default.createElement($ae1eeba8b9eafd08$export$5165eccb35aaadb5.Provider, {
    value: context
  }, children);
});
function $f1ab8c75478c6f73$export$cf75428e0b9ed1ea({ children }) {
  let context = useMemo(() => ({
    register: () => {
    }
  }), []);
  return /* @__PURE__ */ React__default.createElement($ae1eeba8b9eafd08$export$5165eccb35aaadb5.Provider, {
    value: context
  }, children);
}
function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
  let { ref, onInteractOutside, isDisabled, onInteractOutsideStart } = props;
  let stateRef = useRef({
    isPointerDown: false,
    ignoreEmulatedMouseEvents: false
  });
  let onPointerDown = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
    if (onInteractOutside && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) {
      if (onInteractOutsideStart) onInteractOutsideStart(e);
      stateRef.current.isPointerDown = true;
    }
  });
  let triggerInteractOutside = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
    if (onInteractOutside) onInteractOutside(e);
  });
  useEffect(() => {
    let state = stateRef.current;
    if (isDisabled) return;
    const element = ref.current;
    const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
    if (typeof PointerEvent !== "undefined") {
      let onClick = (e) => {
        if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);
        state.isPointerDown = false;
      };
      documentObject.addEventListener("pointerdown", onPointerDown, true);
      documentObject.addEventListener("click", onClick, true);
      return () => {
        documentObject.removeEventListener("pointerdown", onPointerDown, true);
        documentObject.removeEventListener("click", onClick, true);
      };
    } else if (process.env.NODE_ENV === "test") {
      let onMouseUp = (e) => {
        if (state.ignoreEmulatedMouseEvents) state.ignoreEmulatedMouseEvents = false;
        else if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);
        state.isPointerDown = false;
      };
      let onTouchEnd = (e) => {
        state.ignoreEmulatedMouseEvents = true;
        if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);
        state.isPointerDown = false;
      };
      documentObject.addEventListener("mousedown", onPointerDown, true);
      documentObject.addEventListener("mouseup", onMouseUp, true);
      documentObject.addEventListener("touchstart", onPointerDown, true);
      documentObject.addEventListener("touchend", onTouchEnd, true);
      return () => {
        documentObject.removeEventListener("mousedown", onPointerDown, true);
        documentObject.removeEventListener("mouseup", onMouseUp, true);
        documentObject.removeEventListener("touchstart", onPointerDown, true);
        documentObject.removeEventListener("touchend", onTouchEnd, true);
      };
    }
  }, [
    ref,
    isDisabled,
    onPointerDown,
    triggerInteractOutside
  ]);
}
function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
  if (event.button > 0) return false;
  if (event.target) {
    const ownerDocument = event.target.ownerDocument;
    if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;
    if (event.target.closest("[data-react-aria-top-layer]")) return false;
  }
  if (!ref.current) return false;
  return !event.composedPath().includes(ref.current);
}
const $a11501f3d1d39e6c$var$visibleOverlays = [];
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
  let { onClose, shouldCloseOnBlur, isOpen, isDismissable = false, isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside } = props;
  useEffect(() => {
    if (isOpen && !$a11501f3d1d39e6c$var$visibleOverlays.includes(ref)) {
      $a11501f3d1d39e6c$var$visibleOverlays.push(ref);
      return () => {
        let index = $a11501f3d1d39e6c$var$visibleOverlays.indexOf(ref);
        if (index >= 0) $a11501f3d1d39e6c$var$visibleOverlays.splice(index, 1);
      };
    }
  }, [
    isOpen,
    ref
  ]);
  let onHide = () => {
    if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref && onClose) onClose();
  };
  let onInteractOutsideStart = (e) => {
    if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
      if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
        e.stopPropagation();
        e.preventDefault();
      }
    }
  };
  let onInteractOutside = (e) => {
    if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
      if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
        e.stopPropagation();
        e.preventDefault();
      }
      onHide();
    }
  };
  let onKeyDown = (e) => {
    if (e.key === "Escape" && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {
      e.stopPropagation();
      e.preventDefault();
      onHide();
    }
  };
  $e0b6e0b68ec7f50f$export$872b660ac5a1ff98({
    ref,
    onInteractOutside: isDismissable && isOpen ? onInteractOutside : void 0,
    onInteractOutsideStart
  });
  let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
    isDisabled: !shouldCloseOnBlur,
    onBlurWithin: (e) => {
      if (!e.relatedTarget || $9bf71ea28793e738$export$1258395f99bf9cbf(e.relatedTarget)) return;
      if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose === null || onClose === void 0 ? void 0 : onClose();
    }
  });
  let onPointerDownUnderlay = (e) => {
    if (e.target === e.currentTarget) e.preventDefault();
  };
  return {
    overlayProps: {
      onKeyDown,
      ...focusWithinProps
    },
    underlayProps: {
      onPointerDown: onPointerDownUnderlay
    }
  };
}
function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
  let { type } = props;
  let { isOpen } = state;
  useEffect(() => {
    if (ref && ref.current) $dd149f63282afbbf$export$f6211563215e3b37.set(ref.current, state.close);
  });
  let ariaHasPopup = void 0;
  if (type === "menu") ariaHasPopup = true;
  else if (type === "listbox") ariaHasPopup = "listbox";
  let overlayId = $bdb11010cef70236$export$f680877a34711e37();
  return {
    triggerProps: {
      "aria-haspopup": ariaHasPopup,
      "aria-expanded": isOpen,
      "aria-controls": isOpen ? overlayId : void 0,
      onPress: state.toggle
    },
    overlayProps: {
      id: overlayId
    }
  };
}
const $49c51c25361d4cd2$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
const $49c51c25361d4cd2$var$nonTextInputTypes = /* @__PURE__ */ new Set([
  "checkbox",
  "radio",
  "range",
  "color",
  "file",
  "image",
  "button",
  "submit",
  "reset"
]);
let $49c51c25361d4cd2$var$preventScrollCount = 0;
let $49c51c25361d4cd2$var$restore;
function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {}) {
  let { isDisabled } = options;
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
    if (isDisabled) return;
    $49c51c25361d4cd2$var$preventScrollCount++;
    if ($49c51c25361d4cd2$var$preventScrollCount === 1) {
      if ($c87311424ea30a05$export$fedb369cb70207f1()) $49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollMobileSafari();
      else $49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollStandard();
    }
    return () => {
      $49c51c25361d4cd2$var$preventScrollCount--;
      if ($49c51c25361d4cd2$var$preventScrollCount === 0) $49c51c25361d4cd2$var$restore();
    };
  }, [
    isDisabled
  ]);
}
function $49c51c25361d4cd2$var$preventScrollStandard() {
  let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
  return $ff5963eb1fccf552$export$e08e3b67e392101e(scrollbarWidth > 0 && // Use scrollbar-gutter when supported because it also works for fixed positioned elements.
  ("scrollbarGutter" in document.documentElement.style ? $49c51c25361d4cd2$var$setStyle(document.documentElement, "scrollbarGutter", "stable") : $49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${scrollbarWidth}px`)), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"));
}
function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
  let scrollable;
  let restoreScrollableStyles;
  let onTouchStart = (e) => {
    scrollable = $62d8ded9296f3872$export$cfa2225e87938781(e.target, true);
    if (scrollable === document.documentElement && scrollable === document.body) return;
    if (scrollable instanceof HTMLElement && window.getComputedStyle(scrollable).overscrollBehavior === "auto") restoreScrollableStyles = $49c51c25361d4cd2$var$setStyle(scrollable, "overscrollBehavior", "contain");
  };
  let onTouchMove = (e) => {
    if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
      e.preventDefault();
      return;
    }
    if (scrollable.scrollHeight === scrollable.clientHeight && scrollable.scrollWidth === scrollable.clientWidth) e.preventDefault();
  };
  let onTouchEnd = () => {
    if (restoreScrollableStyles) restoreScrollableStyles();
  };
  let onFocus = (e) => {
    let target = e.target;
    if ($49c51c25361d4cd2$var$willOpenKeyboard(target)) {
      setupStyles();
      target.style.transform = "translateY(-2000px)";
      requestAnimationFrame(() => {
        target.style.transform = "";
        if ($49c51c25361d4cd2$var$visualViewport) {
          if ($49c51c25361d4cd2$var$visualViewport.height < window.innerHeight)
            requestAnimationFrame(() => {
              $49c51c25361d4cd2$var$scrollIntoView(target);
            });
          else
            $49c51c25361d4cd2$var$visualViewport.addEventListener("resize", () => $49c51c25361d4cd2$var$scrollIntoView(target), {
              once: true
            });
        }
      });
    }
  };
  let restoreStyles = null;
  let setupStyles = () => {
    if (restoreStyles) return;
    let onWindowScroll = () => {
      window.scrollTo(0, 0);
    };
    let scrollX = window.pageXOffset;
    let scrollY = window.pageYOffset;
    restoreStyles = $ff5963eb1fccf552$export$e08e3b67e392101e($49c51c25361d4cd2$var$addEvent(window, "scroll", onWindowScroll), $49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"), $49c51c25361d4cd2$var$setStyle(document.body, "marginTop", `-${scrollY}px`), () => {
      window.scrollTo(scrollX, scrollY);
    });
    window.scrollTo(0, 0);
  };
  let removeEvents = $ff5963eb1fccf552$export$e08e3b67e392101e($49c51c25361d4cd2$var$addEvent(document, "touchstart", onTouchStart, {
    passive: false,
    capture: true
  }), $49c51c25361d4cd2$var$addEvent(document, "touchmove", onTouchMove, {
    passive: false,
    capture: true
  }), $49c51c25361d4cd2$var$addEvent(document, "touchend", onTouchEnd, {
    passive: false,
    capture: true
  }), $49c51c25361d4cd2$var$addEvent(document, "focus", onFocus, true));
  return () => {
    restoreScrollableStyles === null || restoreScrollableStyles === void 0 ? void 0 : restoreScrollableStyles();
    restoreStyles === null || restoreStyles === void 0 ? void 0 : restoreStyles();
    removeEvents();
  };
}
function $49c51c25361d4cd2$var$setStyle(element, style, value) {
  let cur = element.style[style];
  element.style[style] = value;
  return () => {
    element.style[style] = cur;
  };
}
function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
  target.addEventListener(event, handler, options);
  return () => {
    target.removeEventListener(event, handler, options);
  };
}
function $49c51c25361d4cd2$var$scrollIntoView(target) {
  let root = document.scrollingElement || document.documentElement;
  let nextTarget = target;
  while (nextTarget && nextTarget !== root) {
    let scrollable = $62d8ded9296f3872$export$cfa2225e87938781(nextTarget);
    if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== nextTarget) {
      let scrollableTop = scrollable.getBoundingClientRect().top;
      let targetTop = nextTarget.getBoundingClientRect().top;
      if (targetTop > scrollableTop + nextTarget.clientHeight) scrollable.scrollTop += targetTop - scrollableTop;
    }
    nextTarget = scrollable.parentElement;
  }
}
function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
  return target instanceof HTMLInputElement && !$49c51c25361d4cd2$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
}
var $773d5888b972f1cf$exports = {};
$773d5888b972f1cf$exports = {
  "dismiss": `تجاهل`
};
var $d11f19852b941573$exports = {};
$d11f19852b941573$exports = {
  "dismiss": `Отхвърляне`
};
var $b983974c2ee1efb3$exports = {};
$b983974c2ee1efb3$exports = {
  "dismiss": `Odstranit`
};
var $5809cc9d4e92de73$exports = {};
$5809cc9d4e92de73$exports = {
  "dismiss": `Luk`
};
var $c68c2e4fc74398d1$exports = {};
$c68c2e4fc74398d1$exports = {
  "dismiss": `Schließen`
};
var $0898b4c153db2b77$exports = {};
$0898b4c153db2b77$exports = {
  "dismiss": `Απόρριψη`
};
var $6d74810286a15183$exports = {};
$6d74810286a15183$exports = {
  "dismiss": `Dismiss`
};
var $309d73dc65f78055$exports = {};
$309d73dc65f78055$exports = {
  "dismiss": `Descartar`
};
var $44ad94f7205cf593$exports = {};
$44ad94f7205cf593$exports = {
  "dismiss": `Lõpeta`
};
var $7c28f5687f0779a9$exports = {};
$7c28f5687f0779a9$exports = {
  "dismiss": `Hylkää`
};
var $e6d75df4b68bd73a$exports = {};
$e6d75df4b68bd73a$exports = {
  "dismiss": `Rejeter`
};
var $87505c9dab186d0f$exports = {};
$87505c9dab186d0f$exports = {
  "dismiss": `התעלם`
};
var $553439c3ffb3e492$exports = {};
$553439c3ffb3e492$exports = {
  "dismiss": `Odbaci`
};
var $74cf411061b983a2$exports = {};
$74cf411061b983a2$exports = {
  "dismiss": `Elutasítás`
};
var $e933f298574dc435$exports = {};
$e933f298574dc435$exports = {
  "dismiss": `Ignora`
};
var $ac91fc9fe02f71f6$exports = {};
$ac91fc9fe02f71f6$exports = {
  "dismiss": `閉じる`
};
var $52b96f86422025af$exports = {};
$52b96f86422025af$exports = {
  "dismiss": `무시`
};
var $c0d724c3e51dafa6$exports = {};
$c0d724c3e51dafa6$exports = {
  "dismiss": `Atmesti`
};
var $c92899672a3fe72e$exports = {};
$c92899672a3fe72e$exports = {
  "dismiss": `Nerādīt`
};
var $9f576b39d8e7a9d6$exports = {};
$9f576b39d8e7a9d6$exports = {
  "dismiss": `Lukk`
};
var $9d025808aeec81a7$exports = {};
$9d025808aeec81a7$exports = {
  "dismiss": `Negeren`
};
var $fce709921e2c0fa6$exports = {};
$fce709921e2c0fa6$exports = {
  "dismiss": `Zignoruj`
};
var $2599cf0c4ab37f59$exports = {};
$2599cf0c4ab37f59$exports = {
  "dismiss": `Descartar`
};
var $3c220ae7ef8a35fd$exports = {};
$3c220ae7ef8a35fd$exports = {
  "dismiss": `Dispensar`
};
var $93562b5094072f54$exports = {};
$93562b5094072f54$exports = {
  "dismiss": `Revocare`
};
var $cd9e2abd0d06c7b4$exports = {};
$cd9e2abd0d06c7b4$exports = {
  "dismiss": `Пропустить`
};
var $45375701f409adf1$exports = {};
$45375701f409adf1$exports = {
  "dismiss": `Zrušiť`
};
var $27fab53a576de9dd$exports = {};
$27fab53a576de9dd$exports = {
  "dismiss": `Opusti`
};
var $4438748d9952e7c7$exports = {};
$4438748d9952e7c7$exports = {
  "dismiss": `Odbaci`
};
var $0936d7347ef4da4c$exports = {};
$0936d7347ef4da4c$exports = {
  "dismiss": `Avvisa`
};
var $29700c92185d38f8$exports = {};
$29700c92185d38f8$exports = {
  "dismiss": `Kapat`
};
var $662ccaf2be4c25b3$exports = {};
$662ccaf2be4c25b3$exports = {
  "dismiss": `Скасувати`
};
var $d80a27deda7cdb3c$exports = {};
$d80a27deda7cdb3c$exports = {
  "dismiss": `取消`
};
var $2b2734393847c884$exports = {};
$2b2734393847c884$exports = {
  "dismiss": `關閉`
};
var $a2f21f5f14f60553$exports = {};
$a2f21f5f14f60553$exports = {
  "ar-AE": $773d5888b972f1cf$exports,
  "bg-BG": $d11f19852b941573$exports,
  "cs-CZ": $b983974c2ee1efb3$exports,
  "da-DK": $5809cc9d4e92de73$exports,
  "de-DE": $c68c2e4fc74398d1$exports,
  "el-GR": $0898b4c153db2b77$exports,
  "en-US": $6d74810286a15183$exports,
  "es-ES": $309d73dc65f78055$exports,
  "et-EE": $44ad94f7205cf593$exports,
  "fi-FI": $7c28f5687f0779a9$exports,
  "fr-FR": $e6d75df4b68bd73a$exports,
  "he-IL": $87505c9dab186d0f$exports,
  "hr-HR": $553439c3ffb3e492$exports,
  "hu-HU": $74cf411061b983a2$exports,
  "it-IT": $e933f298574dc435$exports,
  "ja-JP": $ac91fc9fe02f71f6$exports,
  "ko-KR": $52b96f86422025af$exports,
  "lt-LT": $c0d724c3e51dafa6$exports,
  "lv-LV": $c92899672a3fe72e$exports,
  "nb-NO": $9f576b39d8e7a9d6$exports,
  "nl-NL": $9d025808aeec81a7$exports,
  "pl-PL": $fce709921e2c0fa6$exports,
  "pt-BR": $2599cf0c4ab37f59$exports,
  "pt-PT": $3c220ae7ef8a35fd$exports,
  "ro-RO": $93562b5094072f54$exports,
  "ru-RU": $cd9e2abd0d06c7b4$exports,
  "sk-SK": $45375701f409adf1$exports,
  "sl-SI": $27fab53a576de9dd$exports,
  "sr-SP": $4438748d9952e7c7$exports,
  "sv-SE": $0936d7347ef4da4c$exports,
  "tr-TR": $29700c92185d38f8$exports,
  "uk-UA": $662ccaf2be4c25b3$exports,
  "zh-CN": $d80a27deda7cdb3c$exports,
  "zh-TW": $2b2734393847c884$exports
};
function $parcel$interopDefault$1(a) {
  return a && a.__esModule ? a.default : a;
}
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
  let { onDismiss, ...otherProps } = props;
  let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault$1($a2f21f5f14f60553$exports), "@react-aria/overlays");
  let labels = $313b98861ee5dd6c$export$d6875122194c7b44(otherProps, stringFormatter.format("dismiss"));
  let onClick = () => {
    if (onDismiss) onDismiss();
  };
  return /* @__PURE__ */ React__default.createElement($5c3e21d68f1c4674$export$439d29a4e110a164, null, /* @__PURE__ */ React__default.createElement("button", {
    ...labels,
    tabIndex: -1,
    onClick,
    style: {
      width: 1,
      height: 1
    }
  }));
}
const $5e3802645cc19319$var$supportsInert = typeof HTMLElement !== "undefined" && "inert" in HTMLElement.prototype;
let $5e3802645cc19319$var$refCountMap = /* @__PURE__ */ new WeakMap();
let $5e3802645cc19319$var$observerStack = [];
function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
  let windowObj = $431fbd86ca7dc216$export$f21a1ffae260145a(targets === null || targets === void 0 ? void 0 : targets[0]);
  let opts = options instanceof windowObj.Element ? {
    root: options
  } : options;
  var _opts_root;
  let root = (_opts_root = opts === null || opts === void 0 ? void 0 : opts.root) !== null && _opts_root !== void 0 ? _opts_root : document.body;
  let shouldUseInert = (opts === null || opts === void 0 ? void 0 : opts.shouldUseInert) && $5e3802645cc19319$var$supportsInert;
  let visibleNodes = new Set(targets);
  let hiddenNodes = /* @__PURE__ */ new Set();
  let getHidden = (element) => {
    return shouldUseInert && element instanceof windowObj.HTMLElement ? element.inert : element.getAttribute("aria-hidden") === "true";
  };
  let setHidden = (element, hidden) => {
    if (shouldUseInert && element instanceof windowObj.HTMLElement) element.inert = hidden;
    else if (hidden) element.setAttribute("aria-hidden", "true");
    else {
      element.removeAttribute("aria-hidden");
      if (element instanceof windowObj.HTMLElement)
        element.inert = false;
    }
  };
  let walk = (root2) => {
    for (let element of root2.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) visibleNodes.add(element);
    let acceptNode = (node) => {
      if (hiddenNodes.has(node) || visibleNodes.has(node) || node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
      for (let target of visibleNodes) {
        if (node.contains(target)) return NodeFilter.FILTER_SKIP;
      }
      return NodeFilter.FILTER_ACCEPT;
    };
    let walker = document.createTreeWalker(root2, NodeFilter.SHOW_ELEMENT, {
      acceptNode
    });
    let acceptRoot = acceptNode(root2);
    if (acceptRoot === NodeFilter.FILTER_ACCEPT) hide(root2);
    if (acceptRoot !== NodeFilter.FILTER_REJECT) {
      let node = walker.nextNode();
      while (node != null) {
        hide(node);
        node = walker.nextNode();
      }
    }
  };
  let hide = (node) => {
    var _refCountMap_get;
    let refCount = (_refCountMap_get = $5e3802645cc19319$var$refCountMap.get(node)) !== null && _refCountMap_get !== void 0 ? _refCountMap_get : 0;
    if (getHidden(node) && refCount === 0) return;
    if (refCount === 0) setHidden(node, true);
    hiddenNodes.add(node);
    $5e3802645cc19319$var$refCountMap.set(node, refCount + 1);
  };
  if ($5e3802645cc19319$var$observerStack.length) $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].disconnect();
  walk(root);
  let observer = new MutationObserver((changes) => {
    for (let change of changes) {
      if (change.type !== "childList") continue;
      if (![
        ...visibleNodes,
        ...hiddenNodes
      ].some((node) => node.contains(change.target))) for (let node of change.addedNodes) {
        if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === "true" || node.dataset.reactAriaTopLayer === "true")) visibleNodes.add(node);
        else if (node instanceof Element) walk(node);
      }
    }
  });
  observer.observe(root, {
    childList: true,
    subtree: true
  });
  let observerWrapper = {
    visibleNodes,
    hiddenNodes,
    observe() {
      observer.observe(root, {
        childList: true,
        subtree: true
      });
    },
    disconnect() {
      observer.disconnect();
    }
  };
  $5e3802645cc19319$var$observerStack.push(observerWrapper);
  return () => {
    observer.disconnect();
    for (let node of hiddenNodes) {
      let count = $5e3802645cc19319$var$refCountMap.get(node);
      if (count == null) continue;
      if (count === 1) {
        setHidden(node, false);
        $5e3802645cc19319$var$refCountMap.delete(node);
      } else $5e3802645cc19319$var$refCountMap.set(node, count - 1);
    }
    if (observerWrapper === $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1]) {
      $5e3802645cc19319$var$observerStack.pop();
      if ($5e3802645cc19319$var$observerStack.length) $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].observe();
    } else $5e3802645cc19319$var$observerStack.splice($5e3802645cc19319$var$observerStack.indexOf(observerWrapper), 1);
  };
}
function $5e3802645cc19319$export$1020fa7f77e17884(element) {
  let observer = $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1];
  if (observer && !observer.visibleNodes.has(element)) {
    observer.visibleNodes.add(element);
    return () => {
      observer.visibleNodes.delete(element);
    };
  }
}
function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
  let { triggerRef, popoverRef, groupRef, isNonModal, isKeyboardDismissDisabled, shouldCloseOnInteractOutside, ...otherProps } = props;
  let isSubmenu = otherProps["trigger"] === "SubmenuTrigger";
  let { overlayProps, underlayProps } = $a11501f3d1d39e6c$export$ea8f71083e90600f({
    isOpen: state.isOpen,
    onClose: state.close,
    shouldCloseOnBlur: true,
    isDismissable: !isNonModal || isSubmenu,
    isKeyboardDismissDisabled,
    shouldCloseOnInteractOutside
  }, groupRef !== null && groupRef !== void 0 ? groupRef : popoverRef);
  let { overlayProps: positionProps, arrowProps, placement, triggerAnchorPoint: origin } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
    ...otherProps,
    targetRef: triggerRef,
    overlayRef: popoverRef,
    isOpen: state.isOpen,
    onClose: isNonModal && !isSubmenu ? state.close : null
  });
  $49c51c25361d4cd2$export$ee0f7cc6afcd1c18({
    isDisabled: isNonModal || !state.isOpen
  });
  useEffect(() => {
    if (state.isOpen && popoverRef.current) {
      var _groupRef_current, _groupRef_current1;
      if (isNonModal) return $5e3802645cc19319$export$1020fa7f77e17884((_groupRef_current = groupRef === null || groupRef === void 0 ? void 0 : groupRef.current) !== null && _groupRef_current !== void 0 ? _groupRef_current : popoverRef.current);
      else return $5e3802645cc19319$export$1c3ebcada18427bf([
        (_groupRef_current1 = groupRef === null || groupRef === void 0 ? void 0 : groupRef.current) !== null && _groupRef_current1 !== void 0 ? _groupRef_current1 : popoverRef.current
      ], {
        shouldUseInert: true
      });
    }
  }, [
    isNonModal,
    state.isOpen,
    popoverRef,
    groupRef
  ]);
  return {
    popoverProps: $3ef42575df84b30b$export$9d1611c77c2fe928(overlayProps, positionProps),
    arrowProps,
    underlayProps,
    placement,
    triggerAnchorPoint: origin
  };
}
const $337b884510726a0d$export$a2200b96afd16271 = /* @__PURE__ */ React__default.createContext(null);
function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
  let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
  let { portalContainer = isSSR ? null : document.body, isExiting } = props;
  let [contain, setContain] = useState(false);
  let contextValue = useMemo(() => ({
    contain,
    setContain
  }), [
    contain,
    setContain
  ]);
  let { getContainer } = $96b38030c423d352$export$9fc1347d4195ccb3();
  if (!props.portalContainer && getContainer) portalContainer = getContainer();
  if (!portalContainer) return null;
  let contents = props.children;
  if (!props.disableFocusManagement) contents = /* @__PURE__ */ React__default.createElement($9bf71ea28793e738$export$20e40289641fbbb6, {
    restoreFocus: true,
    contain: (props.shouldContainFocus || contain) && !isExiting
  }, contents);
  contents = /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
    value: contextValue
  }, /* @__PURE__ */ React__default.createElement($f1ab8c75478c6f73$export$cf75428e0b9ed1ea, null, contents));
  return /* @__PURE__ */ $dbSRa$reactdom.createPortal(contents, portalContainer);
}
function $337b884510726a0d$export$14c98a7594375490() {
  let ctx = useContext($337b884510726a0d$export$a2200b96afd16271);
  let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
    setContain === null || setContain === void 0 ? void 0 : setContain(true);
  }, [
    setContain
  ]);
}
var $c0398ad35c3639b7$exports = {};
$c0398ad35c3639b7$exports = {
  "longPressMessage": `اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`
};
var $7af657c4165927c3$exports = {};
$7af657c4165927c3$exports = {
  "longPressMessage": `Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто`
};
var $d95d4da6d531ab81$exports = {};
$d95d4da6d531ab81$exports = {
  "longPressMessage": `Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku`
};
var $24ebda9c775dca17$exports = {};
$24ebda9c775dca17$exports = {
  "longPressMessage": `Langt tryk eller tryk på Alt + pil ned for at åbne menuen`
};
var $743e0dfca6cab1e9$exports = {};
$743e0dfca6cab1e9$exports = {
  "longPressMessage": `Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen`
};
var $a2f41026e05f1c84$exports = {};
$a2f41026e05f1c84$exports = {
  "longPressMessage": `Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού`
};
var $43b800e97c901737$exports = {};
$43b800e97c901737$exports = {
  "longPressMessage": `Long press or press Alt + ArrowDown to open menu`
};
var $442f5f6ac211e29f$exports = {};
$442f5f6ac211e29f$exports = {
  "longPressMessage": `Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú`
};
var $dff280acfeb2d8ac$exports = {};
$dff280acfeb2d8ac$exports = {
  "longPressMessage": `Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool`
};
var $51608325613944d7$exports = {};
$51608325613944d7$exports = {
  "longPressMessage": `Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli`
};
var $c4a1b1eabeaa87be$exports = {};
$c4a1b1eabeaa87be$exports = {
  "longPressMessage": `Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu.`
};
var $8c74815cdee18d1b$exports = {};
$8c74815cdee18d1b$exports = {
  "longPressMessage": `לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט`
};
var $fd0e9ef6a7fe0ec9$exports = {};
$fd0e9ef6a7fe0ec9$exports = {
  "longPressMessage": `Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika`
};
var $a89a74a39eba465a$exports = {};
$a89a74a39eba465a$exports = {
  "longPressMessage": `Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához`
};
var $edc7c66594a0ae8a$exports = {};
$edc7c66594a0ae8a$exports = {
  "longPressMessage": `Premere a lungo o premere Alt + Freccia giù per aprire il menu`
};
var $f1ab51510712db52$exports = {};
$f1ab51510712db52$exports = {
  "longPressMessage": `長押しまたは Alt+下矢印キーでメニューを開く`
};
var $f9b672d9b82fa3d6$exports = {};
$f9b672d9b82fa3d6$exports = {
  "longPressMessage": `길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기`
};
var $a385f3910feda499$exports = {};
$a385f3910feda499$exports = {
  "longPressMessage": `Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.`
};
var $4f1bde932c441789$exports = {};
$4f1bde932c441789$exports = {
  "longPressMessage": `Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa`
};
var $914a51a8a594d5be$exports = {};
$914a51a8a594d5be$exports = {
  "longPressMessage": `Langt trykk eller trykk Alt + PilNed for å åpne menyen`
};
var $89aaf803103bb500$exports = {};
$89aaf803103bb500$exports = {
  "longPressMessage": `Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen`
};
var $c685891476dbaaca$exports = {};
$c685891476dbaaca$exports = {
  "longPressMessage": `Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu`
};
var $885879b9b10c2959$exports = {};
$885879b9b10c2959$exports = {
  "longPressMessage": `Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu`
};
var $6b39616688a51692$exports = {};
$6b39616688a51692$exports = {
  "longPressMessage": `Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu`
};
var $f26362aed63f47e2$exports = {};
$f26362aed63f47e2$exports = {
  "longPressMessage": `Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul`
};
var $06cbade644558bf0$exports = {};
$06cbade644558bf0$exports = {
  "longPressMessage": `Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню`
};
var $0a391ff68f9d59b1$exports = {};
$0a391ff68f9d59b1$exports = {
  "longPressMessage": `Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol`
};
var $8193cf0e649c7928$exports = {};
$8193cf0e649c7928$exports = {
  "longPressMessage": `Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol`
};
var $f398debcce5a5c55$exports = {};
$f398debcce5a5c55$exports = {
  "longPressMessage": `Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni`
};
var $9e9fef000aa4c013$exports = {};
$9e9fef000aa4c013$exports = {
  "longPressMessage": `Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn`
};
var $c016c8183bbe3d68$exports = {};
$c016c8183bbe3d68$exports = {
  "longPressMessage": `Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın`
};
var $ca4f6c8462244e62$exports = {};
$ca4f6c8462244e62$exports = {
  "longPressMessage": `Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню`
};
var $2d9960c02ccac927$exports = {};
$2d9960c02ccac927$exports = {
  "longPressMessage": `长按或按 Alt + 向下方向键以打开菜单`
};
var $f1b682a4c8c5631c$exports = {};
$f1b682a4c8c5631c$exports = {
  "longPressMessage": `長按或按 Alt+向下鍵以開啟功能表`
};
var $2cbb7ca666678a14$exports = {};
$2cbb7ca666678a14$exports = {
  "ar-AE": $c0398ad35c3639b7$exports,
  "bg-BG": $7af657c4165927c3$exports,
  "cs-CZ": $d95d4da6d531ab81$exports,
  "da-DK": $24ebda9c775dca17$exports,
  "de-DE": $743e0dfca6cab1e9$exports,
  "el-GR": $a2f41026e05f1c84$exports,
  "en-US": $43b800e97c901737$exports,
  "es-ES": $442f5f6ac211e29f$exports,
  "et-EE": $dff280acfeb2d8ac$exports,
  "fi-FI": $51608325613944d7$exports,
  "fr-FR": $c4a1b1eabeaa87be$exports,
  "he-IL": $8c74815cdee18d1b$exports,
  "hr-HR": $fd0e9ef6a7fe0ec9$exports,
  "hu-HU": $a89a74a39eba465a$exports,
  "it-IT": $edc7c66594a0ae8a$exports,
  "ja-JP": $f1ab51510712db52$exports,
  "ko-KR": $f9b672d9b82fa3d6$exports,
  "lt-LT": $a385f3910feda499$exports,
  "lv-LV": $4f1bde932c441789$exports,
  "nb-NO": $914a51a8a594d5be$exports,
  "nl-NL": $89aaf803103bb500$exports,
  "pl-PL": $c685891476dbaaca$exports,
  "pt-BR": $885879b9b10c2959$exports,
  "pt-PT": $6b39616688a51692$exports,
  "ro-RO": $f26362aed63f47e2$exports,
  "ru-RU": $06cbade644558bf0$exports,
  "sk-SK": $0a391ff68f9d59b1$exports,
  "sl-SI": $8193cf0e649c7928$exports,
  "sr-SP": $f398debcce5a5c55$exports,
  "sv-SE": $9e9fef000aa4c013$exports,
  "tr-TR": $c016c8183bbe3d68$exports,
  "uk-UA": $ca4f6c8462244e62$exports,
  "zh-CN": $2d9960c02ccac927$exports,
  "zh-TW": $f1b682a4c8c5631c$exports
};
function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
  let { type = "menu", isDisabled, trigger = "press" } = props;
  let menuTriggerId = $bdb11010cef70236$export$f680877a34711e37();
  let { triggerProps, overlayProps } = $628037886ba31236$export$f9d5c8beee7d008d({
    type
  }, state, ref);
  let onKeyDown = (e) => {
    if (isDisabled) return;
    if (trigger === "longPress" && !e.altKey) return;
    if (ref && ref.current) switch (e.key) {
      case "Enter":
      case " ":
        if (trigger === "longPress" || e.isDefaultPrevented()) return;
      // fallthrough
      case "ArrowDown":
        if (!("continuePropagation" in e)) e.stopPropagation();
        e.preventDefault();
        state.toggle("first");
        break;
      case "ArrowUp":
        if (!("continuePropagation" in e)) e.stopPropagation();
        e.preventDefault();
        state.toggle("last");
        break;
      default:
        if ("continuePropagation" in e) e.continuePropagation();
    }
  };
  let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($2cbb7ca666678a14$exports), "@react-aria/menu");
  let { longPressProps } = $8a26561d2877236e$export$c24ed0104d07eab9({
    isDisabled: isDisabled || trigger !== "longPress",
    accessibilityDescription: stringFormatter.format("longPressMessage"),
    onLongPressStart() {
      state.close();
    },
    onLongPress() {
      state.open("first");
    }
  });
  let pressProps = {
    preventFocusOnPress: true,
    onPressStart(e) {
      if (e.pointerType !== "touch" && e.pointerType !== "keyboard" && !isDisabled) {
        $7215afc6de606d6b$export$de79e2c695e052f3(e.target);
        state.open(e.pointerType === "virtual" ? "first" : null);
      }
    },
    onPress(e) {
      if (e.pointerType === "touch" && !isDisabled) {
        $7215afc6de606d6b$export$de79e2c695e052f3(e.target);
        state.toggle();
      }
    }
  };
  delete triggerProps.onPress;
  return {
    // @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: {
      ...triggerProps,
      ...trigger === "press" ? pressProps : longPressProps,
      id: menuTriggerId,
      onKeyDown
    },
    menuProps: {
      ...overlayProps,
      "aria-labelledby": menuTriggerId,
      autoFocus: state.focusStrategy || true,
      onClose: state.close
    }
  };
}
const $fc79756100351201$export$6f49b4016bfc8d56 = /* @__PURE__ */ new WeakMap();
function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
  let { shouldFocusWrap = true, onKeyDown, onKeyUp, ...otherProps } = props;
  if (!props["aria-label"] && !props["aria-labelledby"] && process.env.NODE_ENV !== "production") console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
  let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    labelable: true
  });
  let { listProps } = $982254629710d113$export$b95089534ab7c1fd({
    ...otherProps,
    ref,
    selectionManager: state.selectionManager,
    collection: state.collection,
    disabledKeys: state.disabledKeys,
    shouldFocusWrap,
    linkBehavior: "override"
  });
  $fc79756100351201$export$6f49b4016bfc8d56.set(state, {
    onClose: props.onClose,
    onAction: props.onAction,
    shouldUseVirtualFocus: props.shouldUseVirtualFocus
  });
  return {
    menuProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, {
      onKeyDown,
      onKeyUp
    }, {
      role: "menu",
      ...listProps,
      onKeyDown: (e) => {
        var _listProps_onKeyDown;
        if (e.key !== "Escape" || props.shouldUseVirtualFocus) (_listProps_onKeyDown = listProps.onKeyDown) === null || _listProps_onKeyDown === void 0 ? void 0 : _listProps_onKeyDown.call(listProps, e);
      }
    })
  };
}
function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
  let { id, key, closeOnSelect, isVirtualized, "aria-haspopup": hasPopup, onPressStart, onPressUp: pressUpProp, onPress, onPressChange: pressChangeProp, onPressEnd, onClick: onClickProp, onHoverStart: hoverStartProp, onHoverChange, onHoverEnd, onKeyDown, onKeyUp, onFocus, onFocusChange, onBlur, selectionManager = state.selectionManager } = props;
  let isTrigger = !!hasPopup;
  let isTriggerExpanded = isTrigger && props["aria-expanded"] === "true";
  var _props_isDisabled;
  let isDisabled = (_props_isDisabled = props.isDisabled) !== null && _props_isDisabled !== void 0 ? _props_isDisabled : selectionManager.isDisabled(key);
  var _props_isSelected;
  let isSelected = (_props_isSelected = props.isSelected) !== null && _props_isSelected !== void 0 ? _props_isSelected : selectionManager.isSelected(key);
  let data = $fc79756100351201$export$6f49b4016bfc8d56.get(state);
  let item = state.collection.getItem(key);
  let onClose = props.onClose || data.onClose;
  let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
  let performAction = () => {
    var _item_props;
    if (isTrigger) return;
    if (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.onAction) item.props.onAction();
    else if (props.onAction) props.onAction(key);
    if (data.onAction) {
      let onAction = data.onAction;
      onAction(key);
    }
  };
  let role = "menuitem";
  if (!isTrigger) {
    if (selectionManager.selectionMode === "single") role = "menuitemradio";
    else if (selectionManager.selectionMode === "multiple") role = "menuitemcheckbox";
  }
  let labelId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
  let descriptionId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
  let keyboardId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
  let ariaProps = {
    id,
    "aria-disabled": isDisabled || void 0,
    role,
    "aria-label": props["aria-label"],
    "aria-labelledby": labelId,
    "aria-describedby": [
      descriptionId,
      keyboardId
    ].filter(Boolean).join(" ") || void 0,
    "aria-controls": props["aria-controls"],
    "aria-haspopup": hasPopup,
    "aria-expanded": props["aria-expanded"]
  };
  if (selectionManager.selectionMode !== "none" && !isTrigger) ariaProps["aria-checked"] = isSelected;
  if (isVirtualized) {
    ariaProps["aria-posinset"] = item === null || item === void 0 ? void 0 : item.index;
    ariaProps["aria-setsize"] = $453cc9f0df89c0a5$export$77d5aafae4e095b2(state.collection);
  }
  let isPressedRef = useRef(false);
  let onPressChange = (isPressed2) => {
    pressChangeProp === null || pressChangeProp === void 0 ? void 0 : pressChangeProp(isPressed2);
    isPressedRef.current = isPressed2;
  };
  let interaction = useRef(null);
  let onPressUp = (e) => {
    if (e.pointerType !== "keyboard") interaction.current = {
      pointerType: e.pointerType
    };
    if (e.pointerType === "mouse") {
      if (!isPressedRef.current) e.target.click();
    }
    pressUpProp === null || pressUpProp === void 0 ? void 0 : pressUpProp(e);
  };
  let onClick = (e) => {
    var _interaction_current, _interaction_current1;
    onClickProp === null || onClickProp === void 0 ? void 0 : onClickProp(e);
    performAction();
    $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, item.props.href, item === null || item === void 0 ? void 0 : item.props.routerOptions);
    let shouldClose = ((_interaction_current = interaction.current) === null || _interaction_current === void 0 ? void 0 : _interaction_current.pointerType) === "keyboard" ? ((_interaction_current1 = interaction.current) === null || _interaction_current1 === void 0 ? void 0 : _interaction_current1.key) === "Enter" || selectionManager.selectionMode === "none" || selectionManager.isLink(key) : selectionManager.selectionMode !== "multiple" || selectionManager.isLink(key);
    shouldClose = closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : shouldClose;
    if (onClose && !isTrigger && shouldClose) onClose();
    interaction.current = null;
  };
  let { itemProps, isFocused } = $880e95eb8b93ba9a$export$ecf600387e221c37({
    id,
    selectionManager,
    key,
    ref,
    shouldSelectOnPressUp: true,
    allowsDifferentPressOrigin: true,
    // 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: data.shouldUseVirtualFocus
  });
  let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21({
    onPressStart,
    onPress,
    onPressUp,
    onPressChange,
    onPressEnd,
    isDisabled
  });
  let { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled,
    onHoverStart(e) {
      if (!$507fabe10e71c6fb$export$b9b3dfddab17db27() && !(isTriggerExpanded && hasPopup)) {
        selectionManager.setFocused(true);
        selectionManager.setFocusedKey(key);
      }
      hoverStartProp === null || hoverStartProp === void 0 ? void 0 : hoverStartProp(e);
    },
    onHoverChange,
    onHoverEnd
  });
  let { keyboardProps } = $46d819fcbaf35654$export$8f71654801c2f7cd({
    onKeyDown: (e) => {
      if (e.repeat) {
        e.continuePropagation();
        return;
      }
      switch (e.key) {
        case " ":
          interaction.current = {
            pointerType: "keyboard",
            key: " "
          };
          e.target.click();
          break;
        case "Enter":
          interaction.current = {
            pointerType: "keyboard",
            key: "Enter"
          };
          if (e.target.tagName !== "A") e.target.click();
          break;
        default:
          if (!isTrigger) e.continuePropagation();
          onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
          break;
      }
    },
    onKeyUp
  });
  let { focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({
    onBlur,
    onFocus,
    onFocusChange
  });
  let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(item === null || item === void 0 ? void 0 : item.props);
  delete domProps.id;
  let linkProps = $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(item === null || item === void 0 ? void 0 : item.props);
  return {
    menuItemProps: {
      ...ariaProps,
      ...$3ef42575df84b30b$export$9d1611c77c2fe928(
        domProps,
        linkProps,
        isTrigger ? {
          onFocus: itemProps.onFocus,
          "data-collection": itemProps["data-collection"],
          "data-key": itemProps["data-key"]
        } : itemProps,
        pressProps,
        hoverProps,
        keyboardProps,
        focusProps,
        // Prevent DOM focus from moving on mouse down when using virtual focus or this is a submenu/subdialog trigger.
        data.shouldUseVirtualFocus || isTrigger ? {
          onMouseDown: (e) => e.preventDefault()
        } : void 0,
        isDisabled ? void 0 : {
          onClick
        }
      ),
      // 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: itemProps.tabIndex != null && isTriggerExpanded && !data.shouldUseVirtualFocus ? -1 : itemProps.tabIndex
    },
    labelProps: {
      id: labelId
    },
    descriptionProps: {
      id: descriptionId
    },
    keyboardShortcutProps: {
      id: keyboardId
    },
    isFocused,
    isFocusVisible: isFocused && selectionManager.isFocused && $507fabe10e71c6fb$export$b9b3dfddab17db27() && !isTriggerExpanded,
    isSelected,
    isPressed,
    isDisabled
  };
}
function $3e5eb2498db5b506$export$73f7a44322579622(props) {
  let { heading, "aria-label": ariaLabel } = props;
  let headingId = $bdb11010cef70236$export$f680877a34711e37();
  return {
    itemProps: {
      role: "presentation"
    },
    headingProps: heading ? {
      // 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: headingId,
      role: "presentation"
    } : {},
    groupProps: {
      role: "group",
      "aria-label": ariaLabel,
      "aria-labelledby": heading ? headingId : void 0
    }
  };
}
const $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS = 2;
const $d275435c250248f8$var$THROTTLE_TIME = 50;
const $d275435c250248f8$var$TIMEOUT_TIME = 1e3;
const $d275435c250248f8$var$ANGLE_PADDING = Math.PI / 12;
function $d275435c250248f8$export$85ec83e04c95f50a(options) {
  let { menuRef, submenuRef, isOpen, isDisabled } = options;
  let prevPointerPos = useRef(void 0);
  let submenuRect = useRef(void 0);
  let lastProcessedTime = useRef(0);
  let timeout = useRef(void 0);
  let autoCloseTimeout = useRef(void 0);
  let submenuSide = useRef(void 0);
  let movementsTowardsSubmenuCount = useRef(2);
  let [preventPointerEvents, setPreventPointerEvents] = useState(false);
  let updateSubmenuRect = () => {
    if (submenuRef.current) {
      submenuRect.current = submenuRef.current.getBoundingClientRect();
      submenuSide.current = void 0;
    }
  };
  $9daab02d461809db$export$683480f191c0e3ea({
    ref: submenuRef,
    onResize: updateSubmenuRect
  });
  let reset = () => {
    setPreventPointerEvents(false);
    movementsTowardsSubmenuCount.current = $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS;
    prevPointerPos.current = void 0;
  };
  let modality = $507fabe10e71c6fb$export$98e20ec92f614cfe();
  let onPointerDown = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
    if (preventPointerEvents) e.preventDefault();
  });
  useEffect(() => {
    if (preventPointerEvents && menuRef.current) menuRef.current.style.pointerEvents = "none";
    else menuRef.current.style.pointerEvents = "";
  }, [
    menuRef,
    preventPointerEvents
  ]);
  useEffect(() => {
    let submenu = submenuRef.current;
    let menu = menuRef.current;
    if (isDisabled || !submenu || !isOpen || modality !== "pointer" || !menu) {
      reset();
      return;
    }
    submenuRect.current = submenu.getBoundingClientRect();
    let onPointerMove = (e) => {
      if (e.pointerType === "touch" || e.pointerType === "pen") return;
      let currentTime = Date.now();
      if (currentTime - lastProcessedTime.current < $d275435c250248f8$var$THROTTLE_TIME) return;
      clearTimeout(timeout.current);
      clearTimeout(autoCloseTimeout.current);
      let { clientX: mouseX, clientY: mouseY } = e;
      if (!prevPointerPos.current) {
        prevPointerPos.current = {
          x: mouseX,
          y: mouseY
        };
        return;
      }
      if (!submenuRect.current) return;
      if (!submenuSide.current) submenuSide.current = mouseX > submenuRect.current.right ? "left" : "right";
      if (mouseX < menu.getBoundingClientRect().left || mouseX > menu.getBoundingClientRect().right || mouseY < menu.getBoundingClientRect().top || mouseY > menu.getBoundingClientRect().bottom) {
        reset();
        return;
      }
      let prevMouseX = prevPointerPos.current.x;
      let prevMouseY = prevPointerPos.current.y;
      let toSubmenuX = submenuSide.current === "right" ? submenuRect.current.left - prevMouseX : prevMouseX - submenuRect.current.right;
      let angleTop = Math.atan2(prevMouseY - submenuRect.current.top, toSubmenuX) + $d275435c250248f8$var$ANGLE_PADDING;
      let angleBottom = Math.atan2(prevMouseY - submenuRect.current.bottom, toSubmenuX) - $d275435c250248f8$var$ANGLE_PADDING;
      let anglePointer = Math.atan2(prevMouseY - mouseY, submenuSide.current === "left" ? -(mouseX - prevMouseX) : mouseX - prevMouseX);
      let isMovingTowardsSubmenu = anglePointer < angleTop && anglePointer > angleBottom;
      movementsTowardsSubmenuCount.current = isMovingTowardsSubmenu ? Math.min(movementsTowardsSubmenuCount.current + 1, $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS) : Math.max(movementsTowardsSubmenuCount.current - 1, 0);
      if (movementsTowardsSubmenuCount.current >= $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS) setPreventPointerEvents(true);
      else setPreventPointerEvents(false);
      lastProcessedTime.current = currentTime;
      prevPointerPos.current = {
        x: mouseX,
        y: mouseY
      };
      if (isMovingTowardsSubmenu) timeout.current = setTimeout(() => {
        reset();
        autoCloseTimeout.current = setTimeout(() => {
          let target = document.elementFromPoint(mouseX, mouseY);
          if (target && menu.contains(target)) target.dispatchEvent(new PointerEvent("pointerover", {
            bubbles: true,
            cancelable: true
          }));
        }, 100);
      }, $d275435c250248f8$var$TIMEOUT_TIME);
    };
    window.addEventListener("pointermove", onPointerMove);
    if (process.env.NODE_ENV !== "test") window.addEventListener("pointerdown", onPointerDown, true);
    return () => {
      window.removeEventListener("pointermove", onPointerMove);
      if (process.env.NODE_ENV !== "test") window.removeEventListener("pointerdown", onPointerDown, true);
      clearTimeout(timeout.current);
      clearTimeout(autoCloseTimeout.current);
      movementsTowardsSubmenuCount.current = $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS;
    };
  }, [
    isDisabled,
    isOpen,
    menuRef,
    modality,
    setPreventPointerEvents,
    onPointerDown,
    submenuRef
  ]);
}
function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
  let { parentMenuRef, submenuRef, type = "menu", isDisabled, delay = 200, shouldUseVirtualFocus } = props;
  let submenuTriggerId = $bdb11010cef70236$export$f680877a34711e37();
  let overlayId = $bdb11010cef70236$export$f680877a34711e37();
  let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
  let openTimeout = useRef(void 0);
  let cancelOpenTimeout = useCallback(() => {
    if (openTimeout.current) {
      clearTimeout(openTimeout.current);
      openTimeout.current = void 0;
    }
  }, [
    openTimeout
  ]);
  let onSubmenuOpen = $8ae05eaa5c114e9c$export$7f54fc3180508a52((focusStrategy) => {
    cancelOpenTimeout();
    state.open(focusStrategy);
  });
  let onSubmenuClose = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
    cancelOpenTimeout();
    state.close();
  });
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
    return () => {
      cancelOpenTimeout();
    };
  }, [
    cancelOpenTimeout
  ]);
  let submenuKeyDown = (e) => {
    if (!e.currentTarget.contains(document.activeElement)) return;
    switch (e.key) {
      case "ArrowLeft":
        if (direction === "ltr" && e.currentTarget.contains(e.target)) {
          e.preventDefault();
          e.stopPropagation();
          onSubmenuClose();
          if (!shouldUseVirtualFocus && ref.current) $7215afc6de606d6b$export$de79e2c695e052f3(ref.current);
        }
        break;
      case "ArrowRight":
        if (direction === "rtl" && e.currentTarget.contains(e.target)) {
          e.preventDefault();
          e.stopPropagation();
          onSubmenuClose();
          if (!shouldUseVirtualFocus && ref.current) $7215afc6de606d6b$export$de79e2c695e052f3(ref.current);
        }
        break;
      case "Escape":
        var _submenuRef_current;
        if ((_submenuRef_current = submenuRef.current) === null || _submenuRef_current === void 0 ? void 0 : _submenuRef_current.contains(e.target)) {
          e.stopPropagation();
          onSubmenuClose();
          if (!shouldUseVirtualFocus && ref.current) $7215afc6de606d6b$export$de79e2c695e052f3(ref.current);
        }
        break;
    }
  };
  var _state_focusStrategy;
  let submenuProps = {
    id: overlayId,
    "aria-labelledby": submenuTriggerId,
    submenuLevel: state.submenuLevel,
    ...type === "menu" && {
      onClose: state.closeAll,
      autoFocus: (_state_focusStrategy = state.focusStrategy) !== null && _state_focusStrategy !== void 0 ? _state_focusStrategy : void 0,
      onKeyDown: submenuKeyDown
    }
  };
  let submenuTriggerKeyDown = (e) => {
    switch (e.key) {
      case "ArrowRight":
        if (!isDisabled) {
          if (direction === "ltr") {
            e.preventDefault();
            if (!state.isOpen) onSubmenuOpen("first");
            if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) $7215afc6de606d6b$export$de79e2c695e052f3(submenuRef.current);
          } else if (state.isOpen) onSubmenuClose();
          else e.continuePropagation();
        }
        break;
      case "ArrowLeft":
        if (!isDisabled) {
          if (direction === "rtl") {
            e.preventDefault();
            if (!state.isOpen) onSubmenuOpen("first");
            if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) $7215afc6de606d6b$export$de79e2c695e052f3(submenuRef.current);
          } else if (state.isOpen) onSubmenuClose();
          else e.continuePropagation();
        }
        break;
      default:
        e.continuePropagation();
        break;
    }
  };
  let onPressStart = (e) => {
    if (!isDisabled && (e.pointerType === "virtual" || e.pointerType === "keyboard"))
      onSubmenuOpen("first");
  };
  let onPress = (e) => {
    if (!isDisabled && (e.pointerType === "touch" || e.pointerType === "mouse"))
      onSubmenuOpen();
  };
  let onHoverChange = (isHovered) => {
    if (!isDisabled) {
      if (isHovered && !state.isOpen) {
        if (!openTimeout.current) openTimeout.current = setTimeout(() => {
          onSubmenuOpen();
        }, delay);
      } else if (!isHovered) cancelOpenTimeout();
    }
  };
  $e9faafb641e167db$export$90fc3a17d93f704c(parentMenuRef, "focusin", (e) => {
    var _parentMenuRef_current;
    if (state.isOpen && ((_parentMenuRef_current = parentMenuRef.current) === null || _parentMenuRef_current === void 0 ? void 0 : _parentMenuRef_current.contains(e.target)) && e.target !== ref.current) onSubmenuClose();
  });
  let shouldCloseOnInteractOutside = (target) => {
    if (target !== ref.current) return true;
    return false;
  };
  $d275435c250248f8$export$85ec83e04c95f50a({
    menuRef: parentMenuRef,
    submenuRef,
    isOpen: state.isOpen,
    isDisabled
  });
  return {
    submenuTriggerProps: {
      id: submenuTriggerId,
      "aria-controls": state.isOpen ? overlayId : void 0,
      "aria-haspopup": !isDisabled ? type : void 0,
      "aria-expanded": state.isOpen ? "true" : "false",
      onPressStart,
      onPress,
      onHoverChange,
      onKeyDown: submenuTriggerKeyDown,
      isOpen: state.isOpen
    },
    submenuProps,
    popoverProps: {
      isNonModal: true,
      shouldCloseOnInteractOutside
    }
  };
}
function $40df3f8667284809$export$d55e7ee900f34e93(props, ref) {
  let { role = "dialog" } = props;
  let titleId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
  titleId = props["aria-label"] ? void 0 : titleId;
  let isRefocusing = useRef(false);
  useEffect(() => {
    if (ref.current && !ref.current.contains(document.activeElement)) {
      $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
      let timeout = setTimeout(() => {
        if (document.activeElement === ref.current || document.activeElement === document.body) {
          isRefocusing.current = true;
          if (ref.current) {
            ref.current.blur();
            $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
          }
          isRefocusing.current = false;
        }
      }, 500);
      return () => {
        clearTimeout(timeout);
      };
    }
  }, [
    ref
  ]);
  $337b884510726a0d$export$14c98a7594375490();
  return {
    dialogProps: {
      ...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
        labelable: true
      }),
      role,
      tabIndex: -1,
      "aria-labelledby": props["aria-labelledby"] || titleId,
      // 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: (e) => {
        if (isRefocusing.current) e.stopPropagation();
      }
    },
    titleProps: {
      id: titleId
    }
  };
}
function $a28c903ee9ad8dc5$export$79fefeb1c2091ac3(props) {
  let overlayTriggerState = $fc909762b330b746$export$61c6a8c84e605fb6(props);
  let [focusStrategy, setFocusStrategy] = useState(null);
  let [expandedKeysStack, setExpandedKeysStack] = useState([]);
  let closeAll = () => {
    setExpandedKeysStack([]);
    overlayTriggerState.close();
  };
  let openSubmenu = (triggerKey, level) => {
    setExpandedKeysStack((oldStack) => {
      if (level > oldStack.length) return oldStack;
      return [
        ...oldStack.slice(0, level),
        triggerKey
      ];
    });
  };
  let closeSubmenu = (triggerKey, level) => {
    setExpandedKeysStack((oldStack) => {
      let key = oldStack[level];
      if (key === triggerKey) return oldStack.slice(0, level);
      else return oldStack;
    });
  };
  return {
    focusStrategy,
    ...overlayTriggerState,
    open(focusStrategy2 = null) {
      setFocusStrategy(focusStrategy2);
      overlayTriggerState.open();
    },
    toggle(focusStrategy2 = null) {
      setFocusStrategy(focusStrategy2);
      overlayTriggerState.toggle();
    },
    close() {
      closeAll();
    },
    expandedKeysStack,
    openSubmenu,
    closeSubmenu
  };
}
function $e5614764aa47eb35$export$cfc51cf86138bf98(props, state) {
  let { triggerKey } = props;
  let { expandedKeysStack, openSubmenu, closeSubmenu, close: closeAll } = state;
  let [submenuLevel] = useState(expandedKeysStack === null || expandedKeysStack === void 0 ? void 0 : expandedKeysStack.length);
  let isOpen = useMemo(() => expandedKeysStack[submenuLevel] === triggerKey, [
    expandedKeysStack,
    triggerKey,
    submenuLevel
  ]);
  let [focusStrategy, setFocusStrategy] = useState(null);
  let open = useCallback((focusStrategy2) => {
    setFocusStrategy(focusStrategy2 !== null && focusStrategy2 !== void 0 ? focusStrategy2 : null);
    openSubmenu(triggerKey, submenuLevel);
  }, [
    openSubmenu,
    submenuLevel,
    triggerKey
  ]);
  let close = useCallback(() => {
    setFocusStrategy(null);
    closeSubmenu(triggerKey, submenuLevel);
  }, [
    closeSubmenu,
    submenuLevel,
    triggerKey
  ]);
  let toggle = useCallback((focusStrategy2) => {
    setFocusStrategy(focusStrategy2 !== null && focusStrategy2 !== void 0 ? focusStrategy2 : null);
    if (isOpen) close();
    else open(focusStrategy2);
  }, [
    close,
    open,
    isOpen
  ]);
  return useMemo(() => ({
    focusStrategy,
    isOpen,
    open,
    close,
    closeAll,
    submenuLevel,
    // 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
  }), [
    isOpen,
    open,
    close,
    closeAll,
    focusStrategy,
    toggle,
    submenuLevel
  ]);
}
class $05ca4cd7c4a5a999$export$863faf230ee2118a {
  *[Symbol.iterator]() {
    yield* this.iterable;
  }
  get size() {
    return this.keyMap.size;
  }
  getKeys() {
    return this.keyMap.keys();
  }
  getKeyBefore(key) {
    let node = this.keyMap.get(key);
    var _node_prevKey;
    return node ? (_node_prevKey = node.prevKey) !== null && _node_prevKey !== void 0 ? _node_prevKey : null : null;
  }
  getKeyAfter(key) {
    let node = this.keyMap.get(key);
    var _node_nextKey;
    return node ? (_node_nextKey = node.nextKey) !== null && _node_nextKey !== void 0 ? _node_nextKey : null : null;
  }
  getFirstKey() {
    return this.firstKey;
  }
  getLastKey() {
    return this.lastKey;
  }
  getItem(key) {
    var _this_keyMap_get;
    return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
  }
  at(idx) {
    const keys = [
      ...this.getKeys()
    ];
    return this.getItem(keys[idx]);
  }
  constructor(nodes, { expandedKeys } = {}) {
    this.keyMap = /* @__PURE__ */ new Map();
    this.firstKey = null;
    this.lastKey = null;
    this.iterable = nodes;
    expandedKeys = expandedKeys || /* @__PURE__ */ new Set();
    let visit = (node) => {
      this.keyMap.set(node.key, node);
      if (node.childNodes && (node.type === "section" || expandedKeys.has(node.key))) for (let child of node.childNodes) visit(child);
    };
    for (let node of nodes) visit(node);
    let last = null;
    let index = 0;
    for (let [key, node] of this.keyMap) {
      if (last) {
        last.nextKey = key;
        node.prevKey = last.key;
      } else {
        this.firstKey = key;
        node.prevKey = void 0;
      }
      if (node.type === "item") node.index = index++;
      last = node;
      last.nextKey = void 0;
    }
    var _last_key;
    this.lastKey = (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
  }
}
function $875d6693e12af071$export$728d6ba534403756(props) {
  let { onExpandedChange } = props;
  let [expandedKeys, setExpandedKeys] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.expandedKeys ? new Set(props.expandedKeys) : void 0, props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : /* @__PURE__ */ new Set(), onExpandedChange);
  let selectionState = $7af3f5b51489e0b5$export$253fe78d46329472(props);
  let disabledKeys = useMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
    props.disabledKeys
  ]);
  let tree = $7613b1592d41b092$export$6cd28814d92fa9c9(props, useCallback((nodes) => new $05ca4cd7c4a5a999$export$863faf230ee2118a(nodes, {
    expandedKeys
  }), [
    expandedKeys
  ]), null);
  useEffect(() => {
    if (selectionState.focusedKey != null && !tree.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
  }, [
    tree,
    selectionState.focusedKey
  ]);
  let onToggle = (key) => {
    setExpandedKeys($875d6693e12af071$var$toggleKey(expandedKeys, key));
  };
  return {
    collection: tree,
    expandedKeys,
    disabledKeys,
    toggleKey: onToggle,
    setExpandedKeys,
    selectionManager: new $d496c0a20b6e58ec$export$6c8a5aaad13c9852(tree, selectionState)
  };
}
function $875d6693e12af071$var$toggleKey(set, key) {
  let res = new Set(set);
  if (res.has(key)) res.delete(key);
  else res.add(key);
  return res;
}
const $07b14b47974efb58$export$9b9a0cd73afb7ca4 = /* @__PURE__ */ createContext(null);
const $07b14b47974efb58$var$PopoverGroupContext = /* @__PURE__ */ createContext(null);
const $07b14b47974efb58$export$5b6b19405a83ff9d = /* @__PURE__ */ forwardRef(function Popover(props, ref) {
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $07b14b47974efb58$export$9b9a0cd73afb7ca4);
  let contextState = useContext($de32f1b87079253c$export$d2f961adcb0afbe);
  let localState = $fc909762b330b746$export$61c6a8c84e605fb6(props);
  let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;
  let isExiting = $d3f049242431219c$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || false;
  let isHidden = $f39a9eba43920ace$export$b5d7cc18bb8d2b59();
  let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
  if (isHidden) {
    let children = props.children;
    if (typeof children === "function") children = children({
      trigger: props.trigger || null,
      placement: "bottom",
      isEntering: false,
      isExiting: false,
      defaultChildren: null
    });
    return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children);
  }
  if (state && !state.isOpen && !isExiting) return null;
  return /* @__PURE__ */ React__default.createElement($07b14b47974efb58$var$PopoverInner, {
    ...props,
    triggerRef: props.triggerRef,
    state,
    popoverRef: ref,
    isExiting,
    dir: direction
  });
});
function $07b14b47974efb58$var$PopoverInner({ state, isExiting, UNSTABLE_portalContainer, clearContexts, ...props }) {
  let arrowRef = useRef(null);
  let containerRef = useRef(null);
  let groupCtx = useContext($07b14b47974efb58$var$PopoverGroupContext);
  let isSubPopover = groupCtx && props.trigger === "SubmenuTrigger";
  var _props_offset;
  let { popoverProps, underlayProps, arrowProps, placement, triggerAnchorPoint } = $f2f8a6077418541e$export$542a6fd13ac93354({
    ...props,
    offset: (_props_offset = props.offset) !== null && _props_offset !== void 0 ? _props_offset : 8,
    arrowRef,
    // If this is a submenu/subdialog, use the root popover's container
    // to detect outside interaction and add aria-hidden.
    groupRef: isSubPopover ? groupCtx : containerRef
  }, state);
  let ref = props.popoverRef;
  let isEntering = $d3f049242431219c$export$6d3443f2c48bfc20(ref, !!placement) || props.isEntering || false;
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    ...props,
    defaultClassName: "react-aria-Popover",
    values: {
      trigger: props.trigger || null,
      placement,
      isEntering,
      isExiting
    }
  });
  let shouldBeDialog = !props.isNonModal || props.trigger === "SubmenuTrigger";
  let [isDialog, setDialog] = useState(false);
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
    if (ref.current) setDialog(shouldBeDialog && !ref.current.querySelector("[role=dialog]"));
  }, [
    ref,
    shouldBeDialog
  ]);
  useEffect(() => {
    if (isDialog && props.trigger !== "SubmenuTrigger" && ref.current && !ref.current.contains(document.activeElement)) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
  }, [
    isDialog,
    ref,
    props.trigger
  ]);
  let children = useMemo(() => {
    let children2 = renderProps.children;
    if (clearContexts) for (let Context of clearContexts) children2 = /* @__PURE__ */ React__default.createElement(Context.Provider, {
      value: null
    }, children2);
    return children2;
  }, [
    renderProps.children,
    clearContexts
  ]);
  let style = {
    ...popoverProps.style,
    "--trigger-anchor-point": triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : void 0,
    ...renderProps.style
  };
  let overlay = /* @__PURE__ */ React__default.createElement("div", {
    ...$3ef42575df84b30b$export$9d1611c77c2fe928($65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
      global: true
    }), popoverProps),
    ...renderProps,
    role: isDialog ? "dialog" : void 0,
    tabIndex: isDialog ? -1 : void 0,
    "aria-label": props["aria-label"],
    "aria-labelledby": props["aria-labelledby"],
    ref,
    slot: props.slot || void 0,
    style,
    dir: props.dir,
    "data-trigger": props.trigger,
    "data-placement": placement,
    "data-entering": isEntering || void 0,
    "data-exiting": isExiting || void 0
  }, !props.isNonModal && /* @__PURE__ */ React__default.createElement($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
    onDismiss: state.close
  }), /* @__PURE__ */ React__default.createElement($44f671af83e7d9e0$export$2de4954e8ae13b9f.Provider, {
    value: {
      ...arrowProps,
      placement,
      ref: arrowRef
    }
  }, children), /* @__PURE__ */ React__default.createElement($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
    onDismiss: state.close
  }));
  if (!isSubPopover) return /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$c6fdb837b070b4ff, {
    ...props,
    shouldContainFocus: isDialog,
    isExiting,
    portalContainer: UNSTABLE_portalContainer
  }, !props.isNonModal && state.isOpen && /* @__PURE__ */ React__default.createElement("div", {
    "data-testid": "underlay",
    ...underlayProps,
    style: {
      position: "fixed",
      inset: 0
    }
  }), /* @__PURE__ */ React__default.createElement("div", {
    ref: containerRef,
    style: {
      display: "contents"
    }
  }, /* @__PURE__ */ React__default.createElement($07b14b47974efb58$var$PopoverGroupContext.Provider, {
    value: containerRef
  }, overlay)));
  var _ref;
  return /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$c6fdb837b070b4ff, {
    ...props,
    shouldContainFocus: isDialog,
    isExiting,
    portalContainer: (_ref = UNSTABLE_portalContainer !== null && UNSTABLE_portalContainer !== void 0 ? UNSTABLE_portalContainer : groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.current) !== null && _ref !== void 0 ? _ref : void 0
  }, overlay);
}
const $63df2425e2108aa8$export$744d98a3b8a94e1c = /* @__PURE__ */ createContext({});
const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /* @__PURE__ */ createContext(null);
const $3674c52c6b3c5bce$export$24aad8519b95b41b = /* @__PURE__ */ createContext(null);
const $3674c52c6b3c5bce$export$795aec4671cbae19 = /* @__PURE__ */ createContext(null);
const $3674c52c6b3c5bce$var$SelectionManagerContext = /* @__PURE__ */ createContext(null);
function $3674c52c6b3c5bce$export$27d2ad3c5815583e(props) {
  let state = $a28c903ee9ad8dc5$export$79fefeb1c2091ac3(props);
  let ref = useRef(null);
  let { menuTriggerProps, menuProps } = $168583247155ddda$export$dc9c12ed27dd1b49({
    ...props,
    type: "menu"
  }, state, ref);
  let [buttonWidth, setButtonWidth] = useState(null);
  let onResize = useCallback(() => {
    if (ref.current) setButtonWidth(ref.current.offsetWidth + "px");
  }, [
    ref
  ]);
  $9daab02d461809db$export$683480f191c0e3ea({
    ref,
    onResize
  });
  let scrollRef = useRef(null);
  return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $3674c52c6b3c5bce$export$c7e742effb1c51e2,
        {
          ...menuProps,
          ref: scrollRef
        }
      ],
      [
        $de32f1b87079253c$export$d2f961adcb0afbe,
        state
      ],
      [
        $3674c52c6b3c5bce$export$795aec4671cbae19,
        state
      ],
      [
        $07b14b47974efb58$export$9b9a0cd73afb7ca4,
        {
          trigger: "MenuTrigger",
          triggerRef: ref,
          scrollRef,
          placement: "bottom start",
          style: {
            "--trigger-width": buttonWidth
          },
          "aria-labelledby": menuProps["aria-labelledby"]
        }
      ]
    ]
  }, /* @__PURE__ */ React__default.createElement($f1ab8c75478c6f73$export$3351871ee4b288b8, {
    ...menuTriggerProps,
    ref,
    isPressed: state.isOpen
  }, props.children));
}
const $3674c52c6b3c5bce$var$SubmenuTriggerContext = /* @__PURE__ */ createContext(null);
class $3674c52c6b3c5bce$var$SubmenuTriggerNode extends $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
  filter(collection, newCollection, filterFn) {
    let triggerNode = collection.getItem(this.firstChildKey);
    if (triggerNode && filterFn(triggerNode.textValue, this)) {
      let clone = this.clone();
      newCollection.addDescendants(clone, collection);
      return clone;
    }
    return null;
  }
}
$3674c52c6b3c5bce$var$SubmenuTriggerNode.type = "submenutrigger";
const $3674c52c6b3c5bce$export$ecabc99eeffab7ca = /* @__PURE__ */ $e1995378a142960e$export$e953bb1cd0f19726($3674c52c6b3c5bce$var$SubmenuTriggerNode, (props, ref, item) => {
  let { CollectionBranch } = useContext($7135fc7d473fd974$export$4feb769f8ddf26c5);
  let state = useContext($3674c52c6b3c5bce$export$24aad8519b95b41b);
  let rootMenuTriggerState = useContext($3674c52c6b3c5bce$export$795aec4671cbae19);
  let submenuTriggerState = $e5614764aa47eb35$export$cfc51cf86138bf98({
    triggerKey: item.key
  }, rootMenuTriggerState);
  let submenuRef = useRef(null);
  let itemRef = $df56164dff5785e2$export$4338b53315abf666(ref);
  let { parentMenuRef, shouldUseVirtualFocus } = useContext($3674c52c6b3c5bce$var$SubmenuTriggerContext);
  let { submenuTriggerProps, submenuProps, popoverProps } = $0065b146e7192841$export$7138b0d059a6e743({
    parentMenuRef,
    submenuRef,
    delay: props.delay,
    shouldUseVirtualFocus
  }, submenuTriggerState, itemRef);
  return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $3674c52c6b3c5bce$var$MenuItemContext,
        {
          ...submenuTriggerProps,
          onAction: void 0,
          ref: itemRef
        }
      ],
      [
        $3674c52c6b3c5bce$export$c7e742effb1c51e2,
        {
          ref: submenuRef,
          ...submenuProps
        }
      ],
      [
        $de32f1b87079253c$export$d2f961adcb0afbe,
        submenuTriggerState
      ],
      [
        $07b14b47974efb58$export$9b9a0cd73afb7ca4,
        {
          trigger: "SubmenuTrigger",
          triggerRef: itemRef,
          placement: "end top",
          "aria-labelledby": submenuProps["aria-labelledby"],
          ...popoverProps
        }
      ]
    ]
  }, /* @__PURE__ */ React__default.createElement(CollectionBranch, {
    collection: state.collection,
    parent: item
  }), props.children[1]);
}, (props) => props.children[0]);
const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /* @__PURE__ */ forwardRef(function Menu(props, ref) {
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $3674c52c6b3c5bce$export$c7e742effb1c51e2);
  return /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$bf788dd355e3a401, {
    content: /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$fb8073518f34e6ec, props)
  }, (collection) => /* @__PURE__ */ React__default.createElement($3674c52c6b3c5bce$var$MenuInner, {
    props,
    collection,
    menuRef: ref
  }));
});
function $3674c52c6b3c5bce$var$MenuInner({ props, collection, menuRef: ref }) {
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $8e6cc465cc68f603$export$b0d3ecf7112093a7);
  let { filter, ...autocompleteMenuProps } = props;
  let filteredCollection = useMemo(() => filter ? collection.filter(filter) : collection, [
    collection,
    filter
  ]);
  let state = $875d6693e12af071$export$728d6ba534403756({
    ...props,
    collection: filteredCollection,
    children: void 0
  });
  let triggerState = useContext($3674c52c6b3c5bce$export$795aec4671cbae19);
  let { isVirtualized, CollectionRoot } = useContext($7135fc7d473fd974$export$4feb769f8ddf26c5);
  let { menuProps } = $d5336fe17ce95402$export$38eaa17faae8f579({
    ...props,
    isVirtualized,
    onClose: props.onClose || (triggerState === null || triggerState === void 0 ? void 0 : triggerState.close)
  }, state, ref);
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    defaultClassName: "react-aria-Menu",
    className: props.className,
    style: props.style,
    values: {
      isEmpty: state.collection.size === 0
    }
  });
  let emptyState = null;
  if (state.collection.size === 0 && props.renderEmptyState) emptyState = /* @__PURE__ */ React__default.createElement("div", {
    role: "menuitem",
    style: {
      display: "contents"
    }
  }, props.renderEmptyState());
  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    global: true
  });
  return /* @__PURE__ */ React__default.createElement($9bf71ea28793e738$export$20e40289641fbbb6, null, /* @__PURE__ */ React__default.createElement("div", {
    ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, menuProps),
    ref,
    slot: props.slot || void 0,
    "data-empty": state.collection.size === 0 || void 0,
    onScroll: props.onScroll
  }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $3674c52c6b3c5bce$export$24aad8519b95b41b,
        state
      ],
      [
        $431f98aba6844401$export$6615d83f6de245ce,
        {
          elementType: "div"
        }
      ],
      [
        $7135fc7d473fd974$export$d40e14dec8b060a8,
        {
          name: "MenuSection",
          render: $3674c52c6b3c5bce$var$MenuSectionInner
        }
      ],
      [
        $3674c52c6b3c5bce$var$SubmenuTriggerContext,
        {
          parentMenuRef: ref,
          shouldUseVirtualFocus: autocompleteMenuProps === null || autocompleteMenuProps === void 0 ? void 0 : autocompleteMenuProps.shouldUseVirtualFocus
        }
      ],
      [
        $3674c52c6b3c5bce$var$MenuItemContext,
        null
      ],
      [
        $8e6cc465cc68f603$export$b0d3ecf7112093a7,
        null
      ],
      [
        $8e6cc465cc68f603$export$698f465ec27e93df,
        null
      ],
      [
        $3674c52c6b3c5bce$var$SelectionManagerContext,
        state.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 */
      [
        $3674c52c6b3c5bce$export$795aec4671cbae19,
        triggerState !== null && triggerState !== void 0 ? triggerState : $a28c903ee9ad8dc5$export$79fefeb1c2091ac3({})
      ]
    ]
  }, /* @__PURE__ */ React__default.createElement(CollectionRoot, {
    collection: state.collection,
    persistedKeys: $7135fc7d473fd974$export$90e00781bc59d8f9(state.selectionManager.focusedKey),
    scrollRef: ref
  })), emptyState));
}
class $3674c52c6b3c5bce$var$GroupSelectionManager extends $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
  get focusedKey() {
    return this.parent.focusedKey;
  }
  get isFocused() {
    return this.parent.isFocused;
  }
  setFocusedKey(key, childFocusStrategy) {
    return this.parent.setFocusedKey(key, childFocusStrategy);
  }
  setFocused(isFocused) {
    this.parent.setFocused(isFocused);
  }
  get childFocusStrategy() {
    return this.parent.childFocusStrategy;
  }
  constructor(parent, state) {
    super(parent.collection, state);
    this.parent = parent;
  }
}
function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className = "react-aria-MenuSection") {
  var _section_props, _section_props1;
  let state = useContext($3674c52c6b3c5bce$export$24aad8519b95b41b);
  let { CollectionBranch } = useContext($7135fc7d473fd974$export$4feb769f8ddf26c5);
  let [headingRef, heading] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8();
  var _section_props_arialabel;
  let { headingProps, groupProps } = $3e5eb2498db5b506$export$73f7a44322579622({
    heading,
    "aria-label": (_section_props_arialabel = section.props["aria-label"]) !== null && _section_props_arialabel !== void 0 ? _section_props_arialabel : void 0
  });
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    defaultClassName: className,
    className: (_section_props = section.props) === null || _section_props === void 0 ? void 0 : _section_props.className,
    style: (_section_props1 = section.props) === null || _section_props1 === void 0 ? void 0 : _section_props1.style,
    values: {}
  });
  let parent = useContext($3674c52c6b3c5bce$var$SelectionManagerContext);
  let selectionState = $7af3f5b51489e0b5$export$253fe78d46329472(props);
  let manager = props.selectionMode != null ? new $3674c52c6b3c5bce$var$GroupSelectionManager(parent, selectionState) : parent;
  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    global: true
  });
  delete DOMProps.id;
  return /* @__PURE__ */ React__default.createElement("section", {
    ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, groupProps),
    ref
  }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $72a5793c14baf454$export$e0e4026c12a8bdbb,
        {
          ...headingProps,
          ref: headingRef
        }
      ],
      [
        $3674c52c6b3c5bce$var$SelectionManagerContext,
        manager
      ]
    ]
  }, /* @__PURE__ */ React__default.createElement(CollectionBranch, {
    collection: state.collection,
    parent: section
  })));
}
const $3674c52c6b3c5bce$export$4b1545b4f2016d26 = /* @__PURE__ */ $e1995378a142960e$export$e953bb1cd0f19726($23b9f4fcf0fe224b$export$437f11dc9b403b78, $3674c52c6b3c5bce$var$MenuSectionInner);
const $3674c52c6b3c5bce$var$MenuItemContext = /* @__PURE__ */ createContext(null);
const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /* @__PURE__ */ $e1995378a142960e$export$18af5c7a9e9b3664($23b9f4fcf0fe224b$export$fd11f34e1d07f134, function MenuItem(props, forwardedRef, item) {
  var _useSlottedContext;
  [props, forwardedRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, forwardedRef, $3674c52c6b3c5bce$var$MenuItemContext);
  let id = (_useSlottedContext = $64fa3d84918910a7$export$fabf2dc03a41866e($3674c52c6b3c5bce$var$MenuItemContext)) === null || _useSlottedContext === void 0 ? void 0 : _useSlottedContext.id;
  let state = useContext($3674c52c6b3c5bce$export$24aad8519b95b41b);
  let ref = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
  let selectionManager = useContext($3674c52c6b3c5bce$var$SelectionManagerContext);
  let { menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states } = $a2e5df62f93c7633$export$9d32628fc2aea7da({
    ...props,
    id,
    key: item.key,
    selectionManager
  }, state, ref);
  let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled: states.isDisabled
  });
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    ...props,
    id: void 0,
    children: item.rendered,
    defaultClassName: "react-aria-MenuItem",
    values: {
      ...states,
      isHovered,
      isFocusVisible: states.isFocusVisible,
      selectionMode: selectionManager.selectionMode,
      selectionBehavior: selectionManager.selectionBehavior,
      hasSubmenu: !!props["aria-haspopup"],
      isOpen: props["aria-expanded"] === "true"
    }
  });
  let ElementType = props.href ? "a" : "div";
  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    global: true
  });
  delete DOMProps.id;
  delete DOMProps.onClick;
  return /* @__PURE__ */ React__default.createElement(ElementType, {
    ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, menuItemProps, hoverProps),
    ref,
    "data-disabled": states.isDisabled || void 0,
    "data-hovered": isHovered || void 0,
    "data-focused": states.isFocused || void 0,
    "data-focus-visible": states.isFocusVisible || void 0,
    "data-pressed": states.isPressed || void 0,
    "data-selected": states.isSelected || void 0,
    "data-selection-mode": selectionManager.selectionMode === "none" ? void 0 : selectionManager.selectionMode,
    "data-has-submenu": !!props["aria-haspopup"] || void 0,
    "data-open": props["aria-expanded"] === "true" || void 0
  }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $514c0188e459b4c0$export$9afb8bc826b033ea,
        {
          slots: {
            [$64fa3d84918910a7$export$c62b8e45d58ddad9]: labelProps,
            label: labelProps,
            description: descriptionProps
          }
        }
      ],
      [
        $63df2425e2108aa8$export$744d98a3b8a94e1c,
        keyboardShortcutProps
      ]
    ]
  }, renderProps.children));
});
const $de32f1b87079253c$export$8b93a07348a7730c = /* @__PURE__ */ createContext(null);
const $de32f1b87079253c$export$d2f961adcb0afbe = /* @__PURE__ */ createContext(null);
function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
  let state = $a28c903ee9ad8dc5$export$79fefeb1c2091ac3(props);
  let buttonRef = useRef(null);
  let { triggerProps, overlayProps } = $628037886ba31236$export$f9d5c8beee7d008d({
    type: "dialog"
  }, state, buttonRef);
  let [buttonWidth, setButtonWidth] = useState(null);
  let onResize = useCallback(() => {
    if (buttonRef.current) setButtonWidth(buttonRef.current.offsetWidth + "px");
  }, [
    buttonRef
  ]);
  $9daab02d461809db$export$683480f191c0e3ea({
    ref: buttonRef,
    onResize
  });
  triggerProps.id = $bdb11010cef70236$export$f680877a34711e37();
  overlayProps["aria-labelledby"] = triggerProps.id;
  return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $de32f1b87079253c$export$d2f961adcb0afbe,
        state
      ],
      [
        $3674c52c6b3c5bce$export$795aec4671cbae19,
        state
      ],
      [
        $de32f1b87079253c$export$8b93a07348a7730c,
        overlayProps
      ],
      [
        $07b14b47974efb58$export$9b9a0cd73afb7ca4,
        {
          trigger: "DialogTrigger",
          triggerRef: buttonRef,
          "aria-labelledby": overlayProps["aria-labelledby"],
          style: {
            "--trigger-width": buttonWidth
          }
        }
      ]
    ]
  }, /* @__PURE__ */ React__default.createElement($f1ab8c75478c6f73$export$3351871ee4b288b8, {
    ...triggerProps,
    ref: buttonRef,
    isPressed: state.isOpen
  }, props.children));
}
const $de32f1b87079253c$export$3ddf2d174ce01153 = /* @__PURE__ */ forwardRef(function Dialog(props, ref) {
  let originalAriaLabelledby = props["aria-labelledby"];
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $de32f1b87079253c$export$8b93a07348a7730c);
  let { dialogProps, titleProps } = $40df3f8667284809$export$d55e7ee900f34e93({
    ...props,
    // Only pass aria-labelledby from props, not context.
    // Context is used as a fallback below.
    "aria-labelledby": originalAriaLabelledby
  }, ref);
  let state = useContext($de32f1b87079253c$export$d2f961adcb0afbe);
  if (!dialogProps["aria-label"] && !dialogProps["aria-labelledby"]) {
    if (props["aria-labelledby"]) dialogProps["aria-labelledby"] = props["aria-labelledby"];
    else if (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 renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    defaultClassName: "react-aria-Dialog",
    className: props.className,
    style: props.style,
    children: props.children,
    values: {
      close: (state === null || state === void 0 ? void 0 : state.close) || (() => {
      })
    }
  });
  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    global: true
  });
  return /* @__PURE__ */ React__default.createElement("section", {
    ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, dialogProps),
    ref,
    slot: props.slot || void 0
  }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $4e85f108e88277b8$export$d688439359537581,
        {
          slots: {
            [$64fa3d84918910a7$export$c62b8e45d58ddad9]: {},
            title: {
              ...titleProps,
              level: 2
            }
          }
        }
      ],
      [
        $d2b4bc8c273e7be6$export$24d547caef80ccd1,
        {
          slots: {
            [$64fa3d84918910a7$export$c62b8e45d58ddad9]: {},
            close: {
              onPress: () => state === null || state === void 0 ? void 0 : state.close()
            }
          }
        }
      ]
    ]
  }, renderProps.children));
});
export {
  $3674c52c6b3c5bce$export$27d2ad3c5815583e as $,
  $3674c52c6b3c5bce$export$d9b273488cd8ce6f as a,
  $3674c52c6b3c5bce$export$2ce376c2cc3355c8 as b,
  $3674c52c6b3c5bce$export$4b1545b4f2016d26 as c,
  $3674c52c6b3c5bce$export$ecabc99eeffab7ca as d,
  $07b14b47974efb58$export$5b6b19405a83ff9d as e,
  $de32f1b87079253c$export$3ddf2d174ce01153 as f,
  $de32f1b87079253c$export$2e1e1122cf0cba88 as g,
  $a11501f3d1d39e6c$export$ea8f71083e90600f as h,
  $49c51c25361d4cd2$export$ee0f7cc6afcd1c18 as i,
  $337b884510726a0d$export$14c98a7594375490 as j,
  $5e3802645cc19319$export$1c3ebcada18427bf as k,
  $de32f1b87079253c$export$d2f961adcb0afbe as l,
  $86ea4cb521eb2e37$export$2317d149ed6f78c4 as m,
  $337b884510726a0d$export$c6fdb837b070b4ff as n,
  $168583247155ddda$export$dc9c12ed27dd1b49 as o,
  $07b14b47974efb58$export$9b9a0cd73afb7ca4 as p
};
