!function(){"use strict";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","$urlRouterProvider"];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.otherwise("/general")}t.$inject=["$rootScope"];functiont(e){e.$on("$routeChangeError",function(e,t,a,r){console.error(e,t,a,r)})}}(),function(){"use strict";e.$inject=["$mdDialog","$mdToast","FileUploader","Dialog","sgSettings","Account","defaults","account","accountId","mailCustomFromEnabled"];functione(e,t,a,r,n,i,s,o,c,d){varu=this;u.defaultPort=143,u.defaults=s,u.account=o,u.accountId=c,u.customFromIsReadonly=function(){return!(c>0||d)},u.onBeforeUploadCertificate=function(e){u.form=e,u.uploader.clearQueue()},u.certificateIsInstalled=function(){returnu.certificateFilename&&0===u.uploader.queue.length},u.removeCertificate=function(){newi({id:c}).$removeCertificate().then(function(){deleteu.certificateFilename})},u.importCertificate=function(){u.uploader.queue[0].formData=[{password:u.certificatePassword}],u.uploader.uploadAll()},u.cancel=function(){e.cancel()},u.save=function(){e.hide()},u.hostnameRE=c>0?/^(?!(127\.0\.0\.1|localhost(?:\.localdomain)?)$)/:/./,u.account.encryption?"ssl"==u.account.encryption&&(u.defaultPort=993):u.account.encryption="none",u.account.certificateFilename&&(u.certificateFilename=u.account.certificateFilename),u.uploader=newa({url:[n.activeUser("folderURL")+"Mail",c,"importCertificate"].join("/"),autoUpload:!1,queueLimit:1,filters:[{name:f,fn:f}],onAfterAddingFile:function(e){u.certificateFilename=e.file.name},onSuccessItem:function(e,a,r,n){vari=angular.element(document.getElementById("accountSecurityContent"));t.show(t.simple().content(l("Success")).parent(i).position("top right").hideDelay(3e3)),this.clearQueue()},onErrorItem:function(e,t,a,n){r.alert(l("Error"),l("An error occurred while importing the certificate. Verify your password."))}});functionf(e){vart=e.type.indexOf("pkcs12")>0||/\.(p12|pfx)$/.test(e.name);returnu.form.certificateFilename.$setValidity("fileformat",t),t}}angular.module("SOGo.PreferencesUI").controller("AccountDialogController",e)}(),function(){"use strict";e.$inject=["$scope","$window","$mdDialog","filter","mailboxes","labels"];functione(e,t,a,r,n,i){vars=this,o=t.sieveCapabilities,c=t.forwardEnabled;t.vacationEnabled;s.filter=r,s.mailboxes=n,s.labels=i,s.cancel=function(){a.cancel()},s.hasRulesAndActions=function(){vare=[s.filter.actions];"allmessages"!=s.filter.match&&e.push(s.filter.rules);return_.every(e,function(e){returne&&e.length>0})},s.save=function(e){a.hide()},s.addMailFilterRule=function(e){s.filter.rules||(s.filter.rules=[]);s.filter.rules.push({field:"subject",operator:"contains"})},s.removeMailFilterRule=function(e){s.filter.rules.splice(e,1)},s.addMailFilterAction=function(e){s.filter.actions||(s.filter.actions=[]);s.filter.actions.push({method:"discard"})},s.removeMailFilterAction=function(e){s.filter.actions.splice(e,1)},s.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")},o.indexOf("body")>-1&&(s.fieldLabels.body=l("Body")),s.methodLabels={discard:l("Discard the message"),keep:l("Keep the message"),stop:l("Stop processing filter rules")},c&&(s.methodLabels.redirect=l("Forward the message to")),o.indexOf("reject")>-1&&(s.methodLabels.reject=l("Send a reject message")),o.indexOf("fileinto")>-1&&(s.methodLabels.fileinto=l("Filet