import { filterErrors as m } from "../hooks/use-form-errors/filter-errors/filter-errors.mjs";
import { getPath as j } from "../paths/get-path.mjs";
const i = Symbol("root-rule");
function s(r) {
  const t = m(r);
  return { hasErrors: Object.keys(t).length > 0, errors: t };
}
function u(r, t, y = "", l = {}) {
  return typeof r != "object" || r === null ? l : Object.keys(r).reduce((f, c) => {
    const o = r[c], e = `${y === "" ? "" : `${y}.`}${c}`, n = j(e, t);
    let p = !1;
    return typeof o == "function" && (f[e] = o(n, t, e)), typeof o == "object" && Array.isArray(n) && (p = !0, n.forEach(
      (d, b) => u(o, t, `${e}.${b}`, f)
    ), i in o && (f[e] = o[i](n, t, e))), typeof o == "object" && typeof n == "object" && n !== null && (p || u(o, t, e, f), i in o && (f[e] = o[i](n, t, e))), f;
  }, l);
}
function h(r, t) {
  return s(typeof r == "function" ? r(t) : u(r, t));
}
export {
  i as formRootRule,
  h as validateValues
};
//# sourceMappingURL=validate-values.mjs.map
