",' ',' error_outline'," "+l("An error occured while importing contacts.")+"","
",""].join(""),position:"top right",hideDelay:3e3})}}),s.close=function(){t.hide()}}a.show({parent:angular.element(document.body),targetEvent:e,clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"UIxContactsImportDialog",controller:o,controllerAs:"$CardsImportDialogController",locals:{folder:t}}),o.$inject=["scope","$mdDialog","folder"]}function U(t){function o(e,t){function o(){e.hide()}this.addressbook=t,this.close=o}(t.urls?e.when():g.$reloadAll()).then(function(){a.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:t.id+"/links",controller:o,controllerAs:"links",locals:{addressbook:t}})}),o.$inject=["$mdDialog","addressbook"]}function E(e){function t(e,t,o){function r(){d.addressbook.$save().then(function(){o.init(d.addressbook.$omit()),t.hide()})}function s(){t.cancel()}var d=this;d.addressbook=new g(o.$omit()),d.saveProperties=r,d.close=s}a.show({templateUrl:e.id+"/properties",controller:t,controllerAs:"properties",clickOutsideToClose:!0,escapeToClose:!0,locals:{srcAddressBook:e}}).catch(function(){}),t.$inject=["$scope","$mdDialog","srcAddressBook"]}function T(e){e.$acl.$users().then(function(){a.show({templateUrl:e.id+"/UIxAclEditor",controller:"AclController",controllerAs:"acl",clickOutsideToClose:!0,escapeToClose:!0,locals:{usersWithACL:e.$acl.users,User:v,folder:e}})})}function x(e){console.debug("subscribeToFolder "+e.owner+e.name),g.$subscribe(e.owner,e.name).then(function(e){c.show(c.simple().content(l("Successfully subscribed to address book")).position("top right").hideDelay(3e3))})}function M(e,t){return t.id!=e.id&&(t.isOwned||t.acls.objectCreator)}function j(e,o,r){var s,d,n,a,i,u,p;s=o.id,i=!1,0===(d=e.$selectedCards()).length&&(d=[e.$selectedCard()]),(n=_.filter(d,function(e){return e.$isCard()})).length!=d.length&&c.show(c.simple().content(l("Lists can't be moved or copied.")).position("top right").hideDelay(2e3)),n.length&&("copy"==r?(u=e.$copyCards(n,s),p=l("%{0} card(s) copied",n.length)):(u=e.$moveCards(n,s),p=l("%{0} card(s) moved",n.length),a=_.map(n,"id"),i=e.selectedCard&&a.indexOf(e.selectedCard)>=0),u.then(function(){i&&t.go("app.addressbook"),c.show(c.simple().content(p).position("top right").hideDelay(2e3))}))}var H=this,P=[];H.activeUser=b.activeUser,H.service=g,H.select=w,H.newAddressbook=y,H.edit=F,H.revertEditing=A,H.save=S,H.confirmDelete=D,H.importCards=I,H.showLinks=U,H.showProperties=E,H.share=T,H.subscribeToFolder=x,H.isDroppableFolder=M,H.dragSelectedCards=j,function(e){e.push(h.createHotkey({key:"backspace",description:l("Delete selected card or address book"),callback:function(){g.selectedFolder&&!g.selectedFolder.hasSelectedCard()&&D()}})),_.forEach(e,function(e){h.registerHotkey(e)})}(P),o.$on("$destroy",function(){_.forEach(P,function(e){h.deregisterHotkey(e)})})}e.$inject=["$q","$state","$scope","$rootScope","$stateParams","$timeout","$window","$mdDialog","$mdToast","$mdMedia","$mdSidenav","FileUploader","sgConstant","sgHotkeys","sgFocus","Card","AddressBook","Dialog","sgSettings","User","stateAddressbooks"],angular.module("SOGo.ContactsUI").controller("AddressBooksController",e)}(),function(){"use strict";function e(e,t,o,r,s,d,n,a,c,i,u,p,f){function h(e){return angular.isString(e)?{value:e}:e}function m(e,t,o){M.card.$delete(t,o),e.$setDirty()}function $(){var e=M.card.$addOrg({value:""});i("org_"+e)}function g(){M.card.birthday=new Date}function k(){M.card.$addScreenName("")}function b(){var e=M.card.$addEmail("");i("email_"+e)}function v(){var e=M.card.$addPhone("");i("phone_"+e)}function C(){var e=M.card.$addUrl("","");i("url_"+e)}function w(){return _.keys(f.customFields).length<4}function y(){angular.isDefined(M.card.customFields)||(M.card.customFields={});var e=_.pullAll(["1","2","3","4"],_.keys(f.customFields));M.card.customFields[e[0]]=""}function F(e){delete M.card.customFields[e]}function A(){var e=M.card.$addAddress("","","","","","","","");i("address_"+e)}function S(e,t){return e.length