var p=Object.defineProperty;var c=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var l=(s,e,a)=>e in s?p(s,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[e]=a,g=(s,e)=>{for(var a in e||(e={}))m.call(e,a)&&l(s,a,e[a]);if(c)for(var a of c(e))P.call(e,a)&&l(s,a,e[a]);return s};import{ad as f,X as d}from"./vendor.26ab8f26.js";let i={};function k(s){const{page:e=1,size:a=15,callback:u,params:o={}}=s;i=Object.assign({},f(o));const n=d({page:e,size:a,loading:!1,count:0,lists:[]}),r=()=>n.loading?Promise.reject():(n.loading=!0,u(g({pageNo:n.page,pageSize:n.size},o)).then(t=>(n.count=t==null?void 0:t.count,n.lists=t==null?void 0:t.lists,Promise.resolve(t))).catch(t=>Promise.reject(t)).finally(()=>{n.loading=!1}));return{pager:n,requestApi:r,resetParams:()=>{Object.keys(i).forEach(t=>{o[t]=i[t]}),r()},resetPage:()=>{n.page=1,r()}}}export{k as u};
