import { t as e } from "./utils-B7XIe3qq.js";
import { t } from "./dist-BCCeHAQm.js";
import { a as n, o as r, t as i } from "./dist-koa_pEtu.js";
import { t as a } from "./dist-C0wG5dwG.js";
import { t as o } from "./dist-CVCn7F_m.js";
import { n as s, r as c, t as l } from "./dist-B1veE5DO.js";
import * as u from "react";
import d from "react";
import { jsx as f } from "react/jsx-runtime";
//#region node_modules/@radix-ui/react-toggle/dist/index.mjs
var p = "Toggle", m = u.forwardRef((e, t) => {
	let { pressed: n, defaultPressed: o, onPressedChange: s, ...c } = e, [l, u] = a({
		prop: n,
		onChange: s,
		defaultProp: o ?? !1,
		caller: p
	});
	return /* @__PURE__ */ f(i.button, {
		type: "button",
		"aria-pressed": l,
		"data-state": l ? "on" : "off",
		"data-disabled": e.disabled ? "" : void 0,
		...c,
		ref: t,
		onClick: r(e.onClick, () => {
			e.disabled || u(!l);
		})
	});
});
m.displayName = p;
var h = m, g = "ToggleGroup", [_, v] = n(g, [c]), y = c(), b = d.forwardRef((e, t) => {
	let { type: n, ...r } = e;
	if (n === "single") return /* @__PURE__ */ f(C, {
		...r,
		ref: t
	});
	if (n === "multiple") return /* @__PURE__ */ f(w, {
		...r,
		ref: t
	});
	throw Error(`Missing prop \`type\` expected on \`${g}\``);
});
b.displayName = g;
var [x, S] = _(g), C = d.forwardRef((e, t) => {
	let { value: n, defaultValue: r, onValueChange: i = () => {}, ...o } = e, [s, c] = a({
		prop: n,
		defaultProp: r ?? "",
		onChange: i,
		caller: g
	});
	return /* @__PURE__ */ f(x, {
		scope: e.__scopeToggleGroup,
		type: "single",
		value: d.useMemo(() => s ? [s] : [], [s]),
		onItemActivate: c,
		onItemDeactivate: d.useCallback(() => c(""), [c]),
		children: /* @__PURE__ */ f(D, {
			...o,
			ref: t
		})
	});
}), w = d.forwardRef((e, t) => {
	let { value: n, defaultValue: r, onValueChange: i = () => {}, ...o } = e, [s, c] = a({
		prop: n,
		defaultProp: r ?? [],
		onChange: i,
		caller: g
	}), l = d.useCallback((e) => c((t = []) => [...t, e]), [c]), u = d.useCallback((e) => c((t = []) => t.filter((t) => t !== e)), [c]);
	return /* @__PURE__ */ f(x, {
		scope: e.__scopeToggleGroup,
		type: "multiple",
		value: s,
		onItemActivate: l,
		onItemDeactivate: u,
		children: /* @__PURE__ */ f(D, {
			...o,
			ref: t
		})
	});
});
b.displayName = g;
var [T, E] = _(g), D = d.forwardRef((e, t) => {
	let { __scopeToggleGroup: n, disabled: r = !1, rovingFocus: a = !0, orientation: c, dir: l, loop: u = !0, ...d } = e, p = y(n), m = o(l), h = {
		role: "group",
		dir: m,
		...d
	};
	return /* @__PURE__ */ f(T, {
		scope: n,
		rovingFocus: a,
		disabled: r,
		children: a ? /* @__PURE__ */ f(s, {
			asChild: !0,
			...p,
			orientation: c,
			dir: m,
			loop: u,
			children: /* @__PURE__ */ f(i.div, {
				...h,
				ref: t
			})
		}) : /* @__PURE__ */ f(i.div, {
			...h,
			ref: t
		})
	});
}), O = "ToggleGroupItem", k = d.forwardRef((e, t) => {
	let n = S(O, e.__scopeToggleGroup), r = E(O, e.__scopeToggleGroup), i = y(e.__scopeToggleGroup), a = n.value.includes(e.value), o = r.disabled || e.disabled, s = {
		...e,
		pressed: a,
		disabled: o
	}, c = d.useRef(null);
	return r.rovingFocus ? /* @__PURE__ */ f(l, {
		asChild: !0,
		...i,
		focusable: !o,
		active: a,
		ref: c,
		children: /* @__PURE__ */ f(A, {
			...s,
			ref: t
		})
	}) : /* @__PURE__ */ f(A, {
		...s,
		ref: t
	});
});
k.displayName = O;
var A = d.forwardRef((e, t) => {
	let { __scopeToggleGroup: n, value: r, ...i } = e, a = S(O, n), o = {
		role: "radio",
		"aria-checked": e.pressed,
		"aria-pressed": void 0
	};
	return /* @__PURE__ */ f(m, {
		...a.type === "single" ? o : void 0,
		...i,
		ref: t,
		onPressedChange: (e) => {
			e ? a.onItemActivate(r) : a.onItemDeactivate(r);
		}
	});
}), j = b, M = k, N = t(e("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors", "hover:bg-accent hover:text-accent-foreground", "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none", "disabled:pointer-events-none disabled:opacity-50", "data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\"size-\"])]:size-4"), {
	variants: {
		variant: {
			default: "bg-transparent",
			outline: "border-border-glass bg-transparent border shadow-sm hover:bg-accent hover:text-accent-foreground"
		},
		size: {
			default: "h-9 min-w-9 px-3",
			sm: "h-8 min-w-8 px-2",
			lg: "h-10 min-w-10 px-4"
		}
	},
	defaultVariants: {
		variant: "default",
		size: "default"
	}
});
function P({ className: t, variant: n, size: r, ...i }) {
	return /* @__PURE__ */ f(h, {
		"data-slot": "toggle",
		className: e(N({
			variant: n,
			size: r,
			className: t
		})),
		...i
	});
}
var F = u.createContext({
	size: "default",
	variant: "default"
});
function I({ className: t, variant: n, size: r, children: i, ...a }) {
	return /* @__PURE__ */ f(j, {
		"data-slot": "toggle-group",
		className: e("flex items-center gap-1", a.orientation === "vertical" && "flex-col", t),
		...a,
		children: /* @__PURE__ */ f(F.Provider, {
			value: {
				variant: n,
				size: r
			},
			children: i
		})
	});
}
function L({ className: t, variant: n, size: r, children: i, ...a }) {
	let o = u.useContext(F);
	return /* @__PURE__ */ f(M, {
		"data-slot": "toggle-group-item",
		className: e(N({
			variant: n ?? o.variant,
			size: r ?? o.size
		}), t),
		...a,
		children: i
	});
}
//#endregion
export { N as i, I as n, L as r, P as t };

//# sourceMappingURL=toggle-DJJEPXXE.js.map