define("app/filters/notificationFilter",["angular"],(function(e){var t;try{t=e.module("App")}catch(i){t=e.module("App",[])}t.filter("notificationFilter",(function(){return function(t,i){if(!i)return t;var r=[];return i=i.toLocaleLowerCase(),e.forEach(t,(function(e){var t=e.system_name.toLocaleLowerCase(),n=e.display_name.toLocaleLowerCase();(-1!==t.indexOf(i)||-1!==n.indexOf(i))&&r.push(e)})),r}})),t.filter("notificationServiceFilter",(function(){return function(t,i){if(void 0===i)return t;var r=[];return e.forEach(t,(function(e){var t=Number(e.level);0!==Number(i)&&0!==t&&t>=i&&r.push(e)})),r}}))})),define("app/filters/splitOnComma",["angular"],(function(e){var t;try{t=e.module("App")}catch(i){t=e.module("App",[])}t.filter("splitOnComma",(function(){return function(e,t){if("string"!=typeof e)return e;if(!new RegExp(",").test(e))return[e];t=t||5;var i=e.split(",");if(i.length<t)return i;var r=i.slice(0,t-2);return r.push(LOCALE.maketext(" … and [numf,_1] more",i.length-(t-2))),r}})),t.filter("splitOnCommaForTitle",(function(){return function(e){return"string"!=typeof e?e:new RegExp(",").test(e)?e.split(",").join(",\n"):e}}))})),define("app/services/verifyNotificationService",["angular","cjt/io/api","cjt/io/whm-v1-request","cjt/io/whm-v1","cjt/services/APIService"],(function(e,t,i){var r;try{r=e.module("App")}catch(t){r=e.module("App",["cjt2.services.api"])}r.factory("verifyNotificationService",["$q","APIService",function(t,r){var n=function(){};return n.prototype=new r,e.extend(n.prototype,{verify_service:function(e){var t=new i.Class;return t.initialize("",e),this.deferred(t).promise}}),new n}])})),define("app/services/indexService",["angular","cjt/io/whm-v1-request","cjt/services/APICatcher"],(function(e,t){var i=e.module("whm.contactManager.indexService",["cjt2.services.apicatcher"]);function r(e,i){var r={createUserSession:function(){var r=(new t.Class).initialize("","create_user_session",{user:e.REMOTE_USER,service:"cpaneld",app:"ContactInfo_Change"});return i.promise(r).then((function(e){return e.data.url}))}};return r}return r.$inject=["PAGE","APICatcher"],i.factory("indexService",r)})),define("app/controllers/mainController",["angular","lodash","cjt/util/locale","app/filters/notificationFilter","app/filters/splitOnComma","app/services/verifyNotificationService","app/services/indexService","cjt/directives/spinnerDirective"],(function(e,t,i){var r;try{(r=e.module("App")).value("PAGE",window.app.PAGE),r.value("LOCALE",i),r.value("_",t)}catch(t){r=e.module("App",[])}var n=function(t,i,r,n,o,a,c,s,u,l){var f=this,p=i("orderBy"),d=i("notificationFilter");f.filteredNotifications=[],f.selectedNotifications=[],f.PAGE=n,f.meta={current_sort_key:"importance",reverse_sort:!1,search_key:""},f.PAGE.event&&(f.meta.search_key=f.PAGE.event,f.show_notifications=!0),f.locale=s,f.will_verify=!1;for(var m=0;m<n.contactmethods.length;m++)if(n.contactmethods[m].verification_api&&n.contactmethods[m].contact){f.will_verify=!0;break}return f.orderNotifications=function(e){f.meta.current_sort_key===e?f.meta.reverse_sort=!f.meta.reverse_sort:(f.meta.reverse_sort=0,f.meta.current_sort_key=e),f.updateFilteredNotifications()},f.loginTocPanel=function(){return c.createUserSession().then((function(e){r.open(e,"_blank")||o.success(s.maketext("Click to continue as the “[_1]” user and modify the [asis,cPanel] notification settings.",l.escape(n.REMOTE_USER)),{ttl:-1,variables:{buttonLabel:s.maketext("Go to [asis,cPanel]"),showAction:!0,action:function(){r.open(e)}}})}))},f.updateFilteredNotifications=function(){f.filteredNotifications=p(d(f.PAGE.notifications,f.meta.search_key),f.meta.current_sort_key,f.meta.reverse_sort)},f.verify_service=function(t){return t.verifying=!0,u.start(t.system_name+"-spinner"),a.verify_service(t.verification_api).then((function(i){i.data&&i.data.length?e.forEach(i.data,(function(e){e.result.error?o.error(f.locale.maketext("The system was unable to send the [_1] notification to “[_2]” because of the following error: [_3]",l.escape(t.display_name),l.escape(e.url||e.access_token),l.escape(e.result.error))):o.success(f.locale.maketext("The system sent the [_1] notification message “[_2]” successfully to “[_3]”.",l.escape(t.display_name),l.escape(e.result.message_id),l.escape(e.url||e.access_token)))})):o.success(f.locale.maketext("The system sent the [_1] notification message “[_2]” successfully.",l.escape(t.display_name),l.escape(i.data.message_id)))}),(function(e){o.error(f.locale.maketext("The system was unable to send the [_1] notification because of the following error: [_2]",l.escape(t.display_name),l.escape(e)))})).finally((function(){t.verifying=!1,u.stop(t.system_name+"-spinner")}))},f.orderNotifications("display_name"),t.$watch((function(){return f.filteredNotifications}),(function(e){f.selectedNotifications=i("filter")(e,{selected:!0})}),!0),f};return n.prototype.setSelected=function(t,i){e.forEach(t,(function(e){e.selected=i}))},n.prototype.setLevel=function(t,i){e.forEach(t,(function(e){e.disabled||(e.importance=i.toString())}))},n.prototype.selectedHeaderClass=function(e,t){var i="icon-arrow-"+(t.reverse_sort?"down":"up");return e===t.current_sort_key&&i},n.$inject=["$scope","$filter","$window","PAGE","growl","verifyNotificationService","indexService","LOCALE","spinnerAPI","_"],r.controller("MainController",n)})),define("app/directives/indeterminate",["angular"],(function(e){var t;try{t=e.module("App")}catch(i){t=e.module("App",[])}t.directive("cpIndeterminate",[function(){return{restrict:"A",scope:{cpIndeterminate:"@"},link:function(e,t){e.$watch("cpIndeterminate",(function(e){var i=!1;"true"===e&&(i=!0),t.prop("indeterminate",i)}))}}}])})),define("app/index",["angular","cjt/core","uiBootstrap","cjt/directives/searchDirective","cjt/modules","cjt/decorators/growlDecorator"],(function(e,t){"use strict";return function(){return e.module("App",["cjt2.config.whm.configProvider","ui.bootstrap","cjt2.directives.search","cjt2.whm","angular-growl","whm.contactManager.indexService"]),require(["cjt/bootstrap","app/controllers/mainController","app/directives/indeterminate"],(function(e){e(document)}))}}));