var DeusEx;(function(){"use strict";function i(){return{restrict:"A",scope:{},link:function(n,t){t.attr("href",window.secureMessageServiceUrl)}}}function n(n){return{restrict:"EA",template:'<div class="login-button-component">\t\t\t<div class="login-button-body" ng-transclude><\/div><\/div>',transclude:!0,scope:{},link:function(t,i){var r=i.find(".login-button-component");i.find(".login-button-body a").click(function(){r.toggleClass("desktop-opened")});n.click(function(n){r.hasClass("desktop-opened")&&(r.has(n.target).length>0||r.removeClass("desktop-opened"))})},controller:r}}n.$inject=["$document"];var r=function(){function n(n,t,i,r,u){this.$scope=n;this.$modal=t;this.$templateCache=i;this.$sce=r;this.$element=u;this.isLoading=!0;n.controller=this;n.isMobile=window.mobileStyle;n.secureMessageServiceUrl=window.secureMessageServiceUrl}return n.prototype.openDialog=function(n){document.domain.indexOf("futurpension.se")!==-1&&(document.domain="futurpension.se");this.isLoading=!0;this.src=this.$sce.trustAsResourceUrl("https://mit.futurpension.se/pub/logon/logon.aspx?ss=SV&channel="+n);this.loginDialog=this.$modal.open({template:this.$templateCache.get("login-dialog.html"),scope:this.$scope,windowClass:"login-modal"})},n.prototype.onOpen=function(){var n=this,t=$(".modal iframe");t.on("load",function(){n.safeOnLoadFrame()})},n.prototype.closeDialog=function(){this.loginDialog!=null&&this.loginDialog.close();this.src=null},n.prototype.safeOnLoadFrame=function(){var n=this;this.$scope.$$phase?this.onLoadFrame():this.$scope.$apply(function(){n.onLoadFrame()})},n.prototype.onLoadFrame=function(){this.isLoading=!1},n.$inject=["$scope","$modal","$templateCache","$sce","$element"],n}(),t=window.mobileStyle?getOrCreateAngularModule("theApp",["ui.bootstrap","ngSanitize"]):getOrCreateAngularModule("theApp",["sticky","ui.bootstrap","ngSanitize"]);t.directive("loginButton",n);t.directive("secureMessageHref",i)})(DeusEx||(DeusEx={}))