function adjustPositioning(){var t=document.querySelector(".main.container-fluid"),e=document.querySelector("#top-nav");t&&e&&(t.style["padding-top"]=e.offsetHeight+"px")}"localhost"!==window.location.hostname&&LE.init({token:"7af02042-59a2-4c1b-88e6-5698fc90e51e",catchall:!0,page_info:"per-page"}),window.eposLoyaltyApiUrl="https://giftapi.emaginepos.com/api/v1/public/",window.eposS3AssestUrl="https://s3.amazonaws.com/emaginepos-loyalty-assets/";var app=angular.module("app",["ngMessages","ngResource","ngSanitize","ngTable","ui.router","ui.bootstrap","webStorageModule","ng-currency","ngLoad","ngError","app.navbar","app.customer","app.common","app.growl","app.signup","app.settings","app.loyalty","app.org","app.org.about"]);app.config(["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","$sceDelegateProvider",function(t,e,o,n,r){"use strict";o.html5Mode(!1),r.resourceUrlWhitelist(["self","http://dineloyal.com**","https://dineloyal.com**","http://dineloyal.club**","https://dineloyal.club**","https://dineloyal.club**"]),e.otherwise(function(t){var e=t.get("$state");e.go("loyalty-dashboard")}),n.interceptors.push(["$q","webStorage","$rootScope","$timeout","$location",function(t,e,o,n,r){return{request:function(t){t.headers=t.headers||{};var o=e.get("token",!0);return o&&-1===t.url.indexOf("s3.amazonaws.com")&&(t.headers.Authorization="Bearer "+o),t},responseError:function a(i){return 401!==i.status&&403!==i.status||a.ignore401s||-1!==r.url().indexOf("login")||i.config.url.indexOf("changepass")>-1&&i.data&&"Unauthorized"!==i.data.message||i.config.url.indexOf("loyalty/claim")>-1&&403===i.status||(o.notify({type:"warning",msg:"Your session has expired. Please login again."}),e.remove("token",!0),o.$broadcast("logout"),a.ignore401s=!0,n(function(){delete a.ignore401s},500)),t.reject(i)}}}])}]).run(["$rootScope","$interval","$uibModal","$window","webStorage","$state","Customer","Org","$timeout","Utils",function(t,e,o,n,r,a,i,s,l,u){if(s.load().then(function(e){t.orgInfo=e},function(e){t.notify({type:"error",msg:"Fatal Error: Could not retrieve Organization information."})}),-1!==window.navigator.appVersion.indexOf("Win")&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)){var c=document.createElement("style");document.head.appendChild(c),c.sheet.insertRule("::-webkit-scrollbar {width:10px}",c.sheet.cssRules.length),c.sheet.insertRule("::-webkit-scrollbar-thumb {background-color:rgba(255,255,255,0.5); border-radius:5px}",c.sheet.cssRules.length)}t.$on("logout",function(){i.currentCustomer=null,a.go("login")}),t.$on("$stateChangeStart",function(t,e,o,n,r){i.currentCustomer||e.data&&e.data.requiresLogin===!1?!i.currentCustomer||"login"!==e.name&&"signup"!==e.name&&"reset-pw"!==e.name||(t.preventDefault(),a.go("loyalty-dashboard")):(t.preventDefault(),a.go("login"))}),t.$on("$stateChangeSuccess",function(){window.scrollTo(0,0),l(function(){u.reloadAppIfStale()})}),t.alerts=[];var p=0;t.notifications={},t.notify=function(e){var o;e&&(o=p++,t.notifications[o]=e)},t.clearNotifications=function(){t.notifications={}},t.closeAlert=function(e){t.alerts.splice(e,1)},n.addEventListener("resize",adjustPositioning),t.$on("navbar:resize",function(){e(adjustPositioning,50,5)}),function(){var t=Date.parse;Date.parse=function(e){if(!e)return NaN;if(_.isDate(e)&&(e=e.toString()),e.match(/^\d{1,2}-\d{1,2}-\d{4}$/)){var o=e.split("-"),n=parseInt(o[2]),r=parseInt(o[0]),a=parseInt(o[1]);return new Date(n,r-1,a)}return t(e)}}()}]).controller("MainCtrl",["$scope","Org","About","$interval","$timeout",function(t,e,o,n,r){t.Org=e,t.About=o,t.isMobileApp=!!window.cordova,t.showMainContent=!1,t.$watch("About.getSplashContent()",function(e,o){null===e&&(t.showMainContent=!0,n(adjustPositioning,100,20))})}]),angular.module("app").directive("datepickerPopup",[function(){return{restrict:"EAC",require:"ngModel",link:function(t,e,o,n){n.$formatters.shift()}}}]);