const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_objectWithoutProperties = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js");
const require_TreeItem = require("./TreeItem.js");
const require_utilities = require("../../utilities.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _dnd_kit_sortable = require("@dnd-kit/sortable");
let _dnd_kit_utilities = require("@dnd-kit/utilities");
//#region src/components/pisellDraggable/components/TreeItem/SortableTreeItem.tsx
const _excluded = ["id", "depth"];
const animateLayoutChanges = ({ isSorting, wasDragging }) => isSorting || wasDragging ? false : true;
const SortableTreeItem = (_ref) => {
	let { id, depth } = _ref, props = require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
	const { attributes, isDragging, isSorting, listeners, setDraggableNodeRef, setDroppableNodeRef, transform, transition } = (0, _dnd_kit_sortable.useSortable)({
		id,
		animateLayoutChanges
	});
	const style = {
		transform: _dnd_kit_utilities.CSS.Translate.toString(transform),
		transition
	};
	return /* @__PURE__ */ react.default.createElement(require_TreeItem.TreeItem, require_objectSpread2._objectSpread2({
		ref: setDraggableNodeRef,
		wrapperRef: setDroppableNodeRef,
		style,
		depth,
		ghost: isDragging,
		disableSelection: require_utilities.iOS,
		disableInteraction: isSorting,
		handleProps: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, attributes), listeners)
	}, props));
};
var SortableTreeItem_default = (0, react.memo)(SortableTreeItem);
//#endregion
exports.default = SortableTreeItem_default;
