(this.webpackJsonp=this.webpackJsonp||[]).push([[0],[,function(e,t,n){"use strict";var r=n(110);n.d(t,"a",(function(){return r.a}));var a=n(77);n.d(t,"d",(function(){return a.a}));var o=n(211);n.d(t,"b",(function(){return o.a}));var i=n(212);n.d(t,"c",(function(){return i.a}))},,,function(e,t,n){"use strict";var r=n(0),a=n.n(r),o=n(2),i=n(32),l=n(1);t.a={Screen:function(e){return a.a.createElement(o.a,{style:{minWidth:l.d.minPageWidth,minHeight:e.forceScrollbar?"101%":void 0,backgroundColor:l.a.pageBackground,paddingVertical:e.paddingVertical||l.d.doubleBaseMargin,paddingHorizontal:e.paddingHorizontal||l.d.doubleBaseMargin}},e.children)},Icon:function(e){return a.a.createElement(i.a,{source:e.source,style:{width:e.size?e.size:l.d.icons.medium,height:e.size?e.size:l.d.icons.medium,tintColor:e.tintColor,resizeMode:"contain"}})},FlexSpacer:function(e){return a.a.createElement(o.a,{style:{flex:e.flex?e.flex:1}})},SpacerSmall:function(){return a.a.createElement(o.a,{style:{width:l.d.smallMargin,height:l.d.smallMargin}})},Spacer:function(){return a.a.createElement(o.a,{style:{width:l.d.baseMargin,height:l.d.baseMargin}})},SpacerDouble:function(){return a.a.createElement(o.a,{style:{width:l.d.doubleBaseMargin,height:l.d.doubleBaseMargin}})},SpacerTriple:function(){return a.a.createElement(o.a,{style:{width:l.d.tripleBaseMargin,height:l.d.tripleBaseMargin}})},SpacerQuad:function(){return a.a.createElement(o.a,{style:{width:l.d.quadBaseMargin,height:l.d.quadBaseMargin}})},SpacerSix:function(){return a.a.createElement(o.a,{style:{width:l.d.sixBaseMargin,height:l.d.sixBaseMargin}})},SpacerEight:function(){return a.a.createElement(o.a,{style:{width:l.d.eightBaseMargin,height:l.d.eightBaseMargin}})},HorizontalLine:function(e){var t=e.color,n=void 0===t?l.a.lightGrey:t;return a.a.createElement(o.a,{style:{width:"100%",borderWidth:1,borderColor:n}})}}},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return l.a})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return f}));var r=n(12),a=n.n(r);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var i=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:o(e,t),r=a(e.toFixed(n));return i(t)+r+l(t)}function s(e,t){var n="";return n=Math.abs(e)>=1e7?(e/1e6).toFixed(0)+"M":Math.abs(e)>=1e6?(e/1e6).toFixed(1)+"M":Math.abs(e)>=1e4?(e/1e3).toFixed(0)+"k":Math.abs(e)>=1e3?(e/1e3).toFixed(1)+"k":""+e.toFixed(0),i(t)+n+l(t)}n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return s})),function(e){e.Number="Number",e.Dollars="Dollars",e.Percent="Percent",e.Temperature="Temperature"}(r||(r={}))},,,function(e,t,n){"use strict";var r=n(222);n.d(t,"Label",(function(){return r.a}));var a=n(470);n.d(t,"ConnectedLabel",(function(){return a.a}));var o=n(471);n.o(o,"ConnectedValueLabel")&&n.d(t,"ConnectedValueLabel",(function(){return o.ConnectedValueLabel})),n.o(o,"LABEL_THEME_COMPONENT_CAPTION")&&n.d(t,"LABEL_THEME_COMPONENT_CAPTION",(function(){return o.LABEL_THEME_COMPONENT_CAPTION})),n.o(o,"LABEL_THEME_LIGHT")&&n.d(t,"LABEL_THEME_LIGHT",(function(){return o.LABEL_THEME_LIGHT})),n.o(o,"LABEL_THEME_SUBHEADING")&&n.d(t,"LABEL_THEME_SUBHEADING",(function(){return o.LABEL_THEME_SUBHEADING})),n.o(o,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return o.LABEL_THEME_TITLE})),n.o(o,"LABEL_THEME_TITLE_BOLD")&&n.d(t,"LABEL_THEME_TITLE_BOLD",(function(){return o.LABEL_THEME_TITLE_BOLD})),n.o(o,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return o.kvsComponentSelector}));var i=n(156);n.d(t,"LABEL_THEME_COMPONENT_CAPTION",(function(){return i.a})),n.d(t,"LABEL_THEME_LIGHT",(function(){return i.c})),n.d(t,"LABEL_THEME_SUBHEADING",(function(){return i.d})),n.d(t,"LABEL_THEME_TITLE",(function(){return i.e})),n.d(t,"LABEL_THEME_TITLE_BOLD",(function(){return i.f}))},function(e,t,n){"use strict";var r=n(454);n.d(t,"Button",(function(){return r.a}));var a=n(455);n.o(a,"BUTTON_THEME_ACCEPT")&&n.d(t,"BUTTON_THEME_ACCEPT",(function(){return a.BUTTON_THEME_ACCEPT})),n.o(a,"BUTTON_THEME_CANCEL")&&n.d(t,"BUTTON_THEME_CANCEL",(function(){return a.BUTTON_THEME_CANCEL})),n.o(a,"BUTTON_THEME_CLEAR_WITH_RED_TEXT")&&n.d(t,"BUTTON_THEME_CLEAR_WITH_RED_TEXT",(function(){return a.BUTTON_THEME_CLEAR_WITH_RED_TEXT})),n.o(a,"BUTTON_THEME_FIXED_BLUE")&&n.d(t,"BUTTON_THEME_FIXED_BLUE",(function(){return a.BUTTON_THEME_FIXED_BLUE})),n.o(a,"BUTTON_THEME_FIXED_RED")&&n.d(t,"BUTTON_THEME_FIXED_RED",(function(){return a.BUTTON_THEME_FIXED_RED})),n.o(a,"BUTTON_THEME_GLOBAL_ERROR")&&n.d(t,"BUTTON_THEME_GLOBAL_ERROR",(function(){return a.BUTTON_THEME_GLOBAL_ERROR})),n.o(a,"BUTTON_THEME_GLOBAL_MESSAGE")&&n.d(t,"BUTTON_THEME_GLOBAL_MESSAGE",(function(){return a.BUTTON_THEME_GLOBAL_MESSAGE})),n.o(a,"BUTTON_THEME_LARGE_BLUE")&&n.d(t,"BUTTON_THEME_LARGE_BLUE",(function(){return a.BUTTON_THEME_LARGE_BLUE})),n.o(a,"BUTTON_THEME_LARGE_GREEN")&&n.d(t,"BUTTON_THEME_LARGE_GREEN",(function(){return a.BUTTON_THEME_LARGE_GREEN})),n.o(a,"BUTTON_THEME_LARGE_GREY")&&n.d(t,"BUTTON_THEME_LARGE_GREY",(function(){return a.BUTTON_THEME_LARGE_GREY})),n.o(a,"ERROR_BUTTON_THEME")&&n.d(t,"ERROR_BUTTON_THEME",(function(){return a.ERROR_BUTTON_THEME})),n.o(a,"SOLID_BUTTON_THEME")&&n.d(t,"SOLID_BUTTON_THEME",(function(){return a.SOLID_BUTTON_THEME}));var o=n(213);n.d(t,"BUTTON_THEME_ACCEPT",(function(){return o.a})),n.d(t,"BUTTON_THEME_CANCEL",(function(){return o.b})),n.d(t,"BUTTON_THEME_CLEAR_WITH_RED_TEXT",(function(){return o.c})),n.d(t,"BUTTON_THEME_FIXED_BLUE",(function(){return o.d})),n.d(t,"BUTTON_THEME_FIXED_RED",(function(){return o.e})),n.d(t,"BUTTON_THEME_GLOBAL_ERROR",(function(){return o.f})),n.d(t,"BUTTON_THEME_GLOBAL_MESSAGE",(function(){return o.g})),n.d(t,"BUTTON_THEME_LARGE_BLUE",(function(){return o.h})),n.d(t,"BUTTON_THEME_LARGE_GREEN",(function(){return o.i})),n.d(t,"BUTTON_THEME_LARGE_GREY",(function(){return o.j})),n.d(t,"ERROR_BUTTON_THEME",(function(){return o.k})),n.d(t,"SOLID_BUTTON_THEME",(function(){return o.l}))},,,function(e,t,n){"use strict";var r=n(207);n.d(t,"default",(function(){return r.default}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"g",(function(){return i})),n.d(t,"f",(function(){return l})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return h}));var r,a=n(8),o=n.n(a);n(670);!function(e){e.Day="day",e.Week="week",e.Month="month",e.Quarter="quarter",e.Year="year"}(r||(r={}));function i(e){return o.a.tz(e,"YYYY-MM-DDTHH:mm",!1,o()().tz()||"Australia/Melbourne")}function l(e){return o.a.utc(e).tz(o()().tz()||"Australia/Melbourne")}function c(e,t){if(void 0===e)return"...";var n=l(e),a=l(t),o=d(n,r.Day),i=d(a,r.Day);return 0===s(o,i)?n.format("h:mm a z"):0===o.diff(i,r.Year)?n.format("D MMM, h:mm a z"):n.format("D MMM YYYY, h:mm a z")}function s(e,t){return Math.floor(t.diff(e,r.Day,!0))}function u(e,t){switch(t){case r.Day:return 0===e.hour()&&0===e.minute()&&0===e.second()&&0===e.millisecond();case r.Week:return u(e,r.Day)&&1===e.day();case r.Month:return u(e,r.Day)&&1===e.date();case r.Quarter:var n=e.month();return u(e,r.Month)&&(0===n||3===n||6===n||9===n);case r.Year:return u(e,r.Day)&&1===e.dayOfYear()}return console.log("isStartOfInterval is missing case",t),!1}function d(e,t){switch(t){case r.Day:return e.clone().startOf(r.Day);case r.Week:return e.clone().startOf(r.Day).day(1);case r.Month:return e.clone().startOf(r.Month);case r.Quarter:var n=d(e,r.Month);return n=n.month(n.month()-n.month()%3);case r.Year:return e.clone().startOf(r.Year)}return console.log("getStartOfInterval is missing case",t),e}function p(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;switch(t){case r.Quarter:return e.clone().add(3*n,r.Month)}return e.clone().add(n,t)}function f(e,t){return u(e,t)?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return p(e,t,-n)}(e,t):d(e,t)}function h(e,t){return u(e,t)?p(e,t):p(d(e,t),t)}},,,function(e,t,n){"use strict";var r=n(481);n.d(t,"Group",(function(){return r.a}));n(482),n(227)},,function(e,t,n){"use strict";var r=n(14);n.d(t,"b",(function(){return r.b})),n.d(t,"a",(function(){return r.a}))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return d}));var r=n(12),a=n.n(r),o=n(64),i=n(57),l=n(54);function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"timestart",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"carparkname",r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o={$match:a()({},t,{$gte:new Date(e.start.toISOString()),$lt:new Date(e.end.toISOString())})};return e.carParks&&e.carParks.length>0?o.$match[n]={$in:e.carParks}:o.$match[n]=r?null:{$ne:null},o}n.d(t,"b",(function(){return l.a})),n.d(t,"c",(function(){return l.b})),n.d(t,"d",(function(){return l.c})),n.d(t,"e",(function(){return l.d})),n.d(t,"f",(function(){return l.f})),n.d(t,"g",(function(){return l.g}));var s=function(e){return o.e.includes(e)},u=function(e,t){return s(e)?t.filter((function(t){return t.state===e})).map((function(e){return e.name})):e!==i.a&&e!==i.b?[e]:void 0},d=function(e,t){if(s(e))return[e];if(e!==i.a&&e!==i.b){var n=t.find((function(t){return t.name===e}));return n?[n.state]:void 0}}},function(e,t,n){"use strict";var r=n(458);n.d(t,"Reducers",(function(){return r.a}));var a=n(215);n.d(t,"Actions",(function(){return a.a}));n(459)},,function(e,t,n){"use strict";n(216);var r=n(468);n.d(t,"ConnectedValueLabel",(function(){return r.a}));var a=n(469);n.o(a,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return a.LABEL_THEME_TITLE})),n.o(a,"Label")&&n.d(t,"Label",(function(){return a.Label})),n.o(a,"VALUE_LABEL_THEME_HUGE_GREEN_CENTERED")&&n.d(t,"VALUE_LABEL_THEME_HUGE_GREEN_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_GREEN_CENTERED})),n.o(a,"VALUE_LABEL_THEME_HUGE_GREY_CENTERED")&&n.d(t,"VALUE_LABEL_THEME_HUGE_GREY_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_GREY_CENTERED})),n.o(a,"VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED")&&n.d(t,"VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED})),n.o(a,"VALUE_LABEL_THEME_HUGE_RED_CENTERED")&&n.d(t,"VALUE_LABEL_THEME_HUGE_RED_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_RED_CENTERED})),n.o(a,"VALUE_LABEL_THEME_LARGE")&&n.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return a.VALUE_LABEL_THEME_LARGE})),n.o(a,"VALUE_LABEL_THEME_MEDIUM_CENTERED")&&n.d(t,"VALUE_LABEL_THEME_MEDIUM_CENTERED",(function(){return a.VALUE_LABEL_THEME_MEDIUM_CENTERED})),n.o(a,"VALUE_LABEL_THEME_ORANGE_CENTERED")&&n.d(t,"VALUE_LABEL_THEME_ORANGE_CENTERED",(function(){return a.VALUE_LABEL_THEME_ORANGE_CENTERED})),n.o(a,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return a.kvsComponentSelector}));var o=n(147);n.d(t,"VALUE_LABEL_THEME_HUGE_GREEN_CENTERED",(function(){return o.b})),n.d(t,"VALUE_LABEL_THEME_HUGE_GREY_CENTERED",(function(){return o.c})),n.d(t,"VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED",(function(){return o.d})),n.d(t,"VALUE_LABEL_THEME_HUGE_RED_CENTERED",(function(){return o.e})),n.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return o.f})),n.d(t,"VALUE_LABEL_THEME_MEDIUM_CENTERED",(function(){return o.g})),n.d(t,"VALUE_LABEL_THEME_ORANGE_CENTERED",(function(){return o.h}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return r}));var r,a=n(12),o=n.n(a),i=n(19),l={setFontsLoading:Object(i.createAction)("app/SET_FONTS_LOADING",(function(e){return function(t){return e(t)}})),setBusy:Object(i.createAction)("app/SET_BUSY",(function(e){return function(t){return e(t)}})),setGlobalMessage:Object(i.createAction)("app/SET_GLOBAL_MESSAGE",(function(e){return function(t){return e(t)}})),setError:Object(i.createAction)("app/SET_ERROR",(function(e){return function(t){return e(t)}}))};function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(i.getType)(l.setFontsLoading):return s({},e,{fontsLoading:t.payload});case Object(i.getType)(l.setBusy):return s({},e,{busy:e.busy+(t.payload?1:-1)});case Object(i.getType)(l.setGlobalMessage):return s({},e,{globalMessage:t.payload?s({type:r.Info},t.payload):void 0});case Object(i.getType)(l.setError):return s({},e,{globalMessage:t.payload?s({type:r.Error},t.payload):void 0});default:return e}}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(19),a={resetPassword:Object(r.createAsyncAction)("userAdmin/RESET_PASSWORD_REQUEST","userAdmin/RESET_PASSWORD_SUCCESS","userAdmin/RESET_PASSWORD_FAILURE")(),createUser:Object(r.createAsyncAction)("userAdmin/CREATE_USER_REQUEST","userAdmin/CREATE_USER_SUCCESS","userAdmin/CREATE_USER_FAILURE")(),updateUser:Object(r.createAsyncAction)("userAdmin/UPDATE_USER_REQUEST","userAdmin/UPDATE_USER_SUCCESS","userAdmin/UPDATE_USER_FAILURE")(),deleteUser:Object(r.createAsyncAction)("userAdmin/DELETE_USER_REQUEST","userAdmin/DELETE_USER_SUCCESS","userAdmin/DELETE_USER_FAILURE")(),getUsers:Object(r.createAsyncAction)("userAdmin/GET_USERS_REQUEST","userAdmin/GET_USERS_SUCCESS","userAdmin/GET_USERS_FAILURE")(),editUser:Object(r.createStandardAction)("userAdmin/EDIT_USER")()}},,function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return d.b})),n.d(t,"d",(function(){return d.a})),n.d(t,"b",(function(){return E}));var r=n(12),a=n.n(r),o=n(19),i={setFirebaseLoading:Object(o.createStandardAction)("user/SET_FIREBASE_LOADING")(),setLoggedOut:Object(o.createStandardAction)("user/SET_LOGGED_OUT")(),signUp:Object(o.createAsyncAction)("user/SIGNUP_REQUEST","user/SIGNUP_SUCCESS","user/SIGNUP_FAILURE")(),login:Object(o.createAsyncAction)("user/LOGIN_REQUEST","user/LOGIN_SUCCESS","user/LOGIN_FAILURE")(),federatedLogin:Object(o.createAsyncAction)("user/FEDERATED_LOGIN_REQUEST","user/FEDERATED_LOGIN_SUCCESS","user/FEDERATED_LOGIN_FAILURE")(),checkPermissions:Object(o.createAsyncAction)("user/CHECK_PERMISSIONS_REQUEST","user/CHECK_PERMISSIONS_SUCCESS","user/CHECK_PERMISSIONS_FAILURE")(),setError:Object(o.createStandardAction)("user/SET_ERROR")()};function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.setFirebaseLoading):return c({},e,{firebaseLoading:t.payload});case Object(o.getType)(i.setLoggedOut):return c({},e,{userDetails:void 0});case Object(o.getType)(i.signUp.request):case Object(o.getType)(i.login.request):case Object(o.getType)(i.federatedLogin.request):return c({},e,{updating:!0});case Object(o.getType)(i.signUp.success):case Object(o.getType)(i.login.success):case Object(o.getType)(i.federatedLogin.success):return c({},e,{updating:!1});case Object(o.getType)(i.signUp.failure):case Object(o.getType)(i.login.failure):case Object(o.getType)(i.federatedLogin.failure):return c({},e,{updating:!1,error:t.payload});case Object(o.getType)(i.checkPermissions.request):return c({},e,{updating:!0});case Object(o.getType)(i.checkPermissions.success):return c({},e,{updating:!1,userDetails:t.payload,error:void 0});case Object(o.getType)(i.checkPermissions.failure):return c({},e,{updating:!1,error:t.payload});case Object(o.getType)(i.setError):return c({},e,{error:t.payload});default:return e}},d=n(59),p=n(16),f=n.n(p),h=n(63),m=n.n(h),y=n(93),g=n(73),b=n(74),A=n(114),E=[Object(b.b)(i.signUp.request,(function(e){return m.a.auth().createUserWithEmailAndPassword(e.email,e.password).then((function(e){return i.signUp.success()})).catch((function(e){return i.signUp.failure(Object(d.c)(d.a.BadCredentials,e.message))}))})),Object(b.b)(i.login.request,(function(e){return m.a.auth().signInWithEmailAndPassword(e.email,e.password).then((function(e){return i.login.success()})).catch((function(e){return i.login.failure(Object(d.c)(d.a.BadCredentials,e.message))}))})),Object(b.b)(i.federatedLogin.request,(function(){var e=new m.a.auth.GoogleAuthProvider;return m.a.auth().signInWithPopup(e).then((function(e){return i.federatedLogin.success()})).catch((function(e){return i.federatedLogin.failure(Object(d.c)(d.a.BadCredentials,e.message))}))})),Object(b.b)(i.checkPermissions.request,(function(){return y.QueryService.checkPermission().then((function(e){return i.checkPermissions.success(function(e,t){if(e){var n=t&&t.role?t.role:d.b.viewer;return{displayName:e.displayName||e.email||"Unknown user",role:n}}return{displayName:"Unknown User",role:d.b.inactive}}(m.a.auth().currentUser,e))})).catch((function(e){var t,n;return f.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=m.a.auth().currentUser,!(n=t&&!t.emailVerified)){r.next=5;break}return r.next=5,f.a.awrap(null==t?void 0:t.sendEmailVerification().catch((function(e){})));case 5:return r.next=7,f.a.awrap(m.a.auth().signOut());case 7:return r.abrupt("return",i.checkPermissions.failure(Object(d.c)(n?d.a.EmailUnverified:d.a.NoPermission,e.message,t&&t.email?t.email:void 0)));case 8:case"end":return r.stop()}}),null,null,null,Promise)}))})),Object(b.a)(i.setLoggedOut,(function(){return g.Actions.setMenuItem(A.b)}))]},function(e,t,n){"use strict";n.d(t,"b",(function(){return S})),n.d(t,"a",(function(){return k}));var r=n(107),a=n(740),o=n(219),i=n(284),l=n(62),c=n.n(l),s=n(741),u=n(39),d=n(73),p=n(64),f=n(45),h=n(101),m=n(36),y=n(111),g=n(197),b=n(18),A=Object(r.c)({global:u.c,menu:d.Reducers,timeZone:p.c,user:f.c,userAdmin:h.Reducers,data:y.DataReducers,kdsData:m.Reducers,kvsComponent:b.KVSComponentReducers}),E=s.a.apply(void 0,c()(f.b).concat(c()(h.Epics),c()(g.b))),v={key:"root",storage:o.a,whitelist:[]},S=function(e){var t=[],n=Object(a.a)();t.push(n);var o=[];o.push(r.a.apply(void 0,t));var i=r.d,l=Object(r.e)(e,i.apply(void 0,o));return n.run(E),l}(Object(i.a)(v,A)),k=Object(i.b)(S)},,function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}));var r,a=0;!function(e){e.Line="Line graph",e.LayeredLine="Layered line graph",e.LayeredArea="Layered area graph",e.StackedLine="Stacked line graph",e.StackedLinePercentage="Stacked line percentage graph",e.StackedArea="Stacked area graph",e.StackedAreaPercentage="Stacked area percentage graph"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var r=n(30);function a(e,t){return e.format("YYYY-MM-DD")+" to "+t.format("YYYY-MM-DD")}function o(e,t,n){if(void 0===n)return!1;var a=Object(r.d)((function(t){return e(t).dataStampData[n]}));return void 0===t||a!==t.dataStamp}},,,,,function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return c})),n.d(t,"h",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"b",(function(){return d})),n.d(t,"g",(function(){return p})),n.d(t,"d",(function(){return f})),n.d(t,"f",(function(){return h}));var r=n(12),a=n.n(r);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"date",n={$match:a()({},t,{$gte:new Date(e.start.toISOString()),$lt:new Date(e.end.toISOString())})};return n}function c(e){return{$match:a()({},e.field,{$in:e.values})}}function s(e){return e?{$match:a()({},e.filterKey,{$in:e.values})}:{$match:{}}}function u(e){return e?{$match:a()({},e.filterKey,{$in:e.values})}:{$match:{}}}function d(e){var t={};e.firstOutputs&&e.firstOutputs.forEach((function(e){t[e]={$first:"$"+e}})),e.sumOutputs&&e.sumOutputs.forEach((function(e){t[e]={$sum:"$"+e}})),e.addCount&&(t[e.addCount]={$sum:1});var n=e.fields.map((function(e){return{$toString:"$"+e}}));return{$group:i({_id:1==n.length?n[0]:{$concat:n}},t)}}function p(e){return{$sort:a()({},e.field,e.ascendingOrder?1:-1)}}function f(e){return{$limit:e.limit}}function h(e){var t={};return e.outputs&&e.outputs.forEach((function(e){t[e]=!0})),e.projectOutputs&&e.projectOutputs.forEach((function(e){t[e.to]="$"+e.from})),{$project:i({_id:!1},t)}}},,function(e,t,n){"use strict";n(233);var r=n(512);n.d(t,"ConnectedDataTable",(function(){return r.a}));var a=n(205);n.o(a,"DATA_TABLE_THEME_DEFAULT")&&n.d(t,"DATA_TABLE_THEME_DEFAULT",(function(){return a.DATA_TABLE_THEME_DEFAULT})),n.o(a,"DATA_TABLE_THEME_DOUBLE_ROWS")&&n.d(t,"DATA_TABLE_THEME_DOUBLE_ROWS",(function(){return a.DATA_TABLE_THEME_DOUBLE_ROWS}));var o=n(157);n.d(t,"DATA_TABLE_THEME_DEFAULT",(function(){return o.a})),n.d(t,"DATA_TABLE_THEME_DOUBLE_ROWS",(function(){return o.b}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o}));var r="All "+n(14).b.strings.car_parks,a="All states",o=[{name:"Sydney",state:"NSW",latitude:-33.8688,longitude:151.2093},{name:"Melbourne",state:"VIC",latitude:-37.8136,longitude:144.9631},{name:"Brisbane",state:"QLD",latitude:-27.4698,longitude:153.0251},{name:"Perth",state:"WA",latitude:-31.9505,longitude:115.8605},{name:"Adelaide",state:"SA",latitude:-34.9285,longitude:138.6007}]},function(e,t,n){"use strict";n.d(t,"b",(function(){return b})),n.d(t,"a",(function(){return g}));var r=n(7),a=n.n(r),o=n(34),i=n.n(o),l=n(0),c=n.n(l),s=n(106),u=n.n(s),d=n(66),p=n(2),f=n(5),h=n(24),m=n(4),y=n(1),g={titleStyle:[y.b.grey.bodyL.bold,{alignSelf:"center"}],messageStyle:[y.b.grey.bodyM.regular,{alignSelf:"center"}],dialogContainerStyle:{alignSelf:"center",borderWidth:1,borderColor:y.a.grey,backgroundColor:y.a.white,borderRadius:5,padding:10,paddingHorizontal:20,minWidth:250},modalStyle:{backgroundColor:"rgba(192, 192, 192, 0.75)"}};function b(e){var t=e.buttons,n=void 0===t?[]:t,r=e.theme,o=void 0===r?g:r,s=Object(l.useState)(e.show),y=i()(s,2),b=y[0],A=y[1];Object(l.useEffect)((function(){return A(e.show)}));return c.a.createElement(u.a,{animationType:"fade",transparent:!0,supportedOrientations:["landscape"],visible:b,ariaHideApp:!1,onRequestClose:void 0},c.a.createElement(d.a,{onPress:function(){A(!1),e.onClose&&e.onClose()}},c.a.createElement(p.a,{style:[{flex:1},o.modalStyle]})),c.a.createElement(p.a,{style:{position:"absolute",height:"100%",width:"100%",flex:1,justifyContent:"space-around"},pointerEvents:"box-none"},c.a.createElement(p.a,{style:o.dialogContainerStyle},c.a.createElement(f.a,{style:o.titleStyle},e.title),c.a.createElement(m.a.Spacer,null),e.message&&c.a.createElement(f.a,{style:o.messageStyle},e.message),e.children&&c.a.createElement(c.a.Fragment,null,e.children),c.a.createElement(m.a.SpacerDouble,null),c.a.createElement(p.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"center"}},n.map((function(e,t){return c.a.createElement(c.a.Fragment,null,c.a.createElement(h.Button,a()({key:t},e)),t!==n.length-1&&c.a.createElement(m.a.Spacer,null))}))),c.a.createElement(m.a.Spacer,null))))}var A=b;t.c=A},function(e,t,n){"use strict";var r,a;function o(e,t,n){return{code:e,message:t,email:n}}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return o})),function(e){e.administrator="administrator",e.editor="editor",e.viewer="viewer",e.updateRequired="update required",e.inactive="inactive"}(r||(r={})),function(e){e.BadCredentials="Bad Credentials",e.EmailUnverified="Email Unverified",e.NoPermission="No Permission"}(a||(a={}))},,,,,function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return f})),n.d(t,"b",(function(){return s})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return y})),n.d(t,"g",(function(){return g}));var r=n(12),a=n.n(r),o=n(19),i={setTimeZoneState:Object(o.createStandardAction)("timeZone/SET_TIME_ZONE_STATE")()};function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.setTimeZoneState):return c({},e,{timeZoneState:t.payload});default:return e}},p=n(162),f={timeZoneState:Object(p.createSelector)((function(e){return e.timeZone}),(function(e){return e.timeZoneState}))};!function(e){e.ACT="ACT",e.NSW="NSW",e.NT="NT",e.QLD="QLD",e.SA="SA",e.TAS="TAS",e.VIC="VIC",e.WA="WA"}(s||(s={}));var h,m=Object.keys(s);function y(e){return"Australia/"+function(e){switch(e){case s.ACT:return h.Canberra;case s.NSW:return h.Sydney;case s.NT:return h.Darwin;case s.QLD:return h.Brisbane;case s.SA:return h.Adelaide;case s.TAS:return h.Hobart;case s.VIC:return h.Melbourne;case s.WA:return h.Perth}return"Unknown"}(e)}function g(e){switch(e){case"Australian Capital Territory":return s.ACT;case"New South Wales":return s.NSW;case"Northern Territory":return s.NT;case"Queensland":return s.QLD;case"South Australia":return s.SA;case"Tasmania":return s.TAS;case"Victoria":return s.VIC;case"Western Australia":return s.WA}return"Unknown"}!function(e){e.Canberra="Canberra",e.Sydney="Sydney",e.Darwin="Darwin",e.Brisbane="Brisbane",e.Adelaide="Adelaide",e.Hobart="Hobart",e.Melbourne="Melbourne",e.Perth="Perth"}(h||(h={}))},,,function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(125);function a(e,t){return e.replace("rgb","rgba").replace(")",", "+t+")")}function o(e){return r.e(r.a).domain([0,Math.max(e,1)])}function i(e,t){return r.e(r.b).domain([t,e])}},,,,function(e,t,n){"use strict";var r=n(511);n.d(t,"PickerBox",(function(){return r.a}));var a=n(477);n.o(a,"PICKER_BOX_THEME_SLIM")&&n.d(t,"PICKER_BOX_THEME_SLIM",(function(){return a.PICKER_BOX_THEME_SLIM}));var o=n(224);n.d(t,"PICKER_BOX_THEME_SLIM",(function(){return o.b}))},function(e,t,n){"use strict";n.d(t,"e",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"h",(function(){return l})),n.d(t,"g",(function(){return c})),n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"i",(function(){return d}));var r={};n.r(r),n.d(r,"publicHolidays",(function(){return f})),n.d(r,"schoolHolidays",(function(){return h}));var a={};n.r(a),n.d(a,"newRequest",(function(){return A}));var o={};n.r(o),n.d(o,"newRequest",(function(){return v})),n.d(o,"createProjection",(function(){return S}));var i={};n.r(i),n.d(i,"getTopGroups",(function(){return R})),n.d(i,"newRequest",(function(){return C}));var l={};n.r(l),n.d(l,"newRequest",(function(){return P}));var c={};n.r(c),n.d(c,"newRequest",(function(){return w}));var s={};n.r(s),n.d(s,"newRequest",(function(){return I}));var u={};n.r(u),n.d(u,"newRequest",(function(){return L}));var d={};n.r(d),n.d(d,"newRequestPipeline",(function(){return Z}));var p=n(54);function f(e,t){return{database:e,collection:"public_holidays",operation:"aggregate",query:{pipeline:m(t)}}}function h(e,t){return{database:e,collection:"school_holidays",operation:"aggregate",query:{pipeline:y(t)}}}function m(e){return[g(e),{$group:{_id:{$concat:[{$dateToString:{date:"$date"}},{$trim:{input:"$holiday_name"}}]},date:{$first:"$date"},name:{$first:"$holiday_name"},states:{$push:"$region_code"}}},{$group:{_id:"$date",description:{$push:{name:{$trim:{input:"$name"}},states:b("$states")}}}},{$project:{_id:!1,date:"$_id",description:{$reduce:{input:"$description",initialValue:"",in:{$concat:["$$value",{$concat:["$$this.name"," ","$$this.states"]},{$cond:[{$eq:["$$this",{$arrayElemAt:["$description",-1]}]},"",", "]}]}}}}},{$sort:{date:1}}]}function y(e){return[g(e),{$group:{_id:"$date",states:{$push:"$region_code"}}},{$project:{_id:!1,date:"$_id",description:{$concat:["School holiday ",b("$states")]}}},{$sort:{date:1}}]}function g(e){var t=p.c(e);return e.states&&(t.$match.region_code={$in:e.states}),t}function b(e){return{$cond:[{$eq:[{$size:e},8]},"(ALL)",{$reduce:{input:e,initialValue:"(",in:{$concat:["$$value","$$this",{$cond:[{$eq:["$$this",{$arrayElemAt:[e,-1]}]},")",", "]}]}}}]}}function A(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{pipeline:E(t)}}}function E(e){return[p.c(e),{$project:{_id:!1,date:"$"+(e.dateKey||"date"),description:"$"+(e.descriptionKey||"description")}},{$sort:{date:1}}]}function v(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:k(t)}}}function S(e){var t={_id:!1,date:e.dateKey},n=e.multiValueKeys,r=void 0===n?[]:n,a=e.multiCountKeys,o=void 0===a?[]:a;if(r.length>0||o.length>0){if(r.length>0){if(o.length>0&&o.length!=r.length)throw new Error("Mismatched length of multiCountKeys and multiValueKeys");r.forEach((function(e){t[e]="$"+e}))}if(o.length>0){if(r.length>0&&r.length!=o.length)throw new Error("Mismatched length of multiCountKeys and multiValueKeys");o.forEach((function(e){t[e]="$"+e}))}}else t.value=e.valueKey?e.valueKey:1,t.count=e.countKey?e.countKey:1;return e.extraKeys&&e.extraKeys.length>0&&e.extraKeys.forEach((function(e){t[e]="$"+e})),t}function k(e){var t=[{$project:S(e)}];return e.filter&&t.unshift(p.a(e.filter)),t}var T=n(8),O=n.n(T);function R(e,t){var n=null!=t?t:{},r=n.count,a=n.group,o=void 0===a?"group":a,i=n.start,l=n.end,c=[];null==e||e.forEach((function(e){if(function(e,t,n){var r=O()(e.date);return!(null==r||!r.isValid())&&(null!=t&&null!=n?r.isSameOrAfter(t,"days")&&r.isSameOrBefore(n,"days"):null!=t?r.isSameOrAfter(t,"days"):null==n||r.isSameOrBefore(n,"days"))}(e,i,l)){var t=e[o];if(t){var n=c.find((function(e){return e.group===t}));n?n.value+=e.value:c.push({group:t,value:e.value})}}})),c.sort((function(e,t){return e.value0?{$match:B({},t.$match,{category:{$in:e.categories}})}:t}function L(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:F(t)}}}function F(e){return[p.c(e,e.dateKey),p.h(e.stringFilter),p.e(e.numberFilter),{$project:{_id:!1,date:"$"+(e.dateKey||"date"),value:"$value",latitude:"$latitude",longitude:"$longitude"}},{$sort:{date:1}}]}var W=n(160);function Z(e){return{database:e.database||W.a.defaultDatabase||"NO_DATABASE_DEFINED",collection:e.collection,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:e.pipeline}}}},function(e,t,n){"use strict";var r=n(315);n.d(t,"Reducers",(function(){return r.a}));var a=n(136);n.d(t,"Actions",(function(){return a.a}));n(316)},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s}));var r=n(19),a=n(553),o=n(276),i=n(277),l=n(285);function c(e,t){return function(n,i){return n.pipe(Object(a.a)(Object(r.isActionOf)(e)),Object(o.a)((function(e){return t(e.payload,i)})))}}function s(e,t){return function(n,o){return n.pipe(Object(a.a)(Object(r.isActionOf)(e)),Object(i.a)((function(e){return Object(l.a)(t(e.payload,o))})))}}},,,function(e,t,n){"use strict";var r=n(52),a=n(83),o=n(142),i=a.a.get("window"),l=i.width,c=i.height,s="android"===r.a.OS,u="ios"===r.a.OS,d="web"===r.a.OS,p=a.a.get("screen"),f=Math.min(p.width,p.height,420)/360;function h(e){return Math.round(e*f)}var m={isAndroid:s,isIos:u,isWeb:d,screenWidth:l,screenHeight:c,screenScale:f,statusBarHeight:"android"===r.a.OS?o.a.statusBarHeight:0,tinyMargin:2.5,smallMargin:5,baseMargin:10,doubleBaseMargin:20,tripleBaseMargin:30,quadBaseMargin:40,sixBaseMargin:60,eightBaseMargin:80,icons:{tiny:h(15),small:h(20),mediumSmall:h(24),medium:h(28),large:h(36),huge:h(48),massive:h(96)},minPageWidth:700,maxDialogWidth:Math.min(.75*l,500),borderRadius:5,infoButtonSize:14,infoButtonPadding:5,invalidOpacity:.5,timing:{componentDebounce:200,componentThrottle:400}};t.a=m},function(e,t,n){"use strict";n.d(t,"e",(function(){return _.d})),n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"h",(function(){return i})),n.d(t,"j",(function(){return l})),n.d(t,"k",(function(){return c})),n.d(t,"i",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"l",(function(){return p})),n.d(t,"n",(function(){return f})),n.d(t,"g",(function(){return h})),n.d(t,"m",(function(){return m}));var r={};n.r(r),n.d(r,"newRequest",(function(){return g}));var a={};n.r(a),n.d(a,"newRequest",(function(){return v}));var o={};n.r(o),n.d(o,"byBookingCount",(function(){return k})),n.d(o,"byValue",(function(){return T}));var i={};n.r(i),n.d(i,"Category",(function(){return C})),n.d(i,"newRequest",(function(){return D}));var l={};n.r(l),n.d(l,"newRequest",(function(){return V}));var c={};n.r(c),n.d(c,"newRequest",(function(){return I}));var s={};n.r(s),n.d(s,"newRequest",(function(){return F}));var u={};n.r(u),n.d(u,"newRequest",(function(){return Z}));var d={};n.r(d),n.d(d,"newRequest",(function(){return Q}));var p={};n.r(p),n.d(p,"newRequest",(function(){return z}));var f={};n.r(f),n.d(f,"newRequest",(function(){return K}));var h={};n.r(h),n.d(h,"newPromoCampaignStatRequest",(function(){return X}));var m={};n.r(m),n.d(m,"newRequest",(function(){return q}));var y=n(33);function g(e){return{database:y.b.dataService.database,collection:"bookings",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:b(e)}}}function b(e){return[A(e),{$sort:{datetime:-1}},{$limit:e.limit||1e3},{$project:{_id:!1,datetime:!0,pseudoId:"$pseudoid",carPark:"$carparkname",product:!0,city:"$geocity",value:"$valueaud"}}]}function A(e){var t={$match:{datetime:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)},product:{$ne:null},geocity:{$ne:null}}};return e.carParks&&e.carParks.length>0&&(t.$match.carparkname={$in:e.carParks}),t}var E=n(35);function v(e){return{database:y.b.dataService.database,collection:"bookings_summary_daily",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:S(e)}}}function S(e){return[E.a(e,"timestart","carparkname",!1),{$facet:{values:[{$group:{_id:"$carparkname",count:{$sum:"$totalbookings"}}},{$project:{_id:!1,k:"$_id",v:"$count"}}]}},{$replaceRoot:{newRoot:{$arrayToObject:"$values"}}}]}function k(e){return{database:y.b.dataService.database,collection:"daily_products_by_booking_count",operation:"aggregate",query:{pipeline:O(e)}}}function T(e){return{database:y.b.dataService.database,collection:"daily_products_by_booking_value",operation:"aggregate",query:{pipeline:O(e)}}}function O(e){var t=[{$facet:{products:[R(e),{$group:{_id:"$product",count:{$sum:"$count"}}},{$sort:{count:-1}},{$project:{_id:!1,name:"$_id"}}]}},{$project:{products:{$map:{input:"$products",in:"$$this.name"}}}}];return e.limit&&t[0].$facet.products.splice(3,0,{$limit:e.limit}),t}function R(e){var t={$match:{product:{$ne:null},date:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)}}};return e.carParks&&e.carParks.length>0&&(t.$match.carparkname={$in:e.carParks}),t}var C,U=n(130);function D(e){return{database:y.b.dataService.database,collection:e.bookingSource===U.BookingSource.App?"bookings_summary_daily":"bookings_web_summary_daily",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:P(e)}}}function P(e){return[E.a(e),w(e),{$sort:{timeStart:1}}]}function w(e){var t=e.category&&e.category===C.UserType?"$valuesbyusertype":"$valuesbyproduct";return{$project:{_id:!1,carParkName:e.carParks&&1===e.carParks.length?e.carParks[0]:null,timeStart:"$timestart",timeEnd:"$timeend",totalValue:"$totalvalue",valuesByCategory:t}}}!function(e){e[e.Product=0]="Product",e[e.UserType=1]="UserType"}(C||(C={}));var M=n(62),x=n.n(M);function V(e){return{database:y.b.dataService.database,collection:e.bookingSource===U.BookingSource.App?"car_park_sales_daily_forecast":"web_bookings_daily_forecast",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:j(e)}}}function j(e){return[B(e)].concat(x()(function(e){return[{$group:{_id:{$concat:[{$toString:{$year:"$timestamp"}},{$toString:{$month:"$timestamp"}},{$toString:{$dayOfMonth:"$timestamp"}}]},carparkname:e.carParks&&1===e.carParks.length?{$first:"$carParkName"}:{$first:null},timestamp:{$first:"$timestamp"},p10:{$sum:"$p10"},p50:{$sum:"$p50"},p90:{$sum:"$p90"}}}]}(e)),[{$sort:{timestamp:1}},{$project:{_id:!1,carParkName:"$carparkname",timeStart:{$dateToString:{date:"$timestamp"}},timeEnd:{$dateToString:{date:{$add:["$timestamp",864e5]}}},valueAudP10:"$p10",valueAudP50:"$p50",valueAudP90:"$p90"}}])}function B(e){var t={$match:{timestamp:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)}}};if(e.carParks&&e.carParks.length>0){var n=e.carParks.map((function(e){return e.toLowerCase()}));t.$match.carParkName={$in:n}}return t}function I(e){return{database:y.b.dataService.database,collection:"car_park_sales_daily_forecast",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:L(e)}}}function N(e){return{$match:{carParkName:{$in:e.carParks.map((function(e){return e.toLowerCase()}))},timestamp:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)}}}}function J(e){var t={$project:{_id:!1,predictions:{$arrayToObject:"$predictions"}}};return"carPark"===e?t.$project.carParkName="$_id":(t.$project.timeStart={$dateToString:{date:"$timestamp"}},t.$project.timeEnd={$dateToString:{date:{$add:["$timestamp",864e5]}}}),t}function L(e){var t,n={$sort:{}};return"date"===e.grouping?n.$sort.timeStart=1:n.$sort.carParkName=1,[N(e)].concat(x()([{$group:{_id:{$concat:["$carParkName",{$dateToString:{date:"$timestamp"}}]},carparkname:{$first:"$carParkName"},timestamp:{$first:"$timestamp"},p10:{$first:"$p10"},p50:{$first:"$p50"},p90:{$first:"$p90"}}},{$group:{_id:"carPark"===(t=e.grouping)?"$carparkname":{$dateToString:{date:"$timestamp"}},timestamp:{$first:"$timestamp"},predictions:{$push:{k:"carPark"===t?{$dateToString:{date:"$timestamp"}}:"$carparkname",v:{valueAudP10:"$p10",valueAudP50:"$p50",valueAudP90:"$p90"}}}}}]),[J(e.grouping),n])}function F(e){return{database:y.b.dataService.database,collection:"bookings_summary_daily",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:W(e)}}}function W(e){return[E.a(e,"timestart","carparkname",!1),{$facet:{values:[{$group:{_id:"$carparkname",value:{$sum:"$totalvalue"}}},{$project:{_id:!1,k:"$_id",v:{$floor:"$value"}}}]}},{$replaceRoot:{newRoot:{$arrayToObject:"$values"}}}]}function Z(e){return{database:y.b.dataService.database,collection:"bookings",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:H(e)}}}function H(e){return[E.a(e,"datetime","carparkname",!1),{$group:{_id:"$usertype",totalValue:{$sum:"$valueaud"},totalCount:{$sum:1}}},{$project:{_id:!1,userType:"$_id",average:{$divide:["$totalValue","$totalCount"]}}}]}function Q(e){return{database:y.b.dataService.database,collection:"bookings_screen_transactions_per_user",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:G(e)}}}function G(e){return[E.d(e),{$group:{_id:"$category",transactionCount:{$sum:"$count"}}},{$group:{_id:null,userCount:{$sum:1},transactionCount:{$sum:"$transactionCount"}}},{$project:{_id:!1,value:{$divide:["$transactionCount","$userCount"]}}}]}function z(e){return{database:y.b.dataService.database,collection:"summary_screen_active_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:Y(e)}}}function Y(e){return[E.d(e,"datetime"),E.c({fields:["category"],firstOutputs:["category"]}),E.c({fields:[],addCount:"value"})]}function K(){return{database:y.b.dataService.database,collection:"summary_screen_all_time_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[E.g({field:"date"}),E.e({limit:1}),E.f({outputs:["value"]})]}}}function X(){return{database:y.b.dataService.database,collection:"promo_campaigns_stats",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[]}}}function q(){return{database:y.b.dataService.database,collection:"summary_screen_all_time_apple_apy",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[E.g({field:"date"}),E.e({limit:1}),E.f({outputs:["value"]})]}}}var _=n(72)},,,function(e,t,n){"use strict";n.d(t,"d",(function(){return L})),n.d(t,"e",(function(){return D})),n.d(t,"c",(function(){return x})),n.d(t,"a",(function(){return V})),n.d(t,"b",(function(){return j}));var r=n(12),a=n.n(r),o=n(10),i=n.n(o),l=n(11),c=n.n(l),s=n(15),u=n.n(s),d=n(6),p=n.n(d),f=n(13),h=n.n(f),m=n(0),y=n.n(m),g=n(5),b=n(25),A=n(76),E=n(2),v=n(66),S=n(155),k=n(1),T=n(4),O=n(32),R=n(29),C=n(26);function U(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var a=p()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u()(this,n)}}var D,P=function(e){h()(n,e);var t=U(n);function n(){return i()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.onPrevPress,n=e.onNextPress;return m.createElement(E.a,{style:w.container},m.createElement(R.a,{onPress:t},m.createElement(O.a,{source:k.c.arrowLeft,style:w.arrow})),m.createElement(R.a,{onPress:n},m.createElement(O.a,{source:k.c.arrowRight,style:w.arrow})))}}]),n}(m.PureComponent),w=C.a.create({container:{flexDirection:"row",alignItems:"center"},arrow:{width:k.d.icons.small,height:k.d.icons.small,margin:-k.d.tinyMargin,tintColor:k.a.highlight}});function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical"}(D||(D={}));var x={legendOrientation:D.Vertical,minWidth:100,alignItems:"flex-start",backgroundColor:k.a.controlBackground,borderColor:k.a.border,borderWidth:1,borderRadius:k.d.borderRadius,font:k.b.grey.bodyS.thin},V=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n="/debug/pprof/",r=g.parse(n,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=c}return r.query=i()({},r.query,l,t.query),delete r.search,a.headers=i()({},o,t.headers),{url:g.format(r),options:a}},debugPprofProfileGet:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("profile","Required parameter profile was null or undefined when calling debugPprofProfileGet.");var r="/debug/pprof/{profile}".replace("{profile}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}}}},O=function(e){return{debugPprofGet:function(t){var n=T(e).debugPprofGet(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e;throw e}))}},debugPprofProfileGet:function(t,n){var r=T(e).debugPprofProfileGet(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e;throw e}))}}}},R=(function(e){p()(n,e);var t=b(n);function n(){return y()(this,n),t.apply(this,arguments)}a()(n,[{key:"debugPprofGet",value:function(e){return O(this.configuration).debugPprofGet(e)(this.basePath)}},{key:"debugPprofProfileGet",value:function(e,t){return O(this.configuration).debugPprofProfileGet(e,t)(this.basePath)}}])}(S),function(e){return{adminAllocatePack:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminAllocatePack.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling adminAllocatePack.");var a="/packs/admin/user/{userId}/pack".replace("{userId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},adminAllocatePackCode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminAllocatePackCode.");if(null===n||void 0===n)throw new k("packId","Required parameter packId was null or undefined when calling adminAllocatePackCode.");var a="/packs/admin/user/{userId}/pack/{packId}/code".replace("{userId}",encodeURIComponent(String(t))).replace("{packId}",encodeURIComponent(String(n))),o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}return o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},adminDeleteUserPack:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminDeleteUserPack.");if(null===n||void 0===n)throw new k("packId","Required parameter packId was null or undefined when calling adminDeleteUserPack.");var a="/packs/admin/user/{userId}/packs/{packId}".replace("{userId}",encodeURIComponent(String(t))).replace("{packId}",encodeURIComponent(String(n))),o=g.parse(a,!0),l=i()({method:"DELETE"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}return o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},adminFixInvalidPass:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling adminFixInvalidPass.");var r="/packs/admin/fix-invalid-pass",a=g.parse(r,!0),o=i()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},adminGetProducts:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="/packs/admin/products",r=g.parse(n,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;o.Authorization=c}return r.query=i()({},r.query,l,t.query),delete r.search,a.headers=i()({},o,t.headers),{url:g.format(r),options:a}},adminGetUserPacks:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminGetUserPacks.");var a="/packs/admin/user/{userId}/packs".replace("{userId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"GET"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}return void 0!==n&&(s.type=n),o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},adminUpdateProducts:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling adminUpdateProducts.");var r="/packs/admin/products",a=g.parse(r,!0),o=i()({method:"PUT"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},amendBooking:function(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling amendBooking.");if(null===n||void 0===n)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling amendBooking.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling amendBooking.");var o="/packs/booking/{bookingNo}/amend".replace("{bookingNo}",encodeURIComponent(String(n))),l=g.parse(o,!0),c=i()({method:"POST"},a),s={},u={};if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;s["X-API-Key"]=d}void 0!==t&&null!==t&&(s.Authorization=String(t)),s["Content-Type"]="application/json",l.query=i()({},l.query,u,a.query),delete l.search,c.headers=i()({},s,a.headers);var p=!0;return c.body=p?JSON.stringify(r||{}):r||"",{url:g.format(l),options:c}},amendBookingCode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling amendBookingCode.");if(null===n||void 0===n)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling amendBookingCode.");var a="/packs/booking/{bookingNo}/amendment-code".replace("{bookingNo}",encodeURIComponent(String(n))),o=g.parse(a,!0),l=i()({method:"GET"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},bookingInfo:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling bookingInfo.");if(null===n||void 0===n)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling bookingInfo.");var a="/packs/booking/{bookingNo}".replace("{bookingNo}",encodeURIComponent(String(n))),o=g.parse(a,!0),l=i()({method:"GET"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},cancelBooking:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling cancelBooking.");if(null===n||void 0===n)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling cancelBooking.");var a="/packs/booking/{bookingNo}/cancel".replace("{bookingNo}",encodeURIComponent(String(n))),o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},emailInvoice:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling emailInvoice.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling emailInvoice.");var a="/packs/invoice",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},getActivePacks:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getActivePacks.");var r="/packs/active",a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},getPackCode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getPackCode.");if(null===n||void 0===n)throw new k("packId","Required parameter packId was null or undefined when calling getPackCode.");var a="/packs/code",o=g.parse(a,!0),l=i()({method:"GET"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==n&&(s.packId=n),void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},getPackProducts:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("sites","Required parameter sites was null or undefined when calling getPackProducts.");var r="/packs/products",a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return t&&(c.sites=t.join(v)),a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},getPacksHistory:function(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getPacksHistory.");var o="/packs/history",l=g.parse(o,!0),c=i()({method:"GET"},a),s={},u={};if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;s["X-API-Key"]=d}return void 0!==n&&(u.page=n),void 0!==r&&(u.pageSize=r),void 0!==t&&null!==t&&(s.Authorization=String(t)),l.query=i()({},l.query,u,a.query),delete l.search,c.headers=i()({},s,a.headers),{url:g.format(l),options:c}},purchasePack:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling purchasePack.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling purchasePack.");var a="/packs/purchase",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},usePackPass:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling usePackPass.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling usePackPass.");var a="/packs/usepass",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}}}}),C=function(e){return{adminAllocatePack:function(t,n,r){var a=R(e).adminAllocatePack(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminAllocatePackCode:function(t,n,r){var a=R(e).adminAllocatePackCode(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminDeleteUserPack:function(t,n,r){var a=R(e).adminDeleteUserPack(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminFixInvalidPass:function(t,n){var r=R(e).adminFixInvalidPass(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminGetProducts:function(t){var n=R(e).adminGetProducts(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminGetUserPacks:function(t,n,r){var a=R(e).adminGetUserPacks(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminUpdateProducts:function(t,n){var r=R(e).adminUpdateProducts(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},amendBooking:function(t,n,r,a){var o=R(e).amendBooking(t,n,r,a);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+o.url,o.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},amendBookingCode:function(t,n,r){var a=R(e).amendBookingCode(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},bookingInfo:function(t,n,r){var a=R(e).bookingInfo(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},cancelBooking:function(t,n,r){var a=R(e).cancelBooking(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},emailInvoice:function(t,n,r){var a=R(e).emailInvoice(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getActivePacks:function(t,n){var r=R(e).getActivePacks(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getPackCode:function(t,n,r){var a=R(e).getPackCode(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getPackProducts:function(t,n){var r=R(e).getPackProducts(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getPacksHistory:function(t,n,r,a){var o=R(e).getPacksHistory(t,n,r,a);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+o.url,o.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},purchasePack:function(t,n,r){var a=R(e).purchasePack(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},usePackPass:function(t,n,r){var a=R(e).usePackPass(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},U=function(e){p()(n,e);var t=b(n);function n(){return y()(this,n),t.apply(this,arguments)}return a()(n,[{key:"adminAllocatePack",value:function(e,t,n){return C(this.configuration).adminAllocatePack(e,t,n)(this.basePath)}},{key:"adminAllocatePackCode",value:function(e,t,n){return C(this.configuration).adminAllocatePackCode(e,t,n)(this.basePath)}},{key:"adminDeleteUserPack",value:function(e,t,n){return C(this.configuration).adminDeleteUserPack(e,t,n)(this.basePath)}},{key:"adminFixInvalidPass",value:function(e,t){return C(this.configuration).adminFixInvalidPass(e,t)(this.basePath)}},{key:"adminGetProducts",value:function(e){return C(this.configuration).adminGetProducts(e)(this.basePath)}},{key:"adminGetUserPacks",value:function(e,t,n){return C(this.configuration).adminGetUserPacks(e,t,n)(this.basePath)}},{key:"adminUpdateProducts",value:function(e,t){return C(this.configuration).adminUpdateProducts(e,t)(this.basePath)}},{key:"amendBooking",value:function(e,t,n,r){return C(this.configuration).amendBooking(e,t,n,r)(this.basePath)}},{key:"amendBookingCode",value:function(e,t,n){return C(this.configuration).amendBookingCode(e,t,n)(this.basePath)}},{key:"bookingInfo",value:function(e,t,n){return C(this.configuration).bookingInfo(e,t,n)(this.basePath)}},{key:"cancelBooking",value:function(e,t,n){return C(this.configuration).cancelBooking(e,t,n)(this.basePath)}},{key:"emailInvoice",value:function(e,t,n){return C(this.configuration).emailInvoice(e,t,n)(this.basePath)}},{key:"getActivePacks",value:function(e,t){return C(this.configuration).getActivePacks(e,t)(this.basePath)}},{key:"getPackCode",value:function(e,t,n){return C(this.configuration).getPackCode(e,t,n)(this.basePath)}},{key:"getPackProducts",value:function(e,t){return C(this.configuration).getPackProducts(e,t)(this.basePath)}},{key:"getPacksHistory",value:function(e,t,n,r){return C(this.configuration).getPacksHistory(e,t,n,r)(this.basePath)}},{key:"purchasePack",value:function(e,t,n){return C(this.configuration).purchasePack(e,t,n)(this.basePath)}},{key:"usePackPass",value:function(e,t,n){return C(this.configuration).usePackPass(e,t,n)(this.basePath)}}]),n}(S),D=function(e){return{adminDeleteUserBan:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminDeleteUserBan.");var r="/promo/admin/user/userban/{userId}".replace("{userId}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"DELETE"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},adminGetPaymentDetailUpdates:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminGetPaymentDetailUpdates.");var r="/promo/admin/user/paymentdetailupdates/{userId}".replace("{userId}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},assignCode:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling assignCode.");var r="/promo/assigncode",a=g.parse(r,!0),o=i()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},bookingEvent:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling bookingEvent.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling bookingEvent.");var a="/promo/booking-events",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},createGroup:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("group","Required parameter group was null or undefined when calling createGroup.");var a="/promo/creategroup/{group}".replace("{group}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={},u=new g.URLSearchParams;if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=d}return void 0!==n&&u.set("upfile",n),c["Content-Type"]="application/x-www-form-urlencoded",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),l.body=u.toString(),{url:g.format(o),options:l}},deleteCampaign:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling deleteCampaign.");var r="/promo/campaign/{campaignId}".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"DELETE"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},deleteCodesFile:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling deleteCodesFile.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling deleteCodesFile.");var a="/promo/campaign/{campaignId}/codefile".replace("{campaignId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"DELETE"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},generateBarcode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling generateBarcode.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling generateBarcode.");var a="/promo/requesteSpecialBarcode",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},getActiveCampaigns:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="/promo/activecampaigns",r=g.parse(n,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=c}return r.query=i()({},r.query,l,t.query),delete r.search,a.headers=i()({},o,t.headers),{url:g.format(r),options:a}},getAllCampaigns:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="/promo/allcampaigns",r=g.parse(n,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;o.Authorization=c}return r.query=i()({},r.query,l,t.query),delete r.search,a.headers=i()({},o,t.headers),{url:g.format(r),options:a}},getCampaign:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling getCampaign.");var r="/promo/campaign/{campaignId}".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},getCodes:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getCodes.");var r="/promo/codes",a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},groupPush:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling groupPush.");var r="/promo/grouppush",a=g.parse(r,!0),o=i()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},removeCode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling removeCode.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling removeCode.");var a="/promo/removecode",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},resetCampaignSentCodes:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling resetCampaignSentCodes.");var r="/promo/campaign/{campaignId}/resetsent".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},runCampaign:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling runCampaign.");var r="/promo/campaign/{campaignId}/run".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},sessionReminderPush:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling sessionReminderPush.");var r="/promo/sessionreminderpush",a=g.parse(r,!0),o=i()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},setCampaign:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling setCampaign.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling setCampaign.");var a="/promo/campaign/{campaignId}".replace("{campaignId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},setUserPaymentDetails:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling setUserPaymentDetails.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling setUserPaymentDetails.");var a="/promo/referral/paymentdetails",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},uploadCodesFile:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling uploadCodesFile.");var a="/promo/campaign/{campaignId}/codefile".replace("{campaignId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={},u=new g.URLSearchParams;if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=d}return void 0!==n&&u.set("upfile",n),c["Content-Type"]="application/x-www-form-urlencoded",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),l.body=u.toString(),{url:g.format(o),options:l}},validateReferralCode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling validateReferralCode.");if(null===n||void 0===n)throw new k("code","Required parameter code was null or undefined when calling validateReferralCode.");var a="/promo/referral/validatecode/{code}".replace("{code}",encodeURIComponent(String(n))),o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers),{url:g.format(o),options:l}},validateReferralPayment:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling validateReferralPayment.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling validateReferralPayment.");var a="/promo/referral/validatepayment",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}}}},P=function(e){return{adminDeleteUserBan:function(t,n){var r=D(e).adminDeleteUserBan(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminGetPaymentDetailUpdates:function(t,n){var r=D(e).adminGetPaymentDetailUpdates(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},assignCode:function(t,n){var r=D(e).assignCode(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},bookingEvent:function(t,n,r){var a=D(e).bookingEvent(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},createGroup:function(t,n,r){var a=D(e).createGroup(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},deleteCampaign:function(t,n){var r=D(e).deleteCampaign(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},deleteCodesFile:function(t,n,r){var a=D(e).deleteCodesFile(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},generateBarcode:function(t,n,r){var a=D(e).generateBarcode(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getActiveCampaigns:function(t){var n=D(e).getActiveCampaigns(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getAllCampaigns:function(t){var n=D(e).getAllCampaigns(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getCampaign:function(t,n){var r=D(e).getCampaign(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getCodes:function(t,n){var r=D(e).getCodes(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},groupPush:function(t,n){var r=D(e).groupPush(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},removeCode:function(t,n,r){var a=D(e).removeCode(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},resetCampaignSentCodes:function(t,n){var r=D(e).resetCampaignSentCodes(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},runCampaign:function(t,n){var r=D(e).runCampaign(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},sessionReminderPush:function(t,n){var r=D(e).sessionReminderPush(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},setCampaign:function(t,n,r){var a=D(e).setCampaign(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},setUserPaymentDetails:function(t,n,r){var a=D(e).setUserPaymentDetails(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},uploadCodesFile:function(t,n,r){var a=D(e).uploadCodesFile(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},validateReferralCode:function(t,n,r){var a=D(e).validateReferralCode(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},validateReferralPayment:function(t,n,r){var a=D(e).validateReferralPayment(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},w=function(e){p()(n,e);var t=b(n);function n(){return y()(this,n),t.apply(this,arguments)}return a()(n,[{key:"adminDeleteUserBan",value:function(e,t){return P(this.configuration).adminDeleteUserBan(e,t)(this.basePath)}},{key:"adminGetPaymentDetailUpdates",value:function(e,t){return P(this.configuration).adminGetPaymentDetailUpdates(e,t)(this.basePath)}},{key:"assignCode",value:function(e,t){return P(this.configuration).assignCode(e,t)(this.basePath)}},{key:"bookingEvent",value:function(e,t,n){return P(this.configuration).bookingEvent(e,t,n)(this.basePath)}},{key:"createGroup",value:function(e,t,n){return P(this.configuration).createGroup(e,t,n)(this.basePath)}},{key:"deleteCampaign",value:function(e,t){return P(this.configuration).deleteCampaign(e,t)(this.basePath)}},{key:"deleteCodesFile",value:function(e,t,n){return P(this.configuration).deleteCodesFile(e,t,n)(this.basePath)}},{key:"generateBarcode",value:function(e,t,n){return P(this.configuration).generateBarcode(e,t,n)(this.basePath)}},{key:"getActiveCampaigns",value:function(e){return P(this.configuration).getActiveCampaigns(e)(this.basePath)}},{key:"getAllCampaigns",value:function(e){return P(this.configuration).getAllCampaigns(e)(this.basePath)}},{key:"getCampaign",value:function(e,t){return P(this.configuration).getCampaign(e,t)(this.basePath)}},{key:"getCodes",value:function(e,t){return P(this.configuration).getCodes(e,t)(this.basePath)}},{key:"groupPush",value:function(e,t){return P(this.configuration).groupPush(e,t)(this.basePath)}},{key:"removeCode",value:function(e,t,n){return P(this.configuration).removeCode(e,t,n)(this.basePath)}},{key:"resetCampaignSentCodes",value:function(e,t){return P(this.configuration).resetCampaignSentCodes(e,t)(this.basePath)}},{key:"runCampaign",value:function(e,t){return P(this.configuration).runCampaign(e,t)(this.basePath)}},{key:"sessionReminderPush",value:function(e,t){return P(this.configuration).sessionReminderPush(e,t)(this.basePath)}},{key:"setCampaign",value:function(e,t,n){return P(this.configuration).setCampaign(e,t,n)(this.basePath)}},{key:"setUserPaymentDetails",value:function(e,t,n){return P(this.configuration).setUserPaymentDetails(e,t,n)(this.basePath)}},{key:"uploadCodesFile",value:function(e,t,n){return P(this.configuration).uploadCodesFile(e,t,n)(this.basePath)}},{key:"validateReferralCode",value:function(e,t,n){return P(this.configuration).validateReferralCode(e,t,n)(this.basePath)}},{key:"validateReferralPayment",value:function(e,t,n){return P(this.configuration).validateReferralPayment(e,t,n)(this.basePath)}}]),n}(S),M=function(e){return{getDevices:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getDevices.");var r="/push/devices",a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},getSettings:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getSettings.");var r="/push/settings",a=g.parse(r,!0),o=i()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},healthcheck:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="/healthcheck",r=g.parse(n,!0),a=i()({method:"GET"},t),o={},l={};return void 0!==e&&(l.verbose=e),r.query=i()({},r.query,l,t.query),delete r.search,a.headers=i()({},o,t.headers),{url:g.format(r),options:a}},registerDevice:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling registerDevice.");var a="/push/devices",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},setSettings:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling setSettings.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling setSettings.");var a="/push/settings",o=g.parse(a,!0),l=i()({method:"POST"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}},unregisterDevice:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling unregisterDevice.");var a="/push/devices",o=g.parse(a,!0),l=i()({method:"DELETE"},r),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,r.query),delete o.search,l.headers=i()({},c,r.headers);var d=!0;return l.body=d?JSON.stringify(n||{}):n||"",{url:g.format(o),options:l}}}},x=function(e){return{getDevices:function(t,n){var r=M(e).getDevices(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getSettings:function(t,n){var r=M(e).getSettings(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},healthcheck:function(t,n){var r=M(e).healthcheck(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},registerDevice:function(t,n,r){var a=M(e).registerDevice(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},setSettings:function(t,n,r){var a=M(e).setSettings(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},unregisterDevice:function(t,n,r){var a=M(e).unregisterDevice(t,n,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},V=(function(e){p()(n,e);var t=b(n);function n(){return y()(this,n),t.apply(this,arguments)}a()(n,[{key:"getDevices",value:function(e,t){return x(this.configuration).getDevices(e,t)(this.basePath)}},{key:"getSettings",value:function(e,t){return x(this.configuration).getSettings(e,t)(this.basePath)}},{key:"healthcheck",value:function(e,t){return x(this.configuration).healthcheck(e,t)(this.basePath)}},{key:"registerDevice",value:function(e,t,n){return x(this.configuration).registerDevice(e,t,n)(this.basePath)}},{key:"setSettings",value:function(e,t,n){return x(this.configuration).setSettings(e,t,n)(this.basePath)}},{key:"unregisterDevice",value:function(e,t,n){return x(this.configuration).unregisterDevice(e,t,n)(this.basePath)}}])}(S),function(e){return{refundRequest:function(t,n,r,a){var o=function(e){return{refundRequest:function(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling refundRequest.");if(null===n||void 0===n)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling refundRequest.");if(null===r||void 0===r)throw new k("email","Required parameter email was null or undefined when calling refundRequest.");var o="/user/support/booking/{bookingNo}/refund".replace("{bookingNo}",encodeURIComponent(String(n))),l=g.parse(o,!0),c=i()({method:"POST"},a),s={},u={},d=new g.URLSearchParams;if(e&&e.apiKey){var p="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;s["X-API-Key"]=p}return void 0!==t&&null!==t&&(s.Authorization=String(t)),void 0!==r&&d.set("email",r),s["Content-Type"]="application/x-www-form-urlencoded",l.query=i()({},l.query,u,a.query),delete l.search,c.headers=i()({},s,a.headers),c.body=d.toString(),{url:g.format(l),options:c}}}}(e).refundRequest(t,n,r,a);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+o.url,o.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}}),j=(function(e){p()(n,e);var t=b(n);function n(){return y()(this,n),t.apply(this,arguments)}a()(n,[{key:"refundRequest",value:function(e,t,n,r){return V(this.configuration).refundRequest(e,t,n,r)(this.basePath)}}])}(S),function(e){return{deleteUserAccount:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling deleteUserAccount.");var r="/user/account",a=g.parse(r,!0),o=i()({method:"DELETE"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}},deleteUserAccountData:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("userName","Required parameter userName was null or undefined when calling deleteUserAccountData.");var r="/user/account/{userName}".replace("{userName}",encodeURIComponent(String(t))),a=g.parse(r,!0),o=i()({method:"DELETE"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,n.query),delete a.search,o.headers=i()({},l,n.headers),{url:g.format(a),options:o}}}}),B=function(e){return{deleteUserAccount:function(t,n){var r=j(e).deleteUserAccount(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},deleteUserAccountData:function(t,n){var r=j(e).deleteUserAccountData(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},I=function(e){p()(n,e);var t=b(n);function n(){return y()(this,n),t.apply(this,arguments)}return a()(n,[{key:"deleteUserAccount",value:function(e,t){return B(this.configuration).deleteUserAccount(e,t)(this.basePath)}},{key:"deleteUserAccountData",value:function(e,t){return B(this.configuration).deleteUserAccountData(e,t)(this.basePath)}}]),n}(S)},,function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return c}));var r=n(9),a=n(14),o="",i=a.b.strings.Bookings,l="VIC",c=r.c.logo},,function(e,t,n){"use strict";n.d(t,"b",(function(){return B}));var r=n(12),a=n.n(r),o=n(10),i=n.n(o),l=n(11),c=n.n(l),s=n(15),u=n.n(s),d=n(6),p=n.n(d),f=n(13),h=n.n(f),m=n(0),y=n.n(m),g=n(2),b=n(5),A=n(95),E=n(32),v=n(29),S=n(4),k=n(1),T=n(87),O=n(24),R=n(30),C=n(45),U=[{role:C.e.administrator,text:"Administrator",secondaryText:"Access all the features of Command including user management"},{role:C.e.editor,text:"Editor",secondaryText:"View access to all the features of Command and limited ability to make amendments"},{role:C.e.viewer,text:"Viewer",secondaryText:"View access to all the features of Command"},{role:C.e.inactive,text:"Inactive",secondaryText:"No access permissions"}],D=n(73),P=n(101),w=n(122);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;tt-c&&(u.x=t-c-i),u.y+l>n-c&&(u.y=n-c-l)),y.a.createElement(g.a,{style:R({position:"absolute",top:u.y,left:u.x,maxWidth:t-2*c,maxHeight:n-2*c,paddingHorizontal:v.d.smallMargin,backgroundColor:v.a.pageBackground,borderRadius:v.d.smallMargin,borderWidth:1,borderColor:v.a.border},S.c,{opacity:r?0:1,overflow:"hidden"}),onLayout:r?this.onLayout:void 0},a&&a(e))}},{key:"renderOuterView",value:function(e,t){var n=this.props.renderParentOverlay,r=this.state,a=r.pendingPopupData,o=r.popupData;return y.a.createElement(g.a,{style:{width:"100%",height:"100%"},pointerEvents:"none"},o&&n&&n(o),a&&this.renderPopupLabel(a,e,t,!0),o&&this.renderPopupLabel(o,e,t,!1))}},{key:"render",value:function(){var e=this.props,t=e.isModal,n=e.updateOnTouchMove,r=this.state,a=r.pendingPopupData,o=r.popupData,i=r.parentWidth,l=r.parentHeight,c=E.a.get("window"),s=c.width,u=c.height;return y.a.createElement(k.a,{style:{width:"100%",height:"100%",position:"absolute",zIndex:1},onTouchGrant:this.onTouchGrantOrMove,onTouchMove:n?this.onTouchGrantOrMove:void 0,onTouchRelease:this.onTouchRelease,onLayout:this.onParentLayout,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},t&&y.a.createElement(A.a,{animationType:"none",transparent:!0,supportedOrientations:["landscape"],visible:!!a||!!o,ariaHideApp:!1},this.renderOuterView(s,u)),!t&&(a||o)&&this.renderOuterView(i,l))}}]),n}(m.PureComponent);U.defaultProps={isModal:!1,updateOnTouchMove:!0}},function(e,t,n){"use strict";n(234);var r=n(496);n.d(t,"ConnectedPieChart",(function(){return r.a}));n(204)},function(e,t,n){"use strict";n.d(t,"b",(function(){return M}));var r=n(10),a=n.n(r),o=n(11),i=n.n(o),l=n(15),c=n.n(l),s=n(6),u=n.n(s),d=n(13),p=n.n(d),f=n(0),h=n.n(f),m=n(2),y=n(5),g=n(32),b=n(29),A=n(4),E=n(89),v=n(1),S=n(24),k=n(30),T=n(73),O=n(45),R=n(101),C=n(116);function U(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u()(e);if(t){var a=u()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return c()(this,n)}}var D=[{flex:1},{flex:1.5},{flex:.5},{flex:.5,alignItems:"flex-end"}],P=v.d.tripleBaseMargin,w=function(e){p()(n,e);var t=U(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).onAddUser=function(){r.props.dispatch(R.Actions.editUser(void 0)),r.props.dispatch(T.Actions.setMenuItem(C.b))},r.onEditUser=function(e){r.props.dispatch(R.Actions.editUser(e)),r.props.dispatch(T.Actions.setMenuItem(C.b))},r.onDeleteUser=function(e){r.props.dispatch(R.Actions.updateUser.request({uid:e,role:O.e.inactive}))},r.renderUserListSeparator=function(){return h.a.createElement(m.a,{style:{width:"100%",height:1,backgroundColor:v.a.border}})},r.renderUserListHeader=function(){return h.a.createElement(m.a,null,h.a.createElement(m.a,{style:{height:P,backgroundColor:v.a.pageBackground,flexDirection:"row",alignItems:"center"}},h.a.createElement(m.a,{style:D[0]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Name")),h.a.createElement(m.a,{style:D[1]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Email")),h.a.createElement(m.a,{style:D[2]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Role")),h.a.createElement(m.a,{style:D[3]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Actions"))),r.renderUserListSeparator())},r.renderUserListItem=function(e){var t=r.props.userAdmin.updatingUsers;return h.a.createElement(m.a,{key:e.uid},h.a.createElement(m.a,{style:{flexDirection:"row",height:P,alignItems:"center"}},h.a.createElement(m.a,{style:D[0]},h.a.createElement(y.a,{style:v.b.black.bodyXS.thin},(e.firstName||"")+(void 0!==e.firstName&&void 0!==e.surname?" ":"")+(e.surname||""))),h.a.createElement(m.a,{style:D[1]},h.a.createElement(y.a,{style:v.b.black.bodyXS.thin},e.email||"Google user")),h.a.createElement(m.a,{style:D[2]},h.a.createElement(y.a,{style:v.b.black.bodyXS.thin},e.role)),h.a.createElement(m.a,{style:[D[3],{flexDirection:"row",alignItems:"center",justifyContent:"flex-end"}]},h.a.createElement(b.a,{onPress:function(){return r.onEditUser(e.uid)},disabled:t},h.a.createElement(g.a,{source:v.c.edit,style:{width:v.d.icons.small,height:v.d.icons.small,tintColor:v.a.highlight}})),e.role!=O.e.inactive&&h.a.createElement(A.a.Spacer,null),e.role!=O.e.inactive&&h.a.createElement(b.a,{onPress:function(){return r.onDeleteUser(e.uid)},disabled:t},h.a.createElement(g.a,{source:v.c.trash,style:{width:v.d.icons.small,height:v.d.icons.small,tintColor:v.a.red}})))),r.renderUserListSeparator())},r.state={fetchedUsers:!1},r}return i()(n,[{key:"componentDidMount",value:function(){this.props.userAdmin.updatingUsers||(this.setState({fetchedUsers:!0}),this.props.dispatch(R.Actions.getUsers.request()))}},{key:"componentDidUpdate",value:function(e){var t=this.props.userAdmin.updatingUsers;e.userAdmin.updatingUsers&&!t&&(this.state.fetchedUsers||(this.setState({fetchedUsers:!0}),this.props.dispatch(R.Actions.getUsers.request())))}},{key:"render",value:function(){var e=this,t=this.props.userAdmin,n=t.users,r=t.updatingUsers;return h.a.createElement(A.a.Screen,{forceScrollbar:!0,paddingVertical:v.d.quadBaseMargin,paddingHorizontal:v.d.eightBaseMargin},h.a.createElement(m.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},h.a.createElement(y.a,{style:v.b.black.bodyL.bold},"Active Users"),h.a.createElement(S.Button,{text:"Add new user",onPress:this.onAddUser,disabled:r,theme:S.BUTTON_THEME_FIXED_RED})),h.a.createElement(A.a.SpacerDouble,null),this.renderUserListHeader(),h.a.createElement(m.a,null,void 0!==n&&h.a.createElement(m.a,{style:{opacity:void 0===n||r?v.d.invalidOpacity:void 0}},n.map((function(t){return e.renderUserListItem(t)}))),r&&h.a.createElement(E.a,{style:{width:"100%",height:"100%",minHeight:3*P,maxHeight:20*P,position:"absolute",backgroundColor:void 0===n?v.a.loadingBackground:void 0},activityIndicatorColor:v.a.black})),h.a.createElement(A.a.SpacerDouble,null))}}]),n}(h.a.Component);w.title="Settings";t.a=Object(k.b)((function(e){return{userAdmin:e.userAdmin}}))(w);var M=w.title},,,,,,,,function(e,t,n){"use strict";n.d(t,"BookingSource",(function(){return r}));var r;n(202);!function(e){e[e.App=0]="App",e[e.Web=1]="Web"}(r||(r={}))},,,,function(e,t,n){"use strict";n(229);var r=n(499);n.d(t,"ConnectedBarChart",(function(){return r.a}));n(203),n(230)},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(19),a={setHasChanges:Object(r.createStandardAction)("menu/SET_HAS_CHANGES")(),setMenuItem:Object(r.createStandardAction)("menu/SET_MENU_ITEM")(),openMenu:Object(r.createAction)("menu/OPEN_MENU"),closeMenu:Object(r.createAction)("menu/CLOSE_MENU"),toggleMenu:Object(r.createAction)("menu/TOGGLE_MENU")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(19),a={setCarparkList:Object(r.createAction)("SET_CARPARK_LIST",(function(e){return function(t){return e(t)}})),setSchoolHolidays:Object(r.createAction)("SET_SCHOOL_HOLIDAYS",(function(e){return function(t){return e(t)}})),setPublicHolidays:Object(r.createAction)("SET_PUBLIC_HOLIDAYS",(function(e){return function(t){return e(t)}})),setAppVersions:Object(r.createAction)("SET_APP_VERSIONS",(function(e){return function(t){return e(t)}})),setLastImported:Object(r.createAction)("SET_LAST_IMPORTED",(function(e){return function(t){return e(t)}}))}},function(e,t,n){"use strict";var r=n(231);n.d(t,"StarRating",(function(){return r.a}));var a=n(500);n.d(t,"ConnectedStarRating",(function(){return a.a}));var o=n(206);n.o(o,"STAR_RATING_THEME_DEFAULT")&&n.d(t,"STAR_RATING_THEME_DEFAULT",(function(){return o.STAR_RATING_THEME_DEFAULT}));var i=n(158);n.d(t,"STAR_RATING_THEME_DEFAULT",(function(){return i.a}))},,,,,,,,,function(e,t,n){"use strict";n.d(t,"i",(function(){return s})),n.d(t,"a",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"h",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return y})),n.d(t,"c",(function(){return g}));var r=n(12),a=n.n(r),o=n(1),i=n(109);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];return e?f.b.promoPushService.prod:f.b.promoPushService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.getAPIConfig(t),r=n.apiKey,a=n.apiBaseUrl;return new p.b({apiKey:r},a)}},{key:"authenticate",value:function(){var e;return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=m.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"getAllCampaigns",value:function(t){return e.authenticate().then((function(n){return e.getApi(t).getAllCampaigns({headers:{Authorization:n}}).then((function(e){return e.campaigns||[]}))}))}},{key:"convertBeforeSet",value:function(e){return g({},e)}},{key:"convertAfterSet",value:function(e,t){return g({},e,{campaignType:e.campaignType,codeFiles:t})}},{key:"setCampaign",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(n).setCampaign(t.campaignId,e.convertBeforeSet(t),{headers:{Authorization:r}}).then((function(n){return e.convertAfterSet(n,t.codeFiles)}))}))}},{key:"uploadCodeFile",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new FormData;r.append("file",t.file);var a=e.getAPIConfig(n),o=a.apiKey,i=a.apiBaseUrl,l=i+"/promo/campaign/"+t.campaignId+"/codefile";return e.authenticate().then((function(e){return fetch(l,{method:"POST",headers:{Authorization:String(e),"X-API-Key":String(o)},body:r})})).then((function(e){return e.json().then((function(t){return{success:200===e.status,message:t.message}}))}))}},{key:"deleteCodeFile",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(n).deleteCodesFile(t.campaignId,{fileName:t.file},{headers:{Authorization:r}})}))}},{key:"getCampaign",value:function(t){return e.authenticate().then((function(n){return e.getApi().getCampaign(t,{headers:{Authorization:n}})}))}},{key:"adminDeleteUserBan",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(n).adminDeleteUserBan(t,{headers:{Authorization:r}})}))}},{key:"adminGetPaymentDetailUpdates",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(n).adminGetPaymentDetailUpdates(t,{headers:{Authorization:r}})}))}}]),e}()},function(e,t,n){"use strict";var r=n(12),a=n.n(r),o=n(211);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){for(var t=1;t1&&void 0!==n[1]?n[1]:{},r.abrupt("return",fetch(e,t).then((function(t){return t.ok&&200===t.status?t.json().catch((function(n){console.log("Warning: fetch "+e+" status "+t.status+" but decoding json failed with",n)})):t.json().catch((function(e){throw new Error("Request failed with status "+t.status)})).then((function(e){throw new Error(void 0!==e&&void 0!==e.message?e.message:"Request failed with status "+t.status)}))})));case 2:case"end":return r.stop()}}),null,null,null,Promise)}function y(e,t,n,r){var o,i,l,c,s=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o=s.length>4&&void 0!==s[4]?s[4]:"GET",i={headers:{Authorization:r,"Content-Type":"application/json"},method:o,mode:"cors"},l=e+"/"+t,"POST"===o&&(i.body=JSON.stringify(n)),"GET"===o&&void 0!==n&&(c=Object.keys(n).filter((function(e){return null!==n[e]&&void 0!==n[e]})).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(n[e].toString())})).join("&"),l+="?"+c),a.abrupt("return",m(l,i));case 6:case"end":return a.stop()}}),null,null,null,Promise)}function g(e,t,n,r){var o;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o={headers:h({Authorization:"Bearer "+r},t),method:"POST",mode:"cors",body:n},a.abrupt("return",m(e,o));case 2:case"end":return a.stop()}}),null,null,null,Promise)}var b=n(72),A=n(516),E=n(54),v=function(){function e(){i()(this,e)}return c()(e,null,[{key:"init",value:function(e,t){this.apiBaseUrl=e,this.defaultDatabase=t}},{key:"dailyValue",value:function(e){var t,n,r,o,i=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t=i.length>1&&void 0!==i[1]?i[1]:"$date",n=i.length>2&&void 0!==i[2]?i[2]:"$value",r=i.length>3&&void 0!==i[3]?i[3]:"$count",o=i.length>4?i[4]:void 0,a.abrupt("return",this.postQuery(b.b.newRequest(null!=o?o:this.defaultDatabase,{collectionKey:e,dateKey:t,valueKey:n||void 0,countKey:r||void 0})).then((function(e){return e||[]})));case 5:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"dailyValueFromParams",value:function(e,t){return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.postQuery(b.b.newRequest(null!=t?t:this.defaultDatabase,e)).then((function(e){return e||[]})));case 1:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"dailyMultiValue",value:function(e,t){var n,r,o,i,l=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=l.length>2&&void 0!==l[2]?l[2]:[],r=l.length>3&&void 0!==l[3]?l[3]:[],o=l.length>4&&void 0!==l[4]?l[4]:"$date",i=l.length>5?l[5]:void 0,a.abrupt("return",this.postQuery(b.b.newRequest(null!=i?i:this.defaultDatabase,{collectionKey:e,dateKey:o,multiValueKeys:t,multiCountKeys:n,extraKeys:r})).then((function(e){return t.map((function(t,r){var a=n[r];return(e||[]).map((function(e){return{date:e.date,value:t?e[t]:1,count:a?e[a]:1}}))}))})));case 5:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"groupedDailyValue",value:function(e){var t,n,r,o,i,l=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t=l.length>1&&void 0!==l[1]?l[1]:"$date",n=l.length>2&&void 0!==l[2]?l[2]:"$value",r=l.length>3&&void 0!==l[3]?l[3]:"$count",o=l.length>4&&void 0!==l[4]?l[4]:"$category",i=l.length>5?l[5]:void 0,a.abrupt("return",this.postQuery(b.d.newRequest(null!=i?i:this.defaultDatabase,{collectionKey:e,dateKey:t,valueKey:n||void 0,countKey:r||void 0,groupKey:o})).then((function(e){return e||[]})));case 6:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"dailyMultiValueToGroupedDailyValue",value:function(e,t,n){var r,o,i,l,c,s=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return r=s.length>3&&void 0!==s[3]?s[3]:[],o=s.length>4&&void 0!==s[4]?s[4]:[],i=s.length>5?s[5]:void 0,l=s.length>6&&void 0!==s[6]?s[6]:"$date",c=s.length>7?s[7]:void 0,a.abrupt("return",this.postQuery(b.b.newRequest(null!=c?c:this.defaultDatabase,{collectionKey:e,dateKey:l,multiValueKeys:n,multiCountKeys:r,extraKeys:o,filter:i})).then((function(e){return t.map((function(t,a){var i=n[a],l=r[a];return(e||[]).map((function(e){var n={date:e.date,group:t,value:i?e[i]:1,count:l?e[l]:1};return o.length>0&&o.forEach((function(t){n[t]=e[t]})),n}))})).reduce((function(e,t){return e.concat(t)}))})));case 6:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"groupedDailyValueFromParams",value:function(e,t){return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.postQuery(b.d.newRequest(null!=t?t:this.defaultDatabase,e)).then((function(e){return e||[]})));case 1:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"holidaysPublic",value:function(e,t){var n;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=b.e.publicHolidays(null!=t?t:this.defaultDatabase,e),r.abrupt("return",this.postQuery(n).then((function(e){return e||[]})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"holidaysSchool",value:function(e,t){var n;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=b.e.schoolHolidays(null!=t?t:this.defaultDatabase,e),r.abrupt("return",this.postQuery(n));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"calendarEvents",value:function(e,t){var n;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=b.a.newRequest(null!=t?t:this.defaultDatabase,e),r.abrupt("return",this.postQuery(n));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"locationEvents",value:function(e,t){var n;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=b.f.newRequest(null!=t?t:this.defaultDatabase,e),r.abrupt("return",this.postQuery(n));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"tableData",value:function(e,t,n){return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.tableDataRequest({database:null!=n?n:this.defaultDatabase,collection:e,query:{options:{allowDiskUse:!0},pipeline:t?[E.g({field:t})]:[]},operation:"aggregate"}));case 1:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"tableDataPipeline",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=b.i.newRequestPipeline(e),n.abrupt("return",this.postQuery(t).then((function(e){return e||[]})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"tableDataRequest",value:function(e){return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.postQuery(e).then((function(e){return e||[]})));case 1:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"checkPermission",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0!==this.apiBaseUrl){n.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return t=this.apiBaseUrl+"/auth/login",n.abrupt("return",this.authenticate().then((function(n){return fetch(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n,role:e})}).then((function(e){return e.ok?e.json().catch((function(e){console.log("Warning: Login endpoint did not return a response body (role will default to viewer)")})):e.json().then((function(e){throw e}))}))})));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"authenticate",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"postQuery",value:function(e){var t,n;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==this.apiBaseUrl){r.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return t=this.apiBaseUrl+"/query",n={"Content-Type":"application/bson"},r.abrupt("return",this.authenticate().then((function(r){return g(t,n,A.a(e),r)})));case 5:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"createUser",value:function(e){var t=this;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0!==this.apiBaseUrl){n.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return n.abrupt("return",this.authenticate().then((function(n){return y(t.apiBaseUrl,"auth/createUser",e,"Bearer "+n,"POST")})));case 3:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"updateUser",value:function(e){var t=this;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0!==this.apiBaseUrl){n.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return n.abrupt("return",this.authenticate().then((function(n){return y(t.apiBaseUrl,"auth/updateUser",e,"Bearer "+n,"POST")})));case 3:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"deleteUser",value:function(e){var t=this;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0!==this.apiBaseUrl){n.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return n.abrupt("return",this.authenticate().then((function(n){return y(t.apiBaseUrl,"auth/deleteUser",e,"Bearer "+n,"POST")})));case 3:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"getUsers",value:function(){var e=this;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==this.apiBaseUrl){t.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return t.abrupt("return",this.authenticate().then((function(t){return y(e.apiBaseUrl,"auth/getUsers",void 0,"Bearer "+t)})));case 3:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"summaryScreenAllTimeUsers",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=b.h.newRequest(),t.abrupt("return",this.postQuery(e).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"summaryScreenActiveUsers",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=b.g.newRequest(e),n.abrupt("return",this.postQuery(t).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"feedback",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=b.c.newRequest(e),n.abrupt("return",this.postQuery(t).then((function(e){return e||[]})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}}]),e}()},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var r,a,o=n(10),i=n.n(o),l=n(11),c=n.n(l),s=n(15),u=n.n(s),d=n(6),p=n.n(d),f=n(13),h=n.n(f),m=n(0),y=n.n(m),g=n(2),b=n(25),A=n(76),E=n(52);function v(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var a=p()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u()(this,n)}}!function(e){e.up="Up",e.down="Down",e.vertical="Vertical",e.left="Left",e.right="Right",e.horizontal="Horizontal"}(r||(r={})),function(e){e.linear="linear",e.spring="spring"}(a||(a={}));var S=function(e){h()(n,e);var t=v(n);function n(e,r){var o;return i()(this,n),(o=t.call(this,e,r)).close=function(){var e=o.props.expandStyle;e===a.linear?b.a.timing(o.state.anim,{easing:A.a.linear,duration:o.props.duration,toValue:0}).start():e===a.spring&&b.a.spring(o.state.anim,{toValue:0,friction:50,tension:100}).start()},o.open=function(){var e=o.props.expandStyle;e===a.linear?b.a.timing(o.state.anim,{easing:A.a.linear,duration:o.props.duration,toValue:1}).start():e===a.spring&&b.a.spring(o.state.anim,{toValue:1,friction:50,tension:100}).start()},o.setChildrenExpanse=function(e){var t=e.nativeEvent.layout,n=t.width,r=t.height,a=o.isHorizontal()?n:r;o.state.childrenExpanse!==a&&o.setState({childrenExpanse:a})},o.state={anim:o.props.anim||new b.a.Value(e.visible?1:0)},o}return c()(n,[{key:"componentDidUpdate",value:function(e,t){this.props.visible!==e.visible&&(this.props.visible?this.open():this.close())}},{key:"isHorizontal",value:function(){var e=this.props.direction;return e===r.left||e===r.right||e===r.horizontal}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.minExpanse,a=e.maxExpanse,o=e.direction,i=this.state.anim,l=this.isHorizontal(),c=!this.props.visible||void 0!==this.state.childrenExpanse,s=c&&l?i.interpolate({inputRange:[0,1],outputRange:[n,Math.min(this.state.childrenExpanse||0,a)],extrapolate:"clamp"}):void 0,u=c&&!l?i.interpolate({inputRange:[0,1],outputRange:[n,Math.min(this.state.childrenExpanse||0,a)],extrapolate:"clamp"}):void 0,d=n>0?1:i.interpolate({inputRange:[0,.5,.75,1],outputRange:[0,.25,.5,1],extrapolate:"clamp"}),p=l?"row":"column",f="flex-start";return o!==r.left&&o!==r.up||(f="flex-end"),o!==r.vertical&&o!==r.horizontal||(f="center"),y.a.createElement(g.a,{style:{overflow:"hidden",backgroundColor:"#00000000"},pointerEvents:"box-none"},y.a.createElement(b.a.View,{style:{overflow:"web"===E.a.OS?"visible":"scroll",width:s,height:u,opacity:d,minWidth:l?n:void 0,maxWidth:l?a:void 0,minHeight:l?void 0:n,maxHeight:l?void 0:a,flexDirection:p,justifyContent:f},pointerEvents:"box-none"},y.a.createElement(g.a,{onLayout:this.setChildrenExpanse,style:{flexDirection:p},pointerEvents:"box-none"},t)))}}]),n}(y.a.PureComponent);S.defaultProps={expandStyle:a.spring,duration:300,minExpanse:0,maxExpanse:1e4,direction:r.down}},,,,function(e,t,n){"use strict";var r=n(497);n.d(t,"default",(function(){return r.a}));n(498)},,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s}));var r=n(12),a=n.n(r),o=n(1),i=n(24);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var c={headerColor:o.a.highlight,backgroundColor:o.a.pageBackground,borderWidth:2,borderRadius:o.d.borderRadius,titleTextStyle:o.b.white.bodyL.bold,messageTextStyle:o.b.black.bodyM.thin,buttonTheme:i.BUTTON_THEME_GLOBAL_MESSAGE,modalOverlayColor:o.a.modalOverlayColor},s=function(e){for(var t=1;t0?t.moveX:t.x0)-r._layout.x,i=(t.moveY>0?t.moveY:t.y0)-r._layout.y,l=t.moveX>0?t.moveX:t.x0,c=t.moveY>0?t.moveY:t.y0;return a&&(o=Math.min(Math.max(o,0),r._layout.width),i=Math.min(Math.max(i,0),r._layout.height)),{x:o,y:i,screenX:l,screenY:c,viewRect:k({},r._layout)}}},r.onTouchGrant=function(e,t){var n=r.props.parentView||r._ref;n.current&&n.current.measure((function(n,a,o,i,l,c){if(r._layout={x:l,y:c,width:o,height:i},void 0!==r.props.onTouchGrant){var s=r.getPanEvent(e,t);s&&r.props.onTouchGrant(s)}}))},r.onTouchMove=function(e,t){if(Math.abs(t.dx)>Math.abs(t.dy)+20&&r.props.scrollView&&r.props.scrollView.current&&"ios"===A.a.OS&&r.props.scrollView.current.setNativeProps({scrollEnabled:!1}),void 0!==r.props.onTouchMove){var n=r.getPanEvent(e,t);n&&r.props.onTouchMove(n)}},r.onTouchRelease=function(e,t){if(r.props.scrollView&&r.props.scrollView.current&&"ios"===A.a.OS&&r.props.scrollView.current.setNativeProps({scrollEnabled:!0}),void 0!==r.props.onTouchRelease){var n=r.getPanEvent(e,t);n&&r.props.onTouchRelease(n)}},r._panResponder=v.a.create({onStartShouldSetPanResponder:function(e,t){return!0},onStartShouldSetPanResponderCapture:function(e,t){return!0},onMoveShouldSetPanResponder:function(e,t){return!0},onMoveShouldSetPanResponderCapture:function(e,t){return!0},onPanResponderTerminationRequest:function(e,t){return!1},onPanResponderGrant:r.onTouchGrant,onPanResponderMove:r.onTouchMove,onPanResponderRelease:r.onTouchRelease,onPanResponderTerminate:r.onTouchRelease}),r.state={},r}return u()(n,[{key:"render",value:function(){return b.a.createElement(E.a,a()({ref:this._ref,style:[{backgroundColor:"transparent"},this.props.style]},this._panResponder.panHandlers,{onLayout:this.props.onLayout,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave}),this.props.children)}}]),n}(b.a.PureComponent)},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return h}));var r=n(19),a={replyToAndroidReview:Object(r.createAction)("REPLY_TO_ANDROID_REVIEW",(function(e){return function(t,n){return e({review:t,text:n})}})),replyToIOSReview:Object(r.createAction)("REPLY_TO_IOS_REVIEW",(function(e){return function(t){return e({review:t})}}))},o=n(179),i=n(52),l=n(530),c=n(285),s=n(531),u=n(553),d=n(277),p=n(739),f=n(39),h=[function(e,t){return e.pipe(Object(u.a)(Object(r.isActionOf)(a.replyToAndroidReview)),Object(d.a)((function(e){var t=e.payload,n=t.review,r=t.text,a="https://www.googleapis.com/androidpublisher/v3/applications/{packageName}/reviews/{reviewId}:reply?access_token={accessToken}";return a=(a=(a=a.replace("{packageName}","au.com.wilsonone")).replace("{reviewId}",n.id)).replace("{accessToken}","a7264dccf78df18a10307f1aa2f1c44e56c09360"),Object(l.a)({url:a,text:r})})),Object(d.a)((function(e){var t=e.url,n=e.text;return Object(c.a)(fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({replyText:n})}))})),Object(d.a)((function(e){return Object(c.a)(e.json())})),Object(d.a)((function(e){var t=e.result,n=t.replyText,r=t.lastEdited.seconds;return console.log("Review reply successful at "+r+": "+n),Object(l.a)(f.a.setGlobalMessage({title:"Success",message:"Your reply was successfully submitted. It will appear in the table following the next data update."}))})),Object(p.a)((function(e){return console.error("Error posting review reply",e),Object(l.a)(f.a.setError({title:"Error",message:"There was an error submitting the review reply. Please try again later."}))})))},function(e,t){return e.pipe(Object(u.a)(Object(r.isActionOf)(a.replyToIOSReview)),Object(d.a)((function(e){var t=e.payload.review,n="https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/{appId}/ios/ratingsResponses?reviewId={reviewId}";return n=(n=n.replace("{appId}","1368305246")).replace("{reviewId}",t.id),"web"==i.a.OS?window.open(n,"_blank"):o.a.canOpenURL(n)&&o.a.openURL(n),s.a})))}]},function(e,t,n){"use strict";var r=n(148);n.d(t,"default",(function(){return r.a}));n(501)},,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"default",(function(){return A}));var r=n(16),a=n.n(r),o=n(10),i=n.n(o),l=n(11),c=n.n(l),s=n(15),u=n.n(s),d=n(6),p=n.n(d),f=n(13),h=n.n(f),m=n(14),y=n(78),g=n(93);function b(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var a=p()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u()(this,n)}}g.QueryService.init(m.b.dataService.apiBaseURL,m.b.dataService.database);var A=function(e){h()(n,e);var t=b(n);function n(){return i()(this,n),t.apply(this,arguments)}return c()(n,null,[{key:"bookings",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.carParks||0!=e.carParks.length){n.next=2;break}return n.abrupt("return",[]);case 2:return t=y.d.newRequest(e),n.abrupt("return",this.postQuery(t));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"summaryScreenActiveUsers",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=y.l.newRequest(e),n.abrupt("return",this.postQuery(t).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"summaryScreenAllTimeUsers",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.n.newRequest(),t.abrupt("return",this.postQuery(e).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"averageUserTypePurchases",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.carParks||0!=e.carParks.length){n.next=2;break}return n.abrupt("return",[]);case 2:return t=y.b.newRequest(e),n.abrupt("return",this.postQuery(t));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"averageTransactionsPerUser",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=y.a.newRequest(e),n.abrupt("return",this.postQuery(t).then((function(e){return e&&e.length>0?e[0]:{value:0}})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"bookingsRevenue",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.carParks||0!=e.carParks.length){n.next=2;break}return n.abrupt("return",[]);case 2:return t=y.h.newRequest(e),n.abrupt("return",this.postQuery(t));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"productsByBookingCount",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=y.f.byBookingCount(e),n.abrupt("return",this.postQuery(t).then((function(e){return 1===e.length?e[0].products:[]})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"productsByValue",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=y.f.byValue(e),n.abrupt("return",this.postQuery(t).then((function(e){return 1===e.length?e[0].products:[]})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"bookingsRevenuePrediction",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.carParks||0!=e.carParks.length){n.next=2;break}return n.abrupt("return",[]);case 2:return t=y.j.newRequest(e),n.abrupt("return",this.postQuery(t));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"bookingsRevenuePredictionGrouped",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.carParks||0!=e.carParks.length){n.next=2;break}return n.abrupt("return",[]);case 2:return t=y.k.newRequest(e),n.abrupt("return",this.postQuery(t));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"revenueByCarPark",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.carParks||0!=e.carParks.length){n.next=2;break}return n.abrupt("return",{});case 2:return t=y.i.newRequest(e),n.abrupt("return",this.postQuery(t).then((function(e){return e[0]})));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"bookingCountsByCarPark",value:function(e){var t;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.carParks||0!=e.carParks.length){n.next=2;break}return n.abrupt("return",{});case 2:return t=y.c.newRequest(e),n.abrupt("return",this.postQuery(t).then((function(e){return e[0]})));case 4:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"promoCampaignStats",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.g.newPromoCampaignStatRequest(),t.abrupt("return",this.postQuery(e));case 2:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"summaryScreenAllTimeApplePay",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.m.newRequest(),t.abrupt("return",this.postQuery(e).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return t.stop()}}),null,this,null,Promise)}}]),n}(g.QueryService)},function(e,t){},,,function(e,t,n){"use strict";var r=n(12),a=n.n(r),o=n(110),i=n(77);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var c={bold:{fontFamily:"Roboto-Bold"},regular:{fontFamily:"Roboto-Regular"},thin:{fontFamily:"Roboto-Light"},boldItalic:{fontFamily:"Roboto-BoldItalic"},regularItalic:{fontFamily:"Roboto-RegularItalic"},thinItalic:{fontFamily:"Roboto-LightItalic"}},s={h0:42*i.a.screenScale,h1:28*i.a.screenScale,h2:24*i.a.screenScale,bodyL:20*i.a.screenScale,bodyM:16*i.a.screenScale,bodyS:12*i.a.screenScale,bodyXS:10*i.a.screenScale,bodyXXS:8*i.a.screenScale},u=1.34*i.a.screenScale;function d(e){return function(e){var t=e.sizes||s,n=Object.keys(t),r=e.types||c,o=Object.keys(r),i={};return n.forEach((function(t){var n=s[t],r={};o.forEach((function(t){r[t]=function(e){for(var t=1;t0?b.c.valueUp:e<0?b.c.valueDown:b.c.valueFixed}var R=function(e){p()(n,e);var t=T(n);function n(){var e;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0?n.percentageIncreaseColor:t<0?n.percentageDecreaseColor:b.a.lightGrey},e.renderPercentageChangeElement=function(t){var n=e.getTheme();return void 0===t?null:h.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"center"}},h.a.createElement(g.a,{style:{width:b.d.icons.tiny/2,height:b.d.icons.tiny,tintColor:e.getPercentageChangeColor(t)},source:O(t)}),h.a.createElement(A.a.SpacerSmall,null),h.a.createElement(m.a,{style:[n.percentageFont,{color:e.getPercentageChangeColor(t)}]},Object(S.c)(t,S.a.Percent)))},e}return i()(n,[{key:"getTheme",value:function(){var e=this.props,t=e.theme,n=e.data;return Object(v.i)(t)?t:t(n?n.value:0)}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.dataStampInvalid,r=e.style,a=this.getTheme();if(!t)return h.a.createElement(E.a,{showLoading:!0,style:{alignSelf:r.alignSelf,flex:r.flex,minWidth:r.minWidth,minHeight:r.minHeight,maxWidth:r.maxWidth,maxHeight:r.maxHeight,width:160,height:80}});var o={};return t.description&&(o="center"===a.alignItems?{paddingHorizontal:a.infoButtonTheme.buttonSize}:{paddingRight:a.infoButtonTheme.buttonSize}),h.a.createElement(y.a,{style:{overflow:"hidden",alignSelf:r.alignSelf,alignItems:a.alignItems,flex:r.flex,minWidth:r.minWidth,minHeight:r.minHeight,maxWidth:r.maxWidth,maxHeight:r.maxHeight,backgroundColor:a.backgroundColor,borderRadius:a.borderRadius,borderWidth:a.borderWidth,borderColor:a.borderColor,paddingVertical:b.d.smallMargin,paddingHorizontal:b.d.baseMargin,opacity:n?b.d.invalidOpacity:void 0}},h.a.createElement(m.a,{style:[a.titleFont,o]},t.title),h.a.createElement(m.a,{style:a.valueFont},Object(S.c)(t.value,t.valueType)),this.renderPercentageChangeElement(t.percentageChange),t.secondaryValue&&h.a.createElement(y.a,{style:{marginTop:t.percentageChange?b.d.baseMargin:void 0}},h.a.createElement(m.a,{style:a.secondaryValueFont},t.secondaryValue," ")),t.description&&h.a.createElement(y.a,{style:{position:"absolute",top:b.d.infoButtonPadding,right:b.d.infoButtonPadding}},h.a.createElement(k.InfoButton,{title:t.title,description:t.description,theme:a.infoButtonTheme})))}}]),n}(f.PureComponent);R.defaultProps={style:{},theme:v.a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s}));var r=n(12),a=n.n(r),o=n(1),i=n(67);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var c={buttonSize:o.d.infoButtonSize,buttonColor:o.a.softHighlight,titleFont:o.b.black.bodyM.regular,descriptionFont:o.b.grey.bodyS.thin,maxWidth:500},s=function(e){for(var t=1;t0){var u=!!o.isVertical,d=r.getBarThickness();if(n=Math.min(Math.max(0,Math.floor((u?e.x:e.y)/d)),o.items.length-1),r.setState({selectedIndex:n}),void 0!==n){var p=o.items[n],f=p.label,h=p.value;if(p.childItems&&l){var m=s;l[n].some((function(t,n){var a=p.childItems.length-n-1;if((m-=t)=1)if(a.isVertical)for(;t*c<50;)c+=2;else for(;t*c<20;)c+=2;return y.a.createElement(g.a,{style:{flexDirection:e?"row":"column"}},a.items.map((function(r,s){return s%c===Math.floor(c/2)?y.a.createElement(g.a,{key:"main_label_"+s,style:{width:e?t*c:void 0,maxWidth:e?void 0:100,height:e?void 0:t*c,maxHeight:e?20+M:void 0,paddingHorizontal:e?n:void 0,paddingVertical:e?void 0:n,alignItems:"center",justifyContent:e?"flex-start":"space-between",flexDirection:e?"column":"row"}},a.isVertical&&y.a.createElement(g.a,{style:{width:1,height:M,backgroundColor:c>1?i.axisColor:void 0}}),y.a.createElement(b.a,{style:s===o?i.selectedLabelFont:i.labelFont,numberOfLines:l},r.label),!a.isVertical&&y.a.createElement(g.a,{style:{width:M,height:1,backgroundColor:c>1?i.axisColor:void 0}})):null})))}},{key:"renderBars",value:function(e,t,n){var r=this,a=this.state,o=a.data,i=a.animValues,l=a.topValue,c=a.selectedIndex,s=this.props.theme,u=this.getBarLength(l,l),d=!0;return!o.isVertical&&t<20&&(d=!1),o.isVertical&&t<50&&(d=!1),y.a.createElement(g.a,{style:{flex:1,flexDirection:e?"row":"column",borderLeftWidth:e?void 0:1,borderLeftColor:e?void 0:s.axisColor,borderBottomWidth:e?1:void 0,borderBottomColor:e?s.axisColor:void 0}},o.items.map((function(a,l){var p=i[l].interpolate({inputRange:[0,u],outputRange:[0,u],extrapolate:"clamp"}),f=l===c?a.selectedColor||s.selectedBarColor:a.color||s.barColor,h={flexDirection:e?"column":"row",height:e?void 0:t,width:e?t:void 0,paddingHorizontal:e?n:void 0,paddingVertical:e?void 0:n,justifyContent:e?"flex-end":"flex-start",alignItems:"center"};return a.childItems?r.renderChildViews(l,h,a,u,e):y.a.createElement(g.a,{key:"main_bar_"+l,style:h},d&&e&&r.textLabel(!1,s,f,e,i[l],a.value,o.valueType),y.a.createElement(A.a.View,{style:{flexDirection:e?"column":"row",width:e?"100%":p,height:e?p:"100%",backgroundColor:f,alignItems:"center",justifyContent:e?"flex-start":"flex-end",overflow:"hidden",borderTopLeftRadius:e?s.barRounding:void 0,borderTopRightRadius:s.barRounding,borderBottomRightRadius:e?void 0:s.barRounding}},d&&r.textLabel(!0,s,f,e,i[l],a.value,o.valueType)),d&&!e&&r.textLabel(!1,s,f,e,i[l],a.value,o.valueType))})))}},{key:"renderChildViews",value:function(e,t,n,r,a){var o=this,i=this.state,l=i.childAnimValues,c=i.data,s=i.selectedChildIndex,u=i.selectedIndex,d=this.props.theme,p=this.getColorMap(c.items);return y.a.createElement(g.a,{key:"main_bar_"+e,style:t},y.a.createElement(g.a,{style:{borderTopLeftRadius:a?d.barRounding:void 0,borderTopRightRadius:d.barRounding,borderBottomRightRadius:a?void 0:d.barRounding,overflow:"hidden",width:"100%"}},n.childItems.map((function(t,n){var i=l[e][n].interpolate({inputRange:[0,r],outputRange:[0,r],extrapolate:"clamp"}),c=void 0===u||void 0===s||u===e&&s===n?1:.6;return o.renderChild(t,i,a,p(n),c)}))))}},{key:"renderChild",value:function(e,t,n,r,a){return y.a.createElement(A.a.View,{key:"child_"+e.label,style:{width:n?"100%":t,height:n?t:"100%",backgroundColor:r,opacity:a}})}},{key:"getBarThickness",value:function(){var e=this.state,t=e.data,n=e.width,r=e.height,a=!!t.isVertical;return Math.max((a?n:r-this.getLegendHeight())/t.items.length,v.d.baseMargin)}},{key:"renderBarChart",value:function(){var e,t=this.state,n=t.data,r=t.width,a=t.height,o=t.axisOpacityAnim,i=this.props,l=i.dataStampInvalid,c=i.legend,s=!!n.isVertical,u=this.getBarThickness(),d=.05*u,p=this.getMaxChildSize(n.items),f=this.getColorMap(n.items);return y.a.createElement(g.a,null,c&&y.a.createElement(g.a,{style:{height:this.getLegendHeight(),maxHeight:this.getLegendHeight()}},y.a.createElement(U.d,{theme:U.a,items:null==p||null==(e=p.childItems)?void 0:e.map((function(e,t){return{title:e.label,color:f(t)}}))})),y.a.createElement(g.a,null,y.a.createElement(A.a.View,{style:{width:r,height:a-this.getLegendHeight(),flexDirection:s?"column":"row",opacity:l?A.a.multiply(o,v.d.invalidOpacity):o}},!s&&this.renderAxisLabels(s,u,d),this.renderBars(s,u,d),s&&this.renderAxisLabels(s,u,d),y.a.createElement(T.a,{getPopupData:this.getPopupData,renderPopupContents:this.renderPopupContents,onPopupHidden:this.onPopupHidden,hoverResponder:this._csvButton})),y.a.createElement(D.CSVButton,{ref:this._csvButton,getCSVData:this.getCSVData})))}},{key:"render",value:function(){var e=this.props.style,t=this.state,n=t.animValues,r=t.data,a=t.rawData,o=t.width,i=t.height,l=void 0===a,c=0===r.items.length||!n||0===n.length,s=e.width!==o||e.height!==i;return l||c||s?y.a.createElement(O.a,{showLoading:l,showNoData:c,style:{width:e.width,height:e.height}}):this.renderBarChart()}}]),n}(m.PureComponent);x.defaultProps={style:{width:200,height:200},theme:k.a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(1),a={backgroundColor:r.a.controlBackground,axisColor:r.a.darkGrey,barColor:r.a.highlight,selectedBarColor:r.a.darkGrey,barRounding:r.d.tinyMargin,barFont:r.b.grey.bodyS.thin,labelFont:r.b.grey.bodyS.regular,selectedLabelFont:[r.b.grey.bodyS.regular,{color:r.a.darkGrey}]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(10),a=n.n(r),o=n(11),i=n.n(o),l=n(15),c=n.n(l),s=n(6),u=n.n(s),d=n(13),p=n.n(d),f=n(0),h=n.n(f),m=n(2),y=n(5),g=n(158),b=n(20),A=n(89),E=n(4),v=n(1);function S(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u()(e);if(t){var a=u()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return c()(this,n)}}var k=function(e){p()(n,e);var t=S(n);function n(){return a()(this,n),t.apply(this,arguments)}return i()(n,[{key:"renderStars",value:function(e,t){return h.a.createElement(m.a,{style:{alignSelf:"flex-start"}},h.a.createElement(y.a,{style:t},"\u2606\u2606\u2606\u2606\u2606"),h.a.createElement(m.a,{style:{position:"absolute",width:20*e+"%",maxWidth:20*e+"%",overflow:"hidden"}},h.a.createElement(m.a,{style:{width:"200%"}},h.a.createElement(y.a,{style:t,ellipsizeMode:"clip",numberOfLines:1},"\u2605\u2605\u2605\u2605\u2605"))))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.style,r=e.theme,a=e.dataStampInvalid,o=e.hideNumericalRating;return t?h.a.createElement(m.a,{style:[n,{opacity:a?v.d.invalidOpacity:void 0}]},t.title&&h.a.createElement(y.a,{style:r.titleFont,ellipsizeMode:"tail",numberOfLines:1},t.title),h.a.createElement(m.a,{style:{flexDirection:"row",alignItems:"flex-end"}},!o&&h.a.createElement(y.a,{style:r.ratingFont,ellipsizeMode:"clip",numberOfLines:1},Object(b.c)(t.rating,b.a.Number)),!o&&h.a.createElement(E.a.Spacer,null),this.renderStars(t.rating,r.ratingFont)),t.count&&h.a.createElement(y.a,{style:r.countFont,ellipsizeMode:"tail",numberOfLines:1},Object(b.b)(t.count,b.a.Number)+" Ratings")):h.a.createElement(A.a,{showLoading:!0,style:[{width:300,height:100},n]})}}]),n}(f.PureComponent);k.defaultProps={style:{},theme:g.a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1),a=n(255),o={minWidth:12*r.d.baseMargin,height:4*r.d.baseMargin,backgroundColor:r.a.controlBackground,borderWidth:1,borderColor:r.a.lightGrey,borderRadius:r.d.borderRadius,textStyle:r.b.black.bodyS.regular,textPadding:r.d.baseMargin,datePickerPopupTheme:a.DATE_PICKER_POPUP_THEME_DEFAULT}},function(e,t,n){"use strict";n.d(t,"a",(function(){return B}));var r=n(10),a=n.n(r),o=n(11),i=n.n(o),l=n(15),c=n.n(l),s=n(6),u=n.n(s),d=n(13),p=n.n(d),f=n(0),h=n(2),m=n(80),y=n(1),g=n(62),b=n.n(g),A=n(26),E=n(12),v=n.n(E),S=n(5),k=n(32),T=n(29),O=n(120);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var C=function(e){var t=e.icon,n=e.value,r=e.color,a=void 0===r?y.a.white:r,o=e.rowHeight,i=e.numberOfLines,l=e.header,c=void 0!==l&&l,s=e.textAlignVertical,u=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:function(e){};e>0&&t&&t(e)}(e,m)},index:n,hoverResponder:e.hoverResponder})})))},P=A.a.create({column:{overflow:"hidden"}}),w=n(157),M=n(89),x=n(41),V=n(90);function j(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u()(e);if(t){var a=u()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return c()(this,n)}}var B=function(e){p()(n,e);var t=j(n);function n(e){var r;return a()(this,n),(r=t.call(this,e))._csvButton=f.createRef(),r.updateIsScrollable=function(){if(r._layoutW&&r._contentW){var e=r._layoutW=0&&r.props.cellTapAction(r.props.page,e)},r.state={isScrollable:!1},r}return i()(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.data,r=t.page,a=t.pageSize,o=t.style,i=t.theme,l=this.state.isScrollable;if(void 0===n||0===n.titleRow.cells.length){var c=i.renderEmptyRows&&a?i.rowHeight*(a+1):2*y.d.tripleBaseMargin;return f.createElement(M.a,{showLoading:void 0===n,style:{width:o.width,height:c}})}var s=n.titleRow.cells.map((function(e){return(e?e.length:0)+6}));n.rows.forEach((function(e){e.cells.forEach((function(e,t){n.cellFlex&&n.cellFlex[t]?s[t]=n.cellFlex[t]:s[t]+=(e?e.length:0)+6}))}));for(var u=8*(x.min(s)||1),d=0;df)return void h(void 0);var y=Math.atan2(m.x,m.y);y<0&&(y+=2*Math.PI),n.forEach((function(e,t){e.startAngle<=y&&e.endAngle>y&&(a=t,h(t))}))}}if(void 0!==a){var g=d.pieSlices[a];o={title:g.title,value:Object(R.c)(g.value,d.valueType,0),percentage:r>0?100*g.value/r:0}}return o},e.renderPopupContents=function(e){return h.a.createElement(m.a,{style:{alignItems:"center",justifyContent:"center"}},h.a.createElement(E.a,{style:b.b.black.bodyS.regular},e.title),h.a.createElement(E.a,{style:b.b.black.bodyXS.thin},e.value),h.a.createElement(E.a,{style:b.b.grey.bodyXS.thin},Object(R.c)(e.percentage,R.a.Percent)))},e.onPopupHidden=function(){var t=e.props.onSelectSlice;t&&t(void 0)},e.getCSVData=function(){var t,n,r=e.props.data;return{title:null==(t=r.csvDefinition)?void 0:t.title,headers:(null==(n=r.csvDefinition)?void 0:n.headers)||["Category","Value"],data:(r.csvPieSlices||r.pieSlices).map((function(e){return[e.title,Object(R.c)(e.value,r.valueType,0)]}))}},e}return i()(n,[{key:"render",value:function(){var e=this,t=this.props.style,n=t.width,r=t.height,a=Math.min(n,r)/2,o=this.props,i=o.data,l=o.outerRadius,c=void 0===l?a:l,s=o.innerRadius,u=void 0===s?0:s,d=o.startAngle,p=void 0===d?0:d,f=o.endAngle,y=void 0===f?Math.PI:f,g=o.padAngle,A=void 0===g?0:g,E=o.style,R=o.elevation,U=void 0===R?0:R,D=o.selectedIndex,P=.05*a,w=i.pieSlices.map((function(e,t){var n=D===t?c-P*(1-U):c-P;return S.a().outerRadius(n).innerRadius(u).padAngle(A)})),M=i.pieSlices.map((function(e){return e.value})).reduce((function(e,t){return e+t})),x=100*y/(2*Math.PI);if(0===i.pieSlices.length||0===M)return h.a.createElement(m.a,{style:E});var V=S.b().value((function(e){return e.value})).sort((function(e,t){return e+t})).startAngle(p||0).endAngle(y)(i.pieSlices),j=Math.max(6,Math.min(8*a/200,16)),B=Object(O.a)(i.pieSlices.length);return h.a.createElement(m.a,{style:{width:2*a,height:2*a}},h.a.createElement(m.a,{style:{width:2*a,height:2*a}},a>0&&h.a.createElement(v.e,{width:2*a,height:2*a},h.a.createElement(v.a,{x:a,y:a},V.map((function(e,t){var n=i.pieSlices[t],r=w[t](e);return h.a.createElement(v.c,{key:"pie_slice_"+n.title,d:r||void 0,fill:n.color||B(t),strokeWidth:0})})),V.map((function(e,t){var n=e.value/M*x;if(n>=3){var r=n.toFixed(1)+"%",a={x:0,y:.7*c},o=(e.endAngle-e.startAngle)/2,i=e.startAngle+o,l=Object(T.rotateVector2d)(a,i);return h.a.createElement(v.f,{key:"slice_"+t,textAnchor:"middle",alignmentBaseline:"middle",fontSize:""+j,fontWeight:"200",fontFamily:"Verdana",stroke:"none",fill:b.a.black,x:-l.x,y:-l.y,opacity:x/100,style:{userSelect:"none"}},r)}return null})))),a>0&&h.a.createElement(k.a,{getPopupData:function(t){return e.getPopupData(t,V,M)},renderPopupContents:this.renderPopupContents,onPopupHidden:this.onPopupHidden,hoverResponder:this._csvButton})),h.a.createElement(C.CSVButton,{ref:this._csvButton,getCSVData:this.getCSVData}))}}]),n}(f.PureComponent),P=n(89),w=n(81),M=n(4);function x(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u()(e);if(t){var a=u()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return c()(this,n)}}var V=y.a.createAnimatedComponent(D),j=function(e){p()(n,e);var t=x(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).debouncedUpdate=Object(A.debounce)((function(e){var t=r.props.style,n=t.width,a=t.height;n===r.state.width&&a===r.state.height||r.setState({width:n,height:a});var o=e.data?e.data.pieSlices:void 0,i=r.props.data?r.props.data.pieSlices:void 0;Object(A.isEqual)(o,i)}),b.d.timing.componentDebounce),r.onSelectSlice=function(e){e!==r.state.selectedIndex&&r.onFocus(e)},r.onFocus=function(e){e===r.state.selectedIndex&&(e=void 0),void 0!==e&&r.setState({selectedIndex:e},y.a.timing(r.state.outerElevation,{toValue:1,duration:100,easing:g.a.inOut(g.a.quad)}).start),void 0===e&&y.a.timing(r.state.outerElevation,{toValue:0,duration:100,easing:g.a.inOut(g.a.quad)}).start((function(){r.setState({selectedIndex:e})}))},r.state={endAngle:new y.a.Value(2*Math.PI),outerElevation:new y.a.Value(0),selectedIndex:void 0,width:e.style.width,height:e.style.height},r}return i()(n,[{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){this.debouncedUpdate.cancel(),this.state.outerElevation.stopAnimation()}},{key:"componentDidUpdate",value:function(e){this.debouncedUpdate(e)}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.dataStampInvalid,r=e.style,a=e.legendTheme,o=this.state,i=o.outerElevation,l=o.selectedIndex,c=o.endAngle,s=o.width,u=o.height;if(!t||0===t.pieSlices.length||r.width!==s||r.height!==u)return h.a.createElement(P.a,{showLoading:!t,style:{width:r.width,height:r.height}});var d=Object(O.a)(t.pieSlices.length),p=r.width,f=r.height;a&&(void 0!==a.minWidth&&a.legendOrientation===w.e.Vertical&&(p-=a.minWidth+b.d.baseMargin),void 0!==a.minHeight&&a.legendOrientation===w.e.Horizontal&&(f-=a.minHeight+b.d.baseMargin));var y=Math.min(p,f),g=r.width,A=r.height;return a&&(a.legendOrientation===w.e.Vertical&&(g-=y+b.d.baseMargin),a.legendOrientation===w.e.Horizontal&&(A-=y+b.d.baseMargin)),h.a.createElement(m.a,{style:{width:r.width,height:r.height,flexDirection:a&&a.legendOrientation===w.e.Vertical?"row":void 0,alignItems:"center",justifyContent:"center",opacity:n?b.d.invalidOpacity:void 0}},h.a.createElement(V,{style:{width:y,height:y},outerRadius:r.outerRadius,innerRadius:r.innerRadius,startAngle:0,endAngle:c,padAngle:r.padAngle,elevation:i,selectedIndex:l,onSelectSlice:this.onSelectSlice,data:t}),!!a&&h.a.createElement(M.a.Spacer,null),!!a&&h.a.createElement(w.d,{items:t.pieSlices.map((function(e,t){return{title:e.title,color:e.color||d(t)}})),style:{maxWidth:g,maxHeight:A},theme:a,selectedIndex:l}))}}]),n}(f.PureComponent);j.defaultProps={style:{width:200,height:200,innerRadius:0,padAngle:0}}},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(474);n.d(t,"DashboardDataService",(function(){return r.a}));n(208)},,function(e,t,n){"use strict";var r=n(12),a=n.n(r),o=n(0),i=n(32),l=n(2),c=n(5),s=n(29),u=n(26),d=n(1);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.count,n=e.page,r=void 0===n?0:n,a=e.pageSize,u=e.theme,p=e.onNextPress,h=e.onPrevPress;if(void 0===a||!u.renderEmptyRows&&t<=a)return null;var m=r*a+1,y=Math.min(t,m+a-1),g=t>0?m+" - "+y+" / "+t:"0 / 0",b=t<=a||1===m,A=t<=a||y===t;return o.createElement(l.a,{style:f.container},o.createElement(c.a,{style:f.text}," ",g," "),o.createElement(s.a,{onPress:h,disabled:b},o.createElement(i.a,{source:d.c.arrowLeft,style:[f.arrow,{tintColor:b?u.disabledPageButtonColor:u.enabledPageButtonColor}]})),o.createElement(s.a,{onPress:p,disabled:A},o.createElement(i.a,{source:d.c.arrowRight,style:[f.arrow,{tintColor:A?u.disabledPageButtonColor:u.enabledPageButtonColor}]})))};var f=u.a.create({container:{flexDirection:"row",alignItems:"center",alignSelf:"flex-end",padding:d.d.baseMargin},text:function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.setHasChanges):return c({},e,{hasChanges:t.payload});case Object(o.getType)(i.a.setMenuItem):return c({},e,{selected:t.payload,hasChanges:!1});case Object(o.getType)(i.a.openMenu):return c({},e,{open:!0});case Object(o.getType)(i.a.closeMenu):return c({},e,{open:!1});case Object(o.getType)(i.a.toggleMenu):return c({},e,{open:!e.open});default:return e}}},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(12),a=n.n(r),o=n(19),i=n(43);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.resetPassword.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.resetPassword.success):return c({},e,{updatingUsers:!1,usersError:void 0});case Object(o.getType)(i.a.resetPassword.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.createUser.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.createUser.success):return c({},e,{updatingUsers:!1,users:t.payload,usersError:void 0});case Object(o.getType)(i.a.createUser.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.updateUser.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.updateUser.success):return c({},e,{updatingUsers:!1,users:t.payload,usersError:void 0});case Object(o.getType)(i.a.updateUser.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.deleteUser.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.deleteUser.success):return c({},e,{updatingUsers:!1,users:t.payload,usersError:void 0});case Object(o.getType)(i.a.deleteUser.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.getUsers.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.getUsers.success):return c({},e,{updatingUsers:!1,users:t.payload.map((function(e){return{uid:e.uid,firstName:e.firstName,surname:e.surname,email:e.email,role:e.role}})),usersError:void 0});case Object(o.getType)(i.a.getUsers.failure):return c({},e,{updatingUsers:!1,users:void 0,usersError:t.payload});case Object(o.getType)(i.a.editUser):return c({},e,{manageUserUID:t.payload});default:return e}}},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));var r=n(43),a=n(59),o=n(63),i=n.n(o),l=n(93),c=n(39),s=n(73),u=n(74),d=n(122),p=n(116),f=function(e){switch(e){case a.b.administrator:return 3;case a.b.editor:return 2;case a.b.viewer:return 1;case a.b.updateRequired:return 0;default:return-1}},h=function(e){return void 0!==e?e.sort((function(e,t){var n=f(e.role),r=f(t.role)-n;return 0!=r?r:e.emailt.email?1:0})):[]},m=Object(u.b)(r.a.resetPassword.request,(function(e){return l.QueryService.checkPermission(a.b.administrator).then((function(t){return i.a.auth().sendPasswordResetEmail(e,null)})).then((function(){return r.a.resetPassword.success(e)})).catch((function(e){return r.a.resetPassword.failure(e)}))})),y=Object(u.a)(r.a.resetPassword.success,(function(e){return c.a.setGlobalMessage({title:"Check your inbox",message:"An email has been sent to "+e})})),g=Object(u.a)(r.a.resetPassword.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),b=Object(u.b)(r.a.updateUser.request,(function(e,t){return l.QueryService.updateUser(e).then((function(n){var a=t.value.userAdmin.users.filter((function(t){return t.uid!==e.uid}));return a.push(n),r.a.updateUser.success(h(a))})).catch((function(e){return r.a.updateUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})),A=Object(u.a)(r.a.updateUser.success,(function(e,t){return s.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),E=Object(u.a)(r.a.updateUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),v=Object(u.b)(r.a.deleteUser.request,(function(e,t){return l.QueryService.deleteUser(e).then((function(n){var a=t.value.userAdmin.users.filter((function(t){return t.uid!==e.uid}));return r.a.deleteUser.success(h(a))})).catch((function(e){return r.a.deleteUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})),S=Object(u.a)(r.a.deleteUser.success,(function(e,t){return s.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),k=Object(u.a)(r.a.deleteUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),T=[m,y,g,Object(u.b)(r.a.createUser.request,(function(e,t){return l.QueryService.createUser(e).then((function(n){return i.a.auth().sendPasswordResetEmail(e.email,null).then((function(a){var o=t.value.userAdmin.users.filter((function(t){return t.email!==e.email}));return o.push(n),r.a.createUser.success(h(o))})).catch((function(e){return r.a.createUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})).catch((function(e){return r.a.createUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})),Object(u.a)(r.a.createUser.success,(function(e,t){return s.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),Object(u.a)(r.a.createUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),b,A,E,v,S,k,Object(u.b)(r.a.getUsers.request,(function(){return l.QueryService.getUsers().then((function(e){return r.a.getUsers.success(h(e))})).catch((function(e){return r.a.getUsers.failure(Object(a.c)(a.a.NoPermission,"Failed to get user list",void 0))}))})),Object(u.a)(r.a.getUsers.failure,(function(e){return c.a.setError({title:"Error",message:e.message})}))]},,function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),a=n.n(r),o=n(82),i=n(2),l=n(5),c=n(29),s=n(213),u=n(1),d=n(4);function p(e){var t=e.text,n=e.onPress,r=e.theme,p=void 0===r?s.l:r,f=e.fetching,h=f||e.disabled;return a.a.createElement(c.a,{style:{justifyContent:"center",alignItems:p.stretchWidth?"stretch":"center",opacity:p.disabledFade&&h?.5:void 0},onPress:n,disabled:h},a.a.createElement(i.a,{style:{flexDirection:"row",justifyContent:"center",alignItems:"center",paddingHorizontal:p.paddingHorizontal,paddingVertical:p.paddingVertical,borderRadius:p.borderRadius,backgroundColor:h&&p.disabledBackgroundColor||p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,minWidth:p.minWidth,width:p.width,height:p.height}},f&&a.a.createElement(a.a.Fragment,null,a.a.createElement(o.a,{color:u.a.white,animating:!0}),a.a.createElement(d.a.Spacer,null)),a.a.createElement(l.a,{style:p.textStyle},t)))}},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));var r=n(12),a=n.n(r),o=n(10),i=n.n(o),l=n(11),c=n.n(l),s=n(15),u=n.n(s),d=n(6),p=n.n(d),f=n(13),h=n.n(f),m=n(0),y=n.n(m),g=n(2),b=n(5),A=n(66),E=n(214);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.setKDSData):return c({},e,a()({},t.payload.key,t.payload.data));default:return e}}},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(12),a=n.n(r),o=n(19),i=n(137),l=n(8);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.setCarparkList):return s({},e,{},t.payload);case Object(o.getType)(i.a.setSchoolHolidays):return s({},e,{schoolHolidays:t.payload});case Object(o.getType)(i.a.setPublicHolidays):return s({},e,{publicHolidays:t.payload});case Object(o.getType)(i.a.setAppVersions):return s({},e,{appVersions:t.payload});case Object(o.getType)(i.a.setLastImported):return s({},e,{lastImported:t.payload});default:return e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(162),a={carParkList:Object(r.createSelector)((function(e){return e.data}),(function(e){return e.carparkList}))||[]}},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(12),a=n.n(r),o=n(19),i=n(104);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.clearComponentData):return{dataStampData:{},scrollGraphData:{},barChartData:{},pieChartData:{},valueLabelData:{},labelData:{},dataTableData:{},starRatingData:{},heatmapData:{}};case Object(o.getType)(i.a.setDataStampData):return c({},e,{dataStampData:c({},e.dataStampData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setLabelData):return c({},e,{labelData:c({},e.labelData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setValueLabelData):return c({},e,{valueLabelData:c({},e.valueLabelData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setScrollGraphData):return c({},e,{scrollGraphData:c({},e.scrollGraphData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setBarChartData):return c({},e,{barChartData:c({},e.barChartData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setPieChartData):return c({},e,{pieChartData:c({},e.pieChartData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setDataTableData):return c({},e,{dataTableData:c({},e.dataTableData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setStarRatingData):return c({},e,{starRatingData:c({},e.starRatingData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setHeatmapData):return c({},e,{heatmapData:c({},e.heatmapData,a()({},t.payload.key,t.payload.data))});default:return e}}},function(e,t,n){"use strict";var r=n(48);n.d(t,"ScrollGraphType",(function(){return r.a}));var a=n(203);n.o(a,"ConnectedValueLabel")&&n.d(t,"ConnectedValueLabel",(function(){return a.ConnectedValueLabel})),n.o(a,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return a.LABEL_THEME_TITLE})),n.o(a,"Label")&&n.d(t,"Label",(function(){return a.Label})),n.o(a,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return a.kvsComponentSelector}));var o=n(204);n.o(o,"ConnectedValueLabel")&&n.d(t,"ConnectedValueLabel",(function(){return o.ConnectedValueLabel})),n.o(o,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return o.LABEL_THEME_TITLE})),n.o(o,"Label")&&n.d(t,"Label",(function(){return o.Label})),n.o(o,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return o.kvsComponentSelector}));var i=n(38);n.o(i,"ConnectedValueLabel")&&n.d(t,"ConnectedValueLabel",(function(){return i.ConnectedValueLabel})),n.o(i,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return i.LABEL_THEME_TITLE})),n.o(i,"Label")&&n.d(t,"Label",(function(){return i.Label})),n.o(i,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return i.kvsComponentSelector}));var l=n(23);n.o(l,"ConnectedValueLabel")&&n.d(t,"ConnectedValueLabel",(function(){return l.ConnectedValueLabel})),n.o(l,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return l.LABEL_THEME_TITLE})),n.o(l,"Label")&&n.d(t,"Label",(function(){return l.Label})),n.o(l,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return l.kvsComponentSelector}));var c=n(205);n.o(c,"ConnectedValueLabel")&&n.d(t,"ConnectedValueLabel",(function(){return c.ConnectedValueLabel})),n.o(c,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return c.LABEL_THEME_TITLE})),n.o(c,"Label")&&n.d(t,"Label",(function(){return c.Label})),n.o(c,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return c.kvsComponentSelector}));var s=n(206);n.o(s,"ConnectedValueLabel")&&n.d(t,"ConnectedValueLabel",(function(){return s.ConnectedValueLabel})),n.o(s,"LABEL_THEME_TITLE")&&n.d(t,"LABEL_THEME_TITLE",(function(){return s.LABEL_THEME_TITLE})),n.o(s,"Label")&&n.d(t,"Label",(function(){return s.Label})),n.o(s,"kvsComponentSelector")&&n.d(t,"kvsComponentSelector",(function(){return s.kvsComponentSelector}));n(472)},function(e,t,n){"use strict";n.d(t,"a",(function(){return R}));var r=n(12),a=n.n(r),o=n(10),i=n.n(o),l=n(11),c=n.n(l),s=n(15),u=n.n(s),d=n(6),p=n.n(d),f=n(13),h=n.n(f),m=n(0),y=n.n(m),g=n(2),b=n(5),A=n(217),E=n(1),v=n(4),S=n(120);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t=a?null:y.a.createElement(A.a.View,{style:{position:"absolute",left:r.width-n.indicatorTheme.width-n.indicatorTheme.padding+n.shadowPadding,top:n.indicatorTheme.padding+n.shadowPadding,backgroundColor:n.indicatorTheme.color,borderRadius:n.indicatorTheme.borderRadius,width:n.indicatorTheme.width,height:i,transform:[{translateY:A.a.multiply(this.state.indicator,o/a).interpolate({inputRange:[0,l],outputRange:[0,l],extrapolate:"clamp"})}]}})}},{key:"renderPopupListBox",value:function(){var e=this,t=this.state,n=t.open,r=t.expand,a=t.anim,o=t.layout,i=this.props,l=i.items,c=i.theme,s=i.selectedValue,u=i.selectedValues,d=l.findIndex((function(e){return e.value===s}));return y.a.createElement(k.a,{animationType:"none",transparent:!0,supportedOrientations:["landscape"],visible:n,ariaHideApp:!1,onRequestClose:function(){e.onClose()}},y.a.createElement(v.a,{onPress:function(){return e.onClose()}},y.a.createElement(g.a,{style:{flex:1,paddingTop:o.y+o.height+O.d.smallMargin-c.shadowPadding,paddingLeft:o.x-c.shadowPadding,alignItems:"flex-start"}},y.a.createElement(T.a,{visible:r,anim:a},y.a.createElement(g.a,null,y.a.createElement(E.a,{initialScrollIndex:d>=0?d:void 0,getItemLayout:this.getItemLayout,style:x({width:o.width,maxHeight:c.maxBoxHeight,borderWidth:c.borderWidth,borderColor:c.borderColor,borderRadius:c.borderRadius,backgroundColor:c.backgroundColor,margin:c.shadowPadding},P.c),data:l,extraData:d,renderItem:function(t){var n=t.item;return y.a.createElement(D,{multiSelect:void 0!=u,item:n,selectedValues:u||[s],theme:c,onValueChange:e.onValueChange})},ListHeaderComponent:y.a.createElement(g.a,{style:{height:c.boxVerticalPadding}}),ListFooterComponent:y.a.createElement(g.a,{style:{height:c.boxVerticalPadding}}),keyExtractor:this.getListKey,showsVerticalScrollIndicator:!1,bounces:!1,scrollEnabled:!0,scrollEventThrottle:16,onScroll:A.a.event([{nativeEvent:{contentOffset:{y:this.state.indicator}}}])}),this.renderScrollIndicator())))))}},{key:"render",value:function(){var e=this.state.anim,t=this.props,n=t.placeholder,r=t.items,a=t.selectedValue,o=t.theme,i=t.style,l=r.find((function(e){return JSON.stringify(e.value)===JSON.stringify(a)})),c=l?l.label:n;return y.a.createElement(g.a,{style:i},y.a.createElement(v.a,{onPress:this.onToggle,disabled:this.props.disabled},y.a.createElement(g.a,{ref:this._ref,style:{height:o.pickerHeight,paddingLeft:O.d.baseMargin,borderWidth:o.borderWidth,borderColor:o.borderColor,borderRadius:o.borderRadius,backgroundColor:o.backgroundColor,minWidth:o.minWidth,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},onLayout:this.onLayout},y.a.createElement(b.a,{style:this.props.disabled?o.pickerDisabledFont:o.pickerFont,numberOfLines:1,ellipsizeMode:"tail"},c),y.a.createElement(A.a.Image,{source:O.c.arrowDown,style:{tintColor:o.iconColor,width:o.iconSize,height:o.iconSize,transform:[{rotate:e.interpolate({inputRange:[0,1],outputRange:["0deg","-180deg"],extrapolate:"clamp"})}]},resizeMode:"contain"}))),this.renderPopupListBox())}}]),n}(y.a.PureComponent);j.defaultProps={style:{},theme:R.a,disabled:!1}},function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(0),a=n(30),o=n(10),i=n.n(o),l=n(11),c=n.n(l),s=n(15),u=n.n(s),d=n(6),p=n.n(d),f=n(13),h=n.n(f),m=n(2),y=n(233),g=n(254),b=n(1),A=n(41);function E(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var a=p()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u()(this,n)}}var v=function(e){h()(n,e);var t=E(n);function n(e){var r;return i()(this,n),(r=t.call(this,e)).nextTablePage=function(){var e=r.props,t=e.data,n=e.pageSize,a=r.state.page+1;n&&(a=Math.min(a,Math.floor((t.rows.length-1)/n))),r.setState({page:a})},r.prevTablePage=function(){var e=Math.max(0,r.state.page-1);r.setState({page:e})},r.state={page:0},r}return c()(n,[{key:"componentDidUpdate",value:function(e){Object(A.isEqual)(this.props.data,e.data)||this.setState({page:0})}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.dataStampInvalid,a=e.style,o=e.theme,i=e.pageSize,l=e.cellTapAction,c=this.state.page;return r.createElement(m.a,{style:{width:a.width,opacity:n?b.d.invalidOpacity:void 0}},r.createElement(y.a,{data:t,style:a,theme:o,page:c,pageSize:i,cellTapAction:l}),r.createElement(g.a,{count:void 0!==t?t.rows.length:0,page:c,pageSize:i,onNextPress:this.nextTablePage,onPrevPress:this.prevTablePage,theme:o}))}}]),n}(r.PureComponent);v.defaultProps={style:{width:100}};var S=n(157),k=n(49),T=n(90);function O(e){var t=Object(a.d)((function(t){return e.kvsSelector(t).dataTableData[e.dataKey]})),n=Object(k.b)(e.kvsSelector,t,e.dataStampKey);return r.createElement(v,{data:Object(T.injectCSVTitle)(t,e.dataKey),dataStampInvalid:n,pageSize:e.pageSize,style:e.style,theme:e.theme||S.a})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return D})),n.d(t,"a",(function(){return P}));var r=n(10),a=n.n(r),o=n(11),i=n.n(o),l=n(15),c=n.n(l),s=n(6),u=n.n(s),d=n(13),p=n.n(d),f=n(12),h=n.n(f),m=n(0),y=n.n(m),g=n(25),b=n(2),A=n(32),E=n(29),v=n(228);function S(e,t){var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?"application/csv":"text/csv",r=new Blob([t?"\ufeff":"",e],{type:n}),a="data:"+n+";charset=utf-8,"+(t?"\ufeff":"")+e,o=window.URL||window.webkitURL;return"undefined"===typeof o.createObjectURL?a:o.createObjectURL(r)}function k(e,t){var n=S(e),r=document.createElement("a");"string"===typeof r.download?(document.body.appendChild(r),r.download=t,r.href=n,r.click(),document.body.removeChild(r)):location.replace(n)}var T=n(1),O=n(539);function R(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u()(e);if(t){var a=u()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return c()(this,n)}}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;t.3?z.c.happyFace:z.c.indifferentFace;return function(){return m.a.createElement(G.a,{style:{width:z.d.icons.small,height:z.d.icons.small},source:n})}},Magnitude:function(e){return e?JSON.parse(e).document_sentiment.magnitude:""}};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function q(e){for(var t=1;t0?r+o/a:r}})),n}function ce(e,t,n,r){var a=[];t&&t.forEach((function(t){var n=F.g(t.date).startOf("day"),r=le(n,e),o=le(n.add(24,"hour"),e);r>=0&&o>=0&&a.push({startColumn:r,endColumn:o,label:t.description,color:U.a.green})})),n&&n.forEach((function(t){var n=F.g(t.date).startOf("day"),r=le(n,e),o=le(n.add(24,"hour"),e);r>=0&&o>=0&&a.push({startColumn:r,endColumn:o,label:t.description,color:U.a.red})})),a=function(e){for(var t=[],n=function(n){var r=q({},e[n]),a=t.find((function(e){return r.label===e.label&&(Math.abs(e.endColumn-r.startColumn)<.5||Math.abs(e.startColumn-r.endColumn)<.5)}));void 0!==a?(a.startColumn=Math.min(r.startColumn,a.startColumn),a.endColumn=Math.max(r.endColumn,a.endColumn)):t.push(r)},r=0;r=0&&a.push({startColumn:i,endColumn:i,label:"Version "+t.description,color:U.a.red})}));for(var o=te().month(0).date(1),i=le(o,e);i>=0;)a.push({startColumn:i,endColumn:i,label:o.format("YYYY"),color:U.a.darkGrey}),o.subtract(1,"year"),i=le(o,e);return(i=le(te(),e))>=0&&a.push({startColumn:i,endColumn:i,label:"Today"+te().format(" z"),color:U.a.darkGrey}),a}function se(e,t,n){if(e){var r=[];return e.forEach((function(e){if(n.find((function(t){return t===e.province_state}))){var t=r.find((function(t){return t.date===e.date}));t?(t.confirmed+=e.confirmed,t.recovered+=e.recovered,t.deaths+=e.deaths):r.push(q({},e,{province_state:"Selected States"}))}})),r.sort((function(e,t){return e.date0&&(u=l.filterTopCategoriesToDateRange?Q.d.getTopGroups(t,{start:o,end:i}):Q.d.getTopGroups(t));var d=ie(o,i,u.length);try{t.forEach((function(e){var t=F.b(o,F.g(e.date)),n=d[t];if(n&&(n.value+=e.value,e.group)){var r=u.indexOf(e.group);r>=0&&(n.categoryValues[r]+=e.value)}}));var p=u.map((function(e){return{name:e}})),f=Object(B.clone)(p);u.length>0&&function(e,t,n){if(!(t.length<=n)||function(e){return e.forEach((function(e){var t=e.categoryValues.reduce((function(e,t){return e+t}),0);if(e.value!==t)return!0})),!1}(e)){for(;t.length>=n;)t.pop();t.push({name:"Other",color:U.a.other}),e.forEach((function(e){for(e.csvCategoryValues=Object(B.clone)(e.categoryValues);e.categoryValues.length>=n;)e.categoryValues.pop();var t=e.categoryValues.reduce((function(e,t){return e+t}),0);e.categoryValues.push(e.value-t)}))}}(d,f,s),null!=l.categoryColours&&l.categoryColours.forEach((function(e,t){t=0?l[a].value+=e.value:c+=e.value}}));var s=l.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value}));if(c>0||l.length>a.categoryCount){for(;l.length>=a.categoryCount;){var u=l.pop();u&&(c+=u.value)}l.push({title:"Other",value:c,color:U.a.other})}var d={dataStamp:o,pieSlices:l,csvPieSlices:s,valueType:a.valueType,csvDefinition:a.csvDefinition};A.b.dispatch(Z.KVSComponentActions.setPieChartData(e,d))}catch(p){A.b.dispatch(x.a.setError({title:"Error",message:p.message}))}}}function fe(e,t,n,r,a){var o=[];return e&&(e.forEach((function(e){if(e.group&&(void 0===r||e.group in r)){var a=F.g(e.date);if(!a.isBefore(t)&&a.isBefore(n)){var i=o.findIndex((function(t){return t.group===e.group}));i>=0?(o[i].value+=e.value,o[i].count+=e.count):o.push({group:e.group,value:e.value,count:e.count})}}})),a===re.Average&&o.forEach((function(e){e.value=0===e.count?0:e.value/e.count})),a===re.Count&&o.forEach((function(e){e.value=e.count}))),o}function he(e,t,n,r,a){var o=fe(e,t,n,r,a).map((function(e){return e.value}));return Object(B.max)(o)||0}function me(e,t,n,r,a,o){if(t)try{!function(e,t,n,r){if(!t)return;try{var a=t.map((function(e){return{label:e.group,value:e.value,count:e.count,color:U.a.blue}})),o=(n.showZeroValues?a:a.filter((function(e){return e.count>0}))).sort((function(e,t){return"value"===n.sortBy?n.invertValence?e.value-t.value:t.value-e.value:n.invertValence?e.labelt.label?-1:1})),i=o.filter((function(e){return e.value>0}));if(null!=n.categoryCount&&o.length>n.categoryCount)if(n.addOtherCategory){for(var l=0,c=0;o.length>=n.categoryCount;){var s=o.pop();n.calculation===re.Average?l+=((null==s?void 0:s.value)||0)*((null==s?void 0:s.count)||0):l+=(null==s?void 0:s.value)||0,c+=(null==s?void 0:s.count)||0}n.calculation===re.Average&&c>0&&(l/=c),o.push({label:"Other",value:l,count:c})}else for(;o.length>n.categoryCount;)o.pop();var u={dataStamp:r,items:o,csvItems:i,valueType:W.a.Number,defaultMaxValue:n.defaultMaxValue,csvDefinition:n.csvDefinition};A.b.dispatch(Z.KVSComponentActions.setBarChartData(e,u))}catch(d){A.b.dispatch(x.a.setError({title:"Error",message:d.message}))}}(e,fe(t,n,r,a.groupFilter,a.calculation),a,o)}catch(i){A.b.dispatch(x.a.setError({title:"Error",message:i.message}))}}function ye(e,t,n,r,a,o,i){A.b.dispatch(Z.KVSComponentActions.setValueLabelData(e,{title:t,description:n,value:r,valueType:a,percentageChange:o,dataStamp:i}))}function ge(e,t,n,r,a){var o=0,i=0;return e.forEach((function(e){if(function(e,t){return!t||void 0!==e.group&&-1!==Object(B.sortedIndexOf)(t,e.group)}(e,a)){var l=F.g(e.date);!l.isBefore(t)&&l.isBefore(n)&&(o+=r===re.SumProduct?e.count*e.value:e.value,i+=e.count)}})),r===re.Average&&i>0?o/i:r===re.Count?i:o}function be(e,t,n,r,a,o,i,l,c,s,u){return Ae({key:e,title:t,description:n,data:r,groupFilter:a,startMoment:o,endMoment:i,valueType:l,calculationType:c,calculatePercentageChange:s,dataStamp:u})}function Ae(e){if(e.data){var t,n=e.groupFilter?e.groupFilter.concat().sort():void 0,r=ge(e.data,e.startMoment,e.endMoment,e.calculationType||re.Sum,n),a=void 0;if(e.calculatePercentageChange){var o=H.DashboardDataService.getPrevParams({start:e.startMoment,end:e.endMoment}),i=ge(e.data,o.start,o.end,e.calculationType||re.Sum,n);0!==i&&(a=100*(r/i-1))}if(e.showCount){var l=ge(e.data,e.startMoment,e.endMoment,re.Count,n);t=""+(e.showCount.prefix||"")+Object(W.b)(l,W.a.Number)+(e.showCount.suffix||"")}var c={title:e.title,description:e.description,value:r,valueType:e.valueType||W.a.Number,secondaryValue:t,percentageChange:a,dataStamp:e.dataStamp};return A.b.dispatch(Z.KVSComponentActions.setValueLabelData(e.key,c)),c}}function Ee(e){if(e.data){var t=e.groupFilter?e.groupFilter.concat().sort():void 0,n=ge(e.data,e.startMoment,e.endMoment,e.valuesRequireSumProduct?re.SumProduct:re.Sum,t),r=ge(e.data,e.startMoment,e.endMoment,re.Count,t),a={title:e.title,rating:n/r,count:r,dataStamp:e.dataStamp};A.b.dispatch(Z.KVSComponentActions.setStarRatingData(e.key,a))}}function ve(e,t,n,r,a,o,i){if(t)try{var l=o?o.concat().sort():Object(B.uniqBy)(t,(function(e){return e.group})).map((function(e){return e.group})).sort(),c=l.map((function(e){return{category:e,value:0,count:0,average:0}}));t.forEach((function(e){var t=F.g(e.date);if(!t.isBefore(n)&&t.isBefore(r)&&e.group){var a=Object(B.sortedIndexOf)(l,e.group);-1!==a&&(c[a].value+=e.value,c[a].count+=e.count)}}));var s=c.filter((function(e){return e.count>0}));s.forEach((function(e){e.average=0===e.count?0:e.value/e.count})),s.sort((function(e,t){var n=a?e.average-t.average:t.average-e.average,r=t.count-e.count;return 0!==n?n:r}));var u=[];s.forEach((function(e,t){u[t]={cells:[(t+1).toString(),e.category,K.NumberTwoDecimalPlaces(e.average),K.Number(e.count)]}}));var d={dataStamp:i,titleRow:{cells:["Rank","Category","Rating","Count"]},rows:u,cellFlex:[1,5,1,1]};A.b.dispatch(Z.KVSComponentActions.setDataTableData(e,d))}catch(p){A.b.dispatch(x.a.setError({title:"Error",message:p.message}))}}!function(e){e.Sum="Sum",e.Count="Count",e.Average="Average",e.SumProduct="SumProduct"}(re||(re={}));var Se=n(35);function ke(e){var t=[];return e.forEach((function(e){var n=t.find((function(t){return e.geoCity===t.name}));void 0===n?t.push({name:e.geoCity,minLatitude:e.latitude,minLongitude:e.longitude,maxLatitude:e.latitude,maxLongitude:e.longitude}):(n.minLatitude=Math.min(n.minLatitude,e.latitude),n.minLongitude=Math.min(n.minLongitude,e.longitude),n.maxLatitude=Math.max(n.maxLatitude,e.latitude),n.maxLongitude=Math.max(n.maxLongitude,e.longitude))})),t}var Te=n(537),Oe=n(64),Re=n(4),Ce=n(71);function Ue(e){var t=Object(b.d)(e.selector),n=Object(b.c)();return h.createElement(y.a,{style:{flexDirection:"row",alignItems:"center",flex:1,minWidth:e.style&&e.style.minWidth?e.style.minWidth:120,maxWidth:e.style&&e.style.maxWidth?e.style.maxWidth:200,minHeight:z.d.tripleBaseMargin}},e.icon&&h.createElement(G.a,{style:{width:z.d.icons.tiny,height:z.d.icons.tiny,tintColor:z.a.grey},source:e.icon}),e.icon&&h.createElement(Re.a.Spacer,null),h.createElement(Ce.PickerBox,{placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedValue:t,onValueChange:function(t){n(e.onChangeAction(t))},style:{flex:1},theme:Ce.PICKER_BOX_THEME_SLIM}))}var De=function(e){return h.createElement(Ue,{icon:z.c.timeZone,placeholder:"Time Zone",items:Oe.e.map((function(e){var t=J.a.tz(Oe.f(e));return{label:e+", "+t.format("z")+" ("+t.format("Z")+")",value:e}})),selector:Oe.d.timeZoneState,onChangeAction:Oe.a.setTimeZoneState})},Pe=n(538),we=n(282),Me=n(29),xe=n(95),Ve=n(67),je=n(31),Be=n(24),Ie=n(114),Ne=n(14);function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Fe=function(e){f()(n,e);var t=Le(n);function n(){var e;o()(this,n);for(var r=arguments.length,a=new Array(r),i=0;i1e-4||Math.abs(e.longitude-t.longitude)>1e-4||Math.abs(e.latitudeDelta-t.latitudeDelta)>1e-4||Math.abs(e.longitudeDelta-t.longitudeDelta)>1e-4))},e.getCurrentRegion=function(){if(e._mapRef){var t=e._mapRef.getBounds(),n=e._mapRef.getCenter();if(t&&n){var r=t.getNorthEast(),a=t.getSouthWest();return{latitude:n.lat(),longitude:n.lng(),latitudeDelta:Math.abs(r.lat()-a.lat()),longitudeDelta:Math.abs(r.lng()-a.lng())}}}return null},e.onBoundsChanged=Object(B.debounce)((function(){var t=e.props.onRegionChangeComplete;if(e._mapRef&&t){var n=e.getCurrentRegion();e.regionsDifferent(n,e.state.lastRegion)&&t(n)}}),200),e}return l()(n,[{key:"animateCamera",value:function(e,t){if(this._mapRef&&e.center)if(e.zoom){var n={lat:e.center.latitude,lon:e.center.longitude};if(void 0!==this._layout&&void 0!==this._layout.width&&void 0!==this._layout.height){var r=Ke.a.bounds(n,e.zoom,[this._layout.width,this._layout.height]),a={west:r[0],south:r[1],east:r[2],north:r[3]};this._mapRef.fitBounds(a),this._mapRef.panToBounds(a)}}else{var o={lat:e.center.latitude,lng:e.center.longitude};this._mapRef.panTo(o)}}},{key:"componentDidUpdate",value:function(e){var t=this.getCurrentRegion();this.regionsDifferent(t,this.state.lastRegion)&&this.setState({lastRegion:t})}},{key:"render",value:function(){var e=this.props,t=e.initialRegion,n=e.onPress,r=e.style,a=e.onMarkerPress,o=t?{center:{lat:t.latitude,lng:t.longitude}}:{},i=m.a.Children.map(this.props.children,(function(e){return e?m.a.cloneElement(e,{forwardOnPress:a}):e}));return m.a.createElement(y.a,{style:r,onLayout:this.onLayout},m.a.createElement(ze.b,Ge()({onLoad:this.handleMapMounted,mapContainerStyle:r},o,{onBoundsChanged:this.onBoundsChanged,zoom:14,onClick:n,options:{streetViewControl:!1}}),i))}}]),n}(h.PureComponent),_e=n(66),$e=n(221);function et(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var tt=function(e){f()(n,e);var t=et(n);function n(){var e;o()(this,n);for(var r=arguments.length,a=new Array(r),i=0;i=40?{zoom:0}:Ke.a.viewport(n,[o,i]);e.push(t.getClusters(n,r.zoom))})),e},r.onMarkerPress=function(e,t){var n=r.props.clusterers;if(e&&t&&t.nativeEvent&&t.nativeEvent.coordinate&&t.nativeEvent.id){var a=t.nativeEvent.id.split("_");if(a&&a.length>2&&"c"===a[0]){var o=n[parseInt(a[1],10)],i=parseInt(a[2],10);if(o){var l=o.getClusterExpansionZoom(i)+2;e.animateCamera({center:t.nativeEvent.coordinate,zoom:"web"===ct.a.OS?l:l-1},{duration:500})}}}},r.geoJsonGeometryToLatLng=function(e){var t="Point"===e.type?e.coordinates:[];return 2!==t.length?{latitude:0,longitude:0}:{latitude:t[1],longitude:t[0]}},r.state={clustersPerClusterer:r.determineCurrentClusters()},r}return l()(n,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.clusterers,r=t.region,a=t.width,o=t.height;e.region===r&&e.clusterers===n&&e.width===a&&e.height===o||this.setState({clustersPerClusterer:this.determineCurrentClusters()})}},{key:"render",value:function(){var e=this,t=this.props,n=t.renderMarker,r=t.forwardOnPress,a=this.state.clustersPerClusterer,o=[];return a.map((function(t,a){return t.map((function(t){if(t.properties){var i=t.properties.cluster?"c_"+a+"_"+t.properties.cluster_id:"p_"+t.properties.id;o.push(n(i,i,e.geoJsonGeometryToLatLng(t.geometry),!!t.properties.cluster,t.properties,r))}}))})),o}}]),n}(h.PureComponent),ft=O.a.create({clusterOuterCircle:{width:U.d.clusterOuterDiam,height:U.d.clusterOuterDiam,borderRadius:U.d.clusterOuterRad,backgroundColor:Object(Ve.c)(U.a.black,.5),alignItems:"center",justifyContent:"center"},clusterInnerCircle:{width:U.d.clusterInnerDiam,height:U.d.clusterInnerDiam,borderRadius:U.d.clusterInnerRad,backgroundColor:U.a.black,alignItems:"center",justifyContent:"center"},clusterText:ut({},U.b.white.bodyS.bold),marker:{width:U.d.markerPinDims,height:U.d.markerPinDims},markerText:ut({},U.b.white.bodyXS.bold,{textAlign:"center",marginTop:U.d.markerTextMargin})}),ht=n(169);function mt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var yt=U.a.grey,gt={latitude:-37.8136,longitude:144.9631,latitudeDelta:.065,longitudeDelta:.075};var bt=function(e){f()(n,e);var t=mt(n);function n(e){var r;o()(this,n),(r=t.call(this,e))._mapRef=null,r._pinClustering=null,r.getDataPoints=function(e){return e.map((function(e){return[e.carpark.latitude||gt.latitude,e.carpark.longitude||gt.longitude]}))},r.getMaxValue=function(e){return Math.max(Ze.d(e,(function(e){return e.value}))||1,1)},r.clusterMarkers=function(e){var t=e.map((function(e,t){return{type:"Feature",geometry:{type:"Point",coordinates:[e.carpark.longitude,e.carpark.latitude]},properties:{mapItem:e,id:t}}})),n=new lt.a({radius:80,map:function(e){return{sum:e.mapItem.value}},reduce:function(e,t){e.sum+=t.sum}});return n.load(t),n},r.clusterAll=function(){var e=r.props.mapItems.reduce((function(e,t){var n=t.carpark.state,r=e[n]||[];return r.push(t),e[n]=r,e}),{});return Object.values(e).map((function(e){return r.clusterMarkers(e)}))},r.onRegionChanged=function(e){r.setState({latestRegion:e})},r.getRegionForSelectedCity=function(){var e=r.props.selectedCity;if(e){var t=He.c.find((function(t){return t.name===e}));if(void 0!==t)return{latitude:t.latitude,longitude:t.longitude,latitudeDelta:.05,longitudeDelta:.06}}return gt},r.renderMarker=function(e,t,n,r,a,o){var i=r?a.sum:a.mapItem.value;return function(e,t,n,r,a,o){return r?m.a.createElement(tt,{key:e,identifier:t,coordinate:n,anchor:{x:.5,y:.5},onPress:o},m.a.createElement(y.a,{style:ft.clusterOuterCircle},m.a.createElement(y.a,{style:ft.clusterInnerCircle},m.a.createElement(R.a,{style:ft.clusterText},a)))):m.a.createElement(tt,{key:e,identifier:e,coordinate:n,image:U.c.mapPin,onPress:o},m.a.createElement(y.a,{style:ft.marker},m.a.createElement(R.a,{style:ft.markerText},a)))}(e,t,n,r,Object(W.b)(i,W.a.Number),o)},r.onMarkerPress=function(e){r._mapRef&&r._pinClustering&&r._pinClustering.onMarkerPress(r._mapRef,e)};var a=r.filterMapItems(e.selectedCity,e.mapItems);return r.state={mapItems:a,maxValue:r.getMaxValue(a),totalRegion:r.getTotalRegion(a),clusterers:r.clusterAll(),latestRegion:r.getRegionForSelectedCity()},r}return l()(n,[{key:"filterMapItems",value:function(e,t){return t.filter((function(t){return t.carpark.geoCity==e}))}},{key:"getTotalRegion",value:function(e){var t=void 0;return e.forEach((function(e){void 0===t?t={minLatitude:e.carpark.latitude,minLongitude:e.carpark.longitude,maxLatitude:e.carpark.latitude,maxLongitude:e.carpark.longitude}:(t.minLatitude=Math.min(t.minLatitude,e.carpark.latitude),t.minLongitude=Math.min(t.minLongitude,e.carpark.longitude),t.maxLatitude=Math.max(t.maxLatitude,e.carpark.latitude),t.maxLongitude=Math.max(t.maxLongitude,e.carpark.longitude))})),void 0===t&&(t={minLatitude:gt.latitude-gt.latitudeDelta,minLongitude:gt.longitude-gt.longitudeDelta,maxLatitude:gt.latitude+gt.latitudeDelta,maxLongitude:gt.longitude+gt.longitudeDelta}),t}}]),l()(n,[{key:"componentDidUpdate",value:function(e){if(e.mapItems!==this.props.mapItems||e.selectedCity!==this.props.selectedCity){var t=this.state.clusterers;e.mapItems!==this.props.mapItems&&(t=this.clusterAll());var n=this.state.latestRegion;if(e.selectedCity!==this.props.selectedCity&&this._mapRef){var r=this.getRegionForSelectedCity();this._mapRef.animateCamera({center:r},{duration:500}),n=r}var a=this.filterMapItems(this.props.selectedCity,this.props.mapItems);this.setState({mapItems:a,maxValue:this.getMaxValue(a),totalRegion:this.getTotalRegion(a),clusterers:t,latestRegion:n})}}},{key:"render",value:function(){for(var e=this,t=this.state,n=t.maxValue,r=t.mapItems,a=t.totalRegion,o=t.clusterers,i=t.latestRegion,l=this.props,c=l.dataStampInvalid,s=l.selectedCity,u=l.selectedOverlay,d=l.cityList,p=l.valueType,f=void 0===p?W.a.Number:p,h=d.find((function(e){return e.name===s})),g=void 0!==h?h:a,b=this.getDataPoints(r),A=Ze.f().extent([[g.minLatitude-.1,g.minLongitude-.1],[g.maxLatitude+.1,g.maxLongitude+.1]]).polygons(b).map((function(e){return e.map((function(e){return function(e){return{latitude:e[0],longitude:e[1]}}(e)}))})),E=Ze.e(Ze.c).domain([0,n]),v=[],S=0;S<=10;S++)v.push(m.a.createElement(y.a,{key:"guide_"+S,style:{flex:1,height:U.d.doubleBaseMargin,backgroundColor:E(n*S/10),margin:.5}}));var k=this.props.style||{},T=k.width,O=k.height;return m.a.createElement(y.a,{style:{width:T,height:O,opacity:c?U.d.invalidOpacity:void 0}},m.a.createElement(ht.a,{visible:"voronoi"===u},m.a.createElement(y.a,{style:{width:T,flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},m.a.createElement(R.a,{style:U.b.grey.bodyS.regular},Object(W.c)(0,f)),m.a.createElement(R.a,{style:U.b.grey.bodyS.regular},Object(W.c)(n,f))),m.a.createElement(y.a,{style:{width:T,flexDirection:"row",backgroundColor:U.a.border,padding:.5}},v),m.a.createElement(Re.a.Spacer,null)),m.a.createElement(y.a,{style:{borderColor:U.a.border,borderWidth:1,borderRadius:U.d.borderRadius,overflow:"hidden",flex:1}},m.a.createElement(it,{ref:function(t){e._mapRef=t},provider:"google",liteMode:!1,zoomEnabled:!0,zoomControlEnabled:!0,style:{flex:1},onMarkerPress:this.onMarkerPress,initialRegion:i,onRegionChangeComplete:this.onRegionChanged},"voronoi"===u&&A.map((function(e,t){var n=Object(Ve.c)(E(r[t].value),.5);return m.a.createElement(ot,{key:"heat_region_"+t,coordinates:e,strokeWidth:1,strokeColor:yt,fillColor:n})})),"voronoi"===u&&r.map((function(e,t){var n={latitude:e.carpark.latitude,longitude:e.carpark.longitude},r=E(e.value);return m.a.createElement(rt,{key:"centroid_"+t,center:n,radius:50,fillColor:r,strokeColor:yt,strokeWidth:1})})),"markers"===u&&m.a.createElement(pt,{ref:function(t){return e._pinClustering=t},width:T,height:O,clusterers:o,region:i,renderMarker:this.renderMarker}))))}}]),n}(h.PureComponent);bt.defaultProps={style:{width:U.d.defaultSize,height:U.d.defaultSize}};var At=n(36),Et=n(89);function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function St(e){for(var t=1;t0||void 0!==n&&n>0;return m.a.createElement(y.a,{style:St({overflow:"hidden"},this.props.style),onLayout:this.onLayout},r&&m.a.Children.map(this.props.children,(function(e){return e&&e.props?m.a.cloneElement(e,{style:St({},e.props.style,{width:t,height:n})}):e})),!r&&m.a.createElement(Et.a,{showLoading:!1,style:St({},this.props.style,{position:"absolute"})}))}}]),n}(m.a.PureComponent),Ot=n(44),Rt=n(120);function Ct(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Ut=function(e){f()(n,e);var t=Ct(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.categoryIndex,r=e.graphWidth,a=e.graphHeight,o=e.startOffset,i=e.endOffset,l=e.lineColor,c=e.topValue,s=[];if(void 0!==t){var u=i-1,d=this.props.dataStartOffset||0,p=(this.props.dataEndOffset||t.graphItems.length)-1,f=Math.max(Math.min(Math.max(Math.ceil(o-.5),d),t.graphItems.length-1),0),h=Math.max(Math.min(Math.min(Math.floor(u+.5),p),t.graphItems.length-1),0);if(h>f){var y=function(e){var t=0,n=0,r=0,a=0;e.forEach((function(e){t+=e.x,a+=e.x*e.x,n+=e.y,r+=e.x*e.y}));var o=e.length,i=o*a-t*t;return 0===i?{a:0,b:0}:{a:(n*a-t*r)/i,b:(o*r-t*n)/i}}(function(e,t,n,r){var a=[];if(void 0!==r&&r>=0&&rc||E.y<0||E.y>c)if(Math.abs(y.b)>.001){var v={x:-y.a/y.b,y:0},S={x:(c-y.a)/y.b,y:c},k=v.xA.x&&(A=k),T.xc&&(A.y=c),E.y<0&&(E.y=0),E.y>c&&(E.y=c);var O=function(e){return r*(e-o)/(u-o)},R=function(e){return a*(1-e/c)},C="M"+O(A.x)+","+R(A.y)+"L"+O(E.x)+","+R(E.y);s.push(m.a.createElement(Ot.c,{key:"line_of_best_fit",d:C,stroke:l,strokeWidth:2,fillOpacity:0}))}}return s}}]),n}(h.PureComponent);function Dt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Pt=function(e){f()(n,e);var t=Dt(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"getTextWidth",value:function(e){var t=4;if(e)for(var n=0;n=f){var a=n*(e.startColumn-i)/(d-i),l=n*(e.endColumn-i)/(d-i);e.endColumn>e.startColumn||(p.push(m.a.createElement(Ot.b,{key:"marker_line_"+e.label+"_"+e.startColumn+"_"+t,x1:a,y1:o,x2:a,y2:r,stroke:e.color,strokeDasharray:[3,3],strokeWidth:"0.5"})),s&&p.push(m.a.createElement(Pt,{key:"marker_label_"+e.label+"_"+e.startColumn+"_"+t,x:(a+l)/2,y:o,label:e.label,color:e.color,backgroundColor:u.backgroundColor})))}}))}return p}}]),n}(h.PureComponent);function xt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Vt=function(e){f()(n,e);var t=xt(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.graphWidth,r=e.graphHeight,a=e.startOffset,o=e.endOffset,i=e.axisColor,l=o-1,c=[];if(void 0!==t){for(var s=Math.max(Math.min(Math.ceil(a-.5),t.graphItems.length-1),0),u=Math.max(Math.min(Math.floor(l+.5),t.graphItems.length-1),0),d="",p=Math.floor((u-s)/7),f=1;f=l&&(p+="M"+a+","+n.y+"L"+a+","+(n.y+n.h));var o=z.a.white,i=t.points.find((function(t){return t.column===e}));i&&(o=t.colorMapper(i.value)),s.push(m.a.createElement(Ot.d,{key:"data_band_column_"+e,x:a,y:n.y,width:f,height:n.h,fill:o,strokeWidth:0}))},y=u;y<=d;y++)h(y);s.push(m.a.createElement(Ot.c,{key:"data_band_lines",d:p,stroke:i,strokeWidth:1,fillOpacity:0}))}return s}}]),n}(h.PureComponent),Nt=n(81);function Jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t=c&&e.endColumnc&&u.push({description:e.label,color:e.color})}));var d=r.renderingPrediction()&&void 0!==s.prediction?[{description:"90%",value:r.formatValue(Math.max(s.prediction.max,0))},{description:"50%",value:r.formatValue(Math.max(s.prediction.expected,0))},{description:"10%",value:r.formatValue(Math.max(s.prediction.min,0))}]:void 0,p=[],f=Object(Ve.a)(o.categoryInfo.length);if(void 0!==s.categoryValues&&o.categoryInfo.length>0)for(var h=s.categoryValues.length-1;h>=0;h--)p.push({description:o.categoryInfo[h].name,value:r.formatValue(s.categoryValues[h]),color:o.categoryInfo[h].color||f(h)});return o.colorBands&&o.colorBands.forEach((function(e){var t=e.points.find((function(e){return e.column===c}));t&&p.push({description:e.label,value:Object(W.c)(t.value,e.valueType),color:e.colorMapper(t.value)})})),o.extraLines&&o.extraLines.forEach((function(e){var t=e.points.find((function(e){return e.column===c}));t&&p.push({description:e.description,value:Object(W.c)(t.value,e.valueType),color:e.color})})),{position:{x:t.paddingLeft+(c-i.startOffset)/l,y:z.d.smallMargin},title:s.label,markerLabels:u,value:o.hidePopupTotalValue?void 0:r.formatValue(s.value),predictionLabels:d,categoryLabels:p}},r.renderPopupContents=function(e){var t=r.props.theme;return m.a.createElement(y.a,{style:{minWidth:100,maxWidth:150,width:e.categoryLabels&&e.categoryLabels.length>0?150:void 0}},m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{alignSelf:"center"}]},e.title),void 0!==e.value&&m.a.createElement(R.a,{style:[z.b.black.bodyS.thin,{alignSelf:"center"}]},e.value),void 0!==e.predictionLabels&&m.a.createElement(y.a,{style:{backgroundColor:t.predictionColor,paddingHorizontal:z.d.smallMargin,paddingVertical:z.d.tinyMargin,marginBottom:z.d.smallMargin,borderRadius:z.d.smallMargin}},e.predictionLabels.map((function(e,t){return m.a.createElement(y.a,{key:"popup_prediction_"+t,style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},m.a.createElement(R.a,{style:z.b.white.bodyXXS.regular},e.description),m.a.createElement(Re.a.Spacer,null),m.a.createElement(R.a,{style:z.b.white.bodyXXS.regular},e.value))}))),void 0!==e.categoryLabels&&e.categoryLabels.map((function(e,t){return m.a.createElement(y.a,{key:"popup_category_"+e+"_"+t,style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(y.a,{style:{width:z.d.smallMargin,height:z.d.smallMargin,backgroundColor:e.color}}),m.a.createElement(Re.a.SpacerSmall,null),m.a.createElement(R.a,{style:z.b.grey.bodyXXS.thin,ellipsizeMode:"tail",numberOfLines:1},e.description),m.a.createElement(Re.a.SpacerSmall,null),m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(R.a,{style:z.b.grey.bodyXXS.thin},e.value))})),void 0!==e.markerLabels&&e.markerLabels.map((function(e,t){return m.a.createElement(R.a,{key:"popup_marker_label_"+t,style:[z.b.white.bodyXXS.regular,{color:e.color,textAlign:"center",alignSelf:"center"}]},e.description)})))},r.renderParentOverlay=function(e){var t=r.props.theme;return m.a.createElement(y.a,{style:{position:"absolute",width:1,backgroundColor:t.primaryAxisColor,left:e.position.x,top:t.paddingTop,bottom:t.paddingBottom}})},r.getScrubberOffsets=function(){var e=r.props,t=e.scrubberStartOffset,n=e.scrubberEndOffset,a=r.state.data,o=0,i=a.graphItems.length;return t&&n&&(o=t.__getValue(),i=n.__getValue()),{startOffset:o,endOffset:i,minColumn:Math.max(Math.ceil(o),0),maxColumn:Math.min(Math.floor(i),a.graphItems.length)-1}},r.getCSVData=function(){for(var e,t,n=r.state.data,a=r.getScrubberOffsets(),o=n.scrollGraphType!==jt.a.Line&&n.categoryInfo.length>0,i=[],l=function(e){var t=n.graphItems[e];if(o&&t.categoryValues&&t.categoryValues.length>0){var r=void 0!==t.csvCategoryValues&&void 0!==n.csvCategoryInfo,a=r?t.csvCategoryValues:t.categoryValues,l=r?n.csvCategoryInfo:n.categoryInfo,c=[];a.forEach((function(e,n){l.length>n&&c.push({label:t.label,category:l[n].name,value:e})})),c.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value})).forEach((function(e){i.push([e.label,e.category,Object(W.c)(e.value,n.valueType,0)])}))}else i.push([t.label,Object(W.c)(t.value,n.valueType,0)])},c=a.minColumn;c<=a.maxColumn;c++)l(c);return{title:null==(e=n.csvDefinition)?void 0:e.title,headers:(null==(t=n.csvDefinition)?void 0:t.headers)||(o?["Date","Category","Value"]:["Date","Value"]),data:i}};var a=e.data,i=e.style,l=e.theme,c=r.calculatePercentages(a),s=i.width-l.paddingLeft-l.paddingRight,u=i.height-l.paddingTop-l.paddingBottom,d=r.getLegendHeight(u),p=u-d,f=p;(null==a?void 0:a.colorBands)&&a.colorBands.forEach((function(e){f-=e.height}));var h=r.getTopValue(c.graphItems,c.scrollGraphType);return r.state={animating:!1,lastGraphItems:c.graphItems,lastTopValue:h,rawData:a,data:c,topValue:h,width:e.style.width,height:e.style.height,axisHeight:p,graphWidth:s,graphHeight:f,graphAnim:new L.a.Value(0),legendHeight:d},r}return l()(n,[{key:"componentWillUnmount",value:function(){this.debouncedUpdate.cancel(),this.state.graphAnim.stopAnimation()}},{key:"componentDidUpdate",value:function(){this.debouncedUpdate()}},{key:"getMaxValue",value:function(e,t){if(0==e.length)return 0;var n=this.isStacked(t),r=1;return e.forEach((function(e){n?e.value>r&&(r=e.value):e.categoryValues&&e.categoryValues.forEach((function(e){rr&&(r=e.prediction.max)})),r}},{key:"getTopValue",value:function(e,t){for(var n=this.getMaxValue(e,t),r=2;n>100*r;)r*=10;return Math.ceil(n/r)*r}},{key:"calculatePercentages",value:function(e){if(void 0===e)return{graphItems:[],categoryInfo:[],valueType:W.a.Number,scrollGraphType:jt.a.StackedArea,showLineOfBestFit:!1};if(e.scrollGraphType!=jt.a.StackedLinePercentage&&e.scrollGraphType!=jt.a.StackedAreaPercentage)return e;var t=Gt({},e,{valueType:W.a.Percent});return t.graphItems=t.graphItems.map((function(e){var t=void 0!==e.categoryValues?e.categoryValues.map((function(t,n){return e.value>0?100*t/e.value:n===e.categoryValues.length-1?100:0})):void 0;return Gt({},e,{value:100,categoryValues:t})})),t}},{key:"getLegendHeight",value:function(e){var t=this.props.theme.legendTheme;if(t&&t.legendOrientation===Nt.e.Horizontal){var n=t.minHeight,r=t.sizeProportion;return Math.max(n||0,(r||0)*e)}return 0}},{key:"padPoints",value:function(e,t){if(e.length>=t)return e;var n=[];if(0===e.length){for(var r=0;r0)!function(){var a=n.isStacked(n.state.data.scrollGraphType),o=e.map((function(){return 0})),i=e.map((function(e,t){return{x:t,y:o[t]}}));r.push(i);for(var l=function(t){var n=e.map((function(e,n){var r=e.categoryValues&&e.categoryValues.length>t?e.categoryValues[t]:0;return a?o[n]+=r:o[n]=r,{x:n,y:o[n]}}));r.push(n)},c=0;c=0;r--)n.push(Gt({},t[r]));return n}},{key:"renderAnimatedCategories",value:function(e,t,n){var r=this;if(!e&&!t)return null;var a=this.state,o=a.animating,i=a.lastGraphItems,l=a.lastTopValue,c=a.data,s=a.topValue,u=a.graphAnim,d=this.isStacked(c.scrollGraphType),p=Math.max(c.graphItems.length,2),f=p;o&&(f=Math.max(i.length,2));var h=Math.max(f,p),y=this.getCategoryLines(c.graphItems,c.categoryInfo.length),g=[];o&&(g=(g=this.getCategoryLines(i,c.categoryInfo.length)).map((function(e){return r.padPoints(e,h)})),y=y.map((function(e){return r.padPoints(e,h)})));var b=Object(Ve.a)(c.categoryInfo.length),A=[];if(e)for(var E=0;Et.startColumn;return m.a.createElement(Ot.a,{key:"marker_"+o},c&&m.a.createElement(Ot.d,{x:i,y:a,width:l-i,height:r,fill:t.color,fillOpacity:.75}))}))||m.a.createElement(Ot.a,null))}},{key:"getColorBandY",value:function(e){var t=this.state.data.colorBands,n=0;if(t)for(var r=0;r0}));return n.forEach((function(e){e.value=Math.floor(e.value)})),n}},{key:"getCarparkOccupancyData",value:function(){var e=this.props.data.carparkList,t=this.props.bookingCountsByCarParkData,n=e.map((function(e){return{carpark:e,value:(t?t[e.name]:void 0)||0}})).filter((function(e){return!Ne.b.isDemo||e.value>0}));return n.forEach((function(e){e.value=Math.floor(e.value)})),n}},{key:"renderDataControls",value:function(){var e=this.props.data.cityList,t=this.state,n=t.selectedCity,r=t.selectedMapType,a=t.selectedOverlay;return m.a.createElement(je.Group,{style:{padding:U.d.doubleBaseMargin,width:300}},m.a.createElement(Ce.PickerBox,{placeholder:"Select what to view",items:[{label:Bn.Revenue,value:Bn.Revenue},{label:Bn.Occupancy,value:Bn.Occupancy}],selectedValue:r,onValueChange:this.onMapTypePicker}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Ce.PickerBox,{placeholder:"Select how to view the information",items:[{label:xn.Voronoi,value:"voronoi"},{label:xn.Markers,value:"markers"}],selectedValue:a,onValueChange:this.onOverlayPicker}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Ce.PickerBox,{placeholder:"Select the city to view",items:e.map((function(e){return{label:e.name,value:e.name}})),selectedValue:n,onValueChange:this.onCityPicker}))}},{key:"renderDataView",value:function(){var e,t=this.props.data.cityList,n=this.state,r=n.selectedCity,a=n.selectedMapType,o=n.selectedOverlay,i=n.targetDataStamp,l=n.activeDataStamp,c=[];a===Bn.Revenue?(c=this.getCarparkRevenueData(),e=W.a.Dollars):a===Bn.Occupancy&&(c=this.getCarparkOccupancyData());var s=U.d.doubleBaseMargin,u=U.d.doubleBaseMargin,d=U.d.doubleBaseMargin,p=i!==l;return m.a.createElement(je.Group,{style:{flex:1,paddingHorizontal:s,paddingTop:u,paddingBottom:d}},m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(bt,{dataStampInvalid:p,mapItems:c,selectedCity:r,cityList:t,valueType:e,selectedOverlay:o})))}},{key:"render",value:function(){var e=this.state.dateScrub;return m.a.createElement(y.a,{style:{minWidth:U.d.minPageWidth,backgroundColor:U.a.pageBackground,padding:U.d.doubleBaseMargin,flex:1}},m.a.createElement(je.Group,null,m.a.createElement(wn,{dateScrub:e,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(rn,{kvsSelector:Z.kvsComponentSelector,dataKey:Vn.ScrubberLineGraph,theme:Zt}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%",flex:1}},this.renderDataControls(),m.a.createElement(Re.a.SpacerDouble,null),this.renderDataView()))}}]),n}(m.a.Component),Nn=Object(b.b)((function(e){return{data:e.data,revenueByCarParkData:e.kdsData[jn.RevenueByCarPark],bookingCountsByCarParkData:e.kdsData[jn.BookingCountsByCarPark]}}))(In);function Jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e,t,n,r,a,o,i,l,c,s){var u=[],d=[];try{if(a&&a.length>0){u=ie(i,l,a.length),d=a.map((function(e){return{name:e.description,color:e.color}}));var p=void 0!==a.find((function(e){return e.isTotal}));a.forEach((function(e,t){e.revenue&&e.revenue.forEach((function(n){var r=F.b(i,F.g(n.timeStart)),a=u[r];a&&(p&&!e.isTotal||(a.value+=n.totalValue),a.categoryValues[t]+=n.totalValue)}))}))}else u=ie(i,l,1);void 0===o||c.scrollGraphType!==Z.ScrollGraphType.Line&&c.scrollGraphType!==Z.ScrollGraphType.LayeredLine&&c.scrollGraphType!==Z.ScrollGraphType.LayeredArea&&c.scrollGraphType!==Z.ScrollGraphType.StackedLine&&c.scrollGraphType!==Z.ScrollGraphType.StackedArea||o.forEach((function(e){u.forEach((function(t){var n=F.g(e.timeStart);!n.isBefore(t.start)&&n.isBefore(t.end)&&(void 0===t.prediction?t.prediction={max:e.valueAudP90,expected:e.valueAudP50,min:e.valueAudP10}:(t.prediction.max+=e.valueAudP90,t.prediction.expected+=e.valueAudP50,t.prediction.min+=e.valueAudP10))}))}));var f=ce(u,t,n,r),h={graphItems:u,graphMarkers:f,categoryInfo:d,valueType:W.a.Dollars,scrollGraphType:c.scrollGraphType,showLineOfBestFit:c.showLineOfBestFit,lineOfBestFitStartColumn:c.lineOfBestFitStartMoment?F.b(i,c.lineOfBestFitStartMoment):void 0,lineOfBestFitEndColumn:c.lineOfBestFitEndMoment?F.b(i,c.lineOfBestFitEndMoment):void 0,extraLines:c.extraLines,colorBands:c.colorBands,csvDefinition:c.csvDefinition,dataStamp:s};A.b.dispatch(Z.KVSComponentActions.setScrollGraphData(e,h))}catch(m){A.b.dispatch(x.a.setError({title:"Error",message:m.message}))}}function Fn(e,t,n,r,a){if(t){var o=[];t.forEach((function(e){var t=F.g(e.date);if(!t.isBefore(n)&&t.isBefore(r)){var a=o.find((function(t){return t.group===e.group}));void 0!==a?a.value+=e.value:o.push(function(e){for(var t=1;t=0}},{key:"getWeatherDataForState",value:function(e){var t=this.state.dateScrub,n=this.props.kdsData,r=[];return n[sr.DailyWeather].filter((function(t){return t.state===e})).forEach((function(e){if(null!==e.max_temperature){var n=F.g(e.date).startOf("day");r.push({column:n.diff(t.queryStartMoment,"days"),value:Number(e.max_temperature)})}})),{label:e,axisLabel:e,points:r,valueType:W.a.Temperature,colorMapper:Object(Ve.b)(10,40),height:U.d.baseMargin}}},{key:"updateRevenueGraph",value:function(e){var t,n,r,a,o,i,l,c,s,u,d,p,f,h,m,y,g=this;return S.a.async((function(b){for(;;)switch(b.prev=b.next){case 0:if(t=this.state,n=t.dateScrub,r=t.selectedCarParkOrState,a=this.props.kdsData,o=this.props.data,i=o.schoolHolidays,l=o.publicHolidays,c=o.appVersions,s=o.carparkList,u=a[sr.RevenueGraph]){b.next=6;break}return b.abrupt("return");case 6:d=this.mergeSelectedIndividualData({revenue:u.revenue,description:"App Revenue",isTotal:!1,color:dr.app},{revenue:u.webRevenue,description:"Web Revenue",isTotal:!1,color:dr.web},{revenue:[].concat(_n()(u.revenue),_n()(u.webRevenue)),description:"Total Revenue",isTotal:!0,color:dr.total}),this.isOptionSelected(lr.Predictions)&&(p=this.mergeSelectedData(u.predictions,u.webPredictions)),f=Se.i(r,s)||[Oe.b.TAS,Oe.b.VIC,Oe.b.SA,Oe.b.ACT,Oe.b.NSW,Oe.b.WA,Oe.b.QLD,Oe.b.NT],h=[],this.isOptionSelected(lr.Covid)&&(m=se(a[sr.Covid],n.queryStartMoment,f))&&h.push(m),y=[],this.isOptionSelected(lr.Weather)&&f.forEach((function(e){y.push(g.getWeatherDataForState(e))})),Ln(ur.RevenueLineGraph,i,l,c,d,p,n.queryStartMoment,n.queryEndMoment,{scrollGraphType:jt.a.LayeredLine,showLineOfBestFit:!0,lineOfBestFitEndMoment:te().add(1,"day"),extraLines:h,colorBands:y,csvDefinition:{headers:["Date","Platform","Value in AUD"]}},e);case 14:case"end":return b.stop()}}),null,this,null,Promise)}},{key:"fetchAndUpdateRevenueGraph",value:function(e){var t,n,r,a,o,i,l,c=this;return S.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:if(t=this.state,n=t.dateScrub,r=t.selectedCarParkOrState,a=this.props.kdsData,o=a[sr.RevenueGraph],i=this.props.data.carparkList,l=r===He.b?void 0:Se.h(r,i)||[],!o||o.selectedCarParkOrState!==r){s.next=9;break}this.updateRevenueGraph(e),s.next=10;break;case 9:return s.abrupt("return",Qn.default.getKassandraRevenueData(n.queryStartMoment,n.queryEndMoment,l,r).then((function(t){c.props.dispatch(At.Actions.setKDSData(sr.RevenueGraph,t)),c.updateRevenueGraph(e)})));case 10:case"end":return s.stop()}}),null,this,null,Promise)}},{key:"renderCheckBoxes",value:function(){var e=this.state,t=e.showApp,n=e.showWeb,r=e.showTotal;return m.a.createElement(y.a,{style:{flexDirection:"row",justifyContent:"flex-end"}},m.a.createElement(rr.CheckBox,{checked:t,checkColor:dr.app,text:"App",onPress:this.onAppPress}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(rr.CheckBox,{checked:n,checkColor:dr.web,text:"Web",onPress:this.onWebPress}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(rr.CheckBox,{checked:r,checkColor:dr.total,text:"Total",onPress:this.onTotalPress}))}},{key:"updateComponentData",value:function(){var e,t,n,r,a,o,i,l,c,s,u=this,d=arguments;return S.a.async((function(p){for(;;)switch(p.prev=p.next){case 0:return e=!(d.length>0&&void 0!==d[0])||d[0],t=d.length>1&&void 0!==d[1]&&d[1],n=this.props.data,r=n.schoolHolidays,a=n.publicHolidays,o=n.appVersions,i=this.state,l=i.dateScrub,c=i.selectedCarParkOrState,s=[],e&&(s.push(j.default.tableDataRequest({database:Ne.b.dataService.covidDatabase,collection:"jhu",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.b({field:"country_region",values:["Australia"]}),Se.c({fields:["date","province_state"],firstOutputs:["date","province_state"],sumOutputs:["confirmed","deaths","recovered"]}),Se.g({field:"date"}),Se.f({outputs:["date","confirmed","deaths","recovered","province_state"]})]}}).then((function(e){var t=e.map((function(e){return or({},e,{province_state:Object(Oe.g)(e.province_state)})}));u.props.dispatch(At.Actions.setKDSData(sr.Covid,t))}))),s.push(j.default.tableDataRequest({database:Ne.b.dataService.database,collection:"daily_weather",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[]}}).then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.DailyWeather,e))}))),s.push(Promise.all([j.default.groupedDailyValue("bookings_screen_daily_revenue_by_product"),j.default.groupedDailyValue("bookings_screen_daily_revenue_by_product_web")]).then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.DailyRevenueByProductApp,e[0])),u.props.dispatch(At.Actions.setKDSData(sr.DailyRevenueByProductWeb,e[1])),de(ur.ScrubberLineGraph,e[0],r,a,o,l.queryStartMoment,l.queryEndMoment,{scrollGraphType:jt.a.Line,valueType:W.a.Dollars,showLineOfBestFit:!1})}))),s.push(Promise.all([j.default.dailyValue("summary_screen_bookings_revenue"),j.default.dailyValue("summary_screen_bookings_revenue_web")]).then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.BookingsRevenueApp,e[0])),u.props.dispatch(At.Actions.setKDSData(sr.BookingsRevenueWeb,e[1]))}))),s.push(Qn.default.getKassandraRevenueData(l.queryStartMoment,l.queryEndMoment,void 0,c).then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.RevenueGraph,e))})))),t&&(s.push(j.default.groupedDailyValue("summary_screen_purchases_refunds_amended_bookings").then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.PurchasesRefundsAmendedBookings,e))}))),s.push(j.default.dailyValue("bookings_screen_average_app_signup_purchase").then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.AverageAppSignupPurchase,e))}))),s.push(j.default.dailyValue("bookings_screen_average_book_a_bay_purchase").then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.AverageBookABayPurchase,e))}))),s.push(j.default.dailyValue("bookings_screen_average_wilsonone_purchase").then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.AverageWilsonOnePurchase,e))}))),s.push(j.default.groupedDailyValue("bookings_payment_platform").then((function(e){u.props.dispatch(At.Actions.setKDSData(sr.BookingsPaymentPlatform,e))})))),p.abrupt("return",Promise.all(s).then((function(){var e=u.getDataStampWithAllTogglesAndNoRange();u.updateRevenueGraph(e)})));case 8:case"end":return p.stop()}}),null,this,null,Promise)}},{key:"updateFetchedData",value:function(e,t,n){var r=this;return S.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:j.default.bookings({timeStart:e.toISOString(),timeEnd:t.toISOString(),limit:1e3}).then((function(e){tr.createDataTableData(ur.BookingsTable,e,{columns:[{title:"Date",field:"datetime",valueFormatter:K.Date},{title:"Hour",field:"datetime",valueFormatter:K.Hour},{title:"ID",field:"pseudoId"},{title:Ne.b.strings.Car_Park,field:"carPark"},{title:Ne.b.strings.Product,field:"product"},{title:"City",field:"city"},{title:"Value",field:"value",valueFormatter:K.Dollars}]},n)})),this.state.showMoreContent&&j.default.tableDataRequest({database:Ne.b.dataService.database,collection:"daily_bookings_by_unique_user_and_platform",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.d({start:e,end:t}),Se.b({field:"platform",values:this.getFilterValues()}),Se.c({fields:["userId"],addCount:"value"}),Se.c({fields:[],sumOutputs:["value"],addCount:"count"})]}}).then((function(n){var a=r.getDataStampWithSomeToggles(e,t);ye(ur.AverageBookingCountLabel,"Average "+Ne.b.strings.Bookings+" per "+Ne.b.strings.Booked+" User",r.getDynamicLabelDescription("The average number of "+Ne.b.strings.bookings+" per user that made at least one "+Ne.b.strings.booking+" with the "," during the selected time period."),n.length>0?n[0].value/n[0].count:0,W.a.Number,void 0,a)}));case 2:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"getDataStampWithSomeToggles",value:function(e,t){var n=this.state,r=n.showApp,a=n.showWeb,o=n.showTotal;return Object(nn.a)(e,t)+" "+r+" "+a+" "+o}},{key:"getDataStampWithSomeTogglesAndNoRange",value:function(){var e=this.state;return e.showApp+" "+e.showWeb+" "+e.showTotal}},{key:"getDataStampWithAllTogglesAndNoRange",value:function(){var e=this.state,t=e.showApp,n=e.showWeb,r=e.showTotal,a=e.selectedCarParkOrState;return this.isOptionSelected(lr.Covid)+" "+this.isOptionSelected(lr.Weather)+" "+t+" "+n+" "+r+" "+this.isOptionSelected(lr.Predictions)+" "+a}},{key:"mergeSelectedData",value:function(e,t){var n=this.state,r=n.showApp,a=n.showWeb;return n.showTotal||r&&a?e.concat(t):r?e:a?t:[]}},{key:"mergeSelectedIndividualData",value:function(e,t,n){var r=this.state,a=r.showApp,o=r.showWeb,i=r.showTotal,l=[];return a&&(l=l.concat(e)),o&&(l=l.concat(t)),i&&(l=l.concat(n)),l}},{key:"getFilterValues",value:function(){var e=this.state,t=e.showApp,n=e.showWeb,r=e.showTotal,a=[];return(t||r)&&(a.push("ANDROID"),a.push("IOS")),(n||r)&&a.push("WEB"),a}},{key:"render",value:function(){var e=this,t=this.state,n=t.dateScrub,r=t.selectedCarParkOrState;return m.a.createElement(Re.a.Screen,null,m.a.createElement(je.Group,null,m.a.createElement(wn,{dateScrub:n,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(rn,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.ScrubberLineGraph,theme:Zt}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(fn.Label,{data:{text:"State"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Re.a.FlexSpacer,null),this.renderCarparksPicker(),m.a.createElement(Re.a.SpacerDouble,null),this.renderCheckBoxes())),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(fn.Label,{data:{text:"Revenue"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Re.a.FlexSpacer,null),this.renderOptionsPicker()),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(fn.Label,{data:{text:"Daily Revenue",description:this.getDynamicLabelDescription("The total daily revenue for "+Ne.b.strings.bookings+" made with the "," during the selected time period in "+r+".")},theme:fn.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(ur.RevenueLineGraph,ur.DataStampWithAllTogglesAndNoRange,3),m.a.createElement(Re.a.SpacerDouble,null)),m.a.createElement(Re.a.SpacerDouble,null),this.state.showMoreContent?m.a.createElement(m.a.Fragment,null,m.a.createElement(je.Group,{style:{flexDirection:"row"}},m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.PurchasesLabel,dataStampKey:ur.DataStamp,style:{flex:1},theme:Zn.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.RefundsLabel,dataStampKey:ur.DataStamp,style:{flex:1},theme:Zn.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.AmendedBookingsLabel,dataStampKey:ur.DataStamp,style:{flex:1},theme:Zn.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.BookingsRevenueLabel,dataStampKey:ur.DataStampWithSomeToggles,style:{flex:1},theme:Zn.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.BookingsLabel,dataStampKey:ur.DataStampWithSomeToggles,style:{flex:1},theme:Zn.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.AverageBookingValueLabel,dataStampKey:ur.DataStampWithSomeToggles,style:{minWidth:"100%"}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.AverageBookingCountLabel,dataStampKey:ur.DataStampWithSomeToggles,style:{minWidth:"100%"}}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(fn.Label,{data:{text:"Revenue by "+Ne.b.strings.Product+" Type"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Re.a.FlexSpacer,null),this.renderProductTypePicker()),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(fn.Label,{data:{text:"Daily Revenue by "+Ne.b.strings.Product+" Type",description:this.getDynamicLabelDescription("The breakdown of daily revenue by "+Ne.b.strings.product+" type for "+Ne.b.strings.bookings+" made with the "," during the selected time period.")},theme:fn.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(ur.ProductLineGraph,ur.DataStampWithSomeToggles,2)),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:"Revenue by "+Ne.b.strings.Product+" Type",description:this.getDynamicLabelDescription("The breakdown of total revenue by "+Ne.b.strings.product+" type for "+Ne.b.strings.bookings+" made with the "," during the selected time period.")},theme:fn.LABEL_THEME_COMPONENT_CAPTION}),m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(Wn.ConnectedPieChart,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.ProductPieChart,dataStampKey:ur.DataStampWithSomeToggles}))))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"App Revenue by Payment Method"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(fn.Label,{data:{text:"Payment Revenue"},theme:fn.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(ur.PaymentTypeLineGraph,ur.DataStamp,2)),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:"App Revenue by Payment Type",description:"The breakdown of total revenue by payment type for "+Ne.b.strings.bookings+" made by the App during the selected time period."},theme:fn.LABEL_THEME_COMPONENT_CAPTION}),m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(Wn.ConnectedPieChart,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.PaymentTypePieChart,dataStampKey:ur.DataStamp}))))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"App "+Ne.b.strings.Bookings,description:"The list of all "+Ne.b.strings.bookings+" made with the App during the selected time period."},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,null,m.a.createElement(Hn.ConnectedDataTable,{kvsSelector:Z.kvsComponentSelector,dataKey:ur.BookingsTable,dataStampKey:ur.DataStamp,pageSize:10})))):m.a.createElement(Be.Button,{text:"Show More",theme:or({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){var t=!e.state.showMoreContent;e.setState({showMoreContent:t}),e.updateComponentData(!t,t).then(e.updateAfterToggle).catch((function(t){e.props.dispatch(x.a.setError({title:"Error",message:t.message}))}))}}))}}]),n}(m.a.Component),yr=Object(b.b)((function(e){return{data:e.data,kdsData:e.kdsData}}))(mr),gr=n(134);function br(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}!function(e){e.GroupedDailyErrors="MonitoringScreen Grouped Daily Errors",e.GroupedDailyUserUnexpectedErrors="MonitoringScreen Grouped Daily User Unexpected Errors",e.UserEventStream="MonitoringScreen User Event Stream",e.UserEventStreamLoginIds="MonitoringScreen User Event Stream Login Ids",e.UserEventStreamErrors="UserEventStreamErrors"}(pr||(pr={})),function(e){e.DataStamp="MonitoringScreen Data Stamp",e.ScrubberLineGraph="MonitoringScreen Scrubber Line Graph",e.ErrorBarChart="MonitoringScreen Error Bar Chart",e.ErrorsDetailTable="MonitoringScreen Error Details Table",e.UserEventStreamTable="MonitoringScreen User Event Stream"}(fr||(fr={}));var Ar=function(e){f()(n,e);var t=br(n);function n(e){var r;o()(this,n),(r=t.call(this,e)).onScrubberEvent=function(e,t,n){var a=Object(nn.a)(e,t);n!==un.Changing&&n!==un.Changed||r.props.dispatch(Z.KVSComponentActions.setDataStampData(fr.DataStamp,a)),n===un.Changed&&(!function(e,t,n,r,a,o){if(t){for(var i=Q.d.getTopGroups(t),l=[],c=n.clone();c.isBefore(r);c.add(1,"day"))l.push({label:c.format("D MMM"),value:0,color:U.a.blue,childItems:i.map((function(e){return{label:e,value:0}}))});try{var s=i.length>a.categoryCount;t.forEach((function(e){var t=F.g(e.date).diff(n,"days");if(t>=0&&t=0?l[t].childItems[r].value+=e.value:s=!0}else s=!0}));var u=l.map((function(e){return q({},e,{childItems:e.childItems.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value}))})}));s&&l.forEach((function(e){for(;e.childItems.length>=a.categoryCount;)e.childItems.pop();var t=e.childItems.reduce((function(e,t){return e+t.value}),0);e.childItems.push({label:"Other",value:e.value-t})}));var d={dataStamp:o,items:l,csvItems:u,valueType:W.a.Number,isVertical:a.isVertical,csvDefinition:a.csvDefinition};A.b.dispatch(Z.KVSComponentActions.setBarChartData(e,d))}catch(p){A.b.dispatch(x.a.setError({title:"Error",message:p.message}))}}}(fr.ErrorBarChart,r.props.kdsData[pr.GroupedDailyErrors],e,t,{categoryCount:20,isVertical:!0,csvDefinition:{headers:["Date","Error","Count"]}},a),tr.createDataTableData(fr.ErrorsDetailTable,r.props.kdsData[pr.GroupedDailyUserUnexpectedErrors],{dateFilter:{field:"event_date",startMoment:e,endMoment:t},columns:[{title:"Date",field:"event_date",valueFormatter:K.Date},{title:"Event",field:"event_name"},{title:"Error Tag",field:"error_tag"},{title:"Error",field:"error"},{title:"Count",field:"count",valueFormatter:K.Number}]},a),r.updateFetchedData(e,t,a))},r.updateUserEventStreamTableData=function(){var e=r.state,t=e.dateScrub,n=e.filterLoginId,a=e.filterError,o=r.props.kdsData[pr.UserEventStream],i=Pn(t),l=Object(nn.a)(i.startMoment,i.endMoment),c=n&&o?o.filter((function(e){return e.loginId===n})):o;tr.createDataTableData(fr.UserEventStreamTable,a&&c?c.filter((function(e){return e.error===a})):c,{columns:[{title:"Date and Time",field:"datetime",valueFormatter:K.DateTimeZone},{title:"Login Id",field:"loginId"},{title:"Event",field:"event_name"},{title:"Error Tag",field:"errorTag"},{title:"Error",field:"error"},{title:"Platform",field:"platform"},{title:"App Version",field:"version"}]},l)},r.onFilterLoginIdChange=function(e){r.setState({filterLoginId:e},r.updateUserEventStreamTableData)},r.onFilterErrorChange=function(e){r.setState({filterError:e},r.updateUserEventStreamTableData)},r.props.dispatch(Z.KVSComponentActions.clearComponentData());var a=ne({});return r.state={dateScrub:a,filterLoginId:void 0},r}return l()(n,[{key:"componentDidMount",value:function(){var e=this,t=this.state.dateScrub;this.updateComponentData().then((function(){var n=Pn(t);e.onScrubberEvent(n.startMoment,n.endMoment,un.Changed)})).catch((function(t){e.props.dispatch(x.a.setError({title:"Error",message:t.message}))}))}},{key:"updateComponentData",value:function(){var e,t,n,r,a,o,i=this;return S.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return e=this.props.data,t=e.schoolHolidays,n=e.publicHolidays,r=e.appVersions,a=this.state.dateScrub,(o=[]).push(j.default.tableDataRequest({database:M.b.dataService.database,collection:"grouped_daily_user_unexpected_errors",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.c({fields:["event_date","error"],firstOutputs:["event_date","error"],sumOutputs:["count"]}),Se.g({field:"event_date"}),Se.f({projectOutputs:[{from:"event_date",to:"date"},{from:"error",to:"group"},{from:"count",to:"value"},{from:"count",to:"count"}]})]}}).then((function(e){i.props.dispatch(At.Actions.setKDSData(pr.GroupedDailyErrors,e)),de(fr.ScrubberLineGraph,e,t,n,r,a.queryStartMoment,a.queryEndMoment,{scrollGraphType:jt.a.StackedArea,categoryCount:20,valueType:W.a.Number})}))),o.push(j.default.tableDataRequest({collection:"grouped_daily_user_unexpected_errors",database:M.b.dataService.database,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.g({field:"hour"}),Se.g({field:"event_date"})]}}).then((function(e){i.props.dispatch(At.Actions.setKDSData(pr.GroupedDailyUserUnexpectedErrors,e))}))),l.abrupt("return",Promise.all(o));case 6:case"end":return l.stop()}}),null,this,null,Promise)}},{key:"updateFetchedData",value:function(e,t,n){var r,a,o,i=this;return S.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:r=this.state,a=r.filterLoginId,o=r.filterError,j.default.tableDataRequest({database:M.b.dataService.database,collection:"user_event_stream",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.d({start:e,end:t},"datetime"),Se.g({field:"datetime"}),Se.e({limit:5e4})]}}).then((function(e){i.props.dispatch(At.Actions.setKDSData(pr.UserEventStream,e));var t=e.filter((function(e){return e.error})),n=Object(B.uniqBy)(t,(function(e){return e.loginId})).map((function(e){return e.loginId})).sort();i.props.dispatch(At.Actions.setKDSData(pr.UserEventStreamLoginIds,n));var r=Object(B.uniqBy)(t,(function(e){return e.error})).map((function(e){return e.error})).sort();i.props.dispatch(At.Actions.setKDSData(pr.UserEventStreamErrors,r)),void 0!==a&&void 0===n.find((function(e){return e===a}))&&i.setState({filterLoginId:void 0}),void 0!==o&&void 0===r.find((function(e){return e===o}))&&i.setState({filterError:void 0}),i.updateUserEventStreamTableData()})).catch((function(e){i.props.dispatch(x.a.setError({title:"Error",message:e.message}))}));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e,t,n=this.state.dateScrub,r=this.props.kdsData,a=null!=(e=r[pr.UserEventStreamLoginIds])?e:[],o=[{label:"All users",value:void 0}];a.forEach((function(e){o.push({label:e,value:e})}));var i=null!=(t=r[pr.UserEventStreamErrors])?t:[],l=[{label:"Errors",value:void 0}];return i.forEach((function(e){l.push({label:e,value:e})})),m.a.createElement(Re.a.Screen,{forceScrollbar:!0},m.a.createElement(je.Group,null,m.a.createElement(wn,{dateScrub:n,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(rn,{kvsSelector:Z.kvsComponentSelector,dataKey:fr.ScrubberLineGraph,theme:Zt}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"Top Errors",description:"The top errors for network calls"},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,{calculateHeight:!0,aspectRatio:3},m.a.createElement(gr.ConnectedBarChart,{kvsSelector:Z.kvsComponentSelector,dataKey:fr.ErrorBarChart,scrubberStartOffset:n.scrubberStartOffset,scrubberEndOffset:n.scrubberEndOffset,legend:!0,dataStampKey:fr.DataStamp}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"Errors",description:"The list of all errors made with the App during the selected time period."},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,null,m.a.createElement(Hn.ConnectedDataTable,{kvsSelector:Z.kvsComponentSelector,dataKey:fr.ErrorsDetailTable,dataStampKey:fr.DataStamp,pageSize:10}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(fn.Label,{data:{text:"User Event Stream",description:"The list of user events from the App during the selected time period optionally filtered by a user's login id. Note that only users who generated at least one error in the selected time period will be shown in the picker."},style:{flex:1},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ce.PickerBox,{placeholder:"Filter by Login Id?",items:o,style:{flex:1},selectedValue:this.state.filterLoginId,onValueChange:this.onFilterLoginIdChange}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ce.PickerBox,{placeholder:"Filter by error?",items:l,style:{flex:1},selectedValue:this.state.filterError,onValueChange:this.onFilterErrorChange})),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,null,m.a.createElement(Hn.ConnectedDataTable,{kvsSelector:Z.kvsComponentSelector,dataKey:fr.UserEventStreamTable,dataStampKey:fr.DataStamp,pageSize:10}))))}}]),n}(m.a.Component),Er=Object(b.b)((function(e){return{data:e.data,kdsData:e.kdsData}}))(Ar),vr=n(109);function Sr(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var kr={DailyRatingsByCarPark:"SurveysScreen Daily Ratings By "+Ne.b.strings.Car_Park,DailyBookingsRevenueByStateAndCarParkApp:"SurveyScreen Daily "+Ne.b.strings.Bookings+" Revenue By State"},Tr={DataStamp:"SurveysScreen Data Stamp",ScrubberGraph:"SurveysScreen Scrubber Graph",AverageRatingLabel:"SurveysScreen Average Rating Label",BookingPercentageWithRatingLabel:"SurveysScreen "+Ne.b.strings.Booking+" Percentage With Rating Label",PositiveFeedbackCountLabel:"SurveysScreen Positive Feedback Count Label",PositiveFeedbackBarChart:"SurveysScreen Positive Feedback Bar Chart",NegativeFeedbackCountLabel:"SurveysScreen Negative Feedback Count Label",NegativeFeedbackBarChart:"SurveysScreen Negative Feedback Bar Chart",HighestRatedCarParksTable:"SurveysScreen Highest Rated "+Ne.b.strings.Car_Parks+" Table",LowestRatedCarParksTable:"SurveysScreen Lowest Rated "+Ne.b.strings.Car_Parks+" Table"},Or=function(e){f()(n,e);var t=Sr(n);function n(e){var r;return o()(this,n),(r=t.call(this,e)).refreshComponents=function(){var e=Pn(r.state.dateScrub);r.onScrubberEvent(e.startMoment,e.endMoment,un.Changed)},r.onScrubberEvent=function(e,t,n){var a=r.props.carParkList,o=r.state.filter,i=r.getDataStamp(e,t,o);if(n!==un.Changing&&n!==un.Changed||r.props.dispatch(Z.KVSComponentActions.setDataStampData(Tr.DataStamp,i)),n===un.Changed){var l=Object(Se.h)(o,a),c=r.props.kdsData[kr.DailyRatingsByCarPark];Ae({key:Tr.AverageRatingLabel,title:"Average Rating",description:"The average user rating for the selected "+Ne.b.strings.car_park+"(s) over the selected time period. Users rate their "+Ne.b.strings.parking+" experience from 1 to 5.",data:c,groupFilter:l,startMoment:e,endMoment:t,valueType:W.a.Number,calculationType:re.Average,showCount:{suffix:" Ratings"},calculatePercentageChange:!0,dataStamp:i});var s=r.props.kdsData[kr.DailyBookingsRevenueByStateAndCarParkApp]||void 0,u=r.calculateTotalCount(s,e,t,l,"car_park_name","datetime"),d=r.calculateTotalCount(c,e,t,l,"group","date");ye(Tr.BookingPercentageWithRatingLabel,Ne.b.strings.Bookings+" with a Rating","The percentage of "+Ne.b.strings.bookings+" that were given a rating for the selected "+Ne.b.strings.car_park+"(s) over the selected time period.",u>d&&u>0?100*d/u:0,W.a.Percent,void 0,i),ve(Tr.HighestRatedCarParksTable,r.props.kdsData[kr.DailyRatingsByCarPark],e,t,!1,l,i),ve(Tr.LowestRatedCarParksTable,c,e,t,!0,l,i),r.updateFetchedData(e,t,i,l)}},r.onCarparkPicker=function(e){r.setState({filter:e},r.refreshComponents)},r.renderBarChart=function(e){var t=r.state.dateScrub;return m.a.createElement(Tt,{calculateHeight:!0,aspectRatio:1.5},m.a.createElement(gr.ConnectedBarChart,{kvsSelector:Z.kvsComponentSelector,dataKey:e,dataStampKey:Tr.DataStamp,scrubberStartOffset:t.scrubberStartOffset,scrubberEndOffset:t.scrubberEndOffset}))},r.renderGraphFilterPicker=function(){var e=r.props.data.carparkList,t=r.state.filter;return m.a.createElement(y.a,{style:{flexDirection:"row",justifyContent:"space-between"}},m.a.createElement(Ce.PickerBox,{placeholder:He.a,items:[{label:He.a,value:He.a}].concat(_n()(e.map((function(e){return{label:e.name,value:e.name}})))),selectedValue:r.state.filter,onValueChange:r.onCarparkPicker,style:{flex:1}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ce.PickerBox,{placeholder:He.b,items:[{label:He.b,value:He.b}].concat(_n()(Oe.e.map((function(e){return{label:e,value:e}})))),selectedValue:r.state.filter,onValueChange:r.onCarparkPicker,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(vr.InfoButton,{title:"Filtering Results",description:r.getGraphFilterDescription(t)}))},r.getRatingsTheme=function(e){return e>=4?Zn.VALUE_LABEL_THEME_HUGE_GREEN_CENTERED:e>=2?Zn.VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED:e>=1?Zn.VALUE_LABEL_THEME_HUGE_RED_CENTERED:Zn.VALUE_LABEL_THEME_HUGE_GREY_CENTERED},r.props.dispatch(Z.KVSComponentActions.clearComponentData()),r.state={dateScrub:ne({}),filter:He.a},r}return l()(n,[{key:"componentDidMount",value:function(){var e=this;this.updateComponentData().then((function(t){var n=Pn(e.state.dateScrub);e.onScrubberEvent(n.startMoment,n.endMoment,un.Changed)}))}},{key:"updateComponentData",value:function(){var e,t,n,r,a,o,i=this;return S.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return e=this.props.data,t=e.schoolHolidays,n=e.publicHolidays,r=e.appVersions,a=this.state.dateScrub,(o=[]).push(j.default.groupedDailyValue("daily_rating_counts_by_rating").then((function(e){de(Tr.ScrubberGraph,e,t,n,r,a.queryStartMoment,a.queryEndMoment,{categoryList:["1","2","3","4","5"],scrollGraphType:jt.a.StackedArea,valueType:W.a.Number})}))),o.push(j.default.groupedDailyValue("ratings_screen_daily_ratings_by_carpark").then((function(e){i.props.dispatch(At.Actions.setKDSData(kr.DailyRatingsByCarPark,e))}))),o.push(j.default.tableData("daily_bookings_revenue_by_state_and_carpark_app").then((function(e){i.props.dispatch(At.Actions.setKDSData(kr.DailyBookingsRevenueByStateAndCarParkApp,e))}))),l.abrupt("return",Promise.all(o));case 7:case"end":return l.stop()}}),null,this,null,Promise)}},{key:"getDataStamp",value:function(e,t,n){return Object(nn.a)(e,t)+" "+n}},{key:"updateFetchedData",value:function(e,t,n,r){var a=this;return S.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:j.default.feedback({collectionKey:"ratings_screen_daily_feedback_by_type_and_carpark",start:e,end:t,categories:r}).then((function(r){var o=r&&r.filter((function(e){return 5===e.value})),i=r&&r.filter((function(e){return e.value<=4})),l=he(o,e,t,void 0,re.Count),c=he(i,e,t,void 0,re.Count),s=Math.max(l,c);a.props.dispatch(Z.KVSComponentActions.setLabelData(Tr.PositiveFeedbackCountLabel,{text:(o?o.length:0)+" Positive Rating Attributes"})),me(Tr.PositiveFeedbackBarChart,o,e,t,{categoryCount:5,calculation:re.Count,sortBy:"value",invertValence:!1,defaultMaxValue:s,csvDefinition:{headers:["Response","Count"]}},n),a.props.dispatch(Z.KVSComponentActions.setLabelData(Tr.NegativeFeedbackCountLabel,{text:(i?i.length:0)+" Negative Rating Attributes"})),me(Tr.NegativeFeedbackBarChart,i,e,t,{categoryCount:5,calculation:re.Count,sortBy:"value",invertValence:!1,defaultMaxValue:s,csvDefinition:{headers:["Response","Count"]}},n)}));case 1:case"end":return o.stop()}}),null,null,null,Promise)}},{key:"calculateTotalCount",value:function(e,t,n,r,a,o){var i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"count",l=0;return e&&e.forEach((function(e){if(void 0===r||void 0!==r.find((function(t){return t===e[a]}))){var c=F.g(e[o]);!c.isBefore(t)&&c.isBefore(n)&&(l+=e[i])}})),l}},{key:"getGraphFilterDescription",value:function(e){return void 0===e||e===He.a?"Results include "+Ne.b.strings.bookings+" for all "+Ne.b.strings.car_parks+" in Australia.":void 0!==Oe.e.find((function(t){return t===e}))?"Results include "+Ne.b.strings.bookings+" for any "+Ne.b.strings.car_park+" in "+e+".":"Results are for "+Ne.b.strings.bookings_at+" "+e+"."}},{key:"render",value:function(){var e=this.state.dateScrub;return m.a.createElement(y.a,{style:{minWidth:U.d.minPageWidth,backgroundColor:U.a.pageBackground,padding:U.d.doubleBaseMargin}},m.a.createElement(je.Group,null,m.a.createElement(wn,{dateScrub:e,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(rn,{kvsSelector:Z.kvsComponentSelector,dataKey:Tr.ScrubberGraph,theme:Zt})),!Ne.b.isDemo&&m.a.createElement(Re.a.SpacerDouble,null),!Ne.b.isDemo&&this.renderGraphFilterPicker()),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"Ratings"},style:{flex:1},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Tr.AverageRatingLabel,dataStampKey:Tr.DataStamp,style:{maxWidth:250,minHeight:140},theme:this.getRatingsTheme}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Zn.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Tr.BookingPercentageWithRatingLabel,dataStampKey:Tr.DataStamp,style:{maxWidth:250},theme:Zn.VALUE_LABEL_THEME_MEDIUM_CENTERED})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:"Positive Rating Attributes",description:"The breakdown of the positive feedback that was recieved for the selected "+Ne.b.strings.car_park+"(s) over the selected time period."},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(fn.ConnectedLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Tr.PositiveFeedbackCountLabel,theme:fn.LABEL_THEME_LIGHT}),m.a.createElement(Re.a.Spacer,null),this.renderBarChart(Tr.PositiveFeedbackBarChart)),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:"Negative Rating Attributes",description:"The breakdown of the negative feedback that was recieved for the selected "+Ne.b.strings.car_park+"(s) over the selected time period."},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(fn.ConnectedLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Tr.NegativeFeedbackCountLabel,theme:fn.LABEL_THEME_LIGHT}),m.a.createElement(Re.a.Spacer,null),this.renderBarChart(Tr.NegativeFeedbackBarChart)))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:"Highest Rated "+Ne.b.strings.Car_Parks,description:"The top ranked "+Ne.b.strings.car_parks+" based on the user feedback for the selected "+Ne.b.strings.car_park+"(s) over the selected time period. Rating is the average rating and count is the number of ratings made for that "+Ne.b.strings.car_park+"."},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,{style:{width:"100%"}},m.a.createElement(Hn.ConnectedDataTable,{kvsSelector:Z.kvsComponentSelector,dataKey:Tr.HighestRatedCarParksTable,dataStampKey:Tr.DataStamp,pageSize:10}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:"Lowest Rated "+Ne.b.strings.Car_Parks,description:"The worst ranked "+Ne.b.strings.car_parks+" based on the user feedback from the selected "+Ne.b.strings.car_park+"(s) over the selected time period. Rating is the average rating and count is the number of ratings made for that "+Ne.b.strings.car_park+"."},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,{style:{width:"100%"}},m.a.createElement(Hn.ConnectedDataTable,{kvsSelector:Z.kvsComponentSelector,dataKey:Tr.LowestRatedCarParksTable,dataStampKey:Tr.DataStamp,pageSize:10}))))))}}]),n}(m.a.Component),Rr=Object(b.b)((function(e){return{kdsData:e.kdsData,data:e.data,carParkList:V.DataSelectors.carParkList(e)}}))(Or),Cr=n(197),Ur=n(138),Dr=n(34),Pr=n.n(Dr);function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mr(e){for(var t=1;t0)for(var n=e.length-1;n>=0;n--){var r=e[n],a={date:r.dateTime,value:r.averageUserRatingForCurrentVersion*r.userRatingCountForCurrentVersion,count:r.userRatingCountForCurrentVersion};if(n0)for(var n=e.length-1;n>=0;n--){var r=e[n],a={date:r.date,value:r.totalRating,count:r.count};if(n0&&(u=100*s.value/c.value);var d={title:"Percent Used",description:"The total promo codes used as a percentage of the total sent for the date range",value:u,valueType:W.a.Percent,dataStamp:a};r.props.dispatch(Z.KVSComponentActions.setValueLabelData(Ta(ga.PromoPercentUsedValue,i),d))}))}},r.renderUploadSection=function(e){var t=r.state.fileDisplay[e.campaignId]||!1;return m.a.createElement(ht.a,{visible:t},m.a.createElement(Re.a.Spacer,null),m.a.createElement(y.a,{style:{flex:1,borderColor:U.a.lightGrey,borderRadius:U.d.borderRadius,borderWidth:1,marginRight:U.d.baseMargin,padding:U.d.baseMargin}},r.renderFileTable(e),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(Be.Button,{text:"Upload",theme:Sa({},Be.SOLID_BUTTON_THEME,{backgroundColor:U.a.blue}),onPress:function(){return r.selectFile(e.campaignId)}}))))},r.renderFileTable=function(e){var t;return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"flex-end"}},m.a.createElement(y.a,{style:{minWidth:400,flex:1,flexDirection:"row"}},m.a.createElement(R.a,{style:z.b.black.bodyM.bold},"Code Files")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:[{width:150},z.b.black.bodyS.bold]},"Initial Count"),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:[{width:150},z.b.black.bodyS.bold]},"Remaining"),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{width:60}},m.a.createElement(R.a,{style:[z.b.black.bodyS.bold,{textAlign:"center"}]},"Delete"))),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Re.a.HorizontalLine,null),null==(t=e.codeFiles)?void 0:t.map((function(t){return m.a.createElement(y.a,{key:e.campaignId+"_"+t.fileName},m.a.createElement(Re.a.Spacer,null),m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(y.a,{style:{flex:1,minWidth:400,flexDirection:"row"}},m.a.createElement(R.a,{style:{marginLeft:U.d.doubleBaseMargin}},t.fileName)),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:{width:150}},t.initialCount),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:{width:150}},t.remainingCount),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{width:60,flexDirection:"row"}},m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(Me.a,{onPress:function(){return r.checkDeleteCodeFile(e,t)}},m.a.createElement(G.a,{source:U.c.close,style:{tintColor:U.a.red,height:U.d.icons.medium,width:U.d.icons.medium}})),m.a.createElement(Re.a.FlexSpacer,null))),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Re.a.HorizontalLine,null),m.a.createElement(Re.a.Spacer,null))})))},r.alertCloseHandler=function(){r.setState({alert:{show:!1}})},r.checkDeleteCodeFile=function(e,t){r.setState({alert:{show:!0,title:"Are you sure?",onClose:r.alertCloseHandler,message:"Do you want to delete code file ("+t.fileName+")",buttons:[{text:"Cancel"},{text:"Delete",theme:Be.ERROR_BUTTON_THEME,onPress:function(){r.onDeleteCodeFile(e,t)}}]}})},r.onDeleteCodeFile=function(e,t){var n=Sa({},r.state.showProgressIndicator);n[e.campaignId]=!0,r.setState({showProgressIndicator:n}),ca.default.deleteCodeFile({campaignId:e.campaignId,file:t.fileName},r.state.useProdPromoService).then((function(t){setTimeout((function(){r.updateKVSComponentKeys().then((function(){var t=Sa({},r.state.showProgressIndicator);t[e.campaignId]=!1,r.setState({showProgressIndicator:t})}))}),1e3)}))},r.selectFile=function(e){Aa.a({type:"text/csv"}).then((function(t){if("success"===t.type){var n=Sa({},r.state.showProgressIndicator);n[e]=!0,r.setState({showProgressIndicator:n});var a={campaignId:e,file:t.file};ca.default.uploadCodeFile(a,r.state.useProdPromoService).then((function(n){if(n.success)setTimeout((function(){r.updateKVSComponentKeys().then((function(){var t=Sa({},r.state.showProgressIndicator);t[e]=!1,r.setState({showProgressIndicator:t})}))}),1e3);else{var a,o=Sa({},r.state.showProgressIndicator);o[e]=!1,r.setState({showProgressIndicator:o,alert:{show:!0,title:"Failed to upload file: "+(null==(a=t.file)?void 0:a.name),message:n.message,onClose:r.alertCloseHandler,buttons:[{text:"OK"}]}})}}))}}))},r.onCloseEditCampaign=function(){r.setState({editingCampaign:void 0})},r.onSaveCampaignDetails=function(e){var t;return S.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return(t=Sa({},r.state.showProgressIndicator))[e.campaignId]=!0,r.setState({showProgressIndicator:t}),n.abrupt("return",ca.default.setCampaign(e,r.state.useProdPromoService).then((function(t){var n=r.props.kdsData[ya.PromoAdminCampaigns],a=n.findIndex((function(t){return t.campaignId===e.campaignId}));n[a]=e,r.props.dispatch(At.Actions.setKDSData(ya.PromoAdminCampaigns,n));var o=Sa({},r.state.showProgressIndicator);o[e.campaignId]=!1,r.setState({showProgressIndicator:o})})).catch((function(){r.props.dispatch(x.a.setError({title:"Error",message:"Something went wrong."})),t[e.campaignId]=!1,r.setState({showProgressIndicator:t})})));case 4:case"end":return n.stop()}}),null,null,null,Promise)},r.props.dispatch(Z.KVSComponentActions.clearComponentData());var a=te().subtract(364,"days"),i=J.a.utc("2020-09-01T00:00:00Z"),l=ne({queryEndMoment:te().add(32,"days"),scrubberStartMoment:J.a.max(i,a)});return r.state={dateScrub:l,editingCampaign:void 0,showProgressIndicator:{},useProdPromoService:M.b.configType===M.a.Production,fileDisplay:{},alert:{show:!1}},r}return l()(n,[{key:"componentDidMount",value:function(){this.updateKVSComponentKeys()}},{key:"updateKVSComponentKeys",value:function(){var e,t=this;return S.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return(e=[]).push(ca.default.getAllCampaigns(this.state.useProdPromoService).then((function(e){var n=function(e){var t=0;switch(e.campaignType){case ba.c.RewardPeriodic:t+=30;break;case ba.c.ReferralReward:t+=20;break;case ba.c.ReferralBooking:t+=10}return e.campaignActive&&(t+=1),t};return e=e.sort((function(e,t){return n(t)-n(e)})),t.props.dispatch(At.Actions.setKDSData(ya.PromoAdminCampaigns,e)),t.onCampaignsFetched(e)}))),n.abrupt("return",Promise.all(e).then((function(){var e=Pn(t.state.dateScrub);t.onScrubberEvent(e.startMoment,e.endMoment,un.Changed)})).catch((function(e){t.props.dispatch(x.a.setError({title:"Error",message:e.message}))})));case 3:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"onCampaignsFetched",value:function(e){var t,n,r,a,o,i=this;return S.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return t=this.props.data,n=t.schoolHolidays,r=t.publicHolidays,a=t.appVersions,o=this.state.dateScrub,l.abrupt("return",j.default.dailyMultiValueToGroupedDailyValue("promo_campaign_stats_daily",["Sent","Used"],["count_sent","count_used"],void 0,["campaign_id"]).then((function(t){i.props.dispatch(At.Actions.setKDSData(ya.PromoStatsGroupedDaily,t)),de(ga.Scrubber,t,n,r,a,o.queryStartMoment,o.queryEndMoment,{categoryCount:2,scrollGraphType:jt.a.LayeredArea,valueType:W.a.Number}),e&&e.forEach((function(e){var l=e.campaignId,c=t.filter((function(e){return e.campaign_id==l}));de(Ta(ga.PromoStatsGraph,l),c,n,r,a,o.queryStartMoment,o.queryEndMoment,{categoryCount:2,scrollGraphType:jt.a.LayeredArea,valueType:W.a.Number});var s={title:"Total Remaining",description:"The total promo codes remaining in this campaign",value:i.getTotalRemainingCodes(e),valueType:W.a.Number};i.props.dispatch(Z.KVSComponentActions.setValueLabelData(Ta(ga.PromoCountRemainingValue,l),s))}))})));case 3:case"end":return l.stop()}}),null,this,null,Promise)}},{key:"getTotalRemainingCodes",value:function(e){var t=0;return e.codeFiles&&e.codeFiles.forEach((function(e){t+=e.remainingCount||0})),t}},{key:"render",value:function(){var e=this,t=this.state,n=t.dateScrub,r=(t.useProdPromoService,this.props.kdsData[ya.PromoAdminCampaigns]);return m.a.createElement(y.a,{style:{minWidth:U.d.minPageWidth,backgroundColor:U.a.pageBackground,padding:U.d.doubleBaseMargin}},m.a.createElement(je.Group,null,m.a.createElement(wn,{dateScrub:n,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(rn,{kvsSelector:Z.kvsComponentSelector,dataKey:ga.Scrubber,theme:Zt})),!1),r&&r.map((function(t){return e.renderCampaign(t)})),this.state.editingCampaign&&m.a.createElement(pa,{campaign:this.state.editingCampaign,editing:!0,onSaveCampaign:this.onSaveCampaignDetails,onClose:this.onCloseEditCampaign}),m.a.createElement(Ea.b,{show:this.state.alert.show,title:this.state.alert.title,message:this.state.alert.message,buttons:this.state.alert.buttons,onClose:this.state.alert.onClose}))}},{key:"renderCampaign",value:function(e){var t=this.state.dateScrub,n=e.campaignId,r=this.state.showProgressIndicator[e.campaignId];return m.a.createElement(y.a,{key:n,style:{marginTop:U.d.doubleBaseMargin}},m.a.createElement(y.a,null,m.a.createElement(je.Group,null,m.a.createElement(Z.Label,{data:{text:e.campaignName,description:"Count of sent and used promotion codes for the "+e.campaignName+" campaign"},theme:Z.LABEL_THEME_TITLE}),m.a.createElement(Tt,{calculateHeight:!0,aspectRatio:3},m.a.createElement(y.a,{style:{flexDirection:"row"}},this.renderCampaignDetails(e),m.a.createElement(y.a,{style:{flex:3}},m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(rn,{kvsSelector:Z.kvsComponentSelector,dataKey:Ta(ga.PromoStatsGraph,n),scrubberStartOffset:t.scrubberStartOffset,scrubberEndOffset:t.scrubberEndOffset,theme:Wt})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(Z.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Ta(ga.PromoCountSentValue,n),dataStampKey:ga.DataStamp,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Z.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Ta(ga.PromoCountUsedValue,n),dataStampKey:ga.DataStamp,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Z.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Ta(ga.PromoPercentUsedValue,n),dataStampKey:ga.DataStamp,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Z.ConnectedValueLabel,{kvsSelector:Z.kvsComponentSelector,dataKey:Ta(ga.PromoCountRemainingValue,n),style:{flex:1}}))))),this.renderUploadSection(e))),r&&m.a.createElement(y.a,{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:U.a.lightGrey,opacity:.7}},m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(g.a,{style:{flex:2}}),m.a.createElement(Re.a.FlexSpacer,null)))}},{key:"renderCampaignDetails",value:function(e){var t=this,n=this.state.fileDisplay[e.campaignId]||!1,r=e.campaignActive,a=e.campaignHidden;return m.a.createElement(y.a,{style:{flex:1,borderColor:U.a.lightGrey,borderRadius:U.d.borderRadius,borderWidth:1,marginRight:U.d.baseMargin,padding:U.d.baseMargin}},m.a.createElement(y.a,{style:{flexDirection:"row"}},r&&m.a.createElement(R.a,{style:z.b.green.bodyS.bold},"Active"),!r&&m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"Inactive"),m.a.createElement(Re.a.Spacer,null),a&&m.a.createElement(R.a,{style:z.b.grey.bodyS.bold},"Hidden"),m.a.createElement(Re.a.FlexSpacer,null),this.props.canEdit&&m.a.createElement(Me.a,{onPress:function(){t.setState({editingCampaign:e})}},m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(Re.a.Icon,{source:U.c.edit,size:U.d.icons.small}),m.a.createElement(Re.a.Spacer,null))),m.a.createElement(Me.a,{onPress:function(){var r=Sa({},t.state.fileDisplay);r[e.campaignId]=!n,t.setState({fileDisplay:r})}},m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(Re.a.Icon,{source:U.c.promo,size:U.d.icons.small,tintColor:U.a.black})))),m.a.createElement(Re.a.Spacer,null),m.a.createElement(C.a,null,[this.renderLabeledValue("Description",e.campaignDescription),this.renderLabeledValue("Short Description",e.campaignShortDescription),this.renderLabeledValue("Share Description",e.campaignShareDescription||""),this.renderLabeledValue("Reward Label",e.campaignRewardLabel),this.renderLabeledValue("End Date",J()(e.campaignEndDate).format("DD/MM/yyyy")),this.renderLabeledValue("Terms and Conditions",e.campaignTermsAndConditions),this.renderLabeledValue("Codes Title",e.promoCodeTitle),this.renderLabeledValue("Codes Description",e.promoCodeDescription),this.renderLabeledValue("Codes All Expire",J()(e.promoCodeExpiry).format("DD/MM/yyyy")),this.renderLabeledValue("Codes Valid Days",e.promoCodeValidDays.toString()),e.rewardBookingsTarget&&this.renderLabeledValue("Reward Bookings",e.rewardBookingsTarget.toString()),e.rewardDaysWindow&&e.campaignType===ba.c.RewardRolling&&this.renderLabeledValue("Reward Days",e.rewardDaysWindow.toString()),e.rewardMaxPromosInPeriod&&e.campaignType===ba.c.RewardPeriodic&&this.renderLabeledValue("Max Promos in Period",e.rewardMaxPromosInPeriod.toString())]),m.a.createElement(Re.a.Spacer,null))}},{key:"renderLabeledValue",value:function(e,t){if(t)return m.a.createElement(y.a,{key:e},m.a.createElement(R.a,{style:z.b.black.bodyXS.bold},e),m.a.createElement(R.a,{style:z.b.black.bodyXS.regular},t),m.a.createElement(Re.a.Spacer,null))}}]),n}(m.a.Component),Ra=Object(b.b)((function(e){var t=e.user.userDetails,n=!!t&&t.role===P.e.administrator;return{data:e.data,kdsData:e.kdsData,canEdit:n}}))(Oa),Ca=n(542),Ua=n.n(Ca);function Da(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Pa,wa,Ma=n(716),xa=function(e){f()(n,e);var t=Da(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){return m.a.createElement(Ua.a,{originWhitelist:["*"],source:{html:U.d.isWeb?Ma:"

Information about Kassandra

"},style:{flex:1,padding:U.d.doubleBaseMargin},scrollEnabled:!1})}}]),n}(m.a.Component),Va=n(160);!function(e){e.DailyBookingsRevenueByPlatform="PlatformScreen Daily Bookings Revenue By Platform"}(Pa||(Pa={})),function(e){e.DataStamp="PlatformScreen Data Stamp",e.ScrubberGraph="PlatformScreen Scrubber Graph",e.OSVersionPieChart="PlatformScreen OS Version Pie Chart",e.AndroidVersionPieChart="PlatformScreen Android Version Pie Chart",e.IOSVersionPieChart="PlatformScreen iOS Version Pie Chart",e.AppVersionPieChart="PlatformScreen App Version Pie Chart",e.PlatformPieChart="PlatformScreen Platform Pie Chart",e.MobileModelBarChart="PlatformScreen Mobile Model Bar Chart",e.BookingValuePieChart="PlatformScreen Booking Value Pie Chart"}(wa||(wa={}));function ja(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Ba=function(e){f()(n,e);var t=ja(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(e){Object(B.isEqual)(e,this.props)||this.update()}},{key:"update",value:function(){var e,t,n,r,a;return S.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=this.props,t=e.dailyData,n=e.groupedDailyData,r=e.dateScrub,a=e.calendarEvents,void 0===t){o.next=3;break}return o.abrupt("return",ue(wa.ScrubberGraph,t,null==a?void 0:a.schoolHolidays,null==a?void 0:a.publicHolidays,null==a?void 0:a.appVersions,r.queryStartMoment,r.queryEndMoment,{scrollGraphType:jt.a.Line,valueType:W.a.Number,showLineOfBestFit:!1}));case 3:if(void 0===n){o.next=5;break}return o.abrupt("return",de(wa.ScrubberGraph,n,null==a?void 0:a.schoolHolidays,null==a?void 0:a.publicHolidays,null==a?void 0:a.appVersions,r.queryStartMoment,r.queryEndMoment,{categoryList:["IOS","ANDROID"],scrollGraphType:jt.a.StackedArea,valueType:W.a.Dollars}));case 5:case"end":return o.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e=this.props,t=e.dateScrub,n=e.lastImported,r=e.onScrubberEvent;return m.a.createElement(je.Group,null,m.a.createElement(wn,{dateScrub:t,label:n,onEvent:r},m.a.createElement(rn,{kvsSelector:Z.kvsComponentSelector,dataKey:wa.ScrubberGraph,theme:Zt})))}}]),n}(m.a.PureComponent),Ia=n(93),Na=n(54);function Ja(e,t,n,r){var a=[Na.c({start:e,end:t},"date")];return r&&a.push(Na.a(r)),a.push(Na.b({fields:["userId",n],firstOutputs:["date",n]})),a.push(Na.b({fields:[n],firstOutputs:["date",n],addCount:"value"})),a.push(Na.f({outputs:["date","value"],projectOutputs:[{from:n,to:"group"},{from:"value",to:"count"}]})),Ia.QueryService.tableDataRequest({database:Ne.b.dataService.database,collection:"platform_unique_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:a}})}function La(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Fa=function(e){f()(n,e);var t=La(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"componentDidUpdate",value:function(e){var t=this.props.dataSync;void 0!==t&&(void 0!==e.dataSync&&e.dataSync.dataStamp===t.dataStamp||this.update(t))}},{key:"update",value:function(e){var t=this;return S.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Ja(e.startMoment,e.endMoment,this.props.field,this.props.filter).then((function(n){pe(t.props.kvsComponentKey,n,e.startMoment,e.endMoment,{categoryCount:10,valueType:W.a.Number,csvDefinition:{headers:t.props.csvHeaders}},e.dataStamp)})));case 1:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){return m.a.createElement(je.Group,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:this.props.title,description:this.props.description},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,{style:{maxHeight:400},aspectRatio:1.5,calculateHeight:!0},m.a.createElement(Wn.ConnectedPieChart,{kvsSelector:Z.kvsComponentSelector,dataKey:this.props.kvsComponentKey,dataStampKey:wa.DataStamp,legendTheme:Nt.c})))}}]),n}(m.a.PureComponent);function Wa(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.AndroidVersionPieChart,title:"Android Version",description:"The breakdown of the Android operating system version of devices used to access the app over the selected time period.",field:"mobileOSVersion",filter:{field:"platform",values:["ANDROID"]},csvHeaders:["Android Version","User Count"]})}function Za(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.IOSVersionPieChart,title:"iOS Version",description:"The breakdown of the iOS operating system version of devices used to access the app over the selected time period.",field:"mobileOSVersion",filter:{field:"platform",values:["IOS"]},csvHeaders:["iOS Version","User Count"]})}function Ha(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.PlatformPieChart,title:"Platform",description:"The breakdown of the mobile platform being used to access the app over the selected time period.",field:"platform",csvHeaders:["Mobile Platform","User Count"]})}function Qa(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.AppVersionPieChart,title:"App Version",description:"The breakdown of the app version being used over the selected time period. This shows results for both iOS and Android devices.",field:"appVersion",csvHeaders:["App Version","User Count"]})}function Ga(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var za=function(e){f()(n,e);var t=Ga(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"componentDidUpdate",value:function(e){var t=this.props.dataSync;void 0!==t&&(void 0!==e.dataSync&&e.dataSync.dataStamp===t.dataStamp||this.update(t))}},{key:"update",value:function(e){return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ja(e.startMoment,e.endMoment,"mobileModel",this.props.filter).then((function(t){me(wa.MobileModelBarChart,t,e.startMoment,e.endMoment,{categoryCount:20,addOtherCategory:!0,calculation:re.Sum,sortBy:"value",invertValence:!1,csvDefinition:{headers:["Phone Model","Count"]}},e.dataStamp)})));case 1:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e=this.props.dateScrub;return m.a.createElement(je.Group,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:"Phone Models",description:this.props.description||"The breakdown of the mobile phone models used to access the app over the selected time period. This shows results for both iOS and Android devices."},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,{style:{minHeight:500,flex:1}},m.a.createElement(gr.ConnectedBarChart,{kvsSelector:Z.kvsComponentSelector,dataKey:wa.MobileModelBarChart,dataStampKey:wa.DataStamp,scrubberStartOffset:e.scrubberStartOffset,scrubberEndOffset:e.scrubberEndOffset})))}}]),n}(m.a.PureComponent);function Ya(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Ka=function(e){f()(n,e);var t=Ya(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"componentDidUpdate",value:function(e){var t=this.props.dataSync;void 0!==t&&(void 0!==e.dataSync&&e.dataSync.dataStamp===t.dataStamp||this.update(t))}},{key:"update",value:function(e){var t;return S.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=this.props.data,n.abrupt("return",pe(wa.BookingValuePieChart,t,e.startMoment,e.endMoment,{categoryCount:10,valueType:W.a.Dollars,csvDefinition:{headers:this.props.csvHeaders}},e.dataStamp));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){return m.a.createElement(je.Group,{style:{flex:1}},m.a.createElement(fn.Label,{data:{text:this.props.title,description:this.props.description},theme:fn.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,{style:{maxHeight:400},aspectRatio:1.5,calculateHeight:!0},m.a.createElement(Wn.ConnectedPieChart,{kvsSelector:Z.kvsComponentSelector,dataKey:this.props.kvsComponentKey,dataStampKey:wa.DataStamp,legendTheme:Nt.c})))}}]),n}(m.a.PureComponent);function Xa(e){return m.a.createElement(Ka,{dataSync:e.dataSync,data:e.data,kvsComponentKey:wa.BookingValuePieChart,title:Ne.b.strings.Booking+" Value Per Platform",description:"The breakdown of "+Ne.b.strings.booking+" value based on the mobile platform used to make the "+Ne.b.strings.booking+" (iOS or Android).",csvHeaders:["Mobile Platform","Value in AUD"]})}function qa(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var _a=function(e){f()(n,e);var t=qa(n);function n(e){var r;return o()(this,n),(r=t.call(this,e)).onScrubberEvent=function(e,t,n){if(n===un.Changing||n===un.Changed){var a=Object(nn.a)(e,t);r.props.dispatch(Z.KVSComponentActions.setDataStampData(wa.DataStamp,a)),n===un.Changed&&r.setState({dataSync:{startMoment:e,endMoment:t,dataStamp:a}})}},r.props.dispatch(Z.KVSComponentActions.clearComponentData()),r.state={dateScrub:ne({})},r}return l()(n,[{key:"componentDidMount",value:function(){var e=this,t=this.state.dateScrub;this.updateComponentData().then((function(){var n=Pn(t);e.onScrubberEvent(n.startMoment,n.endMoment,un.Changed)})).catch((function(t){e.props.dispatch(x.a.setError({title:"Error",message:t.message}))}))}},{key:"updateComponentData",value:function(){var e,t=this;return S.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return(e=[]).push(Va.a.groupedDailyValue("daily_bookings_revenue_by_platform").then((function(e){t.props.dispatch(At.Actions.setKDSData(Pa.DailyBookingsRevenueByPlatform,e))}))),n.abrupt("return",Promise.all(e));case 3:case"end":return n.stop()}}),null,null,null,Promise)}},{key:"render",value:function(){var e=this.state,t=e.dateScrub,n=e.dataSync,r=this.props.data,a=r.lastImported,o=r.schoolHolidays,i=r.publicHolidays,l=r.appVersions,c=this.props.kdsData[Pa.DailyBookingsRevenueByPlatform];return m.a.createElement(Re.a.Screen,{forceScrollbar:!0},m.a.createElement(Ba,{dateScrub:t,groupedDailyData:c,calendarEvents:{schoolHolidays:o,publicHolidays:i,appVersions:l},lastImported:a.label,onScrubberEvent:this.onScrubberEvent}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%"}},m.a.createElement(Wa,{dataSync:n}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Za,{dataSync:n})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%"}},m.a.createElement(Ha,{dataSync:n}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Qa,{dataSync:n})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%"}},m.a.createElement(za,{dateScrub:t,dataSync:n}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Xa,{dataSync:n,data:c})),m.a.createElement(Re.a.SpacerDouble,null))}}]),n}(m.a.Component),$a=Object(b.b)((function(e){return{data:e.data,kdsData:e.kdsData}}))(_a),eo=n(122),to=n(116),no=n(63),ro=n.n(no),ao=n(162),oo=Object(ao.createSelector)([function(e){return e.user}],(function(e){var t=e.userDetails;return!!t&&t.role===P.e.administrator})),io=n(168),lo=n.n(io),co=n(17);function so(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var uo,po,fo,ho,mo,yo,go,bo,Ao,Eo=function e(t,n=""){o()(this,e),this.basePath=n,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)},vo=function(e){f()(n,e);var t=so(n);function n(e,r){var a;return o()(this,n),(a=t.call(this,r)).field=e,a.name="RequiredError",a}return n}(lo()(Error));!function(e){e[e.Entry="Entry"]="Entry",e[e.Exit="Exit"]="Exit",e[e.PAAccess="PAAccess"]="PAAccess",e[e.Dual="Dual"]="Dual"}(uo||(uo={})),function(e){e[e.Pre="Pre"]="Pre",e[e.Post="Post"]="Post",e[e.Entered="Entered"]="Entered",e[e.Exited="Exited"]="Exited",e[e.Cancelled="Cancelled"]="Cancelled",e[e.NotStarted="NotStarted"]="NotStarted"}(po||(po={})),function(e){e[e.Initial="initial"]="Initial",e[e.Entered="entered"]="Entered",e[e.Exited="exited"]="Exited"}(fo||(fo={})),function(e){e[e.Pending="pending"]="Pending",e[e.Normal="normal"]="Normal",e[e.Suspect="suspect"]="Suspect",e[e.Denied="denied"]="Denied"}(ho||(ho={})),function(e){e[e.Pre="Pre"]="Pre",e[e.Post="Post"]="Post",e[e.Entered="Entered"]="Entered",e[e.Exited="Exited"]="Exited",e[e.Cancelled="Cancelled"]="Cancelled",e[e.NotStarted="NotStarted"]="NotStarted"}(mo||(mo={})),function(e){e[e.Keep="Keep"]="Keep",e[e.Release="Release"]="Release",e[e.Delete="Delete"]="Delete"}(yo||(yo={})),function(e){e[e.Ok="ok"]="Ok",e[e.Warning="warning"]="Warning",e[e.Error="error"]="Error"}(go||(go={})),function(e){e[e.Entry="Entry"]="Entry",e[e.Exit="Exit"]="Exit",e[e.PAAccess="PAAccess"]="PAAccess",e[e.Dual="Dual"]="Dual"}(bo||(bo={})),function(e){e[e.Pending="pending"]="Pending",e[e.Normal="normal"]="Normal",e[e.Suspect="suspect"]="Suspect",e[e.Denied="denied"]="Denied"}(Ao||(Ao={}));var So,ko=function(e){return{access:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling access.");var r="/elevate/access",a=co.parse(r,!0),o=Ge()({method:"POST"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},accessStatus:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="/elevate/accessStatus",a=co.parse(r,!0),o=Ge()({method:"POST"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},activateUser:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling activateUser.");var r="/elevate/user",a=co.parse(r,!0),o=Ge()({method:"POST"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},addUserPlate:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling addUserPlate.");var r="/elevate/userPlates",a=co.parse(r,!0),o=Ge()({method:"POST"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},conflictResolve:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling conflictResolve.");var r="/elevate/userPlates/conflict",a=co.parse(r,!0),o=Ge()({method:"POST"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},getUser:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="/elevate/user",r=co.parse(n,!0),a=Ge()({method:"GET"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=l}return r.query=Ge()({},r.query,i,t.query),delete r.search,a.headers=Ge()({},o,t.headers),{url:co.format(r),options:a}},getUserPlates:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="/elevate/userPlates",r=co.parse(n,!0),a=Ge()({method:"GET"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=l}return r.query=Ge()({},r.query,i,t.query),delete r.search,a.headers=Ge()({},o,t.headers),{url:co.format(r),options:a}},healthcheck:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="/healthcheck",n=co.parse(t,!0),r=Ge()({method:"GET"},e),a={},o={};return n.query=Ge()({},n.query,o,e.query),delete n.search,r.headers=Ge()({},a,e.headers),{url:co.format(n),options:r}},movement:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling movement.");var r="/elevate/movement",a=co.parse(r,!0),o=Ge()({method:"POST"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},removeUserPlate:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling removeUserPlate.");var r="/elevate/userPlates",a=co.parse(r,!0),o=Ge()({method:"DELETE"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},updateUser:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling updateUser.");var r="/elevate/user",a=co.parse(r,!0),o=Ge()({method:"PUT"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},updateUserPlate:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("body","Required parameter body was null or undefined when calling updateUserPlate.");var r="/elevate/userPlates",a=co.parse(r,!0),o=Ge()({method:"PUT"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},userRefresh:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="/elevate/user/refresh",r=co.parse(n,!0),a=Ge()({method:"POST"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=l}return r.query=Ge()({},r.query,i,t.query),delete r.search,a.headers=Ge()({},o,t.headers),{url:co.format(r),options:a}}}},To=function(e){return{access:function(t,n){var r=ko(e).access(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},accessStatus:function(t,n){var r=ko(e).accessStatus(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},activateUser:function(t,n){var r=ko(e).activateUser(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},addUserPlate:function(t,n){var r=ko(e).addUserPlate(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},conflictResolve:function(t,n){var r=ko(e).conflictResolve(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUser:function(t){var n=ko(e).getUser(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserPlates:function(t){var n=ko(e).getUserPlates(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},healthcheck:function(t){var n=ko(e).healthcheck(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},movement:function(t,n){var r=ko(e).movement(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},removeUserPlate:function(t,n){var r=ko(e).removeUserPlate(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},updateUser:function(t,n){var r=ko(e).updateUser(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},updateUserPlate:function(t,n){var r=ko(e).updateUserPlate(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},userRefresh:function(t){var n=ko(e).userRefresh(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},Oo=(function(e){f()(n,e);var t=so(n);function n(){return o()(this,n),t.apply(this,arguments)}l()(n,[{key:"access",value:function(e,t){return To(this.configuration).access(e,t)(this.basePath)}},{key:"accessStatus",value:function(e,t){return To(this.configuration).accessStatus(e,t)(this.basePath)}},{key:"activateUser",value:function(e,t){return To(this.configuration).activateUser(e,t)(this.basePath)}},{key:"addUserPlate",value:function(e,t){return To(this.configuration).addUserPlate(e,t)(this.basePath)}},{key:"conflictResolve",value:function(e,t){return To(this.configuration).conflictResolve(e,t)(this.basePath)}},{key:"getUser",value:function(e){return To(this.configuration).getUser(e)(this.basePath)}},{key:"getUserPlates",value:function(e){return To(this.configuration).getUserPlates(e)(this.basePath)}},{key:"healthcheck",value:function(e){return To(this.configuration).healthcheck(e)(this.basePath)}},{key:"movement",value:function(e,t){return To(this.configuration).movement(e,t)(this.basePath)}},{key:"removeUserPlate",value:function(e,t){return To(this.configuration).removeUserPlate(e,t)(this.basePath)}},{key:"updateUser",value:function(e,t){return To(this.configuration).updateUser(e,t)(this.basePath)}},{key:"updateUserPlate",value:function(e,t){return To(this.configuration).updateUserPlate(e,t)(this.basePath)}},{key:"userRefresh",value:function(e){return To(this.configuration).userRefresh(e)(this.basePath)}}])}(Eo),function(e){return{getAdminUser:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("email","Required parameter email was null or undefined when calling getAdminUser.");var r="/elevate/admin/user/{email}".replace("{email}",encodeURIComponent(String(t))),a=co.parse(r,!0),o=Ge()({method:"GET"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers),{url:co.format(a),options:o}},getAdminUserPlates:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("email","Required parameter email was null or undefined when calling getAdminUserPlates.");var r="/elevate/admin/user/{email}/userPlates".replace("{email}",encodeURIComponent(String(t))),a=co.parse(r,!0),o=Ge()({method:"GET"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers),{url:co.format(a),options:o}},getUserSessionDetail:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("appSessionId","Required parameter appSessionId was null or undefined when calling getUserSessionDetail.");var r="/elevate/admin/user/{appSessionId}/appSession".replace("{appSessionId}",encodeURIComponent(String(t))),a=co.parse(r,!0),o=Ge()({method:"GET"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers),{url:co.format(a),options:o}},getUserSessions:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("email","Required parameter email was null or undefined when calling getUserSessions.");var r="/elevate/admin/user/{email}/userSessions".replace("{email}",encodeURIComponent(String(t))),a=co.parse(r,!0),o=Ge()({method:"GET"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers),{url:co.format(a),options:o}},getUserWhitelist:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new vo("email","Required parameter email was null or undefined when calling getUserWhitelist.");var r="/elevate/admin/user/{email}/userWhitelist".replace("{email}",encodeURIComponent(String(t))),a=co.parse(r,!0),o=Ge()({method:"GET"},n),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,n.query),delete a.search,o.headers=Ge()({},i,n.headers),{url:co.format(a),options:o}}}}),Ro=function(e){return{getAdminUser:function(t,n){var r=Oo(e).getAdminUser(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getAdminUserPlates:function(t,n){var r=Oo(e).getAdminUserPlates(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserSessionDetail:function(t,n){var r=Oo(e).getUserSessionDetail(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserSessions:function(t,n){var r=Oo(e).getUserSessions(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserWhitelist:function(t,n){var r=Oo(e).getUserWhitelist(t,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},Co=function(e){f()(n,e);var t=so(n);function n(){return o()(this,n),t.apply(this,arguments)}return l()(n,[{key:"getAdminUser",value:function(e,t){return Ro(this.configuration).getAdminUser(e,t)(this.basePath)}},{key:"getAdminUserPlates",value:function(e,t){return Ro(this.configuration).getAdminUserPlates(e,t)(this.basePath)}},{key:"getUserSessionDetail",value:function(e,t){return Ro(this.configuration).getUserSessionDetail(e,t)(this.basePath)}},{key:"getUserSessions",value:function(e,t){return Ro(this.configuration).getUserSessions(e,t)(this.basePath)}},{key:"getUserWhitelist",value:function(e,t){return Ro(this.configuration).getUserWhitelist(e,t)(this.basePath)}}]),n}(Eo),Uo=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getAPIConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?M.b.elevateService.prod:M.b.elevateService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.getAPIConfig(t),r=n.apiKey,a=n.apiBaseUrl;return new Co({apiKey:r},a)}},{key:"authenticate",value:function(){var e;return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=ro.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"getUser",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(t).getAdminUser(n,{headers:{Authorization:r}}).then((function(e){return e.user})).catch((function(e){console.error("Error getting Elevate user",e)}))}))}},{key:"getAllSessions",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(t).getUserSessions(n,{headers:{Authorization:r}}).then((function(e){return{sessions:e.sessions}})).catch((function(){return{sessions:[]}}))}))}},{key:"getUserSessionDetail",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(t).getUserSessionDetail(n,{headers:{Authorization:r}}).then((function(e){return e.session||{}}))}))}},{key:"getUserWhitelist",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(t).getUserWhitelist(n,{headers:{Authorization:r}}).then((function(e){return e.whitelistEntries||[]}))}))}},{key:"getUserPlates",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(t).getAdminUserPlates(n,{headers:{Authorization:r}}).then((function(e){return e.plates||[]}))}))}}]),e}(),Do=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getAPIConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?M.b.promoPushService.prod:M.b.promoPushService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.getAPIConfig(t),r=n.apiKey,a=n.apiBaseUrl;return new ba.a({apiKey:r},a)}},{key:"authenticate",value:function(){var e;return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=ro.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"adminGetUserPacks",value:function(t,n,r){return e.authenticate().then((function(a){return e.getApi(r).adminGetUserPacks(t,n,{headers:{Authorization:a}})}))}},{key:"adminDeleteUserPacks",value:function(t,n,r){return e.authenticate().then((function(a){return e.getApi(r).adminDeleteUserPack(t,n,{headers:{Authorization:a}})}))}},{key:"adminFixInvalidPass",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(n).adminFixInvalidPass(t,{headers:{Authorization:r}})}))}},{key:"adminAllocatePackCode",value:function(t,n,r){return e.authenticate().then((function(a){return e.getApi(r).adminAllocatePackCode(t,n,{headers:{Authorization:a}})}))}},{key:"adminAllocatePack",value:function(t,n,r){return e.authenticate().then((function(a){return e.getApi(r).adminAllocatePack(t,n,{headers:{Authorization:a}})}))}},{key:"adminGetProducts",value:function(t){return e.authenticate().then((function(n){return e.getApi(t).adminGetProducts({headers:{Authorization:n}})}))}},{key:"adminUpdateProducts",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(n).adminUpdateProducts(t,{headers:{Authorization:r}})}))}}]),e}(),Po=n(276),wo=n(285),Mo=n(277),xo=n(739);function Vo(e,t,n,r,a){return Object(wo.a)(fetch(function(e,t,n){return(e=e.replace(/\/$/,""))+"/"+t+(null!=n?n:"")}(e,t,n),r)).pipe(Object(Mo.a)((function(e){if(e.status>=200&&e.status<300)try{return e.json()}catch(t){throw{message:"Parse error: "+JSON.stringify(t)}}return e.text().then((function(t){var n=t||e.statusText||"Status "+e.status,r={};if(t)try{r=JSON.parse(t)}catch(a){throw{message:n}}if(!r.message)throw{message:n};throw r}))})),Object(xo.a)((function(e){return function(e,t,n,r){throw r&&(n&&n.method?e.tag=n.method+" "+t:e.tag=t,e.tracked=!0,r(e)),e}(e,t,r,a)})))}function jo(e){return function(e,t){var n;return(null!=(n=e.ServiceList)?n:[]).findIndex((function(e){return e.Service===t}))>=0}(e,So.WilsonOne)}function Bo(e){return{Id:e.Id,AXCarparkID:e.AXCarparkID,StationNumber:e.StationNumber,StationImageWithUrl:e.StationImageWithUrl,Name:e.Label,BestPrice:e.BestPrice||"",IsWilsonOne:jo(e),Location:e.Location,PrintTickets:!1}}function Io(){return Vo(M.b.cmsBaseUrl,"GetListActiveCarParks").pipe(Object(Po.a)((function(e){return(e.CarParksList||[]).map(Bo)})))}!function(e){e[e.Casual=1]="Casual",e[e.Monthly=2]="Monthly",e[e.Night=3]="Night",e[e.Weekend=4]="Weekend",e[e.Disabled=6]="Disabled",e[e.Earlybird=15]="Earlybird",e[e.WilsonOne=18]="WilsonOne",e[e.EPark=22]="EPark"}(So||(So={}));var No=n(148);function Jo(e,t){Object(h.useEffect)((function(){var t=function(t){e()&&(t.preventDefault(),t.returnValue=!0)};return window.addEventListener("beforeunload",t),function(){window.removeEventListener("beforeunload",t)}}),t)}var Lo=n(254),Fo=function(e){var t=e.children,n=e.style;return m.a.createElement(R.a,{selectable:!0,style:[n]},t)};function Wo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zo(e){for(var t=1;t5,p=o&&s>5;return 0===s?m.a.createElement(R.a,{style:z.b.grey.bodyS.regularItalic},"No bundles found."):m.a.createElement(m.a.Fragment,null,m.a.createElement(ui,null),u&&u.map((function(t,n){return m.a.createElement(di,{userId:e.userEmail,bundle:t,key:n,onTrashPressed:function(){return e.onTrashPressed(t)},onToolsPressed:function(){return e.onToolsPressed(t)},onAddCodePressed:function(){return e.onAddCodePressed(t)},refresh:e.onSearchPressed,actionsDisabled:e.actionsDisabled})})),m.a.createElement(Re.a.SpacerDouble,null),d&&m.a.createElement(Be.Button,{text:"Show All",theme:fi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:l}),p&&m.a.createElement(Be.Button,{text:"Show Less",theme:fi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:c}))}var mi=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getAPIConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?M.b.promoPushService.prod:M.b.promoPushService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.getAPIConfig(t),r=n.apiKey,a=n.apiBaseUrl;return new ba.d({apiKey:r},a)}},{key:"authenticate",value:function(){var e;return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=ro.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"deleteUserAccountData",value:function(t,n){return e.authenticate().then((function(r){return e.getApi(n).deleteUserAccountData(t,{headers:{Authorization:r}})}))}}]),e}();function yi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gi(e){for(var t=1;t0&&a(bi.REQUESTING_CONFIRMATION)}),[e.userEmail]),u=Object(h.useCallback)((function(){a(bi.PROCESSING),mi.deleteUserAccountData(e.userEmail,e.prod).then((function(e){c(e.message),a(bi.PROCESSING_COMPLETE)})).catch((function(){return a(bi.REQUEST_ERROR)}))}),[e.userEmail]),d=Object(h.useCallback)((function(){r==bi.REQUESTING_CONFIRMATION&&a(bi.NOT_OPEN)}),[a]),p=Object(h.useMemo)((function(){switch(r){case bi.REQUESTING_CONFIRMATION:return"Are you sure?";case bi.PROCESSING:return"Deleting ...";case bi.NOT_OPEN:return"";case bi.REQUEST_ERROR:return"Something went wrong";default:return"Delete user account"}}),[r]),f=Object(h.useMemo)((function(){switch(r){case bi.REQUESTING_CONFIRMATION:return m.a.createElement(R.a,null,"This will delete user account data for ",m.a.createElement(R.a,{style:U.b.black.bodyS.bold},e.userEmail));case bi.PROCESSING:return m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,null,"Deleting user account data, please wait..."),m.a.createElement(y.a,{style:{flex:1,justifyContent:"center",width:"100%"}},m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(g.a,{color:U.a.red})));case bi.PROCESSING_COMPLETE:return m.a.createElement(R.a,{style:Ai.messageStyle},l);case bi.REQUEST_ERROR:return m.a.createElement(R.a,{style:U.b.red.bodyS.regularItalic},"There was an error processing your request. Please try again later","\n"," or contact Wilson Parking Support.");default:return m.a.createElement(m.a.Fragment,null)}}),[r]),b=Object(h.useMemo)((function(){switch(r){case bi.REQUEST_ERROR:case bi.REQUESTING_CONFIRMATION:return[{text:"Cancel",theme:gi({},Be.BUTTON_THEME_CANCEL,{textStyle:U.b.red.bodyM.bold,minWidth:"auto",borderColor:U.a.red,paddingHorizontal:U.d.doubleBaseMargin}),onPress:d},{text:"Delete",theme:gi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:u}];case bi.PROCESSING_COMPLETE:return[{text:"Ok",theme:gi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){a(bi.NOT_OPEN),e.refresh(e.prod)}}];default:return[]}}),[r]),A=Object(h.useMemo)((function(){return r!==bi.NOT_OPEN}),[r]);return Jo((function(){return A}),[A]),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"Delete User Account Data"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{alignItems:"flex-start"}},m.a.createElement(Be.Button,{text:"Delete",theme:gi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:s})),A&&m.a.createElement(Ea.c,{onClose:d,show:A,title:p,buttons:b,theme:Ai},f))}function vi(e){return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{height:U.d.tripleBaseMargin,backgroundColor:U.a.pageBackground,flexDirection:"row",justifyContent:"space-between"}},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(Fo,{style:U.b.black.bodyM.regular},"UserId: ",e.user.userId)),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:U.b.black.bodyM.regular},"AccessAllowed: ",e.user.accessAllowed?"Y":"N")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:U.b.black.bodyM.regular},"Lpr Blocked: ",e.user.lprBlocked?"Y":"N"))))}function Si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ki(e){for(var t=1;t0&&c(Ti.REQUESTING_CONFIRMATION)}),[null==(t=e.userDetails)?void 0:t.userID]),b=Object(h.useCallback)((function(){var t,n;c(Ti.PROCESSING),No.a.adminDeleteUserBan(null!=(t=null==(n=e.userDetails)?void 0:n.userID)?t:"",e.prod).then((function(e){p(e.message),c(Ti.PROCESSING_COMPLETE)})).catch((function(){return c(Ti.REQUEST_ERROR)}))}),[null==(n=e.userDetails)?void 0:n.userID]),A=Object(h.useCallback)((function(){l==Ti.REQUESTING_CONFIRMATION&&c(Ti.NOT_OPEN)}),[c,l]),E=Object(h.useMemo)((function(){switch(l){case Ti.REQUESTING_CONFIRMATION:return"Are you sure?";case Ti.PROCESSING:return"Unlocking ...";case Ti.NOT_OPEN:return"";case Ti.REQUEST_ERROR:return"Something went wrong";default:return"Unlocked user account"}}),[l]),v=Object(h.useMemo)((function(){switch(l){case Ti.REQUESTING_CONFIRMATION:var t;return m.a.createElement(R.a,null,"This will unlock the user account for"," ",m.a.createElement(R.a,{style:U.b.black.bodyS.bold},null==(t=e.userDetails)?void 0:t.userID));case Ti.PROCESSING:return m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,null,"Unlocking user account, please wait..."),m.a.createElement(y.a,{style:{flex:1,justifyContent:"center",width:"100%"}},m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(g.a,{color:U.a.red})));case Ti.PROCESSING_COMPLETE:return m.a.createElement(R.a,{style:Oi.messageStyle},d);case Ti.REQUEST_ERROR:return m.a.createElement(R.a,{style:U.b.red.bodyS.regularItalic},"There was an error processing your request. Please try again later","\n"," or contact Wilson Parking Support.");default:return m.a.createElement(m.a.Fragment,null)}}),[l]),S=Object(h.useMemo)((function(){switch(l){case Ti.REQUEST_ERROR:case Ti.REQUESTING_CONFIRMATION:return[{text:"Cancel",theme:ki({},Be.BUTTON_THEME_CANCEL,{textStyle:U.b.red.bodyM.bold,minWidth:"auto",borderColor:U.a.red,paddingHorizontal:U.d.doubleBaseMargin}),onPress:A},{text:"Confirm",theme:ki({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:b}];case Ti.PROCESSING_COMPLETE:return[{text:"Ok",theme:ki({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){c(Ti.NOT_OPEN),e.refresh(e.prod)}}];default:return[]}}),[l]),k=Object(h.useMemo)((function(){return l!==Ti.NOT_OPEN}),[l]);return Jo((function(){return k}),[k]),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flex:1,justifyContent:"space-between",flexDirection:"row"}},m.a.createElement(fn.Label,{data:{text:"User Payment Lock"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"Unlock User",theme:ki({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),disabled:0==(null==(r=e.userDetails)?void 0:r.banStatus)||void 0,onPress:f})),m.a.createElement(Re.a.Spacer,null),m.a.createElement(R.a,{style:U.b.grey.bodyS.regularItalic},"All data shown is from the last 30 days."),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ri,null),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Ci,{userDetails:e.userDetails}),m.a.createElement(Re.a.SpacerDouble,null),(null==(a=e.userDetails)?void 0:a.paymentUpdates)&&e.userDetails.paymentUpdates.length>0&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Ui,null),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Di,{userDetails:e.userDetails})),k&&m.a.createElement(Ea.c,{onClose:A,show:k,title:E,buttons:S,theme:Oi},v))}!function(e){e[e.NOT_OPEN=0]="NOT_OPEN",e[e.REQUESTING_CONFIRMATION=1]="REQUESTING_CONFIRMATION",e[e.PROCESSING=2]="PROCESSING",e[e.PROCESSING_COMPLETE=3]="PROCESSING_COMPLETE",e[e.REQUEST_ERROR=4]="REQUEST_ERROR"}(Ti||(Ti={}));var wi=function(e){var t,n,r=e.userPlate,a=e.row;return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:[_o.row,{backgroundColor:(t=a,n=Hn.DATA_TABLE_THEME_DEFAULT,t%2===0?n.secondaryColor:n.primaryColor)}]},m.a.createElement(y.a,{style:_o.cell},m.a.createElement(Fo,{style:_o.bodyText},r.plate)),m.a.createElement(y.a,{style:_o.cell},m.a.createElement(Fo,{style:_o.bodyText},r.state)),m.a.createElement(y.a,{style:_o.cell},m.a.createElement(Fo,{style:_o.bodyText},r.lprEnabled?"Y":"N")),m.a.createElement(y.a,{style:_o.cell},m.a.createElement(Fo,{style:_o.bodyText},r.conflict?"Y":"N")),m.a.createElement(y.a,{style:_o.cell},m.a.createElement(Fo,{style:_o.bodyText},r.lprVerified?"Y":"N"))))},Mi=function(e){var t=e.data;return m.a.createElement(m.a.Fragment,null,t&&m.a.createElement(y.a,null,m.a.createElement(y.a,{style:_o.header},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:_o.headerText},"Plate")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:_o.headerText},"State")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:_o.headerText},"LprEnabled")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:_o.headerText},"Conflict")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:_o.headerText},"LprVerified"))),t.map((function(e,t){return m.a.createElement(wi,{key:t,userPlate:e,row:t})}))))},xi=function(e){var t=Object(h.useState)(void 0),n=Pr()(t,2),r=n[0],a=n[1];return Object(h.useEffect)((function(){if(!r){var t=e.useProd,n=e.userEmail;Uo.getUserPlates(t,n).then((function(e){a(e)}))}})),m.a.createElement(Re.a.Screen,{paddingVertical:z.d.quadBaseMargin,paddingHorizontal:z.d.eightBaseMargin},m.a.createElement(Me.a,{style:{position:"absolute",top:z.d.doubleBaseMargin,left:z.d.doubleBaseMargin},onPress:e.back},m.a.createElement(G.a,{source:z.c.arrowLeft,style:{width:z.d.icons.medium,height:z.d.icons.medium,tintColor:z.a.grey}})),m.a.createElement(fn.Label,{data:{text:"User Plates"},theme:fn.LABEL_THEME_TITLE}),r&&m.a.createElement(Mi,{data:r}))};function Vi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ji(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function Hi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(V(!0),Ie(e).then((function(){return S.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S.a.awrap(new Promise((function(e){return setTimeout(e,1e3)})));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),null,null,null,Promise)})).then((function(){return d(!0)})).finally((function(){return V(!1)})))}),[n]);Object(h.useEffect)((function(){Do.adminGetProducts(I).then((function(e){Q(e)}))}),[I]),Object(h.useEffect)((function(){No.a.adminGetPaymentDetailUpdates(n,I).then((function(e){ce(e)}))}),[I]),Object(h.useEffect)((function(){Io().toPromise().then((function(e){F(e)}))}),[I]);var Je=Object(h.useMemo)((function(){var e=[];if(null!=H)for(var t,n=function(t){var n=null==L?void 0:L.find((function(e){return e.AXCarparkID===t.carParks[0]}));null!=n&&e.push({product:t,site:n})},r=Zi(H);!(t=r()).done;){n(t.value)}return e}),[H,L]),Le=Object(h.useMemo)((function(){var e=[{label:"",value:void 0}],t=Je.filter((function(e){return e})).map((function(e){return{label:"("+e.site.AXCarparkID+") "+e.site.Name+" - "+e.product.count+" Daily Passes",value:e}}));return t.sort((function(e,t){return e.label.localeCompare(t.label)})),e=e.concat(t)}),[H,L]);return m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.Screen,null,!1,m.a.createElement(fn.Label,{data:{text:"Search for a user account by email address"},theme:fn.LABEL_THEME_LIGHT}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(xe.a,{style:{minWidth:28*z.d.baseMargin,height:4*z.d.baseMargin,borderWidth:1,borderColor:z.a.lightGrey,borderRadius:z.d.borderRadius,padding:z.d.baseMargin},value:n,onChangeText:r,onSubmitEditing:function(){return Ne(I)},placeholder:"name@email.com"}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"Search",theme:Wi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){return Ne(I)},fetching:De})),me&&m.a.createElement(Li,{back:function(){ye(!1)},userEmail:n,useProd:I}),Ae&&m.a.createElement(xi,{back:function(){Ee(!1)},userEmail:n,useProd:I}),ke&&m.a.createElement(ai,{back:function(){Te(!1)},userEmail:n,useProd:I}),!ke&&!me&&!Ae&&m.a.createElement(m.a.Fragment,null,k&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:z.b.black.bodyM.bold},"An error has occured"),m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"Error: ",g)),!k&&m.a.createElement(m.a.Fragment,null,!U&&u&&!x&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:z.b.black.bodyM.bold},"Not Displaying?"),m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"\u2022 The email is invalid."),m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"\u2022 The email has no valid user account.")),u&&U&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flex:1,justifyContent:"space-between",flexDirection:"row"}},m.a.createElement(fn.Label,{data:{text:"Active User Bundles"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Be.Button,{text:"Add New",theme:Wi({},Be.BUTTON_THEME_FIXED_BLUE,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),disabled:!Ue,onPress:function(e){return l({type:"for_adding_bundle",bundle:e,action:Ve})}})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(hi,{bundleData:$,numBundlesToShow:5,userEmail:n,onTrashPressed:function(e){return l({type:"for_trashing",bundle:e,action:we})},onToolsPressed:function(e){return l({type:"for_tools",bundle:e,action:Pe})},onAddCodePressed:function(e){return l({type:"for_adding_code",bundle:e,action:Me})},onSearchPressed:function(){return Ne(I)},actionsDisabled:!1}))),u&&!Ce&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"Inactive User Bundles"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(hi,{bundleData:re,numBundlesToShow:5,userEmail:n,onTrashPressed:function(){return l(void 0)},onToolsPressed:function(){return l(void 0)},onAddCodePressed:function(e){return l({type:"for_adding_code",bundle:e,action:Me})},onSearchPressed:function(){return Ne(I)},actionsDisabled:!0}))),Oe&&K&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(fn.Label,{data:{text:"Elevate user"},theme:fn.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(vi,{user:K}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(Be.Button,{text:"View App Sessions",onPress:function(){Te(!0)}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"View Whitelist Requests",onPress:function(){ye(!0)}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"View User Plates",onPress:function(){Ee(!0)}})))),i&&m.a.createElement(ci,{bundleAlert:i,closeHandler:function(){l(void 0),pe(void 0)},filterItems:Le,fetching:x,error:de}),Ue&&U&&u&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Pi,{userDetails:le,prod:I,refresh:function(){return Ne(I)}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ei,{userEmail:n,prod:I,refresh:function(){return Ne(I)}}))))))}var zi=n(131),Yi=n(19);function Ki(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xi(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function ol(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e.price>0&&""!=e.description)}function sl(e){if(null==e.input)return!0;var t=e.input,n=t.description,r=t.count,a=t.price;if(""===n.trim())return!1;var o=parseInt(r,10);if(isNaN(o))return!1;var i=parseFloat(a.replace("$","").trim());return!isNaN(i)}function ul(e){return null!=e.input}function dl(e){if(ul(e)){var t=parseInt(e.input.count,10),n=parseFloat(e.input.price.replace("$","").trim());return isNaN(t)||isNaN(n)?"":Object(W.c)(t*n,W.a.Dollars)}return Object(W.c)(e.count*e.price,W.a.Dollars)}var pl={description:"",count:"",price:""};function fl(e,t){return t.includes(e.state)}function hl(e){if(ul(e))return z.a.lightGrey;if(!cl(e))return z.a.orange;switch(e.state){case"added":return z.a.green;case"removed":return z.a.red;case"modified":return z.a.yellow;default:return z.a.pageBackground}}var ml=function(e){var t=e.actionsDisabled?.5:1;return m.a.createElement(Me.a,{disabled:e.actionsDisabled,onPress:e.onPress},m.a.createElement(G.a,{source:e.icon,style:{width:z.d.icons.small,height:z.d.icons.small,tintColor:e.color,opacity:t}}))};function yl(){return m.a.createElement(y.a,{style:{width:"100%",height:1,backgroundColor:z.a.border}})}function gl(e){var t,n,r,a,o,i,l=Object(b.d)(oo),c=Object(h.useCallback)((function(){var t,n=null==(t=e.product).input?rl({},t,{input:{description:t.description,count:""+t.count,price:Object(W.c)(t.price,W.a.Dollars)}}):rl({},t);e.onProductChange(n)}),[e.product,e.onProductChange]),s=Object(h.useCallback)((function(){e.onProductReverted()}),[e.onProductReverted]),u=Object(h.useCallback)((function(){e.onProductRemoved()}),[e.onProductRemoved]),d=Object(h.useCallback)((function(){var t=function(e){if(null==e.input)return e;var t=e.input,n=t.description,r=t.count,a=t.price,o=parseInt(r,10),i=parseFloat(a.replace("$","").trim());return Object(zi.a)(e,(function(e){e.description=n,e.count=o,e.price=i,e.gst=.1*e.price,e.input=void 0}))}(e.product);e.onProductChange(t)}),[e.product,e.onProductChange]),p=Object(h.useCallback)((function(){var t,n=(t=e.product,Object(zi.a)(t,(function(e){e.input=void 0})));e.onProductChange(n)}),[e.product,e.onProductChange]),f=Object(h.useCallback)((function(t){var n=Object(zi.a)(e.product,(function(e){e.input.count=t}));e.onProductChange(n)}),[e.product,e.onProductChange]),g=Object(h.useCallback)((function(t){var n=Object(zi.a)(e.product,(function(e){e.input.description=t}));e.onProductChange(n)}),[e.product,e.onProductChange]),A=Object(h.useCallback)((function(t){var n=Object(zi.a)(e.product,(function(e){e.input.price=t}));e.onProductChange(n)}),[e.product,e.onProductChange]),E=ul(e.product),v=e.product.carParks[0],S=null!=(t=null==(n=e.product.input)?void 0:n.count)?t:""+e.product.count,k=null!=(r=null==(a=e.product.input)?void 0:a.description)?r:e.product.description,T=null!=(o=null==(i=e.product.input)?void 0:i.price)?o:Object(W.c)(e.product.price,W.a.Dollars);return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{backgroundColor:hl(e.product),flexDirection:"row",height:z.d.tripleBaseMargin,alignItems:"center"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(qi,{contents:v,rowWidth:50,editable:!1})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(qi,{contents:S,rowWidth:50,editable:E,onValueChange:f,textAlign:"right"})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(qi,{contents:k,rowWidth:100,editable:E,onValueChange:g})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(qi,{contents:T,rowWidth:50,editable:E,onValueChange:A,textAlign:"right"})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse",alignItems:"center"}},m.a.createElement(qi,{contents:dl(e.product),editable:!1,textAlign:"right"})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:6,flexDirection:"row",alignItems:"center"}},m.a.createElement(Re.a.FlexSpacer,null),l&&m.a.createElement(bl,{product:e.product,disabled:e.actionsDisabled,onConfirmPress:d,onCancelPress:p,onDeletePress:u,onEditPress:c,onUndoPress:s}))),m.a.createElement(yl,null))}function bl(e){var t,n=[];if(ul(e.product)){var r=sl(e.product);n.push(m.a.createElement(ml,{key:"confirm",onPress:e.onConfirmPress,icon:z.c.check,color:z.a.highlight,actionsDisabled:!r})),n.push(m.a.createElement(ml,{key:"cancel",onPress:e.onCancelPress,icon:z.c.cross,color:z.a.red,actionsDisabled:!1}))}else{var a="removed"!==e.product.state,o=fl(e.product,["added","unmodified"]),i=fl(e.product,["modified","removed"]);t=function(e){if(!cl(e))return"Invalid";switch(e.state){case"added":return"Added";case"modified":return"Modified";case"removed":return"Removed"}}(e.product),a&&n.push(m.a.createElement(ml,{key:"edit",onPress:e.onEditPress,icon:z.c.edit,color:z.a.highlight,actionsDisabled:e.disabled})),o&&n.push(m.a.createElement(ml,{key:"delete",onPress:e.onDeletePress,icon:z.c.trash,color:z.a.red,actionsDisabled:e.disabled})),i&&n.push(m.a.createElement(ml,{key:"undo",onPress:e.onUndoPress,icon:z.c.undo,color:z.a.orange,actionsDisabled:e.disabled}))}return n.length<2&&(n.push(m.a.createElement(y.a,{style:{width:z.d.icons.small}})),n.reverse()),m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},null!=t&&m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,{style:U.b.black.bodyXS.boldItalic},t),m.a.createElement(Re.a.Spacer,null)),n)}function Al(){var e=Object(b.d)(oo);return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{height:z.d.tripleBaseMargin,backgroundColor:z.a.pageBackground,flexDirection:"row",alignItems:"center"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Site ID")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Count")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Description")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Price")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Total Price")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:6,flexDirection:"row-reverse"}},e&&m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Actions"))),m.a.createElement(yl,null))}function El(e){return 0===e.products.length?m.a.createElement(R.a,{style:z.b.grey.bodyS.regularItalic},"No bundles found."):m.a.createElement(m.a.Fragment,null,m.a.createElement(Al,null),e.products.map((function(t){return m.a.createElement(gl,{key:t.id,product:t,onProductChange:function(t){return e.onProductChange(t)},onProductReverted:function(){return e.onProductReverted(t)},onProductRemoved:function(){return e.onProductRemoved(t)},actionsDisabled:e.actionsDisabled})})))}function vl(e){var t=0;if("undefined"===typeof Symbol||null==e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"===typeof e)return Sl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sl(e,t)}(e)))return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function Sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function Ml(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n60&&(o=!0),window.history.pushState({},"",jl(r.selected))),o&&S.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:j.default.tableDataRequest({database:M.b.dataService.database,collection:"user_event_stream",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.d({start:J.a.utc().subtract(7,"day"),end:J.a.utc().add(1,"day")},"datetime"),Se.g({field:"datetime"}),Se.e({limit:1}),Se.f({outputs:["datetime"]})]}}).then((function(e){var t=e.length>0?e[0].datetime:void 0,n=J()().toISOString(),r="Last Imported: "+F.c(t,n);A.b.dispatch(V.DataActions.setLastImported({datetime:t,datetimeChecked:n,label:r}))})).catch((function(e){A.b.dispatch(x.a.setError({title:"Error",message:e.message}))}));case 1:case"end":return e.stop()}}),null,null,null,Promise);case 8:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e=this.props.global,t=e.fontsLoading,n=e.globalMessage,r=this.props.user,a=r.firebaseLoading,o=r.userDetails;return t||a?m.a.createElement(y.a,{style:[Il.container,{alignItems:"center",justifyContent:"center"}]},m.a.createElement(g.a,{size:"large",color:U.a.grey})):o?m.a.createElement(y.a,{style:Il.container},m.a.createElement(y.a,{style:{flex:1,flexDirection:"row"}},m.a.createElement(Pe.SideMenu,{title:Ne.b.name,logo:U.c.logo,menuItems:this._menuItems,version:Ne.b.version,user:this.props.user.userDetails}),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(Te.ScreenHeader,null,m.a.createElement(De,null),m.a.createElement(Re.a.SpacerDouble,null)),m.a.createElement(C.a,{key:this.props.menu.selected,style:{width:"100%"},showsVerticalScrollIndicator:U.d.isWeb,contentContainerStyle:{height:U.d.isWeb?"100%":void 0,flexGrow:U.d.isWeb?void 0:1}},this.renderSelectedPage()))),m.a.createElement(we.GlobalDialog,{globalMessage:n})):m.a.createElement(y.a,{style:Il.container},m.a.createElement(We,null),m.a.createElement(we.GlobalDialog,{globalMessage:n}))}}]),r}(m.a.Component),Il=O.a.create({container:{position:"absolute",left:0,right:0,top:0,bottom:0,backgroundColor:U.a.pageBackground}}),Nl=Object(b.b)((function(e){return{global:e.global,menu:e.menu,timeZone:e.timeZone,user:e.user,data:e.data}}))(Bl);function Jl(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s()(this,n)}}var Ll=function(e){f()(n,e);var t=Jl(n);function n(){var e;o()(this,n);for(var r=arguments.length,a=new Array(r),i=0;i\n\nKassandra\n\n\n\n\n
\n

Vision

\n

Kassandra enables businesses to explore and gain insights from the data collected by their apps and web services, through interactive dashboards and ML-powered predictive modelling.

\n

Description

\n

Kassandra is a toolkit of services and API\'s that enables the creation of insightful interactive dashboards for consumption through a web portal and mobile devices.

\n

The target audience for Kassandra is a business with large volumes of analytics data stored in a data lake or repository. Kassandra integrates with the data lake to extract and process meaningful information from the collected analytics. The data is stored in a readily queryable format, and is made available to companion services for visualisation and prediction through web and mobile dashboards.

\n

Components

\n

\n

Kassandra Data Service and API

\n

The Kassandra Data Service (KDS) provides a datastore that sits between a business\'s data lake and dashboard services. Through a simple and flexible integration API, users can create their own data mining methods and store them in the data service for visualisation and further processing by other Kassandra services.

\n

Every client has their own dedicated database within KDS, isolated from other clients and secured with user-level controls applied.

\n

Kassandra Visualisation SDK

\n

Kassandra provides a Visualisation SDK (KVS) for building web and mobile dashboards in React Native. Using KVS, a developer can easily produce a live dashboard simply by laying out supplied components and binding them to their Kassandra Data Service account.

\n

KVS includes a comprehensive set of interactive components for visualising data sourced from the Kassandra Data service.

\n

Visualisation Components

\n
    \n
  • Line graphs
  • \n
  • Bar graphs
  • \n
  • Pie charts
  • \n
  • Timeline scrubbers
  • \n
  • Geo maps with specialised data and tilemap overlays
  • \n
  • Tables
  • \n
\n

KVS can be integrated into React Native apps, Expo online apps and React Native Web apps.

\n

Kassandra Forecast Service

\n

The Kassandra Forecast Service (KFS) leverages AWS Forecast to produce timeline data series predictions on data stored in KDS. KFS can be configured to periodically update the predictions on an ongoing basis. Prediction data is saved in KDS where it can be consumed by other Kassandra services.

\n

Kassandra Admin Console

\n

The Kassandra Admin Console is a planned future service, that will enable users to manage their Kassandra services, users and subscriptions through a user friendly web console.

\n

Market differentiators

\n
    \n
  • High quality interactive visualisations
  • \n
  • Native to mobile and web
  • \n
  • Tight prebuilt integrations between data lake, data and client layers - creating a new dashboard should be a plug and play experience
  • \n
\n
\n\n\n'}],[[569,1,2]]]); //# sourceMappingURL=app.866418d5.chunk.js.map