(()=>{function e(n,e,s,t,r){var a=this;function i(){var e=r("User's application access changed.");return t.success(e)}_.assign(a,{save:function(){var e=_.pick(a.user,["id","applications"]);return n.save(e).then(i)},cancel:s.gotoList,$onChanges:function(e){e.user&&a.user&&(a.hasExternalOrigin=n.hasExternalOrigin(a.user),a.hasExternalOrigin&&t.warning(s.EXTERNAL_ORIGIN_TEXT),(e=>{s.hasAppManagement(e).then(function(e){a.hasAppManagement=e})})(a.user))},$onDestroy:function(){t.remove({text:s.EXTERNAL_ORIGIN_TEXT,type:"warning"})}})}e.$inject=["c8yUser","c8yApplication","c8yUsersUi","c8yAlert","gettext"],angular.module("c8y.users").component("c8yUserApplicationAccess",{templateUrl:":::PLUGIN_PATH:::/userDetailView/userApplicationAccess.html",bindings:{user:"<"},controller:e,controllerAs:"vm"})})();