1import{D as e,On as t,Qn as n,_ as r,b as i,bt as a,g as o,k as s,mt as c,nr as l,o as u,y as d}from"./CrzdsfCC.js";import{f,p}from"./BqpUJ7rG.js";import{t as m}from"./QBUVBvjB.js";import{t as h}from"./DZ6lCy8U.js";function g({per_page:e=10}={}){let t=f();return{page:o(()=>Number(t.query.page)||1),per_page:e}}var _={key:0,"aria-label":`Pagination`,class:`flex items-center justify-center gap-1 mt-8`},v=[`href`,`aria-disabled`,`tabindex`],y=[`href`,`aria-current`,`onClick`],b=[`href`,`aria-disabled`,`tabindex`],x=`inline-flex items-center justify-center h-9 w-9 rounded-md text-sm font-medium transition-colors`,S=`bg-primary text-primary-foreground`,C=`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,w=`opacity-50 pointer-events-none`,T=s({__name:`Pagination`,props:{pagination:{},scrollToTop:{type:Boolean,default:!0},scrollToId:{default:null},scrollOffset:{default:0}},setup(s){let g=s,T=f(),E=p(),D=o(()=>{let e=g.pagination.current_page,t=g.pagination.last_page;return t<=1?[]:e===1?[1,2,3].filter(e=>e<=t):e===t?[t-2,t-1,t].filter(e=>e>=1):[e-1,e,e+1]});function O(e){return E.resolve({query:{...T.query,page:e>1?String(e):void 0}}).href}async function k(e,t){if(t.preventDefault(),await E.push({query:{...T.query,page:e>1?String(e):void 0}}),g.scrollToId){let e=document.getElementById(g.scrollToId);if(e){let t=g.scrollOffset??0,n=e.getBoundingClientRect().top+window.pageYOffset+t;window.scrollTo({top:n,behavior:`smooth`})}}else g.scrollToTop&&window.scrollTo({top:0,behavior:`smooth`})}let A=o(()=>g.pagination.current_page<=1),j=o(()=>g.pagination.current_page>=g.pagination.last_page);return(o,f)=>s.pagination.last_page>1?(c(),i(`nav`,_,[r(`a`,{href:O(s.pagination.current_page-1),class:n([x,C,t(A)&&w]),"aria-disabled":t(A),tabindex:t(A)?-1:void 0,"aria-label":`Page précédente`,onClick:f[0]||=e=>!t(A)&&k(s.pagination.current_page-1,e)},[e(t(m),{class:`h-4 w-4`})],10,v),(c(!0),i(u,null,a(t(D),e=>(c(),i(`a`,{key:e,href:O(e),class:n([x,e===s.pagination.current_page?S:C]),"aria-current":e===s.pagination.current_page?`page`:void 0,onClick:t=>k(e,t)},l(e),11,y))),128)),r(`a`,{href:O(s.pagination.current_page+1),class:n([x,C,t(j)&&w]),"aria-disabled":t(j),tabindex:t(j)?-1:void 0,"aria-label":`Page suivante`,onClick:f[1]||=e=>!t(j)&&k(s.pagination.current_page+1,e)},[e(t(h),{class:`h-4 w-4`})],10,b)])):d(``,!0)}});
1export{g as n,T as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.