import{toNestErrors as e,validateFieldsNatively as r}from"@hookform/resolvers";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},t.apply(null,arguments)}function n(e){if(e.path?.length){let r="";for(const t of e.path){const e="object"==typeof t?t.key:t;if("string"!=typeof e&&"number"!=typeof e)return null;r+=r?`.${e}`:e}return r}return null}function o(o,s,a){return void 0===a&&(a={}),function(s,i,u){try{var l=function(){if(f.issues){var o=function(e,r){for(var o=Object.create(null),s=0;s<e.length;s++){var a=e[s],i=n(a);if(i&&(o[i]||(o[i]={message:a.message,type:""}),r)){var u,l=o[i].types||{};o[i].types=t({},l,((u={})[Object.keys(l).length]=a.message,u))}}return o}(f.issues,!u.shouldUseNativeValidation&&"all"===u.criteriaMode);return{values:{},errors:e(o,u)}}return u.shouldUseNativeValidation&&r({},u),{values:a.raw?Object.assign({},s):f.value,errors:{}}},f=o["~standard"].validate(s),c=function(){if(f instanceof Promise)return Promise.resolve(f).then(function(e){f=e})}();return Promise.resolve(c&&c.then?c.then(l):l())}catch(e){return Promise.reject(e)}}}export{o as arktypeResolver};
//# sourceMappingURL=arktype.module.js.map
