import { a as e, n as t, r as n, t as r } from "./dist-DCjaNViz.js";
import { o as i, r as a, t as o } from "./dist-D-6_qntS.js";
import { t as s } from "./dist-DjSP8Xx2.js";
import { t as c } from "./dist-BN9-Ksur.js";
import { t as l } from "./dist-o21Z8vCD.js";
import { t as u } from "./utils-CHlhTiFC.js";
import { t as d } from "./check-BgqCbxkW.js";
import { t as f } from "./chevron-down-DnbuLcwD.js";
import { t as p } from "./dist-CGH4Pssf.js";
import { t as m } from "./dist-C-DOdUAW.js";
import { r as h, t as g } from "./dist-CniKe8MM.js";
import { i as _, n as v, r as y, t as b } from "./es2015-gSh3xMJF.js";
import { a as x, i as S, n as C, r as w, t as T } from "./dist-CCgkh91X.js";
import { n as E } from "./dist-Dw21-wvw.js";
import { t as D } from "./icons-BfoqXvPq.js";
import * as O from "react";
import k from "react";
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
import * as N from "react-dom";
//#region node_modules/@radix-ui/number/dist/index.mjs
function P(e, [t, n]) {
	return Math.min(n, Math.max(t, e));
}
//#endregion
//#region node_modules/@radix-ui/react-select/dist/index.mjs
var ee = [
	" ",
	"Enter",
	"ArrowUp",
	"ArrowDown"
], F = [" ", "Enter"], I = "Select", [L, R, te] = s(I), [z, B] = e(I, [te, x]), V = x(), [H, U] = z(I), [W, ne] = z(I), G = (e) => {
	let { __scopeSelect: t, children: n, open: i, defaultOpen: a, onOpenChange: o, value: s, defaultValue: u, onValueChange: d, dir: f, name: p, autoComplete: m, disabled: h, required: g, form: _ } = e, v = V(t), [y, b] = O.useState(null), [x, C] = O.useState(null), [w, T] = O.useState(!1), E = l(f), [D, k] = r({
		prop: i,
		defaultProp: a ?? !1,
		onChange: o,
		caller: I
	}), [A, N] = r({
		prop: s,
		defaultProp: u,
		onChange: d,
		caller: I
	}), P = O.useRef(null), ee = y ? _ || !!y.closest("form") : !0, [F, R] = O.useState(/* @__PURE__ */ new Set()), te = Array.from(F).map((e) => e.props.value).join(";");
	return /* @__PURE__ */ j(S, {
		...v,
		children: /* @__PURE__ */ M(H, {
			required: g,
			scope: t,
			trigger: y,
			onTriggerChange: b,
			valueNode: x,
			onValueNodeChange: C,
			valueNodeHasChildren: w,
			onValueNodeHasChildrenChange: T,
			contentId: c(),
			value: A,
			onValueChange: N,
			open: D,
			onOpenChange: k,
			dir: E,
			triggerPointerDownPosRef: P,
			disabled: h,
			children: [/* @__PURE__ */ j(L.Provider, {
				scope: t,
				children: /* @__PURE__ */ j(W, {
					scope: e.__scopeSelect,
					onNativeOptionAdd: O.useCallback((e) => {
						R((t) => new Set(t).add(e));
					}, []),
					onNativeOptionRemove: O.useCallback((e) => {
						R((t) => {
							let n = new Set(t);
							return n.delete(e), n;
						});
					}, []),
					children: n
				})
			}), ee ? /* @__PURE__ */ M(Ue, {
				"aria-hidden": !0,
				required: g,
				tabIndex: -1,
				name: p,
				autoComplete: m,
				value: A,
				onChange: (e) => N(e.target.value),
				disabled: h,
				form: _,
				children: [A === void 0 ? /* @__PURE__ */ j("option", { value: "" }) : null, Array.from(F)]
			}, te) : null]
		})
	});
};
G.displayName = I;
var K = "SelectTrigger", q = O.forwardRef((e, t) => {
	let { __scopeSelect: r, disabled: a = !1, ...s } = e, c = V(r), l = U(K, r), u = l.disabled || a, d = i(t, l.onTriggerChange), f = R(r), p = O.useRef("touch"), [m, h, g] = Ge((e) => {
		let t = f().filter((e) => !e.disabled), n = Ke(t, e, t.find((e) => e.value === l.value));
		n !== void 0 && l.onValueChange(n.value);
	}), _ = (e) => {
		u || (l.onOpenChange(!0), g()), e && (l.triggerPointerDownPosRef.current = {
			x: Math.round(e.pageX),
			y: Math.round(e.pageY)
		});
	};
	return /* @__PURE__ */ j(T, {
		asChild: !0,
		...c,
		children: /* @__PURE__ */ j(o.button, {
			type: "button",
			role: "combobox",
			"aria-controls": l.contentId,
			"aria-expanded": l.open,
			"aria-required": l.required,
			"aria-autocomplete": "none",
			dir: l.dir,
			"data-state": l.open ? "open" : "closed",
			disabled: u,
			"data-disabled": u ? "" : void 0,
			"data-placeholder": We(l.value) ? "" : void 0,
			...s,
			ref: d,
			onClick: n(s.onClick, (e) => {
				e.currentTarget.focus(), p.current !== "mouse" && _(e);
			}),
			onPointerDown: n(s.onPointerDown, (e) => {
				p.current = e.pointerType;
				let t = e.target;
				t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), e.button === 0 && e.ctrlKey === !1 && e.pointerType === "mouse" && (_(e), e.preventDefault());
			}),
			onKeyDown: n(s.onKeyDown, (e) => {
				let t = m.current !== "";
				!(e.ctrlKey || e.altKey || e.metaKey) && e.key.length === 1 && h(e.key), !(t && e.key === " ") && ee.includes(e.key) && (_(), e.preventDefault());
			})
		})
	});
});
q.displayName = K;
var re = "SelectValue", J = O.forwardRef((e, n) => {
	let { __scopeSelect: r, className: a, style: s, children: c, placeholder: l = "", ...u } = e, d = U(re, r), { onValueNodeHasChildrenChange: f } = d, p = c !== void 0, m = i(n, d.onValueNodeChange);
	return t(() => {
		f(p);
	}, [f, p]), /* @__PURE__ */ j(o.span, {
		...u,
		ref: m,
		style: { pointerEvents: "none" },
		children: We(d.value) ? /* @__PURE__ */ j(A, { children: l }) : c
	});
});
J.displayName = re;
var ie = "SelectIcon", ae = O.forwardRef((e, t) => {
	let { __scopeSelect: n, children: r, ...i } = e;
	return /* @__PURE__ */ j(o.span, {
		"aria-hidden": !0,
		...i,
		ref: t,
		children: r || "▼"
	});
});
ae.displayName = ie;
var oe = "SelectPortal", se = (e) => /* @__PURE__ */ j(g, {
	asChild: !0,
	...e
});
se.displayName = oe;
var Y = "SelectContent", ce = O.forwardRef((e, n) => {
	let r = U(Y, e.__scopeSelect), [i, a] = O.useState();
	if (t(() => {
		a(new DocumentFragment());
	}, []), !r.open) {
		let t = i;
		return t ? N.createPortal(/* @__PURE__ */ j(le, {
			scope: e.__scopeSelect,
			children: /* @__PURE__ */ j(L.Slot, {
				scope: e.__scopeSelect,
				children: /* @__PURE__ */ j("div", { children: e.children })
			})
		}), t) : null;
	}
	return /* @__PURE__ */ j(fe, {
		...e,
		ref: n
	});
});
ce.displayName = Y;
var X = 10, [le, Z] = z(Y), ue = "SelectContentImpl", de = a("SelectContent.RemoveScroll"), fe = O.forwardRef((e, t) => {
	let { __scopeSelect: r, position: a = "item-aligned", onCloseAutoFocus: o, onEscapeKeyDown: s, onPointerDownOutside: c, side: l, sideOffset: u, align: d, alignOffset: f, arrowPadding: p, collisionBoundary: m, collisionPadding: g, sticky: x, hideWhenDetached: S, avoidCollisions: C, ...w } = e, T = U(Y, r), [E, D] = O.useState(null), [k, A] = O.useState(null), M = i(t, (e) => D(e)), [N, P] = O.useState(null), [ee, F] = O.useState(null), I = R(r), [L, te] = O.useState(!1), z = O.useRef(!1);
	O.useEffect(() => {
		if (E) return b(E);
	}, [E]), y();
	let B = O.useCallback((e) => {
		let [t, ...n] = I().map((e) => e.ref.current), [r] = n.slice(-1), i = document.activeElement;
		for (let n of e) if (n === i || (n?.scrollIntoView({ block: "nearest" }), n === t && k && (k.scrollTop = 0), n === r && k && (k.scrollTop = k.scrollHeight), n?.focus(), document.activeElement !== i)) return;
	}, [I, k]), V = O.useCallback(() => B([N, E]), [
		B,
		N,
		E
	]);
	O.useEffect(() => {
		L && V();
	}, [L, V]);
	let { onOpenChange: H, triggerPointerDownPosRef: W } = T;
	O.useEffect(() => {
		if (E) {
			let e = {
				x: 0,
				y: 0
			}, t = (t) => {
				e = {
					x: Math.abs(Math.round(t.pageX) - (W.current?.x ?? 0)),
					y: Math.abs(Math.round(t.pageY) - (W.current?.y ?? 0))
				};
			}, n = (n) => {
				e.x <= 10 && e.y <= 10 ? n.preventDefault() : E.contains(n.target) || H(!1), document.removeEventListener("pointermove", t), W.current = null;
			};
			return W.current !== null && (document.addEventListener("pointermove", t), document.addEventListener("pointerup", n, {
				capture: !0,
				once: !0
			})), () => {
				document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", n, { capture: !0 });
			};
		}
	}, [
		E,
		H,
		W
	]), O.useEffect(() => {
		let e = () => H(!1);
		return window.addEventListener("blur", e), window.addEventListener("resize", e), () => {
			window.removeEventListener("blur", e), window.removeEventListener("resize", e);
		};
	}, [H]);
	let [ne, G] = Ge((e) => {
		let t = I().filter((e) => !e.disabled), n = Ke(t, e, t.find((e) => e.ref.current === document.activeElement));
		n && setTimeout(() => n.ref.current.focus());
	}), K = O.useCallback((e, t, n) => {
		let r = !z.current && !n;
		(T.value !== void 0 && T.value === t || r) && (P(e), r && (z.current = !0));
	}, [T.value]), q = O.useCallback(() => E?.focus(), [E]), re = O.useCallback((e, t, n) => {
		let r = !z.current && !n;
		(T.value !== void 0 && T.value === t || r) && F(e);
	}, [T.value]), J = a === "popper" ? ge : me, ie = J === ge ? {
		side: l,
		sideOffset: u,
		align: d,
		alignOffset: f,
		arrowPadding: p,
		collisionBoundary: m,
		collisionPadding: g,
		sticky: x,
		hideWhenDetached: S,
		avoidCollisions: C
	} : {};
	return /* @__PURE__ */ j(le, {
		scope: r,
		content: E,
		viewport: k,
		onViewportChange: A,
		itemRefCallback: K,
		selectedItem: N,
		onItemLeave: q,
		itemTextRefCallback: re,
		focusSelectedItem: V,
		selectedItemText: ee,
		position: a,
		isPositioned: L,
		searchRef: ne,
		children: /* @__PURE__ */ j(v, {
			as: de,
			allowPinchZoom: !0,
			children: /* @__PURE__ */ j(_, {
				asChild: !0,
				trapped: T.open,
				onMountAutoFocus: (e) => {
					e.preventDefault();
				},
				onUnmountAutoFocus: n(o, (e) => {
					T.trigger?.focus({ preventScroll: !0 }), e.preventDefault();
				}),
				children: /* @__PURE__ */ j(h, {
					asChild: !0,
					disableOutsidePointerEvents: !0,
					onEscapeKeyDown: s,
					onPointerDownOutside: c,
					onFocusOutside: (e) => e.preventDefault(),
					onDismiss: () => T.onOpenChange(!1),
					children: /* @__PURE__ */ j(J, {
						role: "listbox",
						id: T.contentId,
						"data-state": T.open ? "open" : "closed",
						dir: T.dir,
						onContextMenu: (e) => e.preventDefault(),
						...w,
						...ie,
						onPlaced: () => te(!0),
						ref: M,
						style: {
							display: "flex",
							flexDirection: "column",
							outline: "none",
							...w.style
						},
						onKeyDown: n(w.onKeyDown, (e) => {
							let t = e.ctrlKey || e.altKey || e.metaKey;
							if (e.key === "Tab" && e.preventDefault(), !t && e.key.length === 1 && G(e.key), [
								"ArrowUp",
								"ArrowDown",
								"Home",
								"End"
							].includes(e.key)) {
								let t = I().filter((e) => !e.disabled).map((e) => e.ref.current);
								if (["ArrowUp", "End"].includes(e.key) && (t = t.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(e.key)) {
									let n = e.target, r = t.indexOf(n);
									t = t.slice(r + 1);
								}
								setTimeout(() => B(t)), e.preventDefault();
							}
						})
					})
				})
			})
		})
	});
});
fe.displayName = ue;
var pe = "SelectItemAlignedPosition", me = O.forwardRef((e, n) => {
	let { __scopeSelect: r, onPlaced: a, ...s } = e, c = U(Y, r), l = Z(Y, r), [u, d] = O.useState(null), [f, p] = O.useState(null), m = i(n, (e) => p(e)), h = R(r), g = O.useRef(!1), _ = O.useRef(!0), { viewport: v, selectedItem: y, selectedItemText: b, focusSelectedItem: x } = l, S = O.useCallback(() => {
		if (c.trigger && c.valueNode && u && f && v && y && b) {
			let e = c.trigger.getBoundingClientRect(), t = f.getBoundingClientRect(), n = c.valueNode.getBoundingClientRect(), r = b.getBoundingClientRect();
			if (c.dir !== "rtl") {
				let i = r.left - t.left, a = n.left - i, o = e.left - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = P(a, [X, Math.max(X, l - c)]);
				u.style.minWidth = s + "px", u.style.left = d + "px";
			} else {
				let i = t.right - r.right, a = window.innerWidth - n.right - i, o = window.innerWidth - e.right - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = P(a, [X, Math.max(X, l - c)]);
				u.style.minWidth = s + "px", u.style.right = d + "px";
			}
			let i = h(), o = window.innerHeight - X * 2, s = v.scrollHeight, l = window.getComputedStyle(f), d = parseInt(l.borderTopWidth, 10), p = parseInt(l.paddingTop, 10), m = parseInt(l.borderBottomWidth, 10), _ = parseInt(l.paddingBottom, 10), x = d + p + s + _ + m, S = Math.min(y.offsetHeight * 5, x), C = window.getComputedStyle(v), w = parseInt(C.paddingTop, 10), T = parseInt(C.paddingBottom, 10), E = e.top + e.height / 2 - X, D = o - E, O = y.offsetHeight / 2, k = y.offsetTop + O, A = d + p + k, j = x - A;
			if (A <= E) {
				let e = i.length > 0 && y === i[i.length - 1].ref.current;
				u.style.bottom = "0px";
				let t = f.clientHeight - v.offsetTop - v.offsetHeight, n = A + Math.max(D, O + (e ? T : 0) + t + m);
				u.style.height = n + "px";
			} else {
				let e = i.length > 0 && y === i[0].ref.current;
				u.style.top = "0px";
				let t = Math.max(E, d + v.offsetTop + (e ? w : 0) + O) + j;
				u.style.height = t + "px", v.scrollTop = A - E + v.offsetTop;
			}
			u.style.margin = `${X}px 0`, u.style.minHeight = S + "px", u.style.maxHeight = o + "px", a?.(), requestAnimationFrame(() => g.current = !0);
		}
	}, [
		h,
		c.trigger,
		c.valueNode,
		u,
		f,
		v,
		y,
		b,
		c.dir,
		a
	]);
	t(() => S(), [S]);
	let [C, w] = O.useState();
	return t(() => {
		f && w(window.getComputedStyle(f).zIndex);
	}, [f]), /* @__PURE__ */ j(_e, {
		scope: r,
		contentWrapper: u,
		shouldExpandOnScrollRef: g,
		onScrollButtonChange: O.useCallback((e) => {
			e && _.current === !0 && (S(), x?.(), _.current = !1);
		}, [S, x]),
		children: /* @__PURE__ */ j("div", {
			ref: d,
			style: {
				display: "flex",
				flexDirection: "column",
				position: "fixed",
				zIndex: C
			},
			children: /* @__PURE__ */ j(o.div, {
				...s,
				ref: m,
				style: {
					boxSizing: "border-box",
					maxHeight: "100%",
					...s.style
				}
			})
		})
	});
});
me.displayName = pe;
var he = "SelectPopperPosition", ge = O.forwardRef((e, t) => {
	let { __scopeSelect: n, align: r = "start", collisionPadding: i = X, ...a } = e;
	return /* @__PURE__ */ j(w, {
		...V(n),
		...a,
		ref: t,
		align: r,
		collisionPadding: i,
		style: {
			boxSizing: "border-box",
			...a.style,
			"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
			"--radix-select-content-available-width": "var(--radix-popper-available-width)",
			"--radix-select-content-available-height": "var(--radix-popper-available-height)",
			"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
			"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
		}
	});
});
ge.displayName = he;
var [_e, ve] = z(Y, {}), ye = "SelectViewport", be = O.forwardRef((e, t) => {
	let { __scopeSelect: r, nonce: a, ...s } = e, c = Z(ye, r), l = ve(ye, r), u = i(t, c.onViewportChange), d = O.useRef(0);
	return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("style", {
		dangerouslySetInnerHTML: { __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}" },
		nonce: a
	}), /* @__PURE__ */ j(L.Slot, {
		scope: r,
		children: /* @__PURE__ */ j(o.div, {
			"data-radix-select-viewport": "",
			role: "presentation",
			...s,
			ref: u,
			style: {
				position: "relative",
				flex: 1,
				overflow: "hidden auto",
				...s.style
			},
			onScroll: n(s.onScroll, (e) => {
				let t = e.currentTarget, { contentWrapper: n, shouldExpandOnScrollRef: r } = l;
				if (r?.current && n) {
					let e = Math.abs(d.current - t.scrollTop);
					if (e > 0) {
						let r = window.innerHeight - X * 2, i = parseFloat(n.style.minHeight), a = parseFloat(n.style.height), o = Math.max(i, a);
						if (o < r) {
							let i = o + e, a = Math.min(r, i), s = i - a;
							n.style.height = a + "px", n.style.bottom === "0px" && (t.scrollTop = s > 0 ? s : 0, n.style.justifyContent = "flex-end");
						}
					}
				}
				d.current = t.scrollTop;
			})
		})
	})] });
});
be.displayName = ye;
var xe = "SelectGroup", [Se, Ce] = z(xe), we = O.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e, i = c();
	return /* @__PURE__ */ j(Se, {
		scope: n,
		id: i,
		children: /* @__PURE__ */ j(o.div, {
			role: "group",
			"aria-labelledby": i,
			...r,
			ref: t
		})
	});
});
we.displayName = xe;
var Te = "SelectLabel", Ee = O.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e, i = Ce(Te, n);
	return /* @__PURE__ */ j(o.div, {
		id: i.id,
		...r,
		ref: t
	});
});
Ee.displayName = Te;
var Q = "SelectItem", [De, Oe] = z(Q), ke = O.forwardRef((e, t) => {
	let { __scopeSelect: r, value: a, disabled: s = !1, textValue: l, ...u } = e, d = U(Q, r), f = Z(Q, r), p = d.value === a, [m, h] = O.useState(l ?? ""), [g, _] = O.useState(!1), v = i(t, (e) => f.itemRefCallback?.(e, a, s)), y = c(), b = O.useRef("touch"), x = () => {
		s || (d.onValueChange(a), d.onOpenChange(!1));
	};
	if (a === "") throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
	return /* @__PURE__ */ j(De, {
		scope: r,
		value: a,
		disabled: s,
		textId: y,
		isSelected: p,
		onItemTextChange: O.useCallback((e) => {
			h((t) => t || (e?.textContent ?? "").trim());
		}, []),
		children: /* @__PURE__ */ j(L.ItemSlot, {
			scope: r,
			value: a,
			disabled: s,
			textValue: m,
			children: /* @__PURE__ */ j(o.div, {
				role: "option",
				"aria-labelledby": y,
				"data-highlighted": g ? "" : void 0,
				"aria-selected": p && g,
				"data-state": p ? "checked" : "unchecked",
				"aria-disabled": s || void 0,
				"data-disabled": s ? "" : void 0,
				tabIndex: s ? void 0 : -1,
				...u,
				ref: v,
				onFocus: n(u.onFocus, () => _(!0)),
				onBlur: n(u.onBlur, () => _(!1)),
				onClick: n(u.onClick, () => {
					b.current !== "mouse" && x();
				}),
				onPointerUp: n(u.onPointerUp, () => {
					b.current === "mouse" && x();
				}),
				onPointerDown: n(u.onPointerDown, (e) => {
					b.current = e.pointerType;
				}),
				onPointerMove: n(u.onPointerMove, (e) => {
					b.current = e.pointerType, s ? f.onItemLeave?.() : b.current === "mouse" && e.currentTarget.focus({ preventScroll: !0 });
				}),
				onPointerLeave: n(u.onPointerLeave, (e) => {
					e.currentTarget === document.activeElement && f.onItemLeave?.();
				}),
				onKeyDown: n(u.onKeyDown, (e) => {
					f.searchRef?.current !== "" && e.key === " " || (F.includes(e.key) && x(), e.key === " " && e.preventDefault());
				})
			})
		})
	});
});
ke.displayName = Q;
var $ = "SelectItemText", Ae = O.forwardRef((e, n) => {
	let { __scopeSelect: r, className: a, style: s, ...c } = e, l = U($, r), u = Z($, r), d = Oe($, r), f = ne($, r), [p, m] = O.useState(null), h = i(n, (e) => m(e), d.onItemTextChange, (e) => u.itemTextRefCallback?.(e, d.value, d.disabled)), g = p?.textContent, _ = O.useMemo(() => /* @__PURE__ */ j("option", {
		value: d.value,
		disabled: d.disabled,
		children: g
	}, d.value), [
		d.disabled,
		d.value,
		g
	]), { onNativeOptionAdd: v, onNativeOptionRemove: y } = f;
	return t(() => (v(_), () => y(_)), [
		v,
		y,
		_
	]), /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(o.span, {
		id: d.textId,
		...c,
		ref: h
	}), d.isSelected && l.valueNode && !l.valueNodeHasChildren ? N.createPortal(c.children, l.valueNode) : null] });
});
Ae.displayName = $;
var je = "SelectItemIndicator", Me = O.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e;
	return Oe(je, n).isSelected ? /* @__PURE__ */ j(o.span, {
		"aria-hidden": !0,
		...r,
		ref: t
	}) : null;
});
Me.displayName = je;
var Ne = "SelectScrollUpButton", Pe = O.forwardRef((e, n) => {
	let r = Z(Ne, e.__scopeSelect), a = ve(Ne, e.__scopeSelect), [o, s] = O.useState(!1), c = i(n, a.onScrollButtonChange);
	return t(() => {
		if (r.viewport && r.isPositioned) {
			let e = function() {
				s(t.scrollTop > 0);
			}, t = r.viewport;
			return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
		}
	}, [r.viewport, r.isPositioned]), o ? /* @__PURE__ */ j(Le, {
		...e,
		ref: c,
		onAutoScroll: () => {
			let { viewport: e, selectedItem: t } = r;
			e && t && (e.scrollTop -= t.offsetHeight);
		}
	}) : null;
});
Pe.displayName = Ne;
var Fe = "SelectScrollDownButton", Ie = O.forwardRef((e, n) => {
	let r = Z(Fe, e.__scopeSelect), a = ve(Fe, e.__scopeSelect), [o, s] = O.useState(!1), c = i(n, a.onScrollButtonChange);
	return t(() => {
		if (r.viewport && r.isPositioned) {
			let e = function() {
				let e = t.scrollHeight - t.clientHeight;
				s(Math.ceil(t.scrollTop) < e);
			}, t = r.viewport;
			return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
		}
	}, [r.viewport, r.isPositioned]), o ? /* @__PURE__ */ j(Le, {
		...e,
		ref: c,
		onAutoScroll: () => {
			let { viewport: e, selectedItem: t } = r;
			e && t && (e.scrollTop += t.offsetHeight);
		}
	}) : null;
});
Ie.displayName = Fe;
var Le = O.forwardRef((e, r) => {
	let { __scopeSelect: i, onAutoScroll: a, ...s } = e, c = Z("SelectScrollButton", i), l = O.useRef(null), u = R(i), d = O.useCallback(() => {
		l.current !== null && (window.clearInterval(l.current), l.current = null);
	}, []);
	return O.useEffect(() => () => d(), [d]), t(() => {
		u().find((e) => e.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
	}, [u]), /* @__PURE__ */ j(o.div, {
		"aria-hidden": !0,
		...s,
		ref: r,
		style: {
			flexShrink: 0,
			...s.style
		},
		onPointerDown: n(s.onPointerDown, () => {
			l.current === null && (l.current = window.setInterval(a, 50));
		}),
		onPointerMove: n(s.onPointerMove, () => {
			c.onItemLeave?.(), l.current === null && (l.current = window.setInterval(a, 50));
		}),
		onPointerLeave: n(s.onPointerLeave, () => {
			d();
		})
	});
}), Re = "SelectSeparator", ze = O.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e;
	return /* @__PURE__ */ j(o.div, {
		"aria-hidden": !0,
		...r,
		ref: t
	});
});
ze.displayName = Re;
var Be = "SelectArrow", Ve = O.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e, i = V(n), a = U(Be, n), o = Z(Be, n);
	return a.open && o.position === "popper" ? /* @__PURE__ */ j(C, {
		...i,
		...r,
		ref: t
	}) : null;
});
Ve.displayName = Be;
var He = "SelectBubbleInput", Ue = O.forwardRef(({ __scopeSelect: e, value: t, ...n }, r) => {
	let a = O.useRef(null), s = i(r, a), c = p(t);
	return O.useEffect(() => {
		let e = a.current;
		if (!e) return;
		let n = window.HTMLSelectElement.prototype, r = Object.getOwnPropertyDescriptor(n, "value").set;
		if (c !== t && r) {
			let n = new Event("change", { bubbles: !0 });
			r.call(e, t), e.dispatchEvent(n);
		}
	}, [c, t]), /* @__PURE__ */ j(o.select, {
		...n,
		style: {
			...E,
			...n.style
		},
		ref: s,
		defaultValue: t
	});
});
Ue.displayName = He;
function We(e) {
	return e === "" || e === void 0;
}
function Ge(e) {
	let t = m(e), n = O.useRef(""), r = O.useRef(0), i = O.useCallback((e) => {
		let i = n.current + e;
		t(i), (function e(t) {
			n.current = t, window.clearTimeout(r.current), t !== "" && (r.current = window.setTimeout(() => e(""), 1e3));
		})(i);
	}, [t]), a = O.useCallback(() => {
		n.current = "", window.clearTimeout(r.current);
	}, []);
	return O.useEffect(() => () => window.clearTimeout(r.current), []), [
		n,
		i,
		a
	];
}
function Ke(e, t, n) {
	let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a = qe(e, Math.max(i, 0));
	r.length === 1 && (a = a.filter((e) => e !== n));
	let o = a.find((e) => e.textValue.toLowerCase().startsWith(r.toLowerCase()));
	return o === n ? void 0 : o;
}
function qe(e, t) {
	return e.map((n, r) => e[(t + r) % e.length]);
}
var Je = G, Ye = q, Xe = J, Ze = ae, Qe = se, $e = ce, et = be, tt = ke, nt = Ae, rt = Me, it = Je, at = Xe, ot = k.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ M(Ye, {
	ref: r,
	className: u("cursor-pointer flex h-9 flex gap-2 rtl:[direction:rtl] items-center text-primary-blue-600 hover:text-primary-blue-400 dark:text-primary-white dark:hover:text-primary-white uppercase font-semibold text-sm justify-between whitespace-nowrap bg-transparent p-0 data-[placeholder]:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", "[&[data-state=open]>.lucide-chevron-down]:rotate-180", e),
	...n,
	children: [
		/* @__PURE__ */ j(D, {}),
		t,
		/* @__PURE__ */ j(Ze, {
			asChild: !0,
			children: /* @__PURE__ */ j(f, { className: "h-6 w-6 transition-transform duration-200" })
		})
	]
}));
ot.displayName = Ye.displayName;
var st = k.forwardRef(({ className: e, children: t, position: n = "popper", inPortal: r = !1, ...i }, a) => {
	let o = /* @__PURE__ */ j($e, {
		ref: a,
		className: u("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-primary-white dark:bg-primary-gray-650 text-popover-foreground shadow-md 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 origin-[--radix-select-content-transform-origin]", n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", e),
		position: n,
		...i,
		children: /* @__PURE__ */ j(et, {
			className: u(n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
			children: t
		})
	});
	return r ? /* @__PURE__ */ j(Qe, { children: o }) : o;
});
st.displayName = $e.displayName;
var ct = k.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ M(tt, {
	ref: r,
	className: u("relative flex w-full cursor-default select-none items-center py-3 px-4 text-sm uppercase font-semibold outline-none border-b border-primary-gray-400 [&:last-of-type]:border-b-0 dark:border-primary-gray-550 focus:bg-primary-gray-400 dark:focus:bg-primary-gray-550  data-[disabled]:pointer-events-none data-[disabled]:opacity-50", e),
	...n,
	children: [/* @__PURE__ */ j("span", {
		className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center",
		children: /* @__PURE__ */ j(rt, { children: /* @__PURE__ */ j(d, { className: "h-4 w-4" }) })
	}), /* @__PURE__ */ j(nt, { children: t })]
}));
ct.displayName = tt.displayName;
//#endregion
//#region src/components/ui/LanguageSwitcher/index.tsx
function lt(e) {
	let { options: t, value: n, onValueChange: r, defaultValue: i, inPortal: a = !1 } = e;
	return /* @__PURE__ */ M(it, {
		onValueChange: r,
		value: n,
		defaultValue: i,
		children: [/* @__PURE__ */ j(ot, { children: /* @__PURE__ */ j(at, {}) }), /* @__PURE__ */ j(st, {
			inPortal: a,
			children: t.map((e) => /* @__PURE__ */ j(ct, {
				value: e.id,
				children: e.label
			}, e.id))
		})]
	});
}
//#endregion
export { lt as t };

//# sourceMappingURL=LanguageSwitcher-CvEA2zY_.js.map