!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("@sinclair/typebox/compiler"),require("@sinclair/typebox/value"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","@sinclair/typebox/compiler","@sinclair/typebox/value","react-hook-form"],r):r((e||self).hookformResolversTypebox={},e.hookformResolvers,e.compiler,e.value,e.ReactHookForm)}(this,function(e,r,o,t,s){function i(e,r){for(var o=Object.create(null);e.length;){var t=e[0],i=t.type,a=t.message,l=t.path.substring(1).replace(/\//g,".");if(o[l]||(o[l]={message:a,type:""+i}),r){var n=o[l].types,c=n&&n[""+i];o[l]=s.appendErrors(l,r,o,""+i,c?[].concat(c,t.message):t.message)}e.shift()}return o}e.typeboxResolver=function(e){return function(s,a,l){try{var n=Array.from(e instanceof o.TypeCheck?e.Errors(s):t.Value.Errors(e,s));return l.shouldUseNativeValidation&&r.validateFieldsNatively({},l),Promise.resolve(n.length?{values:{},errors:r.toNestErrors(i(n,!l.shouldUseNativeValidation&&"all"===l.criteriaMode),l)}:{errors:{},values:s})}catch(e){return Promise.reject(e)}}}});
//# sourceMappingURL=typebox.umd.js.map
