import{toNestErrors as e,validateFieldsNatively as s}from"@hookform/resolvers";import{appendErrors as o}from"react-hook-form";function t(t,a,r={}){return async(a,i,n)=>{let c=t["~standard"].validate(a);if(c instanceof Promise&&(c=await c),c.issues){const s=((e,s)=>{const t=Object.assign([],e),a={};for(const e of t){if(!e.path)continue;const t=e.path.join(".");if(a[t]||(a[t]={message:e.message,type:""}),s){const r=a[t].types,i=r&&r[""];a[t]=o(t,s,a,"",i?[].concat(i,e.message):e.message)}}return a})(c.issues,!n.shouldUseNativeValidation&&"all"===n.criteriaMode);return{values:{},errors:e(s,n)}}return n.shouldUseNativeValidation&&s({},n),{values:r.raw?Object.assign({},a):c.value,errors:{}}}}export{t as typeschemaResolver};
//# sourceMappingURL=typeschema.modern.mjs.map
