import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import icon_default from "../../../icon/index.js";
import { withMode } from "../../dataSourceForm/utils.js";
import InputReadPretty from "./ReadPretty.js";
import React, { useCallback } from "react";
import { Input } from "antd";
//#region src/components/dataSourceComponents/fields/Input.Email/WithMode.tsx
const _excluded = ["onBlur", "onChange"];
const Email = (props) => {
	const { onBlur: propsOnBlur, onChange: propsOnChange } = props, rest = _objectWithoutProperties(props, _excluded);
	const onBlur = useCallback((e) => {
		var _e$target;
		propsOnChange === null || propsOnChange === void 0 || propsOnChange(((e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) || "").trim());
		propsOnBlur === null || propsOnBlur === void 0 || propsOnBlur(e);
	}, [propsOnBlur, propsOnChange]);
	return /* @__PURE__ */ React.createElement(Input, _objectSpread2(_objectSpread2({}, rest), {}, {
		onChange: propsOnChange,
		onBlur,
		prefix: /* @__PURE__ */ React.createElement(icon_default, {
			type: "pisell2-mail-01",
			size: 18,
			color: "#98A2B3"
		})
	}));
};
const EmailWithMode = withMode(Email, InputReadPretty);
//#endregion
export { EmailWithMode as default };
