"use strict";function viewport(){var n=window,t="inner";return"innerWidth"in window||(t="client",n=document.documentElement||document.body),{width:n[t+"Width"]}}var studentsApp=angular.module("studentsApp",["ui.bootstrap","ui.select2","ngAnimate","angulartics","angulartics.google.analytics"]),hash;studentsApp.controller("baseController",["$scope","$window",function(n,t){n.redirectToTpPage=function(n,i){t.location.href="/true-picture/"+n+"/"+i}}]);studentsApp.filter("sanitize",["$sce",function(n){return function(t){return n.trustAsHtml(t)}}]);studentsApp.run(function(){});studentsApp.factory("_",["$window",function(n){return n._}]);studentsApp.controller("CollapseMenuCtrl",["$scope",function(n){n.isCollapsed=!0}]);studentsApp.controller("searchController",["$scope","$window","$location","$document","searchService","$analytics",function(n,t,i,r,u,f){function c(){n.firmType=l;n.currentPage=1;n.pageSize=h;n.sortField=a}var e="-1",o="-1",s="-1",l=1,a="FirmId",h=10,v=1;n.initialised=0;n.firmText="";n.regionText="";n.practiceAreaText="";n.isOldUrlRedirect=!1;n.studentBaseUri=r.find("#StudentApiBaseUri").val();n.publicationId=r.find("#PublicationId").val();n.changeTabsInit=function(){var i=t.location.href.split("##")[1];i==="bonus"?(n.selected=3,n.list="Get Hired"):i==="firm-profile"?(n.selected=4,n.list="Firm Profile"):i==="firm-rankings"?(n.selected=5,n.list="Firm Rankings"):i==="media-content"?(n.selected=6,n.list="Media"):(n.selected=1,n.list="True Picture")};n.activateTab=function(t,i){n.selected=t;n.list=i};n.search=function(){var i=0,r=0,f=1,e,t;n.firmRegion!==o&&(i=n.firmRegion);n.firmPracticeArea!==s&&(r=n.firmPracticeArea);n.currentPage!==1&&(f=n.currentPage);e="PublicationId="+n.publicationId+"&RegionId="+i+"&PracticeAreaId="+r+"&page="+f+"&pageSize="+h;t=u.search(n.studentBaseUri,e);t.then(function(){n.searchLoading=1});t.then(function(t){n.searchLoading=0;n.searchResult=t},function(t){n.status=t})};n.pageChanged=function(){n.search()};n.updateSearchFilter=function(t){for(var f=[2,8,14],u,r,i=0;i<f.length;i++)if($("#select2-chosen-"+f[i]).text().substring(0,8)!="Select a"){n.regionText=$("#select2-chosen-"+f[i]).text();break}for(u=[3,9,15],r=0;r<u.length;r++)if($("#select2-chosen-"+u[r]).text().substring(0,8)!="Select a"){n.practiceAreaText=$("#select2-chosen-"+u[r]).text();break}n.firmText=$("#select2-chosen-1").text();n.firmTextX=$("#select2-chosen-1").text();t=="search"&&n.search()};n.clearSearch=function(){c();n.firmId=e;n.firmRegion=o;n.firmPracticeArea=s;n.barId=e;n.lawSchoolId=e;n.lawSchoolType=v};n.loadLookup=function(){var f,u,r;c();f=t.location.pathname;i.search().firmId===undefined&&f!==undefined&&f!==null?(u=f.split("/"),u[1]==="Search"&&u[2]==="FirmList"&&u[3]!=null?(n.isOldUrlRedirect=!0,r=u[3].split("-"),n.firmPracticeArea=r[1],n.firmRegion=r[2],n.search(),n.firmId=r[0]>0?r[0]:"-1",n.firmPracticeArea=r[1]>0?r[1]:"-1",n.firmRegion=r[2]>0?r[2]:"-1"):n.clearSearch()):n.initialised||i.search().firmId===undefined?n.clearSearch():(n.firmId=i.search().firmId,n.firmRegion=i.search().region,n.firmPracticeArea=i.search().practiceArea,n.firmText=i.search().firmName,n.regionText=i.search().regionName,n.practiceAreaText=i.search().practiceAreaName,n.search())};n.redirectToSearchPage=function(){n.updateSearchFilter();t.location.href="/search-result#?firmId="+n.firmId+"&region="+n.firmRegion+"&practiceArea="+n.firmPracticeArea+"&firmName="+n.firmText+"&regionName="+n.regionText+"&practiceAreaName="+n.practiceAreaText};n.redirectToFirmPage=function(i){i=="Law Firm page"?(t.location.href="/true-picture/"+n.firmId+"/1",f.eventTrack(i+" - First Dropdown",{category:"Search",label:n.firmTextX})):(t.location.href="/true-picture/"+n.firmId+"/1",f.eventTrack(i+" - First Dropdown",{category:"Search",label:n.firmTextX}))};n.redirectToBarPage=function(){t.location.href="/true-picture/"+n.barId+"/2"};n.redirectToLawSchoolPage=function(){t.location.href="/true-picture/"+n.lawSchoolId+"/3/"+n.lawSchoolType};n.loadLookup();n.ids={};n.ids1={};n.ids2={};n.finalLog1=[];n.compareBtn=function(){angular.forEach(n.ids,function(n,t){n&&this.push(t)},n.finalLog1);var i=n.finalLog1.join("&f="),r="compare-firms#?pubid="+n.publicationId+"&f="+i;n.finalLog1.length>=2&&(t.location.href=r);n.finalLog1.length=0};n.idsFunction=function(t){n.idsCount=0;t==1?_.forIn(n.ids1,function(t){t&&(n.idsCount=n.idsCount+1)}):t==2&&_.forIn(n.ids2,function(t){t&&(n.idsCount=n.idsCount+1)})};n.tickAll=function(t){t==1?n.toggleVal?_.each(n.ids1,function(t,i,r){r[i]=!0;n.checkedStatus=!0;n.idsCount=0;_.forIn(n.ids1,function(t){t&&(n.idsCount=n.idsCount+1)})}):_.each(n.ids1,function(t,i,r){r[i]=!1;n.checkedStatus=!1;n.idsCount=0;_.forIn(n.ids1,function(t){t&&(n.idsCount=n.idsCount+1)})}):t==2&&(n.toggleVal?_.each(n.ids2,function(t,i,r){r[i]=!0;n.checkedStatus=!0;n.idsCount=0;_.forIn(n.ids2,function(t){t&&(n.idsCount=n.idsCount+1)})}):_.each(n.ids2,function(t,i,r){r[i]=!1;n.checkedStatus=!1;n.idsCount=0;_.forIn(n.ids2,function(t){t&&(n.idsCount=n.idsCount+1)})}))};n.clearSelected=function(){n.toggleVal=!1;n.checkAll=!1;n.tickAll(1);n.tickAll(2)};n.compareBtnAZ=function(i,r){r==1?angular.forEach(n.ids1,function(n,t){n&&this.push(t)},n.finalLog1):r==2?angular.forEach(n.ids2,function(n,t){n&&this.push(t)},n.finalLog1):angular.forEach(n.ids,function(n,t){n&&this.push(t)},n.finalLog1);var u=n.finalLog1.join("&f="),f="../compare-firms#?pubid="+i+"&f="+u;n.finalLog1.length>=2&&(t.location.href=f);n.finalLog1.length=0};n.letter=[];n.checkId=function(n){var t=angular.element("#"+n);return t.length!="1"?!0:!1}}]);studentsApp.controller("searchController2",["$scope","$http","$location",function(n,t,i){var u,r;n.ShowContent=0;n.setSelect=function(t){n.sel=t;t||(n.sel=0);n.SecondBtn=n.Collection.Datas[t].Columns};n.clearSearch=function(){n.searchField=""};n.FirstTitle=function(t){n.list=t};n.setList=function(t){n.list=t};n.setSort=function(t){n.sort="Sorted By: "+t.Description};n.accordionCollapsed=!0;n.orderBy=n.SecondBtn;n.setOrderBy=function(t){n.orderBy=t};n.predicate=function(t){return typeof n.orderBy=="undefined"?undefined:n.orderBy==="Name"?t[n.orderBy][0]:t[n.orderBy].Value};n.filterX=n.SecondBtn;n.FilteringTest=function(t){n.filterX=t};n.predicate2=function(t){return typeof n.filterX=="undefined"?undefined:typeof t[n.filterX]=="undefined"?undefined:n.filterX==="Name"?t[n.filterX][0]:t[n.filterX].Value};n.getFieldname=function(n,t){var i=t.find(function(t){return t.FieldName===n});return i.Description};n.url=i.search();n.publicationId=n.url.pubid;n.publicationId=n.publicationId?n.url.pubid:0;n.firmsId=n.url.f;u=n.firmsId?n.firmsId.join("&f="):0;r="";window.location.host.charAt(0)==="l"?r="local.":window.location.host.charAt(0)==="p"&&(r="preview-");n.publicationId||u?t.get("https://"+r+"app-students-api-prod.azurewebsites.net/api/organisationsearch/FirmComparison/?pubid="+n.publicationId+"&f="+u).success(function(t){n.Collection=t;n.ShowContent=2}).error(function(t){n.Collection=t;n.ShowContent=1}):n.ShowContent=3}]);studentsApp.factory("searchService",["$http","$q",function(n,t){function r(n,t){var r=n+"/organisationsearch/search/?"+t;return i(r)}function u(n,t){var r=n+"/organisation/list/"+t;return i(r)}function f(n,t,r){var u=n+"/studentregion/get?publicationTypeId="+t+"&organisationType="+r;return i(u)}function e(n,t){var r=n+"/practicearea/get?"+t;return i(r)}function i(i){var r=t.defer();return n({method:"GET",url:i}).success(function(n){r.resolve(n)}).error(function(n){r.reject(n)}),r.promise}return{search:r,getFirms:u,getRegions:f,getPracticeAreas:e}}]);studentsApp.directive("map",function(){var n=[],t=function(t,i,r){function o(){u===void 0&&(u=new google.maps.Map(i[0],f))}function s(n,t,i){var r,u={position:t,map:n,title:i,icon:"https://maps.google.com/mapfiles/ms/icons/green-dot.png"};r=new google.maps.Marker(u);e.push(r)}var u,e=[],f;angular.forEach(jQuery.parseJSON(r.markers.toString()),function(t){n.push(t)});f={center:new google.maps.LatLng(r.latitude,r.longitude),zoom:6,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1};o();angular.forEach(n,function(n){s(u,new google.maps.LatLng(n.Lat,n.Long),n.Comment)})};return{restrict:"A",template:'<div id="googleMaps"><\/div>',replace:!0,link:t}});$(document).ready(function(){var f=document.getElementById("map");if(f){var n,o=new google.maps.InfoWindow,i=new google.maps.LatLngBounds,t=[],r=[],u=[],e={zoom:0,disableDefaultUI:!0,zoomControl:!0,scrollwheel:!1,mapTypeId:google.maps.MapTypeId.ROADMAP};n=new google.maps.Map(document.getElementById("map"),e);n.fitBounds(i);$("#map_list ul li").each(function(){var h=$(this).find(".marker_number").text(),f=new google.maps.LatLng($(this).find(".marker_lat").text(),$(this).find(".marker_long").text()),e=new google.maps.MarkerImage("https://maps.google.com/mapfiles/ms/icons/green-dot.png"),o=new google.maps.MarkerImage("https://maps.google.com/mapfiles/ms/icons/red-dot.png"),s=new google.maps.Marker({position:f,map:n,animation:google.maps.Animation.DROP,title:$(this).find(".marker_title").text(),brief:$(this).find(".marker_brief").text(),icon:e});t.push(s);u.push(e);r.push(o);i.extend(f)});$("#map_list ul li").on("mouseenter",function(){var n=$(this).attr("id");t[n].setIcon(r[n])}).on("mouseleave",function(){var n=$(this).attr("id");t[n].setIcon(u[n])})}});$(document).ready(function(){$(".info-search .panel-heading + .collapse:not(.in)").prev().prepend('<i class="fa fa-caret-right hidden-md hidden-lg pull-left"><\/i>');$(".info-search .panel-heading + .collapse.in").prev().prepend('<i class="fa fa-caret-down hidden-md hidden-lg pull-left"><\/i>');$(".info-search .panel-heading a").click(function(){$(".panel").find(".collapse.in").prev().find("i.pull-left").addClass("fa-caret-right").removeClass("fa-caret-down");$(this).parents(".panel-heading").find("i.fa-caret-right").removeClass("fa-caret-right").addClass("fa-caret-down");$(this).parents(".panel").find(".collapse.in").prev().find("i.fa-caret-down").removeClass("fa-caret-down").addClass("fa-caret-right")})});$(window).on("load resize",function(){clearTimeout($.data(this,"resizeTimer1"));$.data(this,"resizeTimer1",setTimeout(function(){viewport().width>991?($(".j-data").removeAttr("data-toggle").removeClass("collapsed"),$("#collapseSearch").removeClass("collapse").addClass("collapse in").removeAttr("style")):viewport().width<992&&($(".j-data").attr("data-toggle","collapse").addClass("collapsed"),$("#collapseSearch").removeClass("collapse in").addClass("collapse"))},200))});hash=window.location.hash;hash&&$('ul.nav a[href="'+hash+'"]').tab("show");$(".nav-tabs a").click(function(){$(this).tab("show");var n=$("body").scrollTop();window.location.hash=this.hash;$("html,body").scrollTop(n)});$(document).ready(function(){$(".dropdown-submenu").find(".dropdown-toggle").append('<i class="fa fa-angle-right"><\/i>')});$("*[title]").hover(function(){var n=$(this).attr("title");$(this).attr("tmp",n);$(this).attr("title","")},function(){var n=$(this).attr("tmp");$(this).attr("title",n);$(this).removeAttr("tmp")});$(".student-guide-download a").click(function(n){var t="",i=$(this).attr("href");t=n.srcElement?n.srcElement.innerText:n.target.innerText;!t||(_gaq.push(["_trackEvent","Student Guide 2020","Download Student Guide 2020 "+t,"Student Guide 2020 "+t]),setTimeout(function(){window.location.href=i},1e3),event.preventDefault())})