import { t as e } from "./utils-B7XIe3qq.js";
import { n as t } from "./dist-CTlQcJNK.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-D5o6xae2.js";
import { t as s } from "./dist-Cao8o5bZ.js";
import * as c from "react";
import { jsx as l, jsxs as u } from "react/jsx-runtime";
//#region node_modules/@radix-ui/react-switch/dist/index.mjs
var d = "Switch", [f, p] = n(d), [m, h] = f(d), g = c.forwardRef((e, n) => {
	let { __scopeSwitch: o, name: s, checked: f, defaultChecked: p, required: h, disabled: g, value: _ = "on", onCheckedChange: v, form: y, ...S } = e, [C, w] = c.useState(null), T = t(n, (e) => w(e)), E = c.useRef(!1), D = C ? y || !!C.closest("form") : !0, [O, k] = a({
		prop: f,
		defaultProp: p ?? !1,
		onChange: v,
		caller: d
	});
	return /* @__PURE__ */ u(m, {
		scope: o,
		checked: O,
		disabled: g,
		children: [/* @__PURE__ */ l(i.button, {
			type: "button",
			role: "switch",
			"aria-checked": O,
			"aria-required": h,
			"data-state": x(O),
			"data-disabled": g ? "" : void 0,
			disabled: g,
			value: _,
			...S,
			ref: T,
			onClick: r(e.onClick, (e) => {
				k((e) => !e), D && (E.current = e.isPropagationStopped(), E.current || e.stopPropagation());
			})
		}), D && /* @__PURE__ */ l(b, {
			control: C,
			bubbles: !E.current,
			name: s,
			value: _,
			checked: O,
			required: h,
			disabled: g,
			form: y,
			style: { transform: "translateX(-100%)" }
		})]
	});
});
g.displayName = d;
var _ = "SwitchThumb", v = c.forwardRef((e, t) => {
	let { __scopeSwitch: n, ...r } = e, a = h(_, n);
	return /* @__PURE__ */ l(i.span, {
		"data-state": x(a.checked),
		"data-disabled": a.disabled ? "" : void 0,
		...r,
		ref: t
	});
});
v.displayName = _;
var y = "SwitchBubbleInput", b = c.forwardRef(({ __scopeSwitch: e, control: n, checked: r, bubbles: i = !0, ...a }, u) => {
	let d = c.useRef(null), f = t(d, u), p = s(r), m = o(n);
	return c.useEffect(() => {
		let e = d.current;
		if (!e) return;
		let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
		if (p !== r && n) {
			let t = new Event("click", { bubbles: i });
			n.call(e, r), e.dispatchEvent(t);
		}
	}, [
		p,
		r,
		i
	]), /* @__PURE__ */ l("input", {
		type: "checkbox",
		"aria-hidden": !0,
		defaultChecked: r,
		...a,
		tabIndex: -1,
		ref: f,
		style: {
			...a.style,
			...m,
			position: "absolute",
			pointerEvents: "none",
			opacity: 0,
			margin: 0
		}
	});
});
b.displayName = y;
function x(e) {
	return e ? "checked" : "unchecked";
}
var S = g, C = v, w = c.forwardRef(({ className: t, size: n = "default", ...r }, i) => /* @__PURE__ */ l(S, {
	className: e("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors", "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", "data-[state=checked]:bg-primary data-[state=unchecked]:bg-accent", n === "default" && "h-6 w-11", n === "sm" && "h-5 w-9", t),
	...r,
	ref: i,
	children: /* @__PURE__ */ l(C, { className: e("bg-foreground pointer-events-none block rounded-full shadow-lg ring-0 transition-transform", n === "default" && "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0", n === "sm" && "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") })
}));
w.displayName = S.displayName;
//#endregion
export { w as t };

//# sourceMappingURL=switch-CoTkNGEB.js.map