a="tasks"),n(a,{reload:!0})}),a.$on("calendars:list",function(){k.$filter(F.componentType,{reload:!0})}),a.$on("calendar:dragend",x),b.$on("$destroy",function(){_.forEach(G,function(a){f.deregisterHotkey(a)})})}a.$inject=["$rootScope","$scope","$timeout","$state","$mdDialog","sgHotkeys","sgFocus","Dialog","Preferences","Calendar","Component"],angular.module("SOGo.SchedulerUI").controller("CalendarListController",a)}(),function(){"use strict";functiona(a,b,c,d,e,f,g,h,i,j,k,m,n,o){functionp(a,b,c){returna.sortableScope.element[0]==b.element[0]}functionq(){m.saveFoldersOrder(_.flatMap(m.$findAll(),"id"))}functionr(){G.sortableMode=!G.sortableMode,G.filter.name=""}functions(){m.saveFoldersOrder()}functiont(a){i.prompt(l("New calendar"),l("Name of the Calendar")).then(function(a){varb=newm({name:a,isEditable:!0,isRemote:!1,owner:UserLogin});b.$id().then(function(){m.$add(b)})})}functionu(){functiona(a,b,c,d){vare=this,f=c.split("/"),g=f[2];e.title=l("Please identify yourself to %{0}").formatted(g),e.authenticate=function(a){!a.$valid&&a.$error.required||d.setCredentials(e.username,e.password).then(function(a){b.hide()},function(b){a.password.$setValidity("credentials",!1)})},e.cancel=function(){b.cancel()}}i.prompt(l("Subscribe to a web calendar..."),l("URL of the Calendar"),{inputType:"url"}).then(function(b){m.$addWebCalendar(b).then(function(c){angular.isObject(c)&&d.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"UIxWebCalendarAuthDialog",controller:a,controllerAs:"$WebCalendarAuthDialogController",locals:{url:b,calendar:c}})})}),a.$inject=["scope","$mdDialog","url","calendar"]}functionv(a){a.isSubscription?a.$delete().catch(function(b,c){i.alert(l('An error occured while deleting the calendar "%{0}".',a.name),l(b.error))}):i.confirm(l("Warning"),l('Are you sure you want to delete the calendar "%{0}"?',a.name),{ok:l("Delete")}).then(function(){a.$delete().catch(function(b,c){i.alert(l('An error occured while deleting the calendar "%{0}".',a.name),l(b.error))})})}functionw(b,c){functione(b,c,d){functione(a){varb=0===a.type.indexOf("text")||/\.(ics)$/.test(a.name);returnb||f.show({template:["<md-toast>",' <div class="md-toast-content">',' <md-icon class="md-warn md-hue-1">error_outline</md-icon>'," <span>"+l("Select an iCalendar file (.ics).")+"</span>"," </div>","</md-toast>"].join(""),position:"top right",hideDelay:3e3}),b}varh=this;h.uploader=newg({url:ApplicationBaseURL+[d.id,"import"].join("/"),autoUpload:!0,queueLimit:1,filters:[{name:e,fn:e}],onSuccessItem:function(b,d,e,g){varh;c.hide(),0===d.imported?h=l("No event was imported."):(h=l("A total of %{0} events were imported in the calendar.",d.imported),a.$emit("calendars:list")),f.show(f.simple().content(h).position("top right").hideDelay(3e3))},onErrorItem:function(a,b,c,d){f.show({template:["<md-toast>",' <div class="md-toast-content">',' <md-icon class="md-warn md-hue-1">error_outline</md-icon>'," <span>"+l("An error occurred while importing calendar.")+"</span>"," </div>","</md-toast>"].join(""),position:"top right",hideDelay:3e3})}}),h.close=function(){c.hide()}}d.show({parent:angular.element(document.body),targetEvent:b,clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"UIxCalendarImportDialog",controller:e,controllerAs:"$CalendarImportDialogController",locals:{folder:c}}),e.$inject=["scope","$mdDialog","folder"]}functionx(a){_.forEach(m.$findAll(),function(b){a.id==b.id?b.active=1:b.active=0})}functiony(){_.forEach(m.$findAll(),function(a){a.active=1})}functionz(a){functionb(a,b){functionc(){a.hide()}vard=this;d.calendar=b,d.close=c}d.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:a.id+"/links",controller:b,controllerAs:"links",locals:{calendar:a}}),b.$inject=["$mdDialog","calendar"]}functionA(a){functionb(a,b,c){functiond(){f.calendar.$save(),c.init(f.calendar.$omit()),b.hide()}functione(){b.cancel()}varf=this;f.calendar=newm(c.$omit()),f.saveProperties=d,f.close=e,a.$watch(function(){returnf.calendar.color},