/* materialize Pagination v0.2.2 | http://mirjamsk.github.io/materialize-pagination */
;(function(c,f,g,k){var d=function(a,b){this.$elem=c(a);this.options=b;this.currentPage=this.$nextEllipsis=this.$prevEllipsis=this.$container=null;this.visiblePages=[];this.maxVisiblePages=3};d.prototype={defaults:{align:"center",lastPage:1,firstPage:1,urlParameter:"page",useUrlParameter:!0,onClickCallback:function(){}},init:function(){this.config=c.extend({},this.defaults,this.options);var a=this.config.useUrlParameter?this.parseUrl():this.config.firstPage;this.createPaginationBase(a)&&this.bindClickEvent()},
createPaginationBase:function(a){if(isNaN(this.config.firstPage)||isNaN(this.config.lastPage))return console.error("Both firstPage and lastPage attributes need to be integer values"),!1;if(this.config.firstPage>this.config.lastPage)return console.error("Value of firstPage must be less than the value of lastPage"),!1;this.config.firstPage=parseInt(this.config.firstPage);this.config.lastPage=parseInt(this.config.lastPage);this.currentPage=this.config.firstPage-this.maxVisiblePages;this.$container=c("
").addClass("pagination").addClass(this.config.align+
"-align");this.$prevEllipsis=this.util.Ellipsis();this.$nextEllipsis=this.util.Ellipsis();var b=this.util.createPage(this.config.firstPage),h=this.util.createChevron("prev"),e=this.util.createChevron("next");this.$container.append(h).append(b).append(this.$prevEllipsis.$elem).append(this.$nextEllipsis.$elem).append(e);this.config.lastPage>this.config.firstPage&&this.util.createPage(this.config.lastPage).insertBefore(e);this.requestPage(a);this.renderActivePage();this.$elem.append(this.$container);
return!0},requestPage:function(a){switch(a){case this.currentPage:return;case this.currentPage-1:this.requestPrevPage();break;case this.currentPage+1:this.requestNextPage();break;default:this.requestPageByNumber(a)}this.config.onClickCallback(this.currentPage);this.renderActivePage();this.config.useUrlParameter&&this.updateUrlParam(this.config.urlParameter,this.currentPage)},requestPrevPage:function(){--this.currentPage;this.visiblePages.pop().remove();this.visiblePages.unshift(this.insertPrevPaginationComponent(this.currentPage-
1))},requestNextPage:function(){this.currentPage+=1;this.visiblePages.shift().remove();this.visiblePages.push(this.insertNextPaginationComponent(this.currentPage+1))},requestPageByNumber:function(a){this.purgeVisiblePages();this.currentPage=a;this.visiblePages.push(this.insertNextPaginationComponent(this.currentPage-1));this.visiblePages.push(this.insertNextPaginationComponent(this.currentPage));this.visiblePages.push(this.insertNextPaginationComponent(this.currentPage+1))},renderActivePage:function(){this.renderEllipsis();
this.$container.find("li.active").removeClass("active");c(this.$container.find('[data-page="'+this.currentPage+'"]')[0]).addClass("active")},renderEllipsis:function(){this.$prevEllipsis.isHidden&&this.currentPage>=this.config.firstPage+this.maxVisiblePages?this.$prevEllipsis.show():!this.$prevEllipsis.isHidden&&this.currentPage<=this.config.firstPage+this.maxVisiblePages-1&&this.$prevEllipsis.hide();this.$nextEllipsis.isHidden&&this.currentPage<=this.config.lastPage-this.maxVisiblePages?this.$nextEllipsis.show():
!this.$nextEllipsis.isHidden&&this.currentPage>=this.config.lastPage-this.maxVisiblePages+1&&this.$nextEllipsis.hide()},bindClickEvent:function(){var a=this;this.$container.on("click","li",function(){var b=a.sanitizePageRequest(c(this).data("page"));a.requestPage(b)})},insertPrevPaginationComponent:function(a){return a>this.config.firstPage&&athis.config.firstPage&&
a=this.config.firstPage&&a<=this.config.lastPage&&(b=parseInt(a));return b},purgeVisiblePages:function(){for(var a=this.visiblePages.length,b=0;b").text(a).addClass("waves-effect").attr("data-page",a)},createChevron:function(a){var b="next"===a?"right":"left",b=c("").addClass("waves-effect").addClass("material-icons").text("chevron_"+b);return this.createPage(a).text("").attr("data-page",a).append(b)},Ellipsis:function(){var a=c("- ");a.text("...");a.addClass("hide disabled");return{$elem:a,isHidden:!0,
show:function(){this.isHidden=!1;this.$elem.removeClass("hide")},hide:function(){this.isHidden=!0;this.$elem.addClass("hide")}}}}};d.defaults=d.prototype.defaults;c.fn.materializePagination=function(a){return this.each(function(){(new d(this,a)).init()})}})(jQuery,window,document);