import{l as h}from"./index-CmAiVN5e.js";class u{constructor(){this._errors=new Map,h(this)}get hasErrors(){return this._errors.size>0}get errors(){return this._errors}getErrorBy(r){return this._errors.get(r)||""}setError(r,s){s?this._errors.set(r,s):this._errors.delete(r)}setErrors(r){const s=Object.keys(r);for(const o of s){const e=r[o];if(Array.isArray(e)){const t=e.shift()||"";this.setError(o,t)}else{const t=Object.keys(e);for(const i of t){const a=e[i];if(Array.isArray(a)){const c=a.shift()||"";this.setError(i,c)}}}}}clear(){this._errors.clear()}}export{u as F};