e.resolve(a),a})}returne.promise},a.prototype.$isGroup=function(){returnthis.isGroup||this.userClass&&"normal-group"==this.userClass},a.prototype.$isAnonymous=function(){return"anonymous"==this.uid},a.prototype.$isSpecial=function(){returnthis.userClass&&"public-user"==this.userClass},a.prototype.$confirmRights=function(a){varb=!1;return!this.$confirmation&&(_.some(_.values(this.rights))&&("anonymous"==this.uid?"AddressBook"==a.constructor.name?b=l('Potentially anyone on the Internet will be able to access your address book "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?',a.name):"Calendar"==a.constructor.name&&(b=l('Potentially anyone on the Internet will be able to access your calendar "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?',a.name)):"anyone"!=this.uid&&"<default>"!=this.uid||("AddressBook"==a.constructor.name?b=l('Any user with an account on this system will be able to access your address book "%{0}". Are you certain you trust them all?',a.name):"Calendar"==a.constructor.name?b=l('Any user with an account on this system will be able to access your calendar "%{0}". Are you certain you trust them all?',a.name):"Mailbox"==a.constructor.name&&(b=l('Any user with an account on this system will be able to access your mailbox "%{0}". Are you certain you trust them all?',a.name)))),this.$confirmation=b,b)},a.prototype.$rightsAreDirty=function(){returnthis.rights&&!_.isEqual(this.rights,this.$shadowRights)},a.prototype.$resetRights=function(a){varb=this;a?_.map(_.keys(this.rights),function(a){angular.isString(b.rights[a])?b.rights[a]="None":b.rights[a]=0}):this.$shadowRights&&(this.rights=angular.copy(this.$shadowRights))},a.prototype.$folders=function(b){varc=this,d=a.$q.defer(),e={type:b};returnthis.$$folders?d.resolve(this.$$folders):a.$$resource.userResource(this.uid).fetch(null,"foldersSearch",e).then(function(a){c.$$folders=a.folders,d.resolve(a.folders)}),d.promise},a.prototype.$omit=function(){vara={};returnangular.forEach(this,function(b,c){"constructor"!=c&&"$"!=c[0]&&(a[c]=b)}),a},a.prototype.toString=function(){return"[User "+this.c_email+"]"}}(),function(){"use strict";functiona(){functiona(a,b,c,d){vare,f=b.find("img"),g=b.find("md-icon"),h=angular.element(g[0]),i=angular.element(g[1]);c.size&&(f.attr("width",c.size),f.attr("height",c.size),h.css("font-size",c.size+"px"),i.css("font-size",parseInt(.4*c.size)+"px")),angular.isDefined(c.ngDisabled)&&(e=a.$watch(c.ngDisabled,function(a){c.disabled&&i.css({display:"block"}),e()})),d.img=f,d.genericImg=h}return{restrict:"AE",scope:{},bindToController:{size:"@",email:"=sgEmail",src:"=sgSrc"},transclude:!0,template:['<div class="sg-icon-badge-container">'," <md-icon ng-transclude></md-icon>",' <md-icon class="md-warn sg-icon--badge sg-icon--badge-bottom"',' style="display: none">not_interested</md-icon>',' <img class="ng-hide" ng-src="{{vm.url}}">',"</div>"].join(""),link:a,controller:"sgAvatarImageController",controllerAs:"vm"}}functionb(a,b,c,d,e,f){functiong(a){varb=f(a,k.size,e.defaults.SOGoAlternateAvatar);c({method:"GET",url:b,cache:!0,headers:{Accept:"image/*"}}).then(function(){k.url||(k.url=b,k.urlEmail=a,i())},function(){h()})}functionh(){k.url=null,k.urlEmail=null,k.img.addClass("ng-hide"),k.genericImg.removeClass("ng-hide")}functioni(){k.genericImg.addClass("ng-hide"),k.img.removeClass("ng-hide")}functionj(){b.addClass("sg-avatar-image--zoomable"),l=function(){b.toggleClass("sg-avatar-image--zoom")},b.on("click",l)}vark,l;k=this,a.$on("$destroy",function(){l&&b.off("click",l)}),a.$watch(function(){returnk.email},function(a,b){a&&k.urlEmail!=a?(h(),e.defaults.SOGoGravatarEnabled&&g(a)):a||h()}),"sg-src"inb[0].attributes&&a.$watch(function(){returnk.src},function(a){a&&(k.url=a,k.urlEmail=""+k.email,j(),i())})}b.$inject=["$scope","$element","$http","$q","Preferences","Gravatar"],angular.module("SOGo.Common").directive("sgAvatarImage",a).controller("sgAvatarImageController",b)}(),functi