import{u as N,j as e,e as y}from"./vendor-BKmmeuxg.js";import{B as a}from"./button-BpNwv2aE.js";import{D as f,a as v,b as _,c as b}from"./dropdown-menu-DO-po5c1.js";import{S as w}from"./scroll-area-C8HGru-R.js";import{g as k}from"./route-B4ZMN77y.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";const A=r=>{const{props:C}=N(),{translate:P}=C,{frontend:n,common:i}=P,{current_page:o,last_page:l,first_page_url:D,last_page_url:M,next_page_url:d,prev_page_url:m}=r.paginationInfo,x=N(),p=k(x.url),t=[];if(l>0)for(let s=1;s<=l;s++)t.push({key:`${s}`,value:s});else t.push({key:"1",value:1});const h=s=>{y.get(route(r.routeName,{...r.routeParams||{},...p,page:s}))},c=s=>{var g,j;const I=k(s);y.get(route(r.routeName,{category:(g=x.props.category)==null?void 0:g.id,category_child:(j=x.props.categoryChild)==null?void 0:j.id,...r.routeParams||{},...p,...I}))},u=s=>`text-center py-1 ${o===s&&"bg-primary-50"}`;return e.jsxs("div",{className:`${r.className}`,children:[e.jsxs("div",{className:"mb-4 flex items-center justify-center md:hidden",children:[e.jsx("span",{className:"mr-1",children:e.jsxs("strong",{children:[o," ",i.of," ",l]})}),e.jsxs("span",{className:"mr-3",children:["| ",n.go_to_page_colon]}),e.jsxs(f,{children:[e.jsx(v,{children:e.jsx(a,{variant:"secondary",className:"hover:border-primary h-8 w-[60px] rounded-md border border-gray-200 text-gray-700",children:o})}),e.jsx(_,{align:"end",className:"min-w-[60px]",children:e.jsx(w,{className:"",children:t.map(s=>e.jsx(b,{onClick:()=>h(s.value),className:u(s.value),children:s.value},s.key))})})]})]}),e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(a,{color:"white",disabled:!m,onClick:()=>c(D),className:"h-8 px-2 text-xs sm:px-3",children:"<<First"}),e.jsx(a,{color:"white",disabled:!m,onClick:()=>c(m),className:"mx-3 h-8 px-2 text-xs sm:px-3",children:n.prev}),e.jsxs("div",{className:"hidden items-center md:flex",children:[e.jsxs("span",{className:"mr-1",children:[i.page," ",e.jsxs("strong",{children:[o," ",i.of," ",l]})]}),e.jsxs("span",{className:"mr-3",children:["| ",n.go_to_page_colon]}),e.jsxs(f,{children:[e.jsx(v,{children:e.jsx(a,{variant:"secondary",className:"hover:border-primary h-8 w-[60px] rounded-md border border-gray-200 text-gray-700",children:o})}),e.jsx(_,{align:"end",className:"min-w-[60px]",children:e.jsx(w,{className:"",children:t.map(s=>e.jsx(b,{onClick:()=>h(s.value),className:u(s.value),children:s.value},s.key))})})]})]}),e.jsx(a,{color:"white",disabled:!d,onClick:()=>c(d),className:"mx-3 h-8 px-2 text-xs sm:px-3",children:n.next}),e.jsx(a,{color:"white",disabled:!d,onClick:()=>c(M),className:"h-8 px-2 text-xs sm:px-3",children:"Last>>"})]})]})};export{A as default};
