(function(){var n=angular.module("userEventViewer",[]),t=function(n,t){n.currentPage=1;n.maxSize=12;n.stoploading="show";n.loading=null;n.init=function(){n.stoploading="show";n.currentPage=1;n.maxSize=12;t.get("/umbraco/surface/usereventsurface/index").then(i,r)};var i=function(t){n.results=t.data;n.error=null;n.showRecords=n.results.slice(n.currentPage-1,n.maxSize);n.totalPages=n.results.length>n.maxSize?Math.ceil(n.results.length/n.maxSize):1;n.showPagination=n.results.length>n.maxSize?"show":null},r=function(){n.error="No events";n.results=null};n.doPagination=function(t){n.stoploading=null;n.loading="show";var i=(t-1)*n.maxSize,r=i+n.maxSize;setTimeout(function(){n.$apply(function(){t>=1&&t<=n.totalPages&&(n.showRecords=n.showRecords.concat(n.results.slice(i,r)),n.currentPage=t,n.showPagination=t<n.totalPages?"show":null,n.stoploading="show",n.loading=null)})},1e3)}};n.controller("UserEventController",["$scope","$http",t]);angular.bootstrap(document.getElementById("allEvents"),["userEventViewer"])})()