import{u as x,j as e,N as s,F as n,m as g}from"./entry.client-CV0PzNS2.js";const f=d=>{const{totalPages:a=1,currentPage:t=1,onPageChange:l,paginationUrl:r,only:i}=d,{t:c}=x("core");return console.log(r),e.jsx("nav",{className:"flex flex-row items-center justify-center lg:justify-end py-2 mb-4",children:e.jsxs("ul",{className:"flex flex-row items-center bg-white rounded-md overflow-hidden",children:[e.jsx("li",{children:e.jsxs(s,{only:i,target:"_self",href:r?r.replace(":page:",(t-1).toString()):void 0,onClick:()=>r?void 0:l?l(t-1):null,className:`flex flex-row items-center rounded-l-lg border px-2 md:px-3 py-2 leading-tight h-9 ${t===1?"cursor-default border-gray-100 bg-gray-100 text-gray-300 hover:text-gray-300":"border-gray-100 bg-white text-gray-500 hover:text-accent-500 hover:cursor-pointer"}`,children:[e.jsx(n,{name:"fa-solid fa-chevron-left"}),e.jsx("span",{className:"hidden pl-2 md:flex",children:c("previous_page")})]})}),t>=4&&a>=6&&e.jsx("li",{children:e.jsx(s,{only:i,target:"_self",href:r?r.replace(":page:","1"):void 0,onClick:()=>r?void 0:l?l(1):null,className:"border border-gray-100 bg-white px-2 md:px-3 py-2 leading-tight text-gray-500 hover:text-accent-500 hover:cursor-default h-9",children:"1"})}),a<6&&g(Array.from(Array(a).keys()),(h,o)=>e.jsx("li",{children:e.jsx(s,{only:i,target:"_self",href:r?r.replace(":page:",(o+1).toString()):void 0,onClick:()=>r?void 0:l?l(o+1):null,className:`${t-1===o?"bg-accent-500 text-white hover:cursor-default":"bg-white text-gray-500 hover:text-accent-500"} border border-gray-100 h-9
                px-2 md:px-3 py-2 leading-tight hover:cursor-pointer`,children:o+1})},`${r}_${o}`)),a>=6&&t<4&&g(Array.from(Array(4).keys()),(h,o)=>e.jsx("li",{children:e.jsx(s,{only:i,target:"_self",href:r?r.replace(":page:",(o+1).toString()):void 0,onClick:()=>r?void 0:l?l(o+1):null,className:`${t===o+1?"bg-accent-500 text-white hover:text-white":"bg-white text-gray-500 hover:text-accent-500"} border border-gray-100 h-9
                px-2 md:px-3 py-2 leading-tight hover:cursor-pointer`,children:o+1})},`start_${r}_${o}`)),a>=6&&t>=4&&t<=a-3&&e.jsx("span",{className:"px-1 md:px-2 h-9 flex flex-col justify-center",children:e.jsx(n,{name:"fa-light fa-ellipsis"})}),a>=6&&t>=4&&t<=a-3&&e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(s,{only:i,target:"_self",href:r?r.replace(":page:",(t-1).toString()):void 0,onClick:()=>r?void 0:l?l(t-1):null,className:"border border-gray-100 bg-white px-2 md:px-3 py-2 leading-tight text-gray-500 hover:text-accent-500 hover:cursor-pointer h-9",children:t-1})}),e.jsx("li",{children:e.jsx("button",{type:"button",className:"border border-gray-100 bg-accent-500 px-2 md:px-3 py-2 leading-tight text-white hover:cursor-default h-9",children:t})}),e.jsx("li",{children:e.jsx(s,{only:i,target:"_self",href:r?r.replace(":page:",(t+1).toString()):void 0,onClick:()=>r?void 0:l?l(t+1):null,className:"border border-gray-100 bg-white px-2 md:px-3 py-2 leading-tight text-gray-500 hover:text-accent-500 hover:cursor-pointer",children:t+1})})]}),a>=6&&t<=a-3&&e.jsx("span",{className:"px-1 md:px-2 h-9 flex flex-col justify-center",children:e.jsx(n,{name:"fa-light fa-ellipsis"})}),a>=6&&t>a-3&&e.jsx("span",{className:"px-1 md:px-2 h-9 flex flex-col justify-center",children:e.jsx(n,{name:"fa-light fa-ellipsis"})}),a>=6&&t>a-3&&Array.from(Array(4).keys()).map((h,o)=>e.jsx("li",{children:e.jsx(s,{only:i,target:"_self",href:r?r.replace(":page:",(a-3+o).toString()):void 0,onClick:()=>r?void 0:l?l(a-3+o):null,className:`${t===a-3+o?"bg-accent-500 text-white hover:text-white":"bg-white text-gray-500 hover:text-accent-500"} border border-gray-100 h-9
                px-2 md:px-3 py-2 leading-tight hover:cursor-pointer`,children:a-3+o})},`last_${r}_${o}`)),t<a-3&&a>=6&&e.jsx("li",{children:e.jsx(s,{only:i,target:"_self",href:r?r.replace(":page:",a.toString()):void 0,onClick:()=>r?void 0:l?l(a):null,className:"border border-gray-100 bg-white px-2 md:px-3 py-2 leading-tight text-gray-500 hover:text-accent-500 hover:cursor-pointer h-9",children:a})}),e.jsx("li",{children:e.jsxs(s,{only:i,target:"_self",href:r?r.replace(":page:",(t+1).toString()):void 0,onClick:()=>r?void 0:l?l(t+1):null,className:`flex flex-row items-center rounded-r-lg border px-2 md:px-3 py-2 leading-tight h-9 ${t===a?"cursor-default border-gray-100 bg-gray-100 text-gray-300 hover:text-gray-100":"border-gray-100 bg-white text-gray-500 hover:text-accent-500 hover:cursor-pointer"}`,children:[e.jsx("span",{className:"hidden pr-2 md:flex",children:c("next_page")}),e.jsx(n,{name:"fa-solid fa-chevron-right"})]})})]})},r)};export{f as P};