"use client";
const require_render_strategy = require("../../utils/render-strategy.cjs");
const require_collapsible_root = require("../collapsible/collapsible-root.cjs");
const require_use_tree_view_context = require("./use-tree-view-context.cjs");
const require_use_tree_view_node_context = require("./use-tree-view-node-context.cjs");
const require_use_tree_view_node_props_context = require("./use-tree-view-node-props-context.cjs");
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/tree-view/tree-view-branch.tsx
var TreeViewBranch = (0, react.forwardRef)((props, ref) => {
	const treeView = require_use_tree_view_context.useTreeViewContext();
	const nodeProps = require_use_tree_view_node_props_context.useTreeViewNodePropsContext();
	const nodeState = require_use_tree_view_node_context.useTreeViewNodeContext();
	const renderStrategyProps = require_render_strategy.useRenderStrategyPropsContext();
	const mergedProps = (0, _zag_js_react.mergeProps)(treeView.getBranchProps(nodeProps), props);
	const branchContentProps = treeView.getBranchContentProps(nodeProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_collapsible_root.CollapsibleRoot, {
		ref,
		open: nodeState.expanded,
		ids: { content: branchContentProps.id },
		...renderStrategyProps,
		...mergedProps
	});
});
TreeViewBranch.displayName = "TreeViewBranch";
//#endregion
exports.TreeViewBranch = TreeViewBranch;
