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_index = require("./CellProvider/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let styled_components = require("styled-components");
styled_components = require_runtime.__toESM(styled_components);
let react_resizable = require("react-resizable");
require("react-resizable/css/styles.css");
//#region src/components/table/Table/tableConfig/header/index.tsx
const _excluded = ["index"], _excluded2 = [
	"onResize",
	"width",
	"field_type",
	"lock",
	"editable",
	"dataIndex",
	"position"
];
const ResizeCellStyle = (0, styled_components.default)(react_resizable.Resizable)`
	&::before {
		position: absolute;
		top: 50%;
		right: 0;
		width: 1px;
		height: 1.6em;
		background-color: rgba(0, 0, 0, 0.06);
		transform: translateY(-50%);
		transition: background-color 0.3s;
		content: "";
	}

	&:last-child::before {
		display: none;
	}

	.react-resizable {
		position: relative;
		background-clip: padding-box;
	}

	.react-resizable-handle {
		position: absolute;
		width: 10px;
		height: 100%;
		bottom: 0;
		cursor: col-resize;
		background-image: none;
		z-index: 1;
	}
`;
const CustomHeaderRow = (_ref) => {
	let { index } = _ref, props = require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
	return /* @__PURE__ */ react.default.createElement("tr", props);
};
const CustomHeaderCell = (props) => {
	const { onResize, width, field_type, lock, editable, dataIndex, position } = props, restProps = require_objectWithoutProperties._objectWithoutProperties(props, _excluded2);
	if (!props.record) restProps.style = require_objectSpread2._objectSpread2({}, restProps.style);
	if (position === "end") return /* @__PURE__ */ react.default.createElement("td", restProps, /* @__PURE__ */ react.default.createElement(require_index.default, props));
	return /* @__PURE__ */ react.default.createElement(ResizeCellStyle, {
		width: width || 200,
		height: 0,
		onResize,
		draggableOpts: { enableUserSelectHack: false }
	}, /* @__PURE__ */ react.default.createElement("td", restProps, /* @__PURE__ */ react.default.createElement(require_index.default, props)));
};
var header_default = {
	Row: CustomHeaderRow,
	Cell: CustomHeaderCell
};
//#endregion
exports.default = header_default;
