import { n as e } from "./input-Bp6_Ucgr.js";
import { useState as t } from "react";
import { jsx as n } from "react/jsx-runtime";
//#region src/input-search/InputSearch.tsx
function r({ onChange: r, ...i }) {
	let [a, o] = t(() => i.defaultValue ?? i.value ?? ""), [s, c] = t(() => i.defaultValue ?? i.value ?? ""), l = (e) => {
		let t = e.trim();
		t !== s && (c(t), r(t));
	}, u = () => {
		o(""), c(""), r("");
	}, d = (e) => {
		e.key === "Enter" && (e.preventDefault(), l(a));
	}, f = () => {
		l(a);
	}, p = (e) => {
		o(e);
	};
	return /* @__PURE__ */ n(e, {
		...i,
		value: a,
		onChange: p,
		onKeyDown: d,
		onBlur: f,
		onClear: u
	});
}
//#endregion
export { r as t };

//# sourceMappingURL=input-search-Bkhcinru.js.map