import { a as e, r as t, t as n } from "./dist-DCjaNViz.js";
import { o as r, r as i, t as a } from "./dist-D-6_qntS.js";
import { t as o } from "./dist-BSqU5QJM.js";
import { t as s } from "./dist-BN9-Ksur.js";
import { t as c } from "./utils-CHlhTiFC.js";
import { r as l, t as u } from "./dist-CniKe8MM.js";
import { i as d, n as f, r as p, t as m } from "./es2015-gSh3xMJF.js";
import { a as h, i as g, n as _, r as v, t as y } from "./dist-CCgkh91X.js";
import * as b from "react";
import x from "react";
import { jsx as S } from "react/jsx-runtime";
//#region node_modules/@radix-ui/react-popover/dist/index.mjs
var C = "Popover", [w, ee] = e(C, [h]), T = h(), [te, E] = w(C), D = (e) => {
	let { __scopePopover: t, children: r, open: i, defaultOpen: a, onOpenChange: o, modal: c = !1 } = e, l = T(t), u = b.useRef(null), [d, f] = b.useState(!1), [p, m] = n({
		prop: i,
		defaultProp: a ?? !1,
		onChange: o,
		caller: C
	});
	return /* @__PURE__ */ S(g, {
		...l,
		children: /* @__PURE__ */ S(te, {
			scope: t,
			contentId: s(),
			triggerRef: u,
			open: p,
			onOpenChange: m,
			onOpenToggle: b.useCallback(() => m((e) => !e), [m]),
			hasCustomAnchor: d,
			onCustomAnchorAdd: b.useCallback(() => f(!0), []),
			onCustomAnchorRemove: b.useCallback(() => f(!1), []),
			modal: c,
			children: r
		})
	});
};
D.displayName = C;
var O = "PopoverAnchor", k = b.forwardRef((e, t) => {
	let { __scopePopover: n, ...r } = e, i = E(O, n), a = T(n), { onCustomAnchorAdd: o, onCustomAnchorRemove: s } = i;
	return b.useEffect(() => (o(), () => s()), [o, s]), /* @__PURE__ */ S(y, {
		...a,
		...r,
		ref: t
	});
});
k.displayName = O;
var A = "PopoverTrigger", j = b.forwardRef((e, n) => {
	let { __scopePopover: i, ...o } = e, s = E(A, i), c = T(i), l = r(n, s.triggerRef), u = /* @__PURE__ */ S(a.button, {
		type: "button",
		"aria-haspopup": "dialog",
		"aria-expanded": s.open,
		"aria-controls": s.contentId,
		"data-state": K(s.open),
		...o,
		ref: l,
		onClick: t(e.onClick, s.onOpenToggle)
	});
	return s.hasCustomAnchor ? u : /* @__PURE__ */ S(y, {
		asChild: !0,
		...c,
		children: u
	});
});
j.displayName = A;
var M = "PopoverPortal", [N, P] = w(M, { forceMount: void 0 }), F = (e) => {
	let { __scopePopover: t, forceMount: n, children: r, container: i } = e, a = E(M, t);
	return /* @__PURE__ */ S(N, {
		scope: t,
		forceMount: n,
		children: /* @__PURE__ */ S(o, {
			present: n || a.open,
			children: /* @__PURE__ */ S(u, {
				asChild: !0,
				container: i,
				children: r
			})
		})
	});
};
F.displayName = M;
var I = "PopoverContent", L = b.forwardRef((e, t) => {
	let n = P(I, e.__scopePopover), { forceMount: r = n.forceMount, ...i } = e, a = E(I, e.__scopePopover);
	return /* @__PURE__ */ S(o, {
		present: r || a.open,
		children: a.modal ? /* @__PURE__ */ S(z, {
			...i,
			ref: t
		}) : /* @__PURE__ */ S(B, {
			...i,
			ref: t
		})
	});
});
L.displayName = I;
var R = i("PopoverContent.RemoveScroll"), z = b.forwardRef((e, n) => {
	let i = E(I, e.__scopePopover), a = b.useRef(null), o = r(n, a), s = b.useRef(!1);
	return b.useEffect(() => {
		let e = a.current;
		if (e) return m(e);
	}, []), /* @__PURE__ */ S(f, {
		as: R,
		allowPinchZoom: !0,
		children: /* @__PURE__ */ S(V, {
			...e,
			ref: o,
			trapFocus: i.open,
			disableOutsidePointerEvents: !0,
			onCloseAutoFocus: t(e.onCloseAutoFocus, (e) => {
				e.preventDefault(), s.current || i.triggerRef.current?.focus();
			}),
			onPointerDownOutside: t(e.onPointerDownOutside, (e) => {
				let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0;
				s.current = t.button === 2 || n;
			}, { checkForDefaultPrevented: !1 }),
			onFocusOutside: t(e.onFocusOutside, (e) => e.preventDefault(), { checkForDefaultPrevented: !1 })
		})
	});
}), B = b.forwardRef((e, t) => {
	let n = E(I, e.__scopePopover), r = b.useRef(!1), i = b.useRef(!1);
	return /* @__PURE__ */ S(V, {
		...e,
		ref: t,
		trapFocus: !1,
		disableOutsidePointerEvents: !1,
		onCloseAutoFocus: (t) => {
			e.onCloseAutoFocus?.(t), t.defaultPrevented || (r.current || n.triggerRef.current?.focus(), t.preventDefault()), r.current = !1, i.current = !1;
		},
		onInteractOutside: (t) => {
			e.onInteractOutside?.(t), t.defaultPrevented || (r.current = !0, t.detail.originalEvent.type === "pointerdown" && (i.current = !0));
			let a = t.target;
			n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
		}
	});
}), V = b.forwardRef((e, t) => {
	let { __scopePopover: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, disableOutsidePointerEvents: o, onEscapeKeyDown: s, onPointerDownOutside: c, onFocusOutside: u, onInteractOutside: f, ...m } = e, h = E(I, n), g = T(n);
	return p(), /* @__PURE__ */ S(d, {
		asChild: !0,
		loop: !0,
		trapped: r,
		onMountAutoFocus: i,
		onUnmountAutoFocus: a,
		children: /* @__PURE__ */ S(l, {
			asChild: !0,
			disableOutsidePointerEvents: o,
			onInteractOutside: f,
			onEscapeKeyDown: s,
			onPointerDownOutside: c,
			onFocusOutside: u,
			onDismiss: () => h.onOpenChange(!1),
			children: /* @__PURE__ */ S(v, {
				"data-state": K(h.open),
				role: "dialog",
				id: h.contentId,
				...g,
				...m,
				ref: t,
				style: {
					...m.style,
					"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
					"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
					"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
					"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
					"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
				}
			})
		})
	});
}), H = "PopoverClose", U = b.forwardRef((e, n) => {
	let { __scopePopover: r, ...i } = e, o = E(H, r);
	return /* @__PURE__ */ S(a.button, {
		type: "button",
		...i,
		ref: n,
		onClick: t(e.onClick, () => o.onOpenChange(!1))
	});
});
U.displayName = H;
var W = "PopoverArrow", G = b.forwardRef((e, t) => {
	let { __scopePopover: n, ...r } = e;
	return /* @__PURE__ */ S(_, {
		...T(n),
		...r,
		ref: t
	});
});
G.displayName = W;
function K(e) {
	return e ? "open" : "closed";
}
var q = D, J = k, Y = j, X = F, Z = L, Q = q, ne = Y, re = J, $ = x.forwardRef(({ className: e, align: t = "center", sideOffset: n = 4, ...r }, i) => /* @__PURE__ */ S(X, { children: /* @__PURE__ */ S(Z, {
	...r,
	ref: i,
	align: t,
	sideOffset: n,
	className: c("h-auto z-50 w-72 border border-primary-gray-300 dark:border-primary-gray-550 text-sm bg-primary-gray-100 dark:bg-primary-gray-650 p-3 text-primary-black dark:text-primary-white outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", e)
}) }));
$.displayName = Z.displayName;
//#endregion
export { ne as i, re as n, $ as r, Q as t };

//# sourceMappingURL=popover-Cqeti5H9.js.map