import{d as x,W as m,k as t,j as a,x as s,t as d,K as k,q as _,a7 as A,$ as o,P as n,y as r,l,g as h,h as p,a0 as N,a8 as S,a9 as V,a2 as D,F,ap as L,aq as M,v as j}from"./CD3vEZdK.js";import{A as q,a as z}from"./Z4UlOcB4.js";const I={key:0,class:"flex justify-center"},R={class:"flex items-center gap-x-4"},E={class:"page-link"},K={key:0},T=x({inheritAttrs:!1,__name:"Pagination",props:{currentPage:{},lastPage:{},perPage:{},total:{},allowPageSelection:{type:Boolean,default:!1},showCurrentPage:{type:Boolean,default:!0},showMaxPage:{type:Boolean,default:!0}},emits:["navigate"],setup(y,{emit:v}){const f=y,w=v,i=m({get(){return f.currentPage},set(e){w("navigate",e)}}),u=m(()=>i.value<=1),c=m(()=>i.value===f.lastPage),C=()=>{u.value||(i.value-=1)},b=()=>{c.value||(i.value+=1)};return(e,G)=>{const P=D,B=F,$=L,W=M;return!t(u)||!t(c)?(a(),s("nav",I,[d("ul",R,[d("li",{class:k([{disabled:t(u)},"page-item"])},[_(P,{tabindex:t(u)?"-1":"false","aria-disabled":t(u),icon:t(q),onClick:C},null,8,["tabindex","aria-disabled","icon"])],2),A(e.$slots,"default",S(V(e.$props)),()=>[d("div",E,[e.allowPageSelection?(a(),h(W,{key:1},{popper:p(()=>[(a(!0),s(o,null,N(e.lastPage,g=>(a(),h($,{key:g,onClick:H=>i.value=g},{default:p(()=>[n(r(g),1)]),_:2},1032,["onClick"]))),128))]),default:p(()=>[_(B,{color:"secondary","aria-haspopup":"true","aria-expanded":"false"},{default:p(()=>[e.showCurrentPage?(a(),s(o,{key:0},[n(r(e.$t("paginator.page"))+" "+r(e.currentPage),1)],64)):l("",!0),e.showMaxPage?(a(),s(o,{key:1},[e.showCurrentPage?(a(),s(o,{key:0},[n(" / ")],64)):l("",!0),n(" "+r(e.lastPage),1)],64)):l("",!0)]),_:1})]),_:1})):(a(),s("div",K,[e.showCurrentPage?(a(),s(o,{key:0},[n(r(e.$t("paginator.page"))+" "+r(e.currentPage),1)],64)):l("",!0),e.showMaxPage?(a(),s(o,{key:1},[e.showCurrentPage?(a(),s(o,{key:0},[n(" / ")],64)):l("",!0),n(" "+r(e.lastPage),1)],64)):l("",!0)]))])],!0),d("li",{class:k([{disabled:t(c)},"page-item"])},[_(P,{tabindex:t(c)?-1:!1,"aria-disabled":t(c),icon:t(z),onClick:b},null,8,["tabindex","aria-disabled","icon"])],2)])])):l("",!0)}}}),Q=j(T,[["__scopeId","data-v-adc6773d"]]);export{Q as _};
