import{d as p,A as m,e as n,o as a,a as s,b as l,n as c,F as h,h as k,t as f,f as x}from"./CGQLQ9ei.js";const P={key:0,class:"flex flex-wrap justify-center pt-32px"},v=["disabled"],w=["disabled","onClick"],y=["disabled"],C={key:1},B=p({__name:"Pager",props:{numPosts:{},total:{},currentPage:{}},emits:["change-page"],setup(u,{emit:d}){const b=u,g=d,o=m(()=>Math.ceil(b.total/b.numPosts));function i(e){window.scrollTo({top:0,left:0,behavior:"smooth"}),g("change-page",e)}return(e,r)=>n(o)>1?(a(),s("div",P,[l("button",{type:"button",disabled:e.currentPage===1,class:c([[e.currentPage===1?"border-black/30":"border-black hover:bg-black hover:text-white"],"mx-6px h-32px w-32px flex items-center justify-center border rounded-full bg-white text-center font-montserrat text-14px font-medium leading-14px text-black"]),onClick:r[0]||(r[0]=t=>i(e.currentPage-1))},r[2]||(r[2]=[l("i",{class:"i-carbon-chevron-left block"},null,-1)]),10,v),(a(!0),s(h,null,k(n(o),t=>(a(),s("div",{key:t},[(e.currentPage<=3?t<=6:e.currentPage>n(o)-3?n(o)-5<=t:e.currentPage-3<=t&&e.currentPage+2>=t)?(a(),s("button",{key:0,type:"button",disabled:e.currentPage===t,class:c([[e.currentPage===t?"bg-black text-white":"bg-white text-black"],"mx-6px h-32px w-32px border border-black rounded-full font-montserrat text-14px font-medium leading-14px active:bg-black hover:bg-black active:text-white hover:text-white"]),onClick:()=>i(t)},f(t),11,w)):x("",!0)]))),128)),l("button",{type:"button",disabled:e.currentPage==n(o),class:c([[e.currentPage==n(o)?"border-black/30":"border-black hover:bg-black hover:text-white"],"mx-6px h-32px w-32px flex items-center justify-center border rounded-full bg-white text-center font-montserrat text-14px font-medium leading-14px text-black"]),onClick:r[1]||(r[1]=t=>i(e.currentPage+1))},r[3]||(r[3]=[l("i",{class:"i-carbon-chevron-right block"},null,-1)]),10,y)])):(a(),s("div",C))}});export{B as _};