!function(){"use strict";angular.module("angular",["ngAnimate","ngCookies","ngStorage","ngTouch","ngSanitize","ngMessages","ngAria","restangular","ui.router","ui.bootstrap","toastr","angularMoment","angular.filter","akoenig.deckgrid","angular-timeline","duScroll","oitozero.ngSweetAlert"])}(),function(){"use strict";function e(){function e(e,o){var t=this;t.profile=t.owner,t.documents=[],t.openDocument=function(e){o.go("main.profile.page",{page:e.path,profile:e.profile.identifier})};var i=t.block.settings.limit||5;e.profiles.one(t.profile.id).one("articles").get({content_type:"TinyMceArticle",per_page:i}).then(function(e){t.documents=e.data.articles})}e.$inject=["noosfero","$state"];var o={restrict:"E",templateUrl:"app/components/noosfero-blocks/recent-documents/recent-documents.html",scope:{block:"=",owner:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoRecentDocumentsBlock",e)}(),function(){"use strict";function e(){function e(){var e=this;e.profile=e.owner}var o={restrict:"E",templateUrl:"app/components/noosfero-blocks/profile-image/profile-image.html",scope:{block:"=",owner:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoProfileImageBlock",e)}(),function(){"use strict";function e(){function e(e){var o=this;o.members=[],e.members(e.profiles.one(o.owner.id)).one().get({per_page:6}).then(function(e){o.members=e.data.people})}e.$inject=["noosfero"];var o={restrict:"E",templateUrl:"app/components/noosfero-blocks/members-block/members-block.html",scope:{block:"=",owner:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoMembersBlock",e)}(),function(){"use strict";function e(){function e(){}var o={restrict:"E",templateUrl:"app/components/noosfero-blocks/main-block/main-block.html",scope:{block:"=",owner:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoMainBlock",e)}(),function(){"use strict";function e(){function e(){var e=this;e.links=e.block.settings.links}var o={restrict:"E",templateUrl:"app/components/noosfero-blocks/link-list/link-list.html",scope:{block:"=",owner:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoLinkListBlock",e)}(),function(){"use strict";function e(){function e(e){var o=this;o.posts=[],o.perPage=3,o.currentPage=1,o.loadPage=function(){e.articles.one(o.article.id).customGET("children",{content_type:"TinyMceArticle",per_page:o.perPage,page:o.currentPage}).then(function(e){o.totalPosts=e.headers("total"),o.posts=e.data.articles})},o.loadPage()}e.$inject=["noosfero"];var o={restrict:"E",templateUrl:"app/components/noosfero-articles/blog/blog.html",scope:{article:"=",profile:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoBlog",e)}(),function(){"use strict";function e(e,o){function t(){}var i={restrict:"E",templateUrl:"app/components/noosfero-articles/article/article.html",scope:{article:"=",profile:"="},controller:t,controllerAs:"vm",bindToController:!0,link:function(t,i){var n="noosfero"+t.vm.article.type;if(e.has(n+"Directive")){var r=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();i.replaceWith(o("<"+r+' article="vm.article" profile="vm.profile">")(t))}}};return i}e.$inject=["$injector","$compile"],angular.module("angular").directive("noosferoArticle",e)}(),function(){"use strict";function e(){function e(){var e=this;e.getActivityTemplate=function(e){return"app/components/noosfero-activities/activity/"+e.verb+".html"}}var o={restrict:"E",scope:{activity:"="},templateUrl:"app/components/noosfero-activities/activity/activity.html",replace:!0,controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoActivity",e)}(),function(){"use strict";function e(){function e(){var e=this;e.defaultIcon="fa-users",e.profile&&"Person"===e.profile.type&&(e.defaultIcon="fa-user")}var o={restrict:"E",templateUrl:"app/components/noosfero/profile-image/profile-image.html",scope:{profile:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoProfileImage",e)}(),function(){"use strict";function e(){function e(){var e=this;e.boxesOrder=function(e){return 2==e.position?0:e.position}}var o={restrict:"E",scope:{boxes:"=",owner:"="},templateUrl:"app/components/noosfero-boxes/boxes.html",controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("noosferoBoxes",e)}(),function(){"use strict";function e(e){var o={restrict:"E",scope:{block:"=",owner:"="},link:function(o,t){var i=o.block.type.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();t.replaceWith(e("")(o))}};return o}e.$inject=["$compile"],angular.module("angular").directive("noosferoBlock",e)}(),function(){"use strict";function e(){var e={restrict:"E",scope:{activities:"="},templateUrl:"app/components/noosfero-activities/activities.html"};return e}angular.module("angular").directive("noosferoActivities",e)}(),function(){"use strict";angular.module("angular").factory("noosfero",["Restangular",function(e){var o;return{currentProfile:o,profiles:e.service("profiles"),articles:e.service("articles"),profile:function(o){return e.one("profiles",o)},members:function(o){return e.service("members",o)},boxes:function(o){return e.service("boxes",e.one("profiles",o))}}}])}(),function(){"use strict";angular.module("angular").filter("noosferoTemplateFilter",function(){return function(e,o){for(var t in o)e=e.replace("{"+t+"}",o[t]);return e}})}(),function(){"use strict";function e(){function e(e,o,t,i,n,r,a){var l=this;l.currentUser=i.getCurrentUser(),l.modalInstance=null,l.openLogin=function(){l.modalInstance=o.open({templateUrl:"app/components/auth/login.html",controller:"AuthController",controllerAs:"vm",bindToController:!0})},l.logout=function(){t.logout(),r.go(r.current,{},{reload:!0})},n.$on(a.loginSuccess,function(){l.modalInstance&&(l.modalInstance.close(),l.modalInstance=null),r.go(r.current,{},{reload:!0})}),n.$on(a.logoutSuccess,function(){l.currentUser=i.getCurrentUser()}),l.activate=function(){l.currentUser||l.openLogin()},l.activate()}e.$inject=["moment","$modal","AuthService","Session","$scope","$state","AUTH_EVENTS"];var o={restrict:"E",templateUrl:"app/components/navbar/navbar.html",scope:{},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("angular").directive("acmeNavbar",e)}(),function(){"use strict";function e(e,o,t,i,n,r){function a(e){var t="/api/v1/login",i="login="+e.username+"&password="+e.password;return o.post(t,i).then(s,c)}function l(){var e="/api/v1/login_from_cookie";return o.post(e).then(s,c)}function s(e){n.debug("AuthService.login [SUCCESS] response",e);var o=i.create(e.data);return t.currentUser=o,t.$broadcast(r.loginSuccess,o),o}function c(e){return n.debug("AuthService.login [FAIL] response",e),t.$broadcast(r.loginFailed),null}function p(){i.destroy(),t.currentUser=void 0,t.$broadcast(r.logoutSuccess),o.jsonp("/account/logout")}function u(){return!!i.userId}function m(e){return angular.isArray(e)||(e=[e]),f.isAuthenticated()&&-1!==e.indexOf(i.userRole)}var f={login:a,loginFromCookie:l,logout:p,isAuthenticated:u,isAuthorized:m};return f}function o(e,o){var t={};return t.create=function(t){return e.currentUser=t.user,o.debug("User session created.",e.currentUser),e.currentUser},t.destroy=function(){delete e.currentUser,o.debug("User session destroyed.")},t.getCurrentUser=function(){return e.currentUser},t}e.$inject=["$q","$http","$rootScope","Session","$log","AUTH_EVENTS"],o.$inject=["$localStorage","$log"],angular.module("angular").factory("Session",o).factory("AuthService",e)}(),function(){"use strict";function e(e,o,t,i){var n=this;n.credentials={},n.login=function(){i.login(n.credentials)}}e.$inject=["noosfero","$log","$stateParams","AuthService"],angular.module("angular").controller("AuthController",e)}(),function(){"use strict";function e(e){function o(){t.profile=e.currentProfile,e.profiles.one(t.profile.id).one("activities").get().then(function(e){t.activities=e.data.activities})}var t=this;t.profile=null,t.activities=[],o()}e.$inject=["noosfero"],angular.module("angular").controller("ProfileInfoController",e)}(),function(){"use strict";function e(e,o,t){function i(){e.profiles.one().get({identifier:t.profile}).then(function(o){return n.profile=o.data[0],e.currentProfile=n.profile,e.boxes(n.profile.id).one().get()}).then(function(e){n.boxes=e.data.boxes})}var n=this;n.boxes=[],i()}e.$inject=["noosfero","$log","$stateParams"],angular.module("angular").controller("ProfileController",e)}(),function(){"use strict";function e(e,o,t,i,n){function r(){a.profile=e.currentProfile,e.profile(a.profile.id).customGET("home_page",{fields:"path"}).then(function(e){e.data.article?n.transitionTo("main.profile.page",{page:e.data.article.path,profile:a.profile.identifier},{location:!1}):n.transitionTo("main.profile.info",{profile:a.profile.identifier},{location:!1})})}var a=this;r()}e.$inject=["noosfero","$log","$stateParams","$scope","$state"],angular.module("angular").controller("ProfileHomeController",e)}(),function(){"use strict";function e(){}angular.module("angular").controller("MainController",e)}(),function(){"use strict";function e(e,o,t){function i(){n.profile=e.currentProfile,e.profiles.one(n.profile.id).one("articles").get({path:t.page}).then(function(e){n.article=e.data.article})}var n=this;n.article=null,n.profile=null,i()}e.$inject=["noosfero","$log","$stateParams"],angular.module("angular").controller("ContentViewerController",e)}(),function(){"use strict";function e(e){function o(){t.profile=e.currentProfile}var t=this;t.article=null,t.profile=null,o()}e.$inject=["noosfero"],angular.module("angular").controller("ContentViewerActionsController",e)}(),function(){"use strict";function e(e,o,t,i,n){function r(){a.profile=e.currentProfile}var a=this;a.article={},a.profile=null,r(),a.save=function(){e.profiles.one(a.profile.id).customPOST({article:a.article},"articles",{},{"Content-Type":"application/json"}).then(function(e){i.transitionTo("main.profile.page",{page:e.data.article.path,profile:a.profile.identifier}),n.swal({title:"Good job!",text:"Article saved!",type:"success",timer:1e3})})}}e.$inject=["noosfero","$stateParams","$httpParamSerializer","$state","SweetAlert"],angular.module("angular").controller("CmsController",e)}(),function(){"use strict";function e(e,o,t){o.addFullRequestInterceptor(function(e,o,i,n,r){return t.getCurrentUser()&&(r["Private-Token"]=t.getCurrentUser().private_token),{headers:r}})}e.$inject=["$log","Restangular","Session"],angular.module("angular").run(e)}(),function(){"use strict";function e(e,o){e.state("main",{url:"/",templateUrl:"app/main/main.html",controller:"MainController",controllerAs:"vm",resolve:{currentUser:["AuthService",function(e){return e.loginFromCookie()}]}}).state("main.profile.cms",{url:"^/myprofile/:profile/cms",views:{mainBlockContent:{templateUrl:"app/cms/cms.html",controller:"CmsController",controllerAs:"vm"}}}).state("main.profile.settings",{url:"^/myprofile/:profile"}).state("main.profile",{url:"^/:profile","abstract":!0,views:{content:{templateUrl:"app/profile/profile.html",controller:"ProfileController",controllerAs:"vm"}}}).state("main.profile.home",{url:"",views:{mainBlockContent:{controller:"ProfileHomeController",controllerAs:"vm"}}}).state("main.profile.info",{url:"^/profile/:profile",views:{mainBlockContent:{templateUrl:"app/profile-info/profile-info.html",controller:"ProfileInfoController",controllerAs:"vm"}}}).state("main.profile.page",{url:"/{page:any}",views:{mainBlockContent:{templateUrl:"app/content-viewer/page.html",controller:"ContentViewerController",controllerAs:"vm"},"actions@main":{templateUrl:"app/content-viewer/navbar-actions.html",controller:"ContentViewerActionsController",controllerAs:"vm"}}}),o.otherwise("/")}e.$inject=["$stateProvider","$urlRouterProvider"],angular.module("angular").config(e)}(),function(){"use strict";angular.module("angular").constant("moment",moment).constant("AUTH_EVENTS",{loginSuccess:"auth-login-success",loginFailed:"auth-login-failed",logoutSuccess:"auth-logout-success"})}(),function(){"use strict";function e(e,o,t,i,n){e.debugEnabled(!0),o.html5Mode({enabled:!0}),t.setBaseUrl("/api/v1"),t.setFullResponse(!0),i.defaults.headers.post={"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},n.decorator("$uiViewScroll",["$delegate","$document",function(e,o){return function(e){o.scrollToElementAnimated(e)}}])}e.$inject=["$logProvider","$locationProvider","RestangularProvider","$httpProvider","$provide"],angular.module("angular").config(e)}(),angular.module("angular").run(["$templateCache",function(e){e.put("app/cms/cms.html",'
'),e.put("app/content-viewer/navbar-actions.html",''),e.put("app/content-viewer/page.html",''),e.put("app/main/main.html",'
'),e.put("app/profile/profile.html",'
'),e.put("app/profile-info/profile-info.html",'

{{vm.profile.name}}

Profile Wall

'),e.put("app/components/auth/login.html",''),e.put("app/components/boxes/boxes.html",'{{vm.boxesOrder}} {{boxesOrder}}'),e.put("app/components/navbar/navbar.html",''),e.put("app/components/noosfero-activities/activities.html",''),e.put("app/components/noosfero-boxes/box.html",'

{{block.title}}

'),e.put("app/components/noosfero-boxes/boxes.html",''),e.put("app/components/noosfero/profile-image/profile-image.html",' '),e.put("app/components/noosfero-activities/activity/activity.html",'
'),e.put("app/components/noosfero-activities/activity/add_member_in_community.html",'

has joined the community

'),e.put("app/components/noosfero-activities/activity/create_article.html",'

has published on

'),e.put("app/components/noosfero-activities/activity/new_friendship.html",'

has made new friend(s):

'),e.put("app/components/noosfero-articles/article/article.html",'
'),e.put("app/components/noosfero-articles/blog/blog.html",'

'),e.put("app/components/noosfero-blocks/link-list/link-list.html",''),e.put("app/components/noosfero-blocks/main-block/main-block.html",'
'),e.put("app/components/noosfero-blocks/members-block/members-block.html",'
'),e.put("app/components/noosfero-blocks/profile-image/profile-image.html",'
Control panel
'),e.put("app/components/noosfero-blocks/recent-documents/recent-documents.html",'
')}]); //# sourceMappingURL=../maps/scripts/app-33ee2c5596.js.map