"use client";
import { t as e } from "./useIsoLayoutEffect-CKOv1bV_.js";
import { d as t, i as n, t as r } from "./useRenderElement-CmuWsiNa.js";
import { t as i } from "./useStableCallback-CqEVb76s.js";
import { a } from "./useOpenChangeComplete-DjMFUwhi.js";
import { a as o, i as s, n as c, o as l, r as u, t as d } from "./useCollapsiblePanel-B7ERXY1c.js";
import { t as f } from "./useButton-AXffhTAZ.js";
import { cn as p } from "./lib/utils.js";
import * as m from "react";
import { jsx as h } from "react/jsx-runtime";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/collapsible/root/stateAttributesMapping.js
var g = {
	...c,
	...a
}, _ = /*#__PURE__*/ m.forwardRef(function(e, t) {
	let { render: n, className: a, defaultOpen: o = !1, disabled: c = !1, onOpenChange: u, open: d, style: f, ...p } = e, _ = i(u), v = l({
		open: d,
		defaultOpen: o,
		onOpenChange: _,
		disabled: c
	}), y = m.useMemo(() => ({
		open: v.open,
		disabled: v.disabled,
		transitionStatus: v.transitionStatus
	}), [
		v.open,
		v.disabled,
		v.transitionStatus
	]), b = m.useMemo(() => ({
		...v,
		onOpenChange: _,
		state: y
	}), [
		v,
		_,
		y
	]), x = r("div", e, {
		state: y,
		ref: t,
		props: p,
		stateAttributesMapping: g
	});
	return /*#__PURE__*/ h(s.Provider, {
		value: b,
		children: x
	});
});
process.env.NODE_ENV !== "production" && (_.displayName = "CollapsibleRoot");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/collapsible/trigger/CollapsibleTrigger.js
var v = {
	...u,
	...a
}, y = /*#__PURE__*/ m.forwardRef(function(e, t) {
	let { panelId: n, open: i, handleTrigger: a, state: s, disabled: c } = o(), { className: l, disabled: u = c, id: d, render: p, nativeButton: m = !0, style: h, ...g } = e, { getButtonProps: _, buttonRef: y } = f({
		disabled: u,
		focusableWhenDisabled: !0,
		native: m
	});
	return r("button", e, {
		state: s,
		ref: [t, y],
		props: [
			{
				"aria-controls": i ? n : void 0,
				"aria-expanded": i,
				onClick: a
			},
			g,
			_
		],
		stateAttributesMapping: v
	});
});
process.env.NODE_ENV !== "production" && (y.displayName = "CollapsibleTrigger");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/collapsible/panel/CollapsiblePanelCssVars.js
var b = /*#__PURE__*/ function(e) {
	return e.collapsiblePanelHeight = "--collapsible-panel-height", e.collapsiblePanelWidth = "--collapsible-panel-width", e;
}({}), x = /*#__PURE__*/ m.forwardRef(function(i, a) {
	let { className: s, hiddenUntilFound: c, keepMounted: l, render: u, id: f, style: p, ...m } = i;
	process.env.NODE_ENV !== "production" && e(() => {
		c && l === !1 && t("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.");
	}, [c, l]);
	let { mounted: h, onOpenChange: _, open: v, panelId: y, setMounted: x, setPanelIdState: S, setOpen: C, state: w, transitionStatus: T } = o(), E = c ?? !1, D = l ?? !1;
	e(() => {
		if (f) return S(f), () => {
			S(void 0);
		};
	}, [f, S]);
	let { height: O, props: k, ref: A, shouldPreventOpenAnimation: j, shouldRender: M, transitionStatus: N, width: P } = d({
		externalRef: a,
		hiddenUntilFound: E,
		id: y,
		keepMounted: D,
		mounted: h,
		onOpenChange: _,
		open: v,
		setMounted: x,
		setOpen: C,
		transitionStatus: T
	}), F = {
		...w,
		transitionStatus: N
	}, I = n(p, F), L = r("div", {
		...i,
		style: void 0
	}, {
		state: F,
		ref: A,
		props: [
			k,
			{ style: {
				[b.collapsiblePanelHeight]: O === void 0 ? "auto" : `${O}px`,
				[b.collapsiblePanelWidth]: P === void 0 ? "auto" : `${P}px`
			} },
			m,
			I ? { style: I } : void 0,
			j ? { style: { animationName: "none" } } : void 0
		],
		stateAttributesMapping: g
	});
	return M ? L : null;
});
process.env.NODE_ENV !== "production" && (x.displayName = "CollapsiblePanel");
//#endregion
//#region lib/components/ui/atoms/collapsible.tsx
function S({ className: e, ...t }) {
	return /* @__PURE__ */ h(_, {
		className: p("has-[[data-slot=collapsible-trigger][data-disabled]]:opacity-75", e),
		"data-slot": "collapsible",
		...t
	});
}
function C({ className: e, ...t }) {
	return /* @__PURE__ */ h(y, {
		className: p("data-disabled:cursor-not-allowed [&[data-disabled]]:hover:bg-transparent", e),
		"data-slot": "collapsible-trigger",
		...t
	});
}
function w({ ...e }) {
	return /* @__PURE__ */ h(x, {
		"data-slot": "collapsible-content",
		...e
	});
}
//#endregion
export { w as n, C as r, S as t };
