import T from "../../../@babel/runtime/helpers/esm/slicedToArray.mjs";
import g from "../../../rc-util/es/hooks/useLayoutEffect.mjs";
import * as f from "react";
function v(r) {
  var t = r.valueTexts, i = r.onTextChange, c = f.useState(""), n = T(c, 2), a = n[0], u = n[1], o = f.useRef([]);
  o.current = t;
  function x(e) {
    u(e), i(e);
  }
  function s() {
    u(o.current[0]);
  }
  return g(function() {
    t.every(function(e) {
      return e !== a;
    }) && s();
  }, [t.join("||")]), [a, x, s];
}
export {
  v as default
};
