var e=require("react-hook-form"),r=function(r,t,i){if(r&&"reportValidity"in r){var a=e.get(i,t);r.setCustomValidity(a&&a.message||""),r.reportValidity()}},t=function(e,t){var i=function(i){var a=t.fields[i];a&&a.ref&&"reportValidity"in a.ref?r(a.ref,i,e):a&&a.refs&&a.refs.forEach(function(t){return r(t,i,e)})};for(var a in t.fields)i(a)},i=function(e,r){var t=a(r).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(function(e){return a(e).match("^"+t+"\\.\\d+")})};function a(e){return e.replace(/[\[\]]/g,"")}exports.toNestErrors=function(r,a){a.shouldUseNativeValidation&&t(r,a);var n={};for(var s in r){var o=e.get(a.fields,s),f=Object.assign(r[s]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(i(a.names||Object.keys(r),s)){var c=Object.assign({},e.get(n,s));e.set(c,"root",f),e.set(n,s,c)}else e.set(n,s,f)}return n},exports.validateFieldsNatively=t;
//# sourceMappingURL=resolvers.js.map
