var L=Object.defineProperty,R=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var f=(a,r,n)=>r in a?L(a,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[r]=n,o=(a,r)=>{for(var n in r||(r={}))A.call(r,n)&&f(a,n,r[n]);if(_)for(var n of _(r))E.call(r,n)&&f(a,n,r[n]);return a},b=(a,r)=>R(a,X(r));import{aT as w,j as e,aX as k}from"./react-vendor-xYZnmIII.js";import{V as C,W as P,B as l,X as D,e as M,Y as I}from"./ui-components-CQM92IK3.js";import{g as T}from"./route-D0xh7FtZ.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";const G=a=>{const{props:r}=w(),{translate:n}=r,{frontend:c,common:x}=n,{current_page:t,last_page:i,first_page_url:$,last_page_url:B,next_page_url:p,prev_page_url:h}=a.paginationInfo,u=w(),g=T(u.url),d=[];if(i>0)for(let s=1;s<=i;s++)d.push({key:`${s}`,value:s});else d.push({key:"1",value:1});const j=s=>{k.get(route(a.routeName,b(o(o({},a.routeParams||{}),g),{page:s})))},m=s=>{var y,v;const F=T(s);k.get(route(a.routeName,o(o(o({category:(y=u.props.category)==null?void 0:y.id,category_child:(v=u.props.categoryChild)==null?void 0:v.id},a.routeParams||{}),g),F)))},N=s=>`text-center py-1 ${t===s&&"bg-primary-50"}`;return e.jsxs("div",{className:`${a.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:[t," ",x.of," ",i]})}),e.jsxs("span",{className:"mr-3",children:["| ",c.go_to_page_colon]}),e.jsxs(C,{children:[e.jsx(P,{children:e.jsx(l,{variant:"secondary",className:"hover:border-primary h-8 w-[60px] rounded-md border border-gray-200 text-gray-700",children:t})}),e.jsx(D,{align:"end",className:"min-w-[60px]",children:e.jsx(M,{className:"",children:d.map(s=>e.jsx(I,{onClick:()=>j(s.value),className:N(s.value),children:s.value},s.key))})})]})]}),e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(l,{color:"white",disabled:!h,onClick:()=>m($),className:"h-8 px-2 text-xs sm:px-3",children:"<<First"}),e.jsx(l,{color:"white",disabled:!h,onClick:()=>m(h),className:"mx-3 h-8 px-2 text-xs sm:px-3",children:c.prev}),e.jsxs("div",{className:"hidden items-center md:flex",children:[e.jsxs("span",{className:"mr-1",children:[x.page," ",e.jsxs("strong",{children:[t," ",x.of," ",i]})]}),e.jsxs("span",{className:"mr-3",children:["| ",c.go_to_page_colon]}),e.jsxs(C,{children:[e.jsx(P,{children:e.jsx(l,{variant:"secondary",className:"hover:border-primary h-8 w-[60px] rounded-md border border-gray-200 text-gray-700",children:t})}),e.jsx(D,{align:"end",className:"min-w-[60px]",children:e.jsx(M,{className:"",children:d.map(s=>e.jsx(I,{onClick:()=>j(s.value),className:N(s.value),children:s.value},s.key))})})]})]}),e.jsx(l,{color:"white",disabled:!p,onClick:()=>m(p),className:"mx-3 h-8 px-2 text-xs sm:px-3",children:c.next}),e.jsx(l,{color:"white",disabled:!p,onClick:()=>m(B),className:"h-8 px-2 text-xs sm:px-3",children:"Last>>"})]})]})};export{G as default};
