!function(){"use strict";function c(e){"function"!=typeof e.then&&(angular.extend(this,e),_.forEach(this.identities,function(e){var t;e.fullName&&e.email?e.full=e.fullName+" <"+e.email+">":e.email?e.full="<"+e.email+">":e.full="",e.signature&&(t=angular.element("
',''," "," ",'',"
",'{{$ctrl.mailbox.$icon}} ",' ',' ',"',' '," ",'more_vert '].join(""),controller:"sgMailboxListItemController",controllerAs:"$ctrl"}})}(),function(){function e(t,e,n){var s=this;this.$onInit=function(){var e=["uid","isread","isflagged","flags","subject"];"draft"==(this.MailboxService=n).selectedFolder.type&&e.push("subject"),t.$watch(function(){return s.message?[_.pick(s.message,e)]:null},function(e,t){s.message&&s.onUpdate()},!0)},this.onUpdate=function(){this.message.isread?e.removeClass("unread"):e.addClass("unread"),n.selectedFolder.isSelectedMessage(this.message.uid,this.message.$mailbox.path)?e.addClass("md-default-theme md-accent md-bg md-hue-2"):e.removeClass("md-default-theme md-accent md-bg md-hue-2")},this.setVisibility=function(e,t){t?e.classList.remove("ng-hide"):e.classList.add("ng-hide")}}e.$inject=["$scope","$element","Mailbox"],angular.module("SOGo.MailerUI").controller("sgMessageListItemController",e).directive("sgMessageListItem",function(){return{restrict:"C",scope:{},bindToController:{message:"=sgMessage"},controller:"sgMessageListItemController"}})}(),function(){function e(s,a,e,t,r,n,l,c,i){var u=this;this.$postLink=function(){var t,e,n,i,o;this.parentController=s.parentController,i=this.parentController.onUpdate,o=this.parentController.setVisibility,_.forEach(a.find("div"),function(e){e.classList.contains("sg-tile-content")?t=angular.element(e):e.classList.contains("sg-tile-icons")&&(n=angular.element(e))}),e=t.find("button")[0],this.threadButton=e,e=angular.element(e),this.threadIconElement=e.find("md-icon")[0],this.threadCountElement=e.find("span")[0],this.priorityIconElement=t.find("md-icon")[0],l.$virtualMode&&(this.mailboxNameElement=t.find("span")[0],this.mailboxNameElement.classList.remove("ng-hide")),this.senderElement=t.find("span")[1],_.forEach(t.find("div"),function(e){e.classList.contains("sg-tile-subject")?u.subjectElement=e:e.classList.contains("sg-tile-size")?u.sizeElement=e:e.classList.contains("sg-tile-date")&&(u.dateElement=e)}),_.forEach(n.find("md-icon"),function(e){"star"==e.textContent?u.flagIconElement=e:"reply"==e.textContent?u.answerIconElement=e:"forward"==e.textContent?u.forwardIconElement=e:"attach_file"==e.textContent&&(u.attachmentIconElement=e)}),this.parentController.onUpdate=function(){var e;u.message=u.parentController.message;var t=r.nodesToArray(a[0].querySelectorAll(".sg-category"));for(_.forEach(t,function(e){a[0].removeChild(e)}),e=0;e')).css("left",3*e+"px"),n.css("background-color",u.service.$tags[s][1]),a.prepend(n))}u.mailboxNameElement&&(u.mailboxNameElement.innerHTML=u.message.$mailbox.$displayName),u.MailboxService.selectedFolder.isSentFolder?u.senderElement.innerHTML=u.message.$shortAddress("to").encodeEntities():u.senderElement.innerHTML=u.message.$shortAddress("from").encodeEntities(),u.message.priority&&u.message.priority.level<3?(u.priorityIconElement.classList.remove("ng-hide"),u.message.priority.level<2?u.priorityIconElement.classList.add("md-warn"):u.priorityIconElement.classList.remove("md-warn")):u.priorityIconElement.classList.add("ng-hide"),u.message.first?(u.threadButton.classList.remove("ng-hide"),u.threadCountElement.innerHTML=u.message.threadCount,u.message.collapsed&&u.threadIconElement.classList.remove("md-rotate-180-ccw")):u.threadButton.classList.add("ng-hide"),u.subjectElement.innerHTML=u.message.subject.encodeEntities(),u.sizeElement.innerHTML=u.message.size,u.dateElement.innerHTML=u.message.relativedate,o(u.flagIconElement,u.message.isflagged),o(u.answerIconElement,u.message.isanswered),o(u.forwardIconElement,u.message.isforwarded),o(u.attachmentIconElement,u.message.hasattachment),angular.bind(u.parentController,i)()},this.service=c,this.MailboxService=l},this.toggleThread=function(){this.message.collapsed?this.threadIconElement.classList.add("md-rotate-180-ccw"):this.threadIconElement.classList.remove("md-rotate-180-ccw"),this.message.toggleThread()}}e.$inject=["$scope","$element","$parse","$state","$mdUtil","$mdToast","Mailbox","Message","encodeUriFilter"],angular.module("SOGo.MailerUI").controller("sgMessageListItemMainController",e).directive("sgMessageListItemMain",function(){return{restrict:"C",require:"^^sgMessageListItem",scope:{},template:[' ','",' ",'',"",'",' \x3c!-- mailbox --\x3e','",'error '," \x3c!-- sender or recipient --\x3e","\x3c!-- date --\x3e',"','","\x3c!-- subject --\x3e','\x3c!-- size --\x3e','',' ","expand_more ',"','"].join(""),link:function(e,t,n,s){e.parentController=s},controller:"sgMessageListItemMainController",controllerAs:"$ctrl"}})}(),function(){"use strict";function e(e,t){var n=this;this.$postLink=function(){t.registerImage(e),e.on("click",this.showImage)},this.showImage=function(e){"IMG"==e.target.tagName&&t.showGallery(e,n.partIndex)}}e.$inject=["$element","ImageGallery"],angular.module("SOGo.MailerUI").directive("sgZoomableImage",function(){return{restrict:"A",bindToController:{partIndex:"=sgZoomableImage"},controller:e}})}(); //# sourceMappingURL=Mailer.services.js.map\x3c!-- message loading progress --\x3e ',"