From 3a7d528315abbc43be108b7ff51a80ce43b5ccd0 Mon Sep 17 00:00:00 2001 From: Matheus Machado Monteiro - SUPDE/DEDES/DEDS1 <00045948194@serpro-1554946.(none)> Date: Fri, 18 Dec 2015 16:33:51 -0200 Subject: [PATCH] Update dist --- dist/assets/images/icons/sprite.png | Bin 108645 -> 0 bytes dist/index.html | 4 ++-- dist/scripts/app-412f89662a.js | 7 +++++++ dist/scripts/app-879ef3ee54.js | 8 -------- dist/styles/app-34fadf2170.css | 10 ++++++++++ dist/styles/app-fe2f8827b4.css | 10 ---------- 6 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 dist/scripts/app-412f89662a.js delete mode 100644 dist/scripts/app-879ef3ee54.js create mode 100644 dist/styles/app-34fadf2170.css delete mode 100644 dist/styles/app-fe2f8827b4.css diff --git a/dist/assets/images/icons/sprite.png b/dist/assets/images/icons/sprite.png index 77d564b..f2a89d5 100644 Binary files a/dist/assets/images/icons/sprite.png and b/dist/assets/images/icons/sprite.png differ diff --git a/dist/index.html b/dist/index.html index 9f96f5b..5f0b4e6 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,3 +1,3 @@ -Dialoga Brasil
Dialoga Brasil
\ No newline at end of file +
\ No newline at end of file diff --git a/dist/scripts/app-412f89662a.js b/dist/scripts/app-412f89662a.js new file mode 100644 index 0000000..1a670e1 --- /dev/null +++ b/dist/scripts/app-412f89662a.js @@ -0,0 +1,7 @@ +!function(){"use strict";angular.module("dialoga",["ngAnimate","ngCookies","ngTouch","ngSanitize","ui.router","ngStorage","720kb.socialshare","slugifier","ncy-angular-breadcrumb","ngMessages"])}(),function(){"use strict";function a(a,e,o,s,r,t){var i=this;i.DialogaService=a,i.$scope=e,i.$rootScope=o,i.$location=s,i.$filter=r,i.$log=t,i.init(),i.loadData(),i.attachListeners(),i.$rootScope.focusMainContent(),t.debug("RespostasPageController")}angular.module("dialoga").controller("RespostasPageController",a),a.$inject=["DialogaService","$scope","$rootScope","$location","$filter","$log"],a.prototype.init=function(){var a=this;a.page=1,a.per_page=10,a.themes=null,a.selectedTheme=null,a.filtredProposals=null,a.query=null,a.search=a.$location.search(),a.search.tema&&(a._filtredByThemeSlug=a.search.tema),a.search.filtro&&(a._filtredByQuery=a.search.filtro),(a.search.tema||a.search.filtro)&&(a.loadingFilter=!0),a.loading=null,a.error=null},a.prototype.loadData=function(){var a=this;a.loading=!0,a.loadingThemes=!0,a.DialogaService.getThemes(function(e){for(var o=[],s=e.length-1;s>=0;s--){var r=e[s];r.archived&&o.push(r)}a.themes=o,a.loadingThemes=!1,a.loading=!1,a.filter()},function(e){a.error=e,a.$log.error(e),a.loadingThemes=!1,a.loading=!1})},a.prototype.attachListeners=function(){var a=this;a.$scope.$on("change-selectedCategory",function(e,o){a.selectedTheme=o}),a.$scope.$watch("pageRespostas.selectedTheme",function(e){a.search.tema=e?e.slug:null,a.$location.search("tema",a.search.tema),a.loadingFilter||a.filterProposals()}),a.$scope.$watch("pageRespostas.query",function(e){a.search.filtro=e?e:null,a.$location.search("filtro",a.search.filtro),a.loadingFilter||a.filterProposals()})},a.prototype.resetFilterValues=function(){var a=this;a.query=null,a.selectedTheme=null},a.prototype.changePage=function(a){var e=this;e.page=a,e.filterProposals(a)},a.prototype.filter=function(){var a=this;if(a.loadingThemes||a.loadingProposals)return void a.$log.info("No proposals or themes loaded yet. Abort.");if(a._filtredByThemeSlug){var e=a._filtredByThemeSlug;a.DialogaService.getThemeBySlug(e,function(e){a.selectedTheme=e},function(e){a.$log.error('Error when try to "getThemeBySlug"',e)})}a._filtredByQuery&&(a.query=a._filtredByQuery),(a._filtredByThemeSlug||a._filtredByQuery)&&(a.filterProposals(),a.loadingFilter=!1)},a.prototype.filterProposals=function(a,e){var o=this;if(o.loadingProposals)return void o.$log.debug("Content is not loaded yet.");var s=a||o.page,r=e||o.per_page,t=o.query,i={page:s,per_page:r,has_children:!0,"fields[]":["id","body","abstract","hits","ranking_position","votes_against","votes_count","votes_for","parent","categories","slug","url","image","title","archived"]};o.selectedTheme&&(i.category_ids=o.selectedTheme.id),t&&(i.query=t),o.loadingProposals=!0,o.DialogaService.searchProposals(i,function(a){o.total_proposals=parseInt(a._obj.headers("total")),o.filtredProposals=a.articles,o.loadingProposals=!1},function(a){o.error=a,o.$log.error(a),o.loadingProposals=!1})},a.prototype.submitSearch=function(){var a=this,e=angular.element("#search-result");e&&e.length>0?(angular.element("html,body").animate({scrollTop:e.offset().top},"fast"),a.filterProposals()):a.$log.warn("#search-result element not found.")}}(),function(){"use strict";function a(a,e,o,s,r,t){var i=this;i.DialogaService=a,i.$scope=e,i.$rootScope=o,i.$location=s,i.$filter=r,i.$log=t,i.init(),i.loadData(),i.attachListeners(),i.$rootScope.focusMainContent(),t.debug("RankingPageController")}angular.module("dialoga").controller("RankingPageController",a),a.$inject=["DialogaService","$scope","$rootScope","$location","$filter","$log"],a.prototype.init=function(){var a=this;a.page=1,a.per_page=10,a.themes=null,a.selectedTheme=null,a.filtredPrograms=null,a.selectedProgram=null,a.filtredProposals=null,a.query=null,a.search=a.$location.search(),a.slug=a.$location.$$path,console.log("aqui",a.$location.$$path),a.search.tema&&(a._filtredByThemeSlug=a.search.tema),a.search.programa&&(a._filtredByProgramSlug=a.search.programa),(a.search.tema||a.search.programa)&&(a.loadingFilter=!0),a.loading=null,a.error=null},a.prototype.loadData=function(){var a=this;a.loading=!0,a.loadingThemes=!0,a.DialogaService.getThemes(function(e){a.themes=e,a.loadingThemes=!1;var o=null;if(a.search.tema||a._filtredByThemeSlug){var s=a.themes.filter(function(e){return e.slug===a.search.tema||e.slug===a._filtredByThemeSlug});s&&s.length>0&&(o=s[0],a.selectedTheme=o)}o||(a.selectedTheme=a.themes[Math.floor(Math.random()*a.themes.length)]);var r=a.selectedTheme.id;a.loadPrograms(r,function(){a.loading=!1,a.loadingFilter=!1})},function(e){a.error=e,a.$log.error(e),a.loadingThemes=!1,a.loading=!1})},a.prototype.loadPrograms=function(a,e){var o=this;o.DialogaService.getProgramsByThemeId(a,function(a){o.filtredPrograms=a;var s=null;if(o.search.programa||o._filtredByProgramSlug){var r=o.filtredPrograms.filter(function(a){return a.slug===o.search.programa||a.slug===o._filtredByProgramSlug});r&&r.length>0&&(s=r[0],o.selectedProgram=s)}s||(o.selectedProgram=o.filtredPrograms[Math.floor(Math.random()*o.filtredPrograms.length)]),e&&e()},function(a){o.$log.error(a),e&&e()})},a.prototype.attachListeners=function(){var a=this;a.$scope.$on("change-selectedCategory",function(e,o){a.selectedTheme=o}),a.$scope.$watch("pageRanking.selectedTheme",function(e){a.search.tema=e?e.slug:null,a.$location.search("tema",a.search.tema),!a.loadingFilter&&a.selectedTheme&&a.selectedTheme.id&&a.loadPrograms(a.selectedTheme.id,function(){a.filterProposals()})}),a.$scope.$on("change-selectedTopic",function(e,o){a.selectedProgram=o}),a.$scope.$watch("pageRanking.selectedProgram",function(e){a.search.programa=e?e.slug:null,a.$location.search("programa",a.search.programa),a.loadingFilter||a.filterProposals()}),a.$scope.$watch("pageRanking.query",function(e){a.search.filtro=e?e:null,a.$location.search("filtro",a.search.filtro),a.loadingFilter||a.filterProposals()})},a.prototype.resetFilterValues=function(){var a=this;a.query=null,a.selectedTheme=null},a.prototype.changePage=function(a){var e=this;e.page=a,e.filterProposals(a)},a.prototype.filterProposals=function(a,e){var o=this;if(o.loadingProposals)return void o.$log.debug("Content is not loaded yet.");var s=a||o.page,r=e||o.per_page,t=o.query,i=o.selectedProgram,n={page:s,per_page:r};i&&(n.parent_id=i.id),t&&(n.query=t),o.loadingProposals=!0,o.DialogaService.searchProposals(n,function(a){o.total_proposals=parseInt(a._obj.headers("total")),o.filtredProposals=a.articles,o.loadingProposals=!1},function(a){o.error=a,o.$log.error(a),o.loadingProposals=!1})}}(),function(){"use strict";function a(a,e,o,s,r,t){var i=this;i.DialogaService=a,i.$scope=e,i.$rootScope=o,i.$location=s,i.$filter=r,i.$log=t,i.init(),i.loadData(),i.attachListeners(),i.$rootScope.focusMainContent(),t.debug("PropostasPageController")}angular.module("dialoga").controller("PropostasPageController",a),a.$inject=["DialogaService","$scope","$rootScope","$location","$filter","$log"],a.prototype.init=function(){var a=this;a.page=1,a.per_page=10,a.themes=null,a.selectedTheme=null,a.filtredProposals=null,a.query=null,a.search=a.$location.search(),a.search.tema&&(a._filtredByThemeSlug=a.search.tema),a.search.filtro&&(a._filtredByQuery=a.search.filtro),(a.search.tema||a.search.filtro)&&(a.loadingFilter=!0),a.loading=null,a.error=null},a.prototype.loadData=function(){var a=this;a.loading=!0,a.loadingThemes=!0,a.DialogaService.getThemes(function(e){a.themes=e,a.loadingThemes=!1,a.loading=!1,a.filter()},function(e){a.error=e,a.$log.error(e),a.loadingThemes=!1,a.loading=!1})},a.prototype.attachListeners=function(){var a=this;a.$scope.$on("change-selectedCategory",function(e,o){a.selectedTheme=o}),a.$scope.$watch("pagePropostas.selectedTheme",function(e){a.search.tema=e?e.slug:null,a.$location.search("tema",a.search.tema),a.loadingFilter||a.filterProposals()}),a.$scope.$watch("pagePropostas.query",function(e){a.search.filtro=e?e:null,a.$location.search("filtro",a.search.filtro),a.loadingFilter||a.filterProposals()})},a.prototype.resetFilterValues=function(){var a=this;a.query=null,a.selectedTheme=null},a.prototype.changePage=function(a){var e=this;e.page=a,e.filterProposals(a)},a.prototype.filter=function(){var a=this;if(a.loadingThemes||a.loadingProposals)return void a.$log.info("No proposals or themes loaded yet. Abort.");if(a._filtredByThemeSlug){var e=a._filtredByThemeSlug;a.DialogaService.getThemeBySlug(e,function(e){a.selectedTheme=e},function(e){a.$log.error('Error when try to "getThemeBySlug"',e)})}a._filtredByQuery&&(a.query=a._filtredByQuery),(a._filtredByThemeSlug||a._filtredByQuery)&&(a.filterProposals(),a.loadingFilter=!1)},a.prototype.filterProposals=function(a,e){var o=this;if(o.loadingProposals)return void o.$log.debug("Content is not loaded yet.");var s=a||o.page,r=e||o.per_page,t=o.query,i={page:s,per_page:r};o.selectedTheme&&(i.category_ids=o.selectedTheme.id),t&&(i.query=t),o.loadingProposals=!0,o.DialogaService.searchProposals(i,function(a){o.total_proposals=parseInt(a._obj.headers("total")),o.filtredProposals=a.articles,o.loadingProposals=!1},function(a){o.error=a,o.$log.error(a),o.loadingProposals=!1})},a.prototype.submitSearch=function(){var a=this,e=angular.element("#search-result");e&&e.length>0?(angular.element("html,body").animate({scrollTop:e.offset().top},"fast"),a.filterProposals()):a.$log.warn("#search-result element not found.")}}(),function(){"use strict";function a(a,e,o,s,r,t){var i=this;i.DialogaService=a,i.$scope=e,i.$rootScope=o,i.$location=s,i.$filter=r,i.$log=t,i.init(),i.loadData(),i.attachListeners(),i.$rootScope.focusMainContent(),i.$log.debug("ProgramasPageController")}angular.module("dialoga").controller("ProgramasPageController",a),a.$inject=["DialogaService","$scope","$rootScope","$location","$filter","$log"],a.prototype.init=function(){var a=this;a.themes=null,a.selectedTheme=null,a.programs=null,a.filtredPrograms=null,a.query=null,a.search=a.$location.search(),a.search.tema&&(a._filtredByThemeSlug=a.search.tema),a.search.filtro&&(a._filtredByQuery=a.search.filtro),(a.search.tema||a.search.filtro)&&(a.loadingFilter=!0),a.loading=null,a.error=null},a.prototype.loadData=function(){var a=this;a.loading=!0,a.loadingPrograms=!0,a.DialogaService.getPrograms(function(e){a.programs=e,a.filtredPrograms=a.programs,a.loadingPrograms=!1,a.filter()},function(e){a.error=e,a.$log.error(e),a.loadingPrograms=!1}),a.loadingThemes=!0,a.DialogaService.getThemes(function(e){a.themes=e,a.loadingThemes=!1,a.filter()},function(e){a.error=e,a.$log.error(e),a.loadingThemes=!1})},a.prototype.attachListeners=function(){var a=this;a.$scope.$on("change-selectedCategory",function(e,o){a.selectedTheme=o,a.$log.debug("vm.selectedTheme",a.selectedTheme)}),a.$scope.$watch("pageProgramas.selectedTheme",function(e){a.search.tema=e?e.slug:null,a.$location.search("tema",a.search.tema),a.loadingFilter||(a.filtredPrograms=a.getFiltredPrograms())}),a.$scope.$watch("pageProgramas.query",function(e){a.search.filtro=e?e:null,a.$location.search("filtro",a.search.filtro),a.loadingFilter||(a.filtredPrograms=a.getFiltredPrograms())})},a.prototype.filter=function(){var a=this;if(a.loadingThemes||a.loadingPrograms)return void a.$log.info("No programs or themes loaded yet. Abort.");if(a._filtredByThemeSlug){var e=a._filtredByThemeSlug;a.DialogaService.getThemeBySlug(e,function(e){a.selectedTheme=e},function(e){a.$log.error('Error when try to "getThemeBySlug"',e)})}a._filtredByQuery&&(a.query=a._filtredByQuery),(a._filtredByThemeSlug||a._filtredByQuery)&&(a.filtredPrograms=a.getFiltredPrograms(),a.loadingFilter=!1)},a.prototype.submitSearch=function(){var a=this;a.loadingFilter=!0;var e=angular.element("#search-result");e&&e.length>0?(angular.element("html,body").animate({scrollTop:e.offset().top},"fast"),a.filtredPrograms=a.getFiltredPrograms()):a.$log.warn("#search-result element not found.")},a.prototype.showAllPrograms=function(a){var e=this;a.stopPropagation(),e.resetFilterValues(),e._showAllFlag=!0,e.filtredPrograms=e.getFiltredPrograms()},a.prototype.resetFilterValues=function(){var a=this;a.query=null,a.selectedTheme=null},a.prototype.getFiltredPrograms=function(){var a=this;if(!a.programs)return a.$log.info("No programs loaded yet. Abort."),null;var e=a.programs,o=e,s=a.query,r=a.selectedTheme,t=a.$filter("filter");return r&&(o=a._filterByCategory(o,r)),s&&(o=t(o,s,!1)),s||r||!a._showAllFlag||(o=a._balanceByCategory(o)),o},a.prototype._filterByCategory=function(a,e){var o=this;if(a=a||[],!e)return a;for(var s=[],r=0;r0)){var d=l.pop();o.push(d),p=!0}p||(c=!1)}return o}}(),function(){"use strict";function a(a,e,o,s,r,t,i,n,l,c,p){var d=this;d.DialogaService=a,d.PATH=e,d.VOTE_OPTIONS=o,d.PROPOSAL_STATUS=s,d.$state=r,d.$location=t,d.$scope=i,d.$rootScope=n,d.$element=l,d.$sce=c,d.$log=p,d.init(),d.loadData(),d.attachListeners(),d.$rootScope.focusMainContent(),d.$log.debug("ProgramaPageController")}angular.module("dialoga").controller("ProgramaPageController",a),a.$inject=["DialogaService","PATH","VOTE_OPTIONS","PROPOSAL_STATUS","$state","$location","$scope","$rootScope","$element","$sce","$log"],a.prototype.init=function(){var a=this;a.article=null,a.category=null,a.loading=null,a.loadingTopProposals=null,a.loadingProposalBox=null,a.sendProposalRedirectURI=null,a.showDetailAboutArchived=!1,a.search=a.$location.search(),a.error=!1},a.prototype.loadData=function(){var a=this;a.loading=!0,a.proposalStatus=null;var e=a.$state.params.slug;return e?void a.DialogaService.getProgramBySlug(e,function(o){a.article=o,a.category=a.article.categories[0],a.sendProposalRedirectURI="state=programa&task=send-proposal&slug="+e,a.$rootScope.contentTitle=a.article.title,!a.banner&&a.article.image&&(a.banner={src:a.PATH.image+a.article.image.url,alt:"Imagem de destaque do conteúdo"}),a.article.body&&!a.article.bodyTrusted&&(a.article.bodyTrusted=a.$sce.trustAsHtml(a.article.body)),a.loadingTopProposals=!0,a.DialogaService.getProposalsByTopicIdRanked(a.article.id,{limit:5},function(e){if(a.total_proposals=parseInt(a.article.children_count),a.proposals=e.articles?e.articles:e.proposals,console.log("-------------",a.proposals),a.proposalsTopFive=a.proposals.slice(0,5),a.proposalsTopRated=a.proposals.slice(0,3),a.loadingTopProposals=!1,a.article.archived&&a.search.proposal_id){for(var o=!1,s=parseInt(a.search.proposal_id),r=a.proposalsTopRated.length-1;r>=0;r--){var t=a.proposalsTopRated[r];if(t.id===s){o=!0;break}}if(!o)return void a.$log.debug("Proposal is not one of top 3.");a.$rootScope.findElAsyncAndFocus(".sub-section-"+s)}for(var i=a.proposalsTopRated.length-1;i>=0;i--){var n=a.proposalsTopRated[i];n.body=n&&n.body&&n.body.length>0?String(n.body).replace(/<[^>]+>/gm,""):a.banner.src}},function(e){a.$log.error(e),a.loadingTopProposals=!1}),a.article.archived||(a.search.proposal_id?a.loadProposalById(a.search.proposal_id):a.loadRandomProposal()),a.loading=!1},function(e){a.$log.error(e),a.error=e,a.loading=!1}):(a.$log.warn("slug not defined."),a.$log.info("Rollback to home page."),void a.$state.go("inicio",{},{location:"replace"}))},a.prototype.attachListeners=function(){var a=this;a.$scope.$on("proposal-carousel:showProposalsList",function(){a.showProposalsList()}),a.$scope.$on("cadastro-proposa:startSendProposal",function(e,o){a.proposalStatus=a.PROPOSAL_STATUS.SENDING;var s=a.article.categories[0].id;a.DialogaService.createProposal(o,a.article.id,s,function(e){a.$log.debug("response",e),a.proposalStatus=a.PROPOSAL_STATUS.SUCCESS},function(e){a.$log.error(e),a.error=e,400===a.error.code&&(a.error.message="",a.error.message+="Não foi possível enviar a proposta.
",a.error.message+="Este problema já foi registrado em nossos servidores.
",a.error.message+="Por favor, tente novamente mais tarde."),a.proposalStatus=a.PROPOSAL_STATUS.ERROR})})},a.prototype.loadProposalById=function(a){var e=this;e.loadingProposalBox=!0,e.DialogaService.getProposalById(a,{limit:"1"},e._handleSuccessOnGetProposal.bind(e),e._handleErrorOnGetProposal.bind(e))},a.prototype.loadRandomProposal=function(){var a=this;a.loadingProposalBox=!0,a.DialogaService.getProposalsByTopicId(a.article.id,{order:"random()",limit:"1",t:Date.now()},a._handleSuccessOnGetProposal.bind(a),a._handleErrorOnGetProposal.bind(a))},a.prototype._handleSuccessOnGetProposal=function(a){var e=this;if(a&&a.articles){var o=a.articles.length;e.randomProposal=a.articles[Math.floor(Math.random()*o)],e.loadingProposalBox=!1,e.$scope.$broadcast("proposal-box:proposal-loaded",{success:!0})}e.search.proposal_id&&e.$rootScope.findElAsyncAndFocus(".focused-proposal")},a.prototype._handleErrorOnGetProposal=function(a){var e=this;e.$log.error(a),e.$scope.$broadcast("proposal-box:proposal-loaded",{error:!0})},a.prototype.voteSkip=function(){var a=this;a.loadRandomProposal()},a.prototype.vote=function(a,e){var o=this;return o.article.archived?void o.$log.info("Article archived. Abort."):e===o.VOTE_OPTIONS.SKIP?void o.voteSkip():void o.DialogaService.voteProposal(a,{value:e}).then(function(a){o.$log.debug("voteProposal response",a),a.success=!0,o.$scope.$broadcast("proposal-box:vote-response",a)},function(a){o.$log.debug("voteProposal error",a),a.error=!0,o.$scope.$broadcast("proposal-box:vote-response",a)})["finally"](function(a){o.$log.debug("voteProposal finally",a)})},a.prototype.showProposalsList=function(){var a=this;a.findAndShow("#section-proposal-list")},a.prototype.hideProposalsList=function(){var a=this;a.findAndHide("#section-proposal-list")},a.prototype.showProposalForm=function(){var a=this;return a.article.archived?void a.$log.info("Article archived. Abort."):void a.findAndShow("#section-proposal-form")},a.prototype.hideProposalForm=function(){var a=this;a.findAndHide("#section-proposal-form")},a.prototype.findAndShow=function(a){var e=this,o=e.$element.find(a);o.slideDown(),angular.element("html,body").animate({scrollTop:o.offset().top},"fast")},a.prototype.findAndHide=function(a){var e=this;e.$element.find(a).slideUp()},a.prototype.sendAnotherProposal=function(){var a=this;a.proposalStatus=null},a.prototype.toggleContentVisibility=function(){var a=this,e=angular.element(".section-content");return e&&0!==e.length?void(e.is(":visible")?e.slideUp():(e.slideDown(),angular.element("html,body").animate({scrollTop:e.offset().top},"fast"))):void a.$log.warn('".section-content" not found.')},a.prototype.toggleResponseVisibility=function(a){function e(){var e=angular.element(".gov-response-"+a.id);e.is(":visible")?e.slideUp():e.slideDown(100,function(){angular.element("html,body").animate({scrollTop:e.offset().top},"fast")})}var o=this;return a?void(a.response?e():(a.response={loading:!0,error:!1,content:null},o.DialogaService.getResponseByProposalId(a.proposal_id).then(function(o){a.response.content=o.articles[0].body,e()})["catch"](function(){a.response.error=!1})["finally"](function(){a.response.loading=!1}))):void o.$log.error("Error - proposal is:",a)}}(),function(){"use strict";function a(a,e,o,s){var r=this;r.DialogaService=a,r.$log=s,r.init(),r.loadData(),r.$log.debug("SitemapPageController")}function e(a){for(var e={},o=a.length,s=0;o>s;s++){var r=a[s],t=r.categories[0],i=e[t.slug]||{};angular.isArray(i.programs)||(i=t,i.programs=[],e[i.slug]=i),i.programs.push(r)}return e}angular.module("dialoga").controller("SitemapPageController",a),a.$inject=["DialogaService","$state","$sce","$log"],a.prototype.init=function(){var a=this;a.programsPerThemes=null},a.prototype.loadData=function(){var a=this;a.DialogaService.getPrograms(function(o){a.programsPerThemes=e(o)},function(e){a.error=e,a.$log.error(e)})}}(),function(){"use strict";function a(a,e,o,s,r,t,i){var n=this;n.DialogaService=a,n.$scope=e,n.$location=o,n.$filter=s,n.$sce=r,n.$timeout=t,n.$log=i,n.init(),n.loadData(),n.attachListeners(),n.$log.debug("InicioPageController")}function e(a){for(var e=[],o={},s=0;s0)){var p=n.pop();e.push(p),c=!0}c||(l=!1)}return e}function o(){var a=document.createElement("script");a.src="https://www.youtube.com/iframe_api";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}function s(){var a=angular.element.find(".js-iframe iframe"),e=window.YT.Player;new e(a[0],{events:{onReady:r}})}function r(a){a.target.playVideo(),t(1e3)}function t(a){var e=angular.element.find(".video-background");angular.element(e).fadeOut(a||100)}angular.module("dialoga").controller("InicioPageController",a),a.$inject=["DialogaService","$scope","$location","$filter","$sce","$timeout","$log"],a.prototype.init=function(){var a=this;a.article=null,a.events=null,a.featuredEvent=null,a.bannerRespostas=!0,a.themes=null,a.selectedTheme=null,a.programs=null,a.filtredPrograms=null,a.query=null,a.scroll=null,a.search=a.$location.search(),a.search.tema&&(a._filtredByThemeSlug=a.search.tema),a.search.filtro&&(a._filtredByQuery=a.search.filtro),(a.search.tema||a.search.filtro)&&(a.loadingFilter=!0),a.search.scroll&&(a.scroll=a.search.scroll),a.loading=null,a.error=null},a.prototype.loadData=function(){function a(){o.loadingThemes=!0,o.DialogaService.getThemes(function(a){o.themes=a,o.loadingThemes=!1,o.filter()},function(a){o.$log.error("Error on getThemes.",a),o.loadingThemes=!1,o.errorThemes=a}),o.loadingPrograms=!0,o.DialogaService.getProgramsRandom({},function(a){o.programs=o.article.children,o.filtredPrograms=a.articles,o.loadingPrograms=!1,o.filter(),e()},function(a){o.$log.error("Error on getPrograms.",a),o.loadingPrograms=!1,o.errorPrograms=a})}function e(){o._scrollHandler()}var o=this;o.loading=!0,o.DialogaService.getHome(function(e){o.article=e.article,o.article.videoIsLoaded&&t(2e3),a(),o.loading=!1},function(a){o.$log.error("Error on getHome.",a),o.loading=!1,o.error=a}),o.loadingEvents=!0,o.DialogaService.getEvents().then(function(a){o.$log.debug("getEvents.success",a),o.events=a.articles;var e=o.$filter("orderBy");o.featuredEvent=e(o.events,"start_date",!1)[0]},function(a){o.$log.debug("Error on getEvents.",a),o.eventsError=a},function(a){o.$log.debug("{UPDATE}",a)})["finally"](function(a){o.$log.debug("{FINALLY}",a),o.loadingEvents=!1})},a.prototype._scrollHandler=function(){var a=this;if(a.search.scroll){var e=a.search.scroll,o=0;if(angular.isNumber(e))o=parseInt(e);else{var s=angular.element("#"+a.search.scroll);s&&s.length>0?o=s.offset().top:a.$log.warn("element not found:",a.search.scroll)}a.$timeout(function(){angular.element("html,body").animate({scrollTop:o},"fast")},0)}},a.prototype.attachListeners=function(){var a=this;a.$scope.$on("change-selectedCategory",function(e,o){a.selectedTheme=o}),a.$scope.$watch("pageInicio.selectedTheme",function(e){a.search.tema=e?e.slug:null,a.$location.search("tema",a.search.tema),a.loadingFilter||(a.filtredPrograms=a.getFiltredPrograms())}),a.$scope.$watch("pageInicio.query",function(e){a.search.filtro=e?e:null,a.$location.search("filtro",a.search.filtro),a.loadingFilter||(a.filtredPrograms=a.getFiltredPrograms())})},a.prototype.showVideo=function(){var a=this;return a.article.videoIsLoaded?(t(0),void a.$log.debug("The content already cached. Show-it!")):(o(),window.onYouTubeIframeAPIReady=window.onYouTubeIframeAPIReady||s,window.onYouTubePlayerReady=window.onYouTubePlayerReady||r,void(a.article.videoIsLoaded=!0))},a.prototype.showEventVideo=function(){var a=this;t(0),a.featuredEvent.canView=!0,a.featuredEvent.bodyTrusted=a.$sce.trustAsHtml(a.featuredEvent.body)},a.prototype.submitSearch=function(){var a=this;a.loadingFilter=!0;var e=angular.element("#search-result");e&&e.length>0?(angular.element("html,body").animate({scrollTop:e.offset().top},"fast"),a.filtredPrograms=a.getFiltredPrograms()):a.$log.warn("#search-result element not found.")},a.prototype.filter=function(){var a=this;if(a.loadingThemes||a.loadingPrograms)return void a.$log.info("No programs or themes loaded yet. Abort.");if(a._filtredByThemeSlug){var e=a._filtredByThemeSlug;a.DialogaService.getThemeBySlug(e,function(e){a.selectedTheme=e},function(e){a.$log.error('Error when try to "getThemeBySlug"',e)})}a._filtredByQuery&&(a.query=a._filtredByQuery),(a._filtredByThemeSlug||a._filtredByQuery)&&(a.filtredPrograms=a.getFiltredPrograms(),a.loadingFilter=!1)},a.prototype.showAllPrograms=function(a){var e=this;a.stopPropagation(),e.resetFilterValues(),e.filtredPrograms=e.getFiltredPrograms()},a.prototype.resetFilterValues=function(){var a=this;a.query=null,a.selectedTheme=null},a.prototype.getFiltredPrograms=function(){var a=this;if(!a.programs)return a.$log.debug("No programs loaded yet. Abort."),null;var o=a.programs,s=o,r=a.query,t=a.selectedTheme,i=a.$filter("filter");return a.loadingFilter=!0,t&&(s=a._filterByCategory(s,t)),r&&(s=i(s,r,!1)),r||t||(s=e(s)),a.loadingFilter=!1,s},a.prototype._filterByCategory=function(a,e){var o=this;if(a=a||[],!e)return a;for(var s=[],r=0;r0&&(a.$window.initCaptcha(o[0]),a.$interval.cancel(e),e=void 0)},200)},a.prototype.submitContactForm=function(a,e){var o=this;o.$log.debug("submitContactForm contactForm",e),o.sendingContactForm=!0;var s={name:e.inputName.$modelValue,email:e.inputEmail.$modelValue,subject:e.inputSubject.$modelValue,message:e.inputMessage.$modelValue},r=a.target,t=angular.element(r),i=t.find('[name="txtToken_captcha_serpro_gov_br"]');s.txtToken_captcha_serpro_gov_br=i.val(),o.DialogaService.sendContactForm(s).then(function(a){o.$log.debug("sendContactForm success",a),o.successMessage="Mensagem enviada com sucesso!"},function(a){o.$log.warn("sendContactForm error",a),o.errorMessage="Erro ao enviar mensagem. Tente novamente mais tarde."})["finally"](function(a){o.$log.debug("sendContactForm finally",a),o.sendingContactForm=!1})}}(),function(){"use strict";function a(a,e,o){var s=this;s.AuthService=a,s.$state=e,s.$log=o,s.init(),s.$log.debug("NewPasswordPageController")}angular.module("dialoga").controller("NewPasswordPageController",a),a.$inject=["AuthService","$state","$log"],a.prototype.init=function(){var a=this;a.loading=!1,a.submitNewPasswordSuccess=!1,a.submitNewPasswordError=!1,a.token=a.$state.params.token},a.prototype.submitNewPassword=function(a,e){var o=this;if(!e.$valid)return void o.$log.warn("Form validation: fail.");o.loading=!0,o.submitNewPasswordSuccess=!1,o.submitNewPasswordError=!1;var s={code:o.token,newPassword:e.newPassword.$modelValue,newPasswordConfirmation:e.newPasswordConfirmation.$modelValue},r=o.AuthService.changePassword(s);r.then(function(a){o.$log.debug("new password success:",a),o.submitNewPasswordSuccess=!0})["catch"](function(a){o.$log.debug("new password error:",a),o.submitNewPasswordError=!0,o.submitNewPasswordErrorMessage=a.data.message||"Não foi possível configurar nova senha.",a.status>=500&&a.status<600&&(o.internalError=!0)})["finally"](function(){o.loading=!1})}}(),function(){"use strict";function a(a,e,o,s,r,t,i,n,l,c,p,d,g){var u=this;u.$scope=a,u.$rootScope=e,u.$window=o,u.$location=s,u.$state=r,u.$timeout=t,u.$interval=i,u.APP=n,u.AUTH_EVENTS=l,u.AuthService=c,u.DialogaService=p,u.Session=d,u.$log=g,u.init(),u.loadData(),u.attachListeners(),u.$rootScope.focusMainContent(),u.$log.debug("AuthPageController")}function e(a){return angular.element(a.target).find('[name="txtToken_captcha_serpro_gov_br"]').val()}angular.module("dialoga").controller("AuthPageController",a),a.$inject=["$scope","$rootScope","$window","$location","$state","$timeout","$interval","APP","AUTH_EVENTS","AuthService","DialogaService","Session","$log"],a.prototype.init=function(){var a=this;a.signin={},a.signup={},a.terms=null,a.loadingTerms=null,a.delay=3,a.countdown=0,a.search=a.$location.search();var e=a.search.redirect_uri||"";e&&e.length>0&&(a.params=JSON.parse('{"'+decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}'),a.hasRedirect=!0),a.currentUser=a.Session.getCurrentUser(),a.$scope.$on(a.AUTH_EVENTS.loginSuccess,function(){a.currentUser=a.Session.getCurrentUser()}),a.$scope.$on(a.AUTH_EVENTS.logoutSuccess,function(){a.clearMessages(),a.currentUser=a.Session.getCurrentUser(),a._attachCaptcha()})},a.prototype.loadData=function(){var a=this;a.loadingTerms=!0,a.DialogaService.getTerms(function(e){a.loadingTerms=!1,a.terms=e.article},function(e){a.loadingTerms=!1,a.error=e})},a.prototype.attachListeners=function(){var a=this;a.$scope.$on(a.AUTH_EVENTS.registerSuccess,function(e,o){a.$log.debug("[register success] response",o)}),a.$scope.$on(a.AUTH_EVENTS.registerFailed,function(e,o){a.$log.debug("[register error] response",o)}),a.$scope.$on("oauthClientPluginResult",function(e,o){a.$log.debug("response",o)}),a._attachCaptcha()},a.prototype._attachCaptcha=function(){var a=this,e=null;e=a.$interval(function(){var o=angular.element("#serpro_captcha");o&&o.length>0&&(a.$window.initCaptcha(o[0]),a.$interval.cancel(e),e=void 0)},200)},a.prototype.onClickLogout=function(){var a=this;a.AuthService.logout()},a.prototype.submitSignup=function(a,o){var s=this;o.txtToken_captcha_serpro_gov_br=e(a),s.AuthService.register(o).then(function(){s.signupSuccess=!0},function(a){if(s.signupError=!0,s.signupErrorTitle="Erro!",s.signupErrorMessage=a.data.message,a.status>=400&&a.status<500){var e=JSON.parse(a.data.message);e&&e.email&&(s.signupErrorMessage="E-mail já está em uso.")}a.status>=500&&a.status<600&&(s.internalError=!0)})},a.prototype.submitSignin=function(a){ +var e=this;e.AuthService.login(a).then(function(){e.showSigninSuccessMessage(),e._startRedirect()},function(a){e.$log.error('Error on "submitSignin"',a),e.signinError=!0,a.status>=400&&a.status<500&&(e.signinErrorTitle="Erro!",e.signinErrorContent=a.data.message,401===a.status&&(e.signinErrorTitle="Acesso não autorizado!",e.signinErrorContent="E-mail ou senha incorretos."))})},a.prototype.submitRecover=function(a,o){var s=this;s.loadingSubmitRecover=!0;var r={login:o.login.$modelValue,captcha_text:o.captcha_text.$modelValue,txtToken_captcha_serpro_gov_br:e(a)},t=s.AuthService.forgotPassword(r);t.then(function(a){s.$log.debug("recover success.response",a),s.recoverSuccess=!0}),t["catch"](function(a){s.$log.debug("recover error.response",a),s.recoverError=!0,s.recoverErrorMessage=a.data.message,a.status>=400&&a.status<500&&404===a.status&&(s.recoverErrorMessage="E-mail não cadastrado no Dialoga Brasil."),a.status>=500&&a.status<600&&(s.internalError=!0)}),t["finally"](function(){s.loadingSubmitRecover=!1})},a.prototype.submitConfirmationForm=function(a,o){var s=this,r={login:o.login.$modelValue,captcha_text:o.captcha_text.$modelValue,txtToken_captcha_serpro_gov_br:e(a)};s.AuthService.resendConfirmation(r).then(function(a){s.$log.debug("resendConfirmation success.response",a),s.resendConfirmationSuccess=!0;var e=a.data.users[0];e&&e.activated===!0?(s.resendConfirmationSuccessTitle="Usuário já está ativo!",s.resendConfirmationSuccessMessage="O e-mail informado já foi confirmado."):(s.resendConfirmationSuccessTitle="Pronto!",s.resendConfirmationSuccessMessage="Em instantes você receberá em seu e-mail um link para confirmar o seu cadastro.")},function(a){s.$log.debug("resendConfirmation error.response",a),s.resendConfirmationError=!0,s.resendConfirmationErrorMessage=a.data.message,a.status>=500&&a.status<600&&(s.internalError=!0)})["catch"](function(a){s.$log.debug("resendConfirmation catch.error",a)})},a.prototype.clearMessages=function(){var a=this;a.signupSuccess=!1,a.signinSuccess=!1,a.confirmSuccess=!1,a.signinError=!1,a.signupError=!1},a.prototype.showSigninSuccessMessage=function(){var a=this;a.signinSuccess=!0,a.successMessage="Login efetuado com sucesso!"},a.prototype._startRedirect=function(){var a=this;if(!a.hasRedirect)return void a.$log.debug("No redirect params defined.");a.countdown=a.delay;var e=null;e=a.$interval(function(){a.countdown--,a.countdown<=0&&(a.$interval.cancel(e),e=void 0)},1e3),a.$timeout(function(){var e=a.params.state;switch(e){case"inicio":a.$state.go(e,{event_id:a.params.event_id,task:a.params.task});break;case"programa":a.$state.go(e,{slug:a.params.slug,task:a.params.task,proposal_id:a.params.proposal_id});break;default:a.$log.debug("State not handled yet:",e)}},1e3*a.delay)},a.prototype.authWithFacebook=function(){var a=this,e="http://hom.login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id="+a.APP.facebook_app_id;a.$window.oauthClientAction(e)},a.prototype.authWithGooglePlus=function(){var a=this,e="http://hom.login.dialoga.gov.br/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id="+a.APP.google_app_id;a.$window.oauthClientAction(e)}}(),function(){"use strict";function a(a,e,o){var s=this;s.AuthService=a,s.$state=e,s.$log=o,s.init(),s.doActivation(),s.$log.debug("ActivePageController")}angular.module("dialoga").controller("ActivePageController",a),a.$inject=["AuthService","$state","$log"],a.prototype.init=function(){var a=this;a.loading=!0,a.activation_code=a.$state.params.activation_code},a.prototype.doActivation=function(){var a=this;a.AuthService.activate(a.activation_code).then(function(e){a.$log.info("response",e),a.successMessageTitle="Pronto!",a.successMessageContent="Conta ativada com sucesso!"},function(e){a.$log.error("response",e),a.errorMessageTitle="Erro!",(e.status>=500||e.status<600)&&(a.errorMessageContent="Código de ativação incorreto.")})["finally"](function(e){a.$log.debug("finally",e),a.loading=!1})}}(),function(){"use strict";function a(a,e,o,s,r){var t=this;t.DialogaService=a,t.$rootScope=e,t.$state=o,t.$sce=s,t.$log=r,t.init(),t.loadData(),t.$rootScope.focusMainContent(),t.$log.debug("ArticlePageController")}angular.module("dialoga").controller("ArticlePageController",a),a.$inject=["DialogaService","$rootScope","$state","$sce","$log"],a.prototype.init=function(){var a=this;a.page=a.$state.current.name,a.article=null,a.loading=!0,a.$log.debug("vm.page",a.page)},a.prototype.loadData=function(){function a(a){o.loading=!1,o.article=a.article}function e(a){o.loading=!1,o.error=a}var o=this;switch(o.page){case"sobre":o.DialogaService.getAbout(a,e);break;case"termos-de-uso":o.DialogaService.getTerms(a,e);break;default:o.$log.debug("Page not handled:",o.page)}}}(),function(){"use strict";function a(){function a(a){a.debug("validationMessagesController");var e=this;e.$log=a,e.init()}a.$inject=["$log"],a.prototype.init=function(){var a=this;a.required||(a.required="Ops, o campo é obrigatório."),a.minlength||(a.minlength="O campo deve ser maior."),a.maxlength||(a.maxlength="O campo deve ser menor"),a.email||(a.email="O endereço de e-mail deve ser válido")};var e={restrict:"E",templateUrl:"app/components/validation-messages/validation-messages.html",scope:{field:"=",required:"=",minlength:"=",maxlength:"=",email:"="},controller:a,controllerAs:"vm",bindToController:!0};return e}angular.module("dialoga").directive("validationMessages",a)}(),function(){"use strict";function a(a,e,o){function s(e,o){return a.get(e,o).then(t)["catch"](i)}function r(e,o){return a.post(e,o).then(t)["catch"](i)}function t(a){return o.debug("[SUCCESS]",a),a.data._obj=a,a.data}function i(a){return o.debug("[ERROR]",a),o.error("XHR Failed on Service.\n"+angular.toJson(a.data,!0)),e.reject(angular.isObject(a.data)?a.data:"An unknown error occurred.")}o.debug("UtilService");var n={get:s,post:r,handleSuccess:t,handleError:i};return n}angular.module("dialoga").factory("UtilService",a),a.$inject=["$http","$q","$log"]}(),function(){"use strict";function a(){function a(a,e){e.debug("TopicsSelectController");var o=this;o.$rootScope=a,o.$log=e,o.init()}a.$inject=["$rootScope","$log"],a.prototype.init=function(){},a.prototype.selectTopic=function(){var a=this;return null===a.selectedTopic?void a.$log.debug("Default topic selected."):void a.$rootScope.$broadcast("change-selectedTopic",a.selectedTopic)};var e={restrict:"E",templateUrl:"app/components/topics-select/topics-select.html",scope:{topics:"=",selectedTopic:"="},controller:a,controllerAs:"vm",bindToController:!0};return e}angular.module("dialoga").directive("topicsSelect",a)}(),function(){"use strict";function a(){function a(a,e,o,s,r){r.debug("TopicListController");var t=this;t.$scope=a,t.$element=e,t.$location=o,t.$filter=s,t.$log=r,t.defaultLimit=6,t.init()}a.$inject=["$scope","$element","$location","$filter","$log"],a.prototype.init=function(){var a=this;if(!a.article)return void a.$log.debug("no article to display. Tip: use a ng-if before use this directive");if(a.categories=a.article.categories,a.programs=a.article.children,a.orderCriteries=[{label:"Título",name:"titulo"},{label:"Tema",name:"tema"},{label:"Aleatório",name:"aleatorio"}],a.filtredProgramList=a.getFiltredPrograms(),a.search=a.$location.search(),a.query=a.search&&a.search.filtro?a.search.filtro:null,a.limitTo=a.search&&a.search.limite?parseInt(a.search.limite,10):a.defaultLimit,a.categoryFilter=a.search&&a.search.tema?a.getCategoryBySlug(a.search.tema):null,a.orderCriteria=a.search&&a.search.ordem?{name:a.search.ordem}:null,a.reverse=a.search&&a.search.reverso?!0:!1,!angular.equals({},a.search)){var e=a.$element;angular.element("html,body").animate({scrollTop:e.offset().top},"slow")}a.$scope.$watch("vm.query",function(e){a.search.filtro=e?e:null,a.$location.search("filtro",a.search.filtro),a.limitTo=a.search.filtro?a.programs.length:a.defaultLimit,a.filtredProgramList=a.getFiltredPrograms()}),a.$scope.$watch("vm.limitTo",function(e){a.search.limite=e&&e!==a.defaultLimit?e:null,a.$location.search("limite",a.search.limite),a.filtredProgramList=a.getFiltredPrograms()}),a.$scope.$watch("vm.categoryFilter",function(e){a.search.tema=e?e.slug:null,a.$location.search("tema",a.search.tema),a.search.tema&&(a.limitTo=a.programs.length),a.filtredProgramList=a.getFiltredPrograms()}),a.$scope.$watch("vm.orderCriteria",function(e){a.search.ordem=e&&e.name?e.name:null,a.$location.search("ordem",a.search.ordem),a.filtredProgramList=a.getFiltredPrograms()}),a.$scope.$watch("vm.reverse",function(e){a.search.reverso=e?e:null,a.$location.search("reverso",a.search.reverso),a.filtredProgramList=a.getFiltredPrograms()})},a.prototype.resetFilterValues=function(){var a=this;a.query=null,a.limitTo=a.defaultLimit,a.categoryFilter=null,a.orderCriteria=null},a.prototype.getIconClasses=function(a){var e=this;return e.$log.debug("[TODO] getIconClasses of category:",a),"glyphicon glyphicon-exclamation-sign"},a.prototype.getCategoryBySlug=function(a){var e=this,o=null;return angular.forEach(e.categories,function(e){e.slug===a&&(o=e)}),o},a.prototype.filterByCategory=function(a,e){var o=this;e.stopPropagation(),o.categoryFilter=a!==o.categoryFilter?a:null},a.prototype.showAll=function(a){var e=this;a.stopPropagation(),e.resetFilterValues(),e.limitTo=e.programs.length},a.prototype.getFiltredPrograms=function(){var a=this,o=a.programs,s=o,r=a.query,t=a.categoryFilter,i=a.orderCriteria?a.orderCriteria:{name:"aleatorio"},n=a.$filter("filter"),l=a.$filter("orderBy"),c=a.$filter("limitTo"),p=a.limitTo?a.limitTo:4;switch(t&&(s=e(s,t)),r&&(s=n(s,r,!1)),i.name){case"titulo":s=l(s,"title",a.reverse);break;case"tema":s=l(s,"categories[0].name",a.reverse);break;case"more_participants":a.$log.info("Criteria not handled yet: ",i);break;case"aleatorio":s=a.filterShuffle(s),a.reverse&&(s=s.slice().reverse());break;default:a.$log.warn("Criteria not matched: ",i)}return s=c(s,p)},a.prototype.filterShuffle=function(a){for(var e=[],s={},r=0;r0)){var d=l.pop();e.push(d),p=!0}p||(c=!1)}return e};var s={restrict:"E",templateUrl:"app/components/programas/programas.html",scope:{article:"="},controller:a,controllerAs:"vm",bindToController:!0};return s}function e(a,e){if(a=a||[],!e)return a;for(var o=[],s=0;sÉ calculada pelo saldo de interações das propostas (curtidas - não curtidas) dividido pela diferença de exibições entre elas.

O objetivo dessa correção é compensar o saldo de interações e a diferença de exibições das propostas que não tiveram muitas oportunidades de visualização ou das propostas que tiveram mais oportunidades de visualização que a média.

Com essa correção, é possível comparar propostas que entraram em diferentes momentos, durante todo o período da consulta.

"})}a.$inject=["$state","$element","$timeout","$log"],a.prototype.init=function(){var a=this;if(!a.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};a.$timeout(function(){e.call(a)},0)},a.prototype.showContent=function(a){var e=this;console.log("PROPOSAL-LIST",a),e.$state.go("programa",{slug:a.parent.slug,proposal_id:a.proposal_id},{location:!0,reload:!0})};var o={restrict:"E",templateUrl:"app/components/proposal-list/proposal-list.html",scope:{proposals:"="},controller:a,controllerAs:"vm",bindToController:!0};return o}angular.module("dialoga").directive("proposalList",a)}(),function(){"use strict";function a(){function a(a,e,o,s,r,t){t.debug("ProposalGridController");var i=this;i.$scope=a,i.$rootScope=e,i.$element=o,i.$location=s,i.$filter=r,i.$log=t,i.init(),i.attachListeners()}a.$inject=["$scope","$rootScope","$element","$location","$filter","$log"],a.prototype.init=function(){},a.prototype.attachListeners=function(){};var e={restrict:"E",templateUrl:"app/components/proposal-grid/proposal-grid.html",scope:{proposals:"="},controller:a,controllerAs:"vm",bindToController:!0};return e}angular.module("dialoga").directive("proposalGrid",a)}(),function(){"use strict";function a(){function a(a,e,o,s,r){r.debug("ProposalCarouselController");var t=this;t.$scope=a,t.$state=e,t.$element=o,t.$timeout=s,t.$log=r,t.init()}a.$inject=["$scope","$state","$element","$timeout","$log"],a.prototype.init=function(){var a=this;if(!a.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};a.activeIndex=0,a.archived=a.archived||!1,a.loading=!1,a.proposalsLength=a.proposals.length},a.prototype.swipeLeft=function(){var a=this;a.activeIndex=a.activeIndex0?--a.activeIndex:a.proposalsLength-1},a.prototype.switchProposal=function(a){var e=this;a>=0&&a]+>/gm,""),a.ProposalBody="undefined"!==a.proposalsImg?!1:!0},a.prototype.addListeners=function(){var a=this;a.$scope.$on("proposal-box:proposal-loaded",function(e,o){o.success&&(a.STATE=null),o.error&&(a.errorOnSkip=o.error)}),a.$scope.$on("proposal-box:vote-response",function(e,o){o.success&&(a.STATE=a.VOTE_STATUS.SUCCESS),o.error&&(a.STATE=a.VOTE_STATUS.ERROR),401===o.code&&(a.message="Não autorizado."),a.messageCode=o.code,console.log("voto"),console.log(a.message)});var e=null;e=a.$interval(function(){var o=angular.element("#serpro_captcha");o&&o.length>0?(a.$window.initCaptcha(o[0]),a.$interval.cancel(e),e=void 0):a.$log.debug("captcha element not found.")},10)},a.prototype.canVote=function(){var a=this;return!!a.$rootScope.temporaryToken||a.$rootScope.currentUser&&!!a.$rootScope.currentUser.private_token},a.prototype.submitCaptcha=function(a,e){var o=this,s=a.target,r=angular.element(s),t=r.find('[name="txtToken_captcha_serpro_gov_br"]');o.sendingCaptcha=!0,o.AuthService.loginCaptcha({captcha_text:e.captcha_text.$modelValue,txtToken_captcha_serpro_gov_br:t.val()}).then(function(a){o.$log.debug("register success.data",a),o._oldVoteValue&&(o.vote(o._oldVoteValue),o._oldVoteValue=null),o.showCaptchaForm=!1},function(a){o.$log.debug("register error.data",a),o.sendingCaptchaError={code:a.status,message:a.message||"Erro ("+a.status+"). Já estamos trabalhando para resolver o problema.
Por favor, tente novamente mais tarde"},angular.equals(o.sendingCaptchaError.message,"Internal captcha validation error")&&(o.sendingCaptchaError.message="Erro interno ao tentar validar captcha.

Já estamos trabalhando para resolver o problema.
Por favor, tente novamente mais tarde.")},function(a){o.$log.debug("register update.data",a)})["finally"](function(){o.sendingCaptcha=!1})},a.prototype.captchaTryAgain=function(){var a=this;a.showCaptchaForm=!0,a.sendingCaptcha=!1,a.sendingCaptchaError=!1,a.message=null;var e=angular.element("#serpro_captcha");a.$window.reloadCaptcha(e[0]),angular.element("#captcha_text").val("").focus()},a.prototype.vote=function(a){var e=this;return e.archived===!0?void e.$log.info("Article archived. Abort."):(e._oldVoteValue=a,void(e.canVote()?e.doVote?e.doVote({proposal_id:e.proposal.id,value:a}):e.$log.error("No vote function to handler votes"):(e.$log.debug("You cannot vote."),e.showCaptchaForm=!0,angular.element("#captcha_text").focus())))},a.prototype.skip=function(){var a=this;return a.archived===!0?void a.$log.info("Article archived. Abort."):(a.errorOnSkip=!1,a.STATE=a.VOTE_STATUS.LOADING,a.doVote({proposal_id:a.proposal.id,value:a.VOTE_OPTIONS.SKIP}),void a.$log.debug("Sending vote"))},a.prototype.getSocialUrl=function(){var a=this;return a.$state.href("programa",{slug:a.topic.slug,proposal_id:a.proposal.id},{absolute:!0})},a.prototype.getSocialText=function(){var a=this;return a.proposal["abstract"]},a.prototype.getSocialImage=function(){var a=this;return a.$rootScope.basePath+a.topic.image.url};var e={restrict:"E",templateUrl:"app/components/proposal-box/proposal-box.html",scope:{archived:"=",category:"=",doVote:"&",focus:"@",proposal:"=",showVote:"=",topic:"="},controller:a,controllerAs:"vm",bindToController:!0};return e}angular.module("dialoga").directive("proposalBox",a)}(),function(){"use strict";function a(){var a={};return a.generate=function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},a}angular.module("dialoga").factory("GUID",a)}(),function(){"use strict";function a(){function a(a,e,o,s,r){r.debug("EventListController");var t=this;t.ArticleService=a,t.$scope=e,t.$rootScope=o,t.$state=s,t.$log=r,t.init()}a.$inject=["ArticleService","$scope","$rootScope","$state","$log"],a.prototype.init=function(){var a=this;if(!a.events)throw{name:"NotDefined",message:'The attribute "events" is undefined.'};a.isCollapsed||(a.isCollapsed=!0)},a.prototype.toggleView=function(){var a=this;a.isCollapsed=!a.isCollapsed},a.prototype.subscribe=function(a){var e=this,o=a.id;return e.$rootScope.currentUser?(a._loading=!0,void e.ArticleService.subscribeToEvent(o).then(function(o){e.$log.debug("success",o),o.success===!0&&(a.already_follow=!0),o.success===!1&&o.already_follow===!0&&(a.already_follow=!0)},function(a){e.$log.debug("error",a)},function(a){e.$log.debug("update",a)})["finally"](function(o){e.$log.debug("finally",o),a._loading=!1})):(e.$log.info("User is not logged in. Redirect to Auth page."),void e.$state.go("entrar",{redirect_uri:"state=inicio&task=subscribe&event_id="+o},{location:!0}))};var e={restrict:"E",templateUrl:"app/components/event-list/event-list.html",scope:{events:"=",isCollapsed:"="},controller:a,controllerAs:"vm",bindToController:!0};return e}angular.module("dialoga").directive("eventList",a)}(),function(){"use strict";function a(){function a(a){return"param required: "+a}var e={paramRequired:a};return e}angular.module("dialoga").service("ErrorService",a)}(),function(){"use strict";function a(a,e,o,s,r,t,i){function n(a,e){U.home?a(U.home):s.getArticleById(o.articleId.home,{"fields[]":["id","abstract","body","categories","children","children_count","title","slug","image","url","archived"],content_type:"ProposalsDiscussionPlugin::DiscussionTopic"},function(e){U.home=e,T(e),A(e),C(e),x(e),a(e)},e)}function l(a,e){U.about?a(U.about):s.getArticleById(o.articleId.about,{},function(e){U.about=e,a(U.about)},e)}function c(a,e){U.terms?a(U.terms):s.getArticleById(o.articleId.terms,{},function(e){U.terms=e,a(U.terms)},e)}function p(a,e){U.themes?a(U.themes):n(function(){if(!U.hasOwnProperty("themes"))throw{name:"NotFound",message:'"themes" is not defined. "article.categories" was loaded?'};a(U.themes)},e)}function d(a,e,o){function s(){for(var o=null,s=U.themes.length-1;s>=0;s--){var r=U.themes[s];if(r&&r.slug&&r.slug===a){o=r;break}}e(o)}U.themes?s(U.themes):p(s,o)}function g(a,e){U.programs?a(U.programs):n(function(){if(!U.hasOwnProperty("programs"))throw{name:"NotFound",message:'"programs" is not defined. "article.children" was handled?'};a(U.programs)},e)}function u(a,e,o){function s(){var o=U.programs.filter(function(e){return angular.equals(e.slug,a)?!0:!1});e(o[0])}U.programs?s():g(s,o)}function v(a,e,o){function s(){var o=U.programs.filter(function(e){var o=e.categories[0];return o&&angular.equals(o.id,a)?!0:!1});e(o)}U.programs?s():g(s,o)}function m(a,e,s){if(U.programsRandom)e(U.programsRandom);else{var t=!!U.programs,i=B.serviceDialoga+"random_topics/"+o.articleId.home,n=null;n=t?["id","title","slug"]:[];var l=angular.extend({"fields[]":n},a);r.get(i,{params:l}).then(function(a){R(t,a,e)})["catch"](function(a){s(a)})}}function h(a){var e=angular.extend({},a);return s.getEvents(o.communityId,e)}function f(a){return s.getResponseByProposalId(a)}function b(a){if(U.questions)a(U.questions);else{var e=[];U.questions=e,a(U.questions)}}function y(a,e,o){s.searchTopics({query:a},e,o)}function w(a,e,o){s.searchProposals(a,e,o)}function P(a){return s.sendContactForm(o.communityId,a)}function $(a,e){return angular.isArray(a)?a.filter(function(a){return a.parent?a.parent.categories&&0!==a.parent.categories.length?a.parent.categories[0].slug===e:(i.warn("Proposal parent has no categories."),!1):(i.warn("Proposal without a parent."),!1)}):(i.error("Input is not a Array."),[])}function S(a,e){return angular.isArray(a)?a.filter(function(a){return a.parent&&a.parent.id?a.parent.id===e:(i.warn("Proposal has no parent."),!1)}):(i.error("Input is not a Array."),[])}function T(a){var o=a.article["abstract"];o=F(o),o=I(o),a.article["abstract"]=o,a.article.abstractTrusted=e.trustAsHtml(o)}function A(a){a.article.slug||(a.article.slug=t.slugify(a.article.title));for(var e=a.article.children.length-1;e>=0;e--){var o=a.article.children[e];o.slug||(o.slug=t.slugify(o.title))}}function C(a){U.hasOwnProperty("themes")||(U.themes=a.article.categories),E(a),_(a)}function _(a){for(var e=a.article.children,o=a.article.categories,s=o.length-1;s>=0;s--){for(var r=o[s],t=e.length-1;t>=0;t--){var i=e[t];if(i.categories&&i.categories.length>0&&angular.equals(i.categories[0].slug,r.slug)&&i.archived){r.archived=!0;break}}r.archived||(r.archived=!1)}}function x(a){U.hasOwnProperty("programs")||(U.programs=a.article.children,U.programs_count=a.article.children_count),k(U.programs)}function k(e){if(angular.isArray(e))for(var o=null,s=null,r=e.length-1;r>=0;r--)o=e[r],o.summary||(s=o["abstract"].split("
"),o.summary=a.stripHtml(s[0]).trim(),s.length>1&&(o.summaryExtended=s[1].trim()))}function E(a){a.article.categories}function R(a,e,o){if(a){for(var s=[],r=e.articles,t=U.programs.length-1;t>=0;t--)for(var i=U.programs[t],n=r.length-1;n>=0;n--){var l=r[n];l.id===i.id&&s.push(i)}e.articles=s}o(e)}function F(a){var e='