import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{n as t}from"./jsx-runtime-BHz_hoGM.js";import{c as n,m as r,o as i,p as a,s as o}from"./dist-DC-fZEsy.js";var s=e(t(),1),c=Symbol(`FIRST_PAGE`),l=Symbol(`LAST_PAGE`),u=n({first:i(o()),after:i(a()),last:i(o()),before:i(a())});r([n({first:o(),after:i(a())}),n({last:o(),before:i(a())})]);var d=e=>typeof e.first==`number`||typeof e.last==`number`,f=e=>Object.hasOwn(e,`first`),p=e=>Object.hasOwn(e,`last`),m=(e,t=6,n=`forward`)=>d(e)?e:n===`forward`?{first:t}:{last:t},h=(e=6)=>{let[t,n]=(0,s.useState)({first:e});return[t,t=>{n(t===c?{first:e}:t===l?{last:e}:t)}]},g=(e,t,n=6)=>{let r=f(e)&&e.after!==void 0,i=p(e)&&e.before!==void 0,a=null,o=null;return(t.hasPreviousPage||r)&&(a={last:n,before:t.startCursor??void 0}),(t.hasNextPage||i)&&(o={first:n,after:t.endCursor??void 0}),[a,o]};export{h as a,g as i,u as n,m as r,c as t};
//# sourceMappingURL=pagination-DYWPcKZg.js.map