1"use strict";var __spreadArray=function(e,t,i){if(i||2===arguments.length)for(var n,o=0,r=t.length;o<r;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},app=angular.module("incom.boligextra",["ui.bootstrap","ui.router","ngStorage","ngAnimate","ngMessages","ngTouch","ngAria","ngSlider","textAngular","angular-growl","angular.filter","ui.sortable","wu.masonry","rzModule","nvd3","smoothScroll","templates"]),BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,Application,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra,BoligExtra;app.config(["growlProvider",function(e){e.globalTimeToLive(5e3),e.globalDisableCountDown(!0)}]),app.config(["$httpProvider","$compileProvider",function(e,t){t.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|javascript|tel):/),e.defaults.headers.get||(e.defaults.headers.get={}),e.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",e.defaults.headers.get["Cache-Control"]="no-cache",e.defaults.headers.get.Pragma="no-cache"}]),app.run(["uibDatepickerConfig","uibDatepickerPopupConfig",function(e,t){e.showWeeks=!1,e.startingDay=1,t.showButtonBar=!1,t.datepickerPopup="dd-MM-yyyy",window.googleTranslateElementInit=function(){new google.translate.TranslateElement({pageLanguage:"da",autoDisplay:!1},"google_translate_element")};e=window.navigator.userAgent,0<(t=e.indexOf("MSIE "))&&parseInt(e.substring(t+5,e.indexOf(".",t)),10)<10&&(document.getElementById("old-ie-result").style.display="block")}]),window.moment&&window.moment.locale("da",{months:"Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"),monthsShort:"Jan._Feb._Mar._Apr._Maj._Jun._Jul._Aug._Sep._Okt._Nov._Dec.".split("_"),weekdays:"Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"),weekdaysShort:"Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"),weekdaysMin:"Sø_Ma_Ti_On_To_Fr_Lø".split("_"),week:{dow:1}}),app.run(["$locale",function(e){e.NUMBER_FORMATS.GROUP_SEP=".",e.NUMBER_FORMATS.DECIMAL_SEP=","}]),app.run(["PageContentService",function(e){e.currentPage$.subscribe(function(e){var t;e&&(document.title=e.TitleName,(t=document.querySelector("head > meta[name=description]"))||((t=document.createElement("meta")).setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.MetaDescription))})}]),app.constant("moment",window.moment),app.constant("dawaAutocomplete",window.dawaAutocomplete),app.constant("d3",window.d3),app.c
1onstant("nv",window.nv),!function(e){var t;function i(e,t,i,n,o){this.dashboardService=e,this.pageContentService=t,this.$compile=i,this.$element=n,this.$scope=o,this.disposables=new Rx.CompositeDisposable}(e=e.BoardPortal||(e.BoardPortal={})).BoardMemberDashboard||(e.BoardMemberDashboard={}),i.prototype.$onInit=function(){var i=this;this.disposables.add(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){i.currentPage=e,i.disposables.add(i.dashboardService.getDashboardContent(e.Id).subscribe(function(e){var t;e&&(i.dashboardContent=e,t=i.$element.find(".page-grid-container"),e.GridHtml)&&t&&(t.empty(),t.append(i.$compile(e.GridHtml)(i.$scope.$new(!0))))})),i.disposables.add(i.dashboardService.getCurrentUsersDashboardAreas(e.Id).subscribe(function(e){e&&(i.currentUserAreas=e)}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["DashboardService","PageContentService","$compile","$element","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/BoardPortal/BoardMemberDashboard/BoardMemberDashboard.component.html",this.bindings={}},app.component("boardMemberDashboard",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.dashboardService=e,this.pageContentService=t,this.$compile=i,this.$element=n,this.$scope=o,this.disposables=new Rx.CompositeDisposable}(e=e.BoardPortal||(e.BoardPortal={})).MainBoardMemberDashboard||(e.MainBoardMemberDashboard={}),i.prototype.$onInit=function(){var i=this;this.disposables.add(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){i.currentPage=e,i.disposables.add(i.dashboardService.getDashboardContent(e.Id).subscribe(function(e){var t;e&&(i.dashboardContent=e,t=i.$element.find(".page-grid-container"),e.GridHtml)&&t&&(t.empty(),t.append(i.$compile(e.GridHtml)(i.$scope.$new(!0))))})),i.disposables.add(i.dashboardService.getCurrentUsersDashboardAreas(e.Id).subscribe(function(e){e&&(i.currentUserAreas=e)}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["DashboardService","PageContentService","$compile","$element","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/BoardPortal/MainBoardMemberDashboard/MainBoardMemberDashboard.component.html",this.bindings={}},app.component("mainBoardMemberDashboard",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.pageProviderService=e,this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Dashboard||(e.Dashboard={})).MyPageBanner||(e.MyPageBanner={}),i.prototype.$onInit=function(){var t=this;this.pageProviderService.getPageByDocumentType("benefitClub").then(function(e){t.benefitClubPage=e})},i.$inject=["PageProviderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Dashboard/MyPageBanner/MyPageBanner.component.html",this.bindings={headline:"@",showBackgroundImage:"<",showClubButton:"<",bannerBackgroundColor:"@"}},app.component("myPageBanner",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable,this.displayLimit=5}(e=(e=e.CrossPortal||(e.CrossPortal={})).Dashboard||(e.Dashboard={})).MyPageLinkBox||(e.MyPageLinkBox={}),i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Dashboard/MyPageLinkBox/MyPageLinkBox.component.html",this.bindings={links:"<",buttonIconClass:"@",headline:"<",backgroundColor:"@",textColor:"@",differingHeadlineAndBodyColor:"<"}},app.component("myPageLinkBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.pageContentService=e,this.pageProviderService=t,this.userService=i,this.$scope=n,this.utilityService=o,this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Dashboard||(e.Dashboard={})).MyPageNavigation||(e.MyPageNavigation={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){t.currentPage=e})),this.pageProviderService.getPageByDocumentType("personnelFrontPage").then(function(e){t.personnelFrontPage=e}),this.pageProviderService.getPageByDocumentType("boardMemberFrontPage").then(function(e){t.boardMemberFrontPage=e}),this.pageProviderService.getPageByDocumentType("mainBoardMemberFrontPage").then(function(e){t.mainBoardMemberFrontPage=e}),this.pageProviderService.getPageByDocumentType("memberFrontPage").then(function(e){t.memberFrontPage=e}),this.pageProviderService.getPageByDocumentType("tenantFrontPage").then(function(e){t.tenantFrontPage=e}),this.pageProviderService.getPageByDocumentType("editProfile").then(function(e){t.editProfilePage=e}),this.disposables.add(this.userService.currentUser$.subscribe(function(e){e&&(t.currentUser=e)})),this.disposables.add(this.userService.getCurrentUserDashboardsAccess().subscribe(function(e){e&&(t.currentUserHasAccessToPersonnelFrontpage=e.HasAccessToPersonnelFrontpage,t.currentUserHasAccessToMainBoardMemberFrontpage=e.HasAccessToMainBoardMemberFrontpage,t.currentUserHasAccessToBoardMemberFrontpage=e.HasAccessToBoardMemberFrontpage,t.currentUserHasAccessToMemberFrontpage=e.HasAccessToMemberFrontpage,t.currentUserHasAccessToTenantFrontpage=e.HasAccessToTenantFrontpage,t.numberOfRoles=0,t.currentUserHasAccessToPersonnelFrontpage&&t.numberOfRoles++,t.currentUserHasAccessToMainBoardMemberFrontpage&&t.numberOfRoles++,t.currentUserHasAccessToBoardMemberFrontpage&&t.numberOfRoles++,t.currentUserHasAccessToMemberFrontpage&&t.numberOfRoles++,t.currentUserHasAccessToTenantFrontpage)&&t.numberOfRoles++}
1))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageContentService","PageProviderService","UserService","$scope","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Dashboard/MyPageNavigation/MyPageNavigation.component.html",this.bindings={}},app.component("myPageNavigation",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=e.CrossPortal||(e.CrossPortal={})).EgUserProvider||(e.EgUserProvider={})).Modals||(e.Modals={}),t.prototype.submit=function(){this.$modalInstance.close(!0)},t.$inject=["$uibModalInstance","modalData"],e.EgUserProviderMemberTenantSelectionController=t}(BoligExtra=BoligExtra||{}),!function(n){var e,t;function i(e,t,i,n,o,r){this.$scope=e,this.forumService=t,this.fileService=i,this.forumCommentService=n,this.userService=o,this.utilityService=r,this.currentSize=0,this.maxTotalSize=10240,this.images=[],this.files=[],this.uploadedImages=[],this.uploadedFiles=[],this.disposables=new Rx.CompositeDisposable}(e=(e=n.CrossPortal||(n.CrossPortal={})).Forum||(e.Forum={})).ForumCreateComment||(e.ForumCreateComment={}),i.prototype.$onInit=function(){var i=this;this.followPost=this.post.Following,this.disposables.add(this.userService.currentUser$.subscribe(function(e){e&&(i.currentUser=e)})),null!=this.forumComment&&(this.comment=this.setupComment(this.post,this.forumComment)),this.$scope.$watchCollection(function(){return i.images},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedImages,e,n.Utility.File.UploadedFileType.Image),i.images=[])}),this.$scope.$watchCollection(function(){return i.files},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedFiles,e,n.Utility.File.UploadedFileType.File),i.currentSize+=e.reduce(function(e,t){return e+t.size},0)/1024/1024,i.files=[])}),this.guidForComment=this.utilityService.newGuid()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},i.prototype.setupComment=function(e,t){e={Id:t.Id,PostId:e.Id,BodyText:t.BodyText,Files:t.Files,Images:t.Images,AvatarUrl:this.currentUser.AvatarUrl};return e.isEditing=t.isEditing,e},i.prototype.deleteFile=function(e){confirm("Er du sikker på du vil slette denne fil?")&&(e.ShouldDelete=!0)},i.prototype.deleteUploadedImage=function(e){this.uploadedImages.remove(e)},i.prototype.deleteUploadedFile=function(e){this.uploadedFiles.remove(e),this.currentSize-=e.file.size/1024/1024},i.prototype.submit=function(){var i=this;1024*this.currentSize>this.maxTotalSize||(this.followPost!==this.post.Following&&this.forumService.toggleFollowPost(this.post),this.comment.PostId||(this.parentComment?this.comment.PostId=this.parentComment.Id:this.comment.PostId=this.post.Id),this.comment.AvatarUrl||(this.comment.AvatarUrl=this.currentUser.AvatarUrl),this.forumCommentService.postSaveComment(this.comment,this.uploadedImages,this.uploadedFiles).first().subscribe(function(t){t&&i.forumCommentService.getMediaForComment(t.Id).subscribe(function(e){e={Id:t.Id,BodyText:i.comment.BodyText,Files:e.Files.filter(function(e){return!!e}),Images:e.Images.filter(function(e){return!!e}),Seen:!0,EditAndDelete:!0,AvatarUrl:i.currentUser.AvatarUrl,ChildComments:[],CreatedBy:t.CreatorName,CreatedDate:t.CreatedDate};i.parentComment?i.createdComment({parentComment:i.parentComment,comment:e}):i.createdComment({comment:e}),i.resetComment()})}))},i.prototype.resetComment=function(){this.images=[],this.files=[],this.uploadedImages=[],this.uploadedFiles=[],this.comment={},angular.element("#fileUpload").val(null),angular.element("#imageUpload").val(null)},i.prototype.close=function(){this.resetComment(),this.parentComment&&this.cancelled({parentComment:this.parentComment}),this.forumComment&&this.forumComment.isEditing&&(this.forumComment.isEditing=!1)},i.$inject=["$scope","ForumService","FileService","ForumCommentService","UserService","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Forum/CreateComment/ForumCreateComment.component.html",this.bindings={forumComment:"<",post:"<",parentComment:"<",createdComment:"&",cancelled:"&"}},app.component("forumCreateComment",new e)}(BoligExtra=BoligExtra||{}),!function(n){var e,t;function i(e,t,i,n,o,r,s,a,l){this.$scope=e,this.forumService=t,this.fileService=i,this.userAssociationService=n,this.pageContentService=o,this.forumCategoryService=r,this.UserService=s,this.utilityService=a,this.taOptions=l,this.images=[],this.files=[],this.uploadedImages=[],this.uploadedFiles=[],this.disposables=new Rx.CompositeDisposable,this.currentSize=0,this.maxTotalSize=10240}(e=(e=n.CrossPortal||(n.CrossPortal={})).Forum||(e.Forum={})).ForumCreatePost||(e.ForumCreatePost={}),i.prototype.$onInit=function(){var i=this;this.taOptions.defaultTagAttributes.a.target="_blank",this.disposables.add(this.UserService.currentUser$.subscribe(function(e){e&&(i.currentUser=e)})),this.forumPost&&(this.post={Id:this.forumPost.Id,CategoryId:this.forumPost.CategoryId,Title:this.forumPost.Title,BodyText:this.forumPost.BodyText,CompanyId:this.forumPost.CompanyId,DepartmentId:this.forumPost.DepartmentId,Files:this.forumPost.Files,Images:this.forumPost.Images,AvatarUrl:this.currentUser.AvatarUrl}),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(i.userAssociationService.getUserAssociationsForForum(e.Id),i.forumCategoryService.getForumCategories(e.Id))}),this.disposables.add(this.forumCategoryService.forumCategories$.subscribe(function(e){if(e)if(i.categories=e,i.post.CategoryId){for(var t=0;t<i.categories.length;t++)if(i.categories[t].Id===i.post.CategoryId){i.selectedCategory=i.categories[t];break}}else 1===i.categories.length&&(i.selectedCategory=i.categories[0])})),this.$scope.$watchCollection(function(){return i.images},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedImages,e,n.Utility.File.UploadedFileType.Image),i.images=[])}),this.$scope.$watchCollection(function(){return i.files},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedFiles,e,n.Utility.File.UploadedFileType.File),i.currentSize+=e.reduce(function(e,t){return e+t.size},0)/1024/1024,i.files=[])}),this.guidForPost=this.utilityService.newGuid()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},i.prototype.deleteFile=function(e){confirm("Er du sikker på du vil slette denne fil?")&&(e.ShouldDelete=!0)},i.prototype.deleteUploadedImage=function(e){this.uploadedImages.remove(e)},i.prototype.deleteUploadedFile=function(e){this.uploadedFiles.remove(e),this.currentSize-=e.file.size/1024/1024},i.prototype.submit=function(){var e=this;1024*this.currentSize>this.maxTotalSize||(null!=this.selectedCategory.Id&&null!=this.post&&null!=this.post.Id||(this.PostFromMyPage||(this.post.CategoryId=this.selectedCategory.Id),!1===this.ignoreUserAssociation&&(this.post.CompanyId=this.selectedAccess.CompanyId,this.post.DepartmentId=this.selectedAccess.DepartmentId)),this.post.CategoryId=this.selectedCategory.Id,this.forumService.postSavePost(this.post,this.uploadedImages,this.uploadedFiles).then(function(){e.forumService.getPostByNodeId(e.post.Id),e.createdCallback()}))},i.prototype.close=function(){this.createdCallback()},i.$inject=["$scope","ForumService","FileService","UserAssociationService","PageContentService","ForumCategoryService","UserService","UtilityService","taOptions"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Forum/CreatePost/ForumCreatePost.component.html",this.bindings={forumPost:"<",categoryId:"<",createdCallback:"&"}},app.component("forumCreatePost",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/Forum/",this.forumCategories$=new Rx.BehaviorSubject(null),this.lastSavedCategory$=new Rx.BehaviorSubject(null),this.categoryPermissions$=new Rx.BehaviorSubject(null)}(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={}),t.prototype.getForumCategories=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getCategories");this.incomHttp.get(this.baseurl+"/GetForumCategories/"+e).then(function(e){e&&(t.forumCategories$.onNext(e.ForumCategoryViewModels),t.loaderService.removeLoader(i))})},t.prototype.canCreateCategories=function(e){var t=this;this.incomHttp.get(this.baseurl+"/GetCategoryPermissions/"+e).then(function(e){t.categoryPermissions$.onNext(e)})},t.prototype.postSaveCategory=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","saveCategory");return this.incomHttp.post(this.baseurl+"/SaveCategory",e).then(function(e){i.lastSavedCategory$.onNext(e),i.getForumCategories(t),i.loaderService.removeLoader(n)})},t.prototype.deleteCategory=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","deleteCategory");return this.incomHttp.delete(this.baseurl+"/DeleteForumCategory/"+e).then(function(){i.getForumCategories(t),i.loaderService.removeLoader(n)})},t.prototype.updateCategory=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","updateCategory");return this.incomHttp.post(this.baseurl+"/UpdateCategory/"+t,e).then(function(){i.getForumCategories(t),i.loaderService.removeLoader(n)})},t.$inject=["incomHttpService","LoaderService"],app.service("ForumCategoryService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.incomHttp=e,this.loaderService=t,this.$q=i,this.utilityService=n,this.baseurl="/umbraco/api/Forum/",this.postComments$=new Rx.ReplaySubject}(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={}),t.prototype.markCommentRead=function(e){return this.incomHttp.post("".concat(this.baseurl,"/MarkCommentRead?commentId=")+e.Id,null)},t.prototype.deleteComment=function(e){return this.loaderService.setLoader("forum","category"),this.incomHttp.delete(this.baseurl+"/DeleteComment/"+e.Id)},t.prototype.updateCommentsByPost=function(e){var i=this,n=this.loaderService.setLoader("contentSection","getComments");return this.incomHttp.get(this.baseurl+"/GetCommentsByPost/"+e).then(function(e){for(var t=0;t<e.ForumPostComments.length;t++)e.ForumPostComments[t].DisplayCreatedDate=i.utilityService.formatDate(e.ForumPostComments[t].CreatedDate,"long")+" Kl."+i.utilityService.formatDate(e.ForumPostComments[t].CreatedDate,"short time");i.postComments$.onNext(e),i.loaderService.removeLoader(n)})}
1,t.prototype.getCommentsByPost=function(t,e,i){var n=this,o=(void 0===e&&(e=0),void 0===i&&(i=3),this.loaderService.setLoader("contentSection","getComments"));return this.incomHttp.post(this.baseurl+"/GetCommentsByPost/",{Id:t,AmountToSkip:e,AmountToTake:i}).then(function(e){for(var t=0;t<e.ForumPostComments.length;t++)e.ForumPostComments[t].DisplayCreatedDate=n.utilityService.formatDate(e.ForumPostComments[t].CreatedDate,"long")+" Kl."+n.utilityService.formatDate(e.ForumPostComments[t].CreatedDate,"short time");n.postComments$.onNext(e),n.loaderService.removeLoader(o)}),this.postComments$.filter(function(e){return e.PostId==t})},t.prototype.postSaveComment=function(e,i,n){var o=this,t=this.loaderService.setLoader("contentSection","saveComment"),r=new Rx.Subject,s=this.$q.defer();return this.incomHttp.post("".concat(this.baseurl,"/SaveComment"),e).then(function(t){var e=[];angular.isArray(i)&&0<i.length&&e.addRange(i),angular.isArray(n)&&0<n.length&&e.addRange(n),0<e.length?o.incomHttp.postFiles("".concat(o.baseurl,"/UploadFiles?nodeId=").concat(t.Id),e).then(function(){s.resolve()},function(){s.reject()}):s.resolve(),s.promise.then(function(e){r.onNext(t)})}),this.$q.all([s.promise]).then(function(){o.loaderService.removeLoader(t)}),r},t.prototype.getMediaForComment=function(e){var t=new Rx.Subject;return this.incomHttp.get(this.baseurl+"/GetMediaForComment/"+e).then(function(e){t.onNext(e),t.onCompleted()}),t},t.$inject=["incomHttpService","LoaderService","$q","UtilityService"],app.service("ForumCommentService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.utilityService=e,this.DAY=864e5,this.HOUR=36e5,this.MINUTE=6e4}(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={}),t.prototype.getDisplayDateString=function(e){var t,i=Date.now()-e.getTime();return isNaN(i)?"":i<this.MINUTE?(t=Math.floor(i/1e3),"".concat(t," ").concat(1==t?"sekund":"sekunder"," siden")):i<this.HOUR?(t=Math.floor(i/1e3/60),"".concat(t," ").concat(1<t?"minutter":"minut"," siden")):i<this.DAY?(t=Math.floor(i/1e3/60/60),"".concat(t," ").concat(1<t?"timer":"time"," siden")):i<2*this.DAY?"I går":this.utilityService.formatDate(e,"dd.MM.yyyy")},t.$inject=["UtilityService"],app.service("ForumUtilityService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.forumService=e,this.forumCommentService=t,this.disposables=new Rx.CompositeDisposable,this.totalComments=0}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).ForumPostView||(e.ForumPostView={}),i.prototype.$onInit=function(){var n=this;this.disposables.add(this.forumService.getPostByNodeId(this.nodeId).subscribe(function(e){e&&(n.post=e,n.disposables.add(n.forumCommentService.getCommentsByPost(n.post.Id).subscribe(function(e){var i;n.comments?(i=[],e.ForumPostComments.forEach(function(t){var e=n.comments.firstOrDefault(function(e){return t.Id===e.Id}),e=n.comments.indexOf(e);-1<e?n.comments[e]=t:i.push(t)}),n.comments.addRange(i)):n.comments=e.ForumPostComments,n.totalComments=e.TotalComments})))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["ForumService","ForumCommentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Forum/PostView/ForumPostView.component.html",this.bindings={nodeId:"<"}},app.component("forumPostView",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.fileService=e,this.forumActivityService=t,this.forumUtility=i,this.forumService=n,this.windowService=o,this.disposables=new Rx.CompositeDisposable,this.postPresentation=!1,this.editView=!1,this.totalComments=0}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).ForumPost||(e.ForumPost={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.toggleOpenContent=function(){this.postPresentation||(this.showPostContent=!this.showPostContent)},i.prototype.getDisplayDateString=function(e){return e?this.forumUtility.getDisplayDateString(new Date(e)):""},i.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},i.prototype.toggleIsFollowing=function(t){this.disposables.add(this.forumActivityService.toggleFollowPost(t.Id,t.Following).subscribe(function(e){t.Following=e}))},i.prototype.deletePost=function(e){var t=this;confirm("Er du sikker på du vil slette dette indlæg?")&&this.forumService.deletePost(e).then(function(){t.windowService.history.pushState({},"",e.ForumUrl+"#"+e.CategoryId)})},i.prototype.toggleEditView=function(){this.editView=!1},i.$inject=["FileService","ForumActivityService","ForumUtilityService","ForumService","$window"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Forum/Post/ForumPost.component.html",this.bindings={post:"<",postPresentation:"<",comments:"<",totalComments:"<",showPostContent:"<"}},app.component("forumPost",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.shortcutsService=e,this.disposables=new Rx.CompositeDisposable}(e=e.CrossPortal||(e.CrossPortal={})).GlobalShortcuts||(e.GlobalShortcuts={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.shortcutsService.getGlobalShortcuts().subscribe(function(e){t.globalShortcuts=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["GlobalShortcutsService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/GlobalShortcuts/GlobalShortcuts.component.html",this.bindings={}},app.component("globalShotcuts",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/GlobalShortcuts/"}(e=e.CrossPortal||(e.CrossPortal={})).GlobalShortcuts||(e.GlobalShortcuts={}),t.prototype.getGlobalShortcuts=function(){var t=new Rx.Subject;return this.incomHttp.get("".concat(this.baseurl,"getGlobalShortcuts")).then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("GlobalShortcutsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.globalSearchService=e,this.pageContentService=t,this.windowService=i,this.disposables=new Rx.CompositeDisposable,this.searchQuery=""}(e=(e=e.Crossportal||(e.Crossportal={})).GlobalSearch||(e.GlobalSearch={})).GlobalSearchSiteMenu||(e.GlobalSearchSiteMenu={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&t.globalSearchService.getSearchPageUrl(e).subscribe(function(e){e&&(t.searchPageUrl=e)})}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.doSearch=function(){var e=this.searchPageUrl+"#query="+encodeURIComponent(this.searchQuery);this.windowService.location.href=e},i.$inject=["GlobalSearchService","PageContentService","$window"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Crossportal/GlobalSearch/GlobalSearchSiteMenu/GlobalSearchSiteMenu.component.html",this.bindings={}},app.component("globalSearchSiteMenu",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.mitIdService=e,this.pageContentService=t,this.featureFlagService=i,this.isEnabled=!1,this.showNemId=!1}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).ExternalId||(e.ExternalId={}),i.prototype.$onInit=function(){var t=this;this.isEnabled=this.featureFlagService.externalIdFeatureFlags.enableLoginSwitcher,this.mitIdSource=this.mitIdService.getMitIdIconSource(!0),this.nemIdSource="/images/NemID.svg",this.pageContentService.currentPage$.first().subscribe(function(e){e&&(t.currentPage=e)})},i.prototype.goToMitId=function(){this.mitIdService.goToMitId(this.currentPage.Id)},i.prototype.userCancelledNemId=function(){this.showNemId=!this.showNemId},i.$inject=["MitIdService","PageContentService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/ExternalIdSwitcher/ExternalIdSwitcher.component.html",this.bindings={bodyText:"<"}},app.component("externalIdSwitcher",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){var n=this;this.mitIdService=e,this.pageContentService=t,this.featureFlagService=i,this.getMitIdIconSource=function(){return n.mitIdService.getMitIdIconSource()},this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).MitId||(e.MitId={}),i.prototype.$onInit=function(){var t=this;this.isEnabled=this.featureFlagService.mitIdFeatureFlags.enableMitIdLogin,this.isEnabled&&(this.useMitIdButtonColor=this.featureFlagService.mitIdFeatureFlags.useMitIdButtonColor,this.useMitIdIconColor=this.featureFlagService.mitIdFeatureFlags.useMitIdIconColor,this.iconInButton=this.featureFlagService.mitIdFeatureFlags.useMitIdIconInButton,this.pageContentService.currentPage$.filter(function(e){return!!e}).take(1).subscribe(function(e){t.currentPage=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.goToMitId=function(){this.mitIdService.goToMitId(this.currentPage.Id)},i.$inject=["MitIdService","PageContentService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/MitId/MitId.component.html",this.bindings={}},app.component("mitId",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.incomHttp=e,this.loaderService=t,this.utilityService=i,this.featureFlagService=n,this.baseUrl="/umbraco/Api/MitId/"}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).MitId||(e.MitId={}),t.prototype.getCurrentMitIdKey=function(){var e;return!!this.featureFlagService.mitIdFeatureFlags.enableMitIdLogin&&!(!(e=this.utilityService.getParameters("querystring"))||!e.k)&&e.k},t.prototype.goToMitId=function(e){var t=this,i=this.loaderService.setLoader("global","MitIdRedirect"),e={NodeId:e};this.incomHttp.post("".concat(this.baseUrl,"RedirectToMitIdLogin"),e).finally(function(){return t.loaderService.removeLoader(i)})},t.prototype.getMitIdIconSource=function(e){return void 0===e&&(e=!1),this.featureFlagService.mitIdFeatureFlags.useMitIdIconColor||e?"/images/MitID identity blue.svg":"/images/MitID identity white.svg"},t.$inject=["incomHttpService","LoaderService","UtilityService","FeatureFlagService"],app.service("MitIdService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){var n=this;this.mitIdService=e,this.pageContentService=t,this.featureFlagService=i,this.getMitIdIconSource=function(){return n.mitIdService.getMitIdIconSource(!0)},this.useMitIdButtonColor=!1,this.useMitIdIconColor=!1,this.isEnabled=!1}e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).MitId||(e.MitId={}),i.prototype.$onInit=function(){var t=this;this.isEnabled=this.featureFlagService.mitIdFeatureFlags.enableMitIdLogin,this.isEnabled&&(this.pageContentService.currentPage$.filter(function(e){return!!e}).take(1).subscribe(function(e){t.currentPage=e}),this.useMitIdButtonColor=this.featureFlagService.mitIdFeatureFlags.useMitIdButtonColor,this.useMitIdIconColor=this.featureFlagService.mitIdFeatureFlags.useMitIdIconColor)},i.prototype.goToMitId=function(){this.mitIdService.goToMitId(this.currentPage.Id)},i.$inject=["MitIdService","PageContentService","FeatureFlagService"],t=i,e.MitIdBoxController=t,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/MitId/MitIdBox/MitIdBox.component.html",this.bindings={}},app.component("mitIdBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var o,t,i;function n(e,t,i,n,o){this.ribbonService=e,this.modalService=t,this.newsletterService=i,this.$sce=n,this.featureFlagService=o,this.selectedContentNodes=[],this.canPickContentFeatureFlag=!1}e=e.CrossPortal||(e.CrossPortal={}),o=e.Newsletter||(e.Newsletter={}),t=o.Components||(o.Components={}),n.prototype.$onInit=function(){this.canPickContentFeatureFlag=this.featureFlagService.newsletter.canPickContentFeatureFlag},n.prototype.pickNewImages=function(i){var n=this;this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterAddImage.modal.html",t.Modals.NewsletterAddImagesController,null,"md").result.then(function(t){t&&("UploadedFile"==t.type?n.newsletterService.uploadFiles(t.uploadedFile).then(function(e){e&&(n.ribbon.EditorFields[i].Value=e.firstOrDefault().url,n.ribbon.EditorFields[i].Link=t.imageLink,n.updateContent())}
1):"SelectedImage"==t.type&&(n.ribbon.EditorFields[i].Value=t.selectedImage.url,n.ribbon.EditorFields[i].Link=t.imageLink,n.updateContent()))})},n.prototype.setEditingRibbon=function(){this.ribbonService.setEditingRibbon(this.ribbon)},n.prototype.showAsTrustedHtml=function(e){return this.$sce.trustAsHtml(e)},n.prototype.getColClassForRibbon=function(e){switch(e.Alias){case o.Ribbon.ribbon1:return e.EditorFields.any(function(e){return!!e.ContentType})?"content-grid-double-col":"content-grid-single-col";case o.Ribbon.ribbon2:return e.EditorFields.any(function(e){return!!e.ContentType})?"content-grid-double-col":"content-grid-single-col";case o.Ribbon.ribbon3:case o.Ribbon.ribbon4:return"content-grid-single-col";case o.Ribbon.ribbon5:case o.Ribbon.ribbon6:case o.Ribbon.ribbon7:return"content-grid-double-col";case o.Ribbon.ribbon8:return e.EditorFields.any(function(e){return!!e.ContentType})?"content-grid-two-third-to-one-third-col":"content-grid-single-col";case o.Ribbon.ribbon9:return e.EditorFields.any(function(e){return!!e.ContentType})?"content-grid-one-third-to-two-third-col":"content-grid-single-col";case o.Ribbon.ribbon10:return"content-grid-single-col";case o.Ribbon.footerRibbon1:break;case o.Ribbon.footerRibbon2:case o.Ribbon.headerRibbon1:case o.Ribbon.headerRibbon2:return"content-grid-single-col"}},n.prototype.setEditorFieldColumnContentType=function(e,t,i){for(var n=0;n<t.EditorFields.length;n++)switch(t.Alias){case o.Ribbon.ribbon1:case o.Ribbon.ribbon2:case o.Ribbon.ribbon3:case o.Ribbon.ribbon4:case o.Ribbon.ribbon8:case o.Ribbon.ribbon9:case o.Ribbon.ribbon10:case o.Ribbon.headerRibbon1:case o.Ribbon.footerRibbon2:case o.Ribbon.headerRibbon2:this.ribbon.EditorFields[n].ContentType=i;break;case o.Ribbon.ribbon5:case o.Ribbon.ribbon6:case o.Ribbon.ribbon7:n%2==e&&(this.ribbon.EditorFields[n].ContentType=i)}},n.prototype.shouldShowContentSelection=function(e,t){switch(t){case o.Ribbon.ribbon1:case o.Ribbon.ribbon2:return 0==e;case o.Ribbon.ribbon3:case o.Ribbon.ribbon4:return!0;case o.Ribbon.ribbon5:case o.Ribbon.ribbon6:case o.Ribbon.ribbon7:return 0==e||1==e;case o.Ribbon.ribbon8:case o.Ribbon.ribbon9:case o.Ribbon.ribbon10:return 0==e;case o.Ribbon.footerRibbon1:break;case o.Ribbon.footerRibbon2:case o.Ribbon.headerRibbon1:case o.Ribbon.headerRibbon2:return!0}},n.prototype.selectContentNode=function(t,i){var n=this;this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterSelectNodeContent.modal.html",o.Components.Modals.NewsletterSelectNodeContentController,"lg").result.then(function(e){n.selectedContentNodes.push(i),n.ribbonService.hydrateRibbon(n.ribbon,t,e),n.updateContent()})},n.prototype.updateContent=function(){this.ribbonService.updateContent(this.ribbon)},n.prototype.delete=function(){this.ribbonService.delete(this.ribbon)},n.$inject=["RibbonService","ModalService","NewsletterService","$sce","FeatureFlagService"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Components/EditRibbon.component.html",this.bindings={ribbon:"<"}},app.component("editRibbon",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.campaign=t.campaign}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.cancel=function(){this.$modalInstance.dismiss()},t.prototype.submit=function(){this.$modalInstance.close("Success")},t.$inject=["$uibModalInstance","modalData"],e.CampaignConfirmDeleteController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){var r=this;this.$modalInstance=e,this.newsletterService=t,this.modalService=i,this.owlCarouselOptionsService=n,this.$sce=o,this.dataLoaded=!1,this.templatesubscription=this.newsletterService.getAllTemplates().subscribe(function(e){r.templates=[],r.templates.add({Name:"Opret uden skabelon",Id:-1}
1),r.templates.addRange(e),r.templates.forEach(function(e){e.HtmlContent&&(e.sanitizedNewsletterHtml=r.$sce.trustAsHtml(angular.copy(e.HtmlContent).replace(/<a/gi,"<a target='_blank'")))}),r.dataLoaded=!0,setTimeout(function(){var e=$(".owl-carousel.owl-banner");0<e.length&&(r.options||(r.options=r.owlCarouselOptionsService.getDefaultOptions(),r.templates.length<=3?(r.options.loop=!1,r.options.mouseDrag=!1,r.options.freeDrag=!1):r.options.navContainer=".owl-nav",r.options.items=3,r.options.navElement="button",r.options.loop=3<r.templates.length)),e.owlCarousel(r.options)},150)})}e=e.CrossPortal||(e.CrossPortal={}),e=(e=(t=e.Newsletter||(e.Newsletter={})).Components||(t.Components={})).Modals||(e.Modals={}),i.prototype.cancel=function(){this.templatesubscription.dispose(),this.$modalInstance.dismiss()},i.prototype.showPreview=function(e){e={title:e.Name,html:e.HtmlContent};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterPreview.modal.html",t.Components.Modals.NewsletterPreviewController,e,"lg")},i.prototype.renderThumbPreview=function(e){return this.$sce.trustAsHtml(angular.copy(e.HtmlContent).replace(/<a/gi,"<a target='_blank'"))},i.prototype.submit=function(t){var e;this.newsletterService.setCreationType("Newsletter"),0<t&&((e=this.templates.firstOrDefault(function(e){return e.Id==t})).Type="Template",this.newsletterService.chosenNewsletter$.onNext(e)),this.newsletterService.setView("editContent"),this.templatesubscription.dispose(),this.$modalInstance.close(t)},i.$inject=["$uibModalInstance","NewsletterService","ModalService","OwlCarouselOptionsService","$sce"],e.CreateNewsletterController=i}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){var n=this;this.$modalInstance=e,this.modalData=t,i.getMediaFile(t.startNodeId).then(function(e){n.modalData.allowFiles&&(e=e.filter(function(e){return"File"!=e.type})),n.modalData.allowImages&&(e=e.filter(function(e){return"Image"!=e.type})),n.node={children:e,id:t.startNodeId}}),this.subscription=i.selectedNode$.take(1).subscribe(function(e){n.$modalInstance.close(e)})}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Modals||(e.Modals={})).Image||(e.Image={}),t.$inject=["$uibModalInstance","modalData","NewsletterMediaService"],e.NewsletterMediaBrowserController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.mediaService=e}(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),i.prototype.$onInit=function(){},i.prototype.fetchChildNodes=function(e){var t=this;this.mediaService.getMediaFile(e.id).then(function(e){e&&(t.node.showNode=!0,t.allowImages||(e=e.filter(function(e){return"Image"!=e.type})),0==(e=t.allowFiles?e:e.filter(function(e){return"File"!=e.type})).length?t.node.children=[{type:"NA",name:"Intet indhold"}]:t.node.children=e)})},i.prototype.selectNode=function(e){this.mediaService.selectedNode$.onNext(e)},i.$inject=["NewsletterMediaService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Crossportal/Newsletter/Components/Modals/Image/NewsletterMediaNodeBrowser.component.html",this.bindings={node:"<",allowFiles:"<",allowImages:"<"}},app.component("newsletterMediaNodeBrowser",new e)}(BoligExtra=BoligExtra||{}),!function(n){var e,t;function i(e,t,i,n,o){this.$scope=e,this.$modalInstance=t,this.fileService=i,this.modalService=n,this.featureFlagService=o,this.uploadedFiles=[],this.canPickContentFeatureFlag=!1,this.baseUrl=window.location.origin}e=n.CrossPortal||(n.CrossPortal={}),t=(t=(t=e.Newsletter||(e.Newsletter={})).Components||(t.Components={})).Modals||(t.Modals={}),i.prototype.$onInit=function(){var i=this;this.$scope.$watchCollection(function(){return i.file},function(e,t){e&&(e=i.fileService.toUploadedFile(e,n.Utility.File.UploadedFileType.Image),i.fileService.attachThumbnail(e,i.$scope),i.uploadedFiles=[],i.uploadedFiles.push(e),i.file=null,i.model={type:"UploadedFile",uploadedFile:i.uploadedFiles,selectedImage:void 0})}),this.canPickContentFeatureFlag=this.featureFlagService.newsletter.canPickContentFeatureFlag},i.prototype.selectImageFromMedias=function(){var t=this;this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/Image/NewsletterMediaBrowser.modal.html",e.Newsletter.Modals.Image.NewsletterMediaBrowserController,{startNodeId:0,allowFiles:!1,allowImages:!0},"lg").result.then(function(e){t.model={type:"SelectedImage",selectedImage:e,uploadedFile:void 0}})},i.prototype.submit=function(){this.model.imageLink=this.imageLink,this.$modalInstance.close(this.model)},i.$inject=["$scope","$uibModalInstance","FileService","ModalService","FeatureFlagService"],t.NewsletterAddImagesController=i}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.newsletterService=i,this.newsletter=t.newsletter}
1e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.cancel=function(){this.$modalInstance.dismiss()},t.prototype.submit=function(){this.$modalInstance.close("Success")},t.$inject=["$uibModalInstance","modalData","NewsletterService"],e.NewsletterConfirmDeleteController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.copyText=function(){navigator.clipboard.writeText(this.modalData.link),this.copyLink=!0},t.prototype.cancel=function(){this.$modalInstance.dismiss()},t.prototype.submit=function(){this.$modalInstance.dismiss()},t.$inject=["$uibModalInstance","modalData"],e.NewsletterLinkController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e;e=(e=t.html).replace(/<a/gi,"<a target='_blank'");t.html=e,this.modalData=t}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.$inject=["$uibModalInstance","modalData"],e.NewsletterPreviewController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.newsletterService=i,this.newsletter=t.newsletter}
1e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.cancel=function(){this.$modalInstance.close()},t.prototype.submit=function(){this.newsletterService.createNewsletter(!1,this.newsletter,!0),this.newsletterService.chosenNewsletter$.onNext(null),this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","NewsletterService"],e.NewsletterSaveBeforeLeaveController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$scope=e,this.$modalInstance=t,this.newsletterService=i,this.node={Children:[]}}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var i=this;this.newsletterService.getContentNodeChildren().then(function(e){var t;(t=i.node.Children).push.apply(t,e)}),this.newsletterService.selectedContentNode$.subscribe(function(e){i.selectedNode=e})},t.prototype.selectNode=function(){this.$modalInstance.close(this.selectedNode)},t.$inject=["$scope","$uibModalInstance","NewsletterService"],e.NewsletterSelectNodeContentController=t}(BoligExtra=BoligExtra||{}),!function(e){var i;function t(e,t,i,n){this.$modalInstance=e,this.newsletterService=i,this.modalService=n,this.newsletter=angular.copy(t.newsletter),this.participants={Companies:[],Departments:[],Participants:[],RoleGroups:[],Roles:[]}}e=e.CrossPortal||(e.CrossPortal={}),e=(e=(i=e.Newsletter||(e.Newsletter={})).Components||(i.Components={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.campaigns=this.newsletterService.campaigns$.getValue(),this.senders=this.newsletterService.senders$.getValue(),this.senders&&(this.selectedSender=this.senders.firstOrDefault(function(e){return e.DefaultSender}))},t.prototype.saveUserFromUserProvider=function(e){this.participants=e,this.receiversSelected()},t.prototype.receiversSelected=function(){"GroupBased"==this.Availability?this.canSend=null!=this.selectedCampaign:"RoleBased"==this.Availability&&(this.canSend=0<this.participants.Participants.length)},t.prototype.saveConsentStatus=function(e){this.overrideConsentsStatus=e.saveConsentStatus},t.prototype.submit=function(){var e=this,t=(this.newsletter.Sender=this.selectedSender,this.newsletter.SendState=null,this.newsletter.Id=0,{newsletter:this.newsletter,anyMembersInList:this.participants.Roles.any(function(e){return"med"==e.RoleType.toLowerCase()}),anyTenantsInList:this.participants.Roles.any(function(e){return"lej"==e.RoleType.toLowerCase()})});this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/SendNewsletter.modal.html",i.Components.Modals.SendNewsletterModalController,t,"lg").result.then(function(){e.newsletterService.chosenNewsletter$.onNext(null),e.$modalInstance.close()})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","NewsletterService","ModalService"],e.ResendNewsletterModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var r;function t(e,t,i,n,o,r,s,a){this.$modalInstance=e,this.modalService=i,this.$scope=n,this.utilityService=o,this.newsletterService=r,this.validationService=s,this.$sce=a,this.sendDate=new Date,this.sendTime=new Date,this.dateOptions={dateDisabled:!1,formatYear:"yy",minDate:new Date,startingDay:1},this.newsletter=t.newsletter,this.newsletter.sanitizedNewsletterHtml=this.$sce.trustAsHtml(angular.copy(this.newsletter.HtmlContent).replace(/<a/gi,"<a target='_blank'")),this.newsletter.SentDateTime&&(this.sendTime=new Date(this.newsletter.SentDateTime),this.sendDate=new Date(this.newsletter.SentDateTime)),this.anyTenantsInList=t.anyTenantsInList,this.anyMembersInList=t.anyMembersInList,this.modalData=t}e=e.CrossPortal||(e.CrossPortal={}),e=(e=(r=e.Newsletter||(e.Newsletter={})).Components||(r.Components={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.emailRegex=this.validationService.getEmailRegex(),this.newsletterService.getReceiversForCampaignAndConsent(this.newsletter.Configuration.CampaignIds,this.newsletter.Configuration.ConsentGroups).then(function(e){t.receivers=e,t.totalAmountOfReceivers=t.receivers.Campaigns.reduce(function(e,t){return e+t.AmountOfSubscribers},0)})},t.prototype.submit=function(){var e,t=this,i=this.reviewForm.$$element.find(".ng-invalid"),n=this.reviewForm.$$controls;this.checkForAdditionalLevel(n);for(var o=0;o<i.length;o++){e=i[o];break}e?(this.utilityService.safeDigest(this.$scope),e.focus()):(n=this.sendDate.setUTCHours(this.sendTime.getHours(),this.sendTime.getMinutes(),0,0),this.newsletter.SentDateTime=new Date(n),this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/SendNewsletter.modal.html",r.Components.Modals.SendNewsletterModalController,this.modalData,"lg").result.then(function(e){e&&t.$modalInstance.close()}))}
1,t.prototype.showPreview=function(e){e={title:e.Name,html:e.HtmlContent};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterPreview.modal.html",r.Components.Modals.NewsletterPreviewController,e,"lg")},t.prototype.sendTestMail=function(){this.testMail&&(this.newsletter.SentDateTime=new Date,this.newsletterService.sendTestMail(this.testMail,this.newsletter))},t.prototype.checkForAdditionalLevel=function(e){for(var t=0;t<e.length;t++)e[t].$$controls&&1<e[t].$$controls.length?this.checkForAdditionalLevel(e[t].$$controls):(e[t].$setDirty(),e[t].$setTouched())},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","ModalService","$scope","UtilityService","NewsletterService","ValidationService","$sce"],e.ReviewNewsletterModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.newsletterService=i,this.$sce=n,this.newsletter=t.newsletter,this.newsletter.sanitizedNewsletterHtml=this.$sce.trustAsHtml(angular.copy(this.newsletter.HtmlContent).replace(/<a/gi,"<a target='_blank'")),this.anyTenantsInList=t.anyTenantsInList,this.anyMembersInList=t.anyMembersInList}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){},t.prototype.submit=function(){this.newsletterService.createNewsletter(!0,this.newsletter,!0),this.newsletterService.chosenNewsletter$.onNext(null),this.$modalInstance.close(!0)},t.prototype.cancel=function(){this.$modalInstance.close(!1)},t.$inject=["$uibModalInstance","modalData","NewsletterService","$sce"],e.SendNewsletterModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.newsletterService=i,this.validationService=n,this.dateOptions={dateDisabled:!1,formatYear:"yy",minDate:new Date,startingDay:1},this.newsletter=t.newsletter,this.modalData=t}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.emailRegex=this.validationService.getEmailRegex()},t.prototype.sendTestMail=function(){this.testMail&&(this.newsletter.SentDateTime=new Date,this.newsletterService.sendTestMail(this.testMail,this.newsletter),this.$modalInstance.close())},t.prototype.checkForAdditionalLevel=function(e){for(var t=0;t<e.length;t++)e[t].$$controls&&1<e[t].$$controls.length?this.checkForAdditionalLevel(e[t].$$controls):(e[t].$setDirty(),e[t].$setTouched())},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","NewsletterService","ValidationService"],e.SendTestNewsletterModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i){this.modalService=e,this.newsletterService=t,this.featureFlagService=i}e=e.CrossPortal||(e.CrossPortal={}),(t=e.Newsletter||(e.Newsletter={})).Components||(t.Components={}),n.prototype.resendNewsletter=function(){var e={Name:this.newsletter.Name,EnablePublicWebShare:this.newsletter.EnablePublicWebShare,HtmlContent:this.newsletter.HtmlContent,Ribbons:this.newsletter.Ribbons,Footer:this.newsletter.Footer,Header:this.newsletter.Header,Sender:this.newsletter.Sender};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/ResendNewsletter.modal.html",t.Components.Modals.ResendNewsletterModalController,{newsletter:e},"lg").result.then(function(){})},n.prototype.$onInit=function(){this.creationType=this.newsletterService.creationType,this.enableSeeingReports=this.featureFlagService.newsletter.enableSeeingReports},n.prototype.getLink=function(){var e={title:this.newsletter.Name,link:this.newsletter.RenderPage};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterLink.modal.html",t.Components.Modals.NewsletterLinkController,e,"lg").result.then(function(){})},n.$inject=["ModalService","NewsletterService","FeatureFlagService"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Components/NewsletterBar.component.html",this.bindings={save:"&",delete:"&",cancel:"&",showReport:"&",showPreview:"&",sendTest:"&",newsletter:"<"}},app.component("newsletterBar",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={}),i.prototype.$onInit=function(){},i.prototype.$onChanges=function(e){e.html&&e.html!=this.html&&(this.html=e.html.currentValue,this.html=this.html.replace(/<a/gi,"<a target='_blank'"),this.renderPreview(this.html))},i.prototype.renderPreview=function(e){e=(e=e.replace(/<a/gi,"<a target='_blank'")).replace(/body{/gi,"testbody{"),$(".newsletter-preview").html(e)},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Components/NewsletterPreview.component.html",this.bindings={html:"<"}},app.component("newsletterPreview",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n;function t(e){var t=this;this.newsletterService=e,this.render$=new Rx.Subject,this.editingRibbon$=new Rx.Subject,this.newsletterService.chosenNewsletter$.subscribe(function(e){e&&(t.chosenNewsletter=e)})}e=e.CrossPortal||(e.CrossPortal={}),(n=e.Newsletter||(e.Newsletter={})).Components||(n.Components={}),t.prototype.setEditingRibbon=function(e){this.editingRibbon$.onNext(e)},t.prototype.updateContent=function(e){switch(e.Alias){case n.Ribbon.ribbon1:case n.Ribbon.ribbon2:case n.Ribbon.ribbon3:case n.Ribbon.ribbon4:case n.Ribbon.ribbon5:case n.Ribbon.ribbon6:case n.Ribbon.ribbon7:case n.Ribbon.ribbon8:case n.Ribbon.ribbon9:case n.Ribbon.ribbon10:this.saveRibbon(e);break;case n.Ribbon.footerRibbon1:case n.Ribbon.footerRibbon2:this.chosenNewsletter.Footer=e;break;case n.Ribbon.headerRibbon1:case n.Ribbon.headerRibbon2:this.chosenNewsletter.Header=e}this.updateNewsletter(this.chosenNewsletter)},t.prototype.saveRibbon=function(t){var e=this.chosenNewsletter.Ribbons.firstOrDefault(function(e){return e.Id==t.Id});null!=e&&this.chosenNewsletter.Ribbons.remove(e),this.chosenNewsletter.Ribbons.add(t),this.chosenNewsletter.Ribbons=this.chosenNewsletter.Ribbons.orderBy(function(e){return e.Id})},t.prototype.updateNewsletter=function(e){this.generateHtml(e)},t.prototype.hydrateRibbon=function(e,t,i){switch(e.Alias){case n.Ribbon.ribbon1:case n.Ribbon.ribbon2:case n.Ribbon.ribbon3:case n.Ribbon.ribbon4:this.hydrateEditorFieldsFromContent(e.EditorFields,i);break;case n.Ribbon.ribbon5:case n.Ribbon.ribbon6:0==t?this.hydrateEditorFieldsFromContent([e.EditorFields[0]],i):1==t&&this.hydrateEditorFieldsFromContent([e.EditorFields[1]],i);break;case n.Ribbon.ribbon7:0==t?this.hydrateEditorFieldsFromContent([e.EditorFields[0],e.EditorFields[2]],i):1==t&&this.hydrateEditorFieldsFromContent([e.EditorFields[1],e.EditorFields[3]],i);break;case n.Ribbon.ribbon8:case n.Ribbon.ribbon9:case n.Ribbon.ribbon10:this.hydrateEditorFieldsFromContent(e.EditorFields,i)}},t.prototype.hydrateEditorFieldsFromContent=function(e,t){var i=!0;t.Link&&(i=t.Link.toLowerCase().startsWith("http:")||t.Link.toLowerCase().startsWith("https:"));for(var n=0;n<e.length;n++)"text"==e[n].Type&&(e[n].Value="<h2>"+t.Title+"</h2> <p>"+t.Lead+'</p> <a style="text-align: center; " href="'+(i?t.Link:window.location.origin+t.Link)+'" >Læs mere » </a>',e[n].Link=i?t.Link:window.location.origin+t.Link),"image"==e[n].Type&&(e[n].Value=t.Image&&""!=t.Image?t.Image:"empty",e[n].Link=i?t.Link:window.location.origin+t.Link)},t.prototype.delete=function(t){var e=this.chosenNewsletter;switch(t.Alias){case n.Ribbon.ribbon1:case n.Ribbon.ribbon2:case n.Ribbon.ribbon3:case n.Ribbon.ribbon4:case n.Ribbon.ribbon5:case n.Ribbon.ribbon6:case n.Ribbon.ribbon7:case n.Ribbon.ribbon8:case n.Ribbon.ribbon9:case n.Ribbon.ribbon10:var i=e.Ribbons.firstOrDefault(function(e){return t.Id==e.Id});e.Ribbons.remove(i);break;case n.Ribbon.footerRibbon1:case n.Ribbon.footerRibbon2:e.Footer=null;break;case n.Ribbon.headerRibbon1:case n.Ribbon.headerRibbon2:e.Header=null}this.updateNewsletter(e),this.newsletterService.chosenNewsletter$.onNext(e),this.render$.onNext(!0),this.newsletterService.chosenNewsletter$.onNext(this.chosenNewsletter)},t.prototype.createRibbon=function(e,t){var i={Alias:e,ColSpan:1,Id:0<e.indexOf("Footer")||0<e.indexOf("Header")?1:this.incrementId(),EditorFields:[],ContentType:t,ContentNodes:[],Configuration:{}};switch(e){case n.Ribbon.ribbon1:return this.createEditorFieldsForRibbon1(i),i;case n.Ribbon.ribbon2:return this.createEditorFieldsForRibbon2(i),i;case n.Ribbon.ribbon3:return this.createEditorFieldsForRibbon3(i),i;case n.Ribbon.ribbon4:return this.createEditorFieldsForRibbon4(i),i;case n.Ribbon.ribbon5:return this.createEditorFieldsForRibbon5(i),i;case n.Ribbon.ribbon6:return this.createEditorFieldsForRibbon6(i),i;case n.Ribbon.ribbon7:return this.createEditorFieldsForRibbon7(i),i;case n.Ribbon.ribbon8:return this.createEditorFieldsForRibbon8(i),i;case n.Ribbon.ribbon9:return this.createEditorFieldsForRibbon9(i),i;case n.Ribbon.ribbon10:return this.createEditorFieldsForRibbon10(i),i;case n.Ribbon.footerRibbon1:return i.Configuration={Size:20,BorderRadius:0},this.createEditorFieldsForFooterRibbon1(i),i;case n.Ribbon.footerRibbon2:return this.createEditorFieldsForFooterRibbon2(i),i;case n.Ribbon.headerRibbon1:return this.createEditorFieldsForHeaderRibbon1(i),i;case n.Ribbon.headerRibbon2:return this.createEditorFieldsForHeaderRibbon2(i),i}},t.prototype.generateHtml=function(e){for(var t=$(".email-ribbon"),i=$(".footer-ribbon"),n=$(".header-ribbon"),o="",r=0;r<n.length;r++)o=n[r].outerHTML;for(var s=0;s<t.length;s++)o+=t[s].outerHTML;for(r=0;r<i.length;r++)o+=i[r].outerHTML;return this.adjustHtmlTags(e,o),e},t.prototype.adjustHtmlTags=function(e,t){e.HtmlContent='<html><head><meta name="x-apple-disable-message-reformatting"> <meta name="viewport" content="width=device-width, initial-scale=1"><style> body{ mso-line-height-rule: exactly; line-height:125%;} .ribbons-container span.first-heading{margin:0; padding:0; font-size:30px; line-height:34px !important; font-weight:600; font-family:Arial, sans-serif;} .ribbons-container span.second-heading{font-size:18px; line-height:32px !important; font-weight:600; margin:0; padding:0; font-family:Arial, sans-serif;} .ribbons-container span.third-heading{font-size:16px; line-height:30px !important; font-weight:600; margin:0; padding:0; font-family:Arial, sans-serif;} .ribbons-container p{font-size:14px; line-height:26px !important; font-weight:400; margin:0; margin-bottom:10px !important; padding:0; font-family:Arial, sans-serif;} div{margin:0} .ribbons-container span{font-size:14px; line-height: 100%; font-weight:400; margin:0; margin-bottom:0px !important; padding:0; color:#000000; font-family:Arial, sans-serif;} .ribbons-container span.unordered-list,.ribbons-container span.unordered-list + span{font-size:14px; line-height: 100%; font-weight:400; margin:0; padding:0; !important; color:#000000; font-family:Arial, sans-serif;} .ribbons-container ul,ol{margin-top:0; margin-bottom:0; padding-bottom:0; padding-top:0; line-height:18px; font-family:Arial, sans-serif;} .ribbons-container li{ font-size:14px; line-height:100%; font-weight:400; margin:0; padding:0; color:#000000; font-family:Arial, sans-serif;} .ribbons-container br{margin:0; padding:0;} .mail-container{padding:0px 15px; background-color:#fff; width:100%; max-width:600px; margin:auto font-family:Arial, sans-serif; line-height:125% !important; mso-line-height-rule: exactly} @media only screen and (max-width:550px) { body, table, td, p, a {-webkit-text-size-adjust: none !important;} td{font-size:13px}}</style> </head><body style="padding:0"> <table width="100%" height="100%" cellspacing="0" cellpadding="10" bgcolor="#eaeae9" style="table-layout:fixed; background-color:#eaeae9"><tbody><tr><td class="ribbons-container" style="padding:0" align="center" border="0" cellspacing="0"><div class="mail-container" Style="padding:0px 15px; background-color:#fff; width:100%; max-width:600px; margin:auto" cellpadding="15px">'+t+"</div></td></tr></tbody></table></body></html>",e.HtmlContent=this.replaceHtmlTags(e.HtmlContent,"p","line-height: 26p
1x; display:block font-family:Arial, sans-serif;","",!0),e.HtmlContent=this.replaceHtmlTags(e.HtmlContent,"h1",'margin:0; padding:0; font-size:30px; line-height:34px; color:#000000; font-weight:600 font-family:Arial, sans-serif;"',"first-heading",!0),e.HtmlContent=this.replaceHtmlTags(e.HtmlContent,"h2",'font-size:18px; line-height:32px; font-weight:600; margin:0; padding:0; font-family:Arial, sans-serif;"',"second-heading",!0),e.HtmlContent=this.replaceHtmlTags(e.HtmlContent,"h3",'font-size:16px; line-height:30px; font-weight:600; margin:0; padding:0; font-family:Arial, sans-serif;"',"third-heading",!0),e.HtmlContent=this.replaceHtmlListTags(e.HtmlContent,"ul"),e.HtmlContent=this.replaceHtmlListTags(e.HtmlContent,"ol")},t.prototype.replaceHtmlTags=function(e,t,i,n,o){for(var r="<"+t,s='class="'+n+'"',n=new RegExp(r,"g"),a=(e.match(n)||[]).length,l=1;l<=a;l++){var c,d,u=void 0,p=e.indexOf(r),p=(-1<p&&(c=e.indexOf("</"+t+">")+3+t.length,(p=e.substring(p,c)).indexOf("<br>"),c=p.indexOf('style="'),d=p.indexOf('"',c+7),-1<c)&&-1<d&&(u=p.substring(c+7,d)),'style="'+i+'"');e=(e=e.replace("<"+t,'<table><tr><td style="padding-bottom:10px !important"><div style="'+u+'"><span '+s+" "+p)).replace("</"+t+">","</span></div></td></tr></table>")}return e},t.prototype.replaceHtmlListTags=function(e,t){for(var i=e.indexOf("<"+t+">"),n=e.indexOf("</"+t+">")+5,o=e.substring(i,n),r=(o.match(/<li>/g)||[]).length,s=1;s<=r;s++)o=(o=o.replace("<li>",'<span class="unordered-list">'+("ol"==t?s+".":"•")+"</span> <span>")).replace("</li>","<br/></span>");return o=(o=o.replace("<"+t+">","")).replace("</"+t+">",""),e.slice(i,n),e=e.substring(0,i)+o+e.substring(n,e.length)},t.prototype.addTextEditorField=function(){return{Alias:"Tekst",Value:null,Type:"text",Link:""}},t.prototype.addImageEditorField=function(){return{Alias:"Billede",Value:null,Type:"image",Link:""}},t.prototype.addLinkEditorField=function(){return{Alias:"link",Value:"<p>Headerlinks</p>",Type:"link",Link:""}},t.prototype.addSocialMediaEditorField=function(e){return{Alias:"SoMe",Value:e,Type:"SoME",Link:""}},t.prototype.createEditorFieldsForRibbon1=function(e){e.EditorFields.add(this.addTextEditorField()),e.EditorFields.add(this.addImageEditorField())},t.prototype.createEditorFieldsForRibbon2=function(e){e.EditorFields.add(this.addImageEditorField()),e.EditorFields.add(this.addTextEditorField())},t.prototype.createEditorFieldsForRibbon3=function(e){e.EditorFields.add(this.addTextEditorField())},t.prototype.createEditorFieldsForRibbon4=function(e){e.EditorFields.add(this.addImageEditorField())},t.prototype.createEditorFieldsForRibbon5=function(e){e.EditorFields.add(this.addTextEditorField()),e.EditorFields.add(this.addTextEditorField())},t.prototype.createEditorFieldsForRibbon6=function(e){e.EditorFields.add(this.addImageEditorField()),e.EditorFields.add(this.addImageEditorField())},t.prototype.createEditorFieldsForRibbon7=function(e){e.EditorFields.add(this.addImageEditorField()),e.EditorFields.add(this.addImageEditorField()),e.EditorFields.add(this.addTextEditorField()),e.EditorFields.add(this.addTextEditorField())},t.prototype.createEditorFieldsForRibbon8=function(e){e.EditorFields.add(this.addTextEditorField()),e.EditorFields.add(this.addImageEditorField())},t.prototype.createEditorFieldsForRibbon9=function(e){e.EditorFields.add(this.addImageEditorField()),e.EditorFields.add(this.addTextEditorField())},t.prototype.createEditorFieldsForRibbon10=function(e){e.EditorFields.add(this.addImageEditorField()),e.EditorFields.add(this.addTextEditorField())},t.prototype.createEditorFieldsForFooterRibbon1=function(e){e.EditorFields.add(this.addSocialMediaEditorField("Facebook")),e.EditorFields.add(this.addSocialMediaEditorField("Instagram")),e.EditorFields.add(this.addSocialMediaEditorField("LinkedIn")),e.EditorFields.add(this.addSocialMediaEditorField("Twitter"))},t.prototype.createEditorFieldsForFooterRibbon2=function(e){e.EditorFields.add(this.addImageEditorField())},t.prototype.createEditorFieldsForHeaderRibbon1=function(e){e.EditorFields.add(this.addLinkEditorField())},t.prototype.createEditorFieldsForHeaderRibbon2=function(e){e.EditorFields.add(this.addImageEditorField())},t.prototype.incrementId=function(){var e=this.chosenNewsletter.Ribbons,t=0;return(t=e.any()?Math.max.apply(Math,e.map(function(e){return e.Id})):t)+1}
1,t.$inject=["NewsletterService"],app.service("RibbonService",t)}(BoligExtra=BoligExtra||{}),!function(e){var s,t;function i(e,t,i,n,o,r){var s=this;this.$scope=e,this.newsletterService=t,this.ribbonService=i,this.modalService=n,this.featureFlagService=o,this.utilityService=r,this.disposables=new Rx.CompositeDisposable,this.selectSection=1,this.selectedConsentGroups=[],this.participants={Companies:[],Departments:[],Participants:[],RoleGroups:[],Roles:[]},this.sortableOptions={handle:".drag-handle",stop:function(e,t){for(var i=0;i<s.newsletter.Ribbons.length;i++)s.newsletter.Ribbons[i].Id=i+1;s.ribbonService.updateNewsletter(s.newsletter)}}}e=e.CrossPortal||(e.CrossPortal={}),(e=(s=e.Newsletter||(e.Newsletter={})).Components||(s.Components={})).Ribbons||(e.Ribbons={}),i.prototype.$onInit=function(){var o=this;this.selectedCampaigns=[],this.disposables.add(this.newsletterService.campaigns$.subscribe(function(e){o.campaigns=e,0<o.campaigns.length&&o.newsletterService.getCampaign(o.campaigns.firstOrDefault().Id),o.newsletter&&(o.selectedCampaigns=o.campaigns.filter(function(t){return!!o.newsletter.Configuration.CampaignIds.find(function(e){return e==t.Id})}),o.newsletterUsesCampaign=0<o.selectedCampaigns.length)})),this.disposables.add(this.newsletterService.senders$.subscribe(function(e){o.senders=e,o.newsletter&&o.newsletter.Sender?o.selectedSender=e.firstOrDefault(function(e){return e.Email==o.newsletter.Sender.Email&&e.Name==o.newsletter.Sender.Name}):o.selectedSender=e.firstOrDefault(function(e){return e.DefaultSender})})),this.newsletterService.getCommunicationConsents().then(function(e){o.consentGroups=e,o.newsletter.Configuration.ConsentGroups&&(o.selectedConsentGroups=o.consentGroups.filter(function(t){return o.newsletter.Configuration.ConsentGroups.some(function(e){return e==t.Id})}))}),this.disposables.add(this.newsletterService.chosenNewsletter$.subscribe(function(e){var t=angular.copy(e);if(t&&e.Ribbons){if("Template"==t.Type&&(t.Id=0),o.newsletter=t,o.newsletter.Configuration){o.participants={Companies:[],Departments:[],Participants:[],RoleGroups:[],Roles:[]};for(var i=0;i<o.newsletter.Configuration.Permissions.CompanyOrDepartments.length;i++)!function(){var t,e=o.newsletter.Configuration.Permissions.CompanyOrDepartments[i];-1==e.Value.indexOf("_")?o.participants.Companies.push({Name:e.Name,CompanyNo:parseInt(e.Value),Selected:!0}):(t=e.Value.split("_"),o.participants.Companies.any(function(e){return e.Selected&&e.CompanyNo==parseInt(t[0])})&&o.participants.Departments.push({Name:e.Name,CompanyNo:parseInt(t[0]),DepartmentNo:parseInt(t[1]),Selected:!0}))}();for(i=0;i<o.newsletter.Configuration.Permissions.RoleGroups.length;i++){var n=o.newsletter.Configuration.Permissions.RoleGroups[i];-1==n.Value.indexOf("-")?o.participants.RoleGroups.push({Id:parseInt(n.Value),Name:n.Name,Selected:!0}):o.participants.Roles.push(JSON.parse(n.Value))}o.newsletterUsesUserProvider=o.participants.Companies.any(),o.newsletterUsesConsentGroups=o.newsletter.Configuration.ConsentGroups.any(),o.newsletterUsesConsentGroups&&o.consentGroups&&(o.selectedConsentGroups=o.consentGroups.filter(function(t){return o.newsletter.Configuration.ConsentGroups.some(function(e){return e==t.Id})}))}else o.newsletter.Configuration={UserProviderSubscribers:[],Permissions:{CompanyOrDepartments:[],RoleGroups:[]},ConsentGroups:[]};o.senders&&o.newsletter.Sender&&(o.selectedSender=o.senders.firstOrDefault(function(e){return e.Email==o.newsletter.Sender.Email&&e.Name==o.newsletter.Sender.Name})),"Done"!=e.SendState&&(o.state="Edit"),o.campaigns&&o.newsletter&&o.newsletter.Configuration&&o.newsletter.Configuration.CampaignIds&&(o.selectedCampaigns=o.campaigns.filter(function(t){return!!o.newsletter.Configuration.CampaignIds.find(function(e){return e==t.Id})}),o.newsletterUsesCampaign=0<o.selectedCampaigns.length)}})),setTimeout(function(){var e;o.newsletter||(o.newsletter=e={Id:0,Ribbons:[]},o.newsletterService.chosenNewsletter$.onNext(e),o.$scope.$applyAsync())},300),this.consentGroupEnabledFeatureFlag=this.featureFlagService.newsletter.consentGroupEnabledFeatureFlag,this.showPreviewBeforeSendFeatureFlag=this.featureFlagService.newsletter.showPreviewBeforeSendFeatureFlag},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.setSelectionState=function(e){this.selectSection==e?this.selectSection=-1:this.selectSection=e},i.prototype.addRibbon=function(e){e=this.ribbonService.createRibbon(e,this.contentType);this.newsletter.Ribbons.add(e),this.ribbonService.updateNewsletter(this.newsletter)},i.prototype.addFooterRibbon=function(e){e=this.ribbonService.createRibbon(e,"Manuel");this.newsletter.Footer=e,this.ribbonService.updateNewsletter(this.newsletter)},i.prototype.addHeaderRibbon=function(e){e=this.ribbonService.createRibbon(e,"Manuel");this.newsletter.Header=e,this.ribbonService.updateNewsletter(this.newsletter)},i.prototype.delete=function(){var t=this,e={newsletter:this.newsletter};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterConfirmDelete.modal.html",s.Components.Modals.NewsletterConfirmDeleteController,e,"lg").result.then(function(e){e&&(t.newsletterService.deleteNewsletter(t.newsletter.Id),t.newsletterService.chosenNewsletter$.onNext(null),t.cancel())})},i.prototype.resetUserProvider=function(){this.newsletterUsesUserProvider||(this.participants={Companies:[],Departments:[],Participants:[],RoleGroups:[],Roles:[]},this.newsletter.Configuration.UserProviderSubscribers=[],this.newsletter.Configuration.Permissions={CompanyOrDepartments:[],RoleGroups:[]})},i.prototype.seeReport=function(){this.showReport(this.newsletter.Id)},i.prototype.createNewsletter=function(e,t){if(this.newsletter){this.ribbonService.updateNewsletter(this.newsletter);var i=this.newsletterForm.$$element.find(".ng-invalid"),n=void 0,o=(this.selectSection=1,this.newsletterForm.$$controls);this.checkForAdditionalLevel(o);for(var r=0;r<i.length;r++)if("div"!==i[r].localName){n=i[r];break}!t&&n?(1!=this.selectSection&&this.setSelectionState(1),this.utilityService.safeDigest(this.$scope),n.focus()):(this.newsletter.Configuration.CampaignIds=this.newsletterUsesCampaign&&this.selectedCampaigns.map(function(e){return e.Id}),this.newsletter.Configuration.ConsentGroups=this.selectedConsentGroups.map(function(e){return e.Id}),this.newsletterUsesUserProvider||(this.participants={Companies:[],Departments:[],Participants:[],RoleGroups:[],Roles:[]},this.newsletter.Configuration.UserProviderSubscribers=[],this.newsletter.Configuration.Permissions={CompanyOrDepartments:[],RoleGroups:[]}),e?n?(1!=this.selectSection&&this.setSelectionState(1),this.utilityService.safeDigest(this.$scope),n.focus()):this.newsletter.Name&&""!==this.newsletter.Name&&null!=this.selectedSender&&""!=this.selectedSender.Email&&(this.newsletter.Sender=this.selectedSender,this.newsletter.OverrideConsents=this.overrideConsentsStatus,o={newsletter:this.newsletter,anyMembersInList:this.participants.Roles.any(function(e){return"med"==e.RoleType.toLowerCase()}),anyTenantsInList:this.participants.Roles.any(function(e){return"lej"==e.RoleType.toLowerCase()})},this.showPreviewBeforeSendFeatureFlag?this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/ReviewNewsletter.modal.html",s.Components.Modals.ReviewNewsletterModalController,o,"lg").result.then(function(){}):(this.newsletter.SentDateTime=new Date,this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/SendNewsletter.modal.html",s.Components.Modals.SendNewsletterModalController,o,"lg").result.then(function(e){}))):n?(1!=this.selectSection&&this.setSelectionState(1),this.utilityService.safeDigest(this.$scope),n.focus()):this.newsletter.Name&&""!==this.newsletter.Name&&null!=this.selectedSender&&""!=this.selectedSender.Email&&(this.newsletter.OverrideConsents=this.overrideConsentsStatus,this.newsletter.Sender=this.selectedSender,this.newsletterService.createNewsletter(e,this.newsletter,t),t?this.newsletterService.chosenNewsletter$.onNext(null):this.setSelectionState(1)))}},i.prototype.checkForAdditionalLevel=function(e){for(var t=0;t<e.length;t++)e[t].$$controls&&1<e[t].$$controls.length?this.checkForAdditionalLevel(e[t].$$controls):(e[t].$setDirty(),e[t].$setTouched())},i.prototype.showPreview=function(){var t=this;this.ribbonService.updateNewsletter(this.newsletter),setTimeout(function(){var e={title:t.newsletter.Name,html:t.newsletter.HtmlContent};t.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterPreview.modal.html",s.Components.Modals.NewsletterPreviewController,e,"lg")},300)},i.prototype.sendTestNewsletter=function(){var e={newsletter:this.newsletter,anyMembersInList:!1,anyTenantsInList:!1};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/SendTestNewsletter.modal.html",s.Components.Modals.SendTestNewsletterModalController,e,"lg")},i.prototype.cancelWithVerification=function(e){var t,i=this;!this.newsletter.SentDateTime&&this.newsletter.Name?(t={newsletter:this.newsletter},this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterSaveBeforeLeave.modal.html",s.Components.Modals.NewsletterSaveBeforeLeaveController,t,"lg").result.then(function(){i.cancel({area:e})})):this.cancel({area:e})},i.prototype.saveUserFromUserProvider=function(e){this.newsletter.Configuration.Permissions={CompanyOrDepartments:[],RoleGroups:[]},this.participants=e;for(var t=0;t<this.participants.Participants.length;t++)this.newsletter.Configuration.UserProviderSubscribers.push({Name:this.participants.Participants[t].Name,Email:this.participants.Participants[t].Email,InteressentNo:this.participants.Participants[t].InteressentNo.toString()});for(t=0;t<this.participants.Companies.length;t++)this.participants.Companies[t].Selected&&this.newsletter.Configuration.Permissions.CompanyOrDepartments.push({Name:this.participants.Companies[t].Name,Value:this.participants.Companies[t].CompanyNo.toString()});for(t=0;t<this.participants.Departments.length;t++)this.participants.Departments[t].Selected&&this.newsletter.Configuration.Permissions.CompanyOrDepartments.push({Name:this.participants.Departments[t].Name,Value:this.participants.Departments[t].CompanyNo.toString()+"_"+this.participants.Departments[t].DepartmentNo.toString()});for(t=0;t<this.participants.RoleGroups.length;t++)this.participants.RoleGroups[t].Selected&&this.newsletter.Configuration.Permissions.RoleGroups.push({Name:this.participants.RoleGroups[t].Name,Value:this.participants.RoleGroups[t].Id.toString()});for(t=0;t<this.participants.Roles.length;t++)this.participants.Roles[t].Selected&&this.newsletter.Configuration.Permissions.RoleGroups.push({Name:this.participants.Roles[t].RoleArt,Value:JSON.stringify(this.participants.Roles[t])})},i.prototype.isCampaignSelected=function(t){return this.selectedCampaigns.any(function(e){return e.Id==t})},i.prototype.addCampaignToSelected=function(e){var t=this.selectedCampaigns.indexOf(e);-1==t?this.selectedCampaigns.push(e):this.selectedCampaigns.splice(t,1)},i.prototype.isConsentSelected=function(t){return this.selectedConsentGroups.any(function(e){return e.Id==t.Id})},i.prototype.addConsentToSelected=function(e){var t=this.selectedConsentGroups.indexOf(e);-1==t?this.selectedConsentGroups.push(e):this.selectedConsentGroups.splice(t,1)},i.prototype.saveConsentStatus=function(e){this.overrideConsentsStatus=e.saveConsentStatus},i.$inject=["$scope","NewsletterService","RibbonService","ModalService","FeatureFlagService","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="App/CrossPortal/Newsletter/Components/RibbonContainer.component.html",this.bindings={cancel:"&",showReport:"&"}},app.component("ribbonContainerComponent",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.baseUrl=window.location.origin}
1(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Ribbons||(e.Ribbons={}),i.prototype.$onInit=function(){this.ribbon&&this.ribbon.Alias&&(this.templateUrl="/App/CrossPortal/Newsletter/Components/Ribbons/Content/"+this.ribbon.Alias+".component.html")},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Components/Ribbons/Ribbon.component.html",this.bindings={ribbon:"<"}},app.component("ribbon",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(){}e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),t.ribbon1="Ribbon1",t.ribbon2="Ribbon2",t.ribbon3="Ribbon3",t.ribbon4="Ribbon4",t.ribbon5="Ribbon5",t.ribbon6="Ribbon6",t.ribbon7="Ribbon7",t.ribbon8="Ribbon8",t.ribbon9="Ribbon9",t.ribbon10="Ribbon10",t.footerRibbon1="Footerribbon1",t.footerRibbon2="Footerribbon2",t.headerRibbon1="Headerribbon1",t.headerRibbon2="Headerribbon2",e.Ribbon=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.ribbonService=e,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Ribbons||(e.Ribbons={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.ribbonService.editingRibbon$.subscribe(function(e){t.ribbon=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["RibbonService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Components/Ribbons/Sidebar/EditRibbonSidebar.component.html",this.bindings={}},app.component("editRibbonSideBar",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.newsletterService=e}(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),i.prototype.$onInit=function(){},i.prototype.selectContentNode=function(e){this.selectedNode==e?this.newsletterService.selectedContentNode$.onNext(null):this.newsletterService.selectedContentNode$.onNext(e)},i.prototype.fetchChildNodes=function(e){var t=this;this.newsletterService.getContentNodeChildren(e.Id).then(function(e){e&&(t.node.ShowNode=!0,t.node.Children=e)})},i.$inject=["NewsletterService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Components/SelectNodeContent/SelectNodeContent.component.html",this.bindings={node:"<",selectedNode:"<"}},app.component("selectNodeContent",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable,this.toDate=(new Date).addMonths(1),this.fromDate=(new Date).addMonths(-3)}(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={}),i.prototype.$onInit=function(){this.filterByDate()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.fromDateChanged=function(){this.fromDate&&this.toDate&&(this.fromDate.isAfter(this.toDate)&&(this.toDate=this.fromDate),this.filterByDate())},i.prototype.toggleSearchInAll=function(){this.searchInAll?(this.toDate=new Date(9999,12),this.fromDate=new Date(1,1)):(this.toDate=(new Date).addMonths(1),this.fromDate=(new Date).addMonths(-3)),this.filterByDate()},i.prototype.toDateChanged=function(){this.fromDate&&this.toDate&&(this.toDate.isBefore(this.fromDate)&&(this.fromDate=this.toDate),this.filterByDate())},i.prototype.filterByDate=function(){this.dateFilter({model:{to:this.toDate,from:this.fromDate}})},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Components/Toolbar.component.html",this.bindings={search:"&",dateFilter:"&",placeholder:"@",dateFormat:"@"}},app.component("toolbar",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i,n,o,r,s,a,l){this.$scope=e,this.newsletterService=t,this.modalService=i,this.validationService=n,this.fileService=o,this.utilityService=r,this.$sce=s,this.featureFlagService=a,this.ribbonService=l,this.disposables=new Rx.CompositeDisposable,this.searchText="",this.fromDate=(new Date).addMonths(-3),this.toDate=(new Date).addMonths(1),this.selectedState="draft",this.dataLoaded=!1,this.isSubscriberSearch=!1,this.currentPage=0,this.entryLimit=5,this.subscriberSearchInProgress=!1,this.templates=[]}e=e.CrossPortal||(e.CrossPortal={}),n=e.Newsletter||(e.Newsletter={}),i.prototype.$onInit=function(){var t=this;this.emailRegex=this.validationService.getEmailRegex(),this.disposables.add(this.newsletterService.currentView$.subscribe(function(e){"archiveView"!=t.currentView&&(t.searchText=null),t.currentView=e})),this.disposables.add(this.newsletterService.newsletters$.subscribe(function(e){t.allNewsletters=e,t.allNewsletters.forEach(function(e){e.HtmlContent&&(e.sanitizedNewsletterHtml=t.$sce.trustAsHtml(angular.copy(e.HtmlContent).replace(/<a/gi,"<a target='_blank'")))}),t.filterNewsletters(),t.dataLoaded=!0,t.setView(t.currentView||"archiveView")})),this.disposables.add(this.newsletterService.senders$.subscribe(function(e){t.senders=e})),this.disposables.add(this.newsletterService.campaigns$.subscribe(function(e){var i;e&&(i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),t.campaigns=e.sort(function(e,t){return i.compare(e.Name,t.Name)}),t.shownCampaigns=t.campaigns)})),this.disposables.add(this.newsletterService.chosenCampaign$.subscribe(function(e){t.chosenCampaign=e})),this.disposables.add(this.newsletterService.chosenNewsletter$.subscribe(function(e){e&&(t.chosenNewsletter=e)})),this.disposables.add(this.newsletterService.getAllTemplates().subscribe(function(e){t.templates=e})),this.setView("archiveView"),this.newsletterService.getCurrentNewsletters(),this.newsletterService.getAllCampaigns(),this.newsletterService.getAllNewsletters(),this.newsletterService.getAllSenders(),this.enableTemplateCreationFeatureFlag=this.featureFlagService.newsletter.enableTemplateCreationFeatureFlag,this.enableSeeingReports=this.featureFlagService.newsletter.enableSeeingReports},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.showReport=function(t){var i=this;this.newsletterService.getNewsletter(t).then(function(e){i.newsletterService.seeReport(t),i.setVie
1w("reportView")})},i.prototype.addSender=function(e,t){null!=t&&""!=t&&null!=e&&""!=e&&(this.senders.unshift(t={Email:t,Name:e}),this.newsletterService.addSender(t))},i.prototype.getCurrentView=function(e){switch(e){case"archiveView":return"Nyhedsmail arkiv";case"subscribers":return"Modtagere";case"campaignConfigurations":return"Indstillinger"}},i.prototype.getNewsletterLink=function(e){e={title:e.Name,link:e.RenderPage};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterLink.modal.html",n.Components.Modals.NewsletterLinkController,e,"lg").result.then(function(){})},i.prototype.removeSender=function(t){var e;null!=t&&""!==t&&(e=this.senders.firstOrDefault(function(e){return e.Email==t}),this.senders.remove(e),this.newsletterService.removeSender({Email:t}))},i.prototype.setDefaultSender=function(t){var e=this.senders.firstOrDefault(function(e){return e.Email==t});this.senders.forEach(function(e){return e.DefaultSender=!1}),e.DefaultSender=!0,this.newsletterService.setDefaultSender(t)},i.prototype.getSubscriberOnCampaign=function(e,t){return e.Subscribers.firstOrDefault(function(e){return e.Name==t.Name&&e.Email==t.Email})},i.prototype.selectCampaign=function(e){e.IsSelected=!e.IsSelected;e=this.campaigns.filter(function(e){return e.IsSelected});this.noCampaignSelected=!e||e.length<=0},i.prototype.subscriberSearch=function(e){var n=this;e&&""!=e?(this.isSubscriberSearch=!0,this.subscriberSearchInProgress=!0,this.newsletterService.subscriberSearch(e).first().subscribe(function(e){var i=[],t=e.map(function(e){return e.CampaignId}).filter(function(e,t,i){return i.indexOf(e)==t});e&&e.any()&&(t.forEach(function(t){var e=n.campaigns.find(function(e){return e.Id==t});i.push({CampaignId:e.Id,Name:e.Name,Subscribers:[]})}),e.forEach(function(t){i.find(function(e){return e.CampaignId==t.CampaignId}).Subscribers.push(t)}),i.forEach(function(e){e.AmountOfSubscribers=e.Subscribers.length})),n.subscriberSearchInProgress=!1,n.shownCampaigns=i})):(this.shownCampaigns=this.campaigns,this.isSubscriberSearch=!1)},i.prototype.deleteFoundSubscribers=function(){for(var o,r=this,e=0;e<this.shownCampaigns.length;e++)!function(e){var t=r.shownCampaigns[e];o=r.campaigns.find(function(e){return e.Id==t.CampaignId});for(var i=t.Subscribers.length-1;0<=i;i--){var n=t.Subscribers[i];r.newsletterService.removeSubscriberFromCampaign(t.CampaignId,{Email:n.Email,DeleteReason:"Removed by personnel"}),t.Subscribers.splice(i,1),t.AmountOfSubscribers--,o.AmountOfSubscribers--,r.utilityService.safeDigest(r.$scope)}}(e)},i.prototype.saveUsersToGroup=function(){var n=this.campaigns.filter(function(e){return e.IsSelected});if(this.noCampaignSelected=!n||n.length<=0,this.noCampaignSelected)this.utilityService.safeDigest(this.$scope);else{for(var o=[],r=(this.newUsers.forEach(function(e){e={Email:e.Email,Name:e.Name};o.push(e)}),this),e=0;e<n.length;e++)!function(t){for(var e=r.shownCampaigns.find(function(e){return e.CampaignId==n[t].Id}),i=0;i<o.length;i++)r.chosenCampaign&&n[t].Id==r.chosenCampaign.Id&&(r.chosenCampaign.Subscribers.add(o[i]),r.chosenCampaign.AmountOfSubscribers++),n[t].Subscribers.add(o[i]),n[t].AmountOfSubscribers++,e&&e.AmountOfSubscribers++;r.newsletterService.addSubscriberToCampaign(n[t].Id,o,2),n[t].IsSelected=!1}(e);this.newUsers=[],this.showImportSubscribers=!1}},i.prototype.addOrResetSubscriberOnCampaign=function(e,t){var i=this.getSubscriberOnCampaign(e,t);i?(i.Deleted=null,i.DeleteReason=null):e.Subscribers.add(t),e.AmountOfSubscribers=e.AmountOfSubscribers+1},i.prototype.addSubscriber=function(e,t){var i,n,o=this;null!=e&&""!=e&&null!=t&&""!=t&&(i=this.campaigns.filter(function(e){return e.IsSelected}),this.noCampaignSelected=!i||i.length<=0,this.noCampaignSelected?this.utilityService.safeDigest(this.$scope):(this.showAddSubscriber=!1,n={Email:t,Name:e},i.forEach(function(t){o.newsletterService.addSubscriberToCampaign(t.Id,[n],3).then(function(e){e&&(i.any(function(e){return e.Id==o.chosenCampaign.Id})&&o.addOrResetSubscriberOnCampaign(o.chosenCampaign,n),o.addOrResetSubscriberOnCampaign(t,n)),t.IsSelected=!1})})))},i.prototype.deleteCampaign=function(t){var i=this,e={campaign:this.campaigns.find(function(e){return e.Id==t})};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/CampaignConfirmDelete.modal.html",n.Components.Modals.CampaignConfirmDeleteController,e,"lg").result.then(function(e){e&&i.newsletterService.deleteCampaign(t)})},i.prototype.removeFromList=function(e,t){t.splice(e,1)},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.removeSubscriber=function(t){var e;null!=t&&""!=t&&((e=this.chosenCampaign.Subscribers.firstOrDefault(function(e){return e.Email==t})).DeleteReason="Removed by personnel",e.Deleted=!0,this.newsletterService.removeSubscriberFromCampaign(this.chosenCampaign.Id,{Email:t,DeleteReason:"Removed by personnel"}))},i.prototype.clone=function(e){this.newsletterService.cloneNewsletter(e)},i.prototype.showPreview=function(t){var i=this;this.newsletterService.getNewsletter(t.Id).then(function(){var e;i.chosenNewsletter&&i.chosenNewsletter.Id===t.Id&&(i.newsletterService.setView("archiveView"),e={title:i.chosenNewsletter.Name,html:i.chosenNewsletter.HtmlContent},i.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterPreview.modal.html",n.Components.Modals.NewsletterPreviewController,e,"lg"))})},i.prototype.showImportGuide=function(){this.modalService.createModal("/App/CrossPortal/Newsletter/NewsletterImportGuide.modal.html",n.Components.Modals.NewsletterImportGuideController,{},"lg")},i.prototype.createNewsletter=function(){this.enableTemplateCreationFeatureFlag?this.openCreateNewsletterModal():(this.newsletterService.setCreationType("Newsletter"),this.newsletterService.setView("editContent"))},i.prototype.openCreateNewsletterModal=function(){this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/CreateNewsletter.modal.html",n.Components.Modals.CreateNewsletterController,{},"lg")},i.prototype.getSubscriptionType=function(e){switch(e){case"SignedUp":return"Tilmeldt via hjemmeside";case"Imported":return"Importeret fra excel";case"AddedByAdmin":return"Tilføjet af administrator";case"UserProvider":return"Tilføjet via rollevælgeren";case"ConsentGroup":return"Tilføjet via samtykke";default:return e}},i.prototype.createCampaign=function(e){e&&(this.showCreateCampaign=!1,this.newsletterService.createCampaign({Id:0,Name:e}))},i.prototype.setView=function(e){this.newsletterService.setView(e)},i.prototype.cancel=function(e){e?this.newsletterService.setView(e):this.newsletterService.setView("archiveView")},i.prototype.getCampaign=function(t){this.isSubscriberSearch?this.chosenCampaign=this.shownCampaigns.find(function(e){return e.Id==t}):this.newsletterService.getCampaign(t)},i.prototype.getNewsletter=function(e){this.newsletterService.setCreationType("Newsletter"),this.newsletterService.getNewsletter(e)},i.prototype.showNewsletter=function(){this.newsletterService.getNewsletter(this.chosenNewsletter.Id),this.setView("editContent")},i.prototype.showArchieve=function(){this.setView("archiveView")},i.prototype.search=function(e){this.searchText=e.toLowerCase(),this.filterNewsletters()},i.prototype.cancelImportSubscriber=function(){this.showImportSubscribers=!this.showImportSubscribers,this.showAddSubscriber=!1,this.showCreateCampaign=!1,this.newUsers=[],this.campaigns.forEach(function(e){return e.IsSelected=!1})},i.prototype.setDates=function(e){this.fromDate=e.from,this.toDate=e.to,this.filterNewsletters()},i.prototype.filterNewsletters=function(){var t=this;if(this.allNewsletters){var e=angular.copy(this.allNewsletters);switch(this.fromDate&&this.toDate&&(e=e.filter(function(e){return!e.SentDateTime||(new Date(e.SentDateTime).isAfter(t.fromDate)||new Date(e.SentDateTime).isSameDay(t.fromDate))&&(new Date(e.SentDateTime).isBefore(t.toDate)||new Date(e.SentDateTime).isSameDay(t.toDate))})),this.searchText&&""!==this.searchText&&(e=e.filter(function(e){return e.SubTitle&&e.SubTitle.toLowerCase().includes(t.searchText)||e.Name&&e.Name.toLowerCase().includes(t.searchText)})),this.selectedState){case"sent":e=e.filter(function(e){return"Done"==e.SendState});break;case"planned":e=e.filter(function(e){return"Planned"==e.SendState});break;case"draft":e=e.filter(function(e){return!e.SendState})}e=e.orderBy(function(e){return e.SentDateTime}),this.newsletters=e.reverse(),this.setView("archiveView")}},i.prototype.filterBy=function(e){this.selectedState=e,this.filterNewsletters()},i.prototype.importFromExcel=function(e){var r=this;this.newUsers=[],this.fileService.convertExcelToJson(e).then(function(e){e=e.replace(/Navn/gi,"Name");for(var t=JSON.parse(e),i=0;i<t.length;i++){var n=t[i][0].Email||t[i][0].email||t[i][0]["E-mail"]||t[i][0]["e-mail"];if((t[i][0].Name||t[i][0].name)&&n)for(var o=0;o<t[i].length;o++)r.newUsers.push({Email:t[i][o].Email||t[i][o].email||t[i][o]["E-mail"]||t[i][o]["e-mail"],Name:t[i][o].Name||t[i][o].name})}})},i.prototype.createTemplate=function(){this.newsletterService.setCreationType("Template"),this.newsletterService.setView("editContent")},i.prototype.editTemplate=function(t){this.newsletterService.setCreationType("Template");var e=this.templates.firstOrDefault(function(e){return e.Id==t});this.newsletterService.chosenNewsletter$.onNext(e),this.newsletterService.setView("editContent")}
1,i.prototype.showTemplatePreview=function(e){e={title:e.Name,html:e.HtmlContent};this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterPreview.modal.html",n.Components.Modals.NewsletterPreviewController,e,"lg")},i.prototype.deleteTemplate=function(t){var i=this;this.modalService.createModal("/App/CrossPortal/Newsletter/Components/Modals/NewsletterConfirmDelete.modal.html",n.Components.Modals.NewsletterConfirmDeleteController,{newsletter:t},"lg").result.then(function(e){e&&i.newsletterService.deleteTemplate(t.Id)})},i.$inject=["$scope","NewsletterService","ModalService","ValidationService","FileService","UtilityService","$sce","FeatureFlagService","RibbonService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Newsletter.component.html",this.bindings={}},app.component("newsletter",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.newsletters=[],this.selectedContentNode$=new Rx.Subject,this.senders$=new Rx.BehaviorSubject([]),this.report$=new Rx.Subject,this.newsletters$=new Rx.Subject,this.templates$=new Rx.BehaviorSubject([]),this.campaigns$=new Rx.BehaviorSubject([]),this.chosenCampaign$=new Rx.BehaviorSubject(null),this.chosenNewsletter$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/Newsletter/",this.currentView$=new Rx.BehaviorSubject("archiveView")}(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),t.prototype.getTemplateToRender=function(e,t){var i=this,n=this.loaderService.setLoader("global","getCampaign"),e=this.incomHttp.get(this.baseurl+"GetTemplateToRender?id="+e+"&userInfo="+t);return e.then(function(e){return i.loaderService.removeLoader(n)}),e},t.prototype.getCampaignSnapshotForNewsletter=function(e){var t=this,i=this.loaderService.setLoader("global","getCampaignSnapshot"),e=this.incomHttp.get(this.baseurl+"GetCampaignSnapshotForNewsletter?id="+e);return e.then(function(e){return t.loaderService.removeLoader(i)}),e},t.prototype.togglConsent=function(e,t){var i=this,n=this.loaderService.setLoader("global","getCampaignSnapshot"),e=this.incomHttp.get(this.baseurl+"TogglConsent?userId="+e+"&consentGroup="+t);return e.then(function(e){return i.loaderService.removeLoader(n)}),e},t.prototype.validateIfUserIsSubscribed=function(e,t){var i=this,e={UserId:e.toString(),ConsentGroup:t},n=this.loaderService.setLoader("global","getCampaign"),t=this.incomHttp.post(this.baseurl+"validateIfUserIsSubscribed",e);return t.then(function(e){return i.loaderService.removeLoader(n)}),t},t.prototype.deleteTemplate=function(t){var i=this,n=this.loaderService.setLoader("global","deleteTemplate");this.incomHttp.get(this.baseurl+"DeleteTemplate?Id="+t).then(function(e){i.templates=i.templates.filter(function(e){return e.Id!=t}),i.templates$.onNext(i.templates),i.loaderService.removeLoader(n)})},t.prototype.setCreationType=function(e){this.creationType=e},t.prototype.uploadFiles=function(e){var t,i=this,n=[];if(0<e.length&&n.addRange(e),0<n.length)return t=this.loaderService.setLoader("global","uploadDocs"),(e=this.incomHttp.postFiles(this.baseurl+"UploadFiles",n)).then(function(e){i.loaderService.removeLoader(t)}),e},t.prototype.getCurrentNewsletters=function(){this.newsletters&&this.newsletters$.onNext(this.newsletters)},t.prototype.downloadExampleFile=function(){return this.incomHttp.get(this.baseurl+"downloadExampleFile")},t.prototype.confirmSubscription=function(e){return this.incomHttp.get(this.baseurl+"ConfirmSubscription?token="+e)},t.prototype.getReceiversForCampaignAndConsent=function(e,t){return this.incomHttp.post(this.baseurl+"GetReceiversForCampaignAndConsent",{CampaignIds:e,ConsentGroupIds:t})},t.prototype.subscriberSearch=function(e){var t=this,i=this.loaderService.setLoader("global","getCampaign"),n=(e=e.trim().toLowerCase(),new Rx.Subject);return this.incomHttp.get(this.baseurl+"SubscriberSearch?searchString="+e).then(function(e){n.onNext(e),t.loaderService.removeLoader(i)}),n},t.prototype.getCampaign=function(e){var t=this,i=this.loaderService.setLoader("global","getCampaign");this.incomHttp.get(this.baseurl+"GetCampaign/"+e).then(function(e){e&&(t.chosenCampaign$.onNext(e),t.chosenNewsletter$.onNext(null)),t.loaderService.removeLoader(i)})},t.prototype.getCommunicationConsents=function(){var t=this,i=this.loaderService.setLoader("global","getCommunicationConsents"),e=this.incomHttp.get(this.baseurl+"GetCommunicationConsents");return e.then(function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getNewsletter=function(e){var t=this,i=this.loaderService.setLoader("global","getNewsletter"),e=this.incomHttp.get(this.baseurl+"GetNewsletter/"
1+e);return e.then(function(e){e&&t.chosenNewsletter$.onNext(e),t.loaderService.removeLoader(i)}),e},t.prototype.setDefaultSender=function(e){this.incomHttp.post(this.baseurl+"SetDefaultSender",{Email:e})},t.prototype.addSender=function(e){this.incomHttp.post(this.baseurl+"AddSender",e)},t.prototype.removeSender=function(e){this.incomHttp.post(this.baseurl+"RemoveSender",e)},t.prototype.addSubscriberToCampaign=function(e,t,i,n){var o=this,r=(void 0===n&&(n=!0),this.loaderService.setLoader("global","addSubscriberToCampaign")),e=this.incomHttp.post(this.baseurl+"AddSubscriberToCampaign?id="+e+"&subscriptionType="+i+"&sendFeedback="+n,t);return e.then(function(){o.loaderService.removeLoader(r)}),e},t.prototype.unsubscripeFromCampaign=function(e,t,i){var n=this,o=this.loaderService.setLoader("global","removeSubscriberFromCampaign"),e=this.incomHttp.post(this.baseurl+"UnsubscribeFromCampaign?id="+e+"&subscriptionType="+i,t);return e.then(function(){n.loaderService.removeLoader(o)}),e},t.prototype.removeSubscriberFromCampaign=function(e,t){var i=this,n=this.loaderService.setLoader("global","removeSubscriberFromCampaign"),e=this.incomHttp.post(this.baseurl+"RemoveSubscriberFromCampaign?id="+e,t);return e.then(function(){i.loaderService.removeLoader(n)}),e},t.prototype.deleteNewsletter=function(t){var i=this,n=this.loaderService.setLoader("global","deleteNewsletter");this.incomHttp.post(this.baseurl+"DeleteNewsletter?id="+t,{}).then(function(e){i.newsletters=i.newsletters.filter(function(e){return e.Id!=t}),i.newsletters$.onNext(i.newsletters),i.loaderService.removeLoader(n)})},t.prototype.deleteCampaign=function(i){var n=this,o=this.loaderService.setLoader("global","deleteCampaign"),e=this.incomHttp.get(this.baseurl+"DeleteCampaign?Id="+i);return e.then(function(e){var t;e&&((e=n.campaigns$.getValue())&&(t=e.firstOrDefault(function(e){return e.Id==i}),t=e.indexOf(t),e.splice(t,1),n.campaigns$.onNext(e)),t=n.chosenCampaign$.getValue())&&t.Id==i&&n.chosenCampaign$.onNext(null),n.loaderService.removeLoader(o)}),e},t.prototype.createCampaign=function(e){var i=this,n=this.loaderService.setLoader("global","createCampaign");this.incomHttp.post(this.baseurl+"CreateCampaign",e).then(function(e){var t=i.campaigns$.getValue();t.add(e),i.campaigns$.onNext(t),i.chosenCampaign$.onNext(e),i.chosenNewsletter$.onNext(null),i.loaderService.removeLoader(n)})},t.prototype.sendTestMail=function(e,t){var i=this,n=this.loaderService.setLoader("global","createNewsletter");this.incomHttp.post(this.baseurl+"SendTestNewsletter?testMail="+e,t).then(function(e){i.loaderService.removeLoader(n)})},t.prototype.createNewsletter=function(e,i,n){var o=this,r=this.loaderService.setLoader("global","createNewsletter");this.incomHttp.post(this.baseurl+"CreateNewsletter?shouldSend="+e+"&type="+this.creationType,i).then(function(t){var e;i.Id=t.Id,"Newsletter"==o.creationType&&((e=o.newsletters.firstOrDefault(function(e){return e.Id==t.Id}))&&-1<o.newsletters.indexOf(e)&&o.newsletters.remove(e),o.newsletters.add(t),n)&&(o.newsletters$.onNext(o.newsletters),o.setView("archiveView")),"Template"==o.creationType&&((e=o.templates.firstOrDefault(function(e){return e.Id==t.Id}))&&-1<o.templates.indexOf(e)&&o.templates.remove(e),o.templates.add(t),n)&&(o.templates$.onNext(o.templates),o.setView("campaignConfigurations")),o.loaderService.removeLoader(r)})},t.prototype.setView=function(e){"archiveView"==e&&this.chosenNewsletter$.onNext(null),this.currentView$.onNext(e)},t.prototype.getContentNodeChildren=function(e){var t=this,i=this.loaderService.setLoader("global","fetch-content"),e=this.incomHttp.get(this.baseurl+"GetContentForNewsletter?id="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.prototype.seeReport=function(e){var t=this,i=this.loaderService.setLoader("global","getReportsForNewsletter");this.incomHttp.get(this.baseurl+"GetReportsForNewsletter/"+e).then(function(e){e&&e.Reports&&t.report$.onNext(e.Reports),t.loaderService.removeLoader(i)})},t.prototype.getAllNewsletters=function(){var t=this,i=this.loaderService.setLoader("global","getAllNewsletters");this.incomHttp.get(this.baseurl+"GetAllNewsletters").then(function(e){e&&e.Newsletters&&(t.newsletters=e.Newsletters,t.newsletters$.onNext(t.newsletters)),t.loaderService.removeLoader(i)})},t.prototype.getAllTemplates=function(){var t,i=this;return this.templates||(t=this.loaderService.setLoader("global","getAllTemplates"),this.incomHttp.get(this.baseurl+"GetAllTemplates").then(function(e){i.templates=e.Newsletters,i.templates$.onNext(i.templates),i.loaderService.removeLoader(t)})),this.templates$},t.prototype.getAllCampaigns=function(){var t=this,i=this.loaderService.setLoader("global","getAllCampaigns");this.incomHttp.get(this.baseurl+"GetAllCampaigns/").then(function(e){e&&e.Campaigns&&(0==e.Campaigns.length&&t.createCampaign({Id:0,Name:"Nyhedsgruppe 1"}),t.campaigns$.onNext(e.Campaigns)),t.loaderService.removeLoader(i)})},t.prototype.cloneNewsletter=function(e){var t=this,i=this.loaderService.setLoader("global","cloneNewsletter");e&&this.incomHttp.get(this.baseurl+"CloneNewsletter?Id="+e.Id).then(function(e){e&&(t.newsletters.add(e),t.newsletters$.onNext(t.newsletters),t.chosenNewsletter$.onNext(e),t.setView("editContent")),t.loaderService.removeLoader(i)})},t.prototype.getAllSenders=function(){var t=this,i=this.loaderService.setLoader("global","getAllSenders");this.incomHttp.get(this.baseurl+"GetAllSenders/").then(function(e){e&&t.senders$.onNext(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("NewsletterService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){var n=this;this.$modalInstance=e,this.newsletterService=i,this.newsletterService.downloadExampleFile().then(function(e){return n.downloadUrl=e})}
1e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Components||(e.Components={})).Modals||(e.Modals={}),t.prototype.cancel=function(){this.$modalInstance.dismiss()},t.prototype.submit=function(){this.$modalInstance.close("Success")},t.$inject=["$uibModalInstance","modalData","NewsletterService"],e.NewsletterImportGuideController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.selectedNode$=new Rx.Subject,this.baseurl="/umbraco/api/Newsletter/"}(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),t.prototype.getMediaFile=function(e){var t=this,i=this.loaderService.setLoader("global","fetch-media"),e=this.incomHttp.get(this.baseurl+"GetMediaFile?nodeId="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("NewsletterMediaService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.newsletterService=e}(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),i.prototype.$onInit=function(){var e,t,i,n=this;window.location.hash?(-1<(i=(t=window.location.hash.substring(window.location.hash.indexOf("=")+1).split("="))[0].indexOf("&"))&&(e=t[0].substring(0,i),t[1])&&(i=t[1].indexOf("&"),this.userInfo=t[1].substring(0,i),t[2])&&(this.campaign=t[2]),window.location.hash=""):(e=(t=window.location.search.substring(window.location.search.indexOf("=")+1).split("="))[0],this.userInfo="public"),this.newsletterService.getTemplateToRender(e,this.userInfo).then(function(e){e&&e.HtmlTemplate&&n.renderPreview(e.HtmlTemplate)})},i.prototype.$onDestroy=function(){},i.prototype.renderPreview=function(e){e=e.replace(/<a/gi,"<a target='_blank'"),$(".newsletter-render").html(e)},i.$inject=["NewsletterService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/NewsletterRender.component.html",this.bindings={}},app.component("newsletterRender",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r){var s=this,a=(this.$modalInstance=e,this.loaderService=i,this.pageProvider=n,this.consentService=o,this.newsletterService=r,this.disposables=new Rx.CompositeDisposable,this.loaderService.setLoader("global","getConsentForCampaign"));this.modalData=t,this.pageProvider.getPageByDocumentType("editProfile").then(function(e){s.profilePage=e}),this.disposables.add(this.newsletterService.chosenCampaign$.subscribe(function(e){return s.campaign=e})),this.newsletterService.getCampaign(t.campaignId),this.modalData.consentGroup?this.disposables.add(this.consentService.getConsents().subscribe(function(e){e&&(s.usedConsent=e.find(function(e){return e.ConsentNumber==s.modalData.consentGroup}),s.usedConsent&&(s.acceptedConsent=3==s.usedConsent.ConsentRegistration.GeneralConsent||3==s.usedConsent.ConsentRegistration.EmailConsent,s.acceptedConsent||(1!=s.usedConsent.ConsentRegistration.GeneralConsent&&(s.usedConsent.ConsentRegistration.GeneralConsent=3),1!=s.usedConsent.ConsentRegistration.EmailConsent&&(s.usedConsent.ConsentRegistration.EmailConsent=3),s.consentService.postConsent(s.usedConsent))),s.loaderService.removeLoader(a))})):this.loaderService.removeLoader(a),this.$modalInstance.closed.then(function(e){s.disposables.dispose()})}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).NewsletterSubscribe||(e.NewsletterSubscribe={})).Modals||(e.Modals={}),t.$inject=["$uibModalInstance","modalData","LoaderService","PageProviderService","ConsentsService","NewsletterService"],e.NewsletterSubscriptionCompleteController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(){}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).NewsletterSubscribe||(e.NewsletterSubscribe={})).Modals||(e.Modals={}),t.$inject=["$uibModalInstance","modalData","LoaderService"],e.NewsletterSubscriptionRequireLoginController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.newsletterService=e,this.disposables=new Rx.CompositeDisposable}(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),i.prototype.$onInit=function(){var e=window.location.hash.substring(window.location.hash.indexOf("=")+1).split("=")[0];e&&this.subscribe(e),window.location.hash=""},i.prototype.subscribe=function(e){var t=this;this.newsletterService.confirmSubscription(e).then(function(e){e?t.campaingName=e:t.subscriptionFailed=!0})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["NewsletterService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/NewsletterSubscribe/NewsletterConfirmSubscription.component.html",this.bindings={}},app.component("newsletterConfirmSubscription",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.newsletterService=e,this.userService=t,this.featureFlagService=i,this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).NewsletterSubscribe||(e.NewsletterSubscribe={}),i.prototype.$onInit=function(){var t=this;this.userService.currentUser$.subscribe(function(e){e&&(t.user=e,t.name=e.Name,t.email=e.Email)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.subscribeToNewsLetter=function(t){var e,i,n=this;null!=this.name&&""!=this.name&&null!=this.email&&""!=this.email&&(e={Email:this.email,Name:this.name},i=this.featureFlagService.newsletter.enablePotentialSubscriberMail?1:0,this.newsletterService.addSubscriberToCampaign(1,[e],i).then(function(e){e&&(n.name="",n.email="",t)&&(t.$setPristine(),t.$setUntouched(),t.$rollbackViewValue())}))},i.$inject=["NewsletterService","UserService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/NewsletterSubscribe/NewsletterSubscribe.component.html",this.bindings={}},app.component("newsletterSubscribe",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.newsletterService=e,this.disposables=new Rx.CompositeDisposable,this.doneLoading=!1}(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={}),i.prototype.$onInit=function(){var e=window.location.hash.substring(window.location.hash.indexOf("=")+1).split("="),t=e[0].indexOf("&");switch(this.campaignSnapshot=e[0].substring(0,t),t=e[1].indexOf("&"),this.userinfo=e[1].substring(0,t),this.subscriptionType=e[2],window.location.hash="",parseInt(this.subscriptionType)){case 1:case 2:case 3:this.requireLogin=!1;break;case 4:case 5:this.requireLogin=!0}this.doneLoading=!0},i.prototype.unsubscribe=function(){var t=this,e=this.userinfo.includes("@")?{Email:this.userinfo,DeleteReason:"Unsubscribed"}:{InteressentNo:this.userinfo,DeleteReason:"Unsubscribed"};this.newsletterService.unsubscripeFromCampaign(this.campaignSnapshot,e,parseInt(this.subscriptionType)).then(function(e){e&&(t.success=e)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["NewsletterService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/NewsletterUnsubscribe.component.html",this.bindings={}},app.component("newsletterUnsubscribe",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s){this.scope=e,this.newsletterService=t,this.egUserProviderStateService=i,this.$q=n,this.$sce=o,this.utilityService=r,this.featureFlagService=s,this.disposables=new Rx.CompositeDisposable,this.newsletterDefer=this.$q.defer(),this.reportsDefer=this.$q.defer(),this.camapignDefer=this.$q.defer(),this.snapshotDefer=this.$q.defer(),this.roleGroups=[],this.currentGraph=-1,this.currentGraphViews=9}(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Report||(e.Report={}),i.prototype.$onInit=function(){var a=this;this.enableSeeingReports=this.featureFlagService.newsletter.enableSeeingReports,this.longDate=this.utilityService.longDateTimeFormat,this.$q.all([this.newsletterDefer.promise,this.reportsDefer.promise]).then(function(e){a.setActive();for(var t=a.reports.filter(function(e){return"click"==e.EventType||"open"==e.EventType}),i=0;i<t.length;i++)for(var n=t[i],o=0;o<a.roleGroups.length;o++){var r=a.roleGroups[o].Users.find(function(e){return e.Email==n.Email||e.InteressentNo==n.Email});r&&r.Events.push(n)}}),this.$q.all([this.snapshotDefer.promise,this.camapignDefer.promise,this.reportsDefer.promise]).then(function(e){if(a.campaignSnapshot.CampaignSubscribers){a.actualCampaigns=[];for(var r,t=0;t<a.campaignSnapshot.CampaignSubscribers.length;t++)!function(e){var t=a.campaignSnapshot.CampaignSubscribers[e],i=t.Item2;if(i.Events=[],t){for(var e=a.actualCampaigns.find(function(e){return e.Campaign.Id==t.Item1}),n=(e||(e={Campaign:a.campaigns.find(function(e){return e.Id==t.Item1}),Subscribers:[]},a.actualCampaigns.push(e)),a.reports.filter(function(e){return e.Email==i.Email||e.Email==i.InteressentNo})),o=0;o<n.length;o++)r=n[o],i.Events.push(r);e.Subscribers.push(i)}}(t)}}),this.disposables.add(this.newsletterService.report$.subscribe(function(e){a.reports=e,a.reportTypes=e.map(function(e){return e.EventType}).distinct(),a.reportsDefer.resolve(!0)})),this.disposables.add(this.newsletterService.campaigns$.subscribe(function(e){e&&(a.campaigns=e,a.camapignDefer.resolve(!0))})),this.disposables.add(this.newsletterService.chosenNewsletter$.subscribe(function(r){if(r&&(
1a.chosenNewsletter=r,a.getLinksForNewsletter(r.HtmlContent),a.newsletterService.getCampaignSnapshotForNewsletter(r.Id).then(function(e){a.campaignSnapshot=e,a.snapshotDefer.resolve(!0)}),a.sanitizedNewsletterHtml=a.$sce.trustAsHtml(angular.copy(r.HtmlContent).replace(/<a/gi,"<a target='_blank'")),r.Configuration)&&r.Configuration.Permissions&&r.Configuration.UserProviderSubscribers){for(var s={Companies:[],Departments:[],Participants:[],RoleGroups:[],Roles:[]},i=0;i<r.Configuration.Permissions.CompanyOrDepartments.length;i++)!function(){var t,e=r.Configuration.Permissions.CompanyOrDepartments[i];-1==e.Value.indexOf("_")?s.Companies.push({Name:e.Name,CompanyNo:parseInt(e.Value),Selected:!0}):(t=e.Value.split("_"),s.Companies.any(function(e){return e.Selected&&e.CompanyNo==parseInt(t[0])})&&s.Departments.push({Name:e.Name,CompanyNo:parseInt(t[0]),DepartmentNo:parseInt(t[1]),Selected:!0}))}();for(i=0;i<r.Configuration.Permissions.RoleGroups.length;i++){var e=r.Configuration.Permissions.RoleGroups[i];-1==e.Value.indexOf("-")?a.roleGroups.push({Id:parseInt(e.Value),Name:e.Name,Users:[]}):s.Roles.push(JSON.parse(e.Value))}a.egUserProviderStateService.getPersons(s.Departments,s.Roles).then(function(e){for(var t=e.Users.filter(function(t){return r.Configuration.UserProviderSubscribers.any(function(e){return e.InteressentNo==t.InteressentNo.toString()})}),i=0;i<t.length;i++)for(var n=t[i],o=0;o<n.RoleInformation.length;o++)!function(e){var t=n.RoleInformation[e],i=s.Roles.find(function(e){return e.GroupName==t.GroupName&&e.RoleArt==t.RoleArt&&t.RoleType==e.RoleType});a.roleGroups.find(function(e){return i.RoleGroupId.contains(e.Id)}).Users.push({Email:n.Email,InteressentNo:n.InteressentNo,Name:n.Name,Events:[],CompanyDepartment:t.CompanyNo+"_"+t.DepartmentNo})}(o);a.newsletterDefer.resolve(!0)})}}))},i.prototype.setGraph=function(){switch(this.currentGraph++,this.currentGraph%this.currentGraphViews){case 0:var e=this.getEventsOfEvents("open","delivered",!0);this.graphData={title:"Visninger",data:[{label:"Unikke visninger",value:e},{label:"Udsendelser der ikke er set",value:100-e}]};break;case 1:e=this.getEventsOfEvents("click","delivered",!0);this.graphData={title:"Klik",data:[{label:"Unikke klik",value:e},{label:"Udsendelser der ikke er klikkede i",value:100-e}]};break;case 2:e=this.getEvents("openInBrowser",!0)/this.getEvents("open",!0)*100;this.graphData={title:"Visninger i browser",data:[{label:"Unikke visninger i browser",value:e},{label:"Udsendelser der ikke er set i browser",value:100-e}]};break;case 3:e=this.getEvents("delivered",!0)/this.campaignSnapshot.TotalAmountOfSubscribers*100;this.graphData={title:"Modtaget",data:[{label:"Modtaget",value:e},{label:"Ikke modtaget",value:100-e}]};break;case 4:e=this.getEvents("bounce",!0)/this.campaignSnapshot.TotalAmountOfSubscribers*100;this.graphData={title:"Bounced",data:[{label:"Bounced",value:e},{label:"Ikke bounced",value:100-e}]};break;case 5:e=this.getDeviceEvents("desktop")/this.getEvents("open",!0)*100;this.graphData={title:"Desktop visning",data:[{label:"Desktop visninger",value:e},{label:"Ikke set på desktop",value:100-e}]};break;case 6:e=this.getDeviceEvents("smartphone")/this.getEvents("open",!0)*100;this.graphData={title:"Enheder",data:[{label:"Smartphone visninger",value:e},{label:"Ikke set på smartphone",value:100-e}]};break;case 7:e=this.getEvents("spamreport",!0)/this.getEvents("open",!0)*100;this.graphData={title:"Spam",data:[{label:"Spam",value:e},{label:"Ikke markeret som spam",value:100-e}]};break;case 8:e=this.getUnsubscribeEvents()/this.getEvents("open",!0)*100;this.graphData={title:"Afmeldinger",data:[{label:"Afmeldt",value:e},{label:"Ikke afmeldt",value:100-e}]}}this.utilityService.safeDigest(this.scope)},i.prototype.setActive=function(){var e=this;setInterval(function(){return e.setGraph()},5e3)},i.prototype.getEventsOfEvents=function(t,i,e){var n=this.reports.filter(function(e){return e.EventType==i}),o=null;switch(t){case"open":if(0===(l=this.reports.filter(function(e){return e.EventType==t})).length)return"";o=e?l.map(function(e){return e.Email}).distinct().length/n.length*100:l.length/n.length*100;break;case"click":if(0===(l=this.reports.filter(function(e){return e.EventType==t})).length)return"";for(var r=[],s=0;s<l.length;s++){var a=l[s];e&&r.any(function(e){return e.Email==a.Email&&e.Information==a.Information})||r.push(a)}o=e?n.map(function(e){return e.Email}).distinct().length/r.map(function(e){return e.Information}).distinct().length*100:r.distinct().length/n.map(function(e){return e.Email}).distinct().length*100;break;case"smartphone":var l=n.filter(function(e){return-1<e.Information.indexOf("Android")||-1<e.Information.indexOf("iPhone")}),o=e?l.map(function(e){return e.Email}).distinct().length/n.map(function(e){return e.Email}).distinct().length*100:l.length/n.length*100;break;
1case"desktop":l=n.filter(function(e){return-1==e.Information.indexOf("Android")&&-1==e.Information.indexOf("iPhone")});o=e?l.map(function(e){return e.Email}).distinct().length/n.map(function(e){return e.Email}).distinct().length*100:l.length/n.length*100}return NaN==o||null==o?"":o.toFixed(2)},i.prototype.getLinksForNewsletter=function(e){for(var t,i,n=[],o=0;-1!=o;)-1<(o=e.indexOf('href="',o))&&(o+=6,t=e.indexOf('"',o),0===(i=e.substring(o,t)).length&&!i.trim()||-1!=n.indexOf(i)||n.push(i),o=t+1);this.links=n},i.prototype.getName=function(e){switch(e){case"processed":return"Behandlet";case"delivered":return"Afleveret";case"open":return"Ã
bent";case"click":return"Interaction";case"deferred":return"Udskudt";case"dropped":return"Mislykket";case"spam report":return"Rapportert som spam";case"bounce":return"Fejl under afsendelse";default:return e}},i.prototype.getAmount=function(t){return this.reports.filter(function(e){return e.EventType==t}).length},i.prototype.getEvents=function(t,e){var i=null;switch(t){case"open":var n=this.reports.filter(function(e){return e.EventType==t}),i=(e?n.map(function(e){return e.Email}).distinct():n).length;break;case"click":n=this.reports.filter(function(e){return e.EventType==t});i=(e?n.map(function(e){return e.Email&&e.Information}).distinct():n).length;break;case"bounce":n=this.reports.filter(function(e){return e.EventType==t});i=(e?n.map(function(e){return e.Email}).distinct():n).length;break;case"delivered":n=this.reports.filter(function(e){return e.EventType==t});i=(e?n.map(function(e){return e.Email}).distinct():n).length;break;case"openInBrowser":n=this.reports.filter(function(e){return"click"==e.EventType&&-1<e.Information.indexOf("nyhedsbrev-visning")});i=(e?n.map(function(e){return e.Email}).distinct():n).length;break;case"spamreport":n=this.reports.filter(function(e){return e.EventType==t});i=(e?n.map(function(e){return e.Email}).distinct():n).length}return NaN==i||null==i?"":i},i.prototype.getUnsubscribeEvents=function(){return this.reports.filter(function(e){return"click"==e.EventType&&-1<e.Information.indexOf("nyhedsbrev-afmeldelse")}).map(function(e){return e.Email}).distinct().length},i.prototype.getClickEventsForLink=function(t,e){var i=this.reports.filter(function(e){return"click"==e.EventType&&e.Information==t});return(e?i.map(function(e){return e.Email}).distinct():i).length},i.prototype.getDeviceEvents=function(e){switch(e){case"smartphone":return this.reports.filter(function(e){return"open"==e.EventType&&(-1<e.Information.indexOf("Android")||-1<e.Information.indexOf("iPhone"))}).map(function(e){return e.Email}).distinct().length;case"desktop":return this.reports.filter(function(e){return"open"==e.EventType&&-1==e.Information.indexOf("Android")&&-1==e.Information.indexOf("iPhone")}).map(function(e){return e.Email}).distinct().length}},i.prototype.getEventsForGroup=function(e,t){return"open"==t?e.filter(function(e){return 0!=e.Events.filter(function(e){return e.EventType==t}).length}).length:"click"==t?e.map(function(e){return e.Events.filter(function(e){return e.EventType==t}).length}).reduce(function(e,t){return e+t}):void 0},i.prototype.getEventsForUser=function(e,t){return e.Events.filter(function(e){return e.EventType==t}).length},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["$scope","NewsletterService","EgUserProviderStateService","$q","$sce","UtilityService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Report/NewsletterReport.component.html",this.bindings={showNewsletter:"&",showArchieve:"&"}},app.component("newsletterReport",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.d3=e,this.disposables=new Rx.CompositeDisposable,this.options={chart:{margin:{top:0,right:0,bottom:0,left:0},type:"pieChart",x:function(e){return e.label},y:function(e){return e.value},title:!0,showLabels:!0,showTooltipPercent:!0,deepWatchData:!1,growOnHover:!0,showLegend:!1,labelType:"percent",noData:"Ingen statistikker fundet."}}}(e=(e=e.CrossPortal||(e.CrossPortal={})).Newsletter||(e.Newsletter={})).Report||(e.Report={}),i.prototype.$onInit=function(){var t=this;this.$onChanges(null),$(window).resize(function(e){t.options.chart.height=$(window).height()/2}),this.options.chart.height=$(window).height()/2},i.prototype.$onChanges=function(e){e&&e.title&&(this.hasTitle?$("#chart
1-title").text(e.title.currentValue):($("#graph").append('<div id="chart-title" "class="chart-title">'+e.title.currentValue+"</div>"),this.hasTitle=!0))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["d3"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Newsletter/Report/NewsletterReportGraph.component.html",this.bindings={data:"<",title:"<"}},app.component("newsletterReportGraph",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i){this.profileService=e,this.utilityService=t,this.featureFlagService=i,this.disposables=new Rx.CompositeDisposable}(t=(t=e.CrossPortal||(e.CrossPortal={})).Profile||(t.Profile={})).LoginTypes||(t.LoginTypes={}),n.prototype.$onInit=function(){var t=this;this.enableNemId=this.featureFlagService.loginFeatureFlags.enableNemId,this.enableNemId&&(this.updateHasLoginTypes(),this.utilityService.getParameterByName("usedNemId")&&(this.attachNemId=!0,this.loggedInUsingNemId=!0),this.disposables.add(this.profileService.openSection$.subscribe(function(e){t.selectedArea=e})))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.updateHasLoginTypes=function(){var t=this;this.profileService.hasEnteredCPR().then(function(e){null!=e&&1==(t.hasEnteredCPR=e)&&(t.disposables.add(t.profileService.hasNemId().subscribe(function(e){t.hasNemId=e})),t.disposables.add(t.profileService.hasFacebook().subscribe(function(e){t.hasFacebook=e})))})},n.prototype.detachNemId=function(){this.profileService.detachLoginType(e.Core.CrossPortal.Login.OtherLogin.OtherLoginTypes.FacebookLogin),this.hasNemId=!1},n.prototype.detachFacebook=function(){this.profileService.detachLoginType(e.Core.CrossPortal.Login.OtherLogin.OtherLoginTypes.FacebookLogin),this.hasFacebook=!1},n.prototype.loggedInWithNemId=function(e){var t=this;"ok"==e.Result&&this.profileService.attachNemId(e).then(function(e){t.loggedInUsingNemId=e})},n.prototype.doValidateAndAttachNemIdToUser=function(){var t=this;this.cprToAttach&&this.profileService.validateCprAndNemId(this.cprToAttach).then(function(e){t.hasNemId=e})},n.prototype.toggleVisibleArea=function(e){this.selectedArea===e?this.profileService.openSection$.onNext(null):this.profileService.openSection$.onNext(e)},n.$inject=["ProfileService","UtilityService","FeatureFlagService"],i=n,t=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Profile/LoginTypes/LoginTypes.component.html",this.bindings={}},app.component("loginTypes",new t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o){this.$modalInstance=e,this.contactFormService=i,this.validationService=n,this.locationService=o,this.disposables=new Rx.CompositeDisposable,this.contactForm={User:{Address:{}}},this.maxTotalSize=10240,this.contactPerson=t.contactPerson}e=(e=(e=e.CrossPortal||(e.CrossPortal={})).ProjectPresentation||(e.ProjectPresentation={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){var t=this;this.disposables.add(this.contactFormService.currentUserInfo().subscribe(function(e){!e||(t.contactForm.User=e).Address.Country||(t.contactForm.User.Address.Country="Danmark")})),this.disposables.add(this.locationService.getCountries().subscribe(function(e){e&&(t.countries=e)})),this.emailRegex=this.validationService.getEmailRegex()},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close({form:this.contactForm,files:this.uploadedFiles})},t.prototype.getAddress=function(e){e&&(this.contactForm.User.Address.ZipCode=e.ZipCode,this.contactForm.User.Address.City=e.City,this.contactForm.User.Address.Street=e.Street,this.contactForm.User.Address.Location=e.Location,this.contactForm.User.Address.LocalTown=e.LocalTown)},t.$inject=["$uibModalInstance","modalData","ContactFormService","ValidationService","LocationService"],e.ContactFormController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){var i=this;this.utilityService=e,this.scope=t,this.activeFocusColor="#007dc5",this.completedFocusColor="#007dc5",this.disposables=new Rx.CompositeDisposable,this.today=(new Date).getTime(),this.showArrows=!1,this.horizontalPhases=!1,this.isActive=function(e){return e.isActive},this.hasBegun=function(e){return new Date(e.StartDate).getTime()<i.today},this.shouldScrollTo=function(e){return e.prop("offsetWidth")<e.prop("scrollWidth")},this.activePhasesIn=function(e){return e.Phases.filter(i.isActive)},this.getElementFrom=function(e){return document.getElementById("phase-"+e.Id.toString())}}(e=(e=e.CrossPortal||(e.CrossPortal={})).ProjectPresentation||(e.ProjectPresentation={})).PlanPresentation||(e.PlanPresentation={}),i.prototype.$onInit=function(){var t=this;this.activeFocusColor=getComputedStyle(document.documentElement).getPropertyValue("--primaryColor"),this.completedFocusColor=getComputedStyle(document.documentElement).getPropertyValue("--primaryColor"),setTimeout(function(){t.plan.Phases.filter(t.hasBegun).forEac
1h(function(e){return t.calculateTimePassedFor(e)})},300),this.dateFormat=this.utilityService.monthYearFormat,this.horizontalPhases&&this.utilityService.isMobileView$.subscribe(function(){setTimeout(function(){t.activePhasesIn(t.plan).forEach(function(e){return t.scrollToIfOverflown(e)})},300)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.calculateTimePassedFor=function(e){var t=new Date(e.EndDate).getTime(),i=new Date(e.StartDate).getTime(),t=(this.today-i)/(t-i)*100;t<100&&(e.isActive=!0,this.scrollToIfOverflown(e)),this.setTimePassedStyling(e,t)},i.prototype.scrollToPosition=function(e){var t=angular.element(e).prop("offsetLeft");this.containerElement=e.closest(".phases-container"),this.containerElement.scrollLeft=t-100},i.prototype.scrollSideWays=function(e){angular.element(this.containerElement).animate({scrollLeft:"+="+e},200)},i.prototype.scrollToIfOverflown=function(e){this.horizontalPhases&&(e=this.getElementFrom(e))&&((this.showArrows=this.shouldScrollTo(angular.element(e.closest(".phases-container"))))&&this.scrollToPosition(e.closest(".phase-picker")),this.scope.$apply())},i.prototype.setTimePassedStyling=function(e,t){var i=this.getElementFrom(e),e=(i&&i.previousElementSibling.classList.add("is-started"),e.isActive?this.activeFocusColor:this.completedFocusColor),n=this.horizontalPhases?"90deg":"180deg";i.style.borderImage="linear-gradient("+n+", "+e+" "+t.toString()+"%, #ebebeb 0%) 1 / 3 / 0 stretch"},i.prototype.setFocusPhase=function(e){this.focusPhase==e?this.focusPhase=void 0:this.focusPhase=e},i.$inject=["UtilityService","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/ProjectPresentation/PlanPresentation/PlanPresentation.component.html",this.bindings={plan:"<",horizontalPhases:"<"}},app.component("planPresentation",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i,n,o,r,s,a){this.pageContentService=e,this.stateService=t,this.owlCarouselOptionsService=i,this.utilityService=n,this.modalService=o,this.windowService=r,this.fileService=s,this.definitionHelper=a,this.getAllFilesIn=function(e){return[].concat.apply([],e.map(function(e){return e.ProjectFiles}))},this.disposables=new Rx.CompositeDisposable,this.selectedCategory=null,this.displayedNews=3,this.displayedFiles=8,this.sort="-UploadedDate"}e=e.CrossPortal||(e.CrossPortal={}),n=e.ProjectPresentation||(e.ProjectPresentation={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){t.currentPage=e,t.disposables.add(t.stateService.getProject(e.Id).subscribe(function(e){e&&(t.project=e,t.project.FileCategories.forEach(function(t){t.ProjectFiles.forEach(function(e){return e.Category=t.Category})}),e={Id:-1,Category:"Alle kategorier",ProjectFiles:t.getAllFilesIn(t.project.FileCategories)},t.project.FileCategories.unshift(e),t.selectedCategory=e,t.project.News&&t.project.News.NewsItems&&0<t.project.News.NewsItems.length&&(t.latestNewsItem=t.project.News.NewsItems.orderByManyDescending([function(e){return e.ReleaseDate},function(e){return e.Id}
1])[0]),setTimeout(function(){var e=$(".project-banner");0<e.length&&(t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions(),t.options.dots=!0,t.options.lazyLoad=!0,t.options.animateOut="fadeOut",t.options.animateIn="fadeIn",t.options.nav=!1,t.options.dotsContainer=".department-owl-dots")),e.owlCarousel(t.options)},200),t.focusPlan=t.project.Plans[0])})),t.disposables.add(t.utilityService.isMobileView$.subscribe(function(e){e&&1==e?(t.displayedNews=1,t.displayedFiles=3):(t.displayedNews=3,t.displayedFiles=8)}))})),this.dateFormat=this.utilityService.shortDateFormat},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.goToNews=function(e){e&&this.windowService.history.pushState({},"",e.Url)},i.prototype.getDefinitionSeperator=function(e){return this.definitionHelper.getDefinitionSeperator(e)},i.prototype.setSort=function(e){switch(this.sort){case"FileName":this.sort="-"+e;break;case"-FileName":this.sort=e;break;case"UploadedDate":this.sort="-"+e;break;case"-UploadedDate":this.sort=e;break;case"Category":this.sort="-"+e;break;case"-Category":this.sort=e}},i.prototype.setFocusPlan=function(e){this.focusPlan=e},i.prototype.openContactForm=function(t){var i=this;this.modalService.createModal("/App/CrossPortal/ProjectPresentation/Modal/ContactForm.modal.html",n.Modal.ContactFormController,{contactPerson:t},"lg").result.then(function(e){e&&(e.form.ProjectName=i.currentPage.TitleName,e.form.ReceiverMail=t.Email,i.stateService.sendMail(e.form,e.files))})},i.prototype.getIcon=function(e){return this.fileService.getFileIconClass(e.Extension)},i.prototype.downloadFile=function(e){this.stateService.downloadFile(e)},i.$inject=["PageContentService","ProjectPresentationStateService","OwlCarouselOptionsService","UtilityService","ModalService","$window","FileService","ImageDefinitionHelperService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/ProjectPresentation/ProjectPresentation.component.html",this.bindings={}},app.component("projectPresentation",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.baseurl="/umbraco/api/ProjectPresentation/"}(e=e.CrossPortal||(e.CrossPortal={})).ProjectPresentation||(e.ProjectPresentation={}),t.prototype.getProject=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getProject"),e=this.incomHttp.get(this.baseurl+"GetProject?id="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.prototype.getFile=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getFile"),e=this.incomHttp.get(this.baseurl+"GetFile/"+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.prototype.sendMail=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","sendContactForm"),e=this.fileService.postWithFiles(e,this.baseurl+"SendContactFormular/",t);return e.then(function(){i.loaderService.removeLoader(n)}),e},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("ProjectPresentationHttpService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.httpService=e,this.fileService=t,this.project$=new Rx.Subject,this.projects$=new Rx.Subject}(e=e.CrossPortal||(e.CrossPortal={})).ProjectPresentation||(e.ProjectPresentation={}),t.prototype.downloadFile=function(e){var t=this;this.httpService.getFile(e).then(function(e){t.fileService.downloadFile([e])})},t.prototype.getProject=function(e){var t=this;return this.httpService.getProject(e).then(function(e){return t.project$.onNext(e)}),this.project$},t.prototype.sendMail=function(e,t){this.httpService.sendMail(e,t)},t.$inject=["ProjectPresentationHttpService","FileService"],app.service("ProjectPresentationStateService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/Settings/"}(e=e.CrossPortal||(e.CrossPortal={})).Settings||(e.Settings={}),t.prototype.getConfiguration=function(e){var t=new Rx.Subject;return this.incomHttp.get(this.baseUrl+"GetConfiguration/?configurationAlias="+e).then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("SettingsService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.myEventPortalEvents$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/EventPortalCalendar/"}(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Dashboard||(e.Dashboard={}),t.prototype.getEvents=function(e){var t,i=this;return this.myEventPortalEvents||(t=this.loaderService.setLoader("boardcalendar","getlatestcalendarevents"),this.incomHttp.get("".concat(this.baseurl,"GetCurrentEventPortalEvents?amount=").concat(e)).then(function(e){i.myEventPortalEvents=e,i.myEventPortalEvents$.onNext(i.myEventPortalEvents),i.loaderService.removeLoader(t)})),this.myEventPortalEvents$},t.$inject=["incomHttpService","LoaderService"],app.service("EventPortalCalendarService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.catalogService=e,this.disposables=new Rx.CompositeDisposable,this.catalogContents=[],this.showWidget=!1}(e=e.General||(e.General={})).Catalog||(e.Catalog={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.catalogService.isOpen$.subscribe(function(e){t.isShowing=e})),this.disposables.add(this.catalogService.catalogPages$.subscribe(function(e){t.catalogContents=e,t.showWidget=0<e.length}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.toggleCatalog=function(){this.catalogService.toggleCatalog()},i.$inject=["CatalogService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Catalog/CatalogWidget.component.html",this.bindings={}},app.component("catalogWidget",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.catalogService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable,this.currentDepartmentAdded=!1}
1(e=e.General||(e.General={})).Catalog||(e.Catalog={}),i.prototype.$onInit=function(){var t=this;this.catalogService.catalogPages$.subscribe(function(e){t.catalogPages=e,t.department&&t.catalogPages?t.currentDepartmentAdded=t.catalogPages.any(function(e){return e.CompanyId===t.department.Company.Id&&e.DepartmentId===t.department.Id}):t.currentDepartmentAdded=!1}),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){t.currentPage=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.toggleDepartment=function(){this.currentDepartmentAdded?this.removeDepartment():this.addDepartment()},i.prototype.addDepartment=function(){this.catalogService.addTenancySearchPage(this.currentPage.Id,this.department.Company.Id,this.department.Id)},i.prototype.removeDepartment=function(){var t=this,e=this.catalogPages.find(function(e){return e.CompanyId===t.department.Company.Id&&e.DepartmentId===t.department.Id});e&&this.catalogService.removePage(e)},i.$inject=["CatalogService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Catalog/DepartmentCatalog.component.html",this.bindings={department:"<"}},app.component("departmentCatalog",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modalInstance=e}e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){},t.prototype.submit=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance"],e.ProjectPageController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.utilityService=e,this.datepickerOptionsFrom={},this.datepickerOptionsTo={},this.icons=["file-contract","business-time","file-edit","check-circle","clipboard-list","hard-hat","digging","tools","ruler-combined","leaf"]}(e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={})).Edit||(e.Edit={}),i.prototype.$onInit=function(){this.fromDate=new Date(this.phase.StartDate),this.toDate=new Date(this.phase.EndDate),this.dateFormat=this.utilityService.longDateFormat,this.setDatePickerOptions(),this.phase.Icon||(this.phase.Icon=this.icons.firstOrDefault())},i.prototype.$onDestroy=function(){},i.prototype.updateIcon=function(e){this.phase.Icon=e},i.prototype.updateDates=function(){this.phase.StartDate=this.fromDate,this.phase.EndDate=this.toDate},i.prototype.setDatePickerOptions=function(){this.datepickerOptionsTo.minDate=this.fromDate,this.fromDate.getTime()>this.toDate.getTime()&&(this.toDate=this.fromDate),this.updateDates()},i.$inject=["UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/ProjectPresentationAdministration/Edit/EditPhase.component.html",this.bindings={phase:"<"}},app.component("editPhase",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={})).Edit||(e.Edit={}),i.prototype.$onInit=function(){this.EditPlanPhaseSortOptions={axis:"y",cursor:"move",handle:".drag-handle"}},i.prototype.$onDestroy=function(){},i.prototype.addPhase=function(){this.plan.Phases||(this.plan.Phases=[]);var e={StartDate:new Date,EndDate:new Date};this.plan.Phases.push(e)},i.prototype.removePhase=function(e){e>this.plan.Phases.length||this.plan.Phases.splice(e,1)},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/ProjectPresentationAdministration/Edit/EditPlan.component.html",this.bindings={plan:"<"}},app.component("editPlan",new e)}(BoligExtra=BoligExtra||{}),!function(e){var o,t;function i(e,t,i,n,o,r,s){this.projectService=e,this.pageContentService=t,this.frontEndEditUtilityService=i,this.windowService=n,this.fileService=o,this.modalService=r,this.frontEndEditServiceInstance=s,this.uploadedFiles=[],this.editingPlan=!1,this.creatingPlan=!1,this.project={},this.disposables=new Rx.CompositeDisposable,this.creatingNews=!1}e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),(o=e.ProjectPresentationAdministration||(e.ProjectPresentationAdministration={})).Edit||(o.Edit={}),i.prototype.$onInit=function(){var i=this;this.frontEndEditService=this.frontEndEditServiceInstance.getInstance(),this.project.ProjectFileCategories.forEac
1h(function(e){var t=e.ProjectFiles.map(function(e){e.FileData=[];var t={name:e.FileName+"."+e.Extension,lastModified:Number(new Date),size:10},t=i.fileService.toUploadedFile(t);return t.existingId=e.Id,t});i.uploadedFiles.push({category:e.Category,files:t})}),this.disposables.add(this.frontEndEditUtilityService.savedPage$.subscribe(function(e){null!=e&&i.updateEditedProject(e.Id).then(function(){!1===i.creatingNews?location.reload():(i.isEditing.isNewPage=!0,i.isEditing.sortPages=!1,i.isEditing.deletePages=!1,i.isEditing.isEditing=!0,i.pageContentService.togglePageEditing(i.isEditing))})})),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(i.isEditing=e)})),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){i.currentPage=e})),this.disposables.add(this.projectService.getFaqItems().subscribe(function(e){e&&i.setSelectedFaq(e.FaqItems)}))},i.prototype.removeFromArray=function(t,i,e,n){this.modalService.createModal("/App/General/FrontEndEdit/ProjectPresentationAdministration/Edit/Modals/RemovalConfirmation.modal.html",o.Modals.RemovalConfirmationController,{typeOfItem:e,itemBeingRemoved:n},"md").result.then(function(e){!0===e&&t.splice(i,1)})},i.prototype.removeNewsItem=function(t,i){var n=this;this.modalService.createModal("/App/General/FrontEndEdit/ProjectPresentationAdministration/Edit/Modals/RemovalConfirmation.modal.html",o.Modals.RemovalConfirmationController,{typeOfItem:"nyheden: ",itemBeingRemoved:t.Title},"md").result.then(function(e){!0===e&&(n.project.NewsItems.splice(i,1),n.frontEndEditUtilityService.deletePage(t.Id))})},i.prototype.setSelectedFaq=function(e){var t;this.project.FaqItems.any(function(e){return e.selected})||(t=this.project.FaqItems.map(function(e){return e.Udi}),this.project.FaqItems=e,this.project.FaqItems.forEach(function(e){-1!==t.indexOf(e.Udi)&&(e.selected=!0)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.updateEditedProject=function(e){var e={Title:this.project.Title,Description:this.project.Description,ContactPersonIds:this.project.ContactPersonIds,ExistingImageIds:this.project.Images.map(function(e){return e.NodeId}).filter(function(e){return e}),Id:this.project.Id,Plans:this.project.Plans,ImagesSessionId:null,NodeId:e,FaqItems:this.project.FaqItems.filter(function(e){return e.selected}),NewsItems:this.project.NewsItems,FileCategories:this.getExistingFiles()},t=this.getNewFiles();return this.projectService.updateProject(e,t)},i.prototype.createSubPage=function(){var t=this;this.modalService.createModal("/App/General/FrontEndEdit/ProjectPresentationAdministration/Edit/Modals/AddNews.modal.html",o.Modals.AddNewsController,null,"md").result.then(function(e){!0===e&&t.saveCallback&&(t.creatingNews=!0,t.saveCallback({publish:!0}))})},i.prototype.addPlan=function(){this.project.Plans||(this.project.Plans=[]),this.project.Plans.push({})},i.prototype.removeImage=function(t){this.project.Images=this.project.Images.filter(function(e){if(e.NodeId!=t)return e})},i.prototype.editContactId=function(e,t){this.project.ContactPersonIds.length>t&&(this.project.ContactPersonIds[t]=e)},i.prototype.goToNews=function(e){e&&this.windowService.history.pushState({},"",e.Url)},i.prototype.editPlan=function(e){e&&(this.planToEdit=e,this.editingPlan=!0)},i.prototype.getExistingFiles=function(){var e,i=this,t=(e=this.uploadedFiles,[].concat.apply([],e.map(function(e){return e.files.filter(function(e){return!!e.existingId}).map(function(e){return e.existingId})})));return this.project.ProjectFileCategories.forEach(function(e){return e.ProjectFiles=e.ProjectFiles.filter(function(e){return-1!==t.indexOf(e.Id)})}),this.project.ProjectFileCategories.filter(function(t){return i.uploadedFiles.some(function(e){return e.category==t.Category})})},i.prototype.getNewFiles=function(){return[].concat.apply([],this.uploadedFiles.filter(function(e){return e.files.some(function(e){return!e.existingId})}).map(function(t){return t.files.map(function(e){return e.Category=t.category,e})}))},i.$inject=["ProjectPresentationAdministrationStateService","PageContentService","FrontEndEditUtilityService","$window","FileService","ModalService","FrontEndEditService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/ProjectPresentationAdministration/Edit/EditProject.component.html",this.bindings={project:"<",saveCallback:"&"}},app.component("editProject",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close(!0)},t.prototype.cancel=function(){this.$modalInstance.close(!1)},t.$inject=["$uibModalInstance","modalData"],e.AddNewsController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.type=this.modalData.typeOfItem,this.itemToRemove=this.modalData.itemBeingRemoved},t.prototype.submit=function(){this.$modalInstance.close(!0)},t.$inject=["$uibModalInstance","modalData"],e.RemovalConfirmationController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.$scope=e,this.fileService=t,this.uploadedFiles=[],this.disposables=new Rx.CompositeDisposable,this.disableFocusImage=!1}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).ProjectPresentation||(e.ProjectPresentation={})).ImageUpload||(e.ImageUpload={}),i.prototype.$onInit=function(){var i=this;this.ngModelCtrl.$render=function(){i.ngModel=i.ngModelCtrl.$viewValue,!i.focusImage&&i.ngModel&&i.ngModel.any()&&(i.focusImage=i.ngModel[0])},this.$scope.$watchCollection(function(){return i.uploadedFiles},function(e){e&&0<e.length&&(i.ngModel=i.ngModel||[],e=e.map(function(e){var t=i.fileService.toUploadedFile(e);return i.previewFile(e,t),t}),i.ngModel.addRange(e),i.focusImage||(i.focusImage=i.ngModel[0]),angular.element("#imageUpload").val(null),i.uploadedFiles=[])})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.setFocusImage=function(e){this.focusImage=e},i.prototype.previewFile=function(e,t){var i=this,n=new FileReader;n.addEventListener("load",function(){t.src=n.result,i.$scope.$apply()},!1),e&&n.readAsDataURL(e)},i.prototype.removeImage=function(e){e<this.ngModel.length&&(this.ngModel.indexOf(this.focusImage)==e?(this.ngModel.splice(e,1),this.focusImage=this.ngModel.firstOrDefault()):this.ngModel.splice(e,1))},i.$inject=["$scope","FileService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/ProjectPresentationAdministration/ImageUpload/ImageUpload.component.html",this.require={ngModelCtrl:"^ngModel"},this.bindings={disableFocusImage:"<"}},app.component("imageUpload",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.projectStateService=e,this.feedbackService=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={})).News||(e.News={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.disposables.add(t.projectStateService.getProjectNewsOptions(e.Id).subscribe(function(e){e&&(t.newsOptions=e)}))}),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.editPage=function(){this.newsOptions.CanEdit&&(this.isEditing.isNewPage=!1,this.isEditing.sortPages=!1,this.isEditing.deletePages=!1,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing))},i.prototype.deletePage=function(){var t=this;this.newsOptions.CanDelete&&this.feedbackService.showConfirmbox({Headline:"Er du sikker?",Message:"<p>Er du sikker på at du vil slette nyheden?</p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){t.projectStateService.deleteNewsItem(t.currentPage.Id)},function(e){})},i.$inject=["ProjectPresentationAdministrationStateService","FeedbackService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/ProjectPresentationAdministration/News/ProjectNewsOptions.component.html",this.bindings={}},app.component("projectNewsOptions",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.projectService=e,this.frontEndEditUtilityService=t,this.windowService=i,this.creatingProject=!1,this.editingProject=!1,this.uploadedFiles=[],this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={}),i.prototype.$onInit=function(){var t=this;this.nodeId?this.disposables.add(this.projectService.getProject(this.nodeId).subscribe(function(e){t.projectToEdit=e,t.editingProject=!0})):this.disposables.add(this.frontEndEditUtilityService.savedPage$.subscribe(function(e){null!=e?(t.createProject(e.Id),t.windowService.history.pushState({},"",e.Url)):location.reload()}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.createProject=function(e){this.projectService.createProject({NodeId:e},[])},i.prototype.useTemplate=function(e){e&&((e=JSON.parse(JSON.stringify(e))).Id=0,e.Title=null,this.projectService.activeProjectCreation.project=e,this.projectService.activeProjectCreation.files=[],this.creatingProject=!0)},i.prototype.save=function(e){this.saveCallback&&this.saveCallback({publish:e})},i.prototype.deleteProject=function(e){e&&this.projectService.deleteProject(e.Id)},i.$inject=["ProjectPresentationAdministrationStateService","FrontEndEditUtilityService","$window"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/ProjectPresentationAdministration/ProjectAdministration.component.html",this.bindings={nodeId:"<",saveCallback:"&"}},app.component("projectPresentationManagement",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/ProjectPresentationAdministration/"}(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={}),t.prototype.getFaqItems=function(){return this.incomHttp.get(this.baseurl+"GetFaqItems/")},t.prototype.getProject=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getProject"),e=this.incomHttp.get(this.baseurl+"GetProject/"+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.prototype.getProjects=function(){var e=this,t=this.loaderService.setLoader("contentSection","getProjects"),i=this.incomHttp.get(this.baseurl+"GetProjects");return i.then(function(){e.loaderService.removeLoader(t)}),i},t.prototype.createProject=function(e,t){return this.postWithFiles(this.baseurl+"CreateProject/",e,t)},t.prototype.updateProject=function(e,t){return this.postWithFiles(this.baseurl+"UpdateProject/",e,t)},t.prototype.deleteProject=function(e){return this.incomHttp.get(this.baseurl+"DeleteProject?id="+e)},t.prototype.deleteNewsItem=function(e){var t=this,i=this.loaderService.setLoader("contentSection","deleteNewsItem");this.incomHttp.delete(this.baseurl+"DeleteNewsItem/"+e).then(function(e){return t.loaderService.removeLoader(i)})},t.prototype.getProjectNewsOptions=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getNewsOptions"),e=this.incomHttp.get(this.baseurl+"GetNewsOptions?id="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.prototype.postWithFiles=function(e,t,i){var n=new FormData,t=(n.append("project",JSON.stringify(t)),i.forEac
1h(function(e,t){n.append("file".concat(t),e.file),n.append("fileCat".concat(t),e.Category)}),{transformRequest:angular.identity,headers:{"Content-Type":void 0}});return this.incomHttp.post(e,n,t)},t.$inject=["incomHttpService","LoaderService"],app.service("ProjectPresentationAdministrationHttpService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.httpService=e,this.activeProjectCreation={project:null,files:[]},this.activeProjectEdit=null,this.faqItems$=new Rx.BehaviorSubject(null),this.projectNewsOptions$=new Rx.Subject,this.project$=new Rx.Subject,this.projects$=new Rx.Subject}(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ProjectPresentationAdministration||(e.ProjectPresentationAdministration={}),t.prototype.getFaqItems=function(){var t=this;return this.faqItems$.getValue()||this.httpService.getFaqItems().then(function(e){e&&t.faqItems$.onNext(e)}),this.faqItems$},t.prototype.getProject=function(e){var t=this;return this.httpService.getProject(e).then(function(e){t.project$.onNext(e)}),this.project$},t.prototype.getProjects=function(){var t=this;return this.httpService.getProjects().then(function(e){t.projects$.onNext(e)}),this.projects$},t.prototype.createProject=function(e,t){return e.ContactPersonIds||(e.ContactPersonIds=[]),this.httpService.createProject(e,t)},t.prototype.updateProject=function(e,t){return this.handleResponse(this.httpService.updateProject(e,t))},t.prototype.deleteProject=function(e){this.handleResponse(this.httpService.deleteProject(e))},t.prototype.deleteNewsItem=function(e){this.httpService.deleteNewsItem(e)},t.prototype.getProjectNewsOptions=function(e){var t=this;return this.httpService.getProjectNewsOptions(e).then(function(e){return t.projectNewsOptions$.onNext(e)}),this.projectNewsOptions$},t.prototype.handleResponse=function(e){var t=this;return e.then(function(e){e&&t.getProjects()}),e},t.$inject=["ProjectPresentationAdministrationHttpService"],app.service("ProjectPresentationAdministrationStateService",t)}(BoligExtra=BoligExtra||{}),!function(r){var e,t;function i(e,t,i,n,o){var r=this;this.availableTenanciesPageStateService=e,this.pageProviderService=t,this.modalService=i,this.featureFlagService=n,this.$timeout=o,this.fillMissingNumbers=function(e,n){var o=[];return e.forEach(function(e,t,i){o.push(e),i.length!==t+1&&(i=i[t+1],o.addRange(r.getNumbersBetween(e,i,n)))}),o},this.getNumbersBetween=function(e,t,i){for(var n=[],o=e+i;o<t;)n.push(o),o+=i;return n},this.itemsPerPage=3,this.numberOfPages=1,this.currentPage=1,this.disposables=new Rx.CompositeDisposable,this.roundToNearest=function(e,t,i){return i?Math.floor(e/t)*t:Math.ceil(e/t)*t},this.matchesTenancyTypeOption=function(e){return!r.selectedTenancyTypeOption||e.TenancyType===r.selectedTenancyTypeOption},this.matchesRoomOption=function(e){return!r.selectedRoomOption||e.Rooms===r.selectedRoomOption},this.matchesRentOption=function(e){return!r.selectedRentOption||e.RentNet<=r.selectedRentOption},this.tenancyTypeOptions=[],this.maxRentOptions=[],this.roomOptions=[]}(e=(e=r.General||(r.General={})).Frontpage||(e.Frontpage={})).AvailableTenanciesWithFiltering||(e.AvailableTenanciesWithFiltering={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.availableTenanciesPageStateService.getAllAvailableTenancies().subscribe(function(e){e&&(t.allAvailableTenancies=e,t.setupFilteringOptions(),t.numberOfAvailableTenancies=t.allAvailableTenancies.length,t.updateList(),t.setExtraPropertiesOnTenancies(),t.selectedTenancy=t.allAvailableTenancies[0],t.selectedTenancyImages=t.selectedTenancy.displayImages)})),this.pageProviderService.getPageByDocumentType("availableTenancies").then(function(e){e&&(t.availableTenancyPageUrl=e.Url)})},i.prototype.setExtraPropertiesOnTenancies=function(){for(var e=0;e<this.allAvailableTenancies.length;e++)this.allAvailableTenancies[e]&&(this.allAvailableTenancies[e].displayImage=this.getDisplayedImageFor(this.allAvailableTenancies[e]),this.allAvailableTenancies[e].displayImages=this.getDisplayedImagesFor(this.allAvailableTenancies[e]),this.allAvailableTenancies[e].googlemarkers=this.getGoogleMapsMarker(this.allAvailableTenancies[e]),this.allAvailableTenancies[e].MoveInDate=new Date(this.allAvailableTenancies[e].MoveInDate))},i.prototype.getGoogleMapsMarker=function(e){var t,i=[];return e.Address&&e.Address.Coordinates&&(t=e.Address.Street+" "+e.Address.Location,t=(t=e.Address.LocalTown?t+", "+e.Address.LocalTown:t)+", "+e.Address.ZipCode+" "+e.Address.City,i.push({Lat:e.Address.Coordinates.Lat,Lng:e.Address.Coordinates.Lng,InfoBox:{Headline:e.Address.Street+" "+(e.Address.Location||""),Description:t}})),i},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.openRequestModal=function(e){var e={companyId:e.CompanyId,departmentId:e.DepartmentId,tenancyId:e.TenancyId,address:e.Address,moveInDate:e.MoveInDate},t=new r.Utility.Modal.ModalSettings;t.template="/App/Housing/Tenancy/Modals/RequestAvailableTenancy.Modal.html",t.data=e,t.controller=r.Housing.Tenancy.Modals.RequestAvailableTenancyController,t.backdrop=!0,this.modalService.createModalWithSettings(t)},i.prototype.setupFilteringOptions=function(){var e,t=this;this.allAvailableTenancies&&(e=this.allAvailableTenancies.map(function(e){return e.TenancyType}).distinct().orderBy(function(e){return e}),this.tenancyTypeOptions=e,e=this.allAvailableTenancies.map(function(e){return e.Rooms}).distinct().orderBy(function(e){return e}),this.roomOptions=this.fillMissingNumbers(e,1),e=this.allAvailableTenancies.map(function(e){return t.roundToNearest(e.RentNet,500,!1)}).distinct().orderBy(function(e){return e}),this.maxRentOptions=this.fillMissingNumbers(e,500))},i.prototype.updateList=function(){var t=this;this.displayTenancies=this.allAvailableTenancies.filter(function(e){return t.matchesTenancyTypeOption(e)&&t.matchesRoomOption(e)&&t.matchesRentOption(e)}),this.numberOfPages=Math.ceil(this.displayTenancies.length/this.itemsPerPage),this.currentPage=1,0==this.displayTenancies.length?this.selectedTenancy=null:(null==this.selectedTenancy&&0<this.displayTenancies.length&&(this.selectedTenancy=this.displayTenancies[0]),this.displayTenancies.some(function(e){return e.CompanyId==t.selectedTenancy.CompanyId&&e.DepartmentId==t.selectedTenancy.DepartmentId&&e.TenancyId==t.selectedTenancy.TenancyId})||(this.selectedTenancy=this.displayTenancies[0]),this.selectedTenancyImages=[],this.$timeout(function(){t.selectedTenancyImages=t.displayTenancies[0].displayImages}))},i.prototype.getDisplayedImageFor=function(e){if(e){var t=function(e){return e.DepartmentImages&&0<e.DepartmentImages.length?e.DepartmentImages[0]:null},i=function(e){return e.TenancyImages&&0<e.TenancyImages.length?e.TenancyImages[0]:null},n=e,o=e;switch(this.featureFlagService.availableTenancies.imageSource){case r.Utility.FeatureFlag.AvailableTenancyImageSource.DepartmentImages:return 0<o.DepartmentImages.length?o.DepartmentImages[0]:t(n);case r.Utility.FeatureFlag.AvailableTenancyImageSource.TenancyImages:return 0<o.TenancyImages.length?o.TenancyImages[0]:i(n);case r.Utility.FeatureFlag.AvailableTenancyImageSource.DepartmentImagesFallback:return 0<o.TenancyImages.length||0<o.DepartmentImages.length?(0<o.TenancyImages.length?o.TenancyImages:o.DepartmentImages)[0]:(n.TenancyImages&&n.TenancyImages.firstOrDefault()?i:t)(n);default:return null}}},i.prototype.getDisplayedImagesFor=function(e){if(e){var t=function(e){return e.DepartmentImages&&0<e.DepartmentImages.length?e.DepartmentImages:null},i=function(e){return e.TenancyImages&&0<e.TenancyImages.length?e.TenancyImages:null},n=e,o=e;switch(this.featureFlagService.availableTenancies.imageSource){case r.Utility.FeatureFlag.AvailableTenancyImageSource.DepartmentImages:return 0<o.DepartmentImages.length?o.DepartmentImages:t(n);case r.Utility.FeatureFlag.AvailableTenancyImageSource.TenancyImages:return 0<o.TenancyImages.length?o.TenancyImages:i(n);case r.Utility.FeatureFlag.AvailableTenancyImageSource.DepartmentImagesFallback:return 0<o.TenancyImages.length||0<o.DepartmentImages.length?0<o.TenancyImages.length?o.TenancyImages:o.DepartmentImages:(n.TenancyImages&&n.TenancyImages.firstOrDefault()?i:t)(n);default:return null}}},i.prototype.selectTenancy=function(e){var t=this;this.selectedTenancy=e,this.selectedTenancyImages=[],this.$timeout(function(){t.selectedTenancyImages=e.displayImages})},i.prototype.goToPage=function(e){e<1?this.currentPage=1:this.numberOfPages<e?this.currentPage=this.numberOfPages:this.currentPage=e},i.$inject=["AvailableTenanciesPageStateService","PageProviderService","ModalService","FeatureFlagService","$timeout"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Frontpage/AvailableTenanciesWithFiltering/AvailableTenanciesWithFiltering.component.html",this.bindings={}},app.component("availableTenanciesWithFiltering",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s,a,l){this.$element=e,this.scope=t,this.$window=i,this.$sce=n,this.pageProviderService=o,this.tenancySearchService=r,this.$timeout=s,this.smoothScroll=a,this.storageService=l,this.disposables=new Rx.CompositeDisposable,this.showRoleSelector=!1,this.selectedRoleId=1,this.selectedRoleMenuItemIndex=-1,this.allRoles=[],this.shouldShowEditorBox=!1,this.shouldShowLoginBox=!1,this.shouldShowTenancySearchBox=!1}
1(e=(e=(e=e.General||(e.General={})).Frontpage||(e.Frontpage={})).Banner||(e.Banner={})).RoleShortcutsBanner||(e.RoleShortcutsBanner={}),i.prototype.$onInit=function(){var t=this,i=this,e=($(document).bind("click",function(e){0<i.$element.find(".role-selector").find(e.target).length||i.scope.$apply(function(){i.showRoleSelector=!1})}),this.tenancySearchService.loadSearchCriterias(!1,!0),this.disposables.add(this.tenancySearchService.searchCriteria$.subscribe(function(e){e&&(t.searchCriterias=angular.copy(e))})),this.setupSelectableRoles(),this.$window.localStorage.getItem("bannerSelectedRoleId"));e&&(this.selectedRoleId=parseInt(e,10)),this.selectedRole=this.allRoles.firstOrDefault(function(e){return e.id==t.selectedRoleId}),this.pageProviderService.getPageByDocumentType("tenancySearch").then(function(e){return t.tenancySearchPage=e}),this.hasDoneInitialBannerSelection=this.storageService.getBannerInitialSelection()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getShortcutUrl=function(e){return null==e||e.IsEditor||0==e.LinkHasAccess||null==this.tenancySearchPage||e.LinkUrl==this.tenancySearchPage.Url?"javascript:void(0)":e.LinkUrl},i.prototype.toggleShowRoleSelector=function(){this.showRoleSelector=!this.showRoleSelector},i.prototype.setupSelectableRoles=function(){this.allRoles.push({id:1,description:"Jeg er boligsøgende"}),this.allRoles.push({id:2,description:"Jeg er beboer"}),this.allRoles.push({id:3,description:"Jeg søger information"})},i.prototype.selectRole=function(e){var t=this;this.showRoleSelector=!1,this.selectedRoleId=e,this.selectedRoleMenuItemIndex=-1,this.selectedRole=this.allRoles.firstOrDefault(function(e){return e.id==t.selectedRoleId}),this.$window.localStorage.setItem("bannerSelectedRoleId",e+""),this.storageService.setBannerInitialSelection(),this.hasDoneInitialBannerSelection=!0},i.prototype.selectRoleShortcut=function(e,t){var i;this.selectedRoleMenuItemIndex==t?this.closeShortcutBoxes():(this.selectedRoleMenuItemIndex=t,!e.IsEditor&&e.LinkHasAccess&&e.LinkUrl!=this.tenancySearchPage.Url||(this.shouldShowEditorBox=!1,this.shouldShowTenancySearchBox=!1,this.shouldShowLoginBox=!1,e.IsEditor?(this.shouldShowEditorBox=!0,this.editorBoxHtml=this.$sce.trustAsHtml(e.EditorHtml)):e.LinkUrl==this.tenancySearchPage.Url?(this.shouldShowTenancySearchBox=!0,i=this.scope,this.$timeout(function(){i.$broadcast("rzSliderForceRender")}),t=this.$element.find(".tenancy-search-box"),this.scrollToElement(t)):(this.shouldShowLoginBox=!0,this.navigateNodeName=e.LinkName,this.navigateNodeIdAfterLogin=e.LinkNodeId,t=this.$element.find(".navigate-login-box"),this.scrollToElement(t))))},i.prototype.scrollToElement=function(t){var i=this;this.$timeout(function(){var e=t.offset().top+t.outerHeight();$(window).scrollTop()+$(window).innerHeight()<e&&i.smoothScroll(t[0],{offset:80})})},i.prototype.closeShortcutBoxes=function(){this.selectedRoleMenuItemIndex=-1,this.shouldShowEditorBox=!1,this.shouldShowLoginBox=!1,this.shouldShowTenancySearchBox=!1},i.prototype.getSelectedRoleBackgroundImageUrl=function(){switch(this.selectedRoleId){case 1:return this.banner.MemberBackgroundImageUrl;case 2:return this.banner.TenantBackgroundImageUrl;case 3:return this.banner.SeekingInformationBackgroundImageUrl;default:return""}},i.prototype.getTenancySearchPageUrlWithParams=function(){return null==this.searchCriterias?this.tenancySearchPage.Url:this.tenancySearchPage.Url+"#"+this.tenancySearchService.getSearchHash(this.searchCriterias)},i.$inject=["$element","$scope","$window","$sce","PageProviderService","TenancySearchService","$timeout","smoothScroll","StorageService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Frontpage/Banner/RoleShortcutsBanner/RoleShortcutsBanner.component.html",this.bindings={banner:"<"}},app.component("roleShortcutsBanner",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.pageProviderService=e,this.pageContentService=t,this.faqService=i,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).Frontpage||(e.Frontpage={})).Faq||(e.Faq={})).PickedFaqList||(e.PickedFaqList={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.disposables.add(t.faqService.getFaqItems(e.Id).subscribe(function(e){t.faqInfoBoxes=e.FaqItems}))}),this.pageProviderService.getPageByDocumentType("faqOverview").then(function(e){e&&(t.faqPageUrl=e.Url)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageProviderService","PageContentService","CmsFaqService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Frontpage/Faq/PickedFaqList/FaqBox.component.html",this.bindings={}},app.component("faqBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.pageProviderService=e,this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Frontpage||(e.Frontpage={})).FrontpageDoubleInfobox||(e.FrontpageDoubleInfobox={}),i.prototype.$onInit=function(){var t=this;this.pageProviderService.getPageByDocumentType("availableTenancies").then(function(e){return t.availableTenanciesPage=e})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageProviderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Frontpage/FrontpageDoubleInfobox/FrontpageDoubleInfobox.component.html",this.bindings={infoBoxes:"<"}},app.component("frontpageDoubleInfobox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.owlCarouselOptionsService=e,this.siteMenuStateService=t,this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Frontpage||(e.Frontpage={})).InfoSlider||(e.InfoSlider={}),i.prototype.$onInit=function(){var t=this;null!=this.infoSlider&&null!=this.infoSlider.InfoSliderEntries&&0<this.infoSlider.InfoSliderEntries.length&&(setTimeout(function(){var e=$
1(".info-slider .owl-carousel");0<e.length&&(t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions(),t.options.navContainer=".owl-nav",t.options.dotsContainer=".owl-dots")),e.owlCarousel(t.options)},150),this.siteMenuStateService.toggleMenuSection$.subscribe(function(e){setTimeout(function(){window.dispatchEvent(new Event("resize"))},500)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["OwlCarouselOptionsService","SiteMenuStateService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Frontpage/InfoSlider/InfoSlider.component.html",this.bindings={infoSlider:"<"}},app.component("infoSlider",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.pageContentService=e,this.infoBoxService=t,this.infoBoxes=[],this.disposables=new Rx.CompositeDisposable,this.themeName={Hvid:"white","Blå":"blue","Mørk blå":"dark-blue"}}(e=e.General||(e.General={})).InfoBox||(e.InfoBox={}),i.prototype.$onInit=function(){var i=this;this.nodeId?this.disposables.add(this.infoBoxService.getInfoBox(this.nodeId).subscribe(function(e){if(e){i.infoBoxes.add(e);for(var t=0;t<i.infoBoxes.length;t++)i.infoBoxes[t].Theme=i.themeName[i.infoBoxes[t].Theme]}})):this.disposables.add(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&i.disposables.add(i.infoBoxService.getInfoBoxes(e.Id).subscribe(function(e){if(e)for(var t=0;t<e.InfoBoxes.length;t++)e.InfoBoxes[t].Theme=i.themeName[e.InfoBoxes[t].Theme],i.infoBoxes.add(e.InfoBoxes[t])}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageContentService","InfoBoxService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/InfoBox.component.html",this.bindings={nodeId:"<"}},app.component("infoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.faqInfoBoxes$=new Rx.BehaviorSubject([]),this.infoBoxes$=new Rx.Subject,this.baseurl="/umbraco/api/InfoBox/"}(e=e.General||(e.General={})).InfoBox||(e.InfoBox={}),t.prototype.getInfoBoxes=function(e){var t=this;return this.incomHttp.get(this.baseurl+"GetInfoBoxesForPage?nodeId="+e).then(function(e){e&&t.infoBoxes$.onNext(e)}),this.infoBoxes$},t.prototype.getInfoBox=function(e){var t=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"GetInfoBoxForId?nodeId="+e).then(function(e){e&&t.onNext(e)}),t},t.prototype.getFaqInfoBoxes=function(e){var t=this;return this.incomHttp.get(this.baseurl+"GetFaqInfoBoxesForPage?nodeId="+e).then(function(e){e&&t.faqInfoBoxes$.onNext(e)}),this.faqInfoBoxes$},t.$inject=["incomHttpService","LoaderService"],app.service("InfoBoxService",t)}(BoligExtra=BoligExtra||{}),!function(n){var e,t;function i(e){this.modalService=e,this.disposables=new Rx.CompositeDisposable,this.mapMarkers=[]}(e=(e=(e=n.General||(n.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={}
1)).AboutCompanyDepartmentInfoBox||(e.AboutCompanyDepartmentInfoBox={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.openMapsModal=function(){for(var e=this,t=0;t<this.infoBox.Addresses.length;t++)this.mapMarkers.add({Lat:this.infoBox.Addresses[t].Coordinates.Lat,Lng:this.infoBox.Addresses[t].Coordinates.Lng});var i=[];i.markers=this.mapMarkers,this.modalService.createModal("/App/Utility/Location/GoogleMaps/Modal/GoogleMaps.modal.html",n.Utility.Location.GoogleMaps.Modal.GoogleMapsModalController,i,"md").result.then(function(){e.mapMarkers=[]})},i.$inject=["ModalService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/AboutCompanyDepartmentInfoBox/AboutCompanyDepartmentInfoBox.component.html",this.bindings={infoBox:"<"}},app.component("aboutCompanyDepartmentInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.pageProviderService=e,this.infoBoxService=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={})).FaqInfoBox||(e.FaqInfoBox={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.disposables.add(t.infoBoxService.getFaqInfoBoxes(e.Id).subscribe(function(e){t.faqInfoBoxes=e}))})),this.pageProviderService.getPageByDocumentType("faqOverview").then(function(e){e&&e.Url&&(t.faqPageUrl=e.Url)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageProviderService","InfoBoxService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/FaqInfoBox/FaqInfoBox.component.html",this.bindings={}},app.component("faqInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.$element=e,this.disposables=new Rx.CompositeDisposable,this.imageSizeFound=!1}(e=(e=(e=e.General||(e.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={})).ImageLinkInfoBox||(e.ImageLinkInfoBox={}),i.prototype.$onInit=function(){this.elementWidth=this.$element.children().width(),this.elementHeight=this.$element.children().height(),this.imageSizeFound=!0},i.$inject=["$element"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/ImageLinkInfoBox/ImageLinkInfoBox.component.html",this.bindings={infoBox:"<"}},app.component("imageLinkInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={})).LocalInfoBox||(e.LocalInfoBox={}),i.prototype.$onInit=function(){this.infoBox.MappedOfficeHours=[],this.infoBox.OfficeHours&&(this.infoBox.MappedOfficeHours.add({weekday:"Mandag:",hours:this.infoBox.OfficeHours[0]}),this.infoBox.MappedOfficeHours.add({weekday:"Tirsdag:",hours:this.infoBox.OfficeHours[1]}),this.infoBox.MappedOfficeHours.add({weekday:"Onsdag:",hours:this.infoBox.OfficeHours[2]}),this.infoBox.MappedOfficeHours.add({weekday:"Torsdag:",hours:this.infoBox.OfficeHours[3]}),this.infoBox.MappedOfficeHours.add({weekday:"Fredag:",hours:this.infoBox.OfficeHours[4]}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/LocalInfoBox/LocalInfoBox.component.html",this.bindings={infoBox:"<"}},app.component("localInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={})).QuoteInfoBox||(e.QuoteInfoBox={}),i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/QuoteInfoBox/QuoteInfoBox.component.html",this.bindings={infoBox:"<"}},app.component("quoteInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.pageProvider=e,this.tenancySearchService=t,this.disposables=new Rx.CompositeDisposable}(e=(e=(e=e.General||(e.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={})).SearchPageRedirectInfoBox||(e.SearchPageRedirectInfoBox={}),i.prototype.$onInit=function(){var t=this;this.tenancySearchService.loadSearchCriterias(),this.pageProvider.getPageByDocumentType("tenancySearch").then(function(e){t.tenancySearchUrl=e.Url}),this.tenancySearchService.defaultSearchCriteria$.subscribe(function(e){t.searchCriterias=e})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.goToSearch=function(){var t=this,e=(this.infoBox.DepartmentId?((e=this.searchCriterias.Companies.firstOrDefault(function(e){return e.Id==t.infoBox.CompanyId})).Selected=!0,e.Departments.firstOrDefault(function(e){return e.Id==t.infoBox.DepartmentId}).Selected=!0):this.searchCriterias.Companies.firstOrDefault(function(e){return e.Id==t.infoBox.CompanyId}).Selected=!0,this.tenancySearchService.setSearchHash(this.searchCriterias));window.location.assign(this.tenancySearchUrl+"#"+e)},i.$inject=["PageProviderService","TenancySearchV2Service"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/SearchPageRedirectInfoBox/SearchPageRedirectInfoBox.component.html",this.bindings={infoBox:"<"}},app.component("searchPageRedirectInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){e=e.General||(e.General={});(e=e.InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={}),e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/SpecialInfoBox.component.html",this.bindings={infoBox:"<"}},app.component("specialInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.$scope=e,this.$compile=t,this.$element=i}(e=(e=(e=e.General||(e.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={})).Templates||(e.Templates={}),i.prototype.$onInit=function(){var e;this.infoBox.BodyText&&0<this.infoBox.BodyText.length&&((e=this.$element.find(".compiled-text-placeholder")).empty(),e.append(this.$compile(this.infoBox.BodyText)(this.$scope.$new(!0))))},i.$inject=["$scope","$compile","$element"],t=i,e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/Templates/TenancySearchBoxViewModel.component.html",this.bindings={infoBox:"<"},this.controller=t},app.component("tenancySearchBox",new e),e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/Templates/PersonInfoBoxViewModel.component.html",this.bindings={infoBox:"<"},this.controller=t},app.component("personInfoBox",new e),e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/Templates/LoginInfoBoxViewModel.component.html",this.bindings={infoBox:"<"},this.controller=t},app.component("loginInfoBox",new e),e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/Templates/DepartmentOfficeInfoBoxViewModel.component.html",this.bindings={infoBox:"<"},this.controller=t},app.component("departmentOfficeInfoBox",new e),e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/Templates/DefaultInfoBoxViewModel.component.html",this.bindings={infoBox:"<"},this.controller=t},app.component("defaultInfoBox",new e),e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/Templates/CompanyOverviewInfoBoxViewModel.component.html",this.bindings={infoBox:"<"},this.controller=t},app.component("companyOverviewInfoBox",new e),e=function(){this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/Templates/AvailableTenancyInfoBoxListViewModel.component.html",this.bindings={infoBox:"<"},this.controller=t}
1,app.component("availableTenancyInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.sce=e,this.$element=t,this.videoService=i,this.disposables=new Rx.CompositeDisposable,this.showCoverImage=!0,this.showVideo=!1,this.imageSizeFound=!1}(e=(e=(e=e.General||(e.General={})).InfoBox||(e.InfoBox={})).SpecialInfoBoxes||(e.SpecialInfoBoxes={})).VideoInfoBox||(e.VideoInfoBox={}),i.prototype.$onInit=function(){var e=this.videoService.parseYoutubeVideoId(this.infoBox.VideoURL);e&&(this.youtubeVideoEmbedUrl=this.sce.trustAsResourceUrl("https://www.youtube.com/embed/"+e+"?&autoplay=1")),this.elementWidth=this.$element.children().width(),this.elementHeight=this.$element.children().height(),this.imageSizeFound=!0},i.prototype.hideCoverAndPlayVideo=function(){this.showCoverImage=!1,this.showVideo=!0},i.$inject=["$sce","$element","VideoService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/InfoBox/SpecialInfoBoxes/VideoInfoBox/VideoInfoBox.component.html",this.bindings={infoBox:"<"}},app.component("videoInfoBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).LinkBox||(e.LinkBox={}),i.prototype.$onInit=function(){if(this.linkBox)switch(this.linkBox.Theme.toLowerCase()){case"blå":this.theme="blue";break;case"orange":this.theme="orange"}},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/LinkBox/LinkBox.component.html",this.bindings={linkBox:"<"}},app.component("linkBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/LinkBoxes/"}(e=e.General||(e.General={})).LinkBox||(e.LinkBox={}),t.prototype.getLinkBoxesFrom=function(e){var t=new Rx.Subject;return this.incomHttp.get("".concat(this.baseurl,"GetLinkBoxesFrom?nodeId=").concat(e)).then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("LinkBoxService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.frontPageLinkBoxesService=e,this.pageContentService=t,this.pageProvider=i,this.utilityService=n,this.disposables=new Rx.CompositeDisposable,this.openAccordion="first"}(e=e.General||(e.General={})).MultiAccordion||(e.MultiAccordion={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&t.disposables.add(t.frontPageLinkBoxesService.getLinkBoxesFrom(e.Id).subscribe(function(e){e&&(t.linkBoxes=e.LinkBoxes)}))})),this.pageProvider.getPageByDocumentType("publicCmsNewsOverview").then(function(e){e&&(t.newsOverviewUrl=e.Url)}),this.newsItems&&(this.newsItem=this.newsItems.firstOrDefault()),this.utilityService.isMobile$.subscribe(function(e){t.truncate=e?100:9999})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.toggleAccordion=function(e){this.openAccordion==e?this.openAccordion="first":this.openAccordion=e},i.$inject=["LinkBoxService","PageContentService","PageProviderService","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/MultiAccordion/MultiAccordion.component.html",this.bindings={newsItems:"<"}},app.component("multiAccordion",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){var r=this;this.stateService=e,this.utilityService=t,this.loaderService=i,this.fillMissingNumbers=function(e,n){var o=[];return e.forEach(function(e,t,i){o.push(e),i.length!==t+1&&(i=i[t+1],o.addRange(r.getNumbersBetween(e,i,n)))}),o},this.getNumbersBetween=function(e,t,i){for(var n=[],o=e+i;o<t;)n.push(o),o+=i;return n},this.roundToNearest=function(e,t,i){return i?Math.floor(e/t)*t:Math.ceil(e/t)*t},this.matchesRoomOption=function(e){return!r.selectedRoomOption||e.Rooms===r.selectedRoomOption},this.matchesSizeOption=function(e){return!r.selectedSizeOption||e.Sqm>=r.selectedSizeOption},this.matchesRentOption=function(e){return!r.selectedRentOption||e.Re
1ntNet<=r.selectedRentOption},this.matchesTenancyTypeOption=function(e){return!r.selectedTenancyTypeOption||e.TenancyType===r.selectedTenancyTypeOption},this.matchesAreaOption=function(e){return!r.selectedAreaOption||e.Region===r.selectedAreaOption},this.showAllButton=!1,this.roomOptions=[],this.minSizeOptions=[],this.maxRentOptions=[],this.tenancyTypeOptions=[],this.areaOptions=[],this.disposables=new Rx.CompositeDisposable,this.currentPage=0,this.entryLimit=15}(e=e.Housing||(e.Housing={})).AvailableTenancies||(e.AvailableTenancies={}),i.prototype.$onInit=function(){var e=this.utilityService.getParameterByName("ten"),t=this.loaderService.setLoader("contentSection","getAvailableTenancies");e?(this.getSingleAvailableTenancy(e,t),this.getAvailableTenancies()):this.getAvailableTenancies(t)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.getSingleAvailableTenancy=function(e,t){var i=this,e=e.split("_");3!==e.length?console.error("Attempted to fetch tenancy with incorrect tenancy string"):(this.disposables.add(this.stateService.getAvailableTenancy(parseInt(e[0]),parseInt(e[1]),parseInt(e[2])).subscribe(function(e){i.displayTenancies=e?[e]:[],t&&i.loaderService.removeLoader(t)})),this.showAllButton=!0)},i.prototype.getAvailableTenancies=function(t){var i=this;this.disposables.add(this.stateService.getAllAvailableTenancies().subscribe(function(e){e&&(i.tenancies=e,i.setupFilteringOptions(),t)&&(i.displayTenancies=i.tenancies,i.loaderService.removeLoader(t))}))},i.prototype.setupFilteringOptions=function(){var e,t=this;this.tenancies&&(e=this.tenancies.map(function(e){return e.Rooms}).distinct().orderBy(function(e){return e}),this.roomOptions=this.fillMissingNumbers(e,1),e=this.tenancies.map(function(e){return t.roundToNearest(e.Sqm,10,!0)}).distinct().orderBy(function(e){return e}),this.minSizeOptions=this.fillMissingNumbers(e,10),e=this.tenancies.map(function(e){return t.roundToNearest(e.RentNet,500,!1)}).distinct().orderBy(function(e){return e}),this.maxRentOptions=this.fillMissingNumbers(e,500),e=this.tenancies.map(function(e){return e.TenancyType}).distinct().orderBy(function(e){return e}),this.tenancyTypeOptions=e,e=this.tenancies.map(function(e){return e.Region}).distinct().orderBy(function(e){return e}),this.areaOptions=e)},i.prototype.showAll=function(){this.displayTenancies=this.tenancies,this.selectedRoomOption=void 0,this.selectedSizeOption=void 0,this.selectedRentOption=void 0,this.selectedTenancyTypeOption=void 0,this.selectedAreaOption=void 0,this.showAllButton=!1,1<location.href.split("?").length&&window.history.pushState("","",location.href.split("?")[0])},i.prototype.updateList=function(){var t=this;this.displayTenancies=this.tenancies.filter(function(e){return t.matchesRoomOption(e)&&t.matchesSizeOption(e)&&t.matchesRentOption(e)&&t.matchesTenancyTypeOption(e)&&t.matchesAreaOption(e)}),this.showAllButton=this.displayTenancies.length<this.tenancies.length},i.$inject=["AvailableTenanciesPageStateService","UtilityService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/AvailableTenancies/AvailableTenanciesPage.component.html",this.bindings={}},app.component("availableTenanciesPage",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/AvailableTenanciesPage/"}(e=e.Housing||(e.Housing={})).AvailableTenancies||(e.AvailableTenancies={}),t.prototype.getAvailableTenancy=function(e,t,i){return this.incomHttp.get("".concat(this.baseurl,"GetAvailableTenancy?companyId=").concat(e,"&departmentId=").concat(t,"&tenancyId=").concat(i))},t.prototype.getAllAvailableTenancies=function(){return this.incomHttp.get(this.baseurl+"GetAllAvailableTenancies")},t.prototype.getTenancyInfoFor=function(e,t,i){return this.incomHttp.get("".concat(this.baseurl,"GetInfoForTenancy?companyId=").concat(e,"&departmentId=").concat(t,"&tenancyId=").concat(i))},t.$inject=["incomHttpService","LoaderService"],app.service("AvailableTenanciesPageHttpService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.loaderService=e,this.httpService=t,this.modalService=i,this.infoList={},this.tenancy$=new Rx.Subject,this.tenancies$=new Rx.BehaviorSubject(null)}(e=e.Housing||(e.Housing={})).AvailableTenancies||(e.AvailableTenancies={}),t.prototype.getAvailableTenancy=function(e,t,i){var n=this;return this.httpService.getAvailableTenancy(e,t,i).then(function(e){n.tenancy$.onNext(e)}),this.tenancy$},t.prototype.getAllAvailableTenancies=function(){var t=this;return this.httpService.getAllAvailableTenancies().then(function(e){e&&t.tenancies$.onNext(e.Tenancies)}),this.tenancies$},t.prototype.getTenancyInfoFor=function(e,t,i){var n=this,o=new Rx.BehaviorSubject(null),r=this.loaderService.setLoader("tenancyInfo","getTenancyInfo"),s="".concat(e,"_").concat(t,"_").concat(i);return this.infoList[s]?o.onNext(this.infoList[s]):this.httpService.getTenancyInfoFor(e,t,i).then(function(e){o.onNext(e),n.infoList[s]=e,n.loaderService.removeLoader(r)}),o},t.$inject=["LoaderService","AvailableTenanciesPageHttpService","ModalService"],app.service("AvailableTenanciesPageStateService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.stateService=e,this.validationService=t,this.requestAvailableTenancyService=i,this.utilityService=n,this.$scope=o,this.htmlUtilities=r,this.showTenInfo=!1,this.show
1FloorPlan=!1,this.disposables=new Rx.CompositeDisposable,this.moreInfo="",this.markers=[],this.contactForm={User:{Address:{}}},this.descriptionLimit=250,this.toggleShow=!1}(e=e.Housing||(e.Housing={})).AvailableTenancies||(e.AvailableTenancies={}),i.prototype.$onInit=function(){var e=new Date;this.dateFormat=this.utilityService.shortDateFormat,this.tenancy.availableBeforeToday=e>new Date(this.tenancy.MoveInDate),this.countResult=this.htmlUtilities.countNonHtmlCharToLimit(this.tenancy.Description,this.descriptionLimit).setEllipsis,this.nameRegex=this.validationService.getFullNameRegex(),this.emailRegex=this.validationService.getEmailRegex(),this.tenancy&&this.tenancy.Address.Coordinates&&this.markers.add({Lat:this.tenancy.Address.Coordinates.Lat,Lng:this.tenancy.Address.Coordinates.Lng})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getTenancyInfo=function(){var t=this;this.tenancyInfo||this.disposables.add(this.stateService.getTenancyInfoFor(this.tenancy.CompanyId,this.tenancy.DepartmentId,this.tenancy.TenancyId).subscribe(function(e){return t.tenancyInfo=e}))},i.prototype.copyTenancyLink=function(){var e=this,t=this.utilityService.getPageUrl(),i="".concat(this.tenancy.CompanyId,"_").concat(this.tenancy.DepartmentId,"_").concat(this.tenancy.TenancyId),t="".concat(t,"?ten=").concat(i),n=document.createElement("textarea"),t=(n.setAttribute("id",i),n.style.position="fixed",n.value=t,document.body.appendChild(n),document.getElementById(i));t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t),this.hasCopied=!0,setTimeout(function(){e.hasCopied=!1,e.$scope.$apply()},2e3)},i.prototype.showMoreInfo=function(e){"floorplan"==e&&("floorplan"==this.moreInfo?this.moreInfo="":this.moreInfo=e),"tenInfo"==e&&("tenInfo"==this.moreInfo?this.moreInfo="":(this.getTenancyInfo(),this.moreInfo=e))},i.prototype.getAddress=function(e){e&&(this.contactForm.User.Address.ZipCode=e.ZipCode,this.contactForm.User.Address.City=e.City,this.contactForm.User.Address.Street=e.Street,this.contactForm.User.Address.Location=e.Location,this.contactForm.User.Address.LocalTown=e.LocalTown)},i.prototype.submit=function(){var e=angular.copy(this.contactForm);e.CompanyId=this.tenancy.CompanyId,e.DepartmentId=this.tenancy.DepartmentId,e.TenancyId=this.tenancy.TenancyId,this.requestAvailableTenancyService.sendForm(e),this.showForm=!1},i.$inject=["AvailableTenanciesPageStateService","ValidationService","RequestAvailableTenancyService","UtilityService","$scope","HtmlUtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/AvailableTenancies/AvailableTenancy.component.html",this.bindings={tenancy:"<"}},app.component("availableTenancy",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.pageProviderService=i,this.disposables=new Rx.CompositeDisposable,this.affectedResults=t.affectedResults,this.maxRent=t.maxRent,this.totalWishes=t.totalWishes}e=(e=(e=e.Housing||(e.Housing={})).Basket||(e.Basket={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.pageProviderService.getPageByDocumentType("maxRent").then(function(e){e&&(t.maxRentPage=e.Url)})},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","PageProviderService"],e.BasketMaxRentModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.disposables=new Rx.CompositeDisposable}e=(e=e.TenancySearch||(e.TenancySearch={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.SomeTenanciesHaveRulesController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(){var i=this;this.getAmountOfTenanciesIn=function(e){var i=0;return e.forEach(function(e){e.TenancyGroups.forEach(function(e){var t=[];
1e.Tenancies.forEach(function(e){t.contains(e.Rooms)||(t.add(e.Rooms),i+=e.NumberOfTenancies)})})}),i},this.getTenanciesWithAssignmentRuleFrom=function(e){return e.filter(function(e){return angular.isNumber(e.AssignmentRule)})},this.getTenancyGroupOnlyWithTenanciesWithAssignmentRules=function(e){return e.map(function(e){var t=JSON.parse(JSON.stringify(e));return t.AvailableTenancies=i.getTenanciesWithAssignmentRuleFrom(e.AvailableTenancies),t.Tenancies=i.getTenanciesWithAssignmentRuleFrom(e.Tenancies),t}).filter(function(e){return 0<e.AvailableTenancies.length||0<e.Tenancies.length})},this.getDepartmentsWithOnlyAssignmentRuleTenancies=function(e){return(e=e.map(function(e){return e.TenancyGroups=i.getTenancyGroupOnlyWithTenanciesWithAssignmentRules(e.TenancyGroups),e})).filter(function(e){return 0<e.TenancyGroups.length})}}e.Housing||(e.Housing={}),t.prototype.getAssignmentRuleStatus=function(e){return e.any(function(e){return e.AssignmentRule<=0})?!e.any(function(e){return 0<e.AssignmentRule})?"None":"Some":"All"},t.$inject=[],app.service("TenancyUtilitiesService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.dashboardService=e,this.pageContentService=t,this.$compile=i,this.$element=n,this.$scope=o,this.disposables=new Rx.CompositeDisposable}(e=e.MemberPortal||(e.MemberPortal={})).MemberDashboard||(e.MemberDashboard={}),i.prototype.$onInit=function(){var i=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){i.currentPage=e,i.disposables.add(i.dashboardService.getDashboardContent(e.Id).subscribe(function(e){var t;e&&(i.dashboardContent=e,t=i.$element.find(".page-grid-container"),e.GridHtml)&&t&&(t.empty(),t.append(i.$compile(e.GridHtml)(i.$scope.$new(!0))))}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["DashboardService","PageContentService","$compile","$element","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/MemberDashboard/MemberDashboard.component.html",this.bindings={}},app.component("memberDashboard",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modalInstance=e,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close(!0)},t.prototype.cancel=function(){this.$modalInstance.close(!1)},t.$inject=["$uibModalInstance"],e.OfferDeclineConditionController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modalInstance=e}e=(e=(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.prototype.goToTenancySearch=function(){this.$modalInstance.close("tenancySearch")},t.prototype.close=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.MissingBasketContentController=t}(BoligExtra=BoligExtra||{}),!function(e){var o,t;function i(e,t,i){this.departmentAreasService=e,this.pageContentService=t,this.modalService=i,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),o=e.DepartmentAreas||(e.DepartmentAreas={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e,t.departmentAreasService.getDepartmentsWithAreas(e.Id).then(function(e){e&&(t.departmentsWithAreas=JSON.parse(JSON.stringify(e.DepartmentsWithAreas)))}),t.disposables.add(t.departmentAreasService.getAllRegulationDepartments(t.currentPage.Id).subscribe(function(e){e&&(t.allCompanies=e.AllCompanies,t.allDepartments=e.AllDepartments)})))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.editDepartmentArea=function(i,n){var e={currentPage:this.currentPage,isEditing:!0,department:i.Department,departmentArea:n},e={backdrop:!0,controller:o.Modals.EditDepartmentArea.EditDepartmentAreaModalController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/DepartmentAreas/Modals/EditDepartmentArea/EditDepartmentArea.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e).result.then(function(e){var t;e&&(t=i.DepartmentAreas.indexOf(n),i.DepartmentAreas[t]=e)},function(e){console.error(e)})},i.prototype.createNewDepartmentArea=function(){var e={currentPage:this.currentPage,isEditing:!1};this.showCreatingDepartmentAreaModal(e)},i.prototype.createDepartmentAreaForDepartment=function(e){e={currentPage:this.currentPage,isEditing:!1,department:e.Department};this.showCreatingDepartmentAreaModal(e)},i.prototype.showCreatingDepartmentAreaModal=function(e){var i=this,t=new Rx.Subject,e=(e.createDepartmentArea$=t,{backdrop:!0,controller:o.Modals.EditDepartmentArea.EditDepartmentAreaModalController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/DepartmentAreas/Modals/EditDepartmentArea/EditDepartmentArea.modal.html",size:"lg",keyboard:!0});this.modalService.createModalWithSettings(e),this.disposables.add(t.subscribe(function(t){var e=i.departmentsWithAreas.find(function(e){return e.Department.Company.Id==t.CompanyId&&e.Department.Id==t.DepartmentId});e||(e={Department:i.allDepartments.find(function(e){return e.Company.Id==t.CompanyId&&e.Id==t.DepartmentId}),DepartmentAreas:[],showAccordion:!0},i.departmentsWithAreas.add(e)),e.DepartmentAreas.add(t),e.showAccordion=!0},function(e){console.error(e)}))},i.prototype.deleteDepartmentArea=function(t){var e,i,n=this;confirm("Er du sikker på at du vil slette underområdet '".concat(t.Title,"'?"))&&(e={DepartmentAreaId:t.Id,NodeId:this.currentPage.Id},i=t.Id,this.departmentAreasService.deleteDepartmentArea(e).then(function(e){e&&e.Success&&((e=n.departmentsWithAreas.find(function(e){return e.Department.Company.Id==t.CompanyId&&e.Department.Id==t.DepartmentId}))&&(e.DepartmentAreas=e.DepartmentAreas.filter(function(e){return e.Id!=i})),n.departmentsWithAreas=n.departmentsWithAreas.filter(function(e){return 0<e.DepartmentAreas.length}))}))},i.$inject=["DepartmentAreasService","PageContentService","ModalService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/DepartmentAreas/DepartmentAreas.component.html",this.bindings={}},app.component("departmentAreas",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.allRegulationDepartments$=new Rx.ReplaySubject(1),this.baseurl="/umbraco/api/DepartmentAreas/"}
1(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).DepartmentAreas||(e.DepartmentAreas={}),t.prototype.getAllRegulationDepartments=function(e){var t=this,i=this.loaderService.setLoader("contentSection","EditDepartmentAreaLoader");return this.incomHttp.get(this.baseurl+"GetAllRegulationDepartments?nodeId="+e).then(function(e){t.allRegulationDepartments$.onNext(e),t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),this.allRegulationDepartments$},t.prototype.getDepartmentsWithAreas=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetDepartmentsWithAreas"),e=this.incomHttp.get(this.baseurl+"GetDepartmentsWithAreas?nodeId="+e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.createDepartmentArea=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetDepartmentsWithAreas"),e=this.incomHttp.post(this.baseurl+"CreateDepartmentArea",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateDepartmentArea=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetDepartmentsWithAreas"),e=this.incomHttp.post(this.baseurl+"UpdateDepartmentArea",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.deleteDepartmentArea=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetDepartmentsWithAreas"),e=this.incomHttp.post(this.baseurl+"DeleteDepartmentArea",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("DepartmentAreasService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.departmentAreasService=i,this.formService=n,this.disposables=new Rx.CompositeDisposable}e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).DepartmentAreas||(e.DepartmentAreas={})).Modals||(e.Modals={})).EditDepartmentArea||(e.EditDepartmentArea={}),t.prototype.$onInit=function(){var i=this;this.isEditing=this.modalData.isEditing,this.modalData.departmentArea?this.editingDepartmentArea=JSON.parse(JSON.stringify(this.modalData.departmentArea)):this.editingDepartmentArea={},this.disposables.add(this.departmentAreasService.getAllRegulationDepartments(this.modalData.currentPage.Id).subscribe(function(e){var t;e&&(i.allCompanies=e.AllCompanies.where(function(t){return e.AllDepartments.any(function(e){return e.Company.Id==t.Id})}).orderBy(function(e){return e.Id}),i.allDepartments=e.AllDepartments.orderBy(function(e){return e.Id}),i.selectedCompany=i.allCompanies.firstOrDefault(),i.allDepartmentsInSelectedCompany=i.allDepartments.where(function(e){return e.Company.Id==i.selectedCompany.Id}),i.selectedDepartment=i.allDepartments.orderBy(function(e){return e.Id}).where(function(e){return e.Company.Id==i.selectedCompany.Id}).firstOrDefault(),i.modalData.department)&&((t=i.allCompanies.find(function(e){return e.Id==i.modalData.department.Company.Id}))&&(i.selectedCompany=t,i.allDepartmentsInSelectedCompany=i.allDepartments.where(function(e){return e.Company.Id==i.selectedCompany.Id})),i.selectedDepartment=i.modalData.department)}))},t.prototype.onCompanySelectionChanged=function(){var t=this;this.allDepartmentsInSelectedCompany=this.allDepartments.where(function(e){return e.Company.Id==t.selectedCompany.Id}),this.selectedDepartment=this.allDepartmentsInSelectedCompany.orderBy(function(e){return e.Id}).firstOrDefault()},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.saveDepartmentArea=function(){this.form.$setDirty(!0),this.form.$setSubmitted(),this.form.$valid?this.modalData.isEditing?this.updateDepartmentArea():this.createDepartmentArea():angular.element("[name='"+this.form.$name+"']").find(".ng-invalid:visible:first").focus()},t.prototype.updateDepartmentArea=function(){var t=this,e={DepartmentAreaId:this.editingDepartmentArea.Id,Description:this.editingDepartmentArea.Description,NodeId:this.modalData.currentPage.Id,Title:this.editingDepartmentArea.Title};this.departmentAreasService.updateDepartmentArea(e).then(function(e){e&&t.$modalInstance.close(e.DepartmentArea)})},t.prototype.createDepartmentArea=function(){var t=this,e={CompanyId:this.selectedCompany.Id,DepartmentId:this.selectedDepartment.Id,Description:this.editingDepartmentArea.Description,Title:this.editingDepartmentArea.Title,NodeId:this.modalData.currentPage.Id};this.departmentAreasService.createDepartmentArea(e).then(function(e){e&&t.modalData.createDepartmentArea$&&(t.modalData.createDepartmentArea$.onNext(e.DepartmentArea),t.createAnother?(t.formService.clearFields(t.form),t.editingDepartmentArea.Title=null,t.editingDepartmentArea.Description=null):t.$modalInstance.close())})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","DepartmentAreasService","FormService"],e.EditDepartmentAreaModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i){this.regulationService=e,this.modalService=t,this.regulationUtilitiesService=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(n=e.Regulations||(e.Regulations={})).Components||(n.Components={})).BeforeMovingMaintenanceRule||(e.BeforeMovingMaintenanceRule={}),i.prototype.$onInit=function(){var i=this;this.hasMergeFields(this.maintenanceRule.Text)&&this.actionAllowed(),this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){null!=e&&(i.itemSelection=e.firstOrDefault(function(e){return e.ItemId==i.maintenanceRule.Id}))})),this.disposables.add(Rx.Observable.combineLatest(this.regulationService.regulation$,this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];t&&(i.regulation=t),null!=e&&(i.regulationIsLocked=2==e||3==e&&(null==i.regulation||!i.regulation.UserCanFinishRegulationApproval))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.hasMergeFields=function(e){return this.regulationUtilitiesService.hasMergeFields(e)},i.prototype.replaceMergeFields=function(e){return this.textMerged||(this.itemSelection?this.textMerged=this.regulationUtilitiesService.replaceMergeFields(e,this.itemSelection.FieldValues):this.textMerged=e),this.textMerged},i.prototype.editMergeFields=function(t){var i=this,e={itemId:this.maintenanceRule.Id,text:t},e={backdrop:!0,controller:n.Modals.EditMergeFields.EditMergeFieldsController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/EditMergeFields/EditMergeFields.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e).result.then(function(e){null==i.itemSelection&&(i.itemSelection={IsSelected:!0,ItemId:i.maintenanceRule.Id,ItemType:n.Models.GetRegulation.ItemType.MaintenanceRule,FieldValues:[],DepartmentAreas:[]}),i.itemSelection.FieldValues=e.filter(function(e){return""!=e.Value.trim()}),i.regulationService.addItemSelection$.onNext(i.itemSelection),i.textMerged=i.regulationUtilitiesService.replaceMergeFields(t,i.itemSelection.FieldValues)},function(e){})},i.$inject=["RegulationService","ModalService","RegulationUtilitiesService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/BeforeMovingMaintenanceRule/BeforeMovingMaintenanceRule.component.html",this.bindings={maintenanceRule:"<",actionAllowed:"&",regulationType:"<"}},app.component("beforeMovingMaintenanceRule",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,a,t;function n(e,t,i){this.modalService=e,this.regulationService=t,this.regulationsUtilityService=i,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1,this.shownMaintenanceRules=[],this.allItemSelections=[],this.yellowSelectedItemsCount=0,this.redSelectedItemsCount=0}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),i=e.Regulations||(e.Regulations={}),a=i.Regulations||(i.Regulations={}),(e=a.Components||(a.Components={})).GeneralMaintenanceRuleList||(e.GeneralMaintenanceRuleList={}),n.prototype.$onInit=function(){var n=this;this.checkForAction()&&(this.showActionAllowedIcon=!0,this.actionAllowed()),this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){if(null!=e){n.shownMaintenanceRules=[];for(var t=0;t<n.maintenanceRules.length;t++){var i=n.maintenanceRules[t];e.any(function(e){return e.ItemId==i.Id&&e.IsSelected})&&n.shownMaintenanceRules.push(i)}n.allItemSelections=e}})),this.disposables.add(this.regulationService.itemCountUpdate$.subscribe(function(t){n.maintenanceRules.any(function(e){return e.Id==t})&&(n.yellowSelectedItemsCount=0,n.redSelectedItemsCount=0,n.maintenanceRules.forEach(function(e){n.yellowSelectedItemsCount+=n.regulationsUtilityService.isMaintenanceRuleSelectedAndColor(e,n.allItemSelections,i.ColorCode.Yellow)?1:0,n.redSelectedItemsCount+=n.regulationsUtilityService.isMaintenanceRuleSelectedAndColor(e,n.allItemSelections,i.ColorCode.Red)?1:0}),n.regulationService.itemCountUpdate$.onNext(n.sectionId+"-"+n.ruleGroupName.toLowerCase().replace(/ /g,"-")))})),this.disposables.add(Rx.Observable.combineLatest(this.regulationService.regulation$,this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];t&&(n.regulation=t),null!=e&&(n.regulationIsLocked=2==e||3==e&&(null==n.regulation||!n.regulation.UserCanFinishRegulationApproval))})),0<this.maintenanceRules.length&&this.regulationService.itemCountUpdate$.onNext(this.maintenanceRules[0].Id)},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.openSelectMaintenanceRuleModal=function(){for(var o=this,e=[],t=0;t<this.maintenanceRules.length;t++){var i=angular.copy(this.maintenanceRules[t]),n=angular.copy(this.regulation.DepartmentAreas),r=this.allItemSelections.find(function(e){return e.ItemId==i.Id});
1r&&r.DepartmentAreas&&n.forEach(function(t){return t.Selected=r.DepartmentAreas.any(function(e){return e==t.Id})}),i.Selected=this.shownMaintenanceRules.any(function(e){return e.Id==i.Id}),i.ActiveForAllDepartmentAreas=null==r||null==r.DepartmentAreas||0==r.DepartmentAreas.length,i.ActiveForAllDepartmentAreas&&n.forEach(function(e){return e.Selected=!0}),i.DepartmentAreas=n,e.push(i)}var s={ruleGroupName:this.ruleGroupName,maintenanceRules:e,onlyAllowSingleSelection:!1,sectionId:this.sectionId,isObligatory:!1};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/SelectMaintenanceRule/SelectMaintenanceRule.modal.html",a.Modals.SelectMaintenanceRule.SelectMaintenanceRuleModalController,s,"lg").result.then(function(e){if(Array.isArray(e)&&0<e.length){o.shownMaintenanceRules=[];for(var t=0;t<e.length;t++){var i=e[t],n=(i.Selected&&o.shownMaintenanceRules.push(i),i.ActiveForAllDepartmentAreas?[]:i.DepartmentAreas.filter(function(e){return 1==e.Selected}));o.saveMaintenanceRuleItemSelection(i.Id,i.Selected,i.Selected?n:[])}}},function(e){})},n.prototype.saveMaintenanceRuleItemSelection=function(t,e,i){var n=this.allItemSelections.firstOrDefault(function(e){return e.ItemId==t}),o=[],n=(null!=n&&(o=n.FieldValues),{IsSelected:e,ItemId:t,ItemType:a.Models.GetRegulation.ItemType.MaintenanceRule,FieldValues:o,DepartmentAreas:i.map(function(e){return e.Id})});(e?this.regulationService.addItemSelection$:this.regulationService.removeItemSelection$).onNext(n)},n.prototype.childActionAllowed=function(){this.showActionAllowedIcon||(this.showActionAllowedIcon=!0,this.actionAllowed())},n.prototype.checkForAction=function(){return this.maintenanceRules.any(function(e){return 2!=e.ColorCode})},n.$inject=["ModalService","RegulationService","RegulationUtilitiesService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/GeneralMaintenanceRuleList/GeneralMaintenanceRuleList.component.html",this.bindings={ruleGroupName:"@",maintenanceRules:"<",actionAllowed:"&",sectionId:"<"}},app.component("generalMaintenanceRuleList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i){this.regulationService=e,this.modalService=t,this.regulationUtilitiesService=i,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(n=e.Regulations||(e.Regulations={})).Components||(n.Components={})).GeneralMaintenanceRule||(e.GeneralMaintenanceRule={}),i.prototype.$onInit=function(){var i=this;this.hasMergeFields(this.maintenanceRule.Text)&&this.actionAllowed(),this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){null!=e&&(i.itemSelection=e.firstOrDefault(function(e){return e.ItemId==i.maintenanceRule.Id}))})),this.disposables.add(Rx.Observable.combineLatest(this.regulationService.regulation$,this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];t&&(i.regulation=t),null!=e&&(i.regulationIsLocked=2==e||3==e&&(null==i.regulation||!i.regulation.UserCanFinishRegulationApproval))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.hasMergeFields=function(e){return this.regulationUtilitiesService.hasMergeFields(e)},i.prototype.replaceMergeFields=function(e){return this.textMerged||(this.itemSelection?this.textMerged=this.regulationUtilitiesService.replaceMergeFields(e,this.itemSelection.FieldValues):this.textMerged=e),this.textMerged},i.prototype.editMergeFields=function(t){var i=this,e={itemId:this.maintenanceRule.Id,text:t},e={backdrop:!0,controller:n.Modals.EditMergeFields.EditMergeFieldsController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/EditMergeFields/EditMergeFields.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e).result.then(function(e){null==i.itemSelection&&(i.itemSelection={IsSelected:!0,ItemId:i.maintenanceRule.Id,ItemType:n.Models.GetRegulation.ItemType.MaintenanceRule,FieldValues:[],DepartmentAreas:[]}),i.itemSelection.FieldValues=e.filter(function(e){return""!=e.Value.trim()}),i.regulationService.addItemSelection$.onNext(i.itemSelection),i.textMerged=i.regulationUtilitiesService.replaceMergeFields(t,i.itemSelection.FieldValues)},function(e){})},i.$inject=["RegulationService","ModalService","RegulationUtilitiesService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/GeneralMaintenanceRule/GeneralMaintenanceRule.component.html",this.bindings={maintenanceRule:"<",actionAllowed:"&"}},app.component("generalMaintenanceRule",new e)}(BoligExtra=BoligExtra||{}),!function(e){var o,t;function i(e,t){this.regulationService=e,this.modalService=t,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(o=e.Regulations||(e.Regulations={})).Components||(o.Components={})).GuidanceInformation||(e.GuidanceInformation={}),i.prototype.$onInit=function(){var n=this;this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){if(null!=e&&(n.selectedGuidanceInformationImages=[],null!=n.guidanceInformation.Images))for(var t=0;t<n.guidanceInformation.Images.length;t++){var i=n.guidanceInformation.Images[t];e.any(function(e){return e.ItemId==i.Id&&e.IsSelected})&&n.selectedGuidanceInformationImages.push(i)}})),this.disposables.add(Rx.Observable.combineLatest(this.regulationService.regulation$,this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];t&&(n.regulation=t),null!=e&&(n.regulationIsLocked=2==e||3==e&&(null==n.regulation||!n.regulation.UserCanFinishRegulationApproval))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.selectGuidanceInformationImages=function(){var n=this,e={guidanceInformation:this.guidanceInformation,selectedGuidanceInformationImages:this.selectedGuidanceInformationImages},e={backdrop:!0,controller:o.Modals.SelectSectionGuidanceInformationImages.SelectSectionGuidanceInformationImagesModalController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/SelectSectionGuidanceInformationImages/SelectSectionGuidanceInformationImages.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e).result.then(function(i){i&&n.guidanceInformation.Images.forEach(function(e){var t;1==i[e.Id]?(t={IsSelected:!0,FieldValues:[],ItemId:e.Id,ItemType:o.Models.GetRegulation.ItemType.GuidanceInformationImage,DepartmentAreas:[]},n.regulationService.addItemSelection$.onNext(t)):(t={IsSelected:!1,FieldValues:[],ItemId:e.Id,ItemType:o.Models.GetRegulation.ItemType.GuidanceInformationImage,DepartmentAreas:[]},n.regulationService.removeItemSelection$.onNext(t))})},function(e){console.error(e)})},i.$inject=["RegulationService","ModalService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/GuidanceInformation/GuidanceInformation.component.html",this.bindings={guidanceInformation:"<"}},app.component("guidanceInformation",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t){this.regulationService=e,this.regulationsUtilityService=t,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1,this.yellowSelectedItemsCount=0,this.redSelectedItemsCount=0}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),(e=(e=(n=e.Regulations||(e.Regulations={})).Regulations||(n.Regulations={})).Components||(e.Components={})).MaintenanceRuleGroupList||(e.MaintenanceRuleGroupList={}),i.prototype.$onInit=function(){var i=this,e=(this.checkForAction()&&(this.showActionAllowedIcon=!0,this.actionAllowed()),this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){null!=e&&(i.allItemSelections=e)})),this.disposables.add(this.regulationService.itemCountUpdate$.subscribe(function(t){i.maintenanceRuleGroups.any(function(e){return e.MaintenanceRules.any(function(e){return e.Id==t})})&&(i.yellowSelectedItemsCount=0,i.redSelectedItemsCount=0,i.maintenanceRuleGroups.forEach(function(t){i.allItemSelections.some(function(e){return e.ItemId==t.Id&&e.IsSelected})||(i.yellowSelectedItemsCount+=i.regulationsUtilityService.getSelectedRulesInMaintenanceRuleGroupByColor(t,i.allItemSelections,n.ColorCode.Yellow),i.redSelectedItemsCount+=i.regulationsUtilityService.getSelectedRulesInMaintenanceRuleGroupByColor(t,i.allItemSelections,n.ColorCode.Red))}),i.regulationService.itemCountUpdate$.onNext(i.maintenanceRuleGroups[0].Id))})),this.maintenanceRuleGroups.filter(function(e){return 0<e.MaintenanceRules.length}));e.any()&&this.regulationService.itemCountUpdate$.onNext(e[0].MaintenanceRules[0].Id)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.childActionAllowed=function(){this.showActionAllowedIcon||(this.showActionAllowedIcon=!0,this.actionAllowed())},i.prototype.checkForAction=function(){return this.maintenanceRuleGroups.any(function(e){return!e.Obligatory})},i.$inject=["RegulationService","RegulationUtilitiesService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/MaintenanceRuleGroupList/MaintenanceRuleGroupList.component.html",this.bindings={ruleGroupName:"@",maintenanceRuleGroups:"<",actionAllowed:"&",regulationType:"<"}},app.component("maintenanceRuleGroupList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t,a,i;function n(e,t){this.regulationService=e,this.modalService=t,this.disposables=new Rx.CompositeDisposable,this.shownMaintenanceRules=[]}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),t=e.Regulations||(e.Regulations={}),a=t.Regulations||(t.Regulations={}),(e=a.Components||(a.Components={})).MaintenanceRuleGroup||(e.MaintenanceRuleGroup={}),n.prototype.$onInit=function(){var n=this;this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){if(null!=e){n.shownMaintenanceRules=[];for(var t=0;t<n.maintenanceRuleGroup.MaintenanceRules.length;t++){var i=n.maintenanceRuleGroup.MaintenanceRules[t];e.any(function(e){return e.ItemId==i.Id&&e.IsSelected})&&n.shownMaintenanceRules.push(i)}e.any(function(e){return e.ItemId==n.maintenanceRuleGroup.Id&&e.IsSelected})&&(n.isSelected=!0),n.itemSelection=e.firstOrDefault(function(e){return e.ItemId==n.maintenanceRuleGroup.Id}),n.allItemSelections=e,n.maintenanceRuleGroup.Obligatory&&(n.isSelected=!0,0==n.allItemSelections.any(function(e){return e.ItemId==n.maintenanceRuleGroup.Id&&e.ItemType==a.Models.GetRegulation.ItemType.MaintenanceRuleGroup&&e.IsSelected}))&&n.selectionChanged()}})),this.disposables.add(Rx.Observable.combineLatest(this.regulationService.regulation$,this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];t&&(n.regulation=t),null!=e&&(n.regulationIsLocked=2==e||3==e&&(null==n.regulation||!n.regulation.UserCanFinishRegulationApproval))})),this.checkForAction()&&(this.showActionAllowedIcon=!0,this.actionAllowed())},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.selectionChanged=function(){var e={IsSelected:this.isSelected,ItemId:this.maintenanceRuleGroup.Id,ItemType:a.Models.GetRegulation.ItemType.MaintenanceRuleGroup,FieldValues:[],DepartmentAreas:[]};this.isSelected?(this.regulationService.addItemSelection$.onNext(e),this.makeDefaultSelections()):this.regulationService.removeItemSelection$.onNext(e),0<this.maintenanceRuleGroup.MaintenanceRules.length&&this.regulationService.itemCountUpdate$.onNext(this.maintenanceRuleGroup.MaintenanceRules[0].Id)},n.prototype.makeDefaultSelections=function(){var e,i=this;this.allItemSelections.any(function(t){return i.maintenanceRuleGroup.MaintenanceRules.any(function(e){return e.Id==t.ItemId})&&t.IsSelected})||(e=null,this.maintenanceRuleGroup.MaintenanceRules.any(function(e){return e.Recommended})?e=this.maintenanceRuleGroup.MaintenanceRules.firstOrDefault(function(e){return e.Recommended}).Id:this.maintenanceRuleGroup.MaintenanceRules.any(function(e){return e.ColorCode==t.ColorCode.Green})&&(e=this.maintenanceRuleGroup.MaintenanceRules.firstOrDefault(function(e){return e.ColorCode==t.ColorCode.Green}).Id),null!=e&&(e={IsSelected:!0,ItemId:e,ItemType:a.Models.GetRegulation.ItemType.MaintenanceRule,FieldValues:[],DepartmentAreas:[]},this.regulationService.addItemSelection$.onNext(e)))},n.prototype.openSelectMaintenanceRuleModal=function(){for(var o=this,e=[],t=0;t<this.maintenanceRuleGroup.MaintenanceRules.length;t++){var i=angular.copy(this.maintenanceRuleGroup.MaintenanceRules[t]),n=angular.copy(this.regulation.DepartmentAreas),r=this.allItemSelections.find(function(e){return e.ItemId==i.Id});
1r&&r.DepartmentAreas&&n.forEach(function(t){return t.Selected=r.DepartmentAreas.any(function(e){return e==t.Id})}),i.Selected=this.shownMaintenanceRules.any(function(e){return e.Id==i.Id}),i.ActiveForAllDepartmentAreas=null==r||null==r.DepartmentAreas||0==r.DepartmentAreas.length,i.ActiveForAllDepartmentAreas&&n.forEach(function(e){return e.Selected=!0}),i.DepartmentAreas=n,e.push(i)}var s={ruleGroupName:this.maintenanceRuleGroup.Text,maintenanceRules:e,onlyAllowSingleSelection:0==this.maintenanceRuleGroup.AllowMultipleSelection,sectionId:this.maintenanceRuleGroup.SectionId,isObligatory:this.maintenanceRuleGroup.Obligatory};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/SelectMaintenanceRule/SelectMaintenanceRule.modal.html",a.Modals.SelectMaintenanceRule.SelectMaintenanceRuleModalController,s,"lg").result.then(function(e){if(Array.isArray(e)&&0<e.length){o.shownMaintenanceRules=[];for(var t=0;t<e.length;t++){var i=e[t],n=(i.Selected&&o.shownMaintenanceRules.push(i),i.ActiveForAllDepartmentAreas?[]:i.DepartmentAreas.filter(function(e){return 1==e.Selected}));o.saveMaintenanceRuleItemSelection(i.Id,i.Selected,i.Selected?n:[])}}},function(e){})},n.prototype.saveMaintenanceRuleItemSelection=function(t,e,i){var n=this.allItemSelections.firstOrDefault(function(e){return e.ItemId==t}),o=[],n=(null!=n&&(o=n.FieldValues),{IsSelected:e,ItemId:t,ItemType:a.Models.GetRegulation.ItemType.MaintenanceRule,FieldValues:o,DepartmentAreas:i.map(function(e){return e.Id})});(e?this.regulationService.addItemSelection$:this.regulationService.removeItemSelection$).onNext(n)},n.prototype.childActionAllowed=function(){this.showActionAllowedIcon||!this.isSelected&&!this.maintenanceRuleGroup.Obligatory||(this.showActionAllowedIcon=!0,this.actionAllowed())},n.prototype.checkForAction=function(){return!!(this.isSelected&&0<this.maintenanceRuleGroup.MaintenanceRules.length)&&(!this.maintenanceRuleGroup.Obligatory||1<this.maintenanceRuleGroup.MaintenanceRules.length)},n.$inject=["RegulationService","ModalService"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/MaintenanceRuleGroup/MaintenanceRuleGroup.component.html",this.bindings={maintenanceRuleGroup:"<",actionAllowed:"&",regulationType:"<"}},app.component("maintenanceRuleGroup",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).RegulationsOverviewCompany||(e.RegulationsOverviewCompany={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/RegulationsOverviewCompany/RegulationsOverviewCompany.component.html",this.bindings={company:"<",editUrl:"<",regulationDepartments:"<",enableHeadline:"<"}},app.component("regulationsOverviewCompany",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.regulationOverviewService=e,this.fileService=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable}(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).RegulationsOverviewDepartmentRegulation||(e.RegulationsOverviewDepartmentRegulation={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.downloadApprovedRegulation=function(){var t=this,e={NodeId:this.currentPage.Id,CompanyId:this.department.Company.Id,DepartmentId:this.department.Id,LatestApprovedRegulationId:this.regulation.LatestApprovedRegulationId};this.regulationOverviewService.getApprovedRegulationPdfData(e).then(function(e){e&&t.fileService.downloadFile([e])})},i.$inject=["RegulationsOverviewService","FileService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/RegulationsOverviewDepartmentRegulation/RegulationsOverviewDepartmentRegulation.component.html",this.bindings={editUrl:"<",regulation:"<",department:"<"}},app.component("regulationsOverviewDepartmentRegulation",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1}(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).RegulationsOverviewDepartment||(e.RegulationsOverviewDepartment={}),i.prototype.$onInit=function(){null==this.department?this.departmentName="Ukendt afdeling":(this.departmentName=this.department.Name,this.departmentAddress=this.department.Address,this.departmentMaintenanceScheme=this.department.MaintenanceScheme),this.hasAnyRegulationsWithRedRules=this.regulations.any(function(e){return 0<e.SelectedRedRules})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/RegulationsOverviewDepartment/RegulationsOverviewDepartment.component.html",this.bindings={department:"<",editUrl:"<",regulations:"<"}},app.component("regulationsOverviewDepartment",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Components||(e.Components={})).SectionAttribute||(e.SectionAttribute={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/SectionAttribute/SectionAttribute.component.html",this.bindings={sectionAttribute:"<"}},app.component("sectionAttribute",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n,o,t;function i(e,t,i,n,o){this.$sce=e,this.modalService=t,this.pageContentService=i,this.regulationService=n,this.regulationsUtilityService=o,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1,this.showActionAllowedIcon=!1,this.yellowSelectedItemsCount=0,this.redSelectedItemsCount=0}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),n=e.Regulations||(e.Regulations={}),o=n.Regulations||(n.Regulations={}),(e=o.Components||(o.Components={})).SectionGroup||(e.SectionGroup={}),i.prototype.$onInit=function(){var i=this;this.checkForAction()&&(this.showActionAllowedIcon=!0),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(i.currentPage=e)}),this.sectionGroup.DepartmentSectionGroupIntroText=this.$sce.trustAsHtml(this.sectionGroup.DepartmentSectionGroupIntroText),this.disposables.add(this.regulationService.regulation$.subscribe(function(e){e&&(i.regulation=e,i.enableSectionGroupIntroText=i.regulation.RegulationType==o.Models.GetRegulation.RegulationType.RightOfWayCatalog)})),this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){null!=e&&(i.allItemSelections=e,i.selectedSectionsInGroup=i.sectionGroup.Sections.reduce(function(e,t){return i.allItemSelections.any(function(e){return e.ItemId==t.Id&&e.IsSelected})?e+1:e},0))})),this.disposables.add(this.regulationService.itemCountUpdate$.subscribe(function(t){i.sectionGroup.Sections.any(function(e){return e.Id==t})&&(i.yellowSelectedItemsCount=i.regulationsUtilityService.getSelectedRulesInSectionGroupByColor(i.sectionGroup,i.allItemSelections,n.ColorCode.Yellow),i.redSelectedItemsCount=i.regulationsUtilityService.getSelectedRulesInSectionGroupByColor(i.sectionGroup,i.allItemSelections,n.ColorCode.Red),i.regulationService.itemCountUpdate$.onNext(i.sectionGroup.Id))})),this.disposables.add(Rx.Observable.combineLatest(this.regulationService.regulation$,this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];t&&(i.regulation=t),null!=e&&(i.regulationIsLocked=2==e||3==e&&(null==i.regulation||!i.regulation.UserCanFinishRegulationApproval))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.childActionAllowed=function(){this.showActionAllowedIcon||(this.showActionAllowedIcon=!0)},i.prototype.checkForAction=function(){return 0<this.sectionGroup.Sections.length},i.prototype.editSectionGroupIntroText=function(){var t=this,e={introText:this.sectionGroup.DepartmentSectionGroupIntroText,currentPage:this.currentPage,sectionGroup:this.sectionGroup,regulation:this.regulation};this.modalService.createModal("/App/PersonnelPortal/Administration/Regulations/Regulations/Modals/EditSectionGroupIntroText/EditSectionGroupIntroText.modal.html",o.Modals.EditSectionGroupIntroText.EditSectionGroupIntroTextModalController,e,"lg").result.then(function(e){e&&(t.sectionGroup.DepartmentSectionGroupIntroText=t.$sce.trustAsHtml(e.IntroText))},function(e){})},i.$inject=["$sce","ModalService","PageContentService","RegulationService","RegulationUtilitiesService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/SectionGroup/SectionGroup.component.html",this.bindings={sectionGroup:"<",regulationType:"<"}},app.component("sectionGroup",new e)}(BoligExtra=BoligExtra||{}),!function(e){var o,r,t;function i(e,t,i,n){this.regulationService=e,this.modalService=t,this.regulationUtilitiesService=i,this.pageContentService=n,this.showActionAllowedIcon=!1,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1,this.yellowSelectedItemsCount=0,this.redSelectedItemsCount=0,this.yellowSelectedGuidanceInformationCount=0,this.redSelectedGuidanceInformationCount=0}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),o=e.Regulations||(e.Regulations={}),r=o.Regulations||(o.Regulations={}),(e=r.Components||(r.Components={})).Section||(e.Section={}),i.prototype.$onInit=function(){var i=this;this.checkForAction()&&(this.showActionAllowedIcon=!0,this.actionAllowed()),this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){null!=e&&(e.any(function(e){return e.ItemId==i.section.Id&&e.IsSelected})&&(i.isSelected=!0),i.itemSelection=e.firstOrDefault(function(e){return e.ItemId==i.section.Id}),i.allItemSelections=e,i.selectedSectionAttributes=i.section.SectionAttributes.filter(function(t){return e.any(function(e){return e.ItemId==t.Id&&e.ItemType==r.Models.GetRegulation.ItemType.SectionAttribute&&e.IsSelected})}),i.selectedSectionGuidanceInformations=i.section.GuidanceInformations.filter(function(t){return e.any(function(e){return e.ItemId==t.Id&&e.ItemType==r.Models.GetRegulation.ItemType.GuidanceInformation&&e.IsSelected})}))})),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(i.currentPage=e)}),this.disposables.add(this.regulationService.itemCountUpdate$.subscribe(function(t){(i.section.BeforeMovingRuleGroups.any(function(e){return e.Id==t})||-1<(t+"").indexOf(i.section.Id+"-"))&&(i.yellowSelectedItemsCount=i.regulationUtilitiesService.getSelectedRulesInSectionByColor(i.section,i.allItemSelections,o.ColorCode.Yellow),i.redSelectedItemsCount=i.regulationUtilitiesService.getSelectedRulesInSectionByColor(i.section,i.allItemSelections,o.ColorCode.Red),i.yellowSelectedGuidanceInformationCount=i.section.GuidanceInformations.filter(function(e){return i.regulationUtilitiesService.getSelectedGuidanceInformationsInSectionByColor(e,i.allItemSelections,o.ColorCode.Yellow)}).length,i.redSelectedGuidanceInformationCount=i.section.GuidanceInformations.filter(function(e){return i.regulationUtilitiesService.getSelectedGuidanceInformationsInSectionByColor(e,i.allItemSelections,o.ColorCode.Red)}).length,i.regulationService.itemCountUpdate$.onNext(i.section.Id))})),this.disposables.add(Rx.Observable.combineLatest(this.regulationService.regulation$,this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];t&&(i.regulation=t),null!=e&&(i.regulationIsLocked=2==e||3==e&&(null==i.regulation||!i.regulation.UserCanFinishRegulationApproval))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.selectionChanged=function(){this.showAccordion=!1;var e={IsSelected:this.isSelected,ItemId:this.section.Id,ItemType:r.Models.GetRegulation.ItemType.Section,FieldValues:[],DepartmentAreas:[]};this.isSelected?(this.regulationService.addItemSelection$.onNext(e),this.makeDefaultSelections(),this.regulationType==r.Models.GetRegulation.RegulationType.RightOfWayCatalog&&0<this.section.SectionConnections.filter(function(e){return e.MissingSectionConnectionInMaintenanceRegulationDraft}).length&&this.showRightOfWayMissingConnectionsWarningModal()):this.regulationService.removeItemSelection$.onNext(e)},i.prototype.showRightOfWayMissingConnectionsWarningModal=function(){var e={showWarningForAddingSection:!0,sections:[this.section],showHeadersForSections:!1};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/SectionConnectionMissingWarning/SectionConnectionMissingWarning.modal.html",r.Modals.SectionConnectionMissingWarning.SectionConnectionMissingWarningModalController,e,"md")},i.prototype.makeDefaultSelections=function(){this.makeDefaultSelectionsForMaintenanceRules(this.section.MovingInConditionsRules),this.makeDefaultSelectionsForMaintenanceRules(this.section.DailyCleaningRules),this.makeDefaultSelectionsForMaintenanceRules(this.section.MaintenanceRules),this.makeDefaultSelectionsForMaintenanceRuleGroups(this.section.BeforeMovingRuleGroups),this.makeDefaultSelectionsForSectionAttributes(this.section.SectionAttributes)},i.prototype.makeDefaultSelectionsForSectionAttributes=function(e){1==e.length&&(e={IsSelected:!0,ItemId:e[0].Id,ItemType:r.Models.GetRegulation.ItemType.SectionAttribute,FieldValues:[],DepartmentAreas:[]},this.regulationService.addItemSelection$.onNext(e))},i.prototype.makeDefaultSelectionsForMaintenanceRuleGroups=function(e){var i=this;e.forEach(function(t){var e;t.Obligatory&&(i.allItemSelections.any(function(e){return e.ItemId==t.Id&&e.IsSelected})||(e={IsSelected:!0,ItemId:t.Id,ItemType:r.Models.GetRegulation.ItemType.MaintenanceRuleGroup,FieldValues:[],DepartmentAreas:[]},i.regulationService.addItemSelection$.onNext(e)),i.makeDefaultSelectionsForMaintenanceRules(t.MaintenanceRules,1))})},i.prototype.makeDefaultSelectionsForMaintenanceRules=function(e,t){var i,n=this;void 0===t&&(t=999),e=e.where(function(e){return e.ColorCode!=o.ColorCode.Red}).orderBy(function(e){return e.ColorCode}),this.allItemSelections.any(function(t){return e.any(function(e){return e.Id==t.ItemId})&&t.IsSelected})||(i=[],e.any(function(e){return e.Recommended})?i=e.where(function(e){return e.Recommended}).map(function(e){return e.Id}).slice(0,t):e.any(function(e){return e.ColorCode==o.ColorCode.Green})?i.push(e.firstOrDefault(function(e){return e.ColorCode==o.ColorCode.Green}).Id):e.any(function(e){return e.ColorCode==o.ColorCode.Yellow})&&i.push(e.firstOrDefault(function(e){return e.ColorCode==o.ColorCode.Yellow}
1).Id),null!=i&&i.forEach(function(e){e={IsSelected:!0,ItemId:e,ItemType:r.Models.GetRegulation.ItemType.MaintenanceRule,FieldValues:[],DepartmentAreas:[]};n.regulationService.addItemSelection$.onNext(e)}))},i.prototype.toggleAccordion=function(){this.isSelected&&(this.showAccordion=!this.showAccordion)},i.prototype.hasMergeFields=function(e){return this.regulationUtilitiesService.hasMergeFields(e)},i.prototype.replaceMergeFields=function(e){return this.textMerged||(this.itemSelection?this.textMerged=this.regulationUtilitiesService.replaceMergeFields(e,this.itemSelection.FieldValues):this.textMerged=e),this.textMerged},i.prototype.editMergeFields=function(t){var i=this,e={itemId:this.section.Id,text:t},e={backdrop:!0,controller:r.Modals.EditMergeFields.EditMergeFieldsController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/EditMergeFields/EditMergeFields.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e).result.then(function(e){null==i.itemSelection&&(i.itemSelection={IsSelected:i.isSelected,ItemId:i.section.Id,ItemType:r.Models.GetRegulation.ItemType.Section,FieldValues:[],DepartmentAreas:[]}),i.itemSelection.FieldValues=e.filter(function(e){return""!=e.Value.trim()}),i.regulationService.addItemSelection$.onNext(i.itemSelection),i.textMerged=i.regulationUtilitiesService.replaceMergeFields(t,i.itemSelection.FieldValues)},function(e){})},i.prototype.childActionAllowed=function(){this.showActionAllowedIcon||(this.showActionAllowedIcon=!0,this.actionAllowed())},i.prototype.selectSectionAttribute=function(){var n=this,e={sectionAttributes:this.section.SectionAttributes,selectedAttributes:this.selectedSectionAttributes,section:this.section},e={backdrop:!0,controller:r.Modals.SelectSectionAttribute.SelectSectionAttributeModalController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/SelectSectionAttribute/SelectSectionAttribute.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e).result.then(function(i){i&&n.section.SectionAttributes.forEach(function(e){var t;1==i[e.Id]?(t={IsSelected:!0,FieldValues:[],ItemId:e.Id,ItemType:r.Models.GetRegulation.ItemType.SectionAttribute,DepartmentAreas:[]},n.regulationService.addItemSelection$.onNext(t)):(t={IsSelected:!1,FieldValues:[],ItemId:e.Id,ItemType:r.Models.GetRegulation.ItemType.SectionAttribute,DepartmentAreas:[]},n.regulationService.removeItemSelection$.onNext(t))})},function(e){console.error(e)})},i.prototype.selectGuidanceInformations=function(){var n=this,e={section:this.section,sectionGuidanceInformations:this.section.GuidanceInformations,selectedGuidanceInformations:this.selectedSectionGuidanceInformations,currentPage:this.currentPage},e={backdrop:!0,controller:r.Modals.SelectSectionGuidanceInformation.SelectSectionGuidanceInformationModalController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/SelectSectionGuidanceInformation/SelectSectionGuidanceInformation.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e).result.then(function(i){i&&n.section.GuidanceInformations.forEach(function(e){var t;1==i[e.Id]?(t={IsSelected:!0,FieldValues:[],ItemId:e.Id,ItemType:r.Models.GetRegulation.ItemType.GuidanceInformation,DepartmentAreas:[]},n.regulationService.addItemSelection$.onNext(t)):(t={IsSelected:!1,FieldValues:[],ItemId:e.Id,ItemType:r.Models.GetRegulation.ItemType.GuidanceInformation,DepartmentAreas:[]},n.regulationService.removeItemSelection$.onNext(t))})},function(e){console.error(e)})},i.prototype.checkForAction=function(){return this.hasMergeFields(this.section.IntroText)},i.$inject=["RegulationService","ModalService","RegulationUtilitiesService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Components/Section/RegulationsSection.component.html",this.bindings={section:"<",actionAllowed:"&",regulationType:"<"}},app.component("regulationsSection",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i;function t(e,t,i,n,o,r){this.$modalInstance=e,this.modalData=t,this.loaderService=i,this.regulationService=n,this.utilityService=o,this.regulationUtilitiesService=r,this.disposables=new Rx.CompositeDisposable,this.isLoading=!0,this.approvedDate=new Date,this.companyBoardApprovalDate=new Date,this.showCompanyBoardApprovalDatePicker=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),e=(e=(i=e.Regulations||(e.Regulations={})).Modals||(i.Modals={})).ApproveRegulation||(e.ApproveRegulation={}),t.prototype.$onInit=function(){var o=this,e=(this.isLoading=!0,this.loaderService.setLoader("approveRegulationModal","approveRegulationModalLoader")),t=(this.currentPage=this.modalData.currentPage,this.datePickerFormat=this.utilityService.shortDateFormat,this.datePickerToOptions=this.regulationUtilitiesService.getApproveRegulationDatepickerOptions(),this.showCompanyBoardApprovalDatePicker=this.modalData.regulation.RegulationType==i.Models.GetRegulation.RegulationType.RightOfWayCatalog,this.regulationUtilitiesService.getRegulationValidation(this.modalData.regulation,this.modalData.itemSelections));this.sectionGroupValidationErrors=t.sectionGroups,this.canApproveRegulation=!this.sectionGroupValidationErrors.any(),this.canApproveRegulation||(this.validationErrors=[],this.sectionGroupValidationErrors.forEac
1h(function(n){n.sections.orderBy(function(e){return e.name}).forEach(function(i){i.validationErrors.forEach(function(e){o.validationErrors.push({error:e,locationBreadcrumb:n.name+" / "+i.name})}),i.beforeMovingMaintenanceRuleGroups.forEach(function(t){t.validationErrors.forEach(function(e){o.validationErrors.push({error:e,locationBreadcrumb:n.name+" / "+i.name+" / NÃ¥r du flytter / "+t.name})})})})})),this.loaderService.removeLoader(e),this.isLoading=!1},t.prototype.approveRegulation=function(){var e,t=this;this.regulationService.checkMissingSectionConnections(!0)||(this.approvedDate.setUTCHours(0,0,0,0),this.modalData.regulation.RegulationType==i.Models.GetRegulation.RegulationType.RightOfWayCatalog?this.companyBoardApprovalDate.setUTCHours(0,0,0,0):this.companyBoardApprovalDate=null,e={DateOfApproval:this.approvedDate,NodeId:this.currentPage.Id,RegulationId:this.modalData.regulation.Id,RegulationItemSelections:this.modalData.itemSelections,AdditionalIntroText:this.modalData.additionalIntroText,CompanyBoardApprovalDateUtc:this.companyBoardApprovalDate},this.regulationService.approveRegulation(e).then(function(e){e&&e.Success&&t.$modalInstance.close(e)},function(e){}))},t.prototype.cancel=function(){this.$modalInstance.close()},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.$inject=["$uibModalInstance","modalData","LoaderService","RegulationService","UtilityService","RegulationUtilitiesService"],e.ApproveRegulationModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.regulationOverviewService=i,this.windowService=n,this.disposables=new Rx.CompositeDisposable,this.createdRegulationTypes=[]}e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).CreateNewRegulationTemplateSelector||(e.CreateNewRegulationTemplateSelector={}),t.prototype.$onInit=function(){var t=this;this.currentPage=this.modalData.currentPage,this.regulationOverviewService.getRegulationTemplatesForCreating(this.currentPage.Id).subscribe(function(e){e&&(t.editPageUrl=e.EditRegulationUrl,t.regulationTemplates=e.RegulationTemplates,t.allCompanies=e.AllCompanies.where(function(t){return e.AllDepartments.any(function(e){return e.Company.Id==t.Id})}).orderBy(function(e){return e.Id}),t.allDepartments=e.AllDepartments.orderBy(function(e){return e.Id}),t.selectedCompany=t.allCompanies.firstOrDefault(),t.allDepartmentsInSelectedCompany=t.allDepartments.where(function(e){return e.Company.Id==t.selectedCompany.Id}),t.selectedDepartment=t.allDepartments.orderBy(function(e){return e.Id}).where(function(e){return e.Company.Id==t.selectedCompany.Id}).firstOrDefault(),t.modalData.selectedTemplateId&&t.regulationTemplates.any(function(e){return e.Id==t.modalData.selectedTemplateId})&&(t.selectedRegulationTemplate=t.regulationTemplates.firstOrDefault(function(e){return e.Id==t.modalData.selectedTemplateId})),t.onCompanySelectionChanged())})},t.prototype.onCompanySelectionChanged=function(){var t=this;this.allDepartmentsInSelectedCompany=this.allDepartments.where(function(e){return e.Company.Id==t.selectedCompany.Id}),this.selectedDepartment=this.allDepartmentsInSelectedCompany.orderBy(function(e){return e.Id}).firstOrDefault(),this.onDepartmentSelectionChange()},t.prototype.onDepartmentSelectionChange=function(){var t=this;if(this.createdRegulationTypes=[],null!=this.selectedDepartment){var e=this.modalData.existingRegulationsGroupedByDepartment.firstOrDefault(function(e){return e.Company.Id==t.selectedDepartment.Company.Id});if(null!=e){var i=e.DepartmentsWithRegulations.firstOrDefault(function(e){return e.Department.Company.Id===t.selectedDepartment.Company.Id&&e.Department.Id===t.selectedDepartment.Id});if(i&&i.Regulations)for(var n=0;n<i.Regulations.length;n++){var o=i.Regulations[n];this.createdRegulationTypes.push(o.RegulationType)}this.isAllRegulationsAlreadyCreated()}}},t.prototype.isRegulationAlreadyCreated=function(t){return this.createdRegulationTypes.any(function(e){return e===t})},t.prototype.editRegulation=function(t){var i=this,e=this.modalData.existingRegulationsGroupedByDepartment.firstOrDefault(function(e){return e.Company.Id==i.selectedDepartment.Company.Id}).DepartmentsWithRegulations.firstOrDefault(function(e){return e.Department.Company.Id===i.selectedDepartment.Company.Id&&e.Department.Id===i.selectedDepartment.Id});e&&e.Regulations&&(e=e.Regulations.firstOrDefault(function(e){return e.RegulationType===t}),this.windowService.location.href=this.editPageUrl+"?Id="+e.Id)},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.createRegulation=function(){var e,t=this;this.selectedRegulationTemplate?(e={NodeId:this.currentPage.Id,Id:this.selectedRegulationTemplate.Id,CompanyId:this.selectedCompany.Id,DepartmentId:this.selectedDepartment.Id,HasCommonArea:this.selectedRegulationTemplate.HasCommonArea},this.regulationOverviewService.createRegulationFromTemplate(e).then(function(e){e&&e.Success&&(t.windowService.location.href=t.editPageUrl+"?Id="+e.RegulationId)})):this.showSetupError=!0},t.prototype.selectTemplate=function(e){this.selectedRegulationTemplate=e,this.showSetupError=!1},t.prototype.cancel=function(){this.$modalInstance.close()},t.prototype.isAllRegulationsAlreadyCreated=function(){var e=this,t=this.regulationTemplates.map(function(e){return e.RegulationType});this.allRegulationsAlreadyCreated=t.every(function(t){return e.createdRegulationTypes.any(function(e){return e==t})})},t.$inject=["$uibModalInstance","modalData","RegulationsOverviewService","$window"],e.CreateNewRegulationTemplateSelectorController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationService=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).DownloadDepartmentAreaRegulationPreview||(e.DownloadDepartmentAreaRegulationPreview={}),t.prototype.$onInit=function(){this.allDepartmentAreas=this.modalData.allDepartmentAreas,0!=this.allDepartmentAreas.length&&(this.selectedDepartmentArea=this.allDepartmentAreas[0],this.regulation=this.modalData.regulation)},t.prototype.downloadPDF=function(e){e={NodeId:this.modalData.currentPageId,RegulationId:this.regulation.Id,ShowRemarksAndColorCodes:e,DepartmentAreaId:this.selectedDepartmentArea.Id};this.regulationService.getPreviewFile(e),this.$modalInstance.dismiss()},t.prototype.downloadLatestApprovedPDF=function(){var e={NodeId:this.modalData.currentPageId,RegulationId:this.regulation.Id,ShowRemarksAndColorCodes:!1,DepartmentAreaId:this.selectedDepartmentArea.Id};this.regulationService.getLatestApprovedRegulationFileForDepartmentArea(e),this.$modalInstance.dismiss()},t.prototype.cancel=function(){this.$modalInstance.close()},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.$inject=["$uibModalInstance","modalData","RegulationService"],e.DownloadDepartmentAreaRegulationPreviewModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.regulationService=i,this.regulationUtilitiesService=n,this.disposables=new Rx.CompositeDisposable}e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).EditMergeFields||(e.EditMergeFields={}),t.prototype.$onInit=function(){var i=this;this.disposables.add(this.regulationService.allItemSelections$.subscribe(function(e){null!=e&&((e=(i.allItemSelections=e).firstOrDefault(function(e){return e.ItemId==i.modalData.itemId})).FieldValues=e.FieldValues.filter(function(e){return!!e.Value}),null==e||null==e.FieldValues?i.fieldValues=[]:i.fieldValues=e.FieldValues,i.regulationUtilitiesService.hasMergeFields(i.modalData.text))&&(i.regulationUtilitiesService.getMergeFields(i.modalData.text).forEach(function(t){null==i.fieldValues.firstOrDefault(function(e){return e.Key==t})&&i.fieldValues.push({Key:t,Value:""})}),i.mergeFields=i.fieldValues,i.mergedText=i.regulationUtilitiesService.replaceMergeFields(i.modalData.text,i.fieldValues))}))},t.prototype.getFieldKeyWithoutParentheses=function(e){return e.substring(2,e.length-2)},t.prototype.updateMergeText=function(){this.mergedText=this.regulationUtilitiesService.replaceMergeFields(this.modalData.text,this.fieldValues)},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.saveMergeFields=function(){this.$modalInstance.close(this.mergeFields)},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationService","RegulationUtilitiesService"],e.EditMergeFieldsController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationService=i,this.disposables=new Rx.CompositeDisposable,this.taToolbar=[["html","bold","italics","underline","ul","ol","insertLink"],["justifyLeft","justifyCenter","justifyRight"]]}e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).EditSectionGroupIntroText||(e.EditSectionGroupIntroText={}),t.prototype.$onInit=function(){this.introText=this.modalData.introText,this.sectionGroupName=this.modalData.sectionGroup.Name},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.saveIntroText=function(){var t=this,e={IntroText:this.introText,NodeId:this.modalData.currentPage.Id,RegulationId:this.modalData.regulation.Id,SectionGroupId:this.modalData.sectionGroup.Id};this.regulationService.updateSectionGroupIntroText(e).then(function(e){e&&e.Success&&t.$modalInstance.close(e)})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationService"],e.EditSectionGroupIntroTextModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationService=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).RegulationChangeLog||(e.RegulationChangeLog={}),t.prototype.$onInit=function(){var e,t=this;this.modalData.regulationId&&(e={RegulationId:this.modalData.regulationId,NodeId:this.modalData.currentPage.Id},this.regulationService.getRegulationChangeLog(e).then(function(e){e&&(t.changeLogs=e)}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.hasApprovedRegulationChangeLog=function(e){return e.BulkChangeLogEntries.any(function(e){return e.IsRegulationApprovalEntry})},t.prototype.hasTemplateChangeLog=function(e){return e.BulkChangeLogEntries.any(function(e){return e.IsRegulationTemplateChangeEntry})},t.prototype.hasRegulationMarkedAsReadyForApprovalChangeLog=function(e){return e.BulkChangeLogEntries.any(function(e){return e.IsRegulationMarkedAsReadyForApprovalEntry})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationService"],e.RegulationChangeLogController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.disposables=new Rx.CompositeDisposable,this.taToolbar=[["html","bold","italics","underline","ul","ol","insertLink"],["justifyLeft","justifyCenter","justifyRight"]]}e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).RegulationIntroText||(e.RegulationIntroText={}),t.prototype.$onInit=function(){this.introText=this.modalData.introText,this.userCanEditAdditionalIntroText=this.modalData.userCanEditAdditionalIntroText},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close(this.introText)},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.RegulationIntroTextModalController=t}(BoligExtra=BoligExtra||{}),!function(a){var e;function t(e,t,i,n,o,r){var s=this;this.$modalInstance=e,this.modalData=t,this.$scope=i,this.regulationUtilitiesService=n,this.regulationService=o,this.guidanceInformationService=r,this.disposables=new Rx.CompositeDisposable,this.title="",this.description="",this.remark="",this.taToolbar=[["html","bold","italics","underline","ul","ol","insertLink"],["justifyLeft","justifyCenter","justifyRight"]],this.currentSize=0,this.maxTotalSize=10485760,this.imagesReadyToUpload=[],this.images=[],this.$scope.$watchCollection(function(){return s.images},function(e,t){e&&0<e.length&&(s.currentSize+=e.reduce(function(e,t){return e+t.size},0),s.regulationUtilitiesService.addUploadedFiles(s.$scope,s.imagesReadyToUpload,e,a.Utility.File.UploadedFileType.Image),s.images=[])}),this.disposables.add(this.regulationService.regulation$.subscribe(function(e){e&&(s.regulation=e)}))}e=(e=(e=(e=(e=(e=a.PersonnelPortal||(a.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).RequestNewGuidanceInformation||(e.RequestNewGuidanceInformation={}),t.prototype.$onInit=function(){this.section=this.modalData.section},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.cancel=function(){this.$modalInstance.close()},t.prototype.requestGuidanceInformation=function(e){var t,i=this;e.$setDirty(!0),e.$setSubmitted(),e.$valid?this.currentSize>this.maxTotalSize||(t={Title:this.title,Description:this.description,NodeId:this.modalData.currentPage.Id,RegulationId:this.regulation.Id,Remark:this.remark,SectionId:this.section.Id},this.guidanceInformationService.suggestNewGuidanceInformation(t,this.imagesReadyToUpload).then(function(e){i.$modalInstance.close()})):angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},t.prototype.removeSelectedImage=function(e){this.currentSize-=e.file.size,this.imagesReadyToUpload.remove(e)},t.$inject=["$uibModalInstance","modalData","$scope","RegulationUtilitiesService","RegulationService","RegulationGuidanceInformationTemplateService"],e.RequestNewGuidanceInformationModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.utilityService=i,this.regulationService=n,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).RequestNewRule||(e.RequestNewRule={}),t.prototype.$onInit=function(){var t=this,e=(this.modalData.showPaymentTypes&&this.regulationService.getRegulationPaymentTypes().then(function(e){t.allPaymentTypes=e.PaymentTypes,t.suggestNewRuleInputModel.PaymentType=t.allPaymentTypes.firstOrDefault()}),this.utilityService.getParameters("querystring").Id);this.suggestNewRuleInputModel={RegulationId:e,RuleParentId:this.modalData.sectionId,RuleGroupName:this.modalData.ruleGroupName,Text:null,PaymentType:null,Remark:null}},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){var t=this;confirm("Er du sikker på du vil indsende forslaget?")&&this.regulationService.suggestNewRule(this.suggestNewRuleInputModel).then(function(e){t.$modalInstance.close()})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","UtilityService","RegulationService"],e.RequestNewRuleController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.disposables=new Rx.CompositeDisposable}e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).SectionConnectionMissingWarning||(e.SectionConnectionMissingWarning={}),t.prototype.$onInit=function(){this.showWarningForAddingSection=this.modalData.showWarningForAddingSection,this.sections=this.modalData.sections,this.showHeadersForSections=this.modalData.showHeadersForSections},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.SectionConnectionMissingWarningModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.regulationService=i,this.modalService=n,this.disposables=new Rx.CompositeDisposable}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),e=(i=e.Regulations||(e.Regulations={})).Regulations||(i.Regulations={}),e=(t=e.Modals||(e.Modals={})).SelectMaintenanceRule||(t.SelectMaintenanceRule={}),n.prototype.$onInit=function(){var e,t=this;this.maintenanceRules=this.modalData.maintenanceRules.where(function(e){return e.ColorCode!=i.ColorCode.Red}),this.illegalMaintenanceRules=this.modalData.maintenanceRules.where(function(e){return e.ColorCode==i.ColorCode.Red}),this.ruleGroupName=this.modalData.ruleGroupName,this.isObligatory=this.modalData.isObligatory,this.originallyOnlyAllowSingleSelection=this.modalData.onlyAllowSingleSelection,!this.modalData.onlyAllowSingleSelection||0==this.maintenanceRules.length||0<this.maintenanceRules[0].DepartmentAreas.length?(this.onlyAllowSingleSelection=!1,this.allDepartmentAreas=this.maintenanceRules[0].DepartmentAreas):(this.onlyAllowSingleSelection=!0,e=this.modalData.maintenanceRules.firstOrDefault(function(e){return e.Selected}),this.selectedSingleRuleId=null==e?null:e.Id),this.disposables.add(this.regulationService.regulation$.subscribe(function(e){e&&(t.regulation=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.submit=function(){var e,t=this;this.getIsDepartmentAreasSetupCorrect()&&!this.anyMaintenanceRulesHaveZeroDepartmentAreasSelected()&&(this.onlyAllowSingleSelection&&this.maintenanceRules.forEach(function(e){e.Selected=e.Id==t.selectedSingleRuleId}),this.illegalMaintenanceRules.any(function(e){return e.Selected})?((e=this.maintenanceRules).addRange(this.illegalMaintenanceRules.where(function(e){return e.Selected})),e.where(function(e){return e.ColorCode==i.ColorCode.Red&&e.Selected}).forEach(function(e){return e.Selected=!1}),this.$modalInstance.close(e)):this.$modalInstance.close(this.maintenanceRules))},n.prototype.requestNewRuleModal=function(){var e={ruleGroupName:this.modalData.ruleGroupName,sectionId:this.modalData.sectionId,showPaymentTypes:this.onlyAllowSingleSelection};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/RequestNewRule/RequestNewRule.modal.html",t.RequestNewRule.RequestNewRuleController,e,"lg")},n.prototype.getDepartmentAreasText=function(e){return e.ActiveForAllDepartmentAreas?"Alle underområder":(e=e.DepartmentAreas.filter(function(e){return e.Selected}),"".concat(e.length," ").concat(1==e.length?"valgt underområde":"valgte underområder"))},n.prototype.getIsDepartmentAreasSetupCorrect=function(){if(0!=this.maintenanceRules.length&&0!=this.maintenanceRules.filter(function(e){return e.Selected}).length&&null!=this.allDepartmentAreas&&0!=this.allDepartmentAreas.length)for(var e=0;e<this.allDepartmentAreas.length;e++){var t=this.allDepartmentAreas[e],i=this.maintenanceRules.filter(function(e){return e.Selected&&e.ActiveForAllDepartmentAreas}).length+this.maintenanceRules.filter(function(e){return e.Selected&&0==e.ActiveForAllDepartmentAreas&&e.DepartmentAreas.any(function(e){return e.Id==t.Id&&e.Selected})}).length;if(this.modalData.onlyAllowSingleSelection&&0==this.isObligatory&&1<i||this.isObligatory&&0==i||this.isObligatory&&this.modalData.onlyAllowSingleSelection&&1<i)return!1}return!0},n.prototype.anyMaintenanceRulesHaveZeroDepartmentAreasSelected=function(){return this.maintenanceRules.any(function(e){return e.Selected&&0==e.ActiveForAllDepartmentAreas&&0<e.DepartmentAreas.length&&0==e.DepartmentAreas.filter(function(e){return e.Selected}).length})},n.prototype.selectAllDepartmentAreas=function(e,t){e.DepartmentAreas.map(function(e){return e.Selected=t})},n.prototype.cancel=function(){this.$modalInstance.close()},n.$inject=["$uibModalInstance","modalData","RegulationService","ModalService"],e.SelectMaintenanceRuleModalController=n}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.selectedAttributes={},this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).SelectSectionAttribute||(e.SelectSectionAttribute={}),t.prototype.$onInit=function(){var e=this;this.modalData.sectionAttributes.forEach(function(t){e.selectedAttributes[t.Id]=e.modalData.selectedAttributes.some(function(e){return e.Id==t.Id})}),this.attributes=this.modalData.sectionAttributes,this.section=this.modalData.section},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.toggleSelectionOfSectionAttribute=function(e){this.selectedAttributes[e.Id]=!this.selectedAttributes[e.Id],this.showSelectionError=!1},t.prototype.save=function(){var t=this,e=Object.keys(this.selectedAttributes).map(function(e){return t.selectedAttributes[e]}).filter(function(e){return 1==e}).length;this.selectedAttributes&&0!=e?this.$modalInstance.close(this.selectedAttributes):this.showSelectionError=!0},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.SelectSectionAttributeModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.selectedImages={},this.disposables=new Rx.CompositeDisposable}e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Modals||(e.Modals={})).SelectSectionGuidanceInformationImages||(e.SelectSectionGuidanceInformationImages={}),t.prototype.$onInit=function(){var e=this;this.modalData.guidanceInformation.Images.forEach(function(t){e.selectedImages[t.Id]=e.modalData.selectedGuidanceInformationImages.any(function(e){return e.Id==t.Id})}),this.guidanceInformation=this.modalData.guidanceInformation,this.guidanceInformationImages=this.modalData.guidanceInformation.Images},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.toggleSelectionOfImage=function(e){this.selectedImages[e.Id]=!this.selectedImages[e.Id]},t.prototype.save=function(){this.$modalInstance.close(this.selectedImages)},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.SelectSectionGuidanceInformationImagesModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.modalService=i,this.htmlUtilityService=n,this.selectedGuidanceInformations={},this.disposables=new Rx.CompositeDisposable,this.showFullDescriptions=!1,this.descriptionCharLimit=200}e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={}),e=(t=e.Modals||(e.Modals={})).SelectSectionGuidanceInformation||(t.SelectSectionGuidanceInformation={}),i.prototype.$onInit=function(){var e=this;this.modalData.sectionGuidanceInformations.forEach(function(t){e.selectedGuidanceInformations[t.Id]=e.modalData.selectedGuidanceInformations.any(function(e){return e.Id==t.Id})}),this.guidanceInformations=this.modalData.sectionGuidanceInformations,this.section=this.modalData.section},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.toggleSelectionOfGuidanceInformation=function(e){2!=e.ColorCode&&(this.selectedGuidanceInformations[e.Id]=!this.selectedGuidanceInformations[e.Id],this.showSelectionError=!1)},i.prototype.showRequestNewGuidanceInformationModal=function(){var e={section:this.section,currentPage:this.modalData.currentPage};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/RequestNewGuidanceInformation/RequestNewGuidanceInformation.modal.html",t.RequestNewGuidanceInformation.RequestNewGuidanceInformationModalController,e,"md")},i.prototype.save=function(){var t=this,e=Object.keys(this.selectedGuidanceInformations).map(function(e){return t.selectedGuidanceInformations[e]}).filter(function(e){return 1==e}).length;this.selectedGuidanceInformations&&0!=e?this.$modalInstance.close(this.selectedGuidanceInformations):this.showSelectionError=!0},i.prototype.anyGuidanceInformationDescriptionsOverCharLimit=function(){var t=this;return this.guidanceInformations.some(function(e){return t.htmlUtilityService.countNonHtmlCharToLimit(e.Description,t.descriptionCharLimit).setEllipsis})},i.prototype.cancel=function(){this.$modalInstance.close()},i.$inject=["$uibModalInstance","modalData","ModalService","HtmlUtilityService"],e.SelectSectionGuidanceInformationModalController=i}(BoligExtra=BoligExtra||{}),!function(e){var o;function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationService=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),e=(e=(o=e.Regulations||(e.Regulations={})).Modals||(o.Modals={})).DownloadDepartmentAreaRegulationPreview||(e.DownloadDepartmentAreaRegulationPreview={}),t.prototype.$onInit=function(){this.sectionGroupSortingOptions={axis:"y",cursor:"move",handle:".section-group-sort-handle",scroll:!1,"ui-floating":!1,"ui-preserve-size":!0},this.sectionSortingOptions={axis:"y",cursor:"move",handle:".section-sort-handle",scroll:!1,"ui-floating":!1,"ui-preserve-size":!0},this.currentPage=this.modalData.currentPage,this.regulation=JSON.parse(JSON.stringify(this.modalData.regulation))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.save=function(){var t=this,i=[],n=0,e=(this.regulation.SectionGroups.forEach(function(e){i.push({ItemId:e.Id,ItemType:o.Models.GetRegulation.ItemType.SectionGroup,SortOrder:n++}),e.Sections.forEach(function(e){i.push({ItemId:e.Id,ItemType:o.Models.GetRegulation.ItemType.Section,SortOrder:n++})})}),{NodeId:this.currentPage.Id,RegulationId:this.regulation.Id,RegulationItemSortOrders:i});this.regulationService.updateRegulationItemSortOrders(e).then(function(e){e&&e.Success&&(t.regulation.RegulationItemSortOrders=i,t.regulationService.setRegulationItemSortOrders(t.regulation),t.$modalInstance.close(e))})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationService"],e.UpdateSectionSortOrdersModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var r;function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.loaderService=i,this.regulationUtilitiesService=n,this.disposables=new Rx.CompositeDisposable,this.isLoading=!0}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),e=(e=(r=e.Regulations||(e.Regulations={})).Modals||(r.Modals={})).ValidateRegulation||(e.ValidateRegulation={}),t.prototype.$onInit=function(){var o=this,e=(this.isLoading=!0,this.loaderService.setLoader("validateRegulationModal","validateRegulationModalLoader")),t=this.regulationUtilitiesService.getRegulationValidation(this.modalData.regulation,this.modalData.itemSelections);this.sectionGroupValidationErrors=t.sectionGroups,this.canApproveRegulation=!this.sectionGroupValidationErrors.any(),this.canApproveRegulation||(this.validationErrors=[],this.sectionGroupValidationErrors.forEach(function(n){n.sections.orderBy(function(e){return e.name}).forEach(function(i){i.validationErrors.forEach(function(e){o.validationErrors.push({error:e,locationBreadcrumb:n.name+" / "+i.name})}),i.beforeMovingMaintenanceRuleGroups.forEach(function(t){t.validationErrors.forEach(function(e){o.validationErrors.push({error:e,locationBreadcrumb:o.modalData.regulation.RegulationType==r.Models.GetRegulation.RegulationType.HouseRules?n.name+" / "+i.name+" / "+t.name:n.name+" / "+i.name+" / NÃ¥r du flytter / "+t.name})})})})})),this.loaderService.removeLoader(e),this.isLoading=!1},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","LoaderService","RegulationUtilitiesService"],e.ValidateRegulationModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t,n,i;function o(e,t,i,n,o,r,s,a){this.pageContentService=e,this.regulationService=t,this.utilityService=i,this.scope=n,this.modalService=o,this.windowService=r,this.fileService=s,this.htmlUtilityService=a,this.disposables=new Rx.CompositeDisposable,this.currentChangesAreSaved=!0,this.itemSelections=[],this.showFullAdditionalIntroText=!1,this.additionalIntroTextCharLimit=200}t=(t=(t=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(t.Administration={})).Regulations||(t.Regulations={}),n=t.Regulations||(t.Regulations={}),o.prototype.$onInit=function(){var t=this;this.regulationService.resetRegulationSubject(),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e,t.getRegulationToEdit())}),this.regulationService.getRegulationsOverviewPage(this.currentPage.Id).then(function(e){e&&(t.regulationOverviewPage=e)}),this.subscribeToItemSelectionChanges(),this.setupOnBeforeUnload(),this.enableSorting=e.CrossPortal.Settings.Settings.enableRegulationSectionSorting},o.prototype.$onDestroy=function(){this.disposables.dispose(),this.currentChangesAreSaved=!0,window.onbeforeunload=void 0},o.prototype.cancelEdit=function(){this.windowService.location.href=this.regulationOverviewPage.Url},o.prototype.getRegulationToEdit=function(){var o=this,e=this.utilityService.getParameters("querystring").Id;
1e&&(e={NodeId:this.currentPage.Id,RegulationId:e},this.disposables.add(Rx.Observable.combineLatest(this.regulationService.getRegulation(e),this.regulationService.regulationState$).subscribe(function(e){var t=e[0],e=e[1];if(t){o.regulation=t;for(var i=0;i<t.RegulationItemSelections.length;i++){var n=t.RegulationItemSelections[i],n={IsSelected:n.IsSelected,ItemId:n.ItemId,ItemType:n.ItemType,FieldValues:n.FieldValues,DepartmentAreas:n.DepartmentAreas};o.itemSelections.push(n)}o.selectedCompany=t.Company,o.selectedDepartment=t.Department,o.lastEdited=t.LastEdited,o.lastEditedBy=t.LastEditedBy,o.userCanApproveRegulation=t.UserCanApproveRegulation,o.userCanFinishRegulationApproval=t.UserCanFinishRegulationApproval,o.userCanPublishToDepartment=t.UserCanPublishToDepartment,o.userCanEditAdditionalIntroText=t.UserCanEditAdditionalIntroText}null!=e&&(o.regulationState=e,o.regulation&&(o.regulation.RegulationState=e),o.regulationIsLocked=2==e||3==e&&(null==o.regulation||!o.userCanFinishRegulationApproval))})))},o.prototype.subscribeToItemSelectionChanges=function(){var i=this;this.disposables.add(this.regulationService.addItemSelection$.subscribe(function(t){var e;i.itemSelections.any(function(e){return e.ItemId==t.ItemId})?(1<i.itemSelections.filter(function(e){return e.ItemId==t.ItemId}).length&&(e=[],i.itemSelections.forEach(function(t){e.every(function(e){return e.ItemId!=t.ItemId})&&e.push(t)}),i.itemSelections=e),i.itemSelections.firstOrDefault(function(e){return e.ItemId==t.ItemId}).IsSelected=t.IsSelected,i.itemSelections.firstOrDefault(function(e){return e.ItemId==t.ItemId}).FieldValues=t.FieldValues,i.itemSelections.firstOrDefault(function(e){return e.ItemId==t.ItemId}).DepartmentAreas=t.DepartmentAreas):i.itemSelections.add(t),i.currentChangesAreSaved=!1,i.regulationService.itemCountUpdate$.onNext(t.ItemId),i.regulationService.updateAllItemSelections(i.itemSelections)})),this.disposables.add(this.regulationService.removeItemSelection$.subscribe(function(t){var e;i.itemSelections.any(function(e){return e.ItemId==t.ItemId})&&(1<i.itemSelections.filter(function(e){return e.ItemId==t.ItemId}).length&&(e=[],i.itemSelections.forEach(function(t){e.every(function(e){return e.ItemId!=t.ItemId})&&e.push(t)}),i.itemSelections=e),i.itemSelections.firstOrDefault(function(e){return e.ItemId==t.ItemId}).IsSelected=t.IsSelected),i.currentChangesAreSaved=!1,i.regulationService.itemCountUpdate$.onNext(t.ItemId),i.regulationService.updateAllItemSelections(i.itemSelections)}))},o.prototype.saveRegulation=function(){var e,t=this;this.regulation&&(e={NodeId:this.currentPage.Id,RegulationId:this.regulation.Id,RegulationItemSelections:this.itemSelections,AdditionalIntroText:this.regulation.AdditionalIntroText},this.regulationService.updateRegulation(e).then(function(e){e&&(t.currentChangesAreSaved=!0,t.lastEdited=e.LastEdited,t.lastEditedBy=e.LastEditedBy,t.regulationService.checkMissingSectionConnections(!1))}))},o.prototype.setupOnBeforeUnload=function(){var n="Er du sikker på at du vil navigere væk fra siden?";window.onbeforeunload=function(e){if(1!=this.currentChangesAreSaved)return(e=void 0===e?window.event:e)&&(e.returnValue=n),n}.bind(this),this.scope.$on("$locationChangeStart",function(e,t,i){this.currentChangesAreSaved||confirm(n)||e.preventDefault()}.bind(this))},o.prototype.openChangeLogModal=function(){var e={regulationId:this.regulation.Id,currentPage:this.currentPage};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/RegulationChangeLog/RegulationChangeLog.modal.html",n.Modals.RegulationChangeLog.RegulationChangeLogController,e,"lg")},o.prototype.downloadPreviewFile=function(e){e={NodeId:this.currentPage.Id,RegulationId:this.regulation.Id,ShowRemarksAndColorCodes:e,DepartmentAreaId:null};this.regulationService.getPreviewFile(e)},o.prototype.publishRegulationToDepartment=function(){var e,t=this;this.regulationService.checkMissingSectionConnections(!1)||confirm("Er du sikker på at du vil udgive dette reglement til afdelingen?")&&(e={NodeId:this.currentPage.Id,RegulationId:this.regulation.Id},this.regulationService.publishRegulationToDepartment(e).then(function(e){e.Success&&(t.regulation.PublishedToDepartment=!0,t.regulationService.regulationState$.onNext(n.Models.GetRegulation.RegulationStatusType.InProgress))}))},o.prototype.validateRegulation=function(){var e={regulation:this.regulation,itemSelections:this.itemSelections}
1,e={backdrop:!0,controller:n.Modals.ValidateRegulation.ValidateRegulationModalController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/ValidateRegulation/ValidateRegulation.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e)},o.prototype.approveRegulation=function(){var e,t=this;this.regulationService.checkMissingSectionConnections(!0)||(e={regulation:this.regulation,itemSelections:this.itemSelections,currentPage:this.currentPage,additionalIntroText:this.regulation.AdditionalIntroText},e={backdrop:!0,controller:n.Modals.ApproveRegulation.ApproveRegulationModalController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/ApproveRegulation/ApproveRegulation.modal.html",size:"lg",keyboard:!0},this.modalService.createModalWithSettings(e).result.then(function(e){e&&1==e.Success&&(t.currentChangesAreSaved=!0,t.lastEdited=e.LastEdited,t.lastEditedBy=e.LastEditedBy,t.fileService.downloadFile([e.File]),t.regulationService.resetRegulationSubject(),t.regulation=null,setTimeout(function(){t.getRegulationToEdit()}))},function(e){}))},o.prototype.markRegulationReadyForApproval=function(){var e,t=this;this.regulationService.checkMissingSectionConnections(!1)||confirm("Er du sikker på du vil markere reglement som klar til godkendelse?")&&(e={NodeId:this.currentPage.Id,RegulationId:this.regulation.Id},this.regulationService.markRegulationReadyForApproval(e).then(function(e){e&&e.Success&&t.regulationService.regulationState$.onNext(n.Models.GetRegulation.RegulationStatusType.Locked)}))},o.prototype.markRegulationAsRejected=function(){var t,i=this;confirm("Er du sikker på du vil markere reglement som afvist på afdelingsmødet?")&&(t={NewRegulationStatus:n.Models.GetRegulation.RegulationStatusType.InProgress,NodeId:this.currentPage.Id,RegulationId:this.regulation.Id},this.regulationService.updateRegulationStatus(t).then(function(e){e&&e.Success&&i.regulationService.regulationState$.onNext(t.NewRegulationStatus)}))},o.prototype.markRegulationAsApproved=function(){var t,i=this;confirm("Er du sikker på du vil markere reglement som godkendt på afdelingsmødet?")&&(t={NewRegulationStatus:n.Models.GetRegulation.RegulationStatusType.Approved,NodeId:this.currentPage.Id,RegulationId:this.regulation.Id},this.regulationService.updateRegulationStatus(t).then(function(e){e&&e.Success&&i.regulationService.regulationState$.onNext(t.NewRegulationStatus)}))},o.prototype.openIntroText=function(){var t=this,e={introText:this.regulation.AdditionalIntroText,userCanEditAdditionalIntroText:this.userCanEditAdditionalIntroText};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/RegulationIntroText/RegulationIntroText.modal.html",n.Modals.RegulationIntroText.RegulationIntroTextModalController,e,"lg").result.then(function(e){t.regulation.AdditionalIntroText=e})},o.prototype.isAdditionalIntroTextOverCharLimit=function(){return this.regulation&&this.regulation.AdditionalIntroText&&this.htmlUtilityService.countNonHtmlCharToLimit(this.regulation.AdditionalIntroText,this.additionalIntroTextCharLimit).setEllipsis},o.prototype.sendDiffFile=function(){var e={NodeId:this.currentPage.Id,RegulationId:this.regulation.Id};this.regulationService.sendDiffFile(e)},o.prototype.downloadPreviewFileForDepartmentArea=function(){var e={allDepartmentAreas:this.regulation.DepartmentAreas,currentPageId:this.currentPage.Id,regulation:this.regulation};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/DownloadDepartmentAreaRegulationPreview/DownloadDepartmentAreaRegulationPreview.modal.html",n.Modals.DownloadDepartmentAreaRegulationPreview.DownloadDepartmentAreaRegulationPreviewModalController,e,"lg")},o.prototype.showSortContentModal=function(){var t=this,e={currentPage:this.currentPage,regulation:this.regulation};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/UpdateRegulationItemSortOrders/UpdateRegulationItemSortOrders.modal.html",n.Modals.DownloadDepartmentAreaRegulationPreview.UpdateSectionSortOrdersModalController,e,"lg").result.then(function(e){e&&e.Success&&(t.lastEdited=e.LastEdited,t.lastEditedBy=e.LastEditedBy)})},o.$inject=["PageContentService","RegulationService","UtilityService","$scope","ModalService","$window","FileService","HtmlUtilityService"],i=o,t=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/Regulation.component.html",this.bindings={}},app.component("regulation",new t)}(BoligExtra=BoligExtra||{}),!function(e){var n;function t(e,t,i,n){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.modalService=n,this.baseurl="/umbraco/api/Regulations/",this.regulation$=new Rx.ReplaySubject(1),this.removeItemSelection$=new Rx.Subject,this.addItemSelection$=new Rx.Subject,this.allItemSelections$=new Rx.ReplaySubject(1),this.itemCountUpdate$=new Rx.Subject,this.regulationState$=new Rx.ReplaySubject(1)}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),n=e.Regulations||(e.Regulations={}),t.prototype.getRegulation=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetRegulation");return this.incomHttp.post(this.baseurl+"GetRegulation",e).then(function(e){t.regulation=e,t.regulation$.onNext(e),t.updateAllItemSelections(e.RegulationItemSelections),t.regulationState$.onNext(e.RegulationState),t.loaderService.removeLoader(i)}),this.regulation$},t.prototype.updateRegulation=function(e){var t=this,i=this.loaderService.setLoader("contentSection","updateRegulationLoader"),e=this.incomHttp.post(this.baseurl+"UpdateRegulation",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateRegulationItemSortOrders=function(e){var t=this,i=this.loaderService.setLoader("contentSection","updateRegulationItemSortOrdersLoader"),e=this.incomHttp.post(this.baseurl+"UpdateRegulationItemSortOrders",e);return e.finally(function(){t.loaderService.removeLoader(i)}),e},t.prototype.getRegulationChangeLog=function(e){var t=this,i=this.loaderService.setLoader("regulationChangeLogModal","GetRegulationChangeLog"),e=this.incomHttp.post(this.baseurl+"GetRegulationChangeLog",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getPreviewFile=function(t){var i=this,n=this.loaderService.setLoader("contentSection","getPreviewFileLoader");this.incomHttp.get(this.baseurl+"HasAccessToPreviewFile?nodeId="+t.NodeId).then(function(e){e&&i.incomHttp.post(i.baseurl+"SendPreviewFile",t),i.loaderService.removeLoader(n)})},t.prototype.getLatestApprovedRegulationFileForDepartmentArea=function(t){var i=this,n=this.loaderService.setLoader("contentSection","getPreviewFileLoader");this.incomHttp.get(this.baseurl+"HasAccessToPreviewFile?nodeId="+t.NodeId,{suppressFeedback:!0}).then(function(e){e&&i.incomHttp.post(i.baseurl+"GetLatestApprovedRegulationFileForDepartmentArea",t),i.loaderService.removeLoader(n)})},t.prototype.publishRegulationToDepartment=function(e){var t=this,i=this.loaderService.setLoader("contentSection","PublishRegulationToDepartmentLoader"),e=this.incomHttp.post(this.baseurl+"PublishRegulationToDepartment",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getRegulationsOverviewPage=function(e){return this.incomHttp.get(this.baseurl+"GetRegulationsOverviewPage?nodeId="+e)},t.prototype.approveRegulation=function(e){var t=this,i=this.loaderService.setLoader("approveRegulationModal","approveRegulationModalLoader"),e=this.incomHttp.post(this.baseurl+"ApproveRegulation",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.markRegulationReadyForApproval=function(e){var t=this,i=this.loaderService.setLoader("contentSection","markRegulationReadyForApprovalLoader"),e=this.incomHttp.post(this.baseurl+"MarkRegulationReadyForApproval",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getRegulationPaymentTypes=function(){return this.incomHttp.get(this.baseurl+"GetRegulationPaymentTypes")},t.prototype.suggestNewRule=function(e){return this.incomHttp.post(this.baseurl+"SuggestNewRule",e)},t.prototype.updateSectionGroupIntroText=function(e){var t=this,i=this.loaderService.setLoader("EditSectionGroupIntroTextLoader","EditSectionGroupIntroTextLoader"),e=this.incomHttp.post(this.baseurl+"UpdateSectionGroupIntroText",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.checkMissingSectionConnections=function(t){var e=this.regulation,i=this.getSelectedSections().filter(function(e){return e.SectionConnections.any(function(e){return t?e.MissingSectionConnectionInApprovedMaintenanceRegulation:e.MissingSectionConnectionInMaintenanceRegulationDraft})});return!(e.RegulationType!=n.Models.GetRegulation.RegulationType.RightOfWayCatalog||!i.any()||(this.showSectionConnectionsWarning(),0))},t.prototype.getSelectedSections=function(){var e,t=this.regulation,i=this.allItemSelections;return null==t||null==i?[]:(e=[]).concat.apply(e,t.SectionGroups.map(function(e){return e.Sections.where(function(t){return i.any(function(e){return e.ItemId==t.Id&&e.IsSelected})})}))},t.prototype.updateRegulationStatus=function(e){var t=this,i=this.loaderService.setLoader("contentSection","updateRegulationStatusLoader"),e=this.incomHttp.post(this.baseurl+"UpdateRegulationStatus",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.sendDiffFile=function(t){var i=this,n=this.loaderService.setLoader("contentSection","sendDiffFileLoader");this.incomHttp.get(this.baseurl+"HasAccessToPreviewFile?nodeId="+t.NodeId).then(function(e){e&&i.incomHttp.post(i.baseurl+"SendDiffFile",t),i.loaderService.removeLoader(n)})},t.prototype.showSectionConnectionsWarning=function(){var e;this.regulation.RegulationType==n.Models.GetRegulation.RegulationType.RightOfWayCatalog&&(e=this.getSelectedSections().filter(function(e){return e.SectionConnections.any(function(e){return e.MissingSectionConnectionInMaintenanceRegulationDraft||e.MissingSectionConnectionInApprovedMaintenanceRegulation})})).any()&&this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/SectionConnectionMissingWarning/SectionConnectionMissingWarning.modal.html",n.Modals.SectionConnectionMissingWarning.SectionConnectionMissingWarningModalController,{showWarningForAddingSection:!1,sections:e,showHeadersForSections:!0},"md")},t.prototype.resetRegulationSubject=function(){this.regulation$.onNext(null),this.regulationState$.onNext(null),this.regulation=null,this.updateAllItemSelections(null)},t.prototype.updateAllItemSelections=function(e){this.allItemSelections$.onNext(e),this.allItemSelections=e},t.prototype.setRegulationItemSortOrders=function(t){var i=this;t.SectionGroups.forEach(function(e){e.SortOrder=i.getItemSortOrder(t,e.Id),e.Sections.forEach(function(e){e.SortOrder=i.getItemSortOrder(t,e.Id)}),e.Sections.some(function(e){return 0<e.SortOrder})||(e.Sections=e.Sections.orderBy(function(e){return e.Name}))}),this.regulation=t,this.regulation$.onNext(t)},t.prototype.getItemSortOrder=function(e,t){return 0!=e.RegulationItemSortOrders.length&&(e=e.RegulationItemSortOrders.firstOrDefault(function(e){return e.ItemId==t}))?e.SortOrder:0},t.$inject=["incomHttpService","LoaderService","FileService","ModalService"],app.service("RegulationService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i){this.regulationOverviewService=e,this.pageContentService=t,this.modalService=i,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),t=e.Regulations||(e.Regulations={}),n.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e,t.disposables.add(t.regulationOverviewService.getRegulationsOverview(e.Id).subscribe(function(e){e&&(t.editUrl=e.EditUrl,t.allGroupedCompanyRegulations=e.GroupedCompanyRegulations,t.displayGroupedCompanyRegulations=t.allGroupedCompanyRegulations,t.canCreateNewRegulation=e.CanCreateNewRegulation)})))})},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.createNewRegulation=function(){var e={currentPage:this.currentPage,existingRegulationsGroupedByDepartment:this.allGroupedCompanyRegulations},e={backdrop:!0,controller:t.Modals.CreateNewRegulationTemplateSelector.CreateNewRegulationTemplateSelectorController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/CreateNewRegulationTemplateSelector/CreateNewRegulationTemplateSelector.modal.html",size:"lg",keyboard:!0};this.modalService.createModalWithSettings(e)},n.prototype.onCompanySelectionChanged=function(){var t=this;this.selectedCompany?this.displayGroupedCompanyRegulations=this.allGroupedCompanyRegulations.filter(function(e){return e.Company.Id==t.selectedCompany.Company.Id}):this.displayGroupedCompanyRegulations=this.allGroupedCompanyRegulations},n.$inject=["RegulationsOverviewService","PageContentService","ModalService"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/Regulations/RegulationsOverview.component.html",this.bindings={}},app.component("regulationsOverview",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/RegulationsOverview/",this.regulationOverviews$=new Rx.Subject,this.regulationTemplatesForCreating$=new Rx.BehaviorSubject(null)}
1(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={}),t.prototype.getRegulationsOverview=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetRegulationsOverview");return this.incomHttp.get(this.baseurl+"GetRegulationsOverview?nodeId="+e).then(function(e){t.regulationOverviews$.onNext(e),t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),this.regulationOverviews$},t.prototype.getRegulationTemplatesForCreating=function(e){var t=this,i=this.loaderService.setLoader("createNewRegulationModal","GetRegulationTemplatesForCreating");return this.incomHttp.get(this.baseurl+"GetRegulationTemplatesForCreating?nodeId="+e).then(function(e){t.regulationTemplatesForCreating$.onNext(e),t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),this.regulationTemplatesForCreating$},t.prototype.createRegulationFromTemplate=function(e){var t=this,i=this.loaderService.setLoader("createNewRegulationModal","CreateRegulation"),e=this.incomHttp.post(this.baseurl+"CreateRegulationFromTemplate",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getApprovedRegulationPdfData=function(e){var t=this,i=this.loaderService.setLoader("contentSection","CreateRegulation"),e=this.incomHttp.post(this.baseurl+"GetApprovedRegulationPdfData",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationsOverviewService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t,n,i;function o(e,t,i,n,o){this.regulationTemplatesOverviewService=e,this.pageContentService=t,this.modalService=i,this.regulationOverviewService=n,this.featureFlagService=o,this.disposables=new Rx.CompositeDisposable}t=(t=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(t.Administration={}),n=t.Regulations||(t.Regulations={}),o.prototype.$onInit=function(){var t=this;this.showMaintenanceRegulations=e.CrossPortal.Settings.Settings.showMaintenanceRegulations,this.showHouseRulesRegulations=e.CrossPortal.Settings.Settings.showHouseRulesRegulations,this.showRightOfWayCatalogsRegulations=e.CrossPortal.Settings.Settings.showRightOfWayCatalogsRegulations,this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e,t.disposables.add(t.regulationTemplatesOverviewService.getRegulationTemplatesOverview(e.Id).subscribe(function(e){e&&(t.regulationTemplatesOverview=e,t.setOverflowMenuItems(t.regulationTemplatesOverview,t.regulationTemplatesOverview.MaintenanceRegulations),t.setOverflowMenuItems(t.regulationTemplatesOverview,t.regulationTemplatesOverview.HouseRules),t.setOverflowMenuItems(t.regulationTemplatesOverview,t.regulationTemplatesOverview.RightOfWayCatalogs))})))})},o.prototype.$onDestroy=function(){this.disposables.dispose()},o.prototype.setOverflowMenuItems=function(n,e){var o=this;e.forEach(function(e,t){var i=[];i.push({IconClass:"btn-icon btn-file",Text:"Opret reglement fra skabelon",Callback:o.startCreatingRegulationFromTemplate.bind(o,e)}),i.push({IconClass:"btn-icon btn-edit",Text:"Rediger",Url:n.EditUrl+"?Id="+e.Id}),e.FoldoutMenu={FoldoutMenuItems:i,ShowFoldoutMenu:!1}})},o.prototype.startCreatingRegulationFromTemplate=function(t){var i=this;this.disposables.add(this.regulationOverviewService.getRegulationsOverview(this.currentPage.Id).subscribe(function(e){e&&(i.groupedCompanyRegulations=e.GroupedCompanyRegulations,e={currentPage:i.currentPage,selectedTemplateId:t.Id,existingRegulationsGroupedByDepartment:i.groupedCompanyRegulations},e={backdrop:!0,controller:n.Regulations.Modals.CreateNewRegulationTemplateSelector.CreateNewRegulationTemplateSelectorController,data:e,template:"/app/PersonnelPortal/Administration/Regulations/Regulations/Modals/CreateNewRegulationTemplateSelector/CreateNewRegulationTemplateSelector.modal.html",size:"lg",keyboard:!0},i.modalService.createModalWithSettings(e))}))},o.$inject=["RegulationTemplatesOverviewService","PageContentService","ModalService","RegulationsOverviewService","FeatureFlagService"],i=o,t=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplatesOverview.component.html",this.bindings={}},app.component("regulationTemplatesOverview",new t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/RegulationTemplatesOverview/",this.regulationTemplateOverviews$=new Rx.Subject}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),t.prototype.getRegulationTemplatesOverview=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetRegulationTemplatesOverview");return this.incomHttp.get(this.baseurl+"GetRegulationTemplatesOverview?nodeId="+e).then(function(e){t.regulationTemplateOverviews$.onNext(e),t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),this.regulationTemplateOverviews$},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationTemplatesOverviewService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}
1(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).ColorCodeIcon||(e.ColorCodeIcon={}),i.prototype.getColorCodeText=function(){switch(this.colorCode){case 0:return"Anbefalet";case 1:return"Ikke anbefalet";case 2:return"IKKE TILLADT";default:return""}},t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/ColorCodeIcon/ColorCodeIcon.component.html",this.bindings={colorCode:"<",showColorCodeText:"<"}},app.component("colorCodeIcon",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n){this.regulationTemplateService=e,this.pageContentService=t,this.modalService=i,this.regulationMaintenanceRuleTemplateService=n,this.showRule=!0,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateBeforeMovingMaintenanceRule||(e.TemplateBeforeMovingMaintenanceRule={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.regulationTemplateService.maintenanceSchemeToDisplay$.subscribe(function(e){e&&(t.showRule=e.contains(t.beforeMovingMaintenanceRule.MaintenanceScheme.MaintenanceScheme))})),this.setupFoldoutMenuItems(),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.startEditingMaintenanceRule=function(){var t=this,e={isEditing:!(this.foldoutMenu.ShowFoldoutMenu=!1),regulationId:this.regulationId,regulationType:this.regulationType,currentPage:this.currentPage,maintenanceRule:this.beforeMovingMaintenanceRule};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/BeforeMovingMaintenanceRule.modal.html",i.Modals.BeforeMovingMaintenanceRuleModalController,e,"lg").result.then(function(e){e&&(t.beforeMovingMaintenanceRule.ColorCode=(e=e).ColorCode,t.beforeMovingMaintenanceRule.MaintenanceScheme=e.MaintenanceScheme,t.beforeMovingMaintenanceRule.PaymentType=e.PaymentType,t.beforeMovingMaintenanceRule.Recommended=e.Recommended,t.beforeMovingMaintenanceRule.Remark=e.Remark,t.beforeMovingMaintenanceRule.Text=e.Text)},function(e){})},n.prototype.deleteMaintenanceRule=function(){var e,t,i=this;confirm("Er du sikker på at du vil slette reglen '".concat(this.beforeMovingMaintenanceRule.Text,"'?"))&&(e={NodeId:this.currentPage.Id,Id:this.beforeMovingMaintenanceRule.Id,RegulationId:this.regulationId},t=this.beforeMovingMaintenanceRule.Id,this.regulationMaintenanceRuleTemplateService.deleteMaintenanceRule(e).then(function(e){e&&e.Success&&(i.beforeMovingMaintenanceRuleGroup.MaintenanceRules=i.beforeMovingMaintenanceRuleGroup.MaintenanceRules.filter(function(e){return e.Id!=t}))}))},n.prototype.setupFoldoutMenuItems=function(){var e=[];e.push({IconClass:"btn-icon btn-reset",Text:"Slet regel",IsRedButton:!0,Callback:this.deleteMaintenanceRule.bind(this)}),e.push({IconClass:"btn-icon btn-edit",Text:"Rediger",Callback:this.startEditingMaintenanceRule.bind(this)}),this.foldoutMenu={FoldoutMenuItems:e,ShowFoldoutMenu:!1}},n.$inject=["RegulationTemplateService","PageContentService","ModalService","RegulationMaintenanceRuleTemplateService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateBeforeMovingMaintenanceRule/TemplateBeforeMovingMaintenanceRule.component.html",this.bindings={beforeMovingMaintenanceRule:"=",beforeMovingMaintenanceRuleGroup:"=",section:"=",regulationId:"<",regulationType:"<"}},app.component("templateBeforeMovingMaintenanceRule",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t){this.pageContentService=e,this.modalService=t,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1,this.newMaintenanceRuleName=""}
1e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateGeneralMaintenanceRuleList||(e.TemplateGeneralMaintenanceRuleList={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.startCreatingMaintenanceRule=function(){var t=this,e={isEditing:!1,currentPage:this.currentPage,regulationId:this.regulationId,section:this.section,maintenanceRuleGroupType:this.maintenanceRuleGroupType};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/GeneralMaintenanceRule.modal.html",i.Modals.GeneralMaintenanceRuleModalController,e,"lg").result.then(function(e){t.generalMaintenanceRules||(t.generalMaintenanceRules=[]),t.generalMaintenanceRules.add(e)},function(e){})},n.$inject=["PageContentService","ModalService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateGeneralMaintenanceRuleList/TemplateGeneralMaintenanceRuleList.component.html",this.bindings={generalMaintenanceRules:"<",ruleGroupName:"@",section:"<",regulationId:"<",maintenanceRuleGroupType:"<"}},app.component("templateGeneralMaintenanceRuleList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n){this.regulationTemplateService=e,this.pageContentService=t,this.modalService=i,this.regulationMaintenanceRuleTemplateService=n,this.disposables=new Rx.CompositeDisposable,this.showRule=!0,this.showAccordion=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateGeneralMaintenanceRule||(e.TemplateGeneralMaintenanceRule={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.regulationTemplateService.maintenanceSchemeToDisplay$.subscribe(function(e){e&&(t.showRule=e.contains(t.maintenanceRule.MaintenanceScheme.MaintenanceScheme))})),this.setupFoldoutMenuItems(),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.setupFoldoutMenuItems=function(){var e=[];e.push({IconClass:"btn-icon btn-reset",Text:"Slet regel",IsRedButton:!0,Callback:this.deleteMaintenanceRule.bind(this)}),e.push({IconClass:"btn-icon btn-edit",Text:"Rediger",Callback:this.startEditingMaintenanceRule.bind(this)}),this.foldoutMenu={FoldoutMenuItems:e,ShowFoldoutMenu:!1}},n.prototype.startEditingMaintenanceRule=function(){var t=this,e={isEditing:!(this.foldoutMenu.ShowFoldoutMenu=!1),regulationId:this.regulationId,currentPage:this.currentPage,maintenanceRule:this.maintenanceRule};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/GeneralMaintenanceRule.modal.html",i.Modals.GeneralMaintenanceRuleModalController,e,"lg").result.then(function(e){t.maintenanceRule.ColorCode=e.ColorCode,t.maintenanceRule.MaintenanceScheme=e.MaintenanceScheme,t.maintenanceRule.PaymentType=e.PaymentType,t.maintenanceRule.Recommended=e.Recommended,t.maintenanceRule.Remark=e.Remark,t.maintenanceRule.Text=e.Text},function(e){})},n.prototype.deleteMaintenanceRule=function(){var e,t,i=this;confirm("Er du sikker på at du vil slette reglen '".concat(this.maintenanceRule.Text,"'?"))&&(e={NodeId:this.currentPage.Id,Id:this.maintenanceRule.Id,RegulationId:this.regulationId},t=this.maintenanceRule.Id,this.regulationMaintenanceRuleTemplateService.deleteMaintenanceRule(e).then(function(e){e&&e.Success&&(i.maintenanceRules=i.maintenanceRules.filter(function(e){return e.Id!=t}))}))},n.$inject=["RegulationTemplateService","PageContentService","ModalService","RegulationMaintenanceRuleTemplateService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateGeneralMaintenanceRule/TemplateGeneralMaintenanceRule.component.html",this.bindings={maintenanceRules:"=",maintenanceRule:"=",section:"=",regulationId:"<"}},app.component("templateGeneralMaintenanceRule",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t){this.pageContentService=e,this.modalService=t,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1,this.showCreateMaintenanceRuleGroup=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateMaintenanceRuleGroupList||(e.TemplateMaintenanceRuleGroupList={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.startCreatingMaintenanceRuleGroup=function(){var t=this,e={isEditing:!1,currentPage:this.currentPage,regulationId:this.regulationId,regulationType:this.regulationType,section:this.section};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/MaintenanceRuleGroup.modal.html",i.Modals.MaintenanceRuleGroupModalController,e,"lg").result.then(function(e){t.maintenanceRuleGroups||(t.maintenanceRuleGroups=[]),t.maintenanceRuleGroups.add(e)},function(e){})},n.$inject=["PageContentService","ModalService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateMaintenanceRuleGroupList/TemplateMaintenanceRuleGroupList.component.html",this.bindings={maintenanceRuleGroups:"<",ruleGroupName:"@",section:"=",regulationId:"<",regulationType:"<"}},app.component("templateMaintenanceRuleGroupList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i){this.pageContentService=e,this.modalService=t,this.regulationMaintenanceRuleGroupTemplateService=i,this.disposables=new Rx.CompositeDisposable,this.editMaintenanceRuleGroupText="",this.editMaintenanceRuleGroupObligatory=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateMaintenanceRuleGroup||(e.TemplateMaintenanceRuleGroup={}),n.prototype.$onInit=function(){var t=this;this.setupFoldoutMenuItems(),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.setupFoldoutMenuItems=function(){var e=[];e.push({IconClass:"btn-icon btn-reset",Text:"Slet regelgruppe",IsRedButton:!0,Callback:this.deleteMaintenanceRuleGroup.bind(this)}),e.push({IconClass:"btn-icon btn-edit",Text:"Rediger",Callback:this.startEditingMaintenanceRuleGroup.bind(this)}),this.foldoutMenu={FoldoutMenuItems:e,ShowFoldoutMenu:!1}},n.prototype.startEditingMaintenanceRuleGroup=function(){var t=this,e={isEditing:!(this.foldoutMenu.ShowFoldoutMenu=!1),regulationType:this.regulationType,currentPage:this.currentPage,regulationId:this.regulationId,section:this.section,maintenanceRuleGroup:this.maintenanceRuleGroup};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/MaintenanceRuleGroup.modal.html",i.Modals.MaintenanceRuleGroupModalController,e,"lg").result.then(function(e){t.maintenanceRuleGroup.AllowMultipleSelection=e.AllowMultipleSelection,t.maintenanceRuleGroup.Required=e.Required,t.maintenanceRuleGroup.Text=e.Text},function(e){})},n.prototype.deleteMaintenanceRuleGroup=function(){var e,t,i=this;confirm("Er du sikker på at du vil slette regelgruppen '".concat(this.maintenanceRuleGroup.Text,"'?"))&&(e={NodeId:this.currentPage.Id,Id:this.maintenanceRuleGroup.Id,RegulationId:this.regulationId},t=this.maintenanceRuleGroup.Id,this.regulationMaintenanceRuleGroupTemplateService.deleteMaintenanceRuleGroup(e).then(function(e){e&&e.Success&&(i.section.BeforeMovingRuleGroups=i.section.BeforeMovingRuleGroups.filter(function(e){return e.Id!=t}))}))},n.prototype.startCreatingMaintenanceRule=function(){var t=this,e={isEditing:!1,currentPage:this.currentPage,regulationId:this.regulationId,regulationType:this.regulationType,section:this.section,maintenanceRuleGroupType:i.Models.Enums.MaintenanceRuleGroupType.BeforeMoving,maintenanceRuleGroupId:this.maintenanceRuleGroup.Id};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/BeforeMovingMaintenanceRule.modal.html",i.Modals.BeforeMovingMaintenanceRuleModalController,e,"lg").result.then(function(e){e&&(e=e,t.maintenanceRuleGroup.MaintenanceRules||(t.maintenanceRuleGroup.MaintenanceRules=[]),t.maintenanceRuleGroup.MaintenanceRules.add(e))},function(e){})},n.$inject=["PageContentService","ModalService","RegulationMaintenanceRuleGroupTemplateService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateMaintenanceRuleGroup/TemplateMaintenanceRuleGroup.component.html",this.bindings={maintenanceRuleGroup:"=",section:"=",regulationId:"<",regulationType:"<"}},app.component("templateMaintenanceRuleGroup",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i){this.modalService=e,this.pageContentService=t,this.regulationTemplateService=i,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateSectionAttributes||(e.TemplateSectionAttributes={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.startCreatingSectionAttribute=function(){var t=this,e={isEditing:!1,currentPage:this.currentPage,section:this.section,regulationTemplateId:this.regulationTemplateId};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/SectionAttribute.modal.html",i.Modals.SectionAttributeModalController,e,"lg").result.then(function(e){t.section.SectionAttributes||(t.section.SectionAttributes=[]),t.section.SectionAttributes.add(e)},function(e){})},n.$inject=["ModalService","PageContentService","RegulationTemplateService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateSectionAttributes/TemplateSectionAttributes.component.html",this.bindings={section:"<",regulationTemplateId:"<"}},app.component("templateSectionAttributes",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i){this.modalService=e,this.pageContentService=t,this.regulationSectionAttributeTemplateService=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateSectionAttribute||(e.TemplateSectionAttribute={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.editSectionAttribute=function(){var t=this,e={isEditing:!0,currentPage:this.currentPage,section:this.section,sectionAttribute:this.sectionAttribute,regulationTemplateId:this.regulationTemplateId};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/SectionAttribute.modal.html",i.Modals.SectionAttributeModalController,e,"lg").result.then(function(e){null!=e&&(t.sectionAttribute.ChangeApprovalSource=(e=e).ChangeApprovalSource,t.sectionAttribute.DepositText=e.DepositText,t.sectionAttribute.DepreciationOfExpensesText=e.DepreciationOfExpensesText,t.sectionAttribute.HasDeposit=e.HasDeposit,t.sectionAttribute.HasDepreciationOfExpenses=e.HasDepreciationOfExpenses,t.sectionAttribute.HasReimbursementWhenMoving=e.HasReimbursementWhenMoving,t.sectionAttribute.HasRentSupplement=e.HasRentSupplement,t.sectionAttribute.ReEstablishWhenMoving=e.ReEstablishWhenMoving,t.sectionAttribute.ReimbursementWhenMovingText=e.ReimbursementWhenMovingText,t.sectionAttribute.Title=e.Title)},function(e){})},n.prototype.deleteSectionAttribute=function(){var e,t,i=this;confirm("Er du sikker på at du vil slette betingelsen '".concat(this.sectionAttribute.Title,"'?"))&&(e={Id:this.sectionAttribute.Id,NodeId:this.currentPage.Id,RegulationId:this.regulationTemplateId},t=this.sectionAttribute.Id,this.regulationSectionAttributeTemplateService.deleteSectionAttribute(e).then(function(e){e&&e.Success&&(i.section.SectionAttributes=i.section.SectionAttributes.filter(function(e){return e.Id!=t}))}))},n.$inject=["ModalService","PageContentService","RegulationSectionAttributeTemplateService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateSectionAttribute/TemplateSectionAttribute.component.html",this.bindings={sectionAttribute:"<",section:"=",regulationTemplateId:"<"}},app.component("templateSectionAttribute",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t){this.pageContentService=e,this.modalService=t,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateSectionGroup||(e.TemplateSectionGroup={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.startCreatingSection=function(){var t=this,e={isEditing:!1,currentPage:this.currentPage,regulationId:this.regulationId,sectionGroup:this.sectionGroup,regulationType:this.regulationType};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/Section.modal.html",i.Modals.SectionModalController,e,"lg").result.then(function(e){t.sectionGroup.Sections||(t.sectionGroup.Sections=[]),t.sectionGroup.Sections.add(e)},function(e){})},n.$inject=["PageContentService","ModalService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateSectionGroup/TemplateSectionGroup.component.html",this.bindings={sectionGroup:"<",regulationId:"<",regulationType:"<"}},app.component("templateSectionGroup",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t){this.modalService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateGuidanceInformations||(e.TemplateGuidanceInformations={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.startCreatingGuidanceInformation=function(){var t=this,e={isEditing:!1,currentPage:this.currentPage,section:this.section,regulationTemplateId:this.regulationTemplateId};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/GuidanceInformation.modal.html",i.Modals.GuidanceInformationModalController,e,"lg").result.then(function(e){t.section.GuidanceInformations||(t.section.GuidanceInformations=[]),t.section.GuidanceInformations.add(e)},function(e){})},n.$inject=["ModalService","PageContentService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateSectionGuidanceInformations/TemplateSectionGuidanceInformations.component.html",this.bindings={section:"<",regulationTemplateId:"<"}},app.component("templateSectionGuidanceInformations",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i){this.modalService=e,this.pageContentService=t,this.regulationGuidanceInformationTemplateService=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(i=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(i.Components={})).TemplateGuidanceInformation||(e.TemplateGuidanceInformation={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.editGuidanceInformation=function(){var t=this,e={isEditing:!0,currentPage:this.currentPage,section:this.section,guidanceInformation:this.guidanceInformation,regulationTemplateId:this.regulationTemplateId};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/GuidanceInformation.modal.html",i.Modals.GuidanceInformationModalController,e,"lg").result.then(function(e){t.guidanceInformation=e},function(e){})},n.prototype.deleteGuidanceInformation=function(){var e,t,i=this;confirm("Er du sikker på at du vil slette vejledningen '".concat(this.guidanceInformation.Title,"'?"))&&(e={Id:this.guidanceInformation.Id,NodeId:this.currentPage.Id,RegulationId:this.regulationTemplateId},t=this.guidanceInformation.Id,this.regulationGuidanceInformationTemplateService.deleteGuidanceInformation(e).then(function(e){e&&e.Success&&(i.section.GuidanceInformations=i.section.GuidanceInformations.filter(function(e){return e.Id!=t}))}))},n.prototype.editGuidanceInformationImages=function(){var t=this,e={currentPage:this.currentPage,guidanceInformation:this.guidanceInformation,regulationTemplateId:this.regulationTemplateId};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/GuidanceInformationImage.modal.html",i.Modals.GuidanceInformationImageModalController,e,"lg").result.then(function(e){t.guidanceInformation.ColorCode=e.ColorCode,t.guidanceInformation.Description=e.Description,t.guidanceInformation.Remark=e.Remark,t.guidanceInformation.Title=e.Title},function(e){})},n.$inject=["ModalService","PageContentService","RegulationGuidanceInformationTemplateService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateSectionGuidanceInformation/TemplateSectionGuidanceInformation.component.html",this.bindings={guidanceInformation:"<",section:"=",regulationTemplateId:"<"}},app.component("templateSectionGuidanceInformation",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i){this.modalService=e,this.pageContentService=t,this.regulationSectionMaintenanceTextsTemplateService=i,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),(e=(n=e.RegulationTemplate||(e.RegulationTemplate={})).Components||(n.Components={})).TemplateSectionMaintenanceTexts||(e.TemplateSectionMaintenanceTexts={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.editSectionMaintenanceText=function(e){var i=this,e={currentPage:this.currentPage,isEditing:!0,maintenanceText:e,regulationTemplateId:this.regulationTemplateId,section:this.section};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/EditSectionMaintenanceText.modal.html",n.Modals.EditSectionMaintenanceTextModalController,e,"lg").result.then(function(e){var t;e&&(t=e,i.section.MaintenanceTexts.firstOrDefault(function(e){return e.Id==t.Id}).Text=t.Text)},function(e){})},i.prototype.deleteSectionMaintenanceText=function(e){var t,i,n=this;confirm("Er du sikker på at du vil slette teksten?")&&(t={Id:e.Id,NodeId:this.currentPage.Id,RegulationId:this.regulationTemplateId},i=e.Id,this.regulationSectionMaintenanceTextsTemplateService.deleteSectionMaintenanceText(t).then(function(e){n.section.MaintenanceTexts=n.section.MaintenanceTexts.filter(function(e){return e.Id!=i})}))},i.prototype.startCreatingMaintenanceText=function(){var t=this,e={currentPage:this.currentPage,isEditing:!1,regulationTemplateId:this.regulationTemplateId,section:this.section};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/EditSectionMaintenanceText.modal.html",n.Modals.EditSectionMaintenanceTextModalController,e,"lg").result.then(function(e){e&&(e=e,t.section.MaintenanceTexts||(t.section.MaintenanceTexts=[]),t.section.MaintenanceTexts.add(e))},function(e){})},i.$inject=["ModalService","PageContentService","RegulationSectionMaintenanceTextsTemplateService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateSectionMaintenanceTexts/TemplateSectionMaintenanceTexts.component.html",this.bindings={section:"<",regulationTemplateId:"<"}},app.component("templateSectionMaintenanceTexts",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t,n,i;function o(e,t,i){this.pageContentService=e,this.modalService=t,this.regulationSectionTemplateService=i,this.disposables=new Rx.CompositeDisposable,this.showAccordion=!1,this.MaintenanceRuleGroupType=n.Models.Enums.MaintenanceRuleGroupType}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),t=e.Regulations||(e.Regulations={}),n=t.RegulationTemplate||(t.RegulationTemplate={}),(e=n.Components||(n.Components={})).TemplateSection||(e.TemplateSection={}),o.prototype.$onInit=function(){var t=this;this.setupFoldoutMenuItems(),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)}))},o.prototype.$onDestroy=function(){this.disposables.dispose()},o.prototype.startEditingSection=function(){var t=this,e={isEditing:!(this.foldoutMenu.ShowFoldoutMenu=!1),currentPage:this.currentPage,regulationId:this.regulationId,section:this.section,regulationType:this.regulationType};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/Section.modal.html",n.Modals.SectionModalController,e,"lg").result.then(function(e){null!=e&&(t.section.IntroText=(e=e).IntroText,t.section.IsSelectedAutomatically=e.IsSelectedAutomatically,t.section.Name=e.Name)},function(e){})},o.prototype.setupFoldoutMenuItems=function(){var e=[];this.regulationType!=t.Regulations.Models.GetRegulation.RegulationType.MaintenanceRegulations&&this.regulationType!=t.Regulations.Models.GetRegulation.RegulationType.RightOfWayCatalog||e.push({IconClass:"btn-icon btn-link-icon",Text:"Ret sammenhæng",Callback:this.editSectionConnections.bind(this)}),e.push({IconClass:"btn-icon btn-reset",Text:0==this.regulationType?"Slet bygningsdel":"Slet kategori",IsRedButton:!0,Callback:this.deleteSection.bind(this)}),e.push({IconClass:"btn-icon btn-edit",Text:"Rediger",Callback:this.startEditingSection.bind(this)}),this.foldoutMenu={FoldoutMenuItems:e,ShowFoldoutMenu:!1}},o.prototype.deleteSection=function(){var e,t,i=this;confirm("Er du sikker på at du vil slette: '".concat(this.section.Name,"'?"))&&(e={NodeId:this.currentPage.Id,Id:this.section.Id,RegulationId:this.regulationId},t=this.section.Id,this.regulationSectionTemplateService.deleteSection(e).then(function(e){e&&e.Success&&(i.sectionGroup.Sections=i.sectionGroup.Sections.filter(function(e){return e.Id!=t}))}))},o.prototype.editSectionConnections=function(){var t=this,e=(this.foldoutMenu.ShowFoldoutMenu=!1,{currentPage:this.currentPage,regulationId:this.regulationId,section:this.section,regulationType:this.regulationType});this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/SectionConnections.modal.html",n.Modals.SectionConnectionsModalController,e,"lg").result.then(function(e){null!=e&&(t.section.SectionConnections=e)},function(e){})},o.$inject=["PageContentService","ModalService","RegulationSectionTemplateService"],i=o,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/Components/TemplateSection/TemplateSection.component.html",this.bindings={sectionGroup:"=",section:"=",regulationId:"<",regulationType:"<"}},app.component("templateSection",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i;function t(e,t,i,n,o){this.$modalInstance=e,this.modalData=t,this.regulationTemplateService=i,this.regulationUtilitiesService=n,this.regulationMaintenanceRuleTemplateService=o,this.disposables=new Rx.CompositeDisposable}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),e=(e=(i=e.Regulations||(e.Regulations={})).RegulationTemplate||(i.RegulationTemplate={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.isEditing=this.modalData.isEditing,this.modalData.maintenanceRule?this.maintenanceRule=JSON.parse(JSON.stringify(this.modalData.maintenanceRule)):(this.maintenanceRule={},this.maintenanceRule.ColorCode=i.ColorCode.Green),this.disposables.add(this.regulationTemplateService.colorCodes$.subscribe(function(e){e&&(t.allColorCodes=e)})),this.disposables.add(this.regulationTemplateService.maintenanceSc
1hemes$.subscribe(function(e){e&&(t.allMaintenanceSchemes=e,t.maintenanceRule.MaintenanceScheme||(t.maintenanceRule.MaintenanceScheme=e.firstOrDefault()))})),this.disposables.add(this.regulationTemplateService.paymentTypes$.subscribe(function(e){e&&(t.allPaymentTypes=e,t.maintenanceRule.PaymentType||(t.maintenanceRule.PaymentType=e.firstOrDefault()))}))},t.prototype.addVariableToText=function(e){var t="FLETTEFELT";null==this.maintenanceRule.Text&&(this.maintenanceRule.Text=""),this.maintenanceRule.Text.endsWith(" ")||""==this.maintenanceRule.Text||(this.maintenanceRule.Text+=" "),this.maintenanceRule.Text+="{{".concat(t,"}}"),this.regulationUtilitiesService.addVariableToFieldAndSelectText(e,this.maintenanceRule.Text,t)},t.prototype.saveRule=function(e){e.$setDirty(!0),e.$setSubmitted(),e.$valid?this.modalData.isEditing?this.updateRule():this.createRule():angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},t.prototype.updateRule=function(){var t=this,e={ColorCode:this.maintenanceRule.ColorCode,Id:this.maintenanceRule.Id,MaintenanceScheme:this.maintenanceRule.MaintenanceScheme.MaintenanceScheme,NodeId:this.modalData.currentPage.Id,PaymentType:this.maintenanceRule.PaymentType.PaymentType,Recommended:this.maintenanceRule.Recommended,Remark:this.maintenanceRule.Remark,Text:this.maintenanceRule.Text,RegulationId:this.modalData.regulationId};this.regulationMaintenanceRuleTemplateService.updateMaintenanceRule(e).then(function(e){e&&e.Success&&t.$modalInstance.close(t.maintenanceRule)})},t.prototype.createRule=function(){var t=this,e={ColorCode:this.maintenanceRule.ColorCode,MaintenanceScheme:this.maintenanceRule.MaintenanceScheme.MaintenanceScheme,NodeId:this.modalData.currentPage.Id,Recommended:this.maintenanceRule.Recommended,RegulationId:this.modalData.regulationId,Remark:this.maintenanceRule.Remark,Text:this.maintenanceRule.Text,PaymentType:this.maintenanceRule.PaymentType.PaymentType,SectionId:this.modalData.section.Id,MaintenanceRuleGroupType:this.modalData.maintenanceRuleGroupType,MaintenanceRuleGroupId:this.modalData.maintenanceRuleGroupId};this.regulationMaintenanceRuleTemplateService.createMaintenanceRule(e).then(function(e){e&&t.$modalInstance.close(e)})},t.prototype.setColorCode=function(e){(this.maintenanceRule.ColorCode=e)==i.ColorCode.Red&&(this.maintenanceRule.Recommended=!1)},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationTemplateService","RegulationUtilitiesService","RegulationMaintenanceRuleTemplateService"],e.BeforeMovingMaintenanceRuleModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationTemplateService=i,this.disposables=new Rx.CompositeDisposable,this.taToolbar=[["html","bold","italics","underline","ul","ol","insertLink"],["justifyLeft","justifyCenter","justifyRight"]]}e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.introText=this.modalData.introText,this.isBAccountMaintenanceScheme=this.modalData.isBAccountMaintenanceScheme},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.saveIntroText=function(){var t=this,e={RegulationIntroTextId:this.modalData.regulationIntroTextId,IntroText:this.introText,NodeId:this.modalData.currentPage.Id};this.regulationTemplateService.updateRegulationIntroText(e).then(function(e){e&&e.Success&&t.$modalInstance.close(e)})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationTemplateService"],e.EditIntroTextModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationSectionMaintenanceTextsTemplateService=i,this.disposables=new Rx.CompositeDisposable,this.taToolbar=[["html","bold","italics","underline","ul","ol","insertLink"],["justifyLeft","justifyCenter","justifyRight"]]}
1e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.modalData.maintenanceText?this.editingMaintenanceText=JSON.parse(JSON.stringify(this.modalData.maintenanceText)):this.editingMaintenanceText={},this.section=this.modalData.section,this.isEditing=this.modalData.isEditing},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.saveMaintenanceText=function(){this.modalData.isEditing?this.updateMaintenanceText():this.createMaintenanceText()},t.prototype.updateMaintenanceText=function(){var t=this,e={MaintenanceText:this.editingMaintenanceText.Text,NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.modalData.regulationTemplateId,SectionMaintenanceTextId:this.modalData.maintenanceText.Id};this.regulationSectionMaintenanceTextsTemplateService.updateSectionMaintenanceText(e).then(function(e){e&&e.Success&&t.$modalInstance.close(t.editingMaintenanceText)})},t.prototype.createMaintenanceText=function(){var t=this,e={MaintenanceText:this.editingMaintenanceText.Text,NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.modalData.regulationTemplateId,SectionId:this.section.Id};this.regulationSectionMaintenanceTextsTemplateService.createSectionMaintenanceText(e).then(function(e){e&&t.$modalInstance.close(e)})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationSectionMaintenanceTextsTemplateService"],e.EditSectionMaintenanceTextModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationTemplateService=i,this.disposables=new Rx.CompositeDisposable,this.taToolbar=[["html","bold","italics","underline","ul","ol","insertLink"],["justifyLeft","justifyCenter","justifyRight"]]}e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.regulationTemplate=this.modalData.regulationTemplate,this.maintenanceText=this.regulationTemplate.SharedSectionConnectionMaintenanceText.Text},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){var t=this,e={RegulationSharedSectionConnectionMaintenanceTextId:this.modalData.regulationTemplate.SharedSectionConnectionMaintenanceText.RegulationSharedSectionConnectionMaintenanceTextId,NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.regulationTemplate.Id,MaintenanceText:this.maintenanceText};this.regulationTemplateService.updateRegulationSharedSectionConnectionMaintenanceText(e).then(function(e){e&&e.Success&&(e={RegulationSharedSectionConnectionMaintenanceTextId:e.RegulationSharedSectionConnectionMaintenanceTextId,Text:t.maintenanceText},t.$modalInstance.close(e))})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationTemplateService"],e.EditSharedSectionConnectionMaintenanceTextController=t}(BoligExtra=BoligExtra||{}),!function(e){var i;function t(e,t,i,n,o){this.$modalInstance=e,this.modalData=t,this.regulationTemplateService=i,this.regulationUtilitiesService=n,this.regulationMaintenanceRuleTemplateService=o,this.disposables=new Rx.CompositeDisposable}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),e=(e=(i=e.Regulations||(e.Regulations={})).RegulationTemplate||(i.RegulationTemplate={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.isEditing=this.modalData.isEditing,this.modalData.maintenanceRule?this.maintenanceRule=JSON.parse(JSON.stringify(this.modalData.maintenanceRule)):(this.maintenanceRule={},this.maintenanceRule.ColorCode=i.ColorCode.Green),this.disposables.add(this.regulationTemplateService.colorCodes$.subscribe(function(e){e&&(t.allColorCodes=e)})),this.disposables.add(this.regulationTemplateService.maintenanceSc
1hemes$.subscribe(function(e){e&&(t.allMaintenanceSchemes=e,t.maintenanceRule.MaintenanceScheme||(t.maintenanceRule.MaintenanceScheme=e.firstOrDefault()))}))},t.prototype.addVariableToText=function(e){var t="FLETTEFELT";null==this.maintenanceRule.Text&&(this.maintenanceRule.Text=""),this.maintenanceRule.Text.endsWith(" ")||""==this.maintenanceRule.Text||(this.maintenanceRule.Text+=" "),this.maintenanceRule.Text+="{{".concat(t,"}}"),this.regulationUtilitiesService.addVariableToFieldAndSelectText(e,this.maintenanceRule.Text,t)},t.prototype.saveRule=function(e){e.$setDirty(!0),e.$setSubmitted(),e.$valid?this.modalData.isEditing?this.updateRule():this.createRule():angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},t.prototype.updateRule=function(){var t=this,e={ColorCode:this.maintenanceRule.ColorCode,Id:this.maintenanceRule.Id,MaintenanceScheme:this.maintenanceRule.MaintenanceScheme.MaintenanceScheme,NodeId:this.modalData.currentPage.Id,Recommended:this.maintenanceRule.Recommended,Remark:this.maintenanceRule.Remark,Text:this.maintenanceRule.Text,RegulationId:this.modalData.regulationId};this.regulationMaintenanceRuleTemplateService.updateMaintenanceRule(e).then(function(e){e&&e.Success&&t.$modalInstance.close(t.maintenanceRule)})},t.prototype.createRule=function(){var t=this,e={ColorCode:this.maintenanceRule.ColorCode,MaintenanceScheme:this.maintenanceRule.MaintenanceScheme.MaintenanceScheme,NodeId:this.modalData.currentPage.Id,Recommended:this.maintenanceRule.Recommended,RegulationId:this.modalData.regulationId,Remark:this.maintenanceRule.Remark,Text:this.maintenanceRule.Text,SectionId:this.modalData.section.Id,MaintenanceRuleGroupType:this.modalData.maintenanceRuleGroupType};this.regulationMaintenanceRuleTemplateService.createMaintenanceRule(e).then(function(e){e&&t.$modalInstance.close(e)})},t.prototype.setColorCode=function(e){(this.maintenanceRule.ColorCode=e)==i.ColorCode.Red&&(this.maintenanceRule.Recommended=!1)},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationTemplateService","RegulationUtilitiesService","RegulationMaintenanceRuleTemplateService"],e.GeneralMaintenanceRuleModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var i;function t(e,t,i,n,o){this.$modalInstance=e,this.modalData=t,this.regulationTemplateService=i,this.modalService=n,this.guidanceInformationService=o,this.disposables=new Rx.CompositeDisposable,this.taToolbar=[["html","bold","italics","underline","ul","ol","insertLink"],["justifyLeft","justifyCenter","justifyRight"]]}e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),i=e.Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.isEditing=this.modalData.isEditing,this.regulationTemplateId=this.modalData.regulationTemplateId,this.modalData.guidanceInformation?this.guidanceInformation=JSON.parse(JSON.stringify(this.modalData.guidanceInformation)):(this.guidanceInformation={},this.guidanceInformation.Images=[],this.guidanceInformation.ColorCode=0),this.disposables.add(this.regulationTemplateService.colorCodes$.subscribe(function(e){e&&(t.allColorCodes=e)}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.saveGuidanceInformation=function(e){e.$setDirty(!0),e.$setSubmitted(),e.$valid?this.modalData.isEditing?this.updateGuidanceInformation():this.createGuidanceInformation():angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},t.prototype.setColorCode=function(e){this.guidanceInformation.ColorCode=e},t.prototype.updateGuidanceInformation=function(){var t=this,e={ColorCode:this.guidanceInformation.ColorCode,Description:this.guidanceInformation.Description,GuidanceInformationId:this.guidanceInformation.Id,NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.modalData.regulationTemplateId,Remark:this.guidanceInformation.Remark,Title:this.guidanceInformation.Title};this.guidanceInformationService.updateGuidanceInformation(e).then(function(e){e&&e.Success&&t.$modalInstance.close(t.guid
1anceInformation)})},t.prototype.createGuidanceInformation=function(){var t=this,e={ColorCode:this.guidanceInformation.ColorCode,Description:this.guidanceInformation.Description,NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.modalData.regulationTemplateId,Remark:this.guidanceInformation.Remark,SectionId:this.modalData.section.Id,Title:this.guidanceInformation.Title};this.guidanceInformationService.createGuidanceInformation(e).then(function(e){e&&t.$modalInstance.close(e)})},t.prototype.editImages=function(){var t=this,e={currentPage:this.modalData.currentPage,guidanceInformation:this.modalData.guidanceInformation,regulationTemplateId:this.regulationTemplateId};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/GuidanceInformationImage.modal.html",i.GuidanceInformationImageModalController,e,"lg").result.then(function(e){t.guidanceInformation=e},function(e){})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationTemplateService","ModalService","RegulationGuidanceInformationTemplateService"],i.GuidanceInformationModalController=t}(BoligExtra=BoligExtra||{}),!function(n){var e;function t(e,t,i,n,o){this.$modalInstance=e,this.modalData=t,this.$scope=i,this.regulationGuidanceInformationTemplateService=n,this.regulationUtilitiesService=o,this.disposables=new Rx.CompositeDisposable,this.showAddingImageView=!1,this.imagesReadyToUpload=[],this.images=[]}e=(e=(e=(e=(e=n.PersonnelPortal||(n.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var i=this;this.guidanceInformation=this.modalData.guidanceInformation,this.guidanceInformationImages=JSON.parse(JSON.stringify(this.guidanceInformation.Images)),this.$scope.$watchCollection(function(){return i.images},function(e,t){e&&0<e.length&&(i.imagesReadyToUpload=[],i.regulationUtilitiesService.addUploadedFiles(i.$scope,i.imagesReadyToUpload,e,n.Utility.File.UploadedFileType.Image),i.images=[])}),this.companyImageSortOptions={cursor:"move",containment:".guidance-information-images"}},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.cancelAddingImage=function(){this.showAddingImageView=!1,this.images=[],this.imagesReadyToUpload=[],$(".add-image-view #guidance-information-image-selector").val(null)},t.prototype.addImage=function(){var e,t=this;0!=this.imagesReadyToUpload.length&&(e={GuidanceInformationId:this.guidanceInformation.Id,NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.modalData.regulationTemplateId},this.regulationGuidanceInformationTemplateService.addImageToGuidanceInformation(e,this.imagesReadyToUpload).then(function(e){e&&(t.guidanceInformation.Images.push(e),t.guidanceInformationImages.push(e),t.cancelAddingImage())}))},t.prototype.clearImage=function(e){this.images=[],this.imagesReadyToUpload=[],$(".add-image-view #guidance-information-image-selector").val(null)},t.prototype.deleteUploadedImage=function(t){var e,i=this;confirm("Er du sikker på at du vil slette billedet?")&&(e={Id:t.Id,NodeId:this.modalData.currentPage.Id,RegulationId:this.modalData.regulationTemplateId},this.regulationGuidanceInformationTemplateService.deleteGuidanceInformationImage(e).then(function(e){i.guidanceInformation.Images=JSON.parse(JSON.stringify(i.guidanceInformation.Images.filter(function(e){return e.Id!=t.Id}))),i.guidanceInformationImages=JSON.parse(JSON.stringify(i.guidanceInformation.Images))}))},t.prototype.saveImageSortOrder=function(){var t=this,e=this.guidanceInformationImages.map(function(e,t){return{GuidanceInformationImageId:e.Id,SortOrder:t}}),e={GuidanceInformationId:this.guidanceInformation.Id,NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.modalData.currentPage.Id,SortOrders:e};this.regulationGuidanceInformationTemplateService.updateSortOrderForGuidanceInformationImages(e).then(function(e){e&&e.Success&&(t.guidanceInformation.Images=JSON.parse(JSON.stringify(t.guidanceInformationImages)))})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","$scope","RegulationGuidanceInformationTemplateService","RegulationUtilitiesService"],e.GuidanceInformationImageModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.$modalInstance=e,this.modalData=t,this.regulationMaintenanceRuleGroupTemplateService=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),e=(t=e.RegulationTemplate||(e.RegulationTemplate={})).Modals||(t.Modals={}),i.prototype.$onInit=function(){this.isEditing=this.modalData.isEditing,this.modalData.maintenanceRuleGroup?this.maintenanceRuleGroup=JSON.parse(JSON.stringify(this.modalData.maintenanceRuleGroup)):this.maintenanceRuleGroup={},this.originalRuleGroupText=this.maintenanceRuleGroup.Text,this.requiredState=this.maintenanceRuleGroup.Required!=t.Models.Enums.MaintenanceRuleGroupRequired.NotRequired,this.changedRequiredState()},i.prototype.saveRuleGroup=function(e){e.$setDirty(!0),e.$setSubmitted(),e.$valid?this.modalData.isEditing?this.updateRuleGroup():this.createRuleGroup():angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},i.prototype.updateRuleGroup=function(){var t=this,e={Id:this.maintenanceRuleGroup.Id,RegulationId:this.modalData.regulationId,Required:this.maintenanceRuleGroup.Required,Text:this.maintenanceRuleGroup.Text,NodeId:this.modalData.currentPage.Id,AllowMultipleSelection:this.maintenanceRuleGroup.AllowMultipleSelection};this.regulationMaintenanceRuleGroupTemplateService.updateMaintenanceRuleGroup(e).then(function(e){e&&e.Success&&t.$modalInstance.close(t.maintenanceRuleGroup)})},i.prototype.createRuleGroup=function(){var t=this,e={NodeId:this.modalData.currentPage.Id,RegulationId:this.modalData.regulationId,SectionId:this.modalData.section.Id,Required:this.maintenanceRuleGroup.Required,Text:this.maintenanceRuleGroup.Text,AllowMultipleSelection:this.maintenanceRuleGroup.AllowMultipleSelection};this.regulationMaintenanceRuleGroupTemplateService.createMaintenanceRuleGroup(e).then(function(e){e&&t.$modalInstance.close(e)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.changedRequiredState=function(){this.maintenanceRuleGroup.Required=this.requiredState?t.Models.Enums.MaintenanceRuleGroupRequired.Required:t.Models.Enums.MaintenanceRuleGroupRequired.NotRequired},i.prototype.cancel=function(){this.$modalInstance.close()},i.$inject=["$uibModalInstance","modalData","RegulationMaintenanceRuleGroupTemplateService"],e.MaintenanceRuleGroupModalController=i}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.regulationUtilitiesService=i,this.regulationSectionTemplateService=n,this.disposables=new Rx.CompositeDisposable}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),e=(e=(t=e.Regulations||(e.Regulations={})).RegulationTemplate||(t.RegulationTemplate={})).Modals||(e.Modals={}),i.prototype.$onInit=function(){this.modalData.regulationType==t.Regulations.Models.GetRegulation.RegulationType.MaintenanceRegulations?this.partTypeName="bygningsdel":this.partTypeName="kategori",this.isEditing=this.modalData.isEditing,this.modalData.section?this.section=JSON.parse(JSON.stringify(this.modalData.section)):this.section={},this.originalSectionName=this.section.Name,this.section.SectionAttributes||(this.section.SectionAttributes=[]),this.section.SectionConnections||(this.section.SectionConnections=[]),this.section.MaintenanceTexts||(this.section.MaintenanceTexts=[]),this.section.GuidanceInformations||(this.section.GuidanceInformations=[])},i.prototype.addVariableToText=function(e){var t="FLETTEFELT";null==this.section.IntroText&&(this.section.IntroText=""),this.section.IntroText.endsWith(" ")||""==this.section.IntroText||(this.section.IntroText+=" "),this.section.IntroText+="{{".concat(t,"}}"),this.regulationUtilitiesService.addVariableToFieldAndSelectText(e,this.section.IntroText,t)},i.prototype.saveSection=function(e){e.$setDirty(!0),e.$setSubmitted(),e.$valid?this.modalData.isEditing?this.updateSection():this.createSection():angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},i.prototype.updateSection=function(){var t=this,e={Name:this.section.Name,SectionId:this.section.Id,IntroText:this.section.IntroText,IsSelectedAutomatically:this.section.IsSelectedAutomatically,NodeId:this.modalData.currentPage.Id,RegulationId:this.modalData.regulationId};this.regulationSectionTemplateService.updateSection(e).then(function(e){e&&e.Success&&t.$modalInstance.close(t.section)})},i.prototype.createSection=function(){var t=this,e={SectionGroupId:this.modalData.sectionGroup.Id,Name:this.section.Name,IntroText:this.section.IntroText,IsSelectedAutomatically:this.section.IsSelectedAutomatically,NodeId:this.modalData.currentPage.Id,RegulationId:this.modalData.regulationId};this.regulationSectionTemplateService.createSection(e).then(function(e){e&&e.Success&&(t.section.Id=e.SectionId,t.$modalInstance.close(t.section))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.cancel=function(){this.$modalInstance.close()},i.$inject=["$uibModalInstance","modalData","RegulationUtilitiesService","RegulationSectionTemplateService"],e.SectionModalController=i}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.regulationTemplateService=i,this.regulationSectionAttributeTemplateService=n,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.isEditing=this.modalData.isEditing,this.regulationTemplateId=this.modalData.regulationTemplateId,this.modalData.sectionAttribute?this.sectionAttribute=JSON.parse(JSON.stringify(this.modalData.sectionAttribute)):this.sectionAttribute={},this.disposables.add(this.regulationTemplateService.sectionAttributeMaintenanceTypes$.subscribe(function(e){e&&(t.allMaintenanceOptions=e,t.sectionAttribute)&&!t.sectionAttribute.Maintenance&&(t.sectionAttribute.Maintenance=t.allMaintenanceOptions.firstOrDefault())})),this.disposables.add(this.regulationTemplateService.sectionAttributeChangeApprovalSources$.subscribe(function(e){e&&(t.allChangeApprovalSources=e,t.sectionAttribute)&&!t.sectionAttribute.ChangeApprovalSource&&(t.sectionAttribute.ChangeApprovalSource=t.allChangeApprovalSources.firstOrDefault())}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.saveSectionAttribute=function(e){e.$setDirty(!0),e.$setSubmitted(),e.$valid?this.modalData.isEditing?this.updateAttribute():this.createAttribute():angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},t.prototype.updateAttribute=function(){var t=this,e={RegulationTemplateId:this.regulationTemplateId,SelectedSectionAttributeChangeApprovalSource:this.sectionAttribute.ChangeApprovalSource.Id,DepositText:this.sectionAttribute.DepositText,HasDeposit:this.sectionAttribute.HasDeposit,HasReimbursementWhenMoving:this.sectionAttribute.HasReimbursementWhenMoving,HasRentSupplement:this.sectionAttribute.HasRentSupplement,Title:this.sectionAttribute.Title,SelectedSectionAttributeMaintenance:this.sectionAttribute.Maintenance.Id,ReEstablishWhenMoving:this.sectionAttribute.ReEstablishWhenMoving,ReimbursementWhenMovingText:this.sectionAttribute.ReimbursementWhenMovingText,HasDepreciationOfExpenses:this.sectionAttribute.HasDepreciationOfExpenses,DepreciationOfExpensesText:this.sectionAttribute.DepreciationOfExpensesText,SectionAttributeId:this.sectionAttribute.Id,NodeId:this.modalData.currentPage.Id};this.regulationSectionAttributeTemplateService.updateSectionAttribute(e).then(function(e){e&&e.Success&&t.$modalInstance.close(t.sectionAttribute)})},t.prototype.createAttribute=function(){var t=this,e={RegulationTemplateId:this.regulationTemplateId,SelectedSectionAttributeChangeApprovalSource:this.sectionAttribute.ChangeApprovalSource.Id,DepositText:this.sectionAttribute.DepositText,HasDeposit:this.sectionAttribute.HasDeposit,HasReimbursementWhenMoving:this.sectionAttribute.HasReimbursementWhenMoving,HasRentSupplement:this.sectionAttribute.HasRentSupplement,Title:this.sectionAttribute.Title,SelectedSectionAttributeMaintenance:this.sectionAttribute.Maintenance.Id,ReEstablishWhenMoving:this.sectionAttribute.ReEstablishWhenMoving,ReimbursementWhenMovingText:this.sectionAttribute.ReimbursementWhenMovingText,HasDepreciationOfExpenses:this.sectionAttribute.HasDepreciationOfExpenses,DepreciationOfExpensesText:this.sectionAttribute.DepreciationOfExpensesText,NodeId:this.modalData.currentPage.Id,SectionId:this.modalData.section.Id};this.regulationSectionAttributeTemplateService.createSectionAttribute(e).then(function(e){e&&e.Success&&(t.sectionAttribute.Id=e.SectionAttributeId,t.$modalInstance.close(t.sectionAttribute))})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","RegulationTemplateService","RegulationSectionAttributeTemplateService"],e.SectionAttributeModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.regulationTemplateService=i,this.regulationSectionTemplateService=n,this.disposables=new Rx.CompositeDisposable}e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),e=(e=(t=e.Regulations||(e.Regulations={})).RegulationTemplate||(t.RegulationTemplate={})).Modals||(e.Modals={}),i.prototype.$onInit=function(){var i=this,e=(this.section=this.modalData.section,null);if(this.modalData.regulationType==t.Regulations.Models.GetRegulation.RegulationType.MaintenanceRegulations)e=t.Regulations.Models.GetRegulation.RegulationType.RightOfWayCatalog;else{if(this.modalData.regulationType!=t.Regulations.Models.GetRegulation.RegulationType.RightOfWayCatalog)return;e=t.Regulations.Models.GetRegulation.RegulationType.MaintenanceRegulations}
1e={NodeId:this.modalData.currentPage.Id,RegulationType:e};this.regulationTemplateService.getSectionGroupAndSectionsByRegulationType(e).then(function(e){e&&e.Success&&(i.sectionGroups=e.SectionGroups.map(function(e){var t=e;return t.selectableSections=e.BaseSectionItems.map(function(t){var e=t;return e.selected=i.section.SectionConnections.any(function(e){return e==t.Id}),e}),t}))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.submit=function(){var t=this,i=(e=[]).concat.apply(e,this.sectionGroups.map(function(e){return e.selectableSections.where(function(e){return e.selected}).map(function(e){return e.Id})})),e={NodeId:this.modalData.currentPage.Id,RegulationTemplateId:this.modalData.regulationId,PrimarySectionId:this.section.Id,RelatedSectionIds:i};this.regulationSectionTemplateService.updateSectionConnections(e).then(function(e){e&&e.Success&&t.$modalInstance.close(i)})},i.prototype.cancel=function(){this.$modalInstance.close()},i.$inject=["$uibModalInstance","modalData","RegulationTemplateService","RegulationSectionTemplateService"],e.SectionConnectionsModalController=i}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).OptionsBar||(e.OptionsBar={}),i.prototype.cancel=function(){this.cancelCallback&&this.cancelCallback()},t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/OptionsBar/OptionsBar.component.html",this.bindings={cancelCallback:"&"}},app.component("optionsBar",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.baseGuidanceInformationUrl="/umbraco/api/RegulationGuidanceInformationTemplate/"}(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),t.prototype.createGuidanceInformation=function(e){var t=this,i=this.loaderService.setLoader("GuidanceInformationLoader","GuidanceInformationLoader"),e=this.incomHttp.post(this.baseGuidanceInformationUrl+"CreateGuidanceInformation",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateGuidanceInformation=function(e){var t=this,i=this.loaderService.setLoader("GuidanceInformationLoader","GuidanceInformationLoader"),e=this.incomHttp.post(this.baseGuidanceInformationUrl+"UpdateGuidanceInformation",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.deleteGuidanceInformation=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GuidanceInformationLoader"),e=this.incomHttp.post(this.baseGuidanceInformationUrl+"DeleteGuidanceInformation",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.addImageToGuidanceInformation=function(e,t){var i=this,n=this.loaderService.setLoader("GuidanceInformationImageLoader","GuidanceInformationImageLoader"),e=this.fileService.postWithFiles(e,this.baseGuidanceInformationUrl+"AddImageToGuidanceInformation/",t);return e.then(function(e){i.loaderService.removeLoader(n)},function(e){i.loaderService.removeLoader(n)}),e},t.prototype.deleteGuidanceInformationImage=function(e){var t=this,i=this.loaderService.setLoader("GuidanceInformationImageLoader","GuidanceInformationImageLoader"),e=this.incomHttp.post(this.baseGuidanceInformationUrl+"DeleteGuidanceInformationImage",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateSortOrderForGuidanceInformationImages=function(e){var t=this,i=this.loaderService.setLoader("GuidanceInformationImageLoader","GuidanceInformationImageLoader"),e=this.incomHttp.post(this.baseGuidanceInformationUrl+"UpdateSortOrderForGuidanceInformationImages",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.suggestNewGuidanceInformation=function(e,t){var i=this,n=this.loaderService.setLoader("suggest-guidance-information-loader-area","suggest-guidance-information-loader-area"),e=this.fileService.postWithFiles(e,this.baseGuidanceInformationUrl+"SuggestNewGuidanceInformation/",t);return e.then(function(e){i.loaderService.removeLoader(n)},function(e){i.loaderService.removeLoader(n)}),e},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("RegulationGuidanceInformationTemplateService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/RegulationMaintenanceRuleGroup/"}
1(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),t.prototype.createMaintenanceRuleGroup=function(e){var t=this,i=this.loaderService.setLoader("MaintenanceRuleGroupLoader","MaintenanceRuleGroupLoader"),e=this.incomHttp.post(this.baseUrl+"CreateMaintenanceRuleGroup",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateMaintenanceRuleGroup=function(e){var t=this,i=this.loaderService.setLoader("MaintenanceRuleGroupLoader","MaintenanceRuleGroupLoader"),e=this.incomHttp.post(this.baseUrl+"UpdateMaintenanceRuleGroup",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.deleteMaintenanceRuleGroup=function(e){var t=this,i=this.loaderService.setLoader("contentSection","BeforeMovingMaintenanceRuleGroupLoader"),e=this.incomHttp.post(this.baseUrl+"DeleteMaintenanceRuleGroup",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationMaintenanceRuleGroupTemplateService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseMaintenanceRuleUrl="/umbraco/api/RegulationMaintenanceRuleTemplate/"}(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),t.prototype.createMaintenanceRule=function(e){var t=this,i=this.loaderService.setLoader("MaintenanceRuleLoader","MaintenanceRuleLoader"),e=this.incomHttp.post(this.baseMaintenanceRuleUrl+"CreateMaintenanceRule",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateMaintenanceRule=function(e){var t=this,i=this.loaderService.setLoader("MaintenanceRuleLoader","MaintenanceRuleLoader"),e=this.incomHttp.post(this.baseMaintenanceRuleUrl+"UpdateMaintenanceRule",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.deleteMaintenanceRule=function(e){var t=this,i=this.loaderService.setLoader("contentSection","BeforeMovingMaintenanceRuleLoader"),e=this.incomHttp.post(this.baseMaintenanceRuleUrl+"DeleteMaintenanceRule",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationMaintenanceRuleTemplateService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/RegulationSectionAttributeTemplate/"}(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),t.prototype.createSectionAttribute=function(e){var t=this,i=this.loaderService.setLoader("SectionAttributeLoader","SectionAttributeLoader"),e=this.incomHttp.post(this.baseUrl+"CreateSectionAttribute",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateSectionAttribute=function(e){var t=this,i=this.loaderService.setLoader("SectionAttributeLoader","SectionAttributeLoader"),e=this.incomHttp.post(this.baseUrl+"UpdateSectionAttribute",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.deleteSectionAttribute=function(e){var t=this,i=this.loaderService.setLoader("contentSection","SectionAttributeLoader"),e=this.incomHttp.post(this.baseUrl+"DeleteSectionAttribute",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationSectionAttributeTemplateService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/RegulationSectionMaintenanceTextsTemplate/"}
1(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),t.prototype.createSectionMaintenanceText=function(e){var t=this,i=this.loaderService.setLoader("SectionMaintenanceTextLoader","SectionMaintenanceTextLoader"),e=this.incomHttp.post(this.baseUrl+"CreateSectionMaintenanceText",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateSectionMaintenanceText=function(e){var t=this,i=this.loaderService.setLoader("SectionMaintenanceTextLoader","SectionMaintenanceTextLoader"),e=this.incomHttp.post(this.baseUrl+"UpdateSectionMaintenanceText",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.deleteSectionMaintenanceText=function(e){var t=this,i=this.loaderService.setLoader("delete-section-maintenance-text-"+e.Id,"delete-section-maintenance-text-"+e.Id),e=this.incomHttp.post(this.baseUrl+"DeleteSectionMaintenanceText",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationSectionMaintenanceTextsTemplateService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/RegulationSectionTemplate/"}(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),t.prototype.createSection=function(e){var t=this,i=this.loaderService.setLoader("SectionLoader","SectionLoader"),e=this.incomHttp.post(this.baseUrl+"CreateSection",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateSection=function(e){var t=this,i=this.loaderService.setLoader("SectionLoader","SectionLoader"),e=this.incomHttp.post(this.baseUrl+"UpdateSection",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.deleteSection=function(e){var t=this,i=this.loaderService.setLoader("contentSection","SectionLoader"),e=this.incomHttp.post(this.baseUrl+"DeleteSection",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateSectionConnections=function(e){var t=this,i=this.loaderService.setLoader("SectionConnectionsLoader","SectionConnectionsLoader"),e=this.incomHttp.post(this.baseUrl+"UpdateSectionConnections",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationSectionTemplateService",t)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i,n,o,r){this.utilityService=e,this.pageContentService=t,this.regulationTemplateService=i,this.pageProviderService=n,this.windowService=o,this.modalService=r,this.disposables=new Rx.CompositeDisposable,this.showA=!0,this.showB=!0}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={}),n=e.RegulationTemplate||(e.RegulationTemplate={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e,t.getRegulationTemplateToEdit())}),this.pageProviderService.getPageByDocumentType("regulationTemplatesOverview").then(function(e){e&&(t.regulationTemplatesOverviewPage=e)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.cancelEdit=function(){this.windowService.location.href=this.regulationTemplatesOverviewPage.Url},i.prototype.toggleSchemeA=function(){this.showA=!this.showA,this.maintenanceSchemeChange()},i.prototype.toggleSchemeB=function(){this.showB=!this.showB,this.maintenanceSchemeChange()},i.prototype.editIntroText=function(t){var i=this,e={isBAccountMaintenanceScheme:t,
1introText:(t?this.regulationTemplate.IntroTextBScheme:this.regulationTemplate.IntroTextAScheme).Text,regulationIntroTextId:(t?this.regulationTemplate.IntroTextBScheme:this.regulationTemplate.IntroTextAScheme).RegulationIntroTextId,currentPage:this.currentPage};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/EditIntroText.modal.html",n.Modals.EditIntroTextModalController,e,"lg").result.then(function(e){e&&(t?(i.regulationTemplate.IntroTextBScheme.Text=e.Text,i.regulationTemplate.IntroTextBScheme.RegulationIntroTextId=e.Id):(i.regulationTemplate.IntroTextAScheme.Text=e.Text,i.regulationTemplate.IntroTextAScheme.RegulationIntroTextId=e.Id))},function(e){})},i.prototype.editSharedSectionConnectionMaintenanceText=function(){var t=this,e={currentPage:this.currentPage,regulationTemplate:this.regulationTemplate};this.modalService.createModal("/app/PersonnelPortal/Administration/Regulations/RegulationTemplate/Modals/EditSharedSectionConnectionMaintenanceText.modal.html",n.Modals.EditSharedSectionConnectionMaintenanceTextController,e,"lg").result.then(function(e){e&&(t.regulationTemplate.SharedSectionConnectionMaintenanceText=e)},function(e){})},i.prototype.maintenanceSchemeChange=function(){this.showA&&this.showB?this.regulationTemplateService.changeMaintenanceSchemesToDisplay([0,1,2]):this.showA&&!this.showB?this.regulationTemplateService.changeMaintenanceSchemesToDisplay([0,1]):!this.showA&&this.showB?this.regulationTemplateService.changeMaintenanceSchemesToDisplay([0,2]):this.regulationTemplateService.changeMaintenanceSchemesToDisplay([])},i.prototype.getRegulationTemplateToEdit=function(){var t=this,e=this.utilityService.getParameters("querystring").Id;e&&(e={Id:e,NodeId:this.currentPage.Id},this.disposables.add(this.regulationTemplateService.getRegulationTemplate(e).subscribe(function(e){e&&(t.regulationTemplate=e,t.maintenanceSchemeChange())})))},i.$inject=["UtilityService","PageContentService","RegulationTemplateService","PageProviderService","$window","ModalService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/Regulations/RegulationTemplate/RegulationTemplate.component.html",this.bindings={}},app.component("regulationTemplate",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/RegulationTemplate/",this.colorCodes$=new Rx.ReplaySubject(1),this.paymentTypes$=new Rx.ReplaySubject(1),this.maintenanceSchemes$=new Rx.ReplaySubject(1),this.maintenanceSchemeToDisplay$=new Rx.BehaviorSubject([0,1,2]),this.sectionAttributeChangeApprovalSources$=new Rx.ReplaySubject(1),this.sectionAttributeMaintenanceTypes$=new Rx.ReplaySubject(1),this.regulationTemplate$=new Rx.Subject}(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={}),t.prototype.getRegulationTemplate=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetRegulationTemplate");return this.incomHttp.post(this.baseUrl+"GetRegulationTemplate",e).then(function(e){t.colorCodes$.onNext(e.AllColorCodes),t.paymentTypes$.onNext(e.AllPaymentTypes),t.maintenanceSchemes$.onNext(e.AllMaintenanceSchemes),t.sectionAttributeChangeApprovalSources$.onNext(e.AllSectionAttributeChangeApprovalSources),t.sectionAttributeMaintenanceTypes$.onNext(e.AllSectionAttributeMaintenanceTypes),t.regulationTemplate$.onNext(e),t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),this.regulationTemplate$},t.prototype.updateRegulationIntroText=function(e){var t=this,i=this.loaderService.setLoader("EditIntroTextLoader","EditIntroTextLoader"),e=this.incomHttp.post(this.baseUrl+"UpdateRegulationIntroText",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getSectionGroupAndSectionsByRegulationType=function(e){var t=this,i=this.loaderService.setLoader("SectionConnectionsLoader","SectionConnectionsLoader"),e=this.incomHttp.post(this.baseUrl+"GetSectionGroupAndSectionsByRegulationType",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateRegulationSharedSectionConnectionMaintenanceText=function(e){var t=this,i=this.loaderService.setLoader("UpdateRegulationSharedSectionConnectionMaintenanceTextLoader","UpdateRegulationSharedSectionConnectionMaintenanceTextLoader"),e=this.incomHttp.post(this.baseUrl+"UpdateRegulationSharedSectionConnectionMaintenanceText",e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e}
1,t.prototype.changeMaintenanceSchemesToDisplay=function(e){this.maintenanceSchemeToDisplay$.onNext(e)},t.$inject=["incomHttpService","LoaderService"],app.service("RegulationTemplateService",t)}(BoligExtra=BoligExtra||{}),!function(r){var e,t,a;function i(e,t){this.$timeout=e,this.fileService=t,this.mergeFieldRegex=/{{(.*?)\}}/g}e=(e=r.PersonnelPortal||(r.PersonnelPortal={})).Administration||(e.Administration={}),t=e.Regulations||(e.Regulations={}),(e=a=t.ColorCode||(t.ColorCode={}))[e.Green=0]="Green",e[e.Yellow=1]="Yellow",e[e.Red=2]="Red",i.prototype.addVariableToFieldAndSelectText=function(e,n,o){var r;e&&e.$$element&&0!=e.$$element.length&&(r=void 0,(e.$$element[0]instanceof HTMLInputElement||e.$$element[0]instanceof HTMLTextAreaElement)&&(r=e.$$element[0]),this.$timeout(function(){var e,t=n.length-(o.length+"}}".length),i=n.length-"}}".length;r.createTextRange?((e=r.createTextRange()).collapse(!0),e.moveStart("character",t),e.moveEnd("character",i),e.select()):r.setSelectionRange?(r.focus(),r.setSelectionRange(t,i)):r.selectionStart&&(r.selectionStart=t,r.selectionEnd=i),r.focus()},0))},i.prototype.hasMergeFields=function(e){e=this.getMergeFields(e);return null!=e&&0<e.length},i.prototype.getMergeFields=function(e){var t=[];if(e){e=e.match(this.mergeFieldRegex);if(null==e)return t;e.forEach(function(e){t.contains(e)||t.add(e)})}return t},i.prototype.replaceMergeFields=function(e,i){var n,t=e.match(this.mergeFieldRegex);return null==t||null==i?e:(n=e,t.forEach(function(t){var e=i.firstOrDefault(function(e){return e.Key==t&&""!=e.Value});null!=e&&(n=n.replace(t,e.Value))}),n)},i.prototype.getRegulationValidation=function(n,o){var r=this,s={sectionGroups:[]};return n.SectionGroups.forEach(function(e){e.Sections.forEach(function(i){o.any(function(e){return e.ItemId==i.Id&&1==e.IsSelected})&&(0==i.MovingInConditionsRules.any()&&0==i.DailyCleaningRules.any()&&0==i.MaintenanceRules.any()&&0==i.BeforeMovingRuleGroups.any(function(e){return e.MaintenanceRules.any()})?r.addValidationError(s,e,i,null,"Er tilvalgt, men har ingen regler valgt under sig."):(n.RegulationType==t.Regulations.Models.GetRegulation.RegulationType.RightOfWayCatalog&&0==i.SectionAttributes.filter(function(t){return o.any(function(e){return e.ItemId==t.Id&&e.IsSelected})}).length&&r.addValidationError(s,e,i,null,"Mangler valg af betingelse for økonomi og ansvar."),n.RegulationType==t.Regulations.Models.GetRegulation.RegulationType.RightOfWayCatalog&&i.GuidanceInformations.any(function(e){return 2!=e.ColorCode})&&0==i.GuidanceInformations.filter(function(t){return o.any(function(e){return e.ItemId==t.Id&&e.IsSelected})}).length&&r.addValidationError(s,e,i,null,"Mangler valg af vejledning."),i.MovingInConditionsRules.any(function(e){return e.Recommended})&&!i.MovingInConditionsRules.any(function(t){return o.any(function(e){return e.ItemId==t.Id&&1==e.IsSelected})})&&r.addValidationError(s,e,i,null,"Stand ved indflytning skal have mindst 1 regel valgt."),i.MovingInConditionsRules.any(function(t){return t.ColorCode==a.Red&&o.any(function(e){return e.ItemId==t.Id&&e.IsSelected})})&&r.addValidationError(s,e,i,null,"Stand ved indflytning har mindst 1 rød regel valgt. Dette er ikke tilladt."),n.DepartmentAreas.any()&&!r.getIsDepartmentAreasSetupCorrect(i.MovingInConditionsRules,o.filter(function(e){return i.MovingInConditionsRules.map(function(e){return e.Id}).contains(e.ItemId)&&e.IsSelected}),n.DepartmentAreas,!1,!1)&&r.addValidationError(s,e,i,null,"Stand ved indflytning har en ugyldig opsætning af underområder."),i.DailyCleaningRules.any(function(e){return e.Recommended})&&!i.DailyCleaningRules.any(function(t){return o.any(function(e){return e.ItemId==t.Id&&1==e.IsSelected})})&&r.addValidationError(s,e,i,null,"Sådan gør du rent skal have mindst 1 regel valgt."),i.DailyCleaningRules.any(function(t){return t.ColorCode==a.Red&&o.any(function(e){return e.ItemId==t.Id&&e.IsSelected})})&&r.addValidationError(s,e,i,null,"Sådan gør du rent har mindst 1 rød regel valgt. Dette er ikke tilladt."),n.DepartmentAreas.any()&&!r.getIsDepartmentAreasSetupCorrect(i.DailyCleaningRules,o.filter(function(e){return i.DailyCleaningRules.map(function(e){return e.Id}).contains(e.ItemId)&&e.IsSelected}),n.DepartmentAreas,!1,!1)&&r.addValidationError(s,e,i,null,"Sådan gør du rent har en ugyldig opsætning af underområder."),i.MaintenanceRules.any(function(e){return e.Recommended})&&!i.MaintenanceRules.any(function(t){return o.any(function(e){return e.ItemId==t.Id&&1==e.IsSelected})})&&r.addValidationError(s,e,i,null,"Sådan vedligeholder du skal have mindst 1 regel valgt."),i.MaintenanceRules.any(function(t){return t.ColorCode==a.Red&&o.any(function(e){return e.ItemId==t.Id&&e.IsSelected})})&&r.addValidationError(s,e,i,null,"Sådan vedligeholder du har mindst 1 rød regel valgt. Dette er ikke tilladt."),n.DepartmentAreas.any()&&!r.getIsDepartmentAreasSetupCorrect(i.MaintenanceRules,o.filter(function(e){return i.MaintenanceRules.map(function(e){return e.Id}).contains(e.ItemId)&&e.IsSelected}),n.DepartmentAreas,!1,!1)&&r.addValidationError(s,e,i,null,"Sådan vedligeholder du har en ugyldig opsætning af underområder."),i.BeforeMovingRuleGroups.forEach(function(t){o.any(function(e){return e.ItemId==t.Id&&1==e.IsSelected})&&(t.MaintenanceRules.any(function(t){return o.any(function(e){return e.ItemId==t.Id&&1==e.IsSelected})})||r.addValidationError(s,e,i,t,"Regelgruppen er tilvalgt, men har ingen regler valgt under sig."),t.Obligatory&&!t.MaintenanceRules.any(function(t){return o.any(function(e){return e.ItemId==t.Id&&1==e.IsSelected})})&&r.addValidationError(s,e,i,t,"Regelgruppen er obligatorisk, men har ingen regler valgt under sig."),t.MaintenanceRules.any(function(t){return o.any(function(e){return e.ItemId==t.Id&&e.IsSelected})&&t.ColorCode==a.Red})&&r.addValidationError(s,e,i,t,"Regelgruppen har mindst 1 rød regel valgt. Dette er ikke tilladt."),n.DepartmentAreas.any())&&!r.getIsDepartmentAreasSetupCorrect(t.MaintenanceRules,o.filter(function(e){return t.MaintenanceRules.map(function(e){return e.Id}).contains(e.ItemId)&&e.IsSelected}),n.DepartmentAreas,t.Obligatory,0==t.AllowMultipleSelection)&&r.addValidationError(s,e,i,t,"Regelgruppen har en ugyldig opsætning af underområder.")})))})}),s},i.prototype.getIsDepartmentAreasSetupCorrect=function(e,i,t,n,o){if(0!=e.length&&0!=t.length)for(var r=0;r<t.length;r++){var s=t[r],a=e.map(function(t){return i.find(function(e){return e.ItemId==t.Id})}).filter(function(e){return null!=e}).filter(function(e){return null==e.DepartmentAreas||0==e.DepartmentAreas.length}).length+e.filter(function(t){var e=i.find(function(e){return e.ItemId==t.Id&&e.IsSelected});return null!=e&&0<e.DepartmentAreas.length&&e.DepartmentAreas.any(function(e){return e==s.Id})}).length;if(o&&0==n&&1<a||n&&0==a||o&&n&&1<a)return!1}return!0},i.prototype.addValidationError=function(e,t,i,n,o){e.sectionGroups.any(function(e){return e.id==t.Id})||e.sectionGroups.add({sections:[],id:t.Id,name:t.Name}),e.sectionGroups.firstOrDefault(function(e){return e.id==t.Id}).sections.any(function(e){return e.id==i.Id})||e.sectionGroups.firstOrDefault(function(e){return e.id==t.Id}).sections.add({id:i.Id,name:i.Name,validationErrors:[],beforeMovingMaintenanceRuleGroups:[]}),(null!=n?(e.sectionGroups.firstOrDefault(function(e){return e.id==t.Id}).sections.firstOrDefault(function(e){return e.id==i.Id}).beforeMovingMaintenanceRuleGroups.any(function(e){return e.id==n.Id})||e.sectionGroups.firstOrDefault(function(e){return e.id==t.Id}).sections.firstOrDefault(function(e){return e.id==i.Id}).beforeMovingMaintenanceRuleGroups.add({id:n.Id,name:n.Text,validationErrors:[]}),e.sectionGroups.firstOrDefault(function(e){return e.id==t.Id}).sections.firstOrDefault(function(e){return e.id==i.Id}).beforeMovingMaintenanceRuleGroups.firstOrDefault(function(e){return e.id==n.Id})):e.sectionGroups.firstOrDefault(function(e){return e.id==t.Id}).sections.firstOrDefault(function(e){return e.id==i.Id})).validationErrors.push(o)},i.prototype.getApproveRegulationDatepickerOptions=function(){return{maxDate:new Date}}
1,i.prototype.addUploadedFiles=function(t,e,i,n){var o=this;e.addRange(i.map(function(e){e=o.fileService.toUploadedFile(e,n);return n===r.Utility.File.UploadedFileType.Image&&o.fileService.attachThumbnail(e,t),e}))},i.prototype.getSelectedRulesInSectionGroupByColor=function(e,i,t){var n=this,o=0;return e.Sections.filter(function(t){return i.any(function(e){return e.ItemId==t.Id&&e.IsSelected})}).forEach(function(e){return o+=n.getSelectedRulesInSectionByColor(e,i,t)}),o},i.prototype.getSelectedRulesInSectionByColor=function(t,i,n){var o=this,r=0;return i.any(function(e){return e.ItemId==t.Id&&e.IsSelected})&&(t.DailyCleaningRules.forEach(function(e){return r+=o.isMaintenanceRuleSelectedAndColor(e,i,n)?1:0}),t.MaintenanceRules.forEach(function(e){return r+=o.isMaintenanceRuleSelectedAndColor(e,i,n)?1:0}),t.MovingInConditionsRules.forEach(function(e){return r+=o.isMaintenanceRuleSelectedAndColor(e,i,n)?1:0}),t.BeforeMovingRuleGroups.filter(function(t){return i.any(function(e){return e.ItemId==t.Id&&e.IsSelected})}).forEach(function(e){return r+=o.getSelectedRulesInMaintenanceRuleGroupByColor(e,i,n)}),t.GuidanceInformations.forEach(function(e){return r+=o.getSelectedGuidanceInformationsInSectionByColor(e,i,n)?1:0})),r},i.prototype.getSelectedGuidanceInformationsInSectionByColor=function(t,e,i){return e.any(function(e){return e.ItemId==t.Id&&e.IsSelected})&&t.ColorCode==i},i.prototype.getSelectedRulesInMaintenanceRuleGroupByColor=function(e,i,t){var n=this,o=0;return e.MaintenanceRules.filter(function(t){return i.any(function(e){return e.ItemId==t.Id&&e.IsSelected})}).forEach(function(e){return o+=n.isMaintenanceRuleSelectedAndColor(e,i,t)?1:0}),o},i.prototype.isMaintenanceRuleSelectedAndColor=function(t,e,i){return e.any(function(e){return e.ItemId==t.Id&&e.IsSelected})&&t.ColorCode==i},i.$inject=["$timeout","FileService"],app.service("RegulationUtilitiesService",i)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.dashboardService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable}(e=e.PersonnelPortal||(e.PersonnelPortal={})).PersonnelDashboard||(e.PersonnelDashboard={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){t.currentPage=e,t.disposables.add(t.dashboardService.getCurrentUsersDashboardAreas(e.Id).subscribe(function(e){e&&(t.currentUserAreas=e)}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["DashboardService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/PersonnelDashboard/PersonnelDashboard.component.html",this.bindings={}},app.component("personnelDashboard",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.$modalInstance=e,this.modalData=t,this.tenantRentService=i,this.disposables=new Rx.CompositeDisposable,this.loading=!0}t=(t=(t=(t=e.TenantPortal||(e.TenantPortal={})).Rents||(t.Rents={})).BAccount||(t.BAccount={})).Modals||(t.Modals={}),i.prototype.$onInit=function(){var t=this;this.tenantRentService.getRequisitionRequestInfo().then(function(e){e&&(t.name=e.Name,t.tenancyNumber=e.TenancyNumber),t.loading=!1}),this.requestMinimumAmount=e.CrossPortal.Settings.Settings.requisitionRequestMinimumAmount},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.submit=function(e){var t=this;e.$valid&&(e={RequestedAmount:this.requestAmount,RequestedDescription:this.requestDescription},this.tenantRentService.createRequisitionRequest(e).then(function(e){e&&t.$modalInstance.close()}))},i.prototype.cancel=function(){this.$modalInstance.close()},i.$inject=["$uibModalInstance","modalData","TenantRentService"],t.RequestRequisitionModalController=i}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(){this.disposables=new Rx.CompositeDisposable,this.hideDepositTable=e.CrossPortal.Settings.Settings.hideDepositTable}(t=(t=(t=e.TenantPortal||(e.TenantPortal={})).Rents||(t.Rents={})).PaymentRent||(t.PaymentRent={})).DepositList||(t.DepositList={}),n.prototype.$onInit=function(){},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.payDeposit=function(e){this.onPayDeposit({deposits:e})},n.$inject=[],i=n,t=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/PaymentRent/DepositList/DepositList.component.html",this.transclude=!0,this.bindings={depositsToPay:"<",onPayDeposit:"&"}},app.component("depositList",new t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=(e=e.TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={})).PaymentRent||(e.PaymentRent={})).PaymentRentPaymentTerms||(e.PaymentRentPaymentTerms={}),t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.modalData.callback&&this.acceptedPaymentConditions&&this.modalData.callback()},t.prototype.cancel=function(){this.$modalInstance.close(!1)},t.$inject=["$uibModalInstance","modalData"],e.PaymentRentPaymentTermsModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.featureFlagService=e,this.disposables=new Rx.CompositeDisposable}(e=(e=(e=e.TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={})).PaymentRent||(e.PaymentRent={})).RentList||(e.RentList={}),i.prototype.$onInit=function(){this.splitRentAndDebts=this.featureFlagService.rentPayment.separateDebtsFromNextRent,this.rent&&(this.fullTenantNumber=this.rent.FullTenantNumber,this.rents=this.rent.RentPayments,this.futureRent=this.rent.FutureRent,this.owedRent=this.rent.OwedRent)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.payRent=function(e,t){this.onPayRent({rent:e,fullTenantNumber:t})},i.$inject=["FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/PaymentRent/RentList/RentList.component.html",this.transclude=!0,this.bindings={rent:"<",onPayRent:"&"}},app.component("rentList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.dashboardService=e,this.pageContentService=t,this.$compile=i,this.$element=n,this.$scope=o,this.disposables=new Rx.CompositeDisposable}(e=e.TenantPortal||(e.TenantPortal={})).TenantDashboard||(e.TenantDashboard={}),i.prototype.$onInit=function(){var i=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){i.currentPage=e,i.disposables.add(i.dashboardService.getDashboardContent(e.Id).subscribe(function(e){var t;e&&(i.dashboardContent=e,t=i.$element.find(".page-grid-container"),e.GridHtml)&&t&&(t.empty(),t.append(i.$compile(e.GridHtml)(i.$scope.$new(!0))))}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getMyTenancyLinks=function(){return null==this.dashboardContent||null==this.dashboardContent.MyTenancyLinks?[]:this.dashboardContent.MyTenancyLinks.Links},i.$inject=["DashboardService","PageContentService","$compile","$element","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/TenantDashboard/TenantDashboard.component.html",this.bindings={}},app.component("tenantDashboard",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.pageContentService=e,this.pageProviderService=t,this.utilityService=i,this.scope=n,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).BenefitClub||(e.BenefitClub={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){t.currentPage=e,t.utilityService.safeDigest()})),this.pageProviderService.getPageByDocumentType("benefitClub").then(function(e){e&&(t.benefitClubPage=e.Url)}),this.disposables.add(this.utilityService.isHorizontalTablet.subscribe(function(e){t.isMobileView=!e,t.utilityService.safeDigest()}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.shouldShowLargeBox=function(){return this.currentPage&&this.currentPage.IsFrontpage&&!this.isMobileView},i.$inject=["PageContentService","PageProviderService","UtilityService","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/BenefitClub/BenefitClub.component.html",this.bindings={}},app.component("benefitClub",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.owlCarouselOptionsService=e,this.$element=t,this.siteMenuStateService=i,this.orderBy=""}(e=(e=e.Ui||(e.Ui={})).Carousel||(e.Carousel={})).CarouselWithLightBox||(e.CarouselWithLightBox={}),i.prototype.$onInit=function(){this.images&&0<this.images.length&&!this.images[0].Url&&(this.images=this.images.map(function(e){return{Id:0,Name:"",Photographer:"",SortOrder:0,Url:e}})),this.imageDefinition&&""!==this.imageDefinition?this.imageDefinition="?definition="+this.imageDefinition:this.imageDefinition="?definition=",jQuery(document.documentElement).keyup(function(e){var t=jQuery(".owl-carousel.owl-standard");"ArrowLeft"==e.key?t.trigger("prev.owl"):"ArrowRight"==e.key&&t.trigger("next.owl")}),this.siteMenuStateService.toggleMenuSection$.subscribe(function(e){setTimeout(function(){window.dispatchEvent(new Event("resize"))},500)})},i.prototype.$onChanges=function(e){var t=this;e.images&&this.images&&0<this.images.length&&setTimeout(function(){var e=t.$element.find(".owl-carousel.owl-standard");t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions(),t.options.navElement="button",1==t.images.length&&(t.options.loop=!1,t.options.mouseDrag=!1,t.options.freeDrag=!1)),e.owlCarousel(t.options)},100)},i.$inject=["OwlCarouselOptionsService","$element","SiteMenuStateService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/Carousels/Carou
1selWithLightBox/OwlCarouselWithLightBox.component.html",this.bindings={images:"<",options:"<",imageDefinition:"<",description:"<",orderBy:"@"}},app.component("owlCarouselWithLightBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.owlCarouselOptionsService=e,this.$element=t,this.orderBy=""}(e=(e=e.Ui||(e.Ui={})).Carousel||(e.Carousel={})).StandardForLightbox||(e.StandardForLightbox={}),i.prototype.$onInit=function(){this.images&&0<this.images.length&&!this.images[0].Url&&(this.images=this.images.map(function(e){return{Id:0,Name:"",Photographer:"",SortOrder:0,Url:e}})),this.imageDefinition&&""!==this.imageDefinition?this.imageDefinition="?definition="+this.imageDefinition:this.imageDefinition="?definition=",jQuery(document.documentElement).keyup(function(e){var t=jQuery(".owl-carousel.owl-standard");"ArrowLeft"==e.key?t.trigger("prev.owl"):"ArrowRight"==e.key&&t.trigger("next.owl")})},i.prototype.$onChanges=function(e){var t=this;e.images&&this.images&&0<this.images.length&&setTimeout(function(){var e=t.$element.find(".owl-carousel.owl-standard");t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions(),t.options.navElement="button",1==t.images.length&&(t.options.loop=!1,t.options.mouseDrag=!1,t.options.freeDrag=!1)),t.startIndex&&(t.options.startPosition=t.startIndex),e.owlCarousel(t.options)},200)},i.$inject=["OwlCarouselOptionsService","$element"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/Carousels/StandardForLightbox/OwlCarouselForLightBox.component.html",this.bindings={images:"<",options:"<",imageDefinition:"<",description:"<",url:"<",startIndex:"<",orderBy:"@"}},app.component("owlCarouselForLightboxCarousel",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.featureFlagService=e,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).ContentLayout||(e.ContentLayout={}),i.prototype.$onInit=function(){this.pushingSiteMenuEnabled=this.featureFlagService.siteMenu.enablePushingSiteMenu},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="content",this.transclude=!0,this.template="<ng-transclude></ng-transclude>",this.bindings={}},app.component("contentLayout",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).FoldoutMenu||(e.FoldoutMenu={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.invokeCallback=function(e){null!=e&&"function"==typeof e&&e()},i.prototype.getFoldoutMenuItemUrl=function(e){return e||"javascript:void(0)"},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/FoldoutMenu/FoldoutMenu.component.html",this.bindings={foldoutMenu:"<"}},app.component("foldoutMenu",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.eventPortalCalendarService=e,this.getAvailabilityTextFor=function(e){return e.IsParticipant?"Tilmeldt":"Public"==e.Availability?"Offentlig":"Open"==e.Availability?"Ã
ben":"Tilmeld"},this.eventLimit=3,this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Dashboard||(e.Dashboard={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.eventPortalCalendarService.getEvents(this.eventLimit).subscribe(function(e){e&&(t.calendar=e,t.calendar.Events.forEach(function(e){e.availabilityText=t.getAvailabilityTextFor(e)}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.goTo=function(e){e&&(location.href=e.Url)},i.$inject=["EventPortalCalendarService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Calendar/Dashboard/EventPortalCalendar/EventPortalCalendar.component.html",this.bindings={}},app.component("eventPortalBoardCalendar",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.$sce=i,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.CrossPortal||(e.CrossPortal={})).InComForms||(e.InComForms={})).SignDocument||(e.SignDocument={}),t.prototype.$onInit=function(){this.signatureLink=this.$sce.trustAsResourceUrl(this.modalData.SignatureLink)},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.$inject=["$uibModalInstance","modalData","$sce"],e.SignDocumentController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.faqService=e,this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Faq||(e.Faq={})).Dashboard||(e.Dashboard={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.faqService.getFaqItems(this.pageId).subscribe(function(e){t.faqItems=e.FaqItems}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["CmsFaqService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Faq/Dashboard/MyPageFaq.component.html",this.bindings={pageId:"<",linkToFaq:"<"}},app.component("myPageFaq",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.cmsNewsService=e,this.owlCarouselOptionsService=t,this.pageProvider=i,this.definitionHelper=n,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).News||(e.News={})).Dashboard||(e.Dashboard={})).PublicNewsList||(e.PublicNewsList={}),i.prototype.$onInit=function(){var t=this;this.entryLimit||(this.entryLimit=3),this.pageProvider.getPageByDocumentType("publicCmsNewsOverview").then(function(e){e&&(t.publicNewsUrl=e.Url)}),this.disposables.add(this.cmsNewsService.getLatestNews$(this.entryLimit).subscribe(function(e){e&&(t.usePublicNewsSlider&&setTimeout(function(){var e=$(".owl-newslist.publicnews");t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions(),t.options.lazyLoad=!0,t.options.animateOut="fadeOut",t.options.animateIn="fadeIn",t.options.nav=!0,t.options.loop=!1,t.options.mouseDrag=!1,t.options.touchDrag=!1),e.on("translate.owl.carousel",function(e){$(".public-news-index").text(e.item.index+1)}),e.on("initialized.owl.carousel",function(e){$(".public-news-index").text(e.item.index+1)}),e.owlCarousel(t.options)},200),t.latestNews=e.latestNews)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getDefinitionSeperator=function(e){return this.definitionHelper.getDefinitionSeperator(e)},i.$inject=["CmsNewsService","OwlCarouselOptionsService","PageProviderService","ImageDefinitionHelperService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/News/Dashboard/PublicNews/PublicNewsList/PublicNewslist.component.html",this.bindings={entryLimit:"<",usePublicNewsSlider:"<"}},app.component("publicNewsList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.departmentSelectorService=e,this.$scope=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable,this.currentPage=0,this.entryLimit=10,this.allMapMarkers=[]}(e=(e=(e=e.Housing||(e.Housing={})).Department||(e.Department={})).DepartmentSelector||(e.DepartmentSelector={})).DepartmentSelectorForCompany||(e.DepartmentSelectorForCompany={}),i.prototype.$onInit=function(){var o=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&o.disposables.add(o.departmentSelectorService.getDepartmentsForCompany(e.Id).subscribe(function(e){e&&(o.departments=e,o.shownDepartments=e,o.getAllMapMarkers(e),e.forEach(function(e){for(var t=[],i=0;i<e.Addresses.length;i++)e.Addresses[i].Coordinates&&t.add({Lat:e.Addresses[i].Coordinates.Lat,Lng:e.Addresses[i].Coordinates.Lng,InfoBox:{Headline:e.Name,Description:e.Addresses[i].Street+" "+e.Addresses[i].Location,Image:e.Images.any()?e.Images.firstOrDefault().Url:null}});e.googlemarkers=t}))}))}),this.$scope.$watch(function(){return o.sText},function(e,t){if(e&&e!==t){for(var i=[],n=0;n<o.departments.length;n++)o.departmentMatch(o.departments[n])&&i.add(o.departments[n]);o.shownDepartments=i}else e&&""!==e||(o.shownDepartments=o.departments)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getAllMapMarkers=function(e){var n=[];e.forEach(function(e){for(var t,i=0;i<e.Addresses.length;i++)e.Addresses[i].Coordinates&&(t=e.Images.any()?e.Images.firstOrDefault().Url:null,e.Description,n.add({Lat:e.Addresses[i].Coordinates.Lat,Lng:e.Addresses[i].Coordinates.Lng,InfoBox:{Headline:e.Name,Description:e.Address.Street+" "+e.Address.Location,Image:t,Link:e.PresentationUrl}}))}),this.allMapMarkers=n},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.departmentMatch=function(e){for(var t=!1,i=e,n=this.sText.toLowerCase().split(" "),o=0;o<n.length;o++)if(""!==n[o]){var r,t=null!=i.Name&&null!=i.Name&&-1<i.Name.toLowerCase().indexOf(n[o])||null!=i.Id&&null!=i.Id&&-1<i.Id.toString().indexOf(n[o])||null!=e.Address.ZipCode&&null!=e.Address.ZipCode&&-1<e.Address.ZipCode.toLowerCase().indexOf(n[o])||null!=e.Address.City&&null!=e.Address.City&&-1<e.Address.City.toLowerCase().indexOf(n[o])||null!=e.Address.Street&&null!=e.Address.Street&&-1<e.Address.Street.toLowerCase().indexOf(n[o]);if(-1<this.sText.toLowerCase().indexOf("afd")&&(r=-1<this.sText.toLowerCase().indexOf("afd.")?n.indexOf("afd."):n.indexOf("afd"),n.splice(r,1),t=null!=i.Name&&null!=i.Name&&-1<i.Name.toLowerCase().indexOf(n[o])||null!=i.Id&&null!=i.Id&&-1<i.Id.toString().indexOf(n[o])||null!=e.Address.ZipCode&&null!=e.Address.ZipCode&&-1<e.Address.ZipCode.toLowerCase().indexOf(n[o])||null!=e.Address.City&&null!=e.Address.City&&-1<e.Address.City.toLowerCase().indexOf(n[o])||null!=e.Address.Street&&null!=e.Address.Street&&-1<e.Address.Street.toLowerCase().indexOf(n[o])),!t)break}return t},i.$inject=["DepartmentSelectorService","$scope","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Department/DepartmentSelector/DepartmentSelectorForCompany/DepartmentSelectorForCompany.component.html",this.bindings={}},app.component("departmentSelectorForCompany",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.departmentSelectorService=e,this.disposables=new Rx.CompositeDisposable,this.selectedDepartment=null}(e=(e=e.Housing||(e.Housing={})).Department||(e.Department={})).DepartmentSelectorSpecificPage||(e.DepartmentSelectorSpecificPage={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.goToPageOnDepartment=function(){this.selectedDepartment&&(this.documentType?this.departmentSelectorService.goToPageOnDepartment(this.selectedDepartment,this.documentType):this.departmentSelectorService.goToDepartment(this.selectedDepartment))},i.$inject=["DepartmentSelectorService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Department/DepartmentSelector/DepartmentSelectorSpecificPage/DepartmentSelectorSpecificPage.component.html",this.bindings={documentType:"<"}},app.component("departmentSelectorSpecificPage",new e)}(BoligExtra=BoligExtra||{}),!function(n){var i,t,e,o,r;function s(e,t,i,n,o,r,s){this.modalService=e,this.basketService=t,this.utilityService=i,this.loaderService=n,this.pageProviderService=o,this.featureFlagService=r,this.scope=s,this.subscriptions=new Rx.CompositeDisposable}i=n.Housing||(n.Housing={}),t=i.Tenancy||(i.Tenancy={}),e=t.Presentation||(t.Presentation={}),s.prototype.$onInit=function(){var i=this;this.subscriptions.add(this.utilityService.isMobile$.subscribe(function(e){i.isMobileView=e})),this.enableLabels=this.featureFlagService.tenancyPresentationLabels.enableLabels,this.treatAvailableTenanciesLikeStandardTenancies=this.featureFlagService.availableTenancies.treatAvailableTenanciesLikeStandardTenancies,this.toggleSpecificTenancies&&(this.groupTenancies(),this.scope.$watch(function(){return i.tenancyGrouping},function(e,t){e&&e!=t&&i.groupTenancies()}))},s.prototype.groupTenancies=function(){var o=this;
1this.tenancyGrouping.roomGroupings.forEach(function(e){e.identifier=o.newGuid(),e.tenancies=e.tenancies.orderBy(function(e){return e.Deposit}).orderBy(function(e){return e.Rent}).orderBy(function(e){return e.Size}),e.tenancies.forEach(function(e){return e.identifier=o.newGuid()}),e.tenanciesDistincted=e.tenancies.orderByDescending(function(e){return e.IsStandard}).reduce(function(e,t){var i=[t.Floor,t.Size,t.Rent,t.Deposit].join("-"),n=e.find(function(e){return e.key==i});return n||((n={key:i,value:[]}).identifier=o.newGuid(),e.push(n)),n.value.push(t),e},[]).orderBy(function(e){return e.key})}),this.subscriptions.add(this.basketService.contents$.subscribe(function(e){o.tenancyGrouping.roomGroupings.forEach(function(e){e.IsWish=e.tenancies.every(function(e){return e.IsWish});var i=0;e.tenanciesDistincted.forEach(function(e){var t=0;e.value.forEach(function(e){e.IsWish&&(i++,t++)}),e.HasWish=0<t}),e.HasWish=0<i})}))},s.prototype.toggleTenancyOpenState=function(e,t){e.showTen=!e.showTen,t.hasOpenTenancies=t.tenancies.some(function(e){return e.showTen})},s.prototype.getDepartmentTenancyButtonText=function(e){var t=1==e.IsWish?"Fjern ":"Tilføj ",i=this.getAmountOfTenanciesThatIsWished(e.tenancies),n=1==e.IsWish?e.tenancies.length:e.tenancies.length-i;return this.showOnlyWishes?"Fjern "+i:t+n+(1<e.tenancies.length?" boliger ":" bolig ")+(0!=i&&i!=e.tenancies.length?" af "+e.tenancies.length:"")},s.prototype.getAmountOfTenanciesThatIsWished=function(e){var t=0;return e.forEach(function(e){e.IsWish&&t++}),t},s.prototype.getTenancyButtonText=function(e){var t=this.isAllWishedFor(e),i=t?"Fjern ":"Tilføj ",n=this.getAmountOfTenanciesThatIsWished(e),t=t?e.length:e.length-n;return this.showOnlyWishes?"Fjern "+n:i+t+(0!=n&&n!=e.length?" af "+e.length:"")},s.prototype.toggleWishesForDepartment=function(e,t,i){var n=this,o=this.loaderService.setLoader(i=void 0===i?"":i,i);(this.isAllWishedFor(e)||this.showOnlyWishes?this.basketService.removeTenancies(e):this.basketService.addTenancies(e)).finally(function(){n.loaderService.removeLoader(o)})},s.prototype.isAllWishedFor=function(e){return e.every(function(e){return e.IsWish})},s.prototype.showAssignmentRule=function(e){this.modalService.createModal("/App/Housing/TenancySearch/Modals/AssignmentRule.modal.html",i.TenancySearch.Modals.AssignmentRuleModalController,{assignmentRuleId:e},"md")},s.prototype.toggleWish=function(e,t,i){var n=this,o=(void 0===i&&(i=""),angular.isArray(e)||(e=[e]),this.loaderService.setLoader(i,"toggleTenancies"));(e.every(function(e){return e.IsWish})?this.basketService.removeTenancies(e):this.basketService.addTenancies(e).then(function(e){n.pageProviderService.getPageByDocumentType("basket").then(function(e){return n.basketPage=e})})).finally(function(){n.loaderService.removeLoader(o)})},s.prototype.removeWish=function(e,t,i){var n,o,r=this;void 0===i&&(i=""),angular.isArray(e)?(n=this.loaderService.setLoader(i,"toggleTenancies"),this.basketService.removeTenancies(e).finally(function(){r.loaderService.removeLoader(n)})):(e=[e])[0].IsWish&&(o=this.loaderService.setLoader(i,"toggleTenancies"),this.basketService.removeTenancies(e).finally(function(){r.loaderService.removeLoader(o)}))},s.prototype.viewFloorPlan=function(e){for(var t={media:[],title:"Plantegninger",doPrint:!1,height:500,width:600},i=0;i<e.length;i++)t.media.push({Name:e[i],Url:e[i]});this.modalService.createModal("/App/Ui/Modals/Gallery/GalleryModal.html",n.Ui.Modals.Gallery.GalleryModalController,t,"md")},s.prototype.viewTenancy=function(e){var e={tenancy:e,toggleSpecificTenancies:this.toggleSpecificTenancies},t=new n.Utility.Modal.ModalSettings;t.template="/App/Housing/Tenancy/Presentation/Modal/TenancyPresentation.Modal.html",t.data=e,t.controller=i.Tenancy.Presentation.Modal.TenancyPresentationController,t.size="lg",t.backdrop=!0,this.modalService.createModalWithSettings(t)},s.prototype.missingPlacementInfo=function(){this.modalService.createModal("/App/Housing/Tenancy/Presentation/Modal/TenancyPlacementInfo.modal.html",e.Modal.TenancyPlacementInfoController,"lg")},s.prototype.openRequestModal=function(e){e={companyId:e.CompanyId,departmentId:e.DepartmentId,tenancyId:e.TenancyId,address:e.Address,moveInDate:e.MoveInDate};this.modalService.createModal("/App/Housing/Tenancy/Modals/RequestAvailableTenancy.Modal.html",t.Modals.RequestAvailableTenancyController,e)},s.prototype.newGuid=function(){return this.utilityService.newGuid().replace(/-/g,"")},s.$inject=["ModalService","BasketService","UtilityService","LoaderService","PageProviderService","FeatureFlagService","$scope"],o=s,r=function(){this.controller=o,this.templateUrl=["$element","$attrs",function(e,t){return"true"===t.toggleSpecificTenancies?"/App/Housing/Tenancy/Presentation/TenancyTableSpecificSignup.component.html":"/App/Housing/Tenancy/Presentation/TenancyTable.component.html"}],this.bindings={showOnlyWishes:"<",tenancyGrouping:"<",toggleSpecificTenancies:"@",isInteressent:"<",type:"<",showOnlyAvailable:"<",showTables:"<"}},app.component("tenancyTable",new r)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o){this.emailHistoryOverviewService=e,this.utilityService=t,this.pageContentService=i,this.modalService=n,this.loaderService=o,this.disposables=new Rx.CompositeDisposable,this.page=0,this.sort="",this.toDate=new Date,this.fromDate=new Date(this.toDate.getFullYear(),this.toDate.getMonth()-1,this.toDate.getDate()),this.datepickerOptionsTo={minDate:this.fromDate}}e=e.PersonnelPortal||(e.PersonnelPortal={}),i=e.EmailHistory||(e.EmailHistory={}),n.prototype.$onInit=function(){var t=this;this.entryLimit||(this.entryLimit=250),this.datePickerFormat=this.utilityService.shortDateFormat,this.longDateTimeFormat=this.utilityService.longDateTimeFormat,this.dateSelectedChanged(),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){t.currentPage=e})),this.disposables.add(this.emailHistoryOverviewService.emailSearchResult$.subscribe(function(e){e&&(t.emailItems=e.EmailHistoryListItems,t.sort="Sent",t.setSort())})),this.disposables.add(this.emailHistoryOverviewService.emailDetailsResult$.subscribe(function(e){e&&(e={pageId:t.currentPage.Id,emailDetails:e},t.modalService.createModal("/App/PersonnelPortal/EmailHistory/Modals/EmailDetails.modal.html",i.Modals.EmailDetailsController,e))}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.dateSelectedChanged=function(){this.fromDate.getTime()>this.toDate.getTime()&&(this.toDate=this.fromDate),this.datepickerOptionsTo={minDate:this.fromDate}},n.prototype.search=function(){var t=this,e={SearchString:this.searchString,FromDate:this.utilityService.formatDate(this.fromDate,"iso date time"),ToDate:this.utilityService.formatDate(this.toDate,"iso date time")},i=this.loaderService.setLoader("contentSection","GetEmailHistory");this.emailHistoryOverviewService.getEmails(this.currentPage.Id,e).then(function(e){return t.loaderService.removeLoader(i)})},n.prototype.clearSearch=function(){this.searchString=null,this.emailItems=null,this.toDate=new Date,this.fromDate=new Date(this.toDate.getFullYear(),this.toDate.getMonth()-1,this.toDate.getDate())},n.prototype.setSort=function(e){switch(this.sort===(e=void 0===e?"Sent":e)?this.sort="-"+e:this.sort=e,this.sort){case"Subject":this.emailItems=this.emailItems.orderBy(function(e){return e.Subject});break;case"-Subject":this.emailItems=this.emailItems.orderByDescending(function(e){return e.Subject});break;case"Receiver":this.emailItems=this.emailItems.orderBy(function(e){return e.Receiver});break;case"-Receiver":this.emailItems=this.emailItems.orderByDescending(function(e){return e.Receiver});break;case"Sent":this.emailItems=this.emailItems.orderBy(function(e){return e.Sent});break;case"-Sent":this.emailItems=this.emailItems.orderByDescending(function(e){return e.Sent})}},n.prototype.updatePage=function(e){this.page=e},n.prototype.viewDetails=function(e){var t=this,i=this.loaderService.setLoader("contentSection","GetEmailDetails");this.emailHistoryOverviewService.getEmailDetails(this.currentPage.Id,e.Id).then(function(e){return t.loaderService.removeLoader(i)})},n.$inject=["EmailHistoryOverviewService","UtilityService","PageContentService","ModalService","LoaderService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/EmailHistory/EmailHistoryOverview.component.html",this.bindings={entryLimit:"<"}},app.component("emailHistoryOverview",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.incomHttp=e,this.baseurl="/umbraco/api/EmailHistoryOverview/",this.emailSearchResult$
1=new Rx.Subject,this.emailDetailsResult$=new Rx.Subject}(e=e.PersonnelPortal||(e.PersonnelPortal={})).EmailHistory||(e.EmailHistory={}),t.prototype.getEmails=function(e,t){var i=this,e=this.incomHttp.post(this.baseurl+"GetEmails/"+e,t);return e.then(function(e){i.emailSearchResult$.onNext(e)}),e},t.prototype.getEmailDetails=function(e,t){var i=this,t=this.incomHttp.get(this.baseurl+"GetDetails?id="+t+"&pageId="+e);return t.then(function(e){i.emailDetailsResult$.onNext(e)}),t},t.prototype.resendEmail=function(e){this.incomHttp.post(this.baseurl+"ResendEmail/",e)},t.prototype.sendCopyOfEmail=function(e){this.incomHttp.post(this.baseurl+"SendCopyOfEmail/",e)},t.$inject=["incomHttpService"],app.service("EmailHistoryOverviewService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r){this.$modalInstance=e,this.modalData=t,this.fileService=i,this.emailHistoryOverviewService=n,this.validationService=o,this.utilityService=r,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).EmailHistory||(e.EmailHistory={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.emailRegex=this.validationService.getEmailRegex(),this.longDateTimeFormat=this.utilityService.longDateTimeFormat},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.cancel=function(){this.$modalInstance.close()},t.prototype.getFileIconClass=function(e){return this.fileService.getFileIconClass(e)},t.prototype.downloadFile=function(e){e&&this.fileService.downloadFile([e])},t.prototype.resendMail=function(){var e;confirm("Er du sikker på, at du vil genudsende denne e-mail?")&&(e={EmailId:this.modalData.emailDetails.Id,PageId:this.modalData.pageId},this.emailHistoryOverviewService.resendEmail(e))},t.prototype.sendCopyOfEmail=function(){var e={EmailId:this.modalData.emailDetails.Id,PageId:this.modalData.pageId,CopyReceiver:this.emailCopyReceiver};this.emailHistoryOverviewService.sendCopyOfEmail(e)},t.$inject=["$uibModalInstance","modalData","FileService","EmailHistoryOverviewService","ValidationService","UtilityService"],e.EmailDetailsController=t}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t){this.EgUserProviderStateService=e,this.modalService=t,this.editing=!0,this.persons=[],this.companies=[],this.departments=[],this.roles=[],this.roleGroups=[],this.shownRoles=[],this.shownDepartments=[],this.disposables=new Rx.CompositeDisposable,this.amountOfSelectedCompanies=0,this.amountOfSelectedDepartments=0,this.amountOfSelectedRoleGroups=0,this.amountOfSelectedRoles=0,this.groupedShownRoles=[]}e=e.CrossPortal||(e.CrossPortal={}),i=e.EgUserProvider||(e.EgUserProvider={}),n.prototype.$onInit=function(){var n=this;this.EgUserProviderStateService.getRoleGroups(),this.EgUserProviderStateService.getRolesInRoleGroup(),this.EgUserProviderStateService.getCompanies(),this.EgUserProviderStateService.getDepartments(),this.disposables.add(this.EgUserProviderStateService.resetSelected$.subscribe(function(e){e&&(n.resetSelection(n.companies),n.resetSelection(n.departments),n.resetSelection(n.shownDepartments),n.resetSelection(n.roleGroups),n.resetSelection(n.roles),n.resetSelection(n.shownRoles),n.resetSelection(n.shownPersons),n.resetSelection(n.persons))})),this.disposables.add(this.EgUserProviderStateService.companies$.subscribe(function(e){var t;n.participants.Companies&&(e.forEach(function(t){return t.Selected=n.participants.Companies.some(function(e){return e.CompanyNo==t.CompanyNo})}),n.amountOfSelectedCompanies=e.filter(function(e){return e.Selected}).length),n.companies=[],(t=n.companies).push.apply(t,JSON.parse(JSON.stringify(e))),n.departments&&0<n.departments.length&&0<n.companies.length&&n.validateDepartments(),n.Step=1})),this.disposables.add(this.EgUserProviderStateService.departments$.subscribe(function(e){var t;n.participants.Departments&&(e.forEach(function(t){return t.Selected=n.participants.Departments.some(function(e){return e.CompanyNo==t.CompanyNo&&e.DepartmentNo==t.DepartmentNo})}),n.shownDepartments=[],(t=n.shownDepartments).push.apply(t,JSON.parse(JSON.stringify(e))),n.addDepartmentZeroToDepartmentsForEachCompany(n.shownDepartments)),n.departments=[],(t=n.departments).push.apply(t,JSON.parse(JSON.stringify(e))),n.addDepartmentZeroToDepartmentsForEachCompany(n.departments),0<n.departments.length&&n.companies&&0<n.companies.length&&n.validateDepartments()})),this.disposables.add(this.EgUserProviderStateService.roleGroups$.subscribe(function(t){var e;if(n.participants.RoleGroups)for(var i=0;i<t.length;i++)t[i].Selected=n.participants.RoleGroups.some(function(e){return e.Selected&&e.Id===t[i].Id}),n.amountOfSelectedRoleGroups=t.filter(function(e){return e.Selected}).length;n.roleGroups=[],(e=n.roleGroups).push.apply(e,JSON.parse(JSON.stringify(t))),n.roles&&0<n.roles.length&&n.shownRoles&&0<n.shownRoles.length&&0<n.roleGroups.length&&n.validateRoles()})),this.disposables.add(this.EgUserProviderStateService.rolesInRoleGroup$.subscribe(function(t){var e;if(n.participants.Roles){for(var i=0;i<t.length;i++)t[i].Selected=n.participants.Roles.some(function(e){return e.Selected&&e.Id===t[i].Id});n.shownRoles=[],(e=n.shownRoles).push.apply(e,JSON.parse(JSON.stringify(t)))}n.roles=[],(e=n.roles).push.apply(e,JSON.parse(JSON.stringify(t))),0<n.roles.length&&n.roleGroups&&0<n.roleGroups.length&&n.validateRoles()})),this.disposables.add(this.EgUserProviderStateService.persons$.subscribe(function(e){var i;n.anyTenantsInList=n.shownRoles.any(function(e){return e.Selected&&"Lej"==e.RoleType}),n.anyMembersInList=n.shownRoles.any(function(e){return e.Selected&&"Med"==e.RoleType}),n.tempPersons=angular.copy(n.persons),n.persons=[],n.shownPersons=[],e&&(i=angular.copy(n.persons.filter(function(e){return e.Selected})),n.shownDepartments.any(function(e){return e.Selected})&&n.shownRoles.any(function(e){return e.Selected})&&(n.hasSetPreviousSelectedPartipants||(n.hasSetPreviousSelectedPartipants=!0,n.participants.Participants&&(n.tempPersons=n.participants.Participants,n.tempPersons.forEach(function(e){return e.Selected=!0}))),n.persons=angular.copy(e),i&&0===i.length?n.tempPersons&&n.persons.forEach(function(t){return t.Selected=n.tempPersons.some(function(e){return e.InteressentNo===t.InteressentNo})}):n.persons.forEach(function(t){return t.Selected=i.some(function(e){return e.InteressentNo===t.InteressentNo})}),n.boardmemberOrPersonnelSelected=n.shownRoles.any(function(e){return e.Selected&&("Bes"==e.RoleType||"Per"==e.RoleType)}),n.persons.forEach(function(e){var i=[],t=(e.RoleInformation.forEach(function(t){0===i.filter(function(e){return e.CompanyNo==t.CompanyNo&&e.DepartmentNo==t.DepartmentNo&&e.RoleArt==t.RoleArt&&e.RoleType==t.RoleType}).length&&i.push(t)}),e.shownRoleInformation=i,e.RoleInformation.every(function(e){return"Med"==e.RoleType||"Lej"==e.RoleType}));e.showOnTable=!t,t&&(e.Selected=t)}),n.shownPersons=n.persons.filter(function(e){return e.showOnTable})),n.anyMembersInShownList=n.persons.any(function(e){return e.RoleInformation.any(function(e){return"Med"==e.RoleType})}),n.anyTenantsInShownList=n.persons.any(function(e){return e.RoleInformation.any(function(e){return"Lej"==e.RoleType})}),n.isAllTenantsSelected=n.anyTenantsInShownList,n.isAllMembersSelected=n.anyMembersInShownList)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.allTenantsSelected=function(){var e=this.persons.filter(function(e){return e.RoleInformation.any(function(e){return"Lej"==e.RoleType})&&!e.showOnTable}),t=e.where(function(e){return e.Selected});return 0<e.length&&t.length==e.length},n.prototype.allMembersSelected=function(){var e=this.persons.filter(function(e){return e.RoleInformation.any(function(e){return"Med"==e.RoleType})&&!e.showOnTable}),t=e.where(function(e){return e.Selected});return 0<e.length&&t.length==e.length},n.prototype.selectAllMembers=function(){var t=this,i=this.allMembersSelected();this.isAllMembersSelected=!i,this.persons.forEach(function(e){e.RoleInformation.any(function(e){return"Med"==e.RoleType})&&!e.showOnTable&&(e.Selected=!i)}),this.isAllTenantsSelected=this.allTenantsSelected(),this.persons.forEach(function(e){!e.RoleInformation.any(function(e){return"Lej"==e.RoleType})||e.RoleInformation.any(function(e){return"Med"==e.RoleType})||e.showOnTable||(e.Selected=t.isAllTenantsSelected)})},n.prototype.selectAllTenants=function(){var t=this,i=this.allTenantsSelected();this.isAllTenantsSelected=!i,this.persons.forEach(function(e){e.RoleInformation.any(function(e){return"Lej"==e.RoleType})&&!e.showOnTable&&(e.Selected=!i)}),this.isAllMembersSelected=this.allMembersSelected(),this.persons.forEach(function(e){!e.RoleInformation.any(function(e){return"Med"==e.RoleType})||e.RoleInformation.any(function(e){return"Lej"==e.RoleType})||e.showOnTable||(e.Selected=t.isAllMembersSelected)})},n.prototype.onlyMembersAndTenants=function(){return this.persons.every(function(e){return!e.showOnTable})},n.prototype.addDepartmentZeroToDepartmentsForEachCompany=function(e){var t,i,n=this;e&&e.any()&&(t=e.map(function(e){return e.CompanyNo}).distinct(),i=[],t.forEach(function(t){e.some(function(e){return e.CompanyNo==t&&"00"==e.DepartmentNo.toString()})||i.push({CompanyNo:t,DepartmentNo:Number(0).minTwoDigits(),Name:e.firstOrDefault(function(e){return e.CompanyNo==t}
1).CompanyName,IsDepartmentZero:!0})}),this.participants.Departments&&i.forEach(function(t){return t.Selected=n.participants.Departments.some(function(e){return e.CompanyNo.minTwoDigits()==t.CompanyNo&&e.DepartmentNo.minTwoDigits()==t.DepartmentNo})}),e.push.apply(e,i))},n.prototype.resetSelection=function(e){e&&0<e.length&&e.forEach(function(e){return e.Selected=!1})},n.prototype.edit=function(){this.Step=1,this.editing=!this.editing},n.prototype.save=function(){var e,t=this;this.anyMembersInList||this.anyTenantsInList?(e={anyMembersInList:this.anyMembersInList,anyTenantsInList:this.anyTenantsInList},this.modalService.createModal("/App/CrossPortal/EgUserProvider/Modals/EgUserProviderMemberTenantSelection.modal.html",i.Modals.EgUserProviderMemberTenantSelectionController,e,"lg").result.then(function(e){e&&t.saveUserSelection()})):this.saveUserSelection()},n.prototype.saveUserSelection=function(){for(var t=this,e=0;e<this.shownPersons.length;e++)for(var i=0;i<this.persons.length;i++)this.shownPersons[e].InteressentNo==this.persons[i].InteressentNo&&(this.persons[i].Selected=this.shownPersons[e].Selected);0==this.shownDepartments.filter(function(e){return e.Selected}).length&&(this.validateDepartments(),this.shownDepartments.forEach(function(e){return e.Selected=!0})),0==this.shownRoles.filter(function(e){return e.Selected}).length&&(this.validateRoles(),this.amountOfSelectedRoles=this.shownRoles.length,this.shownRoles.forEach(function(e){return e.Selected=!0})),0==this.persons.filter(function(e){return e.Selected}).length?this.getPersons().then(function(e){e.Users.forEach(function(e){return e.Selected=!0}),t.participants.Participants=e.Users,t.saveSelection({model:{Companies:t.companies.filter(function(e){return e.Selected}),Departments:t.shownDepartments.filter(function(e){return e.Selected}),RoleGroups:t.roleGroups.filter(function(e){return e.Selected}),Roles:t.shownRoles.filter(function(e){return e.Selected}),Participants:e.Users}})}):this.saveSelection({model:{Companies:this.companies.filter(function(e){return e.Selected}),Departments:this.shownDepartments.filter(function(e){return e.Selected}),RoleGroups:this.roleGroups.filter(function(e){return e.Selected}),Roles:this.shownRoles.filter(function(e){return e.Selected}),Participants:this.persons.filter(function(e){return e.Selected})}}),this.Step=1,this.editing=!this.editing},n.prototype.selectAll=function(e,t){for(var i=e.any(function(e){return!e.Selected}),n=0;n<e.length;n++)e[n].Selected=i;var o=i?e.length:0;switch(t){case"companies":this.amountOfSelectedCompanies=o;break;case"departments":this.amountOfSelectedDepartments=o;break;case"roleGroups":this.amountOfSelectedRoleGroups=o;break;case"roles":this.amountOfSelectedRoles=o}},n.prototype.selectAllPersons=function(e){if(e&&e.filter)for(var t=e.filter(function(e){return e.showOnTable}).any(function(e){return!e.Selected}),i=0;i<e.length;i++)e[i].showOnTable&&(e[i].Selected=t)},n.prototype.allPersonsSelected=function(e){if(e&&e.filter)return e.filter(function(e){return e.showOnTable}).every(function(e){return e.Selected})},n.prototype.allSelected=function(e){if(e&&e.every)return e.every(function(e){return e.Selected})},n.prototype.selectedAmount=function(e){if(e&&e.filter){e=e.filter(function(e){return e.Selected});if(e)return e.length}return 0},n.prototype.canGoToStep=function(e){var t=!0;if(this.form){if(1===e)return t;2===e&&(t=this.companies.some(function(e){return e.Selected}),this.form.$setValidity("companiesNotSelected",t)),3===e&&(t=this.shownDepartments.some(function(e){return e.Selected}),this.form.$setValidity("departmentsNotSelected",t)),4===e&&(t=this.roleGroups.some(function(e){return e.Selected}),this.form.$setValidity("roleGroupsNotSelected",t)),5===e&&(t=this.shownRoles.some(function(e){return e.Selected}),this.form.$setValidity("rolesNotSelected",t))}return t},n.prototype.participantsContains=function(e,t){switch(e){case"person":return this.participants.Participants.some(function(e){return e.InteressentNo===t.InteressentNo});case"roleGroup":return this.participants.RoleGroups.some(function(e){return e.Id===t.Id});case"department":return this.participants.Departments.some(function(e){return e.CompanyNo==t.CompanyNo&&e.DepartmentNo==t.DepartmentNo});case"company":return this.participants.Companies.some(function(e){return e.CompanyNo==t.CompanyNo});case"role":return this.participants.Roles.some(function(e){return e.Id===t.Id})}},n.prototype.changeParticipantsStep=function(e){this.canGoToStep(e)&&(1===e&&(this.Step=e),2===e&&(this.validateDepartments(),this.Step=e),3===e&&(this.Step=e),4===e&&(this.validateRoles(),this.Step=e),5===e)&&(this.getPersons(),this.Step=e)},n.prototype.getPersons=function(){return this.EgUserProviderStateService.getPersons(this.shownDepartments.filter(function(e){return e.Selected}),this.shownRoles.filter(function(e){return e.Selected}))},n.prototype.validateDepartments=function(){var i=this,e=JSON.parse(JSON.stringify(this.shownDepartments)),n=this.companies.filter(function(e){return e.Selected}).map(function(e){return e.CompanyNo});if(this.shownDepartments=JSON.parse(JSON.stringify(this.departments.filter(function(e){return n.contains(e.CompanyNo)}))),this.shownDepartments){this.shownDepartments.sort(function(e,t){return Number(e.CompanyNo+e.DepartmentNo)-Number(t.CompanyNo+t.DepartmentNo)});for(var o=this,t=0;t<this.shownDepartments.length;t++)!function(t){n.contains(o.shownDepartments[t].CompanyNo)&&e.filter(function(e){return e.Selected}).some(function(e){return e.CompanyNo===i.shownDepartments[t].CompanyNo&&e.DepartmentNo===i.shownDepartments[t].DepartmentNo})?o.shownDepartments[t].Selected=!0:o.shownDepartments[t].Selected=!1}(t);this.roles&&0<this.roles.length&&this.roleGroups&&0<this.roleGroups.length&&this.validateRoles()}this.shownPersons=[],this.persons=[],this.amountOfSelectedDepartments=this.shownDepartments.filter(function(e){return e.Selected}).length},n.prototype.validateRoles=function(){var e=JSON.parse(JSON.stringify(this.shownRoles)),t=(this.roles.forEac
1h(function(e){return e.Selected=!1}),this.roleGroups.filter(function(e){return e.Selected}).map(function(e){return e.Id}));this.shownRoles=JSON.parse(JSON.stringify(this.roles.filter(function(e){return e.RoleGroupId.any(function(e){return t.contains(e)})})));for(var i=0;i<this.shownRoles.length;i++)this.shownRoles[i].RoleGroupId.any(function(e){return t.contains(e)})&&e.filter(function(e){return e.Selected}).map(function(e){return e.Id}).contains(this.shownRoles[i].Id)?this.shownRoles[i].Selected=!0:this.shownRoles[i].Selected=!1;this.groupedShownRoles=[];for(var n=function(e){for(var n=o.shownRoles[e],t=0;t<n.RoleGroupId.length;t++)!function(t){var e,i=o.roleGroups.find(function(e){return e.Id==n.RoleGroupId[t]});i&&i.Selected&&((e=o.groupedShownRoles.find(function(e){return e.RoleGroupName==i.Name}))||(e={RoleGroupName:i.Name,Roles:[]},o.groupedShownRoles.add(e)),e.Roles.add(n))}(t);1<o.groupedShownRoles.filter(function(e){return e.Roles.contains(n)}).length&&(n.ExistsInMultipleRoleGroups=!0)},o=this,i=0;i<this.shownRoles.length;i++)n(i);this.shownPersons=[],this.persons=[],this.amountOfSelectedRoles=this.shownRoles.filter(function(e){return e.Selected}).length},n.prototype.selectCompany=function(e){this.amountOfSelectedCompanies=this.amountOfSelectedCompanies+(e.Selected?1:-1),this.validateDepartments()},n.prototype.selectDepartment=function(e){this.amountOfSelectedDepartments=this.amountOfSelectedDepartments+(e.Selected?1:-1),this.validateDepartments()},n.prototype.selectRoleGroup=function(e){this.amountOfSelectedRoleGroups=this.amountOfSelectedRoleGroups+(e.Selected?1:-1),this.validateRoles()},n.prototype.selectRole=function(t){this.shownRoles.find(function(e){return e.Id==t.Id}).Selected=t.Selected,this.roles.find(function(e){return e.Id==t.Id}).Selected=t.Selected,this.amountOfSelectedRoles=this.amountOfSelectedRoles+(t.Selected?1:-1),this.validateRoles()},n.prototype.SetOverrideConsentStatus=function(){this.overrideConsent=!this.overrideConsent,this.saveConsentStatus({model:{saveConsentStatus:this.overrideConsent}})},n.$inject=["EgUserProviderStateService","ModalService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/EgUserProvider/EgUserProvider.component.html",this.bindings={preventRemoval:"<",form:"<",saveSelection:"&",participants:"<",saveConsentStatus:"&"}},app.component("egUserProvider",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/EgUserProvider/"}(e=e.CrossPortal||(e.CrossPortal={})).EgUserProvider||(e.EgUserProvider={}),t.prototype.getRoleGroups=function(){var t=this,i=this.loaderService.setLoader("specificUserSelection","fetching-role-groups"),e=this.incomHttp.get(this.baseUrl+"GetRoleGroups");return e.then(function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getRolesInRoleGroup=function(){var t=this,i=this.loaderService.setLoader("specificUserSelection","fetching-roles"),e=this.incomHttp.get(this.baseUrl+"GetRoles");return e.then(function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getCompanies=function(){var t=this,i=this.loaderService.setLoader("specificUserSelection","fetching-companies"),e=this.incomHttp.get(this.baseUrl+"GetAllCompanies");return e.then(function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getDepartments=function(){var t=this,i=this.loaderService.setLoader("specificUserSelection","fetching-departments"),e=this.incomHttp.get(this.baseUrl+"GetDepartments");return e.then(function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getPersons=function(e,t){var i=this,n=this.loaderService.setLoader("specificUserSelection","fetching-users"),e=this.incomHttp.post(this.baseUrl+"GetPersonsByDepartmentAndRoles",{Departments:e,Roles:t});return e.then(function(e){i.loaderService.removeLoader(n)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("EgUserProviderHttpService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.EgUserProviderHttpService=e,this.resetSelected$=new Rx.Subject,this.persons$=new Rx.Subject,this.roleGroups$=new Rx.Subject,this.rolesInRoleGroup$=new Rx.Subject,this.companies$=new Rx.Subject,this.departments$=new Rx.Subject}(e=e.CrossPortal||(e.CrossPortal={})).EgUserProvider||(e.EgUserProvider={}),t.prototype.getRoleGroups=function(){var t=this,e=this.EgUserProviderHttpService.getRoleGroups();return e.then(function(e){t.roleGroups$.onNext(e.RoleGroups)}),e},t.prototype.getRolesInRoleGroup=function(){var t=this,e=this.EgUserProviderHttpService.getRolesInRoleGroup();return e.then(function(e){t.rolesInRoleGroup$.onNext(e.Roles)}),e},t.prototype.getCompanies=function(){var t=this,e=this.EgUserProviderHttpService.getCompanies();
1return e.then(function(e){e.Companies.forEach(function(e){e.CompanyNo=e.CompanyNo}),t.companies$.onNext(e.Companies)}),e},t.prototype.getDepartments=function(){var t=this,e=this.EgUserProviderHttpService.getDepartments();return e.then(function(e){e.Departments.forEach(function(e){e.DepartmentNo=e.DepartmentNo,e.CompanyNo=e.CompanyNo}),t.departments$.onNext(e.Departments)}),e},t.prototype.getPersons=function(e,t){var i=this,e=this.EgUserProviderHttpService.getPersons(e,t);return e.then(function(e){i.persons$.onNext(e.Users)}),e},t.prototype.resetSelected=function(){this.resetSelected$.onNext(!0)},t.$inject=["EgUserProviderHttpService"],app.service("EgUserProviderStateService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.fixedTextService=i,this.$scope=n,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.Ui||(e.Ui={})).FixedText||(e.FixedText={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var n=this;this.modalData.fixedTextAlias&&this.fixedTextService.getFixedText(this.modalData.fixedTextAlias).then(function(e){n.fixedText=e}),this.$scope.$on("$locationChangeStart",function(e,t,i){n.cancel()})},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","FixedTextService","$scope"],e.FixedTextModalController=t}(BoligExtra=BoligExtra||{}),!function(i){var e,t;function n(e,t){this.$scope=e,this.fileService=t,this.disposables=new Rx.CompositeDisposable,this.currentSize=0,this.uploadedFiles=[]}(e=i.Ui||(i.Ui={})).FormFields||(e.FormFields={}),n.prototype.$onInit=function(){var t=this;this.ngModelCtrl.$render=function(){t.ngModel=t.ngModelCtrl.$viewValue},this.$scope.$watchCollection(function(){return t.uploadedFiles},function(e){e&&0<e.length&&(t.ngModelCtrl.$setDirty(),t.ngModel=t.ngModel||[],t.ngModel.addRange(e.map(function(e){e=t.fileService.toUploadedFile(e,i.Utility.File.UploadedFileType.Image);return t.fileService.attachThumbnail(e,t.$scope),e})),t.uploadedFiles=[])}),this.$scope.$watchCollection(function(){return t.ngModel},function(e){t.ngModelCtrl.$setViewValue(e),t.updateRequiredValidState(e)}),this.maxTotalSize||(this.maxTotalSize=10240)},n.prototype.updateRequiredValidState=function(e){e&&(this.required&&this.ngModelCtrl.$setValidity("required",0<e.length),this.maxFiles&&0<this.maxFiles&&this.ngModelCtrl.$setValidity("filecount",e.length<=this.maxFiles),this.maxTotalSize)&&0<this.maxTotalSize&&(this.ngModelCtrl.$setValidity("filesize",e.reduce(function(e,t){return e+t.file.size},0)/1024<=this.maxTotalSize),this.currentSize=e.reduce(function(e,t){return e+t.file.size},0)/1024/1024)},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.$inject=["$scope","FileService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.require={ngModelCtrl:"^ngModel"},this.templateUrl="/App/Ui/FormFields/FormImageUpload.component.html",this.bindings={required:"<",accept:"@",maxFiles:"<",maxTotalSize:"<"},this.transclude=!0},app.component("formImageUpload",new e)}(BoligExtra=BoligExtra||{}),app.directive("onlyDigits",[function(){return{restrict:"A",link:function(e,t,i){$(t).on("keydown",function(e){var t=e.which||e.keyCode;return!e.shiftKey&&!e.altKey&&!e.ctrlKey&&48<=t&&t<=57||96<=t&&t<=105||8===t||9===t||13===t||35===t||36===t||37===t||39===t||46===t||9===t})}}}]),!function(e){var t;function i(e,t){this.$scope=e,this.$compile=t,this.disposables=new Rx.CompositeDisposable,this.isYoutube=!1,this.images=[],this.orderBy=""}(e=e.Ui||(e.Ui={})).Lightbox||(e.Lightbox={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.buildLightbox=function(){var e,t,i,n,o,r=this,s=(this.youtubeLink?(s="https://www.youtube.com/embed/",e=-1!=this.youtubeLink.indexOf("youtu.be"),t=-1!=this.youtubeLink.indexOf("youtube"),(e||t)&&(n="",n=e?(i=this.youtubeLink.lastIndexOf("/")+1,s+this.youtubeLink.slice(i)):-1!=this.youtubeLink.indexOf("embed")?this.youtubeLink:(o=this.youtubeLink.indexOf("v=")+2,s+this.youtubeLink.slice(o,o+13)),o=angular.element('<div class="angular-lightbox-overlay" style="display: none" aria-modal="true" role=dialog aria-label="Modal youtube video visning">
1\n <span class="angular-lightbox-inner video">\n <span class="absolute inset-0 z-0 loading-md" ></span>\n <iframe class="bex-z-1" src="'.concat(n,'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> \n <span href class="close " title="Close" ng-click="$ctrl.closeLightbox()">×</span>\n </span>\n </div>'))[0])):o=angular.element('<div class="angular-lightbox-overlay flex loading-md">\n <div class="absolute inset-0 w-full h-full bg" tabindex="0" aria-label="Luk modalen" ng-click="$ctrl.closeLightbox()"></div>\n <div class="angular-lightbox-inner" aria-modal="true" role="dialog" aria-label="Modal billede galleri">\n <owl-carousel-for-lightbox-carousel description="true" order-by="'.concat(this.orderBy,'" images="$ctrl.images.length > 0 ? $ctrl.images : $ctrl.image" start-index="$ctrl.startIndex"></owl-carousel-for-lightbox-carousel>\n <button class="close fal fa-times -top-10 right-0" title="Luk" aria-label="Luk modalen" ng-click="$ctrl.closeLightbox()"></span>\n </div>\n </div>'))[0],this.$scope.$new(!0));(s.$ctrl=this).lightboxDom=this.$compile(o)(s)[0],-1==i&&(i=0),e||t?this.lightboxDom.style.display="flex":this.loadImageAt(i,this.lightboxDom),document.addEventListener("keydown",function(e){return r.onKeyDown(e,r.lightboxDom)}),setTimeout(function(){document.body.appendChild(r.lightboxDom),r.loadImageAt(0,r.lightboxDom)},100)},i.prototype.closeLightbox=function(t){var i=this;t=t||this.lightboxDom,document.removeEventListener("keydown",function(e){return i.onKeyDown(e,t)}),t.remove()},i.prototype.onKeyDown=function(e,t){"Escape"===e.key&&this.closeLightbox(t)},i.prototype.loadImageAt=function(e,t){var i=new Image;i.onload=function(){t.style.display="flex"},i.onerror=function(){t.style.display="flex"},this.images&&0<this.images.length&&(i.title=e+1+"/"+this.images.length)},i.$inject=["$scope","$compile"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/Lightbox/Lightbox.component.html",this.bindings={images:"<",image:"<",youtubeLink:"<",startIndex:"<",orderBy:"@"}},app.component("lightbox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.featureFlagService=e,this.$element=t,this.siteMenuStateService=i,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).SiteMenu||(e.SiteMenu={}),i.prototype.$onInit=function(){var t=this;this.featureFlagService.siteMenu.enablePushingSiteMenu?this.disposables.add(this.siteMenuStateService.openMenuSection$.subscribe(function(e){e?(t.$element.addClass(t.whenOpen),t.$element.removeClass(t.whenClosed)):(t.$element.removeClass(t.whenOpen),t.$element.addClass(t.whenClosed))})):this.$element.addClass(this.whenClosed)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["FeatureFlagService","$element","SiteMenuStateService"],t=i,app.directive("mainMenu",function(){return{restrict:"A",controller:t,controllerAs:"$ctrl",scope:{},bindToController:{whenOpen:"@",whenClosed:"@"}}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.featureFlagService=e,this.$element=t}(e=e.Ui||(e.Ui={})).SiteMenu||(e.SiteMenu={}),i.prototype.$onInit=function(){this.featureFlagService.siteMenu.enablePushingSiteMenu?(this.$element.addClass(this.whenEnabled),this.$element.removeClass(this.whenDisabled)):(this.$element.removeClass(this.whenEnabled),this.$element.addClass(this.whenDisabled))},i.prototype.$onDestroy=function(){},i.$inject=["FeatureFlagService","$element"],t=i,app.directive("pushingMenu",function(){return{restrict:"A",controller:t,controllerAs:"$ctrl",scope:{},bindToController:{whenEnabled:"@",whenDisabled:"@"}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(){this.openMenuSection$=new Rx.BehaviorSubject(null),this.toggleMenuSection$=new Rx.Subject,this.openMenu$=new Rx.Subject}
1(e=e.Ui||(e.Ui={})).SiteMenu||(e.SiteMenu={}),t.prototype.getMenuSection=function(e){this.openMenuSection$.onNext(e),this.toggleMenuSection$.onNext({})},t.prototype.toggleMenu=function(e){"close"===(e=e||"")?(this.menuState=!1,this.openMenu$.onNext(!1)):(this.menuState=!this.menuState,this.openMenu$.onNext(this.menuState))},t.$inject=[],app.service("SiteMenuStateService",t)}(BoligExtra=BoligExtra||{}),!function(e){e=e.Utility||(e.Utility={});e.Animations||(e.Animations={}),app.animation(".anim-scale",function(){return{addClass:function(e,t,i){"ng-hide"===t?e.hide().animate({width:"0%"},300):i()},removeClass:function(e,t,i){"ng-hide"===t?e.show().animate({width:"100%"},300):i()}}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.$element=e,this.$scope=t,this.$compile=i,this.htmlUtilities=n}(e=e.Utility||(e.Utility={})).BindHtml||(e.BindHtml={}),i.prototype.$onChanges=function(){var e=this.htmlUtilities.countNonHtmlCharToLimit(this.text,this.limit),e=this.text.substr(0,e.offsetCounter)+this.ellipsis+this.getClosedTagsString(e.closingHtmlCharacters);this.$element.empty(),this.$element.append(this.$compile(e)(this.$scope.$new(!0)))},i.prototype.getTagType=function(e){return e.replace(/<[\/]?([^>]*)>/,"$1")},i.prototype.getClosedTagsString=function(i){var n=this,o=[];return angular.forEach(i,function(e,t){!/<\//.test(e)||0!==t&&n.getTagType(e)===n.getTagType(i[t-1])||o.push(e)}),o.join("")},i.$inject=["$element","$scope","$compile","HtmlUtilityService"],t=i,app.directive("incomBindHtml",function(){return{restrict:"A",controller:t,controllerAs:"$ctrl",scope:{},bindToController:{text:"<",limit:"<",ellipsis:"@"}}})}(BoligExtra=BoligExtra||{}),!function(e){e=e.Utility||(e.Utility={});function t(e,t,i){this.browser=e,this.version=t,this.device=i}(n=r=e.Browser||(e.Browser={}))[n.Unknown=0]="Unknown",n[n.Safari=1]="Safari",n[n.Chrome=2]="Chrome",n[n.Firefox=3]="Firefox",n[n.InternetExplorer=4]="InternetExplorer",(n=i=e.Device||(e.Device={}))[n.Unknown=0]="Unknown",n[n.Mobile=1]="Mobile",n[n.Desktop=2]="Desktop",(n=l=e.OS||(e.OS={}))[n.Unknown=0]="Unknown",n[n.Windows=1]="Windows",n[n.Linux=2]="Linux",n[n.Unix=3]="Unix",n[n.Mac=4]="Mac",e.BrowserVersion=t,o.prototype.setBrowserAndVersion=function(e,t,i,n){var o;-1!=(o=e.indexOf("Chrome"))?(this.browser=r.Chrome,t=e.substring(o+7)):-1!=(o=e.indexOf("MSIE"))?(this.browser=r.InternetExplorer,t=e.substring(o+5)):-1!=(o=e.indexOf("Firefox"))?(this.browser=r.Firefox,t=e.substring(o+8)):-1!=(o=e.indexOf("Safari"))?(this.browser=r.Safari,t=e.substring(o+7),-1!=(o=e.indexOf("Version"))&&(t=e.substring(o+8))):e.lastIndexOf(" ")+1<(o=e.lastIndexOf("/"))&&(t=e.substring(o+1),this.browser=r.Unknown),-1!=(e=(t=-1!=(e=t.indexOf(";"))?t.substring(0,e):t).indexOf(" "))&&(t=t.substring(0,e)),i=this.setSemVersion(t),isNaN(i)&&(t=""+parseFloat(n.appVersion),i=this.setSemVersion(n.appVersion)),this.fullVersion=t,this.BrMajorVersion=i},o.prototype.setDevice=function(e){var t={Android:function(){return e.match(/Android/i)},BlackBerry:function(){return e.match(/BlackBerry/i)},iOS:function(){return e.match(/iPhone|iPad|iPod/i)},Opera:function(){return e.match(/Opera Mini/i)},Windows:function(){return e.match(/IEMobile/i)},any:function(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()}};this.device=t.any()?i.Mobile:i.Desktop},o.prototype.setOS=function(e){-1!=e.indexOf("Win")&&(this.OS=l.Windows),-1!=e.indexOf("Mac")&&(this.OS=l.Mac),-1!=e.indexOf("X11")&&(this.OS=l.Unix),-1!=e.indexOf("Linux")&&(this.OS=l.Linux)},o.prototype.setSemVersion=function(e){var t=e.split("."),t=t[0]+"."+t[1],t=parseFloat(t);return isNaN(t)?parseInt(e,10):t};var r,i,l,n=o;function o(){this.OS=l.Unknown,this.pixelratio=window.devicePixelRatio,this.screensize=""+screen.width?screen.width:(screen.height,screen.height);var e=navigator,t=e.userAgent,i=e.platform,n=e.cookieEnabled,o=e.language,r=e.onLine,s=""+parseFloat(e.appVersion),a=this.setSemVersion(e.appVersion);this.setBrowserAndVersion(t,s,a,e),this.setOS(i),this.setDevice(t),this.platform=i,this.cookie=n,this.language=o,this.online=r}e.UserAgent=n,app.service("getBrowser",["$window",function(i){return function(){var e=i.navigator.userAgent,t={chrome:/chrome/i,safari:/safari/i,firefox:/firefox/i,ie:/internet explorer/i};return t.chrome.test(e)?r.Chrome:t.firefox.test(e)?r.Firefox:t.ie.test(e)?r.InternetExplorer:t.safari.test(e)?r.Safari:r.Unknown}}])}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=e.Utility||(e.Utility={})).FeatureFlag||(e.FeatureFlag={})).AvailableTenancyImageSource||(e.AvailableTenancyImageSource={}))[e.TenancyImages=0]="TenancyImages",e[e.DepartmentImages=1]="DepartmentImages",e[e.DepartmentImagesFallback=2]="DepartmentImagesFallback"}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.$scope=e,this.element=t}
1(e=e.Utility||(e.Utility={})).File||(e.File={}),i.prototype.$onInit=function(){var i=this;this.element[0]&&this.element.bind("change",function(e){var t=e.target;i.$scope.$applyAsync(function(){i.$scope.uploadChange({$event:t.files[0]})})})},i.$inject=["$scope","$element"],t=i,app.directive("uploadChange",function(){return{restrict:"A",controller:t,scope:{uploadChange:"&"}}})}(BoligExtra=BoligExtra||{}),app.filter("startWithTypeaheadHighlight",["$sce","$injector","$log",function(i,e,n){var o;return o=e.has("$sanitize"),function(e,t){return!o&&/<.*>/g.test(e)&&n.warn("Unsafe use of typeahead please use ngSanitize"),e=t?(""+e).replace(new RegExp("^"+t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"gi"),"<strong>$&</strong>"):e,e=o?e:i.trustAsHtml(e)}}]),!function(e){function t(){var n=this;this.hasBegunHtmlHandling=function(e,t){var i=!1;return n.isBeginningMarkupIteration(e,t)?(t.doneCounting||(t.htmlElement="<"),i=t.iteratingThroughMarkup=!0):n.isBeginningSpecialCharacterIteration(e,t)&&(i=t.iteratingThroughSpecialChar=!0),i}}e.Utility||(e.Utility={}),t.prototype.countNonHtmlCharToLimit=function(e,t){for(var i={iteratingThroughMarkup:!1,iteratingThroughSpecialChar:!1,finishedHandlingCase:!1,doneCounting:!1,htmlElement:"",result:{countResult:0,offsetCounter:0,setEllipsis:!1,closingHtmlCharacters:[]}},n=0;n<e.length;n++){var o=e[n],r=(i.doneCounting=i.result.countResult<t,this.hasBegunHtmlHandling(o,i));!r&&i.iteratingThroughMarkup?this.iterateThroughMarkup(o,i):!r&&";"===o&&i.iteratingThroughSpecialChar&&this.finishSpecialCharacterHandling(i),i.doneCounting?(i.iteratingThroughMarkup||i.iteratingThroughSpecialChar||i.finishedHandlingCase||i.result.countResult++,i.result.offsetCounter++):i.result.setEllipsis=!0,i.finishedHandlingCase=!1}return i.result},t.prototype.isBeginningMarkupIteration=function(e,t){return"<"===e&&!t.iteratingThroughMarkup&&!t.iteratingThroughSpecialChar},t.prototype.isBeginningSpecialCharacterIteration=function(e,t){return"&"===e&&!t.iteratingThroughMarkup&&!t.iteratingThroughSpecialChar},t.prototype.finishSpecialCharacterHandling=function(e){e.iteratingThroughSpecialChar=!1,e.result.countResult++,e.finishedHandlingCase=!0},t.prototype.iterateThroughMarkup=function(e,t){t.doneCounting||(t.htmlElement="".concat(t.htmlElement).concat(e)),">"===e&&(t.doneCounting||t.result.closingHtmlCharacters.push(t.htmlElement),t.finishedHandlingCase=!0,t.iteratingThroughMarkup=!1)},app.service("HtmlUtilityService",t)}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=e.Utility||(e.Utility={})).Key||(e.Key={}))[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Shift=16]="Shift",e[e.Ctrl=17]="Ctrl",e[e.Alt=18]="Alt",e[e.PauseBreak=19]="PauseBreak",e[e.CapsLock=20]="CapsLock",e[e.Escape=27]="Escape",e[e.Space=32]="Space",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.LeftArrow=37]="LeftArrow",e[e.UpArrow=38]="UpArrow",e[e.RightArrow=39]="RightArrow",e[e.DownArrow=40]="DownArrow",e[e.Insert=45]="Insert",e[e.Delete=46]="Delete",e[e.Zero=48]="Zero",e[e.ClosedParen=48]="ClosedParen",e[e.One=49]="One",e[e.ExclamationMark=49]="ExclamationMark",e[e.Two=50]="Two",e[e.AtSign=50]="AtSign",e[e.Three=51]="Three",e[e.PoundSign=51]="PoundSign",e[e.Hash=51]="Hash",e[e.Four=52]="Four",e[e.DollarSign=52]="DollarSign",e[e.Five=53]="Five",e[e.PercentSign=53]="PercentSign",e[e.Six=54]="Six",e[e.Caret=54]="Caret",e[e.Hat=54]="Hat",e[e.Seven=55]="Seven",e[e.Ampersand=55]="Ampersand",e[e.Eight=56]="Eight",e[e.Star=56]="Star",e[e.Asterik=56]="Asterik",e[e.Nine=57]="Nine",e[e.OpenParen=57]="OpenParen",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.LeftWindowKey=91]="LeftWindowKey",e[e.RightWindowKey=92]="RightWindowKey",e[e.SelectKey=93]="SelectKey",e[e.Numpad0=96]="Numpad0",e[e.Numpad1=97]="Numpad1",e[e.Numpad2=98]="Numpad2",e[e.Numpad3=99]="Numpad3",e[e.Numpad4=100]="Numpad4",e[e.Numpad5=101]="Numpad5",e[e.Numpad6=102]="Numpad6",e[e.Numpad7=103]="Numpad7",e[e.Numpad8=104]="Numpad8",e[e.Numpad9=105]="Numpad9",e[e.Multiply=106]="Multiply",e[e.Add=107]="Add",e[e.Subtract=109]="Subtract",e[e.DecimalPoint=110]="DecimalPoint",e[e.Divide=111]="Divide",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NumLock=144]="NumLock",e[e.ScrollLock=145]="ScrollLock",e[e.SemiColon=186]="SemiColon",e[e.Equals=187]="Equals",e[e.Comma=188]="Comma",e[e.Dash=189]="Dash",e[e.Period=190]="Period",e[e.UnderScore=189]="UnderScore",e[e.PlusSign=187]="PlusSign",e[e.ForwardSlash=191]="ForwardSlash",e[e.Tilde=192]="Tilde",e[e.GraveAccent=192]="GraveAccent",e[e.OpenBracket=219]="OpenBracket",e[e.ClosedBracket=221]="ClosedBracket",e[e.Quote=222]="Quote"}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}
1e=(e=(e=e.Utility||(e.Utility={})).Location||(e.Location={})).GoogleMaps||(e.GoogleMaps={}),i.prototype.getGoogleMapsMarkersFrom=function(i,n){void 0===n&&(n=null);var o=[],r=i.Name||i.DepartmentName;return(0<i.Addresses.length?i.Addresses:[i.Address]).forEach(function(e){var t=0<i.Images.length?i.Images[0].Url:null;e.Coordinates&&(e={Lat:e.Coordinates.Lat,Lng:e.Coordinates.Lng,InfoBox:{Headline:r,Description:e.Street+" "+(e.Location||""),Image:t}},n&&(e.InfoBox.Link=n(i)),o.add(e))}),o},t=i,e.GoogleMapsUtilityService=t,app.service("GoogleMapsUtilityService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(){}(e=e.Utility||(e.Utility={})).Media||(e.Media={}),t.prototype.getDefinitionSeperator=function(e){return e&&-1!=e.indexOf("?")?"&":"?"},t.$inject=[],app.service("ImageDefinitionHelperService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.cachedRequests=[],this.selectedNode$=new Rx.Subject,this.baseurl="/umbraco/api/Media/"}(e=e.Utility||(e.Utility={})).Media||(e.Media={}),t.prototype.getMediaFolderByDocType=function(t){var i=this,n=this.loaderService.setLoader("global","fetch-media"),e=this.cachedRequests.firstOrDefault(function(e){return e.docType===t});return e&&e.expires.getTime()<(new Date).getTime()&&(this.cachedRequests.remove(e),e=null),e||(e={expires:(new Date).addMinutes(5),docType:t,request:this.incomHttp.get(this.baseurl+"GetMediaByDocumentType/?docType="+t)},this.cachedRequests.add(e)),e.request.then(function(e){i.loaderService.removeLoader(n)}),e.request},t.prototype.getMediaFile=function(e){var t=this,i=this.loaderService.setLoader("global","fetch-media"),e=this.incomHttp.get(this.baseurl+"GetMediaFile?nodeId="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService"],app.service("MediaService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){var n=this;this.$modalInstance=e,this.modalData=t,i.getMediaFile(t.startNodeId).then(function(e){n.modalData.allowFiles&&(e=e.filter(function(e){return"File"!=e.type})),n.modalData.allowImages&&(e=e.filter(function(e){return"Image"!=e.type})),n.node={children:e,id:t.startNodeId}}),i.selectedNode$.subscribe(function(e){n.$modalInstance.close(e)})}e=(e=(e=e.Utility||(e.Utility={})).Media||(e.Media={})).Modals||(e.Modals={}),t.$inject=["$uibModalInstance","modalData","MediaService"],e.MediaBrowserController=t}(BoligExtra=BoligExtra||{}),!function(i){var e,t;function n(e,t,i){this.boardSettingsService=e,this.profileService=t,this.modalService=i,this.disposables=new Rx.CompositeDisposable,this.headlines={}}(e=i.BoardPortal||(i.BoardPortal={})).BoardSettings||(e.BoardSettings={}),n.prototype.$onInit=function(){var t=this;this.disposables.add(this.boardSettingsService.getBoardSettings().subscribe(function(e){e&&(t.boardSettings=e.Settings,e.HeaderTexts.forEac
1h(function(e){return t.headlines[e.Alias]=e.Name}))})),this.disposables.add(this.boardSettingsService.getEmails().subscribe(function(e){e&&null!=(t.emails=e).AlternateEmail&&(t.newAlternateEmail=e.AlternateEmail.slice(0))})),this.disposables.add(this.profileService.profile$.subscribe(function(e){e&&(t.profile=e)})),this.profileService.getProfile()},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.updateAlternateEmail=function(){var t=this;this.disposables.add(this.boardSettingsService.updateAlternateEmail(this.newAlternateEmail).subscribe(function(e){e!=t.newAlternateEmail&&(e||t.newAlternateEmail)||t.boardSettingsService.getEmails()}))},n.prototype.saveBoardSettings=function(e){this.boardSettingsService.updateBoardSettings(e)},n.prototype.setBoardSettingVisibility=function(e,t){e.Visibility=t,this.checkIfInformationIsAvailable(e)},n.prototype.checkIfInformationIsAvailable=function(e){var t;"DontShow"!==e.Visibility&&"false"!=e.Visibility.toString()&&(t={fixedTextAlias:"BoardProfileMissingInformation"},"ShowEmail"===e.Setting&&!this.profile.Interessent.Email||"ShowMobileNumber"===e.Setting&&!this.profile.Interessent.MobilePhone||"ShowPhoneNumber"===e.Setting&&!this.profile.Interessent.Phone?this.modalService.createModal("/App/Ui/FixedText/Modals/FixedText.modal.html",i.Ui.FixedText.Modals.FixedTextModalController,t):"ShowAlternateEmail"!==e.Setting||this.newAlternateEmail||(t.fixedTextAlias="BoardProfileMissingAlternateEmail",this.modalService.createModal("/App/Ui/FixedText/Modals/FixedText.modal.html",i.Ui.FixedText.Modals.FixedTextModalController,t)))},n.$inject=["BoardSettingsService","ProfileService","ModalService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/BoardPortal/BoardSettings/BoardSettings.component.html",this.bindings={}},app.component("boardSettings",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.updatedEmail$=new Rx.BehaviorSubject(""),this.emails$=new Rx.BehaviorSubject(null),this.boardSettings$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/BoardSettings/"}(e=e.BoardPortal||(e.BoardPortal={})).BoardSettings||(e.BoardSettings={}),t.prototype.getBoardSettings=function(){var t=this,i=this.loaderService.setLoader("contentSection","getBoardSettings");return this.incomHttp.get(this.baseurl+"GetBoardSettings/").then(function(e){t.boardSettings$.onNext(e),t.loaderService.removeLoader(i)}),this.boardSettings$},t.prototype.updateAlternateEmail=function(e){var t=this,i=this.loaderService.setLoader("contentSection","updateEmail");return this.incomHttp.post("".concat(this.baseurl,"UpdateAlternateEmail?updatedEmail=").concat(e),e).then(function(e){t.updatedEmail$.onNext(e),t.loaderService.removeLoader(i)}),this.updatedEmail$},t.prototype.updateBoardSettings=function(e){this.incomHttp.post(this.baseurl+"UpdateBoardSettings/",e)},t.prototype.getEmails=function(){var t=this,i=this.loaderService.setLoader("contentSection","getEmails");return this.incomHttp.get(this.baseurl+"GetEmails/").then(function(e){t.emails$.onNext(e),t.loaderService.removeLoader(i)}),this.emails$},t.prototype.deleteAlternateEmail=function(){var t=this;this.incomHttp.get(this.baseurl+"DeleteAlternateEmail/").then(function(e){t.getEmails()})},t.$inject=["incomHttpService","LoaderService"],app.service("BoardSettingsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.companyBoardService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable}(e=e.CompanyPage||(e.CompanyPage={})).CompanyBoard||(e.CompanyBoard={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.disposables.add(t.companyBoardService.getCompanyBoardMembers(e.Id).subscribe(function(e){e&&(t.companyBoardMembers=e)}))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["CompanyBoardService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CompanyPage/CompanyBoard/CompanyBoard.component.html",this.bindings={}},app.component("companyBoard",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/CompanyBoard/"}(e=e.CompanyPage||(e.CompanyPage={})).CompanyBoard||(e.CompanyBoard={}),t.prototype.getCompanyBoardMembers=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getBoard"),n=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"GetCompanyBoardMembers/"+e).then(function(e){n.onNext(e.BoardMembers),t.loaderService.removeLoader(i)}),n},t.$inject=["incomHttpService","LoaderService"],app.service("CompanyBoardService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o){this.$http=e,this.loaderService=t,this.modalService=i,this.fileService=n,this.$q=o,this.explorerUrl="/umbraco/api/FileArchiveExplorer/",this.currentNode$=new Rx.Subject,this.content$=new Rx.BehaviorSubject([]),this.isAdmin$=new Rx.BehaviorSubject(null)}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={}),t.prototype.searchForNodes=function(e,t){var i=this,n=this.loaderService.setLoader("fileSearch","search"),e=this.$http.post("".concat(this.explorerUrl,"SearchForNodes?nodeName=")+e,t);return e.then(function(){i.loaderService.removeLoader(n)}),e},t.prototype.getExplorerContent=function(e,t){var i=this,n=this.loaderService.setLoader("fileArchive","getContent");this.$http.post("".concat(this.explorerUrl,"GetExplorerContent?currentPageId=").concat(e),t).then(function(e){i.isAdmin$.onNext(e.IsSystemAdmin),i.loaderService.removeLoader(n),i.currentNode$.onNext(e.CurrentNode),i.content$.onNext(e.Content)})},t.prototype.getExplorerRootContent=function(e,t){var i=this,n=this.loaderService.setLoader("fileArchive","getContent"),e=this.$http.post("".concat(this.explorerUrl,"GetExplorerRootContent?currentPageId=").concat(e),t);return e.then(function(e){i.isAdmin$.onNext(e.IsSystemAdmin),i.loaderService.removeLoader(n),i.content$.onNext(e.Content),e.CurrentNode&&i.currentNode$.onNext(e.CurrentNode)}),e},t.$inject=["incomHttpService","LoaderService","ModalService","FileService","$q"],app.service("FileArchiveExplorerService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s){this.$modalInstance=e,this.$scope=t,this.loaderService=n,this.fileService=o,this.modalData=r,this.explorerService=s,this.subs=new Rx.CompositeDisposable,this.service=i.getInstance(),this.nodeIds=r.nodeIds}e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={}),e=(t=e.FileArchive||(e.FileArchive={})).Modals||(t.Modals={}),i.prototype.$onInit=function(){},i.prototype.doSearch=function(e){var t=this;1<e.length?this.explorerService.searchForNodes(e,this.nodeIds).then(function(e){e&&(t.results=e.FileArchiveNavigationViewModels)}):this.results=[]},i.prototype.getIcon=function(e){return e.ShortcutForId?"fa-level-up":t.isFileArchiveFileViewModel(e)?this.fileService.getFileIconClass(e.Extension):e.NodeTags.any(function(e){return"CompanyDepartmentPseudoRoot"===e.Tag})?"fa-building":"fa-folder-open"},i.prototype.getFile=function(e){this.service.downloadFile(e,this.modalData.currentPageId)},i.$inject=["$uibModalInstance","$scope","FileArchiveServiceFactory","LoaderService","FileService","modalData","FileArchiveExplorerService"],e.FileArchiveExplorerSearchController=i}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r){this.$modalInstance=e,this.$scope=t,this.loaderService=n,this.fileService=o,this.pageContentService=r,this.subs=new Rx.CompositeDisposable,this.service=i.getInstance()}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.subs.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPageId=e.Id)}))},t.prototype.doSearch=function(e){var t=this;1<e.length?this.service.searchForNodes(e).then(function(e){e&&(t.results=e.FileArchiveNavigationViewModels)}):this.results=[]},t.prototype.getIcon=function(e){return this.service.getIcon(e)},t.prototype.getFile=function(e){this.service.downloadFile(e,this.currentPageId)},t.$inject=["$uibModalInstance","$scope","FileArchiveServiceFactory","LoaderService","FileService","PageContentService"],e.FileArchiveSearchController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.loaderService=i,this.$q=n,this.files=angular.copy(t.nodes.filter(function(e){return"FileArchiveFileViewModel"===e.NodeType})).orderBy(function(e){return e.SortOrder}),this.nodes=angular.copy(t.nodes.filter(function(e){return"FileArchiveFolderViewModel"===e.NodeType})).orderBy(function(e){return e.SortOrder}),this.service=t.service}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.nodes.orderBy(function(e){return e.SortOrder})},t.prototype.getIcon=function(e){return this.service.getIcon(e)},t.prototype.submit=function(){for(var e=this,t=this.loaderService.setLoader("submit","command"),i=[],n=0;n<this.nodes.length;n++)this.nodes[n].SortOrder=n,i.push(this.service.updateNode(this.nodes[n],!1));for(n=0;n<this.files.length;n++)this.files[n].SortOrder=n+1e3,i.push(this.service.updateNode(this.files[n],!1));this.$q.all(i).then(function(){e.$modalInstance.close(),e.loader
1Service.removeLoader(t)})},t.$inject=["$uibModalInstance","modalData","LoaderService","$q"],e.FileArchiveSortOrderController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.campaign$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/Campaign/"}(e=e.CrossPortal||(e.CrossPortal={})).Campaign||(e.Campaign={}),t.prototype.validateCampaignCodePromise=function(e){var t=this,i=this.loaderService.setLoader("contentSection","ValidateCampaignCode"),e=this.incomHttp.get(this.baseurl+"ValidateCampaignCode?code="+e);return e.then(function(e){t.loaderService.removeLoader(i)}),e},t.prototype.validateCampaignCodeObservable=function(e){var t=this,i=this.loaderService.setLoader("global","ValidateCampaignCode");return this.incomHttp.get(this.baseurl+"ValidateCampaignCode?code="+e).then(function(e){t.loaderService.removeLoader(i),t.campaign$.onNext(e)}),this.campaign$},t.prototype.isAnyCampaignActive=function(){var t=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"IsAnyCampaignActive").then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("CampaignService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.modalInstance=e,this.modalData=t,this.profileService=i,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Consents||(e.Consents={})).Modals||(e.Modals={})).MissingConsentsModalData=function(){},t.prototype.$onInit=function(){var t=this;this.profileService.getProfile(),this.disposables.add(this.profileService.profile$.subscribe(function(e){e&&e.Interessent&&(t.user=e.Interessent)})),this.missingConsents=this.modalData.missingConsents},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.$inject=["$uibModalInstance","modalData","ProfileService"],e.MissingConsentsModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.loginService=e,this.storageService=t,this.validationService=i,this.firstLoginStep=1,this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).FirstLogin||(e.FirstLogin={}),i.prototype.$onInit=function(){this.firstLoginFormData=this.storageService.getFirstLoginInfo(),this.phoneRegex=this.validationService.getPhoneNumberRegex(),this.firstLoginFormData&&(this.cprConsent=this.firstLoginFormData.CprConsent,2===this.firstLoginFormData.Step)&&(this.firstLoginStep=2)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.allConsentsAnswered=function(e){this.consentsValid=e,this.showConsentError=!e},i.prototype.doFirstLogin=function(){this.consentsValid&&(this.storageService.setFirstLoginInfo(void 0),this.loginService.firstLogin())},i.prototype.validateFirstLogin=function(e){var t=this;e.$valid&&(this.firstLoginFormData.AcceptedCprConditions=this.acceptedCprConditions,this.loginService.validateFirstLogin(this.firstLoginFormData).then(function(e){e&&(t.firstLoginFormData.Step=2,t.storageService.setFirstLoginInfo(t.firstLoginFormData),t.firstLoginStep=2)}))},i.$inject=["LoginService","StorageService","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/FirstLogin/FirstLogin.component.html",this.bindings={}},app.component("firstLogin",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.loginService=e,this.$location=t,this.pageProviderService=i,this.pageContentService=n,this.featureFlagService=o,this.storageService=r,this.disposables=new Rx.CompositeDisposable,this.togglePassword=!1}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).SiteMenuLogin||(e.SiteMenuLogin={}),i.prototype.$onInit=function(){var t=this,i=(this.enableShowPassword=this.featureFlagService.passwordFeatureFlags.EnableShowPassword,this.enableFacebookLogin=this.featureFlagService.loginFeatureFlags.enableFacebook,this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){return t.currentPage=e}),this.nemIdActive=this.featureFlagService.loginFeatureFlags.enableNemId,this.mitIdActive=this.featureFlagService.mitIdFeatureFlags.enableMitIdLogin,this.disposables.add(this.loginService.firstLoginModel$.subscribe(function(e){e&&t.pageProviderService.getLoginPage().then(function(e){t.$location.path(e.Url)})})),this.disposables.add(this.loginService.firstOtherLoginModel$.subscribe(function(e){e&&t.pageProviderService.getLoginPage().then(function(e){t.$location.path(e.Url)})})),this.loginService.getPageVariables().subscribe(function(e){e&&(t.resetPasswordUrl=e.ForgottenLoginUrl,i)&&i.dispose()}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.doLogin=function(e){e.$valid&&(this.loginFormData.LoginNodeId=this.currentPage.Id,this.loginService.login(this.loginFormData),this.storageService.setCurrentMenuSectionStorage(null))},i.$inject=["LoginService","$location","PageProviderService","PageContentService","FeatureFlagService","StorageService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/SiteMenuLogin/SiteMenuLogin.component.html",this.bindings={}},app.component("siteMenuLogin",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.mediaService=e}(e=e.Utility||(e.Utility={})).Media||(e.Media={}),i.prototype.$onInit=function(){},i.prototype.fetchChildNodes=function(e){var t=this;this.mediaService.getMediaFile(e.id).then(function(e){e&&(t.node.showNode=!0,t.allowImages||(e=e.filter(function(e){return"Image"!=e.type})),0==(e=t.allowFiles?e:e.filter(function(e){return"File"!=e.type})).length?t.node.children=[{type:"NA",name:"Intet indhold"}]:t.node.children=e)})},i.prototype.selectNode=function(e){this.mediaService.selectedNode$.onNext(e)},i.$inject=["MediaService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Utility/Media/MediaNodeBrowser.component.html",this.bindings={node:"<",allowFiles:"<",allowImages:"<"}},app.component("mediaNodeBrowser",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){var i=this;this.personOverviewService=e,this.loaderService=t,this.matchesRoleTypes=function(e){return!i.selectedRoleType||e.Positions.any(function(e){return e===i.selectedRoleType})},this.matchesDepartmentId=function(e){return!i.selectedroleDepartmentId||-1!=e.DepartmentIds.indexOf(i.selectedroleDepartmentId)},this.roleTypes=[],this.roleDepartmentIds=[]}(e=e.CrossPortal||(e.CrossPortal={})).PersonOverview||(e.PersonOverview={}),i.prototype.$onInit=function(){var t=this,i=this.loaderService.setLoader("person-overview","load");this.model={RoleGroupId:this.roleGroup,CompanyId:this.companyId,DepartmentIds:this.departmentIds},this.personOverviewService.getPersonsInOverview(this.model).then(function(e){t.persons=e,t.setupFilteringOptions(),i&&(t.displayPersons=e,t.loaderService.removeLoader(i))}),this.showEmail=-1<this.propertiesToShow.indexOf("email"),this.showPhone=-1<this.propertiesToShow.indexOf("phone"),this.showWorkPhone=-1<this.propertiesToShow.indexOf("workPhone"),this.showOfficeHours=-1<this.propertiesToShow.indexOf("officeHours"),this.showElectionPeriod=-1<this.propertiesToShow.indexOf("electionPeriod"),this.showDepartmentId=-1<this.propertiesToShow.indexOf("departmentId"),this.showImage=-1<this.propertiesToShow.indexOf("image"),this.hideDropdowns=-1<this.propertiesToShow.indexOf("hideDropdowns")},i.prototype.setupFilteringOptions=function(){var t;this.persons&&(this.roleTypes=this.persons.map(function(e){return e.Positions}).reduce(function(e,t){return e.concat(t)},[]).distinct().orderBy(function(e){return e}),t=[],this.persons.map(function(e){t.addRange(e.DepartmentIds)}),this.roleDepartmentIds=t.distinct().orderBy(function(e){return e}))},i.prototype.updateList=function(){var t=this;this.displayPersons=this.persons.filter(function(e){return t.matchesRoleTypes(e)&&t.matchesDepartmentId(e)})},i.prototype.getPositionsSummarized=function(e){var t="";if(0!=e.length){if(1==e.length)return e[0];t+=e[0];for(var i=1;i<e.length-1;i++)t+=", "+e[i];t+=" og "+e[e.length-1]}return t},i.$inject=["PersonOverviewService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/PersonOverview/PersonOverview.component.html",this.bindings={roleGroup:"<",departmentIds:"<",companyId:"<",propertiesToShow:"<"}},app.component("personOverview",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.incomHttp=e,this.baseurl="/umbraco/api/PersonOverview/"}(e=e.CrossPortal||(e.CrossPortal={})).PersonOverview||(e.PersonOverview={}),t.prototype.getPersonsInOverview=function(e){return this.incomHttp.post(this.baseurl+"GetPersonsInOverview?",e).then(function(e){return e.Persons})},t.$inject=["incomHttpService"],app.service("PersonOverviewService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.$scope=e,this.validationService=t,this.profileService=i,this.featureFlagService=n,this.model={},this.disposables=new Rx.CompositeDisposable,this.togglePassword=!1}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Profile||(e.Profile={})).ChangePassword||(e.ChangePassword={}),i.prototype.$onInit=function(){this.enableShowPassword=this.featureFlagService.passwordFeatureFlags.EnableShowPassword,this.passwordRegex=this.validationService.getPasswordRegex()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.changePassword=function(){this.$scope.changePasswordForm.$valid&&this.profileService.updatePassword(this.model.password,this.model.oldPassword)},i.prototype.escapeSpecialRegExCharacters=function(e){return this.validationService.escapeSpecialRegExCharacters(e)},i.$inject=["$scope","ValidationService","ProfileService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Profile/ChangePassword/ChangePassword.component.html",this.bindings={}},app.component("changePassword",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,n,t;function o(e,t,i,n){this.consentService=e,this.profileService=t,this.validationService=i,this.utilityService=n,this.applicableChannels=[],this.disposables=new Rx.CompositeDisposable,this.cprValid=!0,this.hasLoaded=!1,this.tempUser={}}i=e.CrossPortal||(e.CrossPortal={}),(n=i.Consents||(i.Consents={})).ConsentItem||(n.ConsentItem={}),o.prototype.$onInit=function(){var i=this;this.emailRegex=this.validationService.getEmailRegex(),this.disposables.add(this.consentService.eboksAvaliable$.subscribe(function(e){i.canUseEboks=e})),this.disposables.add(this.consentService.deleteCprUponRevokingConsent$.subscribe(function(e){i.deleteCprUponRevokingConsent=e})),this.applicableChannels=["EboksConsent","EmailConsent"].filter(function(e){return i.consent.ConsentRegistration[e]!==n.ConsentLevelViewModel.NotApplicable}),this.getAcceptanceStatus(),this.consent.ConsentRegistration.TempGeneralConsent=this.consentStatus?n.ConsentLevelViewModel.Yes:n.ConsentLevelViewModel.No,this.disposables.add(this.consentService.consents$.subscribe(function(e){e&&0<e.length&&(e=e.filter(function(t){return i.consent.DependsOn.some(function(e){return e==t.ConsentNumber})}),i.missingConsents=e.filter(function(e){return e.ConsentRegistration.GeneralConsent!=n.ConsentLevelViewModel.Yes}),i.isAvaliable=0==i.missingConsents.length,i.getAcceptanceStatus())})),this.user.Birthdate?(6<this.user.Birthdate.length?this.birthDate=this.utilityService.formatDate(this.user.Birthdate,"birthdate format"):this.birthDate=this.user.Birthdate,this.hasBirthDate=!0):this.hasBirthDate=!1,this.disposables.add(this.consentService.openConsent$.subscribe(function(e){i.consent.ConsentNumber==e&&(i.showConsents=!0)})),this.hasLoaded=!0},o.prototype.$onDestroy=function(){this.disposables.dispose()},o.prototype.validateCpr=function(){var t=this;this.cprValid=!1,4==this.ssnInput.length&&this.disposables.add(this.consentService.checkCpr(this.birthDate+this.ssnInput).subscribe(function(e){t.cprValid=!e}))},o.prototype.saveConsent4=function(e){this.loading=!0,this.user.Birthdate=this.birthDate,this.hasBirthDate=!0,this.consentService.postConsent4(this.consent,e)},o.prototype.saveConsent=function(){this.loading=!0,this.consentService.postConsent(this.consent)},o.prototype.openOtherConsent=function(e){var t=document.getElementById("consent"+e.ConsentNumber);this.showConsents=!1,this.consentService.openConsent$.onNext(e.ConsentNumber),t.scrollIntoView({behavior:"smooth"})},o.prototype.saveCallback=function(e){e&&(this.consent=e,this.isOpen=!1),this.loading=!1},o.prototype.showWarning=function(){return this.consent.ConsentRegistration.GeneralConsent===n.ConsentLevelViewModel.NotApplicable&&!!this.consentStatus&&(this.consent.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.NotApplicable||this.consent.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.NotApplicable||this.consent.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.Yes)&&this.consent.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.Yes&&this.consent.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.Yes},o.prototype.getAcceptanceStatus=function(){var t=this;if(this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.NotApplicable)return this.consent.ConsentRegistration.GeneralConsent===n.ConsentLevelViewModel.Unanswered?void(this.consentStatus=null):void(this.consentStatus=this.consent.ConsentRegistration.GeneralConsent===n.ConsentLevelViewModel.Yes);this.applicableChannels.every(function(e){return t.consent.ConsentRegistration[e]===n.ConsentLevelViewModel.No})?this.consentStatus=!1:this.applicableChannels.every(function(e){return t.consent.ConsentRegistration[e]===n.ConsentLevelViewModel.Unanswered})?this.consentStatus=null:this.consentStatus=!0},o.prototype.updateGeneralConsentIfApplicable=function(){var e,t=this;this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.NotApplicable?(this.consent.ConsentRegistration.GeneralConsent=this.consentStatus?n.ConsentLevelViewModel.Yes:n.ConsentLevelViewModel.No,this.consent.ConsentRegistration.TempGeneralConsent=this.consentStatus?n.ConsentLevelViewModel.Yes:n.ConsentLevelViewModel.No):(this.consent.ConsentRegistration.TempGeneralConsent=this.consentStatus?n.ConsentLevelViewModel.Yes:n.ConsentLevelViewModel.No,this.consentStatus?1===this.applicableChannels.length&&(e=this.applicableChannels[0],i.isFirstLoginViewModel(this.user),"EboksConsent"===e&&!this.canUseEboks||"SmsConsent"===e&&!this.user.MobilePhone||"EmailConsent"===e&&!this.user.Email||(this.consent.ConsentRegistration[e]=n.ConsentLevelViewModel.Yes)):this.applicableChannels.forEac
1h(function(e){return t.consent.ConsentRegistration[e]=n.ConsentLevelViewModel.No}))},o.prototype.updateConsent=function(e,t,i){t[i]=e?n.ConsentLevelViewModel.Yes:n.ConsentLevelViewModel.No},o.prototype.hasAnswered=function(){return this.checkIfMissingAnswer(),this.consent.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.Unanswered||this.consent.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.Unanswered||this.consent.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.Unanswered||this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.Unanswered},o.prototype.isGeneral=function(){return this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.NotApplicable},o.prototype.isChannelSelected=function(e){return this.consent.ConsentRegistration[e]===n.ConsentLevelViewModel.Yes},o.prototype.isChannelApplicable=function(e){return this.consent.ConsentRegistration[e]!==n.ConsentLevelViewModel.NotApplicable},o.prototype.isNo=function(){return!(this.consent.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.No||this.consent.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.No||this.consent.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.No||this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.NotApplicable&&this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.No)},o.prototype.checkIfMissingAnswer=function(){var t=this;if(this.consent.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.NotApplicable)return this.consent.ConsentRegistration.GeneralConsent===n.ConsentLevelViewModel.Unanswered?void(this.missingAnswer=null):void(this.missingAnswer=this.consent.ConsentRegistration.GeneralConsent===n.ConsentLevelViewModel.Yes);this.applicableChannels.every(function(e){return t.consent.ConsentRegistration[e]===n.ConsentLevelViewModel.No})?this.missingAnswer=!1:this.applicableChannels.every(function(e){return t.consent.ConsentRegistration[e]===n.ConsentLevelViewModel.Unanswered})?this.missingAnswer=null:this.missingAnswer=!0},o.$inject=["ConsentsService","ProfileService","ValidationService","UtilityService"],t=o,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Consents/ConsentItem/ConsentItem.component.html",this.bindings={consent:"<",user:"<"}},app.component("consentItem",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i){this.consentsService=e,this.utilityService=t,this.featureFlagService=i,this.disposables=new Rx.CompositeDisposable}e=e.CrossPortal||(e.CrossPortal={}),(n=e.Consents||(e.Consents={})).ConsentList||(n.ConsentList={}),i.prototype.$onInit=function(){this.getConsents(),this.showMissingConsentList=this.featureFlagService.consents.showMissingConsentList,this.user.Birthdate?(6<this.user.Birthdate.length?this.birthDate=this.utilityService.formatDate(this.user.Birthdate,"birthdate format"):this.birthDate=this.user.Birthdate,this.hasBirthDate=!0):this.hasBirthDate=!1},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.checkIfAvaliable=function(e){return this.consents.filter(function(t){return e.DependsOn.some(function(e){return e==t.ConsentNumber})}).filter(function(e){return e.ConsentRegistration.GeneralConsent!=n.ConsentLevelViewModel.Yes})},i.prototype.getConsents=function(){var i=this;this.disposables.add(this.consentsService.getConsents().subscribe(function(e){var t;e&&0<e.length&&(i.limitTo?i.consents=e.where(function(e){return i.limitTo.contains(e.ConsentNumber)}):i.consents=e,i.allConsentsValid&&(t=i.consents.every(function(e){return i.hasAnswered(e)}),i.allConsentsValid({state:t})),i.consentsService.eboksAvaliable$.onNext(e.firstOrDefault(function(e){return 4===e.ConsentNumber}).ConsentRegistration.GeneralConsent===n.ConsentLevelViewModel.Yes),i.missingConsents=e.filter(function(e){return e.ConsentRegistration.GeneralConsent!=n.ConsentLevelViewModel.Yes&&!(e.ConsentRegistration.GeneralConsent==n.ConsentLevelViewModel.NotApplicable&&(e.ConsentRegistration.SmsConsent==n.ConsentLevelViewModel.Yes||e.ConsentRegistration.EmailConsent==n.ConsentLevelViewModel.Yes||e.ConsentRegistration.EboksConsent==n.ConsentLevelViewModel.Yes))}))}))},i.prototype.acceptAllConsents=function(){var t=this,e=this.hasDanishCpr?this.user.Birthdate+this.ssnInput:null;this.consentsService.acceptAllConsents(e).then(function(e){t.getConsents()})},i.prototype.hasAnswered=function(e){return e.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.NotApplicable&&e.ConsentRegistration.EboksConsent!==n.ConsentLevelViewModel.Unanswered||e.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.NotApplicable&&e.ConsentRegistration.EmailConsent!==n.ConsentLevelViewModel.Unanswered||e.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.NotApplicable&&e.ConsentRegistration.SmsConsent!==n.ConsentLevelViewModel.Unanswered||e.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.NotApplicable&&e.ConsentRegistration.GeneralConsent!==n.ConsentLevelViewModel.Unanswered},i.prototype.validateCpr=function(){var t=this;this.cprValid=!1,4==this.ssnInput.length&&this.disposables.add(this.consentsService.checkCpr(this.birthDate+this.ssnInput).subscribe(function(e){t.cprValid=!e}))},i.$inject=["ConsentsService","UtilityService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Consents/ConsentList/ConsentList.component.html",this.bindings={limitTo:"<",user:"<",allConsentsValid:"&"}},app.component("consentList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var n;function t(e){this.$http=e,this.baseUrl="/umbraco/api/consent/",this.deleteCprUponRevokingConsent$=new Rx.BehaviorSubject(!1),this.openConsent$=new Rx.Subject,this.consents$=ne
1w Rx.BehaviorSubject([]),this.eboksAvaliable$=new Rx.BehaviorSubject(!1)}e=e.CrossPortal||(e.CrossPortal={}),n=e.Consents||(e.Consents={}),t.prototype.getConsents=function(){var t=this;return this.$http.get(this.baseUrl+"getconsents").then(function(e){t.deleteCprUponRevokingConsent$.onNext(e.DeleteCprUponRevokingConsent),t.consents$.onNext(e.Consents)}),this.consents$},t.prototype.checkCpr=function(e){var t=new Rx.Subject;return this.$http.post(this.baseUrl+"checkCpr",e).then(function(e){t.onNext(e)}),t},t.prototype.postConsent=function(e){var t=this;this.$http.post(this.baseUrl+"postconsent",e).then(function(e){t.consents$.onNext(e.Consents)})},t.prototype.acceptAllConsents=function(e){return this.$http.post(this.baseUrl+"AcceptAllConsents",{Property:"newSsn",Value:e})},t.prototype.postConsent4=function(e,t){var i=this;this.$http.post(this.baseUrl+"postConsent4?consenting="+(e.ConsentRegistration.GeneralConsent===n.ConsentLevelViewModel.Yes),[{Property:"SsnInput",Value:t}]).then(function(e){i.consents$.onNext(e.Consents)})},t.$inject=["incomHttpService"],app.service("ConsentsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i,n,o){this.contactWizardService=e,this.modalLogic=t,this.$scope=i,this.pageProviderService=n,this.validationService=o,this.newNames={"Glarmester ":"Glarmester (glas)","Kloak ":"Kloak (stoppet afløb/toilet)","VVS ":"VVS (vand og varme)"},this.acuteDepartment=null,this.officeDepartment=null,this.disposables=new Rx.CompositeDisposable,this.emailRegex=this.validationService.getEmailRegex()}e=(e=e.General||(e.General={})).Contact||(e.Contact={}),t=e.ContactWizard||(e.ContactWizard={}),n.prototype.$onInit=function(){this.doGetContactWizardInfo(),this.addWatchers(),this.currentTime=(new Date).getHours()},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.openWaitTimes=function(){this.modalLogic.createModal("/App/General/Contact/ContactWizard/Modal/ContactWaitTimeModal.html",t.Modal.ContactWaitTimeModalController,"lg")},n.prototype.doGetAcuteContacts=function(e){var i=this;this.disposables.add(this.contactWizardService.getAcuteContacts(e).subscribe(function(e){if(e){i.acuteContacts=e;for(var t=0;t<i.acuteContacts.length;t++)i.newNames[i.acuteContacts[t].Role]&&(i.acuteContacts[t].Role=i.newNames[i.acuteContacts[t].Role])}}))},n.prototype.doGetContactWizardInfo=function(){var n=this;this.disposables.add(this.contactWizardService.getContactWizardInfo().subscribe(function(e){if(e){n.contactWizardInfo=e;for(var t=0;t<n.contactWizardInfo.ContactBoxes.length;t++){var i=n.contactWizardInfo.ContactBoxes[t];n.emailRegex.test(i.Info)&&(i.isEmail=!0)}}})),this.disposables.add(this.contactWizardService.getFindPersonPersonnel().subscribe(function(e){e&&(n.findPersonSections=e.FindPersonSections)}))},n.prototype.addWatchers=function(){var i=this;this.$scope.$watch(function(){return i.officeDepartment},function(e,t){e&&e!==t&&i.contactWizardService.getOfficeUrl(e).subscribe(function(e){e&&history.pushState(null,null,e)})}),this.$scope.$watch(function(){return i.acuteDepartment},function(e,t){e&&e!==t&&i.doGetAcuteContacts(e)})},n.$inject=["ContactWizardService","ModalService","$scope","PageProviderService","ValidationService"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App//General/Contact/ContactWizard/ContactWizard.component.html",this.bindings={}},app.component("contactWizard",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.findPersonPersonnel$=new Rx.BehaviorSubject(null),this.contactWizardBoxes$=new Rx.BehaviorSubject(null),this.acuteContacts$=new Rx.BehaviorSubject(null),this.contactForm$=new Rx.BehaviorSubject(null),this.faq$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/ContactWizard/"}(e=(e=e.General||(e.General={})).Contact||(e.Contact={})).ContactWizard||(e.ContactWizard={}),t.prototype.getOfficeUrl=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getOfficeUrl"),n=new Rx.Subject;return this.incomHttp.post(this.baseurl+"GetOfficeUrl",e).then(function(e){n.onNext(e),t.loaderService.removeLoader(i)}),n},t.prototype.getFindPersonPersonnel=function(){var t=this,i=this.loaderService.setLoader("findPerson","getFindPersonPersonnel");return this.incomHttp.get(this.baseurl+"GetFindPersonInfo").then(function(e){t.findPersonPersonnel$.onNext(e),t.loaderService.removeLoader(i)}),this.findPersonPersonnel$},t.prototype.getContactWizardInfo=function(){var t=this;return this.incomHttp.get(this.baseurl+"GetContactWizardInfo").then(function(e){t.contactWizardBoxes$.onNext(e)}),this.contactWizardBoxes$},t.prototype.getAcuteContacts=function(e){var t=this;return this.incomHttp.post(this.baseurl+"GetAcuteContacts",e).then(function(e){t.acuteContacts$.onNext(e)}),this.acuteContacts$},t.prototype.sendContactForm=function(e,t){this.fileService.postWithFiles(e,this.baseurl+"SendContactForm/",t)},t.prototype.getFaq=function(){var t=this;new Rx.Subject;return this.incomHttp.get(this.baseurl+"GetFaqCategories").then(function(e){t.faq$.onNext(e)}),this.faq$},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("ContactWizardService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s){this.contactWizardService=e,this.formService=t,this.faqService=i,this.$scope=n,this.fileService=o,this.validationService=r,this.$sce=s,this.files=[],this.contactForm={User:{Address:{}}},this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).Contact||(e.Contact={})).ContactWizard||(e.ContactWizard={})).FaqContactForm||(e.FaqContactForm={}),i.prototype.$onInit=function(){var t=this;this.$scope.$watchCollection(function(){return t.files},function(e){t.uploadedFiles=t.uploadedFiles||[],e&&0<e.length&&t.uploadedFiles.addRange(e.map(function(e){return t.fileService.toUploadedFile(e)})),t.files=[]}),this.doGetFaq(),this.emailRegex=this.validationService.getEmailRegex(),this.fullNameRegex=this.validationService.getFullNameRegex(),this.phoneRegex=this.validationService.getPhoneNumberRegex()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getAddress=function(e){e&&(this.contactForm.User.Address.ZipCode=e.ZipCode,this.contactForm.User.Address.City=e.City,this.contactForm.User.Address.Street=e.Street,this.contactForm.User.Address.Location=e.Location,this.contactForm.User.Address.LocalTown=e.LocalTown)},i.prototype.doGetFaq=function(){var t=this;this.disposables.add(this.faqService.getFaq().subscribe(function(e){e&&(t.faqCategories=e.Categories.where(function(e){return e.EmailAddress&&""!==e.EmailAddress}),t.faqCategories.forEach(function(e){return e.SubCategories=e.SubCategories.where(function(e){return e.EmailAddress&&""!==e.EmailAddress})}),t.faqCategories.forEach(function(e){e.Questions.forEach(function(e){e.Answer=t.$sce.trustAsHtml(e.Answer)}),e.SubCategories.forEach(function(e){e.Questions.forEach(function(e){e.Answer=t.$sce.trustAsHtml(e.Answer)})})}))}))},i.prototype.showThis=function(e){var t=!e.show;this.faqCategory.Questions.forEach(function(e){e.show=!1}),e.show=t},i.prototype.updateFaqAndContactForm=function(e){var t=this;this.selectedFaqCategory&&(this.faqCategory=this.faqCategories.firstOrDefault(function(e){return e.Name==t.selectedFaqCategory.Name}),e?(this.contactForm.Category={Subject:e.Name,ReceiverEmail:e.EmailAddress},this.contactForm.Subject=e.Name):(this.contactForm.Category={Subject:this.faqCategory.Name,ReceiverEmail:this.faqCategory.EmailAddress},this.contactForm.Subject=this.faqCategory.Name))},i.prototype.sendMail=function(){var e=angular.copy(this.contactForm);this.contactWizardService.sendContactForm(e,this.uploadedFiles),this.formService.clearFields(this.form)},i.prototype.anyUsedInContact=function(){return this.selectedFaqSubCategory?this.selectedFaqSubCategory.Questions.any(function(e){return e.UsedInContact}):this.selectedFaqCategory.Questions.any(function(e){return e.UsedInContact})},i.$inject=["ContactWizardService","FormService","CmsFaqService","$scope","FileService","ValidationService","$sce"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Contact/ContactWizard/FaqContactForm/FaqContactForm.component.html",this.bindings={}},app.component("faqContactForm",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e){this.$modalInstance=e,this.waitTimes=[{Time:"09:00-10:00",Calls:t.Few},{Time:"10:00-11:00",Calls:t.Some},{Time:"11:00-12:00",Calls:t.Many},{Time:"12:00-13:00",Calls:t.Many},{Time:"13:00-14:00",Calls:t.Some},{Time:"14:00-15:00",Calls:t.Few}]}e=(e=(e=(e=e.General||(e.General={})).Contact||(e.Contact={})).ContactWizard||(e.ContactWizard={})).Modal||(e.Modal={}),(i=t=t||{})[i.Few=0]="Few",i[i.Some=1]="Some",i[i.Many=2]="Many",n.prototype.$onInit=function(){},n.prototype.cancel=function(){this.$modalInstance.close()},n.$inject=["$uibModalInstance"],i=n,e.ContactWaitTimeModalController=i}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.alwaysOpen=!1,this.searchPersonnelInput="",this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Contact||(e.Contact={}
1)).FindPerson||(e.FindPerson={}),i.prototype.$onInit=function(){this.findPersonPersonnel&&(this.filteredPersonPersonnel=JSON.parse(JSON.stringify(this.findPersonPersonnel)))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.resetFindPerson=function(){this.filteredPersonPersonnel=JSON.parse(JSON.stringify(this.findPersonPersonnel))},i.prototype.isEmpty=function(e){var t,i=this;return!e.Chiefs.any(function(e){return 0<e.Personnel.length||""!==e.Name})&&(t=!1,e.SubSections.forEach(function(e){t=i.isEmpty(e)}),!t)},i.prototype.doFilterFindPerson=function(t){var e,i,n=this;t?(e=this.filteredPersonPersonnel.firstOrDefault(function(e){return e.Title==t.Title}),i=this.findPersonPersonnel.firstOrDefault(function(e){return e.Title==t.Title}),e&&i&&(e.IsVisible=!0,e.Chiefs=angular.copy(i.Chiefs),e.Chiefs.filter(this.chiefFilter,this.searchPersonnelInput),e.Chiefs.forEach(function(e){return e.Personnel=e.Personnel.filter(n.filter,n.searchPersonnelInput)}))):this.filteredPersonPersonnel.forEach(function(e){return n.doFilterFindPerson(e)})},i.prototype.filter=function(e){var t=this.toString();if(""==t||-1!==e.Name.toUpperCase().indexOf(t.toUpperCase()))return e},i.prototype.chiefFilter=function(e){var t=this.toString();return""!=t&&-1===e.Name.toUpperCase().indexOf(t.toUpperCase())&&(e.Name=""),e},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Contact/FindPerson/FindPerson.component.html",this.bindings={findPersonPersonnel:"<",alwaysOpen:"<"}},app.component("findPerson",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/FindPerson/"}(e=(e=e.General||(e.General={})).Contact||(e.Contact={}
1)).FindPerson||(e.FindPerson={}),t.prototype.getFindPersonPersonnel=function(e){var t=this,i=new Rx.Subject,n=this.loaderService.setLoader("contentSection","getFindPersonPersonnel");return this.incomHttp.get(this.baseurl+"GetFindPersonInfo?nodeId="+e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("FindPersonService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.findPersonService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Contact||(e.Contact={})).FindPerson||(e.FindPerson={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.disposables.add(t.findPersonService.getFindPersonPersonnel(e.Id).subscribe(function(e){t.findPersonSections=e.FindPersonSections}))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["FindPersonService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Contact/FindPerson/FindPersonPage.component.html",this.bindings={}},app.component("findPersonPage",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Contact||(e.Contact={}
1)).FindPerson||(e.FindPerson={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Contact/FindPerson/FindPersonSection.component.html",this.bindings={section:"<"}},app.component("findPersonSection",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.pageContentService=e,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).HeaderContent||(e.HeaderContent={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.headerContent=e.HeaderContents)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/HeaderContent/HeaderContent.component.html",this.bindings={}},app.component("headerContent",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.pageContentService=e,this.validationService=t,this.departmentOfficeFormService=i,this.formService=n,this.disposables=new Rx.CompositeDisposable,this.contactForm={User:{Address:{}}},this.maxTotalSize=10240}(e=(e=e.General||(e.General={})).Contact||(e.Contact={})).DepartmentOffice||(e.DepartmentOffice={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.contactForm.CurrentPageId=e.Id,t.departmentOfficeFormService.getCurrentUserData().then(function(e){e&&(t.contactForm.User=e)}))}),this.emailRegex=this.validationService.getEmailRegex()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getAddress=function(e){e&&(this.contactForm.User.Address.ZipCode=e.ZipCode,this.contactForm.User.Address.City=e.City,this.contactForm.User.Address.Street=e.Street,this.contactForm.User.Address.Location=e.Location,this.contactForm.User.Address.LocalTown=e.LocalTown)},i.prototype.sendMail=function(){var e=angular.copy(this.contactForm),t=__spreadArray([],this.uploadedFiles,!0);this.departmentOfficeFormService.sendForm(e,t),this.uploadedFiles=[],this.contactForm={},this.formService.clearFields(this.form)},i.$inject=["PageContentService","ValidationService","DepartmentOfficeFormService","FormService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Contact/DepartmentOffice/DepartmentOfficeForm.component.html",this.bindings={}},app.component("departmentOfficeForm",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.baseurl="/umbraco/api/DepartmentOfficeForm/"}(e=(e=e.General||(e.General={})).Contact||(e.Contact={})).DepartmentOffice||(e.DepartmentOffice={}),t.prototype.getCurrentUserData=function(){return this.incomHttp.get(this.baseurl+"GetCurrentUserData")},t.prototype.sendForm=function(e,t){this.fileService.postWithFiles(e,this.baseurl+"SendContactForm/",t)},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("DepartmentOfficeFormService",t)}(BoligExtra=BoligExtra||{}),!function(e){e.AppConfig||(e.AppConfig={});app.config(["$stateProvider","$locationProvider",function(e,t){e.state("all",{url:"*myPath",resolve:{pageContent:["$stateParams","PageContentService",function(e,t){t.goToUrl(e.myPath)}]},component:"pageContent"}),t.html5Mode(!0)}])}(BoligExtra=BoligExtra||{}),!function(BoligExtra){var AppConfig;!function(AppConfig){var Routing;!function(Routing){var PageContentComponentController=function(){function PageContentComponentController(e,t,i,n,o,r,s,a,l){this.$scope=e,this.$compile=t,this.pageContentService=i,this.$element=n,this.featureFlagService=o,this.utilityService=r,this.smoothScroll=s,this.http=a,this.sitemenuStateService=l,this.sub=new Rx.CompositeDisposable,this.isEditing=!1}return PageContentComponentController.prototype.$onInit=function(){var _this=this,clearWatch=(this.isPushingSiteMenuEnabled=this.featureFlagService.siteMenu.enablePushingSiteMenu,this.$scope.$watch(function(){return _this.http.pendingRequests.length},function(e){0==e&&(document.getElementById("initialPageLoader").remove(),clearWatch())}));this.sub.add(this.utilityService.isHorizontalTablet.subscribe(function(e){_this.isTabletOrHigher=e})),this.sub.add(this.pageContentService.currentPage$.subscribe(function(currentPage){if(currentPage&&!currentPage.PreventLoad){for(var mainContentDiv,page
1ContentDiv=(0==_this.isTabletOrHigher&&_this.isPushingSiteMenuEnabled&&(_this.sitemenuStateService.getMenuSection(""),_this.sitemenuStateService.toggleMenu("close"),mainContentDiv=_this.$element.parents("#main-content"),mainContentDiv.offset().top<window.scrollY)&&_this.smoothScroll(mainContentDiv[0]),_this.$element.find("#pagecontent")),childScope=pageContentDiv.scope().$$childHead;childScope;){var nextChildScope=childScope.$$nextSibling;childScope.$destroy(),childScope=nextChildScope}if(pageContentDiv.empty(),pageContentDiv.append(_this.$compile(currentPage.HtmlContent)(_this.$scope.$new(!0))).hide().fadeIn(200),_this.$scope.$root.$applyAsync(),_this.featureFlagService.content.allowScriptsInSource)for(var arr=_this.$element.find("script"),n=0;n<arr.length;n++)eval(arr[n].innerHTML)}})),this.sub.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(_this.createNewPage=e.isNewPage,_this.isEditing=e.isEditing,_this.sortPages=e.sortPages,_this.deletePages=e.deletePages)}))},PageContentComponentController.prototype.$onDestroy=function(){this.sub.dispose()},PageContentComponentController.$inject=["$scope","$compile","PageContentService","$element","FeatureFlagService","UtilityService","smoothScroll","$http","SiteMenuStateService"],PageContentComponentController}(),PageContentComponent=function(){this.controller=PageContentComponentController,this.templateUrl="/App/AppConfig/PageContent/PageContent.component.html"};app.component("pageContent",new PageContentComponent)}(Routing=AppConfig.Routing||(AppConfig.Routing={}))}(AppConfig=BoligExtra.AppConfig||(BoligExtra.AppConfig={}))}(BoligExtra=BoligExtra||{}),!function(o){var e;function t(e,t,i,n,o,r,s){this.loaderService=e,this.$http=t,this.modalService=i,this.siteMenuService=n,this.userService=o,this.utilityService=r,this.featureFlagsService=s,this.defaultEditState={isEditing:!1,sortPages:!1,deletePages:!1,isNewPage:!1},this.currentPage$=new Rx.BehaviorSubject(null),this.isEditingPage$=new Rx.BehaviorSubject(this.defaultEditState)}(e=o.AppConfig||(o.AppConfig={})).PageContent||(e.PageContent={}),t.prototype.updateProfilePicture=function(e){null!=this.userService.currentUser$.getValue()&&(this.userService.currentUser$.getValue().AvatarUrl=e)},t.prototype.goToUrl=function(e){var t=this,i=this.loaderService.setLoader("contentSection","pageContent"),n=(this.resetPageEditing(),this.currentPage$.getValue()),e={params:{url:encodeURIComponent(e),oldUrl:n?encodeURIComponent(n.Url):"",query:window.location.search}};this.$http.get("/Umbraco/api/PageContent/Get/",e).then(function(e){e?(e.IsLoggedIn!==(null!=t.userService.currentUser$.getValue())&&t.userService.getCurrentUser(),t.currentPage$.onNext(e),t.siteMenuService.updateMenu(e),e.MissingConsentsAnswers&&e.MissingConsentsAnswers.any()&&t.modalService.createModal("/app/CrossPortal/Consents/Modals/MissingConsents.modal.html",o.CrossPortal.Consents.Modals.MissingConsentsModalController,{missingConsents:e.MissingConsentsAnswers},"lg"),e.MissingMemberships&&0<e.MissingMemberships.length&&t.modalService.createModal("/app/Housing/Basket/Modals/MissingMembership.modal.html",o.Housing.Basket.Modals.MissingMembershipModalController,{missingMemberships:e.MissingMemberships,tenancies:e.BasketTenancies},"lg")):t.utilityService.safeDigest(),t.loaderService.removeLoader(i)},function(e){return t.loaderService.removeLoader(i)})},t.prototype.togglePageEditing=function(e){this.resetPageEditing(),this.isEditingPage$.onNext(e)},t.prototype.resetPageEditing=function(){this.defaultEditState={isEditing:!1,sortPages:!1,deletePages:!1,isNewPage:!1},this.isEditingPage$.onNext(this.defaultEditState)},t.$inject=["LoaderService","incomHttpService","ModalService","SiteMenuService","UserService","UtilityService","FeatureFlagService"],app.service("PageContentService",t)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o,r){this.modalService=t,this.fileService=i,this.pageContentService=n,this.$timeout=o,this.utilityService=r,this.subs=new Rx.CompositeDisposable,this.currentNode=null,this.selectedNodes=[],this.contents=[],this.path=[],this.orderBy="SortOrder",this.allSelected=!1,this.service=e.getInstance()}e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={}),i=e.FileArchive||(e.FileArchive={}),n.prototype.$onInit=function(){var i=this,e=this.utilityService.getParameters("querystring");e&&e.folder&&!location.hash&&(e=this.utilityService.getPageUrl()+"#"+e.folder,history.pushState(null,null,e)),this.subs.add(this.service.currentNode$.subscribe(function(e){return i.currentNode=e})),this.subs.add(this.service.content$.subscribe(function(e){i.contents=e,i.files=e.filter(function(e){return"FileArchiveFileViewModel"===e.NodeType}
1),i.folders=e.filter(function(e){return"FileArchiveFolderViewModel"===e.NodeType})})),this.subs.add(this.service.ancestors$.subscribe(function(e){i.path=e})),this.navigate=function(e){var t=parseInt(location.hash.replace(/#|!|\//g,""));angular.isNumber(t)&&!isNaN(t)?i.goto(t):i.goto(0)},window.addEventListener("hashchange",this.navigate),this.navigate(null),this.subs.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(i.currentPageId=e.Id,i.pageName=e.PageName)}))},n.prototype.$onDestroy=function(){this.subs.dispose(),window.removeEventListener("hashchange",this.navigate)},n.prototype.goBack=function(){var e,t=this.path.pop();t?(e=t.ShortcutForId||t.Id,t.PseudoId&&""!==t.PseudoId?location.hash=e+"_"+t.PseudoId:location.hash=e.toString()):location.hash=""},n.prototype.toggleAllNodeSelection=function(e){if(!1===this.allSelected)for(var t=0;t<e.length;t++){var i=e[t];this.selectedNodes.contains(i)||this.selectedNodes.add(i)}else for(t=0;t<e.length;t++){i=e[t];this.selectedNodes.contains(i)&&this.selectedNodes.remove(i)}},n.prototype.isAllNodesSelected=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(!this.selectedNodes.any(function(e){return e.Id===i.Id}))return this.allSelected=!1;this.selectedNodes.any(function(e){return e.Id===i.Id})}return this.allSelected=!0},n.prototype.toggleNodeSelection=function(e){this.selectedNodes.contains(e)?this.selectedNodes.remove(e):this.selectedNodes.add(e)},n.prototype.setOrderByForName=function(){this.currentNode.IsPseudoHousing?this.orderBy="PseudoId":this.orderBy="Name"},n.prototype.isNodeSelected=function(t){return this.selectedNodes.any(function(e){return e.Id===t.Id})},n.prototype.goto=function(e){this.selectedNodes=[],this.service.goto(e)},n.prototype.getFile=function(e){this.service.downloadFile(e,this.currentPageId)},n.prototype.openNewFolderDialog=function(){var e,t=this;this.checkPermission("CreateFolder")&&(e={parentNode:this.currentNode,service:this.service,isExplorer:!1},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveCreateNewFolder.modal.html",i.Modals.FileArchiveCreateNewFolderController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))},n.prototype.openSearchDialog=function(){var e=this;this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveSearch.modal.html",i.Modals.FileArchiveSearchController,null,"md").result.then(function(){return e.goto(e.currentNode?e.currentNode.Id:0)})},n.prototype.openUploadFilesDialog=function(){var e;this.checkPermission("CreateFile")&&(e={parentNode:this.currentNode,service:this.service},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveUploadFiles.modal.html",i.Modals.FileArchiveUploadFilesController,e,"md").result.then(function(){}))},n.prototype.openRenameItemDialog=function(){var e,t=this;this.checkPermission("Rename")&&1===this.selectedNodes.length&&(e={selectedNode:this.selectedNodes[0],service:this.service},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveEditNode.modal.html",i.Modals.FileArchiveEditNodeController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))}
1,n.prototype.openSetSortOrderDialog=function(){var e,t=this;this.checkPermission("SetSortOrder")&&(e={nodes:this.contents,service:this.service},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveSetSortOrder.modal.html",i.Modals.FileArchiveSortOrderController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))},n.prototype.openDeleteDialog=function(){var e,t=this;!this.checkPermission("Delete")||this.selectedNodes.length<1||(e={selectedNodes:this.selectedNodes,isExplorer:!1,node:this.currentNode},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveDeleteNodes.modal.html",i.Modals.FileArchiveDeleteNodesController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))},n.prototype.openRelocateDialog=function(){var e,t=this;!this.checkPermission("Relocate")||this.selectedNodes.length<1||(e={selectedNodes:this.selectedNodes,currentParent:this.currentNode},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveRelocateNodes.modal.html",i.Modals.FileArchiveRelocateNodesController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))},n.prototype.openNewShortCutDialog=function(){var e,t=this;!this.checkPermission("NewShortcut")||this.selectedNodes.length<1||(e={selectedNode:this.selectedNodes.firstOrDefault(),currentParent:this.currentNode},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveCreateShortcut.modal.html",i.Modals.FileArchiveShortCutNodesController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))},n.prototype.openEditPermissionsDialog=function(){var e,t=this;!this.checkPermission("EditPermissions")||this.selectedNodes.length<1||(e={selectedNodes:this.selectedNodes},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileARchiveEditPermissions.modal.html",i.Modals.FileArchiveEditPermissionsController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))},n.prototype.updateUnderlyingPermissionsDialog=function(){var e,t=this;this.checkPermission("EditPermissions")&&this.currentNode.Id&&(e={selectedNodes:[this.currentNode]},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileARchiveEditPermissions.modal.html",i.Modals.FileArchiveEditPermissionsController,e,"md").result.then(function(){return t.goto(t.currentNode?t.currentNode.Id:0)}))},n.prototype.isClickable=function(e){return!e.NodeTags.any(function(e){return"CompanyDepartmentPseudoRoot"==e.Tag})},n.prototype.checkPermission=function(e){if(this.currentNode&&this.currentNode.PseudoId&&-1==this.currentNode.PseudoId.indexOf("-1")&&this.selectedNodes.any(function(e){return e.NodeTags.any(function(e){return"DepartmentStandardFolder"==e.Tag||"CompanyStandardFolder"==e.Tag})})&&("EditPermissions"==e||"Rename"==e||"Delete"==e||"Relocate"==e||"NewShortcut"==e))return!1;if(this.service.isAdmin()){if(!this.currentNode&&("CreateFile"==e||"Relocate"==e||"NewShortcut"==e))return!1;if("CreateFolder"==e)return!0;if("SetSortOrder"==e)return!0;if("Delete"==e&&0<this.selectedNodes.length)return!0;if(("EditPermissions"==e||"Rename"==e||"Delete"==e)&&1===this.selectedNodes.length)return!0;if(this.currentNode&&"Relocate"==e&&1===this.selectedNodes.length&&this.selectedNodes.every(function(e){return!e.IsPseudoHousing}))return!0;if(this.currentNode&&"NewShortcut"==e&&1===this.selectedNodes.length&&this.selectedNodes.every(function(e){return!e.IsPseudoHousing})&&this.selectedNodes.every(function(e){return null==e.ShortcutForId}))return!0;if(this.currentNode&&"CreateFile"==e)return!0}return"CreateFolder"===e&&this.currentNode&&this.currentNode.Permissions.any()&&!this.selectedNodes.any()?this.currentNode.Permissions.any(function(e){return"EditSubFoldersPermission"===e}):"CreateFile"===e&&this.currentNode&&this.currentNode.Permissions.any()&&!this.selectedNodes.any()?this.currentNode.Permissions.any(function(e){return"EditFilesPermission"===e}):("EditPermissions"===e||"Rename"===e)&&1===this.selectedNodes.length&&this.selectedNodes.any()&&this.selectedNodes.any(function(e){return e.Permissions.any()})?this.selectedNodes.every(function(e){return e.Permissions.any(function(e){return"EditFilesPermission"===e})}):"UpdatePermissions"===e?this.currentNode.Permissions.any(function(e){return"EditFilesPermission"===e}):"SetSortOrder"==e&&this.currentNode&&this.currentNode.Permissions.any()?this.currentNode.Permissions.any(function(e){return"EditFilesPermission"===e}):"Delete"===e&&1===this.selectedNodes.length&&this.currentNode?this.currentNode.Permissions.any()&&this.currentNode.Permissions.any(function(e){return"DeleteFilesPermission"===e})||this.selectedNodes.every(function(e){return e.IsUploadedByInteressent}):"Relocate"==e&&1===this.selectedNodes.length&&this.selectedNodes.every(function(e){return!e.IsPseudoHousing})&&this.currentNode&&this.currentNode.Permissions.any()?this.currentNode.Permissions.any(function(e){return"RelocateFilesPermission"===e}):!!("NewShortcut"==e&&1===this.selectedNodes.length&&this.selectedNodes.every(function(e){return!e.IsPseudoHousing})&&this.selectedNodes.every(function(e){return null==e.ShortcutForId})&&this.currentNode&&this.currentNode.Permissions.any())&&this.currentNode.Permissions.any(function(e){return"RelocateFilesPermission"===e})},n.prototype.getIcon=function(e){return this.service.getIcon(e)},n.prototype.doSearch=function(e){var t=this;1<e.length?this.service.searchForNodes(e).then(function(e){e&&(t.results=e.FileArchiveNavigationViewModels)}):this.results=[]},n.prototype.toggleSearchResult=function(){var e=this;this.openSearchResult?this.$timeout(function(){e.openSearchResult=!1},250):this.openSearchResult=!0},n.$inject=["FileArchiveServiceFactory","ModalService","FileService","PageContentService","$timeout","UtilityService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Archives/FileArchive/FileArchive.component.html",this.bindings={isNonAdmin:"<"}},app.component("fileArchive",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i,n,o){this.$http=e,this.loaderService=t,this.modalService=i,this.fileService=n,this.$q=o}function o(e,t,i,n,o){this.$http=e,this.loaderService=t,this.modalService=i,this.fileService=n,this.$q=o,this.baseUrl="/umbraco/api/FileArchive/",this.explorerUrl="/umbraco/api/FileArchiveExplorer/",this.permissions$=new Rx.BehaviorSubject(null),this.ancestors$=ne
1w Rx.BehaviorSubject([]),this.currentNode$=new Rx.BehaviorSubject(null),this.content$=new Rx.BehaviorSubject([])}e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={}),t=e.FileArchive||(e.FileArchive={}),n.prototype.getInstance=function(){return new i(this.$http,this.loaderService,this.modalService,this.fileService,this.$q)},n.$inject=["incomHttpService","LoaderService","ModalService","FileService","$q"],e=n,o.prototype.searchForNodes=function(e){var t=this,i=this.loaderService.setLoader("fileSearch","search"),e=this.$http.get("".concat(this.baseUrl,"SearchForNodes?nodeName=")+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},o.prototype.deleteNodes=function(e,t){var i=this,n=this.$q.defer(),o=(this.getPseudoIdFromNodeOrUrl(e),t.CurrentCompanyId=this.currentNodeCompanyId,t.CurrentDepartmentId=this.currentNodeDepartmentId,this.loaderService.setLoader("fileArchive","deletion"));return this.$http.post("".concat(this.baseUrl,"DeleteNodes"),t).then(function(){i.loaderService.removeLoader(o),n.resolve()}),n.promise},o.prototype.downloadFile=function(t,e){var i,n=this,o=(0<t&&(i=(i=this.content$.getValue().firstOrDefault(function(e){return e.Id==t}))||this.currentNode$.getValue(),this.getPseudoIdFromNodeOrUrl(i)),this.loaderService.setLoader("fileArchive","fileDownload"));this.$http.post("".concat(this.baseUrl,"DownloadFile?id=").concat(t,"&pageId=").concat(e,"&companyId=").concat(this.currentNodeCompanyId,"&departmentId=").concat(this.currentNodeDepartmentId),null).then(function(e){n.loaderService.removeLoader(o),n.fileService.downloadFile([e])})},o.prototype.getContent=function(e,t,i){var n=this,e=$.param({nodeId:e,companyId:t||"",departmentId:i||""}),o=this.loaderService.setLoader("fileArchive","getContent");return this.$http.get("".concat(this.baseUrl,"GetContent?").concat(e)).then(function(e){n.loaderService.removeLoader(o),n.currentNode$.onNext(e.CurrentNode),n.ancestors$.onNext(e.Ancestors),n.content$.onNext(e.Content),n._isAdmin=e.IsSystemAdmin})},o.prototype.getPermissions=function(e,t){var i=this,n=this.loaderService.setLoader("fileArchive","getPermissions"),e=(this.permissions$.onNext(null),(e=e.where(function(e){return!!e})).map(function(e){return e.Id}));return t=t||!1,this.$http.get("".concat(this.baseUrl,"GetPermissions?nodeids=").concat(e.join(","),"&getAdditionalLevelOfPermissions=").concat(t)).then(function(e){i.loaderService.removeLoader(n),i.permissions$.onNext(e.ArchivePermissionViewModels)}),this.permissions$},o.prototype.isAdmin=function(){return this._isAdmin},o.prototype.updateNode=function(e,t){var i=this,n=this.loaderService.setLoader("fileArchive","updateNode");return this.getPseudoIdFromNodeOrUrl(e),this.$http.post("".concat(this.baseUrl,"UpdateNode?updateShortCut=").concat(t,"&companyId=").concat(this.currentNodeCompanyId,"&departmentId=").concat(this.currentNodeDepartmentId),e).then(function(){i.loaderService.removeLoader(n)})},o.prototype.savePermissions=function(){var e=this,t=this.permissions$.getValue(),i=this.loaderService.setLoader("fileArchive","savePermissions");return this.$http.post("".concat(this.baseUrl,"SavePermissions"),t).then(function(){e.loaderService.removeLoader(i)})},o.prototype.saveFilePermission=function(e){var t=this,i=angular.copy(this.permissions$.getValue()),n=(i[0].NodeId=e,this.loaderService.setLoader("fileArchive","saveFilePermissions"));return this.$http.post("".concat(this.baseUrl,"SavePermissions?companyId=").concat(this.currentNodeCompanyId,"&departmentId=").concat(this.currentNodeDepartmentId),i).then(function(){t.loaderService.removeLoader(n)})},o.prototype.uploadFiles=function(e,t,i){var n=this,o=[],r=this.$q.defer(),s=this.$q.defer(),a=this.loaderService.setLoader("fileArchive","uploadFiles"),l=(angular.isArray(t)||(t=[t]),e?e.Id:0);return this.getPseudoIdFromNodeOrUrl(e),o.push(this.$http.postFiles("".concat(this.baseUrl,"UploadFiles?nodeId=").concat(l,"&companyId=").concat(this.currentNodeCompanyId,"&departmentId=").concat(this.currentNodeDepartmentId),t).then(function(e){if(e)for(var t=0;t<e.length;t++)o.push(n.saveFileTags(e[t],i)),o.push(n.saveFilePermission(e[t])),t==e.length-1&&s.resolve()})),s.promise.then(function(){n.$q.all(o).finally(function(){n.loaderService.removeLoader(a),i.any(function(e){return"CompanyDepartmentPseudoRoot"==e.Tag})?r.resolve():n.goto(l).then(function(e){r.resolve()})})}),r.promise},o.prototype.createFolder=function(e,t,i,n){var o=this,r=this.$q.defer(),s=this.loaderService.setLoader("fileArchive","creation");return t.Folder.ParentId=e,i&&n?(this.currentNodeCompanyId=i,this.currentNodeDepartmentId=n,this.$http.post("".concat(this.baseUrl,"CreateFolder?companyId=").concat(i,"&departmentId=").concat(n),t).then(function(e){e&&o.saveFilePermission(e.Id).then(function(){r.resolve(e),o.loaderService.removeLoader(s)})})):this.$http.post("".concat(this.baseUrl,"CreateFolder"),t).then(function(e){e&&o.saveFilePermission(e.Id).then(function(){r.resolve(e),o.loaderService.removeLoader(s)})}),r.promise},o.prototype.createShortcut=function(e,t){var i=this,e={NewFolder:e,OriginalNode:t},n=this.loaderService.setLoader("fileArchive","shortcut");return this.$http.post("".concat(this.baseUrl,"CreateShortcut"),e).then(function(){i.loaderService.removeLoader(n)})},o.prototype.relocateNodes=function(e,t){var i=this,e={NodeIds:e.map(function(e){return e.Id}),NewParent:t},n=this.loaderService.setLoader("fileArchive","relocate");return this.$http.post("".concat(this.baseUrl,"RelocateNodes"),e).then(function(){i.loaderService.removeLoader(n)})},o.prototype.getShortcutsFornode=function(e){var t=this,i=this.loaderService.setLoader("modal","getShortcutsForNode"),e=this.$http.get("".concat(this.baseUrl,"GetShortcutsFornode?nodeId=").concat(e));return e.then(function(){t.loaderService.removeLoader(i)}),e},o.prototype.getNodeTags=function(e,t){var i=this,n=this.loaderService.setLoader("modal","getShortcutsForNode"),e=this.$http.get("".concat(this.baseUrl,"GetNodeTags?includeHidden=").concat(e,"&isPseudo=").concat(t));return e.then(function(){i.loaderService.removeLoader(n)}),e},o.prototype.goto=function(t){var e;return 0<t?(e=(e=this.content$.getValue().firstOrDefault(function(e){return e.Id==t}))||this.currentNode$.getValue(),this.getPseudoIdFromNodeOrUrl(e),this.getContent(t,this.currentNodeCompanyId,this.currentNodeDepartmentId)):this.getContent(t)},o.prototype.getPseudoIdFromNodeOrUrl=function(e){var t,i,n;this.currentNodeCompanyId=null,this.currentNodeDepartmentId=null,e&&e.IsPseudoHousing?(i=void 0,-1<(i=location.hash.toLowerCase().indexOf("_"))?1===(n=location.hash.substring(i+1).split("_")).length?this.currentNodeCompanyId=Number(n[0]):2===n.length&&(this.currentNodeCompanyId=Number(n[0]),this.currentNodeDepartmentId=Number(n[1])):e.PseudoId&&!e.NodeTags.any(function(e){return"CompanyDepartmentPseudoRoot"==e.Tag})&&(1===(t=e.PseudoId.split("_")).length?this.currentNodeCompanyId=Number(t[0]):2===t.length&&(this.currentNodeCompanyId=Number(t[0]),this.currentNodeDepartmentId=Number(t[1])))):e||(i=void 0,-1<(i=location.hash.toLowerCase().indexOf("_"))&&(1===(n=location.hash.substring(i+1).split("_")).length?this.currentNodeCompanyId=Number(n[0]):2===n.length&&(this.currentNodeCompanyId=Number(n[0]),this.currentNodeDepartmentId=Number(n[1]))))},o.prototype.saveFileTags=function(e,t){var i=this,n=this.loaderService.setLoader("fileArchive","saveFileTags");return this.$http.post("".concat(this.baseUrl,"SaveFileTags?nodeId=").concat(e,"&companyId=").concat(this.currentNodeCompanyId,"&departmentId=").concat(this.currentNodeDepartmentId),t).then(function(){i.loaderService.removeLoader(n)})},o.prototype.getIcon=function(e){return e.ShortcutForId?"fa-level-up":t.isFileArchiveFileViewModel(e)?this.fileService.getFileIconClass(e.Extension):e.NodeTags.any(function(e){return"CompanyDepartmentPseudoRoot"===e.Tag})?"fa-building":e.NodeTags.any(function(e){return"DepartmentStandardFolder"==e.Tag||"CompanyStandardFolder"==e.Tag})?"fa-clone":"fa-folder-open"},i=o,app.service("FileArchiveServiceFactory",e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o,r,s,a){this.modalService=i,this.fileService=n,this.archiveExplorerService=o,this.pageContentService=r,this.featureFlagService=s,this.utilityService=a,this.rootNodes=[],this.currentNode=null,this.selectedNodes=[],this.contents=[],this.path=[],this.orderBy="SortOrder",this.allSelected=!1,this.dateColumnCount=0,this.subs=new Rx.CompositeDisposable,this.service=t.getInstance()}e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={}),i=e.FileArchive||(e.FileArchive={}),n.prototype.$onInit=function(){var n=this,e=this.utilityService.getParameters("querystring");e&&e.folder&&!location.hash&&(e=this.utilityService.getPageUrl()+"#"+e.folder,history.pushState(null,null,e)),this.subs.add(this.pageContentService.currentPage$.subscribe(function(e){n.currentPage=e,n.currentPageDepartmentId=e.DepartmentIdFromCompanyDepartmentPage,n.currentPageCompanyId=e.CompanyIdFromCompanyDepartmentPage,n.rootNodes.any()||(n.loading=!0,n.getRootNodes())})),this.subs.add(this.archiveExplorerService.currentNode$.subscribe(function(t){t&&(t.NodeTags.any(function(e){return"CompanyDepartmentPseudoRoot"==e.Tag})?(n.contents=n.rootNodes,n.files=n.contents.filter(function(e){return"FileArchiveFileViewModel"===e.NodeType}),n.folders=n.contents.filter(function(e){return(n.childFolderIds.contains(e.Id)||n.startNodes.contains(e.Id)||n.pseudoFolder.contains(e.Id)
1)&&"FileArchiveFolderViewModel"===e.NodeType}),n.currentNode=null,location.hash="#"):(n.currentNode=t,n.path.any(function(e){return e.Id==t.Id})||n.path.push(t)))})),this.subs.add(this.archiveExplorerService.isAdmin$.subscribe(function(e){n.isAdmin=e})),this.subs.add(this.archiveExplorerService.content$.subscribe(function(e){n.contents=e.filter(function(e){return(n.childFolderIds.contains(e.Id)||n.startNodes.contains(e.Id)||n.pseudoFolder.contains(e.Id))&&"FileArchiveFolderViewModel"===e.NodeType||"FileArchiveFileViewModel"===e.NodeType});var e=n.contents.filter(function(e){return"FileArchiveFileViewModel"===e.NodeType}),t=n.contents.filter(function(e){return"FileArchiveFolderViewModel"===e.NodeType}),i=t.firstOrDefault();n.featureFlagService.fileArchive.openInitialFolder&&i&&0==e.length&&1==t.length&&(n.startNodes.contains(i.Id)||n.pseudoFolder.contains(i.Id))?window.location.hash="#"+(i.ShortcutForId||i.Id)+(i.PseudoId?"_"+i.PseudoId:""):(n.files=e,n.folders=t)})),this.navigate=function(e){n.selectedNodes=[];var t,i=parseInt(location.hash.replace(/#|!|\//g,""));angular.isNumber(i)&&!isNaN(i)?(n.path.any(function(e){return e.Id==i})&&(t=n.path.firstOrDefault(function(e){return e.Id==i}),t=n.path.indexOf(t),n.path.splice(t,n.path.length)),t={CompanyAndDepartments:{Departments:n.departments,Companies:n.companies},Id:i},n.archiveExplorerService.getExplorerContent(n.currentPage.Id,t)):(n.path=[],n.currentNode=null,n.getRootNodesContent())},window.addEventListener("hashchange",this.navigate),this.orderBy="SortOrder",this.showUpdatedDate=this.featureFlagService.fileArchive.showUpdatedDate,this.showCreatedDate=this.featureFlagService.fileArchive.showCreatedDate,this.showUpdatedDate&&this.dateColumnCount++,this.showCreatedDate&&this.dateColumnCount++},n.prototype.$onDestroy=function(){this.subs.dispose(),window.removeEventListener("hashchange",this.navigate)},n.prototype.getRootNodes=function(){var t=this,e={CompanyAndDepartments:{Departments:this.departments,Companies:this.companies},FolderIds:this.startNodes,PseudoFolderIds:this.pseudoFolder};this.archiveExplorerService.getExplorerRootContent(this.currentPage.Id,e).then(function(e){t.rootNodes=e.Content.filter(function(e){return(t.childFolderIds.contains(e.Id)||t.startNodes.contains(e.Id)||t.pseudoFolder.contains(e.Id))&&"FileArchiveFolderViewModel"===e.NodeType||"FileArchiveFileViewModel"===e.NodeType}),t.getRootNodesContent(),t.loading=!1})},n.prototype.getRootNodesContent=function(){var e=parseInt(location.hash.replace(/#|!|\//g,""));e&&!isNaN(e)?(e={CompanyAndDepartments:{Departments:this.departments,Companies:this.companies},Id:e},this.archiveExplorerService.getExplorerContent(this.currentPage.Id,e)):(this.contents=this.rootNodes,this.files=this.contents.filter(function(e){return"FileArchiveFileViewModel"===e.NodeType}),this.folders=this.contents.filter(function(e){return"FileArchiveFolderViewModel"===e.NodeType}))},n.prototype.toggleAllNodeSelection=function(e){if(!1===this.allSelected)for(var t=0;t<e.length;t++){var i=e[t];this.selectedNodes.contains(i)||this.selectedNodes.add(i)}else for(t=0;t<e.length;t++){i=e[t];this.selectedNodes.contains(i)&&this.selectedNodes.remove(i)}},n.prototype.isAllNodesSelected=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(!this.selectedNodes.any(function(e){return e.Id===i.Id}))return this.allSelected=!1;this.selectedNodes.any(function(e){return e.Id===i.Id})}return this.allSelected=!0},n.prototype.openSearchDialog=function(){var e={nodeIds:this.childFolderIds.concat(this.startNodes).concat(this.pseudoFolder),currentPageId:this.currentPage.Id};this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveExplorerSearch.modal.html",i.Modals.FileArchiveExplorerSearchController,e,"md").result.then(function(){})},n.prototype.openRenameItemDialog=function(){var e,t=this;this.checkPermission("Rename")&&1===this.selectedNodes.length&&(e={selectedNode:this.selectedNodes[0],service:this.service},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveEditNode.modal.html",i.Modals.FileArchiveEditNodeController,e,"md").result.then(function(){return t.navigate({})}))},n.prototype.toggleNodeSelection=function(e){this.selectedNodes.contains(e)?this.selectedNodes.remove(e):this.selectedNodes.add(e)},n.prototype.isNodeSelected=function(t){return this.selectedNodes.any(function(e){return e.Id===t.Id})},n.prototype.goBack=function(){var t=this;if(0<this.path.length&&this.rootNodes.any(function(e){return e.ParentId!==t.path.lastOrDefault().ParentId})){var i=this.path.pop();if(i&&!this.rootNodes.any(function(e){return e.ParentId==i.ParentId}))return void(0==i.ParentId?location.hash="#":location.hash="#".concat(i.ParentId))}this.contents=this.rootNodes,this.files=this.contents.filter(function(e){return"FileArchiveFileViewModel"===e.NodeType}),this.folders=this.contents.filter(function(e){return"FileArchiveFolderViewModel"===e.NodeType}),this.currentNode=null,location.hash="#"},n.prototype.getFile=function(e){this.service.downloadFile(e,this.currentPage.Id)},n.prototype.openNewFolderDialog=function(){var e,t=this;this.checkPermission("CreateFolder")&&(e={parentNode:this.currentNode,service:this.service,isExplorer:!0,currentPage:this.currentPage},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveCreateNewFolder.modal.html",i.Modals.FileArchiveCreateNewFolderController,e,"md").result.then(function(e){t.childFolderIds.add(e.Id),t.navigate({})}))},n.prototype.openUploadFilesDialog=function(){var e,t=this;this.checkPermission("CreateFile")&&(e={parentNode:this.currentNode,service:this.service},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveUploadFiles.modal.html",i.Modals.FileArchiveUploadFilesController,e,"md").result.then(function(){return t.navigate({})}))},n.prototype.openDeleteDialog=function(){var e,t=this;!this.checkPermission("Delete")||this.selectedNodes.length<1||(e={selectedNodes:this.selectedNodes,isExplorer:!0,currentPageId:this.currentPage.Id,node:this.currentNode},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveDeleteNodes.modal.html",i.Modals.FileArchiveDeleteNodesController,e,"md").result.then(function(){return t.navigate({})}))}
1,n.prototype.openSetSortOrderDialog=function(){var e,t=this;this.checkPermission("SetSortOrder")&&(e={nodes:this.files.concat(this.folders),service:this.service},this.modalService.createModal("/App/CrossPortal/Archives/FileArchive/Modals/FileArchiveSetSortOrder.modal.html",i.Modals.FileArchiveSortOrderController,e,"md").result.then(function(){return t.navigate({})}))},n.prototype.isClickable=function(e){return!e.NodeTags.any(function(e){return"CompanyDepartmentPseudoRoot"==e.Tag})},n.prototype.checkPermission=function(e){if(this.isAdmin){if(this.currentNode&&"CreateFolder"==e&&"true"==this.allowFolderCreation)return!0;if(("Delete"==e||"Rename"==e)&&0<this.selectedNodes.length)return!0;if(this.currentNode&&"CreateFile"==e&&"true"==this.allowUploads)return!0;if("SetSortOrder"==e)return!0}return"CreateFolder"===e&&this.currentNode&&!this.selectedNodes.any()&&"true"==this.allowFolderCreation?this.currentNode.Permissions.any(function(e){return"EditSubFoldersPermission"===e}):"CreateFile"===e&&this.currentNode&&!this.selectedNodes.any()&&"true"==this.allowUploads?this.currentNode.Permissions.any(function(e){return"EditFilesPermission"===e}):"Rename"===e&&1===this.selectedNodes.length?this.selectedNodes.every(function(e){return e.IsUploadedByInteressent})||this.selectedNodes.every(function(e){return e.Permissions.any(function(e){return"EditFilesPermission"===e})}):"Delete"===e&&1===this.selectedNodes.length&&this.currentNode?this.selectedNodes.every(function(e){return!e.NodeTags.any(function(e){return"DepartmentStandardFolder"==e.Tag||"CompanyStandardFolder"==e.Tag})})&&this.currentNode.Permissions.any()&&this.currentNode.Permissions.any(function(e){return"DeleteFilesPermission"===e})||this.selectedNodes.every(function(e){return e.IsUploadedByInteressent}):"SetSortOrder"==e&&!this.selectedNodes.any()&&this.currentNode&&this.currentNode.Permissions.any(function(e){return"SetSortOrderPermission"===e})},n.prototype.canGoBack=function(){return!(!this.currentNode||0==this.path.length)},n.prototype.getIcon=function(e){return e.ShortcutForId?"fa-level-up":i.isFileArchiveFileViewModel(e)?this.fileService.getFileIconClass(e.Extension):"fa-folder-open"},n.$inject=["$scope","FileArchiveServiceFactory","ModalService","FileService","FileArchiveExplorerService","PageContentService","FeatureFlagService","UtilityService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Archives/FileArchive/FileArchiveExplorer/FileArchiveExplorer.component.html",this.bindings={startNodes:"<",allowFolderCreation:"@",allowUploads:"@",departments:"<",pseudoFolder:"<",childFolderIds:"<",companies:"<"}},app.component("fileArchiveExplorer",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.subscriptions=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={}),i.prototype.$onInit=function(){var t=this,e=(this.isFolder=this.nodes.any(function(e){return e&&"FileArchiveFolderViewModel"==e.NodeType}),this.serviceInstance.getPermissions(this.nodes,this.getAdditionalLevelOfPermissions));this.subscriptions.add(e.subscribe(function(e){e&&(e[0].RoleGroupPermissions.any()&&(e[0].RoleGroupPermissions=e[0].RoleGroupPermissions.orderBy(function(e){return e.RoleGroup.Name})),e[0].NotificationSettings.any()&&(e[0].NotificationSettings=e[0].NotificationSettings.orderBy(function(e){return e.RoleGroup.Name})),t.permissions=e[0],t.isFictionalNode=t.nodes.any(function(e){return e&&e.PseudoId&&e.IsPseudoHousing}),t.nodes&&t.nodes.every(function(e){return null!=e})&&(e=t.nodes.where(function(e){return null!=e.NodeTags}).reduce(function(e,t){return e.concat(t.NodeTags)},[]),t.departmentStandardFolder=e.any(function(e){return"DepartmentStandardFolder"==e.Tag}),t.companyStandardFolder=e.any(function(e){return"CompanyStandardFolder"==e.Tag})),t.itemType||(t.itemType=t.nodes.firstOrDefault().NodeType),"FileArchiveFileViewModel"==t.itemType&&t.permissions.RoleGroupPermissions.forEach(function(e){for(var t=e.Permissions.filter(function(e){return"EditFilesPermission"!=e.Alias&&"ReadFilesPermission"!=e.Alias}),i=0;i<t.length;i++)e.Permissions.remove(t[i])}),t.isFictionalNode&&(t.preventPermissionChange="FileArchiveFolderViewModel"==t.itemType&&(t.companyStandardFolder||t.departmentStandardFolder)),t.setSelectedPermissionsForNode())}))},i.prototype.$onDestroy=function(){this.subscriptions.dispose()},i.prototype.setSelectedPermissionsForNode=function(){var t=this;(this.departmentStandardFolder||this.companyStandardFolder)&&this.permissions.DepartmentPermissions.forEach(function(e){t.companyStandardFolder&&!t.getAdditionalLevelOfPermissions&&(e.Selected=t.isFictionalNode),t.departmentStandardFolder&&!t.getAdditionalLevelOfPermissions&&e.Departments.forEac
1h(function(e){return e.Selected=t.isFictionalNode})}),this.setPermissionForNode()},i.prototype.setPermissionForNode=function(){for(var e=0;e<this.nodes.length;e++)if(this.nodes[e]&&this.nodes[e].PseudoId)for(var t=this.nodes[e].PseudoId.split("_"),i=0;i<this.permissions.DepartmentPermissions.length;i++)if(this.permissions.DepartmentPermissions[i].CompanyId==Number(t[0])||-1==this.permissions.DepartmentPermissions[i].CompanyId)if(1===t.length)this.permissions.DepartmentPermissions[i].Selected=!0;else if(2===t.length)for(var n=0;n<this.permissions.DepartmentPermissions[i].Departments.length;n++){var o=this.permissions.DepartmentPermissions[i].Departments[n],r=Number(t[0]),s=Number(t[1]);o.CompanyId==r&&o.DepartmentId==s?o.Selected=!0:o.Selected=-1==r}},i.prototype.toggleAllRolePermissions=function(e){e.any(function(e){return!e.IsSelected})?e.forEach(function(e){return e.IsSelected=!0}):e.forEach(function(e){return e.IsSelected=!1})},i.prototype.allRolesToggled=function(e){return e.every(function(e){return e.IsSelected})},i.prototype.anyRolesToggled=function(e){return e.any(function(e){return e.IsSelected})},i.prototype.toggleAllDepartments=function(e){var t=this.allDepartmentsSelected(e);e.Departments.forEach(function(e){return e.Selected=!t})},i.prototype.allDepartmentsSelected=function(e){return e.Departments&&e.Departments.every(function(e){return e.Selected})},i.prototype.toggleAllCompanies=function(){var t=this.allCompaniesSelected();this.permissions.DepartmentPermissions.forEach(function(e){return e.Selected=!t})},i.prototype.allCompaniesSelected=function(){return this.permissions.DepartmentPermissions.every(function(e){return e.Selected})},t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Archives/FileArchive/FileArchivePermissionSelector.component.html",this.bindings={nodes:"=",serviceInstance:"<",getAdditionalLevelOfPermissions:"<",itemType:"<"}},app.component("filearchivePermissionSelector",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){var n=this;this.$modalInstance=e,this.loaderService=i,this.parentNode=t.parentNode,this.isExplore=t.isExplorer,t.currentPage&&(this.currentPageCompanyId=t.currentPage.CompanyIdFromCompanyDepartmentPage,this.currentPageDepartmentId=t.currentPage.DepartmentIdFromCompanyDepartmentPage,this.currentPageId=t.currentPage.Id),this.service=t.service,this.parentNode?this.service.getNodeTags(!1,this.parentNode.IsPseudoHousing).then(function(e){e&&(n.possibleNodeTags=e.NodeTagViewModels)}):this.service.getNodeTags(!1,!1).then(function(e){e&&(n.possibleNodeTags=e.NodeTagViewModels)}),this.newFolder={NodeTags:[]},this.isAdmin=this.service.isAdmin(),this.parentNode&&this.parentNode.PseudoId&&-1<this.parentNode.PseudoId.indexOf("-1")&&(this.checkAndSetTag("DepartmentStandardFolder"),this.checkAndSetTag("CompanyStandardFolder"),this.newFolder.IsPublic=this.newFolder.NodeTags.any(function(e){return"DepartmentStandardFolder"==e.Tag||"CompanyStandardFolder"==e.Tag}))}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.addOrRemoveTag=function(t){this.newFolder.NodeTags.every(function(e){return e.Tag!=t.Tag})?this.newFolder.NodeTags.add(t):this.newFolder.NodeTags.remove(t)},t.prototype.checkAndSetTag=function(t){this.parentNode&&this.parentNode.NodeTags.any(function(e){return e.Tag==t})&&this.newFolder.NodeTags.add(this.parentNode.NodeTags.firstOrDefault(function(e){return e.Tag==t}))},t.prototype.submit=function(e){var t,i,n,o=this;e.$valid?(t=this.loaderService.setLoader("submit","command"),i=this.parentNode?this.parentNode.Id:0,0<this.newFolder.Name.length?(n={CurrentNodeId:this.currentPageId,IsExplore:this.isExplore,Folder:this.newFolder},this.service.createFolder(i,n,this.currentPageCompanyId,this.currentPageDepartmentId).then(function(e){o.$modalInstance.close(e),o.loaderService.removeLoader(t)})):this.loaderService.removeLoader(t)):angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()}
1,t.$inject=["$uibModalInstance","modalData","LoaderService"],e.FileArchiveCreateNewFolderController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=t,this.loaderService=n,this.newParent=null,this.contents=[],this.path=[],this.subs=new Rx.CompositeDisposable,this.service=e.getInstance(),this.selectedNode=i.selectedNode}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.subs.add(this.service.content$.subscribe(function(e){e&&(t.contents=e.where(function(e){return"FileArchiveFolderViewModel"===e.NodeType&&!e.IsPseudoHousing})),t.loader&&t.loaderService.removeLoader(t.loader)})),this.navigate(0)},t.prototype.$onDestroy=function(){this.subs.dispose()},t.prototype.updateNodeSelection=function(e){this.newParent=e,this.contents.forEach(function(e){delete e.selected}),e.selected=!0},t.prototype.navigate=function(e,t){var i;this.loader=this.loaderService.setLoader("modal","getContent"),this.contents.forEach(function(e){delete e.selected}),t?-1<t.indexOf("_")?1===(i=t.split("_")).length?this.service.getContent(e,Number(i[0])):2===i.length?this.service.getContent(e,Number(i[0]),Number(i[1])):this.service.getContent(e):this.service.getContent(e,Number(t)):this.service.getContent(e)},t.prototype.goto=function(e){this.newParent=e,this.path.push(e),this.navigate(e.Id,e.PseudoId)},t.prototype.goBack=function(){var e=this.path.pop();this.newParent=e,this.navigate(e.ParentId,e.PseudoId)},t.prototype.submit=function(){var e,t=this;this.newParent&&(e=this.loaderService.setLoader("submit","command"),this.service.createShortcut(this.selectedNode,this.newParent).then(function(){t.loaderService.removeLoader(e),t.$modalInstance.close()}))},t.prototype.getIcon=function(e){return this.service.getIcon(e)},t.$inject=["FileArchiveServiceFactory","$uibModalInstance","modalData","LoaderService"],e.FileArchiveShortCutNodesController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){var o=this;this.$modalInstance=t,this.loaderService=n,this.shortcuts=[],this.selectedNodes=i.selectedNodes,this.currentPageId=i.currentPageId,this.isExplorer=i.isExplorer,this.node=i.node,this.fileArchiveService=e.getInstance(),this.isPseudoNode=this.selectedNodes.any(function(e){return e.IsPseudoHousing});for(var r=0;r<this.selectedNodes.length;r++)this.fileArchiveService.getShortcutsFornode(this.selectedNodes[r].Id).then(function(e){e&&o.shortcuts.addRange(e.FileArchiveNavigationViewModels)})}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.submit=function(){var e=this,t=this.loaderService.setLoader("submit","command"),i={CurrentPageId:this.currentPageId,IsExplore:this.isExplorer,NodeIds:this.selectedNodes.map(function(e){return e.Id})};this.fileArchiveService.deleteNodes(this.node,i).then(function(){e.loaderService.removeLoader(t),e.$modalInstance.close()})},t.prototype.getIcon=function(e){return this.fileArchiveService.getIcon(e)},t.$inject=["FileArchiveServiceFactory","$uibModalInstance","modalData","LoaderService"],e.FileArchiveDeleteNodesController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){var o=this;this.$modalInstance=e,this.utilityService=i,this.loaderService=n,this.updateShortcuts=!1,this.shortcuts=[],this.service=t.service,this.currentNode=t.selectedNode,this.updatedNode=angular.copy(t.selectedNode),this.simpleMode=t.simpleMode,this.format=i.shortDateFormat,this.service.getShortcutsFornode(this.currentNode.Id).then(function(e){e&&o.shortcuts.addRange(e.FileArchiveNavigationViewModels)})}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.open=function(e){e.preventDefault(),e.stopPropagation(),this.opened=!0},t.prototype.toggleUpdate=function(){this.updateShortcuts=!this.updateShortcuts},t.prototype.getIcon=function(e){return this.service.getIcon(e)},t.prototype.submit=function(e){var t,i=this;e.$valid?this.updatedNode&&this.updatedNode!==this.currentNode&&(t=this.loaderService.setLoader("submit","command"),this.service.updateNode(this.updatedNode,this.updateShortcuts).then(function(){i.loaderService.removeLoader(t),i.$modalInstance.close()})):angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},t.$inject=["$uibModalInstance","modalData","UtilityService","LoaderService"],e.FileArchiveEditNodeController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.loaderService=n,this.currentNodes=t.selectedNodes,this.service=i.getInstance(),this.isAdmin=this.service.isAdmin()}
1e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.toggleAdminProtection=function(){var t=this;this.currentNodes.forEach(function(e){return e.IsAdminProtected=!t.currentNodes[0].IsAdminProtected})},t.prototype.submit=function(){var e=this,t=this.loaderService.setLoader("submit","command");this.service.savePermissions(this.currentNodes,this.permissions).then(function(){e.loaderService.removeLoader(t),e.$modalInstance.close()})},t.$inject=["$uibModalInstance","modalData","FileArchiveServiceFactory","LoaderService"],e.FileArchiveEditPermissionsController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=t,this.loaderService=n,this.newParent=null,this.contents=[],this.path=[],this.subs=new Rx.CompositeDisposable,this.service=e.getInstance(),this.selectedNodes=i.selectedNodes}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.subs.add(this.service.content$.subscribe(function(e){e&&(t.contents=e.where(function(e){return"FileArchiveFolderViewModel"===e.NodeType&&!e.IsPseudoHousing})),t.loader&&t.loaderService.removeLoader(t.loader)})),this.navigate(0)},t.prototype.$onDestroy=function(){this.subs.dispose()},t.prototype.updateNodeSelection=function(e){this.newParent=e,this.contents.forEach(function(e){delete e.selected}),e.selected=!0},t.prototype.goBack=function(){var e=this.path.pop();this.newParent=null,this.navigate(e.ParentId,e.PseudoId)},t.prototype.getIcon=function(e){return this.service.getIcon(e)},t.prototype.navigate=function(e,t){var i;this.loader=this.loaderService.setLoader("modal","getContent"),this.contents.forEach(function(e){delete e.selected}),t?-1<t.indexOf("_")?1===(i=t.split("_")).length?this.service.getContent(e,Number(i[0])):2===i.length?this.service.getContent(e,Number(i[0]),Number(i[1])):this.service.getContent(e):this.service.getContent(e,Number(t)):this.service.getContent(e)},t.prototype.goto=function(t){this.newParent=t,this.path.push(t),this.selectedNodes.any(function(e){return e.Id==t.Id})||this.navigate(t.Id,t.PseudoId)},t.prototype.submit=function(){var e,t=this;this.newParent&&(e=this.loaderService.setLoader("submit","command"),this.service.relocateNodes(this.selectedNodes,this.newParent).then(function(){t.loaderService.removeLoader(e),t.$modalInstance.close()}))},t.$inject=["FileArchiveServiceFactory","$uibModalInstance","modalData","LoaderService"],e.FileArchiveRelocateNodesController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r){this.$modalInstance=e,this.$scope=i,this.loaderService=n,this.fileService=o,this.settingsService=r,this.tags=[],this.rawFileList=[],this.fileList=[],this.insertNewFilesAtTopInsteadOfBottom=!1,this.parentNode=t.parentNode,this.service=t.service,this.parentNode&&this.parentNode.PseudoId&&-1<this.parentNode.PseudoId.indexOf("-1")&&(this.checkAndSetTag("DepartmentStandardFolder"),this.checkAndSetTag("CompanyStandardFolder"))}e=(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.$scope.$watchCollection(function(){return t.rawFileList},function(e){e&&0<e.length&&(t.fileList.addRange(e.map(function(e){return t.fileService.toUploadedFile(e)})),t.rawFileList=[])}),this.settingsService.getConfiguration("FileArchiveConfiguration").subscribe(function(e){e&&e.Configurations.firstOrDefault(function(e){return"InsertNewFilesAtTopInsteadOfBottom"==e.Key})&&(t.insertNewFilesAtTopInsteadOfBottom=e.Configurations.firstOrDefault(function(e){return"InsertNewFilesAtTopInsteadOfBottom"==e.Key}).Value)})},t.prototype.checkAndSetTag=function(t){this.parentNode&&this.parentNode.NodeTags.any(function(e){return e.Tag==t})&&this.tags.add(this.parentNode.NodeTags.firstOrDefault(function(e){return e.Tag==t}))},t.prototype.getIcon=function(e){return this.service.getIcon(e)},t.prototype.removeFileFromList=function(e){this.fileList.splice(e,1)},t.prototype.editFilename=function(e){e.metadata.tempFilename=e.metadata.FileName,e.editing=!0},t.prototype.changeFilename=function(e){e.metadata.FileName=e.metadata.tempFilename,delete e.editing},t.prototype.cancelChangeFilename=function(e){delete e.editing},t.prototype.setUpPermissions=function(){this.showPermissions=!this.showPermissions},t.prototype.submit=function(){var e=this,t=this.loaderService.setLoader("submit","command");0<this.fileList.length&&this.service.uploadFiles(this.parentNode,this.fileList,this.tags).then(function(){e.loader
1Service.removeLoader(t),e.$modalInstance.close()})},t.$inject=["$uibModalInstance","modalData","$scope","LoaderService","FileService","SettingsService"],e.FileArchiveUploadFilesController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.dashboardService=e,this.disposables=new Rx.CompositeDisposable}(e=e.CrossPortal||(e.CrossPortal={})).Dashboard||(e.Dashboard={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.dashboardService.getCurrentUsersDashboardAreas(null).subscribe(function(e){e&&(t.currentUserAreas=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["DashboardService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Dashboard/Dashboard.component.html",this.bindings={}},app.component("dashboard",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/Dashboard/"}(e=e.CrossPortal||(e.CrossPortal={})).Dashboard||(e.Dashboard={}),t.prototype.getCurrentUsersDashboardAreas=function(e){var t=this,i=new Rx.Subject,n=this.loaderService.setLoader("contentSection","dashboard");return this.incomHttp.get(this.baseurl+"GetCurrentUsersDashboardAreas?nodeId="+e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.prototype.getDashboardContent=function(e){var t=this,i=new Rx.Subject,n=this.loaderService.setLoader("contentSection","dashboard");return this.incomHttp.get(this.baseurl+"GetDashboardContent?nodeId="+e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("DashboardService",t)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n){this.forumActivityService=e,this.fileService=t,this.userAssociationService=i,this.modalService=n,this.disposables=new Rx.CompositeDisposable,this.isPersonnel=!1}e=e.CrossPortal||(e.CrossPortal={}),(e=(i=e.Forum||(e.Forum={})).Dashboard||(i.Dashboard={})).ForumActivity||(e.ForumActivity={}),n.prototype.$onInit=function(){var n=this;this.forum&&this.disposables.add(this.forumActivityService.getForumLatestPost(this.forum.NodeId).subscribe(function(e){var i;e&&(n.latestPostWrapper=e,n.latestPost?(i=[],e.LatestForumPosts.forEach(function(t){var e=n.latestPost.firstOrDefault(function(e){return t.Id===e.Id}),e=n.latestPost.indexOf(e);-1<e?n.latestPost[e]=t:i.push(t)}),n.latestPost.addRange(i)):n.latestPost=e.LatestForumPosts,n.latestPost)&&0<n.latestPost.length&&(n.userAssociationService.getUserAssociationsForForum(n.latestPost.firstOrDefault().Id),n.disposables.add(n.userAssociationService.userAssociationsForForum$.first(function(e){return!!e&&e.PageId===n.latestPost.firstOrDefault().Id}).subscribe(function(e){e&&!n.userAssociations&&(n.userAssociations=e.UserAssociations.orderBy(function(e){return e.CompanyId&&e.DepartmentId}))})))}))},n.prototype.loadMore=function(){this.forumActivityService.getForumLatestPost(this.forum.NodeId,this.latestPost.length)},n.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},n.prototype.toggleIsFollowing=function(t){this.disposables.add(this.forumActivityService.toggleFollowPost(t.Id,t.Following).subscribe(function(e){t.Following=e}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.createPost=function(e){var t=this,e={categoryId:e,forumId:this.forum.NodeId,selectedUserAssociations:null,PostFromMyPage:!0};this.modalService.createModal("/App/CrossPortal/Forum/Modals/CreateForumPost.modal.html",i.Modals.CreateForumPostController,e,"lg").result.then(function(e){t.forumActivityService.getForumLatestPost(t.forum.NodeId,0,t.latestPost.length),t.latestPost=[]})},n.$inject=["ForumActivityService","FileService","UserAssociationService","ModalService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Forum/Dashboard/ForumActivity/ForumActivity.component.html",this.bindings={forum:"<"}},app.component("forumActivity",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.boardInquiriesService=e,this.formService=t,this.$scope=i,this.maxFiles=1,this.maxTotalSize=10240,this.disposables=new Rx.CompositeDisposable,this.createNew=!1}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).BoardInquiries||(e.BoardInquiries={})).BoardChat||(e.BoardChat={}),i.prototype.$onInit=function(){var i=this;this.postInquiry=angular.copy(this.inquiry),this.$scope.$watch(function(){return i.inquiry},function(e,t){e&&e!==t&&(i.postInquiry=angular.copy(i.inquiry))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.updateInquiry=function(){var e=JSON.parse(JSON.stringify(this.boardForm));this.createNew?this.boardInquiriesService.createInquiry(e,this.uploadedFiles):(this.postInquiry.Messages.add({Message:e.Message}),this.isBoard?this.boardInquiriesService.updateInquiryBoardMember(this.postInquiry,this.uploadedFiles):this.boardInquiriesService.updateInquiryTenant(this.postInquiry,this.uploadedFiles)),this.formService.clearFields(this.form),this.createNew=!1},i.prototype.markInquiryAsCompleted=function(e){e.show=!1,e.IsClosed=!0,this.boardInquiriesService.markInquiryAsCompleted(e)},i.prototype.getFile=function(e){this.boardInquiriesService.downloadFile(e)},i.$inject=["BoardInquiriesService","FormService","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/BoardInquiries/BoardChat/BoardChat.component.html",this.bindings={isBoard:"<",inquiry:"<",completed:"<",createNew:"="}},app.component("boardChat",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.tenantListService=e,this.disposeables=new Rx.CompositeDisposable,this.sort=""}(e=e.BoardPortal||(e.BoardPortal={})).TenantList||(e.TenantList={}),i.prototype.$onInit=function(){var t=this;this.tenantListService.getCompanyDepartmentDropdown(),this.disposeables.add(this.tenantListService.applicableCompanyAndDepartments$.subscribe(function(e){e&&(t.selectedDepartment=e[0],t.applicableDepartments=e)})),this.disposeables.add(this.tenantListService.tenants$.subscribe(function(e){e&&(t.currentList=t.tenants=e.Tenants||[],t.movingTenants=e.MovingTenants||[],t.movedTenants=e.MovedTenants||[],t.setSort("TenancyNo"))}))},i.prototype.setSort=function(e){var i=this;switch(this.sort===e?this.sort="-"+e:this.sort=e,this.sort){case"TenancyNo":this.currentList=this.currentList.orderBy(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId}),this.tenants=this.tenants.orderBy(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId}),this.movingTenants=this.movingTenants.orderBy(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId}),this.movedTenants=this.movedTenants.orderBy(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId});break;case"-TenancyNo":this.currentList=this.currentList.orderByDescending(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId}),this.tenants=this.tenants.orderByDescending(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId}),this.movingTenants=this.movingTenants.orderByDescending(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId}),this.movedTenants=this.movedTenants.orderByDescending(function(e){return e.Tenancy.CompanyId&&e.Tenancy.DepartmentId&&e.Tenancy.TenancyId});break;case"Address":this.currentList.sort(this.alphanumSort),this.tenants.sort(this.alphanumSort),this.movingTenants.sort(this.alphanumSort),this.movedTenants.sort(this.alphanumSort);break;case"-Address":this.currentList.sort(function(e,t){return i.alphanumSort(t,e)}),this.tenants.sort(function(e,t){return i.alphanumSort(t,e)}),this.movingTenants.sort(function(e,t){return i.alphanumSort(t,e)}),this.movedTenants.sort(function(e,t){return i.alphanumSort(t,e)});break;case"MoveInDate":this.currentList=this.currentList.orderBy(function(e){return e.MoveInDate}),this.tenants=this.tenants.orderBy(function(e){return e.MoveInDate}),this.movingTenants=this.movingTenants.orderBy(function(e){return e.MoveInDate}),this.movedTenants=this.movedTenants.orderBy(function(e){return e.MoveInDate});break;case"-MoveInDate":this.currentList=this.currentList.orderByDescending(function(e){return e.MoveInDate}),this.tenants=this.tenants.orderByDescending(function(e){return e.MoveInDate}),this.movingTenants=this.movingTenants.orderByDescending(function(e){return e.MoveInDate}),this.movedTenants=this.movedTenants.orderByDescending(function(e){return e.MoveInDate});break;case"AvaliableDate":this.currentList=this.currentList.orderBy(function(e){return e.AvailableDate}),this.movingTenants=this.movingTenants.orderBy(function(e){return e.AvailableDate});break;case"-AvaliableDate":this.currentList=this.currentList.orderByDescending(function(e){return e.AvailableDate}),this.movingTenants=this.movingTenants.orderByDescending(function(e){return e.AvailableDate});break;case"MoveOutDate":this.currentList=this.currentList.orderBy(function(e){return e.MoveOutDate||"-1"}),this.movingTenants=this.movingTenants.orderBy(function(e){return e.MoveOutDate||"-1"}),this.movedTenants=this.movedTenants.orderBy(function(e){return e.MoveOutDate||"-1"});break;case"-MoveOutDate":this.currentList=this.currentList.orderByDescending(function(e){return e.MoveOutDate||"-1"}),this.movingTenants=this.movingTenants.orderByDescending(function(e){return e.MoveOutDate||"-1"}),this.movedTenants=this.movedTenants.orderByDescending(function(e){return e.MoveOutDate||"-1"})}},i.prototype.setList=function(e){switch(this.currentList=[],e){case"tenants":this.currentList.addRange(this.tenants),this.currentlyShowing="tenants";case"movingTenants":this.currentList.addRange(this.movingTenants),this.currentlyShowing="movingTenants";case"movedTenants":this.currentList.addRange(this.movedTenants),this.currentlyShowing="movedTenants"}},i.prototype.selectedCompanyDepartmentChanged=function(e){e!==this.selectedDepartment&&(this.selectedDepartment=e,this.tenantListService.getTenantListForDepartment(this.selectedDepartment.CompanyId,this.selectedDepartment.DepartmentId))},i.prototype.alphanumSort=function(e,t){e=e.Address.Street+e.Address.Location,t=t.Address.Street+t.Address.Location;function i(e){for(var t,i=[],n=0,o=-1,r=0;
1s=(t=e.charAt(n++)).charCodeAt(0);){var s=46==s||48<=s&&s<=57;s!==r&&(i[++o]="",r=s),i[o]+=t}return i}for(var n,o,r=i(e),s=i(t),a=0;r[a]&&s[a];a++)if(r[a]!==s[a])return n=Number(r[a]),o=Number(s[a]),n==r[a]&&o==s[a]?n-o:r[a]>s[a]?1:-1;return r.length-s.length},i.prototype.$onDestroy=function(){this.disposeables.dispose()},i.$inject=["TenantListService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/BoardPortal/TenantList/TenantList.Component.html"},app.component("tenantList",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/TenantList/",this.applicableCompanyAndDepartments$=new Rx.BehaviorSubject(null),this.tenants$=new Rx.BehaviorSubject(null)}(e=e.BoardPortal||(e.BoardPortal={})).TenantList||(e.TenantList={}),t.prototype.getCompanyDepartmentDropdown=function(){var i=this,n=this.loaderService.setLoader("contentSection","getDepartments");this.incomHttp.get("".concat(this.baseurl,"GetApplicableCompanyAndDepartments")).then(function(e){var t=e.CompanyDepartmentDropdownItemViewModels.firstOrDefault(function(e){return!e.IsCompany});i.getTenantListForDepartment(t.CompanyId,t.DepartmentId),i.applicableCompanyAndDepartments$.onNext(e.CompanyDepartmentDropdownItemViewModels),i.loaderService.removeLoader(n)})},t.prototype.getTenantListForDepartment=function(e,t,i){var n=this,o=(void 0===i&&(i=!1),this.loaderService.setLoader("tenant-list","list"));this.incomHttp.get("".concat(this.baseurl,"GetTenantListForDepartment?companyId=").concat(e,"&departmentId=").concat(t,"&includeBiTenancy=").concat(i)).then(function(e){n.tenants$.onNext(e),n.loaderService.removeLoader(o)})},t.$inject=["incomHttpService","LoaderService"],app.service("TenantListService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.boardInquiriesService=e,this.writingNew=!1,this.disposables=new Rx.CompositeDisposable,this.showCompleted=!1,this.currentPage=0,this.currentPageClosed=0,this.entryLimit=5}(e=e.CrossPortal||(e.CrossPortal={})).BoardInquiries||(e.BoardInquiries={}),i.prototype.$onInit=function(){var t=this;this.isBoard?this.boardInquiriesService.getInquiresForBoardMember(!0):this.boardInquiriesService.getInquiresForTenant(),this.disposables.add(this.boardInquiriesService.inquiries$.subscribe(function(e){null!=e&&(t.inquries?t.setShown(e):t.inquries=e.Inquiries.filter(function(e){return!e.IsClosed}),t.closedInquries=e.Inquiries.filter(function(e){return e.IsClosed}))}))},i.prototype.setShown=function(e){for(var t=-1,i=0;i<this.inquries.length;i++)this.inquries[i].show&&(t=i);this.inquries=e.Inquiries.filter(function(e){return!e.IsClosed}),0<=t&&t<this.inquries.length&&(this.inquries[t].show=!0)},i.prototype.showThis=function(e){var t=!e.show;this.inquries.forEach(function(e){e.show=!1}),e.show=t},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.updatePageClosed=function(e){this.currentPageClosed=e},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["BoardInquiriesService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/BoardInquiries/BoardInquiries.component.html",this.bindings={isBoard:"<"}},app.component("boardInquiries",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.inquiries$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/BoardInquiries/"}(e=e.CrossPortal||(e.CrossPortal={})).BoardInquiries||(e.BoardInquiries={}),t.prototype.createInquiry=function(e,t){var i=this;this.fileService.postWithFiles(e,this.baseurl+"CreateInquiry/",t).then(function(e){i.getInquiresForTenant()})},t.prototype.getInquiresForBoardMember=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getInquiries");this.incomHttp.get(this.baseurl+"GetInquiresForBoardMember?includeDeleted="+e).then(function(e){t.inquiries$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getInquiresForTenant=function(){var t=this,i=this.loaderService.setLoader("contentSection","getInquiries");this.incomHttp.get(this.baseurl+"GetInquiresForTenant").then(function(e){t.inquiries$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.markInquiryAsCompleted=function(e){var t=this.loaderService.setLoader("contentSection","markAsCompleted");this.incomHttp.post(this.baseurl+"MarkInquiryAsCompleted",e),this.getInquiresForBoardMember(!0),this.loaderService.removeLoader(t)},t.prototype.updateInquiryTenant=function(e,t){var i=this;this.fileService.postWithFiles(e,this.baseurl+"UpdateInquiryTenant/",t).then(function(e){i.getInquiresForTenant()})},t.prototype.updateInquiryBoardMember=function(e,t){var i=this;this.fileService.postWithFiles(e,this.baseurl+"UpdateInquiryBoardMember/",t).then(function(e){i.getInquiresForBoardMember(!1)})},t.prototype.downloadFile=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getFile");this.incomHttp.get(this.baseurl+"GetFile/"+e).then(function(e){t.loaderService.removeLoader(i),t.fileService.downloadFile([e])})},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("BoardInquiriesService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.boardCalendarService=e,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Dashboard||(e.Dashboard={})).BoardCalendar||(e.BoardCalendar={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.boardCalendarService.getBoardCalendarEvent(1).subscribe(function(e){e&&(t.calendar=e,t.createLink=t.calendar.Url+"#NewEvent=true")}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["BoardCalendarService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Calendar/Dashboard/BoardCalendar/BoardCalendar.component.html",this.bindings={}},app.component("boardCalendar",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/ForumActivity/",this.forumLatestPost$=new Rx.ReplaySubject}(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).Dashboard||(e.Dashboard={})).ForumActivity||(e.ForumActivity={}),t.prototype.getForumLatestPost=function(t,e,i){var n=this,o=(void 0===e&&(e=0),void 0===i&&(i=3),this.loaderService.setLoader("forumActivity","getlatestpost"));return this.incomHttp.post(this.baseurl+"GetLatestForumPost",{NodeId:t,AmountToSkip:e,AmountToTake:i}).then(function(e){n.forumLatestPost$.onNext(e),n.loaderService.removeLoader(o)}),this.forumLatestPost$.filter(function(e){return e.NodeId===t})},t.prototype.toggleFollowPost=function(e,t){var i=new Rx.Subject;return this.incomHttp.get(this.baseurl+"ToggleFollowPost?id="+e+"&isFollowing="+t).then(function(e){i.onNext(e)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("ForumActivityService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.pbsBannerService=e,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Pbs||(e.Pbs={})).Dashboard||(e.Dashboard={})).PbsBanner||(e.PbsBanner={}),i.prototype.$onInit=function(){var t=this;this.pbsBannerService.getPbsBanner().then(function(e){t.pbsBanner=e})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.hidePbsBanner=function(){this.pbsBannerService.hidePbsBanner(),this.pbsBanner=null},i.$inject=["PbsBannerService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Pbs/Dashboard/PbsBanner/PbsBanner.component.html",this.bindings={}},app.component("pbsBanner",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/FrontEndEditCalendar/",this.calendarCategories$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),t.prototype.createCalendarCategory=function(e,t){var i=this,n=this.loaderService.setLoader("global","createCategory");this.incomHttp.post(this.baseurl+"CreateCalendarCategory/"+t,e).then(function(e){i.calendarCategories$.onNext(e.CmsCalendarCategories),i.loaderService.removeLoader(n)})},t.$inject=["incomHttpService","LoaderService"],app.service("FrontEndEditCalendarService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.frontEndEditUtilityService=e,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.updatePageToDelete=function(e){this.frontEndEditUtilityService.pageToDelete$.onNext(e)},i.$inject=["FrontEndEditUtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/FrontEndEditDeletePageChildren.component.html",this.bindings={deletablePages:"<"}},app.component("frontEndEditDeletePageChildren",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.frontEndEditServiceInstance=e,this.windowService=t,this.pageContentService=i,this.frontEndEditUtilityService=n,this.frontEndEditPermissionService=o,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),i.prototype.$onInit=function(){var t=this;this.frontEndEditService=this.frontEndEditServiceInstance.getInstance(),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.frontEndEditPermissionService.getCurrentUsersPermissions(e.Id)}),this.disposables.add(this.frontEndEditUtilityService.deletablePages$.subscribe(function(e){null!=e&&(t.deletablePages=e)})),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)})),this.disposables.add(this.frontEndEditUtilityService.pageToDelete$.subscribe(function(e){e&&(e.Delete?t.setSubPagesAsDelete(e.FrontEndEditPages):t.markParentAsNotDeleted(t.deletablePages,e))})),this.frontEndEditUtilityService.getDeletablePages(this.currentPage.Id)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.setSubPagesAsDelete=function(e){for(var t=0;t<e.length;t++)e[t].Delete=!0,this.setSubPagesAsDelete(e[t].FrontEndEditPages)},i.prototype.markParentAsNotDeleted=function(e,t){for(var i=0;i<e.length;i++)this.isDirectParent(e[i],t)?(e[i].Delete=!1,this.frontEndEditUtilityService.pageToDelete$.onNext(e[i])):this.markParentAsNotDeleted(e[i].FrontEndEditPages,t)},i.prototype.isDirectParent=function(e,t){return e.FrontEndEditPages.any(function(e){return e.Id===t.Id})},i.prototype.back=function(){this.pageContentService.resetPageEditing()},i.prototype.deletePages=function(){confirm("Er du sikker på du ønsker at slette de markerede sider?")&&this.frontEndEditUtilityService.deletePages(this.deletablePages,this.currentPage.Id)},i.$inject=["FrontEndEditService","$window","PageContentService","FrontEndEditUtilityService","FrontEndEditPermissionService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/FrontEndEditDeletePages.component.html",this.bindings={}},app.component("frontEndEditDeletePages",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/FrontEndEditNews/",this.newsCategories$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),t.prototype.createNewsCategory=function(e,t){var i=this,n=this.loaderService.setLoader("global","createCategory");this.incomHttp.post(this.baseurl+"CreateNewsCategory/"+t,e).then(function(e){i.newsCategories$.onNext(e.CmsNewsCategories),i.loaderService.removeLoader(n)})},t.$inject=["incomHttpService","LoaderService"],app.service("FrontEndEditNewsService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/FrontEndEditPermission/",this.availableContentTypes$=new Rx.BehaviorSubject(null),this.userFrontEndEditPermission$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),t.prototype.getAvailablePageTypes=function(e){var t=this,i=this.loaderService.setLoader("global","getPageTypes");this.incomHttp.get(this.baseurl+"GetAvailablePageTypes/"+e).then(function(e){t.availableContentTypes$.onNext(e.PageTypes),t.loaderService.removeLoader(i)})},t.prototype.getCurrentUsersPermissions=function(e){var t=this;this.incomHttp.get(this.baseurl+"GetCurrentUsersPermissions/"+e).then(function(e){t.userFrontEndEditPermission$.onNext(e)})},t.$inject=["incomHttpService","LoaderService"],app.service("FrontEndEditPermissionService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/FrontEndEditSortableChildren.component.html",this.bindings={sortablePages:"<"}},app.component("frontEndEditSortableChildren",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.frontEndEditServiceInstance=e,this.windowService=t,this.pageContentService=i,this.frontEndEditUtilityService=n,this.frontEndEditPermissionService=o,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),i.prototype.$onInit=function(){var t=this;this.frontEndEditService=this.frontEndEditServiceInstance.getInstance(),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.frontEndEditPermissionService.getCurrentUsersPermissions(e.Id)}),this.disposables.add(this.frontEndEditUtilityService.sortablePages$.subscribe(function(e){null!=e&&(t.sortablePages=e)})),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)})),this.frontEndEditUtilityService.getSortablePages(this.currentPage.Id)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.back=function(){this.pageContentService.resetPageEditing()},i.prototype.saveSortOrder=function(){this.frontEndEditUtilityService.saveSortedPages(this.sortablePages,this.currentPage.Id)},i.$inject=["FrontEndEditService","$window","PageContentService","FrontEndEditUtilityService","FrontEndEditPermissionService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/FrontEndEditSortPages.component.html",this.bindings={}},app.component("frontEndEditSortPages",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.siteMenuService=i,this.baseurl="/umbraco/api/FrontEndEditUtility/",this.editorConfig$=new Rx.BehaviorSubject(null),this.savedPage$=new Rx.Subject,this.pageToDelete$=new Rx.BehaviorSubject(null),this.sortablePages$=new Rx.BehaviorSubject(null),this.deletablePages$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),t.prototype.getDefaultEditorConfig=function(){var t=this;return this.incomHttp.get(this.baseurl+"GetGridEditorConfig/").then(function(e){t.editorConfig$.onNext(e.GridEditors)}),this.editorConfig$},t.prototype.getSortablePages=function(e){var t=this,i=this.loaderService.setLoader("feeSortablePages","getSortablePages");this.incomHttp.get(this.baseurl+"GetSortablePages/"+e).then(function(e){t.sortablePages$.onNext(e.FrontEndEditPages),t.loaderService.removeLoader(i)})},t.prototype.saveSortedPages=function(e,t){for(var i=this,n=this.loaderService.setLoader("global","saveSortedPages"),o=0;o<e.length;o++)e[o].SortOrder=o;this.incomHttp.post(this.baseurl+"SaveSortedPages/"+t,{FrontEndEditPages:e}).then(function(){i.getSortablePages(t),i.loaderService.removeLoader(n)})},t.prototype.deletePages=function(e,t){var i=this,n=this.loaderService.setLoader("global","deletePages");this.incomHttp.post(this.baseurl+"/DeletePages/"+t,{FrontEndEditPages:e}).then(function(e){e===t&&i.getDeletablePages(t),i.loaderService.removeLoader(n)})},t.prototype.getDeletablePages=function(e){var t=this,i=this.loaderService.setLoader("feeDeletePages","getDeletablePages");this.incomHttp.get(this.baseurl+"GetDeletablePages/"+e).then(function(e){t.deletablePages$.onNext(e.FrontEndEditPages),t.loaderService.removeLoader(i)})},t.prototype.deletePage=function(e){var t=this,i=this.loaderService.setLoader("global","deletePages");this.incomHttp.delete(this.baseurl+"DeletePage/"+e).then(function(){t.loaderService.removeLoader(i)})},t.prototype.updateSavedPage=function(e){this.savedPage$.onNext(e)},t.$inject=["incomHttpService","LoaderService","SiteMenuService"],app.service("FrontEndEditUtilityService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.departmentNewsListService=e,this.owlCarouselOptionsService=t,this.definitionHelper=i,this.disposables=new Rx.CompositeDisposable,this.departmentNewsListLoaded=!1}
1(e=(e=(e=(e=e.General||(e.General={})).News||(e.News={})).Dashboard||(e.Dashboard={})).DepartmentNews||(e.DepartmentNews={})).DepartmentNewsList||(e.DepartmentNewsList={}),i.prototype.$onInit=function(){var t=this;this.entryLimit||(this.entryLimit=3),this.disposables.add(this.departmentNewsListService.getDepartmentNewsList(this.entryLimit).subscribe(function(e){e&&(t.useDepartmentNewsSlider&&setTimeout(function(){var e=$(".owl-newslist.departmentnews");t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions(),t.options.lazyLoad=!0,t.options.animateOut="fadeOut",t.options.animateIn="fadeIn",t.options.nav=!0,t.options.loop=!1,t.options.mouseDrag=!1,t.options.touchDrag=!1),e.on("translate.owl.carousel",function(e){$(".news-index").text(e.item.index+1)}),e.on("initialized.owl.carousel",function(e){$(".news-index").text(e.item.index+1)}),e.owlCarousel(t.options)},150),t.departmentNewsList=e,t.newsItems=t.departmentNewsList.NewsItems),t.departmentNewsListLoaded=!0}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getDefinitionSeperator=function(e){return this.definitionHelper.getDefinitionSeperator(e)},i.$inject=["DepartmentNewsListService","OwlCarouselOptionsService","ImageDefinitionHelperService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/News/Dashboard/DepartmentNews/DepartmentNewsList/DepartmentNewsList.component.html",this.bindings={entryLimit:"<",useDepartmentNewsSlider:"<"}},app.component("departmentNewsList",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.loaderService=t,this.fileService=i,this.baseUrl="/Umbraco/api/Crosswork/",this.crosswork$=new Rx.BehaviorSubject(null)}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Documents||(e.Documents={})).Crosswork||(e.Crosswork={}),t.prototype.getCrosswork=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getCrosswork");this.$http.post("".concat(this.baseUrl,"GetCrossworks"),e).then(function(e){t.crosswork$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getCrossworkFile=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getFile");this.$http.post("".concat(this.baseUrl,"GetCrossworkFile"),e).then(function(e){t.fileService.downloadFile([e]),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("CrossworkService",t)}(BoligExtra=BoligExtra||{}),!function(BoligExtra){var CrossPortal;!function(CrossPortal){var Documents;!function(Documents){var Crosswork;!function(Crosswork){var CrossworkDepartmentController=function(){function CrossworkDepartmentController(e,t,i){this.crossworkService=e,this.utilityService=t,this.fileService=i}return CrossworkDepartmentController.prototype.$onInit=function(){for(var _this=this,queryKey=this.utilityService.getParameterByName("key").split("_"),categories=[],categoriesList=eval(this.categoriesList),i=0;i<categoriesList.length;i++)categories.add({CategoryNo1:categoriesList[i][0],CategoryNo2:categoriesList[i][1]});var inputmodel={CompanyId:Number(queryKey[0]),DepartmentId:Number(queryKey[1]),GetForBothUserAndDepartment:!1,Categories:categories};this.crossworkService.getCrosswork(inputmodel),this.subscription=this.crossworkService.crosswork$.subscribe(function(e){_this.crossworks=e.Crossworks})},CrossworkDepartmentController.prototype.$onDestroy=function(){this.subscription.dispose()},CrossworkDepartmentController.prototype.getFileIconClass=function(e){return this.fileService.getFileIconClass(e)},CrossworkDepartmentController.prototype.downloadFile=function(e){this.crossworkService.getCrossworkFile(e)},CrossworkDepartmentController.$inject=["CrossworkService","UtilityService","FileService"],CrossworkDepartmentController}(),CrossworkDepartmentComponent=function(){this.controller=CrossworkDepartmentController,this.templateUrl="/App/CrossPortal/Documents/Crosswork/Crosswork.component.html",this.bindings={categoriesList:"<"}};app.component("crossworkDepartmentComponent",new CrossworkDepartmentComponent)}(Crosswork=Documents.Crosswork||(Documents.Crosswork={}))}(Documents=CrossPortal.Documents||(CrossPortal.Documents={}))}(CrossPortal=BoligExtra.CrossPortal||(BoligExtra.CrossPortal={}))}(BoligExtra=BoligExtra||{}),!function(BoligExtra){var CrossPortal;!function(CrossPortal){var Documents;!function(Documents){var Crosswork;!function(Crosswork){var CrossworkUserController=function(){function CrossworkUserController(e,t){this.crossworkService=e,this.fileService=t}return CrossworkUserController.prototype.$onInit=function(){for(var _this=this,categories=[],categoriesList=eval(this.categoriesList),i=0;i<categoriesList.length;i++)categories.add({CategoryNo1:categoriesList[i][0],CategoryNo2:categoriesList[i][1]});var inputmodel={CompanyId:null,DepartmentId:null,GetForBothUserAndDepartment:this.getForBothUserAndDepartment,Categories:categories};this.crossworkService.getCrosswork(inputmodel),this.subscription=this.crossworkService.crosswork$.subscribe(function(e){_this.crossworks=e.Crossworks})},CrossworkUserController.prototype.$onDestroy=function(){this.subscription.dispose()},CrossworkUserController.prototype.downloadFile=function(e){this.crossworkService.getCrossworkFile(e)},CrossworkUserController.prototype.getFileIconClass=function(e){return this.fileService.getFileIconClass(e)},CrossworkUserController.$inject=["CrossworkService","FileService"],CrossworkUserController}(),CrossworkUserComponent=function(){this.controller=CrossworkUserController,this.templateUrl="/App/CrossPortal/Documents/Crosswork/Crosswork.component.html",this.bindings={categoriesList:"<",getForBothUserAndDepartment:"<"}};app.component("crossworkUserComponent",new CrossworkUserComponent)}(Crosswork=Documents.Crosswork||(Documents.Crosswork={}))}(Documents=CrossPortal.Documents||(CrossPortal.Documents={}))}(CrossPortal=BoligExtra.CrossPortal||(BoligExtra.CrossPortal={}))}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.loaderService=t,this.fileService=i,this.baseUrl="/Umbraco/api/WebDok/",this.webDok$=new Rx.BehaviorSubject(null)}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Documents||(e.Documents={})).WebDok||(e.WebDok={}),t.prototype.getWebDok=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getWebdok");this.$http.post("".concat(this.baseUrl,"GetWebDokFor"),e).then(function(e){t.webDok$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getWebDokFile=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getFile");this.$http.post("".concat(this.baseUrl,"GetWebDokFile"),e).then(function(e){t.loaderService.removeLoader(i),t.fileService.downloadFile([e])})},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("WebDokService",t)}(BoligExtra=BoligExtra||{}),!function(BoligExtra){var CrossPortal;!function(CrossPortal){var Documents;!function(Documents){var WebDok;!function(WebDok){var WebDokDepartmentController=function(){function WebDokDepartmentController(e,t,i){this.webDokService=e,this.utilityService=t,this.fileService=i}return WebDokDepartmentController.prototype.$onInit=function(){var _this=this,queryKey=this.utilityService.getParameterByName("key").split("_");if(this.categoriesList)for(var categories=[],categoriesList=eval(this.categoriesList),i=0;i<categoriesList.length;i++)categories.add({Id:categoriesList[i]});var inputmodel={CompanyId:Number(queryKey[0]),DepartmentId:Number(queryKey[1]),GetForBothUserAndDepartment:!1,From:null,Categories:categories};this.webDokService.getWebDok(inputmodel),this.subscription=this.webDokService.webDok$.subscribe(function(e){_this.webdoks=e})},WebDokDepartmentController.prototype.getFileIconClass=function(e){return this.fileService.getFileIconClass(e)},WebDokDepartmentController.prototype.downloadFile=function(e){this.webDokService.getWebDokFile(e)},WebDokDepartmentController.prototype.$onDestroy=function(){this.subscription.dispose()},WebDokDepartmentController.$inject=["WebDokService","UtilityService","FileService"],WebDokDepartmentController}(),WebDokDepartmentComponent=function(){this.controller=WebDokDepartmentController,this.templateUrl="/App/CrossPortal/Documents/WebDok/WebDok.component.html",this.bindings={categoriesList:"<"}};app.component("webDokDepartmentComponent",new WebDokDepartmentComponent)}(WebDok=Documents.WebDok||(Documents.WebDok={}))}(Documents=CrossPortal.Documents||(CrossPortal.Documents={}))}(CrossPortal=BoligExtra.CrossPortal||(BoligExtra.CrossPortal={}))}(BoligExtra=BoligExtra||{}),!function(BoligExtra){var CrossPortal;!function(CrossPortal){var Documents;!function(Documents){var WebDok;!function(WebDok){var WebDokUserController=function(){function WebDokUserController(e,t,i){this.webDokService=e,this.fileService=t,this.featureFlags=i}return WebDokUserController.prototype.$onInit=function(){for(var _this=this,categories=(this.showCategoryName=this.featureFlags.webDok.displayCategoryName,[]),categoriesList=eval(this.categoriesList),i=0;i<categoriesList.length;i++)categories.add({Id:categoriesList[i]});var inputmodel={CompanyId:null,DepartmentId:null,GetForBothUserAndDepartment:this.getForBothUserAndDepartment,From:null,Categories:categories};this.webDokService.getWebDok(inputmodel),this.subscription=this.webDokService.webDok$.subscribe(function(e){_this.webdoks=e})},WebDokUserController.prototype.getFileIconClass=function(e){return this.fileService.getFileIconClass(e)},WebDokUserController.prototype.downloadFile=function(e){this.webDokService.getWebDokFile(e)},WebDokUserController.prototype.$onDestroy=function(){this.subscription.dispose()},WebDokUserController.$inject=["WebDokService","FileService","FeatureFlagService"],WebDokUserController}(),WebDokUserComponent=function(){this.controller=WebDokUserController,this.templateUrl="/App/CrossPortal/Documents/WebDok/WebDok.component.html",this.bindings={categoriesList:"<",getForBothUserAndDepartment:"<"}};app.component("webDokUserComponent",new WebDokUserComponent)}(WebDok=Documents.WebDok||(Documents.WebDok={}))}(Documents=CrossPortal.Documents||(CrossPortal.Documents={}))}(CrossPortal=BoligExtra.CrossPortal||(BoligExtra.CrossPortal={}))}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o){this.forumService=e,this.fileService=t,this.modalService=i,this.userAssociationService=n,this.pageContentService=o,this.disposables=new Rx.CompositeDisposable,this.selectedUserAssociations=null}e=e.CrossPortal||(e.CrossPortal={}),(i=e.Forum||(e.Forum={})).Category||(i.Category={}),n.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.page=e,t.userAssociationService.getUserAssociationsForForum(e.Id))}),this.disposables.add(this.userAssociationService.userAssociationsForForum$.first(function(e){return!!e&&e.PageId===t.page.Id}).subscribe(function(e){e&&!t.userAssociations&&(t.userAssociations=e.UserAssociations.orderBy(function(e){return e.CompanyId&&e.DepartmentId}),t.ignoreUserAssociation=e.IgnoreUserAssociation)})),this.disposables.add(this.forumService.categoryPosts$.subscribe(function(e){e&&t.userAssociations&&(t.posts=e,t.ignoreUserAssociation?t.sortedPosts=t.posts.orderByDescending(function(e){return e.CreatedDate}):null==t.selectedUserAssociations?t.sortedPosts=t.posts.orderByDescending(function(e){return e.CreatedDate}):null!=t.selectedUserAssociations?t.selectedCompanyDepartmentChange():null!=t.userAssociations&&1===t.userAssociations.length&&(t.selectedUserAssociations=t.userAssociations.firstOrDefault(),t.selectedCompanyDepartmentChange()))}
1))},n.prototype.$onChanges=function(e){e.category&&this.forumService.getPostsByCategory(this.category.Id)},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.createPost=function(){var t=this,e={categoryId:this.category.Id,selectedUserAssociations:this.selectedUserAssociations,PostFromMyPage:!1};this.modalService.createModal("/App/CrossPortal/Forum/Modals/CreateForumPost.modal.html",i.Modals.CreateForumPostController,e,"lg").result.then(function(e){e!==t.category.Id?t.onPostCreated({categoryId:e}):(t.sortedPosts=null,t.forumService.getPostsByCategory(t.category.Id))})},n.prototype.markPostAsRead=function(e){this.forumService.markPostRead(e.Id).then(function(){e.Seen=!0})},n.prototype.editPost=function(e){var t=this,e={categoryId:this.category.Id,post:e,selectedUserAssociations:this.selectedUserAssociations,PostFromMyPage:!1};this.modalService.createModal("/App/CrossPortal/Forum/Modals/CreateForumPost.modal.html",i.Modals.CreateForumPostController,e,"lg").result.then(function(e){t.forumService.getPostsByCategory(t.category.Id)})},n.prototype.toggleFollowing=function(e){this.forumService.toggleFollowPost(e)},n.prototype.deletePost=function(t){var e=this;confirm("Er du sikker på du vil slette dette indlæg?")&&this.forumService.deletePost(t).then(function(){e.sortedPosts=e.sortedPosts.where(function(e){return e.Id!=t.Id})})},n.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},n.prototype.selectedCompanyDepartmentChange=function(){var t=this;null!=this.selectedUserAssociations&&null!=this.posts?this.sortedPosts=this.posts.where(function(e){return e.CompanyId===t.selectedUserAssociations.CompanyId&&e.DepartmentId===t.selectedUserAssociations.DepartmentId}).orderByDescending(function(e){return e.CreatedDate}):this.sortedPosts=this.posts.orderByDescending(function(e){return e.CreatedDate})},n.$inject=["ForumService","FileService","ModalService","UserAssociationService","PageContentService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Forum/Category/ForumCategory.component.html",this.bindings={category:"<",onPostCreated:"&"}},app.component("forumCategory",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.forumCommentService=e,this.fileService=t,this.$location=i,this.forumUtility=n,this.forumCategoryService=o,this.disposables=new Rx.CompositeDisposable,this.showComments=!0,this.totalComments=0}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).Comment||(e.Comment={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getDisplayDateString=function(e){return e?this.forumUtility.getDisplayDateString(new Date(e)):""},i.prototype.loadMore=function(){this.forumCommentService.getCommentsByPost(this.post.Id,this.comments.length)},i.prototype.loadAll=function(){this.forumCommentService.getCommentsByPost(this.post.Id,this.comments.length,this.totalComments)},i.prototype.createdChild=function(e,t){var i=e.ChildComments.firstOrDefault(function(e){return e.Id===t.Id});i?(i.BodyText=t.BodyText,i.isEditing=!1):(e.ChildComments.unshift(t),this.post.Following=!0)},i.prototype.cancelledChildEdit=function(e){e.ChildComments.forEach(function(e){e.isEditing=!1})},i.prototype.cancelledChildCreation=function(e){e.isCreatingChild=!1},i.prototype.isDoneEditing=function(t){var e=this.comments.indexOf(this.comments.firstOrDefault(function(e){return e.Id==t.Id}));-1<e?this.comments[e]=t:(this.createCommentView=!1,this.comments.unshift(t))},i.prototype.createComment=function(){this.createCommentView=!0},i.prototype.deleteComment=function(t){var e=this;confirm("Er du sikker på du vil slette denne kommentar?")&&this.forumCommentService.deleteComment(t).then(function(){e.comments=e.comments.where(function(e){return e.Id!=t.Id}),e.post.Comments--})},i.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},i.$inject=["ForumCommentService","FileService","$location","ForumUtilityService","ForumCategoryService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Forum/Comment/ForumComment.component.html",this.bindings={post:"<",comments:"<",totalComments:"<",isChild:"<",parentComment:"<"}},app.component("forumComment",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(t,i,e,n){var o=this;this.$window=e,angular.element(this.$window).bind("scroll",function(e){t.commentToRead.Seen?angular.element(o.$window).unbind(e):o.isScrolledIntoView(i)&&(n.markCommentRead(t.commentToRead).then(function(){t.postToRead&&(t.postToRead.UnreadComments--,t.commentToRead.Seen=!0)}),angular.element(o.$window).unbind(e))})}(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).Directives||(e.Directives={}),i.prototype.$onInit=function(){},i.prototype.isScrolledIntoView=function(e){var t=$(this.$window).scrollTop()+$(this.$window).height();return $(e).offset().top+$(e).height()<=t},i.$inject=["$scope","$element","$window","ForumCommentService"],t=i,app.directive("markCommentRead",function(){return{restrict:"A",scope:{commentToRead:"=",postToRead:"="},controller:t,controllerAs:"$ctrl"}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(t,i,e,n){var o=this;this.$window=e,angular.element(this.$window).bind("scroll",function(e){t.postToRead.Seen?angular.element(o.$window).unbind(e):o.isScrolledIntoView(i)&&(n.markPostRead(t.postToRead.Id).then(function(){t.postToRead.Seen=!0}),angular.element(o.$window).unbind(e))})}(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).Directives||(e.Directives={}),i.prototype.$onInit=function(){},i.prototype.isScrolledIntoView=function(e){var t=$(this.$window).scrollTop()+$(this.$window).height();return $(e).offset().top+$(e).height()<=t},i.$inject=["$scope","$element","$window","ForumService"],t=i,app.directive("markPostRead",function(){return{restrict:"A",scope:{postToRead:"="},controller:t,controllerAs:"$ctrl"}})}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i,n,o){this.forumService=e,this.$location=t,this.modalService=i,this.pageContentService=n,this.forumCategoryService=o,this.canCreateCategories=!1,this.canEditCategories=!1,this.canDeleteCategories=!1,this.disposables=new Rx.CompositeDisposable}e=e.CrossPortal||(e.CrossPortal={}),t=e.Forum||(e.Forum={}),n.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&(t.forumCategoryService.canCreateCategories(e.Id),t.forumCategoryService.getForumCategories(e.Id))}),this.disposables.add(this.forumCategoryService.categoryPermissions$.subscribe(function(e){e&&(t.canCreateCategories=e.CanCreate,t.canEditCategories=e.CanEdit,t.canDeleteCategories=e.CanDelete)})),this.disposables.add(this.forumCategoryService.forumCategories$.subscribe(function(e){e&&(t.categories=e,t.navigate())})),this.disposables.add(this.forumCategoryService.lastSavedCategory$.subscribe(function(e){!e||t.selectedCategory&&t.selectedCategory.Id===e.Id||(t.selectedCategory=e,t.updateSelected())})),this.disposables.add(Rx.Observable.fromEvent(window,"hashchange").subscribe(function(){t.navigate()}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.navigate=function(){var e=this.$location.hash();if(""!==e)for(var t=(e=e.replace(/#|!|\//g,"")).indexOf("_"),i=(-1<t&&(e=e.substring(0,t)),parseInt(e)),n=0;n<this.categories.length;n++)if(this.categories[n].Id===i){this.selectedCategory=this.categories[n];break}},n.prototype.createCategory=function(){var e={forumId:this.currentPage.Id};this.modalService.createModal("/App/CrossPortal/Forum/Modals/CreateForumCategory.modal.html",t.Modals.CreateForumCategoryController,e,"lg")},n.prototype.manageForumCategory=function(){var e={canEdit:this.canEditCategories,canDelete:this.canDeleteCategories};this.modalService.createModal("/App/CrossPortal/Forum/Modals/EditForumCategory.modal.html",t.Modals.EditForumCategoryController,e,"lg")},n.prototype.isCategorySelected=function(){return null!=this.selectedCategory},n.prototype.updateSelected=function(){var e=this.selectedCategory;e?this.$location.hash(e.Id.toString()):(this.$location.hash(""),window.location.reload())},n.prototype.onPostCreated=function(e){for(var t=0;t<this.categories.length;t++)if(this.categories[t].Id===e&&(null==this.selectedCategory||e!==this.selectedCategory.Id)){this.selectedCategory=this.categories[t];break}this.updateSelected()},n.$inject=["ForumService","$location","ModalService","PageContentService","ForumCategoryService"],i=n,e=function(){this.controller=i,this.templateUrl="/App/CrossPortal/Forum/Forum.component.html",this.bindings={}},app.component("forum",new e)}(BoligExtra=BoligExtra||{}),!function(r){var e;function t(e,t,i,n,o){this.incomHttp=e,this.$q=t,this.utilityService=i,this.loaderService=n,this.fileService=o,this.categoryPosts$=new Rx.BehaviorSubject(null),this.forumPost$=new Rx.Subject,this.latestActivity$=new Rx.Subject,this.baseurl="/umbraco/api/Forum"}(e=r.CrossPortal||(r.CrossPortal={})).Forum||(e.Forum={}),t.prototype.getLatestActivity=function(e){var i=this;this.incomHttp.get(this.baseurl+"/GetLatestActivity/"+e).then(function(e){for(var t=0;t<e.ForumNewActivities.length;t++)e.ForumNewActivities[t].DisplayLastUpdatedDate=i.utilityService.formatDate(e.ForumNewActivities[t].LastUpdatedDate,"long")+" Kl."+i.utilityService.formatDate(e.ForumNewActivities[t].LastUpdatedDate,"short time");for(t=0;t<e.ForumLatestActivities.length;t++)e.ForumLatestActivities[t].DisplayLastUpdatedDate=i.utilityService.formatDate(e.ForumLatestActivities[t].LastUpdatedDate,"long")+" Kl."+i.utilityService.formatDate(e.ForumLatestActivities[t].LastUpdatedDate,"short time");i.latestActivity$.onNext(e)})},t.prototype.markPostRead=function(e){return this.incomHttp.post("".concat(this.baseurl,"/MarkPostRead?postId=")+e,null)},t.prototype.getPostsByCategory=function(e){var i=this,n=this.loaderService.setLoader("contentSection","getPosts");this.incomHttp.get(this.baseurl+"/GetPostsByCategory/"+e).then(function(e){for(var t=0;t<e.ForumCategoryPostViewModels.length;t++)e.ForumCategoryPostViewModels[t].DisplayCreatedDate=i.utilityService.formatDate(e.ForumCategoryPostViewModels[t].CreatedDate,"long")+" Kl."+i.utilityService.formatDate(e.ForumCategoryPostViewModels[t].CreatedDate,"short time");i.categoryPosts$.onNext(e.ForumCategoryPostViewModels),i.loaderService.removeLoader(n)})},t.prototype.getPostByNodeId=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getPost");return this.incomHttp.get(this.baseurl+"/GetPostByNodeId/"+e).then(function(e){e.DisplayCreatedDate=t.utilityService.formatDate(e.CreatedDate,"long")+" Kl."+t.utilityService.formatDate(e.CreatedDate,"short time"),t.forumPost$.onNext(e),t.loaderService.removeLoader(i)}),this.forumPost$},t.prototype.toggleFollowPost=function(t){this.incomHttp.post(this.baseurl+"/ToggleFollowPost",t).then(function(e){t.Following=e.Following,t.FollowedBy=e.FollowedBy})},t.prototype.postSavePost=function(e,i,n){var o=this,t=this.loaderService.setLoader("forumDisplaySection","savePost"),r=this.$q.defer(),e=(this.incomHttp.post("".concat(this.baseurl,"/SavePost"),e).then(function(e){var t=[];return angular.isArray(i)&&0<i.length&&t.addRange(i),angular.isArray(n)&&0<n.length&&t.addRange(n),0<t.length?o.incomHttp.postFiles("".concat(o.baseurl,"/UploadFiles?nodeId=").concat(e),t).then(function(){r.resolve()},function(){r.reject()}):r.resolve(),e}),this.$q.all([r.promise]));return e.then(function(){o.loaderService.removeLoader(t)}),e},t.prototype.deletePost=function(e){return this.loaderService.setLoader("forum","category"),this.incomHttp.delete(this.baseurl+"/DeletePost/"+e.Id)}
1,t.prototype.addUploadedFiles=function(t,e,i,n){var o=this;e.addRange(i.map(function(e){e=o.fileService.toUploadedFile(e,n);return n===r.Utility.File.UploadedFileType.Image&&o.fileService.attachThumbnail(e,t),e}))},t.$inject=["incomHttpService","$q","UtilityService","LoaderService","FileService"],app.service("ForumService",t)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o){this.forumService=e,this.modalService=t,this.userAssociationService=i,this.pageContentService=n,this.$location=o,this.disposables=new Rx.CompositeDisposable,this.selectedUserAssociations=null,this.allRead=!1,this.currentPage=0,this.entryLimit=10}e=e.CrossPortal||(e.CrossPortal={}),(i=e.Forum||(e.Forum={})).LatestActivity||(i.LatestActivity={}),n.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.page=e,t.forumName=t.page.PageName,t.forumService.getLatestActivity(e.Id))}),this.disposables.add(this.forumService.latestActivity$.subscribe(function(e){e&&(t.latestActivity=e.ForumLatestActivities,t.latestActivity=__spreadArray(__spreadArray([],t.latestActivity,!0),e.ForumNewActivities,!0).orderByDescending(function(e){return e.CreatedDate}),t.userAssociationService.getUserAssociationsForForum(t.page.Id))})),this.disposables.add(this.userAssociationService.userAssociationsForForum$.first(function(e){return!!e&&e.PageId===t.page.Id}).subscribe(function(e){e&&e.PageId&&(t.userAssociations=e.UserAssociations,t.ignoreUserAssociation=e.IgnoreUserAssociation,!1===t.ignoreUserAssociation?null!=t.userAssociations&&1===t.userAssociations.length&&(t.selectedUserAssociations=t.userAssociations.firstOrDefault(),t.selectedCompanyDepartmentChange()):t.selectedCompanyDepartmentChange())}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.selectedCompanyDepartmentChange=function(){var t=this;null!=this.selectedUserAssociations&&null!=this.newActivity?this.newActivity=this.newActivity.where(function(e){return e.CompanyId===t.selectedUserAssociations.CompanyId&&e.DepartmentId===t.selectedUserAssociations.DepartmentId}):this.newActivity=this.newActivity},n.prototype.createPost=function(){var t=this,e={categoryId:this.page.Id,selectedUserAssociations:null,PostFromMyPage:!1};this.modalService.createModal("/App/CrossPortal/Forum/Modals/CreateForumPost.modal.html",i.Modals.CreateForumPostController,e).result.then(function(e){t.onPostCreated({categoryId:e})})},n.prototype.goToCategory=function(e){this.forumService.markPostRead(e.PostId),this.$location.hash(e.CategoryId.toString()+"_"+e.PostId.toString())},n.prototype.updatePage=function(e){this.currentPage=e},n.$inject=["ForumService","ModalService","UserAssociationService","PageContentService","$location"],t=n,e=function(){this.controller=t,this.templateUrl="/App/CrossPortal/Forum/LatestActivity/ForumLatestActivity.component.html",this.bindings={onPostCreated:"&"}},app.component("forumLatestActivity",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$modalInstance=e,this.modalData=t,this.forumService=i,this.pageContentService=n,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e)}),this.disposables.add(this.forumService.categoryPermissions$.subscribe(function(e){e&&(t.userAssociations=e.CreateUserAssociations,t.ignoreUserAssociation=e.IgnoreUserAssociation)}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.userAssociationSelected=function(){return this.userAssociations.any(function(e){return e.Selected})},t.prototype.submit=function(){var e=this;this.newCategory.ForumId=this.modalData.forumId,this.newCategory.UserAssociations=this.userAssociations.where(function(e){return e.Selected}),this.forumService.postSaveCategory(this.newCategory,this.currentPage.Id).then(function(){e.$modalInstance.close()})},t.$inject=["$uibModalInstance","modalData","ForumCategoryService","PageContentService"],e.CreateForumCategoryController=t}(BoligExtra=BoligExtra||{}),!function(n){var e;function t(e,t,i,n,o,r,s,a){this.$scope=e,this.$modalInstance=t,this.modalData=i,this.forumService=n,this.fileService=o,this.forumCommentService=r,this.userService=s,this.utilityService=a,this.currentSize=0,this.maxTotalSize=10240,this.images=[],this.files=[],this.uploadedImages=[],this.uploadedFiles=[]}e=(e=(e=n.CrossPortal||(n.CrossPortal={})).Forum||(e.Forum={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var i=this;this.post=this.modalData.post,this.followPost=this.modalData.post.Following,this.userService.currentUser$.subscribe(function(e){e&&(i.currentUser=e)}),null!=this.modalData.comment&&(this.comment={Id:this.modalData.comment.Id,PostId:this.modalData.post.Id,BodyText:this.modalData.comment.BodyText,Files:this.modalData.comment.Files,Images:this.modalData.comment.Images,AvatarUrl:this.currentUser.AvatarUrl}),this.$scope.$watchCollection(function(){return i.images},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedImages,e,n.Utility.File.UploadedFileType.Image),i.images=[])}),this.$scope.$watchCollection(function(){return i.files},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedFiles,e,n.Utility.File.UploadedFileType.File),i.currentSize+=e.reduce(function(e,t){return e+t.size},0)/1024/1024,i.files=[])}),this.guidForComment=this.utilityService.newGuid()},t.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},t.prototype.deleteFile=function(e){confirm("Er du sikker på du vil slette denne fil?")&&(e.ShouldDelete=!0)},t.prototype.deleteUploadedImage=function(e,t){this.uploadedImages.remove(e)},t.prototype.deleteUploadedFile=function(e){this.uploadedFiles.remove(e),this.currentSize-=e.file.size/1024/1024},t.prototype.submit=function(){var e=this;this.followPost!==this.post.Following&&this.forumService.toggleFollowPost(this.post),this.comment.PostId||(this.comment.PostId=this.post.Id),this.forumCommentService.postSaveComment(this.comment,this.uploadedImages,this.uploadedFiles).subscribe(function(){e.$modalInstance.close(!0)}).dispose()},t.$inject=["$scope","$uibModalInstance","modalData","ForumService","FileService","ForumCommentService","UserService","UtilityService"],e.CreateForumCommentController=t}(BoligExtra=BoligExtra||{}),!function(n){var e;function t(e,t,i,n,o,r,s,a,l,c,d){this.$modalInstance=e,this.modalData=t,this.$scope=i,this.forumService=n,this.fileService=o,this.userAssociationService=r,this.pageContentService=s,this.forumCategoryService=a,this.userService=l,this.utilityService=c,this.taOptions=d,this.disposables=new Rx.CompositeDisposable,this.images=[],this.files=[],this.uploadedImages=[],this.uploadedFiles=[],this.currentSize=0,this.maxTotalSize=10240}e=(e=(e=n.CrossPortal||(n.CrossPortal={})).Forum||(e.Forum={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var i=this;this.taOptions.defaultTagAttributes.a.target="_blank",this.disposables.add(this.userService.currentUser$.subscribe(function(e){e&&(i.currentUser=e)})),this.categoryId=this.modalData.categoryId,this.PostFromMyPage=this.modalData.PostFromMyPage||!1,null!=this.modalData.post?this.post={Id:this.modalData.post.Id,CategoryId:this.modalData.post.CategoryId,Title:this.modalData.post.Title,BodyText:this.modalData.post.BodyText,CompanyId:this.modalData.post.CompanyId,DepartmentId:this.modalData.post.DepartmentId,Files:this.modalData.post.Files,Images:this.modalData.post.Images,AvatarUrl:this.currentUser.AvatarUrl}:(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(i.modalData.forumId?(i.userAssociationService.getUserAssociationsForForum(i.modalData.forumId),i.forumCategoryService.getForumCategories(i.modalData.forumId)):(i.userAssociationService.getUserAssociationsForForum(e.Id),i.forumCategoryService.getForumCategories(e.Id)))}),this.disposables.add(this.userAssociationService.userAssociationsForForum$.subscribe(function(e){e&&(i.userAssociations=e.UserAssociations,i.ignoreUserAssociation=e.IgnoreUserAssociation,i.ignoreUserAssociation||(i.modalData.selectedUserAssociations?i.selectedAccess=i.userAssociations.firstOrDefault(function(e){return e.CompanyId===i.modalData.selectedUserAssociations.CompanyId&&e.DepartmentId===i.modalData.selectedUserAssociations.DepartmentId}):i.selectedAccess||null==i.userAssociations||1!==i.userAssociations.length||(i.selectedAccess=i.userAssociations[0])))})),this.disposables.add(this.forumCategoryService.forumCategories$.subscribe(function(e){if(e)if(i.categories=e,null!=i.categoryId){for(var t=0;t<i.categories.length;t++)if(i.categories[t].Id===i.categoryId){i.selectedCategory=i.categories[t];break}}else 1===i.categories.length&&(i.selectedCategory=i.categories[0])}))),this.$scope.$watchCollection(function(){return i.images},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedImages,e,n.Utility.File.UploadedFileType.Image),i.images=[])}),this.$scope.$watchCollection(function(){return i.files},function(e,t){e&&0<e.length&&(i.forumService.addUploadedFiles(i.$scope,i.uploadedFiles,e,n.Utility.File.UploadedFileType.File),i.currentSize+=e.reduce(function(e,t){return e+t.size},0)/1024/1024,i.files=[])}),this.guidForPost=this.utilityService.newGuid()},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},t.prototype.deleteFile=function(e){confirm("Er du sikker på du vil slette denne fil?")&&(e.ShouldDelete=!0)},t.prototype.deleteUploadedImage=function(e,t){this.uploadedImages.remove(e)},t.prototype.deleteUploadedFile=function(e){this.uploadedFiles.remove(e),this.currentSize-=e.file.size/1024/1024},t.prototype.submit=function(){var e=this;1024*this.currentSize>this.maxTotalSize||(null!=this.selectedCategory.Id&&null!=this.post&&null!=this.post.Id||(this.PostFromMyPage||(this.post.CategoryId=this.selectedCategory.Id),!1===this.ignoreUserAssociation&&(this.post.CompanyId=this.selectedAccess.CompanyId,this.post.DepartmentId=this.selectedAccess.DepartmentId)),this.post.CategoryId=this.selectedCategory.Id,this.forumService.postSavePost(this.post,this.uploadedImages,this.uploadedFiles).then(function(){e.$modalInstance.close(e.categoryId)}))},t.$inject=["$uibModalInstance","modalData","$scope","ForumService","FileService","UserAssociationService","PageContentService","ForumCategoryService","UserService","UtilityService","taOptions"],e.CreateForumPostController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o){this.$modalInstance=e,this.modalData=t,this.forumService=i,this.feedbackService=n,this.pageContentService=o,this.disposables=new Rx.CompositeDisposable}
1e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Forum||(e.Forum={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.canEdit=this.modalData.canEdit,this.canDelete=this.modalData.canDelete,this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.forumService.getForumCategories(e.Id)}),this.disposables.add(this.forumService.forumCategories$.subscribe(function(e){e&&(t.forumCategories=e)}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.toggleEditing=function(){this.editing=!this.editing},t.prototype.deleteCategory=function(){var t=this;this.feedbackService.showConfirmbox({Headline:"Er du sikker på at du vil slette kategorien?",Message:"<p>Dette sletter også alle tilhørende indlæg og kommentare!</p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){t.forumService.deleteCategory(t.selectedCategory.Id,t.currentPage.Id).then(function(){t.$modalInstance.close()})},function(e){})},t.prototype.submit=function(){var e=this;this.forumService.updateCategory(this.selectedCategory,this.currentPage.Id).then(function(){e.$modalInstance.close()})},t.$inject=["$uibModalInstance","modalData","ForumCategoryService","FeedbackService","PageContentService"],e.EditForumCategoryController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/GlobalSearch/",this.searchResult$=new Rx.BehaviorSubject(null),this.searchPageUrl$=new Rx.BehaviorSubject(null),this.lastPage=null}(e=e.CrossPortal||(e.CrossPortal={})).GlobalSearch||(e.GlobalSearch={}),t.prototype.getSearchPageUrl=function(e){var t=this;return null!=this.lastPage&&!e.IsCompanyOrDepartmentPage&&this.lastPage.IsCompanyOrDepartmentPage===e.IsCompanyOrDepartmentPage||(this.lastPage=e,this.incomHttp.get(this.baseurl+"GetSearchPageUrl/"+e.Id).then(function(e){t.searchPageUrl$.onNext(e)})),this.searchPageUrl$},t.prototype.doSearch=function(e){var t=this,i=this.loaderService.setLoader("contentSection","globalSearch"),e={CurrentPageId:null!=this.lastPage?this.lastPage.Id:-1,Query:e};this.incomHttp.post(this.baseurl+"Search",e).then(function(e){t.searchResult$.onNext(e.SearchResults),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService"],app.service("GlobalSearchService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.globalSearchService=e,this.windowService=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable,this.searchQuery=""}(e=e.CrossPortal||(e.CrossPortal={})).GlobalSearch||(e.GlobalSearch={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&t.disposables.add(t.globalSearchService.getSearchPageUrl(e).subscribe(function(e){e&&(t.searchPageUrl=e)}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.doSearch=function(){var e=this.searchPageUrl+"#query=".concat(encodeURIComponent(this.searchQuery).replace("%2C",", "));this.windowService.location.pathname==this.searchPageUrl?this.windowService.location.hash="query=".concat(encodeURIComponent(this.searchQuery).replace("%2C",",")):this.windowService.history.pushState({},"",e)},i.$inject=["GlobalSearchService","$window","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/GlobalSearch/GlobalSearch2/GlobalSearchField2.component.html",this.bindings={}},app.component("globalSearchField",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.globalSearchService=e,this.utilityService=t,this.$location=i,this.definitionHelper=n,this.disposables=new Rx.CompositeDisposable,this.searchQuery="",this.currentPage=0,this.entryLimit=9,this.hasSought=!1,this.selectedCategory="all"}(e=e.CrossPortal||(e.CrossPortal={})).GlobalSearch||(e.GlobalSearch={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.globalSearchService.searchResult$.subscribe(function(e){e&&(t.staticSearchResult=e,t.sortSearchResult(t.selectedCategory))})),this.disposables.add(Rx.Observable.fromEvent(window,"hashchange").subscribe(function(){t.navigate()})),this.navigate()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getDefinitionSeperator=function(e){return this.definitionHelper.getDefinitionSeperator(e)},i.prototype.updateHash=function(){location.hash="query=".concat(encodeURIComponent(this.searchQuery).replace("%2C",","))},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.navigate=function(){var e=this.utilityService.getParameters("hash"),t=decodeURIComponent(e.query)||"";e.query&&""!==t&&(this.selectedCategory=decodeURIComponent(e.category)||"",this.searchQuery=t,this.globalSearchService.doSearch(this.searchQuery),this.hasSought=!0)},i.prototype.doSearch=function(){this.updateHash()},i.prototype.sortSearchResult=function(e){switch(e){case"faq":this.searchResult=this.staticSearchResult.where(function(e){return"faqItem"===e.DocumentType||"companyAndDepartmentFaqItem"===e.DocumentType});break;case"news":this.searchResult=this.staticSearchResult.where(function(e){return"cmsNewsItem"===e.DocumentType||"companyDepartmentCmsNe
1wsItem"===e.DocumentType});break;case"documents":this.searchResult=this.staticSearchResult.where(function(e){return"FileArchiveFile"===e.DocumentType});break;default:this.selectedCategory="all",this.searchResult=this.staticSearchResult}this.selectedCategory=e,this.updateHash()},i.$inject=["GlobalSearchService","UtilityService","$location","ImageDefinitionHelperService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/GlobalSearch/GlobalSearchPage.component.html",this.bindings={}},app.component("globalSearchPage",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.locationService=e,this.$scope=t,this.fileService=i,this.validationService=n,this.disposables=new Rx.CompositeDisposable,this.files=[],this.uploadedFiles=[]}(e=(e=e.CrossPortal||(e.CrossPortal={})).InComForms||(e.InComForms={})).Components||(e.Components={}),i.prototype.$onInit=function(){var t=this;switch(this.isDisabled=this.formField.Value&&this.formField.LockPrefilledField,this.formField.LengthClass=0===this.formField.InputFieldLength?"":1===this.formField.InputFieldLength?"medium":"short",this.formField.DataType.Alias){case"FileUpload":this.formField.files=[],this.$scope.$watchCollection(function(){return t.uploadedFiles},function(e){e&&0<e.length&&(t.formField.files.addRange(e.map(function(e){return t.fileService.toUploadedFile(e)})),t.uploadedFiles=[])});break;case"CheckboxList":case"RadioList":case"Dropdown":this.formField.PreValue?this.formField.choices=JSON.parse(this.formField.PreValue):this.formField.choices=[];break;case"Address":this.isDisabled=(this.formField.Value||{}).Street&&this.formField.LockPrefilledField,this.disposables.add(this.locationService.getCountries().subscribe(function(e){e&&(t.countries=e)}));break;case"Text":if(this.formField.RegexPattern&&""!==this.formField.RegexPattern)switch(this.formField.RegexPattern){case"E-mail":this.formField.Regex=this.validationService.getEmailRegex();break;case"Telefon nummer":this.formField.Regex=this.validationService.getPhoneNumberRegex();break;case"URL":this.formField.Regex=this.validationService.getUrlRegex();break;case"Tekst":this.formField.Pattern=this.validationService.getFullNameRegex();break;default:this.formField.Pattern=""}}},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.isStillRequired=function(){return"CheckboxList"===this.formField.DataType.Alias&&this.formField.IsRequired&&!this.formField.choices.any(function(e){return e.Value})},i.$inject=["LocationService","$scope","FileService","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/InComForms/Components/InComFormComponent.component.html",this.bindings={formField:"<",form:"<",rootForm:"<"}},app.component("incomFormComponent",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o,r,s,a){this.inComFormsService=e,this.$scope=t,this.htmlToPdfService=i,this.utilityService=n,this.validationService=o,this.modalService=r,this.profileService=s,this.featureFlagService=a,this.disposables=new Rx.CompositeDisposable,this.showEmailBox=!1}e=e.CrossPortal||(e.CrossPortal={}),i=e.InComForms||(e.InComForms={}),n.prototype.$onInit=function(){var t=this;this.alias&&this.inComFormsService.getForm(this.alias).first(function(e){return!!e}).subscribe(function(e){t.form=e,t.reCaptchaSuccess={Success:!e.RequireReCaptcha},t.profileService.getProfile(),t.accessLevel=20==e.RequiredLoginLevel?"InComForm":""}),this.disposables.add(this.profileService.profile$.subscribe(function(e){e&&(t.user=e.Interessent)})),this.emailRegex=this.validationService.getEmailRegex()},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.resetForm=function(){this.form=null;var e=this.$scope.incomform;e.$setPristine(),e.$setUntouched(),this.showReceipt=!1,this.showEmailBox=!1,this.$onInit()},n.prototype.submitForm=function(e){var i,n=this;e.$valid&&this.reCaptchaSuccess.Success&&(i=[],this.form.FormFields.forEach(function(e){var t;"CheckboxList"===e.DataType.Alias?(t=e.choices,e.Value=t.where(function(e){return e.Value}).map(function(e){return e.Name}).join(",")):"Dropdown"===e.DataType.Alias?e.Value&&(e.Value=e.Value.Name):"FileUpload"===e.DataType.Alias?e.files&&(i.addRange(e.files),e.Value=e.files.map(function(e){return e.metadata.FileName+"."+e.metadata.Extension})):"DatePicker"===e.DataType.Alias&&e.Value&&(e.Value=n.utilityService.formatDate(e.Value,"iso date"))}),this.form.SendCopyTo&&!1===this.showEmailBox&&(this.form.EmailToSendCopyTo=null),this.featureFlagService.inComForms.useBrowserPdfVersion?this.htmlToPdfService.createPdf(".incom-form",this.alias).then(function(e){n.form.PdfGuid=e.replace(/"/g,""),n.commitFormAndHandleResponse(i)}):this.commitFormAndHandleResponse(i))},n.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".incom-form",this.alias)},n.prototype.commitFormAndHandleResponse=function(e){var t=this;this.inComFormsService.postForm(this.form,e).then(function(e){e.ReceiptText&&(t.showReceipt=!0),e.SignatureLink&&t.modalService.createModal("/App/CrossPortal/InComForms/SignDocument/SignDocument.modal.html",i.SignDocument.SignDocumentController,{SignatureLink:e.SignatureLink},"lg")})},n.$inject=["InComFormsService","$scope","HtmlToPdfService","UtilityService","ValidationService","ModalService","ProfileService","FeatureFlagService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/InComForms/InComForms.component.html",this.bindings={alias:"@"}},app.component("incomForms",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.incomHttp=e,this.loaderService=t,this.$q=i,this.fileService=n,this.baseurl="/umbraco/api/InComForms/"}(e=e.CrossPortal||(e.CrossPortal={})).InComForms||(e.InComForms={}),t.prototype.getForm=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getForm"),n=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"GetForm?alias="+e).then(function(e){n.onNext(e),t.loaderService.removeLoader(i)}),n},t.prototype.postForm=function(e,t){return this.fileService.postWithFiles(e,this.baseurl+"PostForm/",t)},t.$inject=["incomHttpService","LoaderService","$q","FileService"],app.service("InComFormsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var o,t;function i(e,t,i,n){this.loginService=e,this.storageService=t,this.pageContentService=i,this.featureFlagService=n,this.loginStep=o.LoginStep.Login,this.showNemId=!1,this.subs=new Rx.CompositeDisposable,this.showMitId=!1,this.showMitIdBox=!1,this.useExternalIdSwitcher=!1,this.hideNemIdButton=!1,this.togglePassword=!1,this.rememberMe=!1}e=e.CrossPortal||(e.CrossPortal={}),o=e.Login||(e.Login={}),i.prototype.$onInit=function(){var t=this,e=(this.enableShowPassword=this.featureFlagService.passwordFeatureFlags.EnableShowPassword,this.enableRememberMe=this.featureFlagService.loginFeatureFlags.enableRememberMeCheckbox,this.showMitId=this.featureFlagService.mitIdFeatureFlags.enableMitIdLogin&&!this.featureFlagService.mitIdFeatureFlags.hideMitIdLoginButton,this.showMitIdBox=this.featureFlagService.mitIdFeatureFlags.enableMitIdLogin&&this.featureFlagService.mitIdFeatureFlags.useMitIdLoginBox,this.nemIdActive=this.featureFlagService.loginFeatureFlags.enableNemId,this.useExternalIdSwitcher=this.featureFlagService.externalIdFeatureFlags.enableLoginSwitcher,this.hideNemIdButton=this.featureFlagService.loginFeatureFlags.hideNemIdLoginButton,this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){return t.currentPage=e}),this.storageService.getFirstLoginInfo()),e=(e&&(this.loginStep=o.LoginStep.FirstLogin,this.bodyText=e.BodyText),new Date);this.birthDateOptions={maxDate:new Date(e.getFullYear()-15,e.getMonth(),e.getDate())},this.subs.add(this.loginService.firstLoginModel$.subscribe(function(e){(t.firstLoginFormData=e)&&(t.storageService.setFirstLoginInfo(e),t.bodyText=e.BodyText,t.loginStep=o.LoginStep.FirstLogin)})),this.subs.add(this.loginService.firstOtherLoginModel$.subscribe(function(e){e&&(t.firstOtherLoginFormData=e,t.bodyText=e.BodyText,t.loginStep!==o.LoginStep.ValidateCpr?t.loginStep=o.LoginStep.ValidateCpr:t.loginStep=o.LoginStep.FirstOtherLogin)})),this.loginService.getPageVariables().first(function(e){return!!e}).subscribe(function(e){e&&(t.resetPasswordUrl=e.ForgottenLoginUrl,t.bodyText||(t.bodyText=e.BodyText))})},i.prototype.$onDestroy=function(){this.subs.dispose()},i.prototype.doLogin=function(e){e.$valid&&(this.loginFormData.LoginNodeId=this.currentPage.Id,this.loginService.login(this.loginFormData))},i.prototype.doAttachOtherLogin=function(e){e.$valid&&(this.firstOtherLoginFormData.LoginNodeId=this.currentPage.Id,this.loginService.attachOtherLoginType(this.firstOtherLoginFormData))},i.prototype.doValidateAndAttachNemIdToUser=function(e){e.$valid&&this.loginService.validateAndAttachNemIdToUser(this.cprToAttach)},i.$inject=["LoginService","StorageService","PageContentService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/Login.component.html",this.bindings={showNemId:"<"}},app.component("loginForm",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.loaderService=t,this.supportService=i,this.localApiUrl="/umbraco/Api/Login/",this.firstOtherLoginModel$=new Rx.BehaviorSubject(null),this.firstLoginModel$=new Rx.BehaviorSubject(null),this.nemIdLoginParameters$=new Rx.BehaviorSubject(null),this.nemIdListenerAttached$=new Rx.BehaviorSubject(!1),this.pageVariables$=new Rx.BehaviorSubject(null)}(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={}),t.prototype.login=function(e){var t=this,i=this.loaderService.setLoader("global","LogIn");this.$http.post(this.localApiUrl+"Login",e).then(function(e){t.firstLoginModel$.onNext(e),t.loaderService.removeLoader(i)},function(e){return t.loaderService.removeLoader(i)})},t.prototype.getNemIdLoginParameters=function(){var t=this,i=this.loaderService.setLoader("contentSection","getNemIdLoginParams");return this.$http.get("/umbraco/api/NemId/GetJsLoginParameters").then(function(e){t.nemIdLoginParameters$.onNext(e),t.loaderService.removeLoader(i)},function(e){return t.loaderService.removeLoader(i)}),this.nemIdLoginParameters$},t.prototype.validateAndAttachNemIdToUser=function(e){var t=this,i=this.loaderService.setLoader("global","LogIn_ValidateAttachNemId");this.$http.post(this.localApiUrl+"ValidateAndAttachNemIdToUser?userId="+e,null).then(function(e){t.firstOtherLoginModel$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.attachOtherLoginType=function(e){var t=this,i=this.loaderService.setLoader("contentSection","
1LogIn_AttachLogin");this.$http.post(this.localApiUrl+"AttachOtherLoginType",e).then(function(e){t.firstLoginModel$.onNext(e),t.loaderService.removeLoader(i)},function(e){return t.loaderService.removeLoader(i)})},t.prototype.loginWithNemId=function(e){var t=this,i=this.loaderService.setLoader("global","LogIn_NemId");this.$http.post(this.localApiUrl+"LoginWithNemId",e).then(function(e){t.firstOtherLoginModel$.onNext(e),t.loaderService.removeLoader(i)},function(e){return t.loaderService.removeLoader(i)})},t.prototype.loginWithLoginType=function(e){var t=this,i=this.loaderService.setLoader("global","LogIn_Logintype");this.$http.post(this.localApiUrl+"LoginWithLoginType",e).then(function(e){t.firstOtherLoginModel$.onNext(e),t.loaderService.removeLoader(i)},function(e){return t.loaderService.removeLoader(i)})},t.prototype.logoff=function(){var t=this,i=this.loaderService.setLoader("global","logout"),e="".concat(this.localApiUrl,"Logoff");this.$http.post(e,null).then(function(){t.supportService.setSupportAdministrationState(!1),location.reload()},function(e){return t.loaderService.removeLoader(i)})},t.prototype.firstLogin=function(){var e=this,t=this.loaderService.setLoader("global","Login_FirstLogin");this.$http.post("".concat(this.localApiUrl,"FirstLogin"),null).then(function(){return e.loaderService.removeLoader(t)},function(){return e.loaderService.removeLoader(t)})},t.prototype.validateFirstLogin=function(e){var t=this,i=this.loaderService.setLoader("global","Login_FirstLogin"),e=this.$http.post("".concat(this.localApiUrl,"ValidateFirstLogin"),e);return e.then(function(){return t.loaderService.removeLoader(i)},function(){return t.loaderService.removeLoader(i)}),e},t.prototype.supporterLogin=function(e,t){var i=this,n=this.loaderService.setLoader("global","SupporterLogin"),e={Username:e,Password:null,RememberMe:!1,LoginNodeId:t};this.$http.post("".concat(this.localApiUrl,"SupporterLogin"),e).then(function(){return i.loaderService.removeLoader(n)},function(){return i.loaderService.removeLoader(n)})},t.prototype.getPageVariables=function(){var t=this;return this.$http.get(this.localApiUrl+"GetPageVariables").then(function(e){t.pageVariables$.onNext(e)}),this.pageVariables$},t.$inject=["incomHttpService","LoaderService","SupportService"],app.service("LoginService",t)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i){this.loginService=e,this.pageContentService=t,this.featureFlagService=i,this.loginStep=n.LoginStep.Login,this.showNemId=!1,this.subs=new Rx.CompositeDisposable,this.firstLoginStep=1,this.activeTab="Login"}e=e.CrossPortal||(e.CrossPortal={}),n=e.Login||(e.Login={}),i.prototype.$onInit=function(){var t=this,e=(this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){return t.currentPage=e}),this.nemIdActive=this.featureFlagService.loginFeatureFlags.enableNemId,new Date);this.birthDateOptions={maxDate:new Date(e.getFullYear()-15,e.getMonth(),e.getDate())},this.subs.add(this.loginService.firstLoginModel$.subscribe(function(e){(t.firstLoginFormData=e)&&(t.cprConsent=e.CprConsent,t.loginStep=n.LoginStep.FirstLogin)})),this.subs.add(this.loginService.firstOtherLoginModel$.subscribe(function(e){e&&(t.firstOtherLoginFormData=e,t.loginStep!==n.LoginStep.ValidateCpr?t.loginStep=n.LoginStep.ValidateCpr:t.loginStep=n.LoginStep.FirstOtherLogin)})),this.loginService.getPageVariables().first(function(e){return!!e}).subscribe(function(e){e&&(t.resetPasswordUrl=e.ForgottenLoginUrl)})},i.prototype.$onDestroy=function(){this.subs.dispose()},i.prototype.doLogin=function(e){e.$valid&&(this.redirectToNodeId&&(this.loginFormData.RedirectToNodeAfterLogin=this.redirectToNodeId),this.loginFormData.LoginNodeId=this.currentPage.Id,this.loginService.login(this.loginFormData))},i.prototype.doAttachOtherLogin=function(e){e.$valid&&(this.firstOtherLoginFormData.LoginNodeId=this.currentPage.Id,this.loginService.attachOtherLoginType(this.firstOtherLoginFormData))},i.prototype.validateFirstLogin=function(e){var t=this;e.$valid&&(this.firstLoginFormData.AcceptedCprConditions=this.AcceptedCprConditions,this.loginService.validateFirstLogin(this.firstLoginFormData).then(function(e){e&&(t.firstLoginStep=2)}))},i.prototype.doFirstLogin=function(){this.consentsValid&&this.loginService.firstLogin()},i.prototype.allConsentsAnswered=function(e){this.consentsValid=e,this.showConsentError=!e},i.prototype.doValidateAndAttachNemIdToUser=function(e){e.$valid&&(e=angular.copy(this.cprToAttach),this.loginService.validateAndAttachNemIdToUser(e))},i.$inject=["LoginService","PageContentService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/LoginBox.component.html",this.bindings={redirectToNodeId:"<"}},app.component("loginBox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.loginStatisticsService=e,this.utilityService=t,this.departmentService=i,this.typesToDisplay=["All"],this.model={fromDate:(new Date).addDays(-7),toDate:new Date},this.dateConfigFrom={format:this.utilityService.shortDateFormat,maxDate:new Date},this.dateConfigTo={format:this.utilityService.shortDateFormat,maxDate:new Date,minDate:this.model.fromDate},this.showSupporterLogins=!1,this.subscriptions=new Rx.CompositeDisposable,this.rawLoginStatisticsModel={Entries:[]},this.loginStatistics=[],this.hasSought=!1,this.orderBy="-LoginDateTime",this.filterByUserId="",this.selectedDepartment=null,this.statisticsName={Lej:"Lejer",Bes:"Bestyrelse",Med:"Medlem",Per:"Personale"},this.currentPage=0,this.entryLimit=15}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).LoginStatistics||(e.LoginStatistics={}),i.prototype.$onInit=function(){var i=this;this.subscriptions.add(this.departmentService.getAllDepartments().subscribe(function(e){e&&(i.departments=e)})),this.subscriptions.add(this.loginStatisticsService.loginStatistics$.subscribe(function(e){e&&(i.rawLoginStatisticsModel=e,i.updateDisplayList(),i.hasSought=!0)})),this.subscriptions.add(this.loginStatisticsService.loginStatisticsCount$.subscribe(function(e){if(e){i.loginCount=e;for(var t=0;t<i.loginCount.Types.length;t++)i.loginCount.Types[t].RoleType=i.statisticsName[i.loginCount.Types[t].RoleType]}})),this.getLoginCount()},i.prototype.$onDestroy=function(){this.subscriptions.dispose()},i.prototype.getCount=function(e){if(this.rawLoginStatisticsModel&&this.rawLoginStatisticsModel.Entries)switch(e){case"Member":return this.rawLoginStatisticsModel.Entries.where(function(e){return e.Details.any(function(e){return"med"===e.RoleType.toLowerCase()})}).length;case"Tenant":return this.rawLoginStatisticsModel.Entries.where(function(e){return e.Details.any(function(e){return"lej"===e.RoleType.toLowerCase()})}).length;case"BoardMember":return this.rawLoginStatisticsModel.Entries.where(function(e){return e.Details.any(function(e){return"bes"===e.RoleType.toLowerCase()})}).length;case"Personnel":return this.rawLoginStatisticsModel.Entries.where(function(e){return e.Details.any(function(e){return"per"===e.RoleType.toLowerCase()})}).length;case"All":return this.rawLoginStatisticsModel.Entries.length}return 0},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.toggleDisplay=function(e){this.typesToDisplay=[e],this.updateDisplayList()},i.prototype.isEnabled=function(e){return this.typesToDisplay.contains(e)},i.prototype.updateDisplayList=function(){function e(e){var t=e.LoginDate.split("-"),e=e.LoginTime.split(":");return new Date(parseInt(t[2]),parseInt(t[1]),parseInt(t[0]),parseInt(e[0]),parseInt(e[1])).getTime()}var i=this;if(this.rawLoginStatisticsModel&&(this.loginStatistics=this.rawLoginStatisticsModel.Entries.map(function(e){return e}
1)),this.typesToDisplay.any()&&!this.typesToDisplay.contains("All"))for(var t,n=[],o=(this.typesToDisplay.contains("Member")&&n.add({type:"med",art:null}),this.typesToDisplay.contains("Tenant")&&n.add({type:"lej",art:null}),this.typesToDisplay.contains("BoardMember")&&n.add({type:"bes",art:null}),this.typesToDisplay.contains("Personnel")&&n.add({type:"per",art:null}),this),r=0;r<this.loginStatistics.length;)!function(e){n.any(function(t){return i.loginStatistics[e].Details.any(function(e){return e.RoleType.toLowerCase()===t.type&&(!t.art||t.art===e.RoleArt.toLowerCase())})})?e++:o.loginStatistics.splice(e,1),t=e}(r),r=t;var s=parseInt(this.filterByUserId||"");switch(0===s||isNaN(s)||(this.loginStatistics=this.loginStatistics.where(function(e){return e.UserId===s})),this.selectedDepartment&&(this.loginStatistics=this.loginStatistics.where(function(e){return e.Details.any(function(e){return e.CompanyId===i.selectedDepartment.Company.Id&&e.DepartmentId===i.selectedDepartment.Id})})),this.orderBy){case"InteressentNo":this.loginStatistics=this.loginStatistics.orderBy(function(e){return e.UserId});break;case"-InteressentNo":this.loginStatistics=this.loginStatistics.orderByDescending(function(e){return e.UserId});break;case"LoginDateTime":this.loginStatistics=this.loginStatistics.orderBy(e);break;case"-LoginDateTime":this.loginStatistics=this.loginStatistics.orderByDescending(e)}},i.prototype.getLogins=function(){var e=this.utilityService.formatDate(this.model.fromDate,"short"),t=this.utilityService.formatDate(this.model.toDate,"short");this.loginStatisticsService.getLoginStatistics(e,t,this.includeSupporterLogins)},i.prototype.getLoginCount=function(){var e=this.utilityService.formatDate(this.model.fromDate,"short"),t=this.utilityService.formatDate(this.model.toDate,"short"),i=parseInt(this.filterByUserId)||-1;this.includeSupporterLogins?this.showSupporterLogins=!0:this.showSupporterLogins=!1,this.loginStatisticsService.getLoginStatisticsCount(e,t,this.includeSupporterLogins,i,this.selectedDepartment)},i.prototype.downloadExcel=function(){this.loginStatisticsService.downloadExcel(this.loginStatistics)},i.prototype.setOrderBy=function(e){this.orderBy===e?this.orderBy="-"+e:this.orderBy=e,this.updateDisplayList()},i.prototype.resetSearch=function(){this.typesToDisplay=["All"],this.loginCount={Total:0,UniqueTotal:0,Types:[],SupportTotal:0},this.model={fromDate:(new Date).addDays(-7),toDate:new Date},this.loginStatistics=[],this.rawLoginStatisticsModel={Entries:[]},this.currentPage=0,this.orderBy="-LoginDateTime",this.filterByUserId="",this.hasSought=!1,this.selectedDepartment=null},i.prototype.fromDateSelectedChanged=function(){this.model.fromDate>this.model.toDate&&(this.model.toDate=this.model.fromDate),this.dateConfigTo.minDate=this.model.fromDate},i.$inject=["LoginStatisticsService","UtilityService","DepartmentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/LoginStatistics/LoginStatistics.component.html"},app.component("loginStatistics",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.fileService=i,this.baseurl="/umbraco/api/LoginStatistics/",this.loginStatistics$=new Rx.BehaviorSubject(null),this.loginStatisticsCount$=new Rx.BehaviorSubject(null)}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).LoginStatistics||(e.LoginStatistics={}),t.prototype.getLoginStatistics=function(e,t,i){var n=this,o=this.loaderService.setLoader("loginStatsResult","getData");this.incomHttp.get(this.baseurl+"GetLogins?fromDate="+e+"&toDate="+t+"&includeSupporterLogins="+i).then(function(e){n.loginStatistics$.onNext(e),n.loaderService.removeLoader(o)})},t.prototype.downloadExcel=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getExcel");this.incomHttp.post(this.baseurl+"GetExcelForEntries",e).then(function(e){t.fileService.downloadFile([e]),t.loaderService.removeLoader(i)})},t.prototype.getLoginStatisticsCount=function(e,t,i,n,o){var r=this,s=(void 0===n&&(n=-1),void 0===o&&(o=null),this.loaderService.setLoader("loginStatsCount","getBasicData"));this.incomHttp.post(this.baseurl+"GetLoginCount?fromDate="+e+"&toDate="+t+"&includeSupporterLogins="+i+"&interessentNo="+n,o).then(function(e){r.loginStatisticsCount$.onNext(e),r.loaderService.removeLoader(s)})},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("LoginStatisticsService",t)}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).LoginStep||(e.LoginStep={}))[e.Login=0]="Login",e[e.FirstLogin=1]="FirstLogin",e[e.FirstOtherLogin=2]="FirstOtherLogin",e[e.ValidateCpr=3]="ValidateCpr"}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.loginService=e,this.$sce=t,this.profileService=i,this.$timeout=n,this.featureFlagService=o,this.ignoreableErrorCodes=["Q0FOMDAy","Q0FOMDAz"],this.isAttached=!1,this.eventId=-1,this.nemIdOrigin="https://applet.danid.dk",this.nemIdIFrameSource="https://applet.danid.dk/launcher/std/",this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).NemId||(e.NemId={}),i.prototype.$onInit=function(){var t=this;this.featureFlagService.loginFeatureFlags.enableNemId&&(this.setupIframe(),this.disposables.add(Rx.Observable.fromEvent(window,"message").subscribe(function(e){t.onNemIdMessage(e)})))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.setupIframe=function(){this.nemFrameId=Math.floor(1e8*Math.random()),this.nemIdIFrameSource=this.nemIdIFrameSource+this.nemFrameId,this.getNemIdLoginParameters()},i.prototype.getNemIdLoginParameters=function(){var t=this;this.disposables.add(this.loginService.getNemIdLoginParameters().subscribe(function(e){t.nemIdLoginParams=e}))},i.prototype.onNemIdMessage=function(t){var e,i,n=this;t.origin==this.nemIdOrigin&&("SendParameters"!==(e=JSON.parse(t.data)).command||this.eventId!==t.timeStamp&&-1!==this.eventId||(this.eventId=t.timeStamp,this.$timeout(function(){var e=n.nemIdLoginParams;e&&0<e.length?document.getElementById(n.nemFrameId.toString()).contentWindow.postMessage(JSON.stringify({command:"parameters",content:e}),n.nemIdOrigin):n.onNemIdMessage(t)},200)),"changeResponseAndSubmit"===e.command&&20<e.content.length?(i={Result:"ok",Signature:e.content},this.performAction(i),void 0!==this.callbackOnResponse&&this.callbackOnResponse({request:i})):"changeResponseAndSubmit"===e.command&&-1===this.ignoreableErrorCodes.indexOf(e.content)?(i={Result:"error",Signature:e.content},this.performAction(i)):-1!==this.ignoreableErrorCodes.indexOf(e.content)&&(this.eventId=-1,this.setupIframe()))},i.prototype.getNemIdIFrameSource=function(){return this.$sce.trustAsResourceUrl(this.nemIdIFrameSource)},i.prototype.performAction=function(e){"login"===this.perform?this.loginService.loginWithNemId(e):"attach"===this.perform&&this.profileService.attachNemId(e)},i.$inject=["LoginService","$sce","ProfileService","$timeout","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/NemId/NemId.component.html",this.bindings={perform:"<",callbackOnResponse:"&?"}},app.component("nemid",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.passwordResetService=e,this.utilityService=t,this.featureFlagService=i,this.togglePassword=!1}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).PasswordReset||(e.PasswordReset={}),i.prototype.$onInit=function(){var t=this;this.enableShowPassword=this.featureFlagService.passwordFeatureFlags.EnableShowPassword,this.token=this.utilityService.getParameterByName("token"),this.userId=parseInt(this.utilityService.getParameterByName("uid")),this.validationSubscription=this.passwordResetService.tokenValidity$.subscribe(function(e){t.isTokenValid=e.IsValid,t.passwordRegex=e.PasswordRegex}),this.token&&this.userId&&this.passwordResetService.validateToken(this.token,this.userId)},i.prototype.$onDestroy=function(){this.validationSubscription.dispose()},i.prototype.sendPasswordReset=function(e){e.$valid&&this.passwordResetService.sendPasswordReset(this.model.username)},i.prototype.changePassword=function(e){e.$valid&&this.passwordResetService.changePassword(this.token,this.userId,this.model.password)},i.$inject=["PasswordResetService","UtilityService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Login/PasswordReset/PasswordReset.component.html"},app.component("passwordReset",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.tokenValidity$=new Rx.BehaviorSubject({IsValid:!1}),this.baseurl="/umbraco/api/PasswordReset/"}(e=(e=e.CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).PasswordReset||(e.PasswordReset={}),t.prototype.sendPasswordReset=function(e){this.incomHttp.post(this.baseurl+"CreatePasswordReset/",e)},t.prototype.validateToken=function(e,t){var i=this;this.incomHttp.post(this.baseurl+"ValidateToken",{Token:e,UserId:t,NewPassword:null}).then(function(e){i.tokenValidity$.onNext(e)})},t.prototype.changePassword=function(e,t,i){var n=this,o=this.loaderService.setLoader("contentSection","pageContent");this.incomHttp.post(this.baseurl+"ChangePassword",{Token:e,UserId:t,NewPassword:i}).then(function(){n.loaderService.removeLoader(o)})},t.$inject=["incomHttpService","LoaderService"],app.service("PasswordResetService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.myShortcutsService=e,this.feedbackService=t,this.disposables=new Rx.CompositeDisposable,this.myShortcuts=null,this.newShortcut=null,this.showAdd=!1,this.showEdit=!1}(e=e.CrossPortal||(e.CrossPortal={})).MyShortcuts||(e.MyShortcuts={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.myShortcutsService.getMyShortcuts().subscribe(function(e){e&&(t.myShortcuts=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.updateMyShortcut=function(t,i){var n=this;this.feedbackService.showConfirmbox({Headline:i?"Er du sikker på du vil opdatere genvejen?":"Er du sikker på at du vil slette genvejen?",Message:"<p></p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){!1===i?n.myShortcuts.Shortcuts.splice(t,1):n.myShortcuts.Shortcuts[t].ShowEdit=!1,n.myShortcutsService.updateMyShortcut(n.myShortcuts)})},i.prototype.addShortcut=function(){this.newShortcut={Name:this.name,Url:this.url,ShowEdit:!1,NodeId:null},this.myShortcutsService.addShortcut(this.newShortcut),this.showAdd=!1,this.name=null,this.url=null},i.$inject=["MyShortcutsService","FeedbackService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/MyShortcuts/MyShortcuts.component.html",this.bindings={}},app.component("myShortcuts",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/MyShortcuts/",this.myShortcuts$=new Rx.BehaviorSubject(null),this.checkNode$=new Rx.BehaviorSubject(null)}(e=e.CrossPortal||(e.CrossPortal={})).MyShortcuts||(e.MyShortcuts={}),t.prototype.getMyShortcuts=function(){var t=this,i=this.loaderService.setLoader("contentSection","getShortcuts");return this.incomHttp.get("".concat(this.baseurl,"GetMyShortcuts")).then(function(e){t.myShortcuts$.onNext(e),t.loaderService.removeLoader(i)}),this.myShortcuts$},t.prototype.addShortcut=function(e){var t=this;this.incomHttp.post("".concat(this.baseurl,"AddShortcut"),e).then(function(){t.myShortcuts$.getValue().Shortcuts.add(e)})},t.prototype.addShortcutByNodeId=function(t){var i=this;this.incomHttp.get("".concat(this.baseurl,"AddShortcutByNodeId?nodeId=")+t).then(function(e){i.myShortcuts$.getValue().Shortcuts.add(e),i.checkNode(t)})},t.prototype.updateMyShortcut=function(e){var t=this;this.incomHttp.post("".concat(this.baseurl,"UpdateMyShortcut"),e).then(function(){t.myShortcuts$.onNext(e)})},t.prototype.checkNode=function(e){var t=this;this.incomHttp.get("".concat(this.baseurl,"CheckNode?nodeId=")+e).then(function(e){t.checkNode$.onNext(e)})},t.prototype.removeShortcut=function(t){var i=this;return this.incomHttp.get("".concat(this.baseurl,"RemoveShortcut?nodeId=")+t).then(function(e){i.myShortcuts$.onNext(e),i.checkNode(t)}),this.myShortcuts$},t.$inject=["incomHttpService","LoaderService"],app.service("MyShortcutsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.myShortcutsService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable,this.newShortcut=null}(e=e.CrossPortal||(e.CrossPortal={})).MyShortcuts||(e.MyShortcuts={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){t.currentPage=e,t.currentPage&&t.myShortcutsService.checkNode(t.currentPage.Id)}),this.disposables.add(this.myShortcutsService.checkNode$.subscribe(function(e){t.myShortcutsMenu=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.addShortcut=function(){this.myShortcutsService.addShortcutByNodeId(this.currentPage.Id)},i.prototype.removeShortcut=function(){this.myShortcutsService.removeShortcut(this.currentPage.Id).subscribe(function(e){})},i.$inject=["MyShortcutsService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/MyShortcuts/MyShortcutsAddMenu.component.html",this.bindings={}},app.component("myShortcutsAddMenu",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.paymentService=e,this.utilityService=t,this.secondaryMerchant=!1}(e=e.CrossPortal||(e.CrossPortal={})).Payment||(e.Payment={}),i.prototype.$onInit=function(){var t=this;this.uniqueId=this.utilityService.newGuid(),this.paymentService.getFormFields(this.orderId,this.transactionId,this.secondaryMerchant).then(function(e){e&&(t.overrideAcceptUrl&&0<t.overrideAcceptUrl.length&&(e.accepturl=t.overrideAcceptUrl),t.paymentWindow=new window.PaymentWindow(e),$("#payment-window-"+t.uniqueId).empty(),t.paymentWindow.append("payment-window-"+t.uniqueId),t.paymentWindow.open())})},i.prototype.$onDestroy=function(){this.paymentWindow.close(),$("#epay_frame").remove(),$("#epay_form").remove(),$("#payment-window-"+this.uniqueId).remove()},i.$inject=["PaymentService","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Payment/EpayPaymentWindow.component.html",this.bindings={orderId:"<",transactionId:"<",overrideAcceptUrl:"<",secondaryMerchant:"<"}},app.component("epayPaymentWindow",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.incomHttp=e,this.loaderService=t,this.$timeout=i,this.$q=n,this.baseurl="/umbraco/api/Payment/"}(e=e.CrossPortal||(e.CrossPortal={})).Payment||(e.Payment={}),t.prototype.getFormFields=function(e,t,i){var n=this,e={TransactionInfo:{OrderId:e,TransactionId:t},SecondaryMerchant:i},o=this.loaderService.setLoader("global","payment"),t=this.incomHttp.post(this.baseurl+"GetFormFields",e);return t.then(function(){n.loaderService.removeLoader(o)}),t},t.prototype.attachPbs=function(e,t){this.incomHttp.post(this.baseurl+"AttachPbs",{OrderId:e,TransactionId:t})},t.prototype.validatePayment=function(e,t){var i,n=this,o=0,r=this.$q.defer(),s={OrderId:e,TransactionId:t};return function t(){o++,n.incomHttp.post(n.baseurl+"ValidatePayment",s).then(function(e){null!=e?(r.resolve(e),i&&i()):i=n.$timeout(t,n.getDelay(o))})}(),r.promise},t.prototype.getDelay=function(e){return e<=2?2500:e<=5?5e3:1e4},t.$inject=["incomHttpService","LoaderService","$timeout","$q"],app.service("PaymentService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/PbsBanner/"}
1(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Pbs||(e.Pbs={})).Dashboard||(e.Dashboard={})).PbsBanner||(e.PbsBanner={}),t.prototype.getPbsBanner=function(){var e=this,t=this.loaderService.setLoader("PbsBanner","PbsBanner"),i=this.incomHttp.get("/umbraco/api/PbsBanner/GetPbsBanner");return i.then(function(){e.loaderService.removeLoader(t)}),i},t.prototype.hidePbsBanner=function(){this.incomHttp.get(this.baseurl+"HidePbsBanner")},t.$inject=["incomHttpService","LoaderService"],app.service("PbsBannerService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.profileService=e}(e=e.CrossPortal||(e.CrossPortal={})).Pbs||(e.Pbs={}),i.prototype.$onInit=function(){var t=this;this.subscription=this.profileService.profile$.subscribe(function(e){null!=e&&(t.billingTypes=e.Interessent.BillingTypes,t.pbsAgreements=t.billingTypes.where(function(e){return"Pbs"===e.BillingType}).length)})},i.prototype.updateBillingType=function(e){window.open(e.Link),this.profileService.updateBillingType(e)},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.$inject=["ProfileService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Pbs/SignUpWithPbs.component.html"},app.component("signUpWithPbs",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.profileService=e,this.validationService=t}(e=(e=e.CrossPortal||(e.CrossPortal={})).Profile||(e.Profile={})).BaseInfo||(e.BaseInfo={}),i.prototype.$onInit=function(){var t=this;this.nameRegex=this.validationService.getFullNameRegex(),this.emailRegex=this.validationService.getEmailRegex(),this.phoneRegex=this.validationService.getPhoneNumberRegex(),this.interessent={},this.subscription=this.profileService.profile$.subscribe(function(e){e&&(t.initialEmail=e.Interessent.Email,t.interessent=e.Interessent,!t.interessent.Address.Country&&t.interessent.HasEnteredCpr&&(t.interessent.Address.Country="Danmark"),t.countries=e.Countries)})},i.prototype.validateEmail=function(t){t.$error.pattern||t.$error.required||this.initialEmail===this.interessent.Email?t.$setValidity("inuse",!0):this.profileService.validateEmail(this.interessent.Email).subscribe(function(e){!1===e?t.$setValidity("inuse",e):e&&t.$setValidity("inuse",!0)})},i.prototype.validateIfCprConditionsAreRequired=function(){return this.interessent.IsTenant&&this.interessent.IsMember&&this.interessent.HasEnteredCpr||this.interessent.IsTenant&&this.interessent.IsMember&&this.hasDanishCpr},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.prototype.getAddress=function(e){e&&(this.interessent.Address.ZipCode=e.ZipCode,this.interessent.Address.City=e.City,this.interessent.Address.Street=e.Street,this.interessent.Address.Location=e.Location,this.interessent.Address.LocalTown=e.LocalTown)},i.$inject=["ProfileService","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Profile/BaseInfo/baseInfo.component.html"},app.component("profileBaseInfo",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.profileService=e,this.featureFlagService=t,this.$scope=i,this.fileService=n,this.utilityService=o,this.pageContentService=r,this.subscriptions=new Rx.CompositeDisposable,this.rawFileList=[]}(e=e.CrossPortal||(e.CrossPortal={})).Profile||(e.Profile={}),i.prototype.$onInit=function(){var t=this;this.profileService.getProfile(),this.subscriptions.add(this.profileService.profile$.subscribe(function(e){e&&e.Interessent&&(t.user=e.Interessent)})),this.smsSignup=this.featureFlagService.communication.smsSignup,this.nemIdActive=this.featureFlagService.loginFeatureFlags.enableNemId,this.ShowAvatarSettings=this.featureFlagService.profile.EnableAvatarViewOnForumAndProfile,this.$scope.$watchCollection(function(){return t.rawFileList},function(e){e&&0<e.length&&(t.profileService.updateProfileImage(e.map(function(e){return t.fileService.toUploadedFile(e)})).then(function(e){t.user.AvatarUrl=e,t.pageContentService.updateProfilePicture(e),t.utilityService.safeDigest(t.$scope)}),t.rawFileList=[])})},i.prototype.$onDestroy=function(){this.subscriptions.dispose()},i.prototype.saveProfile=function(){this.profileService.saveProfile()},i.$inject=["ProfileService","FeatureFlagService","$scope","FileService","UtilityService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Profile/EditProfile.component.html"},app.component("editProfile",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.profileService=e,this.signUpService=t,this.utilityService=i,this.$scope=n,this.disposables=new Rx.CompositeDisposable,this.startDate=new Date,this.endDate=new Date,this.education=!1}
1(e=(e=e.CrossPortal||(e.CrossPortal={})).Profile||(e.Profile={})).EducationInfo||(e.EducationInfo={}),i.prototype.$onInit=function(){var t=this;this.datePickerFormat=this.utilityService.shortDateFormat,this.isSignUp?(this.disposables.add(this.signUpService.baseInfo$.subscribe(function(e){e&&(t.availableEducations=e.Educations,t.educationInstitutions=e.EducationalInstitution)})),this.disposables.add(this.signUpService.interessent$.subscribe(function(e){e&&(t.signUpModel=e,t.educationModel=t.signUpModel.Education)}))):this.disposables.add(this.profileService.profile$.subscribe(function(e){null!=e&&(t.availableEducations=e.Educations,t.educationInstitutions=e.EducationalInstitution,t.interessent=e.Interessent,t.educationModel=t.interessent.Education,t.educationModel)&&(t.education=!0,t.educationModel.EducationEnd)&&(t.startDate=new Date(t.educationModel.EducationStart),t.endDate=new Date(t.educationModel.EducationEnd))})),this.$scope.$watch(function(){return t.education},function(){t.education?t.isSignUp?t.signUpModel.Education=t.educationModel:t.interessent.Education=t.educationModel:t.isSignUp?t.signUpModel.Education=null:t.interessent.Education=null}),this.$scope.$watch(function(){return t.educationModel},function(){t.education?(t.educationModel&&t.educationModel.Id&&(t.educationModel.Name=t.availableEducations.firstOrDefault(function(e){return e.Id===t.educationModel.Id}).Name),t.educationModel.EducationalInstitution&&t.educationModel.EducationalInstitution.Id&&(t.educationModel.EducationalInstitution.Name=t.educationInstitutions.firstOrDefault(function(e){return e.Id===t.educationModel.EducationalInstitution.Id}).Name),t.isSignUp?t.signUpModel.Education=t.educationModel:t.interessent.Education=t.educationModel):t.isSignUp?t.signUpModel.Education=null:t.interessent.Education=null},!0),this.$scope.$watch(function(){return t.startDate},function(){t.education&&(t.educationModel.EducationStart=t.utilityService.formatDate(t.startDate,"iso date"))}),this.$scope.$watch(function(){return t.endDate},function(){t.education&&(t.educationModel.EducationEnd=t.utilityService.formatDate(t.endDate,"iso date"))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["ProfileService","SignUpService","UtilityService","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Profile/EducationInfo/educationInfo.component.html",this.bindings={isSignUp:"<"}},app.component("profileEducationInfo",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.profileService=e,this.validationService=t,this.featureFlagService=i,this.disposables=new Rx.CompositeDisposable}(e=(e=e.CrossPortal||(e.CrossPortal={})).Profile||(e.Profile={})).ExtendedInfo||(e.ExtendedInfo={}),i.prototype.$onInit=function(){var t=this;this.nameRegex=this.validationService.getFullNameRegex(),this.interessent={},this.disposables.add(this.profileService.profile$.subscribe(function(e){null!=e&&(t.interessent=e.Interessent,t.numberOfChildren=e.Interessent.Children.length,t.disableAmountOfAdults=1<t.interessent.NoOfAdults&&t.featureFlagService.profile.DisableEditingOfAmountOfAdults)})),this.showPartnerInfo=this.featureFlagService.signUp.displayPartnerInfo},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.setNumberOfChildren=function(){if(this.interessent.Children.length<this.numberOfChildren)for(var e=this.interessent.Children.length;e<this.numberOfChildren;e++)this.interessent.Children.push({});if(this.interessent.Children.length>this.numberOfChildren)for(e=this.interessent.Children.length;e>this.numberOfChildren;e--)this.interessent.Children.pop()},i.$inject=["ProfileService","ValidationService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Profile/ExtendedInfo/extendedInfo.component.html"},app.component("profileExtendedInfo",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.scope=e,this.profileService=t,this.validationService=i}(e=(e=e.CrossPortal||(e.CrossPortal={})).Profile||(e.Profile={})).InformationSettings||(e.InformationSettings={}),i.prototype.$onInit=function(){var t=this;this.interessent={},this.subscription=this.profileService.profile$.subscribe(function(e){null!=e&&(t.interessent=e.Interessent)})},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.$inject=["$scope","ProfileService","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/CrossPortal/Profile/InformationSettings/informationSettings.component.html"},app.component("profileInformationSettings",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$http=e,this.loaderService=t,this.doesHaveFacebook$=new Rx.BehaviorSubject(null),this.doesHaveNemId$=ne
1w Rx.BehaviorSubject(null),this.profile$=new Rx.BehaviorSubject(null),this.openSection$=new Rx.BehaviorSubject(null),this.baseUrl="/Umbraco/api/Profile/"}(e=e.CrossPortal||(e.CrossPortal={})).Profile||(e.Profile={}),t.prototype.getProfile=function(){var t=this,i=this.loaderService.setLoader("contentSection","LoadProfile");this.$http.get(this.baseUrl+"GetProfileData").then(function(e){e&&e.Interessent&&null===e.Interessent.Children&&(e.Interessent.Children=[]),t.profile$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.updateProfileImage=function(e){return angular.isArray(e)||(e=[e]),this.$http.postFiles(this.baseUrl+"UpdateProfileImage",e)},t.prototype.attachNemId=function(e){return this.$http.post(this.baseUrl+"LoginWithNemId",e)},t.prototype.validateCprAndNemId=function(e){return this.$http.post(this.baseUrl+"ValidateAndAttachNemIdToUser?userId="+e,null)},t.prototype.attachLoginType=function(e){this.$http.post(this.baseUrl+"AttachLoginType",e)},t.prototype.detachLoginType=function(e){this.$http.post(this.baseUrl+"DetachLoginType",{Id:null,LoginType:e,LoginNodeId:null})},t.prototype.hasFacebook=function(){var t=this;return this.$http.get(this.baseUrl+"HasLoginTypeAttached?loginType=FacebookLogin").then(function(e){t.doesHaveFacebook$.onNext(e)}),this.doesHaveFacebook$},t.prototype.hasNemId=function(){var t=this;return this.$http.get(this.baseUrl+"HasLoginTypeAttached?loginType=NemIdLogin").then(function(e){t.doesHaveNemId$.onNext(e)}),this.doesHaveNemId$},t.prototype.hasEnteredCPR=function(){return this.$http.get(this.baseUrl+"HasEnteredCPR")},t.prototype.findCity=function(e){var t=this;this.$http.get("/Umbraco/api/Location/FindCityNameByZip?zipcode="+e).then(function(e){t.profile$.getValue().Interessent.Address.City=e})},t.prototype.saveProfile=function(){var e=this,t=this.loaderService.setLoader("savingProfile","edit-profile"),i=this.profile$.getValue().Interessent;this.newOfferDeliveryMode&&(i.OfferDeliveryMode=this.newOfferDeliveryMode),this.$http.post(this.baseUrl+"SaveProfile",i).then(function(){e.loaderService.removeLoader(t)})},t.prototype.updateBillingType=function(e){this.$http.post(this.baseUrl+"UpdateBillingType",e)},t.prototype.updatePassword=function(e,t){var i=this,n=this.loaderService.setLoader("savingPassword","edit-password");this.$http.post(this.baseUrl+"UpdatePassword?"+$.param({oldPassword:t,newPassword:e}),null).then(function(){i.loaderService.removeLoader(n)})},t.prototype.setNewOfferDeliveryMode=function(e){this.newOfferDeliveryMode=e},t.prototype.validateEmail=function(e){var t=new Rx.Subject;return this.$http.post(this.baseUrl+"ValidateEmail?email="+e,null).then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("ProfileService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.departmentBoardService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable}(e=e.DepartmentPage||(e.DepartmentPage={})).DepartmentBoard||(e.DepartmentBoard={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.disposables.add(t.departmentBoardService.getDepartmentBoardMembers(e.Id).subscribe(function(e){e&&(t.departmentBoardMembers=e)}))})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["DepartmentBoardService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/DepartmentPage/DepartmentBoard/DepartmentBoard.component.html",this.bindings={}},app.component("departmentBoard",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/DepartmentBoard/",this.departmentBoardMembers$=new Rx.BehaviorSubject(null)}(e=e.DepartmentPage||(e.DepartmentPage={})).DepartmentBoard||(e.DepartmentBoard={}),t.prototype.getDepartmentBoardMembers=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getBoard"),n=new Rx.Subject;return this.incomHttp.get(this.baseurl+"GetDepartmentBoardMembers/"+e).then(function(e){n.onNext(e.BoardMembers),t.loaderService.removeLoader(i)}),n},t.$inject=["incomHttpService","LoaderService"],app.service("DepartmentBoardService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.departmentOfficeService=e,this.pageContentService=t,this.disposables=new Rx.CompositeDisposable}(e=e.DepartmentPage||(e.DepartmentPage={})).DepartmentOffice||(e.DepartmentOffice={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.departmentOfficeService.getDepartmentOffice(e.Id).subscribe(function(e){e&&(t.departmentOffices=e.Offices,t.personnel=e.Personnel)})})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["DepartmentOfficeService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/DepartmentPage/DepartmentOffice/DepartmentOffice.component.html",this.bindings={}},app.component("departmentOffice",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/DepartmentOffice/"}(e=e.DepartmentPage||(e.DepartmentPage={})).DepartmentOffice||(e.DepartmentOffice={}),t.prototype.getDepartmentOffice=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getOffice"),n=new Rx.Subject;return this.incomHttp.get(this.baseurl+"GetDepartmentOffice/"+e).then(function(e){n.onNext(e),t.loaderService.removeLoader(i)}),n},t.$inject=["incomHttpService","LoaderService"],app.service("DepartmentOfficeService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s,a,l,c,d,u,p){this.departmentFrontPageService=e,this.pageContentService=t,this.basketService=i,this.utilityService=n,this.loaderService=o,this.modalService=r,this.tenancyUtilities=s,this.featureFlagService=a,this.videoService=l,this.windowService=c,this.sce=d,this.mapsUtility=u,this.tenancySearchService=p,this.disposables=new Rx.CompositeDisposable,this.googlemarkers=[],this.showBackToMyPageButton=!1,this.displayMultipleDepartmentDescriptions=!1,this.descriptionLimit=250,this.openTenancyTables=!1,this.hasExtendedPresentation=!1,this.extendedPresentationIsVideo=!1,this.showExtendedPresentationVideo=!1}
1(e=e.DepartmentPage||(e.DepartmentPage={})).FrontPage||(e.FrontPage={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e,t.departmentFrontPageService.getDepartmentFrontPage(e.Id))}),this.disposables.add(this.departmentFrontPageService.departmentFrontPage$.subscribe(function(e){e&&(t.departmentFrontPageModel?t.departmentFrontPageModel.TenancyCountInBasket=e.TenancyCountInBasket:(t.departmentFrontPageModel=e,t.googlemarkers=t.mapsUtility.getGoogleMapsMarkersFrom(t.departmentFrontPageModel),t.showAvailableButton=t.departmentFrontPageModel.TenancyGroups.any(function(e){return 0<e.AvailableTenancies.length}),t.hasExtendedPresentation=null!=t.departmentFrontPageModel.ExtendedPresentationUrl&&null!=t.departmentFrontPageModel.ExtendedPresentationPreviewImageUrl,t.hasExtendedPresentation&&(e=t.videoService.parseYoutubeVideoId(t.departmentFrontPageModel.ExtendedPresentationUrl),t.extendedPresentationIsVideo=0!=e,t.extendedPresentationIsVideo)&&(t.extendedPresentationYoutubeVideoEmbedUrl=t.sce.trustAsResourceUrl("https://www.youtube.com/embed/"+e+"?&autoplay=1"))))})),this.displayMultipleDepartmentDescriptions=this.featureFlagService.departmentPages.displayMultipleDepartmentDescriptions,this.hideTenanciesAndTenancySearchButtons=this.featureFlagService.departmentPages.hideTenanciesAndTenancySearchButtons,this.hideDepartmentIdText=this.featureFlagService.departmentPages.hideDepartmentIdText,this.utilityService.getParameterByName("StepBack")&&1<window.history.length&&(this.showBackToMyPageButton=!0),this.disposables.add(this.basketService.contents$.subscribe(function(e){e&&t.departmentFrontPageService.getDepartmentFrontPage(t.currentPage.Id,!0)}))},i.prototype.toggleDepartmentInBasket=function(){var e=this,t=this.loaderService.setLoader("department-page-toggle-wishes-"+this.departmentFrontPageModel.DepartmentId,"toggling"),i=!this.allTenanciesInBasket();this.basketService.toggleDepartment(this.departmentFrontPageModel.CompanyId,this.departmentFrontPageModel.DepartmentId,i).then(function(){e.departmentFrontPageModel.TenancyCountInBasket=i?e.departmentFrontPageModel.TotalTenancyCount:0}).finally(function(){e.loaderService.removeLoader(t)})},i.prototype.allTenanciesInBasket=function(){return!!this.departmentFrontPageModel&&this.departmentFrontPageModel&&this.departmentFrontPageModel.TenancyCountInBasket>=this.departmentFrontPageModel.TenancyCount},i.prototype.getAssignmentRuleStatus=function(e){e=e.TenancyGroups.reduce(function(e,t){return e.concat(t.Tenancies)},[]);return this.tenancyUtilities.getAssignmentRuleStatus(e)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.twoStepsBack=function(){this.currentPage.WasRedirected?window.history.go(-2):window.history.go(-1)},i.prototype.toggleShow=function(e,t){t.Show=!e,t.Show?t.Limit=Number.MAX_VALUE:t.Limit=this.descriptionLimit},i.prototype.openExtendedPresentationLinkOrShowVideo=function(){this.extendedPresentationIsVideo?this.showExtendedPresentationVideo=!0:this.windowService.open(this.departmentFrontPageModel.ExtendedPresentationUrl,"_blank")},i.$inject=["DepartmentFrontPageService","PageContentService","BasketService","UtilityService","LoaderService","ModalService","TenancyUtilitiesService","FeatureFlagService","VideoService","$window","$sce","GoogleMapsUtilityService","TenancySearchService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/DepartmentPage/FrontPage/DepartmentFrontPage.component.html",this.bindings={}},app.component("departmentFrontPage",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.departmentFrontPage$=new Rx.Subject,this.baseurl="/umbraco/api/DepartmentFrontPage/"}(e=e.DepartmentPage||(e.DepartmentPage={})).FrontPage||(e.FrontPage={}),t.prototype.getDepartmentFrontPage=function(e,t){var i,n=this;return(t=void 0===t?!1:t)||(i=this.loaderService.setLoader("contentSection","getDepFrontPage")),this.incomHttp.get(this.baseurl+"GetDepartmentFrontPage/"+e).then(function(e){n.departmentFrontPage$.onNext(e),i&&n.loaderService.removeLoader(i)}),this.departmentFrontPage$},t.$inject=["incomHttpService","LoaderService"],app.service("DepartmentFrontPageService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.moment=e,this.$filter=t}(e=e.General||(e.General={})).Calendar||(e.Calendar={}),t.prototype.getListView=function(e,t,i,n){for(var o=[],r=0;r<e.length;r++){var s=e[r],a=this.convertDateStringToMomentObject(s.EventStartTime,"YYYY-MM-DD"),l=this.convertDateStringToMomentObject(s.EventEndTime,"YYYY-MM-DD");"month"===i?(a.month()===t.month()&&a.year()===t.year()&&l.year()===t.year()||a.year()===t.year()&&l.month()===t.month()&&l.year()===t.year())&&o.push(s):a.year()===t.year()&&l.year()===t.year()&&o.push(s)}for(var c=new Array(o.length),d=0;d<o.length;d++){var u=this.convertDateStringToMomentObject(o[d].EventStartTime,"YYYY-MM-DD");c[d]={day:n?u.format("DD"):u.date(),month:u.format("MMM"),date:u.clone(),event:o[d]}}return c},t.prototype.toggleEventBreakdown=function(e,t,i){var n,o=[];
1return 0<e[t][i].events.length&&(n=e[t][i].isOpened,(e=e.map(function(e){return e.isOpened=!1,e.map(function(e){return e.isOpened=!1,e})}))[t][i].isOpened=!n,e[t].isOpened=!n,o=e[t][i].events),{view:e,openEvents:o}},t.prototype.getYearView=function(e,t){for(var i=this,n=[],o=this.getMonthNames(!1),r=0;r<3;r++){for(var s=[],a=0;a<4;a++){var l=12-o.length,c=new Date(this.moment(t).format("YYYY"),l,1),d=this.moment(c).add(1,"month").subtract(1,"second").toDate();s.push({label:o.shift(),monthIndex:l,isToday:this.moment(c).startOf("month").isSame(this.moment().startOf("month")),events:e.filter(function(e){return i.eventIsInPeriod(i.convertDateStringToMomentObject(e.EventStartTime,"YYYY-MM-DD"),i.convertDateStringToMomentObject(e.EventEndTime,"YYYY-MM-DD"),c,d,!0)})})}n.push(s)}return n},t.prototype.getMonthView=function(e,t,i,n){for(var o=this,r=this.isIsoWeek(i)?1:0,s=this.moment(t).startOf("month"),a=this.moment(t).endOf("month").date(),l=[],c=new Array(7),d=1;d<=a;d++){if(1===d)for(var u=this.getWeekDayIndex(s,r),p=s.clone();0<u;)u--,p=p.subtract(1,"day"),c[u]={label:n?p.format("DD"):p.date(),date:p.clone(),inMonth:!1,events:[]};if(c[this.getWeekDayIndex(s,r)]={label:n?s.format("DD"):s.date(),inMonth:!0,isToday:this.moment().startOf("day").isSame(s),date:s.clone(),events:e.filter(function(e){return o.eventIsInPeriod(o.convertDateStringToMomentObject(e.EventStartTime,"YYYY-MM-DD"),o.convertDateStringToMomentObject(e.EventEndTime,"YYYY-MM-DD"),s.clone().startOf("day"),s.clone().endOf("day"),!1)})},d===a)for(var u=this.getWeekDayIndex(s,r),h=s.clone();u<6;)u++,h=h.add(1,"day"),c[u]={label:n?h.format("DD"):h.date(),date:h.clone(),inMonth:!1,events:[]};6!==this.getWeekDayIndex(s,r)&&d!==a||(l.push(c),c=new Array(7)),s=s.add(1,"day")}return l},t.prototype.getWeekDayNames=function(e,t){for(var i=e?"ddd":"dddd",n=[],o=this.isIsoWeek(t)?22:21,r=0;r<=6;r++)n.push(this.moment(new Date(2014,8,o+r)).format(i));return n},t.prototype.isIsoWeekBasedOnLocale=function(){return 1===this.moment().startOf("week").day()},t.prototype.isIsoWeek=function(e){return angular.isDefined(e)?e:this.isIsoWeekBasedOnLocale()},t.prototype.getMonthNames=function(e){for(var t=e?"MMM":"MMMM",i=[],n=0;n<=11;n++)i.push(this.moment(new Date(2014,n)).format(t));return i},t.prototype.eventIsInPeriod=function(e,t,i,n,o){e=this.moment(e),t=this.moment(t),i=this.moment(i),n=this.moment(n);return!!(e.isAfter(i)&&t.isBefore(n)||t.isAfter(i)&&t.isBefore(n)||e.isBefore(i)&&t.isAfter(n)||o&&e.isAfter(i)&&t.isAfter(n)&&e.format("MM-YYYY")===i.format("MM-YYYY")||e.format("DD-MM-YYYY")===i.format("DD-MM-YYYY")||t.format("DD-MM-YYYY")===n.format("DD-MM-YYYY"))},t.prototype.convertDateStringToMomentObject=function(e,t){e=e.split("T");return this.moment(e[0],t)},t.prototype.getWeekDayIndex=function(e,t){e=e.day()-t;return e=e<0?6:e},t.$inject=["moment","$filter"],app.service("CalendarHelperLogic",t)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o){this.cmsCalendarService=e,this.moment=t,this.utilityService=i,this.modalService=n,this.pageContentService=o,this.disposeables=new Rx.CompositeDisposable,this.categoryCollection=[],this.view="month",this.autoOpen=!1}e=e.General||(e.General={}),i=e.Calendar||(e.Calendar={}),n.prototype.$onInit=function(){var t=this;this.widget=!1,this.currentDay=new Date,this.titleFunctions={month:function(){return t.moment(t.currentDay).format("MMMM YYYY")},year:function(){return t.moment(t.currentDay).format("YYYY")}},this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.cmsCalendarService.getCalendarEventsForOverview(e.Id)}),this.disposeables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)})),this.disposeables.add(this.cmsCalendarService.calendar$.subscribe(function(e){null!=e&&(t.canCreateEvent=e.CanCreateEvent,t.canCreateCategory=e.CanCreateCategories,t.canEditCategories=e.CanEditCategories,t.canDeleteCategories=e.CanDeleteCategories,t.events=e.CalendarEvents,t.showCalendar=!1,e=t.utilityService.getParameters("hash"),t.canCreateEvent)&&null!=e.NewEvent&&t.createNewEvent()}))},n.prototype.$onDestroy=function(){this.disposeables.dispose()},n.prototype.prev=function(){this.currentDay=this.moment(this.currentDay).subtract(1,this.view).toDate()},n.prototype.next=function(){this.currentDay=this.moment(this.currentDay).add(1,this.view).toDate()},n.prototype.changeView=function(e){this.view=e},n.prototype.changeViewFromChild=function(e,t){this.view=e,this.currentDay=t},n.prototype.getTitle=function(){return this.titleFunctions[this.view]?this.titleFunctions[this.view]():""},n.prototype.createCalendarCategory=function(){var t=this;this.modalService.createModal("/App/General/Calendar/Modals/CreateCalendarCategory.modal.html",i.Modals.CreateCalendarCategoryController,null,"md").result.then(function(e){e&&t.cmsCalendarService.createCalendarCategory(e,t.currentPage.Id)})},n.prototype.manageCalendarCategory=function(){var e=this,t={canDelete:this.canDeleteCategories,canEdit:this.canEditCategories};this.modalService.createModal("/App/General/Calendar/Modals/EditCalendarCategory.modal.html",i.Modals.EditCalendarCategoryController,t,"md").result.then(function(){e.cmsCalendarService.getCalendarEventsForOverview(e.currentPage.Id)})},n.prototype.createNewEvent=function(){this.isEditing.isNewPage=!0,this.isEditing.sortPages=!1,this.isEditing.deletePages=!1,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing)},n.$inject=["CmsCalendarService","moment","UtilityService","ModalService","PageContentService"],t=n,i.CmsCalendarComponentController=t,e=function(){this.controller=t,this.templateUrl="/App/General/Calendar/CmsCalendar.component.html",this.bindings={useIsoWeek:"&",useShortWeekdayNames:"&",padSingleDigitDates:"&",colorOnMultipleEventTypes:"@",widget:"&"}},app.component("cmsCalendar",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/Umbraco/Api/CmsCalendar/",this.calendar$=new Rx.BehaviorSubject(null),this.calendarOptions$=new Rx.BehaviorSubject(null),this.calendarCategories$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).Calendar||(e.Calendar={}),t.prototype.getCalendarEventsForOverview=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getEvents");this.incomHttp.get("".concat(this.baseurl,"GetCalendarEventsForOverview/").concat(e)).then(function(e){t.calendar$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getCalendarEventOptions=function(e){var t=this;this.incomHttp.get(this.baseurl+"GetCalendarEventOptions/"+e).then(function(e){t.calendarOptions$.onNext(e)})},t.prototype.deleteCalendarEvent=function(e){var t=this,i=this.loaderService.setLoader("contentSection","deleteEvent");
1this.incomHttp.delete(this.baseurl+"DeleteCalendarEvent/"+e).then(function(e){return t.loaderService.removeLoader(i)})},t.prototype.createCalendarCategory=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","createCategory");this.incomHttp.post(this.baseurl+"CreateCalendarCategory/"+t,e).then(function(){i.getCalendarEventsForOverview(t),i.loaderService.removeLoader(n)})},t.prototype.getCalendarCategories=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getCategories");this.incomHttp.get(this.baseurl+"GetCalendarCategories/"+e).then(function(e){t.calendarCategories$.onNext(e.CalendarCategories),t.loaderService.removeLoader(i)})},t.prototype.deleteCategory=function(e){var t=this,i=this.loaderService.setLoader("contentSection","deleteCategory");return this.incomHttp.delete(this.baseurl+"DeleteCalendarCategory/"+e).then(function(e){return t.loaderService.removeLoader(i)})},t.prototype.updateCategory=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","updateCategory");return this.incomHttp.post(this.baseurl+"UpdateCategory/"+t,e).then(function(e){return i.loaderService.removeLoader(n)})},t.$inject=["incomHttpService","LoaderService"],app.service("CmsCalendarService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.utilityService=e,this.calendarService=t,this.feedbackService=i,this.pageContentService=n,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).Calendar||(e.Calendar={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.calendarService.getCalendarEventOptions(e.Id)}),this.disposables.add(this.calendarService.calendarOptions$.subscribe(function(e){e&&(t.calendarOptions=e)})),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.editPage=function(){this.calendarOptions.CanEdit&&(this.isEditing.isNewPage=!1,this.isEditing.sortPages=!1,this.isEditing.deletePages=!1,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing))},i.prototype.deletePage=function(){var t=this;this.calendarOptions.CanDelete&&this.feedbackService.showConfirmbox({Headline:"Er du sikker?",Message:"<p>Er du sikker på at du vil slette begivenheden?</p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){t.calendarService.deleteCalendarEvent(t.currentPage.Id)},function(e){})},i.$inject=["UtilityService","CmsCalendarService","FeedbackService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Calendar/CmsCalendarOptions.component.html",this.bindings={}},app.component("cmsCalendarOptions",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/BoardCalendar/",this.myBoardCalendar$=new Rx.BehaviorSubject(null)}
1(e=(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Dashboard||(e.Dashboard={})).BoardCalendar||(e.BoardCalendar={}),t.prototype.getBoardCalendarEvent=function(e){var t=this,i=this.loaderService.setLoader("boardcalendar","getlatestcalendarevents");return this.incomHttp.get("".concat(this.baseurl,"GetNewestCalendarEvents?amount=").concat(e)).then(function(e){t.myBoardCalendar$.onNext(e),t.loaderService.removeLoader(i)}),this.myBoardCalendar$},t.$inject=["incomHttpService","LoaderService"],app.service("BoardCalendarService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.calendarHelperLogic=e,this.moment=t,this.definitionHelper=i,this.firstRun=!1}(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).List||(e.List={}),i.prototype.$onInit=function(){this.updateView()},i.prototype.$onChanges=function(e){(e.viewType||e.currentDay||e.events)&&this.updateView()},i.prototype.getDefinitionSeperator=function(e){return this.definitionHelper.getDefinitionSeperator(e)},i.prototype.updateView=function(){if(this.viewType&&this.currentDay&&this.events&&(this.view=this.calendarHelperLogic.getListView(this.events,this.moment(this.currentDay),this.viewType,this.padSingleDigitDates),!0===this.hideOld)){for(var e=[],t=0;t<this.view.length;t++)new Date<new Date(this.view[t].event.EventEndTime)&&e.push(this.view[t]);this.view=e}},i.$inject=["CalendarHelperLogic","moment","ImageDefinitionHelperService"],t=i,e=function(){this.controller=t,this.templateUrl="/App/General/Calendar/List/CmsCalendarList.component.html",this.require={parentCtrl:"^^cmsCalendar"},this.bindings={events:"<",currentDay:"<",padSingleDigitDates:"<",viewType:"<",useShortWeekdayNames:"<",hideOld:"<"}},app.component("cmsCalendarList",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){},t.prototype.submit=function(){this.$modalInstance.close(this.model)},t.$inject=["$uibModalInstance","modalData"],e.CreateCalendarCategoryController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o){this.$modalInstance=e,this.modalData=t,this.cmsCalendarService=i,this.feedbackService=n,this.pageContentService=o,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.canEdit=this.modalData.canEdit,this.canDelete=this.modalData.canDelete,this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.cmsCalendarService.getCalendarCategories(e.Id)}),this.disposables.add(this.cmsCalendarService.calendarCategories$.subscribe(function(e){e&&(t.calendarCategories=e)}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.toggleEditing=function(){this.editing=!this.editing},t.prototype.deleteCategory=function(){var t=this;this.feedbackService.showConfirmbox({Headline:"Er du sikker på at du vil slette kategorien?",Message:"<p>Dette sletter også alle tilhørende begivenheder!</p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){t.cmsCalendarService.deleteCategory(t.selectedCategory.Id).then(function(){t.$modalInstance.close()})},function(e){})},t.prototype.submit=function(){var e=this;this.cmsCalendarService.updateCategory(this.selectedCategory,this.currentPage.Id).then(function(){e.$modalInstance.close()})},t.$inject=["$uibModalInstance","modalData","CmsCalendarService","FeedbackService","PageContentService"],e.EditCalendarCategoryController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.calendarHelperLogic=e,this.moment=t,this.firstRun=!1}(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Month||(e.Month={}),i.prototype.$onInit=function(){this.weekDays=this.calendarHelperLogic.getWeekDayNames(this.useShortWeekdayNames,this.useIsoWeek),this.updateView()},i.prototype.$onChanges=function(e){(e.currentDay||e.events)&&this.updateView()},i.prototype.updateView=function(){var n=this;this.currentDay&&this.events&&(this.view=this.calendarHelperLogic.getMonthView(this.events,this.currentDay,this.useIsoWeek,this.padSingleDigitDates),this.autoOpen)&&!this.firstRun&&this.view.forEac
1h(function(e,i){e.forEach(function(e,t){e.inMonth&&n.moment(n.currentDay).startOf("day").isSame(e.date.startOf("day"))&&(n.dayClicked(i,t),n.firstRun=!1)})})},i.prototype.getBackground=function(e){var t=e.events;if(0===t.length)return{};for(var i="",n=0;n<t.length;n++)if(""===i)i=t[n].Color;else if(t[n].Color!==i)return{"background-color":"#".concat(this.colorOnMultipleEventTypes)};return{"background-color":"#".concat(i)}},i.prototype.dayClicked=function(e,t){e=this.calendarHelperLogic.toggleEventBreakdown(this.view,e,t);this.view=e.view,this.openEvents=e.openEvents,0===this.openEvents.length&&this.updateView()},i.$inject=["CalendarHelperLogic","moment"],t=i,e=function(){this.controller=t,this.templateUrl="/App/General/Calendar/Month/CmsCalendarMonth.component.html",this.require={parentCtrl:"^^cmsCalendar"},this.bindings={events:"<",currentDay:"<",useIsoWeek:"<",useShortWeekdayNames:"<",padSingleDigitDates:"<",colorOnMultipleEventTypes:"<",autoOpen:"<"}},app.component("cmsCalendarMonth",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.calendarHelperLogic=e,this.moment=t,this.firstRun=!1}(e=(e=e.General||(e.General={})).Calendar||(e.Calendar={})).Year||(e.Year={}),i.prototype.$onInit=function(){this.updateView()},i.prototype.$onChanges=function(e){(e.currentDay||e.events)&&this.updateView()},i.prototype.updateView=function(){var n=this;this.currentDay&&this.events&&(this.view=this.calendarHelperLogic.getYearView(this.events,this.currentDay),this.autoOpen)&&!this.firstRun&&this.view.forEach(function(e,i){e.forEach(function(e,t){e.label==n.moment(n.currentDay).format("MMMM")&&(n.monthClicked(i,t),n.firstRun=!1)})})},i.prototype.monthClicked=function(e,t){e=this.calendarHelperLogic.toggleEventBreakdown(this.view,e,t);this.view=e.view,this.openEvents=e.openEvents},i.prototype.drillDown=function(e){this.parentCtrl.changeViewFromChild("month",this.moment(this.currentDay).clone().month(e).toDate())},i.$inject=["CalendarHelperLogic","moment"],t=i,e=function(){this.controller=t,this.templateUrl="/App/General/Calendar/Year/CmsCalendarYear.component.html",this.require={parentCtrl:"^^cmsCalendar"},this.bindings={events:"<",currentDay:"<",autoOpen:"<"}},app.component("cmsCalendarYear",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t){var i=this;this.catalogService=e,this.modalLogic=t,this.todoSortable={start:function(e,t){t.placeholder.height(t.item.height())},stop:function(){i.updateSortOrder()}},this.isShowing=!1,this.showing=!1,this.numberOfPages=0}e=e.General||(e.General={}),t=e.Catalog||(e.Catalog={}),n.prototype.$onInit=function(){var t=this;this.addingPageSubscription=this.catalogService.addingPage$.subscribe(function(e){t.addingNewPage=e}),this.catalogPagesSubscription=this.catalogService.catalogPages$.subscribe(function(e){t.catalogPreview=e,t.numberOfPages=e.length}),this.isShowingSubscription=this.catalogService.isOpen$.subscribe(function(e){t.isShowing=e})},n.prototype.$onDestroy=function(){this.addingPageSubscription.dispose(),this.catalogPagesSubscription.dispose(),this.isShowingSubscription.dispose()},n.prototype.showPage=function(e){this.modalLogic.createModal("/App/General/Catalog/Modal/CatalogModal.html",t.Modal.CatalogModalController,{page:e},"lg")},n.prototype.removePage=function(e){this.catalogService.removePage(e)},n.prototype.getPdf=function(){this.catalogService.getPdf()},n.prototype.abandonCatalog=function(){this.catalogService.abandonCatalog()},n.prototype.updateSortOrder=function(){var e=this.catalogPreview.map(function(e){return e.Id});this.catalogService.updateSortOrder(e)},n.prototype.toggleCatalog=function(){this.catalogService.toggleCatalog()},n.$inject=["CatalogService","ModalService"],i=n,e=function(){this.controller=i,this.templateUrl="/App/General/Catalog/Catalog.component.html"},app.component("catalog",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.loaderService=t,this.featureFlagService=i,this.catalogController="/umbraco/Surface/CatalogSurface",this.catalogPages$=new Rx.BehaviorSubject([]),this.addingPage$=new Rx.BehaviorSubject(!1),this.isOpen$=new Rx.BehaviorSubject(!1),this.featureFlagService.catalogFlags.enableCatalog&&this.getPages()}(e=e.General||(e.General={})).Catalog||(e.Catalog={}),t.prototype.getPages=function(){var t=this;this.$http.get("".concat(this.catalogController,"/GetPagesInCatalog")).then(function(e){e&&t.catalogPages$.onNext(e.CatalogItemViewModels)})},t.prototype.toggleCatalog=function(){this.isOpen$.onNext(!this.isOpen$.getValue())},t.prototype.addPage=function(e,t){var i=this,n=this.loaderService.setLoader("catalog","add-page"),t=(this.addingPage$.onNext(!0),{NodeId:t,Html:e,CompanyId:0,DepartmentId:0});this.$http.post("".concat(this.catalogController,"/AddPage/"),t).then(function(e){i.catalogPages$.getValue().add(e),i.catalogPages$.onNext(i.catalogPages$.getValue()),i.loaderService.removeLoader(n),i.addingPage$.onNext(!1)})},t.prototype.addTenancySearchPage=function(e,t,i){var n=this,o=this.loaderService.setLoader("add-department-catalog_".concat(i,"_").concat(t),"add-page"),e=(this.addingPage$.onNext(!0),{NodeId:e,CompanyId:t,DepartmentId:i,Html:void 0});this.$http.post("".concat(this.catalogController,"/AddPage/"),e).then(function(e){n.catalogPages$.getValue().add(e),n.catalogPages$.onNext(n.catalogPages$.getValue()),n.loaderService.removeLoader(o),n.addingPage$.onNext(!1)})},t.prototype.removePage=function(e){var t=this;this.$http.post("".concat(this.catalogController,"/RemovePage/").concat(e.Id),null).then(function(){t.catalogPages$.getValue().remove(e),t.catalogPages$.onNext(t.catalogPages$.getValue())})},t.prototype.updateSortOrder=function(e){return Rx.Observable.fromPromise(this.$http.post("".concat(this.catalogController,"/UpdateSortOrder"),e))},t.prototype.abandonCatalog=function(){var e=this;this.$http.post("".concat(this.catalogController,"/AbandonCatalog"),null).then(function(){e.getPages()})},t.prototype.getPdf=function(){window.open("".concat(this.catalogController,"/DownloadCatalog"),"_blank","")},t.$inject=["incomHttpService","LoaderService","FeatureFlagService"],app.service("CatalogService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.element=e,this.catalogService=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable}(e=(e=e.General||(e.General={})).Catalog||(e.Catalog={})).Directives||(e.Directives={}),i.prototype.$onInit=function(){var t=this;this.element.click(function(){return t.addPage()}),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){t.currentPage=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.addPage=function(){if(this.isTenancySearch)this.catalogService.addTenancySearchPage(this.currentPage.Id,this.companyId,this.departmentId);else{var e=angular.copy(this.element.closest(".catalog-area")),t=((e=e||angular.copy(angular.element(".catalog-area"))).find(".ng-hide").remove(),[]);e.attr("class").split(" ").forEach(function(e){e.startsWith("col-")&&t.push(e)});for(var i=0;i<t.length;i++)e.removeClass(t[i]);e.addClass("col-md-12");var n=e[0].outerHTML;this.catalogService.addPage(n,this.currentPage.Id)}},i.$inject=["$element","CatalogService","PageContentService"],t=i,app.directive("addcatalog",function(){return{restrict:"A",controller:t,scope:{},bindToController:{isTenancySearch:"<",companyId:"<",departmentId:"<"}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.model=this.modalData}e=(e=(e=e.General||(e.General={})).Catalog||(e.Catalog={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.CatalogModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s,a){this.contactFormService=e,this.htmlToPdfService=t,this.formService=i,this.validationService=n,this.fileService=o,this.pageContentService=r,this.locationService=s,this.$scope=a,this.disposables=new Rx.CompositeDisposable,this.files=[],this.contactForm={User:{Address:{}}},this.maxTotalSize=10240}(e=(e=e.General||(e.General={})).Forms||(e.Forms={})).Contact||(e.Contact={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.contactFormService.setupContactForm(e.Id)}),this.disposables.add(this.locationService.getCountries().subscribe(function(e){e&&(t.countries=e)})),this.disposables.add(this.contactFormService.contactForm$.subscribe(function(e){e&&(t.categories=e.Options,1===t.categories.length)&&(t.contactForm.Category=t.categories.firstOrDefault())})),this.disposables.add(this.contactFormService.currentUserInfo().subscribe(function(e){!e||(t.contactForm.User=e).Address.Country||(t.contactForm.User.Address.Country="Danmark")})),this.emailRegex=this.validationService.getEmailRegex()},i.prototype.getAddress=function(e){e&&(this.contactForm.User.Address.ZipCode=e.ZipCode,this.contactForm.User.Address.City=e.City,this.contactForm.User.Address.Street=e.Street,this.contactForm.User.Address.Location=e.Location,this.contactForm.User.Address.LocalTown=e.L
1ocalTown)},i.prototype.sendMail=function(){var e=angular.copy(this.contactForm);this.contactFormService.sendContactForm(e,this.uploadedFiles)&&this.formService.clearFields(this.form)},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".contact-page","Kontakt")},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["ContactFormService","HtmlToPdfService","FormService","ValidationService","FileService","PageContentService","LocationService","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Contact/ContactForm.Component.html"},app.component("contactForm",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.contactForm$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/ContactForm/",this.currentUser$=new Rx.BehaviorSubject(null)}(e=(e=e.General||(e.General={})).Forms||(e.Forms={})).Contact||(e.Contact={}),t.prototype.setupContactForm=function(e){var t=this,i=this.loaderService.setLoader("global","loadForm");this.incomHttp.get("".concat(this.baseurl,"SetupContactForm/").concat(e)).then(function(e){t.contactForm$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.currentUserInfo=function(){var t=this,i=this.loaderService.setLoader("contentSection","getUser");return this.incomHttp.get(this.baseurl+"/CurrentUserInfo/").then(function(e){t.currentUser$.onNext(e),t.loaderService.removeLoader(i)}),this.currentUser$},t.prototype.sendContactForm=function(t,e){function i(e){return n.incomHttp.post(n.baseurl+"SendContactForm/"+e||"",t).then(function(e){return n.loaderService.removeLoader(o),e})}var n=this,o=this.loaderService.setLoader("contentSection","postForm");return e&&0<e.length?this.incomHttp.postFiles(this.baseurl+"PrepareFiles",e).then(i):i(null).then(function(e){return e}),!1},t.$inject=["incomHttpService","LoaderService"],app.service("ContactFormService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.cookieConsentService=e,this.$sce=t}(e=e.General||(e.General={})).Cookie||(e.Cookie={}),i.prototype.$onInit=function(){var t=this;this.cookieConsentService.hasConsented()||(this.cookieConsentService.getCookieConsent(),this.subscription=this.cookieConsentService.cookieConsent$.subscribe(function(e){t.cookieConsent=e}))},i.prototype.consent=function(){this.cookieConsentService.consent()},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.$inject=["CookieConsentService","$sce"],t=i,e=function(){this.controller=t,this.templateUrl="/App/General/Cookie/CookieConsent.component.html"},app.component("cookieConsent",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.storageService=i,this.cookieConsent$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).Cookie||(e.Cookie={}),t.prototype.getCookieConsent=function(){var t=this;this.incomHttp.get("/umbraco/api/CookieConsent/GetCookieConsent").then(function(e){t.cookieConsent$.onNext(e)})},t.prototype.hasConsented=function(){return this.storageService.getAcceptedCookies()},t.prototype.consent=function(){this.storageService.setAcceptedCookies(!0),this.cookieConsent$.onNext(null)},t.$inject=["incomHttpService","LoaderService","StorageService"],app.service("CookieConsentService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.faqService=e,this.pageContentService=t,this.$location=i,this.$sce=n,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).Faq||(e.Faq={}),i.prototype.$onInit=function(){var t=this;this.faqService.getIdForFaqItemOrCategory(this.$location.url()).then(function(e){t.itemId=e,t.pageContentService.currentPage$.take(1).subscribe(function(e){e&&t.doGetFaq(e.Id)})})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.doGetFaq=function(e){var t=this;this.disposables.add(this.faqService.getFaqOverview(e).subscribe(function(e){e&&(t.faqCategories=e.Categories,t.faqCategories.forEach(function(e){e.Questions.forEach(function(e){e.Answer=t.$sce.trustAsHtml(e.Answer)}
1),e.SubCategories.forEach(function(e){e.Questions.forEach(function(e){e.Answer=t.$sce.trustAsHtml(e.Answer)})})}),t.openCategory())}))},i.prototype.openCategory=function(){for(var e,t=this.itemId,i=0;i<this.faqCategories.length;i++){if(e=this.faqCategories.firstOrDefault(function(e){return e.Id===t})){this.selectedFaqCategory=e;break}if(e=this.faqCategories[i].Questions.firstOrDefault(function(e){return e.Id===t})){this.selectedFaqCategory=this.faqCategories[i],this.showThis(e);break}if(e=this.faqCategories[i].SubCategories.firstOrDefault(function(e){return e.Id===t})){this.selectedFaqCategory=this.faqCategories[i],this.selectedFaqSubCategory=e;break}for(var n=0;n<this.faqCategories[i].SubCategories.length;n++)if(e=this.faqCategories[i].SubCategories[n].Questions.firstOrDefault(function(e){return e.Id===t})){this.selectedFaqCategory=this.faqCategories[i],this.selectedFaqSubCategory=this.faqCategories[i].SubCategories[n],this.showThis(e);break}}},i.prototype.showThis=function(e){var t=!e.show;this.faqCategories.forEach(function(e){e.Questions.forEach(function(e){e.show=!1}),e.SubCategories.forEach(function(e){e.Questions.forEach(function(e){e.show=!1})})}),e.show=t},i.$inject=["CmsFaqService","PageContentService","$location","$sce"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Faq/CmsFaq.component.html"},app.component("cmsFaq",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.faq$=new Rx.Subject,this.baseurl="/Umbraco/api/Faq/"}(e=e.General||(e.General={})).Faq||(e.Faq={}),t.prototype.getFaq=function(){var t=this,i=this.loaderService.setLoader("contentSection","getFaq");return this.incomHttp.get(this.baseurl+"GetFaqCategories").then(function(e){t.faq$.onNext(e),t.loaderService.removeLoader(i)}),this.faq$},t.prototype.getFaqOverview=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getFaq");return this.incomHttp.get(this.baseurl+"GetFaqOverviewById/".concat(e)).then(function(e){t.faq$.onNext(e),t.loaderService.removeLoader(i)}),this.faq$},t.prototype.getFaqItems=function(e){var t=this,i=new Rx.Subject,n=this.loaderService.setLoader("contentSection","getFaq");return this.incomHttp.get(this.baseurl+"GetFaqItems?currentPageId="+e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.prototype.getIdForFaqItemOrCategory=function(e){return this.incomHttp.get(this.baseurl+"GetIdForFaqItemOrCategory?url="+encodeURIComponent(e))},t.$inject=["incomHttpService","LoaderService"],app.service("CmsFaqService",t)}(BoligExtra=BoligExtra||{}),!function(n){var e,i,t,o;function r(e,t,i,n,o,r,s,a,l,c,d,u,p,h){this.$scope=e,this.frontEndEditServiceInstance=t,this.fileService=i,this.modalService=n,this.windowService=o,this.utilityService=r,this.feedbackService=s,this.pageContentService=a,this.frontEndEditUtilityService=l,this.frontEndEditPermissionService=c,this.frontEndEditCalendarService=d,this.frontEndEditNewsService=u,this.projectAdministrationService=p,this.featureFlagService=h,this.disposables=new Rx.CompositeDisposable,this.selectedContentSection=0,this.isSaving=!1,this.selectedProjectPresentation=!1,this.projectNews="ProjectNewsViewModel",this.newsItem="CmsNewsViewModel",this.companyDepartmentNewsItem="CompanyDepartmentCmsNewsViewModel",this.calendarEvent="CmsCalendarEventViewModel",this.projectPage="ProjectPageViewModel",this.hstep=1,this.mstep=15,this.isChooseRowShown=!1,this.availableContentTypes=null,this.selectedContentType=null,this.content=null,this.contentSections=[{name:"Vælg side type",selected:!0,content:[],hide:!1},{name:"Side information",selected:!1,content:["Overskrift","Manchettekst","Oversigtsbillede"],hide:!1},{name:"Udvidet sideindstillinger",selected:!1,content:[],hide:!1},{name:"SEO, tags og søgeord",selected:!1,content:["Meta-titel","Metabeskrivelse","Nøgleord til søgning"],hide:!1},{name:"Side indhold",selected:!1,content:["Indhold"],hide:!1},{name:"Gem og udgiv",content:[],hide:!1}],this.tempPresentationImage=null,this.contentHeadersSet=!1,this.sortableOptions={handle:".edit-section >
1 .edit-controls .drag-handle"},this.sortableContentOptions={handle:".editor-field .edit-controls .drag-handle"},this.sortableOptionsTiles={handle:".edit-controls > .drag-handle"},this.releaseDate=new Date,this.fromDate=new Date,this.toDate=new Date,this.datepickerOptionsTo={minDate:this.fromDate},this.allDepartmentSelected=!1}e=n.General||(n.General={}),i=e.FrontEndEdit||(e.FrontEndEdit={}),r.prototype.$onInit=function(){var i=this;this.frontEndEditService=this.frontEndEditServiceInstance.getInstance(),this.datePickerFormat=this.utilityService.shortDateFormat,this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(i.isEditing=e)})),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){(i.currentPage=e)&&(i.isNew||(i.contentSections[0].hide=!0,i.contentSections[1].selected=!0,i.frontEndEditService.getCurrentPageProperties(i.currentPage.Id)),i.frontEndEditPermissionService.getAvailablePageTypes(i.currentPage.Id))})),this.isNew?this.disposables.add(this.frontEndEditService.newPageProperties$.subscribe(function(e){var t;null!=e&&(i.content=e,i.content.Type===i.newsItem||i.content.Type===i.companyDepartmentNewsItem?(t=i.content,i.releaseDate=new Date(t.ReleaseDate),1===t.AvailableCategories.length&&(i.selectedNewsCategory=t.AvailableCategories[0])):i.content.Type===i.calendarEvent?(1===(t=i.content).AvailableCategories.length&&(i.selectedNewsCategory=t.AvailableCategories[0]),i.fromDate=new Date(t.FromDate),i.toDate=new Date(t.ToDate),i.fromDate.setMinutes(0),i.toDate.setMinutes(0),i.calendarDateSelectedChanged()):i.content.Type===i.projectNews&&(t=i.content,i.releaseDate=new Date(t.ReleaseDate)),i.setContentSections())})):this.disposables.add(this.frontEndEditService.currentPageProperties$.subscribe(function(e){var t;null!=e&&(i.content=e,i.content.Type===i.newsItem?(t=i.content,i.selectedNewsCategory=t.AvailableCategories.firstOrDefault(function(e){return e.Selected}),i.releaseDate=new Date(t.ReleaseDate)):i.content.Type===i.companyDepartmentNewsItem?(t=i.content,i.selectedNewsCategory=t.AvailableCategories.firstOrDefault(function(e){return e.Selected}),i.releaseDate=new Date(t.ReleaseDate),i.allDepartmentSelected=!t.AvailableDepartments.any(function(e){return 0==e.Selected})):i.content.Type===i.calendarEvent?(t=i.content,i.selectedCalendarCategory=t.AvailableCategories.firstOrDefault(function(e){return e.Selected}),i.fromDate=new Date(t.FromDate),i.toDate=new Date(t.ToDate),i.calendarDateSelectedChanged()):i.content.Type===i.projectPage&&(t=i.content,null==i.projectAdministrationService.activeProjectEdit)&&i.disposables.add(i.projectAdministrationService.getProject(t.NodeId).subscribe(function(e){i.projectAdministrationService.activeProjectEdit=e})),i.setContentSections())})),this.disposables.add(this.frontEndEditPermissionService.availableContentTypes$.subscribe(function(e){null!=e&&(i.availableContentTypes=e,null!=i.availableContentTypes)&&1===i.availableContentTypes.length&&(i.contentSections[0].hide=!0,i.contentSections[1].selected=!0,i.selectedContentType=i.availableContentTypes[0],i.selectedContentTypeChanged())})),this.disposables.add(this.frontEndEditUtilityService.getDefaultEditorConfig().subscribe(function(e){null!=e&&(i.rawGridEditorsFromConfigFile=e)})),this.disposables.add(this.frontEndEditNewsService.newsCategories$.subscribe(function(e){(e&&i.content.Type===i.newsItem||e&&i.content.Type===i.companyDepartmentNewsItem)&&(i.content.AvailableCategories=e)})),this.disposables.add(this.frontEndEditCalendarService.calendarCategories$.subscribe(function(e){e&&i.content.Type===i.calendarEvent&&(i.content.AvailableCategories=e)})),this.$scope.$watch(function(){return i.tempPresentationImage},function(e,t){e&&e!==t&&(i.uploadedPrensentationImage=i.fileService.toUploadedFile(e,n.Utility.File.UploadedFileType.Image),i.fileService.attachThumbnail(i.uploadedPrensentationImage,i.$scope),i.tempPresentationImage=null,i.frontEndEditService.uploadPresentationImage(i.uploadedPrensentationImage,i.content))}),this.projectPresentationEnabled=this.featureFlagService.frontEndEdit.enableProjectPresentation},r.prototype.$onDestroy=function(){this.disposables.dispose()},r.prototype.setContentSections=function(){switch(this.content.Type){case this.newsItem:case this.companyDepartmentNewsItem:this.contentSections[2].content=["Kategori","Udgivelsesdato"],this.contentSections[1].selected=!0;break;case this.calendarEvent:this.contentSections[1].content[0]="Emne",this.contentSections[1].content[1]="Kort beskrivelse",this.contentSections[2].content=["Kategori","Sted","Begivenheds periode"],this.contentSections[1].selected=!0;break;case this.projectNews:this.contentSections[2].content=["Udgivelsesdato"];break;default:this.contentSections[2].hide=!0}this.contentHeadersSet=!0},r.prototype.calendarDateSelectedChanged=function(){this.fromDate.getDate()>this.toDate.getDate()&&(this.toDate=this.fromDate),this.datepickerOptionsTo={minDate:this.fromDate}},r.prototype.selectNewContent=function(t){var e={rawGridEditorsFromConfigFile:this.rawGridEditorsFromConfigFile};this.modalService.createModal("/App/General/FrontEndEdit/Modals/NewContent.modal.html",i.Modals.NewContentController,e,"md").result.then(function(e){e&&(t.controls=t.controls||[],t.controls.push(e))}),this.isChooseRowShown=!1},r.prototype.newContent=function(e){for(var t=angular.copy(e),i=0;i<t.areas.length;i++)t.areas[i].controls=[];this.content.Grid.sections[0].rows.push(t),this.isChooseRowShown=!1},r.prototype.removeItemInCollection=function(e,t){e.splice(t,1)},r.prototype.selectedContentTypeChanged=function(){this.frontEndEditService.getNewPageProperties(this.selectedContentType,this.currentPage.Id),this.selectSection(1)},r.prototype.selectSection=function(e){if(!0===this.contentSections[e].selected)this.contentSections[e].selected=!1;else{for(var t=0;t<this.contentSections.length;t++)this.contentSections[t].selected=!1;this.contentSections[e].selected=!0,this.selectedProjectPresentation=!1}},r.prototype.saveAndPublish=function(e,t){var i,n,o,r=this;if(this.isSaving=!0,this.content.Type===this.newsItem)(o=this.content).ReleaseDate=this.utilityService.formatDate(this.releaseDate,"iso date"),this.isNew&&(i=o.AvailableCategories.firstOrDefault(function(e){return e.Id===r.selectedNewsCategory.Id}))&&(i.Selected=!0);else if(this.content.Type===this.companyDepartmentNewsItem)(o=this.content).ReleaseDate=this.utilityService.formatDate(this.releaseDate,"iso date"),o.UpdateAcrossDepartments=t,this.isNew&&(i=o.AvailableCategories.firstOrDefault(function(e){return e.Id===r.selectedNewsCategory.Id}))&&(i.Selected=!0);else if(this.content.Type===this.calendarEvent)(o=this.content).FromDate=this.utilityService.formatDate(this.fromDate,"iso date time"),o.ToDate=this.utilityService.formatDate(this.toDate,"iso date time"),this.isNew&&(t=o.AvailableCategories.firstOrDefault(function(e){return e.Id===r.selectedCalendarCategory.Id}))&&(t.Selected=!0);else if(this.content.Type===this.projectNews){if(null!=this.projectAdministrationService.activeProjectEdit&&this.isNew)return(n=this.content).ReleaseDate=this.utilityService.formatDate(this.releaseDate,"iso date"),n.ProjectId=this.projectAdministrationService.activeProjectEdit.Id,void this.frontEndEditService.saveAndPublishNestedContent(this.content,this.currentPage.Id,e).then(function(e){r.projectAdministrationService.activeProjectEdit.NewsItems.push({Title:n.Name}),r.isEditing.isNewPage=!1,r.pageContentService.togglePageEditing(r.isEditing)})}else if(this.content.Type==this.projectPage)return o=this.content,this.isNew||(o.FaqItems=this.projectAdministrationService.activeProjectEdit.FaqItems.filter(function(e){return e.selected})),void this.frontEndEditService.saveNewPage(o,this.currentPage.Id,!0);this.frontEndEditService.saveAndPublishContent(this.content,this.currentPage.Id,e)},r.prototype.saveNewPage=function(){var t=this;this.isNew&&this.content.Type==this.projectPage&&this.frontEndEditService.saveNewPage(this.content,this.currentPage.Id,!0).then(function(e){t.windowService.history.pushState({},"",e.Url)})},r.prototype.cancel=function(){this.pageContentService.resetPageEditing()},r.prototype.openProject=function(){if(this.isNew)this.modalService.createModal("/App/General/FrontEndEdit/Modals/ProjectPage.modal.html",i.Modals.ProjectPageController,null,"md");else{for(var e=0;e<this.contentSections.length;e++)this.contentSections[e].selected=!1;this.selectedProjectPresentation=!this.selectedProjectPresentation}},r.prototype.removeMainImage=function(){null!=this.content.PresentationImageUrl?this.content.PresentationImageUrl=null:(this.uploadedPrensentationImage=null,this.content.PresentationImageId=null),null!=this.content.PresentationImageId&&(this.content.PresentationImageId=null)},r.prototype.createNewsCategory=function(){var t=this;this.modalService.createModal("/App/General/News/Modals/CreateNewsCategory.modal.html",e.News.Modals.CreateNewsCategoryController,null,"md").result.then(function(e){e&&t.frontEndEditNewsService.createNewsCategory(e,t.currentPage.Id)})},r.prototype.createCalendarCategory=function(){var t=this;this.modalService.createModal("/App/General/Calendar/Modals/CreateCalendarCategory.modal.html",e.Calendar.Modals.CreateCalendarCategoryController,null,"md").result.then(function(e){e&&t.frontEndEditCalendarService.createCalendarCategory(e,t.currentPage.Id)})},r.prototype.deleteContent=function(){var t=this;this.feedbackService.showConfirmbox({Headline:"Er du sikker på at du vil slette siden?",Message:"<p>Sletter du siden vil den og alle underliggende sider ikke længere være tilgængelig!</p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){t.frontEndEditService.deletePage(t.content.NodeId)},function(e){})},r.prototype.toggleSelectAllDepartment=function(){this.allDepartmentSelected=!this.allDepartmentSelected;for(var e=this.content,t=0;t<e.AvailableDepartments.length;t++)e.AvailableDepartments[t].Selected=this.allDepartmentSelected},r.$inject=["$scope","FrontEndEditService","FileService","ModalService","$window","UtilityService","FeedbackService","PageContentService","FrontEndEditUtilityService","FrontEndEditPermissionService","FrontEndEditCalendarService","FrontEndEditNewsService","ProjectPresentationAdministrationStateService","FeatureFlagService"],t=r,o=function(){this.controller=t,this.templateUrl="/App/General/FrontEndEdit/FrontEndEdit.component.html",this.bindings={isNew:"<"}},app.component("frontEndEdit",new o)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.incomHttp=e,this.loaderService=t,this.windowService=i,this.fEEUtilityService=n,this.baseurl="/umbraco/api/FrontEndEdit/",this.currentPageProperties$=new Rx.BehaviorSubject(null),this.newPageProperties$=new Rx.BehaviorSubject(null),this.uploadedInComDocs$=new Rx.BehaviorSubject(null),this.uploadedTopMedia$=new Rx.BehaviorSubject(null),this.embededVideo$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),t.prototype.getInstance=function(){return new t(this.incomHttp,this.loaderService,this.windowService,this.fEEUtilityService)},t.prototype.getNewPageProperties=function(e,t){var i=this,n=this.loaderService.setLoader("global","getPageProperties");this.incomHttp.post(this.baseurl+"GetNewPageProperties/"+t,e).then(function(e){i.newPageProperties$.onNext(e),i.loaderService.removeLoader(n)})},t.prototype.getCurrentPageProperties=function(e){var t=this,i=this.loaderService.setLoader("global","getPageProperties");this.incomHttp.get(this.baseurl+"GetCurrentPageProperties/"+e).then(function(e){e.NodeId&&t.currentPageProperties$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.saveAndPublishContent=function(e,t,i){var n=this,o=this.loaderService.setLoader("global","save");this.incomHttp.post(this.baseurl+"SaveAndPublishContent?id="+t+"&publish="+i,e).then(function(e){e&&e.CreateAdditionalNodesFromTemplate?n.incomHttp.post(n.baseurl+"UpdateAndCreateContent/",e.Id).then(function(e){n.windowService.location.reload()}):e&&""!==e.Url?n.windowService.location.href=e.Url:n.loaderService.removeLoader(o)})},t.prototype.saveAndPublishNestedContent=function(e,t,i){var n=this,o=this.loaderService.setLoader("global","save"),t=this.incomHttp.post(this.baseurl+"SaveAndPublishContent?id="+t+"&publish="+i,e);return t.then(function(){n.loaderService.removeLoader(o)}),t},t.prototype.saveNewPage=function(e,t,i){var n=this,o=this.loaderService.setLoader("global","save"),t=this.incomHttp.post(this.baseurl+"SaveNewPage?id="+t+"&publish="+i,e);return t.then(function(e){n.loaderService.removeLoader(o),n.fEEUtilityService.savedPage$.onNext(e)}),t},t.prototype.uploadPresentationImage=function(e,t){var i=[];e&&i.add(e),0<i.length&&this.incomHttp.postFiles(this.baseurl+"UploadPresentationImage",i).then(function(e){-1<e&&(t.PresentationImageId=e)})},t.prototype.uploadInComDocs=function(e){var t,i=this,n=[];0<e.length&&n.addRange(e),0<n.length&&(t=this.loaderService.setLoader("global","uploadDocs"),this.incomHttp.postFiles(this.baseurl+"UploadFiles",n).then(function(e){i.uploadedInComDocs$.onNext(e),i.loaderService.removeLoader(t)}))},t.prototype.uploadTopMedia=function(e){var t,i=this,n=[];0<e.length&&n.addRange(e),0<n.length&&(t=this.loaderService.setLoader("global","uploadTopMedia"),this.incomHttp.postFiles(this.baseurl+"UploadFiles",n).then(function(e){i.uploadedTopMedia$.onNext(e),i.loaderService.removeLoader(t)}))},t.prototype.embedVideo=function(e){var t=this;this.incomHttp.post(this.baseurl+"EmbedVideo?videoUrl="+e,null).then(function(e){t.embededVideo$.onNext(e)})},t.prototype.checkIfTemplateExists=function(e){var t=new XMLHttpRequest;return t.open("HEAD",e,!1),t.send(),200===t.status},t.prototype.deletePage=function(e){var t=this,i=this.loaderService.setLoader("global","deletePage");this.incomHttp.delete(this.baseurl+"DeletePage/"+e).then(function(e){return t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService","$window","FrontEndEditUtilityService"],app.service("FrontEndEditService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.frontEndEditServiceInstance=e,this.windowService=t,this.utilityService=i,this.pageContentService=n,this.frontEndEditPermissionService=o,this.frontEndEditUtilityService=r,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={}),i.prototype.$onInit=function(){var t=this;this.frontEndEditService=this.frontEndEditServiceInstance.getInstance(),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)})),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&!1===t.isEditing.isEditing&&(t.currentPage=e,t.frontEndEditPermissionService.getCurrentUsersPermissions(e.Id)
1)})),this.disposables.add(this.frontEndEditPermissionService.userFrontEndEditPermission$.subscribe(function(e){t.userFrontEndEditPermission=e||null}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.createSubPage=function(){this.userFrontEndEditPermission.CanCreateSubPage&&(this.isEditing.isNewPage=!0,this.isEditing.sortPages=!1,this.isEditing.deletePages=!1,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing))},i.prototype.editPage=function(){this.userFrontEndEditPermission.CanEditPage&&(this.isEditing.isNewPage=!1,this.isEditing.sortPages=!1,this.isEditing.deletePages=!1,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing))},i.prototype.getSortPages=function(){this.isEditing.isNewPage=!1,this.isEditing.sortPages=!0,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing)},i.prototype.getDeletePages=function(){this.isEditing.isNewPage=!1,this.isEditing.deletePages=!0,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing)},i.prototype.deleteCurrentPage=function(){confirm("Er du sikker på du ønsker at slette denne side?")&&this.frontEndEditUtilityService.deletePage(this.currentPage.Id)},i.$inject=["FrontEndEditService","$window","UtilityService","PageContentService","FrontEndEditPermissionService","FrontEndEditUtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/FrontEndEditFunctions.component.html",this.bindings={}},app.component("frontEndEditFunctions",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n){this.modalService=e,this.frontEndEditServiceInstance=t,this.fileService=i,this.$sce=n,this.taToolbar=[["html","bold","italics","underline","ul","ol"],["justifyLeft","justifyCenter","justifyRight"]]}e=e.General||(e.General={}),(i=e.FrontEndEdit||(e.FrontEndEdit={})).GridComponents||(i.GridComponents={}),n.prototype.$onInit=function(){var t=this;this.frontEndEditService=this.frontEndEditServiceInstance.getInstance(),this.gridControl.editor&&(this.componentTemplateUrl="/App/General/FrontEndEdit/GridComponents/".concat(this.gridControl.editor.alias,"/Edit.html"),this.frontEndEditService.checkIfTemplateExists(this.componentTemplateUrl))||(this.componentTemplateUrl="/App/General/FrontEndEdit/GridComponents/NoComponentFound.html"),this.mediaUploadSubscription=this.frontEndEditService.uploadedInComDocs$.subscribe(function(e){e&&(t.gridControl.value.mediaItems||(t.gridControl.value.mediaItems=[]),t.gridControl.media||(t.gridControl.media=[]),angular.isArray(e)?(t.gridControl.value.mediaItems.addRange(e),t.gridControl.media.addRange(e)):(t.gridControl.value.mediaItems.add(e),t.gridControl.media.add(e)))}),this.uploadedTopMediaSubscription=this.frontEndEditService.uploadedTopMedia$.subscribe(function(e){e&&(t.gridControl.value.imageDump||(t.gridControl.value.imageDump=[]),angular.isArray(e)?t.gridControl.value.imageDump.addRange(e):t.gridControl.value.imageDump.add(e))}),this.embedVideoSubscription=this.frontEndEditService.embededVideo$.subscribe(function(e){e&&(t.gridControl.value.imageDump||(t.gridControl.value.imageDump=[]),angular.isArray(e)?t.gridControl.value.imageDump.addRange(e):t.gridControl.value.imageDump.add(e))})},n.prototype.$onDestroy=function(){this.mediaUploadSubscription.dispose(),this.uploadedTopMediaSubscription.dispose(),this.embedVideoSubscription.dispose()},n.prototype.getComponentLink=function(){return this.componentTemplateUrl},n.prototype.getIconClass=function(e){e=e.substring(e.lastIndexOf(".")+1);return this.fileService.getFileIconClass(e)},n.prototype.swap=function(e,t,i){var n=e[t];e[t]=e[i],e[i]=n},n.prototype.removeItemInCollection=function(e,t){e.splice(t,1)},n.prototype.addNewPublication=function(e){var t=this;this.modalService.createModal("/App/General/FrontEndEdit/Modals/AddDocuments.modal.html",i.Modals.AddDocumentsController,null,"md").result.then(function(e){t.frontEndEditService.uploadInComDocs(e)})},n.prototype.pickNewImages=function(e){var t=this;this.modalService.createModal("/App/General/FrontEndEdit/Modals/AddImages.modal.html",i.Modals.AddImagesController,null,"md").result.then(function(e){t.frontEndEditService.uploadTopMedia(e)})},n.prototype.getEmbedVideoContent=function(e){return this.$sce.trustAsHtml(e)},n.prototype.embedVideo=function(){var t=this;this.modalService.createModal("/App/General/FrontEndEdit/Modals/AddVideo.modal.html",i.Modals.AddVideoController,null,"md").result.then(function(e){t.frontEndEditService.embedVideo(e)})},n.$inject=["ModalService","FrontEndEditService","FileService","$sce"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/FrontEndEdit/GridComponents/FrontEndEditGrid.component.html",this.bindings={gridControl:"<"}},app.component("frontEndEditGridComponent",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$scope=e,this.$modalInstance=t,this.fileService=i,this.uploadedFiles=[],this.files=[]}e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var i=this;this.$scope.$watchCollection(function(){return i.files},function(e,t){e&&0<e.length&&(i.uploadedFiles.addRange(e.map(function(e){return i.fileService.toUploadedFile(e)})),i.files=[])})},t.prototype.removeItemInCollection=function(e,t){e.splice(t,1)},t.prototype.submit=function(){this.$modalInstance.close(this.uploadedFiles)},t.$inject=["$scope","$uibModalInstance","FileService"],e.AddDocumentsController=t}(BoligExtra=BoligExtra||{}),!function(n){var e;function t(e,t,i){this.$scope=e,this.$modalInstance=t,this.fileService=i,this.uploadedFiles=[],this.files=[]}e=(e=(e=n.General||(n.General={})).FrontEndEdit||(e.FrontEndEdit={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var i=this;this.$scope.$watchCollection(function(){return i.files},function(e,t){e&&0<e.length&&(i.uploadedFiles.addRange(e.map(function(e){e=i.fileService.toUploadedFile(e,n.Utility.File.UploadedFileType.Image);return i.fileService.attachThumbnail(e,i.$scope),e})),i.files=[])})},t.prototype.removeItemInCollection=function(e,t){e.splice(t,1)},t.prototype.submit=function(){this.$modalInstance.close(this.uploadedFiles)},t.$inject=["$scope","$uibModalInstance","FileService"],e.AddImagesController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modalInstance=e}
1e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){},t.prototype.submit=function(){this.$modalInstance.close(this.videoUrl)},t.$inject=["$uibModalInstance"],e.AddVideoController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.options=[{alias:"rte",text:"Tekstindhold",control:{value:"",editor:this.getEditor("rte")}},{alias:"incomDocs",text:"Dokumenter",control:{value:{headline:null,mediaItems:[]},editor:this.getEditor("incomDocs"),images:[]}},{alias:"incomTopMedia",text:"Stort billede/slider",control:{value:{imageDump:[]},editor:this.getEditor("incomTopMedia")}},{alias:"embed",text:"Indsæt video",control:{value:{imageDump:[]},editor:this.getEditor("embed")}},{alias:"quote",text:"Citat",control:{value:"",editor:this.getEditor("quote")}},{alias:"headline",text:"Overskrift",control:{value:"",editor:this.getEditor("headline")}}]},t.prototype.selectItem=function(e){this.selectedItem=e,this.$modalInstance.close(this.selectedItem.control)},t.prototype.getEditor=function(e){for(var t=0;t<this.modalData.rawGridEditorsFromConfigFile.length;t++)if(this.modalData.rawGridEditorsFromConfigFile[t].alias===e)return this.modalData.rawGridEditorsFromConfigFile[t];return e},t.$inject=["$uibModalInstance","modalData"],e.NewContentController=t}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i){this.pageProviderService=e,this.owlCarouselOptionsService=t,this.featureFlagsService=i,this.frontPageBanner7="FrontPageBanner7ViewModel",this.disposables=new Rx.CompositeDisposable}e=(e=e.General||(e.General={})).Frontpage||(e.Frontpage={}),i=e.Banner||(e.Banner={}),n.prototype.$onInit=function(){var t=this;null==this.banner||i.isFrontPageBanner3ViewModel(this.banner)||(setTimeout(function(){var e=$
1(".owl-carousel.owl-banner");0<e.length&&(t.options||(t.banner.Type==t.frontPageBanner7?t.options=t.owlCarouselOptionsService.getBanner7Options():(t.options=t.owlCarouselOptionsService.getDefaultOptions(),t.options.navContainer=".owl-nav",t.options.dotsContainer=".owl-dots",t.options.animateOut="fadeOut",t.options.animateIn="fadeIn"))),e.owlCarousel(t.options)},150),this.pageProviderService.getPageByDocumentType("tenancySearch").then(function(e){e&&(t.tenancySearchPageUrl=e.Url)}),this.pageProviderService.getPageByDocumentType("signUp").then(function(e){e&&(t.signUpPageUrl=e.Url)})),this.showLoginBox=this.featureFlagsService.frontpageBanner.displayLoginBox},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.$inject=["PageProviderService","OwlCarouselOptionsService","FeatureFlagService"],t=n,e=function(){this.controller=t,this.templateUrl="/App/General/Frontpage/Banner/Banner2/FrontPageBanner2.component.html",this.bindings={banner:"<"}},app.component("cmsBanner",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.frontpageService=e,this.pageContentService=t,this.$compile=i,this.$element=n,this.$scope=o,this.utilityService=r,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).Frontpage||(e.Frontpage={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&t.disposables.add(t.frontpageService.getFrontPage(e.Id).subscribe(function(e){e&&(t.information=e.Information,t.banner=e.Banner,t.initialDataRecived=!!e,t.cmsNews=e.LatestNews,t.frontpageShortcuts=e.FrontpageShortcuts,t.infoSlider=e.InfoSlider,t.doubleInfobox=e.FrontpageDoubleInfobox,t.roleShortcutsBanner=e.RoleShortcutsBanner,t.gridHtml=e.GridHtml)}))}))},i.prototype.setupGridHTML=function(e){var t=this.$element.find("#frontpage-grid-container");e&&t&&(t.empty(),t.append(this.$compile(e)(this.$scope.$new(!0))),this.$scope.$root.$applyAsync())},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["FrontpageService","PageContentService","$compile","$element","$scope","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Frontpage/Frontpage.Component.html"},app.component("frontpage",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/Frontpage/",this.featured$=new Rx.Subject}(e=e.General||(e.General={})).Frontpage||(e.Frontpage={}),t.prototype.getFrontPage=function(e){var t=new Rx.Subject;return this.incomHttp.get("".concat(this.baseurl,"InitFrontpage/").concat(e)).then(function(e){t.onNext(e)}),t},t.prototype.getFeatured=function(e){var t=this;return this.incomHttp.get("".concat(this.baseurl,"GetFrontpageFeatured/").concat(e)).then(function(e){t.featured$.onNext(e)}),this.featured$},t.$inject=["incomHttpService","LoaderService"],app.service("FrontpageService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i,n,o){this.$scope=e,this.modalLogic=t,this.element=i,this.timeout=n,this.glossaryService=o,this.immuneTagnames=["A","SCRIPT","STYLE","LINK","H1","H2","H3","H4","H5","H6"],this.glossaries=[]}e=e.General||(e.General={}),(t=e.Glossary||(e.Glossary={})).Directives||(t.Directives={}),n.prototype.$onInit=function(){var t=this;this.glossaryService.getAll().subscribe(function(e){t.glossaries=e.Glossaries,t.postDigest(function(){return t.element.length?t.element.each(function(e){t.addGlossary(t.element[e])}):t.element})})},n.prototype.displayModal=function(e){this.modalLogic.createModal("/App/General/Glossary/Modals/GlossaryModal.html",t.Modals.GlossaryModalController,{glossary:e})},n.prototype.postDigest=function(e){var t=this,i=this.$scope.$watch(function(){i(),t.timeout(function(){e(),t.postDigest(e)},0,!1)})},n.prototype.openModal=function(e){for(var t=0;t<this.glossaries.length;t++)if(this.glossaries[t].Id.toString()===e.getAttribute("data-glossaryid")){this.displayModal(this.glossaries[t]);break}},n.prototype.addGlossary=function(e){var t=this,i=0;if(3==e.nodeType)for(var n=0;n<this.glossaries.length;n++)for(var o=this.glossaries[n],r=o.KeyWord.toUpperCase(),s=new RegExp("(^|\\s)"+r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"([,.?!-])*(?!\\S)","g");null!=(c=s.exec(e.data.toUpperCase()));){var a=document.createElement("a"),l=(a.className="glossary-item",a.setAttribute("data-glossaryid",o.Id.toString()),a.addEventListener("click",function(){return t.openModal(a)}),0),c=(void 0!==e.data&&(" "===e.data[0]||0<c.index)&&(l=1),e.splitText(c.index+l)),l=(c.splitText(r.length),c.cloneNode(!0));a.appendChild(l),c.parentNode.replaceChild(a,c),i=1}else if(1==e.nodeType&&e.childNodes&&-1==this.immuneTagnames.indexOf(e.tagName)&&!e.attributes.getNamedItem("no-glossary"))for(n=0;n<e.childNodes.length;++n)n+=this.addGlossary(e.childNodes[n]);return i},n.$inject=["$scope","ModalService","$element","$timeout","GlossaryService"],i=n,app.directive("glossary",function(){return{restrict:"A",controller:i,scope:{},bindToController:{}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$http=e,this.glossaryController="/umbraco/api/Glossary"}(e=e.General||(e.General={})).Glossary||(e.Glossary={}),t.prototype.getAll=function(){return Rx.Observable.fromPromise(this.$http.get(this.glossaryController+"/GetAll"))},t.$inject=["incomHttpService"],app.service("GlossaryService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}
1e=(e=(e=e.General||(e.General={})).Glossary||(e.Glossary={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.model=this.modalData.glossary},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.GlossaryModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$http=e,this.gridContent$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).Grid||(e.Grid={}),t.prototype.getGridContentByNodeId=function(e){var t=this;this.$http.get("/umbraco/api/Grid/GetGridContentByNodeId/".concat(e)).then(function(e){return t.gridContent$.onNext(e)})},t.$inject=["incomHttpService"],app.service("GridService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.gridService=i}e=(e=(e=e.General||(e.General={})).Grid||(e.Grid={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){var t=this;this.gridService.getGridContentByNodeId(this.modalData.nodeId),this.subscription=this.gridService.gridContent$.subscribe(function(e){return t.gridContent=e})},t.prototype.$onDestroy=function(){this.subscription.dispose()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","GridService"],e.ShowGridModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/Umbraco/Api/CmsNews/",this.news$=new Rx.BehaviorSubject(null),this.newsOptions$=new Rx.BehaviorSubject(null),this.newsCategories$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).News||(e.News={}),t.prototype.getNewsForOverview=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getNews");this.incomHttp.get("".concat(this.baseurl,"GetNewsForOverview/").concat(e)).then(function(e){t.news$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getNewsOptions=function(e){var t=this;this.incomHttp.get(this.baseurl+"GetNewsOptions/"+e).then(function(e){t.newsOptions$.onNext(e)})},t.prototype.deleteNewsItem=function(e){var t=this,i=this.loaderService.setLoader("contentSection","deleteNewsItem");this.incomHttp.delete(this.baseurl+"DeleteNewsItem/"+e).then(function(e){return t.loaderService.removeLoader(i)})},t.prototype.createNewsCategory=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","createCategory");this.incomHttp.post(this.baseurl+"CreateNewsCategory/"+t,e).then(function(e){i.getNewsForOverview(t),i.loaderService.removeLoader(n)})},t.prototype.getNewsCategories=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getCategories");return this.incomHttp.get(this.baseurl+"GetNewsCategories/"+e).then(function(e){t.newsCategories$.onNext(e.NewsCategories),t.loaderService.removeLoader(i)}),this.newsCategories$},t.prototype.deleteCategory=function(e){var t=this,i=this.loaderService.setLoader("contentSection","deleteCategory"),e=this.incomHttp.delete(this.baseurl+"DeleteNewsCategory/"+e);return e.then(function(e){return t.loaderService.removeLoader(i)}),e},t.prototype.updateCategory=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","updateCategory"),t=this.incomHttp.post(this.baseurl+"UpdateCategory/"+t,e);return t.then(function(e){return i.loaderService.removeLoader(n)}),t},t.prototype.getLatestNews$=function(e){var t=this,i=new Rx.Subject,n=this.loaderService.setLoader("latestpublicnews","getLatestPublicNews");return this.incomHttp.get(this.baseurl+"GetLatestNews/?Amount="+e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("CmsNewsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.cmsNewsService=e,this.utilityService=t,this.feedbackService=i,this.pageContentService=n,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).News||(e.News={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentPage=e)&&t.cmsNewsService.getNewsOptions(e.Id)}),this.disposables.add(this.cmsNewsService.newsOptions$.subscribe(function(e){e&&(t.newsOptions=e)})),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.editPage=function(){this.newsOptions.CanEdit&&(this.isEditing.isNewPage=!1,this.isEditing.sortPages=!1,this.isEditing.deletePages=!1,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing))},i.prototype.deletePage=function(){var t=this;this.newsOptions.CanDelete&&this.feedbackService.showConfirmbox({Headline:"Er du sikker?",Message:"<p>Er du sikker på at du vil slette nyheden?</p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){t.cmsNewsService.deleteNewsItem(t.currentPage.Id)},function(e){})},i.$inject=["CmsNewsService","UtilityService","FeedbackService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/News/CmsNewsOptions.component.html",this.bindings={}},app.component("cmsNewsOptions",new e)}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i,n,o){this.cmsNewsService=e,this.utilityService=t,this.modalService=i,this.pageContentService=n,this.definitionHelper=o,this.disposables=new Rx.CompositeDisposable,this.categoryCollection=[],this.currentPage=0,this.categoryCollectionStatic=[]}e=e.General||(e.General={}),i=e.News||(e.News={}),n.prototype.$onInit=function(){var t=this;this.entryLimit||(this.entryLimit=9),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){(t.currentContentPage=e).Id&&t.cmsNewsService.getNewsForOverview(e.Id)}),this.disposables.add(this.cmsNewsService.news$.subscribe(function(e){e&&(t.newsItemCollection=e.NewsOverviewItems,t.completeNewsItemCollection=e.NewsOverviewItems,t.canCreateCategory=e.CanCreateCategories,t.canEditCategories=e.CanEditCategories,t.canDeleteCategories=e.CanDeleteCategories,t.canCreateNews=e.CanCreateNews,t.groupNewsCollection())})),this.disposables.add(this.pageContentService.isEditingPage$.subscribe(function(e){e&&(t.isEditing=e)}))},n.prototype.updatePage=function(e){this.currentPage=e},n.prototype.getDefinitionSeperator=function(e){return this.definitionHelper.getDefinitionSeperator(e)},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.showCategory=function(){var t=this;this.filterCategory=this.filterCategory,null!==this.filterCategory?this.newsItemCollection=this.completeNewsItemCollection.filter(function(e){return e.Category===t.filterCategory}):this.newsItemCollection=this.completeNewsItemCollection,this.groupNewsCollection(),this.currentPage=0},n.prototype.createNewsCategory=function(){var t=this;this.modalService.createModal("/App/General/News/Modals/CreateNewsCategory.modal.html",i.Modals.CreateNewsCategoryController,null,"md").result.then(function(e){e&&t.cmsNewsService.createNewsCategory(e,t.currentContentPage.Id)})},n.prototype.manageNewsCategory=function(){var e=this,t={canDelete:this.canDeleteCategories,canEdit:this.canEditCategories};this.modalService.createModal("/App/General/News/Modals/EditNewsCategory.modal.html",i.Modals.EditNewsCategoryController,t,"md").result.then(function(){e.cmsNewsService.getNewsForOverview(e.currentContentPage.Id)})},n.prototype.sortPressCollection=function(){switch(this.sortBy){case"ReleaseDate":this.newsItemCollection=this.newsItemCollection.orderBy(function(e){return e.ReleaseDate});break;case"-ReleaseDate":this.newsItemCollection=this.newsItemCollection.orderByDescending(function(e){return e.ReleaseDate});break;case"Title":this.newsItemCollection=this.newsItemCollection.orderBy(function(e){return e.Title});break;case"-Title":this.newsItemCollection=this.newsItemCollection.orderByDescending(function(e){return e.Title});break;case"-Focus":var e=this.newsItemCollection.where(function(e){return e.Focus}).orderByDescending(function(e){return e.ReleaseDate}),t=this.newsItemCollection.where(function(e){return!1===e.Focus}).orderByDescending(function(e){return e.ReleaseDate});e.addRange(t),this.newsItemCollection=e}},n.prototype.createNews=function(){this.canCreateNews&&(this.isEditing.isNewPage=!0,this.isEditing.sortPages=!1,this.isEditing.deletePages=!1,this.isEditing.isEditing=!this.isEditing.isEditing,this.pageContentService.togglePageEditing(this.isEditing))},n.prototype.groupNewsCollection=function(){for(var e={},t=[],i=0,n=this.newsItemCollection.length;i<n;++i)e.hasOwnProperty(this.newsItemCollection[i].Category)||(t.push(this.newsItemCollection[i].Category),e[this.newsItemCollection[i].Category]=1);this.categoryCollection=t,this.categoryCollectionStatic.any()||(this.categoryCollectionStatic=t)},n.$inject=["CmsNewsService","UtilityService","ModalService","PageContentService","ImageDefinitionHelperService"],t=n,e=function(){this.controller=t,this.templateUrl="/App/General/News/CmsNewsOverview.component.html",this.bindings={entryLimit:"<"}},app.component("cmsNewsOverview",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/DepartmentNewsList/",this.departmentNewsList$=new Rx.BehaviorSubject(null)}
1(e=(e=(e=e.General||(e.General={})).News||(e.News={})).Dashboard||(e.Dashboard={})).DepartmentNews||(e.DepartmentNews={}),t.prototype.getDepartmentNewsList=function(e){var t=this,i=this.loaderService.setLoader("latestnews","getlatestdepartmentnews");return this.incomHttp.get("".concat(this.baseurl,"GetDepartmentNewsList?amount=")+e).then(function(e){t.departmentNewsList$.onNext(e),t.loaderService.removeLoader(i)}),this.departmentNewsList$},t.$inject=["incomHttpService","LoaderService"],app.service("DepartmentNewsListService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=e.General||(e.General={})).News||(e.News={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){},t.prototype.submit=function(){this.$modalInstance.close(this.model)},t.$inject=["$uibModalInstance","modalData"],e.CreateNewsCategoryController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o){this.$modalInstance=e,this.modalData=t,this.cmsNewsService=i,this.feedbackService=n,this.pageContentService=o,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.General||(e.General={})).News||(e.News={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.canEdit=this.modalData.canEdit,this.canDelete=this.modalData.canDelete,this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e)}),this.disposables.add(this.cmsNewsService.getNewsCategories(this.currentPage.Id).subscribe(function(e){e&&(t.newsCategories=e)}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.toggleEditing=function(){this.editing=!this.editing},t.prototype.deleteCategory=function(){var t=this;this.feedbackService.showConfirmbox({Headline:"Er du sikker på at du vil slette kategorien?",Message:"<p>Dette sletter også alle tilhørende nyheder!</p>",CssClass:"info",DurationInMilliseconds:0}).then(function(e){t.cmsNewsService.deleteCategory(t.selectedCategory.Id).then(function(){t.$modalInstance.close()})},function(e){})},t.prototype.submit=function(){var e=this;this.cmsNewsService.updateCategory(this.selectedCategory,this.currentPage.Id).then(function(){e.$modalInstance.close()})},t.$inject=["$uibModalInstance","modalData","CmsNewsService","FeedbackService","PageContentService"],e.EditNewsCategoryController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=e.General||(e.General={})).Office||(e.Office={}),i.prototype.$onInit=function(){},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Office/Office.Component.html",this.bindings={offices:"<"}},app.component("office",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.pageContentService=e,this.operationMessageService=t,this.storageService=i,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).OperationMessage||(e.OperationMessage={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&t.operationMessageService.getOperationMessages(e.Id,t.storageService.getClosedOperationMessages())})),this.disposables.add(this.operationMessageService.operationMessages$.subscribe(function(e){e&&(t.operationMessages=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.close=function(e){var t=this.operationMessages[e],e=(this.operationMessages.splice(e,1),{Id:t.Id,ClosedDate:new Date});this.storageService.setClosedOperationMessages(e)},i.$inject=["PageContentService","OperationMessageService","StorageService"],t=i,e=function(){this.controller=t,this.templateUrl="/App/General/OperationMessage/OperationMessage3/OperationMessage3.component.html"},app.component("cmsOperationMessage",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.operationMessages$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).OperationMessage||(e.OperationMessage={}),t.prototype.getOperationMessages=function(e,t){var i=this;this.incomHttp.post("/umbraco/api/OperationMessage/GetOperationMessages/".concat(e),t).then(function(e){return i.operationMessages$.onNext(e.OperationMessages)})},t.$inject=["incomHttpService","LoaderService"],app.service("OperationMessageService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r){this.$modalInstance=e,this.modalData=t,this.loaderService=i,this.operationMessageManagementService=n,this.utilityService=o,this.validationService=r,this.disposables=new Rx.CompositeDisposable,this.visibleFrom=new Date,this.visibleTo=new Date,this.datepickerOptionsTo={minDate:this.visibleFrom}}
1e=(e=(e=(e=e.General||(e.General={})).OperationMessage||(e.OperationMessage={})).OperationMessageManagement||(e.OperationMessageManagement={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.urlPattern=this.validationService.getUrlRegex(),this.datePickerFormat=this.utilityService.shortDateFormat,this.operationMessageUserAssociations=this.modalData.userAssociations,this.selected=this.modalData.selectedUserAssociation,this.disposables.add(this.operationMessageManagementService.getOperationMessageTypes().subscribe(function(e){e&&(t.messageTypes=e)}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.dateSelectedChanged=function(){this.visibleFrom>this.visibleTo&&(this.visibleTo=this.visibleFrom),this.datepickerOptionsTo={minDate:this.visibleFrom}},t.prototype.submit=function(e){var t,i=this;e.$valid?(t=this.loaderService.setLoader("submit","command"),this.node.CurrentPageId=this.modalData.currentPageId,this.node.VisibleDate=this.visibleFrom,this.node.LastVisibleDate=this.visibleTo,this.node.CompanyId=this.selected.CompanyId,this.node.DepartmentId=this.selected.DepartmentId,this.operationMessageManagementService.createOperationMessage(this.node).then(function(){i.loaderService.removeLoader(t),i.$modalInstance.close(i.selected)})):angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()},t.$inject=["$uibModalInstance","modalData","LoaderService","OperationMessageManagementService","UtilityService","ValidationService"],e.CreateOperationMessageController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r){this.$modalInstance=e,this.modalData=t,this.loaderService=i,this.operationMessageManagementService=n,this.validationService=o,this.utilityService=r,this.disposables=new Rx.CompositeDisposable,this.visibleFrom=new Date,this.visibleTo=new Date,this.datepickerOptionsTo={minDate:this.visibleFrom}}e=(e=(e=(e=e.General||(e.General={})).OperationMessage||(e.OperationMessage={})).OperationMessageManagement||(e.OperationMessageManagement={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.urlPattern=this.validationService.getUrlRegex(),this.datePickerFormat=this.utilityService.shortDateFormat,this.disposables.add(this.operationMessageManagementService.getOperationMessageTypes().subscribe(function(e){e&&(t.messageTypes=e)})),this.visibleFrom=new Date(this.modalData.currentNode.IsoVisibleDate),this.visibleTo=new Date(this.modalData.currentNode.IsoLastVisibleDate),this.dateSelectedChanged(),this.updatedNode=angular.copy(this.modalData.currentNode),this.operationMessageUserAssociations=this.modalData.userAssociations,this.selected=this.operationMessageUserAssociations.firstOrDefault(function(e){return e.CompanyId===t.updatedNode.CompanyId&&e.DepartmentId===t.updatedNode.DepartmentId})},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.dateSelectedChanged=function(){this.visibleFrom>this.visibleTo&&(this.visibleTo=this.visibleFrom),this.datepickerOptionsTo={minDate:this.visibleFrom}},t.prototype.submit=function(e){var t,i,n=this;e.$valid?this.updatedNode&&this.updatedNode!==this.modalData.currentNode&&(t=this.loaderService.setLoader("submit","command"),i={Id:this.updatedNode.Id,CurrentPageId:this.modalData.currentPageId,VisibleDate:this.visibleFrom,LastVisibleDate:this.visibleTo,CreateDate:this.updatedNode.CreateDate,ReadMoreUrl:this.updatedNode.ReadMoreUrl,Title:this.updatedNode.Title,Text:this.updatedNode.Text,MessageType:this.updatedNode.OperationMessageType,CompanyId:this.selected.CompanyId,DepartmentId:this.selected.DepartmentId,ShowOnBoardMemberPortal:this.updatedNode.ShowOnBoardMemberPortal,ShowOnMemberPortal:this.updatedNode.ShowOnMemberPortal,ShowOnTenantPortal:this.updatedNode.ShowOnTenantPortal,ShowOnPersonnelPortal:this.updatedNode.ShowOnPersonnelPortal,ShowOnMyPage:this.updatedNode.ShowOnMyPage},this.operationMessageManagementService.updateOperationMessage(i).then(function(){n.loaderService.removeLoader(t),n.$modalInstance.close(n.selected)})):angular.element("[name='"+e.$name+"']").find(".ng-invalid:visible:first").focus()}
1,t.$inject=["$uibModalInstance","modalData","LoaderService","OperationMessageManagementService","ValidationService","UtilityService"],e.EditOperationMessageController=t}(BoligExtra=BoligExtra||{}),!function(e){var i,t;function n(e,t,i){this.modalService=e,this.operationMessageManagementService=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable}e=(e=e.General||(e.General={})).OperationMessage||(e.OperationMessage={}),i=e.OperationMessageManagement||(e.OperationMessageManagement={}),n.prototype.$onInit=function(){var o=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){o.currentPageId=e.Id,o.disposables.add(o.operationMessageManagementService.getOperationMessagePermissions(e.Id).subscribe(function(e){if(e){for(var t=e,i=0;i<t.OperationMessageUserAssociations.length;i++){var n=t.OperationMessageUserAssociations[i];null==n.CompanyId&&null==n.DepartmentId?n.DisplayName=n.Name:null!=n.CompanyId&&null==n.DepartmentId?n.DisplayName="Sel. "+n.CompanyId+" - "+n.Name:null!=n.CompanyId&&null!=n.DepartmentId&&(n.DisplayName="Afd. "+n.CompanyId+"-"+n.DepartmentId+" - "+n.Name)}o.operationMessagePermission=t}}))}),this.disposables.add(this.operationMessageManagementService.operationMessages$.subscribe(function(e){e&&(o.operationMessages=e)}))},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.selectedChanged=function(e){this.operationMessageManagementService.getOperationMessages(this.currentPageId,e)},n.prototype.editNode=function(e){var t=this,e={currentPageId:this.currentPageId,currentNode:e,userAssociations:this.operationMessagePermission.OperationMessageUserAssociations};this.modalService.createModal("/App/General/OperationMessage/OperationMessageManagement/Modals/EditOperationMessage.modal.html",i.Modals.EditOperationMessageController,e,"md").result.then(function(e){e&&(t.selected=e,t.selectedChanged(e))})},n.prototype.createOperationMessage=function(){var t=this,e={userAssociations:this.operationMessagePermission.OperationMessageUserAssociations,selectedUserAssociation:this.selected,currentPageId:this.currentPageId};this.modalService.createModal("/App/General/OperationMessage/OperationMessageManagement/Modals/CreateOperationMessage.modal.html",i.Modals.CreateOperationMessageController,e,"md").result.then(function(e){e&&(t.selected=e,t.selectedChanged(e))})},n.prototype.deleteNode=function(i){var n=this;window.confirm("Er du sikker pÃ¥, at du vil slette denne driftbesked?")&&this.disposables.add(this.operationMessageManagementService.deleteOperationMessage(this.currentPageId,i).subscribe(function(e){if(e)for(var t=0;t<n.operationMessages.length;t++)n.operationMessages[t].Id===i.Id&&(n.operationMessages.splice(t,1),t=n.operationMessages.length)}))},n.$inject=["ModalService","OperationMessageManagementService","PageContentService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/OperationMessage/OperationMessageManagement/OperationMessageManagement.component.html",this.bindings={}},app.component("operationMessageManagement",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.operationMessages$=new Rx.BehaviorSubject(null),this.baseUrl="/umbraco/api/OperationMessageManagement/"}(e=(e=e.General||(e.General={})).OperationMessage||(e.OperationMessage={})).OperationMessageManagement||(e.OperationMessageManagement={}),t.prototype.getOperationMessagePermissions=function(e){var t=new Rx.Subject;return this.incomHttp.get(this.baseUrl+"GetOperationMessagePermission/"+e).then(function(e){t.onNext(e)}),t},t.prototype.getOperationMessageTypes=function(){var t=new Rx.Subject;return this.incomHttp.get(this.baseUrl+"GetOperationMessageTypes").then(function(e){t.onNext(e.OperationMessageTypes)}),t},t.prototype.deleteOperationMessage=function(e,t){var i=new Rx.Subject;return this.incomHttp.delete(this.baseUrl+"DeleteOperationMessage?id="+t.Id+"¤tPageId="+e).then(function(e){i.onNext(e)}),i},t.prototype.updateOperationMessage=function(e){return this.incomHttp.post(this.baseUrl+"UpdateOperationMessage",e)},t.prototype.createOperationMessage=function(e){return this.incomHttp.post(this.baseUrl+"CreateOperationMessage",e)},t.prototype.getOperationMessages=function(e,t){var i=this;this.incomHttp.post(this.baseUrl+"GetOperationMessageByArea/"+e,t).then(function(e){i.operationMessages$.onNext(e.OperationMessages)})},t.$inject=["incomHttpService","LoaderService"],app.service("OperationMessageManagementService",t)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t){this.caretakersService=e,this.modalLogic=t,this.disposables=new Rx.CompositeDisposable}e=e.General||(e.General={}),n=e.Personnel||(e.Personnel={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.caretakersService.getDepartments().subscribe(function(e){e&&(t.departments=e,t.filteredDepartments=e,t.filteredDepartments.sort(function(e,t){return e.Name>t.Name?1:t.Name>e.Name?-1:0}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getCaretakersAndOpenModal=function(t){var i=this;this.disposables.add(this.caretakersService.getPersonnelByDepartmentAndRole(t.Id,t.Company.Id).subscribe(function(e){e&&(e={caretakers:e,departmentName:t.Name},i.modalLogic.createModal("/App/General/Personnel/Caretakers/Modal/CaretakerModal.html",n.Caretakers.Modal.CaretakerModalController,e,"lg"))}))},i.prototype.doFilter=function(){this.filteredDepartments=this.departments.filter(this.matchesFilter.b
1ind(this))},i.prototype.matchesFilter=function(e,t,i){return e.Name.toUpperCase().includes(this.searchInput.toUpperCase())||e.Address.City.toUpperCase().includes(this.searchInput.toUpperCase())||e.Address.ZipCode.toUpperCase().includes(this.searchInput.toUpperCase())?e:null},i.$inject=["CaretakersService","ModalService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Personnel/Caretakers/Caretakers.component.html"},app.component("caretakers",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.caretakers$=new Rx.BehaviorSubject([]),this.departments$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/Caretakers/"}(e=e.General||(e.General={})).Personnel||(e.Personnel={}),t.prototype.getDepartments=function(){var t=this,i=this.loaderService.setLoader("global","getDepartments");return this.incomHttp.get(this.baseurl+"GetDepartments").then(function(e){t.loaderService.removeLoader(i),t.departments$.onNext(e)}),this.departments$},t.prototype.getPersonnelByDepartmentAndRole=function(e,t){var i=this,n=this.loaderService.setLoader("global","getPersonnel"),e=this.incomHttp.get(this.baseurl+"GetPersonnelByDepartmentAndRole?depId="+e+"&companyId="+t);return e.then(function(){return i.loaderService.removeLoader(n)}),Rx.Observable.fromPromise(e)},t.$inject=["incomHttpService","LoaderService"],app.service("CaretakersService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=(e=e.General||(e.General={})).Personnel||(e.Personnel={})).Caretakers||(e.Caretakers={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.CaretakerModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=e.General||(e.General={})).Personnel||(e.Personnel={}),i.prototype.$onInit=function(){},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Personnel/Personnel.Component.html",this.bindings={personnelList:"<"}},app.component("personnel",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$http=e,this.loaderService=t,this.cmsPersonController="/Umbraco/Api/CmsPerson/",this.person$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).Person||(e.Person={}),t.prototype.getPersonsForOverview=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getPersons");this.$http.get("".concat(this.cmsPersonController,"GetPersonOverview/").concat(e)).then(function(e){t.person$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getIdForPersonOrCategory=function(e){return this.$http.get(this.cmsPersonController+"GetIdForPersonOrCategory?url="+encodeURIComponent(e))},t.$inject=["incomHttpService","LoaderService"],app.service("CmsPersonService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.cmsPersonService=e,this.pageContentService=t,this.modalLogic=i,this.$filter=n,this.featureFlagService=o,this.$location=r,this.disposables=new Rx.CompositeDisposable,this.selectedCategory=null,this.hasResult=!0}(e=e.General||(e.General={})).Person||(e.Person={}),i.prototype.$onInit=function(){var t=this;this.cmsPersonService.getIdForPersonOrCategory(this.$location.url()).then(function(e){t.itemId=e,t.disposables.add(t.pageContentService.currentPage$.subscribe(function(e){e&&t.cmsPersonService.getPersonsForOverview(e.Id)}))}),this.disposables.add(this.cmsPersonService.person$.subscribe(function(e){e&&(t.categories=e.PersonCategories,t.categoriesToDisplay=e.PersonCategories,t.openCategory())})),this.showFallbackImage=this.featureFlagService.displayFallbackImages.displayImageFallback},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.openCategory=function(){for(var e,t=this.itemId,i=0;i<this.categories.length;i++){if(e=this.categories.firstOrDefault(function(e){return e.Id===t})){this.selectedCategory=e;break}if(this.categories[i].Persons.firstOrDefault(function(e){return e.Id===t})){this.selectedCategory=this.categories[i];break}}this.categoryChange()},i.prototype.categoryChange=function(){var t=this;this.selectedCategory?this.categoriesToDisplay=this.categories.where(function(e){return e===t.selectedCategory}):this.categoriesToDisplay=this.categories,this.hasPeopleToShow()},i.prototype.hasPeopleToShow=function(){var e,t=this;""!=this.sText?(e=this.categoriesToDisplay.any(function(e){return t.$filter("filter")(e.Persons,t.sText).any()}),this.hasResult=e):this.hasResult=!0},i.$inject=["CmsPersonService","PageContentService","ModalService","$filter","FeatureFlagService","$location"],t=i,e=function(){this.controller=t,this.templateUrl="/App/General/Person/CmsPersonOverview.component.html"},app.component("cmsPersonOverview",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.model=this.modalData.person}e=(e=(e=e.General||(e.General={})).Person||(e.Person={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){this.model=this.modalData.person},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.PersonModalController=t}(BoligExtra=BoligExtra||{}),!function(n){var e,t;function i(e,t,i,n,o){this.pageContentService=e,this.pressRoomService=t,this.modalLogic=i,this.fileService=n,this.owlCarouselOptionsService=o,this.mediaSelection=[],this.mediaList=null,this.pressCollection=[],this.modalTitle="Billeder",this.zipName="Presserum",this.mediaLead="",this.mediaTitle=""}(e=n.General||(n.General={})).PressRoom||(e.PressRoom={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&(t.currentPage=e)}),this.getFiles()},i.prototype.checkAll=function(){this.mediaList.forEach(function(e){return e.selected=!0})},i.prototype.unCheckAll=function(){this.mediaList.forEach(function(e){return e.selected=!1})},i.prototype.getAllZipFile=function(){this.getZip(this.mediaList)},i.prototype.getZipSelectedFiles=function(){this.getZip(this.mediaList.where(function(e){return!0===e.selected}))},i.prototype.getZip=function(e){var t=this,i=this.pressCollection.firstOrDefault(function(e){return e.Id===t.currentPage.Id}),n="Presserum",i=(i&&(n=i.Title),e.map(function(e){return e.Id}));this.fileService.downloadMediasAsZip(i,n)},i.prototype.isAnySelected=function(){return 0<this.mediaList.where(function(e){return e.selected}).length},i.prototype.getFiles=function(){var t=this;this.pressRoomService.getMediaById(this.currentPage.Id).then(function(e){t.pressRoomService.media$.subscribe(function(e){t.mediaList=e,t.mediaSelection=[],t.slideview&&setTimeout(function(){var e;$(".press-view-box .images > div")&&((e=t.owlCarouselOptionsService.getMultiItemOptions(3)).responsive={0:{items:e.items},1199:{items:2},768:{items:1}},$(".press-view-box .images > div").owlCarousel(e))},100)}).dispose()})},i.prototype.toggleSelection=function(t){var e=this.mediaList.firstOrDefault(function(e){return e.Id===t});e.selected=!e.selected},i.prototype.openModal=function(t){var e=this.mediaList.where(function(e){return"File"!==e.DocumentTypeAlias}),i=e.indexOf(e.firstOrDefault(function(e){return e.Id===t.Id}));this.modalLogic.createModal("/App/Ui/Modals/Gallery/GalleryModal.html",n.Ui.Modals.Gallery.GalleryModalController,{title:"Billeder",doPrint:!0,media:e,selectedIndex:i,imageDefinition:"departmentimages"},"lg")},i.prototype.getFileIcon=function(e){return this.fileService.getFileIconClass(e)},i.$inject=["PageContentService","PressRoomService","ModalService","FileService","OwlCarouselOptionsService"],t=i,e=function(){this.controller=t,this.templateUrl="/App/General/PressRoom/Gallery/PressRoomFileGallery.component.html",this.bindings={slideview:"<"}},app.component("cmsPressRoomFileGallery",new e)}(BoligExtra=BoligExtra||{}),!function(n){var t,e,i;function o(e,t,i,n,o,r){this.pageContentService=e,this.pressRoomService=t,this.modalLogic=i,this.fileService=n,this.owlCarouselOptionsService=o,this.definitionHelper=r,this.disposables=new Rx.CompositeDisposable,this.currentPage=0,this.categoryCollection=[],this.sortBy="-ReleaseDate",this.pressCollection=[],this.mediaLead="",this.mediaTitle=""}(t=n.General||(n.General={})).PressRoom||(t.PressRoom={}),o.prototype.$onInit=function(){var t=this;this.entryLimit||(this.entryLimit=3),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e&&t.pressRoomService.getPressRoomOverview(e.Id)}),this.disposables.add(this.pressRoomService.pressCollection$.subscribe(function(e){e&&(t.pressCollection=e.PressRoomViewModels,t.categoryCollection=t.pressCollection.map(function(e){return e.Category}).distinct(),t.sortPressCollection())}))},o.prototype.$onDestroy=function(){this.disposables.dispose()},o.prototype.setPagingProperties=function(e,t){return Math.ceil(e/(3*t))},o.prototype.getDefinitionSeperator=function(e){return this.definitionHelper.getDefinitionSeperator(e)},o.prototype.updatePage=function(e){this.currentPage=e},o.prototype.groupPressCollection=function(){this.close(),this.numberOfPages=this.setPagingProperties(this.pressCollection.length,this.entryLimit);var e=this.getRowCount();this.sortIntoRows(this.pressCollection,e)},o.prototype.getRowCount=function(){var e,t=window.innerWidth;switch(!0){case 992<=t:e=3;break;case t<992&&767<t:this.entryLimit=4,e=2;break;default:this.entryLimit=9,e=1}return e},o.prototype.sortIntoRows=function(e,t){this.presentationCollection=[];for(var i=e.length/t,n=0,o=t,r=0,s=0;s<i;s++)this.presentationCollection.push([]);for(s=0;s<e.length;s++)n!==o?n++:(n=1,r++),this.presentationCollection[r].push(e[s])},o.prototype.sortPressCollection=function(){switch(this.sortBy){case"ReleaseDate":this.pressCollection=this.pressCollection.orderBy(function(e){return e.ReleaseDate});break;case"-ReleaseDate":this.pressCollection=this.pressCollection.orderByDescending(function(e){return e.ReleaseDate});break;case"Title":this.pressCollection=this.pressCollection.orderBy(function(e){return e.Title});break;case"-Title":this.pressCollection=this.pressCollection.orderByDescending(function(e){return e.Title})}this.groupPressCollection()},o.prototype.showCategory=function(t){this.filterCategory=t,this.pressCollection=null!==t?this.pressRoomService.pressCollection$.getValue().PressRoomViewModels.filter(function(e){return e.Category===t}):this.pressRoomService.pressCollection$.getValue().PressRoomViewModels,this.groupPressCollection(),this.currentPage=0},o.prototype.checkAll=function(){this.mediaList.forEach(function(e){return e.selected=!0})},o.prototype.unCheckAll=function(){this.mediaList.forEach(function(e){return e.selected=!1})},o.prototype.getAllZipFile=function(){this.getZip(this.mediaList)},o.prototype.getZipSelectedFiles=function(){this.getZip(this.mediaList.where(function(e){return!0===e.selected}))},o.prototype.getZip=function(e){var t=this,i=this.pressCollection.firstOrDefault(function(e){return e.Id===t.childId}),n="Presserum",i=(i&&(n=i.Title),e.map(function(e){return e.Id}));this.fileService.downloadMediasAsZip(i,n)},o.prototype.getFile=function(t,i,n,o){var r=this;this.close(),this.pressRoomService.getMediaById(t).then(function(){r.pressRoomService.media$.subscribe(function(e){r.mediaList=e,r.openRowIndex=i,r.childId=t,r.mediaTitle=n,r.mediaLead=o,r.slideview&&setTimeout(function(){var e;$(".press-view-box .images > div")&&((e=r.owlCarouselOptionsService.getMultiItemOptions(3)).responsive={0:{items:e.items},1199:{items:2},768:{items:1}},$(".press-view-box .images > div").owlCarousel(e))},100)}).dispose()})},o.prototype.close=function(){this.mediaList=[],this.openRowIndex=null,this.childId=null,this.mediaTitle="",this.mediaLead=""},o.prototype.toggleSelection=function(t){var e=this.mediaList.firstOrDefault(function(e){return e.Id===t});e.selected=!e.selected},o.prototype.openModal=function(t){var e=this.mediaList.where(function(e){return"File"!==e.DocumentTypeAlias}),i=e.indexOf(e.firstOrDefault(function(e){return e.Id===t.Id}));this.modalLogic.createModal("/App/Ui/Modals/Gallery/GalleryModal.html",n.Ui.Modals.Gallery.GalleryModalController,{title:"Billeder",doPrint:!0,media:e,selectedIndex:i,imageDefinition:"departmentimages"},"lg")},o.prototype.isAnySelected=function(){return 0<this.mediaList.where(function(e){return e.selected}).length},o.prototype.openGridModal=function(e){this.modalLogic.createModal("/App/General/Grid/Modal/showGridModal.html",t.Grid.Modal.ShowGridModalController,{nodeId:e},"lg")},o.prototype.getFileIcon=function(e){return this.fileService.getFileIconClass(e)},o.$inject=["PageContentService","PressRoomService","ModalService","FileService","OwlCarouselOptionsService","ImageDefinitionHelperService"],e=o,i=function(){this.controller=e,this.templateUrl="/App/General/PressRoom/PressRoom.component.html",this.bindings={slideview:"<",entryLimit:"<"}},app.component("cmsPressRoom",new i)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$http=e,this.loaderService=t,this.media$=new Rx.BehaviorSubject(null),this.pressCollection$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).PressRoom||(e.PressRoom={}),t.prototype.getPressRoomOverview=function(e){var t=this,i=this.loaderService.setLoader("global","getPressRoom");this.$http.get("/Umbraco/Api/PressRoom/GetPressRoomOverview/".concat(e)).then(function(e){t.pressCollection$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getMediaById=function(e){var t=this,i=this.loaderService.setLoader("global","getMedia");return this.$http.get("/Umbraco/Api/PressRoom/GetMediaById/".concat(e)).then(function(e){t.media$.onNext(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService"],app.service("PressRoomService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.sitemapService=e,this.smoothScroll=t,this.disposables=new Rx.CompositeDisposable}(e=e.General||(e.General={})).Sitemap||(e.Sitemap={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.sitemapService.sitemap$.subscribe(function(e){e&&(t.sitemap=e)})),this.sitemapService.getSitemap()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.scrollToElement=function(e){e=document.getElementById(e);$(e).find("a").first().focus(),this.smoothScroll(e,{offset:110})},i.$inject=["SitemapService","smoothScroll"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Sitemap/Sitemap.component.html",this.bindings={}},app.component("sitemap",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/Sitemap/",this.sitemap$=new Rx.BehaviorSubject(null)}(e=e.General||(e.General={})).Sitemap||(e.Sitemap={}),t.prototype.getSitemap=function(){var t=this,i=this.loaderService.setLoader("sitemap","getSitemap");this.incomHttp.get(this.baseurl+"GetSitemap").then(function(e){t.sitemap$.onNext(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService"],app.service("SitemapService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable,this.isDepartmentPage=!1}(e=e.General||(e.General={})).Sitemap||(e.Sitemap={}),i.prototype.$onInit=function(){this.isDepartmentPage?this.pageLevel="level-"+(this.page.Level-3):this.pageLevel="level-"+this.page.Level},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/Sitemap/SitemapPage.component.html",this.bindings={page:"<",isDepartmentPage:"<"}},app.component("sitemapPage",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.smsMessagesService=e}(e=e.General||(e.General={})).SmsMessages||(e.SmsMessages={}),i.prototype.$onInit=function(){var t=this;this.smsMessagesService.getSmsMessagesForUser(),this.subscription=this.smsMessagesService.userMe
1ssages$.subscribe(function(e){e&&(t.messages=e.Messages)})},i.prototype.close=function(e){this.messages.splice(e,1)},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.$inject=["SmsMessagesService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/General/SmsMessages/SmsMessages.Component.html"},app.component("smsMessages",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.userMessages$=new Rx.BehaviorSubject(null),this.companyDepartmentMessages$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/SmsMessages/"}(e=e.General||(e.General={})).SmsMessages||(e.SmsMessages={}),t.prototype.getSmsMessagesForUser=function(){var t=this,i=this.loaderService.setLoader("global","getSmsMessages");this.incomHttp.get(this.baseurl+"GetSmsMessagesForUser").then(function(e){t.userMessages$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.getSmsMessagesForCompanyOrDepartment=function(e,t){var i=this,n=this.loaderService.setLoader("global","getSmsMessages");this.incomHttp.get("".concat(this.baseurl,"GetSmsMessagesForCompanyOrDepartment?companyId=").concat(e,"&departmentId=").concat(t)).then(function(e){i.companyDepartmentMessages$.onNext(e),i.loaderService.removeLoader(n)})},t.$inject=["incomHttpService","LoaderService"],app.service("SmsMessagesService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.basketService=e,this.loaderService=t,this.pageProviderService=i,this.pageContentService=n,this.storageService=o,this.disposables=new Rx.CompositeDisposable,this.currentPage=0,this.entryLimit=10}(e=e.Housing||(e.Housing={})).Basket||(e.Basket={}),i.prototype.$onInit=function(){var t=this,i=this.loaderService.setLoader("basket","initBasket");this.storageService.getSupportAdministrationState().subscribe(function(e){t.isSupportAdminstrationActive=e}),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){t.isSupportAdminstrationActive?t.isInteressent=!1:t.isInteressent=-1<e.LoginAccessLevel,t.pageProviderService.getPageByDocumentType(t.isInteressent?"memberships":"signUp").then(function(e){return t.signUpUrl=e.Url})}),this.disposables.add(this.basketService.getBasketDepartmentData().subscribe(function(e){e&&(t.items=e.Departments,t.items.forEach(function(e){for(var t=[],i=0;i<e.Addresses.length;i++)e.Addresses[i].Coordinates&&t.add({Lat:e.Addresses[i].Coordinates.Lat,Lng:e.Addresses[i].Coordinates.Lng,InfoBox:{Headline:e.Name,Description:e.Addresses[i].Street+" "+(e.Addresses[i].Location||""),Image:e.Images.any()?e.Images.firstOrDefault().Url:null}});e.googlemarkers=t}),t.loaderService.removeLoader(i),t.tryUpdateDepartmentList())})),this.disposables.add(this.basketService.contents$.subscribe(function(e){e&&(t.wishes=e.Departments,t.amountOfWishes=e.Counts.NumberOfTenancies,t.signUpPrice=e.PriceToPay,t.tryUpdateDepartmentList())})),this.pageProviderService.getPageByDocumentType("departmentPresentation").then(function(e){return t.departmentUrl=e.Url}),this.pageProviderService.getPageByDocumentType("login").then(function(e){return t.loginUrl=e.Url}),this.pageProviderService.getPageByDocumentType("tenancySearch").then(function(e){return t.tenancySearchUrl=e.Url}),this.basketService.loadContentsIfNotAlreadyLoaded()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.tryUpdateDepartmentList=function(){if(this.wishes&&this.items)for(var i=this,e=this.items.length-1;0<=e;e--)!function(e){var t=i.items[e];0===i.wishes.filter(function(e){return e.CompanyId===t.Company.Id&&e.DepartmentId===t.Id}).length&&i.items.splice(e,1)}(e)},i.prototype.removeDepartment=function(e){var t=this,i=this.loaderService.setLoader("department-"+e.Company.Id+"-"+e.Id,"removeDepartment");this.basketService.removeDepartment(e).then(function(){return t.loaderService.removeLoader(i)})},i.prototype.anyTenanciesInBasket=function(e){return!!e&&e.TenancyGroups.reduce(function(e,t){return e.concat(t.Tenancies)},[]).any(function(e){return e.IsWish})},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.allTenanciesInBasket=function(e){return!!e&&e.TenancyCountInBasket>=e.TenancyCount},i.prototype.clearBasket=function(){var e=this,t=this.loaderService.setLoader("emptyBasket","empty");
1this.basketService.clear().then(function(){return e.loaderService.removeLoader(t)})},i.$inject=["BasketService","LoaderService","PageProviderService","PageContentService","StorageService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Basket/Basket.component.html",this.bindings={}},app.component("basket",new e)}(BoligExtra=BoligExtra||{}),!function(i){var n;function e(e,t,i){this.incomHttp=e,this.modalService=t,this.tenancySearchService=i,this.updateContentsRequest=null,this.baseurl="/umbraco/api/Basket/",this.basketData$=new Rx.BehaviorSubject(null),this.contents$=new Rx.BehaviorSubject(null)}(n=i.Housing||(i.Housing={})).Basket||(n.Basket={}),e.prototype.getOrderIdForMembership=function(e,t){e=e.map(function(e){return{CompanyId:e.CompanyId,DepartmentId:e.DepartmentId,TenancyId:e.TenancyId}});return this.incomHttp.post(this.baseurl+"GetOrderIdForMembershipPurchase?InternalWaitList="+t,e)},e.prototype.getBasketDepartmentData=function(){var t=this;return this.incomHttp.get(this.baseurl+"GetResultData").then(function(e){t.basketData$.onNext(e)}),this.basketData$},e.prototype.loadContentsIfNotAlreadyLoaded=function(){null===this.contents$.getValue()&&this.updateContents()},e.prototype.addTenancies=function(e){var t=this,e=(e=angular.isArray(e)?e:[e]).map(function(e){return{CompanyId:e.CompanyId,DepartmentId:e.DepartmentId,TenancyId:e.TenancyId}});return this.incomHttp.post(this.baseurl+"ToggleTenancies?add=true",e).then(function(e){return t.handleAddTenanciesResult(e)})},e.prototype.removeTenancies=function(e){var t=this,e=(e=angular.isArray(e)?e:[e]).map(function(e){return{CompanyId:e.CompanyId,DepartmentId:e.DepartmentId,TenancyId:e.TenancyId}});return this.incomHttp.post(this.baseurl+"ToggleTenancies?add=false",e).then(function(e){return t.updateContents()})},e.prototype.addDepartment=function(e){e=e.HasSpecificTenancySignUp?this.getSpecificTenanciesToToggle(e.TenancyGroups,!1):this.getTenanciesToToggle(e.TenancyGroups,!1);return this.addTenancies(e)},e.prototype.removeDepartment=function(e){e=e.HasSpecificTenancySignUp?this.getSpecificTenanciesToToggle(e.TenancyGroups,!0):this.getTenanciesToToggle(e.TenancyGroups,!0);return this.removeTenancies(e)},e.prototype.addSearchResult=function(){var t=this,e=this.tenancySearchService.getSearchFromHash();return this.incomHttp.post(this.baseurl+"AddSearchResults",e).then(function(e){return t.handleAddTenanciesResult(e)})},e.prototype.toggleDepartment=function(e,t,i){var n=this;return this.incomHttp.post(this.baseurl+"ToggleDepartment?companyId=".concat(e,"&departmentId=").concat(t,"&add=").concat(i),null).then(function(e){return n.handleAddTenanciesResult(e)})},e.prototype.clear=function(){var t=this,e=this.incomHttp.post(this.baseurl+"ClearBasket",null);return e.then(function(e){return t.updateContents()}),e},e.prototype.getTenanciesToToggle=function(e,t){for(var i=[],n=0;n<e.length;n++)for(var o=e[n],r=[],s=0;s<o.Tenancies.length;s++){var a=o.Tenancies[s];a.IsWish!==t||r.contains(a.Rooms)||(r.push(a.Rooms),i.push(a))}return i},e.prototype.getSpecificTenanciesToToggle=function(e,t){for(var i=[],n=0;n<e.length;n++){var o=e[n];i.push.apply(i,o.Tenancies.filter(function(e){return e.IsWish===t}))}return i},e.prototype.handleAddTenanciesResult=function(e){var t=this;return e.MissingMemberships.some(function(e){return angular.isNumber(e.PriceToPay)})?this.modalService.createModal("/app/Housing/Basket/Modals/MissingMembership.modal.html",n.Basket.Modals.MissingMembershipModalController,{missingMemberships:e.MissingMemberships,tenancies:[]},"lg").result.then(function(e){return t.updateContents()},function(e){return t.updateContents()}):(e.MaxRentResult?this.modalService.createModal("/App/Housing/Basket/Modals/BasketMaxRent.modal.html",n.Basket.Modals.BasketMaxRentModalController,{affectedResults:e.MaxRentResult.AffectedResults,maxRent:e.MaxRentResult.MaxRent,totalWishes:e.MaxRentResult.TotalWishes}):e.SomeTenanciesHaveRules&&this.modalService.createModal("/App/Housing/TenancySearch/Modals/SomeTenanciesHaveRules.modal.html",i.TenancySearch.Modals.SomeTenanciesHaveRulesController,null),this.updateContents())},e.prototype.updateContents=function(){var t,i=this;return null==this.updateContentsRequest&&(t=this.updateContentsRequest=this.incomHttp.get(this.baseurl+"GetBasketContents?includeAllTenancies=false"),this.updateContentsRequest.then(function(e){t===i.updateContentsRequest&&(i.updateContentsRequest=null,i.contents$.onNext(e))})),this.updateContentsRequest},e.$inject=["incomHttpService","ModalService","TenancySearchService"],app.service("BasketService",e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.modalInstance=e,this.modalData=t,this.basketService=i,this.disposables=new Rx.CompositeDisposable,this.totalPriceToPay=0,this.totalPriceToPayInternal=0}
1(e=(e=(e=e.Housing||(e.Housing={})).Basket||(e.Basket={})).Modals||(e.Modals={})).MissingMembershipModalData=function(){},t.prototype.$onInit=function(){this.tenancies=this.modalData.tenancies,this.missingMemberships=this.modalData.missingMemberships.filter(function(e){return!e.IsInternal}),this.missingMembershipsInternal=this.modalData.missingMemberships.filter(function(e){return e.IsInternal}),this.totalPriceToPay=this.missingMemberships.reduce(function(e,t){return e+t.PriceToPay},0),this.totalPriceToPayInternal=this.missingMembershipsInternal.reduce(function(e,t){return e+t.PriceToPay},0)},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.purchaseMembership=function(e){var t=this;void 0===e&&(e=!1),this.request||(this.request=this.basketService.getOrderIdForMembership(this.tenancies,e),this.request.then(function(e){e&&"Completed"===e.OrderId?t.modalInstance.close():(t.transactionId=e.TransactionId,t.orderId=e.OrderId)}))},t.$inject=["$uibModalInstance","modalData","BasketService"],e.MissingMembershipModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.basketService=e,this.pageProvider=t,this.pageContentService=i,this.disposables=new Rx.CompositeDisposable,this.pingAnimation=!1}(e=(e=e.Housing||(e.Housing={})).Basket||(e.Basket={})).Widget||(e.Widget={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e=-1<e.LoginAccessLevel?"TenancyWishes":"basket";t.pageProvider.getPageByDocumentType(e).then(function(e){t.basketPage=e})}),this.disposables.add(this.basketService.contents$.subscribe(function(e){e&&(e.Counts.NumberOfTenancies!==t.numberOfTenanciesInBasket&&(t.pingAnimation=!0,setTimeout(function(){t.pingAnimation=!1},500)),t.numberOfTenanciesInBasket=e.Counts.NumberOfTenancies)})),this.basketService.loadContentsIfNotAlreadyLoaded()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["BasketService","PageProviderService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Basket/Widget/BasketWidget.component.html"},app.component("basketWidget",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.loaderService=t,this.fileService=i,this.departments$=new Rx.BehaviorSubject(null),this.departmentViewModel$=new Rx.Subject,this.urls={}}(e=e.Housing||(e.Housing={})).Department||(e.Department={}),t.prototype.getDepartmentWithTenancies=function(e,t,i){var n,o=this;(i=void 0===i?!1:i)||(n=this.loaderService.setLoader("contentSection","departmentPresentation")),this.$http.get("/Umbraco/api/department/GetDepartmentWithTenancies?companyId=".concat(e,"&departmentId=").concat(t)).then(function(e){o.departmentViewModel$.onNext(e),n&&o.loaderService.removeLoader(n)})},t.prototype.getAllDepartments=function(e){var t=this,e=null===(e=void 0===e?null:e)?"":e.toString();return this.$http.get("/Umbraco/api/department/GetDepartments?companyId=".concat(e)).then(function(e){t.departments$.onNext(e)}),this.departments$},t.prototype.downloadDepartmentPresentationDocument=function(e){var t=this;this.$http.get("/Umbraco/api/department/GetDepartmentPresentationDocument?documentId="+e).then(function(e){t.fileService.downloadFile([e])})},t.prototype.getDepartmentUrl=function(e,t){var i=this,n=new Rx.BehaviorSubject(null),o=e+"_"+t;return this.urls[o]?n.onNext(this.urls[o]):this.$http.get("Umbraco/api/department/GetDepartmentUrl?companyId="+e+"&departmentId="+t).then(function(e){e&&(i.urls[o]=e,n.onNext(i.urls[o]))}),n},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("DepartmentService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t){this.modalService=e,this.sceService=t,this.disposables=new Rx.CompositeDisposable}e=(e=e.Housing||(e.Housing={})).Department||(e.Department={}),t=e.DepartmentInfo||(e.DepartmentInfo={}),n.prototype.$onInit=function(){var t=this;this.departmentInfo.forEach(function(e){"string"==typeof e.SvgString&&(e.SvgString=t.sceService.trustAsHtml(e.SvgString))})},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.viewInfoText=function(e){this.modalService.createModal("/App/Housing/Department/DepartmentInfo/Modal/DepartmentInfo.Modal.html",t.Modal.DepartmentInfoModalController,{depInfo:e},"md")},n.$inject=["ModalService","$sce"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Department/DepartmentInfo/
1DepartmentInfo1/DepartmentInfo1.component.html",this.bindings={departmentInfo:"<"}},app.component("departmentInfo",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=(e=e.Housing||(e.Housing={})).Department||(e.Department={})).DepartmentInfo||(e.DepartmentInfo={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){this.DepartmentInfo=this.modalData.depInfo},t.prototype.$onDestroy=function(){},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.DepartmentInfoModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.departmentSelectorService=e,this.$scope=t,this.removeFirstAfdEntry=function(e){return-1<e.indexOf("afd.")?e.splice(e.indexOf("afd."),1):-1<e.indexOf("afd")?e.splice(e.indexOf("afd")):e},this.disposables=new Rx.CompositeDisposable,this.currentPage=0,this.entryLimit=12,this.allMapMarkers=[],this.overview=!1}(e=(e=e.Housing||(e.Housing={})).Department||(e.Department={})).DepartmentSelector||(e.DepartmentSelector={}),i.prototype.$onInit=function(){var o=this;this.disposables.add(this.departmentSelectorService.getDepartments().subscribe(function(e){e&&(o.departments=e,o.shownDepartments=e,o.getAllMapMarkers(e),e.forEach(function(e){for(var t=[],i=0;i<e.Addresses.length;i++)e.Addresses[i].Coordinates&&t.add({Lat:e.Addresses[i].Coordinates.Lat,Lng:e.Addresses[i].Coordinates.Lng,InfoBox:{Headline:e.Name,Description:e.Addresses[i].Street+" "+(e.Addresses[i].Location||""),Image:e.Images.any()?e.Images.firstOrDefault().Url:null}});e.googlemarkers=t}))})),this.overview&&1==this.overview&&(this.entryLimit=9),this.$scope.$watch(function(){return o.sText},function(e,t){if(e&&e!==t){for(var i=[],n=0;n<o.departments.length;n++)o.departmentMatch(o.departments[n])&&i.add(o.departments[n]);o.shownDepartments=i}else e&&""!==e||(o.shownDepartments=o.departments)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.updatePage=function(e){this.currentPage=e},i.prototype.getAllMapMarkers=function(e){var n=[];e.forEach(function(e){for(var t,i=0;i<e.Addresses.length;i++)e.Addresses[i].Coordinates&&(t=e.Images.any()?e.Images.firstOrDefault().Url:null,e.Description,n.add({Lat:e.Addresses[i].Coordinates.Lat,Lng:e.Addresses[i].Coordinates.Lng,InfoBox:{Headline:e.Name,Description:e.Address.Street+" "+e.Address.Location,Image:t,Link:e.PresentationUrl}}))}),this.allMapMarkers=n},i.prototype.departmentMatch=function(t){var i=this;return this.removeFirstAfdEntry(this.sText.toLowerCase().split(" ")).every(function(e){return i.departmentSelectorService.matchesDepartment(t,e)})},i.$inject=["DepartmentSelectorService","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Department/DepartmentSelector/DepartmentSelector.component.html",this.bindings={overview:"<"}},app.component("departmentSelector",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){var n=this;this.incomHttp=e,this.loaderService=t,this.featureFlags=i,this.matchesDepartment=function(e,t){return n.featureFlags.departmentSelectorSearchFlags.checkDepartmentName&&null!=e.Name&&null!=e.Name&&-1<e.Name.toLowerCase().indexOf(t.toLowerCase())||n.featureFlags.departmentSelectorSearchFlags.checkDepartmentNumber&&n.matchesDepartmentNumber(e,t)||n.featureFlags.departmentSelectorSearchFlags.checkDepartmentAddress&&n.matchesAddress(e.Address,t.toLowerCase())||n.featureFlags.departmentSelectorSearchFlags.checkAddresses&&e.Addresses.any(function(e){return n.matchesAddress(e,t.toLowerCase())})},this.matchesZipCode=function(e,t){return null!=e.ZipCode&&null!=e.ZipCode&&-1<e.ZipCode.toLowerCase().indexOf(t)},this.matchesCity=function(e,t){return null!=e.City&&null!=e.City&&-1<e.City.toLowerCase().indexOf(t)},this.matchesStreet=function(e,t){return null!=e.Street&&null!=e.Street&&-1<e.Street.toLowerCase().indexOf(t)},this.matchesAddress=function(e,t){return n.matchesZipCode(e,t)||n.matchesStreet(e,t)||n.matchesCity(e,t)},this.matchesDepartmentNumber=function(e,t){return-1<e.Id.toString().indexOf(t)},this.baseurl="/umbraco/api/DepartmentSelector/",this.department$=new Rx.BehaviorSubject(null),this.companyDepartment$=new Rx.BehaviorSubject(null)}
1(e=(e=e.Housing||(e.Housing={})).Department||(e.Department={})).DepartmentSelector||(e.DepartmentSelector={}),t.prototype.goToPageOnDepartment=function(e,t){this.incomHttp.post(this.baseurl+"GoToPageOnDepartment?documentType="+t,e)},t.prototype.goToDepartment=function(e){this.incomHttp.post(this.baseurl+"GoToDepartmentPage/",e).then(function(e){window.scroll({top:0,left:0,behavior:"smooth"})})},t.prototype.getBasicDepartments=function(){var t=this,i=this.loaderService.setLoader("contentSection","getBasicDepartments");return this.incomHttp.get(this.baseurl+"GetDepartments").then(function(e){t.department$.onNext(e.Departments),t.loaderService.removeLoader(i)}),this.department$},t.prototype.getDepartments=function(){var t=this,i=this.loaderService.setLoader("global","getDepartments");return this.incomHttp.get(this.baseurl+"GetDepartments").then(function(e){e=t.addGoogleInformationToDepartments(e.Departments);t.department$.onNext(e),t.loaderService.removeLoader(i)}),this.department$},t.prototype.getDepartmentsForCompany=function(e){var t=this,i=this.loaderService.setLoader("global","getDepartments");return this.incomHttp.get(this.baseurl+"GetDepartmentsForCompany/"+e).then(function(e){e=t.addGoogleInformationToDepartments(e.Departments);t.companyDepartment$.onNext(e),t.loaderService.removeLoader(i)}),this.companyDepartment$},t.prototype.addGoogleInformationToDepartments=function(e){for(var t=e,i=0;i<t.length;i++){for(var n=[],o=0;o<t[i].Addresses.length;o++)t[i].Addresses[o].Coordinates&&t[i].Addresses[o].Coordinates.Lat&&t[i].Addresses[o].Coordinates.Lng&&n.add({Lat:t[i].Addresses[o].Coordinates.Lat,Lng:t[i].Addresses[o].Coordinates.Lng});t[i].googlemarkers=n}return t},t.$inject=["incomHttpService","LoaderService","FeatureFlagService"],app.service("DepartmentSelectorService",t)}(BoligExtra=BoligExtra||{}),!function(t){var e,i;function n(e,t,i){this.departmentSelectorService=e,this.$scope=t,this.$timeout=i,this.disposables=new Rx.CompositeDisposable,this.showDepartmentList=!1,this.selectedIndex=0}(e=(e=(e=t.Housing||(t.Housing={})).Department||(e.Department={})).DepartmentSelector||(e.DepartmentSelector={})).DepartmentSelectorBasic||(e.DepartmentSelectorBasic={}),n.prototype.$onInit=function(){var i=this;this.disposables.add(this.departmentSelectorService.getBasicDepartments().subscribe(function(e){e&&(i.departments=e,i.departments.sort(function(e,t){return e.Name>t.Name?1:t.Name>e.Name?-1:0}),i.shownDepartments=i.departments)})),this.$scope.$watch(function(){return i.searchText},function(e,t){e&&e!==t?(i.shownDepartments=i.departments.filter(function(e){return i.departmentSelectorService.matchesDepartment(e,i.searchText)}),i.selectedIndex=0):e&&""!==e||(i.shownDepartments=i.departments,i.selectedIndex=0)}),null!=this.inputDepartment&&(this.searchText=this.inputDepartment.Name)},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.updateInputDepartment=function(e){this.searchText=e.Name,void 0!==this.inputDepartment?this.inputDepartment=e:this.departmentSelectorService.goToDepartment(e)},n.prototype.doBlur=function(){var e=this;this.$timeout(function(){e.showDepartmentList=!1},500)},n.prototype.keyEvent=function(e){e.keyCode===t.Utility.Key.UpArrow&&0<this.selectedIndex?this.selectedIndex--:e.keyCode===t.Utility.Key.DownArrow&&this.selectedIndex<this.shownDepartments.length-1?this.selectedIndex++:e.keyCode===t.Utility.Key.Enter?this.updateInputDepartment(this.shownDepartments[this.selectedIndex]):e.keyCode===t.Utility.Key.Escape&&this.doBlur()},n.$inject=["DepartmentSelectorService","$scope","$timeout"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Department/DepartmentSelector/DepartmentSelectorBasic/DepartmentSelectorBasic.component.html",this.bindings={inputDepartment:"=",displayText:"<"}},app.component("departmentSelectorBasic",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s,a,l,c,d){this.departmentService=e,this.utilityService=t,this.owlCarouselOptionsService=i,this.basketService=n,this.fileService=o,this.featureFlagService=r,this.videoService=s,this.windowService=a,this.sce=l,this.mapsUtility=c,this.loaderService=d,this.disposables=new Rx.CompositeDisposable,this.googlemarkers=[],this.showBackToMyPageButton=!1,this.descriptionLimit=250,this.displayMultipleDepartmentDescriptions=!1,this.openTenancyTables=!1,this.hasExtendedPresentation=!1,this.extendedPresentationIsVideo=!1,this.showExtendedPresentationVideo=!1,this.anyBoardMembers=!0}
1(e=(e=e.Housing||(e.Housing={})).Department||(e.Department={})).Presentation||(e.Presentation={}),i.prototype.$onInit=function(){var t=this,e=this.utilityService.getParameterByName("key").split("_"),i=parseInt(e[0],10),n=parseInt(e[1],10);this.departmentService.getDepartmentWithTenancies(i,n),this.owlCarouselOptions=this.owlCarouselOptionsService.getDefaultOptions(),this.owlCarouselOptions.autoHeightClass="gallery-preview",this.disposables.add(this.departmentService.departmentViewModel$.subscribe(function(e){e&&(t.department?t.department.TenancyCountInBasket=e.TenancyCountInBasket:(t.googlemarkers=t.mapsUtility.getGoogleMapsMarkersFrom(e),t.department=e,t.department.DepartmentDocuments=e.DepartmentDocuments.orderBy(function(e){return e.SortOrder}),t.showAvailableButton=t.department.TenancyGroups.any(function(e){return 0<e.AvailableTenancies.length}),t.anyDepartmentDescription=t.department.DepartmentDescriptions.any(function(e){return""!=e.Text}),t.hasExtendedPresentation=null!=t.department.ExtendedPresentationUrl&&null!=t.department.ExtendedPresentationPreviewImageUrl,t.hasExtendedPresentation&&(e=t.videoService.parseYoutubeVideoId(t.department.ExtendedPresentationUrl),t.extendedPresentationIsVideo=0!=e,t.extendedPresentationIsVideo)&&(t.extendedPresentationYoutubeVideoEmbedUrl=t.sce.trustAsResourceUrl("https://www.youtube.com/embed/"+e+"?&autoplay=1"))))})),this.utilityService.getParameterByName("StepBack")&&1<window.history.length&&(this.showBackToMyPageButton=!0),this.displayMultipleDepartmentDescriptions=this.featureFlagService.departmentPages.displayMultipleDepartmentDescriptions,this.hideTenanciesAndTenancySearchButtons=this.featureFlagService.departmentPages.hideTenanciesAndTenancySearchButtons,this.hideDepartmentIdText=this.featureFlagService.departmentPages.hideDepartmentIdText,this.disposables.add(this.basketService.contents$.subscribe(function(e){e&&t.departmentService.getDepartmentWithTenancies(i,n,!0)}))},i.prototype.orderByFunc=function(e){return"null"==e.$key?"ê":e.$key},i.prototype.toggleDepartmentInBasket=function(){var e=this,t=this.loaderService.setLoader("department-page-toggle-wishes-"+this.department.Id,"toggling"),i=!this.allTenanciesInBasket();this.basketService.toggleDepartment(this.department.Company.Id,this.department.Id,i).then(function(){e.department.TenancyCountInBasket=i?e.department.TotalTenancyCount:0}).finally(function(){e.loaderService.removeLoader(t)})},i.prototype.allTenanciesInBasket=function(){return this.department&&this.department.TenancyCountInBasket>=this.department.TenancyCount},i.prototype.downloadFile=function(e){this.departmentService.downloadDepartmentPresentationDocument(e.Id)},i.prototype.getFileExtensionIcon=function(e){return this.fileService.getFileIconClass(e)},i.prototype.twoStepsBack=function(){window.history.go(-1)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.toggleShow=function(e,t){t.Show=!e,t.Show?t.Limit=Number.MAX_VALUE:t.Limit=this.descriptionLimit},i.prototype.openExtendedPresentationLinkOrShowVideo=function(){this.extendedPresentationIsVideo?this.showExtendedPresentationVideo=!0:this.windowService.open(this.department.ExtendedPresentationUrl,"_blank")},i.$inject=["DepartmentService","UtilityService","OwlCarouselOptionsService","BasketService","FileService","FeatureFlagService","VideoService","$window","$sce","GoogleMapsUtilityService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Department/Presentation/DepartmentPresentation.component.html"},app.component("departmentPresentation",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.tenancySearchService=e,this.disposables=new Rx.CompositeDisposable,this.mapMarkers=[]}(e=(e=e.Housing||(e.Housing={})).TenancySearch||(e.TenancySearch={})).Criterias||(e.Criterias={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.tenancySearchService.getAreasForMap().subscribe(function(e){e&&(t.areas=e.DepartmentsForRegions,t.updateMapMarkers())})),this.disposables.add(this.tenancySearchService.searchCriteria$.subscribe(function(e){e&&(t.regions=e.Areas,t.updateMapMarkers())}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.updateMapMarkers=function(){var e=this,i=[];this.areas&&this.regions&&(this.regions.any(function(e){return e.Selected})?this.regions.forEach(function(t){e.areas.forEach(function(e){e.Coordinates&&e.RegionId===t.Id&&t.Selected&&i.addRange(e.Coordinates.where(function(e){return!!e.Address&&!!e.Address.Coordinates}).map(function(e){return{Lat:e.Address.Coordinates.Lat,Lng:e.Address.Coordinates.Lng,InfoBox:{Headline:e.DepartmentName,Description:e.Address.Street+" "+e.Address.Location,Image:e.DepartmentImageUrl}}}))})}):this.areas.forEach(function(e){e.Coordinates&&i.addRange(e.Coordinates.where(function(e){return!!e.Address&&!!e.Address.Coordinates}).map(function(e){return{Lat:e.Address.Coordinates.Lat,Lng:e.Address.Coordinates.Lng,InfoBox:{Headline:e.DepartmentName,Description:e.Address.Street+" "+e.Address.Location,Image:e.DepartmentImageUrl}}}))})),this.mapMarkers=i},i.$inject=["TenancySearchService"],t=i,e=function(){this.controller=t,this.templateUrl="/App/Housing/TenancySearch/Criterias/AreasOnMap.component.html"},app.component("areasOnMap",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;
1function i(e,t){this.$scope=e,this.$attrs=t,this.showFrom=!1,this.showTo=!1,this.showTicksValues=!1}(e=(e=(e=e.Housing||(e.Housing={})).TenancySearch||(e.TenancySearch={})).Criterias||(e.Criterias={})).CriteriaSectionComponents||(e.CriteriaSectionComponents={}),i.prototype.populateDropDowns=function(){if("dropdown"===this.$attrs.type.toLowerCase()){var e=this.$attrs.minValue?parseInt(this.$attrs.minValue):1,t=this.$attrs.maxValue?parseInt(this.$attrs.maxValue):10,i=this.$attrs.step?parseInt(this.$attrs.step):1;if(this.showFrom){this.fromValues=[];for(var n=e;n<=t;n+=i)(!this.showTo||this.data.SelectedTo>=n)&&this.fromValues.add(n)}if(this.showTo){this.toValues=[];for(n=e;n<=t;n+=i)(!this.showFrom||this.data.SelectedFrom<=n)&&this.toValues.add(n)}}},i.prototype.populateSliders=function(){var e,t,i,o=this;"slider"===this.$attrs.type.toLowerCase()&&(e=this.$attrs.minValue?parseInt(this.$attrs.minValue):1,t=this.$attrs.maxValue?parseInt(this.$attrs.maxValue):10,i=this.$attrs.step?parseInt(this.$attrs.step):1,this.sliderValues=angular.copy({SelectedFrom:this.data.SelectedFrom,SelectedTo:this.data.SelectedTo}),this.slider={floor:e,ceil:t,step:i,showTicks:!0,showTicksValues:this.showTicksValues,noSwitching:!0,showSelectionBar:!0,translate:function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,".")},onEnd:function(e,t,i,n){o.showTo&&o.showFrom?(o.data.SelectedFrom=t,o.data.SelectedTo=i):o.showTo?o.data.SelectedTo=t:o.showFrom&&(o.data.SelectedFrom=t)}})},i.prototype.$onChanges=function(){var t=this;this.data&&(this.showTo=void 0!==this.data.SelectedTo&&null!==this.data.SelectedTo,this.showFrom=void 0!==this.data.SelectedFrom&&null!==this.data.SelectedFrom,"dropdown"===this.$attrs.type.toLowerCase()?this.showTo&&this.$scope.$watch(function(){return t.data},function(e){t.populateDropDowns()}):"slider"===this.$attrs.type.toLowerCase()&&this.$scope.$watch(function(){return t.data},function(e){t.populateSliders()}))},i.$inject=["$scope","$attrs"],t=i,e=function(){this.templateUrl=["$element","$attrs",function(e,t){return"/App/Housing/TenancySearch/Criterias/CriteriaSectionComponents/".concat(t.type,".component.html")}],this.bindings={data:"<",elementClass:"@",showTicksValues:"<"},this.controller=t,this.controllerAs="criteriaSectionCtrl",this.transclude=!0},app.component("tenancySearchCriteriaSection",new e)}(BoligExtra=BoligExtra||{}),!function(i){var e,t;function n(e,t,i,n,o,r,s,a){this.$scope=e,this.tenancySearchService=t,this.utilityService=i,this.$timeout=n,this.featureFlagService=o,this.tenancyUtilities=r,this.siteMenuStateService=s,this.departmentSelectorService=a,this.subscriptions=new Rx.CompositeDisposable,this.criteriaOpen=!0,this.openSection=null,this.showOnlyTenanciesWithAssignmentRules=!1,this.selectedIndex=0,this.keyEventUsed=!1}(e=(e=i.Housing||(i.Housing={})).TenancySearch||(e.TenancySearch={})).Criterias||(e.Criterias={}),n.prototype.$onInit=function(){var n=this,e=(this.splitHousingTypesView=this.featureFlagService.tenancySearchCriterias.disableSplitHousingTypes,this.utilityService.getParameters("hash").hasOwnProperty("ar")&&this.tenancySearchService.showSearchResult$.onNext(!0),this.subscriptions.add(this.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.subscribe(function(e){var t=n.tenancySearchService.getSearchFromHash();n.tenancySearchService.searchCriteria$.onNext(t)})),this.tenancySearchService.loadSearchCriterias(),this.tenancySearchService.getSearchFromHash());e?(this.tenancySearchService.searchCriteria$.onNext(e),this.searchCriterias=JSON.parse(JSON.stringify(e))):this.tenancySearchService.searchCriteria$.filter(function(e){return!!e}).take(1).subscribe(function(e){n.searchCriterias=JSON.parse(JSON.stringify(e)),n.anyPremisSelected=n.searchCriterias.Premises.any(function(e){return e.Selected}),n.anyWaitTimeSelected=n.searchCriterias.WaitTimes.any(function(e){return e.Selected}),n.anyRoomsSelected=n.searchCriterias.Rooms.any(function(e){return e.Selected})}),this.$scope.$watch(function(){return n.searchCriterias},function(e,t){!e||t&&e.Page!==t.Page||(n.tenancySearchService.searchCriteria$.onNext(e),n.tenancySearchService.setSearchHash(e),(t=n.tenancySearchService.getSearchFromHash())&&(t.Page=0,n.tenancySearchService.page$.onNext(t.Page),n.tenancySearchService.updatePageHash(t.Page)),n.tenancySearchService.doSearch(t),n.anyPremisSelected=n.searchCriterias.Premises.any(function(e){return e.Selected}),n.anyWaitTimeSelected=n.searchCriterias.WaitTimes.any(function(e){return e.Selected}),n.anyRoomsSelected=n.searchCriterias.Rooms.any(function(e){return e.Selected}))},!0),this.subscriptions.add(this.tenancySearchService.isSelectingAreasOnMap$.subscribe(function(e){1==(n.selectOnMap=e)&&(n.initialMapSelectionSearchCriteria=angular.copy(n.searchCriterias))})),this.featureFlagService.siteMenu.enablePushingSiteMenu&&(this.subscriptions.add(this.siteMenuStateService.openMenuSection$.subscribe(function(e){n.openSection=e})),this.criteriaOpen=!1),this.showAssignmentRulesCheckbox=this.featureFlagService.tenancySearchCriterias.enableshowOnlyTenanciesWithAssignmentRulesCheckbox,this.checkPosition();this.subscriptions.add(this.tenancySearchService.searchResult$.subscribe(function(e){var t,i;e&&(t=n.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.getValue(),i=JSON.parse(JSON.stringify(e.Departments)),n.tenancyCount=t?n.tenancyUtilities.getAmountOfTenanciesIn(i):e.NumberOfTenancies,n.departmentCount=e.NumberOfDepartments)})),this.subscriptions.add(this.tenancySearchService.getSearchTexts().subscribe(function(e){e&&(n.totalTenancyCount=e.NumberOfTenancies)})),this.subscriptions.add(this.utilityService.isHorizontalTablet.subscribe(function(e){n.isTabletViewOrHigher=e})),this.subscriptions.add(this.tenancySearchService.showSearchResult$.subscribe(function(e){!n.featureFlagService.siteMenu.enablePushingSiteMenu||!0===n.isTabletViewOrHigher?n.hasSought=e:n.hasSought=!0})),this.subscriptions.add(this.departmentSelectorService.getBasicDepartments().subscribe(function(e){(n.departments=e)&&(n.departments.sort(function(e,t){return e.Name>t.Name?1:t.Name>e.Name?-1:0}),n.shownDepartments=n.departments,n.selectedIndex=0)})),this.$scope.$watch(function(){return n.searchText},function(e,t){!1===n.keyEventUsed?(e&&e!==t&&1<e.length?n.shownDepartments=n.departments.filter(n.filter,n.searchText):n.shownDepartments=n.departments,n.selectedIndex=0):n.keyEventUsed=!1})},n.prototype.$onDestroy=function(){this.subscriptions.dispose(),this.featureFlagService.siteMenu.enablePushingSiteMenu&&(this.resetCriterias(),"search"===this.openSection)&&this.siteMenuStateService.getMenuSection(null)},n.prototype.cancelSelectingAreasOnMap=function(){this.tenancySearchService.searchCriteria$.onNext(this.initialMapSelectionSearchCriteria),this.tenancySearchService.isSelectingAreasOnMap$.onNext(!1)},n.prototype.resetCriterias=function(){window.location.hash="",window.location.reload()},n.prototype.selectAreasOnMap=function(e){this.tenancySearchService.isSelectingAreasOnMap$.onNext(!!e),this.tenancySearchService.showSearchResult$.onNext(!0)},n.prototype.onCriteriasChanged=function(){this.tenancySearchService.setSearchHash(this.searchCriterias)},n.prototype.selectedAreaCount=function(){return this.searchCriterias&&this.searchCriterias.Areas.where(function(e){return e.Selected}).length},n.prototype.allAreasSelected=function(){return this.searchCriterias&&!this.searchCriterias.Areas.any(function(e){return!e.Selected})},n.prototype.toggleAllAreas=function(){var t;this.searchCriterias&&(t=this.allAreasSelected(),this.searchCriterias.Areas.forEach(function(e){return e.Selected=!t}),this.updateSearchCriteria("Standard"))},n.prototype.checkPosition=function(){window.matchMedia("(max-width: 767px)").matches&&(this.criteriaOpen=!1)},n.prototype.selectedApartmenttypesCount=function(){return this.searchCriterias&&this.searchCriterias.ApartmentTypes.where(function(e){return e.Selected}).length+this.searchCriterias.TenancyTypes.where(function(e){return e.Selected}).length},n.prototype.refreshSlider=function(){var e=this;this.$timeout(function(){e.$scope.$broadcast("rzSliderForceRender")})},n.prototype.showTenancies=function(){this.isTabletViewOrHigher?(this.tenancySearchService.setSearchHash(this.searchCriterias),this.tenancySearchService.showSearchResult$.onNext(!0)):this.siteMenuStateService.toggleMenu("close")},n.prototype.updateAssignmentRuleVisibility=function(e){this.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.onNext(e)},n.prototype.updateSearchCriteria=function(e){if("Standard"===e)this.searchCriterias.Companies.forEac
1h(function(e){e.Selected=!1,e.Departments.forEach(function(e){return e.Selected=!1})}),this.searchText="";else if("CompanyOrDepartment"===e)for(var t in this.defaultSearchCriterias)this.defaultSearchCriterias.hasOwnProperty(t)&&"Companies"!==t&&"TenancyTypes"!==t&&(this.searchCriterias[t]=angular.copy(this.defaultSearchCriterias[t]));this.tenancySearchService.searchCriteria$.onNext(this.searchCriterias),this.tenancySearchService.setSearchHash(this.searchCriterias)},n.prototype.keyEvent=function(e){e.keyCode===i.Utility.Key.UpArrow&&0<this.selectedIndex?(this.selectedIndex--,this.keyEventUsed=!0,this.searchText=this.shownDepartments[this.selectedIndex].Name):e.keyCode===i.Utility.Key.DownArrow&&this.selectedIndex<this.shownDepartments.length-1?(this.selectedIndex++,this.keyEventUsed=!0,this.searchText=this.shownDepartments[this.selectedIndex].Name):e.keyCode===i.Utility.Key.Enter&&this.updateInputDepartment(this.shownDepartments[this.selectedIndex]);var e=document.getElementById("dep_"+this.selectedIndex),t=document.getElementById("dep_");e&&(e=document.body.getBoundingClientRect(),t.getBoundingClientRect().top,e.top)},n.prototype.filter=function(e){var t=this.toString();if(e.Name.toUpperCase().startsWith(t.toUpperCase())||e.Addresses.any(function(e){return e.Street.toUpperCase().startsWith(t.toUpperCase())})||e.Addresses.any(function(e){return e.City.toUpperCase().startsWith(t.toUpperCase())})||e.Addresses.any(function(e){return e.ZipCode.toUpperCase().startsWith(t.toUpperCase())})||-1<e.Id.toString().indexOf(t.toUpperCase()))return e},n.prototype.doBlur=function(){var e=this;this.$timeout(function(){e.showDepartmentList=!1},500)},n.prototype.showDepartments=function(e){this.showDepartmentList=e,setTimeout(function(){var e=$
1(".main-content").height(),t=$(".item-list").height(),e=($(".main-content main").animate({"min-height":e+t+50}),document.createEvent("Event"));e.initEvent("resize",!1,!0),window.dispatchEvent(e)},500)},n.prototype.updateInputDepartment=function(i){this.searchText=i.Name,this.searchCriterias.Companies.forEach(function(t){t.Selected=t.Id===i.Company.Id,t.Departments.forEach(function(e){e.Selected=t.Selected&&e.Id===i.Id})}),this.updateSearchCriteria("CompanyOrDepartment")},n.$inject=["$scope","TenancySearchService","UtilityService","$timeout","FeatureFlagService","TenancyUtilitiesService","SiteMenuStateService","DepartmentSelectorService"],t=n,e=function(){this.templateUrl="/App/Housing/TenancySearch/Criterias/TenancySearchCriterias.component.html",this.controller=t,this.controllerAs="$ctrl"},app.component("tenancySearchCriterias",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.tenancySearchService=i}e=(e=(e=e.Housing||(e.Housing={})).TenancySearch||(e.TenancySearch={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this,i=this.tenancySearchService.getAssignmentRuleMessage(this.modalData.assignmentRuleId).subscribe(function(e){e&&(t.model=e,i.dispose())})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","TenancySearchService"],e.AssignmentRuleModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$scope=e,this.$modalInstance=t,this.modalData=i,this.tenancySearchService=n,this.mapMarkers=[],this.areas=[],this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.Housing||(e.Housing={})).TenancySearch||(e.TenancySearch={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){var t=this;this.regions=angular.copy(this.modalData.regions),this.disposables.add(this.tenancySearchService.getAreasForMap().subscribe(function(e){e&&(t.areas=e.DepartmentsForRegions,t.updateMapMarkers())}))},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.save=function(){this.$modalInstance.close(this.regions)},t.prototype.updateMapMarkers=function(){var i=this;this.mapMarkers=[],this.regions.forEach(function(t){i.areas.forEach(function(e){e.RegionId===t.Id&&t.Selected&&i.mapMarkers.addRange(e.Coordinates.map(function(e){return{Lat:e.Address.Coordinates.Lat,Lng:e.Address.Coordinates.Lng,InfoBox:{Headline:e.DepartmentName,Description:e.Address.Street+" "+(e.Address.Location||""),Image:e.DepartmentImageUrl}}}))})})},t.$inject=["$scope","$uibModalInstance","modalData","TenancySearchService"],e.SelectAreasOnMapController=t}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e,t,i,n,o,r,s,a,l){this.tenancySearchService=e,this.basketService=t,this.modalService=i,this.loaderService=n,this.tenancyUtilities=o,this.mapsUtility=r,this.utilityService=s,this.$scope=a,this.$timeOut=l,this.subscriptions=new Rx.CompositeDisposable,this.searchResult=[],this.departmentPresentationUrl="",this.entryLimit=10,this.currentPageNumber=0}e=e.Housing||(e.Housing={}),(t=e.TenancySearch||(e.TenancySearch={})).Result||(t.Result={}),n.prototype.$onInit=function(){function t(e){var t;e&&(t=o.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.getValue(),o.departmentPresentationUrl=e.DepartmentPresentationUrl,o.searchResult=JSON.parse(JSON.stringify(e.Departments)),o.updateSearchResultsWithAssignmentRuleAndSetMarkers(t),o.utilityService.safeDigest())}var o=this;this.subscriptions.add(this.tenancySearchService.searchResult$.distinctUntilChanged().subscribe(t)),this.subscriptions.add(this.tenancySearchService.page$.subscribe(function(e){o.currentPageNumber=e})),this.subscriptions.add(this.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.subscribe(function(e){t(o.tenancySearchService.getCurrentResults())})),this.subscriptions.add(this.tenancySearchService.tenanciesForDepartments$.subscribe(function(i){for(var n=0;n<i.length;n++)!function(){var t=i[n],e=o.searchResult.find(function(e){return e.Company.Id===t.Company.Id&&e.Id===t.Id});if(!e)return;e.TenancyGroups=t.TenancyGroups}()})),this.subscriptions.add(this.basketService.contents$.subscribe(function(e){e&&o.searchResult.forEach(function(t){var n,o=e.Departments.find(function(e){return e.CompanyId==t.Company.Id&&e.DepartmentId==t.Id});o?t.HasSpecificTenancySignUp?t.TenancyCountInBasket=o.TenancyIds.length:(n=0,t.TenancyGroups.forEach(function(e){var i=[];e.Tenancies.map(function(e){return e.Rooms}
1).distinct().forEach(function(t){i.push(e.Tenancies.filter(function(e){return e.Rooms==t}))}),i.forEach(function(t){o.TenancyIds.some(function(e){return t.map(function(e){return e.TenancyId}).contains(e)})&&0<t.length&&(n+=t[0].NumberOfTenancies)})}),t.TenancyCountInBasket=n):t.TenancyCountInBasket=0})}))},n.prototype.$onDestroy=function(){this.subscriptions.dispose()},n.prototype.updateSearchResultsWithAssignmentRuleAndSetMarkers=function(e){var t=this;e&&(this.searchResult=this.tenancyUtilities.getDepartmentsWithOnlyAssignmentRuleTenancies(this.searchResult)),this.searchResult.forEach(function(e){e.googlemarkers=t.mapsUtility.getGoogleMapsMarkersFrom(e),e.RefKey=e.Company.Id+"_"+e.Id})},n.prototype.toggleDepartmentInBasket=function(e){var t=this,i=this.loaderService.setLoader("department-toggle-wishes-"+e.Company.Id+"-"+e.Id,"toggling"),n=!this.allTenanciesInBasket(e);this.basketService.toggleDepartment(e.Company.Id,e.Id,n).then(function(){t.loaderService.removeLoader(i),e.TenancyCountInBasket=n?e.TenancyCount:0},function(){t.loaderService.removeLoader(i)})},n.prototype.showAssignmentRule=function(e){this.modalService.createModal("/App/Housing/TenancySearch/Modals/AssignmentRule.modal.html",t.Modals.AssignmentRuleModalController,{assignmentRuleId:e},"md")},n.prototype.allTenanciesInBasket=function(e){return e&&e.TenancyCountInBasket>=e.TenancyCount},n.$inject=["TenancySearchService","BasketService","ModalService","LoaderService","TenancyUtilitiesService","GoogleMapsUtilityService","UtilityService","$scope","$timeout"],i=n,e=function(){this.templateUrl="/App/Housing/TenancySearch/Result/TenancySearchListResult.component.html",this.controller=i,this.controllerAs="$ctrl"},app.component("tenancySearchListResult",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.tenancySearchService=e,this.departmentService=t,this.loaderService=i,this.tenancyUtilities=n,this.googlemarkers=[],this.disposables=new Rx.CompositeDisposable,this.searchResult=[],this.departmentPresentationUrl="",this.totalAddresses=0}(e=(e=e.Housing||(e.Housing={})).TenancySearch||(e.TenancySearch={})).Result||(e.Result={}),i.prototype.$onInit=function(){var i=this;this.loader=this.loaderService.setLoader("mapsMarkers","mapsResult");this.disposables.add(this.tenancySearchService.searchResult$.subscribe(function(e){var t;e&&(t=i.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.getValue(),i.departmentPresentationUrl=e.DepartmentPresentationUrl,i.searchResult=JSON.parse(JSON.stringify(e.Departments)),i.googlemarkers=[],t&&(i.searchResult=i.tenancyUtilities.getDepartmentsWithOnlyAssignmentRuleTenancies(i.searchResult)),i.searchResult.forEach(function(t){i.totalAddresses+=t.Addresses.length,i.disposables.add(i.departmentService.getDepartmentUrl(t.Company.Id,t.Id).subscribe(function(e){e&&i.addMarkersToMapForDepartment(t,e)}))}))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.isFinishedLoading=function(){return this.googlemarkers.length===this.totalAddresses&&(this.loaderService.removeLoader(this.loader),!0)},i.prototype.addMarkersToMapForDepartment=function(e,t){for(var i=0;i<e.Addresses.length;i++)if(e.Addresses[i].Coordinates){for(var n=e.Images.any()?e.Images.firstOrDefault().Url:null,o=0,r=0;r<e.TenancyGroups.length;r++)for(var s=[],a=0;a<e.TenancyGroups[r].Tenancies.length;a++)s.contains(e.TenancyGroups[r].Tenancies[a].Rooms)||(o+=e.TenancyGroups[r].Tenancies[a].NumberOfTenancies,s.add(e.TenancyGroups[r].Tenancies[a].Rooms));var l="Denne afdeling har ".concat(o," bolig").concat(1===o?"":"er",", der matcher din
1søgning");this.googlemarkers.add({Lat:e.Addresses[i].Coordinates.Lat,Lng:e.Addresses[i].Coordinates.Lng,InfoBox:{Description:l,Headline:e.Name,Image:n,Link:t}})}},i.$inject=["TenancySearchService","DepartmentService","LoaderService","TenancyUtilitiesService"],t=i,e=function(){this.templateUrl="/App/Housing/TenancySearch/Result/TenancySearchMapResult.component.html",this.controller=t,this.controllerAs="$ctrl"},app.component("tenancySearchMapResult",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s,a,l,c){this.tenancySearchService=e,this.basketService=t,this.loaderService=i,this.pageProvider=n,this.pageContentService=o,this.featureFlagService=r,this.tenancyUtilities=s,this.windowService=a,this.utilityService=l,this.siteMenuStateService=c,this.hasSought=!1,this.viewType="List",this.entryLimit=10,this.disposables=new Rx.CompositeDisposable,this.showOnlyTenanciesWithAssignmentRules=!1,this.searchResultInBasket=!1,this.pingAnimation=!1}(e=(e=e.Housing||(e.Housing={})).TenancySearch||(e.TenancySearch={})).Result||(e.Result={}),i.prototype.$onInit=function(){function t(e){var t;n.disposables.add(n.tenancySearchService.isSearching$.subscribe(function(e){n.tenancyResultLoading=e?"Tilpasser søgning":""})),e&&(t=n.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.getValue(),n.searchResult=JSON.parse(JSON.stringify(e.Departments)),n.updateSearchResults(t,e.NumberOfDepartments,e.NumberOfTenancies))}var i,n=this,o=!0,e=(this.disposables.add(this.utilityService.isHorizontalTablet.subscribe(function(e){n.isTabletOrHigher=e})),Rx.Observable.combineLatest(this.tenancySearchService.searchCriteria$,this.tenancySearchService.page$.distinctUntilChanged(),function(e,t){return[e,t]}).filter(function(e){return!!e[0]}).tap(function(e){i=n.loaderService.setLoader("tenancySearch","search")}).debounce(50).tap(function(e){i&&n.tenancySearchService.searchResult$.take(1).subscribe(function(e){return n.loaderService.removeLoader(i)})}).subscribe(function(e){var t=e[0],e=e[1];t.Page=e!==n.currentPageNumber&&e||0,n.tenancySearchService.doSearch(t,o),o=!1,n.currentPageNumber=e,n.searchCriteria=t}));this.disposables.add(e),this.disposables.add(this.tenancySearchService.getSearchTexts().subscribe(function(e){e&&(n.introText=e.IntroContent,n.noResultText=e.NoResultContent,n.backgroundImage=e.BackgroundImage,n.totalTenancyCount=e.NumberOfTenancies)})),this.disposables.add(this.tenancySearchService.searchResult$.subscribe(t)),this.disposables.add(this.tenancySearchService.isSelectingAreasOnMap$.subscribe(function(e){return n.selectOnMap=e})),this.disposables.add(this.tenancySearchService.showSearchResult$.subscribe(function(e){!n.featureFlagService.siteMenu.enablePushingSiteMenu||!0===n.isTabletOrHigher?n.hasSought=e:n.hasSought=!0})),this.disposables.add(this.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.subscribe(function(e){n.showOnlyTenanciesWithAssignmentRules=e;e=n.tenancySearchService.getCurrentResults();t(e)})),this.disposables.add(this.basketService.contents$.subscribe(function(e){e&&(e.Counts.NumberOfTenancies!==n.numberOfTenanciesInBasket&&(n.pingAnimation=!0,setTimeout(function(){n.pingAnimation=!1},500)),n.numberOfTenanciesInBasket=e.Counts.NumberOfTenancies)})),this.disposables.add(this.siteMenuStateService.openMenuSection$.subscribe(function(e){n.openSection=e})),this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){e=-1<e.LoginAccessLevel?"TenancyWishes":"basket";n.pageProvider.getPageByDocumentType(e).then(function(e){n.basketPage=e})}),this.showAssignmentRulesCheckbox=this.featureFlagService.tenancySearchCriterias.enableshowOnlyTenanciesWithAssignmentRulesCheckbox,this.hideButtonAddAllTenancyToBasket=this.featureFlagService.tenancySearchPage.hideAddAllTenancysToBasketButton},i.prototype.updateSearchResults=function(e,t,i){var n=this;e?(this.searchResult=this.tenancyUtilities.getDepartmentsWithOnlyAssignmentRuleTenancies(this.searchResult),this.tenancyCount=this.tenancyUtilities.getAmountOfTenanciesIn(this.searchResult)):this.tenancyCount=i,this.tenancyResultDescription='<span class="number">'.concat(this.tenancyCount,"</span>
1\n <span> bolig").concat(1==this.tenancyCount?"":"er"," matcher din søgning</span> \n "),this.searchResult.length>(this.currentPageNumber+1)*this.entryLimit&&this.tenancySearchService.updatePageHash(0),this.departmentCount=t,this.searchResultInBasket=this.searchResult.every(function(e){return n.allTenanciesInBasket(e)})},i.prototype.updatePage=function(e){this.tenancySearchService.updatePageHash(e)},i.prototype.toggleSearchCriteria=function(){"search"===this.openSection?this.siteMenuStateService.getMenuSection(null):(this.siteMenuStateService.toggleMenu(null),this.siteMenuStateService.getMenuSection("search"))},i.prototype.addSearchResultToBasket=function(){var e=this,t=this.loaderService.setLoader("add-all-wishes","add-all");this.basketService.addSearchResult().finally(function(){return e.loaderService.removeLoader(t)})},i.prototype.updateAssignmentRuleVisibility=function(e){this.tenancySearchService.showOnlyTenanciesWithAssignmentRules$.onNext(e)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.allTenanciesInBasket=function(e){return e&&e.TenancyCountInBasket>=e.TenancyCount},i.prototype.isViewMode=function(e){return this.viewType===e},i.prototype.setViewMode=function(e){this.viewType=e},i.prototype.navigate=function(e){this.windowService.history.pushState(null,"",e)},i.prototype.initiateSearch=function(){this.tenancySearchService.setSearchHash(this.searchCriteria),this.tenancySearchService.showSearchResult$.onNext(!0)},i.$inject=["TenancySearchService","BasketService","LoaderService","PageProviderService","PageContentService","FeatureFlagService","TenancyUtilitiesService","$window","UtilityService","SiteMenuStateService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/TenancySearch/Result/TenancySearchResultSummary.component.html"},app.component("tenancySearchResultSummary",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r,s){var a,l=this,c=(this.$http=t,this.loaderService=i,this.$location=n,this.utilityService=o,this.tenancyUtilities=r,this.featureFlagService=s,this.areaCoordinates$=new Rx.BehaviorSubject(null),this.loadOnInit=!1,this.page$=new Rx.BehaviorSubject(0),this.searchCriteria$=new Rx.BehaviorSubject(null),this.defaultSearchCriteria$=new Rx.BehaviorSubject(null),this.searchResult$=new Rx.Subject,this.isSelectingAreasOnMap$=new Rx.BehaviorSubject(!1),this.showSearchResult$=new Rx.BehaviorSubject(!1),this.showOnlyTenanciesWithAssignmentRules$=new Rx.BehaviorSubject(!1),this.isSearching$=new Rx.Subject,this.tenanciesForDepartments$=new Rx.BehaviorSubject([]),this.assignmentRuleMessage$=new Rx.BehaviorSubject(null),this.doSearchSubject$=new Rx.Subject,this.baseurl="/Umbraco/api/TenancySearch/",location.hash&&(this.loadOnInit=!0),this.doSearchSubject$.tap(function(e){return l.internalSearchResult$=new Rx.ReplaySubject}).debounce(500).subscribe(function(t){l.searchCriterias=angular.copy(t),a=l.loaderService.setLoader("tenancySearch","search"),l.$http.post("".concat(l.baseurl,"GetSearchResults?includeTenancies=false"),t).then(function(e){l.currentResults=e,l.showOnlyTenanciesWithAssignmentRules$.getValue()&&(e.Departments=l.tenancyUtilities.getDepartmentsWithOnlyAssignmentRuleTenancies(e.Departments)),l.searchResult$.onNext(e),l.isSearching$.onNext(!1),c(e,t.Page,t.PageSize,!0)})}),function t(e,i,n,o){var r;void 0===o&&(o=!1),l.loaderService.removeLoader(a),0!==e.Departments.length&&(l.internalSearchResult$.onNext([e,i]),(r=JSON.parse(JSON.stringify(l.searchCriterias))).Page=o&&0<i?0:++i,e.Departments.length==n)&&l.$http.post("".concat(l.baseurl,"GetSearchResults?includeTenancies=false"),r).then(function(e){t(e,i,n)})});e.$watch(function(){return o.parseNumber(o.getParameters("hash").p)},function(e,t){0===e?l.page$.onNext(0):l.page$.onNext(e||t||0)}),this.searchCriteria$.subscribe(function(e){l.tenanciesForDepartments$.onNext([])})}(e=e.Housing||(e.Housing={})).TenancySearch||(e.TenancySearch={}),t.prototype.loadSearchCriterias=function(t,i){var n,o=this;void 0===t&&(t=!1),void 0===i&&(i=!1),this.defaultSearchCriteria$.getValue()||(0==i&&(n=this.loaderService.setLoader("searchCriteras","load")),this.$http.get(this.baseurl+"GetDefaultSearchCriterias").then(function(e){o.searchCriterias=e,null==o.defaultSearchCriteria$.getValue()&&o.defaultSearchCriteria$.onNext(e),t?o.searchCriteria$.onNext(e):o.searchCriteria$.onNext(o.getSearchFromHash()),0==i&&o.loaderService.removeLoader(n)}))},t.prototype.doSearch=function(t,e){var i=this;return void 0===e&&(e=!1),!t||!e&&this.isSameCriteria(t,this.searchCriterias)||this.doSearchSubject$.onNext(t),this.internalSearchResult$&&this.internalSearchResult$.filter(function(e){return e[1]==t.Page}).take(1).map(function(e){return e[0]}).delay(5).subscribe(function(e){i.searchResult$.onNext(e)}),this.searchResult$},t.prototype.updatePageHash=function(e){var t=this.utilityService.getParameters("hash"),e=(t.p=e,$.param(t));this.$location.hash(e)},t.prototype.getAssignmentRuleMessage=function(e){var t=this;return this.$http.get(this.baseurl+"GetAssignmentRuleMessage/"+e).then(function(e){t.assignmentRuleMessage$.onNext(e),setTimeout(function(e){return t.assignmentRuleMessage$.onNext(null)},10)}),this.assignmentRuleMessage$},t.prototype.setSearchHash=function(e){e=this.getSearchHash(e);this.$location.hash(e)},t.prototype.getSearchHash=function(e){var t={};return t.ar=e.Areas.where(function(e){return e.Selected}).map(function(e){return e.Id}).join(","),t.tt=e.TenancyTypes.where(function(e){return e.Selected}).map(function(e){return e.Id}).join(","),t.at=e.ApartmentTypes.where(function(e){return e.Selected}).map(function(e){return e.Id}).join(","),t.pr=e.Premises.where(function(e){return e.Selected}).map(function(e){return e.Id}).join(","),t.wa=e.WaitTimes.where(function(e){return e.Selected}).map(function(e){return e.Id}).join(","),t.ro=e.Rooms.where(function(e){return e.Selected}).map(function(e){return e.Id}
1).join(","),t.do=e.OnlyWhereDogAllowed,t.ca=e.OnlyWhereCatAllowed,t.re=e.Rent.SelectedFrom+";"+e.Rent.SelectedTo,t.si=e.Size.SelectedFrom+";"+e.Size.SelectedTo,t.av=e.ShowOnlyAvailable,t.cNo=e.Companies.where(function(e){return e.Selected}).map(function(e){return e.Id}).join(","),t.dNo=e.Companies.map(function(e){return e.Departments.where(function(e){return e.Selected}).map(function(e){return e.Id})}).where(function(e){return null!=e&&""!==e.toString()}).join(","),t.p=this.page$.getValue(),$.param(t)},t.prototype.getSearchFromHash=function(){var i,t,n,e=this.featureFlagService.tenancySearchCriterias.departmentsPerPage,o=angular.copy(this.searchCriterias);return o&&(i=this.utilityService.getParameters("hash"),o.Page=0,o.PageSize=e,delete i.p,o.Areas.forEach(function(t){var e=(i.ar||"").split(",");t.Selected=e.any(function(e){return parseInt(e)===t.Id})}),o.TenancyTypes.forEach(function(t){var e=(i.tt||"").split(",");t.Selected=e.any(function(e){return parseInt(e)===t.Id})}),o.ApartmentTypes.forEach(function(t){var e=(i.at||"").split(",");t.Selected=e.any(function(e){return parseInt(e)===t.Id})}),o.Premises.forEach(function(t){var e=(i.pr||"").split(",");t.Selected=e.any(function(e){return parseInt(e)===t.Id})}),o.WaitTimes.forEach(function(t){var e=(i.wa||"").split(",");t.Selected=e.any(function(e){return parseInt(e)===t.Id})}),i.ro&&o.Rooms.forEach(function(t){var e=(i.ro||"").split(",");t.Selected=e.any(function(e){return parseInt(e)===t.Id})}),i.re&&(e=i.re.split(";"),o.Rent.SelectedFrom=this.utilityService.parseNumber(e[0]),o.Rent.SelectedTo=this.utilityService.parseNumber(e[1])),i.si&&(e=i.si.split(";"),o.Size.SelectedFrom=this.utilityService.parseNumber(e[0]),o.Size.SelectedTo=this.utilityService.parseNumber(e[1])),o.ShowOnlyAvailable="true"===i.av,o.OnlyWhereDogAllowed="true"===i.do,o.OnlyWhereCatAllowed="true"===i.ca,t=(i.cNo||"").split(",").map(function(e){return parseInt(e)}),n=(i.dNo||"").split(",").map(function(e){return parseInt(e)}),o.Companies.forEach(function(e){e.Selected=-1<t.indexOf(e.Id),e.Selected&&e.Departments.forEach(function(e){e.Selected=-1<n.indexOf(e.Id)})})),o},t.prototype.getAreasForMap=function(){var t=this;return this.$http.get(this.baseurl+"GetMapCoordinatesForAreas").then(function(e){return t.areaCoordinates$.onNext(e)}),this.areaCoordinates$},t.prototype.getSearchTexts=function(){var t=this;return this.searchIntro$||(this.searchIntro$=new Rx.ReplaySubject(1),this.$http.get(this.baseurl+"GetSearchTexts").then(function(e){return t.searchIntro$.onNext(e)})),this.searchIntro$},t.prototype.getCurrentResults=function(){if(this.currentResults)return JSON.parse(JSON.stringify(this.currentResults))},t.prototype.isSameCriteria=function(e,t){return angular.equals(e.ApartmentTypes,t.ApartmentTypes)&&angular.equals(e.Areas,t.Areas)&&angular.equals(e.Companies,t.Companies)&&angular.equals(e.OnlyWhereC
1atAllowed,t.OnlyWhereCatAllowed)&&angular.equals(e.OnlyWhereDogAllowed,t.OnlyWhereDogAllowed)&&angular.equals(e.Premises,t.Premises)&&this.compareRent(e.Rent,t.Rent)&&angular.equals(e.Rooms,t.Rooms)&&angular.equals(e.ShowOnlyAvailable,t.ShowOnlyAvailable)&&angular.equals(e.Size,t.Size)&&angular.equals(e.TenancyTypes,t.TenancyTypes)&&angular.equals(e.WaitTimes,t.WaitTimes)},t.prototype.compareRent=function(e,t){return e.SelectedFrom==t.SelectedFrom&&e.SelectedTo==t.SelectedTo},t.prototype.getTenanciesForDepartment=function(e,t,i){var n=this,o=this.tenanciesForDepartments$.getValue();if(!o.some(function(e){return e.Company.Id===i&&e.Id===i}))return(e=this.$http.post(this.baseurl+"GetSearchResults?includeTenancies=true",e)).then(function(e){e&&null!=(e=e.Departments.find(function(e){return e.Company.Id==t&&e.Id==i}))&&(o.add(e),n.tenanciesForDepartments$.onNext(o))}),e},t.$inject=["$rootScope","incomHttpService","LoaderService","$location","UtilityService","TenancyUtilitiesService","FeatureFlagService"],app.service("TenancySearchService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n,o,r){var s=this;this.$modalInstance=e,this.modalData=t,this.validationService=i,this.formService=n,this.requestAvailableTenancyService=o,this.utilityService=r,this.contactForm={User:{Address:{}}},this.dateFormat=this.utilityService.shortDateFormat,this.tenancyInformation=t.companyId+"_"+t.departmentId+"_"+t.tenancyId,this.tenancyAddress=t.address,this.moveInDate=t.moveInDate,this.requestAvailableTenancyService.getCurrentUserData().then(function(e){e&&(s.contactForm.User=e)}),this.emailRegex=this.validationService.getEmailRegex()}e=(e=(e=e.Housing||(e.Housing={})).Tenancy||(e.Tenancy={})).Modals||(e.Modals={}),t.prototype.getAddress=function(e){e&&(this.contactForm.User.Address.ZipCode=e.ZipCode,this.contactForm.User.Address.City=e.City,this.contactForm.User.Address.Street=e.Street,this.contactForm.User.Address.Location=e.Location,this.contactForm.User.Address.LocalTown=e.LocalTown)},t.prototype.submit=function(){var e=angular.copy(this.contactForm);e.CompanyId=this.modalData.companyId,e.DepartmentId=this.modalData.departmentId,e.TenancyId=this.modalData.tenancyId,this.requestAvailableTenancyService.sendForm(e),this.$modalInstance.close()},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","ValidationService","FormService","RequestAvailableTenancyService","UtilityService"],e.RequestAvailableTenancyController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/RequestAvailableTenancy/"}(e=(e=e.Housing||(e.Housing={})).Tenancy||(e.Tenancy={})).Modals||(e.Modals={}),t.prototype.getCurrentUserData=function(){return this.incomHttp.get(this.baseurl+"GetCurrentUserData")},t.prototype.sendForm=function(e){this.incomHttp.post(this.baseurl+"SendContactForm",e)},t.$inject=["incomHttpService","LoaderService"],app.service("RequestAvailableTenancyService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.FloorPlanUrls=t.urls}e=(e=(e=e.Housing||(e.Housing={})).Tenancy||(e.Tenancy={})).Modals||(e.Modals={}),t.prototype.submit=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.TenancyFloorPlanModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modalInstance=e}e=(e=(e=(e=e.Housing||(e.Housing={})).Tenancy||(e.Tenancy={})).Presentation||(e.Presentation={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.$inject=["$uibModalInstance"],e.TenancyPlacementInfoController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.$modalInstance=e,this.modalData=t,this.basketService=i,this.modalService=n,this.$scope=o,this.$compile=r,this.selectedIndex=0,this.selectedView="tenancyInfo",this.tenacyInfoVIew="tenancyInfo",this.floorplanView="floorplans"}t=e.Housing||(e.Housing={}),e=(e=(e=t.Tenancy||(t.Tenancy={})).Presentation||(e.Presentation={})).Modal||(e.Modal={}),i.prototype.$onInit=function(){var t=this;this.tenancy=this.modalData.tenancy,this.toggleSpecificTenancies=this.modalData.toggleSpecificTenancies,this.preventAddingToBasket=this.modalData.preventAddingToBasket,this.basketSubscription=this.basketService.contents$.subscribe(function(e){e&&(t.tenancy.IsWish=e.Departments.any(function(e){return e.CompanyId==t.tenancy.CompanyId&&e.DepartmentId==t.tenancy.DepartmentId&&e.TenancyIds.any(function(e){return e==t.tenancy.TenancyId})}))})},i.prototype.$onDestroy=function(){this.basketSubscription.dispose()},i.prototype.toggleWish=function(e){e.IsWish?this.basketService.addTenancies(e):this.basketService.removeTenancies(e)},i.prototype.showAssignmentRule=function(e){this.modalService.createModal("/App/Housing/TenancySearch/Modals/AssignmentRule.modal.html",t.TenancySearch.Modals.AssignmentRuleModalController,{assignmentRuleId:e},"md")},i.prototype.openWalkThrough=function(){var t=this,e=angular.element('<div class="angular-lightbox-overlay flex loading-md walkthrough">\n <div class="absolute inset-0 w-full h-full bg" tabindex="0" aria-label="Luk modalen" ng-click="$ctrl.closeLightbox()"></div>
1\n <span class="angular-lightbox-inner" aria-modal="true" role="dialog" aria-label="Modal billede galleri">\n <iframe src=\''.concat(this.tenancy.WalkThrough,'\'></iframe>\n <span href class="close" title="Close" ng-click="$ctrl.closeLightbox()">×</span>\n </span>\n </div>'))[0],i=this.$scope.$new(!0);(i.$ctrl=this).lightboxDom=this.$compile(e)(i)[0],document.addEventListener("keydown",function(e){return t.onKeyDown(e,t.lightboxDom)}),setTimeout(function(){document.body.appendChild(t.lightboxDom)},100)},i.prototype.cancel=function(){this.$modalInstance.close()},i.prototype.onKeyDown=function(e,t){"Escape"===e.key&&this.closeLightbox(t)},i.prototype.closeLightbox=function(t){var i=this;t=t||this.lightboxDom,document.removeEventListener("keydown",function(e){return i.onKeyDown(e,t)}),t.remove()},i.$inject=["$uibModalInstance","modalData","BasketService","ModalService","$scope","$compile"],e.TenancyPresentationController=i}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.basketService=e,this.featureFlagService=t,this.scope=i,this.tenancySearchService=n,this.loaderService=o,this.disposables=new Rx.CompositeDisposable,this.loadingTenanciesResult$=new Rx.Subject}(e=(e=e.Housing||(e.Housing={})).Tenancy||(e.Tenancy={})).Presentation||(e.Presentation={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.basketService.contents$.subscribe(function(e){e&&(t.wishes=e.Departments,t.tryUpdateDepartmentListWishStatus())})),this.showTables=this.openTenancyGroups,this.scope.$watch(function(){return t.openTenancyGroups},function(){t.openTenancyGroups&&(t.showTables=t.openTenancyGroups)}),this.disposables.add(this.tenancySearchService.searchCriteria$.filter(function(e){return null!=e}).subscribe(function(e){t.tenancySearchCriteria=angular.copy(e)})),this.tenancySearchService.loadSearchCriterias()},i.prototype.$onChanges=function(e){var t=this;e.rawTenancyGroups&&e.rawTenancyGroups.currentValue!==e.rawTenancyGroups.previousValue&&this.groupTenancies(e.rawTenancyGroups.currentValue),e.showOnlyWishes&&e.showOnlyWishes.currentValue!==e.showOnlyWishes.previousValue&&(e.showOnlyWishes.currentValue?this.tenancygroups.forEach(function(e){return e.showGroup="wishes"!==t.type||!t.showOnlyWishes||e.hasWishes}):this.tenancygroups.forEach(function(e){return e.showGroup=!0}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.groupTenancies=function(e){var r=this;this.tenancygroups=[],e.forEach(function(i){for(var n={apartmentType:i.ApartmentType,tenancyType:i.TenancyType,roomGroupings:[],availableRoomGroupings:[]},o=i.Tenancies.map(function(e){return e.Rooms}).distinct(),e=0;e<o.length;e++)!function(t){var e={rooms:o[t],tenancies:i.Tenancies.filter(function(e){return e.Rooms===o[t]}).map(function(e){return e.CanToggle=r.hideWishToggle(e),e})};e.hasOpenTenancies=e.tenancies.some(function(e){return e.showTen}),n.roomGroupings.push(e)}(e);for(o=i.AvailableTenancies.map(function(e){return e.Rooms}).distinct(),e=0;e<o.length;e++)!function(t){var e={rooms:o[t],tenancies:i.AvailableTenancies.filter(function(e){return e.Rooms===o[t]}).map(function(e){return e.CanToggle=r.hideWishToggle(e),e})};e.hasOpenTenancies=e.tenancies.some(function(e){return e.showTen}),n.availableRoomGroupings.push(e)}(e);n.hasWishes=i.Tenancies.some(function(e){return e.IsWish}),n.showGroup="wishes"!==r.type||!r.showOnlyWishes||n.hasWishes,r.tenancygroups.push(n)})},i.prototype.tryUpdateDepartmentListWishStatus=function(){var e=this;if(this.wishes&&this.tenancygroups)for(var t=this.tenancygroups.length-1;0<=t;t--){var i=this.tenancygroups[t];i.roomGroupings.reduce(function(e,t){return e.concat(t.tenancies)},[]).forEach(function(t){t.IsWish=e.wishes.some(function(e){return e.CompanyId===t.CompanyId&&e.DepartmentId===t.DepartmentId&&-1<e.TenancyIds.indexOf(t.TenancyId)})}),this.featureFlagService.availableTenancies.treatAvailableTenanciesLikeStandardTenancies&&i.availableRoomGroupings.reduce(function(e,t){return e.concat(t.tenancies)}
1,[]).forEach(function(t){t.IsWish=e.wishes.some(function(e){return e.CompanyId===t.CompanyId&&e.DepartmentId===t.DepartmentId&&-1<e.TenancyIds.indexOf(t.TenancyId)})})}},i.prototype.showGroup=function(e){return"wishes"!==this.type||!this.showOnlyWishes||e.reduce(function(e,t){return e.concat(t)},[]).any(function(e){return e.IsWish})},i.prototype.hideWishToggle=function(e){return!!e.AssignmentRule},i.prototype.loadTenancies=function(){var t=this;this.hasLoadedTenancies||this.isLoadingTenancies||(this.disposables.add(this.loadingTenanciesResult$.subscribe(function(e){null!=e&&(t.hasLoadedTenancies=!0)})),this.startLoadingTenancies())},i.prototype.loadTenanciesAndShowTable=function(){var e,t,i=this;this.hasLoadedTenancies?this.showTables=!this.showTables:(e="tenancyPresentationList_"+this.companyId+"_"+this.departmentId,t=this.loaderService.setLoader(e,e),this.disposables.add(this.loadingTenanciesResult$.subscribe(function(e){null!=e&&(i.loaderService.removeLoader(t),i.showTables=!i.showTables,i.hasLoadedTenancies=!0)})),this.isLoadingTenancies||this.startLoadingTenancies())},i.prototype.startLoadingTenancies=function(){var i=this;this.tenancySearchCriteria.Companies.forEach(function(t){t.Selected=t.Id==i.companyId,t.Departments.forEach(function(e){e.Selected=t.Selected&&e.Id==i.departmentId})}),this.tenancySearchCriteria.Page=0,this.isLoadingTenancies=!0,this.tenancySearchService.getTenanciesForDepartment(this.tenancySearchCriteria,this.companyId,this.departmentId).then(function(e){i.loadingTenanciesResult$.onNext(e)})},i.$inject=["BasketService","FeatureFlagService","$scope","TenancySearchService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Housing/Tenancy/Presentation/TenancyPresentationList.component.html",this.bindings={rawTenancyGroups:"<tenancygroups",disableAddToList:"<",isInteressent:"<",type:"<",showOnlyWishes:"<",openTenancyGroups:"<",showOnlyAvailable:"<",toggleSpecificTenancies:"<",companyId:"<",departmentId:"<"}},app.component("tenancyPresentationList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=(e=e.MemberPortal||(e.MemberPortal={})).FlexibleProfile||(e.FlexibleProfile={})).FlexibleChoices||(e.FlexibleChoices={}),i.prototype.$onInit=function(){},i.prototype.callback=function(){this.onUpdate&&this.onUpdate({updatedChoices:this.input})},i.prototype.setDirty=function(e){e.IsDirty=!0},t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/FlexibleProfile/FlexibleChoices/FlexibleChoices.component.html",this.bindings={input:"<",onUpdate:"&"}},app.component("flexibleChoices",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.flexibleProfileService=e,this.disposables=new Rx.CompositeDisposable}(e=e.MemberPortal||(e.MemberPortal={})).FlexibleProfile||(e.FlexibleProfile={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.flexibleProfileService.flexibleProfile$.subscribe(function(e){return t.companies=e})),this.flexibleProfileService.getFlexibleProfile()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["FlexibleProfileService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/FlexibleProfile/FlexibleProfile.component.html",this.bindings={}},app.component("flexibleProfile",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.incomHttp=e,this.flexibleProfile$=new Rx.Subject,this.baseurl="/umbraco/api/FlexibleProfile/"}(e=e.MemberPortal||(e.MemberPortal={})).FlexibleProfile||(e.FlexibleProfile={}),t.prototype.getFlexibleProfile=function(){var t=this;this.incomHttp.get(this.baseurl+"GetFlexibleProfile").then(function(e){return t.flexibleProfile$.onNext(e.Companies)})},t.prototype.updateFlexibleProfile=function(e,t){var i=this;this.incomHttp.post(this.baseurl+"UpdateFlexibleProfile",t,{params:{CompanyId:e}}).then(function(e){return i.getFlexibleProfile()})},t.$inject=["incomHttpService"],app.service("FlexibleProfileService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.flexibleProfileService=e}(e=(e=e.MemberPortal||(e.MemberPortal={})).FlexibleProfile||(e.FlexibleProfile={})).FlexibleProfileCompany||(e.FlexibleProfileCompany={}),i.prototype.$onInit=function(){},i.prototype.saveChoices=function(e){this.flexibleProfileService.updateFlexibleProfile(e.Id,e.AssignmentRuleGroups)},i.$inject=["FlexibleProfileService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/FlexibleProfile/FlexibleProfileCompany/FlexibleProfileCompany.component.html",this.bindings={company:"<",description:"<"}},app.component("flexibleProfileCompany",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.myMembershipsService=e,this.pageProviderService=t,this.utilityService=i,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.MemberPortal||(e.MemberPortal={})).Membership||(e.Membership={})).Dashboard||(e.Dashboard={})).MembershipOverview||(e.MembershipOverview={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.myMembershipsService.getMemberships().subscribe(function(e){e&&(t.memberships=e.where(function(e){return e.Status.IsSignedUp}))})),this.dateFormat=this.utilityService.shortDateFormat,this.pageProviderService.getPageByDocumentType("memberships").then(function(e){e&&(t.myMembershipsUrl=e.Url)})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["MyMembershipsService","PageProviderService","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Membership/Dashboard/MembershipOverview/MembershipOverview.component.html",this.bindings={}},app.component("membershipOverview",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.basketService=i,this.baseurl="/umbraco/api/MyMemberships/",this.memberships$=new Rx.BehaviorSubject(null),this.settings$=new Rx.BehaviorSubject(null)}(e=e.MemberPortal||(e.MemberPortal={})).Membership||(e.Membership={}),t.prototype.getMemberships=function(){var t=this,i=this.loaderService.setLoader("contentSection","GetMemberships");return this.incomHttp.get(this.baseurl+"GetMemberships").then(function(n){var e=t.memberships$.getValue();(e=e||n).forEach(function(t){var e,i=n.firstOrDefault(function(e){return e.Company.Id===t.Company.Id&&e.GroupId===t.GroupId&&e.IsInternal==t.IsInternal}),i=(i&&(t.Status=i.Status),t.Status.RenewalDate);i&&0<i.length&&(i=new Date(i),e=(new Date).addDays(30),i.getTime()<e.getTime()&&(t.Expiring=!0),i=i.addYears(1),t.Status.NewExpirationDate=i)}),t.memberships$.onNext(e),t.loaderService.removeLoader(i)}),this.memberships$},t.prototype.addMembership=function(e){var t=this,i=this.loaderService.setLoader("contentSection","SignUpToMembership"),e=this.incomHttp.post(this.baseurl+"AddMembership",e);return e.then(function(e){return t.loaderService.removeLoader(i),"Completed"===e.OrderId?(t.getMemberships(),null):e}),e},t.prototype.getSettings=function(){var t=this,i=this.loaderService.setLoader("contentSection","GetMembershipSettings");return this.incomHttp.get(this.baseurl+"GetSettings").then(function(e){t.settings$.onNext(e),t.loaderService.removeLoader(i)}),this.settings$},t.prototype.saveSetting=function(e){var t=this,i=this.loaderService.setLoader("contentSection","saveSettings");this.incomHttp.post(this.baseurl+"/UpdateSettings",e).then(function(){t.loaderService.removeLoader(i)})},t.prototype.deleteMembership=function(e){var t=this,i=this.loaderService.setLoader("contentSection","deleteMembership");this.incomHttp.post(this.baseurl+"/DeleteMembership",e).then(function(){t.getMemberships(),t.basketService.updateContents(),t.loaderService.removeLoader(i)})},t.prototype.renewMembership=function(e){var t=this,i=this.loaderService.setLoader("contentSection","renewMembership"),e=this.incomHttp.post(this.baseurl+"/RenewMembership",e);return e.then(function(e){t.loaderService.removeLoader(i)}),e},t.prototype.updateStatus=function(e){return this.incomHttp.post(this.baseurl+"/UpdateMembershipStatus",e)},t.prototype.getProfileInfo=function(){var t=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"GetProfileInfo").then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService","BasketService"],app.service("MyMembershipsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.myMembershipsService=e,this.feedbackService=t,this.utilityService=i,this.campaignService=n,this.featureFlagService=o,this.loaderService=r,this.memberships=null,this.disposables=new Rx.CompositeDisposable,this.isCreatingNewMembership=!1,this.expireSoon=0}(e=e.MemberPortal||(e.MemberPortal={})).Membership||(e.Membership={}),i.prototype.$onInit=function(){var i=this,n=new Date;this.disposables.add(this.myMembershipsService.getMemberships().subscribe(function(e){if(e){i.memberships=e,i.signedUpForYouthTenancy=i.memberships.any(function(e){return e.IsEducationRequired});for(var t=i.expireSoon=0;t<e.length;t++)e[t].Expiring&&i.expireSoon++,e[t].IsExpired=new Date(i.memberships[t].Status.RenewalDate)<n}})),this.disposables.add(this.myMembershipsService.getSettings().subscribe(function(e){e&&(i.settings=e)})),this.disposables.add(this.campaignService.isAnyCampaignActive().subscribe(function(e){!e&&!1!==e||(i.isAnyCampaignActive=e)})),this.disposables.add(this.myMembershipsService.getProfileInfo().subscribe(function(e){e&&(i.profileInfo=e)})),this.dateformat=this.utilityService.shortDateFormat,this.enableGiro=this.featureFlagService.payment.enableGiro,this.currentUrl=location.href},i.prototype.changeStatus=function(t,e){var i=this,n=this.loaderService.setLoader("global","updateStatus");t.Status.IsActive!==e&&(t.Status.IsActive=e,this.myMembershipsService.updateStatus(t).then(function(e){i.loaderService.removeLoader(n),0<e.PriceToPay?t.UpgradeFee=e:i.myMembershipsService.getMemberships()}))},i.prototype.payStatusUpgradeForMembership=function(e){var t=e.UpgradeFee.TransactionInfo;e.orderId=t.OrderId,e.transactionId=t.TransactionId},i.prototype.renewMembership=function(t){this.myMembershipsService.renewMembership(t).then(function(e){e&&(t.orderId=e.OrderId,t.transactionId=e.TransactionId)})},i.prototype.saveSetting=function(e){e.$valid&&this.myMembershipsService.saveSetting(this.settings)},i.prototype.signUpNewMembership=function(t){this.myMembershipsService.addMembership(t).then(function(e){e&&"Completed"!==e.OrderId&&(t.orderId=e.OrderId,t.transactionId=e.TransactionId)})},i.prototype.deleteMembership=function(t){var i=this;this.feedbackService.showConfirmbox({Headline:"Er du sikker på at du vil slette dit medlemskab?",Me
1ssage:"<p>Sletter du din opskrivning, starter du forfra på ventelisten, hvis du skriver dig op igen. <br>Denne handling kan ikke fortrydes!</p>",CssClass:"warning",DurationInMilliseconds:0}).then(function(e){i.myMembershipsService.deleteMembership(t)},function(e){})},i.prototype.validateCampaignCode=function(o,r){r.$setValidity("invalidCampaignCode",!0),r.$valid&&r.$viewValue&&this.campaignService.validateCampaignCodePromise(r.$viewValue).then(function(e){var t,i,n;!e||angular.isNumber(e.CompanyId)&&e.CompanyId!==o.Company.Id?r.$setValidity("invalidCampaignCode",!1):(angular.isNumber(e.Discount)?t=i=n=e.Discount:(t=o.RenewalFee,i=o.ActiveSignupFee,n=o.PassiveSignupFee),o.RenewalFee-=t,o.ActiveSignupFee-=i,o.PassiveSignupFee-=n,o.Status.Campaign=e)})},i.prototype.disableCampaignCode=function(e){var t=e.Status.Campaign;t&&(e.RenewalFee+=t.Discount,delete e.Status.Campaign)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["MyMembershipsService","FeedbackService","UtilityService","CampaignService","FeatureFlagService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Membership/MyMemberships.component.html",this.bindings={}},app.component("myMemberships",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.offerService=e,this.disposables=new Rx.CompositeDisposable,this.maxTotalSize=10240}(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).Cohabitant||(e.Cohabitant={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.offerService.getInfo().subscribe(function(e){e&&(t.inputModel.PersonalInfo=angular.copy(e),0<t.inputModel.PersonalInfo.OfferAcceptInfo.filter(function(e){return e.TenancyId===t.inputModel.Tenancy.TenancyId}).length?t.inputModel.PersonalInfo.OfferAcceptInfo=t.inputModel.PersonalInfo.OfferAcceptInfo.filter(function(e){return e.TenancyId===t.inputModel.Tenancy.TenancyId}):t.inputModel.PersonalInfo.OfferAcceptInfo=[{TenancyId:t.inputModel.Tenancy.TenancyId}])})),this.offerAddress=this.inputModel.Tenancy.Address.Street+" "+this.inputModel.Tenancy.Address.Location+" "+this.inputModel.Tenancy.Address.ZipCode+" "+this.inputModel.Tenancy.Address.City},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["OffersService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Offers/Cohabitant/OfferAcceptInfo.component.html",this.bindings={inputModel:"="}},app.component("offerAcceptInfo",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.offersService=e,this.validationService=t,this.disposables=new Rx.CompositeDisposable}(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).Cohabitant||(e.Cohabitant={}),i.prototype.$onInit=function(){var t=this;this.nameRegex=this.validationService.getFullNameRegex(),this.disposables.add(this.offersService.getInfo().subscribe(function(e){e&&(t.userInfo=e,t.numberOfChildren=e.Children.length,t.acceptedCohabitant=null!=e.PartnerName?"Ja":"Nej")}))},i.prototype.$onChanges=function(e){e.acceptedCohabitant&&e.acceptedCohabitant!==this.acceptedCohabitant&&(this.acceptedCohabitant=e.acceptedCohabitant.currentValue)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.setNumberOfChildren=function(){if(this.userInfo.Children.length<this.numberOfChildren)for(var e=this.userInfo.Children.length;e<this.numberOfChildren;e++)this.userInfo.Children.push({});if(this.userInfo.Children.length>this.numberOfChildren)for(e=this.userInfo.Children.length;e>this.numberOfChildren;e--)this.userInfo.Children.pop()},i.prototype.savePersonalInfo=function(){"Nej"===this.acceptedCohabitant&&(this.userInfo.PartnerName=null,this.userInfo.PartnerBirthday=null),this.showBaseInfo=!1,this.offersService.savePersonalInfo(this.userInfo,[])},i.$inject=["OffersService","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Offers/Cohabitant/OffersCohabitant.component.html",this.bindings={acceptedCohabitant:"<"}},app.component("offersCohabitant",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.myOfferService=e,this.disposables=new Rx.CompositeDisposable,this.myOffersLoaded=!1}
1(e=(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).Dashboard||(e.Dashboard={})).MyOffers||(e.MyOffers={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.myOfferService.getMyOffers().subscribe(function(e){t.myOffersLoaded=!0,e&&(t.myOffers=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["MyOffersService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Offers/Dashboard/MyOffers/MyOffers.component.html",this.bindings={}},app.component("myOffers",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/MyOffers/",this.myOffers$=new Rx.BehaviorSubject(null)}(e=(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).Dashboard||(e.Dashboard={})).MyOffers||(e.MyOffers={}),t.prototype.getMyOffers=function(){var t=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"GetMyOffers").then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("MyOffersService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modalInstance=e,this.disposables=new Rx.CompositeDisposable}e=(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.prototype.$onDestroy=function(){this.disposables.dispose()},t.prototype.submit=function(){this.$modalInstance.close(!0)},t.prototype.cancel=function(){this.$modalInstance.close(!1)},t.$inject=["$uibModalInstance"],e.OfferAcceptConditionController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.offerDeclineReasonsService=e,this.staticDeclineReasons=[],this.declineReasons=[],this.hasAnswered=!1,this.keepDepartmentDeclineReason="Behold afdeling som ønske",this.removeDepartmentDeclineReason="Fjern afdeling som ønske",this.membershipActiveDeclineReason="Behold medlemskab som aktiv",this.membershipPassiveDeclineReason="Sæt medlemskab til passiv"}(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).OfferDeclineReasons||(e.OfferDeclineReasons={}),i.prototype.$onInit=function(){this.populateDeclineReasonLists()},i.prototype.updateChildAnswer=function(e,t){for(var i=0;i<e.length;i++)e[i].Answer="false";t.Answer="true"},i.prototype.populateDeclineReasonLists=function(){var t=this;this.offerDeclineReasonsService.getDeclineReasons().subscribe(function(e){e&&e.DeclineReasonAnswers.forEach(function(e){(e.DeclineReason==t.keepDepartmentDeclineReason||e.DeclineReason==t.removeDepartmentDeclineReason||e.DeclineReason==t.membershipActiveDeclineReason||e.DeclineReason==t.membershipPassiveDeclineReason?t.staticDeclineReasons:t.declineReasons).add(e)})})},i.prototype.setMembershipStatus=function(){var t=this;this.membershipStatus?(this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.membershipActiveDeclineReason}).Answer="true",this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.membershipPassiveDeclineReason}).Answer="false"):!1===this.membershipStatus&&(this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.membershipActiveDeclineReason}).Answer="false",this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.membershipPassiveDeclineReason}).Answer="true")},i.prototype.setKeepDepartment=function(){var t=this;this.departmentStatus?(this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.keepDepartmentDeclineReason}).Answer="true",this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.removeDepartmentDeclineReason}).Answer="false"):!1===this.departmentStatus&&(this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.keepDepartmentDeclineReason}).Answer="false",this.staticDeclineReasons.firstOrDefault(function(e){return e.DeclineReason==t.removeDepartmentDeclineReason}).Answer="true")},i.prototype.updateStatistics=function(){this.setMembershipStatus(),this.setKeepDepartment();var e=this.staticDeclineReasons.concat(this.declineReasons),e={Offer:this.inputModel,DepartmentStatus:this.departmentStatus,MembershipStatus:this.membershipStatus,Answers:e};this.offerDeclineReasonsService.updateOfferStatistic(e),this.hasAnswered=!0}
1,i.$inject=["OfferDeclineReasonsService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Offers/OfferDeclineReasons/OfferDeclineReasons.component.html",this.bindings={inputModel:"<"}},app.component("offerDeclineReasons",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseUrl="/umbraco/api/OfferStatistics/"}(e=(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={})).OfferDeclineReasons||(e.OfferDeclineReasons={}),t.prototype.updateOfferStatistic=function(e){this.incomHttp.post("".concat(this.baseUrl,"UpdateOfferStatistic"),e)},t.prototype.getStatistics=function(e,t,i,n,o,r){var s=new Rx.BehaviorSubject(null);return this.incomHttp.get("".concat(this.baseUrl,"GetOfferStatistics?fromDate=")+e+"&toDate="+t+"&departmentId="+i+"&companyId="+n+"&tenancyId="+o+"&interessentNo="+r).then(function(e){s.onNext(e)}),s},t.prototype.getDeclineReasons=function(){var t=new Rx.BehaviorSubject(null);return this.incomHttp.get("".concat(this.baseUrl,"GetDeclineReasons")).then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("OfferDeclineReasonsService",t)}(BoligExtra=BoligExtra||{}),!function(t){var e,n,i;function o(e,t,i,n,o,r){this.offersService=e,this.owlCarouselOptionsService=t,this.utilityService=i,this.modalService=n,this.pageProvider=o,this.featureFlagService=r,this.disposables=new Rx.CompositeDisposable,this.offerState=1}e=t.MemberPortal||(t.MemberPortal={}),n=e.Offers||(e.Offers={}),o.prototype.$onInit=function(){this.owlCarouselOptions=this.owlCarouselOptionsService.getDefaultOptions(),this.owlCarouselOptions.autoHeightClass="gallery-holder",this.enableStatistics=this.featureFlagService.offers.enableStatistics,this.enablePersonalInfo=this.featureFlagService.offers.enablePersonalInfo,this.enableEditInProgress=this.featureFlagService.offers.enableEditInProgress,this.hideInProgressTab=this.featureFlagService.offers.hideInProgressTab,this.getOffers(this.offerState)},o.prototype.getOffers=function(e){var t,i=this,e=(this.offers=[],t=!this.hideInProgressTab||1!==e&&2!==e?[e]:[1,2],this.offerState=e,{To:new Date,From:(new Date).addYears(-2),Max:50,OfferStates:t});this.disposables.add(this.offersService.getOffers(e).subscribe(function(e){e&&(i.offers=e.Offers)}))},o.prototype.openTenancyFloorPlanModal=function(e){e={urls:e.Tenancy.FloorPlans};this.modalService.createModal("/App/Housing/Tenancy/Modals/TenancyFloorPlan.modal.html",t.Housing.Tenancy.Modals.TenancyFloorPlanModalController,e,"lg")},o.prototype.answer=function(t){var i=this;"UnAnswered"!==t.Answer&&(this.featureFlagService.offers.enableOfferAcceptConfirmation&&"Accept"===t.Answer?this.modalService.createModal("App/MemberPortal/Offers/Modal/OfferAcceptConditions.modal.html",n.Modal.OfferAcceptConditionController,null).result.then(function(e){e&&i.updateAnswer(t)}):this.featureFlagService.offers.enableOfferDeclineConfirmation&&"Decline"==t.Answer?this.modalService.createModal("App/MemberPortal/Offers/Modal/OfferDeclineConditions.modal.html",n.Modal.OfferDeclineConditionController,null).result.then(function(e){e&&i.updateAnswer(t)}):this.updateAnswer(t))},o.prototype.OpenCloseOffer=function(){return 1===this.offerState},o.prototype.updateAnswer=function(e){var t=new Date;this.moveInWith&&(e.Comment?e.Comment+=" Skal samboende/ægtefælle med på kontrakten: "+this.moveInWith:e.Comment="Skal samboende/ægtefælle med på kontrakten: "+this.moveInWith),e.AnswerDate=this.utilityService.formatDate(t,"short"),this.offersService.answerOffer(e),1===this.offerState&&this.offers.remove(e)},o.prototype.$onDestroy=function(){this.disposables.dispose()},o.$inject=["OffersService","OwlCarouselOptionsService","UtilityService","ModalService","PageProviderService","FeatureFlagService"],i=o,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Offers/Offers.component.html",this.bindings={}},app.component("offersComponent",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$http=e,this.loaderService=t,this.baseUrl="/Umbraco/api/Offer/",this.offer$=new Rx.BehaviorSubject(null),this.personalInfo$=new Rx.BehaviorSubject(null)}(e=e.MemberPortal||(e.MemberPortal={})).Offers||(e.Offers={}),t.prototype.getInfo=function(){var t=this;return this.$http.get("".concat(this.baseUrl,"GetInfo")).then(function(e){t.personalInfo$.onNext(e)}),this.personalInfo$},t.prototype.getOffers=function(e){var t=this,i=this.loaderService.setLoader("contentSection","getOffers");return this.$http.post("".concat(this.baseUrl,"GetOffers"),e).then(function(e){t.offer$.onNext(e),t.loaderService.removeLoader(i)}),this.offer$},t.prototype.answerOffer=function(e){var t=this,i=this.loaderService.setLoader("contentSection","answerOffer");this.$http.post("".concat(this.baseUrl,"AnswerOffer"),e).then(function(e){return t.loaderService.removeLoader(i)})},t.prototype.savePersonalInfo=function(t,e){function i(e){return n.$http.post(n.baseUrl+"SaveInfo/"+e||"",t).then(function(e){return n.loaderService.removeLoader(o),e})}var n=this,o=this.loaderService.setLoader("contentSection","saveInfo");return e&&0<e.length?this.$http.postFiles("/umbraco/api/File/PrepareFiles",e).then(i):i(null).then(function(e){return e}),!1},t.$inject=["incomHttpService","LoaderService"],app.service("OffersService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.signupService=e,this.disposables=new Rx.CompositeDisposable}(e=(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={})).Cart||(e.Cart={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.signupService.interessent$.subscribe(function(e){t.interessent=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getTotalPrice=function(){return this.signupService.getTotalPriceToPay()},i.$inject=["SignUpService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/SignUp/Cart/Cart.Component.html"},app.component("itemscart",new e)}(BoligExtra=BoligExtra||{}),!function(i){var e,t;function n(e,t,i,n,o,r,s,a){this.signupService=e,this.scope=t,this.locationService=i,this.validationService=n,this.campaignService=o,this.storageService=r,this.featureFlagService=s,this.loaderService=a,this.disposables=new Rx.CompositeDisposable,this.togglePassword=!1}(e=i.MemberPortal||(i.MemberPortal={})).SignUp||(e.SignUp={}),n.prototype.$onInit=function(){var t=this;this.enableShowPassword=this.featureFlagService.passwordFeatureFlags.EnableShowPassword,this.disposables.add(this.storageService.getSupp
1ortAdministrationState().subscribe(function(e){return t.currentSupportAdministrationState=e})),this.nameRegex=this.validationService.getFullNameRegex(),this.emailRegex=this.validationService.getEmailRegex(),this.passwordRegex=this.validationService.getPasswordRegex(),this.dateRegex=this.validationService.getShortDateRegex(),this.phoneRegex=this.validationService.getPhoneNumberRegex(),this.disposables.add(this.locationService.getCountries().subscribe(function(e){e&&(t.countries=e)})),this.step=1,this.disposables.add(this.signupService.baseInfo$.subscribe(function(e){e&&(t.baseInfo=e,t.cprConsent=e.CprConsent)})),this.disposables.add(this.signupService.interessent$.subscribe(function(e){t.interessent=e,t.interessent.Birthdate&&6<t.interessent.Birthdate.length&&(t.birthDate=t.interessent.Birthdate.substring(0,6),t.cpr=t.interessent.Birthdate.substring(6)),t.interessent.Memberships.any(function(e){return e.IsEducationRequired})?t.studyTenancy=!0:t.studyTenancy=!1})),this.disposables.add(this.campaignService.isAnyCampaignActive().subscribe(function(e){!e&&!1!==e||(t.isAnyCampaignActive=e)})),this.enableGiro=this.featureFlagService.payment.enableGiro,this.showPartnerInfo=this.featureFlagService.signUp.displayPartnerInfo},n.prototype.getAddress=function(e){e&&(this.interessent.Address.ZipCode=e.ZipCode,this.interessent.Address.City=e.City,this.interessent.Address.Street=e.Street,this.interessent.Address.Location=e.Location,this.interessent.Address.LocalTown=e.LocalTown)},n.prototype.setNumberOfChildren=function(){if(this.interessent.Children||(this.interessent.Children=[]),this.interessent.Children.length<this.numberOfChildren)for(var e=this.interessent.Children.length;e<this.numberOfChildren;e++)this.interessent.Children.push({});if(this.interessent.Children.length>this.numberOfChildren)for(e=this.interessent.Children.length;e>this.numberOfChildren;e--)this.interessent.Children.pop()},n.prototype.getPriceToPay=function(){return this.signupService.getTotalPriceToPay()},n.prototype.signUp=function(e){var t,i=this;e.$valid&&(t=this.loaderService.setLoader("contentSection","signUp"),this.reValidateUserInput().take(1).subscribe(function(e){e?(i.cpr?i.interessent.Birthdate=i.birthDate+i.cpr:i.interessent.Birthdate=i.birthDate,i.interessent.AcceptedCprConditions||6<i.interessent.Birthdate.length&&(i.interessent.Birthdate=i.interessent.Birthdate.substr(0,6)),i.featureFlagService.payment.enableGiro||(i.interessent.PaymentType=0),i.disposables.add(i.signupService.signUp().subscribe(function(e){i.loaderService.removeLoader(t)}))):i.loaderService.removeLoader(t)}))},n.prototype.back=function(){this.signupService.back()},n.prototype.next=function(){this.step=3,this.scope.$apply()},n.prototype.validateEmail=function(t){t.$error.pattern||t.$error.required?t.$setValidity("inuse",!0):this.signupService.validateEmail(this.interessent.Email).subscribe(function(e){!1===e?t.$setValidity("inuse",e):e&&t.$setValidity("inuse",!0)})},n.prototype.validateCpr=function(t){var e=this.birthDate+this.cpr;t.$error.minlength||t.$error.required?t.$setValidity("inuse",!0):this.signupService.validateCpr(e).subscribe(function(e){e&&(e.CprValidationState===i.Utility.UserValidation.CprValidationState.AlreadyExists?(t.$setValidity("inuse",!1),t.$setValidity("invalid",!0)):e.CprValidationState===i.Utility.UserValidation.CprValidationState.Invalid?(t.$setValidity("invalid",!1),t.$setValidity("inuse",!0)):e.CprValidationState===i.Utility.UserValidation.CprValidationState.Valid&&(t.$setValidity("inuse",!0),t.$setValidity("invalid",!0)))})},n.prototype.validateNameAndBirthdate=function(t){t.$error.minlength||t.$error.required?t.$setValidity("inuse",!0):this.signupService.validateNameAndBirthdate(this.interessent.Name,this.birthDate).subscribe(function(e){!1===e?t.$setValidity("inuse",e):e&&t.$setValidity("inuse",!0)})},n.prototype.validateBaseInfo=function(){var t=this;this.cpr?this.interessent.Birthdate=this.birthDate+this.cpr:this.interessent.Birthdate=this.birthDate,this.interessent.Name,this.interessent.Birthdate,null!=this.interessent.Email&&this.signupService.validateBaseInfo().subscribe(function(e){e&&(t.step=2,t.scope.$apply())})},n.prototype.validateCampaignCode=function(){var t=this;this.campaignCode&&0<this.campaignCode.length?this.disposables.add(this.campaignService.validateCampaignCodeObservable(this.campaignCode).subscribe(function(e){e&&-1!==e.Id?(t.noSuchCampaign=!1,t.campaign=e,t.getTotalPrice(),t.addCampaignToMemberships()):t.noSuchCampaign=!0})):this.noSuchCampaign=!0},n.prototype.getTotalPrice=function(){var e=this.interessent.Memberships,t=e.filter(function(e){return e.Selected}).map(function(e){return e.ActivationFee}).reduce(function(e,t){return e+t},0);this.interessent.MembershipStatus&&"Letter"===this.interessent.OfferDeliveryMode?t+=e.filter(function(e){return e.Selected}).map(function(e){return e.BothActiveAndLetterPrice}).reduce(function(e,t){return e+t},0):"Letter"===this.interessent.OfferDeliveryMode&&(t+=e.filter(function(e){return e.Selected}).map(function(e){return e.LetterPrice}).reduce(function(e,t){return e+t},0)),this.interessent.MembershipStatus&&(t+=e.filter(function(e){return e.Selected}).map(function(e){return e.ActivePrice}).reduce(function(e,t){return e+t},0)),null!=this.campaign&&null===this.campaign.Discount?this.total=0:null!=this.campaign?this.total=t+e.firstOrDefault().JoinFee+e.firstOrDefault().UnionPrice-this.campaign.Discount:this.total=t+e.firstOrDefault().JoinFee+e.firstOrDefault().UnionPrice},n.prototype.addCampaignToMemberships=function(){for(var e=0;e<this.baseInfo.Memberships.length;e++)!this.campaign||this.baseInfo.Memberships[e].Company.Id!==this.campaign.CompanyId&&null!==this.campaign.CompanyId||(this.baseInfo.Memberships[e].Campaign=this.campaign)},n.prototype.tabWhenFilledOut=function(e,t){return!(t.cpr&&!isNaN(parseInt(e.key))&&this.birthDate&&6<=this.birthDate.length&&(t.cpr.$$element.focus(),t.cpr.$$element.trigger(e),1))},n.prototype.reValidateUserInput=function(){var e,t=[];return this.hasDanishCpr&&this.interessent.AcceptedCprConditions?(e=this.birthDate+this.cpr,t.push(this.signupService.validateCpr(e).map(function(e){return e.CprValidationState===i.Utility.UserValidation.CprValidationState.Valid}))):t.push(this.signupService.validateNameAndBirthdate(this.interessent.Name,this.birthDate)),t.push(this.signupService.validateEmail(this.interessent.Email)),Rx.Ob
1servable.combineLatest(t).map(function(e){return e.every(function(e){return!0===e})})},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.$inject=["SignUpService","$scope","LocationService","ValidationService","CampaignService","StorageService","FeatureFlagService","LoaderService"],t=n,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/SignUp/MemberInfo/MemberInfo2/MemberInfo2.component.html",this.bindings={total:"<"}},app.component("memberInfo",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.activatedMemberships=[],this.memberships=angular.copy(t.memberships.distinct()),this.tenacies=angular.copy(t.tenacies)}e=(e=(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.prototype.submit=function(){this.$modalInstance.close({memberships:this.memberships})},t.prototype.getSubmitText=function(){return this.memberships.every(function(e){return e.Selected})?"Tilføj medlemskaber":this.memberships.every(function(e){return!e.Selected})?"Fjern boliger":"Tilføj valgte medlemskaber og fjern øvrige boliger"},t.prototype.selectMemberShip=function(e){e.Selected=!e.Selected,e.Selected?this.activatedMemberships.add(e):this.activatedMemberships.remove(e),this.memberships.any(function(e){return!e.Selected})||(this.canValidate=!0)},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.SignUpController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modalInstance=e}e=(e=(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){},t.prototype.cancel=function(){this.$modalInstance.close()},t.prototype.continue=function(){this.$modalInstance.close("continue")},t.$inject=["$uibModalInstance"],e.SignUpWithUserController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.utilityService=e,this.paymentService=t,this.$sce=i,this.pageProviderService=n,this.loaderService=o,this.disposables=new Rx.CompositeDisposable,this.count=0}(e=(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={})).Receipt||(e.Receipt={}),i.prototype.$onInit=function(){this.orderId=this.utilityService.getParameterByName("key"),this.transactionId=this.utilityService.getParameterByName("transaction"),this.validatePayment(this.orderId,this.transactionId)},i.prototype.validatePayment=function(e,t){var i=this,n=this.loaderService.setLoader("contentSection","validatePayment");this.paymentService.validatePayment(e,t).then(function(e){null!=e&&(i.order=e,i.calculateOrderValueWithCampaigns(i.order),i.pbsUrl=i.$sce.trustAsResourceUrl(i.order.PbsInfo.Link),"NewMemberPaymentIdentifier"===i.order.IdentifierType?i.pageProviderService.getPageByDocumentType("myPageFrontPage").then(function(e){return i.nextPage=e}):"NewMembershipPaymentIdentifier"===i.order.IdentifierType&&i.pageProviderService.getPageByDocumentType("memberships").then(function(e){return i.nextPage=e}),i.loaderService.removeLoader(n))},function(){i.failedToVerify=!0,i.loaderService.removeLoader(n)})},i.prototype.attachPbs=function(){this.paymentService.attachPbs(this.orderId,this.transactionId),this.step=2},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.calculateOrderValueWithCampaigns=function(e){for(var t=0;t<e.Memberships.length;t++){var i=e.Memberships[t].Campaign;null!=i&&null===i.Discount?e.Amount=0:null!=i&&(e.Amount=e.Amount-i.Discount)}},i.$inject=["UtilityService","PaymentService","$sce","PageProviderService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/SignUp/Receipt/Receipt.component.html",this.bindings={}},app.component("receipt",new e)}(BoligExtra=BoligExtra||{}),!function(e){var r,t;function i(e,t,i,n,o,r,s,a,l,c,d){this.signupService=e,this.modalService=t,this.basketService=i,this.utilityService=n,this.myMembershipService=o,this.smoothScroll=r,this.$element=s,this.storageService=a,this.featureFlagService=l,this.pageProvider=c,this.windowService=d,this.baseInfo={Memberships:[]},this.disposables=new Rx.CompositeDisposable,this.education=!1,this.newMembership={Memberships:[],PaymentType:"PaymentGateway"}}e=e.MemberPortal||(e.MemberPortal={}),r=e.SignUp||(e.SignUp={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.basketService.contents$.subscribe(function(e){e&&(t.basketContents=e)}
1)),this.disposables.add(this.storageService.getSupportAdministrationState().subscribe(function(e){return t.currentSupportAdministrationState=e})),this.signupService.getBaseInfo(this.utilityService.getPageUrl()).then(function(e){t.baseInfo.Countries=e.Countries,t.baseInfo.EducationalInstitution=e.EducationalInstitution,t.baseInfo.Educations=e.Educations,t.baseInfo.Memberships=e.Memberships,t.signupService.interessent$.first(function(e){return!!e}).subscribe(function(e){e&&(t.interessent=e,t.interessent.Memberships=[],t.interessent.Memberships.addRange(t.baseInfo.Memberships.where(function(e){return e.Selected})),t.interessent.MembershipStatus=!0,t.interessent.OfferDeliveryMode="Email",t.interessent.PaymentType=0)}),t.baseInfo.SignUpInformation=e.SignUpInformation.where(function(e){return e.Alias.startsWith("SignUpInfo")&&-1!==e.Content.indexOf("<p>")}),0===t.baseInfo.SignUpInformation.length?t.showInformation=!1:t.showInformation=!0}),this.disposables.add(this.signupService.step$.subscribe(function(e){t.step=e;e=t.$element;e.offset().top<window.scrollY&&t.smoothScroll(e[0])})),this.disposables.add(this.signupService.order$.subscribe(function(e){e&&(t.orderId=e.OrderId,t.transactionId=e.TransactionId)})),this.enableOfferDeliveryModeOptions=this.featureFlagService.signUp.displayOfferDeliveryModeOptions},i.prototype.selectMemberShip=function(e,t){null==(t=void 0===t?null:t)&&(t=!e.Selected),e.Selected=t,e.Selected?this.interessent.Memberships.add(e):this.interessent.Memberships.remove(e),this.hasValidated=!0},i.prototype.validateMemberships=function(){var o=this,e=(this.hasValidated=!0,this.basketContents.Departments.map(function(e){return e.CompanyId}).distinct()),t=this.interessent.MembershipStatus;this.featureFlagService.signUp.showWarningOnActiveMembershipWithNoTenanciesInBasket&&t&&0==e.length?this.modalService.createModal("/App/MemberPortal/SignUp/Modal/MissingBasketContent.Modal.html",r.Modal.MissingBasketContentController,null,"md").result.then(function(e){e&&"tenancySearch"==e?o.pageProvider.getPageByDocumentType("tenancySearch").then(function(e){e&&o.windowService.history.pushState({},"",e.Url)}):o.interessent.MembershipStatus=!1}):this.isCompanyNotSelected()||this.signupService.validateMemberships(this.interessent.Memberships).then(function(e){if(0===e.length)o.signupService.nextStep(2);else{for(var t=[],i=0;i<e.length;i++)for(var n=0;n<o.baseInfo.Memberships.length;n++)e[i].any(function(t){return o.baseInfo.Memberships[n].Company.Id===t.CompanyId&&o.baseInfo.Memberships[n].TenancyTypes.any(function(e){return e===t.TenancyTypeId})})&&t.add(o.baseInfo.Memberships[n]);o.modalService.createModal("/App/MemberPortal/SignUp/Modal/SignUp.Modal.html",r.Modal.SignUpController,{memberships:t,tenacies:e},"md").result.then(function(e){for(var i=e.memberships,t=0;t<i.length;t++)!function(t){var e=o.baseInfo.Memberships.firstOrDefault(function(e){return e.Company.Id===i[t].Company.Id&&e.TenancyTypes.any(function(e){return i[t].TenancyTypes.contains(e)})});i[t].Selected?o.selectMemberShip(e,!0):o.signupService.removeTenanciesForMembership([e])}(t)})}})},i.prototype.isCompanyNotSelected=function(){return this.interessent.Memberships||(this.interessent.Memberships=[]),0===this.interessent.Memberships.length},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.back=function(){this.signupService.back()},i.$inject=["SignUpService","ModalService","BasketService","UtilityService","MyMembershipsService","smoothScroll","$element","StorageService","FeatureFlagService","PageProviderService","$window"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/SignUp/SignUp.Component.html",this.bindings={}},app.component("signUp",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$http=e,this.loaderService=t,this.$timeout=i,this.basketService=n,this.emailValid$=new Rx.Subject,this.cprValid$=new Rx.Subject,this.nameAndBirthdateValid$=new Rx.Subject,this.orderIdForNewMembership$=new Rx.BehaviorSubject(null),this.companyInfo$=new Rx.BehaviorSubject(null),this.order$=new Rx.BehaviorSubject(null),this.step$=new Rx.BehaviorSubject(1),this.interessent$=new Rx.BehaviorSubject({Memberships:[]}),this.baseInfo$=new Rx.BehaviorSubject(null)}(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={}),t.prototype.goToMyPage=function(){this.$http.get("/Umbraco/api/SignUp/GoToMyPage")},t.prototype.getTotalPriceToPay=function(){var e=this.interessent$.getValue(),t=0,i=e.Memberships;return i.any()&&(t=i.filter(function(e){return e.Selected}).map(function(e){return e.ActivationFee}).reduce(function(e,t){return e+t},0),e.MembershipStatus&&"Letter"===e.OfferDeliveryMode?t+=i.filter(function(e){return e.Selected}).map(function(e){return e.BothActiveAndLetterPrice}).reduce(function(e,t){return e+t},0):"Letter"===e.OfferDeliveryMode&&(t+=i.filter(function(e){return e.Selected}).map(function(e){return e.LetterPrice}).reduce(function(e,t){return e+t},0)),e.MembershipStatus&&(t+=i.filter(function(e){return e.Selected}).map(function(e){return e.ActivePrice}).reduce(function(e,t){return e+t},0)),t+=i.firstOrDefault().JoinFee+i.firstOrDefault().UnionPrice,i.firstOrDefault().Campaign)&&(null==i.firstOrDefault().Campaign.Discount?t=0:t-=i.firstOrDefault().Campaign.Discount),t},t.prototype.signUpToMembership=function(e){var t=this,i=this.loaderService.setLoader("contentSection","SignUpToMembership");return this.$http.post("/Umbraco/api/SignUp/SignUpToMembership",e).then(function(e){t.orderIdForNewMembership$.onNext(e),t.loaderService.removeLoader(i)}),this.orderIdForNewMembership$},t.prototype.validateBaseInfo=function(){return Rx.Observable.fromPromise(this.$http.post("/Umbraco/api/SignUp/ValidateBaseInfo",this.interessent$.getValue()))},t.prototype.validateEmail=function(e){var t=this;return this.$http.get("/Umbraco/api/SignUp/ValidateEmail?email="+e).then(function(e){t.emailValid$.onNext(e)}),this.emailValid$},t.prototype.validateNameAndBirthdate=function(e,t){var i=this;return this.$http.get("/Umbraco/api/SignUp/ValidateNameAndBirthdate?name="+e+"&birthdate="+t).then(function(e){i.nameAndBirthdateValid$.onNext(e)}),this.nameAndBirthdateValid$},t.prototype.validateCpr=function(e){var t=this;return this.$http.get("/Umbraco/api/SignUp/ValidateCpr?cpr="+e).then(function(e){t.cprValid$.onNext(e)}),this.cprValid$},t.prototype.removeTenanciesForMembership=function(e){var t=this,i=this.loaderService.setLoader("global","RemoveTenanciesForMembership");return this.$http.post("/Umbraco/api/SignUp/RemoveTenanciesForMembership",e).then(function(e){t.basketService.updateContents(),t.loaderService.removeLoader(i)})},t.prototype.validateMemberships=function(e){return this.$http.post("/Umbraco/api/SignUp/ValidateTenanciesAgainstMemberships",e)},t.prototype.getBaseInfo=function(e){var t=this,i=this.loaderService.setLoader("contentSection","SignUp"),e=this.$http.get("/Umbraco/api/SignUp/GetBaseInfo?currentUrl="+e);return e.then(function(e){t.loaderService.removeLoader(i),t.interessent$.onNext({Memberships:[]}),t.baseInfo$.onNext(e)}),e},t.prototype.getCompanyInfo=function(e){var t=this,i=this.loaderService.setLoader("contentSection","SignUp"),e=this.$http.get("/Umbraco/api/SignUp/GetCompanyInfo?currentUrl="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.prototype.findCity=function(e){var t=this;this.$http.get("/Umbraco/api/Location/FindCityNameByZip?zipcode="+e).then(function(e){t.interessent$.getValue().Address.City=e})},t.prototype.nextStep=function(e){this.step$.onNext(e)},t.prototype.back=function(){this.order$.onNext(null);var e=this.step$.getValue();this.step$.onNext(e-1)},t.prototype.signUp=function(){var i=this,n=new Rx.Subject,e=this.interessent$.getValue();return this.$http.post("/Umbraco/api/SignUp/SignUp",e).then(function(e){var t;e&&(t=i.step$.getValue(),i.step$.onNext(t+1),i.order$.onNext(e)),n.onNext(!!e),n.onCompleted()}),n},t.$inject=["incomHttpService","LoaderService","$timeout","BasketService"],app.service("SignUpService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.informationName={SignUpInfoWaitListPrice:"Pris om året for at stå på venteliste",SignUpInfoFifteenYearRule:"Du skal være fyldt 15 år",SignUpInfoPersonalSignup:"En opskrivning er personlig",SignUpInfoWaitTime:"Venteliste",SignUpInfoAlreadyMember:"Er du allerede kunde eller tidligere kunde?",SignUpInfoSpecialCriteria:"Søger du bolig med særlige udlejningsregler?"},this.disposables=new Rx.CompositeDisposable}(e=(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={})).SignUpInfo||(e.SignUpInfo={}),i.prototype.$onInit=function(){if(this.information)for(var e=0;e<this.information.length;e++)this.informationName[this.information[e].Alias]&&(this.information[e].Alias=this.informationName[this.information[e].Alias])},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/SignUp/SignUpInfo/SignUpInfo.component.html",this.bindings={information:"<"}},app.component("signUpInfo",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.wishSummaryService=e,this.disposables=new Rx.CompositeDisposable}
1(e=(e=(e=e.MemberPortal||(e.MemberPortal={})).Wishes||(e.Wishes={})).Dashboard||(e.Dashboard={})).WishSummary||(e.WishSummary={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.wishSummaryService.getWishSummary().subscribe(function(e){e&&(t.wishSummary=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["WishSummaryService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/MemberPortal/Wishes/Dashboard/WishSummary/WishSummary.component.html",this.bindings={}},app.component("wishSummary",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/WishSummary/"}(e=(e=(e=e.MemberPortal||(e.MemberPortal={})).Wishes||(e.Wishes={})).Dashboard||(e.Dashboard={})).WishSummary||(e.WishSummary={}),t.prototype.getWishSummary=function(){var t=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"GetWishSummary").then(function(e){t.onNext(e)}),t},t.$inject=["incomHttpService","LoaderService"],app.service("WishSummaryService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.supportService=e,this.disposables=new Rx.CompositeDisposable,this.clearOnFocus=!1}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).CprChecker||(e.CprChecker={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.clearResult=function(e){this.clearOnFocus&&(e.$setPristine(),this.clearOnFocus=!1)},i.prototype.doCheckCpr=function(){var t=this;10===this.cpr.length&&this.supportService.checkCprInUse(this.cpr).then(function(e){t.inUse=!e,t.clearOnFocus=!0})},i.$inject=["SupportService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/CprChecker/CprChecker.component.html",this.bindings={}},app.component("cprChecker",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.supportService=e,this.users=[],this.disposables=new Rx.CompositeDisposable}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).EmailChecker||(e.EmailChecker={}),i.prototype.$onInit=function(){},i.prototype.doCheckEmail=function(){var t=this;this.loading=!0,this.supportService.checkEmailExists(this.email).then(function(e){t.loading=!1,t.users=e.Users})},i.$inject=["SupportService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/EmailChecker/EmailChecker.component.html",this.bindings={}},app.component("emailChecker",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.offerAdminService=e,this.utilityService=t,this.disposables=new Rx.CompositeDisposable}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).OfferAdministration||(e.OfferAdministration={}),i.prototype.$onInit=function(){var t=this,e=this.utilityService.parseNumber(this.utilityService.getParameterByName("memberId")),i=this.utilityService.parseNumber(this.utilityService.getParameterByName("tenancyId"));e&&i&&this.disposables.add(this.offerAdminService.getUserAcceptInfo(e,i).subscribe(function(e){e&&(t.userInfo=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["OfferAdministrationService","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/OfferAdministration/OfferAdministration.component.html",this.bindings={}},app.component("offerAdministration",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/OfferAdministration/"}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).OfferAdministration||(e.OfferAdministration={}),t.prototype.getUserAcceptInfo=function(e,t){var i=new Rx.BehaviorSubject(null);return this.incomHttp.get(this.baseurl+"GetInfo?memberId="+e+"&tenancyId="+t).then(function(e){i.onNext(e)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("OfferAdministrationService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.offersService=e,this.utilityService=t,this.disposables=new Rx.CompositeDisposable}(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),i.prototype.$onInit=function(){this.fromDate=new Date,this.fromDate.setMonth(this.fromDate.getMonth()-1),this.toDate=new Date,this.get
1Statistics()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getStatistics=function(){var t=this;this.disposables.add(this.offersService.getStatistics(this.utilityService.formatDate(this.fromDate,"short"),this.utilityService.formatDate(this.toDate,"short"),this.departmentId,this.companyId,this.tenancyId,this.interessentNo).subscribe(function(e){t.declineStatistics=e}))},i.$inject=["OfferDeclineReasonsService","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/OfferDeclineStatistics/OfferDeclineStatistics.component.html"},app.component("offerDeclineStatistics",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.incomHttp=e,this.loaderService=t,this.storageService=i,this.baseurl="/umbraco/api/Support/"}(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),t.prototype.getUserInformation=function(e,t){var i=this,e={OrderId:e,TransactionId:t},n=this.loaderService.setLoader("supportSignUpPayment","supportSignUpPayment"),t=this.incomHttp.post(this.baseurl+"GetUserInformation",e);return t.then(function(e){i.loaderService.removeLoader(n)}),t},t.prototype.setSupportAdministrationState=function(e){var t=this,i=this.loaderService.setLoader("supportAdministration","supportAdministration"),e=this.incomHttp.post(this.baseurl+"ToggleSupportAdministration",e);return e.then(function(e){t.loaderService.removeLoader(i),t.storageService.setSupportAdministrationState(e)}),e},t.prototype.checkCprInUse=function(e){var t=this,i=this.loaderService.setLoader("cprChecker","checkCpr"),e=this.incomHttp.get(this.baseurl+"ValidateCprIsNotInUse?Cpr="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.prototype.checkEmailExists=function(e){var t=this,i=this.loaderService.setLoader("emailChecker","checkEmail"),e=this.incomHttp.get(this.baseurl+"GetUsersAttachedToEmail?email="+e);return e.then(function(){t.loaderService.removeLoader(i)}),e},t.$inject=["incomHttpService","LoaderService","StorageService"],app.service("SupportService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.loginService=e,this.pageContentService=t,this.loginFormData={},this.disposables=new Rx.CompositeDisposable}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).SupporterLogin||(e.SupporterLogin={}),i.prototype.$onInit=function(){var t=this;this.pageContentService.currentPage$.first(function(e){return!!e}).subscribe(function(e){return t.currentPage=e})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.doLogin=function(e){e.$valid&&this.loginService.supporterLogin(this.loginFormData.username,this.currentPage.Id)},i.$inject=["LoginService","PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/SupporterLogin/SupporterLogin.component.html"},app.component("supporterLogin",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.storageService=e,this.supportService=t,this.basketService=i,this.pageProviderService=n,this.disposables=new Rx.CompositeDisposable}(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={}),i.prototype.$onInit=function(){var t=this;this.pageProviderService.getPageByDocumentType("tenancySearch").then(function(e){e&&(t.tenancySearchPage=e.Url)}),this.disposables.add(this.storageService.getSupportAdministrationState().subscribe(function(e){t.currentState=e}))},i.prototype.toggleAdministrationState=function(){var t=this;this.supportService.setSupportAdministrationState(!this.currentState).then(function(e){t.basketService.updateContents()})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["StorageService","SupportService","BasketService","PageProviderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/SupporterSignUp/Banner/SupportSignUpActiveBanner.component.html",this.bindings={}},app.component("supportAdministrationBanner",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.storageService=e,this.supportService=t,this.basketService=i,this.disposables=new Rx.CompositeDisposable}(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).SupporterSignUp||(e.SupporterSignUp={}),i.prototype.$onInit=function(){var t=this;
1this.disposables.add(this.storageService.getSupportAdministrationState().subscribe(function(e){t.currentState=e}))},i.prototype.toggleAdministrationState=function(){var t=this;this.supportService.setSupportAdministrationState(!this.currentState).then(function(e){t.basketService.updateContents()})},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["StorageService","SupportService","BasketService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/SupporterSignUp/SupporterSignUp.component.html",this.bindings={}},app.component("supporterSignUp",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.utilityService=e,this.signUpService=t,this.pageProviderService=i,this.supportService=n,this.disposables=new Rx.CompositeDisposable}(e=(e=e.MemberPortal||(e.MemberPortal={})).SignUp||(e.SignUp={})).SupportSignUpPayment||(e.SupportSignUpPayment={}),i.prototype.$onInit=function(){var t=this;this.pageProviderService.getPageByDocumentType("frontPage").then(function(e){return t.nextPage=e}),this.disposables.add(this.signUpService.step$.subscribe(function(e){e&&(t.step=e)})),this.orderId=this.utilityService.getParameterByName("orderId"),this.paymentType=this.utilityService.getParameterByName("paymentType"),this.transactionId=this.utilityService.getParameterByName("transActionId"),this.supportService.getUserInformation(this.orderId,this.transactionId)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["UtilityService","SignUpService","PageProviderService","SupportService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/PersonnelPortal/Administration/SupporterSignUp/SupportSignUpPayment/SupportSignUpPayment.component.html",this.bindings={}},app.component("supportSignUpPayment",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;e=(e=e.Utility||(e.Utility={})).UserValidation||(e.UserValidation={}),(t=e.CprValidationState||(e.CprValidationState={}))[t.Valid=0]="Valid",t[t.Invalid=1]="Invalid",t[t.AlreadyExists=2]="AlreadyExists",t[t.ExistsMultipleTimes=3]="ExistsMultipleTimes",(t=e.EmailValidationState||(e.EmailValidationState={}))[t.Valid=0]="Valid",t[t.Invalid=1]="Invalid",t[t.AlreadyExists=2]="AlreadyExists",t[t.ExistsMultipleTimes=3]="ExistsMultipleTimes"}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=(e=e.General||(e.General={})).FrontEndEdit||(e.FrontEndEdit={})).ContentPages||(e.ContentPages={})).ContentPageType||(e.ContentPageType={}))[e.ContentPage=0]="ContentPage",e[e.CmsNews=1]="CmsNews",e[e.CmsEvent=2]="CmsEvent",e[e.CompanyDepartmentContentPage=3]="CompanyDepartmentContentPage",e[e.CompanyDepartmentCmsNews=4]="CompanyDepartmentCmsNews",e[e.SectionPage=5]="SectionPage",e[e.CompanyDepartmentSectionPage=6]="CompanyDepartmentSectionPage",e[e.ProjectPhaseNews=7]="ProjectPhaseNews",e[e.Project=8]="Project"}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=e.Utility||(e.Utility={})).File||(e.File={})).UploadedFileType||(e.UploadedFileType={}))[e.File=0]="File",e[e.Image=1]="Image"}(BoligExtra=BoligExtra||{}),!function(e){var t;e=(e=e.Utility||(e.Utility={})).Communication||(e.Communication={}),(t=e.HelpTextGroup||(e.HelpTextGroup={}))[t.FrontEndEdit=20]="FrontEndEdit",t[t.Login=30]="Login",t[t.TenancySearch=40]="TenancySearch",t[t.NoGroup=9999]="NoGroup",(t=e.FixedTextGroup||(e.FixedTextGroup={}))[t.FrontEndEdit=20]="FrontEndEdit",t[t.Login=30]="Login",t[t.TenancySearch=40]="TenancySearch",t[t.NoGroup=9999]="NoGroup"}(BoligExtra=BoligExtra||{}),!function(e){function t(){}e=(e=e.CrossPortal||(e.CrossPortal={})).Settings||(e.Settings={}),t.forceMissingConsentAnswers=!1,t.showMaintenanceRegulations=!0,t.showHouseRulesRegulations=!0,t.showRightOfWayCatalogsRegulations=!0,t.enableRegulationSectionSorting=!0,t.enableRentPayment=!0,t.enableDepositPayment=!1,t.hideDepositTable=!1,t.showBiTenanciesInTenancySearch=!1,t.useInComCompanyRoomIntegration=!1,t.letPersonnelBookCompanyRoomsForFree=!1,t.displayDepartmentImageOnMyDepartment=!0,t.displayTenantNameOnTenantList=!1,t.enableRequestRequisitions=!1,t.requisitionRequestMinimumAmount=null,t.enableForumNotificationSettings=!1,t.consentReminderEnableOnDashboard=!1,e.Settings=t}(BoligExtra=BoligExtra||{}
1),!function(e){(e=(e=(e=(e=(e=e.Core||(e.Core={})).CrossPortal||(e.CrossPortal={})).Login||(e.Login={})).OtherLogin||(e.OtherLogin={})).OtherLoginTypes||(e.OtherLoginTypes={}))[e.FacebookLogin=0]="FacebookLogin",e[e.NemIdLogin=1]="NemIdLogin",e[e.MitIdLogin=2]="MitIdLogin"}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=(e=(e=e.Web||(e.Web={})).Areas||(e.Areas={})).TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={})).MaintenanceSchemeModelType||(e.MaintenanceSchemeModelType={}))[e.Unknown=0]="Unknown",e[e.A=1]="A",e[e.B=2]="B"}(Application=Application||{}),!function(e){var t;e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).RegulationTemplate||(e.RegulationTemplate={})).Models||(e.Models={})).Enums||(e.Enums={}),(t=e.MaintenanceRuleGroupRequired||(e.MaintenanceRuleGroupRequired={}))[t.NotRequired=0]="NotRequired",t[t.Required=1]="Required",t[t.RequiredIfCommonArea=2]="RequiredIfCommonArea",(t=e.MaintenanceRuleGroupType||(e.MaintenanceRuleGroupType={}))[t.MovingInCondition=0]="MovingInCondition",t[t.DailyCleaning=1]="DailyCleaning",t[t.Maintenance=2]="Maintenance",t[t.BeforeMoving=3]="BeforeMoving"}(BoligExtra=BoligExtra||{}),!function(e){var t;e=(e=(e=(e=(e=(e=e.PersonnelPortal||(e.PersonnelPortal={})).Administration||(e.Administration={})).Regulations||(e.Regulations={})).Regulations||(e.Regulations={})).Models||(e.Models={})).GetRegulation||(e.GetRegulation={}),(t=e.ItemType||(e.ItemType={}))[t.SectionGroup=0]="SectionGroup",t[t.Section=1]="Section",t[t.MaintenanceRuleGroup=2]="MaintenanceRuleGroup",t[t.MaintenanceRule=3]="MaintenanceRule",t[t.SectionGroupText=4]="SectionGroupText",t[t.SectionAttribute=5]="SectionAttribute",t[t.GuidanceInformation=6]="GuidanceInformation",t[t.GuidanceInformationImage=7]="GuidanceInformationImage",(t=e.RegulationStatusType||(e.RegulationStatusType={}))[t.Draft=0]="Draft",t[t.InProgress=1]="InProgress",t[t.Locked=2]="Locked",t[t.Approved=3]="Approved",(t=e.RegulationType||(e.RegulationType={}))[t.MaintenanceRegulations=0]="MaintenanceRegulations",t[t.HouseRules=1]="HouseRules",t[t.RightOfWayCatalog=2]="RightOfWayCatalog"}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=(e=(e=e.Web||(e.Web={})).Areas||(e.Areas={})).Housing||(e.Housing={})).Department||(e.Department={})).AssignmentRuleStatusType||(e.AssignmentRuleStatusType={}))[e.NA=0]="NA",e[e.None=1]="None",e[e.All=2]="All",e[e.Some=3]="Some"}(Application=Application||{}),!function(e){(e=(e=(e=(e=e.General||(e.General={})).OperationMessage||(e.OperationMessage={})).OperationMessageManagement||(e.OperationMessageManagement={})).OperationMessageType||(e.OperationMessageType={}))[e.OperationMessage=0]="OperationMessage",e[e.AcuteMessage=1]="AcuteMessage"}(BoligExtra=BoligExtra||{}),!function(e){e=e.CrossPortal||(e.CrossPortal={});function t(){}(e=e.Pbs||(e.Pbs={})).MemberBillingTypeViewModel=function(){},e.TenantBillingTypeViewModel=t}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=e.CrossPortal||(e.CrossPortal={})).Consents||(e.Consents={})).ConsentLevelViewModel||(e.ConsentLevelViewModel={}
1))[e.NotApplicable=1]="NotApplicable",e[e.Unanswered=2]="Unanswered",e[e.Yes=3]="Yes",e[e.No=4]="No"}(BoligExtra=BoligExtra||{}),!function(e){((e=(e=e.CrossPortal||(e.CrossPortal={})).Archives||(e.Archives={})).FileArchive||(e.FileArchive={})).isFileArchiveFileViewModel=function(e){return void 0!==e.Extension}}(BoligExtra=BoligExtra||{}),!function(e){(e.CrossPortal||(e.CrossPortal={})).isFirstLoginViewModel=function(e){return void 0!==e.Birthdate}}(BoligExtra=BoligExtra||{}),!function(e){((e=(e=e.General||(e.General={})).Frontpage||(e.Frontpage={})).Banner||(e.Banner={})).isFrontPageBanner3ViewModel=function(e){return void 0!==e.LinksLeft&&void 0!==e.LinksRight}}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.defectsService=e,this.htmlToPdfService=t,this.formService=i,this.complaintTypes=["Hårde hvidevarer","Døre/Vinduer","Gulv/Væg/Loft","VVS","Trappe/Altan","Andet"],this.defectForm={}}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).Defects||(e.Defects={}),i.prototype.$onInit=function(){var t=this;this.subscription=this.defectsService.tenant$.subscribe(function(e){e&&(t.defectForm.User=e)})},i.prototype.sendMail=function(){var e=angular.copy(this.defectForm);this.formService.clearFields(this.form),this.defectsService.sendForm(e)},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".contact-page","Fejl og mangler")},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.$inject=["DefectsService","HtmlToPdfService","FormService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Forms/Defects/Defects.Component.html"},app.component("defects",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.tenant$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/Defects/",this.setupForm()}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).Defects||(e.Defects={}),t.prototype.setupForm=function(){var t=this,i=this.loaderService.setLoader("global","setupForm");this.incomHttp.get(this.baseurl+"SetupForm").then(function(e){t.tenant$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.sendForm=function(e){this.incomHttp.post(this.baseurl+"SendForm",e)},t.$inject=["incomHttpService","LoaderService"],app.service("DefectsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.fullSubleaseService=e,this.htmlToPdfService=t,this.formService=i,this.validationService=n,this.fullSubLease={}}
1(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).FullSublease||(e.FullSublease={}),i.prototype.$onInit=function(){var t=this;this.subscription=this.fullSubleaseService.tenant$.subscribe(function(e){e&&(t.fullSubLease.User=e)}),this.dateRegex=this.validationService.getDateRegex(),this.emailRegex=this.validationService.getEmailRegex(),this.nameRegex=this.validationService.getFullNameRegex()},i.prototype.getAddress=function(e){e&&(this.fullSubLease.TempAddress.ZipCode=e.ZipCode,this.fullSubLease.TempAddress.City=e.City,this.fullSubLease.TempAddress.Street=e.Street,this.fullSubLease.TempAddress.Location=e.Location,this.fullSubLease.TempAddress.LocalTown=e.LocalTown)},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".contact-page","Ansøgning om fuldstændig fremleje")},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.$inject=["FullSubleaseService","HtmlToPdfService","FormService","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Forms/FullSublease/FullSublease.Component.html"},app.component("fullSublease",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.tenant$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/FullSublease/",this.setupForm()}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).FullSublease||(e.FullSublease={}),t.prototype.setupForm=function(){var t=this,i=this.loaderService.setLoader("global","setupForm");this.incomHttp.get(this.baseurl+"SetupForm").then(function(e){t.tenant$.onNext(e),t.loaderService.removeLoader(i)})},t.prototype.signForm=function(e){var t=this,i=this.loaderService.setLoader("global","signForm");this.incomHttp.post(this.baseurl+"Sign",e).then(function(e){window.open(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService"],app.service("FullSubleaseService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.partialSubleaseService=e,this.htmlToPdfService=t,this.formService=i,this.validationService=n,this.partialSublease={}}
1(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).PartialSublease||(e.PartialSublease={}),i.prototype.$onInit=function(){var t=this;this.subscription=this.partialSubleaseService.setupForm().subscribe(function(e){e&&(t.partialSublease.User=e)}),this.dateRegex=this.validationService.getDateRegex(),this.emailRegex=this.validationService.getEmailRegex(),this.nameRegex=this.validationService.getFullNameRegex()},i.prototype.getAddress=function(e){e&&(this.partialSublease.TempAddress.ZipCode=e.ZipCode,this.partialSublease.TempAddress.City=e.City,this.partialSublease.TempAddress.Street=e.Street,this.partialSublease.TempAddress.Location=e.Location,this.partialSublease.TempAddress.LocalTown=e.LocalTown)},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".contact-page","Ansøgning om delvis fremleje")},i.$inject=["PartialSubleaseService","HtmlToPdfService","FormService","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Forms/PartialSublease/PartialSublease.Component.html"},app.component("partialSublease",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.tenant$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/PartialSublease/"}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={}
1)).PartialSublease||(e.PartialSublease={}),t.prototype.setupForm=function(){var t=this,i=this.loaderService.setLoader("global","setupForm");return this.incomHttp.get(this.baseurl+"SetupForm").then(function(e){t.tenant$.onNext(e),t.loaderService.removeLoader(i)}),this.tenant$},t.$inject=["incomHttpService","LoaderService"],app.service("PartialSubleaseService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.tenant$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/RequestPetPermission/",this.setupForm()}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).RequestPetPermission||(e.RequestPetPermission={}),t.prototype.setupForm=function(){var t=this,i=this.loaderService.setLoader("global","setupForm");this.incomHttp.get(this.baseurl+"SetupForm").then(function(e){t.tenant$.onNext(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService"],app.service("RequestPetPermissionService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.RequestPetPermissionService=e,this.htmlToPdfService=t,this.formService=i,this.requestPetPermission={}}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).RequestPetPermission||(e.RequestPetPermission={}),i.prototype.$onInit=function(){var t=this;this.subscription=this.RequestPetPermissionService.tenant$.subscribe(function(e){e&&(t.requestPetPermission.User=e)})},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".contact-page","Ansøgning om husdyrtilladelse")},i.$inject=["RequestPetPermissionService","HtmlToPdfService","FormService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Forms/RequestPetPermission/RequestPetPermission.component.html"}
1,app.component("requestPetPermission",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.recindLeaseService=e,this.htmlToPdfService=t,this.formService=i,this.validationService=n,this.locationService=o,this.disposables=new Rx.CompositeDisposable,this.rescindLease={}}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).RescindLease||(e.RescindLease={}),i.prototype.$onInit=function(){var t=this;this.subscription=this.recindLeaseService.tenant$.subscribe(function(e){e&&(t.rescindLease.User=e)}),this.disposables.add(this.locationService.getCountries().subscribe(function(e){e&&(t.countries=e)})),this.dateRegex=this.validationService.getDateRegex(),this.emailRegex=this.validationService.getEmailRegex(),this.nameRegex=this.validationService.getFullNameRegex()},i.prototype.getAddress=function(e){e&&(this.rescindLease.Address.ZipCode=e.ZipCode,this.rescindLease.Address.City=e.City,this.rescindLease.Address.Street=e.Street,this.rescindLease.Address.Location=e.Location,this.rescindLease.Address.LocalTown=e.LocalTown)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".contact-page","Opsigelse af lejemål")},i.$inject=["RescindLeaseService","HtmlToPdfService","FormService","ValidationService","LocationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Forms/RescindLease/RescindLease.Component.html"},app.component("rescindLease",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.tenant$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/RescindLease/",this.setupForm()}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).RescindLease||(e.RescindLease={}),t.prototype.setupForm=function(){var t=this,i=this.loaderService.setLoader("global","setupForm");this.incomHttp.get(this.baseurl+"SetupForm").then(function(e){t.tenant$.onNext(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService"],app.service("RescindLeaseService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.tenancyTransferService=e,this.htmlToPdfService=t,this.formService=i,this.validationService=n,this.locationService=o,this.disposables=new Rx.CompositeDisposable,this.tenancyTransfer={}}
1(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).TenancyTransfer||(e.TenancyTransfer={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.tenancyTransferService.tenant$.subscribe(function(e){e&&(t.tenancyTransfer.User=e)})),this.disposables.add(this.locationService.getCountries().subscribe(function(e){e&&(t.countries=e)})),this.dateRegex=this.validationService.getDateRegex(),this.emailRegex=this.validationService.getEmailRegex(),this.nameRegex=this.validationService.getFullNameRegex()},i.prototype.getAddress=function(e){e&&(this.tenancyTransfer.NewTenant.Address.ZipCode=e.ZipCode,this.tenancyTransfer.NewTenant.Address.City=e.City,this.tenancyTransfer.NewTenant.Address.Street=e.Street,this.tenancyTransfer.NewTenant.Address.Location=e.Location,this.tenancyTransfer.NewTenant.Address.LocalTown=e.LocalTown)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".contact-page","Ansøgning om bolig bytning")},i.$inject=["TenancyTransferService","HtmlToPdfService","FormService","ValidationService","LocationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Forms/TenancyTransfer/TenancyTransfer.Component.html"},app.component("tenancyTransfer",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.tenant$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/TenancyTransfer/",this.setupForm()}(e=(e=e.TenantPortal||(e.TenantPortal={})).Forms||(e.Forms={})).TenancyTransfer||(e.TenancyTransfer={}),t.prototype.setupForm=function(){var t=this,i=this.loaderService.setLoader("global","setupForm");this.incomHttp.get(this.baseurl+"SetupForm").then(function(e){t.tenant$.onNext(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService"],app.service("TenancyTransferService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.myDepartmentService=e,this.disposables=new Rx.CompositeDisposable,this.myDepartmentLoaded=!1}(e=(e=e.TenantPortal||(e.TenantPortal={})).MyPage||(e.MyPage={})).MyDepartment||(e.MyDepartment={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.myDepartmentService.getMyDepartment().subscribe(function(e){t.myDepartmentLoaded=!0,e&&(t.myDepartment=e)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.getDepartmentAddress=function(){var e="";return this.myDepartment.Addresse.Street&&(e+=this.myDepartment.Addresse.Street+" ",this.myDepartment.Addresse.Location)&&"null"!=this.myDepartment.Addresse.Location&&(e+=this.myDepartment.Addresse.Location),e+=", "+this.myDepartment.Addresse.ZipCode+" "+this.myDepartment.Addresse.City},i.$inject=["MyDepartmentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/MyPage/MyDepartment/MyDepartment2/MyDepartment2.component.html",this.bindings={}},app.component("myDepartment",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/MyDepartment/"}(e=(e=e.TenantPortal||(e.TenantPortal={})).MyPage||(e.MyPage={})).MyDepartment||(e.MyDepartment={}),t.prototype.getMyDepartment=function(){var t=this,i=new Rx.BehaviorSubject(null),n=this.loaderService.setLoader("mydepartment","getmydepartment");return this.incomHttp.get("".concat(this.baseurl,"GetMyDepartment")).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("MyDepartmentService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=(e=(e=e.TenantPortal||(e.TenantPortal={})).MyPage||(e.MyPage={})).MyDepartment||(e.MyDepartment={})).OfficePresentation||(e.OfficePresentation={}),i.prototype.$onInit=function(){},t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/MyPage/MyDepartment/OfficePresentation/OfficePresentation.component.html",this.bindings={officeList:"<",departmentUrl:"<"}},app.component("officePresentation",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.dateService=e,this.datePipe=this.dateService.shortDateFormat}
1(e=(e=(e=e.TenantPortal||(e.TenantPortal={})).MyPage||(e.MyPage={})).MyDepartment||(e.MyDepartment={})).PersonPresentation||(e.PersonPresentation={}),i.prototype.$onInit=function(){},i.$inject=["UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/MyPage/MyDepartment/PersonPresentation/PersonPresentation.component.html",this.bindings={personList:"<",showPicture:"<"}},app.component("personPresentation",new e)}(BoligExtra=BoligExtra||{}),!function(n){var e,t;function i(e,t,i){this.myTenancyService=e,this.featureFlagService=t,this.modalService=i,this.myTenanciesLoaded=!1,this.floorPlans=[]}(e=(e=n.TenantPortal||(n.TenantPortal={})).MyPage||(e.MyPage={})).MyTenancy||(e.MyTenancy={}),i.prototype.$onInit=function(){var n=this;this.subscription=this.myTenancyService.getMyTenancy().subscribe(function(e){if(n.myTenanciesLoaded=!0,e){n.myTenancies=e.Tenancies.orderByDescending(function(e){return e.TenancyGranted});for(var t=0;t<n.myTenancies.length;t++)if(n.floorPlans[t]=[],n.myTenancies[t].FloorPlanUrls)for(var i=0;i<n.myTenancies[t].FloorPlanUrls.length;i++)n.floorPlans[t][i]={Url:n.myTenancies[t].FloorPlanUrls[i],SortOrder:i}}}),this.showDeposit=this.featureFlagService.displayDeposits.displayDeposits},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.prototype.viewTenancy=function(e){var i=this,e={CompanyId:e.CompanyId,DepartmentId:e.DepartmentId,TenancyId:e.TenancyId};this.myTenancyService.getTenancy(e).subscribe(function(e){var t;e&&(e={tenancy:e,preventAddingToBasket:!0},(t=new n.Utility.Modal.ModalSettings).template="/App/Housing/Tenancy/Presentation/Modal/TenancyPresentation.Modal.html",t.data=e,t.controller=n.Housing.Tenancy.Presentation.Modal.TenancyPresentationController,t.size="lg",t.backdrop=!0,i.modalService.createModalWithSettings(t))})},i.$inject=["MyTenancyService","FeatureFlagService","ModalService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/MyPage/MyTenancy/MyTenancy2/MyTenancy2.Component.html",this.bindings={links:"<"}},app.component("myTenancy",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/MyTenancy/"}(e=(e=e.TenantPortal||(e.TenantPortal={})).MyPage||(e.MyPage={})).MyTenancy||(e.MyTenancy={}),t.prototype.getMyTenancy=function(){var t=this,i=new Rx.BehaviorSubject(null),n=this.loaderService.setLoader("mytenancy","getmytenancy");return this.incomHttp.get("".concat(this.baseurl,"GetMyTenancy")).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.prototype.getTenancy=function(e){var t=this,i=new Rx.BehaviorSubject(null),n=this.loaderService.setLoader("mytenancy","gettenancy");return this.incomHttp.post("".concat(this.baseurl,"GetTenancy"),e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("MyTenancyService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.tenantRentService=e,this.htmlToPdfService=t,this.featureFlagService=i,this.currentPage=0,this.sort="-sortDate",this.numbers=[],this.transactionsTotal=0,this.periodTotal=0,this.pdfName="Kontoudtog"}(e=(e=e.TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={})).AccountStatement||(e.AccountStatement={}),i.prototype.$onInit=function(){var n=this;if(this.types)for(var e=this.types.toString().split(","),t=0;t<e.length;t++)this.numbers.add(Number(e[t]));this.periodAndType={MaxDate:new Date,MinDate:new Date(2015,1,1),FilterByTypes:this.numbers},this.accountStatementSubscription=this.tenantRentService.getAccountStatements(this.periodAndType).subscribe(function(e){var t;e&&0<e.Transactions.length&&(n.accountStatements=e.Transactions.reverse(),n.transactionsTotal=n.accountStatements.map(function(e){return e.Amount}).reduce(function(e,t){return e+t}),n.periods=e.Transactions.map(function(e){return n.getDate(e.RegistrationDate)}).filter(function(t,e,i){return n.findArrayIndex(i,function(e){return e.getTime()==t.getTime()})===e}),n.featureFlagService.accountStatements.onlyShowPeriodsForCurrentAndLastYear&&(t=new Date((new Date).getFullYear()-1,0,0),n.periods=n.periods.filter(function(e){return t<e})),n.endPeriod=n.periods.firstOrDefault(),n.startPeriod=n.periods.lastOrDefault(),n.selectPeriod())})},i.prototype.findArrayIndex=function(e,t){if(!(null==e?0:e.length))return-1;for(var i=-1,n=0;n<e.length;++n)if(t(e[n])){i=n;break}return i},i.prototype.getDate=function(e){e=new Date(e);return new Date(e.getFullYear(),e.getMonth())},i.prototype.selectPeriod=function(){var t=this,e=this.accountStatements.indexOf(this.accountStatements.lastOrDefault(function(e){return t.getDate(e.RegistrationDate).getTime()==t.startPeriod.getTime()}))+1,i=this.accountStatements.indexOf(this.accountStatements.firstOrDefault(function(e){return t.getDate(e.RegistrationDate).getTime()==t.endPeriod.getTime()}));this.selectedPeriodStatements=this.accountStatements.slice(i,e)},i.prototype.sortList=function(){this.selectedPeriodStatements.reverse()},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".expenses",this.pdfName)},i.prototype.$onDestroy=function(){this.accountStatementSubscription.dispose()},i.prototype.updatePage=function(e){this.currentPage=e},i.$inject=["TenantRentService","HtmlToPdfService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/AccountStatement/AccountStatement.Component.html",this.bindings={types:"<",pdfName:"
1<"}},app.component("accountStatement",new e)}(BoligExtra=BoligExtra||{}),!function(i){var e,t,n;function o(e,t,i){this.tenantRentService=e,this.htmlToPdfService=t,this.modalService=i,this.currentPage=0,this.sort="-sortDate"}e=(e=i.TenantPortal||(i.TenantPortal={})).Rents||(e.Rents={}),t=e.BAccount||(e.BAccount={}),o.prototype.$onInit=function(){var t=this;this.subscription=this.tenantRentService.getBAccount().subscribe(function(e){e&&(t.BAccount=e,t.enableRequestRequisition=0<t.BAccount.Balance&&i.CrossPortal.Settings.Settings.enableRequestRequisitions)})},o.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".expenses","Vedligeholdskonto")},o.prototype.sortList=function(){this.BAccount.Transactions.reverse()},o.prototype.updatePage=function(e){this.currentPage=e},o.prototype.getDocument=function(e){this.tenantRentService.getDocument(e)},o.prototype.requestRequisition=function(){var e={balance:this.BAccount.Balance,reservedAmount:this.BAccount.ReservedAmount};this.modalService.createModal("/App/TenantPortal/Rents/BAccount/Modals/RequestRequisition.modal.html",t.Modals.RequestRequisitionModalController,e,"lg")},o.prototype.$onDestroy=function(){this.subscription.dispose()},o.$inject=["TenantRentService","HtmlToPdfService","ModalService"],n=o,e=function(){this.controller=n,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/BAccount/BAccount.Component.html"},app.component("bAccount",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.tenantRentService=e,this.htmlToPdfService=t,this.loaderService=i}(e=(e=e.TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={})).ConsumptionSummary||(e.ConsumptionSummary={}),i.prototype.$onInit=function(){var t=this,i=this.loaderService.setLoader("tenant-consumption","load"),e=new Date,n=e.getFullYear()-5,n=new Date(n,e.getMonth(),e.getDate());this.periodAndType={MaxDate:e,MinDate:n,FilterByTypes:null},this.subscription=this.tenantRentService.getConsumptionSummary(this.periodAndType).subscribe(function(e){e&&(t.loaderService.removeLoader(i),t.loaded=!0,0<e.ConsumptionSummaries.length)&&(t.consumptionSummaries=e.ConsumptionSummaries)})},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".expenses","Forbrugsoversigt")},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.$inject=["TenantRentService","HtmlToPdfService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/ConsumptionSummary/ConsumptionSummary.Component.html"},app.component("consumptionSummary",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.tenantRentService=e,this.htmlToPdfService=t,this.currentPage=0,this.sort="-sortDate"}(e=(e=e.TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={})).Deposits||(e.Deposits={}),i.prototype.$onInit=function(){var t=this;this.subscription=this.tenantRentService.getDeposits().subscribe(function(e){e&&(t.deposits=e.Deposits)})},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".expenses","Depositum")},i.prototype.sortList=function(){this.deposits.reverse()},i.prototype.$onDestroy=function(){this.subscription.dispose()},i.prototype.updatePage=function(e){this.currentPage=e},i.$inject=["TenantRentService","HtmlToPdfService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/Deposits/Deposits.Component.html"},app.component("deposits",new e)}(BoligExtra=BoligExtra||{}),!function(n){var e,o,t;function i(e,t,i){this.tenantRentService=e,this.modalService=t,this.loaderService=i,this.disposables=new Rx.CompositeDisposable,this.secondaryMerchant=!1,this.activeRentView=1,this.enableRentPayment=n.CrossPortal.Settings.Settings.enableRentPayment,this.enableDepositPayment=n.CrossPortal.Settings.Settings.enableDepositPayment}e=(e=n.TenantPortal||(n.TenantPortal={})).Rents||(e.Rents={}),o=e.PaymentRent||(e.PaymentRent={}),i.prototype.$onInit=function(){var t=this;this.orderId=null,this.transactionId=null,this.disposables.add(this.tenantRentService.getDepositsToPayForCurrentTenancy().subscribe(function(e){t.depositsToPay=e})),this.disposables.add(this.tenantRentService.getDepositsToPayForFutureTenancy().subscribe(function(e){t.futureDepositsToPay=e})),this.disposables.add(this.tenantRentService.getRentsForCurrentTenancy().subscribe(function(e){e&&(t.rent=e)})),this.disposables.add(this.tenantRentService.getRentsForFutureTenancy().subscribe(function(e){e&&(t.futureRent=e)})),this.disposables.add(this.tenantRentService.getRentsForLiableTenancy().subscribe(function(e){e&&(t.liableRent=e)})),this.currentUrl=location.href},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.payRent=function(e,t){var i=this,n=(this.orderId=null,{FullTenantNumber:t,Re
1ntPayments:e,OwedRent:this.rent.OwedRent,FutureRent:this.rent.FutureRent});this.modalService.createModal("/App/TenantPortal/Rents/PaymentRent/PaymentRentPaymentTerms/PaymentRentPaymentTerms.modal.html",o.PaymentRentPaymentTerms.PaymentRentPaymentTermsModalController,{callback:function(){var t=i.loaderService.setLoader("goToPaymentLoaderArea","goToPaymentLoaderArea");i.tenantRentService.payRent(n).then(function(e){e&&(i.orderId=e.OrderId,i.transactionId=e.TransactionId),i.loaderService.removeLoader(t)},function(){i.loaderService.removeLoader(t)})}},"md")},i.prototype.payDeposit=function(e){var i=this,t=(this.orderId=null,{callback:function(){var t=i.loaderService.setLoader("goToPaymentLoaderArea","goToPaymentLoaderArea");i.tenantRentService.payDeposit(e).then(function(e){e&&(i.orderId=e.OrderId,i.transactionId=e.TransactionId,i.secondaryMerchant=e.UseSecondaryMerchantNumber),i.loaderService.removeLoader(t)},function(){i.loaderService.removeLoader(t)})}});this.modalService.createModal("/App/TenantPortal/Rents/PaymentRent/PaymentRentPaymentTerms/PaymentRentPaymentTerms.modal.html",o.PaymentRentPaymentTerms.PaymentRentPaymentTermsModalController,t,"md")},i.$inject=["TenantRentService","ModalService","LoaderService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/PaymentRent/PaymentRent.component.html",this.bindings={}},app.component("paymentRent",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.tenantRentService=e,this.htmlToPdfService=t,this.sort="-sortDate",this.yearsBack=5}(e=(e=e.TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={})).RentAndExpenditures||(e.RentAndExpenditures={}),i.prototype.$onInit=function(){var t=this;this.year=(new Date).getFullYear(),this.month=(new Date).getMonth()+1,this.rentSubscription=this.tenantRentService.getRentAndExpenduturesForYearsBack(this.yearsBack).subscribe(function(e){e&&(t.rentGroups=e.TenantRents,t.rentGroups.forEach(function(e){return e.Rents.reverse()}))})},i.prototype.downloadPdf=function(){this.htmlToPdfService.downloadPdf(".expenses","Husleje")},i.prototype.sortList=function(){this.rentGroups.reverse(),this.rentGroups.forEach(function(e){return e.Rents.reverse()})},i.prototype.$onDestroy=function(){this.rentSubscription.dispose()},i.$inject=["TenantRentService","HtmlToPdfService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/TenantPortal/Rents/RentAndExpenditures/RentAndExpenditures.component.html"},app.component("rentAndExpenditures",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.loaderService=t,this.fileService=i,this.baseUrl="/Umbraco/api/TenantRent/",this.rentAndExpenditure$=new Rx.BehaviorSubject(null),this.consumptionSummary$=new Rx.BehaviorSubject(null),this.bAccount$=new Rx.BehaviorSubject(null),this.deposits$=new Rx.BehaviorSubject(null),this.anyMissingPayment$=new Rx.BehaviorSubject(null)}(e=e.TenantPortal||(e.TenantPortal={})).Rents||(e.Rents={}),t.prototype.getDepositsToPayForCurrentTenancy=function(){var t=new Rx.Subject;return this.$http.get(this.baseUrl+"GetDepositsToPayForCurrentTenancy").then(function(e){t.onNext(e)}),t},t.prototype.getDepositsToPayForFutureTenancy=function(){var t=new Rx.Subject;return this.$http.get(this.baseUrl+"GetDepositsToPayForFutureTenancy").then(function(e){t.onNext(e)}),t},t.prototype.getRentAndExpenduturesForYearsBack=function(e){var t=this,i=this.loaderService.setLoader("global","");return this.$http.get("".concat(this.baseUrl,"GetRentAndExpenduturesForYearsBack?maxYearsBack=").concat(e)).then(function(e){t.rentAndExpenditure$.onNext(e),t.loaderService.removeLoader(i)}),this.rentAndExpenditure$},t.prototype.anyMissingPayment=function(){var t=this,i=this.loaderService.setLoader("global","");return this.$http.get("".concat(this.baseUrl,"AnyMissingPayment")).then(function(e){t.anyMissingPayment$.onNext(e),t.loaderService.removeLoader(i)}),this.anyMissingPayment$},t.prototype.payRent=function(e){return this.$http.post("".concat(this.baseUrl,"PayRent"),e)},t.prototype.payDeposit=function(e){return this.$http.post("".concat(this.baseUrl,"PayDeposit"),e)},t.prototype.getAccountStatements=function(e){var t=this,i=new Rx.Subject,n=this.loaderService.setLoader("global","");return this.$http.post("".concat(this.baseUrl,"GetTransactions"),e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.prototype.getConsumptionSummary=function(e){var t=this,i=this.loaderService.setLoader("global","");return this.$http.post("".concat(this.baseUrl,"GetConsumptionSummary"),e).then(function(e){t.consumptionSummary$.onNext(e),t.loaderService.removeLoader(i)}),this.consumptionSummary$},t.prototype.getBAccount=function(){var t=this,i=this.loaderService.setLoader("global","");return this.$http.get("".concat(this.baseUrl,"GetBAccount")).then(function(e){t.bAccount$.onNext(e),t.loaderService.removeLoader(i)}),this.bAccount$},t.prototype.createRequisitionRequest=function(e){var t=this,i=this.loaderService.setLoader("requestRequisitionModal","requestRequisitionModal"),e=this.$http.post("".concat(this.baseUrl,"CreateRequisitionRequest"),e);return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getRequisitionRequestInfo=function(){var t=this,i=this.loaderService.setLoader("requestRequisitionModal","requestRequisitionModal"),e=this.$http.get("".concat(this.baseUrl,"GetRequisitionRequestInfo"));return e.then(function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)},function(e){t.loaderService.removeLoader(i)}),e},t.prototype.getDeposits=function(){var t=this,i=this.loaderService.setLoader("global","");return this.$http.get("".concat(this.baseUrl,"GetDeposits")).then(function(e){t.deposits$.onNext(e),t.loaderService.removeLoader(i)}),this.deposits$},t.prototype.getRentsForCurrentTenancy=function(){var t=this,i=this.loaderService.setLoader("global",""),n=new Rx.Subject;return this.$http.get("".concat(this.baseUrl,"GetRentsForCurrentTenancy")).then(function(e){n.onNext(e),t.loaderService.removeLoader(i)}),n},t.prototype.getRentsForFutureTenancy=function(){var t=this,i=this.loaderService.setLoader("global",""),n=new Rx.Subject;return this.$http.get("".concat(this.baseUrl,"GetRentsForFutureTenancy")).then(function(e){n.onNext(e),t.loaderService.removeLoader(i)}),n},t.prototype.getRentsForLiableTenancy=function(){var t=this,i=this.loaderService.setLoader("global",""),n=new Rx.Subject;return this.$http.get("".concat(this.baseUrl,"GetRentsForLiableTenancy")).then(function(e){n.onNext(e),t.loaderService.removeLoader(i)}),n},t.prototype.getDocument=function(e){var t=this,i=this.loaderService.setLoader("global","");this.$http.get("".concat(this.baseUrl,"GetTransactionDocument")).then(function(e){e&&t.fileService.downloadFile(e),t.loaderService.removeLoader(i)})},t.$inject=["incomHttpService","LoaderService","FileService"],app.service("TenantRentService",t)}(BoligExtra=BoligExtra||{}),!function(e){var i,n,t;function o(e){this.element=e,this.source=null,this.isRendered=!1,this.height=null}function r(e,t){this.$window=e,this.$document=t,this.images=[],this.renderTimer=null,this.renderDelay=100,this.documentTimer=null,this.documentDelay=2e3,this.isWatchingWindow=!1,this.documentHeight=t.height(),this.win=angular.element(e);var l=this;this.windowChanged=function(){l.renderTimer||l.startRenderTimer()},this.checkImages=function(){for(var e=[],t=[],i=l.win.height(),n=l.win.scrollTop(),o=n+i,r=0;r<l.images.length;r++){var s=l.images[r];(s.isVisible(n,o)?e:t).push(s)}for(var a=0;a<e.length;a++)e[a].render();l.images=t,l.clearRenderTimer(),l.images.length||l.stopWatchingWindow()},this.checkDocumentHeight=function(){var e;l.renderTimer||(e=l.$document.height())!==l.documentHeight&&(l.documentHeight=e,l.startRenderTimer())}}function s(e,t,i,n,o){this.$scope=e,this.attributes=t,this.$window=i,this.$document=n,this.$element=o}e.Ui||(e.Ui={}),o.prototype.isVisible=function(e,t){if(!this.element.is(":visible"))return!1;null===this.height&&(this.height=this.element.height());var i=this.element.offset().top,n=i+this.height;return i<=t&&e<=i||n<=t&&e<=n||i<=e&&t<=n},o.prototype.render=function(){this.isRendered=!0,this.renderSource()},o.prototype.setSource=function(e){this.source=e,this.isRendered&&this.renderSource()},o.prototype.renderSource=function(){this.element[0].src=this.source},i=o,r.prototype.addImage=function(e){this.images.push(e),this.renderTimer||this.startRenderTimer(),this.isWatchingWindow||this.startWatchingWindow()},r.prototype.removeImage=function(e){for(var t=0;t<this.images.length;t++)if(this.images[t]===e){this.images.splice(t,1);break}this.images.length||(this.clearRenderTimer(),this.stopWatchingWindow())},r.prototype.clearRenderTimer=function(){clearTimeout(this.renderTimer),this.renderTimer=null},r.prototype.startRenderTimer=function(){this.renderTimer=setTimeout(this.checkImages,this.renderDelay)},r.prototype.startWatchingWindow=function(){this.isWatchingWindow=!0,this.win.on("resize.bnLazySrc",this.windowChanged),this.win.on("scroll.bnLazySrc",this.windowChanged),this.documentTimer=setInterval(this.checkDocumentHeight,this.documentDelay)},r.prototype.stopWatchingWindow=function(){this.isWatchingWindow=!1,this.win.off("resize.bnLazySrc"),this.win.off("scroll.bnLazySrc"),clearInterval(this.documentTimer)},n=r,s.prototype.$onInit=function(){var t=new i(this.$element),e=new n(this.$window,this.$document);e.addImage(t),this.attributes.$observe("bnLazySrc",function(e){t.setSource(e)}),this.$scope.$on("$destroy",function(){e.removeImage(t)})},s.$inject=["$scope","$attrs","$window","$document","$element"],t=s,app.directive("bnLazySrc",function(){return{restrict:"A",controller:t}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.pageContentService=e,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={}
1)).Breadcrumbs||(e.Breadcrumbs={}),i.prototype.$onInit=function(){var e=this;this.disposables.add(this.pageContentService.currentPage$.subscribe(function(t){t&&(e.path=t.Path.where(function(e){return e.Id!==t.Id}),e.currentPage=t)}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageContentService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/Breadcrumbs/Breadcrumbs.component.html",this.bindings={}},app.component("breadcrumbs",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.owlCarouselOptionsService=e}(e=e.Ui||(e.Ui={})).Carousel||(e.Carousel={}),i.prototype.$onInit=function(){this.imageDefinition&&""!==this.imageDefinition?this.imageDefinition="?definition="+this.imageDefinition:this.imageDefinition="?definition="},i.prototype.$onChanges=function(e){var t=this;e.images&&this.images&&0<this.images.length&&setTimeout(function(){var e=$(".owl-carousel");t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions()),e.owlCarousel(t.options)},100)},i.$inject=["OwlCarouselOptionsService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/Carousels/Extended/OwlCarouselExtended.component.html",this.bindings={images:"<",options:"<",imageDefinition:"<",cssClass:"<"}},app.component("owlCarouselExtended",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(){}(e=e.Ui||(e.Ui={})).Carousel||(e.Carousel={}),t.prototype.getDefaultOptions=function(){return{loop:!0,items:1,margin:10,nav:!0,navElement:"div",navText:['<i class="fal fa-angle-left"></i>','<i class="fal fa-angle-right"></i>'],lazyLoad:!0,lazyLoadEager:1}},t.prototype.getMultiItemOptions=function(e){void 0===e&&(e=3);var t=this.getDefaultOptions();return t.items=e,t},t.prototype.getBanner7Options=function(){var e=this.getDefaultOptions();return e.dots=!0,e.dotsContainer=".owl-dots",e.lazyLoad=!0,e.animateOut="fadeOut",e.animateIn="fadeIn",e.nav=!1,e.autoplaySpeed=6,e.autoplay=!0,e.mouseDrag=!1,e.touchDrag=!1,e},t.$inject=[],app.service("OwlCarouselOptionsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.owlCarouselOptionsService=e,this.$element=t}(e=e.Ui||(e.Ui={})).Carousel||(e.Carousel={}),i.prototype.$onInit=function(){this.images&&0<this.images.length&&!this.images[0].Url&&(this.images=this.images.map(function(e){return{Id:0,Name:"",Photographer:"",SortOrder:0,Url:e}})),this.imageDefinition&&""!==this.imageDefinition?this.imageDefinition="?definition="+this.imageDefinition:this.imageDefinition="?definition="},i.prototype.getDefinitionFor=function(e){return-1==e.Url.indexOf("?")?this.imageDefinition:this.imageDefinition.replace("?","&")},i.prototype.$onChanges=function(e){var t=this;e.images&&this.images&&0<this.images.length&&setTimeout(function(){var e=t.$element.find(".owl-carousel.owl-standard");t.options||(t.options=t.owlCarouselOptionsService.getDefaultOptions(),1==t.images.length&&(t.options.loop=!1,t.options.mouseDrag=!1,t.options.freeDrag=!1)),t.startIndex&&(t.options.startPosition=t.startIndex),e.owlCarousel(t.options)},100)},i.$inject=["OwlCarouselOptionsService","$element"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/Carousels/Standard/OwlCarousel.component.html",this.bindings={images:"<",options:"<",imageDefinition:"<",description:"<",startIndex:"<"}},app.component("owlCarousel",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=e.Ui||(e.Ui={})).CompanyDepartmentDropdown||(e.CompanyDepartmentDropdown={}),i.prototype.$onInit=function(){this.removeCompanyFromList?this.collection=this.companyDepartments.where(function(e){return!1===e.IsCompany}):this.collection=this.companyDepartments},i.prototype.selectedChanged=function(){this.onChange({newValue:this.selected})},t=i,e=function(){this.controller=t,this.templateUrl="/App/Ui/CompanyDepartmentDropdown/CompanyDepartmentDropdown.component.html",this.bindings={companyDepartments:"<",removeCompanyFromList:"<",selected:"<",onChange:"&"}},app.component("companyDepartmentDropdown",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.multiple=!1}(e=e.Common||(e.Common={})).UiComponents||(e.UiComponents={}),i.prototype.$onInit=function(){Array.isArray(this.ngModel)?(this.multiple=!0,this.ngModel=this.ngModel||[]):this.ngModel=this.ngModel||(this.items?this.items[0]:{})},i.prototype.toggleSelection=function(t){var e,i=this;Array.isArray(this.ngModel)?(e=this.ngModel.firstOrDefault(function(e){return i.comparator?e[i.comparator]===t[i.comparator]:e===t}))?this.ngModel.remove(e):this.ngModel.add(t):this.ngModel=t},i.prototype.getDisplayValue=function(e){return e[this.displayPropertyName||"name"]},i.prototype.getResultMessage=function(){return Array.isArray(this.ngModel)?"".concat(this.ngModel.length," emner valgt"):this.getDisplayValue(this.ngModel)},i.prototype.isSelected=function(t){var i=this;return Array.isArray(this.ngModel)?this.ngModel.any(function(e){return i.comparator?e[i.comparator]===t[i.comparator]:e===t}):this.ngModel===t},t=i,e=function(){this.bindings={ngModel:"=",displayPropertyName:"<",comparator:"<",items:"="},this.controller=t,this.templateUrl="/App/Ui/Dropdown/DropdownSelectList.component.html"},app.component("dropdownSelectList",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){}(e=e.Ui||(e.Ui={})).Dropdown||(e.Dropdown={}),i.prototype.$onInit=function(){this.selectedItem=this.selectedItem||this.items[0]},i.prototype.getDisplayValue=function(e){return e[this.displayPropertyName||"name"]},t=i,e=function(){this.bindings={selectedItem:"=",displayPropertyName:"<",items:"="},this.controller=t,this.templateUrl="/App/Ui/Dropdown/DropdownSelector.component.html"},app.component("dropdownSelector",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}(e=(e=e.Ui||(e.Ui={})).ErrorPages||(e.ErrorPages={})).AccessDenied||(e.AccessDenied={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/ErrorPages/AccessDenied/AccessDenied.component.html",this.bindings={}},app.component("accessDenied",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(){this.disposables=new Rx.CompositeDisposable}(e=(e=e.Ui||(e.Ui={})).ErrorPages||(e.ErrorPages={})).ErrorPage404||(e.ErrorPage404={}),i.prototype.$onInit=function(){},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=[],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/ErrorPages/ErrorPage404/ErrorPage404.component.html",this.bindings={}},app.component("errorPage404",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.fixedTextService=e,this.$element=t,this.$scope=i,this.$compile=n,this.utilityService=o}(e=e.Ui||(e.Ui={})).FixedText||(e.FixedText={}),i.prototype.$onInit=function(){},i.prototype.$onChanges=function(){var t=this;this.fixedText&&this.fixedTextService.getFixedText(this.fixedText).then(function(e){t.utilityService.isHtml(e.Content)?(t.$element.empty(),t.$element.append(t.$compile(e.Content)(t.$scope.$new(!0)))):t.$element.html(e.Content)})},i.prototype.$onDestroy=function(){},i.$inject=["FixedTextService","$element","$scope","$compile","UtilityService"],t=i,app.directive("fixedText",function(){return{restrict:"A",controller:t,scope:{},bindToController:{fixedText:"<"}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.texts={},this.baseurl="/umbraco/api/FixedText/"}(e=e.Ui||(e.Ui={})).FixedText||(e.FixedText={}),t.prototype.getFixedText=function(e){return this.texts[e]||(this.texts[e]=this.incomHttp.get(this.baseurl+"GetByAlias/"+e)),this.texts[e]},t.$inject=["incomHttpService","LoaderService"],app.service("FixedTextService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){var n=this;this.$scope=e,this.$attrs=t,this.$element=i,this.checkStateFn=function(e,t){n.ngModelCtrl.$setViewValue(e=e||!1),null!=t&&t!=e&&n.callback()},this.required=!1}(e=e.Ui||(e.Ui={})).FormFields||(e.FormFields={}),i.prototype.$onInit=function(){var e=this,t=(this.form=this.$element.controller("form"),this.$attrs.required);angular.isUndefined(t)||(this.required=this.$scope.$parent.$eval(t)),this.$scope.$watch(function(){return e.ngModel},this.checkStateFn)},i.prototype.callback=function(){this.onChangeCallback&&this.onChangeCallback()},i.$inject=["$scope","$attrs","$element"],t=i,e=function(){this.controller=t,this.controllerAs="$cb",this.templateUrl="/App/Ui/FormFields/Checkbox.component.html",this.require={ngModelCtrl:"ngModel"},this.bindings={name:"@",ngModel:"=",onChangeCallback:"&onChange",indeterminate:"<"},this.transclude=!0},app.component("checkbox",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.$scope=e,this.fileService=t,this.disposables=new Rx.CompositeDisposable,this.currentSize=0,this.uploadedFiles=[]}(e=e.Ui||(e.Ui={})).FormFields||(e.FormFields={}),i.prototype.$onInit=function(){var t=this;this.ngModelCtrl.$render=function(){t.ngModel=t.ngModelCtrl.$viewValue},this.$scope.$watchCollection(function(){return t.uploadedFiles},function(e){e&&0<e.length&&(t.ngModelCtrl.$setDirty(),t.ngModel=t.ngModel||[],t.ngModel.addRange(e.map(function(e){return t.fileService.toUploadedFile(e)})),t.uploadedFiles=[])}),this.$scope.$watchCollection(function(){return t.ngModel},function(e){t.ngModelCtrl.$setViewValue(e),t.updateRequiredValidState(e)}),this.maxTotalSize||(this.maxTotalSize=10240)},i.prototype.updateRequiredValidState=function(e){e&&(this.required&&this.ngModelCtrl.$setValidity("required",0<e.length),this.maxFiles&&0<this.maxFiles&&this.ngModelCtrl.$setValidity("filecount",e.length<=this.maxFiles),this.maxTotalSize)&&0<this.maxTotalSize&&(this.ngModelCtrl.$setValidity("filesize",e.reduce(function(e,t){return e+t.file.size},0)/1024<=this.maxTotalSize),this.currentSize=e.reduce(function(e,t){return e+t.file.size},0)/1024/1024)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["$scope","FileService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.require={ngModelCtrl:"^ngModel"},this.templateUrl="/App/Ui/FormFields/FileUpload.component.html",this.bindings={required:"<",accept:"@",maxFiles:"<",maxTotalSize:"<"},this.transclude=!0},app.component("fileUpload",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.$element=e}(e=e.Ui||(e.Ui={})).FormFields||(e.FormFields={}),i.prototype.$onInit=function(){this.form=this.$element.controller("form")},i.prototype.$onDestroy=function(){},i.prototype.showMessages=function(){var e=this.getInputItem();return!(!this.form.$submitted&&!e.$touched)},i.prototype.getInputItem=function(){var t=this;return this.inputItem=this.inputItem||this.form.$$controls.firstOrDefault(function(e){return $(e).closest(t.$element)}),this.inputItem},i.$inject=["$element"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/FormFields/InputField.component.html",this.transclude={label:"?inputFieldLabel",messages:"?validation-messages"}},app.component("inputField",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.$scope=e,this.$attrs=t,this.$element=i,this.required=!1}(e=e.Ui||(e.Ui={})).FormFields||(e.FormFields={}),i.prototype.$onInit=function(){var t=this,e=(this.form=this.$element.controller("form"),this.$attrs.required);angular.isUndefined(e)||(this.required=this.$scope.$parent.$eval(e)),this.$scope.$watch(function(){return t.ngModel},function(e){t.ngModelCtrl.$setViewValue(e)})},i.prototype.$onDestroy=function(){},i.prototype.callback=function(){this.onChangeCallback&&this.onChangeCallback()},i.$inject=["$scope","$attrs","$element"],t=i,e=function(){this.controller=t,this.controllerAs="$rb",this.require={ngModelCtrl:"ngModel"},this.templateUrl="/App/Ui/FormFields/Radiobutton.component.html",this.bindings={groupName:"@",value:"<",onChangeCallback:"&onChange",ngModel:"<"},this.transclude=!0},app.component("radiobutton",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.helpTextFactory=e,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).HelpText||(e.HelpText={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.helpTextFactory.helpText$.subscribe(function(e){null!=e&&(t.helpText=e.firstOrDefault(function(e){return e.Alias.toLowerCase()===t.alias.toLowerCase()}))})),this.helpTextFactory.getServiceInstance(this.module).getHelpTextFromGroup()},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["HelpTextFactory"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/HelpText/HelpText.component.html",this.bindings={alias:"<",module:"<"}},app.component("helpText",new e)}(BoligExtra=BoligExtra||{}),!function(e){e=e.Ui||(e.Ui={});function t(e,t){this.incomHttp=e,this.loaderService=t,this.helpText$=new Rx.BehaviorSubject([]),this.module=[]}e=e.HelpText||(e.HelpText={}),t.prototype.getServiceInstance=function(t){var e=this.module.firstOrDefault(function(e){return e.groupName===t});return e||(e={groupName:t,service:new i(this.incomHttp,this.loaderService,t,this)},this.module.add(e)),e.service},t.$inject=["incomHttpService","LoaderService"],app.service("HelpTextFactory",t),n.prototype.getHelpTextFromGroup=function(){var i=this;this.incomHttp.get(this.baseurl+"GetHelpTextFromGroup?helpTextGroup="+this._helpTextGroup_).then(function(e){var t=i.factory.helpText$.getValue();(t=t||[]).addRange(e.HelpTexts),i.factory.helpText$.onNext(t)})};var i=n;function n(e,t,i,n){this.incomHttp=e,this.loaderService=t,this._helpTextGroup_=i,this.factory=n,this.baseurl="/umbraco/api/HelpText/"}e.HelpTextService=i}(BoligExtra=BoligExtra||{}),!function(e){e=e.Ui||(e.Ui={});e.Indeterminate||(e.Indeterminate={}),app.directive("ngIndeterminate",function(){return{restrict:"A",scope:!1,link:function(e,t,i){e.$watch(i.ngIndeterminate,function(e){t.prop("indeterminate",!!e)})}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.modalData=t,this.owlCarouselOptionsService=i}e=(e=(e=e.Ui||(e.Ui={})).Modals||(e.Modals={})).Gallery||(e.Gallery={}),t.prototype.$onInit=function(){this.options=this.owlCarouselOptionsService.getDefaultOptions(),this.modalData.selectedIndex&&0<this.modalData.selectedIndex&&(this.options.startPosition=this.modalData.selectedIndex),this.modalData.imageDefinition||(this.modalData.imageDefinition="gallery-modal")}
1,t.prototype.print=function(){var e=$("#galleryModal .active img").attr("src"),t=window.open(e,"_blank");t.document.close(),setTimeout(function(){t.focus(),t.print(),t.close()},500)},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData","OwlCarouselOptionsService"],e.GalleryModalController=t}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.smoothScroll=e,this.pageContentService=t,this.subscriptions=new Rx.CompositeDisposable,this.ellipsisAmount=2,this.layout=1}(e=e.Ui||(e.Ui={})).Pagination||(e.Pagination={}),i.prototype.$onInit=function(){var t=this;this.subscriptions.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.pageType=e.DocTypeAlias)}))},i.prototype.$onChanges=function(e){e.amount&&e.amount!==this.amount&&("number"==typeof e.amount.currentValue?this.amount=e.amount.currentValue:e.amount.currentValue&&(this.amount=e.amount.currentValue.length),this.setPagingProperties(this.amount,this.entryLimit)),e.entryLimit&&e.entryLimit!==this.entryLimit&&(this.entryLimit=e.entryLimit.currentValue,this.setPagingProperties(this.amount,this.entryLimit))},i.prototype.$onDestroy=function(){this.subscriptions.dispose()},i.prototype.setPagingProperties=function(e,t){var i;e&&("number"==typeof e?(i=Math.ceil(e/t))!==this.numberOfPages&&this.goToPage(this.currentPage||0):(i=Math.ceil(e.length/t))!==this.numberOfPages&&this.goToPage(this.currentPage||0),this.numberOfPages=i)},i.prototype.goToPage=function(e){this.currentPage=e;"tenancySearch"===this.pageType&&window.matchMedia("(max-width: 991px)").matches||this.smoothScroll(document.getElementById("main-content"),{duration:10,easing:"easeInQuad"}),this.onChange&&this.onChange({page:e})},i.prototype.goToNextPage=function(){var e=this.currentPage+1;e<this.numberOfPages&&this.goToPage(e)},i.prototype.gotToPreviousPage=function(){var e=this.currentPage-1;0<=e&&this.goToPage(e)},i.prototype.getShownPages=function(e){for(var t=this.currentPage-e,i=(t<0&&(t=0),this.currentPage+e),n=(i>this.numberOfPages-1&&(i=this.numberOfPages-1),[]);t<=i;)n.push(t),t++;return n},i.$inject=["smoothScroll","PageContentService"],t=i,e=function(){this.controller=t,this.templateUrl="/App/Ui/Pagination/Pagination.component.html",this.bindings={currentPage:"<",amount:"<",entryLimit:"<",onChange:"&",layout:"<"}},app.component("pagination",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.element=e,this.$timeout=t}(e=e.Ui||(e.Ui={})).Required||(e.Required={}),i.prototype.$onInit=function(){var e=this;this.$timeout(function(){e.findLabels(e.element).forEach(function(e){e[0]instanceof HTMLLabelElement&&0===e.children("span.is-required").length&&e.append("<span class='is-required'>*</span>")})})},i.prototype.$onDestroy=function(){var e=this;this.$timeout(function(){e.findLabels(e.element).forEach(function(e){e[0]instanceof HTMLLabelElement&&0<e.children("span.is-required").length&&e.children("span.is-required").remove()})})},i.prototype.findLabels=function(e){var t=[],i=this.element[0].labels;return i&&0<i.length&&i.forEach(function(e){t.push($(e))}),t},i.$inject=["$element","$timeout"],t=i,app.directive("required",function(){return{restrict:"A",controller:t,bindToController:{}}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.pageContentService=e,this.siteMenuService=t,this.pageProviderService=i,this.userService=n,this.featureflagService=o,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).SideMenu||(e.SideMenu={}),i.prototype.$onInit=function(){var t=this;this.pageProviderService.getPageByDocumentType("editProfile").then(function(e){return t.profile=e}),this.disposables.add(this.siteMenuService.sideMenu$.subscribe(function(e){return t.sideMenu=e})),this.pageProviderService.getPageByDocumentType("myPageFrontPage").then(function(e){return t.myPage=e}),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e)})),this.disposables.add(this.userService.currentUser$.subscribe(function(e){e&&(t.currentUser=e)})),this.showAvatar=this.featureflagService.profile.EnableAvatarViewOnForumAndProfile},i.prototype.getChildren=function(e){e.IsOpen=!e.IsOpen,this.siteMenuService.getChildrenForSideMenuItem(e)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageContentService","SiteMenuService","PageProviderService","UserService","FeatureFlagService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/SideMenu/SideMenu.component.html",this.bindings={}},app.component("sideMenu",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.siteMenuStateService=e,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).SiteMenu||(e.SiteMenu={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.siteMenuStateService.openMenu$.subscribe(function(e){t.menuState=e}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.toggleMenu=function(){this.siteMenuStateService.toggleMenu()},i.$inject=["SiteMenuStateService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/SiteMenu/MenuControl/MenuControl.component.html"},app.component("menuControl",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.siteMenuStateService=e,this.element=t,this.featureFlagService=i,this.UtilityService=n}(e=e.Ui||(e.Ui={})).SiteMenu||(e.SiteMenu={}),i.prototype.$onInit=function(){var t=this;this.UtilityService.isHorizontalTablet.subscribe(function(e){t.isTablet=e}),!this.featureFlagService.siteMenu.enablePushingSiteMenu&&this.isTablet||(this.element.addClass("pushing-sitemenu-enabled"),this.toggleMenuSubscription=this.siteMenuStateService.openMenu$.subscribe(function(e){e?t.element.addClass("menu-active"):t.element.removeClass("menu-active")}),this.toggleMenuSubscription=this.siteMenuStateService.openMenuSection$.subscribe(function(e){e?t.element.addClass("section-active"):t.element.removeClass("section-active")}))},i.prototype.$onDestroy=function(){this.toggleMenuSubscription.dispose(),this.toggleCatalogSubscription.dispose()},i.$inject=["SiteMenuStateService","$element","FeatureFlagService","UtilityService"],t=i,app.directive("pushMainContent",function(){return{restrict:"A",controller:t,controllerAs:"$ctrl",scope:{},bindToController:{}}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r,s,a,l,c,d,u,p,h,m){this.siteMenuService=e,this.pageContentService=t,this.pageProviderService=i,this.basketService=n,this.smoothScroll=o,this.$element=r,this.windowService=s,this.scope=a,this.utilityService=l,this.userService=c,this.featureFlagService=d,this.departmentFrontpageService=u,this.faqService=p,this.siteMenuStateService=h,this.storageService=m,this.showScroll=!1,this.openSection=null,this.subscriptions=new Rx.CompositeDisposable,this.basketTenancyCount=0,this.isSearchPage=!1}(e=e.Ui||(e.Ui={})).SiteMenu||(e.SiteMenu={}),i.prototype.$onInit=function(){var t=this,e=(this.enableFaq=this.featureFlagService.siteMenu.enableFaq,this.subscriptions.add(this.utilityService.isHorizontalTablet.subscribe(function(e){t.isTabletViewOrHigher=e})),this.storageService.getCurrentMenuSectionState()),e=(e&&this.isTabletViewOrHigher&&this.siteMenuStateService.getMenuSection(e),this.pageProviderService.getPageByDocumentType("login").then(function(e){return t.loginPage=e}),this.pageProviderService.getPageByDocumentType("logOut").then(function(e){return t.logoutPage=e}),this.pageProviderService.getPageByDocumentType("basket").then(function(e){return t.basketPage=e}),this.pageProviderService.getPageByDocumentType("myProfileFrontPage").then(function(e){return t.myProfile=e}),this.pageProviderService.getPageByDocumentType("tenancySearch").then(function(e){return t.tenancySearchPage=e}),this.pageProviderService.getPageByDocumentType("myPageFrontPage").then(function(e){return t.myPage=e}),this.pageProviderService.getPageByDocumentType("contactForm").then(function(e){return t.contactPage=e}),this.pageProviderService.getPageByDocumentType("publicFaqOverview").then(function(e){return t.publicFaqOverviewPage=e}),this.pageProviderService.getPageByDocumentType("faqOverview").then(function(e){return t.faqOverviewPage=e}),this.pageProviderService.getPageByDocumentType("frontPage").then(function(e){return t.frontPage=e}),this.pageProviderService.getPageByDocumentType("benefitClub").then(function(e){t.benefitClubPage=e}),this.pageProviderService.getPageByDocumentType("sustainabilityInfo").then(function(e){t.sustainabilityInfoPage=e}),this.pageProviderService.getPageByDocumentType("availableTenancies").then(function(e){t.availableTenanciesPage=e}),this.subscriptions.add(this.pageContentService.currentPage$.subscribe(function(e){e&&(t.currentPage=e,t.currentPage.OpenSiteMenuOnLoad&&t.isTabletViewOrHigher&&t.siteMenuStateService.getMenuSection("mainMenu"),t.pageProviderService.getPageByDocumentType("tenancySearch").then(function(e){e&&(t.isSearchPage=t.currentPage&&e.Id===t.currentPage.Id,t.isSearchPage)&&t.allowPushingSiteMenu&&(t.isTabletViewOrHigher||t.siteMenuStateService.toggleMenu(),t.siteMenuStateService.getMenuSection("search")),setTimeout(function(){$(window).scroll()},50)}))})),this.subscriptions.add(this.userService.currentUser$.subscribe(function(e){e&&(t.currentUser=e)})),this.subscriptions.add(this.siteMenuService.menu$.subscribe(function(e){e&&(t.parentPage=t.currentPage.Path[t.currentPage.Path.length-2],t.pageProviderService.getPageByDocumentType("login").then(function(e){return t.loginPage=e}),t.menuItems=e,t.currentPage.IsCompanyOrDepartmentPage&&(t.menuItems.unshift({NodeId:t.frontPage.Id,Url:t.frontPage.Url,DisplayName:"GÃ¥ til "+t.frontPage.PageName}),t.subscriptions.add(t.departmentFrontpageService.departmentFrontPage$.subscribe(function(e){e&&(t.departmentInfo=e)}))),t.findNodeToShowBorder())})),this.subscriptions.add(this.siteMenuStateService.openMenuSection$.subscribe(function(e){t.openSection=e,t.storageService.setCurrentMenuSectionStorage(e)}
1)),this.siteMenuStateService.openMenu$.subscribe(function(e){t.menuState=e,t.utilityService.safeDigest(t.scope)}));this.siteMenuService.getDepartmentUrl().then(function(e){t.departmentUrl=e}),this.subscriptions.add(e),this.subscriptions.add(this.basketService.contents$.subscribe(function(e){e&&(t.basketTenancyCount=e.Counts.NumberOfTenancies)})),this.basketService.loadContentsIfNotAlreadyLoaded(),angular.element(this.windowService).bind("scroll",function(e){t.showScroll=t.isScrolledBelowView(".page-content")}),this.enableFaq&&this.pageProviderService.getPageByDocumentType("frontPage").then(function(e){e&&t.subscriptions.add(t.faqService.getFaqItems(e.Id).subscribe(function(e){t.popularFaqs=e.FaqItems})),t.subscriptions.add(t.siteMenuService.sideMenuFaqIntro$.subscribe(function(e){t.faqIntro=e})),t.subscriptions.add(t.faqService.getFaq().subscribe(function(e){e&&(t.faqCategories=e.Categories)}))}),this.allowPremiumItems=this.featureFlagService.siteMenu.enablePremiumSiteMenu,this.allowPushingSiteMenu=this.featureFlagService.siteMenu.enablePushingSiteMenu,this.enableDisplayOfPhoneNumber=this.featureFlagService.siteMenu.enableDisplayOfPhoneNumber,this.enableDisplayOfEmail=this.featureFlagService.siteMenu.enableDisplayOfEmail},i.prototype.$onDestroy=function(){this.subscriptions.dispose()},i.prototype.findNodeToShowBorder=function(){var e=this.findCurrentPath(this.menuItems.firstOrDefault(function(e){return e.IsInCurrentPath}));e&&(e.NodeId==this.currentPage.Id&&e.HasChildren?this.currentLevel=e.NodeId:this.currentLevel=e.ParentId)},i.prototype.findCurrentPath=function(e){var t;if(e)return(t=e.ChildNodes.firstOrDefault(function(e){return e.IsInCurrentPath}))?this.findCurrentPath(t):e},i.prototype.toggleOpenSection=function(e){this.openSection===e&&(e=null,this.isTabletViewOrHigher||this.siteMenuStateService.toggleMenu()),this.siteMenuStateService.getMenuSection(e)},i.prototype.openMenu=function(){"mainMenu"!==this.openSection&&this.toggleOpenSection("mainMenu")},i.prototype.closeMenu=function(e){e.IsBlankPage||this.isTabletViewOrHigher||this.siteMenuStateService.toggleMenu()},i.prototype.toggleMenu=function(){this.siteMenuStateService.toggleMenu()},i.prototype.isScrolledBelowView=function(e){var t,e=$(e);return!!e&&(t=$(window).scrollTop(),e.offset().top+e.height()+15<t)},i.prototype.isCurrentPage=function(e){return this.currentPage&&e&&this.currentPage.Path.lastOrDefault().Id===e.NodeId},i.prototype.getChildrenForMenuItem=function(e){e.IsOpen=!e.IsOpen,e.IsOpen?this.siteMenuService.getChildrenForMenuItem(e):this.closeAllChildren(e.ChildNodes)},i.prototype.closeAllChildren=function(e){if(e)for(var t=0;t<e.length;t++)e[t].IsInCurrentPath||(e[t].IsOpen=!1,this.closeAllChildren(e[t].ChildNodes))},i.prototype.navigate=function(e){this.windowService.history.pushState(null,"",e)},i.prototype.toggleSelectedFaq=function(e){this.selectedQuestion==e?this.selectedQuestion="":this.selectedQuestion=e},i.$inject=["SiteMenuService","PageContentService","PageProviderService","BasketService","smoothScroll","$element","$window","$scope","UtilityService","UserService","FeatureFlagService","DepartmentFrontPageService","CmsFaqService","SiteMenuStateService","StorageService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/SiteMenu/SiteMenu.component.html"},app.component("siteMenu",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){var o=this;this.incomHttp=e,this.pageProviderService=t,this.utilityService=i,this.sitemenuStateService=n,this.baseurl="/umbraco/api/SiteMenu/",this.topMenuLoaded=!1,this.topMenu$=new Rx.BehaviorSubject(null),this.menu$=new Rx.BehaviorSubject(null),this.sideMenu$=new Rx.BehaviorSubject(null),this.sideMenuFaqIntro$=new Rx.BehaviorSubject(null),this.utilityService.isHorizontalTablet.subscribe(function(e){o.isTabletViewOrHigher=e}),this.pageProviderService.getPageByDocumentType("frontPage").then(function(e){return o.frontPage=e}),this.isTabletViewOrHigher||this.sitemenuStateService.openMenu$.subscribe(function(e){e?o.sitemenuStateService.getMenuSection("mainMenu"):o.sitemenuStateService.getMenuSection("")})}(e=e.Ui||(e.Ui={})).SiteMenu||(e.SiteMenu={}),t.prototype.getDepartmentUrl=function(){return this.incomHttp.get(this.baseurl+"GetDepartmentUrl/")},t.prototype.updateMenu=function(e){var t=this.menu$.getValue(),t=this.getMenuNodeBasedOnId(t,e.Id);(t=t||{NodeId:e.Id,IsCompanyPage:"companyFrontPage"==e.DocTypeAlias,IsDepartmentPage:"departmentFrontPage"==e.DocTypeAlias,DocumentTypeAlias:e.DocTypeAlias}).IsDepartmentPage?(this.getMenu(t,this.departmentMenu),this.menu=null):t.IsCompanyPage?(this.getMenu(t,this.companyMenu),this.departmentMenu=null):(this.getMenu(t,this.menu),this.departmentMenu=null,this.companyMenu=null)},t.prototype.getChildrenForMenuItem=function(i){var n=this,o=this.menu$.getValue();i.HasChildren&&0==i.ChildNodes.length?this.incomHttp.get(this.baseurl+"GetChildrenForMenuItem/"+i.NodeId).then(function(e){var t=n.getMenuNodeBasedOnId(o,i.NodeId);t&&(t.ChildNodes.addRange(e),n.menu=o,n.setIsOpen(o,i.NodeId),n.menu$.onNext(o))}):(this.setIsOpen(o,i.NodeId),this.menu$.onNext(o))},t.prototype.getChildrenForSideMenuItem=function(i){var n=this,o=this.sideMenu$.getValue();i.HasChildren&&0==i.ChildNodes.length?this.incomHttp.get(this.baseurl+"GetChildrenForMenuItem/"+i.NodeId).then(function(e){var t=n.getMenuNodeBasedOnId([o],i.NodeId);t&&(t.ChildNodes.addRange(e),n.setIsOpen([o],i.NodeId),n.sideMenu$.onNext(o))}):(this.setIsOpen([o],i.NodeId),this.sideMenu$.onNext(o))},t.prototype.getMenu=function(n,o){var r,s=this,a=(this.topMenuLoaded||this.incomHttp.get(this.baseurl+"GetTopMenu/"+n.NodeId).then(function(e){s.topMenuLoaded=!0,s.topMenu$.onNext(e)}),o),e=(a&&this.resetIsInCurrentPath(a),"companyFrontPage"==n.DocumentTypeAlias||"departmentFrontPage"==n.DocumentTypeAlias||this.frontPage&&n.NodeId==this.frontPage.Id);e||(r=this.getMenuNodeBasedOnId(a,n.ParentId)),!a||!r&&e?this.incomHttp.get(this.baseurl+"GetMainMenu/"+n.NodeId).then(function(e){var t,i;s.sideMenuFaqIntro$.onNext(e.FaqIntro),s.sideMenu$.onNext(e.Nodes.firstOrDefault(function(e){return e.IsInCurrentPath})),a?(t=s.findCurrentPath(e.Nodes.firstOrDefault(function(e){return e.IsInCurrentPath})),i=s.findExistingParent(a,e.Nodes,t),r=s.getMenuNodeBasedOnId(e.Nodes,i.NodeId),i.ChildNodes.addRange(r.ChildNodes),s.setIsInCurrentPath(a,t)):(s.setIsInCurrentPath(a,n),a=e.Nodes),o=a,s.menu$.onNext(a)}):(this.getChildrenForMenuItem(n),this.setIsInCurrentPath(a,n),this.menu$.onNext(a))},t.prototype.getMenuNodeBasedOnId=function(e,t){if(e){var i=e.firstOrDefault(function(e){return e.N
1odeId===t});if(!i)for(var n=0;n<e.length;n++){var o=this.getMenuNodeBasedOnId(e[n].ChildNodes,t);if(o){i=o;break}}return i}},t.prototype.resetIsInCurrentPath=function(e){if(e)for(var t=0;t<e.length;t++)e[t].IsInCurrentPath=!1,this.resetIsInCurrentPath(e[t].ChildNodes)},t.prototype.setIsInCurrentPath=function(e,t){t.IsInCurrentPath=!0,t.IsOpen=!0,0<t.ParentId&&(t=this.getMenuNodeBasedOnId(e,t.ParentId))&&(t.IsInCurrentPath=!0,t.IsOpen=!0,this.setIsInCurrentPath(e,t))},t.prototype.setIsOpen=function(e,t){var i;0<t&&(i=this.getMenuNodeBasedOnId(e,t))&&(i.IsOpen=!0,i.ParentId==this.frontPage.Id&&e.forEach(function(e){e.NodeId!=t&&(e.IsOpen=!1)}),this.setIsOpen(e,i.ParentId))},t.prototype.findExistingParent=function(e,t,i){var n=this.getMenuNodeBasedOnId(e,i.NodeId);if(!n){i=this.getMenuNodeBasedOnId(t,i.ParentId);if(t)return this.findExistingParent(e,t,i)}return n},t.prototype.findCurrentPath=function(e){var t;if(e)return(t=e.ChildNodes.firstOrDefault(function(e){return e.IsInCurrentPath}))?this.findCurrentPath(t):e},t.$inject=["incomHttpService","PageProviderService","UtilityService","SiteMenuStateService"],app.service("SiteMenuService",t)}(BoligExtra=BoligExtra||{}),!function(e){var n,t;function i(e,t,i,n){this.element=e,this.$attributes=t,this.siteMenuStateService=i,this.scope=n,this.disposables=new Rx.CompositeDisposable}e=e.Ui||(e.Ui={}),n=e.Sticky||(e.Sticky={}),i.prototype.$onInit=function(){var t=this,i=(this.win=angular.element(window),angular.element("<div class='sticky-placeholder' />").insertBefore(this.element));this.stickyStyle=this.$attributes.stickyStyle,this.stickyMobile=this.$attributes.stickymobile,this.disposables.add(this.siteMenuStateService.toggleMenuSection$.subscribe(function(e){setTimeout(function(){t.reCalculateWidth()},600)})),this.event=function(){var e;t.item&&(e=t.win.scrollTop(),t.item.state===n.StickyState.Fixed?e<t.item.start?t.clearSticky(i):e+t.item.element.outerHeight(!0)>t.item.elementToStick.offset().top+t.item.elementToStick.outerHeight(!0)&&t.setAbsolute():(e>t.item.start&&t.item.state===n.StickyState.Relative||e+t.item.element.outerHeight(!0)<=t.item.elementToStick.offset().top+t.item.elementToStick.outerHeight(!0)&&t.item.state===n.StickyState.Absolute)&&t.setSticky(i))},this.win.bind("scroll",this.event),this.win.bind("resize",this.event),this.checkTablets=function(){return void 0!==this.stickyMobile||!window.matchMedia("(max-width: 991px)").matches},setTimeout(function(){t.item={element:t.element,elementToStick:$(t.$attributes.stickToElement),state:n.StickyState.Relative,start:t.element.offset().top},t.event()},0)},i.prototype.setSticky=function(e){this&&this.checkTablets()&&this.item&&(e.height(this.element.outerHeight()),this.item.element.addClass(this.stickyStyle),this.item.element.css({position:"fixed",top:(this.item.element.outerHeight(!0)-this.item.element.outerHeight())/2+88}),this.item.state=n.StickyState.Fixed,this.reCalculateWidth())},i.prototype.reCalculateWidth=function(){var e;void 0!==this.$attributes.fullWidth&&(e=this.element.parent().width(),this.item.element.css({width:e+"px"}))},i.prototype.setAbsolute=function(){this.item.element.css({position:"absolute",top:this.item.elementToStick.scrollTop()+this.item.elementToStick.outerHeight(!0)-this.item.element.outerHeight(!0)}),this.item.state=n.StickyState.Absolute},i.prototype.clearSticky=function(e){this.item.state=n.StickyState.Relative,this.item.element.css("position",""),this.item.element.css("top",""),this.item.element.css("width",""),e.height(0),this.item.element.removeClass(this.stickyStyle),this.item.start=this.item.element.offset().top},i.prototype.$onDestroy=function(){this.win.unbind("scroll",this.event),this.win.unbind("resize",this.event),this.disposables.dispose(),this.element.prev(".sticky-placeholder").remove()},i.$inject=["$element","$attrs","SiteMenuStateService","$scope"],t=i,app.directive("stickToElement",function(){return{restrict:"A",controller:t,controllerAs:"$ctrl",scope:{}}})}(BoligExtra=BoligExtra||{}),!function(e){(e=(e=(e=e.Ui||(e.Ui={})).Sticky||(e.Sticky={})).StickyState||(e.StickyState={}))[e.Relative=0]="Relative",e[e.Fixed=1]="Fixed",e[e.Absolute=2]="Absolute"}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.$scope=e,this.$attrs=t,this.$element=i,this.termsService=n,this.disposables=new Rx.CompositeDisposable,this.required=!1}(e=e.Ui||(e.Ui={})).Terms||(e.Terms={}),i.prototype.$onInit=function(){var t=this,e=this.$attrs.isRequired;angular.isUndefined(e)||(this.required=this.$scope.$parent.$eval(e)),this.form=this.$element.controller("form"),this.termsService.getTerms().filter(function(e){return null!==e&&e.any()}).first().subscribe(function(e){e.any(function(e){return e.Alias===t.alias}
1)&&(t.term=e.firstOrDefault(function(e){return e.Alias===t.alias}))}),this.errorText||(this.errorText="Du skal bekræfte din forståelse")},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["$scope","$attrs","$element","TermService"],t=i,e=function(){this.controller=t,this.controllerAs="$term",this.templateUrl="/App/Ui/Terms/Term.component.html",this.require={ngModelCtrl:"^ngModel"},this.bindings={alias:"@",ngModel:"=",errorText:"@"}},app.component("term",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.terms$=new Rx.BehaviorSubject([]),this.baseurl="/umbraco/api/Terms/"}(e=e.Ui||(e.Ui={})).Terms||(e.Terms={}),t.prototype.getTerms=function(){var t=this;return this.termPromise||(this.termPromise=this.incomHttp.get("".concat(this.baseurl,"GetAllTerms")),this.termPromise.then(function(e){t.terms$.onNext(e)})),this.terms$},t.$inject=["incomHttpService","LoaderService"],app.service("TermService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t}e=(e=(e=e.Ui||(e.Ui={})).TextInformation||(e.TextInformation={})).Modals||(e.Modals={}),t.prototype.$onInit=function(){this.text=this.modalData.text},t.$inject=["$uibModalInstance","modalData"],e.TextInformationController=t}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e){this.modalService=e,this.disposables=new Rx.CompositeDisposable}e=e.Ui||(e.Ui={}),t=e.TextInformation||(e.TextInformation={}),n.prototype.$onInit=function(){},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.viewText=function(){var e={text:this.text};this.modalService.createModal("/App/Ui/TextInformation/Modals/TextInformation.modal.html",t.Modals.TextInformationController,e,"md")},n.$inject=["ModalService"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/TextInformation/TextInformationButton.component.html",this.bindings={text:"<",buttonTooltip:"<"}},app.component("textInformationButton",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o,r){this.pageContentService=e,this.siteMenuService=t,this.pageProviderService=i,this.utilityService=n,this.windowService=o,this.scope=r,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).TopMenu||(e.TopMenu={}),i.prototype.$onInit=function(){function t(){i.currentPage&&i.topMenu&&i.topMenu.forEach(function(t){t.IsInCurrentPath=i.currentPage.Path.any(function(e){return e.Id===t.NodeId})})}var i=this;this.siteMenuService.topMenuLoaded=!1;this.pageProviderService.getPageByDocumentType("login").then(function(e){i.loginPage=e}),this.pageProviderService.getPageByDocumentType("myPageFrontPage").then(function(e){i.myPage=e,i.disposables.add(i.siteMenuService.topMenu$.subscribe(function(e){e&&(i.topMenu=e,i.topMenu.any(function(e){return e.NodeId===i.myPage.Id})&&(i.topMenu=i.topMenu.filter(function(e){return e.NodeId!==i.myPage.Id})),t())}))}),this.disposables.add(this.pageContentService.currentPage$.subscribe(function(e){i.currentPage=e,t()})),this.utilityService.isHorizontalTablet.subscribe(function(e){i.isTabletOrHigher=e,i.utilityService.safeDigest(i.scope)})},i.prototype.navigate=function(e){this.windowService.history.pushState(null,"",e)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["PageContentService","SiteMenuService","PageProviderService","UtilityService","$window","$scope"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/TopMenu/TopMenu2/TopMenu2.component.html",this.bindings={}},app.component("topMenu",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e){this.tutorialService=e,this.disposables=new Rx.CompositeDisposable}(e=e.Ui||(e.Ui={})).Tutorial||(e.Tutorial={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.tutorialService.tutorial$.subscribe(function(e){e=e.firstOrDefault(function(e){return e.Alias===t.action});e&&(t.tutorialText=e.Content,t.active=!0,t.tutorialService.removeTutorialAction(t.action))}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.close=function(){this.doNotShowAgain&&this.tutorialService.doNotShowAgain(this.action),this.doNotShowAnyTutorialsForThisSession&&this.tutorialService.hideAllTutorialsForSession(),this.active=!1},i.$inject=["TutorialService"],t=i,e=function(){this.controller=t,this.controllerAs="tutorial",this.templateUrl="/App/Ui/Tutorial/Tutorial.component.html",this.bindings={action:"@",orientation:"@"},this.transclude=!0},app.component("tutorial",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.$localStorage=t,this.$sessionStorage=i,this.tutorial$=new Rx.BehaviorSubject([])}(e=e.Ui||(e.Ui={})).Tutorial||(e.Tutorial={}),t.prototype.triggerTutorialForAction=function(t){var i,e,n=this;this.$sessionStorage.hideAllTutorials||(i=this.tutorial$.getValue(),e=this.getEntriesToNotShowAgain(),i.some(function(e){return e.Alias===t}))||e.contains(t)||this.$http.get("/Umbraco/api/Tutorial/GetTutorial?alias="+t).then(function(e){i.push(e),n.tutorial$.onNext(i)})},t.prototype.removeTutorialAction=function(t){var e=this.tutorial$.getValue();e.some(function(e){return e.Alias===t})&&(e.remove(e.firstOrDefault(function(e){return e.Alias===t})),this.tutorial$.onNext(e))},t.prototype.doNotShowAgain=function(e){var t=this.$localStorage.tutorialEntriesToNotShowAgain||[];t.push(e),this.$localStorage.tutorialEntriesToNotShowAgain=t},t.prototype.getEntriesToNotShowAgain=function(){return this.$localStorage.tutorialEntriesToNotShowAgain||[]},t.prototype.hideAllTutorialsForSession=function(){this.$sessionStorage.hideAllTutorials=!0},t.$inject=["incomHttpService","$localStorage","$sessionStorage"],app.service("TutorialService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t,i;function n(e){this.modalService=e,this.disposables=new Rx.CompositeDisposable}e=e.Utility||(e.Utility={}),t=e.AccessLevel||(e.AccessLevel={}),n.prototype.$onInit=function(){},n.prototype.$onDestroy=function(){this.disposables.dispose()},n.prototype.upgradeLoginLevel=function(){this.modalService.createModal("/App/Utility/AccessLevel/Modal/AccessModal.modal.html",t.Modal.AccessModalLoginController,{accessLevel:this.level},"md").result.then(function(){})},n.$inject=["ModalService"],i=n,e=function(){this.controller=i,this.controllerAs="$ctrl",this.templateUrl="/App/Utility/AccessLevel/AccessLevelLogin.component.html",this.bindings={level:"<"}},app.component("accessLevelLogin",new e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n,o){this.accessLevelService=e,this.pageContentService=t,this.$element=i,this.$scope=n,this.$compile=o}(e=e.Utility||(e.Utility={})).AccessLevel||(e.AccessLevel={}),i.prototype.$onInit=function(){var t=this;this.$element.hide(),this.pageContentService.currentPage$.subscribe(function(e){return t.loginAccessLevel=e.LoginAccessLevel})},i.prototype.$onChanges=function(){var t=this;this.accessLevel?this.accessLevelService.getAccessLevel(this.accessLevel).then(function(e){t.loginAccessLevel<e.AccessLevel&&(t.$element.children().remove(),t.$element.append(t.$compile("<access-level-login level="+e.AccessLevel+">")(t.$scope.$new(!0)))),t.$element.show()}):this.$element.show()},i.prototype.$onDestroy=function(){},i.$inject=["AccessLevelService","PageContentService","$element","$scope","$compile"],t=i,app.directive("accessLevel",function(){return{restrict:"A",controller:t,scope:{},bindToController:{accessLevel:"<"}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.accessLevels={},this.baseurl="/umbraco/api/AccessLevel/"}(e=e.Utility||(e.Utility={})).AccessLevel||(e.AccessLevel={}),t.prototype.getAccessLevel=function(e){return this.accessLevels[e]||(this.accessLevels[e]=this.incomHttp.get(this.baseurl+"GetByAlias?Alias="+e)),this.accessLevels[e]},t.$inject=["incomHttpService","LoaderService"],app.service("AccessLevelService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$modalInstance=e,this.featureFlagService=i,this.accessLevel=t.accessLevel,this.mitIdIsEnabled=this.featureFlagService.mitIdFeatureFlags.enableMitIdLogin,this.nemIdIsEnabled=this.featureFlagService.loginFeatureFlags.enableNemId,this.useExternalSwitcher=this.featureFlagService.externalIdFeatureFlags.enableLoginSwitcher}
1e=(e=(e=e.Utility||(e.Utility={})).AccessLevel||(e.AccessLevel={})).Modal||(e.Modal={}),t.prototype.loggedInWithNemId=function(e){"ok"==e.Result&&this.$modalInstance.dismiss()},t.$inject=["$uibModalInstance","modalData","FeatureFlagService"],e.AccessModalLoginController=t}(BoligExtra=BoligExtra||{}),!function(e){e=e.Utility||(e.Utility={});e.Animations||(e.Animations={}),app.animation(".anim-slide",function(){return{addClass:function(e,t,i){var n=(n=e.attr("anim-slide-duration"))?parseInt(n,10):400;"ng-hide"===t?e.slideUp(n,i):i()},removeClass:function(e,t,i){var n=(n=e.attr("anim-slide-duration"))?parseInt(n,10):400;"ng-hide"===t?e.hide().slideDown(n,i):i()}}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.awsService=e,this.scope=t,this.validationService=i,this.selectedAddressIndex=0,this.selectedZipCityIndex=0,this.disposables=new Rx.CompositeDisposable,this.zipCities=[],this.addresses=[],this.whiteLabels=!1}(e=e.Utility||(e.Utility={})).Aws||(e.Aws={}),i.prototype.$onInit=function(){var e=this;this.scope.$watch(function(){return e.address},function(){e.createAddress()}),this.addressRegEx=this.validationService.getAddressRegex(),this.fullAddress||(this.fullAddress={}),null==this.doValidate&&(this.doValidate=!0),null==this.isRequired&&(this.isRequired=!0)},i.prototype.$onChanges=function(){this.fullAddress&&(this.zipCity="".concat(this.fullAddress.ZipCode||""," ").concat(this.fullAddress.City||"").trim(),this.zipCode=this.fullAddress.ZipCode,this.city=this.fullAddress.City,this.address="".concat(this.fullAddress.Street||""," ").concat(this.fullAddress.Location||"").trim())},i.prototype.isZipCitySelected=function(e){return e===this.selectedZipCityIndex},i.prototype.updateZipCitySelection=function(e){switch(e.which){case 38:0<this.selectedZipCityIndex&&this.selectedZipCityIndex--;break;case 40:this.selectedZipCityIndex<this.zipCities.length-1&&this.selectedZipCityIndex++;break;case 13:this.setZipCity(this.zipCities[this.selectedZipCityIndex]),e.preventDefault()}},i.prototype.isAddressSelected=function(e){return e===this.selectedAddressIndex},i.prototype.searchZipCode=function(e){var t=this;(angular.isNumber(e)&&0<e||angular.isString(e)&&0<e.length)&&(this.addresses=[],this.selectedZipCityIndex=0,this.awsService.searchZipCity(e).subscribe(function(e){t.zipCities=e,1===t.zipCities.length&&t.setZipCity(t.zipCities[0])}))},i.prototype.searchHouseNumber=function(e,t){var o=this;this.addresses=[],this.address=t?e+" "+t:e,this.awsService.searchHouseNumber(this.zipCity,e,t).subscribe(function(e){for(var t=JSON.parse(JSON.stringify(e)),i=t.length-1;0<=i;i--){var n=t[i].tekst.lastIndexOf(","),n=t[i].tekst.substring(0,n);t[i].tekst=n,t[i].tekst===o.address&&t.splice(i,1)}o.addresses=t})},i.prototype.setZipCity=function(e){this.zipCode=e.postnummer.nr,this.city=e.postnummer.navn,this.address=null,this.zipCities=[],this.zipCity=e.tekst,this.scope.form.zipCode.$setPristine()},i.prototype.setFullAddress=function(e){this.selectedAddressIndex=0,this.address=e.tekst;var t=e.tekst.indexOf(" "),i=-1<t?e.tekst.substring(0,t):e.tekst,e=-1<t?e.tekst.substring(t+1):"";this.searchHouseNumber(i,e),this.createAddress()},i.prototype.returnAddress=function(){var e;"Danmark"!==this.country&&this.fullAddress.City&&this.fullAddress.ZipCode&&this.fullAddress.Location&&this.fullAddress.Street&&(e={City:this.fullAddress.City,ZipCode:this.fullAddress.ZipCode,Location:this.fullAddress.Location,Street:this.fullAddress.Street},this.callbackFn({addressViewModel:e}))},i.prototype.createAddress=function(){var e,t,i;this.address&&(i=void 0,e=this.address.lastIndexOf(","),t=this.address.substring(e,this.address.length),t=this.hasNumber(t)||t.search("st.")||t.search("th")||t.search("tv")?(e=this.address.indexOf(" "),this.address.substring(e,this.address.length)):(i=this.address.substring(e,this.address.length),t=e,e=this.address.indexOf(" "),this.address.substring(e,t)),i={City:this.city,ZipCode:this.zipCode,LocalTown:i,Location:t,Street:this.address.substring(0,e)},this.fullAddress&&(this.fullAddress.City=i.City,this.fullAddress.ZipCode=i.ZipCode,this.fullAddress.LocalTown=i.LocalTown,this.fullAddress.Location=i.Location,this.fullAddress.Street=i.Street),this.callbackFn({addressViewModel:i}))},i.prototype.validate=function(){this.createAddress()},i.prototype.hasNumber=function(e){return/\d/.test(e)},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.$inject=["AwsService","$scope","ValidationService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Utility/Aws/Aws.component.html",this.bindings={callbackFn:"&",country:"<",fullAddress:"<",isDisabled:"<",doValidate:"<",whiteLabels:"<",isRequired:"<"}},app.component("aws",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$http=e,this.$sce=t,this.apiBase="https://api.dataforsyningen.dk/"}
1(e=e.Utility||(e.Utility={})).Aws||(e.Aws={}),t.prototype.searchZipCity=function(e){var t=new Rx.ReplaySubject,e=this.$sce.trustAsResourceUrl(this.apiBase+"postnumre/autocomplete?q="+e);return this.updateStreamWithAwsResult(e,t),t},t.prototype.searchAddress=function(e,t){var i=new Rx.ReplaySubject;return e&&t&&(t=this.$sce.trustAsResourceUrl("".concat(this.apiBase,"vejnavne/autocomplete?q=").concat(t,"&postnr=").concat(e.substring(0,4))),this.updateStreamWithAwsResult(t,i)),i},t.prototype.searchHouseNumber=function(e,t,i){var n,o=new Rx.ReplaySubject;return t&&e?(n=void 0,n=i?this.$sce.trustAsResourceUrl("".concat(this.apiBase,"adresser/autocomplete?q=").concat(t," ").concat(i,"&postnr=").concat(e.substring(0,4))):this.$sce.trustAsResourceUrl("".concat(this.apiBase,"adgangsadresser/autocomplete?vejnavn=").concat(t,"&postnr=").concat(e.substring(0,4))),this.updateStreamWithAwsResult(n,o)):o.onCompleted(),o},t.prototype.updateStreamWithAwsResult=function(e,t){this.$http.get(e,{cache:!0}).then(function(e){e.data&&t.onNext(e.data),t.onCompleted()})},t.$inject=["$http","$sce"],app.service("AwsService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;e=e.Utility||(e.Utility={}),t=e.FeatureFlag||(e.FeatureFlag={}),app.service("FeatureFlagService",function(){this.companyRoom={enableGiro:!1},this.consents={showMissingConsentList:!1},this.fileArchive={openInitialFolder:!1,showUpdatedDate:!1,showCreatedDate:!1},this.newsletter={canPickContentFeatureFlag:!0,consentGroupEnabledFeatureFlag:!1,showPreviewBeforeSendFeatureFlag:!1,enableTemplateCreationFeatureFlag:!1,enableSeeingReports:!1,enablePotentialSubscriberMail:!1},this.departmentSelectorSearchFlags={checkAddresses:!0,checkDepartmentAddress:!0,checkDepartmentName:!0,checkDepartmentNumber:!0},this.content={allowScriptsInSource:!1},this.maps={enablePoi:!1},this.payment={enableGiro:!0},this.communication={smsSignup:!1},this.tenancyPresentationLabels={enableLabels:!0},this.offers={enableOfferAcceptConfirmation:!0,enableOfferDeclineConfirmation:!0,enableEditInProgress:!1,enablePersonalInfo:!0,enableStatistics:!0,hideInProgressTab:!1},this.pdfOpening={enablePdfToOpenInNewTab:!1},this.inComForms={useBrowserPdfVersion:!1},this.displayDeposits={displayDeposits:!0},this.tenancySearchCriterias={disableSplitHousingTypes:!1,enableshowOnlyTenanciesWithAssignmentRulesCheckbox:!0,departmentsPerPage:10}
1,this.signUp={displayOfferDeliveryModeOptions:!0,displayPartnerInfo:!0,showWarningOnActiveMembershipWithNoTenanciesInBasket:!1},this.siteMenu={enablePremiumSiteMenu:!0,enablePushingSiteMenu:!0,enableDisplayOfEmail:!1,enableDisplayOfPhoneNumber:!1,enableFaq:!0},this.profile={DisableEditingOfAmountOfAdults:!1,EnableAvatarViewOnForumAndProfile:!1},this.availableTenancies={imageSource:t.AvailableTenancyImageSource.DepartmentImagesFallback,enableTenancyPresenationInfo:!1,displayLinktoDepartment:!1,displayDeposit:!1,displayCity:!1,displayZipcode:!1,amountOfTenanciesToBeShown:null,treatAvailableTenanciesLikeStandardTenancies:!1,displayAvailableFromPill:!0,displayLinkToAvailableTenanciesPage:!1},this.displayFallbackImages={displayImageFallback:!1},this.passwordFeatureFlags={EnableShowPassword:!1},this.loginFeatureFlags={enableFacebook:!1,enableNemId:!1,enableRememberMeCheckbox:!1,allowEmptyPhoneForUsers:!1,hideNemIdLoginButton:!0},this.mitIdFeatureFlags={enableMitIdLogin:!0,useMitIdButtonColor:!1,useMitIdIconColor:!1,useMitIdLoginBox:!1,useMitIdIconInButton:!1,hideMitIdLoginButton:!1},this.externalIdFeatureFlags={enableLoginSwitcher:!1},this.frontEndEdit={enableProjectPresentation:!0},this.webDok={displayCategoryName:!1},this.frontpageBanner={displayLoginBox:!0},this.departmentPages={displayMultipleDepartmentDescriptions:!0,displayDepartmentBoardPeriods:!0,hideTenanciesAndTenancySearchButtons:!1,hideDepartmentIdText:!1,hideDepartmentPresentationPersonnelEmail:!1,hideDepartmentPresentationPersonnelPhone:!1,showDepartmentDistances:!1},this.regulations={ShowMaintenanceRegulations:!1,ShowHouseRulesRegulations:!1,ShowRightOfWayCatalogsRegulations:!1},this.catalogFlags={enableCatalog:!0,enableDepartmentCatalog:!0},this.boardInquiries={hidePreviouslySentInquiries:!1},this.tenancySearchPage={hideAddAllTenancysToBasketButton:!1},this.accountStatements={onlyShowPeriodsForCurrentAndLastYear:!1},this.rentPayment={separateDebtsFromNextRent:!1}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.feedbackService=e,this.$attrs=t,this.$timeout=i,this.feedbackItems=[]}(e=e.Utility||(e.Utility={})).Feedback||(e.Feedback={}),i.prototype.$onInit=function(){var t=this;this.feedbackSubscription=this.feedbackService.feedback$.subscribe(function(e){t.feedbackItems.addRange(e),t.feedbackItems.forEach(function(e){0<e.DurationInMilliseconds&&t.$timeout(function(){t.dismiss(e)},e.DurationInMilliseconds)})})},i.prototype.$onDestroy=function(){this.feedbackSubscription.dispose()},i.prototype.dismiss=function(e){this.feedbackItems.remove(e)},i.$inject=["FeedbackService","$attrs","$timeout"],t=i,e=function(){this.controller=t,this.templateUrl="/App/Utility/Feedback/Feedback.component.html",this.bindings={type:"@"}},app.component("feedback",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$q=e,this.feedback$=new Rx.BehaviorSubject([])}(e=e.Utility||(e.Utility={})).Feedback||(e.Feedback={}),t.prototype.registerFeedbackItems=function(e){e&&e.any()&&this.feedback$.onNext(e)},t.prototype.showConfirmbox=function(e){var t=this.$q.defer();return confirm(e.Headline)?t.resolve():t.reject(),t.promise},t.$inject=["$q"],app.service("FeedbackService",t)}(BoligExtra=BoligExtra||{}),!function(e){var s,i;function t(e,t,i,n,o){this.incomHttp=e,this.loaderService=t,this.$q=i,this.featureFlagService=n,this.browser=o,this.enablePdfToOpenInNewTab=!1,this.enablePdfToOpenInNewTab=this.featureFlagService.pdfOpening.enablePdfToOpenInNewTab}s=e.Utility||(e.Utility={}),i=s.File||(s.File={}),t.prototype.toUploadedFile=function(e,t){void 0===t&&(t=i.UploadedFileType.File);e={file:e,metadata:{DisplayDate:new Date(e.lastModified),FileName:e.name.substring(0,e.name.lastIndexOf(".")),Extension:e.name.substring(e.name.lastIndexOf(".")+1),UploadedFileType:t,Title:"",Description:""},icon:null};return e.icon=this.getFileIconClass(e.metadata.Extension),e},t.prototype.downloadMediasAsZip=function(e,t){var i=this;this.incomHttp.post("/umbraco/Api/File/DownloadMediasAsZip",{ZipName:t,MediaIds:e}).then(function(e){return i.downloadFile([e])})},t.prototype.postWithFiles=function(t,i,e){function n(e){return o.incomHttp.post(i+e||"",t).then(function(e){r.resolve(e),o.loaderService.removeLoader(s)},function(e){r.reject(e),o.loaderService.removeLoader(s)})}var o=this,r=this.$q.defer(),s=this.loaderService.setLoader("contentSection","postFiles");return e&&0<e.length?this.incomHttp.postFiles("/umbraco/Api/File/PrepareFiles",e).then(n):n(null),r.promise},t.prototype.getFileIconClass=function(e){var t=e.lastIndexOf(".");
1switch((e=-1<t?e.substring(t+1,e.length):e).toLocaleLowerCase()){case"pdf":return"fa-file-pdf";case"doc":case"docx":return"fa-file-word";case"xls":case"xlsx":return"fa-file-excel";case"zip":case"rar":case"7z":return"fa-file-archive";case"jpg":case"jpeg":case"png":case"bmp":case"gif":return"fa-file-image";case"mp3":case"wma":return"fa-file-audio";case"mp4":case"avi":case"mov":return"fa-file-video";case"txt":return"fa-file-alt";case"ppt":case"pptx":return"fa-file-powerpoint";default:return"fa-file"}},t.prototype.downloadFile=function(e){for(var t=this.browser()===s.Browser.Safari,i=0;i<e.length;i++){e[i].Extension&&e[i].Extension.startsWith(".")&&(e[i].Extension=e[i].Extension.replace(".","")),e[i].Name||(e[i].Name="");var n=atob(e[i].Data.toString()),n=this.getByteArrayForFile(n),o=e[i].Extension,n=("xlsx"===o&&(o="octet-stream"),new Blob(n,{type:"application/".concat(o)}));if(window.navigator.msSaveOrOpenBlob){var r=e[i].Name+"."+e[i].Extension;window.navigator.msSaveBlob(n,r)}else{r=window.document.createElement("a");if(r.href=window.URL.createObjectURL(n),r.download=e[i].Name+"."+e[i].Extension,!t&&this.enablePdfToOpenInNewTab&&"pdf"===o.toLocaleLowerCase())return void window.open(r.href,"_blank");document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}}},t.prototype.convertExcelToJson=function(e){e=this.toUploadedFile(e);return this.postWithFiles(null,"/umbraco/Api/File/ConvertXMLToJson/",[e])},t.prototype.getByteArrayForFile=function(e){for(var t=[],i=0;i<e.length;i+=512){for(var n=e.slice(i,i+512),o=new Array(n.length),r=0;r<n.length;r++)o[r]=n.charCodeAt(r);var s=new Uint8Array(o);t.push(s)}return t},t.prototype.attachThumbnail=function(t,i){var e=new FileReader;e.onload=function(e){i.$apply(function(){t.thumbnail=e.target.result})},e.readAsDataURL(t.file)},t.$inject=["incomHttpService","LoaderService","$q","FeatureFlagService","getBrowser"],app.service("FileService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.$scope=e,this.attributes=t,this.element=i}(e=e.Utility||(e.Utility={})).File||(e.File={}),i.prototype.$onInit=function(){var o=this;this.element[0]&&this.element.bind("change",function(e){for(var t,i=e.target,n=0;t=i.files[n];n++){if(!angular.isArray(o.$scope.fileread)){o.$scope.fileread=t;break}o.$scope.fileread.push(t)}o.$scope.$apply()})},i.$inject=["$scope","$attrs","$element"],t=i,app.directive("fileread",function(){return{restrict:"A",controller:t,scope:{fileread:"="}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i){this.$http=e,this.fileService=t,this.loaderService=i,this.baseUrl="/Umbraco/api/HtmlToPdf/"}(e=e.Utility||(e.Utility={})).File||(e.File={}),t.prototype.createPdf=function(e,t,i,n){void 0===n&&(n="");i=this.handlePdfCssTexts(i=void 0===i?[]:i),n=n||"",e=this.handlePdfElementContent(e);return this.makePdf(i,n,e,t)},t.prototype.downloadPdf=function(e,t,i,n){void 0===n&&(n="");i=this.handlePdfCssTexts(i=void 0===i?[]:i),n=n||"",e=this.handlePdfElementContent(e);this.makeAndDownloadPdf(i,n,e,t)},t.prototype.handlePdfCssTexts=function(e){void 0===e&&(e=[]);for(var t=angular.element("link"),i="",n=0;n<t.length;n++)i+=t[n].outerHTML;for(var o=angular.element("style"),n=0;n<o.length;n++)i+=o[n].outerHTML;if(e)for(var r=0;r<e.length;r++)i+=e[r];return i},t.prototype.handlePdfElementContent=function(e){for(var e=angular.copy(angular.element(e)),t=e.find("textarea"),i=e.find(".no-pdf"),n=0;n<i.length;n++)i.remove();for(var o=0;o<t.length;o++)$("<p></p>").html(this.htmlForTextWithEmbeddedNewlines(t[o].value)).addClass("pdfTextArea").insertAfter(t[o]),t[o].remove();for(var r=e.find(".custom-radio input[type='radio']"),o=0;o<r.length;o++)$(r[o]).addClass("custom-radio-display");for(r=e.find(".custom-radio input[type='radio']:checked"),o=0;o<r.length;o++)$(r[o]).attr("checked","");this.addCustomCheckboxBackgroundImage(e);for(var s=e.find("input[type='text']"),a=0;a<s.length;a++)s[a].outerHTML=s[a].outerHTML.slice(0,-1)+' value="'+s[a].value+'">';return e.html()},t.prototype.htmlForTextWithEmbeddedNewlines=function(e){for(var t=[],i=e.split(/\n/),n=jQuery(document.createElement("div")),o=0;o<i.length;o++)t.push(n.text(i[o]).html());return t.join("<br>")}
1,t.prototype.addCustomCheckboxBackgroundImage=function(e){for(var t=e.find(".custom-checkbox input[type='checkbox'] + span"),i=0;i<t.length;i++){var n=t[i].outerHTML;t[i].outerHTML=n.substr(0,n.indexOf(">"))+' style="background: url(/images/checkbox-unchecked.png) no-repeat !important">'+n.substr(n.indexOf(">")+1)}for(t=e.find(".custom-checkbox input[type='checkbox']:checked + span"),i=0;i<t.length;i++){n=t[i].outerHTML;t[i].outerHTML=n.substr(0,n.indexOf("url"))+'url(/images/checkbox-checked.png) no-repeat !important">'+n.substr(n.indexOf(">")+1)}},t.prototype.makePdf=function(e,t,i,n){n={BaseUrl:window.location.origin,Name:n,Content:"".concat(e,"<div class='col-md-12'><div class='row' style='display: block; margin: 0 auto;'> <div class='budget-field'><h3>").concat(t,"</h3>").concat(i,"</div></div></div>")};return this.$http.post("".concat(this.baseUrl,"/PreparePdf"),n)},t.prototype.makeAndDownloadPdf=function(e,t,i,n){var o,r=this,n={BaseUrl:window.location.origin,Name:n,Content:"".concat(e,"<div class='col-md-12'><div class='row' style='display: block; margin: 0 auto;'> <div class='budget-field'><h3>").concat(t,"</h3>").concat(i,"</div></div></div>")};this.$http.post("".concat(this.baseUrl,"/PreparePdf"),n).then(function(e){o=e.replace(/"/g,""),r.$http.get("".concat(r.baseUrl,"/GetPdf/").concat(o)).then(function(e){r.fileService.downloadFile([e])})})},t.$inject=["incomHttpService","FileService","LoaderService"],app.service("HtmlToPdfService",t)}(BoligExtra=BoligExtra||{}),app.filter("dateRange",function(){return function(e,t,i){var n=[],o=Date.parse(t),r=Date.parse(i);return angular.forEach(e,function(e){var t=Date.parse(e.SentDateTime);o<=t&&t<=r&&n.push(e),!e.SentDateTime&&i.isToday()&&n.push(e)}),n}}),!function(e){function t(){}(e=e.Utility||(e.Utility={})).Forms||(e.Forms={}),t.prototype.clearFields=function(e){for(var t=Object.keys(e).filter(function(e){return 0!==e.indexOf("$")}),i=0;i<t.length;i++){var n=e[t[i]];if(n.$viewValue=void 0,n.$modelValue=void 0,n.$$element)for(var o=0;o<n.$$element.length;o++)"textarea"===n.$$element[o].type&&(n.$$element[o].value="");if(n.$$controls)for(var r=0;r<n.$$controls.length;r++)n.$$controls[r].$viewValue=void 0;n.$setPristine(),n.$setUntouched()}e.$setPristine(),e.$setUntouched()},app.service("FormService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t,i,n){this.$q=e,this.$http=t,this.feedbackService=i,this.$rootScope=n,this.wasRedirected=!1}e.Utility||(e.Utility={}),t.prototype.resolveHttpPromise=function(e,i){var n=this,o=(void 0===i&&(i=!1),this.$q.defer());return e.then(function(t){var e;200===t.status&&(t.data?(i||n.feedbackService.registerFeedbackItems(t.data.FeedbackList),t.data.RedirectUrl&&(e=new RegExp("^(((http|https)://)?((www).)?"+window.location.hostname+".|/)","gmi").test(t.data.RedirectUrl),t.data.PreventReload&&e?(n.wasRedirected=!0,setTimeout(function(e){window.history.replaceState({},"",t.data.RedirectUrl)},t.data.RedirectDelay),o.resolve(t.data.Data),n.$rootScope.$applyAsync()):setTimeout(function(e){location.replace(t.data.RedirectUrl)},t.data.RedirectDelay)),t.data.RedirectExternalUrl&&(-1===t.data.RedirectExternalUrl.indexOf("http://")&&-1===t.data.RedirectExternalUrl.indexOf("https://")&&(t.data.RedirectExternalUrl="http://".concat(t.data.RedirectExternalUrl)),setTimeout(function(e){return location.href=t.data.RedirectExternalUrl},t.data.RedirectDelay)),t.data&&t.data.Data&&n.isItemCurrentPageViewModel(t.data.Data)&&(t.data.Data.WasRedirected=n.wasRedirected,n.wasRedirected=!1),o.resolve(t.data.Data)):o.resolve(t.data))},function(e){o.reject(e);n.feedbackService.registerFeedbackItems([{CssClass:"error",DurationInMilliseconds:0,Headline:"Der opstod en fejl!",Message:"Der opstod en fejl med din forespørgsel"}])}),o.promise},t.prototype.isItemCurrentPageViewModel=function(e){return void 0!==e.PreventLoad&&void 0!==e.WasRedirected},t.prototype.get=function(e,t){return this.resolveHttpPromise(this.$http.get(e,t),t&&t.suppressFeedback)},t.prototype.post=function(e,t,i){return this.resolveHttpPromise(this.$http.post(e,t,i),i&&i.suppressFeedback)},t.prototype.patch=function(e,t,i){return this.resolveHttpPromise(this.$http.patch(e,t,i),i&&i.suppressFeedback)},t.prototype.put=function(e,t,i){return this.resolveHttpPromise(this.$http.put(e,t,i),i&&i.suppressFeedback)},t.prototype.delete=function(e,t){return this.resolveHttpPromise(this.$http.delete(e,t),t&&t.suppressFeedback)},t.prototype.postFiles=function(e,t){for(var i=new FormData,n=0;n<t.length;n++)i.append("file".concat(n),t[n].file),i.append("fileData".concat(n),JSON.stringify(t[n].metadata));var o={transformRequest:angular.identity,headers:{"Content-Type":void 0}};return this.resolveHttpPromise(this.$http.post(e,i,o))},t.$inject=["$q","$http","FeedbackService","$rootScope"],app.service("incomHttpService",t)}(BoligExtra=BoligExtra||{}),!function(e){var n;function t(){this.loader$=new Rx.BehaviorSubject([])}e=(e=e.Utility||(e.Utility={})).Loader||(e.Loader={}),n=function(e,t){this.alias=e,this.area=t},e.LoaderInstance=n,t.prototype.getLoaderInstances=function(t){return this.loader$.getValue().where(function(e){return e.area===t})},t.prototype.setLoader=function(e,t){var i=this.getLoaderInstances(e).firstOrDefault(function(e){return e.alias===t});
1return i||(i=new n(t,e),this.loader$.getValue().add(i),this.loader$.onNext(this.loader$.getValue())),i},t.prototype.removeLoader=function(e){e&&this.loader$.getValue().remove(e)&&this.loader$.onNext(this.loader$.getValue())},e=t,app.service("LoaderService",e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.loaderService=e,this.attributes=t,this.element=i}(e=e.Utility||(e.Utility={})).Loader||(e.Loader={}),i.prototype.$onInit=function(){var l=this;this.loaderSubscription=this.loaderService.loader$.subscribe(function(e){var t=l.attributes.loaderArea,i=l.attributes.size,n=l.attributes.loaderPlacementTop,o=0<$(l.element).parents("[class*='loading-']").length,r=$(l.element).children().find("[class*='loading-']");if(!o)if(e.any(function(e){return e.area===t})){if(r[0])for(var s=r[0].classList.length-1;0<=s;s--)(a=r[0].classList[s]).startsWith("loading-")&&r.removeClass(a);o="loading-"+(i||"md");void 0!==n&&l.element[0].classList.add("loading-top"),l.element[0].classList.contains(o)||l.element[0].classList.add(o)}else for(var a,s=l.element[0].classList.length-1;0<=s;s--)(a=l.element[0].classList[s]).startsWith("loading-")&&l.element.removeClass(a)})},i.prototype.$onDestroy=function(){this.loaderSubscription.dispose()},i.$inject=["LoaderService","$attrs","$element"],t=i,app.directive("loaderArea",function(){return{restrict:"A",controller:t,scope:{},bindToController:{}}})}(BoligExtra=BoligExtra||{}),!function(e){var t,n;function i(e,t,i,n,o,r,s){this.$scope=e,this.element=t,this.foliaService=i,this.$templateCache=n,this.$compile=o,this.$timeout=r,this.featureFlagService=s,this.markerConstraints=[],this.bounds=new google.maps.LatLngBounds,this.markers=[]}(e=(e=e.Utility||(e.Utility={})).Location||(e.Location={})).GoogleMaps||(e.GoogleMaps={}),i.prototype.$onInit=function(){var e=this,t=(this.infoboxtemplate=this.$templateCache.get((new n).templateUrl),(this.mapViewModel.firstOrDefault()||{}).Lat||55.341622),i=(this.mapViewModel.firstOrDefault()||{}).Lng||11.193363;this.markerConstraints.push(new google.maps.LatLngBounds({lng:8,lat:54.5},{lng:12.81,lat:57.76})),this.markerConstraints.push(new google.maps.LatLngBounds({lng:14.67,lat:54.97},{lng:15.2,lat:55.3})),this.defaultCenter=new google.maps.LatLng(t,i),this.zoom=parseInt(this.maxInitialZoom),isNaN(this.zoom)&&(this.zoom=13),this.$timeout(function(){e.instantiateMap(),e.addMarkers()},100)},i.prototype.$onChanges=function(e){e.mapViewModel&&this.map&&this.addMarkers()},i.prototype.$onDestroy=function(){google.maps.event.clearInstanceListeners(this.map),google.maps.event.clearInstanceListeners(document)},i.prototype.getInfoBox=function(e){var t,i=this.$scope.$new(!0);for(t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);var n=this.$compile(this.infoboxtemplate),n=jQuery("<div />").append(n(i))[0];return new google.maps.InfoWindow({content:n,disableAutoPan:!1})},i.prototype.instantiateMap=function(){this.streetviewEnabled||(this.streetviewEnabled=!1),this.htmlElement=this.element[0].parentElement,this.map=new google.maps.Map(this.htmlElement,{center:this.defaultCenter,mapTypeId:google.maps.MapTypeId.ROADMAP,keyboardShortcuts:!1,zoomControl:!0,clickableIcons:!0,streetViewControl:this.streetviewEnabled,zoom:this.zoom||15,gestureHandling:"cooperative"}),this.featureFlagService.maps.enablePoi&&(this.foliaEnabled&&this.foliaService.setupFolia(this.map),this.cluster=new MarkerClusterer(this.map,[],{imagePath:"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",maxZoom:17}))},i.prototype.removeMarkers=function(){for(;0<this.markers.length;)this.markers[0].setMap(null),this.markers.splice(0,1)},i.prototype.addMarkers=function(){var o=this;if(this.mapViewModel){this.featureFlagService.maps.enablePoi&&(this.cluster.setMap(null),this.cluster.clearMarkers()),this.removeMarkers(),this.bounds=new google.maps.LatLngBounds;for(var t,r=this,e=0;e<this.mapViewModel.length;e++)!function(e){var e=r.mapViewModel[e],t=new google.maps.LatLng(e.Lat,e.Lng);if(!r.markerConstraints.some(function(e){return e.contains(t)}))return;var i={position:t,icon:r.markerIcon||"/images/Google/maps/marker.png",map:r.map},n=(e.InfoBox&&(i.infobox=r.getInfoBox(e.InfoBox)),new google.maps.Marker(i));e.InfoBox&&n.addListener("click",function(){o.infoBox&&(o.infoBox.close(),o.infoBox===n.infobox)?o.infoBox=null:(n.infobox.open(o.map,n),o.infoBox=n.infobox)}),r.bounds.extend(t),r.markers.push(n),r.featureFlagService.maps.enablePoi&&r.cluster.addMarker(n)}(e);this.map&&0<this.markers.length?(this.map.fitBounds(this.bounds),t=google.maps.event.addListener(this.map,"bounds_changed",function(e){o.zoom&&o.map.getZoom()>o.zoom&&o.map.setZoom(o.zoom),google.maps.event.removeListener(t)}),this.featureFlagService.maps.enablePoi&&this.cluster.setMap(this.map)):(this.map.setCenter(this.defaultCenter),this.map.setZoom(13))}},i.$inject=["$scope","$element","FoliaService","$templateCache","$compile","$timeout","FeatureFlagService"],t=i,n=function(){this.controller=t,this.templateUrl="/App/Utility/Location/GoogleMaps/GoogleMaps.component.html",this.bindings={mapViewModel:"<",markerIcon:"<",allowMarkerClusterer:"<",foliaEnabled:"<",streetviewEnabled:"<",maxInitialZoom:"@"}}
1,app.component("googleMaps",new n)}(BoligExtra=BoligExtra||{}),!function(e){function t(){}(e=(e=e.Utility||(e.Utility={})).Location||(e.Location={})).GoogleMaps||(e.GoogleMaps={}),t.prototype.setupFolia=function(e){var t=window.folia,t=(t&&(t.controls.PublicTransport.defaultTemplate="<iframe frameborder='0' style='border:0px;height:215px;' src='https://www.rejseplanen.dk/bin/stboard.exe/mn?L=vs_liveticker&input=<%=featureData.description%>&start=yes&time=now&outputMode=tickerMode&tools=no&'> </iframe>"),new t.maps.PointsOfInterest({config:{jsonPath:"https://poi.maptoweb.dk/",imagePath:"https://d1zqutybffyvms.cloudfront.net/gfx/poi/default/",messages:{toManyInArea:"(Der er for mange på kortet til at kunne blive vist. Prøv at zoome ind)",noneInArea:"(Der er ingen i det viste kortudsnit. Prøv at zoome ud)"},categories:[{name:"Børn & uddannelse",layers:[{layerId:84,title:"Børnepasning"},{layerId:81,title:"Skole"},{layerId:82,title:"Mellemlang uddannelse"},{layerId:83,title:"Lang uddannelse"}]},{name:"Sport & fritid",layers:[{layerId:90,title:"Sportsfaciliteter"},{layerId:91,title:"Svømmehal"},{layerId:89,title:"Golf"},{layerId:94,title:"Botanisk have"},{layerId:93,title:"Zoologisk have"},{layerId:92,title:"Seværdighed"},{layerId:95,title:"Biograf"},{layerId:97,title:"Teater"}]},{name:"Offentlig service",layers:[{layerId:96,title:"Bibliotek"},{layerId:87,title:"Hospital"},{layerId:86,title:"Offentlig bygning"},{layerId:88,title:"Politi"}]},{name:"Indkøb",layers:[{layerId:85,title:"Indkøb"}]},{name:"Offentlig transport",layers:[{layerId:129,title:"Bus",max:250},{layerId:130,title:"Tog"},{layerId:132,title:"S-tog"},{layerId:131,title:"Metro"}]}]},map:e,renderMethod:t.maps.PointsOfInterest.RenderMethod.BUTTONS}));e.controls[google.maps.ControlPosition.RIGHT_TOP].push(t)},app.service("FoliaService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.$modalInstance=e,this.modalData=t,this.markers=t.markers}e=(e=(e=(e=e.Utility||(e.Utility={})).Location||(e.Location={})).GoogleMaps||(e.GoogleMaps={})).Modal||(e.Modal={}),t.prototype.$onInit=function(){var e=this;$(document).ready(function(){e.loaded=!0})},t.prototype.cancel=function(){this.$modalInstance.close()},t.$inject=["$uibModalInstance","modalData"],e.GoogleMapsModalController=t}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$http=e,this.baseurl="/umbraco/api/Location/",this.countries$=new Rx.BehaviorSubject(null)}(e=e.Utility||(e.Utility={})).Location||(e.Location={}),t.prototype.getCountries=function(){var t=this;return this.$http.get("/Umbraco/api/Location/GetCountries").then(function(e){t.countries$.onNext(e)}),this.countries$},t.$inject=["incomHttpService"],app.service("LocationService",t)}(BoligExtra=BoligExtra||{}),!function(e){((e=e.Utility||(e.Utility={})).Modal||(e.Modal={})).ModalSettings=function(){this.size="md",this.backdrop="static",this.keyboard=!0,this.size="md",this.backdrop="static"}}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.$modal=e}(e=e.Utility||(e.Utility={})).Modal||(e.Modal={}),t.prototype.createModal=function(e,t,i,n){return this.$modal.open({backdrop:"static",templateUrl:e,controllerAs:"$ctrl",controller:t,size:n=void 0===n?"md":n,resolve:{modalData:function(){return i}}})},t.prototype.createModalWithSettings=function(e){return this.$modal.open({templateUrl:e.template,controllerAs:"$ctrl",controller:e.controller,size:e.size,backdrop:e.backdrop,keyboard:e.keyboard,resolve:{modalData:function(){return e.data}}})},t.$inject=["$uibModal"],app.service("ModalService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/PageProvider/",this.cachedRequests=[]}e.Utility||(e.Utility={}),t.prototype.getLoginPage=function(){return this.getPageByDocumentType("login")},t.prototype.getPageByDocumentType=function(t){var e=this.cachedRequests.firstOrDefault(function(e){return e.docType===t});return e&&e.expires.getTime()<(new Date).getTime()&&(this.cachedRequests.remove(e),e=null),e||(e={expires:(new Date).addMinutes(5),docType:t,request:this.incomHttp.get(this.baseurl+"GetPageByDocumentType/"+t)},this.cachedRequests.add(e)),e.request},t.$inject=["incomHttpService","LoaderService"],app.service("PageProviderService",t)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i){this.recaptchaService=e,this.$scope=t,this.utilityService=i,this.dataSiteKey="6LerEOoUAAAAANXp7Tk
1M1Tf9uGVGZpndxo261g3b",this.disposables=new Rx.CompositeDisposable}(e=e.Utility||(e.Utility={})).ReCaptcha||(e.ReCaptcha={}),i.prototype.$onInit=function(){window.recaptchaCallback=this.validateCaptcha.bind(this),this.utilityService.loadScript("https://www.google.com/recaptcha/api.js")},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.validateCaptcha=function(e){var t=this;this.recaptchaService.validateCaptcha(e).subscribe(function(e){e&&(t.success=e)})},i.$inject=["ReCaptchaService","$scope","UtilityService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Utility/ReCaptcha/ReCaptcha.component.html",this.bindings={success:"="}},app.component("reCaptcha",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.baseurl="/umbraco/api/ReCaptcha/"}(e=e.Utility||(e.Utility={})).ReCaptcha||(e.ReCaptcha={}),t.prototype.validateCaptcha=function(e){var t=this,e={ReCaptchaRequestId:e},i=new Rx.Subject,n=this.loaderService.setLoader("contentSection","reCaptcha");return this.incomHttp.post(this.baseurl+"VerifyReCaptcha",e).then(function(e){i.onNext(e),t.loaderService.removeLoader(n)}),i},t.$inject=["incomHttpService","LoaderService"],app.service("ReCaptchaService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){var t=this;this.hasScrolled$=new Rx.Subject,e.onscroll=function(){var e=t.isScrolledIntoView(".main-content");t.hasScrolled$.onNext(e)}}e.Utility||(e.Utility={}),t.prototype.isScrolledIntoView=function(e){var t=$(window).scrollTop();return $(e).offset().top+15<t},t.$inject=["$window"],app.service("ScrollService",t)}(BoligExtra=BoligExtra||{}),!function(){function e(e,t,i){this.$http=e,this.$localStorage=t,this.$sessionStorage=i,this.supportAdministrationState$=new Rx.BehaviorSubject(this.$sessionStorage.supportAdministrationState)}e.prototype.getFirstLoginInfo=function(){return this.$sessionStorage.firstLoginData},e.prototype.setFirstLoginInfo=function(e){this.$sessionStorage.firstLoginData=e},e.prototype.getWishList=function(){return this.$sessionStorage.wishList},e.prototype.setWishList=function(e){this.$sessionStorage.wishList=e},e.prototype.getAcceptedCookies=function(){return!0===this.$localStorage.acceptedCookie},e.prototype.setAcceptedCookies=function(e){return this.$localStorage.acceptedCookie=e},e.prototype.setDepartmentAndcompanyId=function(e,t){this.$sessionStorage.departmentId=e,this.$sessionStorage.companyId=t},e.prototype.getDepartmentAndcompanyId=function(){return this.$sessionStorage.departmentId+","+this.$sessionStorage.companyId},e.prototype.getShowPbsButton=function(){var e=this.$localStorage.showPbsButton;return void 0===e||!1!==e},e.prototype.setShowPbsButton=function(e){return this.$localStorage.showPbsButton=e},e.prototype.setClosedOperationMessages=function(e){var t=this.getClosedOperationMessages();t.push(e),this.$sessionStorage.closedOperationMessages=t},e.prototype.getClosedOperationMessages=function(){return this.$sessionStorage.closedOperationMessages||[]},e.prototype.getSupportAdministrationState=function(){return this.supportAdministrationState$},e.prototype.setSupportAdministrationState=function(e){this.$sessionStorage.supportAdministrationState=e,this.supportAdministrationState$.onNext(this.$sessionStorage.supportAdministrationState)},e.prototype.setCurrentMenuSectionStorage=function(e){e?this.$sessionStorage.openMenuSection=e:delete this.$sessionStorage.openMenuSection},e.prototype.getCurrentMenuSectionState=function(){return this.$sessionStorage.openMenuSection},e.prototype.setBannerInitialSelection=function(){this.$sessionStorage.hasDoneInitialBannerSelection=!0},e.prototype.getBannerInitialSelection=function(){return 1==this.$sessionStorage.hasDoneInitialBannerSelection},e.$inject=["$http","$localStorage","$sessionStorage"],app.service("StorageService",e)}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t,i,n){this.scope=e,this.scrollService=t,this.utilityService=i,this.siteMenuStateService=n,this.disposables=new Rx.CompositeDisposable,this.didScroll=!1}(e=e.Ui||(e.Ui={}
1)).Totop||(e.Totop={}),i.prototype.$onInit=function(){var t=this;this.disposables.add(this.utilityService.isSmallMobile$.subscribe(function(e){t.isMobile=e,t.checkIfOnMobileAndMenuIsOpen()})),this.disposables.add(this.siteMenuStateService.openMenuSection$.subscribe(function(e){t.menuIsOpen=!!e,t.checkIfOnMobileAndMenuIsOpen()})),this.disposables.add(this.scrollService.hasScrolled$.subscribe(function(e){t.didScroll=e,t.scope.$apply()}))},i.prototype.$onDestroy=function(){this.disposables.dispose()},i.prototype.checkIfOnMobileAndMenuIsOpen=function(){this.hideToTopOnMobile=this.menuIsOpen&&this.isMobile,this.utilityService.safeDigest()},i.$inject=["$scope","ScrollService","UtilityService","SiteMenuStateService"],t=i,e=function(){this.controller=t,this.controllerAs="$ctrl",this.templateUrl="/App/Ui/Totop/Totop.component.html",this.bindings={}},app.component("totop",new e)}(BoligExtra=BoligExtra||{}),!function(e){function t(e){this.incomHttp=e,this.currentUser$=new Rx.BehaviorSubject(null),this.currentUserDashboardsAccess=null,this.currentUserDashboardsAccess$=new Rx.ReplaySubject(1),this.baseurl="/umbraco/api/User/"}e.Utility||(e.Utility={}),t.prototype.getCurrentUser=function(){var t=this;this.incomHttp.get(this.baseurl+"GetUser").then(function(e){t.currentUser$.onNext(e)})},t.prototype.removeCurrentUser=function(){this.currentUser$.onNext(null)},t.prototype.isCurrentUserTenant=function(){var t=new Rx.Subject;return this.incomHttp.get(this.baseurl+"IsUserTenant").then(function(e){t.onNext(e)}),t},t.prototype.getCurrentUserRoles=function(){var t=new Rx.Subject;return this.incomHttp.get(this.baseurl+"GetCurrentUserRoles").then(function(e){t.onNext(e)}),t},t.prototype.getCurrentUserDashboardsAccess=function(){var t=this;return null==this.currentUserDashboardsAccess&&this.incomHttp.get(this.baseurl+"GetCurrentUserDashboardsAccess").then(function(e){e&&(t.currentUserDashboardsAccess=e,t.currentUserDashboardsAccess$.onNext(t.currentUserDashboardsAccess),t.currentUserDashboardsAccess$.onCompleted())}),this.currentUserDashboardsAccess$},t.$inject=["incomHttpService"],app.service("UserService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(e,t){this.incomHttp=e,this.loaderService=t,this.userAssociationsForForum$=new Rx.BehaviorSubject(null),this.baseurl="/umbraco/api/UserAssociation/"}(e=e.Utility||(e.Utility={})).UserAssociation||(e.UserAssociation={}),t.prototype.getUserAssociationsForForum=function(e){var t=this;this.incomHttp.get(this.baseurl+"GetUserAssociationsForForum/"+e).then(function(e){t.userAssociationsForForum$.onNext(e)})},t.$inject=["incomHttpService","LoaderService"],app.service("UserAssociationService",t)}(BoligExtra=BoligExtra||{}),!function(e){var a;function t(e,t,i,n,o,r){var s=this;this.filters=e,this.$location=t,this.windowService=i,this.sitemenuStateService=n,this.$rootScope=o,this.featureFlagService=r,this.longDateFormat="dd. MMMM yyyy",this.shortDateFormat="dd-MM-yyyy",this.shortTimeFormat="HH:mm",this.longTimeFormat="HH:mm:ss",this.isoDateFormat="yyyy-MM-dd",this.isoDateTimeFormat="yyyy-MM-dd HH:mm",this.monthYearFormat="MMMM y",this.birthDateFormat="ddMMyy",this.longDateTimeFormat="dd-MM-yyyy kl. HH:mm:ss",this.getNumbersBetween=function(e,t,i){for(var n=[],o=e+i;o<t;)n.push(o),o+=i;return n},this.userAgent=new a.UserAgent,this.windowSize$=new Rx.Subject,this.isSmallMobile$=new Rx.Subject,this.isMobile$=new Rx.BehaviorSubject(null),this.isHorizontalTablet=new Rx.BehaviorSubject(null),this.isDesktop$=new Rx.Subject,this.isMobileView$=new Rx.BehaviorSubject(!1),Rx.Observable.fromEvent(window,"resize").debounce(200).map(function(){return new a.WindowTypes(window.innerHeight,window.innerWidth)}).distinctUntilChanged(function(e){return e.Height&&e.Width}).startWith(new a.WindowTypes(window.innerHeight,window.innerWidth)).tap(function(e){s.windowSize$.onNext(e),s.updateIsMobileView(e),e.IsType("md")?s.isHorizontalTablet.onNext(!0):s.isHorizontalTablet.onNext(!1)}).subscribe(),this.windowSize$.distinctUntilChanged(function(e){return e.Height&&e.Width}).subscribe(function(e){e.IsType("xxs")?s.isSmallMobile$.onNext(!0):s.isSmallMobile$.onNext(!1),e.IsType("md")?s.isHorizontalTablet.onNext(!0):s.isHorizontalTablet.onNext(!1),e.IsType("sm")?s.isMobile$.onNext(!0):s.isMobile$.onNext(!1),e.IsType("xl")?s.isDesktop$.onNext(!0):s.isDesktop$.onNext(!1)}),this.sitemenuStateService.openMenuSection$.subscribe(function(e){s.siteMenuOpen=e&&0<e.length;
1e=s.windowService.window,e=new a.WindowTypes(e.innerHeight,e.innerWidth);s.updateIsMobileView(e)})}a=e.Utility||(e.Utility={}),t.prototype.formatDate=function(e,t){var i;switch(t){case"long":i=this.longDateFormat;break;case"long time":i=this.longTimeFormat;break;case"iso date":i=this.isoDateFormat;break;case"short":i=this.shortDateFormat;break;case"short time":i=this.shortTimeFormat;break;case"iso date time":i=this.isoDateTimeFormat;break;case"birthdate format":i=this.birthDateFormat;break;case"long date time":i=this.longDateTimeFormat;break;default:i=t}return this.filters("date")(e,i)},t.prototype.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");e=new RegExp("[\\?&]".concat(e,"=([^&#]*)")).exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},t.prototype.getParameters=function(e,t){var i="";if("hash"===(e=void 0===e?"querystring":e)?i=this.$location.hash():(e=void 0,-1<(e=location.search.indexOf("?"))&&(i=location.search.substring(e+1))),0===i.length)return{};for(var n={},o=decodeURIComponent(i).split("&"),r=0;r<o.length;r++){var s=o[r].split("=");n[s[0]]=s[1]}return n},t.prototype.getUserAgent=function(){return this.userAgent},t.prototype.isAboveVersion=function(e){var t=this,e=e.firstOrDefault(function(e){return e.browser==t.userAgent.browser&&(null==e.device||e.device==t.userAgent.device)});return null!=e&&e.version<=this.userAgent.BrMajorVersion},t.prototype.newGuid=function(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},t.prototype.parseNumber=function(e){e=parseInt(e);if(!isNaN(e))return e},t.prototype.getPageUrl=function(){var e=this.windowService.location.origin+this.windowService.location.pathname;return!1===e.endsWith("/")&&(e+="/"),e},t.prototype.print=function(e,t){var i=window.open("","PRINT");i.document.write("<html><head><title>"+e+"</title>"),i.document.write("</head><body >"),i.document.write(t),i.document.write("</body></html>"),i.document.close(),i.focus(),i.print(),i.close()},t.prototype.safeDigest=function(e){e?e.$$phase||e.$root.$$phase?e.$applyAsync():e.$digest():this.$rootScope.$applyAsync()},t.prototype.isHtml=function(e){var t=document.createElement("div");t.innerHTML=e;for(var i=t.childNodes,n=i.length;n--;)if(1===i[n].nodeType)return!0;return!1},t.prototype.loadScript=function(e){for(var t=!1,i=document.getElementsByTagName("script"),n=0;n<i.length;++n)null!=i[n].getAttribute("src")&&i[n].getAttribute("src").includes("loader")&&(t=!0);if(!t)for(var o=[e],n=0;n<o.length;n++){var r=document.createElement("script");r.src=o[n],r.type="text/javascript",r.async=!1,r.charset="utf-8",document.getElementsByTagName("head")[0].appendChild(r)}},t.prototype.fillMissingNumbers=function(e,n){var o=this,r=[];return e.forEach(function(e,t,i){r.push(e),i.length!==t+1&&(i=i[t+1],r.addRange(o.getNumbersBetween(e,i,n)))}),r},t.prototype.roundToNearest=function(e,t,i){return i?Math.floor(e/t)*t:Math.ceil(e/t)*t},t.prototype.updateIsMobileView=function(e){e&&(e.Width<1199&&this.siteMenuOpen||e.Width<767?this.isMobileView$.onNext(!0):this.isMobileView$.onNext(!1))},t.$inject=["$filter","$location","$window","SiteMenuStateService","$rootScope","FeatureFlagService"],app.service("UtilityService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(r,e,s,a){e.on("keyup blur",function(e){var t=new Date;a.$setValidity("dateValid",!1);var i,n,o,e=$(e.target).val();null===e||""===e?a.$setValidity("dateValid",!0):(i=parseInt(e.substring(0,2)),n=parseInt(e.substring(2,4)),(e=parseInt(e.substring(4,6))+2e3)>t.getFullYear()&&(e-=100),(o=new Date(e,n-1,i)).getDate()===i&&o.getMonth()+1===n&&o.getFullYear()===e&&(a.$setValidity("dateValid",!0),s.hasOwnProperty("ignore15yearRule")||(t.setFullYear(t.getFullYear()-15),a.$setValidity("15YearRule",!(o.getTime()>t.getTime()))))),r.$apply()})}(e=e.Utility||(e.Utility={})).Validation||(e.Validation={}),app.directive("cprDateValidator",function(){return{restrict:"A",require:"ngModel",scope:{},link:t}})}(BoligExtra=BoligExtra||{}),!function(e){var t;function i(e,t){this.element=e,this.scope=t}
1(e=e.Utility||(e.Utility={})).Validation||(e.Validation={}),i.prototype.$onInit=function(){var o=this;this.element.bind("click",function(){var e=o.element.controller("form"),t=e.$$element.find(".ng-invalid");if(0===t.length)o.scope.clickEvent();else{e=e.$$controls;o.checkForAdditionalLevel(e),o.scope.$apply();for(var i=0;i<t.length;i++)if("checkbox"===t[i].localName){var n=t[i].querySelector('input[type="checkbox"]');n&&n.focus()}else if("div"!==t[i].localName){t[i].focus();break}}})},i.prototype.checkForAdditionalLevel=function(e){for(var t=0;t<e.length;t++)e[t].$$controls&&1<e[t].$$controls.length?this.checkForAdditionalLevel(e[t].$$controls):(e[t].$setDirty(),e[t].$setTouched())},i.prototype.$onDestroy=function(){},i.$inject=["$element","$scope"],t=i,app.directive("valClick",function(){return{restrict:"A",require:"^form",controller:t,controllerAs:"$ctrl",scope:{clickEvent:"&valClick"}}})}(BoligExtra=BoligExtra||{}),!function(e){function t(){}(e=e.Utility||(e.Utility={})).Validation||(e.Validation={}),t.prototype.escapeSpecialRegExCharacters=function(e){return e&&e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},t.prototype.getEmailRegex=function(){return new RegExp(/^(([^<>()\[\]\\.,;:\s@']+(\.[^<>()\[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)},t.prototype.getFullNameRegex=function(){return new RegExp(/^[a-zA-Zà áâäãåæÄ
ÄÄÄèéêëÄįìÃîïÅÅòóôöõøùúûüųūÿýżźñçÄšžÃÃÃÃÃÃ
ÄÄÄÄÄÃÃÃÃÃÃÃÃÄ®ÅÅÃÃÃÃÃÃÃÃÃÃŲŪŸÃŻŹÃÃÃÅÃÄŠŽâð '´`\-]+$/)},t.prototype.getPasswordRegex=function(){return new RegExp(/^.{6,}$/)},t.prototype.getDateRegex=function(){return new RegExp(/^(?:(?:31()(?:0[13578]|1[02]))\1|(?:(?:29|30)()(?:0[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29()02\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0[1-9]|1\d|2[0-8])()(?:(?:0[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/g)},t.prototype.getShortDateRegex=function(){return new RegExp(/^(?:(?:31()(?:0[13578]|1[02]))\1|(?:(?:29|30)()(?:0[1,3-9]|1[0-2])\2))(?:\d{2})$|^(?:29()02\3(?:(?:(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0[1-9]|1\d|2[0-8])()(?:(?:0[1-9])|(?:1[0-2]))\4(?:\d{2})$/g)},t.prototype.getPhoneNumberRegex=function(){return new RegExp(/^([+]?[\d]{0,3})([ ]?[\d]{2,20})+$/)},t.prototype.getUrlRegex=function(){return new RegExp(/^[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?$/)},t.prototype.getAddressRegex=function(){return new RegExp(/(?=.*[0-9_])(?=.*[a-zA-Zà áâäãåæÄ
ÄÄÄèéêëÄįìÃîïÅÅòóôöõøùúûüųūÿýżźñçÄšžÃÃÃÃÃÃ
ÄÄÄÄÄÃÃÃÃÃÃÃÃÄ®ÅÅÃÃÃÃÃÃÃÃÃÃŲŪŸÃŻŹÃÃÃÅÃÄŠŽâð_ ])([a-zA-Zà áâäãåæÄ
ÄÄÄèéêëÄįìÃîïÅÅòóôöõøùúûüųūÿýżźñçÄšžÃÃÃÃÃÃ
ÄÄÄÄÄÃÃÃÃÃÃÃÃÄ®ÅÅÃÃÃÃÃÃÃÃÃÃŲŪŸÃŻŹÃÃÃÅÃÄŠŽâð0-9_ ]+)/)},app.service("ValidationService",t)}(BoligExtra=BoligExtra||{}),!function(e){function t(){}e.Utility||(e.Utility={}),t.prototype.parseYoutubeVideoId=function(e){e=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return!(!e||11!=e[7].length)&&e[7]},app.service("VideoService",t)}(BoligExtra=BoligExtra||{}),!function(e){(e.Utility||(e.Utility={})).WindowTypes=function(e,t){var i=this;this.IsType=function(e){return"xxs"==e?i.Width<=640:"xs"==e?i.Width<=768:"sm"==e?i.Width<=991:"md"==e?1024<=i.Width:"lg"==e?1199<=i.Width:"xl"==e?1280<=i.Width:void 0},this.Height=e,this.Width=t}}(BoligExtra=BoligExtra||{}),BoligExtra=BoligExtra||{},app.directive("a",function(){return{restrict:"E",link:function(e,i,t){var n=["pdf","docx","doc","xlsx","xls","gif","jpg","jpeg","png"];e.$watch(function(){return i.attr("href")},function(t){t&&n.some(function(e){return t.endsWith("."+e)})&&i.prop("target","_blank")})}}}),!function(){t.prototype.$onInit=function(){var t=this;this.$element.on("click",function(){var e=t.$attrs.$attr.href;t.$attrs.$attr.preventGoToTop||!e||!t.$attrs.href||t.$attrs.href.includes("javascript")||t.$attrs.target||t.smoothScroll(".main-content")})},t.prototype.$onDestroy=function(){},t.$inject=["$element","smoothScroll","$attrs"];var e=t;function t(e,t,i){this.$element=e,this.smoothScroll=t,this.$attrs=i}app.directive("a",function(){return{restrict:"E",controller:e}})}(BoligExtra=BoligExtra||{}),Array.prototype.distinct=Array.prototype.distinct||function(){for(var e=[],t=0;t<this.length;t++)-1===e.indexOf(this[t])&&e.push(this[t]);return e},Array.prototype.contains=Array.prototype.contains||function(e){return-1<this.indexOf(e)},Array.prototype.shuffle=Array.prototype.shuffle||function(){for(var e,t,i=this.length;0!==i;)t=Math.floor(Math.random()*i),e=this[--i],this[i]=this[t],this[t]=e;return this},Array.prototype.any=Array.prototype.any||function(e){return e?this.some(e):0<this.length},Array.prototype.firstOrDefault=Array.prototype.firstOrDefault||function(e){for(var t=0;t<this.length;t++){var i=this[t];if(!e||e(i))return i}return null},Array.prototype.lastOrDefault=Array.prototype.lastOrDefault||function(e){for(var t=this.length-1;0<=t;t--){var i=this[t];if(!e||e(i))return i}return null},Array.prototype.where=Array.prototype.where||function(e){for(var t=[],i=0;i<this.length;i++){var n=this[i];e(n)&&t.push(n)}return t},Array.prototype.remove=Array.prototype.remove||function(e){e=this.indexOf(e);return 0<=e&&(this.splice(e,1),!0)},Array.prototype.removeRange=Array.prototype.removeRange||function(e){for(var t=0;t<e.length;t++)this.remove(e[t])},Array.prototype.add=Array.prototype.add||function(e){this.push(e)},Array.prototype.addRange=Array.prototype.addRange||function(e){e&&this.push.apply(this,e)},Array.prototype.orderBy=Array.prototype.orderBy||function(i){var e=0;return e<this.length?this.sort(function(e,t){return i(e)>i(t)?1:i(t)>i(e)?-1:0}):[]},Array.prototype.orderByDescending=Array.prototype.orderByDescending||function(i){var e=0;return e<this.length?this.sort(function(e,t){return i(e)>i(t)?-1:i(t)>i(e)?1:0}):[]},Array.prototype.orderByMany=Array.prototype.orderByMany||function(o){var e=0;return e<this.length?this.sort(function(e,t){for(var i=0;i<o.length;i++){var n=o[i];if(n(e)>n(t))return 1;if(n(t)>n(e))return-1}return 0}):[]},Array.prototype.orderByManyDescending=Array.prototype.orderByManyDescending||function(o){var e=0;return e<this.length?this.sort(function(e,t){for(var i=0;i<o.length;i++){var n=o[i];if(n(e)>n(t))return-1;if(n(t)>n(e))return 1}return 0}):[]},Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw TypeError('"this" is null or not defined');var t=Object(this),i=t.length>>>0;if("function"!=typeof e)throw TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<i;){var r=t[o];if(e.call(n,r,o,t))return r;o++}},configurable:!0,writable:!0}),Date.prototype.convertToNumber=function(){return this.getTime()},Date.prototype.clearTime=Date.prototype.clearTime||function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate())},Date.prototype.clone=Date.prototype.clone||function(){return new Date(this.getTime())},Date.prototype.equals=Date.prototype.equals||function(e){return this.getTime()===e.getTime()},Date.prototype.between=Date.prototype.between||function(e,t){return this.getTime()>=e.getTime()&&this.getTime()<=t.getTime()},Date.prototype.isAfter=Date.prototype.isAfter||function(e){return this.getTime()>e.getTime()},Date.prototype.isBefore=Date.prototype.isBefore=function(e){return this.getTime()<e.getTime()},Date.prototype.isSameDay=Date.prototype.isSameDay||function(e){return this.clone().clearTime().equals(e.clone().clearTime())},Date.prototype.isToday=Date.prototype.isToday||function(){return this.isSameDay(new Date)},Date.prototype.addMilliseconds=Date.prototype.addMilliseconds||function(e){return this.setMilliseconds(this.getMilliseconds()+e),this},Date.prototype.addSeconds=Date.prototype.addSeconds||function(e){return this.addMilliseconds(1e3*e)},Date.prototype.addMinutes=Date.prototype.addMinutes||function(e){return this.addMilliseconds(6e4*e)},Date.prototype.addHours=Date.prototype.addHours||function(e){return this.addMilliseconds(36e5*e)},Date.prototype.addDays=Date.prototype.addDays||function(e){return this.setDate(this.getDate()+e),this},Date.prototype.addWeeks=Date.prototype.addWeeks||function(e){return this.addDays(7*e)},Date.prototype.addMonths=Date.prototype.addMonths||function(e){var t=this.getDate(),e=(this.setDate(1),this.setMonth(this.getMonth()+e),new Date(this.getFullYear(),this.getMonth(),1).addDays(-1).getDate());return this.setDate(Math.min(t,e)),this},Date.prototype.addYears=Date.prototype.addYears||function(e){return this.addMonths(12*e)},BoligExtra=BoligExtra||{},app.directive("iframeSetDimensionsOnload",function(){return{restrict:"A",link:function(e,t,i){t.on("load",function(){var e=t[0].contentWindow.document.body.scrollHeight+"px";t.css("width","100%"),t.css("height",e)})}}}),!function(n){var o=n.Utility.BrowserVersion,e=(t.prototype.$onInit=function(){var n,o=this;this.utilityService.isAboveVersion(this.browserList)||(n=this.$element.parent(),$(this.$element).one("load",function(){EXIF.getData(o.$element[0],function(){var e=EXIF.getTag(o.$element[0],"Orientation"),t=o.$element.height(),i=o.$element.width();if(o.carousel=o.attributes.inCarousel,e&&1!==e)switch(e){case 2:o.setTransform("rotateY(180deg)");break;case 3:o.setTransform("rotate(180deg)");break;case 4:o.setTransform("rotateX(180deg)");break;case 5:o.setTransform("rotateZ(90deg) rotateX(180deg)"),o.setMargin(i,t,n);break;case 6:o.setTransform("rotate(90deg)"),o.setMargin(i,t,n);break;case 7:o.setTransform("rotateZ(90deg) rotateY(180deg)"),o.setMargin(i,t,n);break;case 8:o.setTransform("rotate(-90deg)"),o.setMargin(i,t,n)}})}))},t.prototype.$onDestroy=function(){},t.prototype.setMargin=function(e,t,i){!this.carousel&&t<e&&(i.css("height",e+"px"),this.$element.css("margin-top",(e-t)/2+"px"))},t.prototype.setTransform=function(e){this.$element.css("-ms-transform",e),this.$element.css("-webkit-transform",e),this.$element.css("-moz-transform",e),this.$element.css("transform",e)},t.$inject=["$element","$attrs","UtilityService"],t);function t(e,t,i){this.$element=e,this.attributes=t,this.utilityService=i,this.browserList=[new o(n.Utility.Browser.Chrome,81),new o(n.Utility.Browser.Safari,13.1,n.Utility.Device.Desktop),new o(n.Utility.Browser.Safari,13,n.Utility.Device.Mobile),new o(n.Utility.Browser.Firefox,77)]}app.directive("img",function(){return{restrict:"E",controller:e}})}(BoligExtra=BoligExtra||{}),Number.prototype.convertToNumber||(Number.prototype.convertToNumber=function(){return this}),Number.prototype.minTwoDigits||(Number.prototype.minTwoDigits=function(){return(this<10?"0":"")+this}),String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(t||0,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return t<this.length?t|=0:t=this.length,this.substr(t-e.length,e.length)===e}),String.prototype.toDate||(String.prototype.toDate=function(){var e=this.split("-"),t=parseInt(e[2]),i=parseInt(e[1]),e=parseInt(e[0]),n=new Date(t,i-1,e,0,0,0);return n.getDate()===e&&n.getMonth()===i-1&&n.getFullYear()===t?n:null}),String.prototype.capitalize||(String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)}),String.prototype.convertToNumber||(String.prototype.convertToNumber=function(){return Number(this)}),String.prototype.minTwoDigits||(String.prototype.minTwoDigits=function(){return(this.convertToNumber()<10?"0":"")+this}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return-1!==this.indexOf(e,t=void 0===t?0:t)});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.