!function(){"use strict";functione(e,t){e.state("preferences",{abstract:!0,views:{preferences:{templateUrl:"preferences.html",controller:"PreferencesController",controllerAs:"app"}}}).state("preferences.general",{url:"/general",views:{module:{templateUrl:"generalPreferences.html"}}}).state("preferences.calendars",{url:"/calendars",views:{module:{templateUrl:"calendarsPreferences.html"}}}).state("preferences.addressbooks",{url:"/addressbooks",views:{module:{templateUrl:"addressbooksPreferences.html"}}}).state("preferences.mailer",{url:"/mailer",views:{module:{templateUrl:"mailerPreferences.html"}}}),t.rules.otherwise("/general")}functiont(e,t,a,r){e.DebugEnabled||r.defaultErrorHandler(function(){}),a.onError({to:"preferences.**"},function(e){"preferences"==e.to().name||e.ignored()||(t.error("transition error to "+e.to().name+": "+e.error().detail),r.go({state:"preferences"}))})}angular.module("SOGo.PreferencesUI",["ui.router","ck","angularFileUpload","SOGo.Common","SOGo.MailerUI","SOGo.ContactsUI","SOGo.Authentication","as.sortable"]).config(e).run(t),e.$inject=["$stateProvider","$urlServiceProvider"],t.$inject=["$window","$log","$transitions","$state"]}(),function(){"use strict";functione(i,e,t,s,a,r,n,o,c,d){varf=this,u=newr({id:c,security:o.security});functionh(){f.account.security&&f.account.security.hasCertificate&&u.$certificate().then(function(e){f.certificate=e},function(){deletef.account.security.hasCertificate})}functionp(e){vart=0<e.type.indexOf("pkcs12")||/\.(p12|pfx)$/.test(e.name);returnf.form.certificateFilename.$setValidity("fileformat",t),t}f.defaultPort=143,f.defaults=n,f.account=o,f.accountId=c,f.customFromIsReadonly=function(){return!(0<c||d)},f.onBeforeUploadCertificate=function(e){f.form=e,f.uploader.clearQueue()},f.removeCertificate=function(){u.$removeCertificate().then(function(){deletef.account.security.hasCertificate})},f.importCertificate=function(){f.uploader.queue[0].formData=[{password:f.certificatePassword}],f.uploader.uploadItem(0)},f.cancel=function(){e.cancel()},f.save=function(){e.hide()},f.hostnameRE=0<c?/^(?!(127\.0\.0\.1|localhost(?:\.localdomain)?)$)/:/./,f.account.encryption?"ssl"==f.account.encryption&&(f.defaultPort=993):f.account.encryption="none",h(),f.uploader=newt({url:[a.activeUser("folderURL")+"Mail",c,"importCertificate"].join("/"),autoUpload:!1,queueLimit:1,filters:[{name:p,fn:p}],onAfterAddingFile:function(e){f.certificateFilename=e.file.name},onSuccessItem:function(e,t,a,r){this.clearQueue(),i(function(){_.assign(f.account,{security:{hasCertificate:!0}})}),h()},onErrorItem:function(e,t,a,r){s.alert(l("Error"),l("An error occurred while importing the certificate. Verify your password."))}})}e.$inject=["$timeout","$mdDialog","FileUploader","Dialog","sgSettings","Account","defaults","account","accountId","mailCustomFromEnabled"],angular.module("SOGo.PreferencesUI").controller("AccountDialogController",e)}(),function(){"use strict";functione(e,t,a,r,i,s){varn=this,o=t.sieveCapabilities,c=t.forwardEnabled;t.vacationEnabled;n.filter=r,n.mailboxes=i,n.labels=s,n.cancel=function(){a.cancel()},n.hasRulesAndActions=function(){vare=[n.filter.actions];"allmessages"!=n.filter.match&&e.push(n.filter.rules);return_.every(e,function(e){returne&&0<e.length})},n.save=function(e){a.hide()},n.addMailFilterRule=function(e){n.filter.rules||(n.filter.rules=[]);n.filter.rules.push({field:"subject",operator:"contains"})},n.removeMailFilterRule=function(e){n.filter.rules.splice(e,1)},n.addMailFilterAction=function(e){n.filter.actions||(n.filter.actions=[]);n.filter.actions.push({method:"discard"})},n.removeMailFilterAction=function(e){n.filter.actions.splice(e,1)},n.fieldLabels={subject:l("Subject"),from:l("From"),to:l("To"),cc:l("Cc"),to_or_cc:l("To or Cc"),size:l("Size (Kb)"),header:l("Header")},-1<o.indexOf("body")&&(n.fieldLabels.body=l("Body")),n.methodLabels={discard:l("Discard the message"),keep:l("Keep the message"),stop:l("Stop processing filter rules")},c&&(n.methodLabels.redirect=l("Forward the message to")),-1<o.indexOf("reject")&&(n.methodLabels.reject=l("Sendare