import{D as s}from"./p-3c3b4f3f.js";class t{constructor(i,h,e=!1,o){this.beforeFetch=()=>new t(this.data,this.meta,!0,void 0),this.afterFetch=(i,h=!0)=>new t(this.data&&h?[...this.data,...s.decodeList(i.results)]:s.decodeList(i.results),this.meta||i.meta,!1,void 0),this.afterFetchError=s=>new t(this.data,this.meta,!1,s),this.afterUpdateItem=(s,i)=>new t(this.data?[...this.data].map((t=>t._id===s?Object.assign(Object.assign({},t),i):t)):this.data,this.meta,!1,void 0),this.isEndReached=()=>!(!this.data||!this.meta)&&this.data.length>=this.meta.total,this.data=i,this.error=o,this.isPending=e,this.meta=h}}t.init=()=>new t;export{t as L}