1import{_ as C,r as v,o as i,c as l,t as s,a as r,n,e as c,f as u,g as o,F as y,l as k}from"./app-996d7a72.js";const f={props:{itemName:String,loading:{type:Boolean,default:!1},pagination:Object,selectPerPage:{type:Boolean,default:!1},perPage:{type:Number,default:50}},computed:{selectedPerPage:{get(){return this.perPage},set(m){this.$emit("update:perPage",m)}}},data(){return{pageItemClass:"",pageLinkClass:"px-3 py-1 block rounded",perPageOptions:[{value:25,label:"25"},{value:50,label:"50"},{value:100,label:"100"},{value:250,label:"250"}],currentPage:1,maxShown:7}},methods:{handlePageChange(m){this.$emit("fetch",m)}}},x={key:0,class:"text-dark-400 text-sm mb-4"},P={key:1,class:"text-dark-400 text-sm mb-4"},b={class:"flex flex-col md:flex-row mb-4 gap-3"},w={key:0,class:"overflow-auto"},I={class:"flex flex-row items-center gap-0.5"},L=["href"],S=r("div",{class:"sr-only"},"Previous Page",-1),N=["onClick"],V=["onClick"],B=["onClick"],O=["onClick"],U=["onClick"],z=["onClick"],F=["href"],j=r("div",{class:"sr-only"},"Next Page",-1),D={key:1,class:"md:ms-auto"},E=r("span",{class:"me-2 mb-0"},"Show",-1),M=r("span",{class:"ms-2 mb-0"},"per page",-1);function q(m,_,e,A,t,g){const p=v("font-awesome-icon"),d=v("t-select");return e.pagination?(i(),l("div",{key:0,class:n(["transition-opacity",e.loading?"opacity-50 pointer-events-none":""])},[e.pagination.last_page>1?(i(),l("p",x," Showing "+s(e.pagination.from.toLocaleString("en-US"))+" - "+s(e.pagination.to.toLocaleString("en-US"))+" of "+s(parseInt(e.pagination.total,10)?parseInt(e.pagination.total,10).toLocaleString():m.item.value)+" "+s(e.itemName)+".",1)):(i(),l("p",P," Showing all "+s(parseInt(e.pagination.total,10)?parseInt(e.pagination.total,10).toLocaleString():e.pagination.total)+" "+s(e.itemName),1)),r("div",b,[e.pagination.last_page>1?(i(),l("div",w,[r("ul",I,[e.pagination.prev_page_url?(i(),l("li",{key:0,class:n(t.pageItemClass)},[r("a",{class:n([t.pageLinkClass,"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:e.pagination.prev_page_url,onClick:_[0]||(_[0]=c(a=>g.handlePageChange(e.pagination.current_page-1),["prevent"]))},[S,u(p,{icon:"fa-solid fa-chevron-left"})],10,L)],2)):o("",!0),(i(!0),l(y,null,k(e.pagination.last_page,a=>(i(),l(y,null,[e.pagination.last_page<=7?(i(),l("li",{key:0,class:n(t.pageItemClass)},[r("a",{onClick:c(h=>g.handlePageChange(a),["prevent"]),class:n([t.pageLinkClass,a==e.pagination.current_page?"bg-primary-500 text-white":"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:"#"},s(a),11,N)],2)):(i(),l(y,{key:1},[a===1?(i(),l("li",{key:0,class:n(t.pageItemClass)},[r("a",{onClick:c(h=>g.handlePageChange(a),["prevent"]),class:n([t.pageLinkClass,a==e.pagination.current_page?"bg-primary-500 text-white":"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:"#"},s(a),11,V)],2)):o("",!0),e.pagination.current_page<=4&&a>1&&a<=5?(i(),l("li",{key:1,class:n(t.pageItemClass)},[r("a",{onClick:c(h=>g.handlePageChange(a),["prevent"]),class:n([t.pageLinkClass,a==e.pagination.current_page?"bg-primary-500 text-white":"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:"#"},s(a),11,B)],2)):o("",!0),e.pagination.current_page>4&&a===1||e.pagination.current_page<=4&&a===5?(i(),l("li",{key:2,class:n([t.pageItemClass,"px-1.5"])}," ⦠",2)):o("",!0),e.pagination.current_page>4&&e.pagination.current_page<=e.pagination.last_page-4&&a>=e.pagination.current_page-2&&a<=e.pagination.current_page+2?(i(),l("li",{key:3,class:n(t.pageItemClass)},[r("a",{onClick:c(h=>g.handlePageChange(a),["prevent"]),class:n([t.pageLinkClass,a==e.pagination.current_page?"bg-primary-500 text-white":"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:"#"},s(a),11,O)],2)):o("",!0),e.pagination.current_page<=e.pagination.last_page-4&&a===e.pagination.last_page-1||e.pagination.current_page>e.pagination.last_page-4&&a===1?(i(),l("li",{key:4,class:n([t.pageItemClass,"px-1.5"])}," ⦠",2)):o("",!0),e.pagination.current_page>e.pagination.last_page-4&&a>e.pagination.last_page-5&&a<e.pagination.last_page?(i(),l("li",{key:5,class:n(t.pageItemClass)},[r("a",{onClick:c(h=>g.handlePageChange(a),["prevent"]),class:n([t.pageLinkClass,a==e.pagination.current_page?"bg-primary-500 text-white":"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:"#"},s(a),11,U)],2)):o("",!0),a===e.pagination.last_page?(i(),l("li",{key:6,class:n(t.pageItemClass)},[r("a",{onClick:c(h=>g.handlePageChange(a),["prevent"]),class:n([t.pageLinkClass,a==e.pagination.current_page?"bg-primary-500 text-white":"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:"#"},s(a),11,z)],2)):o("",!0)],64))],64))),256)),e.pagination.next_page_url?(i(),l("li",{key:1,class:n(t.pageItemClass)},[r("a",{class:n([t.pageLinkClass,"text-primary-500 hover:text-primary-600 hover:bg-primary-100"]),href:e.pagination.next_page_url,onClick:_[1]||(_[1]=c(a=>g.handlePageChange(e.pagination.current_page+1),["prevent"]))},[j,u(p,{icon:"fa-solid fa-chevron-right"})],10,F)],2)):o("",!0)])])):o("",!0),e.perPage&&e.selectPerPage&&e.pagination.last_page>1?(i(),l("div",D,[E,u(d,{modelValue:g.selectedPerPage,"onUpdate:modelValue":_[2]||(_[2]=a=>g.selectedPerPage=a),class:"inline-block w-auto",size:"sm",options:t.perPageOptions},null,8,["modelValue","options"]),M])):o("",!0)])],2)):o("",!0)}const H=C(f,[["render",q],["__file","Pagination.vue"]]);export{H as default};
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.