var C=Object.defineProperty,j=Object.defineProperties;var D=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var x=(e,t,o)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,s=(e,t)=>{for(var o in t||(t={}))M.call(t,o)&&x(e,o,t[o]);if(h)for(var o of h(t))I.call(t,o)&&x(e,o,t[o]);return e},g=(e,t)=>j(e,D(t));import{jsxs as i,jsx as a}from"react/jsx-runtime";import{U as S,V as $,B as m,W as B,e as F,X as L}from"./ui-components-B24mpb8o.js";import{g as v}from"./route-D0xh7FtZ.js";import{usePage as T,router as N}from"@inertiajs/react";import"next-themes";import"sonner";import"react";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"lucide-react";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const xe=e=>{const{paginationInfo:t,paginationKey:o="page"}=e,{current_page:p,last_page:l,first_page_url:y,last_page_url:f,next_page_url:d,prev_page_url:c}=t,_=T(),b=v(_.url),u=[];if(l>0)for(let r=1;r<=l;r++)u.push({key:`${r}`,value:r});else u.push({key:"1",value:1});const k=r=>{N.get(route(e.routeName,g(s(s({},e.routeParams||{}),b),{[o]:r})),{},{preserveState:!0})},n=r=>{const w=v(r);N.get(route(e.routeName,g(s(s({},e.routeParams||{}),b),{[o]:w.page})),{},{preserveState:!0})},P=r=>`text-center py-1 ${p===r&&"bg-primary-50"}`;return i("div",{className:`space-y-4 ${e.className}`,children:[i("div",{className:"flex items-center justify-center",children:[a("span",{className:"mr-1",children:i("strong",{children:[p," of ",l]})}),a("span",{className:"mr-3",children:"| Go to page:"}),i(S,{children:[a($,{children:a(m,{type:"button",variant:"outline",className:"h-8 w-[60px] rounded-md border",children:p})}),a(B,{align:"end",className:"min-w-[60px]",children:a(F,{className:"",children:u.map(r=>a(L,{onClick:()=>k(r.value),className:P(r.value),children:r.value},r.key))})})]})]}),i("div",{className:"flex items-center justify-center",children:[a(m,{type:"button",variant:"ghost",disabled:!c,onClick:()=>n(y),className:"bg-muted border-border h-8 border px-2 text-xs sm:px-3",children:"<<First"}),a(m,{type:"button",variant:"ghost",disabled:!c,onClick:()=>n(c),className:"bg-muted border-border mx-3 h-8 border px-2 text-xs sm:px-3",children:"Prev"}),a(m,{type:"button",variant:"ghost",disabled:!d,onClick:()=>n(d),className:"bg-muted border-border mx-3 h-8 border px-2 text-xs sm:px-3",children:"Next"}),a(m,{type:"button",variant:"ghost",disabled:!d,onClick:()=>n(f),className:"bg-muted border-border h-8 border px-2 text-xs sm:px-3",children:"Last>>"})]})]})};export{xe as default};
