. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 85.13.141.101  /  Your IP : 216.73.216.170   [ Reverse IP ]
Web Server : Apache
System : Linux dd40236 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
User : w00ad34b ( 1052)
PHP Version : 8.2.30-nmm1
Disable Function : NONE
Domains : 429 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/htdocs/w00ad34b/spd-cloud/apps/tasks/js/public/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /www/htdocs/w00ad34b/spd-cloud/apps/tasks/js/public/app.min.js
!function(y,f,d){"use strict";y("#content.app-tasks").attr("ng-app","Tasks"),y("#content.app-tasks").attr("ng-cloak"),y("#content.app-tasks").attr("ng-controller","AppController"),y("#content.app-tasks").attr("ng-click","closeAll($event)"),y("#content.app-tasks").addClass("handler"),angular.module("Tasks",["ngRoute","ngAnimate","ui.select","ngSanitize","dndLists"]).config(["$provide","$routeProvider","$interpolateProvider","$httpProvider",function(t,e,r,s){t.value("Config",{markReadTimeout:500,taskUpdateInterval:6e5}),s.defaults.headers.common.requesttoken=f,e.when("/calendars/:calendarID",{}).when("/calendars/:calendarID/edit/:listparameter",{}).when("/calendars/:calendarID/tasks/:taskID",{}).when("/calendars/:calendarID/tasks/:taskID/settings",{}).when("/calendars/:calendarID/tasks/:taskID/edit/:parameter",{}).when("/collections/:collectionID/tasks/:taskID",{}).when("/collections/:collectionID/tasks/:taskID/settings",{}).when("/collections/:collectionID/tasks/:taskID/edit/:parameter",{}).when("/collections/:collectionID",{}).when("/search/:searchString",{}).when("/search/:searchString/tasks/:taskID",{}).when("/search/:searchString/tasks/:taskID/edit/:parameter",{}).otherwise({redirectTo:"/collections/all"})}]),angular.module("Tasks").run(["$document","$rootScope","Config","$timeout","ListsBusinessLayer","TasksBusinessLayer","SearchBusinessLayer",function(e,r,s,n,a,o,i){var u;return(u=function(){return!0,function(){return n(u,s.taskUpdateInterval)}()}).call(),OCA.Search.tasks=i,e.click(function(t){r.$broadcast("documentClicked",t)}),moment.locale("details",{calendar:{lastDay:"["+t("tasks","Due yesterday")+"], HH:mm",sameDay:"["+t("tasks","Due today")+"], HH:mm",nextDay:"["+t("tasks","Due tomorrow")+"], HH:mm",lastWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm",nextWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm",sameElse:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm"}}),moment.locale("details_allday",{calendar:{lastDay:"["+t("tasks","Due yesterday")+"]",sameDay:"["+t("tasks","Due today")+"]",nextDay:"["+t("tasks","Due tomorrow")+"]",lastWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY",nextWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY",sameElse:"["+t("tasks","Due on")+"] MMM DD, YYYY"}}),moment.locale("start",{calendar:{lastDay:"["+t("tasks","Started yesterday")+"], HH:mm",sameDay:"["+t("tasks","Starts today")+"], HH:mm",nextDay:"["+t("tasks","Starts tomorrow")+"], HH:mm",lastWeek:"["+t("tasks","Started on")+"] MMM DD, YYYY, HH:mm",nextWeek:"["+t("tasks","Starts on")+"] MMM DD, YYYY, HH:mm",sameElse:function(){return 0<this.diff(moment())?"["+t("tasks","Starts on")+"] MMM DD, YYYY, HH:mm":"["+t("tasks","Started on")+"] MMM DD, YYYY, HH:mm"}}}),moment.locale("start_allday",{calendar:{lastDay:"["+t("tasks","Started yesterday")+"]",sameDay:"["+t("tasks","Starts today")+"]",nextDay:"["+t("tasks","Starts tomorrow")+"]",lastWeek:"["+t("tasks","Started on")+"] MMM DD, YYYY",nextWeek:"["+t("tasks","Starts on")+"] MMM DD, YYYY",sameElse:function(){return 0<this.diff(moment())?"["+t("tasks","Starts on")+"] MMM DD, YYYY":"["+t("tasks","Started on")+"] MMM DD, YYYY"}}}),moment.locale("reminder",{calendar:{lastDay:t("tasks","[Remind me yesterday at ]HH:mm"),sameDay:t("tasks","[Remind me today at ]HH:mm"),nextDay:t("tasks","[Remind me tomorrow at ]HH:mm"),lastWeek:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm"),nextWeek:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm"),sameElse:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm")}}),moment.locale("tasks",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"]",nextDay:"["+t("tasks","Tomorrow")+"]",lastWeek:"DD.MM.YYYY",nextWeek:"DD.MM.YYYY",sameElse:"DD.MM.YYYY"}}),moment.locale("details_short",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"]",nextDay:"["+t("tasks","Tomorrow")+"]",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY",sameElse:"MMM DD, YYYY"}}),moment.locale("list_week",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"], MMM. DD",nextDay:"["+t("tasks","Tomorrow")+"], MMM. DD",lastWeek:"ddd, MMM. DD",nextWeek:"ddd, MMM. DD",sameElse:"ddd, MMM. DD"}}),moment.locale("en",{relativeTime:{future:t("tasks","in %s"),past:t("tasks","%s ago"),s:t("tasks","seconds"),m:t("tasks","a minute"),mm:t("tasks","%d minutes"),h:t("tasks","an hour"),hh:t("tasks","%d hours"),d:t("tasks","a day"),dd:t("tasks","%d days"),M:t("tasks","a month"),MM:t("tasks","%d months"),y:t("tasks","a year"),yy:t("tasks","%d years")}})}]),angular.module("Tasks").controller("AppController",["$scope","$rootScope","ListsBusinessLayer","$route","Status","$timeout","$location","$routeParams","Loading","SettingsModel","Persistence",function(c,t,e,r,s,n,a,o,i,u,l){return new function(e,r,t,s,n,a,o,i,u,l,d){this._$scope=e,this._$listsbusinesslayer=t,this._$route=s,this._$status=n,this._$timeout=a,this._$location=o,this._$routeparams=i,this._Loading=u,this._$settingsmodel=l,this._persistence=d,this._$scope.status=this._$status.getStatus(),this._$scope.route=this._$routeparams,this._$scope.status.newListName="",this._$scope.settingsmodel=this._$settingsmodel,this._$listsbusinesslayer.init().then(function(t){Promise.all(t).then(function(){c.$apply()})}),this._persistence.init(),this._$scope.closeAll=function(t){(y(t.target).closest(".close-all").length||y(t.currentTarget).is(y(t.target).closest(".handler")))&&(angular.isUndefined(e.route.calendarID)?angular.isUndefined(e.route.collectionID)?o.path("/collections/all"):o.path("/collections/"+e.route.collectionID):("name"===e.route.listparameter&&r.$broadcast("cancelEditCalendar",e.route.calendarID),o.path("/calendars/"+e.route.calendarID)),e.status.addingList=!1,e.status.focusTaskInput=!1,e.status.newListName=""),y(t.target).closest(".newList").length||(e.status.addingList=!1,e.status.newListName=""),y(t.target).closest(".add-subtask").length||(e.status.addSubtaskTo=null,e.status.focusSubtaskInput=!1)},this._$scope.isLoading=function(){return u.isLoading()}}(c,t,e,r,s,n,a,o,i,u,l)}]),angular.module("Tasks").controller("DetailsController",["$scope","$window","TasksModel","TasksBusinessLayer","$route","$location","$timeout","$routeParams","SettingsModel","Loading","ListsModel",function(p,e,r,s,n,m,a,o,i,u,l){return new function(s,e,r,n,a,o,i,u,l,d,c){this._$scope=s,this._$window=e,this._$tasksmodel=r,this._$listsmodel=c,this._tasksbusinesslayer=n,this._$route=a,this._$location=o,this._$timeout=i,this._$routeparams=u,this._$settingsmodel=l,this._Loading=d,this._$scope.task=r.getById(s.route.taskID),this._$scope.found=!0,this._$scope.$on("$routeChangeSuccess",function(){var t=r.getByUri(s.route.taskID);angular.isUndefined(t)||null===t?void 0!==s.route.taskID&&(s.found=!1):(s.task=t,s.task.cats=t.categories,s.found=!0)}),this._$scope.settingsmodel=this._$settingsmodel,this._$scope.settingsmodel.add({id:"various",categories:[]}),this._$scope.isAddingComment=!1,this._$scope.timers=[],this._$scope.durations=[{name:t("tasks","week"),names:t("tasks","weeks"),id:"week"},{name:t("tasks","day"),names:t("tasks","days"),id:"day"},{name:t("tasks","hour"),names:t("tasks","hours"),id:"hour"},{name:t("tasks","minute"),names:t("tasks","minutes"),id:"minute"},{name:t("tasks","second"),names:t("tasks","seconds"),id:"second"}],this._$scope.loadTask=function(t){var e=r.getByUri(s.route.taskID);angular.isUndefined(e)||null===e||(s.task=e,s.found=!0)},this._$scope.TaskState=function(){return s.found?"found":d.isLoading()?"loading":null},this._$scope.params=[{name:t("tasks","before beginning"),invert:!0,related:"START",id:"10"},{name:t("tasks","after beginning"),invert:!1,related:"START",id:"00"},{name:t("tasks","before end"),invert:!0,related:"END",id:"11"},{name:t("tasks","after end"),invert:!1,related:"END",id:"01"}],this._$scope.filterParams=function(t){var e;if(e=r.getById(s.route.taskID),!angular.isUndefined(e)&&null!==e)return e.due&&e.start?t:e.start?t.slice(0,2):t.slice(2)},this._$scope.deleteTask=function(t){return i(function(){return n.deleteTask(t).then(function(){return p.$apply()})},500)},this._$scope.triggerUpdate=function(t){n.triggerUpdate(t)},this._$scope.editName=function(t,e){e.calendar.writable&&(y(t.target).is("a")||s.setEditRoute("name"))},this._$scope.editDueDate=function(t,e){e.calendar.writable&&y(t.currentTarget).is(y(t.target).closest(".handler"))&&(s.setEditRoute("duedate"),n.initDueDate(e))},this._$scope.editStart=function(t,e){e.calendar.writable&&y(t.currentTarget).is(y(t.target).closest(".handler"))&&(s.setEditRoute("startdate"),n.initStartDate(e))},this._$scope.editReminder=function(t,e){if(e.calendar.writable&&y(t.currentTarget).is(y(t.target).closest(".handler")))return s.setEditRoute("reminer"),n.initReminder(s.route.taskID)},this._$scope.editNote=function(t,e){e.calendar.writable&&y(t.currentTarget).is(y(t.target).closest(".handler"))&&(y(t.target).is("a")||s.setEditRoute("note"))},this._$scope.editPriority=function(t,e){e.calendar.writable&&y(t.currentTarget).is(y(t.target).closest(".handler"))&&s.setEditRoute("priority")},this._$scope.editPercent=function(t,e){e.calendar.writable&&y(t.currentTarget).is(y(t.target).closest(".handler"))&&s.setEditRoute("percent")},this._$scope.endEdit=function(t){(y(t.target).closest(".end-edit").length||y(t.currentTarget).is(y(t.target).closest(".handler")))&&s.resetRoute()},this._$scope.endName=function(t){if(13===t.keyCode&&(t.preventDefault(),s.resetRoute()),27===t.keyCode)return s.resetRoute()},this._$scope.setEditRoute=function(t){var e=s.route.calendarID,r=s.route.collectionID;e?m.path("/calendars/"+e+"/tasks/"+s.route.taskID+"/edit/"+t):r&&m.path("/collections/"+r+"/tasks/"+s.route.taskID+"/edit/"+t)},this._$scope.resetRoute=function(){var t=s.route.calendarID,e=s.route.collectionID;t?m.path("/calendars/"+t+"/tasks/"+s.route.taskID):e&&m.path("/collections/"+e+"/tasks/"+s.route.taskID)},this._$scope.deletePercent=function(t){return n.setPercentComplete(t,0)},this._$scope.deleteReminder=function(){return n.deleteReminderDate(s.route.taskID)},this._$scope.toggleCompleted=function(t){t.completed?n.setPercentComplete(t,0):n.setPercentComplete(t,100)},this._$scope.setPercentComplete=function(t,e){n.setPercentComplete(t,e)},this._$scope.toggleStarred=function(t){5<t.priority?n.setPriority(t,0):n.setPriority(t,9)},this._$scope.deletePriority=function(t){return n.setPriority(t,0)},this._$scope.isDue=function(t){return r.due(t)},this._$scope.isOverDue=function(t){return r.overdue(t)},this._$scope.setstartday=function(t){return n.setStart(s.task,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setstarttime=function(t){return n.setStart(s.task,moment(t,"HH:mm"),"time")},this._$scope.deleteStartDate=function(t){n.deleteStartDate(t)},this._$scope.setdueday=function(t){return n.setDue(s.task,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setduetime=function(t){return n.setDue(s.task,moment(t,"HH:mm"),"time")},this._$scope.deleteDueDate=function(t){n.deleteDueDate(t)},this._$scope.isAllDayPossible=function(t){return!angular.isUndefined(t)&&t.calendar.writable&&(t.due||t.start)},this._$scope.toggleAllDay=function(t){n.setAllDay(t,!t.allDay)},this._$scope.setreminderday=function(t){return n.setReminderDate(s.route.taskID,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setremindertime=function(t){return n.setReminderDate(s.route.taskID,moment(t,"HH:mm"),"time")},this._$scope.reminderType=function(t){if(!angular.isUndefined(t))return null===t.reminder?moment(t.start,"YYYYMMDDTHHmmss").isValid()||moment(t.due,"YYYYMMDDTHHmmss").isValid()?"DURATION":"DATE-TIME":t.reminder.type},this._$scope.changeReminderType=function(t){return n.checkReminderDate(t.id),"DURATION"===this.reminderType(t)?t.reminder?t.reminder.type="DATE-TIME":t.reminder={type:"DATE-TIME"}:t.reminder?t.reminder.type="DURATION":t.reminder={type:"DURATION"},n.setReminder(t.id)},this._$scope.setReminderDuration=function(t){return n.setReminder(s.route.taskID)},this._$scope.addComment=function(){var t;s.CommentContent&&(s.isAddingComment=!0,t={tmpID:"newComment"+Date.now(),comment:s.CommentContent,taskID:s.route.taskID,time:moment().format("YYYYMMDDTHHmmss"),name:y("#expandDisplayName").text()},n.addComment(t,function(t){r.updateComment(t),s.isAddingComment=!1},function(){s.isAddingComment=!1}),s.CommentContent="")},this._$scope.sendComment=function(t){if(13===t.keyCode)return s.addComment()},this._$scope.deleteComment=function(t){return n.deleteComment(s.route.taskID,t)},this._$scope.commentStrings=function(){return{button:t("tasks","Comment"),input:t("tasks","Add a comment")}},this._$scope.addCategory=function(t,e){s.task.categories=s.task.cats;var r=s.settingsmodel.getById("various").categories;r.indexOf(t)<0&&r.push(t),n.doUpdate(s.task)},this._$scope.removeCategory=function(t,e){s.task.categories=s.task.cats,n.doUpdate(s.task)}}(p,e,r,s,n,m,a,o,i,u,l)}]),angular.module("Tasks").controller("ListController",["$scope","$rootScope","$window","$routeParams","ListsModel","TasksBusinessLayer","CollectionsModel","ListsBusinessLayer","$location","SearchBusinessLayer","CalendarService","TasksModel","$timeout",function(h,e,f,r,s,n,a,o,i,u,l,d,c){return new function(o,e,r,s,i,u,n,a,l,d,c,p,m){this._$scope=o,this._$window=r,this._$routeParams=s,this._$listsmodel=i,this._$tasksmodel=p,this._$tasksbusinesslayer=u,this._$collectionsmodel=n,this._$listsbusinesslayer=a,this.$location=l,this._$timeout=m,this._$searchbusinesslayer=d,this._$calendarservice=c,this._$scope.collections=this._$collectionsmodel.getAll(),this._$scope.calendars=this._$listsmodel.getAll(),this._$scope.draggedTasks=[],this._$scope.TasksBusinessLayer=this._$tasksbusinesslayer,this._$scope.nameError=!1,this._$scope.color="#31CC7C",this._$scope.deleteMessage=function(e){return t("tasks",'This will delete the calendar "%s" and all corresponding events and tasks.').replace("%s",e.displayname)},this._$scope.delete=function(t){return a.delete(t).then(function(){return l.path("/calendars/"+i.getStandardList().uri),h.$apply()})},this._$scope.startCreate=function(t){o.status.addingList=!0,o.nameError=!1,y(".hasTooltip").tooltip("hide"),m(function(){y("#newList").focus()},50),t.stopPropagation()},this._$scope.create=function(){o.isNameAllowed(o.status.newListName).allowed&&(o.status.addingList=!1,o.isAddingList=!0,a.add(o.status.newListName,o.color).then(function(t){return l.path("/calendars/"+t.uri),h.$apply()}),o.status.newListName="")},this._$scope.cancelCreate=function(){y(".hasTooltip").tooltip("hide"),o.nameError=!1,o.status.addingList=!1,o.status.newListName=""},this._$scope.startEdit=function(t,e){o.status.addingList=!1,o.nameError=!1,y(".hasTooltip").tooltip("hide"),e.prepareUpdate(),l.path("/calendars/"+o.route.calendarID+"/edit/name"),m(function(){y("#list_"+e.uri+" input.edit").focus()},50),t.stopPropagation()},this._$scope.showCalDAVUrl=function(t,e){o.status.addingList=!1,o.nameError=!1,l.path("/calendars/"+o.route.calendarID+"/edit/caldav"),m(function(){y("#list_"+e.uri+" input.caldav").focus()},50),t.stopPropagation()},this._$scope.hideCalDAVUrl=function(){l.path("/calendars/"+o.route.calendarID)},this._$scope.download=function(t){var e=t.url;"/"===e.slice(e.length-1)&&(e=e.slice(0,e.length-1)),e+="?export",f.open(e)},this._$scope.checkNew=function(t,e){o.checkName(t,e)},this._$scope.checkEdit=function(t,e){o.checkName(t,e.displayname,e.uri),27===t.keyCode&&o.cancelEdit(e)},this._$scope.checkName=function(t,e,r){var s=o.isNameAllowed(e,r),n=y(t.currentTarget);s.allowed?(n.tooltip("hide"),o.nameError=!1):(n.attr("title",s.msg).tooltip({placement:"bottom",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),o.nameError=!0),27===t.keyCode&&(t.preventDefault(),n.tooltip("hide"),o.status.addingList=!1,o.status.newListName="",o.nameError=!1)},e.$on("cancelEditCalendar",function(t,e){var r=i.getByUri(e);o.cancelEdit(r)}),this._$scope.cancelEdit=function(t){t.resetToPreviousState(),y(".hasTooltip").tooltip("hide"),o.nameError=!1,l.path("/calendars/"+o.route.calendarID)},this._$scope.saveEdit=function(t){o.isNameAllowed(t.displayname,t.uri).allowed&&(a.rename(t),l.path("/calendars/"+o.route.calendarID))},this._$scope.isNameAllowed=function(e,r){var s={allowed:!1,msg:""};return i.isNameAlreadyTaken(e,r)?s.msg=t("tasks",'The name "%s" is already used.').replace("%s",e):e?s.allowed=!0:s.msg=t("tasks","An empty name is not allowed."),s},this._$scope.getCollectionCount=function(t){var e;return e=d.getFilter(),n.getCount(t,e)},this._$scope.hideCollection=function(t){switch(n.getById(t).show){case 0:return!0;case 1:return!1;case 2:return this.getCollectionCount(t)<1}},this._$scope.getCollectionString=function(t){var e;return"completed"!==t?(e=d.getFilter(),n.getCount(t,e)):""},this._$scope.getListCount=function(t,e){var r;return r=d.getFilter(),i.getCount(t,e,r)},this._$scope.dragoverList=function(t,e){var r=y(t.target).closest("li.list").attr("calendarID");return i.getByUri(r).writable},this._$scope.dropList=function(t,e,r){if("move"===t.dataTransfer.dropEffect){var s=p.getByUri(r.uri),n=y(t.target).closest("li.list").attr("calendarID"),a=i.getByUri(n);u.changeCalendar(s,a).then(function(){o.$apply()})}return!0},this._$scope.dragoverCollection=function(t,e){return!("copy"===t.dataTransfer.effectAllowed||"copyMove"===t.dataTransfer.effectAllowed&&t.ctrlKey||"starred"!==(r=y(t.target).closest("li.collection").attr("collectionID"))&&"completed"!==r&&"today"!==r);var r},this._$scope.dropCollection=function(t,e,r){if("move"===t.dataTransfer.dropEffect){var s=y(t.target).closest("li.collection").attr("collectionID");u.changeCollection(r.uri,s)}return!0}}(h,e,f,r,s,n,a,o,i,u,l,d,c)}]),angular.module("Tasks").controller("SettingsController",["$scope","$window","Status","$location","CollectionsModel","SettingsBusinessLayer","SettingsModel",function(e,r,s,n,a,o,i){return new function(e,r,s,n,a,o,i){this._$scope=e,this._$window=r,this._$status=s,this._$location=n,this._$collectionsmodel=a,this._$settingsbusinesslayer=o,this._$settingsmodel=i,this._$scope.status=this._$status.getStatus(),this._$scope.collections=this._$collectionsmodel.getAll(),this._$scope.settingsmodel=this._$settingsmodel,this._$scope.collectionOptions=[{id:0,name:t("tasks","Hidden")},{id:1,name:t("tasks","Visible")},{id:2,name:t("tasks","Automatic")}],this._$scope.startOfWeekOptions=[{id:0,name:t("tasks","Sunday")},{id:1,name:t("tasks","Monday")},{id:2,name:t("tasks","Tuesday")},{id:3,name:t("tasks","Wednesday")},{id:4,name:t("tasks","Thursday")},{id:5,name:t("tasks","Friday")},{id:6,name:t("tasks","Saturday")}],this._$scope.setVisibility=function(t){var e;return e=a.getById(t),o.setVisibility(t,e.show)},this._$scope.setStartOfWeek=function(){return o.set("various","startOfWeek",i.getById("various").startOfWeek)}}(e,r,s,n,a,o,i)}]),function(){var g=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};angular.module("Tasks").controller("TasksController",["$scope","$window","$routeParams","TasksModel","ListsModel","CollectionsModel","TasksBusinessLayer","$location","SettingsBusinessLayer","SearchBusinessLayer","VTodo","SettingsModel",function(h,e,r,s,a,o,i,u,l,d,f,c){return new function(o,e,r,u,l,s,d,a,i,c,p,m){this._$scope=o,this._$window=e,this._$routeParams=r,this._$tasksmodel=u,this._$listsmodel=l,this._$collectionsmodel=s,this._tasksbusinesslayer=d,this.$location=a,this._settingsbusinesslayer=i,this._searchbusinesslayer=c,this._vtodo=p,this._$scope.tasks=this._$tasksmodel.getAll(),this._$scope.draggedTasks=[],this._$scope.calendars=this._$listsmodel.getAll(),this._$scope.days=[0,1,2,3,4,5,6],this._$scope.isAddingTask=!1,this._$scope.focusInputField=!1,this._$scope.TasksModel=this._$tasksmodel,this._$scope.TasksBusinessLayer=this._tasksbusinesslayer,this._$settingsmodel=m,this._$scope.addTask=function(t,e,r,s){var n;null===r&&(r="");var a={calendar:null,related:e,summary:t,priority:"0",due:!(o.isAddingTask=!0),start:!1,reminder:null,completed:!1,complete:"0",note:""};"starred"===(n=o.route.collectionID)||"today"===n||"week"===n||"all"===n||"completed"===n||"current"===n?(a.calendar=e?r:l.getStandardList(),"starred"===o.route.collectionID&&(a.priority="1"),"today"===o.route.collectionID&&(a.due=moment().startOf("day").format("YYYY-MM-DDTHH:mm:ss")),"current"===o.route.collectionID&&(a.start=moment().format("YYYY-MM-DDTHH:mm:ss"))):a.calendar=l.getByUri(o.route.calendarID),a=f.create(a),d.add(a).then(function(t){return o.isAddingTask=!1,o.openDetails(t.uri,null),h.$apply()}),s&&d.setHideSubtasks(s,0),o.status.focusTaskInput=!1,o.status.focusSubtaskInput=!1,o.status.addSubtaskTo=null,o.status.taskName="",o.status.subtaskName=""},this._$scope.getAddString=function(){var e=l.getStandardList();if(angular.isDefined(e))if(angular.isDefined(o.route.collectionID))switch(o.route.collectionID){case"starred":return t("tasks",'Add an important item in "%s"...').replace("%s",e.displayname);case"today":return t("tasks",'Add an item due today in "%s"...').replace("%s",e.displayname);case"all":return t("tasks",'Add an item in "%s"...').replace("%s",e.displayname);case"current":return t("tasks",'Add a current item in "%s"...').replace("%s",e.displayname);case"completed":case"week":return null}else if(angular.isDefined(l.getByUri(o.route.calendarID)))return t("tasks",'Add an item in "%s"...').replace("%s",l.getByUri(o.route.calendarID).displayname)},this._$scope.getSubAddString=function(e){return t("tasks",'Add a subtask to "%s"...').replace("%s",e)},this._$scope.showSubtaskInput=function(t){o.status.addSubtaskTo=t},this._$scope.hideSubtasks=function(t){var e=o.route.taskID,r=u.getDescendantIDs(t);return t.uri!==e&&!(0<=g.call(r,e))&&t.hideSubtasks},this._$scope.showInput=function(){var t=o.route.collectionID,e=l.getByUri(o.route.calendarID);return"completed"!==t&&"week"!==t&&(!angular.isDefined(e)||e.writable)},this._$scope.focusTaskInput=function(){o.status.focusTaskInput=!0},this._$scope.focusSubtaskInput=function(){o.status.focusSubtaskInput=!0},this._$scope.openDetails=function(t,e){var r=o.route.calendarID,s=o.route.collectionID;if(null===e||y(e.currentTarget).is(y(e.target).closest(".handler"))){var n=u.getByUri(t);n.loadedCompleted||d.getAll(n.calendar,!0,n).then(function(){n.loadedCompleted=!0,h.$apply()}),r?a.path("/calendars/"+r+"/tasks/"+t):s&&a.path("/collections/"+s+"/tasks/"+t)}},this._$scope.toggleCompleted=function(t){t.completed?d.setPercentComplete(t,0):d.setPercentComplete(t,100)},this._$scope.toggleStarred=function(t){5<t.priority?d.setPriority(t,0):d.setPriority(t,9)},this._$scope.toggleHidden=function(){return i.toggle("various","showHidden")},this._$scope.filterTasks=function(t,e){return function(t){return u.filterTasks(t,e)}},this._$scope.getSubTasks=function(t,e){var r,s,n,a;for(r=[],n=0,a=t.length;n<a;n++)(s=t[n]).related!==e.uid||s===e||e.hideCompletedSubtasks&&s.completed||r.push(s);return r},this._$scope.hasNoParent=function(t){return function(t){return u.hasNoParent(t)}},this._$scope.hasSubtasks=function(t){return u.hasSubtasks(t.uid)},this._$scope.hasCompletedSubtasks=function(t){return u.hasCompletedSubtasks(t.uid)},this._$scope.toggleSubtasks=function(t){d.setHideSubtasks(t,!t.hideSubtasks)},this._$scope.toggleCompletedSubtasks=function(t){d.setHideCompletedSubtasks(t,!t.hideCompletedSubtasks)},this._$scope.filterTasksByString=function(t){return function(t){var e=c.getFilter();return u.filterTasksByString(t,e)}},this._$scope.filteredTasks=function(){var t;return t=c.getFilter(),u.filteredTasks(t)},this._$scope.dayHasEntry=function(){return function(t){var e,r,s,n,a;for(e=c.getFilter(),n=0,a=(s=u.filteredTasks(e)).length;n<a;n++)if(!(r=s[n]).completed&&u.hasNoParent(r)&&u.taskAtDay(r,t))return!0;return!1}},this._$scope.taskAtDay=function(t,e){return function(t){return u.taskAtDay(t,e)}},this._$scope.filterLists=function(){return function(t){return o.getCount(t.uri,o.route.collectionID)}},this._$scope.getCount=function(t,e){var r=c.getFilter();return l.getCount(t,e,r)},this._$scope.getCountString=function(t,e){var r=c.getFilter();return n("tasks","%n Completed Task","%n Completed Tasks",l.getCount(t,e,r))},this._$scope.checkTaskInput=function(t){27===t.keyCode&&(y(t.currentTarget).blur(),o.status.taskName="",o.status.subtaskName="",o.status.addSubtaskTo=null,o.status.focusTaskInput=!1,o.status.focusSubtaskInput=!1)},this._$scope.getCompletedTasks=function(t){var e=l.getById(t);d.getAll(e,!0).then(function(){l.setLoadedCompleted(t),h.$apply()})},this._$scope.loadedCompleted=function(t){return l.loadedCompleted(t)},this._$scope.sortDue=function(t){return null===t.due?"last":t.due},this._$scope.sortStart=function(t){return null===t.start?"last":t.start},this._$scope.getSortOrder=function(){switch(o.settingsmodel.getById("various").sortOrder){case"due":return o.sortDue;case"start":return o.sortStart;case"priority":return"-priority";case"alphabetically":return"summary";case"manual":return"manual";default:return["completed",o.sortDue,"-priority",o.sortStart,"summary"]}},this._$scope.getSortOrderIcon=function(){switch(o.settingsmodel.getById("various").sortOrder){case"due":case"start":return"icon-calendar";case"priority":return"icon-task-star";case"alphabetically":return"icon-alphabetically";case"manual":return"icon-manual";default:return"icon-list"}},this._$scope.setSortOrder=function(t,e){o.settingsmodel.getById("various").sortDirection=o.settingsmodel.getById("various").sortOrder===e?+!o.settingsmodel.getById("various").sortDirection:0,o.settingsmodel.getById("various").sortOrder=e,i.set("various","sortOrder",e),i.set("various","sortDirection",o.settingsmodel.getById("various").sortDirection)},this._$scope.dropAsSubtask=function(t,e,r){if("move"===t.dataTransfer.dropEffect){var s=y(t.target).closest(".task-item").attr("taskID"),n=u.getByUri(e.uri),a=u.getByUri(s);d.changeParent(n,a)}return y(".subtasks-container").removeClass("dropzone-visible"),!0},this._$scope.dropAsRootTask=function(t,e,r){if("move"===t.dataTransfer.dropEffect){var s=u.getByUri(e.uri),n=y(t.target).closest("ol[dnd-list]").attr("collectionID"),a=y(t.target).closest("ol[dnd-list]").attr("calendarID"),o=l.getByUri(a),i=d.makeRootTask(s,o,n);Promise.all(i).then(function(){h.$apply()})}return y(".subtasks-container").removeClass("dropzone-visible"),!0},this._$scope.dragover=function(t,e,r){y(".subtasks-container").removeClass("dropzone-visible");var s=y(t.target).closest("ol[dnd-list]").attr("calendarID");return!!l.getByUri(s).writable&&(y(t.target).closest(".task-item").children(".subtasks-container").addClass("dropzone-visible"),!0)},this._$scope.allow=function(t){return t.calendar.writable?"copyMove":"copy"},this._$scope.dragStart=function(t){("copy"===t.dataTransfer.effectAllowed||"copyMove"===t.dataTransfer.effectAllowed&&t.ctrlKey)&&y(t.target).addClass("copy")},this._$scope.dragEnd=function(t){y(t.target).removeClass("copy")}}(h,e,r,s,a,o,i,u,l,d,f,c)}])}.call(d),angular.module("Tasks").directive("appNavigationEntryUtils",function(){return{restrict:"C",link:function(t,e){var r,s;s=e.siblings(".app-navigation-entry-menu"),(r=y(e).find(".app-navigation-entry-utils-menu-button button")).click(function(){s.toggleClass("open")}),t.$on("documentClicked",function(t,e){e.target!==r[0]&&s.removeClass("open")})}}}),angular.module("Tasks").directive("autofocusOnInsert",function(){return function(t,e){return e.focus()}}),angular.module("Tasks").directive("avatar",function(){return{restrict:"A",scope:!1,link:function(t,e,r){return r.$observe("userid",function(){if(r.userid)return e.avatar(r.userid,r.size)})}}});var a=function(t,e,r){if(Array.isArray(t)&&(e=t[1],r=t[2],t=t[0]),t===d)return[0,0,0];e/=100,r/=100;var s,n,a,o=(1-Math.abs(2*r-1))*e,i=t/60,u=o*(1-Math.abs(i%2-1));0===(i=Math.floor(i))?(s=o,n=u,a=0):1===i?(s=u,n=o,a=0):2===i?(s=0,n=o,a=u):3===i?(s=0,n=u,a=o):4===i?(s=u,n=0,a=o):5===i&&(s=o,n=0,a=u);var l=r-o/2;return s+=l,n+=l,a+=l,[Math.round(255*s),Math.round(255*n),Math.round(255*a)]},o=function(t,e,r){return Array.isArray(t)&&(e=t[1],r=t[2],t=t[0]),"#"+parseInt(t,10).toString(16)+parseInt(e,10).toString(16)+parseInt(r,10).toString(16)},i=["#31CC7C","#317CCC","#FF7A66","#F1DB50","#7C31CC","#CC317C","#3A3B3D","#CACBCD"];angular.module("Tasks").directive("colorpicker",function(){if("function"==typeof String.prototype.toHsl){var r="",s="";(i=["15","9","4","b","6","11","74","f","57"]).forEach(function(t,e){r=t.toHsl(),s=a(r),i[e]=o(s)})}return{scope:{selected:"=",customizedColors:"=colors"},restrict:"AE",templateUrl:OC.filePath("tasks","templates","colorpicker.html"),link:function(e,t,r){e.colors=e.customizedColors||i,e.selected=e.selected||e.colors[0],e.random="#000000",e.randomizeColour=function(){e.random="function"==typeof String.prototype.toHsl?o(a(Math.random().toString().toHsl())):i[Math.floor(Math.random()*i.length)],e.pick(e.random)},e.pick=function(t){e.selected=t}}}}),angular.module("Tasks").directive("confirmation",function(){return{priority:-1,restrict:"A",templateUrl:OC.generateUrl("/apps/tasks/templates/confirmation",{}),scope:{confirmationFunction:"&confirmation",confirmationMessage:"&confirmationMessage"},controller:"ConfirmationController"}}),angular.module("Tasks").controller("ConfirmationController",["$scope","$rootScope","$element","$attrs","$compile","$document","$window","$timeout",function(u,t,e,r,s,n,a,o){return new function(r,t,s,e,n,a,o,i){this._$scope=r,this._$scope.countdown=3,s.bind("click",function(t){r.countdown=3,s.removeClass("active");var e=r.confirmationMessage()?r.confirmationMessage():"Are you sure?";s.hasClass("confirmed")||(t.stopPropagation(),r.activate(),s.tooltip({title:e,container:"body",placement:"right",trigger:"manual"}).tooltip("show"),s.addClass("confirmed"))}),s.children(".confirmation-confirm").bind("click",function(t){s.hasClass("confirmed active")?r.confirmationFunction():t.stopPropagation()}),this._$scope.documentClick=function(){s.removeClass("confirmed"),s.tooltip("hide")},this._$scope.activate=function(){r.countdown?(s.find(".countdown").html(r.countdown+" s"),i(function(){r.activate()},1e3),r.countdown--):s.addClass("active")},a.bind("click",r.documentClick),a.bind("touchend",r.documentClick),u.$on("$destroy",function(){a.unbind("click",r.documentClick),a.unbind("touchend",r.documentClick)})}(u,t,e,r,s,n,a,o)}]),angular.module("Tasks").directive("datepicker",function(){return{restrict:"A",scope:!1,link:function(n,t,r){return t.datepicker({onSelect:function(t,e){return n["set"+r.datepicker+"day"](t),n.$apply()},beforeShow:function(t,e){var r,s;return r=y(e).datepicker("widget"),s=-Math.abs(y(t).outerWidth()-r.outerWidth())/2+"px",r.css({"margin-left":s}),y("div.ui-datepicker:before").css({left:"100px"}),y(".hasDatepicker").datepicker("option","firstDay",n.settingsmodel.getById("various").startOfWeek)},beforeShowDay:function(t){return 0===moment(t).startOf("day").diff(moment(n.task[r.datepicker],"YYYYMMDDTHHmmss").startOf("day"),"days")?[1,"selected"]:[1,""]},minDate:null})}}}),angular.module("Tasks").directive("ocClickFocus",["$timeout",function(n){return function(t,e,r){var s;if(s=t.$eval(r.ocClickFocus),angular.isDefined(s)&&angular.isDefined(s.selector))return e.click(function(){return angular.isDefined(s.timeout)?n(function(){return y(s.selector).focus()},s.timeout):y(s.selector).focus()})}}]),angular.module("Tasks").directive("timepicker",function(){return{restrict:"A",link:function(r,e,s){return e.timepicker({onSelect:function(t,e){return r["set"+s.timepicker+"time"](t),r.$apply()},myPosition:"center top",atPosition:"center bottom",hourText:t("tasks","Hours"),minuteText:t("tasks","Minutes")})}}}),angular.module("Tasks").filter("counterFormatter",function(){return function(t){switch(!1){case 0!==t:return"";case t<999:return"999+";default:return t}}}),angular.module("Tasks").filter("dateDetails",function(){return function(e){return moment(e,"YYYYMMDDTHHmmss").isValid()?moment(e,"YYYYMMDDTHHmmss").locale(e.isDate?"details_allday":"details").calendar():t("tasks","Set due date")}}),angular.module("Tasks").filter("dateDetailsShort",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").locale("details_short").calendar():""}}),angular.module("Tasks").filter("dateFromNow",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").fromNow():""}}),angular.module("Tasks").filter("dateTaskList",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").locale("tasks").calendar():""}}),angular.module("Tasks").filter("day",function(){return function(t){return moment().add("days",t).locale("list_week").calendar()}}),angular.module("Tasks").filter("dayTaskList",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").locale("tasks").calendar():""}}),angular.module("Tasks").filter("percentDetails",function(){return function(e){return t("tasks","%s %% completed").replace("%s",e).replace("%%","%")}}),angular.module("Tasks").filter("priorityDetails",function(){return function(e){var r;return r=t("tasks","priority %s: ").replace("%s",e),6==+e||7==+e||8==+e||9==+e?r+" "+t("tasks","high"):5==+e?r+" "+t("tasks","medium"):1==+e||2==+e||3==+e||4==+e?r+" "+t("tasks","low"):t("tasks","no priority assigned")}}),angular.module("Tasks").filter("reminderDetails",function(){return function(e,r){var s,n,a,o,i;if(angular.isUndefined(e)||null===e)return t("tasks","Remind me");if("DATE-TIME"===e.type&&moment(e.date,"YYYYMMDDTHHmmss").isValid())return moment(e.date,"YYYYMMDDTHHmmss").locale("reminder").calendar();if("DURATION"===e.type&&e.duration){s=t("tasks","Remind me");for(var u=0,l=(o=r.durations).length;u<l;u++)a=o[u],+e.duration[a.id]&&(n=1,s+=" "+e.duration[a.id]+" ",s+=(i=a,1==+e.duration[i.id]?i.name:i.names));return n?e.duration.params.invert?s+="END"===e.duration.params.related?" "+t("tasks","before end"):" "+t("tasks","before beginning"):s+="END"===e.duration.params.related?" "+t("tasks","after end"):" "+t("tasks","after beginning"):"END"===e.duration.params.related?s+=" "+t("tasks","at the end"):s+=" "+t("tasks","at the beginning"),s}return t("tasks","Remind me")}}),angular.module("Tasks").filter("startDetails",function(){return function(e){return moment(e,"YYYYMMDDTHHmmss").isValid()?moment(e,"YYYYMMDDTHHmmss").locale(e.isDate?"start_allday":"start").calendar():t("tasks","Set start date")}}),angular.module("Tasks").filter("timeTaskList",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").format("HH:mm"):""}}),angular.module("Tasks").service("CalendarService",["DavClient","Calendar",function(h,d){var c=this;function p(r){return h.propFind(h.buildUrl(OC.linkToRemoteBase("dav")),["{"+h.NS_DAV+"}current-user-principal"],0,{requesttoken:OC.requestToken}).then(function(t){if(!h.wasRequestSuccessful(t.status))throw"CalDAV client could not be initialized - Querying current-user-principal failed";if(!(t.body.propStat.length<1)){var e=t.body.propStat[0].properties;return c._currentUserPrincipal=e["{"+h.NS_DAV+"}current-user-principal"][0].textContent,h.propFind(h.buildUrl(c._currentUserPrincipal),["{"+h.NS_IETF+"}calendar-home-set"],0,{requesttoken:OC.requestToken}).then(function(t){if(!h.wasRequestSuccessful(t.status))throw"CalDAV client could not be initialized - Querying calendar-home-set failed";if(!(t.body.propStat.length<1)){var e=t.body.propStat[0].properties;return c._CALENDAR_HOME=e["{"+h.NS_IETF+"}calendar-home-set"][0].textContent,r()}})}})}function m(t){return parseInt(t.split(" ")[1])}this._CALENDAR_HOME=null,this._currentUserPrincipal=null,this._takenUrls=[],this._PROPERTIES=["{"+h.NS_DAV+"}displayname","{"+h.NS_IETF+"}calendar-description","{"+h.NS_IETF+"}calendar-timezone","{"+h.NS_APPLE+"}calendar-order","{"+h.NS_APPLE+"}calendar-color","{"+h.NS_IETF+"}supported-calendar-component-set","{"+h.NS_OWNCLOUD+"}calendar-enabled","{"+h.NS_DAV+"}acl","{"+h.NS_DAV+"}owner","{"+h.NS_OWNCLOUD+"}invite"],this.getAll=function(){return null===this._CALENDAR_HOME?p(function(){return c.getAll()}):h.propFind(h.buildUrl(this._CALENDAR_HOME),this._PROPERTIES,1,{requesttoken:OC.requestToken}).then(function(t){var e=[];if(!h.wasRequestSuccessful(t.status))throw"CalDAV client could not be initialized - Querying calendars failed";for(var r=0;r<t.body.length;r++){var s=t.body[r];if(!(s.propStat.length<1)){c._takenUrls.push(s.href);var n=m(s.propStat[0].status);if(h.wasRequestSuccessful(n)){var a=!1,o=s.propStat[0].properties["{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set"];if(o)for(var i=0;i<o.length;i++){"vtodo"===o[i].attributes.getNamedItem("name").textContent.toLowerCase()&&(a=!0)}if(a){c._getACLFromResponse(s);var u=s.href.substr(c._CALENDAR_HOME.length).replace(/[^\w\-]+/g,""),l=new d(s.href,s.propStat[0].properties,u);e.push(l)}}}}return e})},this.get=function(t){return null===this._CALENDAR_HOME?p(function(){return c.get(t)}):h.propFind(h.buildUrl(t),this._PROPERTIES,0,{requesttoken:OC.requestToken}).then(function(t){var e=t.body;if(!(e.propStat.length<1)){var r=m(e.propStat[0].status);if(h.wasRequestSuccessful(r)){c._getACLFromResponse(e);var s=e.href.substr(c._CALENDAR_HOME.length).replace(/[^\w\-]+/g,"");return new d(e.href,e.propStat[0].properties,s)}}})},this.create=function(t,e,r){if(null===this._CALENDAR_HOME)return p(function(){return c.create(t,e)});void 0===r&&(r=["vtodo"]);var s=document.implementation.createDocument("","",null),n=s.createElement("c:mkcalendar");n.setAttribute("xmlns:c","urn:ietf:params:xml:ns:caldav"),n.setAttribute("xmlns:d","DAV:"),n.setAttribute("xmlns:a","http://apple.com/ns/ical/"),n.setAttribute("xmlns:o","http://owncloud.org/ns"),s.appendChild(n);var a=s.createElement("d:set");n.appendChild(a);var o=s.createElement("d:prop");a.appendChild(o),o.appendChild(this._createXMLForProperty(s,"displayname",t)),o.appendChild(this._createXMLForProperty(s,"enabled",!0)),o.appendChild(this._createXMLForProperty(s,"color",e)),o.appendChild(this._createXMLForProperty(s,"components",r));var i=n.outerHTML,u=this._suggestUri(t),l=this._CALENDAR_HOME+u+"/",d={"Content-Type":"application/xml; charset=utf-8",requesttoken:OC.requestToken};return h.request("MKCALENDAR",l,d,i).then(function(t){if(201===t.status)return c._takenUrls.push(l),c.get(l).then(function(t){return t.enabled=!0,c.update(t)})})},this.update=function(e){var t=document.implementation.createDocument("","",null),r=t.createElement("d:propertyupdate");r.setAttribute("xmlns:c","urn:ietf:params:xml:ns:caldav"),r.setAttribute("xmlns:d","DAV:"),r.setAttribute("xmlns:a","http://apple.com/ns/ical/"),r.setAttribute("xmlns:o","http://owncloud.org/ns"),t.appendChild(r);var s=t.createElement("d:set");r.appendChild(s);var n=t.createElement("d:prop");s.appendChild(n);var a=e.updatedProperties;e.resetUpdatedProperties();for(var o=0;o<a.length;o++)n.appendChild(this._createXMLForProperty(t,a[o],e[a[o]]));var i=e.url,u=r.outerHTML,l={"Content-Type":"application/xml; charset=utf-8",requesttoken:OC.requestToken};return h.request("PROPPATCH",i,l,u).then(function(t){return e})},this.delete=function(t){return h.request("DELETE",t.url,{requesttoken:OC.requestToken},"").then(function(t){return 204===t.status})},this.share=function(e,r,s,n,a){var o=document.implementation.createDocument("","",null),i=o.createElement("o:share");i.setAttribute("xmlns:d","DAV:"),i.setAttribute("xmlns:o","http://owncloud.org/ns"),o.appendChild(i);var u=o.createElement("o:set");i.appendChild(u);var l=o.createElement("d:href");r===OC.Share.SHARE_TYPE_USER?l.textContent="principal:principals/users/":r===OC.Share.SHARE_TYPE_GROUP&&(l.textContent="principal:principals/groups/"),l.textContent+=s,u.appendChild(l);var d=o.createElement("o:summary");if(d.textContent=t("calendar","{calendar} shared by {owner}",{calendar:e.displayname,owner:e.owner}),u.appendChild(d),n){var c=o.createElement("o:read-write");u.appendChild(c)}var p={"Content-Type":"application/xml; charset=utf-8",requesttoken:f},m=i.outerHTML;return h.request("POST",e.url,p,m).then(function(t){200===t.status&&(a||(r===OC.Share.SHARE_TYPE_USER?e.sharedWith.users.push({id:s,displayname:s,writable:n}):r===OC.Share.SHARE_TYPE_GROUP&&e.sharedWith.groups.push({id:s,displayname:s,writable:n})))})},this.unshare=function(e,r,s){var t=document.implementation.createDocument("","",null),n=t.createElement("o:share");n.setAttribute("xmlns:d","DAV:"),n.setAttribute("xmlns:o","http://owncloud.org/ns"),t.appendChild(n);var a=t.createElement("o:remove");n.appendChild(a);var o=t.createElement("d:href");r===OC.Share.SHARE_TYPE_USER?o.textContent="principal:principals/users/":r===OC.Share.SHARE_TYPE_GROUP&&(o.textContent="principal:principals/groups/"),o.textContent+=s,a.appendChild(o);var i={"Content-Type":"application/xml; charset=utf-8",requesttoken:f},u=n.outerHTML;return h.request("POST",e.url,i,u).then(function(t){return 200===t.status&&(r===OC.Share.SHARE_TYPE_USER?e.sharedWith.users=e.sharedWith.users.filter(function(t){return t.id!==s}):r===OC.Share.SHARE_TYPE_GROUP&&(e.sharedWith.groups=e.sharedWith.groups.filter(function(t){return t.id!==s})),!0)})},this._createXMLForProperty=function(t,e,r){switch(e){case"enabled":var s=t.createElement("o:calendar-enabled");return s.textContent=r?"1":"0",s;case"displayname":var n=t.createElement("d:displayname");return n.textContent=r,n;case"order":var a=t.createElement("a:calendar-color");return a.textContent=r,a;case"color":var o=t.createElement("a:calendar-color");return o.textContent=r,o;case"components":for(var i=t.createElement("c:supported-calendar-component-set"),u=0;u<r.length;u++){var l=t.createElement("c:comp");l.setAttribute("name",r[u].toUpperCase()),i.appendChild(l)}return i}},this._getACLFromResponse=function(t){var e=!1,r=t.propStat[0].properties["{"+h.NS_DAV+"}acl"];if(r)for(var s=0;s<r.length;s++){var n=r[s].getElementsByTagNameNS("DAV:","href");if(0!==n.length)if((n=n[0].textContent)===c._currentUserPrincipal)0<r[s].getElementsByTagNameNS("DAV:","write").length&&(e=!0)}t.propStat[0].properties.canWrite=e},this._isUriAlreadyTaken=function(t){return-1!==this._takenUrls.indexOf(this._CALENDAR_HOME+t+"/")},this._suggestUri=function(t){var e=t.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"");if(!this._isUriAlreadyTaken(e))return e;if(-1===e.indexOf("-")&&(e+="-1",!this._isUriAlreadyTaken(e)))return e;for(;this._isUriAlreadyTaken(e);){var r=e.lastIndexOf("-"),s=e.substr(0,r),n=e.substr(r+1);n.match(/^\d+$/)?(n=parseInt(n),e=s+"-"+ ++n):""===n?e+="1":e=e="-1"}return e}}]),angular.module("Tasks").service("DavClient",[function(){var t;return t=new dav.Client({baseUrl:OC.linkToRemote("dav/calendars"),xmlNamespaces:{"DAV:":"d","urn:ietf:params:xml:ns:caldav":"c","http://apple.com/ns/ical/":"aapl","http://owncloud.org/ns":"oc","http://nextcloud.com/ns":"nc","http://calendarserver.org/ns/":"cs"}}),angular.extend(t,{NS_DAV:"DAV:",NS_IETF:"urn:ietf:params:xml:ns:caldav",NS_APPLE:"http://apple.com/ns/ical/",NS_OWNCLOUD:"http://owncloud.org/ns",NS_NEXTCLOUD:"http://nextcloud.com/ns",NS_CALENDARSERVER:"http://calendarserver.org/ns/",buildUrl:function(t){return window.location.protocol+"//"+window.location.host+t},wasRequestSuccessful:function(t){return 200<=t&&t<=299}}),t}]),angular.module("Tasks").service("ICalFactory",[function(){return{new:function(){var t=new ICAL.Component(["vcalendar",[],[]]),e=angular.element("#app").attr("data-appVersion");return t.updatePropertyWithValue("prodid","-//Nextcloud Tasks v"+e),t}}}]),angular.module("Tasks").factory("Loading",[function(){return new(function(){function t(){this.count=0}return t.prototype.increase=function(){return this.count+=1},t.prototype.decrease=function(){return this.count-=1},t.prototype.getCount=function(){return this.count},t.prototype.isLoading=function(){return 0<this.count},t}())}]),function(){angular.module("Tasks").factory("_Model",[function(){return function(){function t(){this._data=[],this._dataMap={},this._filterCache={}}return t.prototype.handle=function(t){var e,r,s,n;for(n=[],r=0,s=t.length;r<s;r++)e=t[r],n.push(this.add(e));return n},t.prototype.add=function(t,e){if(null===e&&(e=!0),e&&this._invalidateCache(),angular.isDefined(this._dataMap[t.id]))return this.update(t,e);this._data.push(t),this._dataMap[t.id]=t},t.prototype.update=function(t,e){var r,s,n,a;for(s in null===e&&(e=!0),e&&this._invalidateCache(),r=this.getById(t.id),a=[],t)n=t[s],"id"!==s&&a.push(r[s]=n);return a},t.prototype.getById=function(t){return this._dataMap[t]},t.prototype.getAll=function(){return this._data},t.prototype.removeById=function(t,e){var r,s,n,a,o;for(null===e&&(e=!0),r=n=0,a=(o=this._data).length;n<a;r=++n)if(o[r].id===t)return this._data.splice(r,1),s=this._dataMap[t],delete this._dataMap[t],e&&this._invalidateCache(),s},t.prototype.clear=function(){return this._data.length=0,this._dataMap={},this._invalidateCache()},t.prototype._invalidateCache=function(){this._filterCache={}},t.prototype.get=function(t){var e;return e=t.hashCode(),angular.isDefined(this._filterCache[e])||(this._filterCache[e]=t.exec(this._data)),this._filterCache[e]},t.prototype.size=function(){return this._data.length},t}()}])}.call(d),angular.module("Tasks").factory("Persistence",["Request","Loading","$rootScope","$q","CalendarService",function(t,e,r,s,n){return new(function(){function t(t,e,r,s){this._request=t,this._Loading=e,this._$rootScope=r,this._CalendarService=s}return t.prototype.init=function(){var t=this;return this.deferred=s.defer(),function(){return t.deferred.resolve()},this.getCollections(),this.getSettings(),this.deferred.promise},t.prototype.getCollections=function(e,t){var r,s,n,a=this;return null===t&&(t=!0),e||(e=function(){}),t?(this._Loading.increase(),n=function(t){return e(),a._Loading.decrease()},r=function(t){return a._Loading.decrease()}):(n=function(t){return e()},r=function(t){}),s={onSuccess:n,onFailure:r},this._request.get("/apps/tasks/collections",s)},t.prototype.getSettings=function(e,t){var r,s,n,a=this;return null===t&&(t=!0),e||(e=function(){}),t?(this._Loading.increase(),n=function(t){return e(),a._Loading.decrease()},r=function(t){return a._Loading.decrease()}):(n=function(t){return e()},r=function(t){}),s={onSuccess:n,onFailure:r},this._request.get("/apps/tasks/settings",s)},t.prototype.setVisibility=function(t,e){var r={routeParams:{collectionID:t,visibility:e}};return this._request.post("/apps/tasks/collection/{collectionID}/visibility/{visibility}",r)},t.prototype.setting=function(t,e,r){var s={routeParams:{type:t,setting:e,value:r}};return this._request.post("/apps/tasks/settings/{type}/{setting}/{value}",s)},t}())(t,e,r,n)}]),angular.module("Tasks").factory("Publisher",["CollectionsModel","SettingsModel",function(t,e){return new(function(){function t(t,e){this._$collectionsmodel=t,this._$settingsmodel=e,this._subscriptions={},this.subscribeObjectTo(this._$collectionsmodel,"collections"),this.subscribeObjectTo(this._$settingsmodel,"settings")}return t.prototype.subscribeObjectTo=function(t,e){var r=this._subscriptions;return r[e]||(r[e]=[]),this._subscriptions[e].push(t)},t.prototype.publishDataTo=function(t,e){var r,s,n,a,o;for(s=[],a=0,o=(r=this._subscriptions[e]||[]).length;a<o;a++)n=r[a],s.push(n.handle(t));return s},t}())(t,e)}]),angular.module("Tasks").factory("RandomStringService",function(){return{generate:function(){return Math.random().toString(36).substr(2)}}}),angular.module("Tasks").factory("Request",["$http","Publisher",function(t,e){return new(function(){function t(t,e){this.$http=t,this.publisher=e,this.count=0,this.initialized=!1,this.shelvedRequests=[],this.initialized=!0,this._executeShelvedRequests()}return t.prototype.request=function(t,e){var r,n,a;{if(null===e&&(e={}),n={routeParams:{},data:{},onSuccess:function(){return{}},onFailure:function(){return{}},config:{}},angular.extend(n,e),this.initialized)return r={url:OC.generateUrl(t,n.routeParams),data:n.data},angular.extend(r,n.config),"GET"===r.method&&(r.params=r.data),this.$http(r).then((a=this,function(t){var e,r,s;for(e in r=t.data.data)s=r[e],a.publisher.publishDataTo(s,e);return n.onSuccess(t.data,t.status,t.headers,t.config)})).catch(function(t){return n.onFailure(t.data,t.status,t.headers,t.config)});this._shelveRequest(t,n)}},t.prototype.post=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="POST",this.request(t,e)},t.prototype.get=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="GET",this.request(t,e)},t.prototype.put=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="PUT",this.request(t,e)},t.prototype.delete=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="DELETE",this.request(t,e)},t.prototype._shelveRequest=function(t,e){var r={route:t,data:e};return this.shelvedRequests.push(r)},t.prototype._executeShelvedRequests=function(){var t,e,r,s,n;for(r=[],s=0,n=(e=this.shelvedRequests).length;s<n;s++)t=e[s],r.push(this.request(t.route,t.data));return r},t}())(t,e)}]),angular.module("Tasks").factory("Status",[function(){return new(function(){function t(){this._$status={addingList:!1,focusTaskInput:!1}}return t.prototype.getStatus=function(){return this._$status},t}())}]),angular.module("Tasks").service("VTodoService",["DavClient","RandomStringService","$timeout",function(k,e,s){var o=this;this.getAll=function(i,t,e){null===t&&(t=!1),null===e&&(e=!1);var r=document.implementation.createDocument("","",null),s=r.createElement("c:calendar-query");s.setAttribute("xmlns:c","urn:ietf:params:xml:ns:caldav"),s.setAttribute("xmlns:d","DAV:"),s.setAttribute("xmlns:a","http://apple.com/ns/ical/"),s.setAttribute("xmlns:o","http://owncloud.org/ns"),r.appendChild(s);var n=r.createElement("d:prop");s.appendChild(n);var a=r.createElement("d:getetag");n.appendChild(a);var o=r.createElement("c:calendar-data");n.appendChild(o);var u=r.createElement("c:filter");s.appendChild(u);var l=r.createElement("c:comp-filter");l.setAttribute("name","VCALENDAR"),u.appendChild(l);var d=r.createElement("c:comp-filter");d.setAttribute("name","VTODO"),l.appendChild(d);var c=r.createElement("c:prop-filter");if(c.setAttribute("name","COMPLETED"),d.appendChild(c),!t){var p=r.createElement("c:is-not-defined");c.appendChild(p)}if(e){var m=r.createElement("c:prop-filter");m.setAttribute("name","RELATED-TO"),d.appendChild(m);var h=r.createElement("c:text-match"),f=r.createTextNode(e.uid);h.appendChild(f),m.appendChild(h)}var g=i.url,y={"Content-Type":"application/xml; charset=utf-8",Depth:1,requesttoken:OC.requestToken},_=s.outerHTML;return k.request("REPORT",g,y,_).then(function(t){if(k.wasRequestSuccessful(t.status)){var e=[];for(var r in t.body){var s=t.body[r],n=s.propStat[0].properties,a=s.href.substr(s.href.lastIndexOf("/")+1),o={calendar:i,properties:n,uri:a};e.push(o)}return e}})},this.get=function(e,r){var t=e.url+r;return k.request("GET",t,{requesttoken:OC.requestToken},"").then(function(t){return{calendar:e,properties:{"{urn:ietf:params:xml:ns:caldav}calendar-data":t.body,"{DAV:}getetag":t.xhr.getResponseHeader("ETag")},uri:r}})},this.create=function(e,t,r){void 0===r&&(r=!0);var s={"Content-Type":"text/calendar; charset=utf-8",requesttoken:OC.requestToken},n=this._generateRandomUri(),a=e.url+n;return k.request("PUT",a,s,t).then(function(t){return k.wasRequestSuccessful(t.status)?!r||o.get(e,n):(console.log(t),!1)})},this.update=function(e){var t=e.calendar.url+e.uri,r={"Content-Type":"text/calendar; charset=utf-8","If-Match":e.etag,requesttoken:OC.requestToken};return s.cancel(e.timers.update),k.request("PUT",t,r,e.data).then(function(t){return e.etag=t.xhr.getResponseHeader("ETag"),k.wasRequestSuccessful(t.status)})},this.delete=function(t){var e=t.calendar.url+t.uri,r={"If-Match":t.etag,requesttoken:OC.requestToken};return k.request("DELETE",e,r,"").then(function(t){return k.wasRequestSuccessful(t.status)})},this._generateRandomUri=function(){var t="Nextcloud-";return t+=e.generate(),t+=e.generate(),t+=".ics"}}]),angular.module("Tasks").factory("ListsBusinessLayer",["ListsModel","Persistence","TasksBusinessLayer","CalendarService",function(a,t,o,e){return new(function(){function t(t,e,r,s){this._$listsmodel=t,this._persistence=e,this._$tasksbusinesslayer=r,this._$calendarservice=s}return t.prototype.init=function(){return this._$calendarservice.getAll().then(function(t){var e,r,s,n;for(n=[],r=0,s=t.length;r<s;r++)e=t[r],a.add(e),n.push(o.getAll(e));return n})},t.prototype.add=function(t,e){return this._$calendarservice.create(t,e,["vtodo"]).then(function(t){return a.add(t),t})},t.prototype.delete=function(t){return this._$calendarservice.delete(t).then(function(){return a.delete(t)})},t.prototype.rename=function(t){this._$calendarservice.update(t).then(function(t){t.dropPreviousState()})},t}())(a,t,o,e)}]),function(){var o=function(t,e){return function(){return t.apply(e,arguments)}};angular.module("Tasks").factory("SearchBusinessLayer",["ListsModel","Persistence","TasksModel","$rootScope","$routeParams","$location",function(t,e,r,s,n,a){return new(function(){function t(t,e,r,s,n,a){this._$listsmodel=t,this._persistence=e,this._$tasksmodel=r,this._$rootScope=s,this._$routeparams=n,this._$location=a,this.getFilter=o(this.getFilter,this),this.setFilter=o(this.setFilter,this),this.cleanSearch=o(this.cleanSearch,this),this.attach=o(this.attach,this),this.initialize(),this._$searchString=""}return t.prototype.attach=function(t){var e=this;t.setFilter("tasks",function(t){return e.setFilter(t)})},t.prototype.setFilter=function(t){var e=this;return e._$rootScope.$apply(function(){e._$searchString=t})},t.prototype.cleanSearch=function(){var t=this;return t._$rootScope.$apply(function(){t._$searchString=""})},t.prototype.getFilter=function(){return this._$searchString},t.prototype.initialize=function(){14<=OC.config.version.split(".")[0]?OC.Search=new OCA.Search(this.setFilter,this.cleanSearch):OC.Plugins.register("OCA.Search",this)},t}())(t,e,r,s,n,a)}])}.call(d),angular.module("Tasks").factory("SettingsBusinessLayer",["Persistence","SettingsModel",function(t,e){return new(function(){function t(t,e){this._persistence=t,this._$settingsmodel=e}return t.prototype.updateModel=function(){var t;return t=function(){},this._persistence.getCollections(t,!0)},t.prototype.setVisibility=function(t,e){return this._persistence.setVisibility(t,e)},t.prototype.toggle=function(t,e){this._$settingsmodel.toggle(t,e);var r=this._$settingsmodel.getById(t)[e];return this._persistence.setting(t,e,+r)},t.prototype.set=function(t,e,r){return this._persistence.setting(t,e,r)},t}())(t,e)}]),angular.module("Tasks").factory("TasksBusinessLayer",["TasksModel","Persistence","VTodoService","VTodo","$timeout",function(u,t,r,l,s){return new(function(){function i(t,e,r,s,n){this._$tasksmodel=t,this._persistence=e,this._$vtodoservice=r}return i.prototype.getAll=function(t,e,r){return this._$vtodoservice.getAll(t,e,r).then(function(t){var e,r,s,n;for(n=[],r=0,s=t.length;r<s;r++){e=t[r];var a=new l(e.calendar,e.properties,e.uri);n.push(u.ad(a))}return n})},i.prototype.add=function(t){return this._$vtodoservice.create(t.calendar,t.data).then(function(t){var e=new l(t.calendar,t.properties,t.uri);return u.ad(e),e})},i.prototype.getTask=function(t,e){return this._$vtodoservice.get(t,e).then(function(t){return u.ad(t),t})},i.prototype.setPriority=function(t,e){t.calendar.writable&&(t.priority=e,this.doUpdate(t))},i.prototype.setPercentComplete=function(t,e){t.calendar.writable&&(e<100?this.uncompleteParents(t.related):this.completeChildren(t),t.complete=e,this.triggerUpdate(t))},i.prototype.triggerUpdate=function(t,e){e||(e=1e3),t.timers.update&&s.cancel(t.timers.update),t.timers.update=s(function(t){r.update(t)},e,!0,t)},i.prototype.doUpdate=function(t){return this._$vtodoservice.update(t)},i.prototype.completeChildren=function(t){var e,r,s,n=this._$tasksmodel.getChildren(t),a=[];for(r=0,s=n.length;r<s;r++)e=n[r],a.push(this.setPercentComplete(e,100));return a},i.prototype.uncompleteParents=function(t){if(t){var e=this._$tasksmodel.getByUid(t);if(e.completed)return this.setPercentComplete(e,0)}},i.prototype.setHideSubtasks=function(t,e){t.hideSubtasks=e,t.calendar.writable&&this.doUpdate(t)},i.prototype.setHideCompletedSubtasks=function(t,e){t.hideCompletedSubtasks=e,t.calendar.writable&&this.doUpdate(t)},i.prototype.deleteTask=function(t){var e,r,s,n;for(s=0,n=(r=this._$tasksmodel.getChildren(t)).length;s<n;s++)e=r[s],this.deleteTask(e);return this._$vtodoservice.delete(t).then(function(){return u.delete(t)})},i.prototype.momentToICALTime=function(t,e){return e?ICAL.Time.fromDateString(t.format("YYYY-MM-DD")):ICAL.Time.fromDateTimeString(t.format("YYYY-MM-DDTHH:mm:ss"))},i.prototype.initDueDate=function(t){var e=moment(t.start,"YYYY-MM-DDTHH:mm:ss");if(!moment(t.due,"YYYY-MM-DDTHH:mm:ss").isValid()){var r=e.isAfter()?e:moment();return t.allDay?r.startOf("day").add(1,"d"):r.startOf("hour").add(1,"h"),this.setDue(t,r,"all")}},i.prototype.setDue=function(t,e,r){null===r&&(r="day");var s=t.allDay,n=moment(t.start,"YYYY-MM-DDTHH:mm:ss"),a=moment(t.due,"YYYY-MM-DDTHH:mm:ss"),o=a.clone();if("day"===r)moment(o).isValid()?o.year(e.year()).month(e.month()).date(e.date()):o=e.add(12,"h");else if("time"===r)moment(o).isValid()?o.hour(e.hour()).minute(e.minute()):o=e;else{if("all"!==r)return;o=e}(o.isBefore(n)||o.isSame(n))&&(n.subtract(a.diff(o),"ms"),t.start=this.momentToICALTime(n,s)),t.due=this.momentToICALTime(o,s),this.doUpdate(t)},i.prototype.deleteDueDate=function(t){t.due=null,this.doUpdate(t)},i.prototype.initStartDate=function(t){var e=moment(t.start,"YYYY-MM-DDTHH:mm:ss"),r=moment(t.due,"YYYY-MM-DDTHH:mm:ss");if(!e.isValid()){var s=moment().add(1,"h");return r.isBefore(s)&&(s=r.subtract(1,"m")),s.startOf(t.allDay?"day":"hour"),this.setStart(t,s,"all")}},i.prototype.setStart=function(t,e,r){null===r&&(r="day");var s=t.allDay,n=moment(t.due,"YYYY-MM-DDTHH:mm:ss"),a=moment(t.start,"YYYY-MM-DDTHH:mm:ss"),o=a.clone();if("day"===r)moment(o).isValid()?o.year(e.year()).month(e.month()).date(e.date()):o=e.add(12,"h");else if("time"===r)moment(o).isValid()?o.hour(e.hour()).minute(e.minute()):o=e;else{if("all"!==r)return;o=e}(o.isAfter(n)||o.isSame(n))&&(n.add(o.diff(a),"ms"),t.due=this.momentToICALTime(n,s)),t.start=this.momentToICALTime(o,s),this.doUpdate(t)},i.prototype.deleteStartDate=function(t){t.start=null,this.doUpdate(t)},i.prototype.setAllDay=function(t,e){if(t.allDay=e){var r=moment(t.due,"YYYY-MM-DDTHH:mm:ss"),s=moment(t.start,"YYYY-MM-DDTHH:mm:ss");(s.isAfter(r)||s.isSame(r))&&(s=moment(r).subtract(1,"day"),t.start=this.momentToICALTime(s,e))}this.doUpdate(t)},i.prototype.initReminder=function(t){var e,r;if(!this.checkReminderDate(t))return(r=this._$tasksmodel.getById(t)).reminder={type:"DURATION",action:"DISPLAY",duration:{token:"week",week:0,day:0,hour:0,minute:0,second:0,params:{invert:!0}}},moment(r.start,"YYYYMMDDTHHmmss").isValid()?((e=r.reminder.duration.params).related="START",e.id="10"):moment(r.due,"YYYYMMDDTHHmmss").isValid()?((e=r.reminder.duration.params).related="END",e.id="11"):(r.reminder.type="DATE-TIME",r.reminder.date=moment().startOf("hour").add(1,"h").format("YYYYMMDDTHHmmss")),this.setReminder(t)},i.prototype.setReminderDate=function(t,e,r){var s,n,a;if(null===r&&(r="day"),n=this._$tasksmodel.getById(t).reminder,s={type:"DATE-TIME",action:"DISPLAY",duration:null},"day"===r)this.checkReminderDate(t)||null===n?(a=moment(n.date,"YYYYMMDDTHHmmss"),s.action=n.action,a.isValid()&&"DATE-TIME"===n.type?a.year(e.year()).month(e.month()).date(e.date()):a=e.add(12,"h")):a=e.add(12,"h");else{if("time"!==r)return;this.checkReminderDate(t)||null===n?(a=moment(n.date,"YYYYMMDDTHHmmss"),s.action=n.action,a.isValid()&&"DATE-TIME"===n.type?a.hour(e.hour()).minute(e.minute()):a=e):a=e}return s.date=a.format("YYYYMMDDTHHmmss"),this._$tasksmodel.setReminder(t,s),this._persistence.setReminder(t,s)},i.prototype.setReminder=function(t){var e;if(this.checkReminderDate(t))return e=this._$tasksmodel.getById(t).reminder,this._persistence.setReminder(t,e)},i.prototype.checkReminderDate=function(t){var e,r,s,n,a,o,i,u,l;if(null!==(o=(u=this._$tasksmodel.getById(t)).reminder)&&"DURATION"===o.type){if(!o.duration)return!1;if("START"===o.duration.params.related)l="start";else{if("END"!==o.duration.params.related)return!1;l="due"}r=moment(u[l],"YYYYMMDDTHHmmss"),e={w:(s=o.duration).week,d:s.day,h:s.hour,m:s.minute,s:s.second},r=s.params.invert?r.subtract(e):r.add(e),u.reminder.date=r.format("YYYYMMDDTHHmmss")}else{if(null===o||"DATE-TIME"!==o.type)return!1;if(s=o.duration,!(r=moment(o.date,"YYYYMMDDTHHmmss")).isValid())return!1;if(s)a="START"===s.params.related?moment(u.start,"YYYYMMDDTHHmmss"):moment(u.due,"YYYYMMDDTHHmmss"),i=this.secondsToSegments(r.diff(a,"seconds")),s.params.invert=i.invert,s.token="week",s.week=i.week,s.day=i.day,s.hour=i.hour,s.minute=i.minute,s.second=i.second;else{if(u.start)a=moment(u.start,"YYYYMMDDTHHmmss"),n="START",e=0;else{if(!u.due)return!0;a=moment(u.due,"YYYYMMDDTHHmmss"),n="END",e=1}i=this.secondsToSegments(r.diff(a,"seconds")),o.duration={token:"week",params:{related:n,invert:i.invert,id:+i.invert+""+e},week:i.week,day:i.day,hour:i.hour,minute:i.minute,second:i.second}}}return!0},i.prototype.secondsToSegments=function(t){var e,r,s,n,a;return t<0?(t*=-1,s=!0):s=!1,t-=604800*(a=Math.floor(t/604800)),t-=86400*(e=Math.floor(t/86400)),t-=3600*(r=Math.floor(t/3600)),{week:a,day:e,hour:r,minute:n=Math.floor(t/60),second:t-=60*n,invert:s}},i.prototype.deleteReminderDate=function(t){return this._$tasksmodel.setReminder(t,null),this._persistence.setReminder(t,!1)},i.prototype.changeCalendar=function(a,t){if(a.calendar!==t&&t.writable){var o=angular.copy(a);if(o.calendar=t,!u.hasNoParent(o))u.getByUid(o.related).calendar.uri!==o.calendar.uri&&(o.related=null,i.prototype.setPercentComplete(o,0));return r.create(t,o.data).then(function(t){var e=new l(t.calendar,t.properties,t.uri);return u.ad(e),r.delete(a).then(function(){u.delete(a);var t,e,r,s=[],n=u.getChildren(o);for(t=0,e=n.length;t<e;t++)(r=n[t]).calendar.uri!==o.calendar.uri&&s.push(i.prototype.changeCalendar(r,o.calendar));return Promise.all(s)})})}return Promise.resolve(!0)},i.prototype.changeCollection=function(t,e){var r=this._$tasksmodel.getById(t);switch(e){case"starred":return r.priority=9,this.doUpdate(r);case"completed":return this.setPercentComplete(r,100);case"uncompleted":return!!r.completed&&this.setPercentComplete(r,0);case"today":return this.setDue(r,moment().startOf("day").add(12,"h"),"all");case"week":case"all":default:return!1}},i.prototype.changeParent=function(t,e){e.calendar.writable&&(t.related=e.uid,e.hideSubtasks=0,e.completed&&!t.completed?this.setPercentComplete(e,0):this.doUpdate(e),e.calendar.uri!==t.calendar.uri?this.changeCalendar(t,e.calendar):this.doUpdate(t))},i.prototype.makeRootTask=function(t,e,r){if(e.writable){var s=[];return t.related=null,"completed"!==r&&t.completed&&(t.complete=0),s.push(this.changeCollection(t.uri,r)),t.calendar!==e?s.push(this.changeCalendar(t,e)):s.push(this.doUpdate(t)),s}},i.prototype.addComment=function(t,e,r){var s;return e||(e=function(){}),r||(r=function(){}),this._$tasksmodel.addComment(t),s=function(t){return"error"===t.status?r():e(t.data)},this._persistence.addComment(t,s)},i.prototype.deleteComment=function(t,e){return this._$tasksmodel.deleteComment(t,e),this._persistence.deleteComment(t,e)},i}())(u,t,r,l,s)}]),angular.module("Tasks").factory("Calendar",["$rootScope","$filter","$window",function(e,r,s){function n(e,r,s){r.color=r["{http://apple.com/ns/ical/}calendar-color"],void 0!==r.color?9===r.color.length&&(r.color=r.color.substr(0,7)):r.color="#1d2d44",angular.extend(this,{_propertiesBackup:{},_properties:{url:e,uri:s,enabled:"1"===r["{http://owncloud.org/ns}calendar-enabled"],displayname:r["{DAV:}displayname"]||t("tasks","Unnamed"),color:r.color,order:parseInt(r["{http://apple.com/ns/ical/}calendar-order"])||0,components:{vevent:!1,vjournal:!1,vtodo:!1},writable:r.canWrite,shareable:r.canWrite,sharedWith:{users:[],groups:[]},owner:"",loadedCompleted:!1},_updatedProperties:[]}),this._propertiesBackup=angular.copy(this._properties);for(var n=r["{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set"],a=0;a<n.length;a++){var o=n[a].attributes.getNamedItem("name").textContent.toLowerCase();this._properties.components.hasOwnProperty(o)&&(this._properties.components[o]=!0)}var i=r["{http://owncloud.org/ns}invite"];if(void 0!==i)for(var u=0;u<i.length;u++){var l=i[u].getElementsByTagNameNS("DAV:","href");if(0!==l.length){l=l[0].textContent;var d=i[u].getElementsByTagNameNS("http://owncloud.org/ns","access");if(0!==d.length){var c=(d=d[0]).getElementsByTagNameNS("http://owncloud.org/ns","read-write");c=0!==c.length,l.startsWith("principal:principals/users/")?this._properties.sharedWith.users.push({id:l.substr(27),displayname:l.substr(27),writable:c}):l.startsWith("principal:principals/groups/")&&this._properties.sharedWith.groups.push({id:l.substr(28),displayname:l.substr(28),writable:c})}}}var p=r["{DAV:}owner"];void 0!==p&&0!==p.length&&(p=p[0].textContent.slice(0,-1)).startsWith("/remote.php/dav/principals/users/")&&(this._properties.owner=p.substr(33))}return n.prototype={get url(){return this._properties.url},get caldav(){return s.location.origin+this.url},get exportUrl(){var t=this.url;return"/"===t.slice(t.length-1)&&(t=t.slice(0,t.length-1)),t+="?export"},get enabled(){return this._properties.enabled},get uri(){return this._properties.uri},get components(){return this._properties.components},set enabled(t){this._properties.enabled=t,this._setUpdated("enabled")},get displayname(){return this._properties.displayname},set displayname(t){this._properties.displayname=t,this._setUpdated("displayname")},get color(){return this._properties.color},set color(t){this._properties.color=t,this._setUpdated("color")},get sharedWith(){return this._properties.sharedWith},set sharedWith(t){this._properties.sharedWith=t},get textColor(){var t,e=this.color,r="#fff";switch(e.length){case 4:return(t=e.match(/^#([0-9a-f]{3})$/i)[1])?this._generateTextColor(17*parseInt(t.charAt(0),16),17*parseInt(t.charAt(1),16),17*parseInt(t.charAt(2),16)):r;case 7:case 9:var s=new RegExp("^#([0-9a-f]{"+(e.length-1)+"})$","i");return(t=e.match(s)[1])?this._generateTextColor(parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)):r;default:return r}},get order(){return this._properties.order},set order(t){this._properties.order=t,this._setUpdated("order")},get writable(){return this._properties.writable},get shareable(){return this._properties.shareable},get owner(){return this._properties.owner},get loadedCompleted(){return this._properties.loadedCompleted},set loadedCompleted(t){this._properties.loadedCompleted=t},_setUpdated:function(t){-1===this._updatedProperties.indexOf(t)&&this._updatedProperties.push(t)},get updatedProperties(){return this._updatedProperties},resetUpdatedProperties:function(){this._updatedProperties=[]},prepareUpdate:function(){this._propertiesBackup=angular.copy(this._properties)},resetToPreviousState:function(){this._properties=angular.copy(this._propertiesBackup),this._propertiesBackup={}},dropPreviousState:function(){this._propertiesBackup={}},toggleSharesEditor:function(){this.list.editingShares=!this.list.editingShares},_generateTextColor:function(t,e,r){return 130<(299*t+587*e+114*r)/1e3?"#000000":"#FAFAFA"}},n}]),function(){var n={}.hasOwnProperty;angular.module("Tasks").factory("CollectionsModel",["TasksModel","_Model",function(t,e){return new(function(t){function r(t){this._$tasksmodel=t,this._nameCache={},r.__super__.constructor.call(this)}return function(t,e){for(var r in e)n.call(e,r)&&(t[r]=e[r]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(r,e),r.prototype.add=function(t,e){if(null===e&&(e=!0),this._nameCache[t.displayname]=t,angular.isDefined(t.id))return r.__super__.add.call(this,t,e)},r.prototype.getCount=function(t,e){var r,s,n,a,o;for(null===e&&(e=""),a=r=0,o=(n=this._$tasksmodel.filteredTasks(e)).length;a<o;a++)s=n[a],r+=this._$tasksmodel.filterTasks(s,t)&&!s.related;return r},r}())(t)}])}.call(d),function(){var n={}.hasOwnProperty;angular.module("Tasks").factory("ListsModel",["TasksModel","_Model",function(t,e){return new(function(t){function s(t){this._$tasksmodel=t,this._tmpUriCache={},this._data=[],this._dataMap={},this._filterCache={}}return function(t,e){for(var r in e)n.call(e,r)&&(t[r]=e[r]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(s,e),s.prototype.add=function(t,e){if(null===e&&(e=!0),angular.isDefined(t.uri)&&angular.isDefined(this.getByUri(t.uri)))return this.update(t,e);angular.isDefined(t.uri)&&(e&&this._invalidateCache(),angular.isDefined(this._dataMap[t.uri])||(this._data.push(t),this._dataMap[t.uri]=t))},s.prototype.getByUri=function(t){return this._dataMap[t]},s.prototype.update=function(t,e){var r;return null===e&&(e=!0),r=this._tmpIdCache[t.tmpID],angular.isDefined(t.id)&&angular.isDefined(r)&&angular.isUndefined(r.id)&&(r.id=t.id,this._dataMap[t.id]=r),t.void=!1,s.__super__.update.call(this,t,e)},s.prototype.delete=function(t,e){var r,s,n,a,o;for(null===e&&(e=!0),r=n=0,a=(o=this._data).length;n<a;r=++n)if(o[r]===t)return this._data.splice(r,1),s=this._dataMap[t.uri],delete this._dataMap[t.uri],e&&this._invalidateCache(),s},s.prototype.getStandardList=function(){if(this.size())return this.getAll()[0]},s.prototype.isNameAlreadyTaken=function(t,e){var r,s,n,a,o;for(n=!1,a=0,o=(s=this.getAll()).length;a<o;a++)(r=s[a]).displayname===t&&r.uri!==e&&(n=!0);return n},s.prototype.getCount=function(t,e,r){var s,n,a,o,i;for(null===r&&(r=""),o=s=0,i=(a=this._$tasksmodel.filteredTasks(r)).length;o<i;o++)n=a[o],s+=this._$tasksmodel.filterTasks(n,e)&&n.calendar.uri===t&&!n.related;return s},s.prototype.loadedCompleted=function(t){return!angular.isUndefined(this.getById(t))&&this.getById(t).loadedCompleted},s.prototype.setLoadedCompleted=function(t){this.getById(t).loadedCompleted=!0},s.prototype.getColor=function(t){return angular.isUndefined(this.getById(t))?"#CCCCCC":this.getById(t).calendarcolor},s.prototype.getName=function(t){return angular.isUndefined(this.getById(t))?"":this.getById(t).displayname},s}())(t)}])}.call(d),function(){var n={}.hasOwnProperty;angular.module("Tasks").factory("SettingsModel",["_Model",function(e){return new(function(t){function r(){this._nameCache={},r.__super__.constructor.call(this)}return function(t,e){for(var r in e)n.call(e,r)&&(t[r]=e[r]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(r,e),r.prototype.add=function(t,e){return null===e&&(e=!0),this._nameCache[t.displayname]=t,angular.isDefined(t.id)?r.__super__.add.call(this,t,e):this._data.push(t)},r.prototype.toggle=function(t,e){var r;r=this.getById(t),this.getById(t)[e]=!r[e]},r}())}])}.call(d),function(){var n={}.hasOwnProperty,a=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};angular.module("Tasks").factory("TasksModel",["_Model",function(r){return new(function(t){function e(){this._tmpIdCache={},e.__super__.constructor.call(this)}return function(t,e){for(var r in e)n.call(e,r)&&(t[r]=e[r]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(e,r),e.prototype.ad=function(t,e){if(null===e&&(e=!0),angular.isDefined(t.uri)&&angular.isDefined(this.getByUri(t.uri)))return this.update(t,e);angular.isDefined(t.uri)&&(e&&this._invalidateCache(),angular.isDefined(this._dataMap[t.uri])||(this._data.push(t),this._dataMap[t.uri]=t))},e.prototype.getByUri=function(t){return this._dataMap[t]},e.prototype.update=function(t,e){var r;return null===e&&(e=!0),e&&this._invalidateCache(),(r=this.getByUri(t.uri)).components=t.components,r.components.toString(),r},e.prototype.removeById=function(t){return e.__super__.removeById.call(this,t)},e.prototype.delete=function(t,e){var r,s,n,a,o;for(null===e&&(e=!0),r=n=0,a=(o=this._data).length;n<a;r=++n)if(o[r]===t)return this._data.splice(r,1),s=this._dataMap[t.uri],delete this._dataMap[t.uri],e&&this._invalidateCache(),s},e.prototype.removeByList=function(t){var e,r,s,n,a;s=[];for(var o=0,i=(n=this.getAll()).length;o<i;o++)(r=n[o]).calendarid===t&&s.push(r.uid);a=[];for(var u=0,l=s.length;u<l;u++)e=s[u],a.push(this.removeById(e));return a},e.prototype.taskAtDay=function(t,e){var r,s,n,a,o;if(a=moment(t.start,"YYYYMMDDTHHmmss"),s=moment(t.due,"YYYYMMDDTHHmmss"),a.isValid()&&!s.isValid()){if(r=a.diff(moment().startOf("day"),"days",!0),!e&&r<e+1)return!0;if(r<e+1&&e<=r)return!0}if(s.isValid()&&!a.isValid()){if(r=s.diff(moment().startOf("day"),"days",!0),!e&&r<e+1)return!0;if(r<e+1&&e<=r)return!0}if(a.isValid()&&s.isValid()){if(o=a.diff(moment().startOf("day"),"days",!0),n=s.diff(moment().startOf("day"),"days",!0),!e&&(o<e+1||n<e+1))return!0;if(o<e+1&&e<=o&&e<=n)return!0;if(n<e+1&&e<=n&&e<=o)return!0}return!1},e.prototype.isLoaded=function(t){return!!this.getByUid(t.uid)},e.prototype.hasSubtasks=function(t){for(var e=this.getAll(),r=0,s=e.length;r<s;r++){if(e[r].related===t)return!0}return!1},e.prototype.hasCompletedSubtasks=function(t){for(var e=this.getAll(),r=0,s=e.length;r<s;r++){var n=e[r];if(n.related===t&&n.completed)return!0}return!1},e.prototype.hasNoParent=function(t){if(t.related){for(var e=this.getAll(),r=0,s=e.length;r<s;r++){var n=e[r];if(t.related===n.uid&&t!==n)return!1}return!0}return!0},e.prototype.getUriByUid=function(t){for(var e=this.getAll(),r=0,s=e.length;r<s;r++){var n=e[r];if(n.uid===t)return n.uri}return!1},e.prototype.getByUid=function(t){for(var e=this.getAll(),r=0,s=e.length;r<s;r++){var n=e[r];if(n.uid===t)return n}return null},e.prototype.getChildren=function(t){var e,r,s;e=[];for(var n=0,a=(s=this.getAll()).length;n<a;n++)(r=s[n]).related===t.uid&&r!==t&&e.push(r);return e},e.prototype.getDescendantIDs=function(t){var e,r,s;s=[];for(var n=0,a=(r=this.getChildren(t)).length;n<a;n++)e=r[n],s=(s=s.concat(e.uri)).concat(this.getDescendantIDs(e));return s},e.prototype.filterTasks=function(t,e){switch(e){case"completed":return!0===t.completed;case"all":return!1===t.completed;case"current":return!1===t.completed&&this.current(t.start,t.due);case"starred":return!1===t.completed&&5<t.priority;case"today":return!1===t.completed&&(this.today(t.start)||this.today(t.due));case"week":return!1===t.completed&&(this.week(t.start)||this.week(t.due));default:return""+t.calendar.uri==""+e}},e.prototype.filteredTasks=function(t){var e,r,s,n,a;if(s=[],a=this.getAll(),t){for(var o=0,i=a.length;o<i;o++)if(n=a[o],this.filterTasksByString(n,t)){if(this.objectExists(n,s))continue;s.push(n),r=this.getUriByUid(n.related),(e=this.getAncestor(r,s))&&(s=s.concat(e))}}else s=a;return s},e.prototype.objectExists=function(t,e){for(var r=0,s=e.length;r<s;r++){if(e[r].uid===t.uid)return!0}return!1},e.prototype.filterTasksByString=function(t,e){var r,s,n;for(r in s=["summary","note","location","categories"],e=e.toLowerCase(),t)if(n=t[r],0<=a.call(s,r))if("categories"===r){if(this.searchCategories(t.categories,e))return!0}else if(-1!==n.toLowerCase().indexOf(e))return!0;return!1},e.prototype.getAncestor=function(t,e){var r,s,n,a;if(a=[],n=this.getByUri(t)){if(this.objectExists(n,e))return a;if(a.push(n),this.hasNoParent(n))return a;s=this.getUriByUid(n.related),(r=this.getAncestor(s,e))&&(a=a.concat(r))}return a},e.prototype.searchCategories=function(t,e){for(var r=0,s=t.length;r<s;r++){if(-1!==t[r].toLowerCase().indexOf(e))return!0}return!1},e.prototype.setReminder=function(t,e){return this.update({id:t,reminder:e})},e.prototype.overdue=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()&&moment(t,"YYYYMMDDTHHmmss").diff(moment())<0},e.prototype.due=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()},e.prototype.today=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()&&moment(t,"YYYYMMDDTHHmmss").diff(moment().startOf("day"),"days",!0)<1},e.prototype.week=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()&&moment(t,"YYYYMMDDTHHmmss").diff(moment().startOf("day"),"days",!0)<7},e.prototype.current=function(t,e){return!moment(t,"YYYYMMDDTHHmmss").isValid()||moment(t,"YYYYMMDDTHHmmss").diff(moment(),"days",!0)<0||moment(e,"YYYYMMDDTHHmmss").diff(moment(),"days",!0)<0},e}())}])}.call(d),angular.module("Tasks").factory("VTodo",["$filter","ICalFactory","RandomStringService",function(t,s,n){function a(t,e,r){if(angular.extend(this,{calendar:t,data:e["{urn:ietf:params:xml:ns:caldav}calendar-data"],uri:r,etag:e["{DAV:}getetag"]||null,timers:[],loaded:!1}),this.jCal=ICAL.parse(this.data),this.components=new ICAL.Component(this.jCal),0===this.components.jCal.length)throw"invalid calendar"}return a.prototype={get summary(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("summary")},set summary(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("summary",t),this.updateLastModified(),this.data=this.components.toString()},get priority(){return(10-this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("priority"))%10},set priority(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("priority",(10-t)%10),this.updateLastModified(),this.data=this.components.toString()},get complete(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("percent-complete")||0},set complete(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("percent-complete",t),this.updateLastModified(),this.data=this.components.toString(),t<100?(this.completed=null,this.status=0===t?"NEEDS-ACTION":"IN-PROCESS"):(this.completed=ICAL.Time.now(),this.status="COMPLETED")},get completed(){return!!this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("completed")},set completed(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("completed",t):e[0].removeProperty("completed"),this.updateLastModified(),this.data=this.components.toString()},get completed_date(){var t=this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("completed");return t?t.toJSDate():null},get status(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("status")},set status(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("status",t),this.updateLastModified(),this.data=this.components.toString()},get note(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("description")||""},set note(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("description",t),this.updateLastModified(),this.data=this.components.toString()},get uid(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("uid")||""},get related(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("related-to")||null},set related(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("related-to",t):e[0].removeProperty("related-to"),this.updateLastModified(),this.data=this.components.toString()},get hideSubtasks(){return+this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("x-oc-hidesubtasks")||0},set hideSubtasks(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("x-oc-hidesubtasks",+t),this.updateLastModified(),this.data=this.components.toString()},get hideCompletedSubtasks(){return+this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("x-oc-hidecompletedsubtasks")||0},set hideCompletedSubtasks(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("x-oc-hidecompletedsubtasks",+t),this.updateLastModified(),this.data=this.components.toString()},get reminder(){return null},get categories(){var t=this.components.getAllSubcomponents("vtodo")[0].getFirstProperty("categories");return t?t.getValues():[]},set categories(t){var e=this.components.getAllSubcomponents("vtodo"),r=e[0].getFirstProperty("categories");if(0<t.length)if(r)r.setValues(t);else{var s=new ICAL.Property("categories");s.setValues(t),r=e[0].addProperty(s)}else e[0].removeProperty("categories");this.updateLastModified(),this.data=this.components.toString()},get start(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("dtstart")},set start(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("dtstart",t):e[0].removeProperty("dtstart"),this.updateLastModified(),this.data=this.components.toString()},get due(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("due")},set due(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("due",t):e[0].removeProperty("due"),this.updateLastModified(),this.data=this.components.toString()},get allDay(){var t=this.components.getAllSubcomponents("vtodo"),e=t[0].getFirstPropertyValue("dtstart"),r=t[0].getFirstPropertyValue("due"),s=r||e;return null!==s&&s.isDate},set allDay(t){var e=this.components.getAllSubcomponents("vtodo"),r=e[0].getFirstPropertyValue("dtstart");r&&(r.isDate=t,e[0].updatePropertyWithValue("dtstart",r));var s=e[0].getFirstPropertyValue("due");s&&(s.isDate=t,e[0].updatePropertyWithValue("due",s)),this.updateLastModified(),this.data=this.components.toString()},get comments(){return null},get loadedCompleted(){return this.loaded},set loadedCompleted(t){this.loaded=t},updateLastModified:function(){var t=this.components.getAllSubcomponents("vtodo");t[0].updatePropertyWithValue("last-modified",ICAL.Time.now()),t[0].updatePropertyWithValue("dtstamp",ICAL.Time.now())}},a.create=function(t){var e=s.new(),r=new ICAL.Component("vtodo");return e.addSubcomponent(r),r.updatePropertyWithValue("created",ICAL.Time.now()),r.updatePropertyWithValue("dtstamp",ICAL.Time.now()),r.updatePropertyWithValue("last-modified",ICAL.Time.now()),r.updatePropertyWithValue("uid",n.generate()),r.updatePropertyWithValue("summary",t.summary),r.updatePropertyWithValue("priority",t.priority),r.updatePropertyWithValue("percent-complete",t.complete),r.updatePropertyWithValue("x-oc-hidesubtasks",0),t.related&&r.updatePropertyWithValue("related-to",t.related),t.note&&r.updatePropertyWithValue("description",t.note),t.due&&r.updatePropertyWithValue("due",t.due),t.start&&r.updatePropertyWithValue("dtstart",t.start),new a(t.calendar,{"{urn:ietf:params:xml:ns:caldav}calendar-data":e.toString(),"{DAV:}getetag":null},null)},a}])}(jQuery,oc_requesttoken);
//# sourceMappingURL=app.min.js.map

Anon7 - 2022
AnonSec Team