import{n}from"./AlertComponent-CZRUfFVd.js";const r={props:["pagination","offset","path","page"],watch:{$route(e,a){this.changePage(this.current_page)}},computed:{current_page(){return typeof this.page>"u"?1:this.page}},methods:{isCurrentPage(e){return this.pagination.current_page===e},changePage(e){e>this.pagination.last_page&&(e=this.pagination.last_page),this.pagination.current_page=e,this.$emit("paginate")},query(e){return{...this.$route.query,...e}}},computed:{pages(){let e=[],a=this.pagination.current_page-Math.floor(this.offset/2);a<1&&(a=1);let t=a+this.offset-1;for(t>this.pagination.last_page&&(t=this.pagination.last_page);a<=t;)e.push(a),a++;return e}}};var p=function(){var a=this,t=a._self._c;return t("div",{staticClass:"mt-6 d-flex flex-wrap justify-content-between"},[t("ul",{staticClass:"pagination"},[t("li",{staticClass:"page-item"},[a.pagination.current_page>1?t("router-link",{class:"page-link pagination-previous",attrs:{to:{path:a.path,query:a.query({page:1})}}},[t("span",{attrs:{"aria-hidden":"true"}},[t("i",{staticClass:"fa-solid fa-angles-left"}),a._v(" "+a._s(a.trans("em.first")))])]):a._e()],1),t("li",{staticClass:"page-item"},[a.pagination.current_page>1?t("router-link",{class:"page-link  pagination-previous",attrs:{to:{path:a.path,query:a.query({page:a.pagination.current_page-1})}}},[t("span",{attrs:{"aria-hidden":"true"}},[t("i",{staticClass:"fa-solid fa-angle-left"}),a._v(" "+a._s(a.trans("em.previous")))])]):a._e()],1)]),t("ul",{staticClass:"pagination d-flex flex-wrap"},a._l(a.pagination.links,function(i,s){return t("li",{key:s,staticClass:"page-item"},[isNaN(i.label)?a._e():t("router-link",{staticClass:"page-link",class:{active:i.active},attrs:{to:{path:a.path,query:a.query({page:i.label})}}},[a._v(a._s(i.label)+" ")])],1)}),0),t("ul",{staticClass:"pagination"},[t("li",{staticClass:"page-item"},[a.pagination.current_page<a.pagination.last_page?t("router-link",{class:"page-link pagination-next",attrs:{to:{path:a.path,query:a.query({page:a.pagination.current_page+1})}}},[t("span",{attrs:{"aria-hidden":"true"}},[a._v(a._s(a.trans("em.next"))+" "),t("i",{staticClass:"fa-solid fa-angle-right"})])]):a._e()],1),t("li",{staticClass:"page-item"},[a.pagination.current_page<a.pagination.last_page?t("router-link",{class:"page-link pagination-next",attrs:{to:{path:a.path,query:a.query({page:a.pagination.last_page})}}},[t("span",{attrs:{"aria-hidden":"true"}},[a._v(a._s(a.trans("em.last"))+" "),t("i",{staticClass:"fa-solid fa-angles-right"})])]):a._e()],1)])])},l=[],o=n(r,p,l,!1,null,null);const u=o.exports;export{u as P};
