"use client";
import { t as e } from "./useControlled-ZBScq72P.js";
import { n as t, t as n } from "./useIsoLayoutEffect-CKOv1bV_.js";
import { a as r, d as i, f as a, l as o, o as s, r as c, t as l, u } from "./useRenderElement-CmuWsiNa.js";
import { t as d } from "./useStableCallback-CqEVb76s.js";
import { n as f } from "./useCompositeListItem-xM6vOR9-.js";
import { t as p } from "./CompositeList-DJUJLDbx.js";
import { t as m } from "./DirectionContext-B4CbbM--.js";
import { f as h, l as g, r as _, t as v, v as y } from "./createBaseUIEventDetails-ChcQXp54.js";
import { n as b, t as x } from "./useBaseUiId-DOm5ACje.js";
import { a as S, n as C, o as w, t as T } from "./useOpenChangeComplete-DjMFUwhi.js";
import { t as E } from "./isElementDisabled-Cibvw8mz.js";
import { c as D, f as O, p as k } from "./floating-ui.utils.dom-5U5b4xPf.js";
import { r as A, t as j } from "./useButton-AXffhTAZ.js";
import { i as M } from "./detectBrowser-FBYSu3xM.js";
import { n as N } from "./shadowDom-C-4Ejp9R.js";
import { A as P, C as F, D as ee, E as I, I as L, L as R, O as te, S as z, T as ne, V as B, a as re, d as ie, g as V, h as ae, i as H, j as U, k as oe, l as W, m as se, o as G, r as ce, s as K, u as q, v as le, w as ue, x as de, z as fe } from "./popupStateMapping-PdIQcWEz.js";
import { t as J } from "./owner-BrzQrszh.js";
import { o as pe } from "./composite-BlDfbDkL.js";
import { cn as Y } from "./lib/utils.js";
import { n as me } from "./useTimeout-B1x6NSZb.js";
import { a as he, i as ge, r as _e, t as ve } from "./useOpenInteractionType-D-ymktmc.js";
import { n as ye, r as be, t as xe } from "./safePolygon-CscU2iWL.js";
import { i as X, n as Se, r as Ce, t as we } from "./usePositioner-D65mUNMo.js";
import { r as Te, t as Ee } from "./store-Bdrhndby.js";
import { t as De } from "./useFocus-DzHCrvH6.js";
import { n as Oe, r as ke, t as Ae } from "./getPseudoElementBounds-DarjR4tH.js";
import { t as je } from "./inertValue-C36grUTu.js";
import { t as Me } from "./useTriggerFocusGuards-D1QlFlDK.js";
import { n as Ne, t as Pe } from "./ToolbarRootContext-Dubw_915.js";
import { t as Fe } from "./CompositeItem-BWqRobLN.js";
import { t as Ie } from "./Separator-CgntgfMd.js";
import * as Z from "react";
import { jsx as Q, jsxs as Le } from "react/jsx-runtime";
import { CheckIcon as Re, ChevronRightIcon as ze } from "lucide-react";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/positioner/MenuPositionerContext.js
var Be = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (Be.displayName = "MenuPositionerContext");
function Ve(e) {
	let t = Z.useContext(Be);
	if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? u(33) : "Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.");
	return t;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/root/MenuRootContext.js
var He = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (He.displayName = "MenuRootContext");
function $(e) {
	let t = Z.useContext(He);
	if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? u(36) : "Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.");
	return t;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRootContext.js
var Ue = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (Ue.displayName = "ContextMenuRootContext");
function We(e = !0) {
	let t = Z.useContext(Ue);
	if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? u(25) : "Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.");
	return t;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemContext.js
var Ge = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (Ge.displayName = "MenuCheckboxItemContext");
function Ke() {
	let e = Z.useContext(Ge);
	if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? u(30) : "Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.");
	return e;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/item/useMenuItemCommonProps.js
function qe(e) {
	let { closeOnClick: t, highlighted: n, id: r, nodeId: i, store: a, typingRef: o, itemRef: s, itemMetadata: c } = e, { events: l } = a.useState("floatingTreeRoot"), u = We(!0), d = u !== void 0;
	return Z.useMemo(() => ({
		id: r,
		role: "menuitem",
		tabIndex: n ? 0 : -1,
		onKeyDown(e) {
			e.key === " " && o?.current && e.preventDefault();
		},
		onMouseMove(e) {
			i && l.emit("itemhover", {
				nodeId: i,
				target: e.currentTarget
			});
		},
		onClick(e) {
			t && l.emit("close", {
				domEvent: e,
				reason: h
			});
		},
		onMouseUp(e) {
			if (u) {
				let t = u.initialCursorPointRef.current;
				if (u.initialCursorPointRef.current = null, d && t && Math.abs(e.clientX - t.x) <= 1 && Math.abs(e.clientY - t.y) <= 1 || d && !M && e.button === 2) return;
			}
			s.current && a.context.allowMouseUpTriggerRef.current && (!d || e.button === 2) && (!c || c.type === "regular-item") && s.current.click();
		}
	}), [
		t,
		n,
		r,
		l,
		i,
		a,
		o,
		s,
		u,
		d,
		c
	]);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/item/useMenuItem.js
var Je = { type: "regular-item" };
function Ye(e) {
	let { closeOnClick: t, disabled: n = !1, highlighted: r, id: i, store: a, typingRef: s = a.context.typingRef, nativeButton: l, itemMetadata: u, nodeId: d } = e, f = Z.useRef(null), { getButtonProps: p, buttonRef: m } = j({
		disabled: n,
		focusableWhenDisabled: !0,
		native: l,
		composite: !0
	}), h = qe({
		closeOnClick: t,
		highlighted: r,
		id: i,
		nodeId: d,
		store: a,
		typingRef: s,
		itemRef: f,
		itemMetadata: u
	}), g = Z.useCallback((e) => c(h, { onMouseEnter() {
		u.type === "submenu-trigger" && u.setActive();
	} }, e, p), [
		h,
		p,
		u
	]), _ = o(f, m);
	return Z.useMemo(() => ({
		getItemProps: g,
		itemRef: _
	}), [g, _]);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemDataAttributes.js
var Xe = /*#__PURE__*/ function(e) {
	return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.highlighted = "data-highlighted", e;
}({}), Ze = {
	checked(e) {
		return e ? { [Xe.checked]: "" } : { [Xe.unchecked]: "" };
	},
	...S
}, Qe = /*#__PURE__*/ Z.forwardRef(function(t, n) {
	let { render: r, className: i, id: a, label: o, nativeButton: s = !1, disabled: c = !1, closeOnClick: u = !1, checked: d, defaultChecked: p, onCheckedChange: m, style: g, ..._ } = t, y = f({ label: o }), b = Ve(!0), S = x(a), { store: C } = $(), w = C.useState("isActive", y.index), T = C.useState("itemProps"), [E, D] = e({
		controlled: d,
		default: p ?? !1,
		name: "MenuCheckboxItem",
		state: "checked"
	}), { getItemProps: O, itemRef: k } = Ye({
		closeOnClick: u,
		disabled: c,
		highlighted: w,
		id: S,
		store: C,
		nativeButton: s,
		nodeId: b?.context.nodeId,
		itemMetadata: Je
	}), A = Z.useMemo(() => ({
		disabled: c,
		highlighted: w,
		checked: E
	}), [
		c,
		w,
		E
	]);
	function j(e) {
		let t = v(h, e.nativeEvent, void 0, { preventUnmountOnClose() {} });
		m?.(!E, t), !t.isCanceled && D((e) => !e);
	}
	let M = l("div", t, {
		state: A,
		stateAttributesMapping: Ze,
		props: [
			T,
			{
				role: "menuitemcheckbox",
				"aria-checked": E,
				onClick: j
			},
			_,
			O
		],
		ref: [
			k,
			n,
			y.ref
		]
	});
	return /*#__PURE__*/ Q(Ge.Provider, {
		value: A,
		children: M
	});
});
process.env.NODE_ENV !== "production" && (Qe.displayName = "MenuCheckboxItem");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js
var $e = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, keepMounted: a = !1, ...o } = e, s = Ke(), c = Z.useRef(null), { transitionStatus: u, setMounted: d } = w(s.checked);
	return T({
		open: s.checked,
		ref: c,
		onComplete() {
			s.checked || d(!1);
		}
	}), l("span", e, {
		state: {
			checked: s.checked,
			disabled: s.disabled,
			highlighted: s.highlighted,
			transitionStatus: u
		},
		ref: [t, c],
		stateAttributesMapping: Ze,
		props: {
			"aria-hidden": !0,
			...o
		},
		enabled: a || s.checked
	});
});
process.env.NODE_ENV !== "production" && ($e.displayName = "MenuCheckboxItemIndicator");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/group/MenuGroupContext.js
var et = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (et.displayName = "MenuGroupContext");
function tt() {
	let e = Z.useContext(et);
	if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? u(31) : "Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.");
	return e;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/group/MenuGroup.js
var nt = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, ...a } = e, [o, s] = Z.useState(void 0), c = l("div", e, {
		ref: t,
		props: {
			role: "group",
			"aria-labelledby": o,
			...a
		}
	});
	return /*#__PURE__*/ Q(et.Provider, {
		value: s,
		children: c
	});
});
process.env.NODE_ENV !== "production" && (nt.displayName = "MenuGroup");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js
var rt = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { render: r, className: i, style: a, id: o, ...s } = e, c = x(o), u = tt();
	return n(() => (u(c), () => {
		u(void 0);
	}), [u, c]), l("div", e, {
		ref: t,
		props: {
			id: c,
			role: "presentation",
			...s
		}
	});
});
process.env.NODE_ENV !== "production" && (rt.displayName = "MenuGroupLabel");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/item/MenuItem.js
var it = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { render: n, className: r, id: i, label: a, nativeButton: o = !1, disabled: s = !1, closeOnClick: c = !0, style: u, ...d } = e, p = f({ label: a }), m = Ve(!0), h = x(i), { store: g } = $(), _ = g.useState("isActive", p.index), v = g.useState("itemProps"), { getItemProps: y, itemRef: b } = Ye({
		closeOnClick: c,
		disabled: s,
		highlighted: _,
		id: h,
		store: g,
		nativeButton: o,
		nodeId: m?.context.nodeId,
		itemMetadata: Je
	});
	return l("div", e, {
		state: {
			disabled: s,
			highlighted: _
		},
		props: [
			v,
			d,
			y
		],
		ref: [
			b,
			t,
			p.ref
		]
	});
});
process.env.NODE_ENV !== "production" && (it.displayName = "MenuItem");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js
var at = {
	...ce,
	...S
}, ot = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s } = $(), { side: c, align: u } = Ve(), d = Pe(!0) != null, f = s.useState("open"), p = s.useState("transitionStatus"), m = s.useState("popupProps"), h = s.useState("mounted"), g = s.useState("instantType"), _ = s.useState("activeTriggerElement"), y = s.useState("parent"), b = s.useState("lastOpenChangeReason"), x = s.useState("rootId"), S = s.useState("floatingRootContext"), C = s.useState("floatingTreeRoot"), w = s.useState("closeDelay"), E = s.useState("activeTriggerElement"), D = s.useState("hoverEnabled"), O = s.useState("disabled"), k = y.type === "context-menu";
	T({
		open: f,
		ref: s.context.popupRef,
		onComplete() {
			f && s.context.onOpenChangeComplete?.(!0);
		}
	}), Z.useEffect(() => {
		function e(e) {
			s.setOpen(!1, v(e.reason, e.domEvent));
		}
		return C.events.on("close", e), () => {
			C.events.off("close", e);
		};
	}, [C.events, s]), be(S, {
		enabled: D && !O && !k && y.type !== "menubar",
		closeDelay: w
	});
	let A = Z.useCallback((e) => {
		s.set("popupElement", e);
	}, [s]), j = l("div", e, {
		state: {
			transitionStatus: p,
			side: c,
			align: u,
			open: f,
			nested: y.type === "menu",
			instant: g
		},
		ref: [
			t,
			s.context.popupRef,
			A
		],
		stateAttributesMapping: at,
		props: [
			m,
			{ onKeyDown(e) {
				d && pe.has(e.key) && e.stopPropagation();
			} },
			Se(p),
			o,
			{ "data-rootownerid": x }
		]
	}), M = y.type === void 0 || k;
	return (_ || y.type === "menubar" && b !== "outside-press") && (M = !0), /*#__PURE__*/ Q(he, {
		context: S,
		modal: k,
		disabled: !h,
		returnFocus: a === void 0 ? M : a,
		initialFocus: y.type !== "menu",
		restoreFocus: !0,
		externalTree: y.type === "menubar" ? void 0 : C,
		previousFocusableElement: E,
		nextFocusableElement: y.type === void 0 ? s.context.triggerFocusTargetRef : void 0,
		beforeContentFocusGuardRef: y.type === void 0 ? s.context.beforeContentFocusGuardRef : void 0,
		children: j
	});
});
process.env.NODE_ENV !== "production" && (ot.displayName = "MenuPopup");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/portal/MenuPortalContext.js
var st = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (st.displayName = "MenuPortalContext");
function ct() {
	let e = Z.useContext(st);
	if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? u(32) : "Base UI: <Menu.Portal> is missing.");
	return e;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js
var lt = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { keepMounted: n = !1, ...r } = e, { store: i } = $();
	return i.useState("mounted") || n ? /*#__PURE__*/ Q(st.Provider, {
		value: n,
		children: /*#__PURE__*/ Q(U, {
			ref: t,
			...r
		})
	}) : null;
});
process.env.NODE_ENV !== "production" && (lt.displayName = "MenuPortal");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js
var ut = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { anchor: r, positionMethod: i = "absolute", className: a, render: o, side: s, align: c, sideOffset: l = 0, alignOffset: u = 0, collisionBoundary: d = "clipping-ancestors", collisionPadding: f = 5, arrowPadding: m = 5, sticky: h = !1, disableAnchorTracking: g = !1, collisionAvoidance: _ = L, style: b, ...x } = e, { store: S } = $(), w = ct(), T = We(!0), E = S.useState("parent"), D = S.useState("floatingRootContext"), O = S.useState("floatingTreeRoot"), k = S.useState("mounted"), A = S.useState("open"), j = S.useState("modal"), M = S.useState("openMethod"), N = S.useState("activeTriggerElement"), P = S.useState("transitionStatus"), F = S.useState("positionerElement"), ee = S.useState("instantType"), I = S.useState("hasViewport"), te = S.useState("lastOpenChangeReason"), z = S.useState("floatingNodeId"), B = S.useState("floatingParentNodeId"), re = D.useState("domReferenceElement"), ie = Z.useRef(null), V = C(F, !1, !1), ae = r, H = l, U = u, oe = c, W = _;
	E.type === "context-menu" && (ae = r ?? E.context?.anchor, oe ??= "start", !s && oe !== "center" && (U = e.alignOffset ?? 2, H = e.sideOffset ?? -5));
	let se = s, G = oe;
	E.type === "menu" ? (se ??= "inline-end", G ??= "start", W = e.collisionAvoidance ?? R) : E.type === "menubar" && (se ??= "bottom", G ??= "start");
	let ce = E.type === "context-menu", K = Ce({
		anchor: ae,
		floatingRootContext: D,
		positionMethod: T ? "fixed" : i,
		mounted: k,
		side: se,
		sideOffset: H,
		align: G,
		alignOffset: U,
		arrowPadding: ce ? 0 : m,
		collisionBoundary: d,
		collisionPadding: f,
		sticky: h,
		nodeId: z,
		keepMounted: w,
		disableAnchorTracking: g,
		collisionAvoidance: W,
		shiftCrossAxis: ce && !("side" in W && W.side === "flip"),
		externalTree: O,
		adaptiveOrigin: I ? X : void 0
	});
	Z.useEffect(() => {
		function e(e) {
			e.open && (e.parentNodeId === z && S.set("hoverEnabled", !1), e.nodeId !== z && e.parentNodeId === S.select("floatingParentNodeId") && S.setOpen(!1, v(y)));
		}
		return O.events.on("menuopenchange", e), () => {
			O.events.off("menuopenchange", e);
		};
	}, [
		S,
		O.events,
		z
	]), Z.useEffect(() => {
		if (S.select("floatingParentNodeId") == null) return;
		function e(e) {
			if (e.open || e.nodeId !== S.select("floatingParentNodeId")) return;
			let t = e.reason ?? "sibling-open";
			S.setOpen(!1, v(t));
		}
		return O.events.on("menuopenchange", e), () => {
			O.events.off("menuopenchange", e);
		};
	}, [O.events, S]);
	let q = me();
	Z.useEffect(() => {
		A || q.clear();
	}, [A, q]), Z.useEffect(() => {
		function e(e) {
			if (!(!A || e.nodeId !== S.select("floatingParentNodeId"))) if (e.target && N && N !== e.target) {
				let e = S.select("closeDelay");
				e > 0 ? q.isStarted() || q.start(e, () => {
					S.setOpen(!1, v(y));
				}) : S.setOpen(!1, v(y));
			} else q.clear();
		}
		return O.events.on("itemhover", e), () => {
			O.events.off("itemhover", e);
		};
	}, [
		O.events,
		A,
		N,
		S,
		q
	]), Z.useEffect(() => {
		let e = {
			open: A,
			nodeId: z,
			parentNodeId: B,
			reason: S.select("lastOpenChangeReason")
		};
		O.events.emit("menuopenchange", e);
	}, [
		O.events,
		A,
		S,
		z,
		B
	]), n(() => {
		let e = re, t = ie.current;
		if (e && (ie.current = e), t && e && e !== t) {
			S.set("instantType", void 0);
			let e = new AbortController();
			return V(() => {
				S.set("instantType", "trigger-change");
			}, e.signal), () => {
				e.abort();
			};
		}
	}, [
		re,
		V,
		S
	]);
	let le = {
		open: A,
		side: K.side,
		align: K.align,
		anchorHidden: K.anchorHidden,
		nested: E.type === "menu",
		instant: ee
	}, ue = E.type === "menubar" && E.context.modal;
	Ne(A && (ue || j && te !== "trigger-hover"), M === "touch", F, N);
	let de = we(e, le, {
		styles: K.positionerStyles,
		transitionStatus: P,
		props: x,
		refs: [t, S.useStateSetter("positionerElement")],
		hidden: !k,
		inert: !A
	}), fe = k && E.type !== "menu" && (E.type !== "menubar" && j && te !== "trigger-hover" || E.type === "menubar" && E.context.modal), J = null;
	return E.type === "menubar" ? J = E.context.contentElement : E.type === void 0 && (J = N), /*#__PURE__*/ Le(Be.Provider, {
		value: K,
		children: [fe && /*#__PURE__*/ Q(_e, {
			ref: E.type === "context-menu" || E.type === "nested-context-menu" ? E.context.internalBackdropRef : null,
			inert: je(!A),
			cutout: J
		}), /*#__PURE__*/ Q(ne, {
			id: z,
			children: /*#__PURE__*/ Q(p, {
				elementsRef: S.context.itemDomElements,
				labelsRef: S.context.itemLabels,
				children: de
			})
		})]
	});
});
process.env.NODE_ENV !== "production" && (ut.displayName = "MenuPositioner");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroupContext.js
var dt = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (dt.displayName = "MenuRadioGroupContext");
function ft() {
	let e = Z.useContext(dt);
	if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? u(34) : "Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.");
	return e;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js
var pt = /*#__PURE__*/ Z.memo(/*#__PURE__*/ Z.forwardRef(function(t, n) {
	let { render: r, className: i, value: a, defaultValue: o, onValueChange: s, disabled: c = !1, style: u, "aria-labelledby": f, ...p } = t, [m, h] = Z.useState(void 0), [g, _] = e({
		controlled: a,
		default: o,
		name: "MenuRadioGroup"
	}), v = d((e, t) => {
		s?.(e, t), !t.isCanceled && _(e);
	}), y = l("div", t, {
		state: { disabled: c },
		ref: n,
		props: {
			role: "group",
			"aria-labelledby": f ?? m,
			"aria-disabled": c || void 0,
			...p
		}
	}), b = Z.useMemo(() => ({
		value: g,
		setValue: v,
		disabled: c
	}), [
		g,
		v,
		c
	]);
	return /*#__PURE__*/ Q(et.Provider, {
		value: h,
		children: /*#__PURE__*/ Q(dt.Provider, {
			value: b,
			children: y
		})
	});
}));
process.env.NODE_ENV !== "production" && (pt.displayName = "MenuRadioGroup");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItemContext.js
var mt = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (mt.displayName = "MenuRadioItemContext");
function ht() {
	let e = Z.useContext(mt);
	if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? u(35) : "Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.");
	return e;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js
var gt = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { render: n, className: r, id: i, label: a, nativeButton: o = !1, disabled: s = !1, closeOnClick: c = !1, value: u, style: d, ...p } = e, m = f({ label: a }), g = Ve(!0), _ = x(i), { store: y } = $(), b = y.useState("isActive", m.index), S = y.useState("itemProps"), { value: C, setValue: w, disabled: T } = ft(), E = T || s, D = C === u, { getItemProps: O, itemRef: k } = Ye({
		closeOnClick: c,
		disabled: E,
		highlighted: b,
		id: _,
		store: y,
		nativeButton: o,
		nodeId: g?.context.nodeId,
		itemMetadata: Je
	}), A = Z.useMemo(() => ({
		disabled: E,
		highlighted: b,
		checked: D
	}), [
		E,
		b,
		D
	]);
	function j(e) {
		w(u, v(h, e.nativeEvent, void 0, { preventUnmountOnClose() {} }));
	}
	let M = l("div", e, {
		state: A,
		stateAttributesMapping: Ze,
		props: [
			S,
			{
				role: "menuitemradio",
				"aria-checked": D,
				onClick: j
			},
			p,
			O
		],
		ref: [
			k,
			t,
			m.ref
		]
	});
	return /*#__PURE__*/ Q(mt.Provider, {
		value: A,
		children: M
	});
});
process.env.NODE_ENV !== "production" && (gt.displayName = "MenuRadioItem");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js
var _t = /*#__PURE__*/ Z.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, keepMounted: a = !1, ...o } = e, s = ht(), c = Z.useRef(null), { transitionStatus: u, setMounted: d } = w(s.checked);
	return T({
		open: s.checked,
		ref: c,
		onComplete() {
			s.checked || d(!1);
		}
	}), l("span", e, {
		state: {
			checked: s.checked,
			disabled: s.disabled,
			highlighted: s.highlighted,
			transitionStatus: u
		},
		stateAttributesMapping: Ze,
		ref: [t, c],
		props: {
			"aria-hidden": !0,
			...o
		},
		enabled: a || s.checked
	});
});
process.env.NODE_ENV !== "production" && (_t.displayName = "MenuRadioItemIndicator");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menubar/MenubarContext.js
var vt = /*#__PURE__*/ Z.createContext(null);
process.env.NODE_ENV !== "production" && (vt.displayName = "MenubarContext");
function yt(e) {
	let t = Z.useContext(vt);
	if (t === null && !e) throw Error(process.env.NODE_ENV === "production" ? u(5) : "Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.");
	return t;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/store/MenuStore.js
var bt = {
	...Te,
	disabled: F((e) => e.parent.type === "menubar" && e.parent.context.disabled || e.disabled),
	modal: F((e) => (e.parent.type === void 0 || e.parent.type === "context-menu") && (e.modal ?? !0)),
	openMethod: F((e) => e.openMethod),
	allowMouseEnter: F((e) => e.allowMouseEnter),
	stickIfOpen: F((e) => e.stickIfOpen),
	parent: F((e) => e.parent),
	rootId: F((e) => e.parent.type === "menu" ? e.parent.store.select("rootId") : e.parent.type === void 0 ? e.rootId : e.parent.context.rootId),
	activeIndex: F((e) => e.activeIndex),
	isActive: F((e, t) => e.activeIndex === t),
	hoverEnabled: F((e) => e.hoverEnabled),
	instantType: F((e) => e.instantType),
	lastOpenChangeReason: F((e) => e.openChangeReason),
	floatingTreeRoot: F((e) => e.parent.type === "menu" ? e.parent.store.select("floatingTreeRoot") : e.floatingTreeRoot),
	floatingNodeId: F((e) => e.floatingNodeId),
	floatingParentNodeId: F((e) => e.floatingParentNodeId),
	itemProps: F((e) => e.itemProps),
	closeDelay: F((e) => e.closeDelay),
	hasViewport: F((e) => e.hasViewport),
	keyboardEventRelay: F((e) => {
		if (e.keyboardEventRelay) return e.keyboardEventRelay;
		if (e.parent.type === "menu") return e.parent.store.select("keyboardEventRelay");
	})
}, xt = class e extends le {
	constructor(e) {
		super({
			...St(),
			...e
		}, {
			positionerRef: /*#__PURE__*/ Z.createRef(),
			popupRef: /*#__PURE__*/ Z.createRef(),
			typingRef: { current: !1 },
			itemDomElements: { current: [] },
			itemLabels: { current: [] },
			allowMouseUpTriggerRef: { current: !1 },
			triggerFocusTargetRef: /*#__PURE__*/ Z.createRef(),
			beforeContentFocusGuardRef: /*#__PURE__*/ Z.createRef(),
			onOpenChangeComplete: void 0,
			triggerElements: new G()
		}, bt), this.unsubscribeParentListener = this.observe("parent", (e) => {
			if (this.unsubscribeParentListener?.(), e.type === "menu") {
				let t = e.store.select("rootId"), n = e.store.select("floatingTreeRoot"), r = e.store.select("keyboardEventRelay");
				this.unsubscribeParentListener = e.store.subscribe(() => {
					let i = e.store.select("rootId"), a = e.store.select("floatingTreeRoot"), o = e.store.select("keyboardEventRelay");
					t === i && n === a && r === o || (t = i, n = a, r = o, this.notifyAll());
				}), this.context.allowMouseUpTriggerRef = e.store.context.allowMouseUpTriggerRef;
				return;
			}
			e.type !== void 0 && (this.context.allowMouseUpTriggerRef = e.context.allowMouseUpTriggerRef), this.unsubscribeParentListener = null;
		});
	}
	setOpen(e, t) {
		this.state.floatingRootContext.context.events.emit("setOpen", {
			open: e,
			eventDetails: t
		});
	}
	static useStore(t, n) {
		let r = a(() => new e(n)).current;
		return t ?? r;
	}
	unsubscribeParentListener = null;
};
function St() {
	return {
		...Ee(),
		disabled: !1,
		modal: !0,
		openMethod: null,
		allowMouseEnter: !1,
		stickIfOpen: !0,
		parent: { type: void 0 },
		rootId: void 0,
		activeIndex: null,
		hoverEnabled: !0,
		instantType: void 0,
		openChangeReason: null,
		floatingTreeRoot: new P(),
		floatingNodeId: void 0,
		floatingParentNodeId: null,
		itemProps: s,
		keyboardEventRelay: void 0,
		closeDelay: 0,
		hasViewport: !1
	};
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRootContext.js
var Ct = /*#__PURE__*/ Z.createContext(void 0);
process.env.NODE_ENV !== "production" && (Ct.displayName = "MenuSubmenuRootContext");
function wt() {
	return Z.useContext(Ct);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/root/MenuRoot.js
var Tt = de(function(e) {
	let { children: t, open: i, onOpenChange: a, onOpenChangeComplete: o, defaultOpen: l = !1, disabled: u = !1, modal: f, loopFocus: p = !0, orientation: h = "vertical", actionsRef: _, closeParentOnEsc: y = !1, handle: x, triggerId: S, defaultTriggerId: C = null, highlightItemOnHover: w = !0 } = e, T = We(!0), E = $(!0), D = yt(!0), O = wt(), k = Z.useMemo(() => O && E ? {
		type: "menu",
		store: E.store
	} : D ? {
		type: "menubar",
		context: D
	} : T && !E ? {
		type: "context-menu",
		context: T
	} : { type: void 0 }, [
		T,
		E,
		D,
		O
	]), A = xt.useStore(x?.store, {
		open: l,
		openProp: i,
		activeTriggerId: C,
		triggerIdProp: S,
		parent: k
	});
	B(() => {
		i === void 0 && A.state.open === !1 && l === !0 && A.update({
			open: !0,
			activeTriggerId: C
		});
	}), A.useControlledProp("openProp", i), A.useControlledProp("triggerIdProp", S), A.useContextCallback("onOpenChangeComplete", o);
	let j = b(), M = b(), N = A.useState("floatingTreeRoot"), P = ee(N), F = te(), L = A.useState("open"), R = A.useState("activeTriggerElement"), z = A.useState("positionerElement"), ne = A.useState("hoverEnabled"), re = A.useState("disabled"), ae = A.useState("lastOpenChangeReason"), H = A.useState("parent"), U = A.useState("activeIndex"), oe = A.useState("payload"), se = A.useState("floatingParentNodeId"), G = Z.useRef(null), ce = Z.useRef(H.type !== "context-menu"), le = me(), de = Z.useRef(!0), fe = me(), J = se != null;
	process.env.NODE_ENV !== "production" && H.type !== void 0 && f !== void 0 && console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");
	let { openMethod: pe, triggerProps: Y } = ve(L);
	A.useSyncedValues({
		disabled: u,
		modal: H.type === void 0 ? f : void 0,
		openMethod: pe,
		rootId: j
	}), W(A);
	let { forceUnmount: he } = q(L, A, () => {
		A.update({
			allowMouseEnter: !1,
			stickIfOpen: !0
		});
	});
	n(() => {
		T && !E ? A.update({
			parent: {
				type: "context-menu",
				context: T
			},
			floatingNodeId: P,
			floatingParentNodeId: F
		}) : E && A.update({
			floatingNodeId: P,
			floatingParentNodeId: F
		});
	}, [
		T,
		E,
		P,
		F,
		A
	]), Z.useEffect(() => {
		if (L || (G.current = null), H.type === "context-menu") {
			if (!L) {
				le.clear(), ce.current = !1;
				return;
			}
			le.start(500, () => {
				ce.current = !0;
			});
		}
	}, [
		le,
		L,
		H.type
	]), n(() => {
		!L && !ne && A.set("hoverEnabled", !0);
	}, [
		L,
		ne,
		A
	]);
	let ge = d((e, t) => {
		let n = t.reason;
		if (L === e && t.trigger === R && ae === n || (t.preventUnmountOnClose = () => {
			A.set("preventUnmountingOnClose", !0);
		}, !e && t.trigger == null && (t.trigger = R ?? void 0), a?.(e, t), t.isCanceled)) return;
		A.state.floatingRootContext.dispatchOpenChange(e, t);
		let r = t.event;
		if (e === !1 && r?.type === "click" && r.pointerType === "touch" && !de.current) return;
		if (!e && U !== null) {
			let e = A.context.itemDomElements.current[U];
			queueMicrotask(() => {
				e?.setAttribute("tabindex", "-1");
			});
		}
		e && n === "trigger-focus" ? (de.current = !1, fe.start(300, () => {
			de.current = !0;
		})) : (de.current = !0, fe.clear());
		let i = (n === "trigger-press" || n === "item-press") && r.detail === 0 && r?.isTrusted, o = !e && (n === "escape-key" || n == null), s = {
			open: e,
			openChangeReason: n
		};
		G.current = t.event ?? null;
		let c = t.trigger?.id ?? null;
		(c || e) && (s.activeTriggerId = c, s.activeTriggerElement = t.trigger ?? null), A.update(s), H.type === "menubar" && (n === "trigger-focus" || n === "focus-out" || n === "trigger-hover" || n === "list-navigation" || n === "sibling-open") ? A.set("instantType", "group") : i || o ? A.set("instantType", i ? "click" : "dismiss") : A.set("instantType", void 0);
	}), _e = V({
		popupStore: A,
		floatingId: M,
		nested: F != null,
		onOpenChange: ge
	}), ye = _e.context.events;
	Z.useEffect(() => {
		let e = ({ open: e, eventDetails: t }) => ge(e, t);
		return ye.on("setOpen", e), () => {
			ye?.off("setOpen", e);
		};
	}, [ye, ge]);
	let be = Z.useCallback(() => {
		A.setOpen(!1, v(g));
	}, [A]);
	Z.useImperativeHandle(_, () => ({
		unmount: he,
		close: be
	}), [he, be]);
	let xe;
	H.type === "context-menu" && (xe = H.context), Z.useImperativeHandle(xe?.positionerRef, () => z, [z]), Z.useImperativeHandle(xe?.actionsRef, () => ({ setOpen: ge }), [ge]);
	let X = ue(_e, {
		enabled: !re,
		bubbles: { escapeKey: y && H.type === "menu" },
		outsidePress() {
			return H.type !== "context-menu" || G.current?.type === "contextmenu" ? !0 : ce.current;
		},
		externalTree: J ? N : void 0
	}), Se = m(), Ce = Z.useCallback((e) => {
		A.select("activeIndex") !== e && A.set("activeIndex", e);
	}, [A]), we = ke(_e, {
		enabled: !re,
		listRef: A.context.itemDomElements,
		activeIndex: U,
		nested: H.type !== void 0,
		loopFocus: p,
		orientation: h,
		parentOrientation: H.type === "menubar" ? H.context.orientation : void 0,
		rtl: Se === "rtl",
		disabledIndices: r,
		onNavigate: Ce,
		openOnArrowKeyDown: H.type !== "context-menu",
		externalTree: J ? N : void 0,
		focusItemOnHover: w
	}), Te = Z.useCallback((e) => {
		A.context.typingRef.current = e;
	}, [A]), Ee = Oe(_e, {
		listRef: A.context.itemLabels,
		elementsRef: A.context.itemDomElements,
		activeIndex: U,
		resetMs: 500,
		onMatch: (e) => {
			L && e !== U && A.set("activeIndex", e);
		},
		onTyping: Te
	});
	ie(A, {
		floatingRootContext: _e,
		activeTriggerProps: Z.useMemo(() => {
			let e = c(Ee.reference, we.reference, X.reference, { onMouseMove() {
				A.set("allowMouseEnter", !0);
			} }, Y);
			return e["aria-haspopup"] = "menu", e["aria-expanded"] = L, e;
		}, [
			A,
			Ee.reference,
			we.reference,
			X.reference,
			Y,
			L
		]),
		inactiveTriggerProps: Z.useMemo(() => {
			let e = c(we.trigger, X.trigger, Y);
			return e["aria-haspopup"] = "menu", e["aria-expanded"] = !1, e;
		}, [
			we.trigger,
			X.trigger,
			Y
		]),
		popupProps: Z.useMemo(() => c(K, {
			id: M,
			role: "menu",
			"aria-labelledby": R?.id,
			onMouseMove() {
				A.set("allowMouseEnter", !0), H.type === "menu" && A.set("hoverEnabled", !1);
			},
			onClick() {
				A.select("hoverEnabled") && A.set("hoverEnabled", !1);
			},
			onKeyDown(e) {
				let t = A.select("keyboardEventRelay");
				t && !e.isPropagationStopped() && t(e);
			}
		}, Ee.floating, we.floating, X.floating), [
			R,
			M,
			H.type,
			A,
			Ee.floating,
			we.floating,
			X.floating
		]),
		itemProps: we.item ?? s
	});
	let De = Z.useMemo(() => ({
		store: A,
		parent: k
	}), [A, k]), Ae = /*#__PURE__*/ Q(He.Provider, {
		value: De,
		children: typeof t == "function" ? t({ payload: oe }) : t
	});
	return H.type === void 0 || H.type === "context-menu" ? /*#__PURE__*/ Q(I, {
		externalTree: N,
		children: Ae
	}) : Ae;
});
process.env.NODE_ENV !== "production" && (Tt.displayName = "MenuRoot");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js
function Et(e) {
	let t = $().store, n = Z.useMemo(() => ({ parentMenu: t }), [t]);
	return /*#__PURE__*/ Q(Ct.Provider, {
		value: n,
		children: /*#__PURE__*/ Q(Tt, { ...e })
	});
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/utils/findRootOwnerId.js
function Dt(e) {
	if (O(e) && e.hasAttribute("data-rootownerid")) return e.getAttribute("data-rootownerid") ?? void 0;
	if (!k(e)) return Dt(D(e));
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/utils/useMixedToggleClickHandler.js
function Ot(e) {
	let { enabled: t = !0, mouseDownAction: n, open: r } = e, i = Z.useRef(!1);
	return Z.useMemo(() => t ? {
		onMouseDown: (e) => {
			(n === "open" && !r || n === "close" && r) && (i.current = !0, J(e.currentTarget).addEventListener("click", () => {
				i.current = !1;
			}, { once: !0 }));
		},
		onClick: (e) => {
			i.current && (i.current = !1, e.preventBaseUIHandler());
		}
	} : s, [
		t,
		n,
		r
	]);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js
var kt = 2, At = z(function(e, t) {
	let { render: n, className: r, style: i, disabled: a = !1, nativeButton: o = !0, id: f, openOnHover: p, delay: m = 100, closeDelay: h = 0, handle: g, payload: v, ...y } = e, b = $(!0), S = g?.store ?? b?.store;
	if (!S) throw Error(process.env.NODE_ENV === "production" ? u(85) : "Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.");
	let C = x(f), w = S.useState("isTriggerActive", C), T = S.useState("floatingRootContext"), E = S.useState("isOpenedByTrigger", C), D = S.useState("triggerPopupId", C), O = Z.useRef(null), k = Mt(), M = A(!0), F = oe(), I = Z.useMemo(() => F ?? new P(), [F]), { registerTrigger: L, isMountedByThisTrigger: R } = se(C, O, S, {
		payload: v,
		closeDelay: h,
		parent: k,
		floatingTreeRoot: I,
		floatingNodeId: ee(I),
		floatingParentNodeId: te(),
		keyboardEventRelay: M?.relayKeyboardEvent
	}), z = k.type === "menubar", ne = S.useState("disabled"), B = a || ne || z && k.context.disabled, { getButtonProps: re, buttonRef: ie } = j({
		disabled: B,
		native: o
	});
	Z.useEffect(() => {
		!E && k.type === void 0 && (S.context.allowMouseUpTriggerRef.current = !1);
	}, [
		S,
		E,
		k.type
	]);
	let V = Z.useRef(null), ae = me(), U = d((e) => {
		if (!V.current) return;
		ae.clear(), S.context.allowMouseUpTriggerRef.current = !1;
		let t = e.target;
		if (N(V.current, t) || N(S.select("positionerElement"), t) || t === V.current || t != null && Dt(t) === S.select("rootId")) return;
		let n = Ae(V.current);
		e.clientX >= n.left - kt && e.clientX <= n.right + kt && e.clientY >= n.top - kt && e.clientY <= n.bottom + kt || I.events.emit("close", {
			domEvent: e,
			reason: _
		});
	});
	Z.useEffect(() => {
		E && S.select("lastOpenChangeReason") === "trigger-hover" && J(V.current).addEventListener("mouseup", U, { once: !0 });
	}, [
		E,
		U,
		S
	]);
	let W = z && k.context.hasSubmenuOpen, G = ye(T, {
		enabled: (p ?? W) && !B && k.type !== "context-menu" && (!z || W && !R),
		handleClose: xe({ blockPointerEvents: !z }),
		mouseOnly: !0,
		move: !1,
		restMs: k.type === void 0 ? m : void 0,
		delay: { close: h },
		triggerElementRef: O,
		externalTree: I,
		isActiveTrigger: w,
		isClosing: () => S.select("transitionStatus") === "ending"
	}), ce = jt(E, S.select("lastOpenChangeReason")), K = ge(T, {
		enabled: !B && k.type !== "context-menu",
		event: E && z ? "click" : "mousedown",
		toggle: !0,
		ignoreMouse: !1,
		stickIfOpen: k.type === void 0 ? ce : !1
	}), q = De(T, { enabled: !B && W }), le = Ot({
		open: E,
		enabled: z,
		mouseDownAction: "open"
	}), ue = Z.useMemo(() => c(q.reference, K.reference), [q.reference, K.reference]), de = S.useState("triggerProps", R), { preFocusGuardRef: pe, handlePreFocusGuardFocus: Y, handleFocusTargetFocus: he } = Me(S, O), _e = {
		disabled: B,
		open: E
	}, ve = [
		V,
		t,
		ie,
		L,
		O
	], be = [
		ue,
		G ?? s,
		de,
		{
			"aria-haspopup": "menu",
			"aria-controls": D,
			id: C,
			onMouseDown: (e) => {
				S.select("open") || (ae.start(200, () => {
					S.context.allowMouseUpTriggerRef.current = !0;
				}), J(e.currentTarget).addEventListener("mouseup", U, { once: !0 }));
			}
		},
		z ? { role: "menuitem" } : {},
		le,
		y,
		re
	], X = l("button", e, {
		enabled: !z,
		stateAttributesMapping: H,
		state: _e,
		ref: ve,
		props: be
	});
	return z ? /*#__PURE__*/ Q(Fe, {
		tag: "button",
		render: n,
		className: r,
		style: i,
		state: _e,
		refs: ve,
		props: be,
		stateAttributesMapping: H
	}) : E ? /*#__PURE__*/ Le(Z.Fragment, { children: [
		/*#__PURE__*/ Q(fe, {
			ref: pe,
			onFocus: Y
		}, `${C}-pre-focus-guard`),
		/*#__PURE__*/ Q(Z.Fragment, { children: X }, C),
		/*#__PURE__*/ Q(fe, {
			ref: S.context.triggerFocusTargetRef,
			onFocus: he
		}, `${C}-post-focus-guard`)
	] }) : /*#__PURE__*/ Q(Z.Fragment, { children: X }, C);
});
process.env.NODE_ENV !== "production" && (At.displayName = "MenuTrigger");
function jt(e, t) {
	let r = me(), [i, a] = Z.useState(!1);
	return n(() => {
		e && t === "trigger-hover" ? (a(!0), r.start(500, () => {
			a(!1);
		})) : e || (r.clear(), a(!1));
	}, [
		e,
		t,
		r
	]), i;
}
function Mt() {
	let e = We(!0), t = $(!0), n = yt(!0);
	return Z.useMemo(() => n ? {
		type: "menubar",
		context: n
	} : e && !t ? {
		type: "context-menu",
		context: e
	} : { type: void 0 }, [
		e,
		t,
		n
	]);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js
var Nt = /*#__PURE__*/ Z.forwardRef(function(e, r) {
	let { render: a, className: o, style: c, label: d, id: p, nativeButton: m = !1, openOnHover: h = !0, delay: g = 100, closeDelay: _ = 0, disabled: v = !1, ...y } = e, b = f(), S = Ve(), { store: C } = $(), w = x(p), T = C.useState("open"), D = C.useState("floatingRootContext"), O = C.useState("floatingTreeRoot"), k = C.useState("triggerPopupId", w), A = ae(w, C), j = Z.useCallback((e) => {
		let t = A(e);
		return e !== null && C.select("open") && C.select("activeTriggerId") == null && C.update({
			activeTriggerId: w,
			activeTriggerElement: e,
			closeDelay: _
		}), t;
	}, [
		A,
		_,
		C,
		w
	]), M = Z.useRef(null), N = Z.useCallback((e) => {
		M.current = e, C.set("activeTriggerElement", e);
	}, [C]);
	process.env.NODE_ENV !== "production" && n(() => {
		let e = M.current;
		e && E(e) && !v && i(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${t.captureOwnerStack?.() || ""}`);
	});
	let P = wt();
	if (!P?.parentMenu) throw Error(process.env.NODE_ENV === "production" ? u(37) : "Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.");
	C.useSyncedValue("closeDelay", _);
	let F = P.parentMenu, ee = F.useState("itemProps"), I = F.useState("isActive", b.index), L = Z.useMemo(() => ({
		type: "submenu-trigger",
		setActive() {
			F.set("activeIndex", b.index);
		}
	}), [F, b.index]), R = C.useState("disabled"), te = v || R, { getItemProps: z, itemRef: ne } = Ye({
		closeOnClick: !1,
		disabled: te,
		highlighted: I,
		id: w,
		store: C,
		typingRef: F.context.typingRef,
		nativeButton: m,
		itemMetadata: L,
		nodeId: S?.context.nodeId
	}), B = C.useState("hoverEnabled"), ie = F.useState("allowMouseEnter"), V = ye(D, {
		enabled: B && h && !te,
		handleClose: xe({ blockPointerEvents: !0 }),
		mouseOnly: !0,
		move: !0,
		restMs: g,
		delay: ie ? {
			open: g,
			close: _
		} : 0,
		triggerElementRef: M,
		externalTree: O,
		isClosing: () => C.select("transitionStatus") === "ending"
	}), H = ge(D, {
		enabled: !te,
		event: "mousedown",
		toggle: !h,
		ignoreMouse: h,
		stickIfOpen: !1
	}).reference ?? s, U = C.useState("triggerProps", !0);
	return delete U.id, l("div", e, {
		state: {
			disabled: te,
			highlighted: I,
			open: T
		},
		stateAttributesMapping: re,
		props: [
			H,
			V,
			U,
			ee,
			{
				"aria-controls": k,
				tabIndex: T || I ? 0 : -1,
				onBlur() {
					I && F.set("activeIndex", null);
				}
			},
			y,
			z
		],
		ref: [
			r,
			b.ref,
			ne,
			j,
			N
		]
	});
});
process.env.NODE_ENV !== "production" && (Nt.displayName = "MenuSubmenuTrigger");
//#endregion
//#region lib/components/ui/atoms/dropdown-menu.tsx
function Pt({ ...e }) {
	return /* @__PURE__ */ Q(Tt, {
		"data-slot": "dropdown-menu",
		...e
	});
}
function Ft({ ...e }) {
	return /* @__PURE__ */ Q(lt, {
		"data-slot": "dropdown-menu-portal",
		...e
	});
}
function It({ ...e }) {
	return /* @__PURE__ */ Q(At, {
		"data-slot": "dropdown-menu-trigger",
		...e
	});
}
function Lt({ align: e = "start", alignOffset: t = 0, side: n = "bottom", sideOffset: r = 4, className: i, ...a }) {
	return /* @__PURE__ */ Q(lt, { children: /* @__PURE__ */ Q(ut, {
		align: e,
		alignOffset: t,
		className: "isolate z-50 outline-none",
		side: n,
		sideOffset: r,
		children: /* @__PURE__ */ Q(ot, {
			className: Y("data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-md outline-none ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in data-closed:overflow-hidden", i),
			"data-slot": "dropdown-menu-content",
			...a
		})
	}) });
}
function Rt({ ...e }) {
	return /* @__PURE__ */ Q(nt, {
		"data-slot": "dropdown-menu-group",
		...e
	});
}
function zt({ className: e, inset: t, ...n }) {
	return /* @__PURE__ */ Q(nt, { children: /* @__PURE__ */ Q(rt, {
		className: Y("px-2 py-1.5 font-medium text-muted-foreground text-xs data-inset:pl-8", e),
		"data-inset": t,
		"data-slot": "dropdown-menu-label",
		...n
	}) });
}
function Bt({ className: e, inset: t, variant: n = "default", ...r }) {
	return /* @__PURE__ */ Q(it, {
		className: Y("group/dropdown-menu-item relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive", e),
		"data-inset": t,
		"data-slot": "dropdown-menu-item",
		"data-variant": n,
		...r
	});
}
function Vt({ ...e }) {
	return /* @__PURE__ */ Q(Et, {
		"data-slot": "dropdown-menu-sub",
		...e
	});
}
function Ht({ className: e, inset: t, children: n, ...r }) {
	return /* @__PURE__ */ Le(Nt, {
		className: Y("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-open:bg-accent data-popup-open:bg-accent data-inset:pl-8 data-open:text-accent-foreground data-popup-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
		"data-inset": t,
		"data-slot": "dropdown-menu-sub-trigger",
		...r,
		children: [n, /* @__PURE__ */ Q(ze, { className: "ml-auto" })]
	});
}
function Ut({ align: e = "start", alignOffset: t = -3, side: n = "right", sideOffset: r = 0, className: i, ...a }) {
	return /* @__PURE__ */ Q(Lt, {
		align: e,
		alignOffset: t,
		className: Y("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in", i),
		"data-slot": "dropdown-menu-sub-content",
		side: n,
		sideOffset: r,
		...a
	});
}
function Wt({ className: e, children: t, checked: n, inset: r, ...i }) {
	return /* @__PURE__ */ Le(Qe, {
		checked: n,
		className: Y("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
		"data-inset": r,
		"data-slot": "dropdown-menu-checkbox-item",
		...i,
		children: [/* @__PURE__ */ Q("span", {
			className: "pointer-events-none absolute right-2 flex items-center justify-center",
			"data-slot": "dropdown-menu-checkbox-item-indicator",
			children: /* @__PURE__ */ Q($e, { children: /* @__PURE__ */ Q(Re, {}) })
		}), t]
	});
}
function Gt({ ...e }) {
	return /* @__PURE__ */ Q(pt, {
		"data-slot": "dropdown-menu-radio-group",
		...e
	});
}
function Kt({ className: e, children: t, inset: n, ...r }) {
	return /* @__PURE__ */ Le(gt, {
		className: Y("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
		"data-inset": n,
		"data-slot": "dropdown-menu-radio-item",
		...r,
		children: [/* @__PURE__ */ Q("span", {
			className: "pointer-events-none absolute right-2 flex items-center justify-center",
			"data-slot": "dropdown-menu-radio-item-indicator",
			children: /* @__PURE__ */ Q(_t, { children: /* @__PURE__ */ Q(Re, {}) })
		}), t]
	});
}
function qt({ className: e, ...t }) {
	return /* @__PURE__ */ Q(Ie, {
		className: Y("-mx-1 my-1 h-px bg-border", e),
		"data-slot": "dropdown-menu-separator",
		...t
	});
}
function Jt({ className: e, ...t }) {
	return /* @__PURE__ */ Q("span", {
		className: Y("ml-auto text-muted-foreground text-xs tracking-widest group-focus/dropdown-menu-item:text-accent-foreground", e),
		"data-slot": "dropdown-menu-shortcut",
		...t
	});
}
//#endregion
export { Bt as a, Gt as c, Jt as d, Vt as f, It as h, Rt as i, Kt as l, Ht as m, Wt as n, zt as o, Ut as p, Lt as r, Ft as s, Pt as t, qt as u };
