class t{constructor(){this.errors={},this.loading=!1,this.errorsAdded=new CustomEvent("errorsAdded")}setLoading(t){this.loading=t}get(t){var e;return void 0===this.errors[t]?[]:"string"==typeof this.errors[t]?[this.errors[t]]:null!==(e=this.errors[t])&&void 0!==e?e:[]}remove(t){Array.isArray(t)?t.forEach((t=>{delete this.errors[t]})):delete this.errors[t]}fill(t){this.errors=t||{},document.dispatchEvent(this.errorsAdded)}all(){return this.errors}clear(){this.errors={}}static create(){const e=new t;return Object.assign((t=>e.fill(t)),{setLoading:t=>e.setLoading(t),get:t=>e.get(t),remove:t=>e.remove(t),fill:t=>e.fill(t),all:()=>e.all(),clear:()=>e.clear()})}}const e=t.create();export{e as E}