function openAgentContactModal(n,t){var i=angular.element(document.getElementById("listingIndex")).scope();i.$apply(function(){i.vm.openAgentContactModal(n,t)})}var appModule=angular.module("app",["ui.router","ui.bootstrap","ui.utils","ui.jq","ui.select","ui.grid","ngSanitize","oc.lazyLoad","frapontillo.bootstrap-switch","abp","angular-flexslider","bootstrapLightbox","uiGmapgoogle-maps","ui.utils.masks","ngMessages","ngCookies","ui-notification","vcRecaptcha","me-lazyload"]);appModule.config(["$ocLazyLoadProvider",function(n){n.config({cssFilesInsertBefore:"ng_load_plugins_before",debug:!1,events:!0,modules:[]})}]);appModule.value("captchaKey","6LcyXyYTAAAAAFsSArDcKnUEwX6UMHDkJ-2n8CO3");appModule.filter("propsFilter",function(){return function(n,t){var i=[],r;return angular.isArray(n)?(r=Object.keys(t),n.forEach(function(n){for(var f,o,e=!1,u=0;u<r.length;u++)if(f=r[u],o=t[f].toLowerCase(),n[f].toString().toLowerCase().indexOf(o)!==-1){e=!0;break}e&&i.push(n)})):i=n,i}});App.setAssetsPath(abp.appPath+"metronic/assets/");appModule.factory("settings",["$rootScope",function(n){var t={layout:{pageSidebarClosed:!1,pageContentWhite:!0,pageBodySolid:!1,pageAutoScrollOnLoad:1e3},layoutImgPath:App.getAssetsPath()+"admin/layout2/img/",layoutCssPath:App.getAssetsPath()+"admin/layout2/css/",assetsPath:abp.appPath+"metronic/assets",globalPath:abp.appPath+"metronic/assets/global",layoutPath:abp.appPath+"metronic/assets/layouts/layout2"};return n.settings=t,t}]);appModule.factory("GoogleWebMastersKey",["appSession",function(n){var t="",i=function(){for(var t=0;t<n.regionalSettings.length;t++)if(n.regionalSettings[t].name=="GoogleWebMastersKey")return n.regionalSettings[t].output.value};return t=n.getSiteSetting("GoogleWebMastersKey"),(t==null||t=="")&&(t=i()),{googleWebMastersKey:function(){return t},setGoogleWebMastersKey:function(n){t=n}}}]);appModule.run(["$rootScope","settings","$state","i18nService","$anchorScroll",function(n,t,i,r,u){n.$state=i;n.$settings=t;u.yOffset=100;r.get(abp.localization.currentCulture.name)?r.setCurrentLang(abp.localization.currentCulture.name):r.setCurrentLang("en");n.safeApply=function(n){var t=this.$root.$$phase;t=="$apply"||t=="$digest"?n&&typeof n=="function"&&n():this.$apply(n)}}]);$(document).on("click","a[href^='/listing']",function(){window.location.href.indexOf("/listing")>=0&&window.location.reload(!0)});String.prototype.replaceAll=function(n,t){var i=this;return i.split(n).join(t)};appModule.directive("maskMoney",["$timeout","$locale",function(n,t){return{restrict:"A",require:"ngModel",scope:{model:"=ngModel",mmOptions:"=?",prefix:"=",suffix:"=",affixesStay:"=",thousands:"=",decimal:"=",precision:"=",allowZero:"=",allowNegative:"="},link:function(i,r,u,f){function s(){return i.mmOptions}function h(){return $(r).maskMoney("unmasked")[0]}function e(){n(function(){i.$apply(function(){f.$setViewValue($(r).val())})})}function o(){n(function(){elOptions={prefix:i.prefix||"",suffix:i.suffix,affixesStay:i.affixesStay,thousands:i.thousands||t.NUMBER_FORMATS.GROUP_SEP,decimal:i.decimal||t.NUMBER_FORMATS.DECIMAL_SEP,precision:i.precision,allowZero:i.allowZero,allowNegative:i.allowNegative};i.mmOptions||(i.mmOptions={});for(elOption in elOptions)elOptions[elOption]&&(i.mmOptions[elOption]=elOptions[elOption]);$(r).maskMoney(i.mmOptions);$(r).maskMoney("mask");e()},0);n(function(){i.$apply(function(){f.$setViewValue($(r).val())})})}i.$watch(s,o,!0);i.$watch(u.ngModel,e,!0);r.on("keyup",e);f.$parsers.push(h);f.$formatters.push(function(t){return n(function(){o()}),parseFloat(t).toFixed(2)})}}}]),function(){"use strict";appModule.directive("autoFocus",function(){return{restrict:"A",link:function(n,t){t[0].focus()}}})}(),function(){appModule.directive("blazy",["$timeout",function(n){return{restrict:"A",link:function(){n(function(){var n=new Blazy({src:"data-blazy",offset:100,breakpoints:[{width:420,src:"data-blazy-small"}],success:function(){}})},0)}}}])}(),function(){appModule.directive("busyIf",[function(){return{restrict:"A",scope:{busyIf:"="},link:function(n,t){n.$watch("busyIf",function(){n.busyIf?abp.ui.setBusy($(t)):abp.ui.clearBusy($(t))})}}}])}(),function(){appModule.directive("buttonBusy",function(){return{restrict:"A",scope:{buttonBusy:"="},link:function(n,t,i){var s=!1,f=$(t),u=f.find("span"),e=null,r=f.find("i"),o=null;n.$watch("buttonBusy",function(){if(n.buttonBusy)f.attr("disabled","disabled"),r.length&&(o=r.attr("class"),r.removeClass(),r.addClass("fa fa-spin fa-spinner")),i.busyText&&u.length&&(e=u.html(),u.html(i.busyText)),s=!0;else{if(!s)return;f.removeAttr("disabled");r.length&&o&&(r.removeClass(),r.addClass(o));u.length&&e&&u.html(e)}})}}})}(),function(){appModule.directive("enterKey",[function(){return function(n,t,i){t.bind("keydown keypress",function(t){t.which===13&&(n.$apply(function(){n.$eval(i.enterKey)}),t.preventDefault())})}}])}(),function(){appModule.directive("myMap",function(){var n=function(n,t){function f(){i===void 0&&(i=new google.maps.Map(t[0],u))}function e(t,i,u){var f,e={position:n.center,map:t,title:u,icon:n.tenant,center:n.center};f=new google.maps.Marker(e);r.push(f);t.setCenter(n.center)}var i,r=[],u={center:n.center,zoom:8,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_CENTER},zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.LEFT_CENTER},scaleControl:!0,streetViewControl:!0,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_TOP},fullscreenControl:!0};f();e(i,n.center)};return{restrict:"A",template:'<div id="gmaps"><\/div>',replace:!0,link:n,scope:{center:"=?",tenant:"=?"}}})}();appModule.directive("permissionTree",[function(){return{restrict:"E",template:'<div class="permission-tree"><\/div>',scope:{editData:"="},link:function(n,t){function e(){u&&i.jstree("destroy");var t=_.map(n.editData.permissions,function(t){return{id:t.name,parent:t.parentName?t.parentName:"#",text:t.displayName,state:{opened:!0,selected:_.contains(n.editData.grantedPermissionNames,t.name)}}});i.jstree({core:{data:t},types:{"default":{icon:"fa fa-folder tree-item-icon-color icon-lg"},file:{icon:"fa fa-file tree-item-icon-color icon-lg"}},checkbox:{keep_selected_style:!1,three_state:!1,cascade:""},plugins:["checkbox","types"]});u=!0;i.on("changed.jstree",function(t,u){var s,e;u.node&&(s=r,s||(r=!0),u.node.state.selected?(f(i.jstree("get_parent",u.node)),e=$.makeArray(i.jstree("get_children_dom",u.node)),i.jstree("select_node",e)):(e=$.makeArray(i.jstree("get_children_dom",u.node)),i.jstree("deselect_node",e)),s||(n.$apply(function(){n.editData.grantedPermissionNames=o()}),r=!1))})}function f(n){i.jstree("select_node",n,!0);var t=i.jstree("get_parent",n);t&&f(t)}function o(){for(var t=[],r=i.jstree("get_selected",!0),n=0;n<r.length;n++)t.push(r[n].original.id);return t}var i=$(t).find(".permission-tree"),u=!1,r=!1;n.$watch("editData",function(){n.editData&&e()})}}}]);appModule.controller("titleCtrl",["$scope","GoogleWebMastersKey",function(n,t){n.GoogleWebMastersKey=t}]);appModule.directive("geoAddress",function(){return{restrict:"E",templateUrl:"~/App/common/directives/address/geo-address.cshtml",scope:{address:"="},replace:!0,controller:["$scope","abp.services.app.geo",function(n,t){function r(){var r=[];r.push(t.getCountries({}).success(function(t){n.countries=t.items}));n.address.country.countryUID!=null&&r.push(t.getMacroProvinces({countryUID:n.address.country.countryUID}).success(function(t){n.macroProvinces=t.items}));n.address.macroProvince.macroProvinceUID!=null&&r.push(t.getProvinces({dwCountryUID:n.address.country.dwCountryUID}).success(function(t){n.provinces=t.items}));n.address.province.provinceUID!=null&&r.push(t.getCities({provinceUID:n.address.province.provinceUID}).success(function(t){n.cities=t.items}));n.address.city.cityUID!=null&&r.push(t.getLocalZones({cityUID:n.address.city.cityUID}).success(function(t){n.localZones=t.items}));Promise.all(r).then(function(n){console.log(n);i("#CountrySelectionCombobox");i("#MacroProvinceSelectionCombobox");i("#ProvinceSelectionCombobox");i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox")})}function i(n){setTimeout(function(){$(n).selectpicker("refresh")},0)}console.log(n.address);n.address.country==null&&(n.address.country={countryUID:n.address.countryUID});n.address.macroProvince==null&&(n.address.macroProvince={macroProvinceUID:n.address.macroProvinceUID});n.address.province==null&&(n.address.province={provinceUID:n.address.provinceUID});n.address.city==null&&(n.address.city={cityUID:n.address.cityUID});n.address.localZone==null&&(n.address.localZone={localZoneUID:n.address.localZoneUID});n.countries=[];n.macroProvinces=[];n.provinces=[];n.cities=[];n.localZones=[];n.countrySelected=function(){if(n.address.macroProvinceUID=null,n.address.provinceUID=null,n.address.cityUID=null,n.address.localZoneUID=null,n.address.macroProvince.macroProvinceUID=null,n.address.province.provinceUID=null,n.address.city.cityUID=null,n.address.localZone.localZoneUID=null,n.address.country)n.address.countryUID=n.address.country.countryUID;else{n.macroProvinces=[];n.provinces=[];n.cities=[];n.localZones=[];i("#MacroProvinceSelectionCombobox");i("#ProvinceSelectionCombobox");i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox");n.address.countryUID=null;return}n.address.country.hasRegions?t.getMacroProvinces({countryUID:n.address.country.countryUID}).success(function(t){n.macroProvinces=t.items;n.provinces=[];n.cities=[];n.localZones=[];i("#MacroProvinceSelectionCombobox");i("#ProvinceSelectionCombobox");i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox")}):n.address.country.hasProvinces?t.getProvinces({dwCountryUID:n.address.country.countryUID}).success(function(t){n.provinces=t.items;n.cities=[];n.localZones=[];i("#ProvinceSelectionCombobox");i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox")}):t.getCities({dwCountryUID:n.address.country.countryUID}).success(function(t){n.cities=t.items;n.localZones=[];i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox")})};n.macroProvinceSelected=function(){if(n.address.provinceUID=null,n.address.cityUID=null,n.address.localZoneUID=null,n.address.province.provinceUID=null,n.address.city.cityUID=null,n.address.localZone.localZoneUID=null,n.address.macroProvince)n.address.macroProvinceUID=n.address.macroProvince.macroProvinceUID;else{n.provinces=[];n.cities=[];n.localZones=[];i("#ProvinceSelectionCombobox");i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox");n.address.macroProvinceUID=null;return}t.getProvinces({dwCountryUID:n.address.country.countryUID}).success(function(t){n.provinces=t.items;n.cities=[];n.localZones=[];i("#ProvinceSelectionCombobox");i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox")})};n.provinceSelected=function(){if(n.address.cityUID=null,n.address.localZoneUID=null,n.address.city.cityUID=null,n.address.localZone.localZoneUID=null,n.address.province)n.address.provinceUID=n.address.province.provinceUID;else{n.cities=[];n.localZones=[];i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox");n.address.provinceUID=null;return}t.getCities({provinceUID:n.address.province.provinceUID}).success(function(t){n.cities=t.items;n.localZones=[];i("#CitySelectionCombobox");i("#LocalZoneSelectionCombobox")})};n.citySelected=function(){if(n.address.localZoneUID=null,n.address.localZone.localZoneUID=null,n.address.city)n.address.cityUID=n.address.city.cityUID;else{n.localZones=[];i("#LocalZoneSelectionCombobox");n.address.cityUID=null;return}t.getLocalZones({cityUID:n.address.city.cityUID}).success(function(t){n.localZones=t.items;i("#LocalZoneSelectionCombobox")})};n.localZoneSelected=function(){n.address.localZoneUID=n.address.localZone?n.address.localZone.localZoneUID:null};r()}]}});appModule.directive("calendar",function(){return{restrict:"E",templateUrl:"~/App/common/directives/calendar/calendar.cshtml",scope:{options:"=",date:"="},replace:!0,controller:["$scope",function(n){function t(){n.date=n.date=="0001-01-01T00:00:00"||n.date==null?undefined:new Date(n.date)}n.openDatePickerPopup=function(){n.datePickerPopup.opened=!0};n.datePickerPopup={opened:!1,format:null};n.closeText=app.localize("close");n.clearText=app.localize("clear");n.currentText=app.localize("current");n.datePickerPopup.format=n.options.minMode=="year"?"yyyy":"mediumDate";t()}]}}),function(){"use strict";angular.module("angular-flexslider",[]).directive("flexSlider",["$parse","$timeout",function(n,t){return{restrict:"AE",scope:!1,replace:!0,transclude:!0,template:'<div class="flexslider-container"><\/div>',compile:function(i,r,u){return function(i,f){var l,a,e,s,c,h,v,o,y;return h=(r.slide||r.flexSlide).match(/^\s*(.+)\s+in\s+(.*?)(?:\s+track\s+by\s+(.+?))?\s*$/),c=h[1],a=h[2],y=angular.isDefined(h[3])?n(h[3]):n(""+c),e=null,o={},s=function(n,t){var r;return r={},r[c]=n,r.$index=t,y(i,r)},l=function(n,t,r){var f,e;if(e=s(n,t),o[e]!=null)throw"Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys.";return f=i.$new(),f[c]=n,f.$index=t,u(f,function(t){var i;return i={collectionItem:n,childScope:f,element:t},o[e]=i,typeof r=="function"?r(i):void 0})},v=function(n,t){var i,r;if(r=s(n,t),i=o[r],i!=null)return delete o[r],i.childScope.$destroy(),i},i.$watchCollection(a,function(u,h){var c,p,w,st,b,a,k,ht,y,it,rt,ut,d,g,ft,et,nt,tt,ot,ct,lt,at,vt;if((u!=null?u.length:void 0)||(h!=null?h.length:void 0)){if(e!=null){for(it=e.data("flexslider"),st=Object.keys(o).length,u==null&&(u=[]),ft={},a=et=0,ct=u.length;et<ct;a=++et)w=u[a],ft[s(w,a)]=w;if(d=function(){var n,i,t;for(t=[],a=n=0,i=u.length;n<i;a=++n)w=u[a],o[s(w,a)]==null&&t.push({value:w,index:a});return t}(),g=function(){var n=[];for(ut in o)a=o[ut],ft[ut]==null&&n.push(a.collectionItem);return n}(),d.length===1&&g.length===0||d.length===0){for(nt=0,lt=g.length;nt<lt;nt++)b=g[nt],b=v(b,u.indexOf(b)),it.removeSlide(b.element);for(tt=0,at=d.length;tt<at;tt++)b=d[tt],k=b.index,l(b.value,k,function(n){return k===st&&(k=void 0),i.$evalAsync(function(){return it.addSlide(n.element,k)})});return}}for(o={},e!=null&&e.remove(),rt=angular.element('<ul class="slides"><\/ul>'),e=angular.element('<div class="flexslider"><\/div>'),e.append(rt),f.append(e),a=ot=0,vt=u.length;ot<vt;a=++ot)w=u[a],l(w,a,function(n){return rt.append(n.element)});y={};for(c in r)if(p=r[c],c.indexOf("$")!==0){if(!isNaN(ht=parseInt(p))){y[c]=ht;continue}if(p==="false"||p==="true"){y[c]=p==="true";continue}if(c==="start"||c==="before"||c==="after"||c==="end"||c==="added"||c==="removed"){y[c]=function(t){var r;return r=n(t),function(n){return i.$apply(function(){return r(i,{$slider:{element:n}})})}}(p);continue}if(c==="startAt"){y[c]=n(p)(i);continue}y[c]=p}return!y.sliderId&&r.id&&(y.sliderId=""+r.id+"-slider"),y.sliderId&&e.attr("id",y.sliderId),t(function(){return e.flexslider(y)},0)}})}}}}])}.call(this);appModule.directive("coordinates",function(){return{restrict:"E",templateUrl:"~/App/common/directives/coordinates/coordinates.cshtml",scope:{address:"="},replace:!0,controller:["$scope",function(n){function u(){if(n.address!=null&&n.address.lat!=null&&n.address.lat!=0&&n.address.lng!=null&&n.address.lng!=0){t=new google.maps.Map(document.getElementById("map"),{mapTypeControl:!1,center:{lat:n.address.lat,lng:n.address.lng},zoom:8,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_CENTER},zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.LEFT_CENTER},scaleControl:!0,streetViewControl:!0,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_TOP},fullscreenControl:!0});var i=new google.maps.Marker({map:t,position:{lat:n.address.lat,lng:n.address.lng},center:{lat:n.address.lat,lng:n.address.lng},icon:r.KW.icon})}}function f(){var u=e(n.address);i.geocode({address:u},function(i,u){if(u==google.maps.GeocoderStatus.OK){t.setCenter(i[0].geometry.location);var f=new google.maps.Marker({map:t,position:i[0].geometry.location,center:i[0].geometry.location,icon:r.KW.icon});n.$apply(function(){n.coordinate={lat:i[0].geometry.location.lat(),lng:i[0].geometry.location.lng()};n.address.lat=parseFloat(i[0].geometry.location.lat().toFixed(8));n.address.lng=parseFloat(i[0].geometry.location.lng().toFixed(8))})}else swal({title:app.localize("CouldNotFoundAddressHeader"),text:app.localize("CouldNotFoundAddress"),timer:2e3,showConfirmButton:!1})})}function e(n){var t="";return n!=null&&n!=undefined&&(n.streetName!=null&&n.streetName!=undefined&&n.streetName!=null&&(t+=" "+n.streetName),n.addressLineTwo!=null&&n.streeaddressLineTwotName!=undefined&&n.streeaddressLineTwotName!=null&&(t+=" "+n.addressLineTwo),n.streetNumber!=null&&n.streetNumber!=undefined&&n.streetNumber!=null&&(t+=" "+n.streetNumber),n.city!=null&&n.city!=undefined&&n.city!=null&&n.city.cityUID!=null&&(t+=" "+n.city.cityName),n.province!=null&&n.province!=undefined&&n.province!=null&&n.province.provinceUID!=null&&(t+=" "+n.province.provinceName),n.country!=null&&n.country!=undefined&&n.country!=null&&n.country!=null&&(t+=" "+n.country.localLanguageCountryName),n.region!=null&&n.region!=undefined&&n.region!=null&&n.region!=null&&(t+=" "+n.region.regionName),n.localZone!=null&&n.localZone!=undefined&&n.localZone!=null&&n.localZone.localZoneUID!=null&&(t+=" "+n.localZone.localZoneName)),t}n.coordinate={lat:0,lng:0};var i,t,r={KW:{icon:"/Content/map/pointer-1.svg"}};u();n.loadPage=function(){if(n.address!=null&&n.address.country!=null&&n.address.city!=null){i=new google.maps.Geocoder;t=new google.maps.Map(document.getElementById("map"),{mapTypeControl:!1,zoom:8});f()}}}]}});appModule.directive("favorites",function(){return{restrict:"E",templateUrl:"~/App/common/directives/favorites/favorites.cshtml",scope:{},replace:!0,controller:["$scope","appSession","cookieService","abp.services.app.listings","$cookies",function(n,t,i,r,u){function e(){n.loading=!0;var u=i.getFavoriteListings();u.length>0?r.getFavoriteListingForWebSite({listingIds:u,tenantId:t.region.tenantId,regionId:f,languageCode:abp.localization.currentLanguage.name,homeRegionCurrencyUID:t.region.defaultCurrencyId,homeRegionId:t.region.id}).success(function(t){n.favoriteListings={data:t};n.loading=!1}):(n.favoriteListings={data:null},n.loading=!1)}n.favoriteListings=[];var f=parseInt(u.get("destinationRegionIdCookie"));(f==null||f==0)&&(f=t.region.id);n.addRemoveFavoriteListingFull=function(n,t){i.addRemoveFavoriteListing(n,t);e()};n.openAgentContactModal=function(n,t){i.openAgentContactModal(n,t)};e()}]}});appModule.directive("equalHeight",function(){return{restrict:"A",scope:!1,link:function(){function n(n){var i=document.querySelectorAll(n),r=0,u=0,t;if(i&&i.length>0){for(u=i.length,t=0;t<u;t++)i[t].style.height="",i[t].clientHeight>r&&(r=i[t].clientHeight);for(t=0;t<u;t++)i[t].style.height=r+"px"}}function t(){var t=setInterval(function(){$("img").hasClass("b-loaded")&&(n(".js-equal-height"),clearInterval(t))},500)}document.addEventListener&&(document.addEventListener("DOMContentLoaded",function(){n(".js-equal-height")}),window.addEventListener("resize",function(){n(".js-equal-height")}));$(window).resize(function(){n(".js-equal-height")});t()}}});appModule.directive("lookupLists",function(){return{restrict:"E",templateUrl:"~/App/common/directives/lookupLists/lookupLists.cshtml",scope:{lookups:"=",lookupsId:"=",required:"="},replace:!0,controller:["$scope","abp.services.app.lookupLists","appSession",function(n,t,i){var f=i,r=i.region!=null?i.region.tenantId:0,u=i.region!=null?i.region.id:0;getLookupListsDropDown=function(){t.getLookupLists({listId:n.lookups,tenantId:r,regionId:u}).success(function(t){n.lookupLists=t.items}).finally(function(){setTimeout(function(){$(".lookups").selectpicker("refresh")},0)})};getLookupListsDropDown()}]}});appModule.directive("ngSpinnerBar",["$rootScope","$state",function(n,t){return{link:function(i,r){r.addClass("hide");n.$on("$stateChangeStart",function(){r.removeClass("hide")});n.$on("$stateChangeSuccess",function(){r.addClass("hide");$("body").removeClass("page-on-load");Layout.setSidebarMenuActiveLink("match",null,t);setTimeout(function(){App.scrollTop()},n.settings.layout.pageAutoScrollOnLoad)});n.$on("$stateNotFound",function(){r.addClass("hide")});n.$on("$stateChangeError",function(){r.addClass("hide")})}}}]);appModule.directive("a",function(){return{restrict:"E",link:function(n,t,i){if(i.ngClick||i.href===""||i.href==="#")t.on("click",function(n){n.preventDefault()})}}});appModule.directive("dropdownMenuHover",function(){return{link:function(n,t){t.dropdownHover()}}});appModule.directive("recentlyViewed",function(){return{restrict:"E",templateUrl:"~/App/common/directives/recentlyViewed/recentlyViewed.cshtml",scope:{},replace:!0,controller:["$scope","appSession","cookieService","abp.services.app.listings","$timeout","$cookies",function(n,t,i,r,u,f){function o(){n.loading=!0;var u=i.getRecentlyViewedListings();u.length>0?r.getRecentlyViewedListingForWebSite({listingIds:u,tenantId:t.region.tenantId,regionId:e,languageCode:abp.localization.currentLanguage.name,homeRegionCurrencyUID:t.region.defaultCurrencyId,homeRegionId:t.region.id}).success(function(t){n.recentlyViewedListings={data:t};n.loading=!1}):(n.recentlyViewedListings={data:null},n.loading=!1)}n.recentlyViewedListings=[];var e=parseInt(f.get("destinationRegionIdCookie"));(e==null||e==0)&&(e=t.region.id);o();n.openAgentContactModal=function(n,t){i.openAgentContactModal(n,t)}}]}});appModule.directive("savedSearch",function(){return{restrict:"E",templateUrl:"~/App/common/directives/savedSearches/savedSearches.cshtml",scope:{saved:"=ngModel",mysaved:"=",criterian:"=",search:"="},replace:!0,controller:["$scope","abp.services.app.savedSearch","appSession","savedsearches",function(n,t,i,r){function f(i,f){t.getSavedSearchForEdit({id:null}).success(function(e){n.mysavedCriterian=e.criteriaList;n.myListingBusy=!0;i.regionId=u;t.createOrUpdateSavedSearch({savedSearchUser:i,criteriaList:f}).success(function(t){if(t.retVal==!0){var i=t.subscriptionToken,u=r.getCookie();(u==""||u!=i)&&r.putCookie("mysavedsearches",i);n.savedSearchSaved=app.localize("SavedSearchSuccessfullySaved");n.hideSavedSearch=!0}n.saved=!0}).finally(function(){n.mysaved.name="";n.mysaved.email="";n.myListingBusy=!1})})}vm=this;var e=i,o=i.region!=null?i.region.tenantId:0,u=i.region!=null?i.region.id:0;n.mysavedCriterian=n.criterian;n.mysaved=n.mysaved;n.submit=function(){if(!n.saved){if(r.validate(n.mysaved))return;var t=r.getCriterias(n.mysavedCriterian,n.search);f(n.mysaved,t)}}}]}});appModule.directive("searchfilter",function(){return{restrict:"E",templateUrl:function(n,t){return"~/App/common/directives/searchfilters/templates/"+t.mode+".cshtml"},scope:{pagefilter:"=",needlist:"=",sessionvalue:"=",close:"&onClose"},replace:!0,controller:["$scope","abp.services.app.tenant","abp.services.app.session","abp.services.app.region","abp.services.app.office","abp.services.app.agent","$stateParams","abp.services.app.geo","appSession","$location","$cookies",function(n,t,i,r,u,f,e,o,s,h,c){function y(){abp.services.app.regionalSettings.getWebsiteDestRegionalAllSettings({settingNames:s.settingNames,DestinationRegionId:n.selectedCountryRegionId},{async:!1}).done(function(n){s.destinationRegion=n.destRegion;s.destinationRegionalSettings=n.destRegionalLists;s.destinationRegionLanguages=n.DestRegionLanguages})}function v(){n.close()}function p(){n.pagefilter.location="";n.pagefilter.name="";n.pagefilter.language="";n.geoValue="";n.pagefilter.geoId="";n.pagefilter.geoGroup="";$("#office-agent-input").val(null);v()}function w(n){if(n=="Country")return 0;if(n=="MacroProvince")return 1;if(n=="Province")return 2;if(n=="City")return 3;if(n=="LocalZone")return 4;throw new Error("Can not recognize DefaultGeoSearchLevel");}var l=this,a;l.selectedGeoItem={};n.isAgent=n.pagefilter.filterType==2;n.activeIndex=n.isAgent?2:1;n.showToggle=!abp.IsOffice;a=c.get("destinationRegionIdCookie");(a==null||typeof a=="undefined"||a==""||a=="0")&&c.put("destinationRegionIdCookie",s.region.id,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});n.selectedCountryRegionId=parseInt(c.get("destinationRegionIdCookie"));getCountryFlagList=function(){r.getRegionListForFlagDropdown({tenantId:s.region.tenantId,homeRegionId:s.region.id}).success(function(t){n.countryFlagsList=t})};n.countrySelected=function(t){c.put("destinationRegionIdCookie",t.regionId,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});n.selectedCountryRegionId=t.regionId;y();v()};l.getDestRegionalSetting=function(n){for(var i,t=0;t<s.destinationRegionalSettings.length;t++)if(s.destinationRegionalSettings[t].name==n)return s.destinationRegionalSettings[t].type=="ListStringSettingValueDto"||s.destinationRegionalSettings[t].type=="ListIntSettingValueDto"?s.destinationRegionalSettings[t].output.values:s.destinationRegionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};$(document).ready(function(){$("#show-more").on("hide.bs.collapse",function(){$("#showMoreLess").text(app.localize("websiteMore"))});$("#show-more").on("show.bs.collapse",function(){$("#showMoreLess").text(app.localize("websiteLess"))});getCountryFlagList()});n.tabs=[{id:1,title:app.localize("websiteOffice"),template:"/App/common/views/listings/tabs/listingGallery.cshtml",icon:n.isAgent?"office-tab":"office-tab-active"},{id:2,title:app.localize("websiteAgent"),template:"/App/common/views/listings/tabs/mapSearch.cshtml",icon:n.isAgent?"agent-tab-active":"agent-tab"}];n.switchTabs=function(t){l.tabClicked=!0;t===1?(n.isAgent=!1,angular.forEach(n.tabs,function(t,i){n.tabs[i].icon=n.tabs[i].id===1?"office-tab-active":"agent-tab"}),n.pagefilter.filterType=1,n.SearchData()):(n.isAgent=!0,angular.forEach(n.tabs,function(t,i){n.tabs[i].icon=n.tabs[i].id===2?"agent-tab-active":"office-tab"}),n.pagefilter.filterType=2,n.SearchData())};n.loading=!0;n.SearchData=function(){v()};n.Reset=function(){p()};n.modelOptions={debounce:{"default":500,blur:250},getterSetter:!0};n.onSelect=function(t){n.geoValue=t.name;n.pagefilter.geoId=t.id;n.pagefilter.geoGroup=t.group;l.selectedGeoItem=t;n.close()};l.getRegionalSetting=function(n){for(var i,t=0;t<s.regionalSettings.length;t++)if(s.regionalSettings[t].name==n)return s.regionalSettings[t].type=="ListStringSettingValueDto"||s.regionalSettings[t].type=="ListIntSettingValueDto"?s.regionalSettings[t].output.values:s.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};n.getLocation=function(n){var r=w(l.getDestRegionalSetting("DefaultGeoSearchLevel")),u=l.getDestRegionalSetting("DefaultGeoSearchValues"),t=h.absUrl(),i="";return(t.indexOf("officeagentsearch/2")!=-1||t.indexOf("officeagentsearch/1")!=-1||t.indexOf("officeagentsearch")!=-1||t.indexOf("office")!=-1||t.indexOf("agents")!=-1)&&(i="Office"),l.typeaheadIsLoading=!0,new Promise(function(t){o.getSearchGeo({search:n,countryUID:s.destinationRegion.countryId,level:r,ids:u,type:i,regionId:s.region.id}).success(function(n){for(var i=0;i<n.items.length;i++)n.items[i].groupNameLocalized=app.localize(n.items[i].groupName);l.typeaheadIsLoading=!1;t(n.items)})})}}]}});appModule.directive("sendMessage",function(){return{restrict:"E",templateUrl:"~/App/common/directives/sendMessage/sendMessage.cshtml",scope:{sourceType:"=",sourceId:"=",leadSourceId:"=",trainingDetails:"="},replace:!0,controllerAs:"vm",bindToController:!0,controller:["$scope","abp.services.app.contactForms","appSession","Notification","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt",function(n,t,i,r,u,f,e,o){var s=this,h;s.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",i.region.tenantFullName);s.captchaKey=f;n.contact={regionId:i.destinationRegion.id,leadSourceId:s.leadSourceId};o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n});s.sourceType=="office"?s.placeholder=app.localize("websiteCommentPlaceholderOfficeContact"):s.sourceType=="agent"?s.placeholder=app.localize("websiteAgentContactPlaceHolder"):s.sourceType=="team"?s.placeholder=app.localize("Teams.websiteTeamContactPlaceHolder"):(s.sourceType=="trainingOffice"||s.sourceType=="trainingVenue")&&(s.placeholder=app.localize("websiteTrainingContactPlaceHolder"));h=function(t){t&&(t.result?r.success(app.localize("websiteMessageHasBeenSent")):(r.error(app.localize("websiteAnErrorOccured")),console.log(t.message)),n.contact.name="",n.contact.email="",n.contact.phone="",n.contact.comments="",n.contactCreateForm.$setPristine(),n.contactCreateForm.$setUntouched(),s.busy=!1)};s.submit=function(){if(s.displayCaptcha){if(e.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=e.getResponse()}s.busy=!0;s.sourceType=="office"?(n.contact.officeId=s.sourceId,t.sendMessageForOffice(n.contact).success(function(n){h(n)}).finally(function(){o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n})}),s.displayCaptcha&&e.reload(),u.registerHit({tenantId:i.region.tenantId,regionId:i.region.id,name:app.consts.hitsName.officeLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,officeId:s.sourceId})):s.sourceType=="agent"?(n.contact.agentId=s.sourceId,t.sendMessageForAgent(n.contact).success(function(n){h(n)}).finally(function(){o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n})}),s.displayCaptcha&&e.reload(),u.registerHit({tenantId:i.region.tenantId,regionId:i.region.id,name:app.consts.hitsName.agentLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,agentId:s.sourceId})):s.sourceType=="listing"?(n.contact.listingId=s.sourceId,t.sendMessageForListing(n.contact).success(function(n){h(n)}).finally(function(){o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n})}),e.reload(),u.registerHit({tenantId:i.region.tenantId,regionId:i.region.id,name:app.consts.hitsName.listingLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,listingId:s.sourceId})):s.sourceType=="team"?(n.contact.teamId=s.sourceId,t.sendMessageForTeam(n.contact).success(function(n){h(n)}).finally(function(){o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n})}),s.displayCaptcha&&e.reload(),u.registerHit({tenantId:i.region.tenantId,regionId:i.region.id,name:app.consts.hitsName.teamLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,teamId:s.sourceId})):(s.sourceType=="trainingOffice"||s.sourceType=="trainingVenue")&&(n.contact.trainingId=s.sourceId,n.contact.trainingTitle=s.trainingDetails.trainingTitle,n.contact.trainingDate=s.trainingDetails.trainingDate,n.contact.trainingUrl=s.trainingDetails.trainingUrl,s.sourceType=="trainingOffice"&&(n.contact.officeId=s.trainingDetails.trainingSourceId),s.sourceType=="trainingVenue",t.sendMessageForTraining(n.contact).success(function(n){h(n)}).finally(function(){o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n})}),s.displayCaptcha&&e.reload())}}]}});appModule.directive("sendMessageListings",function(){return{restrict:"E",templateUrl:"~/App/common/directives/sendMessage/sendMessageListings.cshtml",scope:{agentInfo:"="},replace:!0,controllerAs:"vm",bindToController:!0,controller:["$scope","abp.services.app.contactForms","appSession","Notification","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt",function(n,t,i,r,u,f,e,o){var s=this,h;s.agent=s.agentInfo;s.captchaKey=f;s.isSoftLeadSent=!1;s.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",i.region.tenantFullName);n.contact={agentId:s.agent.agentId,regionId:i.destinationRegion.id,listingId:s.agent.listingId};o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n});h=function(t){t&&(s.success=t.result,t.result?r.success(app.localize("websiteMessageHasBeenSent")):(r.error(app.localize("websiteAnErrorOccured")),console.log(t.message)),n.contact.name="",n.contact.email="",n.contact.phone="",n.contact.comments="",n.contactCreateForm.$setPristine(),n.contactCreateForm.$setUntouched(),s.busy=!1)};s.getRegionalSetting=function(n){for(var r,t=0;t<i.regionalSettings.length;t++)if(i.regionalSettings[t].name==n)return i.regionalSettings[t].type=="ListStringSettingValueDto"||i.regionalSettings[t].type=="ListIntSettingValueDto"?i.regionalSettings[t].output.values:i.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};s.hideSoftLead=s.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");s.showFullAgentDirectLine=s.hideSoftLead;s.showFullAgentMobile=s.hideSoftLead;s.showFullOfficePhone=s.hideSoftLead;s.submit=function(){if(s.displayCaptcha){if(e.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=e.getResponse()}s.busy=!0;t.sendMessageForListing(n.contact).success(function(n){h(n)}).finally(function(){o.displayCaptcha(i.region.id).success(function(n){s.displayCaptcha=n});s.displayCaptcha&&e.reload();u.registerHit({tenantId:i.region.tenantId,regionId:i.region.id,name:app.consts.hitsName.listingLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,listingId:s.agent.listingId})})};s.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};s.processSoftLead=function(n){switch(n){case 1:s.showFullAgentDirectLine=!0;break;case 2:s.showFullAgentMobile=!0;break;case 3:s.showFullOfficePhone=!0}s.isSoftLeadSent||u.registerHit({tenantId:i.region.tenantId,regionId:i.region.id,name:app.consts.hitsName.listingSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,listingId:s.agent.listingId}).success(function(){s.isSoftLeadSent=!0})}}]}});appModule.directive("static",function(){return{restrict:"E",replace:!0,scope:{page:"=page"},controller:["$scope","abp.services.app.staticContent","appSession","$element","$attrs","$compile","$cookies",function(n,t,i,r,u,f){function e(){n.currentLanguage=abp.localization.currentLanguage}function o(){t.getStaticContentForPage({regionId:parseInt(n.regionId),languageCode:n.currentLanguage.name,pageName:n.page.name,postingId:n.page.postingId,draft:window.location.href.indexOf("preview=draft")>0}).success(function(t){$.each(t,function(t,i){switch(i.key){case"contentHtml":n.html=i.value;var u=angular.element(n.html);r.replaceWith(f(u)(n))}})})}function s(){e();o()}n.regionId=i.region.id;n.languages=i.regionLanguages;n.currentLanguage={};n.changeLanguage=function(n){var t=window.location.href,i=t.indexOf("lan=");i!=-1&&(t=t.slice(0,i)+"lan="+n+t.slice(i+9));location.href=abp.appPath+"AbpLocalization/ChangeCulture?cultureName="+n+"&returnUrl="+t;e()};n.languages=i.regionLanguages;s()}]}}),function(){appModule.filter("momentFormat",function(){return function(n,t){return n?moment(n).format(t):"-"}}).filter("fromNow",function(){return function(n){return moment(n).fromNow()}})}(),function(){appModule.factory("appSession",["$cacheFactory","$cookies",function(n,t){var u=t.get("destinationRegionIdCookie");(u==null||typeof u=="undefined"||u=="")&&t.put("destinationRegionIdCookie",0,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});var r=parseInt(t.get("destinationRegionIdCookie")),e=n("sessionCacheRegional"),i={region:null,regionalSettings:[],rootTemplatePath:"",regionLanguages:[],siteSettings:[],getSiteSetting:function(n){var t=_.findWhere(this.siteSettings,{settingEnumName:n});return t!=null?t.settingValue:null}},f=["DefaultGeoSearchLevel","DefaultGeoSearchValues","IsGoogleMapsHiddenOnWebsite","ShowListingCountAgentPage","RegionSocialMediaFacebook","RegionSocialMediaTwitter","RegionSocialMediaLinkedIn","RegionSocialMediaYoutube","RegionSocialMediaInstagram","IsMapViewAvalibleOnRegionalWebsite","IsPDFBrochureAvalibleOnRegionalWebsite","ShowListingTotalRooms","ShowListingLivingRooms","DevelopmentProjects","EnergyRating","HideAgentSearchResultsText","WebsiteRefineDisplay","IsOpenHouseVisibleOnWebsite","GoogleTagManagerKey","IsMapSearchListingSearchEnabledOnRegionalWebsite","IsMapSearchDefaultOnRegionalWebsite","ShowListingCountOfficePage","DevelopmentProjectsWebsite","IsMortgageCalculatorVisibleOnWebsite","DontAllowGoogleTranslate","EnergyRating","EnableGDPR","Tax Included","Always Open Show More on Home Page Search","IsAlternateCurrencyVisibleOnWebsite","Is Built Area hidden for Land Listings","Hide Lot Dimensions for Res Comm","Hide Soft Lead Functionality on Regional Website","Is T Used for Bedrooms on Regional Website?","Do not show 'Month Built' on Regional Website","Display External Listing ID on Website & Admin","Has Cookie Consent Policy?","Display License Number & Company Name on Office Profile","Hide 'Date Available' on Regional Website","Use Detailed Property Type in H1 on Listing Details","Has Metro Stations","Is Interns Enabled?","Enable Public-Transportation Feature","Display Office Staff/Admin on website"];return abp.services.app.regionalSettings.getWebsiteRegionalAllSettings({settingNames:f,DestinationRegionId:r},{async:!1},{cache:e}).done(function(n){i.regionalSettings=n.regionalLists;i.region=n.region;i.regionLanguages=n.regionLanguages;i.rootTemplatePath=n.rootTemplatePath;i.siteSettings=n.siteSettings;i.settingNames=f;angular.isUndefined(r)||r===null||r===0?(i.destinationRegion=n.region,i.destinationRegionalSettings=n.regionalLists,i.destinationRegionLanguages=n.regionLanguages):(i.destinationRegion=n.destRegion,i.destinationRegionalSettings=n.destRegionalLists,i.destinationRegionLanguages=n.DestRegionLanguages)}),i}])}();appModule.service("chatIntegrationService",["appSession",function(){this.setupChatForWebsite=function(n,t){var r,u;if(retValChatIntegrations=[],t=this.setupPhone(t),n&&t!=undefined&&t.length>0){var e=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)),i={},f=!1;for(r=0;r<n.length;r++){i=n[r];f=i.enabled&&i.chatIntegration.enabled;u={name:i.chatIntegration.name,enabled:f&&t!=null,link:i.chatIntegration.link+""+t,"class":"icon-btn-"+i.chatIntegration.systemName.toLowerCase()};switch(i.chatIntegration.systemName){case"WhatsApp":e&&(u.link="https://wa.me/"+t)}retValChatIntegrations.push(u)}}return retValChatIntegrations};this.setupPhone=function(n){return n!=undefined?n.replace(/\D/g,"").replace(/^0+/,"").replace("+",""):n}}]);appModule.service("cookieService",["$cookies","abp.services.app.hit","appSession","$uibModal",function(n,t,i,r){var o="Fri, 31 Dec 9999 23:59:59 GMT",s="myFavListings",u="fav-on",f="fav-off",c=10,e,h;this.addRemoveFavoriteListing=function(r,e){(e==null||typeof e=="undefined")&&(e=!1);var h=this.getFavoriteListings(),l=i.region,a=$.inArray(r,h);a==-1?(e||(h.push(r),$("#favListing_"+r).addClass(u),$("#favListing_"+r).removeClass(f),t.registerHit({tenantId:l.tenantId,regionId:l.id,name:app.consts.hitsName.listingAddedAsFavorite,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name,listingId:r})),h.length>c&&h.shift()):(h.splice(a,1),$("#favListing_"+r).removeClass(u),$("#favListing_"+r).addClass(f));n.put(s,JSON.stringify(h),{expires:o})};this.getFavoriteListings=function(){var t=n.get(s);return(t==null||typeof t=="undefined"||t=="")&&(t="[]"),JSON.parse(t)};this.isListingInFavorites=function(n){var t=!1,i=this.getFavoriteListings(),r=$.inArray(n,i);return r!=-1&&(t=!0),t};this.getFavOnClass=function(){return u};this.markFavOnForFavoriteListings=function(){$("[id$='favListing_'").each(function(){$(this).removeClass(u);$(this).addClass(f)});var n=this.getFavoriteListings();$.each(n,function(n,t){$("#favListing_"+t).addClass(u);$("#favListing_"+t).removeClass(f)})};e="myRecentlyViewedListings";h=10;this.addRemoveRecentlyViewedListing=function(t,i){(i==null||typeof i=="undefined")&&(i=!1);var r=this.getRecentlyViewedListings(),u=$.inArray(t,r);u==-1&&(i||r.push(t),r.length>h&&r.shift());i&&r.splice(u,1);n.put(e,JSON.stringify(r),{expires:o})};this.getRecentlyViewedListings=function(){var t=n.get(e);return(t==null||typeof t=="undefined"||t=="")&&(t="[]"),JSON.parse(t)};this.openAgentContactModal=function(n,t){var i=r.open({templateUrl:"~/App/common/views/listings/modal/listing-list-contact-modal-dialog.cshtml",controller:"common.views.listing.modal.list.contact as vm",size:"sm",resolve:{id:function(){return n},listingId:function(){return t}}});i.result.then(function(){})}}]);appModule.service("helper",["$location","appSession",function(n,t){this.getLookupListById=function(n,t){if(!angular.isUndefined(n))for(var i=0;i<n.length;i++)if(n[i].listId==t)return n[i].lookupLists;return[]};this.getLookupListByName=function(n,t){if(!angular.isUndefined(n))for(var i=0;i<n.length;i++)if(n[i].listName==listName)return n[i].lookupLists;throw new Error("Can not find lookup list with name "+t);};this.refreshDropDown=function(n){setTimeout(function(){$(n).selectpicker("refresh")},0)};this.isUndefinedOrNull=function(n){return angular.isUndefined(n)||n===null||n===""||n.replace(/\s/g,"")===""};this.isNumber=function(n){return!isNaN(parseFloat(n))&&isFinite(n)};this.doFilter=function(t,i){t[i]!=""||i=="minPrice"?n.search(i,t[i]):n.search(i,null)};this.getDynamicImageByPathNameAndLevel=function(n){if(t.region!=null)return name=t.region.id,"/Custom/"+name+n;throw new Error("Image doesn't exist "+n);};this.getRegionalSetting=function(n,t){for(var r,i=0;i<n.length;i++)if(n[i].name==t)return n[i].type=="ListStringSettingValueDto"||n[i].type=="ListIntSettingValueDto"?n[i].output.values:n[i].output.value;throw new Error("Can not find region setting "+t);}}]);appModule.service("mapService",["appSession","$http","helper",function(n,t){try{google.maps.event.addDomListener(window,"load",this.loadMap);this.loadMap=function(i,r,u,f,e,o,s,h,c,l,a){var p=document.getElementById(i),w=new google.maps.Map(p,{center:{lat:r,lng:u},zoom:f,mapTypeControl:e,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_CENTER},zoomControl:o,zoomControlOptions:{position:google.maps.ControlPosition.LEFT_CENTER},scaleControl:s,streetViewControl:h,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_TOP},fullscreenControl:c,scrollwheel:l,panControl:a}),v=n.rootTemplatePath+"/map/pointer_1.png",y=t.get(v).then(function(){y=v}).catch(function(){y="/Custom/skymark/map/pointer_1.png"}),b={url:v,size:new google.maps.Size(40,40),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(20,40)},k=new google.maps.Marker({position:{lat:r,lng:u},center:{lat:r,lng:u},map:w,icon:b,draggable:!1})}}catch(i){console.log("There is an issue regarding map. Please contact administrator.")}}]);appModule.service("mapServiceListingSearch",["appSession","$http",function(){function i(n,t,i,r){this.pos=n;this.txt_=t;this.cls_=i;this.map_=r;this.div_=null;this.setMap(r)}var s=0;try{i.prototype=new google.maps.OverlayView;i.prototype.onAdd=function(){var n=document.createElement("DIV"),i,t,r;n.className=this.cls_;n.setAttribute("style","position:absolute");n.innerHTML=this.txt_;this.div_=n;i=this.getProjection();t=i.fromLatLngToDivPixel(this.pos);n.style.left=t.x+"px";n.style.top=t.y+"px";r=this.getPanes();r.floatPane.appendChild(n)};i.prototype.draw=function(){var i=this.getProjection(),n=i.fromLatLngToDivPixel(this.pos),t=this.div_;t.style.left=n.x+"px";t.style.top=n.y+"px"};i.prototype.onRemove=function(){this.div_.parentNode.removeChild(this.div_);this.div_=null};i.prototype.hide=function(){this.div_&&(this.div_.style.visibility="hidden")};i.prototype.show=function(){this.div_&&(this.div_.style.visibility="visible")};i.prototype.toggle=function(){this.div_&&(this.div_.style.visibility=="hidden"?this.show():this.hide())};i.prototype.toggleDOM=function(){this.getMap()?this.setMap(null):this.setMap(this.map_)};var n,w=this,v,r,t=[],f=[],e=[],u=[],h,c=null,l=0;function o(){for(var n=0;n<t.length;n++)t[n].setMap(null);for(n=0;n<f.length;n++)f[n].setMap(null);y();t=[];f=[];u=[]}function y(){for(var n=0;n<u.length;n++)u[n].close()}function b(n){return n==1?'<span class="listing-cluster lc-one " style="position: absolute;cursor:pointer;z-index: -1;"><\/span>':n<100?'<span class="listing-cluster lc-small " style="position: absolute;cursor:pointer;z-index: -1;"><span class="cluster-text">'+n+"<\/span><\/span>":n<1e3?'<span class="listing-cluster lc-medium " style="position: absolute;cursor:pointer;z-index: -1;"><span class="cluster-text">'+n+"<\/span><\/span>":'<span class="listing-cluster lc-large " style="position: absolute;cursor:pointer;z-index: -1;"><span class="cluster-text">'+n+"<\/span><\/span>"}function k(n){var t=0;return n==1?t=10:n<100?t=30:n<1e3?t=40:this.diameter=50,t}function p(t){if(y(),t.nbrOfListings<=6){var i=new google.maps.InfoWindow({content:t.infoWindowContent});i.setZIndex(25);u.push(i);i.open(n,t)}}function a(u){var s,h,c;r.mapZoomFactor=1<<n.getZoom();r.mapSearchCurrentZoom=l;s=n.getBounds();s!=null&&(h=s.getSouthWest(),c=s.getNorthEast(),h!=null&&(r.viewportMinX=h.lng(),r.viewportMinY=h.lat()),c!=null&&(r.viewportMaxX=c.lng(),r.viewportMaxY=c.lat()));v.getListingsForWebSiteMapSearch(r).success(function(r){var c,g,s,v,y,w,h;if(o(),e=r.items,e.length>0){for(c=new google.maps.LatLngBounds,g=n.getBounds(),h=0;h<e.length;h++)s=e[h],v=new google.maps.Marker({position:{lat:s.lat,lng:s.lng},title:s.nbrOfListings+"",map:n,icon:{path:google.maps.SymbolPath.CIRCLE,fillColor:"#c4df9b",fillOpacity:.1,scale:5,strokeWeight:0},infoWindowContent:(s.infoWindowContent+"").replace(/PiecesNbrLabel/g,app.localize("websiteTotalRooms")).replace(/BedRoomsNbrLabel/g,app.localize("websiteBedrooms")).replace(/BathRoomNbrLabel/g,app.localize("websiteBathrooms")).replace(/SqFootLabel/g,s.MeasurementType==0?app.localize("websiteLivingSqM"):app.localize("websiteLivingSqF")).replace(/OPENHOUSELABEL/g,app.localize("websiteListingSearchOpenHouse")),nbrOfListings:s.nbrOfListings,diameter:k(s.nbrOfListings)}),google.maps.event.addListener(v,"click",function(){p(this)}),t.push(v),y=b(s.nbrOfListings),w=new i(new google.maps.LatLng(s.lat,s.lng),y,"",n),f.push(w);if(u){for(h=0;h<t.length;h++)c.extend(t[h].getPosition());n.fitBounds(c);n.maxZoom=0;google.maps.event.addListener(n,"zoom_changed",function(){o();l=n.getZoom();a()})}}else d(" <div class='' id='ll-content-container'><input type='hidden' value='False' id='hiddenRTL' name='hiddenRTL'>  <div class='contact-us-link' id='contact-top'><a href='/contactus'  id='A1'>"+app.localize("websiteContactusMessage")+"<i class='chevron'><\/i><\/a><\/div> <div class='ng-scope'>    \t<div class='no-results'>        \t\t<h2>"+app.localize("websiteNoMorelistingsMessage")+"<\/h2>     \t<\/div>    \t<div class='no-results'>        \t\t<p><a href='/contactus' id='A1'>"+app.localize("websiteSendUsMessage")+" "+app.localize("websiteThankyoumessage")+"<\/a><\/p>    \t<\/div>\t<\/div><\/div><\/div>")}).finally(function(){})}function d(i){var o=new google.maps.LatLngBounds,e=new google.maps.Marker({position:new google.maps.LatLng(h.latitude,h.longitude),title:"",map:n,icon:{path:google.maps.SymbolPath.CIRCLE,fillColor:"#c4df9b",fillOpacity:.1,scale:5,strokeWeight:0},infoWindowContent:i}),f=new google.maps.InfoWindow({content:i}),r;for(f.setZIndex(25),t.push(e),u.push(f),f.open(n,e),r=0;r<t.length;r++)o.extend(t[r].getPosition());n.maxZoom=0}distanceBetween2Pts=function(n,t,i){var r=Math.floor(t.x*(1<<n.getZoom())),u=Math.floor(i.x*(1<<n.getZoom())),f=Math.floor(t.y*(1<<n.getZoom())),e=Math.floor(i.y*(1<<n.getZoom()));return Math.sqrt(Math.pow(r-u,2)+Math.pow(f-e,2))};getPointFromMarker=function(n){var t=Math.sin(n.position.lat()*Math.PI/180);return new google.maps.Point(256*(.5+n.position.lng()/360),256*(.5-Math.log((1+t)/(1-t))/(4*Math.PI)))};getPointFromLatLng=function(n){var t=Math.sin(n.lat()*Math.PI/180);return new google.maps.Point(256*(.5+n.lng()/360),256*(.5-Math.log((1+t)/(1-t))/(4*Math.PI)))};function g(i){for(var f=!1,u=0;u<t.length;u++){var r=t[u],e=getPointFromMarker(r),o=distanceBetween2Pts(n,e,getPointFromLatLng(i.latLng));o<=r.diameter&&r.nbrOfListings<=6&&(p(r),f=!0)}f||(n.setZoom(n.getZoom()+1),n.setCenter(i.latLng))}w.createMap=function(t,i,u,f,e,y){if(s!=1){o();v=y;r=e;c=t;h=u;l=u.googleZoomLevel-1;var p=new google.maps.LatLng(u.latitude,u.longitude),w={zoom:u.googleZoomLevel-1,center:p,mapTypeId:google.maps.MapTypeId.ROADMAP,maxZoom:14};n=new google.maps.Map(document.getElementById(i),w);n.setCenter(p);a(!0);google.maps.event.addDomListener(n,"dragend",function(){c.resetSearchPanel();r=c.requestParams;o();a()});google.maps.event.addDomListener(n,"click",g)}s=s+1}}catch(nt){}}]);appModule.service("openstreetmapService2",["appSession","$http","helper",function(n,t){try{var i;this.loadMap=function(r,u,f,e){var h=document.getElementById(r);i===undefined&&(i=L.map(h).setView([u,f],e));L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap<\/a> contributors',maxZoom:18}).addTo(i);var o=n.rootTemplatePath+"/map/pointer_1.png",s=t.get(o).then(function(){s=o}).catch(function(){s="/Custom/skymark/map/pointer_1.png"}),c=L.icon({iconUrl:o,iconSize:[40,40],iconAnchor:[20,40]});marker=L.marker([u,f],{icon:c}).addTo(i)}}catch(r){console.log("There is an issue with the OpenStreetMap service. Please contact the administrator.")}}]);appModule.service("openstreetmapService",["appSession","$http","helper",function(n,t){try{var i;this.loadMap=function(r,u,f,e){var h=document.getElementById(r);i===undefined&&(i=L.map(h).setView([u,f],e));L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap<\/a> contributors',maxZoom:18}).addTo(i);var o=n.rootTemplatePath+"/map/pointer_1.png",s=t.get(o).then(function(){s=o}).catch(function(){s="/Custom/skymark/map/pointer_1.png"}),c=L.icon({iconUrl:o,iconSize:[40,40],iconAnchor:[20,40]});marker=L.marker([u,f],{icon:c}).addTo(i)}}catch(r){console.log("There is an issue with the OpenStreetMap service. Please contact the administrator.")}}]);appModule.service("openStreetMapServiceListingSearch",["appSession","$http",function(n){function tt(){for(var n=0;n<o.length;n++)t.removeLayer(o[n]);o=[];nt=new L.LatLngBounds;t.removeLayer(u);u=new L.featureGroup}function ft(n){var i=null,e=n.nbrOfListings.toString(),r=document.createElement("a"),f,o;return r.href="#",r.className="listing-cluster "+et(e),parseInt(e)>1&&(f=document.createElement("div"),f.className="cluster-text",f.innerHTML=e,r.appendChild(f)),o=L.divIcon({html:r.outerHTML}),i=new L.marker([n.lat,n.lng],{icon:o}).on("click",function(t){keepzoomlevel=!1;a();event.preventDefault();L.DomEvent.stopPropagation(t);n.nbrOfListings!=null&&n.nbrOfListings>0&&n.nbrOfListings<=6?it(t.target,n):(c=!0,ot(n))}).addTo(t),i.addTo(u),nt.extend(i.getLatLng()),i}function et(n){return parseInt(n)===1?"lc-one ":n.length<=2?"lc-small ":n.length<=4?"lc-medium ":"lc-large "}function ot(n){var i=t.getZoom()+2;t.flyTo([n.lat,n.lng],i)}function st(){tt();var n=null;console.log("mapArray: ");console.log(s);$.each(s,function(t,i){n=ft(i);o.push(n)})}function a(){e&&r&&(r.removeFrom(t),r=null)}function it(i,u){a();isMapDraggedManually=!1;e=!1;var f=u.nbrOfListings.length>2?15:0;n.rootTemplatePath=="/Views/Shortlink/SiteTemplates/KW/4/";r=L.popup({maxWidth:650,minWidth:650,maxHeight:450,keepInView:!0,autoClose:!1,className:"listings-container"}).setLatLng([u.lat,u.lng]).setContent(u.infoWindowContent).openOn(t)}function b(f){var l=1<<t.getZoom(),a=Math.log(l)/Math.log(2),e,o,c;i.mapZoomFactor!=l&&r&&(r.removeFrom(t),r=null);i.mapZoomFactor=l;i.mapSearchCurrentZoom=a;e=t.getBounds();e!=null&&(o=e.getSouthWest(),c=e.getNorthEast(),o!=null&&(i.viewportMinX=o.lng,i.viewportMinY=o.lat),c!=null&&(i.viewportMaxX=c.lng,i.viewportMaxY=c.lat));console.log("searchParams: ");console.log(i);d.getListingsForWebSiteMapSearch(i).success(function(i){var o,r,e,l,c,v,a,y;if(s=[],h=i.items,h.length>0){for(this.markers=L.markerClusterGroup({spiderfyOnMaxZoom:!1,showCoverageOnHover:!1,zoomToBoundsOnClick:!1}),o=0;o<h.length;o++)r=h[o],e=(r.infoWindowContent+"").replace(/PiecesNbrLabel/g,app.localize("websiteTotalRooms")).replace(/BedRoomsNbrLabel/g,app.localize("websiteBedrooms")).replace(/BathRoomNbrLabel/g,app.localize("websiteBathrooms")).replace(/SqFootLabel/g,r.MeasurementType==0?app.localize("websiteLivingSqM"):app.localize("websiteLivingSqF")).replace(/OPENHOUSELABEL/g,app.localize("websiteListingSearchOpenHouse")).replace(/Banner.ListingStatus.Sold/g,app.localize("Banner.ListingStatus.Sold")).replace(/Banner.ListingStatus.Rented/g,app.localize("Banner.ListingStatus.Rented")).replace(/Banner.MarketStatus.NewToMarket/g,app.localize("Banner.MarketStatus.NewToMarket")).replace(/Banner.MarketStatus.Foreclosure/g,app.localize("Banner.MarketStatus.Foreclosure")).replace(/Banner.MarketStatus.ComingSoon/g,app.localize("Banner.MarketStatus.ComingSoon")).replace(/Banner.ListingStatus.SalesAgreed/g,app.localize("Banner.ListingStatus.SalesAgreed")).replace(/Banner.MarketStatus.MarketStatus1/g,app.localize("Banner.MarketStatus.MarketStatus1")).replace(/Banner.MarketStatus.MarketStatus2/g,app.localize("Banner.MarketStatus.MarketStatus2")).replace(/Banner.MarketStatus.MarketStatus3/g,app.localize("Banner.MarketStatus.MarketStatus3")),n.rootTemplatePath=="/Views/Shortlink/SiteTemplates/KW/4/"&&(l="",c="",l=app.localize("NumProperties",r.nbrOfListings),r.nbrOfListings>1?c=" gallery-parent-multiple":r.nbrOfListings==1&&e!=""&&(v=$(e),a=v.find(".gallery-transtype"),a.length>0&&(y=a[0].textContent,c=" gallery-parent-single")),e="<h4>"+l+'<\/h4> <div class="gallery-parent'+c+'"> '+e+" <\/div>"),s.push({lat:r.lat,lng:r.lng,nbrOfListings:r.nbrOfListings,infoWindowContent:e});st();f&&(u.getLayers().length>1?(console.log("newSearch - trying to fitBounds(fg.getBounds())"),setTimeout(function(){rt=!0;t.fitBounds(u.getBounds(),{padding:[50,50]})},2e3)):console.log("1 or 0 markers, dont fitBounds"))}else ht(" <div class='' id='ll-content-container'><input type='hidden' value='False' id='hiddenRTL' name='hiddenRTL'>  <div class='contact-us-link' id='contact-top'><a href='/contactus'  id='A1'>"+app.localize("websiteContactusMessage")+"<i class='chevron'><\/i><\/a><\/div> <div class='ng-scope'>    \t<div class='no-results'>        \t\t<h2>"+app.localize("websiteNoMorelistingsMessage")+"<\/h2>     \t<\/div>    \t<div class='no-results'>        \t\t<p><a href='/contactus' id='A1'>"+app.localize("websiteSendUsMessage")+" "+app.localize("websiteThankyoumessage")+"<\/a><\/p>    \t<\/div>\t<\/div><\/div><\/div>")})}function ht(n){var i=t.getBounds();tt();markerData={lat:y.latitude,lng:y.longitude,nbrOfListings:1,infoWindowContent:n};e=!0;it(null,markerData)}var k=this,v=!1,rt=!1,e=!1;isMapDraggedManually=!1;var d,i,o=[],s=[],h=[],y,ut=null,g=10,t,p=!1,c=!0,f=!0,r,nt=new L.LatLngBounds,u=new L.featureGroup,l=!1,w=!1;k.disposeMap=function(){t=undefined};k.createMap=function(n,r,o,s,h,k){if(console.log("createMap()"),w)console.log("createMap already running");else{w=!0;d=k;i=h;ut=n;y=o;g=o.googleZoomLevel-1;timeOutInMS=0;mapDiv=document.getElementById(r);t===undefined&&(t=L.map(mapDiv).setView([o.latitude,o.longitude],g));L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{tileSize:512,zoomOffset:-1,minZoom:1,maxZoom:{panControl:!1,maxZoom:19}.maxZoom,attribution:'Map data &copy; <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors<\/a>',crossOrigin:!0}).addTo(t);t.scrollWheelZoom.disable();u.addTo(t);t.on("zoomend",function(){(console.log("zoomend"),p||f)||(v=!0,c=!0)});t.on("movestart",function(){console.log("movestart");keepzoomlevel=!1;a()});t.on("moveend",function(){if(console.log("moveend"),f){f=!1;return}if(!l){if(l=!0,!isMapDraggedManually||v){c&&(p||!f)&&(p=!1,e=!1,b(!1));v=!1;l=!1;return}c&&(keepzoomlevel=!1,resetGeoFilters(),b(!1),l=!1)}});t.on("click",function(){console.log("click");keepzoomlevel=!1;a()});f=!0;b(!0);w=!1}}}]),function(){appModule.service("QueryStringService",["$location",function(n){this.getFilters=function(t){var r=n.search();for(var i in t)i in r&&(t[i]=r[i]);return t};this.getUrlParameter=function(n,t){for(var e,r,o=t||window.location.search.substring(1),u=o.split(/[&||?]/),f,i=0;i<u.length;i+=1)e=u[i],r=(e||"").split("="),r[0]===n&&(f=r[1]);return f}}])}();appModule.service("savedsearches",["abp.services.app.savedSearch","helper","$cookies",function(n,t,i){function f(){var n=i.get("mysavedsearches");return n==null||typeof n=="undefined"||n==""?"":n}var r="Fri, 31 Dec 9999 23:59:59 GMT",u;this.submit=function(t,u,e){var o=!1,s,h;validate(u)||(s=[],h=this,n.getSavedSearchForEdit({id:null}).success(function(t){s=t.criteriaList;var c=h.getCriterias(s,e);n.createOrUpdateSavedSearch({savedSearchUser:u,criteriaList:c}).success(function(n){if(n.retVal==!0){var t=n.subscriptionToken,u=f();(u==""||u!=t)&&i.put("mysavedsearches",t,{expires:r});o=!0}else o=!1}).error(function(){abp.message.warn(app.localize("ProblemOccured"))}).finally(function(){return o})}))};this.getCriterias=function(n,t){return angular.forEach(t,function(t,i){if(t!=null&&t!=undefined&&t!=0)if(i=="localZoneIds"&&angular.forEach(t,function(t){var i={fieldName:"localZoneIds",selectedValue:t};n.push(i)}),i=="propertyType")angular.forEach(t,function(t){var i={fieldName:"propertyType",selectedValue:t};n.push(i)});else if(i=="station")angular.forEach(t,function(t){var i={fieldName:"station",selectedValue:t};n.push(i)});else{var r={fieldName:i,selectedValue:t};n.push(r)}}),n};u="mysavedsearches";this.getSavedSearch=function(t,f,e){var o=i.get(u);(o==null||typeof o=="undefined"||o=="")&&i.put(u,"",{expires:r});n.getSavedSearchForEdit({id:t}).success(function(n){f=n.savedSearchUser;e=n.criteriaList})};validate=function(n){return t.isUndefinedOrNull(n.name)?(abp.message.warn(app.localize("FillName")),!0):t.isUndefinedOrNull(n.email)?(abp.message.warn(app.localize("FillEmail")),!0):!1};this.validate=function(n){return t.isUndefinedOrNull(n.name)?(abp.message.warn(app.localize("FillName")),!0):t.isUndefinedOrNull(n.email)?(abp.message.warn(app.localize("FillEmail")),!0):!1};this.getCookie=function(){return f()};this.putCookie=function(n,t){i.put(n,t,{expires:r})}}]),function(){appModule.controller("common.views.about.index",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","helper","appSession",function(n,t,i,r,u,f,e,o){var s=this;s.page={name:"aboutus",postingId:cmsData.postingId};f.registerHit({tenantId:o.region.tenantId,regionId:o.region.id,name:app.consts.hitsName.aboutUsView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.agents.agentContact",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office",function(){var n=this;n.agent=null}])}(),function(){appModule.controller("common.views.agents.index",["$scope","$state","$stateParams","abp.services.app.agent","$sce","$uibModal","abp.services.app.hit","mapService","openstreetmapService","helper","appSession","Notification","QueryStringService","$anchorScroll","$cookies","chatIntegrationService","openstreetmapService2",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){function tt(n){n!=null&&r.getAgentRegional({agentId:n,tenantId:g}).success(function(n){if(n==null){b.notAvailableAgentPage=!0;b.loading=!1;return}k!=n.regionId?(k=n.regionId,y.put("destinationRegionIdCookie",k,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"}),abp.services.app.regionalSettings.getWebsiteDestRegionalAllSettings({settingNames:c.settingNames,DestinationRegionId:k},{async:!1}).done(function(t){c.destinationRegion=t.destRegion;c.destinationRegionalSettings=t.destRegionalLists;c.destinationRegionLanguages=t.DestRegionLanguages;b.processAgent(n)})):b.processAgent(n);it()}).finally(function(){b.loading=!1;a.getUrlParameter("contact")=="true"&&b.openModal();window.prerenderReady=!0})}function it(){b.chatIntegrations=p.setupChatForWebsite(b.agent.agentChatIntegrations,b.agent.whatsAppPhone);b.agent.chatIntegrations=b.chatIntegrations;b.loadingChatIntegration=!1}function d(n){return typeof n=="undefined"||n==null?!0:n.replace(/\s/g,"").length<1}var b=this;b.loading=!0;b.isSoftLeadSent=!1;window.prerenderReady=!1;b.agent=null;var nt=c.region.id,g=c.region.tenantId,k=c.region.id;c.destinationRegion&&(k=c.destinationRegion.id);n.scrollTo=function(n){v(n)};b.showAgentMediaContainer=!1;b.loadingChatIntegration=!0;b.chatIntegrations=[];b.processAgent=function(n){b.agent=n;b.notAvailableAgentPage=!1;b.agent.personalWebsite!=null&&b.agent.personalWebsite!=""&&(b.agent.personalWebsite.includes("http")||(b.agent.personalWebsite="//"+b.agent.personalWebsite));b.agent.facebook==null||b.agent.facebook==""||b.agent.facebook.includes("http")||(b.agent.facebook="https://"+b.agent.facebook);b.agent.twitter==null||b.agent.twitter==""||b.agent.twitter.includes("http")||(b.agent.twitter="https://"+b.agent.twitter);b.agent.linkedIn==null||b.agent.linkedIn==""||b.agent.linkedIn.includes("http")||(b.agent.linkedIn="https://"+b.agent.linkedIn);b.agent.youTube==null||b.agent.youTube==""||b.agent.youTube.includes("http")||(b.agent.youTube="https://"+b.agent.youTube);b.agent.instagram==null||b.agent.instagram==""||b.agent.instagram.includes("http")||(b.agent.instagram="https://"+b.agent.instagram);e.registerHit({tenantId:g,regionId:nt,name:app.consts.hitsName.agentDetailsView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name,agentId:b.agent.agentId});b.showAgentMediaContainer=!d(b.agent.facebook)||!d(b.agent.twitter)||!d(b.agent.linkedIn)||!d(b.agent.youTube)||!d(b.agent.instagram)};b.openMap=function(){return};b.isEmptyOrSpaces=function(n){var t=n.trim();return t===""};b.getInclude=function(){if(!angular.isUndefined(b.notAvailableAgentPage))return b.notAvailableAgentPage?"~/App/common/views/agents/partials/unavailableAgentPage.cshtml":"~/App/common/views/agents/partials/agentDetail.cshtml"};b.getIncludeByName=function(n){return abp.rootTemplatePath+"views/agents/partials/"+n+".cshtml"};b.getRegionalSetting=function(n){for(var i,t=0;t<c.destinationRegionalSettings.length;t++)if(c.destinationRegionalSettings[t].name==n)return c.destinationRegionalSettings[t].type=="ListStringSettingValueDto"||c.destinationRegionalSettings[t].type=="ListIntSettingValueDto"?c.destinationRegionalSettings[t].output.values:c.destinationRegionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};b.hideSoftLead=b.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");b.showFullAgentDirectLine=b.hideSoftLead;b.showFullAgentMobile=b.hideSoftLead;n.trustAsHtml=function(n){return u.trustAsHtml(n)};b.openModal=function(){var n=f.open({animation:!0,templateUrl:"~/App/common/views/agents/modal/contact-modal-dialog.cshtml",controller:"common.views.agents.modal.contact as vm",size:"sm",resolve:{agent:b.agent}});n.result.then(function(){})};n.getMap=function(){s.loadMap("map",b.agent.latitude,b.agent.longtitude,15,!1,!1,!1,!1,!1,!1,!1)};n.getMap2=function(){w.loadMap("map2",b.agent.latitude,b.agent.longtitude,15,!1,!1,!1,!1,!1,!1,!1)};b.init=function(n){tt(n)};b.moreInfo=function(){window.location="/"+b.agent.officeUrl};b.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};b.processSoftLead=function(n){switch(n){case 1:b.showFullAgentDirectLine=!0;break;case 2:b.showFullAgentMobile=!0}b.isSoftLeadSent||e.registerHit({tenantId:g,regionId:nt,name:app.consts.hitsName.agentSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,agentId:b.agent.agentId}).success(function(){b.isSoftLeadSent=!0})}}])}(),function(){appModule.controller("common.views.agents.modal.agentmap",["$scope","$uibModalInstance","agent","appSession","helper",function(n,t,i,r,u){vm=this;vm.center=new google.maps.LatLng(i.latitude,i.longitude);vm.agent=i;vm.tenant=u.getDynamicImageByPathNameAndLevel("/map/pointer_1.png");vm.close=function(){t.close()}}])}(),function(){appModule.controller("common.views.agents.modal.contact",["$scope","$uibModalInstance","agent","abp.services.app.contactForms","appSession","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt",function(n,t,i,r,u,f,e,o,s){vm=this;vm.agent=i;vm.chatIntegrations=vm.agent.chatIntegrations;vm.success=null;vm.captchaKey=e;vm.isSoftLeadSent=!1;var h;vm.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",u.region.tenantFullName);n.contact={agentId:i.agentId,regionId:u.destinationRegion.id};vm.close=function(){t.dismiss("cancel")};s.displayCaptcha(u.region.id).success(function(n){vm.displayCaptcha=n});n.setCaptchaWidgetId=function(){h=___grecaptcha_cfg.count-1};vm.getRegionalSetting=function(n){for(var i,t=0;t<u.regionalSettings.length;t++)if(u.regionalSettings[t].name==n)return u.regionalSettings[t].type=="ListStringSettingValueDto"||u.regionalSettings[t].type=="ListIntSettingValueDto"?u.regionalSettings[t].output.values:u.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};vm.hideSoftLead=vm.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");vm.showFullAgentDirectLine=vm.hideSoftLead;vm.showFullAgentMobile=vm.hideSoftLead;vm.showFullOfficePhone=vm.hideSoftLead;vm.submit=function(){if(vm.displayCaptcha){if(o.getResponse(h)===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=o.getResponse(h)}vm.busy=!0;r.sendMessageForAgent(n.contact).success(function(n){vm.success=n.result}).finally(function(){n.contact.name="";n.contact.email="";n.contact.phone="";n.contact.comments="";n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();vm.busy=!1;f.registerHit({tenantId:u.region.tenantId,regionId:u.region.id,name:app.consts.hitsName.agentLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,agentId:i.agentId})})};vm.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};vm.processSoftLead=function(n){switch(n){case 1:vm.showFullAgentDirectLine=!0;break;case 2:vm.showFullAgentMobile=!0;break;case 3:vm.showFullOfficePhone=!0}vm.isSoftLeadSent||f.registerHit({tenantId:u.region.tenantId,regionId:u.region.id,name:app.consts.hitsName.agentSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,agentId:vm.agent.agentId}).success(function(){vm.isSoftLeadSent=!0})}}])}(),function(){appModule.controller("common.views.basinda",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"basinda",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.basinda,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.blog.blogPosting",["appSession","$location","$scope","$state","$http","helper","$templateCache","abp.services.app.cms",function(n,t,i,r,u,f,e,o){function c(n,t){n!=null&&o.getBlogPosting(n,abp.localization.currentLanguage.name,t).success(function(n){if(n==null){s.loading=!1;return}s.blogPosting=n}).finally(function(){s.loading=!1})}function l(){o.getBlogTags(abp.localization.currentLanguage.name).success(function(n){s.blogTags=n})}var s=this;s.page={name:"blogPosting",postingId:""};s.blogPosting=[];s.blogTags=[];var h=n,a=h.region.id,v=h.region.tenantId;s.getInclude=function(){return abp.rootTemplatePath+"views/blog/blogPosting.cshtml"};s.init=function(n){var t=window.location.href.indexOf("preview=draft")>0;c(n,t);l()};s.SearchBlogs=function(){window.location.href=s.searchBlogCritera!=null&&s.searchBlogCritera!=""?"/blogSearch/"+s.searchBlogCritera:"/blog/"}}])}(),function(){appModule.controller("common.views.blog.blogSearch",["appSession","$location","$scope","$state","$http","helper","$templateCache","abp.services.app.cms",function(n,t,i,r,u,f,e,o){var s=this;s.page={name:"blogSearch",postingId:""};s.blogPostings=[];s.blogTags=[];var h=n,c=h.region.id,l=h.region.tenantId;s.Search=function(n){($(".no-results").hide(),n!=null&&n!="")&&o.searchBlogPostings(abp.localization.currentLanguage.name,n).success(function(n){s.blogPostings=n;s.blogPostings.length==0?$(".no-results").show():$(".no-results").hide()})};s.GetTags=function(){o.getBlogTags(abp.localization.currentLanguage.name).success(function(n){s.blogTags=n})};s.getInclude=function(){return abp.rootTemplatePath+"views/blog/blogSearch.cshtml"};s.init=function(n){$(".no-results").hide();s.searchResultsHeading=n;s.Search(n);s.GetTags()};s.SearchBlogs=function(){window.location.href=s.searchBlogCritera!=null&&s.searchBlogCritera!=""?"/blogSearch/"+s.searchBlogCritera:"/blog/"}}])}(),function(){appModule.controller("common.views.blog.index",["appSession","$location","$scope","$state","$http","helper","$templateCache","abp.services.app.cms",function(n,t,i,r,u,f,e,o){function c(){o.getBlogPostings(abp.localization.currentLanguage.name).success(function(n){s.blogPostings=n});o.getBlogTags(abp.localization.currentLanguage.name).success(function(n){s.blogTags=n})}var s=this;s.page={name:"blog",postingId:""};s.blogPostings=[];s.blogTags=[];var h=n,l=h.region.id,a=h.region.tenantId;s.getInclude=function(){return abp.rootTemplatePath+"views/blog/index.cshtml"};c();s.SearchBlogs=function(){window.location.href=s.searchBlogCritera!=null&&s.searchBlogCritera!=""?"/blogSearch/"+s.searchBlogCritera:"/blog/"}}])}(),function(){appModule.controller("common.views.buy.index",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e){var o=this;o.page={name:"buy",postingId:cmsData.postingId};f.registerHit({tenantId:e.region.tenantId,regionId:e.region.id,name:app.consts.hitsName.buyingView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.careers.index",["abp.services.app.hit","appSession",function(n,t){var i=this;i.page={name:"careers",postingId:cmsData.postingId};n.registerHit({tenantId:t.region.tenantId,regionId:t.region.id,name:app.consts.hitsName.careersView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.cms.index",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"cms",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:a.page.name,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.common.lookupModal",["$scope","$uibModalInstance","uiGridConstants","lookupOptions",function(n,t,i,r){var u=this;if(u.loading=!1,u.options=angular.extend({serviceMethod:null,title:app.localize("SelectAnItem"),loadOnStartup:!0,showFilter:!0,filterText:"",skipCount:0,pageSize:app.consts.grid.defaultPageSize,callback:function(){},canSelect:function(){return!0}},r),!u.options.serviceMethod){t.dismiss();return}u.cancel=function(){t.dismiss()};u.gridOptions={enableHorizontalScrollbar:i.scrollbars.WHEN_NEEDED,enableVerticalScrollbar:i.scrollbars.WHEN_NEEDED,paginationPageSizes:app.consts.grid.defaultPageSizes,paginationPageSize:u.options.pageSize,useExternalPagination:!0,enableSorting:!1,appScopeProvider:u,columnDefs:[{name:app.localize("Select"),width:100,cellTemplate:'<div class="ui-grid-cell-contents">  <button class="btn btn-default btn-xs" ng-click="grid.appScope.selectItem(row.entity)"><i class="fa fa-check"><\/i> '+app.localize("Select")+"<\/button><\/div>"},{name:app.localize("Name"),field:"name"}],onRegisterApi:function(t){n.gridApi=t;t.pagination.on.paginationChanged(n,function(n,t){u.options.skipCount=(n-1)*t;u.options.pageSize=t;u.refreshGrid()})},data:[]};u.selectItem=function(n){var i=u.options.canSelect(n);if(i){if(i===!0){u.options.callback(n);t.close(n);return}i.then(function(i){i&&(u.options.callback(n),t.close(n))})}};u.refreshGrid=function(){var n=angular.extend({skipCount:u.options.skipCount,maxResultCount:u.options.pageSize,filter:u.options.filterText},r.extraFilters);u.loading=!0;u.options.serviceMethod(n).success(function(n){u.gridOptions.totalItems=n.totalCount;u.gridOptions.data=n.items}).finally(function(){u.loading=!1})};u.options.loadOnStartup&&u.refreshGrid()}]);appModule.factory("lookupModal",["$uibModal",function(n){function t(t){n.open({templateUrl:"~/App/common/views/common/lookupModal.cshtml",controller:"common.views.common.lookupModal as vm",backdrop:"static",resolve:{lookupOptions:function(){return t}}})}return{open:t}}])}(),function(){appModule.controller("common.views.contactus.index",["$scope","abp.services.app.lookupLists","$uibModal","appSession","abp.services.app.office","abp.services.app.contactForms","Notification","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt","helper","abp.services.app.socialMedia",function(n,t,i,r,u,f,e,o,s,h,c,l,a){function k(){v.getRegionalSetting=function(n){for(var t=0;t<y.regionalSettings.length;t++)if(y.regionalSettings[t].name==n)return y.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};v.IsOffice&&v.getOffices();a.getSocialMedia({}).success(function(n){v.facebook=n.facebook;v.facebook==null||v.facebook==""||v.facebook.includes("http")||(v.facebook="https://"+v.facebook);v.twitter=n.twitter;v.twitter==null||v.twitter==""||v.twitter.includes("http")||(v.twitter="https://"+v.twitter);v.linkedIn=n.linkedIn;v.linkedIn==null||v.linkedIn==""||v.linkedIn.includes("http")||(v.linkedIn="https://"+v.linkedIn);v.youtube=n.youtube;v.youtube==null||v.youtube==""||v.youtube.includes("http")||(v.youtube="https://"+v.youtube);v.instagram=n.instagram;v.instagram==null||v.instagram==""||v.instagram.includes("http")||(v.instagram="https://"+v.instagram)})}var v=this,y,w,p,b;v.busy=!1;v.selectedOffice={};y=r;v.contact={};v.IsRegion=abp.IsRegion;v.IsOffice=abp.IsOffice;v.IsAgent=abp.IsAgent;v.IsTeam=abp.IsTeam;v.checkboxIunderstand=!1;v.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",y.region.tenantFullName);v.OfficeId=parseInt(abp.OfficeId);v.AgentId=parseInt(abp.AgentId);v.TeamId=parseInt(abp.TeamId);w=y.region!=null?y.region.tenantId:0;p=y.region!=null?y.region.id:0;v.headOfficePhone=y.region.headOfficePhone;v.headOfficeEmail=y.region.headOfficeEmail;v.formattedRegionAddress=y.region.formattedRegionAddress;v.regionId=p;t.getMultipleLookupLists({listIds:[60],tenantId:w,regionId:p}).success(function(n){v.options=n.items[0].lookupLists});c.displayCaptcha(y.region.id).success(function(n){v.displayCaptcha=n});v.captchaKey=s;v.openModal=function(){var n=i.open({animation:!0,templateUrl:"~/App/common/views/contactus/modal/contact-us-modal-dialog.cshtml",controller:"common.views.contactus.modal.contact as vm",resolve:{offices:function(){return v.offices}}});n.result.then(function(n){v.contact.selectedOffice=n})};b={regionId:y.region.id,tenantId:y.region.tenantId};u.getOfficesForRegionalContactForm(b).success(function(n){v.offices=n.items;v.offices.length==1&&(v.contact.selectedOffice=v.offices[0])});v.getOffices=function(){u.getOfficesRegional({regionId:p,tenantId:w,officeId:v.OfficeId}).success(function(n){v.office=n.pages.items[0]}).finally(function(){})};v.submit=function(){if(v.displayCaptcha){if(h.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}v.contact.captcha=h.getResponse()}v.busy=!0;v.contact.officeId=v.contact.option==1020||v.contact.option==1021?v.contact.selectedOffice.officeId:null;v.contact.regionId=y.region.id;v.contact.tenantId=y.region.tenantId;f.sendMessageForRegion(v.contact).success(function(n){n.result?(e.success(app.localize("websiteMessageHasBeenSent")),(v.contact.option==1020||v.contact.option==1021)&&o.registerHit({tenantId:y.region.tenantId,regionId:y.region.id,name:app.consts.hitsName.officeContactLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,officeId:v.contact.officeId})):(e.error(app.localize("websiteAnErrorOccured")),console.log(n.message))}).finally(function(){v.contact.selectedOffice={};v.selectedOffice={};v.contact={};n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();v.busy=!1;v.checkboxIunderstand=!1})};k()}])}(),function(){appModule.controller("common.views.contactus.modal.contact",["$scope","$uibModalInstance","offices",function(n,t,i){vm=this;vm.offices=i;vm.close=function(){t.dismiss("cancel")};vm.submit=function(){t.close(vm.selectedOffice)}}])}(),function(){appModule.controller("common.views.error.index",["$scope","$state","abp.services.app.hit","appSession",function(n,t,i,r){var u=this;i.registerHit({tenantId:r.region.tenantId,regionId:r.region.id,name:app.consts.hitsName.errorPage,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.familyReunion",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"familyReunion",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.familyReunion,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.familyReunionHoteles",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"familyReunionHoteles",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.familyReunionHoteles,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.familyReunionInformes",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"familyReunionInformes",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.familyReunionInformes,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.familyreunionpatrocinadores",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"familyreunionpatrocinadores",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.familyreunionpatrocinadores,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.familyReunionPromociones",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"familyReunionPromociones",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.familyReunionPromociones,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.franchise",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"franchise",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.franchise,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.gdpr.accessYourPersonalData",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","appSession","helper","vcRecaptchaService","captchaKey","abp.services.app.gdprRegional","abp.services.app.regionalSettings","helper","abp.services.app.office",function(n,t,i,r,u,f,e,o,s,h,c,l,o,a){function w(n){l.getRegionalSettings({regionId:v.regionId,settingNames:["GDPRForgetMeTimeframe(Years)"]}).success(function(n){v.regionalSettings=n.items}).finally(function(){n()})}function b(n){return o.getRegionalSetting(v.regionalSettings,n)}var v=this,y,p;v.busy=!1;v.showResponseText=!1;v.displayCaptcha=!0;v.captchaKey=h;v.submitBodyText2="";v.IsRegion=abp.IsRegion;v.IsOffice=abp.IsOffice;v.IsAgent=abp.IsAgent;v.IsTeam=abp.IsTeam;y=e.region!=null?e.region.id:0;v.regionId=y;p=e.region!=null?e.region.tenantId:0;v.tenantId=p;v.headOfficePhone=e.region.headOfficePhone;v.headOfficeEmail=e.region.headOfficeEmail;v.formattedRegionAddress=e.region.formattedRegionAddress;v.OfficeId=parseInt(abp.OfficeId);v.getOffices=function(){a.getOfficesRegional({regionId:v.regionId,tenantId:v.tenantId,officeId:v.OfficeId}).success(function(n){v.office=n.pages.items[0]}).finally(function(){})};v.model={emailAddress:"",captcha:""};v.submit=function(){if(v.displayCaptcha){if(s.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}v.model.captcha=s.getResponse()}v.busy=!0;v.showResponseText=!1;c.submitAccessYourPersonalData(v.model).success(function(n){var t=n}).finally(function(){v.displayCaptcha&&s.reload();n.accessYourPersonalDataForm.$setPristine();n.accessYourPersonalDataForm.$setUntouched();v.busy=!1;v.showResponseText=!0})};v.init=function(){w(function(){v.submitBodyText2=app.localize("AccessYourPersonalData.SubmitBodyText2").replaceAll("{0}",e.region.tenantFullName).replaceAll("{1}",b("GDPRForgetMeTimeframe(Years)"))});v.IsOffice&&v.getOffices()};v.init()}])}(),function(){appModule.controller("common.views.gdpr.aypdEmailResponse",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","appSession","helper","vcRecaptchaService","captchaKey","abp.services.app.gdprRegional","abp.services.app.regionalSettings","helper","abp.services.app.office",function(n,t,i,r,u,f,e,o,s,h,c,l,o,a){var v=this,y,p;v.IsRegion=abp.IsRegion;v.IsOffice=abp.IsOffice;v.IsAgent=abp.IsAgent;v.IsTeam=abp.IsTeam;y=e.region!=null?e.region.id:0;v.regionId=y;p=e.region!=null?e.region.tenantId:0;v.tenantId=p;v.headOfficePhone=e.region.headOfficePhone;v.headOfficeEmail=e.region.headOfficeEmail;v.formattedRegionAddress=e.region.formattedRegionAddress;v.OfficeId=parseInt(abp.OfficeId);v.getOffices=function(){a.getOfficesRegional({regionId:v.regionId,tenantId:v.tenantId,officeId:v.OfficeId}).success(function(n){v.office=n.pages.items[0]}).finally(function(){})};v.init=function(){v.IsOffice&&v.getOffices()};v.init()}])}(),function(){appModule.controller("common.views.habeasdata",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"habeasdata",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.habeasdata,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.home.index",["appSession","$location","$scope","$state","$http","helper","$templateCache","abp.services.app.geo","abp.services.app.listings","abp.services.app.lookupLists","abp.services.app.regionalSettings","abp.services.app.hit","abp.services.app.agent","$cookies","abp.services.app.region","cookieService",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){function tt(n){if(n=="Country")return 0;if(n=="MacroProvince")return 1;if(n=="Province")return 2;if(n=="City")return 3;if(n=="LocalZone")return 4;throw new Error("Can not recognize DefaultGeoSearchLevel");}function it(){p.markFavOnForFavoriteListings()}function rt(){l.registerHit({tenantId:d,regionId:k,name:app.consts.hitsName.homepageView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name});w.getCountryFlagList();w.getFeaturedListings();w.getPropertyTypes();w.IsOffice&&w.getAgents()}var w=this,b,k,d,g,nt;w.page={name:"home",postingId:""};w.propertyType={};w.propertyTypes=[];w.transactionType=357;b=n;k=b.region.id;w.currency=b.region.defaultCurrencyName;d=b.region.tenantId;g=v.get("destinationRegionIdCookie");(g==null||typeof g=="undefined"||g==""||g=="0")&&v.put("destinationRegionIdCookie",k,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});w.selectedCountryRegionId=parseInt(v.get("destinationRegionIdCookie"));w.IsRegion=abp.IsRegion;w.IsOffice=abp.IsOffice;w.IsAgent=abp.IsAgent;w.IsTeam=abp.IsTeam;w.IsLuxury=abp.IsLuxury;w.bedRoomsPrefix="";w.roomsAndParkingList=[];w.getCountryFlagList=function(){y.getRegionListForFlagDropdown({tenantId:b.region.tenantId,homeRegionId:b.region.id}).success(function(n){w.countryFlagsList=n})};i.countrySelected=function(n){v.put("destinationRegionIdCookie",n.regionId,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});w.setDestinationRegionalSettingValues()};w.setDestinationRegionalSettingValues=function(){abp.services.app.regionalSettings.getWebsiteDestRegionalAllSettings({settingNames:n.settingNames,DestinationRegionId:w.selectedCountryRegionId},{async:!1}).done(function(t){n.destinationRegion=t.destRegion;n.destinationRegionalSettings=t.destRegionalLists;n.destinationRegionLanguages=t.DestRegionLanguages});w.getPropertyTypes()};w.isValidMinMax=!0;w.getRegionalSetting=function(t){for(var r,i=0;i<n.regionalSettings.length;i++)if(n.regionalSettings[i].name==t)return n.regionalSettings[i].type=="ListStringSettingValueDto"||n.regionalSettings[i].type=="ListIntSettingValueDto"?n.regionalSettings[i].output.values:n.regionalSettings[i].output.value;throw new Error("Can not find region setting "+t);};w.getDestRegionalSetting=function(t){for(var r,i=0;i<n.destinationRegionalSettings.length;i++)if(n.destinationRegionalSettings[i].name==t)return n.destinationRegionalSettings[i].type=="ListStringSettingValueDto"||n.destinationRegionalSettings[i].type=="ListIntSettingValueDto"?n.destinationRegionalSettings[i].output.values:n.destinationRegionalSettings[i].output.value;throw new Error("Can not find region setting "+t);};w.freeTextSearch="";w.getInclude=function(){return abp.rootTemplatePath+"views/home/partials/index.cshtml"};i.getLocation=function(t){return w.typeaheadIsLoading=!0,new Promise(function(i){var r=tt(w.getDestRegionalSetting("DefaultGeoSearchLevel")),u=w.getDestRegionalSetting("DefaultGeoSearchValues");o.getSearchGeo({search:t,countryUID:n.destinationRegion.countryId,level:r,ids:u}).success(function(n){for(var t=0;t<n.items.length;t++)n.items[t].groupNameLocalized=app.localize(n.items[t].groupName);w.typeaheadIsLoading=!1;w.geoId=undefined;w.geoGroup=undefined;nt=n.items[0];i(n.items)})})};w.showMore=w.getRegionalSetting("Always Open Show More on Home Page Search");w.addRemoveFavoriteListing=function(n,t){p.addRemoveFavoriteListing(n,t)};i.onSelect=function(n){w.geoId=n.id;w.geoValue=n.name;w.geoGroup=n.group;w.search()};i.modelOptions={debounce:{"default":500,blur:250},getterSetter:!0};w.getLookupList=function(n){return f.getLookupListById(w.pageLookupLists,n)};w.checkMinMax=function(){if(w.minPrice!=0&&w.maxPrice!=0&&parseInt(w.minPrice)>parseInt(w.maxPrice)){w.isValidMinMax=!1;return}w.isValidMinMax=!0};w.search=function(){if(w.isValidMinMax){if(typeof w.geoId=="undefined"&&typeof w.geoGroup=="undefined"&&typeof w.geoValue!="undefined"&&typeof nt!="undefined"&&w.geoValue!="")i.onSelect(nt);w.geoValue==""&&(w.geoId=undefined,w.firstResult=undefined);s.isListingExists(w.geoValue,w.selectedCountryRegionId).success(function(n){var t,r,i;n?location.href=location.origin+"/listingDetails/"+w.geoValue:(w.propertyType==null&&(w.propertyType={}),t={propertyType:w.propertyType.listLabelId,minPrice:w.minPrice,maxPrice:w.maxPrice,bedRoomCount:w.bedrooms,freeTextSearch:w.freeTextSearch},w.geoGroup==4?t.districtId=w.geoId:w.geoGroup==3?t.localZoneId=w.geoId:w.geoGroup==2?t.city=w.geoId:w.geoGroup==1?t.province=w.geoId:w.geoGroup==0&&(t.macroProvince=w.geoId),t.resCom=w.propertyType.group==app.localize("websiteLand")?3:w.propertyType.group==app.localize("websiteResidential")?1:w.propertyType.group==app.localize("websiteCommercial")?2:abp.IsLuxury?-1:1,w.geoValue!=null&&w.geoValue!=""&&(t.searchText=w.geoValue),(w.transactionType==357||w.transactionType==1663)&&(t.transactionType=1),(w.transactionType==356||w.transactionType==1664)&&(t.transactionType=2),l.registerHit({tenantId:d,regionId:k,name:app.consts.hitsName.mainPageSearch,type:app.consts.hitsType.search,languageCode:abp.localization.currentLanguage.name}),r=0,i="",angular.forEach(t,function(n,t){n&&(i+=r==0?"#?"+t+"="+n:"&"+t+"="+n,r++)}),location.href=location.origin+"/listings"+i)})}};w.getAgents=function(){a.getAgentsRegionalList({sorting:"agentname asc",regionId:w.selectedCountryRegionId,tenantId:d}).success(function(n){w.agents=n;angular.forEach(w.agents,function(n){n.facebook==null||n.facebook==""||n.facebook.includes("http")||(n.facebook="https://"+n.facebook);n.twitter==null||n.twitter==""||n.twitter.includes("http")||(n.twitter="https://"+n.twitter);n.linkedIn==null||n.linkedIn==""||n.linkedIn.includes("http")||(n.linkedIn="https://"+n.linkedIn);n.youTube==null||n.youTube==""||n.youTube.includes("http")||(n.youTube="https://"+n.youTube)})})};w.getFeaturedListings=function(){s.getFeaturedListings(k).success(function(n){w.bedRoomsPrefix=w.getRegionalSetting("Is T Used for Bedrooms on Regional Website?")?"T":"";w.featuredListings=n.items;setTimeout(it,500)})};w.getPropertyTypes=function(){w.propertyTypes=[];h.getMultipleLookupLists({listIds:[102,58,57,59,90],tenantId:d,regionId:w.selectedCountryRegionId}).success(function(n){var r,u,i,t;if(w.pageLookupLists=n.items,abp.IsLuxury){for(i=w.getLookupList(58),t=0;t<i.length;t++)i[t].listId=58,i[t].group=app.localize("websiteResidential");w.propertyTypes=w.propertyTypes.concat(i)}else{for(r=w.getLookupList(57),t=0;t<r.length;t++)r[t].listId=57,r[t].group=app.localize("websiteCommercial");for(i=w.getLookupList(58),t=0;t<i.length;t++)i[t].listId=58,i[t].group=app.localize("websiteResidential");for(u=w.getLookupList(59),t=0;t<u.length;t++)u[t].listId=59,u[t].group=app.localize("websiteLand");w.propertyTypes=w.propertyTypes.concat(i);w.propertyTypes=w.propertyTypes.concat(r);w.propertyTypes=w.propertyTypes.concat(u)}w.roomsAndParkingList=w.getLookupList(90);w.transactionTypes=w.getLookupList(102)})};rt()}])}(),function(){appModule.controller("common.views.layout.footer",["$rootScope","appSession","helper",function(n,t,i){function u(n){return i.getRegionalSetting(t.regionalSettings,n)}var r=this;r.showGDPRFooter=u("EnableGDPR");r.page={name:"footer",postingId:""};n.$on("$includeContentLoaded",function(){Layout.initFooter()});r.getProductNameWithEdition=function(){return"REP"}}])}(),function(){appModule.controller("common.views.layout.header",["$rootScope","$scope","$uibModal","appSession","abp.services.app.userLink",function(n,t){var i=this;t.$on("$includeContentLoaded",function(){Layout.initHeader()});i.languages=abp.localization.languages;i.currentLanguage=abp.localization.currentLanguage;i.changeLanguage=function(n){var t=window.location.href;location.href=abp.appPath+"AbpLocalization/ChangeCulture?cultureName="+n+"&returnUrl="+window.location.href};i.menuItems=[{id:1,name:"menu 1"},{id:2,name:"menu 2"}];i.page={name:"header",postingId:""}}])}(),function(){appModule.controller("common.views.layout",["$scope","abp.services.app.region","$sce","$cookies","appSession",function(n,t,i,r,u){function e(){return $("#menu").data("mmenu").close(),$("#menu").removeClass("open-menu"),$(".mm-slideout .shader").hide(),!1}function o(){var t,i,n,e;f.getRegionalSetting=function(n){for(var t=0;t<u.regionalSettings.length;t++)if(u.regionalSettings[t].name==n)return u.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};t=u.getSiteSetting("GoogleTagManagerKey");(t==null||t=="")&&(t=f.getRegionalSetting("GoogleTagManagerKey")),function(n,t,i,r,u){n[r]=n[r]||[];n[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var e=t.getElementsByTagName(i)[0],f=t.createElement(i),o=r!="dataLayer"?"&l="+r:"";f.async=!0;f.src="https://www.googletagmanager.com/gtm.js?id="+u+o;e.parentNode.insertBefore(f,e)}(window,document,"script","dataLayer",t);i=r.get("defaultLanguageCookie");(i==null||typeof i=="undefined"||i=="")&&r.put("defaultLanguageCookie",u.region.languageCode,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});n=window.location.href;e=n.indexOf("#/!/");e!=-1&&(n=n.replace("#/!/",""),window.location.href=n);e=n.indexOf("#!/");e!=-1&&(n=n.replace("#!/",""),window.location.href=n)}var f=this;$(window).click(function(){$("#menu").attr("class").indexOf("open-menu")!=-1&&$("#menu").removeClass("open-menu")});$("#menu").click(function(n){n.stopPropagation()});$("#menu").on("click","li.menu-header",function(){return console.log("li.menu-header clicked"),e()});$("#menu").on("click","li:not(.menu-header)",function(){var n=$(this).find("a").attr("href").replace("/home","/"),t=$(location).attr("pathname").replace("/home","/");if(n==t)return e()});$(document).keypress(function(n){if((n.key==="Escape"||n.key==="Esc")&&($("#menu").hasClass("mm-opened")||$("#menu").hasClass("open-menu")))return e()});$(document).ready(function(){window.addEventListener("load",function(){if(f.getRegionalSetting("Has Cookie Consent Policy?")){var n=abp.localization.defaultSourceName;abp.localization.defaultSourceName="REP";window.cookieconsent.initialise({palette:{popup:{background:"rgba(0, 0, 0, 0.75)",text:"#ffffff"},button:{background:"#aa0000"}},theme:"classic",content:{message:abp.localization.localize("CookieConsent.MessageText"),link:abp.localization.localize("CookieConsent.LinkText"),href:"/cookies",dismiss:abp.localization.localize("CookieConsent.ButtonText")}});abp.localization.defaultSourceName=n}})});f.getUrl=function(){return u.region.tenantName.toLowerCase()==app.consts.tenantName.kellerWilliams?i.trustAsResourceUrl("https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,400italic,700&subset=latin,latin-ext"):u.region.tenantName.toLowerCase()==app.consts.tenantName.coldWellBanker?i.trustAsResourceUrl("https://fonts.googleapis.com/css?family=Crimson+Text:400,600|Work+Sans:300,400,600&amp;subset=latin-ext"):u.region.tenantName.toLowerCase()==app.consts.tenantName.era?i.trustAsResourceUrl("https://fonts.googleapis.com/css?family=Montserrat:300,400,500&amp;subset=latin-ext"):i.trustAsResourceUrl("https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,400italic,700&subset=latin,latin-ext")};f.currentLanguage=abp.localization.currentLanguage.name.substring(0,2);f.captchaUrl=i.trustAsResourceUrl("https://www.google.com/recaptcha/api.js?onload=vcRecaptchaApiLoaded&render=explicit&hl="+f.currentLanguage);f.page={name:"menu",postingId:""};n.$on("$viewContentLoaded",function(){App.initComponents()});f.setSource=function(n){abp.localization.defaultSourceName=n};o()}])}(),function(){appModule.controller("common.views.lease.index",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","appSession","helper",function(){var n=this;n.page={name:"lease",postingId:cmsData.postingId}}])}(),function(){appModule.controller("common.views.listings.index",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.page","helper","abp.services.app.lookupLists","abp.services.app.websiteDevelopment","abp.services.app.listings","appSession","abp.services.app.geo","$location","QueryStringService","abp.services.app.hit","cookieService","mapServiceListingSearch","openStreetMapServiceListingSearch","abp.services.app.savedSearch","$timeout","savedsearches","$state","$window","$cookies","abp.services.app.region",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,t,nt,tt,it){function ct(n){if(n=="Country")return 0;if(n=="MacroProvince")return 1;if(n=="Province")return 2;if(n=="City")return 3;if(n=="LocalZone")return 4;throw new Error("Can not recognize DefaultGeoSearchLevel");}function lt(){rt.unitOfMeasurement=c.region.unitOfMeasurement==1?{id:1,measurement:"m",measurementSquare:"m²"}:{id:2,measurement:"ft",measurementSquare:"ft²"}}function at(){location.href=abp.appPath+"AbpLocalization/ChangeCulture?cultureName="+rt.search.lan+"&returnUrl="+a.absUrl()}function et(n){if(rt.search={minPrice:null,maxPrice:null,resCom:1,transactionType:1,province:null,macroProvince:null,city:null,localZoneIds:[],bedRoomCount:null,bathRoomCount:null,propertyType:null,station:null,minSqMeter:null,parkingSpaces:null,development:null,building:null,energyEfficiency:null,openHouse:null,lan:null,skipCount:0,currency:null,filterVal:1026,agentId:0,officeId:0,teamId:0,officeName:"",agentName:"",id:null,localZoneId:null,districtId:null,districtIds:[],refineSearch:1,searchText:"",pageNumber:1,freeTextSearch:"",isLuxury:rt.IsLuxury&&rt.selectedCountryRegionId==2003,map:null,addedLabel:0,isVirtualOpenHouse:!1},rt.search.currency=angular.isUndefined(rt.defaultCurrency)||rt.defaultCurrency==null?"":rt.defaultCurrency.currencyISO,rt.search.lan=e.isUndefinedOrNull(rt.search.lan)?abp.localization.currentLanguage.name:rt.search.lan,n){var t=n.split("&");angular.forEach(t,function(n){var t=n.split("=");angular.forEach(rt.search,function(n,i){t[0]==i&&(rt.search[i]=t[1])})})}}function st(n){var t,i;if(et(n),rt.search=v.getFilters(rt.search),$("#AddedSelectionCombobox")!=undefined&&setTimeout(function(){$("#AddedSelectionCombobox").selectpicker("refresh")},0),$.isArray(rt.search.propertyType)?$.each(rt.search.propertyType,function(n){rt.search.propertyType[n]=parseInt(rt.search.propertyType[n])}):rt.search.propertyType=e.isNumber(rt.search.propertyType)?[parseInt(rt.search.propertyType)]:rt.search.propertyType,$.isArray(rt.search.station)?$.each(rt.search.station,function(n){rt.search.station[n]=rt.search.station[n]}):rt.search.station&&(t=rt.search.station,rt.search.station=[],rt.search.station.push(t)),$.isArray(rt.search.metroStations)?$.each(rt.search.metroStations,function(n){rt.search.metroStations[n]=parseInt(rt.search.metroStations[n])}):rt.search.metroStations=e.isNumber(rt.search.metroStations)?[parseInt(rt.search.metroStations)]:rt.search.metroStations,rt.search.energyEfficiency=e.isNumber(rt.search.energyEfficiency)?parseInt(rt.search.energyEfficiency):rt.search.energyEfficiency,rt.search.filterVal=e.isNumber(rt.search.filterVal)?parseInt(rt.search.filterVal):rt.search.filterVal,rt.search.currency=e.isUndefinedOrNull(rt.search.currency)?angular.isUndefined(rt.defaultCurrency)||rt.defaultCurrency==null?"":rt.defaultCurrency.currencyISO:rt.search.currency,rt.search.lan=e.isUndefinedOrNull(rt.search.lan)?abp.localization.currentLanguage.name:rt.search.lan,rt.search.resCom!=null)switch(parseInt(rt.search.resCom)){case-1:rt.listingClassDropdownValue=-1;break;case 1:rt.listingClassDropdownValue=1409;rt.iconRes=!0;break;case 2:rt.listingClassDropdownValue=1410;rt.iconCom=!0;break;case 3:rt.listingClassDropdownValue=1411;rt.iconLand=!0;break;default:rt.listingClassDropdownValue=-1}if(rt.search.transactionType!=null)switch(rt.search.transactionType){case"1":rt.transactionTypeDropDownValue=357;break;case"2":rt.transactionTypeDropDownValue=356;break;default:rt.transactionTypeDropDownValue=357}if(rt.search.addedLabel!=null)switch(rt.search.addedLabel){case"0":rt.propertiesAddedintheLastDropdownValue=1412;break;case"1":rt.propertiesAddedintheLastDropdownValue=1415;break;case"7":rt.propertiesAddedintheLastDropdownValue=1414;break;case"30":rt.propertiesAddedintheLastDropdownValue=1413;break;default:rt.propertiesAddedintheLastDropdownValue=null}!Array.isArray(rt.search.localZoneIds)&&rt.search.localZoneIds&&(i=rt.search.localZoneIds,rt.search.localZoneIds=[i]);e.isUndefinedOrNull(rt.search.localZoneId)||rt.search.localZoneIds.indexOf(rt.search.localZoneId)==-1&&rt.search.localZoneIds.push(rt.search.localZoneId);!Array.isArray(rt.search.districtIds)&&rt.search.districtIds&&(rt.search.districtId=rt.search.districtIds,rt.search.districtIds=[rt.search.districtId]);rt.search.refineSearch==2&&rt.showDetail()}function ht(){rt.destinationRegion=c.destinationRegion;rt.requestParams={skipCount:rt.search.skipCount,maxResultCount:24,transactionType:rt.search.transactionType,listingClass:rt.search.resCom,macroProvinceId:rt.search.macroProvince,provinceId:rt.search.province,cityId:rt.search.city,localZoneIds:rt.search.localZoneIds,currency:rt.search.currency,maxPrice:rt.search.maxPrice,minPrice:rt.search.minPrice,propertyType:rt.search.propertyType,metroStations:rt.search.metroStations,bedRoomCount:rt.search.bedRoomCount,bathRoomCount:rt.search.bathRoomCount,squareMeter:rt.search.minSqMeter,parkingSpace:rt.search.parkingSpaces,totalRoomCount:rt.search.totalRoomCount,totalAreaSqMeter:rt.search.minTotalAreaSqMeter,lotSizeSqMeter:rt.search.minLotSizeSqMeter,developmentId:rt.search.development,buildingId:rt.search.building,energyLevel:rt.search.energyEfficiency,addedDay:rt.search.addedLabel,agentId:rt.search.agentId,officeId:rt.search.officeId,teamId:rt.search.teamId,officeName:rt.search.officeName,agentName:rt.search.agentName,upComingOpenHouse:rt.search.openHouse,orderByCriteria:rt.search.filterVal,id:rt.search.id,tenantId:rt.tenantId,regionId:rt.destinationRegion.id,districtIds:rt.search.districtIds,measurementType:rt.unitOfMeasurement.id,freeTextSearch:rt.search.freeTextSearch,homeRegionCurrencyUID:rt.region.defaultCurrencyId,homeRegionId:rt.regionId,isLuxury:rt.search.isLuxury,station:rt.search.station,isVirtualOpenHouse:rt.search.isVirtualOpenHouse}}function vt(){rt.search.localZoneId==null?rt.districts=null:l.getGeoDistrictsForWebSite({parentId:rt.search.localZoneId}).success(function(n){rt.districts=n.items})}function yt(){var n=i.open({templateUrl:"~/App/common/views/listings/modal/currency.cshtml",controller:"common.views.listings.currency as vm",resolve:{currency:function(){return rt.currencies},defaultCurrency:function(){return rt.defaultCurrency}}});n.result.then(function(n){rt.displayDefaultCurrencySymbol=n.htmlSymbol!=null?n.htmlSymbol:n.currencyISO;rt.search.currency=n.currencyISO})}function pt(n,t,r,u){var f=i.open({templateUrl:"~/App/common/views/listings/modal/priceList.cshtml",controller:"common.views.listings.priceList as vm",resolve:{price:function(){return n},priceEuro:function(){return t},priceUSD:function(){return r},listingCurrency:function(){return u}}});f.result.then(function(){})}function ot(){p.markFavOnForFavoriteListings()}function wt(){var n=i.open({templateUrl:"~/App/common/views/listings/modal/saved-search-modal.cshtml",controller:"common.views.listing.modal.saved.search as vm",backdrop:"static",size:"sm",resolve:{parameters:function(){return rt.search}}});n.result.then(function(){rt.savedSearchSaved=!0})}function bt(n){return(n||document.location.search).replace("#","").replace(/(^\?)/,"").split("&").map(function(n){return n=n.split("="),this[n[0]]=n[1],this}.bind({}))[0]}var rt=this,ut,ft;window.prerenderReady=!1;rt.filterVisible=!0;rt.defaultCurrency=null;rt.loading=!1;rt.tabClicked=!1;rt.mysaved={};rt.mysavedCriterian=[];rt.page=[];rt.myListingBusy=!1;rt.savedSearchSaved=!1;rt.activeListingSearch=!1;rt.IsLuxury=abp.IsLuxury;rt.IsOffice=abp.IsOffice;rt.hidePriceSlider=!1;rt.search={addedLabel:0};ut=tt.get("destinationRegionIdCookie");(ut==null||typeof ut=="undefined"||ut==""||ut=="0")&&tt.put("destinationRegionIdCookie",c.region.id,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});rt.selectedCountryRegionId=parseInt(tt.get("destinationRegionIdCookie"));rt.getCountryFlagList=function(){it.getRegionListForFlagDropdown({tenantId:c.region.tenantId,homeRegionId:rt.region.id}).success(function(n){rt.countryFlagsList=n})};rt.priceSliderSelector=undefined;n.countrySelected=function(n){tt.put("destinationRegionIdCookie",n.regionId,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});rt.setDestinationRegionalSettingValues(!0);rt.priceSliderSelector!==undefined&&rt.resetPriceRange(!0,!0)};rt.setDestinationRegionalSettingValues=function(n){abp.services.app.regionalSettings.getWebsiteDestRegionalAllSettings({settingNames:c.settingNames,DestinationRegionId:rt.selectedCountryRegionId},{async:!1}).done(function(n){c.destinationRegion=n.destRegion;rt.destinationRegion=c.destinationRegion;c.destinationRegionalSettings=n.destRegionalLists;c.destinationRegionLanguages=n.DestRegionLanguages});n&&et();rt.setCurrencies();rt.initSearchTabs();rt.getPageParameter(null,null,!1);rt.initGeo();n&&(rt.geoValue="",rt.search.searchText="");rt.getListings()};rt.dropdownLocalzones=!1;rt.currentPath=a.protocol()+"://"+a.host()+(a.port()!=null&&a.port()!=""?":"+a.port():"");rt.header=app.localize("websiteAllPropertyForSale");rt.openAgentModal=function(n,t){nt.location.href=t==!0?"/"+n+"?contact=true":"/"+n};rt.getTransactionType=function(n){return n==1?app.localize("websiteForSale"):app.localize("websiteForRent")};rt.requestParams={};rt.isMapSearch=!1;rt.pageSize=24;rt.region=c.region;rt.destinationRegion=c.destinationRegion;rt.regionId=rt.region.id;rt.countryId=rt.region.countryId;rt.tenantId=rt.region.tenantId;rt.lookupListings=!1;rt.showEnergyRating=!1;rt.unitOfMeasurement=[];rt.bedRoomCount=null;rt.bathRoomCount=null;rt.parkingSpaces=null;rt.iconRes=!1;rt.iconCom=!1;rt.iconLand=!1;rt.bedRoomsPrefix="";rt.priceSlider={skin:"flat",type:"double",minValue:0,maxValue:1e8,from:0,to:1e8,step:1e4};rt.showPriceSlider=!1;rt.metroStationsText=app.localize("BTSorMRTStations");rt.propertyTypeDefaultText=app.localize("websiteNothingSelected");switch(rt.region.tenantId){case 1:rt.propertyTypeDefaultText=app.localize("websiteSelect...");break;case 4:rt.propertyTypeDefaultText=app.localize("PropertyType")}rt.getPropertyTypeText=function(n){if(n==4)return app.localize("websitePropertyType")};n.getLocation=function(n){return rt.typeaheadIsLoading=!0,new Promise(function(t){var i=ct(rt.getDestRegionalSetting("DefaultGeoSearchLevel")),r=rt.getDestRegionalSetting("DefaultGeoSearchValues");l.getSearchGeo({search:n,countryUID:rt.destinationRegion.countryId,level:i,ids:r}).success(function(n){for(var i=0;i<n.items.length;i++)n.items[i].groupNameLocalized=app.localize(n.items[i].groupName);rt.typeaheadIsLoading=!1;rt.geoId=undefined;rt.geoGroup=undefined;firstResult=n.items[0];t(n.items)})})};n.onSelect=function(n){angular.element("#freeTextLocationSearchSelection").length&&(rt.search.province=null,rt.search.macroProvince=null,rt.search.city=null,rt.search.localZoneIds=[],rt.search.localZoneId=null,rt.search.districtId=null,rt.search.districtIds=[],rt.search.station=null);rt.search.searchText=n.name;rt.geoId=n.id;rt.geoValue=n.name;rt.geoGroup=n.group;var t="";rt.geoGroup==4?(rt.search.districtIds=rt.districtIds,t="District"):rt.geoGroup==3?(rt.search.localZoneIds=rt.geoId,t="LocalZone"):rt.geoGroup==2?(rt.search.city=rt.geoId,t="City"):rt.geoGroup==1?(rt.search.province=rt.geoId,t="Province"):rt.geoGroup==0&&(rt.search.macroProvince=rt.geoId,t="Macroprovince");rt.getRegionalSetting("Enable Public-Transportation Feature")&&(l.getMacroProvinceByGeo({defaultGeoSearchLevel:t,defaultGeoSearchValues:rt.geoId}).success(function(n){l.getStationsForMacroprovince(n).success(function(n){rt.stations=n})}),setTimeout(function(){$("#StationSelectionCombobox").selectpicker("refresh")},0))};n.modelOptions={debounce:{"default":500,blur:250},getterSetter:!0};rt.goListingDetail=function(n){location.href=location.origin+"/listingDetails/"+n};rt.goListingDetailSEO=function(n){location.href=location.origin+"/"+n};rt.goContactUs=function(){location.href=location.origin+"/contactus"};rt.showNoResultsContainer=function(){return(rt.listings==null||rt.listings.length==0)&&!rt.loading};rt.languages=abp.localization.languages;rt.changeLanguage=function(){rt.doFilter("lan");e.isUndefinedOrNull(rt.search.lan)&&(rt.search.lan=_.where(abp.localization.languages,{name:abp.localization.currentLanguage.name})[0].name);at()};rt.toggleVirtual=function(){rt.search.isVirtualOpenHouse=!rt.search.isVirtualOpenHouse;rt.getListings()};rt.getClassNameForEnergyEfficiency=function(n){var t="energy-rating";switch(n){case"A+":return t+" a1";case"A":return t+" a0";case"B":return t+" b0";case"B-":return t+" b-1";case"C":return t+" c0";case"D":return t+" d0";case"E":return t+" e0";case"F":return t+" f0";case"G":return t+" g0";case"NC":return t+" nc";default:return t}};rt.showDetail=function(){rt.showDetailValue=!rt.showDetailValue};rt.selectLanguage=function(n){rt.search.currency=_.where(rt.currencies,{id:n})[0].name};rt.resetSearch=function(){rt.geoId=null;rt.geoValue=null;et();rt.bedRoomCount=null;rt.bathRoomCount=null;rt.parkingSpaces=null;rt.search.currency=rt.defaultCurrency.currencyISO;rt.curPage=0;rt.search.pageNumber=0;rt.developmentId=null;rt.localZones=null;rt.districts=null;rt.energyEfficiency=null;rt.search.propertyType=null;rt.search.metroStations=null;rt.search.station=null;rt.search.isVirtualOpenHouse=!1;rt.resetPriceRange(!1);setTimeout(function(){$("#PropertyTypeSelectionCombobox").selectpicker("refresh")},0);setTimeout(function(){$("#StationSelectionCombobox").selectpicker("refresh")},0);setTimeout(function(){$("#freeTextLocationSearchSelection").selectpicker("refresh")},0)};rt.setTransactionType=function(){switch(rt.transactionTypeDropDownValue){case 357:case 1663:rt.search.transactionType=1;break;case 356:case 1664:rt.search.transactionType=2;break;default:rt.search.transactionType=1}};rt.setPropertiesAddedintheLast=function(){switch(rt.propertiesAddedintheLastDropdownValue){case 1412:rt.search.addedLabel=0;break;case 1413:rt.search.addedLabel=30;break;case 1414:rt.search.addedLabel=7;break;case 1415:rt.search.addedLabel=1;break;default:rt.search.addedLabel=null}};rt.setSearchFeaturesDropdown=function(){switch(parseInt(rt.search.resCom)){case 1:rt.search.resCom=1;rt.iconRes=!rt.iconRes;rt.iconCom=!1;rt.iconLand=!1;break;case 2:rt.search.resCom=2;rt.iconCom=!rt.iconCom;rt.iconRes=!1;rt.iconLand=!1;break;case 3:rt.search.resCom=3;rt.iconLand=!rt.iconLand;rt.iconRes=!1;rt.iconCom=!1;break;default:rt.search.resCom=-1}rt.iconRes||rt.iconCom||rt.iconLand||(rt.search.resCom=-1);rt.search.propertyType=null;rt.setSearchFeatures()};rt.listingClassChanged=function(){rt.setSearchFeatures();rt.search.propertyType=null;rt.priceSliderSelector!==undefined&&rt.resetPriceRange(!0,!0)};rt.setSearchFeatures=function(){parseInt(rt.search.resCom)==1?(rt.residentialFeatures=!0,rt.commercialFeatures=!1,rt.landFeatures=!1,rt.getRegionalSetting("EnergyRating")&&(rt.showEnergyRating=!0),rt.search.bedRoomCount=rt.bedRoomCount,rt.search.bathRoomCount=rt.bathRoomCount,rt.search.parkingSpaces=rt.parkingSpaces,rt.search.totalRoomCount=null,rt.search.minTotalAreaSqMeter=null,rt.search.minLotSizeSqMeter=null):parseInt(rt.search.resCom)==2?(rt.residentialFeatures=!1,rt.commercialFeatures=!0,rt.landFeatures=!1,rt.getRegionalSetting("EnergyRating")&&(rt.showEnergyRating=!0),rt.search.parkingSpaces=rt.parkingSpaces,rt.search.bedRoomCount=null,rt.search.bathRoomCount=null,rt.search.minSqMeter=null,rt.search.minLotSizeSqMeter=null):(rt.residentialFeatures=!1,rt.commercialFeatures=!1,rt.landFeatures=!0,rt.showEnergyRating=!1,rt.search.bedRoomCount=null,rt.search.bathRoomCount=null,rt.search.minSqMeter=null,rt.search.parkingSpaces=null,rt.search.totalRoomCount=null,rt.search.minTotalAreaSqMeter=null)};rt.resetSearchPanel=function(){rt.search.macroProvince=null;rt.search.province=null;rt.search.city=null;rt.search.localZoneIds=[];rt.search.localZoneId=null;ht()};rt.getRegionalSetting=function(n){for(var i,t=0;t<c.regionalSettings.length;t++)if(c.regionalSettings[t].name==n)return c.regionalSettings[t].type=="ListStringSettingValueDto"||c.regionalSettings[t].type=="ListIntSettingValueDto"?c.regionalSettings[t].output.values:c.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};rt.getDestRegionalSetting=function(n){for(var i,t=0;t<c.destinationRegionalSettings.length;t++)if(c.destinationRegionalSettings[t].name==n)return c.destinationRegionalSettings[t].type=="ListStringSettingValueDto"||c.destinationRegionalSettings[t].type=="ListIntSettingValueDto"?c.destinationRegionalSettings[t].output.values:c.destinationRegionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};ft=rt.getDestRegionalSetting("DevelopmentProjectsWebsite");rt.isTaxEnabled=rt.getDestRegionalSetting("Tax Included");rt.taxString=" + "+app.localize("TAX");rt.getRegionalSetting("EnergyRating")&&(rt.showEnergyRating=!0);rt.getInclude=function(){return abp.rootTemplatePath+"views/listings/partials/listingGallery.cshtml"};n.switchTabs=function(t){rt.tabClicked=!0;t.includes("gallery")?(rt.filterVisible=!0,rt.activeTemplate="/App/common/views/listings/tabs/listingGallery.cshtml",rt.isMapSearch=!1,rt.search.map=0,app.utils.InsertGoogleTagManagerEvent("Click","ListingSearch - ListingGallery","ListingSearch - ListingGallery"),angular.forEach(n.tabs,function(t,i){n.tabs[i].icon=n.tabs[i].id=="gallery"?"gallery-tab-active":"map-tab"})):(rt.filterVisible=!1,rt.activeTemplate="/App/common/views/listings/tabs/mapSearch.cshtml",rt.isMapSearch=!0,rt.search.map=1,app.utils.InsertGoogleTagManagerEvent("Click","ListingSearch - MapSearch","ListingSearch - MapSearch"),angular.forEach(n.tabs,function(t,i){n.tabs[i].icon=n.tabs[i].id=="map"?"map-tab-active":"gallery-tab"}))};n.finishLoading=function(){rt.tabClicked};rt.searchListings=function(t){if(rt.curPage=0,rt.search.pageNumber=0,typeof rt.geoId=="undefined"&&typeof rt.geoGroup=="undefined"&&typeof rt.geoValue!="undefined"&&typeof firstResult!="undefined"&&rt.geoValue!="")n.onSelect(firstResult);rt.search.id?h.getListingRegionId(rt.search.id).success(function(n){n==rt.selectedCountryRegionId?rt.goListingDetail(rt.search.id):rt.getListings()}):(t==null||t==!1)&&rt.getListings()};rt.getDevelopments=function(n){angular.isUndefined(rt.search.localZoneIds)&&st(n);s.getDevelopments({regionId:rt.destinationRegion.id,localzoneUIDs:rt.search.localZoneIds}).success(function(n){ft&&(rt.developments=n.items,rt.showDevelopments=rt.developments.length>0?!0:!1);_.where(rt.localZones,{hasLowerLevel:!0}).length>0&&(rt.dropdownLocalzones=!0,vt())})};rt.getBuildings=function(n){s.getBuildingsByDevelopment({developmentId:n}).success(function(n){rt.buildings=n.items;rt.disableBuildings=n.items==0?!0:!1})};rt.getLookupList=function(n){return e.getLookupListById(rt.pageLookupLists,n)};rt.IsAnyGeoData=function(){return!((rt.macroProvinces==null||rt.macroProvinces.length==0)&&(rt.provinces==null||rt.provinces.length==0)&&(rt.cities==null||rt.cities.length==0)&&(rt.localZones==null||rt.localZones.length==0))};rt.showHideGeoSearchDropDown=function(n){var i=rt.getDestRegionalSetting("DefaultGeoSearchLevel"),r=rt.getDestRegionalSetting("DefaultGeoSearchValues"),t;return n=="MacroProvince"&&(rt.macroProvinces==null||rt.macroProvinces.length===0)?!1:n=="Province"&&(rt.provinces==null||rt.provinces.length===0)?!1:n=="City"&&(rt.cities==null||rt.cities.length===0)?!1:n=="LocalZone"&&(rt.localZones==null||rt.localZones.length===0)?!1:n=="District"&&(rt.districts==null||rt.districts.length===0)?!1:(t={},t.County=5,t.MacroProvince=4,t.Province=3,t.City=2,t.LocalZone=1,t.District=0,t[n]>t[i])?!1:t[n]==t[i]&&r.length==1?!1:!0};rt.setCurrencies=function(){var n=rt.getRegionalSetting("DefaultGeoSearchLevel"),t=rt.getRegionalSetting("DefaultGeoSearchValues");f.getListingDetailPageViewModel({tenantId:rt.tenantId,regionId:rt.region.id,countryId:rt.region.countryId,defaultGeoSearchLevel:n,defaultGeoSearchValues:t}).success(function(n){rt.currencies=n.currencies.regionalCurrencies;rt.defaultCurrency=n.currencies.regionalDefaultCurrency;rt.displayDefaultCurrencySymbol=rt.defaultCurrency.htmlSymbol!=null?rt.defaultCurrency.htmlSymbol:rt.defaultCurrency.currencyISO;rt.search.currency=rt.defaultCurrency.currencyISO})};rt.getPageParameter=function(n,t,i){var u=rt.getDestRegionalSetting("DefaultGeoSearchLevel"),r=rt.getDestRegionalSetting("DefaultGeoSearchValues");f.getListingDetailPageViewModel({tenantId:rt.tenantId,regionId:rt.destinationRegion.id,countryId:rt.destinationRegion.countryId,defaultGeoSearchLevel:u,defaultGeoSearchValues:r}).success(function(f){var o;rt.pageLookupLists=f.listLabels.items;rt.lookupListings=!0;angular.isUndefined(rt.defaultCurrency)||rt.defaultCurrency==null||(rt.displayDefaultCurrencySymbol=rt.defaultCurrency.htmlSymbol!=null?rt.defaultCurrency.htmlSymbol:rt.defaultCurrency.currencyISO,rt.search.currency=rt.defaultCurrency.currencyISO);rt.propertyType1=rt.getLookupList(58);rt.propertyType2=rt.getLookupList(57);rt.propertyType3=rt.getLookupList(59);rt.listingClassTemp=[];rt.listingClassTemp.push({listLabelId:-1,targetValue:app.localize("websiteListingClass")});rt.listingClass=rt.listingClassTemp.concat(rt.getLookupList(88));o=rt.getLookupList(17);rt.transactionType=o;rt.propertiesAddedintheLast=rt.getLookupList(89);rt.energyEfficiency=rt.getLookupList(31);rt.roomsAndParkingList=rt.getLookupList(90);rt.filters=rt.getLookupList(61);rt.metroFilters=rt.getLookupList(103);var s={listLabelId:0,targetValue:app.localize("websiteAll")},h={listLabelId:1,targetValue:app.localize("websiteDay")},c={listLabelId:7,targetValue:app.localize("websiteWeek")},a={listLabelId:30,targetValue:app.localize("websiteMonth")};rt.addedList=[s,h,c,a];rt.bedRoomCount=e.isNumber(rt.search.bedRoomCount)?e.isNumber(rt.search.bedRoomCount)>0?parseInt(rt.search.bedRoomCount):null:rt.search.bedRoomCount;rt.bathRoomCount=e.isNumber(rt.search.bathRoomCount)?e.isNumber(rt.search.bathRoomCount)>0?parseInt(rt.search.bathRoomCount):null:rt.search.bathRoomCount;rt.parkingSpaces=e.isNumber(rt.search.parkingSpaces)?e.isNumber(rt.search.parkingSpaces)>0?parseInt(rt.search.parkingSpaces):null:rt.search.parkingSpaces;st(t);l.getInitGeoDataForWebSite({districtId:rt.search.districtId,localZoneId:rt.search.localZoneId,cityId:rt.search.city,provinceId:rt.search.province,macroProvinceId:rt.search.macroProvince,maxGeoLevel:u,maxGeoLevelValues:r}).success(function(f){var s,e,o;rt.localZones=f.localZones;rt.cities=f.cities;rt.provinces=f.provinces;rt.macroProvinces=f.macroProvinces;rt.districts=f.districts;s=rt.search.macroProvince;e=null;r.length!=null&&r.length>0&&(e=r[0]);rt.getRegionalSetting("Enable Public-Transportation Feature")&&l.getMacroProvinceByGeo({macroProvinceUID:s,defaultGeoSearchLevel:u,defaultGeoSearchValues:e}).success(function(n){l.getStationsForMacroprovince(n).success(function(n){rt.stations=n})});rt.getRegionalSetting("DefaultGeoSearchLevel")!="City"&&(rt.search.macroProvince=f.macroProvinceId,rt.search.province=f.provinceId);rt.search.city=f.cityId;f.districtId!=null&&f.districtId!=undefined&&(o=f.districtId,rt.dropdownLocalzones=!0,rt.search.districtIds.indexOf(o)===-1&&rt.search.districtIds.push(o));f.localZoneId!=null&&f.localZoneId!=undefined&&(rt.search.localZoneId=f.localZoneId,rt.search.localZoneIds.indexOf(rt.search.localZoneId)===-1&&rt.search.localZoneIds.push(rt.search.localZoneId),rt.getDevelopments(t));rt.localZones!=null&&_.where(rt.localZones,{hasLowerLevel:!0}).length>0&&(rt.dropdownLocalzones=!0);rt.getDevelopments(t);rt.search.districtId==null&&rt.search.localZoneId==null&&rt.search.city==null&&rt.search.province==null&&rt.search.macroProvince==null&&rt.search.searchText!=""?(rt.loading=!1,setTimeout(ot,500),y.registerHit({tenantId:rt.tenantId,regionId:rt.regionId,name:app.consts.hitsName.listingSearch,type:app.consts.hitsType.search,languageCode:abp.localization.currentLanguage.name})):(i==null||i==!0)&&rt.getListings(n)})})};rt.macroProvinceSelected=function(){rt.search.macroProvince==null?rt.provinces=null:l.getGeoProvincesForWebSite({parentId:rt.search.macroProvince}).success(function(n){rt.provinces=n.items});rt.search.localZoneIds=null;rt.search.localZoneId=null;rt.search.districtId=null;rt.search.districtIds=null;rt.search.city=null;rt.search.province=null;rt.districts=null;rt.localZones=null;rt.cities=null};rt.provinceSelected=function(){rt.search.province==null?rt.cities=null:l.getGeoCitiesForWebSite({parentId:rt.search.province}).success(function(n){rt.cities=n.items});rt.search.localZoneIds=null;rt.search.localZoneId=null;rt.search.districtId=null;rt.search.districtIds=null;rt.search.city=null;rt.districts=null;rt.localZones=null};rt.citySelected=function(){rt.search.city==null?rt.localZones=null:l.getGeoLocalZonesForWebSite({parentId:rt.search.city}).success(function(n){rt.localZones=n.items;rt.dropdownLocalzones=_.where(rt.localZones,{hasLowerLevel:!0}).length>0?!0:!1;setTimeout(function(){$("#LocalzoneSelectionCombobox").selectpicker("refresh")},0)});rt.search.localZoneIds=null;rt.search.localZoneId=null;rt.search.districtId=null;rt.search.districtIds=null;rt.districts=null};rt.initSearchTabs=function(){var i=a.search(),t=i.map;rt.getRegionalSetting("IsGoogleMapsHiddenOnWebsite")?(n.tabs=[{id:"gallery",title:app.localize("websiteListingGallery"),template:"/App/common/views/listings/tabs/listingGallery.cshtml",icon:"gallery-tab-active"}],rt.activeTemplate="/App/common/views/listings/tabs/listingGallery.cshtml",rt.isMapSearch=!1):rt.getRegionalSetting("IsMapSearchListingSearchEnabledOnRegionalWebsite")?(rt.getRegionalSetting("IsMapSearchDefaultOnRegionalWebsite")?(rt.activeTemplate="/App/common/views/listings/tabs/mapSearch.cshtml",rt.isMapSearch=!0):(rt.activeTemplate=t?"/App/common/views/listings/tabs/mapSearch.cshtml":"/App/common/views/listings/tabs/listingGallery.cshtml",rt.isMapSearch=!1),rt.isMapSearch?rt.isMapSearch&&(n.tabs=[{id:"map",title:app.localize("websiteMapSearch"),template:"/App/common/views/listings/tabs/mapSearch.cshtml",icon:rt.isMapSearch?"map-tab-active":"map-tab"},{id:"gallery",title:app.localize("websiteListingGallery"),template:"/App/common/views/listings/tabs/listingGallery.cshtml",icon:rt.isMapSearch?"gallery-tab":"gallery-tab-active"}]):(n.tabs=[{id:"gallery",title:app.localize("websiteListingGallery"),template:"/App/common/views/listings/tabs/listingGallery.cshtml",icon:rt.isMapSearch||t?"gallery-tab":"gallery-tab-active"},{id:"map",title:app.localize("websiteMapSearch"),template:"/App/common/views/listings/tabs/mapSearch.cshtml",icon:rt.isMapSearch||t?"map-tab-active":"map-tab"}],rt.isMapSearch=t)):(n.tabs=[{id:"gallery",title:app.localize("websiteListingGallery"),template:"/App/common/views/listings/tabs/listingGallery.cshtml",icon:"gallery-tab-active"}],rt.activeTemplate="/App/common/views/listings/tabs/listingGallery.cshtml",rt.isMapSearch=!1)};rt.getListings=function(n){var t,i,r;if(n?rt.header=n:rt.getHeader(),rt.setSearchFeatures(),ht(),rt.showEnergyRating||(rt.requestParams.energyLevel=null),rt.requestParams.taxIncluded=rt.isTaxEnabled,rt.search.development!=""&&rt.search.development!=null&&(t=_.where(rt.developments,{developmentId:parseInt(rt.search.development)}),rt.requestParams.developmentId=t.length>0?t[0].id:null,rt.developmentId=rt.requestParams.developmentId),angular.element("#freeTextLocationSearchSelection").length&&(rt.geoGroup==4?(rt.requestParams.districtIds=[rt.geoId],rt.search.districtIds=rt.districtIds):rt.geoGroup==3?(rt.requestParams.localZoneIds=[rt.geoId],rt.search.localZoneIds=rt.geoId):rt.geoGroup==2?(rt.requestParams.cityId=rt.geoId,rt.search.city=rt.geoId):rt.geoGroup==1?(rt.requestParams.provinceId=rt.geoId,rt.search.province=rt.geoId):rt.geoGroup==0&&(rt.requestParams.macroProvinceId=rt.geoId,rt.search.macroProvince=rt.geoId)),rt.setSearchFeatures(),rt.isMapSearch?(rt.requestParams.maxResultCount=1e3,rt.search.metroStations=null):(rt.curPage&&rt.search.pageNumber!=rt.curPage?rt.search.pageNumber=rt.curPage:rt.search.pageNumber&&(rt.curPage=rt.search.pageNumber),rt.curPage?(rt.requestParams.skipCount=(rt.curPage-1)*rt.pageSize,rt.requestParams.maxResultCount=rt.pageSize):(rt.requestParams.skipCount=0,rt.requestParams.maxResultCount=rt.pageSize)),rt.requestParams.minPrice!=null&&rt.requestParams.maxPrice!=null&&(i=e.isNumber(rt.requestParams.minPrice),r=e.isNumber(rt.requestParams.maxPrice),i&&r&&parseFloat(rt.requestParams.minPrice)>parseFloat(rt.requestParams.maxPrice))){alert(app.localize("MinValueCantBeMoreThanMaxValue"));return}rt.requestParams.freeTextSearch=rt.search.freeTextSearch;rt.requestParams.listingClass==1?(rt.listingClassSqM=app.localize("websiteListingResidentialSqM"),rt.listingClassSqFt=app.localize("websiteListingResidentialSqFt")):rt.requestParams.listingClass==2?(rt.listingClassSqM=app.localize("websiteListingCommercialSqM"),rt.listingClassSqFt=app.localize("websiteListingCommercialSqFt")):rt.requestParams.listingClass==3&&(rt.listingClassSqM=app.localize("websiteListingLandSqM"),rt.listingClassSqFt=app.localize("websiteListingLandSqFt"));rt.requestParams.homeRegionCurrencyUID=rt.region.defaultCurrencyId;rt.loading=!0;rt.isMapSearch?y.registerHit({tenantId:rt.tenantId,regionId:rt.regionId,name:app.consts.hitsName.listingSearch,type:app.consts.hitsType.search,languageCode:abp.localization.currentLanguage.name}).success(function(){b.createMap(rt,"search_map_openstreetmap",rt.region,c.region,rt.requestParams,h);rt.loading=!1}):(b.disposeMap(),h.getListingsForWebSite(rt.requestParams).success(function(n){rt.totalCount=n.totalCount;rt.listings=n.items}).finally(function(){var i,t,n;rt.loading=!1;document.body.scrollTop=0;document.documentElement.scrollTop=0;setTimeout(function(){$("#PropertyTypeSelectionCombobox").selectpicker("refresh")},0);i=abp.localization.getSource();rt.curPage||(rt.curPage=1,rt.search.pageNumber=1);rt.bedRoomsPrefix=rt.getRegionalSetting("Is T Used for Bedrooms on Regional Website?")?"T":"";t=(rt.curPage-1)*rt.pageSize+1;n=t+rt.pageSize-1;n>rt.totalCount&&(n=rt.totalCount);window.prerenderReady=!0;rt.paginationMessage=i("ShowingXtoYofZrecords",t,n,rt.totalCount);setTimeout(ot,500);y.registerHit({tenantId:rt.tenantId,regionId:rt.regionId,name:app.consts.hitsName.listingSearch,type:app.consts.hitsType.search,languageCode:abp.localization.currentLanguage.name})}))};rt.currencyChanged=function(n,t){if(t){var i=_.where(rt.currencies,{currencyISO:t});i.length>0&&(rt.displayDefaultCurrencySymbol=angular.isUndefined(i[0].htmlSymbol)?i[0].currencyISO:i[0].htmlSymbol);rt.search.currency=i[0].currencyISO}else rt.displayDefaultCurrencySymbol=angular.isUndefined(n.htmlSymbol)?n.currencyISO:n.htmlSymbol,rt.search.currency=n.currencyISO};rt.openCalculator=function(n,t,i,r){pt(n,t,i,r)};rt.getListingHeaderText=function(n,t,i,r,u,f){var o,e;if(rt.search.officeId!=0&&rt.search.propertyType==null&&i==""&&r==""&&u==""&&f==""&&rt.search.transactionType==0)return rt.header=app.localize("websiteListingHeaderTextFromOffficePage",app.localize(rt.search.officeName));if(rt.search.agentId!=0&&rt.search.propertyType==null&&i==""&&r==""&&u==""&&f==""&&rt.search.transactionType==0)return rt.header=app.localize("websiteListingHeaderTextFromAgentPage",app.localize(rt.search.agentName));rt.search.propertyType==null&&i==""&&r==""&&u==""&&f==""&&rt.search.transactionType==1&&rt.search.resCom==0?rt.header=app.localize("websiteAllPropertyForSale"):rt.search.propertyType==null&&i==""&&r==""&&u==""&&rt.search.transactionType==2&&rt.search.resCom==0?rt.header=app.localize("websiteAllPropertyForRent"):rt.search.propertyType==null&&i==""&&r==""&&u==""&&f==""&&(rt.header=rt.search.resCom==1?rt.search.transactionType==1?app.localize("websiteListingHeaderTextFormat1",app.localize("websiteResidential"),app.localize("websiteForSale")):app.localize("websiteListingHeaderTextFormat1",app.localize("websiteResidential"),app.localize("websiteForRent")):rt.search.resCom==2?rt.search.transactionType==1?app.localize("websiteListingHeaderTextFormat1",app.localize("websiteCommercial"),app.localize("websiteForSale")):app.localize("websiteListingHeaderTextFormat1",app.localize("websiteCommercial"),app.localize("websiteForRent")):rt.search.resCom==3?rt.search.transactionType==1?app.localize("websiteListingHeaderTextFormat1",app.localize("websiteLand"),app.localize("websiteForSale")):app.localize("websiteListingHeaderTextFormat1",app.localize("websiteLand"),app.localize("websiteForRent")):rt.search.transactionType==1?app.localize("websiteAllPropertyForSale"):app.localize("websiteAllPropertyForRent"));rt.search.propertyType!=null&&i==""&&r==""&&u==""&&f==""&&rt.search.transactionType==1&&rt.search.resCom!=0?rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat1",app.localize(e.targetValue),app.localize("websiteForSale"))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat1",app.localize(e.targetValue),app.localize("websiteForSale"))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat1",app.localize(e.targetValue),app.localize("websiteForSale"))):rt.search.propertyType!=null&&i==""&&r==""&&u==""&&f==""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat1",app.localize(e.targetValue),app.localize("websiteForRent"))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat1",app.localize(e.targetValue),app.localize("websiteForRent"))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat1",app.localize(e.targetValue),app.localize("websiteForRent"))));rt.search.propertyType==null&&i!=""&&r==""&&u==""&&f==""&&rt.search.transactionType==1&&rt.search.resCom!=0?rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForSale"),app.localize(i)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForSale"),app.localize(i)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForSale"),app.localize(i)):rt.search.propertyType==null&&i!=""&&r==""&&u==""&&f==""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForRent"),app.localize(i)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForRent"),app.localize(i)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForRent"),app.localize(i)));rt.search.propertyType!=null&&i!=""&&r==""&&u==""&&f==""&&rt.search.transactionType==1&&rt.search.resCom!=0?rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(i))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(i))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(i))):rt.search.propertyType!=null&&i!=""&&r==""&&u==""&&f==""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(i))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(i))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(i))));rt.search.propertyType==null&&i!=""&&r!=""&&u==""&&f==""&&rt.search.transactionType==1&&rt.search.resCom!=0?rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForSale"),app.localize(r)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForSale"),app.localize(r)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForSale"),app.localize(r)):rt.search.propertyType==null&&i!=""&&r!=""&&u==""&&f==""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForRent"),app.localize(r)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForRent"),app.localize(r)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForRent"),app.localize(r)));rt.search.propertyType!=null&&i!=""&&r!=""&&u==""&&f==""&&rt.search.transactionType==1&&rt.search.resCom!=0?rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(r))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(r))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(r))):rt.search.propertyType!=null&&i!=""&&r!=""&&u==""&&f==""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(r))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(r))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(r))));rt.search.propertyType==null&&i!=""&&r!=""&&u!=""&&f==""&&rt.search.transactionType==1&&rt.search.resCom!=0?rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForSale"),app.localize(u)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForSale"),app.localize(u)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForSale"),app.localize(u)):rt.search.propertyType==null&&i!=""&&r!=""&&u!=""&&f==""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForRent"),app.localize(u)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForRent"),app.localize(u)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForRent"),app.localize(u)));rt.search.propertyType!=null&&i!=""&&r!=""&&u!=""&&f==""&&rt.search.transactionType==1&&rt.search.resCom!=0?rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(u))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(u))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(u))):rt.search.propertyType!=null&&i!=""&&r!=""&&u!=""&&f==""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(u))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(u))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(u))));rt.search.propertyType==null&&i!=""&&r!=""&&u!=""&&f!=""&&rt.search.transactionType==1&&rt.search.resCom!=0?(o=f,f.constructor===Array&&(o="",angular.forEach(f,function(n){o+=n+", "}),o=o.slice(0,-2)),rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForSale"),app.localize(o)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForSale"),app.localize(o)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForSale"),app.localize(o))):rt.search.propertyType==null&&i!=""&&r!=""&&u!=""&&f!=""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(o=f,f.constructor===Array&&(o="",angular.forEach(f,function(n){o+=n+", "}),o=o.slice(0,-2)),rt.header=rt.search.resCom==1?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteResidential"),app.localize("websiteForRent"),app.localize(o)):rt.search.resCom==2?app.localize("websiteListingHeaderTextFormat2",app.localize("websiteCommercial"),app.localize("websiteForRent"),app.localize(o)):app.localize("websiteListingHeaderTextFormat2",app.localize("websiteLand"),app.localize("websiteForRent"),app.localize(o)));rt.search.propertyType!=null&&i!=""&&r!=""&&u!=""&&f!=""&&rt.search.transactionType==1&&rt.search.resCom!=0?(o=f,f.constructor===Array&&(o="",angular.forEach(f,function(n){o+=n+", "}),o=o.slice(0,-2)),rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(o))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(o))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForSale"),app.localize(o)))):rt.search.propertyType!=null&&i!=""&&r!=""&&u!=""&&f!=""&&rt.search.transactionType==2&&rt.search.resCom!=0&&(o=f,f.constructor===Array&&(o="",angular.forEach(f,function(n){o+=n+", "}),o=o.slice(0,-2)),rt.search.resCom==1?(e=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(o))):rt.search.resCom==2?(e=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(o))):(e=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0],rt.header=app.localize("websiteListingHeaderTextFormat2",app.localize(e.targetValue),app.localize("websiteForRent"),app.localize(o))))};rt.getHeader=function(){var s=rt.region.countryName+" ",n;try{var i=n!=null&&n!=undefined?n.targetValue+" ":app.localize("websiteAllProperty")+" ",r=rt.search.transactionType==1?app.localize("websiteForSale")+" ":app.localize("websiteForRent")+" ",u=rt.search.macroProvince!=null&&rt.search.macroProvince!=undefined?_.where(rt.macroProvinces,{id:rt.search.macroProvince})[0].name:"",f=rt.search.province!=null&&rt.search.province!=undefined?_.where(rt.provinces,{id:rt.search.province})[0].name:"",o=e.isUndefinedOrNull(rt.search.city)?"":_.where(rt.cities,{id:rt.search.city})[0].name,t="";rt.search.localZoneIds!=null&&rt.search.localZoneIds.length!=0&&rt.search.localZoneIds!=undefined&&(rt.search.localZoneIds.length>1?(t=[],angular.forEach(rt.search.localZoneIds,function(n,i){t.push(_.where(rt.localZones,{id:rt.search.localZoneIds[i]})[0].name)})):t=_.where(rt.localZones,{id:rt.search.localZoneIds[0]})[0].name);rt.getListingHeaderText(i,r,u,f,o,t);n=null;rt.search.resCom==1?rt.search.propertyType!=null?n=_.where(rt.propertyType1,{listLabelId:rt.search.propertyType})[0]:"":rt.search.resCom==2?rt.search.propertyType!=null?n=_.where(rt.propertyType2,{listLabelId:rt.search.propertyType})[0]:"":rt.search.resCom==3&&(rt.search.propertyType!=null?n=_.where(rt.propertyType3,{listLabelId:rt.search.propertyType})[0]:"")}catch(h){rt.header=app.localize("websiteAllPropertyForSale")}};n.$watch("vm.search.localZoneIds",function(n,t){n!=t&&(ft&&(rt.showDevelopments=rt.search.localZoneIds==null?!1:!0),rt.search.localZoneIds===null&&(rt.search.localZoneId=null));rt.getDevelopments()},!0);n.$watch("vm.geoValue",function(n,t){n!=t&&(n==""||n==undefined)&&(rt.search.province=null,rt.search.macroProvince=null,rt.search.city=null,rt.search.localZoneIds=null,rt.search.localZoneId=null,rt.search.districtIds=null,rt.search.searchText=null,rt.geoId=null,rt.geoValue=null);rt.getDevelopments()},!0);n.$watch("vm.search.localZoneId",function(n,t){n!=t&&ft&&(rt.showDevelopments=rt.search.localZoneId==null?!1:!0);rt.getDevelopments()},!0);n.$watch("vm.developmentId",function(n){n&&(rt.search.development=_.where(rt.developments,{id:n})[0].developmentId)});n.$watch("vm.search",function(n,t){n!==t&&(angular.forEach(rt.search,function(n,i){if(rt.doFilter(i),i==="localZoneId"){if(Array.isArray(rt.search.localZoneIds)&&rt.search.localZoneIds.indexOf(t.localZoneId)!=-1){var r=rt.search.localZoneIds.indexOf(t.localZoneId);rt.search.localZoneIds.splice(r,1)}e.isUndefinedOrNull(rt.search.localZoneId)&&Array.isArray(rt.search.localZoneIds)?rt.search.localZoneIds.indexOf(rt.search.localZoneId)!=-1||e.isUndefinedOrNull(rt.search.localZoneId)||rt.search.localZoneIds.push(rt.search.localZoneId):rt.search.localZoneIds=[rt.search.localZoneId]}else i==="developmentId"?rt.search.development=n?_.where(rt.developments,{id:n})[0].developmentId:null:rt.priceSliderSelector!==undefined&&i=="transactionType"&&n!==t.transactionType&&rt.resetPriceRange(!0)}),rt.savedSearchSaved=!1)},!0);n.$on("$locationChangeSuccess",function(n,t,i){var u=getUrlParameter(i,"pageNumber"),r;u!=undefined&&u!=""&&(r=getUrlParameter(t,"pageNumber"),r!=undefined&&r!="")&&u!==r&&rt.curPage!=r&&(rt.search.pageNumber=a.search().pageNumber,rt.curPage=rt.search.pageNumber,rt.getListings())});rt.doFilter=function(n){e.doFilter(rt.search,n)};rt.addRemoveFavoriteListing=function(n,t){p.addRemoveFavoriteListing(n,t)};rt.openFavoriteModal=function(){var n=i.open({templateUrl:"~/App/common/views/listings/modal/listing-favorite-modal-dialog.cshtml",controller:"common.views.listing.modal.favorite as vm",backdrop:"static",size:"sm"});n.result.then(function(){ot()})};rt.openRecentlyViewedModal=function(){var n=i.open({templateUrl:"~/App/common/views/listings/modal/listing-recently-viewed-modal-dialog.cshtml",controller:"common.views.listing.modal.recentlyViewed as vm",backdrop:"static",size:"sm"});n.result.then(function(){})};rt.openAgentContactModal=function(n,t){var r=i.open({templateUrl:"~/App/common/views/listings/modal/listing-list-contact-modal-dialog.cshtml",controller:"common.views.listing.modal.list.contact as vm",size:"sm",resolve:{id:function(){return n},listingId:function(){return t}}});r.result.then(function(){})};rt.savedSearch=function(){var n=g.getCookie();n==""?wt():location.href=location.origin+"/mySavedSearch?t="+n};rt.showCurrencies=function(){yt(rt.currencies)};rt.initGeo=function(){var t=bt(window.location.hash),n=decodeURIComponent(t.searchText);rt.geoValue="";rt.search.searchText="";n!="undefined"&&(rt.geoValue=n,rt.search.searchText=n)};rt.openListingSearchPopup=function(n){var t="~/views/shortlink/sitetemplates/"+c.region.tenantName.toLowerCase()+"/"+n+"/views/listings/partials/listingsearch-popup.cshtml",r=i.open({templateUrl:t,controller:"common.views.listings.partials.listingSearchPopup as vm",backdrop:"static",size:"lg",resolve:{instance:function(){return rt}}});r.result.then(function(){rt.setDestinationRegionalSettingValues(!1);rt.searchListings(!0)})};rt.showPriceInButton=function(){return rt.search.minPrice!=undefined&&rt.search.minPrice!=null&&rt.search.minPrice!==""&&(rt.search.minPrice=="0"||rt.search.minPrice>0)&&rt.search.maxPrice!=undefined&&rt.search.maxPrice!=null&&rt.search.maxPrice!==""&&(rt.search.maxPrice=="0"||rt.search.maxPrice>0)};rt.loadSlider=function(n){rt.priceSliderObj&&rt.reloadSlider();rt.priceSliderObj=$(n);rt.priceSliderObj.ionRangeSlider(rt.sliderInstanceData)};rt.reloadSlider=function(){rt.priceSliderInstance=rt.priceSliderObj.data("ionRangeSlider");rt.priceSliderInstance.update(rt.sliderInstanceData)};rt.openPriceSliderPopup=function(){rt.priceSliderSelector||rt.setupPriceSlider(!0);rt.showPriceSlider=!rt.showPriceSlider};rt.closePriceSlider=function(n){$(n.target).closest("#priceRangePopup").length===0&&$(n.target).closest("#priceRangeButtonGroup").length===0&&(rt.showPriceSlider=!1)};rt.resetPriceRange=function(){rt.priceSliderSelector=null;rt.displayPriceOnButton=!1;rt.search.minPrice=undefined;rt.search.maxPrice=undefined;rt.getListings()};rt.updatePriceOnFinish=function(t){rt.displayPriceOnButton=!0;rt.updatePrice(t);n.$apply()};rt.updatePrice=function(n){rt.search.minPrice=n.from;rt.search.maxPrice=n.to;rt.doFilter("minPrice");rt.doFilter("maxPrice")};rt.priceInputChanged=function(){(rt.search.minPrice!=rt.priceSlider.from||rt.search.maxPrice!=rt.priceSlider.to)&&(rt.search.minPrice<rt.minMaxValues.min&&(rt.search.minPrice=rt.minMaxValues.min),rt.search.maxPrice>rt.minMaxValues.max&&(rt.search.maxPrice=rt.minMaxValues.max),rt.setupPriceSlider(!1,!0))};rt.setupPriceSlider=function(n,t,i){rt.priceSliderSelector="#priceSlider";h.getListingPriceDataForWebsite({tenantId:c.region.tenantId,regionId:rt.destinationRegion.id,transactionType:rt.search.transactionType,listingClass:rt.search.resCom,currency:rt.search.currency}).success(function(r){r&&(rt.minMaxValues=r,rt.priceSlider.minValue=r.min,rt.priceSlider.maxValue=r.max,rt.search.minPrice!=undefined&&(n||t)?(rt.priceSlider.from=rt.search.minPrice,rt.displayPriceOnButton=!0):(rt.priceSlider.from=r.minPrice,n&&t!==null&&(rt.search.minPrice=rt.priceSlider.from)),rt.search.maxPrice!=undefined&&(n||t)?(rt.priceSlider.to=rt.search.maxPrice,rt.displayPriceOnButton=!0):(rt.priceSlider.to=r.maxPrice,n&&t!==null&&(rt.search.maxPrice=rt.priceSlider.to)),rt.priceSlider.step=rt.transactionType==1?1e4:500,rt.sliderInstanceData={skin:rt.priceSlider.skin,type:rt.priceSlider.type,min:rt.priceSlider.minValue,max:rt.priceSlider.maxValue,from:rt.priceSlider.from,to:rt.priceSlider.to,step:rt.priceSlider.step,onFinish:function(n){rt.updatePriceOnFinish(n)}},rt.loadSlider(rt.priceSliderSelector),(!n||t)&&rt.updatePrice(rt.sliderInstanceData));rt.priceSliderReady=!0;i&&rt.getListings()})};rt.init=function(n,t){rt.loading=!0;rt.headerParam=n;rt.querystringParam=t;rt.hidePriceSlider=!0;rt.getCountryFlagList();lt();rt.setCurrencies(n,t);rt.initSearchTabs();rt.getDevelopments(t);rt.initGeo();var i=a.search(),r=i.map;rt.reloadedWithMap=r}}])}(),function(){appModule.controller("common.views.listings.listingDetails",["$http","$scope","$state","$uibModal","$templateCache","uiGridConstants","helper","$stateParams","Lightbox","$location","cookieService","abp.services.app.listings","appSession","$sce","abp.services.app.hit","abp.services.app.listingBrochureGeneration","$filter","mapService","openstreetmapService","$window","abp.services.app.mortgageCalculator","abp.services.app.lookupLists","abp.services.app.contactForms","Notification","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt","QueryStringService","$cookies","chatIntegrationService",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st){function pt(n,t,i,u){var f=r.open({templateUrl:"~/App/common/views/listings/modal/priceList.cshtml",controller:"common.views.listings.priceList as vm",resolve:{price:function(){return n},priceEuro:function(){return t},priceUSD:function(){return i},listingCurrency:function(){return u}}});f.result.then(function(){})}function yt(){var n=c.getFavoriteListings();n.length>0?l.getFavoriteListingForWebSite({listingIds:n,tenantId:ht.tenantId,regionId:ht.destinationRegionId,languageCode:abp.localization.currentLanguage.name,homeRegionCurrencyUID:a.region.defaultCurrencyId,homeRegionId:a.region.id}).success(function(n){ht.favoriteListings=n}):ht.favoriteListings=null}function wt(){var n=c.getRecentlyViewedListings();n.length>0?l.getRecentlyViewedListingForWebSite({listingIds:n,tenantId:ht.tenantId,regionId:ht.destinationRegionId,languageCode:abp.localization.currentLanguage.name,homeRegionCurrencyUID:a.region.defaultCurrencyId,homeRegionId:a.region.id}).success(function(n){ht.recentlyViewedListings=n}):ht.recentlyViewedListings=null}function bt(){l.getListingOpenHouses(ht.listing.id).success(function(n){for(var t=0;t<n.length;t++)ht.openHouses.push({OpenHouseDateDay:n[t].openHouseDateDay,OpenHouseDateTime:n[t].openHouseDateTime})}).error(function(){ht.openHouses=[]})}function kt(n,t,i){var r=n,u;e.isUndefinedOrNull(r)?(u={id:n},h.path("/listings").search(params)):l.getListingForWebSite({filter:n,bpId:i,hashedAgentId:t,defaultCurrencyISO:ht.region.languageCode,regionId:ht.regionId,tenantId:ht.tenantId,homeRegionCurrencyUID:ht.region.defaultCurrencyId}).success(function(n){if(n==null){var t={id:t};h.path("/listings").search(params)}n.listing!=null&&ht.destinationRegionId!=n.listing.regionId?(ht.destinationRegionId=n.listing.regionId,ot.put("destinationRegionIdCookie",ht.destinationRegionId,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"}),abp.services.app.regionalSettings.getWebsiteDestRegionalAllSettings({settingNames:a.settingNames,DestinationRegionId:ht.destinationRegionId},{async:!1}).done(function(t){a.destinationRegion=t.destRegion;a.destinationRegionalSettings=t.destRegionalLists;a.destinationRegionLanguages=t.DestRegionLanguages;ht.processListing(n)})):ht.processListing(n)}).finally(function(){if(ht.listing!=undefined){c.addRemoveRecentlyViewedListing(ht.listing.id,!1);y.registerHit({tenantId:ht.tenantId,regionId:ht.regionId,agentId:ht.listing.agentId,officeId:ht.listing.officeId,name:app.consts.hitsName.listingDetailsView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name,listingId:ht.listing.id});ht.getMortgageCalculatorDefults();yt();wt();bt();si();ht.photoIcon=!1;$("#map").hide();ht.mapIcon=ht.listing.latitude||ht.listing.longitude?!0:!1;ht.listing.youtube&&(ht.youtubeIcon=!0);ht.listing.googleZoomLevel=15;var n=abp.appPath+"HtmlToPdf/GenerateMarketingPDFModularTemplate?listingKey="+ht.listing.key+"&title="+ht.header+"&agentid="+ht.listing.agentId;ht.linkToPdf="/pdf-viewer/web/viewer.html?file="+encodeURIComponent(n);et.getUrlParameter("contact")=="true"&&ht.openModal();window.prerenderReady=!0}ht.loading=!1})}function dt(){ht.maxPrice=ht.listing.listingPrice+ht.listing.listingPrice*.25;ht.minPrice=ht.listing.listingPrice-ht.listing.listingPrice*.25}function ct(n,t,i){window.jQuery&&n instanceof jQuery&&(n=n.get(0).id);var r=document.getElementById(n);r&&r.tagName.toUpperCase()!="IFRAME"&&(r=r.getElementsByTagName("iframe")[0]);r&&r.contentWindow.postMessage(JSON.stringify({event:"command",func:t,args:i||[],id:n}),"*")}function gt(n){var t="",i="",u,r;e.isUndefinedOrNull(n)||(u=n.split("?")[1],r=n.split("#")[1],n.indexOf("youtu.be/")!=-1?(i=n.substr(n.indexOf("youtu.be/")+9,n.length),t="https://youtube.com/embed/"+i+"?hl=tr&amp;autoplay=0&enablejsapi=1&&rel=0"):(i=getUrlParameter(n,"v"),t=n.replace("watch?v="+i,"embed/"+i+"?"),t=t.replace("watch?","embed/"+i+"?"),t=t+"&hl=tr&amp;autoplay=0&enablejsapi=1&rel=0"),t=at(t,n,"t"),t=at(t,n,"start"),t=at(t,n,"time_continue"),t=t.replace(u,""),r!==undefined&&(t=t.replace("#"+r,"")+"#"+r));t=t.replace("http://","https://");t=t.replace("?&","?");ht.youtubeLink=v.trustAsResourceUrl(t)}function at(n,t,i){var r;if(t.indexOf("start=")==-1&&(r=getUrlParameter(t,i),r!=null&&r!="")){var f=0,e=0,u=r.indexOf("m"),o=r.indexOf("s");return u!==-1&&(f=r.substr(0,r.indexOf("m"))*60),o!==-1&&(e=r.substr(u+1,o-(u+1))),n+"&start="+(+f+ +e)}return n}function ni(n){angular.forEach(n,function(n){angular.forEach(n.listingFeatures,function(n){ht.listingFeatures.push(n)})})}function ti(n){n!=null&&n.listingDescription!=null&&n.listingDescription.length>0&&(angular.forEach(n.listingDescription,function(n){e.isUndefinedOrNull(n.description)||ht.listingDescription.push(n)}),_.where(ht.listingDescription,{isoLanguageCode:abp.localization.currentLanguage.name}).length>0?(ht.selectedTab=_.where(ht.listingDescription,{isoLanguageCode:abp.localization.currentLanguage.name})[0].id,ht.selectedDescription=_.where(ht.listingDescription,{isoLanguageCode:abp.localization.currentLanguage.name})[0].description,ht.selectedMotto=_.where(ht.listingDescription,{isoLanguageCode:abp.localization.currentLanguage.name})[0].motto):ht.listingDescription.length>0&&(ht.selectedTab=ht.listingDescription[0].id,ht.selectedDescription=ht.listingDescription[0].description,ht.selectedMotto=ht.listingDescription[0].motto))}function ii(n,t,i,r,u,f){var o="";return ht.getRegionalSetting("Use Detailed Property Type in H1 on Listing Details")&&f!=null&&!e.isUndefinedOrNull(f.targetValue)?o=f.targetValue:n==null||e.isUndefinedOrNull(n.targetValue)||(o=n.targetValue),e.isUndefinedOrNull(t)||(o+=o.length>0?" - "+t:t),e.isUndefinedOrNull(u)||(o+=o.length>0?" - "+u:u),e.isUndefinedOrNull(r)||u==r||(o+=o.length>0?" - "+r:r),e.isUndefinedOrNull(u)||r==i||(o+=o.length>0?" - "+i:i),o}function ri(n){var t=r.open({templateUrl:"~/App/common/views/listings/modal/gallery.cshtml",controller:"common.views.listings.gallery as vm",size:"lg",resolve:{list:function(){return n},header:function(){return ht.header}}});t.result.then(function(){})}function ui(){var n=r.open({templateUrl:"~/App/common/views/listings/modal/listingPrint.cshtml",controller:"common.views.listings.listingPrint as vm",resolve:{}});n.result.then(function(){})}function lt(){if(!document.fullscreenElement&&!document.webkitIsFullScreen&&!document.mozFullScreen&&!document.msFullscreenElement){var n=document.getElementById("panoContainer");n.style.display="none"}}function oi(){ht.unitOfMeasurement=a.destinationRegion?a.destinationRegion.unitOfMeasurement==1?{id:1,measurement:"m",measurementSquare:"m²"}:{id:2,measurement:"ft",measurementSquare:"ft²"}:a.region.unitOfMeasurement==1?{id:1,measurement:"m",measurementSquare:"m²"}:{id:2,measurement:"ft",measurementSquare:"ft²"}}function si(){var n;ht.links=[];ht.listing.hidePrice||(n="",ht.listing.city!=null&&(n="&searchText="+ht.listing.city),ht.links.push({link:"/listings#?maxPrice="+ht.maxPrice+"&minPrice="+ht.minPrice+"&city="+ht.listing.cityId+"&currency="+ht.listing.listingCurrencyISO+"&searchText"+n,text:app.localize("websiteBetween")+" "+w("currency")(ht.minPrice,ht.listing.listingCurrency,0)+" "+app.localize("websiteAnd")+" "+w("currency")(ht.maxPrice,ht.listing.listingCurrency,0)+" "+app.localize("websiteIn")+" "+(ht.listing.city!=null?ht.listing.city:"")}),n="",ht.listing.province!=null&&(n="&searchText="+ht.listing.province),ht.links.push({link:"/listings#?maxPrice="+ht.maxPrice+"&minPrice="+ht.minPrice+"&province="+ht.listing.provinceId+"&currency="+ht.listing.listingCurrencyISO+n,text:app.localize("websiteBetween")+" "+w("currency")(ht.minPrice,ht.listing.listingCurrency,0)+" "+app.localize("websiteAnd")+" "+w("currency")(ht.maxPrice,ht.listing.listingCurrency,0)+" "+app.localize("websiteIn")+" "+(ht.listing.province!=null?ht.listing.province:"")}));n="";ht.listing.province!=null&&(n="&searchText="+ht.listing.province);ht.links.push({link:"/listings#?transactionType=1&province="+ht.listing.provinceId+"&currency="+ht.listing.listingCurrencyISO+"&resCom="+ht.listing.listingClass+"&propertyType="+ht.listing.macroProperty.listLabelId+n,text:app.localize("websiteForSale")+" "+app.localize("websiteIn")+" "+(ht.listing.province!=null?ht.listing.province:"")});n="";ht.listing.city!=null&&(n="&searchText="+ht.listing.city);ht.links.push({link:"/listings#?transactionType=1&city="+ht.listing.cityId+"&currency="+ht.listing.listingCurrencyISO+"&resCom="+ht.listing.listingClass+"&propertyType="+ht.listing.macroProperty.listLabelId+n,text:app.localize("websiteForSale")+" "+app.localize("websiteIn")+" "+(ht.listing.city!=null?ht.listing.city:"")});n="";ht.listing.province!=null&&(n="&searchText="+ht.listing.province);ht.links.push({link:"/listings#?transactionType=2&province="+ht.listing.provinceId+"&currency="+ht.listing.listingCurrencyISO+"&resCom="+ht.listing.listingClass+"&propertyType="+ht.listing.macroProperty.listLabelId+n,text:app.localize("websiteForRent")+" "+app.localize("websiteIn")+" "+(ht.listing.province!=null?ht.listing.province:"")});n="";ht.listing.city!=null&&(n="&searchText="+ht.listing.city);ht.links.push({link:"/listings#?transactionType=2&city="+ht.listing.cityId+"&currency="+ht.listing.listingCurrencyISO+"&resCom="+ht.listing.listingClass+"&propertyType="+ht.listing.macroProperty.listLabelId+n,text:app.localize("websiteForRent")+" "+app.localize("websiteIn")+" "+(ht.listing.city!=null?ht.listing.city:"")})}function hi(){var n={isoLanguageCode:ht.selectedLanguage.language,id:ht.selectedLanguage.code,description:""};ht.listingDescription=[];angular.forEach(ht.listing.listingDescription,function(n){e.isUndefinedOrNull(n.description)||ht.listingDescription.push(n)});ht.listingDescription.push(n);ht.selectedTab=ht.selectedLanguage.code}function ci(){ht.chatIntegrations=st.setupChatForWebsite(ht.listing.agentChatIntegrations,ht.listing.agentWhatsAppPhone);ht.loadingChatIntegration=!1}var ht=this,vt;ht.captchaKey=rt;ht.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",a.region.tenantFullName);window.prerenderReady=!1;ht.loading=!0;ht.unitOfMeasurement=[];ht.listingRooms=[];ht.listingFeatures=[];ht.virtualOpenHouse=null;ht.region=a.region;ht.regionId=ht.region.id;ht.tenantId=ht.region.tenantId;ht.listingDescription=[];ht.recentlyViewedListings=[];ht.openHouses=[];ht.favoriteListings=[];ht.markedAsFavorite="";ht.bpId=null;ht.aid=null;ht.mortgageCalculatorDefults=null;ht.showCalculator=!1;ht.hideGoogleTranslate=!1;ht.showEnergyRating=!1;ht.energyRating=[];ht.pdfLoading=!1;ht.isSoftLeadSent=!1;ht.isSoftLeadSentPC=!1;ht.bedRoomsPrefix="";ht.displayAsYearMonthForBuilt=!0;$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip()});ht.incorrectData="0001-01-01T00:00:00";ht.CurrentDate=new Date((new Date).getUTCFullYear(),(new Date).getUTCMonth(),(new Date).getUTCDate(),(new Date).getUTCHours(),(new Date).getUTCMinutes(),(new Date).getUTCSeconds());ht.vatString="";ht.destinationRegionId=parseInt(ot.get("destinationRegionIdCookie"));(ht.destinationRegionId==null||ht.destinationRegionId==0)&&(ht.destinationRegionId=ht.regionId);ht.loadingChatIntegration=!0;ht.chatIntegrations=[];ht.image360=null;ht.panoramaImage=null;ft.displayCaptcha(a.region.id).success(function(n){ht.displayCaptcha=n});vt=function(n){n&&(ht.success=n.result,n.result?it.success(app.localize("websiteMessageHasBeenSent")):(it.error(app.localize("websiteAnErrorOccured")),console.log(n.message)))};t.form={};ht.submit=function(){if(ht.displayCaptcha){if(ut.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}t.contact.captcha=ut.getResponse()}ht.busy=!0;tt.sendMessageForListing(t.contact).success(function(n){vt(n)}).finally(function(){ft.displayCaptcha(a.region.id).success(function(n){ht.displayCaptcha=n});ht.displayCaptcha&&ut.reload();y.registerHit({tenantId:a.region.tenantId,regionId:a.region.id,name:app.consts.hitsName.listingLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,listingId:t.agent.listingId});t.contact.name="";t.contact.email="";t.contact.phone="";t.contact.comments="";t.form.contactCreateForm.$setPristine();t.form.contactCreateForm.$setUntouched();ht.busy=!1})};ht.getHomeRegionalSetting=function(n){for(var i,t=0;t<a.regionalSettings.length;t++)if(a.regionalSettings[t].name==n)return a.regionalSettings[t].type=="ListStringSettingValueDto"||a.regionalSettings[t].type=="ListIntSettingValueDto"?a.regionalSettings[t].output.values:a.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};ht.getRegionalSetting=function(n){for(var i,t=0;t<a.destinationRegionalSettings.length;t++)if(a.destinationRegionalSettings[t].name==n)return a.destinationRegionalSettings[t].type=="ListStringSettingValueDto"||a.destinationRegionalSettings[t].type=="ListIntSettingValueDto"?a.destinationRegionalSettings[t].output.values:a.destinationRegionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};ht.hideSoftLead=ht.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");ht.hideDateAvailable=ht.getRegionalSetting("Hide 'Date Available' on Regional Website");ht.showFullAgentPhone=ht.hideSoftLead;ht.showFullOfficePhone=ht.hideSoftLead;ht.showFullAgentDirectLinePC=ht.hideSoftLead;ht.showFullAgentMobilePC=ht.hideSoftLead;ht.showFullOfficePhonePC=ht.hideSoftLead;ht.viewBrochure=function(){var n=document.createElement("a");n.setAttribute("id","downloadPDFFromController");n.href=ht.listing.development.brochureUrl;n.click()};ht.showMoreListings=function(){location.href=location.origin+"/listings#?development="+ht.listing.development.developmentId};ht.moreInfo=function(){d.open(ht.listing.development.url)};ht.openCurrency=function(n,t,i,r){pt(n,t,i,r)};ht.init=function(n,t,i){kt(n,t,i);oi()};ht.calculateMortgageAmountWithMessage=function(){var n=ht.listing.listingCurrency;ht.baseMessage=app.localize("MortgageCalculatorRegionalEstimatedMortgagePayment")+"<br/>";switch(ht.mortgageCalculatorDefults.paymentFrequency){case 1396:ht.message=app.localize("MortgageCalculatorRegionalEstimatedMortgagePaymentSemiMonthly");break;case 1397:ht.message=app.localize("MortgageCalculatorRegionalEstimatedMortgagePaymentBiWeekly");break;case 1398:ht.message=app.localize("MortgageCalculatorRegionalEstimatedMortgagePaymentWeekly");break;default:ht.message=app.localize("MortgageCalculatorRegionalEstimatedMortgagePaymentMonthly")}};ht.calculateAmount=0;ht.calculateMortgageAmount=function(){var t=0,u=parseFloat(ht.mortgageCalculatorDefults.depositAmountCalculated/ht.listing.listingPrice).toFixed(2),f=ht.mortgageCalculatorDefults.interestRate/100,n=12;switch(ht.mortgageCalculatorDefults.paymentFrequency){case 1396:n=24;break;case 1397:n=26;break;case 1398:n=52;break;default:n=12}var e=ht.listing.listingPrice*(1-u),i=f/n,o=ht.mortgageCalculatorDefults.amortizationRate*n,r=Math.pow(1+i,o);t=e*(i/(r-1))*r;ht.calculateAmount=parseFloat(t).toFixed(2);ht.calculateMortgageAmountWithMessage()};ht.getDefaultPaymentFrequency=function(){nt.getLookupLists({listId:84,regionId:a.region.id,tenantId:a.region.tenantId}).success(function(n){ht.defaultPaymentFrequencyList=n.items}).finally(function(){setTimeout(function(){},0)})};ht.getVirtualOpenHouseName=function(){ht.virtualOpenHouse&&nt.getLookupLists({listId:52,regionId:a.region.id,tenantId:a.region.tenantId}).success(function(n){var t=_.where(n.items,{listLabelId:ht.virtualOpenHouse.typeUid});t&&t.length>0&&(ht.virtualOpenHouse.name=t[0].targetValue)})};ht.getMortgageCalculatorDefults=function(){var n=a.region.id;ht.getDefaultPaymentFrequency();g.getMortgageCalculatorDefultsForEdit({id:n}).success(function(n){ht.setMortgageCalculatorAdditionalValues(n)}).finally(function(){ht.calculateMortgageAmountWithMessage()})};ht.setMortgageCalculatorAdditionalValues=function(n){ht.mortgageCalculatorDefults=n.mortgageCalculatorDefults;ht.mortgageCalculatorDefults.depositAmountCalculated=parseFloat(ht.listing.listingPrice/100*ht.mortgageCalculatorDefults.depositAmount).toFixed(2);ht.calculateMortgageAmount()};ht.validateDepositAmount=function(){(isNaN(ht.mortgageCalculatorDefults.depositAmount)||ht.mortgageCalculatorDefults.depositAmount=="")&&(ht.mortgageCalculatorDefults.depositAmount=5);ht.mortgageCalculatorDefults.depositAmount<5&&(ht.mortgageCalculatorDefults.depositAmount=5);ht.mortgageCalculatorDefults.depositAmount>99&&(ht.mortgageCalculatorDefults.depositAmount=99);ht.mortgageCalculatorDefults.depositAmount=parseFloat(ht.mortgageCalculatorDefults.depositAmount).toFixed(2);ht.mortgageCalculatorDefults.depositAmountCalculated=parseFloat(ht.listing.listingPrice/100*ht.mortgageCalculatorDefults.depositAmount).toFixed(2);ht.calculateMortgageAmount()};ht.validateInterestRate=function(){(isNaN(ht.mortgageCalculatorDefults.interestRate)||ht.mortgageCalculatorDefults.interestRate=="")&&(ht.mortgageCalculatorDefults.interestRate=.5);ht.mortgageCalculatorDefults.interestRate<.5&&(ht.mortgageCalculatorDefults.interestRate=.5);ht.mortgageCalculatorDefults.interestRate>25&&(ht.mortgageCalculatorDefults.interestRate=25);ht.mortgageCalculatorDefults.interestRate=parseFloat(ht.mortgageCalculatorDefults.interestRate).toFixed(2);ht.calculateMortgageAmount()};ht.validateAmortizationRate=function(){(isNaN(ht.mortgageCalculatorDefults.amortizationRate)||ht.mortgageCalculatorDefults.amortizationRate=="")&&(ht.mortgageCalculatorDefults.amortizationRate=5);parseInt(ht.mortgageCalculatorDefults.amortizationRate)<5&&(ht.mortgageCalculatorDefults.amortizationRate=parseInt(5));parseInt(ht.mortgageCalculatorDefults.amortizationRate)>30&&(ht.mortgageCalculatorDefults.amortizationRate=parseInt(30));ht.mortgageCalculatorDefults.amortizationRate=parseInt(ht.mortgageCalculatorDefults.amortizationRate);ht.calculateMortgageAmount()};ht.getInclude=function(){if(!angular.isUndefined(ht.showDeadListingPage))return ht.showDeadListingPage?"~/App/common/views/listings/partials/deadListingPage.cshtml":"~/App/common/views/listings/partials/listingDetailsMain.cshtml"};ht.getIncludeByName=function(n){return abp.rootTemplatePath+"views/listings/partials/"+n+".cshtml"};t.finishLoading=function(){$("#map").hide()};ht.IsMapVisible=function(){return ht.getRegionalSetting("IsGoogleMapsHiddenOnWebsite")?!1:ht.getRegionalSetting("IsMapViewAvalibleOnRegionalWebsite")&&!ht.map&&ht.mapIcon?!0:!1};ht.getMap=function(){ht.showListingMapHeader=!1;(ht.listing.latitude||ht.listing.longitude)&&(k.loadMap("mapListingDetails",ht.listing.latitude,ht.listing.longitude,ht.listing.googleZoomLevel,!0,!0,!0,!0,!0,!0,!0),ht.showListingMapHeader=!0)};ht.showMap=function(){(ht.listing.latitude||ht.listing.longitude)&&(ht.map=!0,ht.photoIcon=!0,$("#map").show(),k.loadMap("map",ht.listing.latitude,ht.listing.longitude,ht.listing.googleZoomLevel,!0,!0,!0,!0,!0,!0,!0));ht.youtubeIcon=!0;ht.youtubeShowValue=!1;ct("youtube_canvas","stopVideo");window.scrollTo(0,0)};ht.hideMap=function(){ht.photoIcon=!1;ht.map=!1;$("#map").hide();ht.youtubeIcon=!0;ht.youtubeShowValue=!1;ct("youtube_canvas","stopVideo")};ht.addRemoveFavoriteListingFull=function(n,t){c.addRemoveFavoriteListing(n,t);yt()};ht.slide=function(n){document.documentElement.dir==="rtl"&&(n.element.limit=n.element.limit*-1)};ht.getRegionalSetting("DontAllowGoogleTranslate")&&ht.destinationRegionId==ht.regionId&&(ht.hideGoogleTranslate=!0);openPdfPopUp=function(){function e(){n.document&&n.document.title!=r&&(n.document.title=r)}var t=500,i=645,u=screen.width/2-t/2,f=screen.height/2-i/2,n=window.open(ht.linkToPdf,"mywin","left="+u+",top="+f+",width="+t+",height="+i+",toolbar=0,resizable=0,scrollbars=0,location=0,status=0,titlebar=0"),r=ht.header;return e(),!1};ht.getListingRegionId=function(){return ht.listing.regionId};ht.processListing=function(n){n.listing!=null?(ht.listing=n.listing,ht.listingImages=n.listing.listingImages.items,_.where(ht.listingImages,{listingImageType:1}).length>0&&(ht.image360=_.where(ht.listingImages,{listingImageType:1})[0]),_.where(ht.listingImages,{listingImageType:2}).length>0&&(ht.panoramaImage=_.where(ht.listingImages,{listingImageType:2})[0]),gt(ht.listing.youtube),ti(ht.listing),ni(ht.listing.listingFeatures),ht.roomPath=ht.listing.roomPath,ht.getRegionalSetting("Tax Included")&&parseInt(ht.listing.taxPercentage)>0&&(ht.vatString=" + "+app.localize("TAX")),t.agent={agentImageUrl:ht.listing.agentPhotoPath,agentUrl:ht.listing.agentShortLink,officeUrl:ht.listing.officeShortLink,displayName:ht.listing.agentFullName,officeName:ht.listing.agentOfficeName,agentDirectLine:ht.listing.agentDirectLine,agentMobile:ht.listing.agentMobilePhone,agentOfficePhone:ht.listing.agentOfficePhone,agentId:ht.listing.agentId,listingId:ht.listing.id},ci(),t.contact={agentId:t.agent.agentId,regionId:a.destinationRegion.id,listingId:t.agent.listingId},ht.transactionType=ht.listing.transactionTypeUID==1?app.localize("websiteForSale"):app.localize("websiteForRent"),ht.header=ii(ht.listing.macroProperty,ht.transactionType,ht.listing.macroProvince,ht.listing.province,ht.listing.city,ht.listing.property),c.isListingInFavorites(ht.listing.id)&&(ht.markedAsFavorite=c.getFavOnClass()),dt(),ht.showDeadListingPage=ht.listing.availableOnline!=1||ht.listing.hideFromWebsite?!0:!1,ht.getRegionalSetting("EnergyRating")&&(parseInt(ht.listing.listingClass)==1||parseInt(ht.listing.listingClass)==2)&&(ht.listing.energyEfficiencyUID.listLabelId!=0&&(ht.energyRating.energyRatingValue=ht.listing.energyEfficiencyUID.baseValue.replace("+","plus")),ht.listing.certificateDate!="0001-01-01T00:00:00"&&(ht.energyRating.certificateDate=new Date(ht.listing.certificateDate).toISOString().slice(0,10).replace(/-/g,"/")),ht.listing.certificateBasedOn.listLabelId!=0&&(ht.energyRating.certificateBasedOn=ht.listing.certificateBasedOn.targetValue),e.isUndefinedOrNull(ht.energyRating.energyRatingValue)||(ht.showEnergyRating=!0),ht.hideCertificateFields=!1,ht.listing.energyEfficiencyUID.listLabelId==633&&(ht.hideCertificateFields=!0)),ht.bedRoomsPrefix=ht.getHomeRegionalSetting("Is T Used for Bedrooms on Regional Website?")?"T":"",ht.getRegionalSetting("Do not show 'Month Built' on Regional Website")&&(ht.displayAsYearMonthForBuilt=!1),ht.virtualOpenHouse=ht.listing.virtualOpenHouse,ht.getVirtualOpenHouseName()):n.tenantIssue?document.location.href="/":ht.showDeadListingPage=!0};ht.youtubeShow=function(){ht.photoIcon=!0;ht.map=!1;$("#map").hide();ht.youtubeIcon=!1;ht.youtubeShowValue=!0;ct("youtube_canvas","playVideo")};ht.galleryOpen=function(n){ht.youtubeIcon?ri(n):(ht.youtubeShowValue=!1,ht.youtubeIcon=!0,ct("youtube_canvas","stopVideo"))};ht.openPrintPage=function(){ui()};ht.open360Image=function(n){ht.viewer=window.pannellum.viewer("panorama",{type:"equirectangular",panorama:n,autoLoad:!0});ht.viewer.on("load",function(){setTimeout(function(){ht.viewer.resize()},500)});ht.show360Image=!0};ht.openPanorama=function(n,t,i){var r=document.getElementById("panoDiv");r.style.display="inline";$(".panorama-view").html("");$(".panorama-view").html(ht.panorammaHtml(n,t,i));$(function(){$(".panorama-view").panorama360({sliding_controls:!0,start_position:1500,start_position_centered:!0})})};ht.hidePanoImage=function(){var n=document.getElementById("panoDiv");n.style.display="none"};ht.hide360Image=function(){ht.show360Image=!1};ht.panorammaHtml=function(n,t,i){return'<div class="panorama-container"> <img id="panoImage" src="'+n+'" class="pano-images" data-width="'+t+'" data-height="'+i+'" alt="Panorama"> <\/div> '};document.addEventListener("fullscreenchange",lt);document.addEventListener("webkitfullscreenchange",lt);document.addEventListener("mozfullscreenchange",lt);document.addEventListener("MSFullscreenChange",lt);ht.toggle360FullScreen=function(){ht.viewer.toggleFullscreen()};ht.openLightboxModal=function(n){s.openModal(ht.listingImages,n)};ht.setListingDescription=function(n){ht.tab=n;ht.selectedTab=n};ht.getLanguage=function(n){var t=_.where(abp.localization.languages,{name:n});return t.length>0?t[0].displayName:n};ht.getListingBrochure=function(){ht.downloading=!0;var n=abp.appPath+"HtmlToPdf/GetListingBrochure?listingKey="+ht.listing.key+"&pdftype=2";$.fileDownload(n,{successCallback:function(){t.$apply(function(){ht.downloading=!1})},failCallback:function(){t.$apply(function(){ht.downloading=!1});abp.notify.error(app.localize("GenerationFailed"))}})};ht.isActiveTab=function(n){return n===ht.selectedTab?" langtabs-on":""};ht.isNumber=function(n){e.isNumber(n)};ht.translate=function(){var t,n,i,r,u,f,o;if(ht.selectedLanguage==null){ht.listingDescription=[];ht.listingDescription=ht.listing.listingDescription;ht.selectedTab=ht.listing.listingDescription[0].id;ht.tab=ht.selectedTab;return}t=document.createElement("script");t.type="text/javascript";n="";i=_.where(ht.listing.listingDescription,{isoLanguageCode:abp.localization.currentLanguage.name});i.length>0&&i[0]!=null&&(n=i[0].description);r=abp.localization.currentLanguage.name.substr(0,2);e.isUndefinedOrNull(n)&&(r=ht.region.languageCode.substr(0,2),u=_.where(ht.listing.listingDescription,{isoLanguageCode:ht.region.languageCode})[0],n=u!=null?u.description:"",e.isUndefinedOrNull(n)&&(r=ht.listing.listingDescription[0].isoLanguageCode.substr(0,2),n=ht.listing.listingDescription[0].description));f=a.getSiteSetting("GoogleApiKey")!==""?a.getSiteSetting("GoogleApiKey"):"AIzaSyDUXTce63d_bGYkCrqlDwQLeTlq9hSHFGc";o="https://www.googleapis.com/language/translate/v2?key="+f+"&source="+r+"&target="+ht.selectedLanguage.code+"&callback=translateText&q="+n;t.src=o;document.getElementsByTagName("head")[0].appendChild(t);hi()};ht.showDisclaimer=function(){return ht.selectedLanguage&&ht.selectedTab==ht.selectedLanguage.code};ht.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};ht.displayMortgageCalculator=function(){return ht.listing.transactionTypeUID==1&&ht.getRegionalSetting("IsMortgageCalculatorVisibleOnWebsite")&&!ht.isDifferentDestinationRegion()};ht.isDifferentDestinationRegion=function(){return a.region.id!=a.destinationRegion.id};ht.processSoftLead=function(n){switch(n){case 1:ht.showFullAgentPhone=!0;break;case 2:ht.showFullOfficePhone=!0}ht.isSoftLeadSent||y.registerHit({tenantId:ht.tenantId,regionId:ht.regionId,name:app.consts.hitsName.listingSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,listingId:ht.listing.id}).success(function(){ht.isSoftLeadSent=!0})};ht.processSoftLeadPC=function(n){switch(n){case 1:ht.showFullAgentDirectLinePC=!0;break;case 2:ht.showFullAgentMobilePC=!0;break;case 3:ht.showFullOfficePhonePC=!0}ht.isSoftLeadSentPC||y.registerHit({tenantId:ht.tenantId,regionId:ht.regionId,name:app.consts.hitsName.listingSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,listingId:ht.listing.id}).success(function(){ht.isSoftLeadSentPC=!0})};ht.openModal=function(){var n=r.open({templateUrl:"~/App/common/views/listings/modal/listing-contact-modal-dialog.cshtml",controller:"common.views.listing.modal.contact as vm",backdrop:"static",size:"sm",resolve:{agent:{agentImageUrl:ht.listing.agentPhotoPath,agentUrl:ht.listing.agentShortLink,officeUrl:ht.listing.officeShortLink,displayName:ht.listing.agentFullName,officeName:ht.listing.agentOfficeName,agentDirectLine:ht.listing.agentDirectLine,agentMobile:ht.listing.agentMobilePhone,agentOfficePhone:ht.listing.agentOfficePhone,agentId:ht.listing.agentId,listingId:ht.listing.id,hideOnWebsite:ht.listing.agentHideOnWebsite,chatIntegrations:ht.chatIntegrations}}});n.result.then(function(n){console.log(n)})};ht.openModalForVirtualOpenHouse=function(){var t={agentImageUrl:ht.listing.agentPhotoPath,agentUrl:ht.listing.agentShortLink,officeUrl:ht.listing.officeShortLink,displayName:ht.listing.agentFullName,officeName:ht.listing.agentOfficeName,agentDirectLine:ht.listing.agentDirectLine,agentMobile:ht.listing.agentMobilePhone,agentOfficePhone:ht.listing.agentOfficePhone,agentId:ht.listing.agentId,listingId:ht.listing.id,hideOnWebsite:ht.listing.agentHideOnWebsite,chatIntegrations:ht.chatIntegrations,virtualOpenHouse:ht.virtualOpenHouse},n;switch(ht.virtualOpenHouse.eventUrlAccessType){case 0:window.open(ht.virtualOpenHouse.eventUrl,"_blank");break;case 1:default:n=r.open({templateUrl:"~/App/common/views/listings/modal/listing-contact-modal-dialog.cshtml",controller:"common.views.listing.modal.contact as vm",backdrop:"static",size:"sm",resolve:{agent:t}});n.result.then(function(n){console.log(n)})}};ht.openVRWindow=function(){window.open(ht.listing.virtualTour,"mywin","width=500,height=500")};ht.languages=[{code:"en",language:"English"},{code:"af",language:"Afrikaans"},{code:"sq",language:"Albanian"},{code:"am",language:"Amharic"},{code:"ar",language:"Arabic"},{code:"hy",language:"Armenian"},{code:"az",language:"Azerbaijani"},{code:"eu",language:"Basque"},{code:"be",language:"Belarusian"},{code:"bn",language:"Bengali"},{code:"bs",language:"Bosnian"},{code:"bg",language:"Bulgarian"},{code:"ca",language:"Catalan"},{code:"ceb",language:"Cebuano"},{code:"ny",language:"Chichewa"},{code:"zh-CN",language:"Chinese (Simplified)"},{code:"zh-TW",language:"Chinese (Traditional)"},{code:"co",language:"Corsican"},{code:"hr",language:"Croatian"},{code:"cs",language:"Czech"},{code:"da",language:"Danish"},{code:"nl",language:"Dutch"},{code:"eo",language:"Esperanto"},{code:"et",language:"Estonian"},{code:"tl",language:"Filipino"},{code:"fi",language:"Finnish"},{code:"fr",language:"French"},{code:"fy",language:"Frisian"},{code:"gl",language:"Galician"},{code:"ka",language:"Georgian"},{code:"de",language:"German"},{code:"el",language:"Greek"},{code:"gu",language:"Gujarati"},{code:"ht",language:"Haitian Creole"},{code:"ha",language:"Hausa"},{code:"haw",language:"Hawaiian"},{code:"iw",language:"Hebrew"},{code:"hi",language:"Hindi"},{code:"hmn",language:"Hmong"},{code:"hu",language:"Hungarian"},{code:"is",language:"Icelandic"},{code:"ig",language:"Igbo"},{code:"id",language:"Indonesian"},{code:"ga",language:"Irish"},{code:"it",language:"Italian"},{code:"ja",language:"Japanese"},{code:"jw",language:"Javanese"},{code:"kn",language:"Kannada"},{code:"kk",language:"Kazakh"},{code:"km",language:"Khmer"},{code:"ko",language:"Korean"},{code:"ku",language:"Kurdish (Kurmanji)"},{code:"ky",language:"Kyrgyz"},{code:"lo",language:"Lao"},{code:"la",language:"Latin"},{code:"lv",language:"Latvian"},{code:"lt",language:"Lithuanian"},{code:"lb",language:"Luxembourgish"},{code:"mk",language:"Macedonian"},{code:"mg",language:"Malagasy"},{code:"ms",language:"Malay"},{code:"ml",language:"Malayalam"},{code:"mt",language:"Maltese"},{code:"mi",language:"Maori"},{code:"mr",language:"Marathi"},{code:"mn",language:"Mongolian"},{code:"my",language:"Myanmar (Burmese)"},{code:"ne",language:"Nepali"},{code:"no",language:"Norwegian"},{code:"ps",language:"Pashto"},{code:"fa",language:"Persian"},{code:"pl",language:"Polish"},{code:"pt",language:"Portuguese"},{code:"pa",language:"Punjabi"},{code:"ro",language:"Romanian"},{code:"ru",language:"Russian"},{code:"sm",language:"Samoan"},{code:"gd",language:"Scots Gaelic"},{code:"sr",language:"Serbian"},{code:"st",language:"Sesotho"},{code:"sn",language:"Shona"},{code:"sd",language:"Sindhi"},{code:"si",language:"Sinhala"},{code:"sk",language:"Slovak"},{code:"sl",language:"Slovenian"},{code:"so",language:"Somali"},{code:"es",language:"Spanish"},{code:"su",language:"Sundanese"},{code:"sw",language:"Swahili"},{code:"sv",language:"Swedish"},{code:"tg",language:"Tajik"},{code:"ta",language:"Tamil"},{code:"te",language:"Telugu"},{code:"th",language:"Thai"},{code:"uk",language:"Ukrainian"},{code:"ur",language:"Urdu"},{code:"uz",language:"Uzbek"},{code:"vi",language:"Vietnamese"},{code:"cy",language:"Welsh"},{code:"xh",language:"Xhosa"},{code:"yi",language:"Yiddish"},{code:"yo",language:"Yoruba"},{code:"zu",language:"Zulu"}]}]).filter("html",["$sce",function(n){return function(t){return n.trustAsHtml(t)}}])}(),function(){appModule.controller("common.views.listings.savedSearch",["$scope","$state","$uibModal","abp.services.app.savedSearch","$location","appSession","$filter","$cookies","openstreetmapService",function(n,t,i,r,u,f,e,o,s){function y(){var n=o.get(l);(n==null||typeof n=="undefined"||n=="")&&o.put(l,"",{expires:c});h.unsubscriptionCode!=undefined&&h.unsubscriptionCode!=""&&r.getSavedSearchMyListPage({key:h.unsubscriptionCode,regionId:f.region.id,tenantId:f.region.tenantId}).success(function(n){h.mySavedSearches=n;h.mySavedSearches.length==0?(o.put("mysavedsearches","",{expires:c}),location.href=location.origin+"/listings"):h.ssId!=""&&h.ssId!=undefined&&h.ssId!=null&&h.userId!=""&&h.userId!=undefined&&h.userId!=null&&h.unsubscribe(h.ssId,h.userId)}).error(function(){abp.message.warn(app.localize("ProblemOccured"))})}var h=this,v,a,c,l;h.loading=!0;h.IsRegion=abp.IsRegion;h.IsOffice=abp.IsOffice;h.IsAgent=abp.IsAgent;h.IsTeam=abp.IsTeam;h.OfficeId=parseInt(abp.OfficeId);h.AgentId=parseInt(abp.AgentId);h.TeamId=parseInt(abp.TeamId);h.showFullOfficePhone=!1;h.regionName=f.region.name;v=f.region!=null?f.region.tenantId:0;a=f.region!=null?f.region.id:0;h.headOfficePhone=f.region.headOfficePhone;h.headOfficeEmail=f.region.headOfficeEmail;h.formattedRegionAddress=f.region.formattedRegionAddress;h.regionId=a;c="Fri, 31 Dec 9999 23:59:59 GMT";h.view=function(n){var t="";angular.forEach(n,function(n){t+=n.fieldName+"="+n.selectedValue+"&"});t=t.substring(0,t.length-1);location.href=location.origin+"/listings#?"+t};h.unsubscribe=function(n,t){var r=i.open({templateUrl:"~/App/common/views/listings/modal/unsubscribe-modal.cshtml",controller:"common.views.listing.modal.unsubscribe as vm",backdrop:"static",size:"md",resolve:{id:function(){return n},userId:function(){return t}}});r.result.then(function(){h.init(h.userId,h.ssId,h.unsubscriptionCode)})};h.getTransactionClassType=function(n){var t="",r=_.where(n,{fieldName:"transactionType"}),i=_.where(n,{fieldName:"resCom"}),u=_.where(n,{fieldName:"propertyType"});return r.length>0&&(t=r[0].value==1?app.localize("ForSale")+", ":r[0].value==2?app.localize("ForRent")+", ":""),i.length>0&&(t+=i[0].value==1?app.localize("Residential")+", ":i[0].value==2?app.localize("Commertial")+", ":i[0].value==2?app.localize("Land")+", ":""),u.length>0&&(t+=u[0].value+", "),t.length>2&&(t=t.substring(0,t.length-2)),t};h.getLocation=function(n){var t="",i=_.where(n,{fieldName:"macroProvince"}),r=_.where(n,{fieldName:"province"}),u=_.where(n,{fieldName:"city"}),f=_.where(n,{fieldName:"localZoneId"}),e=_.where(n,{fieldName:"localZoneIds"});return i.length>0&&(t=i[0].value+", "),r.length>0&&(t+=r[0].value+", "),u.length>0&&(t+=u[0].value+", "),f.length>0&&(t+=f[0].value+", "),angular.forEach(e,function(n){t+=n.value+", "}),t.length>2&&(t=t.substring(0,t.length-2)),t};h.getPrice=function(n){var u="",r="",i="",t=0,f=_.where(n,{fieldName:"minPrice"}),o=_.where(n,{fieldName:"maxPrice"}),s=_.where(n,{fieldName:"currency"});return s.length>0&&(r=s[0].value),f.length>0&&(i=parseFloat(f[0].value)),o.length>0&&(t=parseFloat(o[0].value)),(i!=0&&i!=undefined||t!=0&&t!=undefined)&&(u=e("currency")(i,r,2)+" - "+(t==0?"&#8734;":e("currency")(t,r,2))),u};h.getBedroom=function(n){var t="",i=_.where(n,{fieldName:"bedRoomCount"});return i.length>0&&(t=i[0].value),t};h.getminSqMeter=function(n){var t="",i=_.where(n,{fieldName:"minSqMeter"});return i.length>0&&(t=i[0].value),t};h.getOpenHouse=function(n){var t="",i=_.where(n,{fieldName:"openHouse"});return i.length>0&&(t=app.localize("WithOpenHouse")),t};h.getAdded=function(n){var i="",t=_.where(n,{fieldName:"addedLabel"});return t.length>0&&(i=t[0].value==1?app.localize("AddedLast",app.localize("websiteDay")):t[0].value==7?app.localize("AddedLast",app.localize("websiteWeek")):t[0].value==30?app.localize("AddedLast",app.localize("websiteMonth")):""),i};n.getMap=function(){s.loadMap("map",f.region.latitude,f.region.longitude,15,!1,!1,!1,!1,!1,!1,!1)};l="mysavedsearches";h.getRegionalSetting=function(n){for(var i,t=0;t<f.destinationRegionalSettings.length;t++)if(f.destinationRegionalSettings[t].name==n)return f.destinationRegionalSettings[t].type=="ListStringSettingValueDto"||f.destinationRegionalSettings[t].type=="ListIntSettingValueDto"?f.destinationRegionalSettings[t].output.values:f.destinationRegionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};h.init=function(n,t,i){h.userId=n;h.ssId=t;h.unsubscriptionCode=i;y();h.facebook=h.getRegionalSetting("RegionSocialMediaFacebook");h.facebook==null||h.facebook==""||h.facebook.includes("http")||(h.facebook="https://"+h.facebook);h.twitter=h.getRegionalSetting("RegionSocialMediaTwitter");h.twitter==null||h.twitter==""||h.twitter.includes("http")||(h.twitter="https://"+h.twitter);h.linkedIn=h.getRegionalSetting("RegionSocialMediaLinkedIn");h.linkedIn==null||h.linkedIn==""||h.linkedIn.includes("http")||(h.linkedIn="https://"+h.linkedIn);h.youtube=h.getRegionalSetting("RegionSocialMediaYoutube");h.youtube==null||h.youtube==""||h.youtube.includes("http")||(h.youtube="https://"+h.youtube);h.instagram=h.getRegionalSetting("RegionSocialMediaInstagram");h.instagram==null||h.instagram==""||h.instagram.includes("http")||(h.instagram="https://"+h.instagram)}}])}(),function(){appModule.controller("common.views.listings.currency",["$scope","$uibModalInstance","currency","defaultCurrency",function(n,t,i,r){var u=this;u.currencies=i;u.defaultCurrency=r;u.close=function(n){t.close(n)};u.cancel=function(){t.close(u.defaultCurrency)}}])}(),function(){appModule.controller("common.views.listings.gallery",["$scope","$uibModalInstance","list","header","appSession",function(n,t,i,r,u){var f=this;f.listingImages=i;f.header=r;f.close=function(){t.close()};f.cancel=function(){t.close()};f.image360IconPath=u.rootTemplatePath+"images/icon-360.png";f.panoIconPath=u.rootTemplatePath+"images/icon-pano.png"}])}(),function(){appModule.controller("common.views.listing.modal.contact",["$scope","$uibModalInstance","agent","abp.services.app.contactForms","appSession","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt","abp.services.app.hit",function(n,t,i,r,u,f,e,o,s){vm=this;vm.agent=i;vm.chatIntegrations=vm.agent.chatIntegrations;vm.virtualOpenHouse=vm.agent.virtualOpenHouse;vm.success=null;vm.isSoftLeadSent=!1;vm.captchaKey=f;vm.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",u.region.tenantFullName);vm.vohImagePath=u.rootTemplatePath+"images/voh-popup.png";n.contact={agentId:i.agentId,regionId:u.destinationRegion.id,listingId:i.listingId};vm.close=function(){t.dismiss("cancel")};o.displayCaptcha(u.region.id).success(function(n){vm.displayCaptcha=n});vm.getRegionalSetting=function(n){for(var i,t=0;t<u.regionalSettings.length;t++)if(u.regionalSettings[t].name==n)return u.regionalSettings[t].type=="ListStringSettingValueDto"||u.regionalSettings[t].type=="ListIntSettingValueDto"?u.regionalSettings[t].output.values:u.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};vm.hideSoftLead=vm.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");vm.showFullAgentDirectLine=vm.hideSoftLead;vm.showFullAgentMobile=vm.hideSoftLead;vm.showFullOfficePhone=vm.hideSoftLead;vm.submit=function(){if(vm.displayCaptcha){if(e.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=e.getResponse()}var t=app.consts.hitsName.listingLead;vm.virtualOpenHouse&&(n.contact.agendaUid=vm.virtualOpenHouse.agendaUid,t=app.consts.hitsName.listingLeadVOHRegistration);vm.busy=!0;r.sendMessageForListing(n.contact).success(function(n){vm.success=n.result}).finally(function(){n.contact.name="";n.contact.email="";n.contact.phone="";n.contact.comments="";n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();vm.busy=!1;s.registerHit({tenantId:u.region.tenantId,regionId:u.region.id,name:t,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,listingId:i.listingId})})};vm.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};vm.processSoftLead=function(n){switch(n){case 1:vm.showFullAgentDirectLine=!0;break;case 2:vm.showFullAgentMobile=!0;break;case 3:vm.showFullOfficePhone=!0}vm.isSoftLeadSent||s.registerHit({tenantId:u.region.tenantId,regionId:u.region.id,name:app.consts.hitsName.listingSoftLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,listingId:vm.agent.listingId}).success(function(){vm.isSoftLeadSent=!0})};vm.getSubmitButtonText=function(){return vm.agent.virtualOpenHouse?app.localize("websiteEmailMeetingInvite"):app.localize("websiteOk")}}])}(),function(){appModule.controller("common.views.listing.modal.favorite",["$scope","$uibModalInstance","appSession","cookieService","abp.services.app.listings","$cookies",function(n,t,i,r,u,f){function o(){var n=r.getFavoriteListings();n.length>0?u.getFavoriteListingForWebSite({listingIds:n,tenantId:i.region.tenantId,regionId:e,languageCode:abp.localization.currentLanguage.name,homeRegionCurrencyUID:i.region.defaultCurrencyId,homeRegionId:i.region.id}).success(function(n){vm.favoriteListings=n;vm.loadingFavoriteListings=!1}):(vm.favoriteListings=null,vm.loadingFavoriteListings=!1)}function s(){o()}vm=this;vm.favoriteListings=[];vm.loadingFavoriteListings=!0;vm.close=function(){t.close("")};var e=parseInt(f.get("destinationRegionIdCookie"));(e==null||e==0)&&(e=i.region.id);vm.addRemoveFavoriteListing=function(n,t){r.addRemoveFavoriteListing(n,t);o()};s()}])}(),function(){appModule.controller("common.views.listing.modal.list.contact",["$scope","$uibModalInstance","abp.services.app.contactForms","abp.services.app.agent","appSession","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt","id","listingId",function(n,t,i,r,u,f,e,o,s,h){function c(){r.getAgentForRegionalModal({id:s}).success(function(t){vm.agent=t;n.contact={agentId:s,regionId:u.destinationRegion.id,listingId:h}})}vm=this;vm.isSoftLeadSent=!1;vm.success=null;vm.captchaKey=f;vm.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",u.region.tenantFullName);vm.close=function(){t.dismiss("cancel")};o.displayCaptcha(u.region.id).success(function(n){vm.displayCaptcha=n});vm.getRegionalSetting=function(n){for(var i,t=0;t<u.regionalSettings.length;t++)if(u.regionalSettings[t].name==n)return u.regionalSettings[t].type=="ListStringSettingValueDto"||u.regionalSettings[t].type=="ListIntSettingValueDto"?u.regionalSettings[t].output.values:u.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};vm.hideSoftLead=vm.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");vm.showFullAgentDirectLine=vm.hideSoftLead;vm.showFullAgentMobile=vm.hideSoftLead;vm.showFullOfficePhone=vm.hideSoftLead;vm.submit=function(){if(vm.displayCaptcha){if(e.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=e.getResponse()}vm.busy=!0;i.sendMessageForListing(n.contact).success(function(n){vm.success=n.result}).finally(function(){n.contact.name="";n.contact.email="";n.contact.phone="";n.contact.comments="";n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();vm.busy=!1;hitService.registerHit({tenantId:u.region.tenantId,regionId:u.region.id,name:app.consts.hitsName.listingLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,listingId:h})})};vm.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};vm.processSoftLead=function(n){switch(n){case 1:vm.showFullAgentDirectLine=!0;break;case 2:vm.showFullAgentMobile=!0;break;case 3:vm.showFullOfficePhone=!0}vm.isSoftLeadSent||hitService.registerHit({tenantId:u.region.tenantId,regionId:u.region.id,name:app.consts.hitsName.listingSoftLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,listingId:vm.agent.listingId}).success(function(){vm.isSoftLeadSent=!0})};c()}])}(),function(){appModule.controller("common.views.listing.modal.recentlyViewed",["$scope","$uibModalInstance","appSession","cookieService","abp.services.app.listings","$cookies",function(n,t,i,r,u,f){function o(){var n=r.getRecentlyViewedListings();n.length>0?u.getRecentlyViewedListingForWebSite({listingIds:n,tenantId:i.region.tenantId,regionId:e,languageCode:abp.localization.currentLanguage.name,homeRegionCurrencyUID:i.region.defaultCurrencyId,homeRegionId:i.region.id}).success(function(n){vm.recentlyViewedListings=n;vm.loadingRecentListings=!1}):(vm.recentlyViewedListings=null,vm.loadingRecentListings=!1)}function s(){o()}vm=this;vm.recentlyViewedListings=[];vm.loadingRecentListings=!0;vm.close=function(){t.close("")};var e=parseInt(f.get("destinationRegionIdCookie"));(e==null||e==0)&&(e=i.region.id);s()}])}(),function(){appModule.controller("common.views.listings.priceList",["$scope","$uibModalInstance","abp.services.app.currency","price","priceEuro","priceUSD","listingCurrency","appSession",function(n,t,i,r,u,f,e,o){function h(){i.getCurrenciesByRegion({regionId:o.region.id}).success(function(n){s.currenciesList=n.regionalCurrencies;_.where(s.currenciesList,{currencyISO:e}).length>0?s.defaultCurrency=_.where(s.currenciesList,{currencyISO:e})[0]:_.where(s.currenciesList,{htmlSymbol:e}).length>0&&(s.defaultCurrency=_.where(s.currenciesList,{htmlSymbol:e})[0]);angular.forEach(s.currenciesList,function(n){var t;if(s.defaultCurrency!=n)if(n.currencyISO=="EUR")t={currency:"&euro;",price:u,currencyName:n.currencyName},s.currencies.push(t);else if(n.currencyISO=="USD")t={currency:"&#x24;",price:f,currencyName:n.currencyName},s.currencies.push(t);else{var i=n.htmlSymbol!=null?n.htmlSymbol:n.currencyISO,r=c(n,s.defaultCurrency),t={currency:i,price:r,currencyName:n.currencyName};s.currencies.push(t)}else s.lastUpdateDate=n.updatedOn})}).finally(function(){})}function c(n,t){var i=t.usdConversionRate/n.usdConversionRate;return r/i}var s=this;s.currencies=[];s.price=r;s.listingCurrency=e;s.lastUpdateDate=null;s.close=function(){t.close()};s.cancel=function(){t.close()};h()}])}(),function(){appModule.controller("common.views.listing.modal.saved.search",["$scope","$uibModalInstance","abp.services.app.savedSearch","parameters","helper","savedsearches","appSession",function(n,t,i,r,u,f,e){function o(){i.getSavedSearchForEdit({id:null}).success(function(n){vm.ssUser=n.savedSearchUser;vm.ssCriterias=n.criteriaList})}function s(){o()}vm=this;vm.success=null;vm.close=function(){t.dismiss("cancel")};vm.submit=function(){vm.ssUser.regionId=e.region.id;f.submit(vm.ssCriterias,vm.ssUser,r);t.close()};s()}])}(),function(){appModule.controller("common.views.listing.modal.unsubscribe",["$scope","$uibModalInstance","abp.services.app.lookupLists","abp.services.app.savedSearch","appSession","id","userId",function(n,t,i,r,u,f,e){function o(){i.getLookupLists({listId:71,tenantId:u.region.tenantId,regionId:u.region.id}).success(function(n){vm.unsubscribeReasons=n.items})}function s(){o()}vm=this;vm.success=null;vm.close=function(){t.dismiss("cancel")};vm.submit=function(){e!=undefined&&e!=null?r.unsubscribeSavedSearchUser({id:f,userId:e,unSubscribeReasonId:vm.reason}).success(function(){t.close()}).error(function(){t.dismiss("cancel")}):r.unsubscribeSavedSearch({id:f,unSubscribeReasonId:vm.reason}).success(function(){t.close()}).error(function(){t.dismiss("cancel")})};vm.busy=!0;s()}])}(),function(){appModule.controller("common.views.listing.modal.vohLink",["$scope","$uibModalInstance","agent","abp.services.app.contactForms","appSession","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt","abp.services.app.hit","abp.services.app.agenda",function(n,t,i,r,u,f,e,o,s,h){vm=this;vm.agent=i;vm.chatIntegrations=vm.agent.chatIntegrations;vm.virtualOpenHouse=vm.agent.virtualOpenHouse;vm.success=null;vm.isSoftLeadSent=!1;vm.captchaKey=f;vm.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",u.region.tenantFullName);vm.vohImagePath=u.rootTemplatePath+"images/voh-popup.png";n.contact={agentId:i.agentId,regionId:u.destinationRegion.id,listingId:i.listingId};vm.close=function(){t.dismiss("cancel")};vm.openLink=function(){window.open(vm.vohLink,"_blank")};o.displayCaptcha(u.region.id).success(function(n){vm.displayCaptcha=n});vm.getRegionalSetting=function(n){for(var i,t=0;t<u.regionalSettings.length;t++)if(u.regionalSettings[t].name==n)return u.regionalSettings[t].type=="ListStringSettingValueDto"||u.regionalSettings[t].type=="ListIntSettingValueDto"?u.regionalSettings[t].output.values:u.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};vm.hideSoftLead=vm.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");vm.showFullAgentDirectLine=vm.hideSoftLead;vm.showFullAgentMobile=vm.hideSoftLead;vm.showFullOfficePhone=vm.hideSoftLead;vm.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};vm.processSoftLead=function(n){switch(n){case 1:vm.showFullAgentDirectLine=!0;break;case 2:vm.showFullAgentMobile=!0;break;case 3:vm.showFullOfficePhone=!0}vm.isSoftLeadSent||s.registerHit({tenantId:u.region.tenantId,regionId:u.region.id,name:app.consts.hitsName.listingSoftLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,listingId:vm.agent.listingId}).success(function(){vm.isSoftLeadSent=!0})};vm.getLink=function(){h.getAgendaEventUrl(vm.virtualOpenHouse.agendaUid).success(function(n){vm.vohLink=n})};vm.getLink()}])}(),function(){appModule.controller("common.views.listings.partials.listingSearchPopup",["$scope","$uibModalInstance","helper","appSession","abp.services.app.geo","instance","abp.services.app.websiteDevelopment","QueryStringService","$cookies",function(n,t,i,r,u,f,e,o,s){function a(n){if(n=="Country")return 0;if(n=="MacroProvince")return 1;if(n=="Province")return 2;if(n=="City")return 3;if(n=="LocalZone")return 4;throw new Error("Can not recognize DefaultGeoSearchLevel");}function v(n){if(l(n),h.search=o.getFilters(h.search),$.isArray(h.search.propertyType)?$.each(h.search.propertyType,function(n){h.search.propertyType[n]=parseInt(h.search.propertyType[n])}):h.search.propertyType=i.isNumber(h.search.propertyType)?[parseInt(h.search.propertyType)]:h.search.propertyType,h.search.energyEfficiency=i.isNumber(h.search.energyEfficiency)?parseInt(h.search.energyEfficiency):h.search.energyEfficiency,h.search.filterVal=i.isNumber(h.search.filterVal)?parseInt(h.search.filterVal):h.search.filterVal,h.search.currency=i.isUndefinedOrNull(h.search.currency)?angular.isUndefined(h.defaultCurrency)||h.defaultCurrency==null?"":h.defaultCurrency.currencyISO:h.search.currency,h.search.lan=i.isUndefinedOrNull(h.search.lan)?abp.localization.currentLanguage.name:h.search.lan,h.search.resCom!=null)switch(h.search.resCom){case"-1":h.listingClassDropdownValue=-1;break;case"1":h.listingClassDropdownValue=1409;h.iconRes=!0;break;case"2":h.listingClassDropdownValue=1410;h.iconCom=!0;break;case"3":h.listingClassDropdownValue=1411;h.iconLand=!0;break;default:h.listingClassDropdownValue=-1}if(h.search.transactionType!=null)switch(h.search.transactionType){case"1":h.transactionTypeDropDownValue=357;break;case"2":h.transactionTypeDropDownValue=356;break;default:h.transactionTypeDropDownValue=357}if(h.search.addedLabel!=null)switch(h.search.addedLabel){case"0":h.propertiesAddedintheLastDropdownValue=1412;break;case"1":h.propertiesAddedintheLastDropdownValue=1415;break;case"7":h.propertiesAddedintheLastDropdownValue=1414;break;case"30":h.propertiesAddedintheLastDropdownValue=1413;break;default:h.propertiesAddedintheLastDropdownValue=null}if(!Array.isArray(h.search.localZoneIds)&&h.search.localZoneIds){var t=h.search.localZoneIds;h.search.localZoneIds=[t]}i.isUndefinedOrNull(h.search.localZoneId)||h.search.localZoneIds.indexOf(h.search.localZoneId)==-1&&h.search.localZoneIds.push(h.search.localZoneId);!Array.isArray(h.search.districtIds)&&h.search.districtIds&&(h.search.districtId=h.search.districtIds,h.search.districtIds=[h.search.districtId]);h.search.refineSearch==2&&h.showDetail()}function y(){h.requestParams={skipCount:h.search.skipCount,maxResultCount:24,transactionType:h.search.transactionType,listingClass:h.search.resCom,macroProvinceId:h.search.macroProvince,provinceId:h.search.province,cityId:h.search.city,localZoneIds:h.search.localZoneIds,currency:h.search.currency,maxPrice:h.search.maxPrice,minPrice:h.search.minPrice,propertyType:h.search.propertyType,bedRoomCount:h.search.bedRoomCount,bathRoomCount:h.search.bathRoomCount,squareMeter:h.search.minSqMeter,parkingSpace:h.search.parkingSpaces,totalRoomCount:h.search.totalRoomCount,totalAreaSqMeter:h.search.minTotalAreaSqMeter,lotSizeSqMeter:h.search.minLotSizeSqMeter,developmentId:h.search.development,buildingId:h.search.building,energyLevel:h.search.energyEfficiency,addedDay:h.search.addedLabel,agentId:h.search.agentId,officeId:h.search.officeId,officeName:h.search.officeName,agentName:h.search.agentName,upComingOpenHouse:h.search.openHouse,orderByCriteria:h.search.filterVal,id:h.search.id,tenantId:h.tenantId,regionId:h.regionId,districtIds:h.search.districtIds,measurementType:h.unitOfMeasurement.id,freeTextSearch:h.search.freeTextSearch}}function l(){h.search={minPrice:null,maxPrice:null,resCom:1,transactionType:1,province:null,addedLabel:0,macroProvince:null,city:null,localZoneIds:[],bedRoomCount:null,bathRoomCount:null,propertyType:null,minSqMeter:null,parkingSpaces:null,development:null,building:null,energyEfficiency:null,openHouse:null,lan:null,skipCount:0,currency:null,filterVal:1026,agentId:0,officeId:0,officeName:"",agentName:"",id:null,localZoneId:null,districtId:null,districtIds:[],refineSearch:1,searchText:"",pageNumber:1,freeTextSearch:""};f.search=h.search;setTimeout(function(){$("#PropertyTypeSelectionCombobox").selectpicker("refresh")},0)}function p(){}var h=this,c;h.IsLuxury=abp.IsLuxury;h.search=f.search;h.searchBackup=parseInt(h.search.resCom);h.lookupListings=!0;h.showDevelopments=f.showDevelopments;h.developments=f.developments;h.buildings=f.buildings;h.propertiesAddedintheLast=f.propertiesAddedintheLast;h.roomsAndParkingList=f.roomsAndParkingList;h.displayDefaultCurrencySymbol=f.displayDefaultCurrencySymbol;h.currencies=f.currencies;h.showCurrencies=f.showCurrencies;h.roomsAndParkingList=f.roomsAndParkingList;h.residentialFeatures=parseInt(h.search.resCom)==1;h.commercialFeatures=parseInt(h.search.resCom)==2;h.landFeatures=parseInt(h.search.resCom)==3;h.searchListings=f.searchListings;h.region=f.region;h.getRegionalSetting=f.getRegionalSetting;h.propertyType1=f.propertyType1;h.propertyType2=f.propertyType2;h.propertyType3=f.propertyType3;h.resCom=f.resCom;h.iconRes=f.iconRes;h.iconCom=f.iconCom;h.iconLand=f.iconLand;h.bedroom1=parseInt(h.search.bedRoomCount)==1418;h.bedroom2=parseInt(h.search.bedRoomCount)==1420;h.bedroom3=parseInt(h.search.bedRoomCount)==1422;h.bedroom4=parseInt(h.search.bedRoomCount)==1424;h.bathroom1=parseInt(h.search.bathRoomCount)==1418;h.bathroom2=parseInt(h.search.bathRoomCount)==1420;h.bathroom3=parseInt(h.search.bathRoomCount)==1422;h.bathroom4=parseInt(h.search.bathRoomCount)==1424;h.parking1=parseInt(h.search.parkingSpaces)==1418;h.parking2=parseInt(h.search.parkingSpaces)==1420;h.parking3=parseInt(h.search.parkingSpaces)==1422;h.parking4=parseInt(h.search.parkingSpaces)==1424;h.defaultCurrency=f.defaultCurrency;h.tenantId=f.tenantId;h.regionId=f.regionId;h.unitOfMeasurement=f.unitOfMeasurement;h.searchText=f.search.searchText;h.geoValue=f.geoValue;h.propertyTypeDefaultText=app.localize("websiteNothingSelected");h.countryFlagsList=f.countryFlagsList;h.selectedCountryRegionId=f.selectedCountryRegionId;switch(f.region.tenantId){case 1:h.propertyTypeDefaultText=app.localize("websiteSelect...");break;case 4:h.propertyTypeDefaultText=app.localize("PropertyType")}c=h.getRegionalSetting("DevelopmentProjectsWebsite");h.doFilter=function(n){i.doFilter(h.search,n)};h.getHeader=function(){var s=h.region.countryName+" ",n;try{var r=n!=null&&n!=undefined?n.targetValue+" ":app.localize("websiteAllProperty")+" ",u=h.search.transactionType==1?app.localize("websiteForSale")+" ":app.localize("websiteForRent")+" ",f=h.search.macroProvince!=null&&h.search.macroProvince!=undefined?_.where(h.macroProvinces,{id:h.search.macroProvince})[0].name:"",e=h.search.province!=null&&h.search.province!=undefined?_.where(h.provinces,{id:h.search.province})[0].name:"",o=i.isUndefinedOrNull(h.search.city)?"":_.where(h.cities,{id:h.search.city})[0].name,t="";h.search.localZoneIds!=null&&h.search.localZoneIds.length!=0&&h.search.localZoneIds!=undefined&&(h.search.localZoneIds.length>1?(t=[],angular.forEach(h.search.localZoneIds,function(n,i){t.push(_.where(h.localZones,{id:h.search.localZoneIds[i]})[0].name)})):t=_.where(h.localZones,{id:h.search.localZoneIds[0]})[0].name);h.getListingHeaderText(r,u,f,e,o,t);n=null;h.search.resCom==1?h.search.propertyType!=null?n=_.where(h.propertyType1,{listLabelId:h.search.propertyType})[0]:"":h.search.resCom==2?h.search.propertyType!=null?n=_.where(h.propertyType2,{listLabelId:h.search.propertyType})[0]:"":h.search.resCom==3&&(h.search.propertyType!=null?n=_.where(h.propertyType3,{listLabelId:h.search.propertyType})[0]:"")}catch(c){h.header=app.localize("websiteAllPropertyForSale")}};h.setBedRooms=function(){switch(parseInt(h.bedRoomCount)){case 1418:h.search.bedRoomCount=1418;f.bedRoomCount=1418;h.bedroom1=!h.bedroom1;h.bedroom2=!1;h.bedroom3=!1;h.bedroom4=!1;break;case 1420:h.search.bedRoomCount=1420;f.bedRoomCount=1420;h.bedroom2=!h.bedroom2;h.bedroom1=!1;h.bedroom3=!1;h.bedroom4=!1;break;case 1422:h.search.bedRoomCount=1422;f.bedRoomCount=1422;h.bedroom3=!h.bedroom3;h.bedroom1=!1;h.bedroom2=!1;h.bedroom4=!1;break;case 1424:h.search.bedRoomCount=1424;f.bedRoomCount=1424;h.bedroom4=!h.bedroom4;h.bedroom1=!1;h.bedroom2=!1;h.bedroom3=!1;break;default:h.search.bedRoomCount=0;f.bedRoomCount=0}h.bedroom1||h.bedroom2||h.bedroom3||h.bedroom4||(h.search.bedRoomCount=0,f.bedRoomCount=0)};h.setBathRooms=function(){switch(parseInt(h.bathRoomCount)){case 1418:h.search.bathRoomCount=1418;f.bathRoomCount=1418;h.bathroom1=!h.bathroom1;h.bathroom2=!1;h.bathroom3=!1;h.bathroom4=!1;break;case 1420:h.search.bathRoomCount=1420;f.bathRoomCount=1420;h.bathroom2=!h.bathroom2;h.bathroom1=!1;h.bathroom3=!1;h.bathroom4=!1;break;case 1422:h.search.bathRoomCount=1422;f.bathRoomCount=1422;h.bathroom3=!h.bathroom3;h.bathroom1=!1;h.bathroom2=!1;h.bathroom4=!1;break;case 1424:h.search.bathRoomCount=1424;f.bathRoomCount=1424;h.bathroom4=!h.bathroom4;h.bathroom1=!1;h.bathroom2=!1;h.bathroom3=!1;break;default:h.search.bathRoomCount=0;f.bathRoomCount=0}h.bathroom1||h.bathroom2||h.bathroom3||h.bathroom4||(h.search.bathRoomCount=0,f.bathRoomCount=0)};h.setParkingSpaces=function(){switch(parseInt(h.parkingSpaces)){case 1418:h.search.parkingSpaces=1418;f.parkingSpaces=1418;h.parking1=!h.parking1;h.parking2=!1;h.parking3=!1;h.parking4=!1;break;case 1420:h.search.parkingSpaces=1420;f.parkingSpaces=1420;h.parking2=!h.parking2;h.parking1=!1;h.parking3=!1;h.parking4=!1;break;case 1422:h.search.parkingSpaces=1422;f.parkingSpaces=1422;h.parking3=!h.parking3;h.parking1=!1;h.parking2=!1;h.parking4=!1;break;case 1424:h.search.parkingSpaces=1424;f.parkingSpaces=1424;h.parking4=!h.parking4;h.parking1=!1;h.parking2=!1;h.parking3=!1;break;default:h.search.parkingSpaces=0;f.parkingSpaces=0}h.parking1||h.parking2||h.parking3||h.parking4||(h.search.parkingSpaces=0,f.parkingSpaces=0)};h.setPropertiesAddedintheLast=function(){switch(h.propertiesAddedintheLastDropdownValue){case 1412:h.search.addedLabel=0;break;case 1413:h.search.addedLabel=30;break;case 1414:h.search.addedLabel=7;break;case 1415:h.search.addedLabel=1;break;default:h.search.addedLabel=null}};h.getAddedInDropDownValue=function(n){switch(parseInt(n)){case 0:return 1412;case 30:return 1413;case 7:return 1414;case 1:return 1415;default:return 0}};h.propertiesAddedintheLastDropdownValue=h.getAddedInDropDownValue(h.search.addedLabel);h.getDevelopments=function(n){angular.isUndefined(h.search.localZoneIds)&&v(n);e.getDevelopments({regionId:h.regionId,localzoneUIDs:h.search.localZoneIds}).success(function(n){c&&(h.developments=n.items,h.showDevelopments=h.developments.length>0?!0:!1);_.where(h.localZones,{hasLowerLevel:!0}).length>0&&(h.dropdownLocalzones=!0,localzoneSelected())})};h.getBuildings=function(n){e.getBuildingsByDevelopment({developmentId:n}).success(function(n){h.buildings=n.items;h.disableBuildings=n.items==0?!0:!1})};h.searchListings=function(){if(h.curPage=0,typeof h.geoId=="undefined"&&typeof h.geoGroup=="undefined"&&typeof h.geoValue!="undefined"&&typeof firstResult!="undefined"&&h.geoValue!="")n.onSelect(firstResult);h.search.id!=null?h.goListingDetail(h.search.id):h.getListings()};h.currencyChanged=function(n,t){if(t){var i=_.where(h.currencies,{currencyISO:t});i.length>0&&(h.displayDefaultCurrencySymbol=angular.isUndefined(i[0].htmlSymbol)?i[0].currencyISO:i[0].htmlSymbol);h.search.currency=i[0].currencyISO;f.search.currency=h.search.currency;f.displayDefaultCurrencySymbol=h.displayDefaultCurrencySymbol}else h.displayDefaultCurrencySymbol=angular.isUndefined(n.htmlSymbol)?n.currencyISO:n.htmlSymbol,h.search.currency=n.currencyISO,f.search.currency=h.search.currency,f.displayDefaultCurrencySymbol=h.displayDefaultCurrencySymbol};n.getLocation=function(n){return h.typeaheadIsLoading=!0,new Promise(function(t){var i=a(h.getRegionalSetting("DefaultGeoSearchLevel")),r=h.getRegionalSetting("DefaultGeoSearchValues");u.getSearchGeo({search:n,countryUID:h.region.countryId,level:i,ids:r}).success(function(n){for(var i=0;i<n.items.length;i++)n.items[i].groupNameLocalized=app.localize(n.items[i].groupName);h.typeaheadIsLoading=!1;h.geoId=undefined;h.geoGroup=undefined;firstResult=n.items[0];t(n.items)})})};n.onSelect=function(n){h.search.searchText=n.name;h.geoId=n.id;h.geoValue=n.name;h.geoGroup=n.group;f.geoId=n.id;f.geoValue=n.name;f.geoGroup=n.group};n.$watch("vm.search.localZoneId",function(n,t){n!=t&&c&&(h.showDevelopments=h.search.localZoneId==null?!1:!0);h.getDevelopments()},!0);n.$watch("vm.developmentId",function(n){n&&(h.search.development=_.where(h.developments,{id:n})[0].developmentId)});n.$watch("vm.search",function(n,t){n!==t&&(angular.forEach(h.search,function(n,r){if(h.doFilter(r),r==="localZoneId"){if(Array.isArray(h.search.localZoneIds)&&h.search.localZoneIds.indexOf(t.localZoneId)!=-1){var u=h.search.localZoneIds.indexOf(t.localZoneId);h.search.localZoneIds.splice(u,1)}i.isUndefinedOrNull(h.search.localZoneId)&&Array.isArray(h.search.localZoneIds)?h.search.localZoneIds.indexOf(h.search.localZoneId)!=-1||i.isUndefinedOrNull(h.search.localZoneId)||h.search.localZoneIds.push(h.search.localZoneId):h.search.localZoneIds=[h.search.localZoneId]}else r==="developmentId"&&(h.search.development=n?_.where(h.developments,{id:n})[0].developmentId:null)}),h.savedSearchSaved=!1)},!0);h.getListings=function(n){var t,r,u;if(n?h.header=n:h.getHeader(),h.setSearchFeatures(),y(),h.showEnergyRating||(h.requestParams.energyLevel=null),h.requestParams.vatIncluded=h.isVATEnabled,h.search.development!=""&&h.search.development!=null&&(t=_.where(h.developments,{developmentId:parseInt(h.search.development)}),h.requestParams.developmentId=t.length>0?t[0].id:null,h.developmentId=h.requestParams.developmentId),angular.element("#freeTextLocationSearchSelection").length&&(console.log("#freeTextLocationSearchSelection exists"),(h.geoValue==""||typeof h.geoId=="undefined")&&(h.geoId=undefined,h.firstResult=undefined,h.geoGroup=="undefined",h.search.province=null,h.search.macroProvince=null,h.search.city=null,h.search.localZoneIds=[],h.search.localZoneId=null,h.search.districtId=null,h.search.districtIds=[]),h.geoGroup==4?(h.requestParams.districtIds=h.geoId,h.search.districtIds=h.districtIds):h.geoGroup==3?(h.requestParams.localZoneIds=h.geoId,h.search.localZoneIds=h.geoId):h.geoGroup==2?(h.requestParams.cityId=h.geoId,h.search.city=h.geoId):h.geoGroup==1?(h.requestParams.provinceId=h.geoId,h.search.province=h.geoId):h.geoGroup==0&&(h.requestParams.macroProvinceId=h.geoId,h.search.macroProvince=h.geoId)),h.setSearchFeatures(),h.isMapSearch?h.requestParams.maxResultCount=1e3:h.curPage?(h.requestParams.skipCount=(h.curPage-1)*h.pageSize,h.requestParams.maxResultCount=h.pageSize):(h.requestParams.skipCount=0,h.requestParams.maxResultCount=h.pageSize),h.requestParams.minPrice!=null&&h.requestParams.maxPrice!=null&&(r=i.isNumber(h.requestParams.minPrice),u=i.isNumber(h.requestParams.maxPrice),r&&u&&parseFloat(h.requestParams.minPrice)>parseFloat(h.requestParams.maxPrice))){alert(app.localize("MinValueCantBeMoreThanMaxValue"));return}h.requestParams.freeTextSearch=h.search.freeTextSearch;h.loading=!0};n.$watch("vm.developmentId",function(n){n&&(h.search.development=_.where(h.developments,{id:n})[0].developmentId)});h.getRegionalSetting=function(n){for(var i,t=0;t<r.regionalSettings.length;t++)if(r.regionalSettings[t].name==n)return r.regionalSettings[t].type=="ListStringSettingValueDto"||r.regionalSettings[t].type=="ListIntSettingValueDto"?r.regionalSettings[t].output.values:r.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};h.setSearchFeaturesDropdown=function(){switch(parseInt(h.search.resCom)){case 1:h.search.resCom=1;h.iconRes=!h.iconRes;h.iconCom=!1;h.iconLand=!1;f.iconRes=!f.iconRes;f.iconCom=!1;f.iconLand=!1;break;case 2:h.search.resCom=2;h.iconCom=!h.iconCom;h.iconRes=!1;h.iconLand=!1;f.iconCom=!f.iconCom;f.iconRes=!1;f.iconLand=!1;break;case 3:h.search.resCom=3;h.iconLand=!h.iconLand;h.iconRes=!1;h.iconCom=!1;f.iconLand=!f.iconLand;f.iconRes=!1;f.iconCom=!1;break;default:h.search.resCom=-1}h.iconRes||h.iconCom||h.iconLand||(h.search.resCom=-1);h.search.propertyType=null;h.setSearchFeatures()};h.setSearchFeatures=function(){parseInt(h.search.resCom)==1?(h.residentialFeatures=!0,h.commercialFeatures=!1,h.landFeatures=!1,h.getRegionalSetting("EnergyRating")&&(h.showEnergyRating=!0),h.search.bedRoomCount=h.bedRoomCount,h.search.bathRoomCount=h.bathRoomCount,h.search.parkingSpaces=h.parkingSpaces,h.search.totalRoomCount=null,h.search.minTotalAreaSqMeter=null,h.search.minLotSizeSqMeter=null):parseInt(h.search.resCom)==2?(h.residentialFeatures=!1,h.commercialFeatures=!0,h.landFeatures=!1,h.getRegionalSetting("EnergyRating")&&(h.showEnergyRating=!0),h.search.parkingSpaces=h.parkingSpaces,h.search.bedRoomCount=null,h.search.bathRoomCount=null,h.search.minSqMeter=null,h.search.minLotSizeSqMeter=null):(h.residentialFeatures=!1,h.commercialFeatures=!1,h.landFeatures=!0,h.showEnergyRating=!1,h.search.bedRoomCount=null,h.search.bathRoomCount=null,h.search.minSqMeter=null,h.search.parkingSpaces=null,h.search.totalRoomCount=null,h.search.minTotalAreaSqMeter=null);f.bedRoomCount=h.bedRoomCount;f.bathRoomCount=h.bathRoomCount;f.parkingSpaces=h.parkingSpaces};h.closePopupAndSearch=function(){if(f.curPage=1,f.search.pageNumber=1,typeof h.geoId=="undefined"&&typeof h.geoGroup=="undefined"&&typeof h.geoValue!="undefined"&&typeof firstResult!="undefined"&&h.geoValue!="")n.onSelect(firstResult);f.selectedCountryRegionId=h.selectedCountryRegionId;s.put("destinationRegionIdCookie",h.selectedCountryRegionId,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});t.close()};h.close=function(){t.dismiss()};h.resetSearch=function(){l();h.search.searchText=null;h.geoId=null;h.geoValue=null;h.geoGroup=null;f.search.searchText=null;f.geoId=null;f.geoValue=null;f.geoGroup=null;h.bedRoomCount=null;h.bathRoomCount=null;h.parkingSpaces=null;h.search.currency=h.defaultCurrency.currencyISO;h.curPage=0;h.developmentId=null;h.getListings();h.localZones=null;h.districts=null;h.energyEfficiency=null;h.search.propertyType=null;h.iconRes=!1;h.iconCom=!1;h.iconLand=!1;f.iconRes=!1;f.iconCom=!1;f.iconLand=!1;h.search.addedLabel=null;h.propertiesAddedintheLastDropdownValue=h.getAddedInDropDownValue(h.search.addedLabel);h.clearAllButtonSelection()};h.clearAllButtonSelection=function(){h.bedroom1=!1;h.bedroom2=!1;h.bedroom3=!1;h.bedroom4=!1;h.bathroom1=!1;h.bathroom2=!1;h.bathroom3=!1;h.bathroom4=!1;h.parking1=!1;h.parking2=!1;h.parking3=!1;h.parking4=!1};p()}])}(),function(){appModule.controller("common.views.misyon",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"misyon",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.misyon,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.officeagentsearch.index",["$scope","$location","appSession","abp.services.app.agent","abp.services.app.tenant","abp.services.app.region","abp.services.app.office","abp.services.app.hit","helper","$window","abp.services.app.seo","$cookies","chatIntegrationService",function(n,t,i,r,u,f,e,o,s,h,c,l,a){var v=this,y,w,p,g,nt,d,it;v.IsOffice=abp.IsOffice;window.prerenderReady=!1;var b=t.absUrl(),k=0,tt=!abp.IsOffice;k=tt?b.indexOf("officeagentsearch/2")!=-1?2:b.indexOf("officeagentsearch/1")!=-1?1:b.indexOf("office")!=-1?1:2:2;v.session=i;y=v.session.region.tenantId;w="";w=k==1?"officeagentsearch":"agents";p=l.get("destinationRegionIdCookie");(p==null||typeof p=="undefined"||p==""||p=="0")&&l.put("destinationRegionIdCookie",i.region.id,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"});v.selectedCountryRegionId=parseInt(l.get("destinationRegionIdCookie"));g=app.localize("webSEOTitleAgentOfficeSearch",app.localize(v.session.region.name));c.createTitle(encodeURIComponent(g),w).success(function(n){v.tenantName=n});nt=app.localize("webSEOTitleAgentSearch2",app.localize(v.session.region.name));c.createTitle(encodeURIComponent(nt),w).success(function(n){v.tenantNameAgent=n});d=v.session.region.id;v.pageHeader=app.localize("websiteRealEstateProfessionalsInRegion",app.localize(v.session.region.countryName));it=[];v.loading=!0;v.angularloading=!0;v.pageFilters={filterType:k,name:null,location:null,language:null,placeHolder:null,languages:[],currentPage:0};v.pageFiltersOld=null;v.resultCount=0;v.maxPage=0;v.skipCount=0;v.pageSize=24;v.languages=[];v.offices=[];v.agents=[];v.loadingChatIntegration=!0;v.getInclude=function(){return abp.rootTemplatePath+"views/officeagentsearch/partials/index.cshtml"};v.search=function(){(v.pageFiltersOld==null||v.pageFiltersOld.geoId!=v.pageFilters.geoId||v.pageFiltersOld.filterType!=v.pageFilters.filterType||v.pageFiltersOld.name!=v.pageFilters.name||v.pageFiltersOld.location!=v.pageFilters.location||v.pageFiltersOld.language!=v.pageFilters.language||v.pageFiltersOld.currentPage!=v.pageFilters.currentPage||v.selectedCountryRegionId!=i.destinationRegion.id)&&(v.pageFiltersOld=jQuery.extend({},v.pageFilters),v.offices=[],v.agents=[],v.selectedCountryRegionId=i.destinationRegion.id,v.getLanguages(),v.skipCount=v.pageFilters.currentPage?(v.pageFilters.currentPage-1)*v.pageSize:0,this.pageFilters.filterType==1?this.getOffices():this.getAgents())};v.getRegionalSetting=function(n){for(var r,t=0;t<i.regionalSettings.length;t++)if(i.regionalSettings[t].name==n)return i.regionalSettings[t].type=="ListStringSettingValueDto"||i.regionalSettings[t].type=="ListIntSettingValueDto"?i.regionalSettings[t].output.values:i.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};v.getLanguages=function(){e.getLanguagesForSite({tenantId:y,regionId:v.selectedCountryRegionId}).success(function(n){v.pageFilters.languages=n})};v.getOffices=function(){$("#divWaitImg").show();$("#notExactMatch").hide();$("#noResults").hide();this.pageFilters.placeHolder=app.localize("websiteOffice");$("#office-agent-input").val()==""&&(v.pageFilters.geoId=null,v.pageFilters.geoGroup=null);e.getOfficesRegional({skipCount:v.skipCount,maxResultCount:v.pageSize,sorting:"name asc",regionId:v.selectedCountryRegionId,tenantId:y,officeName:v.pageFilters.name,searchLanguageId:v.pageFilters.language,geoId:v.pageFilters.geoId,geoGroup:v.pageFilters.geoGroup}).success(function(n){v.offices=n.pages.items;v.resultCount=n.pages.totalCount;v.maxPage=Math.ceil(v.resultCount/v.pageSize);!n.exactMatch&&v.pageFilters.geoId!=null&&v.offices.length>0&&$("#notExactMatch").show();v.offices.length==0&&$("#noResults").show()}).finally(function(){$("#divWaitImg").hide();window.prerenderReady=!0})};v.openAgentModal=function(n){h.location.href="/"+n+"?contact=true"};v.getAgents=function(){$("#divWaitImg").show();$("#notExactMatch").hide();$("#noResults").hide();this.pageFilters.placeHolder=app.localize("websiteAgent");$("#office-agent-input").val()==""&&(v.pageFilters.geoId=null,v.pageFilters.geoGroup=null);r.getAgentsRegional({skipCount:v.skipCount,maxResultCount:v.pageSize,sorting:"agentname asc",regionId:v.selectedCountryRegionId,tenantId:y,agentName:v.pageFilters.name,searchLanguageId:v.pageFilters.language,geoId:v.pageFilters.geoId,geoGroup:v.pageFilters.geoGroup}).success(function(n){v.agents=n.pages.items;v.resultCount=n.pages.totalCount;v.maxPage=Math.ceil(v.resultCount/v.pageSize);!n.exactMatch&&v.pageFilters.geoId!=null&&v.agents.length>0&&$("#notExactMatch").show();v.agents.length==0&&$("#noResults").show();angular.forEach(v.agents,function(n){n.facebook==null||n.facebook==""||n.facebook.includes("http")||(n.facebook="https://"+n.facebook);n.twitter==null||n.twitter==""||n.twitter.includes("http")||(n.twitter="https://"+n.twitter);n.linkedIn==null||n.linkedIn==""||n.linkedIn.includes("http")||(n.linkedIn="https://"+n.linkedIn);n.youTube==null||n.youTube==""||n.youTube.includes("http")||(n.youTube="https://"+n.youTube);n.instagram==null||n.instagram==""||n.instagram.includes("http")||(n.instagram="https://"+n.instagram);n.chatIntegrations=a.setupChatForWebsite(n.agentChatIntegrations,n.whatsAppPhone)});v.loadingChatIntegration=!1}).finally(function(){$("#divWaitImg").hide();o.registerHit({tenantId:y,regionId:d,name:app.consts.hitsName.agentSearch,type:app.consts.hitsType.search,languageCode:abp.localization.currentLanguage.name})})};o.registerHit({tenantId:y,regionId:d,name:app.consts.hitsName.officeAgentSearchView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name});this.search();this.previousPage=function(){v.pageFilters.currentPage=v.pageFilters.currentPage-1;v.skipCount=v.pageFilters.currentPage*v.pageSize;this.search()};this.nextPage=function(){v.pageFilters.currentPage=v.pageFilters.currentPage+1;v.skipCount=v.pageFilters.currentPage*v.pageSize;this.search()}}])}(),function(){appModule.controller("common.views.officeprofile.index",["$scope","abp.services.app.lookupLists","$uibModal","appSession","abp.services.app.office","abp.services.app.contactForms","Notification","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt","helper",function(n,t,i,r,u,f,e,o,s,h,c){function w(){l.getRegionalSetting=function(n){for(var t=0;t<a.regionalSettings.length;t++)if(a.regionalSettings[t].name==n)return a.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};l.IsOffice&&l.getOffices();l.facebook=l.getRegionalSetting("RegionSocialMediaFacebook");l.facebook==null||l.facebook==""||l.facebook.includes("http")||(l.facebook="https://"+l.facebook);l.twitter=l.getRegionalSetting("RegionSocialMediaTwitter");l.twitter==null||l.twitter==""||l.twitter.includes("http")||(l.twitter="https://"+l.twitter);l.linkedIn=l.getRegionalSetting("RegionSocialMediaLinkedIn");l.linkedIn==null||l.linkedIn==""||l.linkedIn.includes("http")||(l.linkedIn="https://"+l.linkedIn);l.youtube=l.getRegionalSetting("RegionSocialMediaYoutube");l.youtube==null||l.youtube==""||l.youtube.includes("http")||(l.youtube="https://"+l.youtube);l.instagram=l.getRegionalSetting("RegionSocialMediaInstagram");l.instagram==null||l.instagram==""||l.instagram.includes("http")||(l.instagram="https://"+l.instagram)}var l=this,a,y,v,p;l.page_description={name:"officeprofile-description",postingId:""};l.page_youtube={name:"officeprofile-youtube",postingId:""};l.page_facebook={name:"officeprofile-facebook",postingId:""};l.busy=!1;l.selectedOffice={};a=r;l.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",a.region.tenantFullName);l.IsRegion=abp.IsRegion;l.IsOffice=abp.IsOffice;l.IsAgent=abp.IsAgent;l.IsTeam=abp.IsTeam;l.OfficeId=parseInt(abp.OfficeId);l.AgentId=parseInt(abp.AgentId);l.TeamId=parseInt(abp.TeamId);l.showFullOfficePhone=!1;y=a.region!=null?a.region.tenantId:0;v=a.region!=null?a.region.id:0;l.headOfficePhone=a.region.headOfficePhone;l.headOfficeEmail=a.region.headOfficeEmail;l.formattedRegionAddress=a.region.formattedRegionAddress;l.regionId=v;t.getMultipleLookupLists({listIds:[60],tenantId:y,regionId:v}).success(function(n){l.options=n.items[0].lookupLists});c.displayCaptcha(a.region.id).success(function(n){l.displayCaptcha=n});l.captchaKey=s;l.openModal=function(){var t=i.open({animation:!0,templateUrl:"~/App/common/views/contactus/modal/contact-us-modal-dialog.cshtml",controller:"common.views.contactus.modal.contact as vm",resolve:{offices:function(){return l.offices}}});t.result.then(function(t){n.contact.selectedOffice=t})};p={regionId:a.region.id,tenantId:a.region.tenantId};l.getOffices=function(){u.getOfficesRegional({regionId:v,tenantId:y,officeId:l.OfficeId}).success(function(n){l.office=n.pages.items[0]}).finally(function(){})};l.submit=function(t){if(l.displayCaptcha){if(h.getResponse()===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=h.getResponse()}l.busy=!0;t.officeId=t.option==1020||t.option==1021?t.selectedOffice.officeId:null;t.regionId=a.destinationRegion.id;t.tenantId=a.destinationRegion.tenantId;f.sendMessageForRegion(t).success(function(n){n.result?(e.success(app.localize("websiteMessageHasBeenSent")),(t.option==1020||t.option==1021)&&o.registerHit({tenantId:a.region.tenantId,regionId:a.region.id,name:app.consts.hitsName.officeContactLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,officeId:t.officeId})):(e.error(app.localize("websiteAnErrorOccured")),console.log(n.message))}).finally(function(){n.contact.selectedOffice={};l.selectedOffice={};n.contact={};n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();l.busy=!1})};l.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};l.processSoftLead=function(){l.showFullOfficePhone=!0;o.registerHit({tenantId:y,regionId:v,name:app.consts.hitsName.officeSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,officeId:l.office.id})};w()}])}(),function(){appModule.controller("common.views.offices.index",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.office","appSession","mapService","openstreetmapService","abp.services.app.hit","$sce","helper","$timeout","$window","$anchorScroll","$cookies","QueryStringService",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){function nt(n){f.getOfficeRegional({officeId:n,userLanguage:abp.localization.currentLanguage.name,tenantId:g}).success(function(n){if(n.office)b.showDeadOfficePage=!1;else{b.showDeadOfficePage=!0;b.loading=!1;return}k!=n.office.regionId?(k=n.office.regionId,p.put("destinationRegionIdCookie",k,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"}),abp.services.app.regionalSettings.getWebsiteDestRegionalAllSettings({settingNames:e.settingNames,DestinationRegionId:k},{async:!1}).done(function(t){e.destinationRegion=t.destRegion;e.destinationRegionalSettings=t.destRegionalLists;e.destinationRegionLanguages=t.DestRegionLanguages;b.processOffice(n)})):b.processOffice(n)}).finally(function(){window.prerenderReady=!0;w.getUrlParameter("contact")=="true"&&b.openModal()})}var b=this;b.page_description={name:"officeprofile-description",postingId:""};b.page_youtube={name:"officeprofile-youtube",postingId:""};b.page_facebook={name:"officeprofile-facebook",postingId:""};window.prerenderReady=!1;n.scrollTo=function(n){y(n)};b.office=null;b.agents=[];b.interns=[];b.loading=!0;b.IsOffice=abp.IsOffice;b.IsRegion=abp.IsRegion;b.IsAgent=abp.IsAgent;b.IsTeam=abp.IsTeam;var d=e.region.id,g=e.region.tenantId,k=e.region.id;e.destinationRegion&&(k=e.destinationRegion.id);b.headOfficePhone=e.region.headOfficePhone;b.headOfficeEmail=e.region.headOfficeEmail;b.formattedRegionAddress=e.region.formattedRegionAddress;b.regionId=d;b.processOffice=function(n){var t,i,r,u;b.office=n.office;b.office.cultureAddress=n.cultureAddress;b.teams=n.teams;b.agents=n.agents;t=b.getRegionalSetting("Is Interns Enabled?");t&&(b.interns=n.interns);b.languagesSpoken=n.languagesSpoken;b.officeHeaderAddress=n.officeHeaderAddress;b.carouselItems=n.carouselItems;b.officeAddress=n.officeAddress;b.listingCount=n.listingCount;i=b.getRegionalSetting("Display Office Staff/Admin on website");i&&(b.officeStaff=n.officeStaff);b.trainingCount=n.trainingCount;b.loading=!1;b.office.facebook==null||b.office.facebook==""||b.office.facebook.includes("http")||(b.office.facebook="https://"+b.office.facebook);b.office.twitter==null||b.office.twitter==""||b.office.twitter.includes("http")||(b.office.twitter="https://"+b.office.twitter);b.office.linkedIn==null||b.office.linkedIn==""||b.office.linkedIn.includes("http")||(b.office.linkedIn="https://"+b.office.linkedIn);b.office.youTube==null||b.office.youTube==""||b.office.youTube.includes("http")||(b.office.youTube="https://"+b.office.youTube);b.office.instagram==null||b.office.instagram==""||b.office.instagram.includes("http")||(b.office.instagram="https://"+b.office.instagram);h.registerHit({tenantId:e.region.tenantId,regionId:e.region.id,name:app.consts.hitsName.officeDetailsView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name,officeId:b.office.id});b.carouselItems!=null&&b.agents!=null&&(r=$.map(b.agents,function(n){return n.id}),u=$.map(b.carouselItems,function(n){return n.listingId}),h.getOfficeRegionalRegisterHits({agentIds:r,listingIds:u,regionId:e.region.id}))};b.getMap=function(){(b.office.latitude||b.office.longitude)&&s.loadMap("map",b.office.latitude,b.office.longitude,15,!1,!1,!1,!1,!1,!1,!1)};b.getInclude=function(){if(!angular.isUndefined(b.showDeadOfficePage))return b.showDeadOfficePage?"~/App/common/views/offices/partials/deadOfficePage.cshtml":"~/App/common/views/offices/partials/index.cshtml"};b.getIncludeByName=function(n){return abp.rootTemplatePath+"views/offices/partials/"+n+".cshtml"};n.finishLoading=function(){$("#map").hide()};b.openMap=function(){return};b.getRegionalSetting=function(n){for(var i,t=0;t<e.destinationRegionalSettings.length;t++)if(e.destinationRegionalSettings[t].name==n)return e.destinationRegionalSettings[t].type=="ListStringSettingValueDto"||e.destinationRegionalSettings[t].type=="ListIntSettingValueDto"?e.destinationRegionalSettings[t].output.values:e.destinationRegionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};b.hideSoftLead=b.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");b.displayLicenseAndCompanyName=b.getRegionalSetting("Display License Number & Company Name on Office Profile");b.showFullOfficePhone=b.hideSoftLead;b.openAgentModal=function(n){v.location.href="/"+n+"?contact=true"};b.openModal=function(){var n=r.open({animation:!0,templateUrl:"~/App/common/views/offices/modal/office-contact-modal-dialog.cshtml",controller:"common.views.offices.modal.contact as vm",size:"sm",resolve:{office:function(){return b.office},officeAddressOutput:function(){return b.officeAddressOutput}}});n.result.then(function(n){console.log(n)})};b.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};b.processSoftLead=function(){b.showFullOfficePhone=!0;h.registerHit({tenantId:g,regionId:d,name:app.consts.hitsName.officeSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,officeId:b.office.id})};b.init=function(n){nt(n)}}])}(),function(){appModule.controller("common.views.offices.officeContact",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office",function(){var n=this;n.office=null}])}(),function(){appModule.controller("common.views.offices.modal.contact",["$scope","$uibModalInstance","office","officeAddressOutput","abp.services.app.contactForms","appSession","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt",function(n,t,i,r,u,f,e,o,s,h){vm=this;vm.office=i;vm.officeAddressOutput=r;vm.success=null;vm.busy=!1;vm.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",f.region.tenantFullName);vm.captchaKey=o;vm.showFullOfficePhone=!1;var c;n.contact={officeId:i.id,regionId:f.destinationRegion.id};vm.close=function(){t.dismiss("cancel")};h.displayCaptcha(f.region.id).success(function(n){vm.displayCaptcha=n});n.setCaptchaWidgetId=function(){c=___grecaptcha_cfg.count-1};vm.submit=function(){if(vm.displayCaptcha){if(s.getResponse(c)===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=s.getResponse(c)}vm.busy=!0;u.sendMessageForOffice(n.contact).success(function(n){vm.success=n.result}).finally(function(){n.contact.name="";n.contact.email="";n.contact.phone="";n.contact.comments="";n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();vm.busy=!1;e.registerHit({tenantId:f.region.tenantId,regionId:f.region.id,name:app.consts.hitsName.officeLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,officeId:i.id})})};vm.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};vm.processSoftLead=function(){vm.showFullOfficePhone=!0;e.registerHit({tenantId:f.region.tenantId,regionId:f.region.id,name:app.consts.hitsName.officeSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,officeId:vm.office.id})}}])}(),function(){appModule.controller("common.views.offices.modal.officemap",["$scope","$uibModalInstance","office","address","appSession","helper",function(n,t,i,r,u,f){vm=this;vm.center=new google.maps.LatLng(i.latitude,i.longitude);vm.address=r;vm.officeImage=i.defaultImage;vm.phone=i.phone;vm.id=i.id;vm.officeName=i.name;vm.tenant=f.getDynamicImageByPathNameAndLevel("/map/pointer_1.png");vm.close=function(){t.close()}}])}(),function(){appModule.controller("common.views.poc.listingToPdf",["$scope","$state","$uibModal","$templateCache",function(){var n=this;n.listingId="1003-2";n.generateListingPdf=function(){var t=abp.appPath+"HtmlToPdf/GetListingPdf?listingId="+n.listingId;window.location=t};n.generateListingPdfiTextSharp=function(){var t=abp.appPath+"HtmlToPdf/GetListingPdfItextSharp?listingId="+n.listingId;window.location=t}}])}(),function(){appModule.controller("common.views.privacy",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e){var o=this;o.page={name:"privacypolicy",postingId:""};f.registerHit({tenantId:e.region.tenantId,regionId:e.region.id,name:app.consts.hitsName.privacy,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.sell.index",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","helper","appSession",function(n,t,i,r,u,f,e,o){var s=this;s.page={name:"sell",postingId:cmsData.postingId};f.registerHit({tenantId:o.region.tenantId,regionId:o.region.id,name:app.consts.hitsName.sellingView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.stepstobuy.index",["$scope","$state","$uibModal","$templateCache","uiGridConstants","helper","appSession",function(){var n=this;n.page={name:"stepstobuy",postingId:cmsData.postingId}}])}(),function(){appModule.controller("common.views.stepstosell.index",["$scope","$state","$uibModal","$templateCache","uiGridConstants","helper","appSession",function(){var n=this;n.page={name:"stepstosell",postingId:cmsData.postingId}}])}(),function(){appModule.controller("common.views.subscription.index",["$scope","$state","$templateCache","abp.services.app.subscription","$stateParams",function(n,t,i,r){var u=this;u.subscription={};u.isSubscribed=!0;u.loading=!1;u.init=function(n){u.token=n;r.getSubscription(n).success(function(n){u.subscription=n;n.authorized===!1?u.header=app.localize("ManageSubscriptionForBuyerProfileUnauthorized"):n.isSuccess===!1?u.header=abp.localization.localize("ManageSubscriptionForBuyerProfileError"):n.isSuccess===!0&&(u.header=abp.localization.localize("ManageSubscriptionForBuyerProfile"))})};u.unsubscribe=function(){u.loading=!0;r.unsubscribe(u.token).success(function(n){u.subscription=n;n.authorized===!1?u.header=app.localize("ManageSubscriptionForBuyerProfileUnauthorized"):n.isSuccess===!1?u.header=abp.localization.localize("ManageSubscriptionForBuyerProfileError"):n.isSuccess===!0&&(u.header=abp.localization.localize("ManageSubscriptionForBuyerProfile"))}).finally(function(){u.loading=!1})};u.resubscribe=function(){u.loading=!0;r.resubscribe(u.token).success(function(n){u.subscription=n;n.authorized===!1?u.header=app.localize("ManageSubscriptionForBuyerProfileUnauthorized"):n.isSuccess===!1?u.header=abp.localization.localize("ManageSubscriptionForBuyerProfileError"):n.isSuccess===!0&&(u.header=abp.localization.localize("ManageSubscriptionForBuyerProfile"))}).finally(function(){u.loading=!1})}}])}(),function(){appModule.controller("common.views.subscription.unsubscription",["$scope","$state","$templateCache","abp.services.app.subscription","$stateParams","abp.services.app.lookupLists","appSession","$location","abp.services.app.hit","helper",function(n,t,i,r,u,f,e,o,s,h){function l(){f.getLookupLists({listId:73,tenantId:e.region.tenantId,regionId:e.region.id}).success(function(n){c.unsubscribeReasons=n.items})}var c=this;c.subscription={};c.isSubscribed=!0;c.loading=!1;s.registerHit({tenantId:e.region.tenantId,regionId:e.region.id,name:app.consts.hitsName.privacy,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name});c.generalUrl=h.getDynamicImageByPathNameAndLevel("/images/general.jpg");c.init=function(n){c.loading=!0;r.generalGetUnsubscribe(n).success(function(t){c.unsubscribeCode=n;c.subscription=t;l();t.authorized===!1?c.header=app.localize("ManageSubscriptionUnauthorized"):t.isSuccess===!1?c.header=abp.localization.localize("ManageSubscriptionError"):t.isSuccess===!0&&(c.header=abp.localization.localize("ManageSubscriptionGeneral"))}).finally(function(){c.loading=!1})};c.unsubscribe=function(){c.loading=!0;r.generalUnsubscribe({token:c.unsubscribeCode,reasonId:c.reason}).success(function(n){c.subscription=n;c.goHome()}).finally(function(){c.loading=!1})};c.goHome=function(){t.go("home")}}])}(),function(){appModule.controller("common.views.teams.index",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.team","appSession","mapService","openstreetmapService","abp.services.app.hit","$sce","helper","$timeout","$window","$cookies",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y){function d(n){f.getTeamRegional({teamId:n,userLanguage:abp.localization.currentLanguage.name,tenantId:b}).success(function(n){w!=n.team.regionId?(w=n.team.regionId,y.put("destinationRegionIdCookie",w,{expires:"Fri, 31 Dec 9999 23:59:59 GMT"}),abp.services.app.regionalSettings.getWebsiteDestRegionalAllSettings({settingNames:e.settingNames,DestinationRegionId:w},{async:!1}).done(function(t){e.destinationRegion=t.destRegion;e.destinationRegionalSettings=t.destRegionalLists;e.destinationRegionLanguages=t.DestRegionLanguages;p.processTeam(n)})):p.processTeam(n)}).finally(function(){window.prerenderReady=!0})}var p=this;p.page_description={name:"teamprofile-description",postingId:""};p.page_youtube={name:"teamprofile-youtube",postingId:""};p.page_facebook={name:"teamprofile-facebook",postingId:""};window.prerenderReady=!1;p.team=null;p.agents=[];p.interns=[];p.loading=!0;p.IsOffice=abp.IsOffice;var k=e.region.id,b=e.region.tenantId,w=e.region.id;e.destinationRegion&&(w=e.destinationRegion.id);p.processTeam=function(n){p.team=n.team;p.office=n.team.office;p.agents=n.agents;p.languagesSpoken=n.languagesSpoken;p.teamHeaderAddress=n.teamHeaderAddress;p.carouselItems=n.carouselItems;p.teamAddress=n.team.officeAddress;p.listingCount=n.listingCount;p.loading=!1;p.team.facebook==null||p.team.facebook==""||p.team.facebook.includes("http")||(p.team.facebook="https://"+p.team.facebook);p.team.twitter==null||p.team.twitter==""||p.team.twitter.includes("http")||(p.team.twitter="https://"+p.team.twitter);p.team.linkedIn==null||p.team.linkedIn==""||p.team.linkedIn.includes("http")||(p.team.linkedIn="https://"+p.team.linkedIn);p.team.youTube==null||p.team.youTube==""||p.team.youTube.includes("http")||(p.team.youTube="https://"+p.team.youTube);p.team.instagram==null||p.team.instagram==""||p.team.instagram.includes("http")||(p.team.instagram="https://"+p.team.instagram);h.registerHit({tenantId:e.region.tenantId,regionId:e.region.id,name:app.consts.hitsName.teamDetailsView,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name,teamId:p.team.id});var t=[],i=[];p.agents&&(t=$.map(p.agents,function(n){return n.id}));p.carouselItems&&(i=$.map(p.carouselItems,function(n){return n.listingId}));h.getTeamRegionalRegisterHits({agentIds:t,listingIds:i,regionId:e.region.id})};p.getMap=function(){(p.office.latitude||p.office.longitude)&&s.loadMap("map",p.office.latitude,p.office.longitude,15,!1,!1,!1,!1,!1,!1,!1)};p.getInclude=function(){return abp.rootTemplatePath+"views/teams/partials/index.cshtml"};p.openMap=function(){return};p.getRegionalSetting=function(n){for(var i,t=0;t<e.regionalSettings.length;t++)if(e.regionalSettings[t].name==n)return e.regionalSettings[t].type=="ListStringSettingValueDto"||e.regionalSettings[t].type=="ListIntSettingValueDto"?e.regionalSettings[t].output.values:e.regionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};p.hideSoftLead=p.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");p.showFullTeamPhone=p.hideSoftLead;n.initializeLazyLoad=function(){a(function(){var n=new Blazy({src:"data-blazy",offset:10,breakpoints:[{width:420,src:"data-blazy-small"}],success:function(n){console.log(n)}})},0)};p.openAgentModal=function(n){v.location.href="/"+n+"?contact=true"};p.openModal=function(){var n=r.open({animation:!0,templateUrl:"~/App/common/views/teams/modal/team-contact-modal-dialog.cshtml",controller:"common.views.teams.modal.contact as vm",size:"sm",resolve:{team:function(){return p.team},officeAddressOutput:function(){return p.officeAddressOutput}}});n.result.then(function(n){console.log(n)})};p.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};p.processSoftLead=function(){p.showFullTeamPhone=!0;h.registerHit({tenantId:b,regionId:k,name:app.consts.hitsName.teamSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,teamId:p.team.id})};p.init=function(n){d(n)}}])}(),function(){appModule.controller("common.views.teams.teamContact",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office",function(){var n=this;n.office=null}])}(),function(){appModule.controller("common.views.teams.modal.officemap",["$scope","$uibModalInstance","office","team","address","appSession","helper",function(n,t,i,r,u,f,e){vm=this;vm.center=new google.maps.LatLng(i.latitude,i.longitude);vm.address=u;vm.teamImage=r.defaultImage;vm.phone=r.phone;vm.id=r.id;vm.teamName=r.name;vm.tenant=e.getDynamicImageByPathNameAndLevel("/map/pointer_1.png");vm.close=function(){t.close()}}])}(),function(){appModule.controller("common.views.teams.modal.contact",["$scope","$uibModalInstance","team","officeAddressOutput","abp.services.app.contactForms","appSession","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt",function(n,t,i,r,u,f,e,o,s,h){vm=this;vm.team=i;vm.officeAddressOutput=r;vm.success=null;vm.busy=!1;vm.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",f.region.tenantFullName);vm.captchaKey=o;vm.showFullOfficePhone=!1;var c;n.contact={teamId:i.id,regionId:f.destinationRegion.id};vm.close=function(){t.dismiss("cancel")};h.displayCaptcha(f.region.id).success(function(n){vm.displayCaptcha=n});n.setCaptchaWidgetId=function(){c=___grecaptcha_cfg.count-1};vm.submit=function(){if(vm.displayCaptcha){if(s.getResponse(c)===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=s.getResponse(c)}vm.busy=!0;u.sendMessageForTeam(n.contact).success(function(n){vm.success=n.result}).finally(function(){n.contact.name="";n.contact.email="";n.contact.phone="";n.contact.comments="";n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();vm.busy=!1;e.registerHit({tenantId:f.region.tenantId,regionId:f.region.id,name:app.consts.hitsName.teamLead,type:app.consts.hitsType.lead,languageCode:abp.localization.currentLanguage.name,teamId:i.id})})};vm.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};vm.processSoftLead=function(){vm.showFullOfficePhone=!0;e.registerHit({tenantId:f.region.tenantId,regionId:f.region.id,name:app.consts.hitsName.teamSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,teamId:vm.team.id})}}])}(),function(){appModule.controller("common.views.termsofuse",["$scope","$state","$uibModal","$templateCache","uiGridConstants","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e){var o=this;o.page={name:"termsofuse",postingId:cmsData.postingId};f.registerHit({tenantId:e.region.tenantId,regionId:e.region.id,name:app.consts.hitsName.termsofuse,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.trainings.details",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.office","appSession","mapService","openstreetmapService","abp.services.app.hit","$sce","helper","$timeout","$window","$anchorScroll","$cookies","QueryStringService","abp.services.app.training",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b){var k=this,d,g;k.loading=!0;k.leadSourceId=3233;n.scrollTo=function(n){y(n)};k.training={};d=e.region.id;g=e.region.tenantId;k.iconLink=e.rootTemplatePath+"/images/icon-link.png";k.iconVideo=e.rootTemplatePath+"/images/icon-video.png";k.headOfficePhone=e.region.headOfficePhone;k.headOfficeEmail=e.region.headOfficeEmail;k.formattedRegionAddress=e.region.formattedRegionAddress;k.regionId=d;k.trainingDetailsForContact=null;k.processOffice=function(n){n.office!=null&&(k.office=n.office,k.officeHeaderAddress=n.officeHeaderAddress,k.officeAddress=n.officeAddress,k.listingCount=n.office.listingOfficeCount,k.trainingCount=n.office.trainingCount)};k.getMap=function(){(k.training.latitude||k.training.longitude)&&s.loadMap("map",k.training.latitude,k.training.longitude,15,!1,!1,!1,!1,!1,!1,!1)};k.getInclude=function(){return angular.isUndefined(k.showDeadTrainingPage)?e.region.tenantName.toLowerCase()==app.consts.tenantName.kellerWilliams?"~/App/common/views/trainings/partials/"+app.consts.tenantName.kellerWilliams+"/details.cshtml":e.region.tenantName.toLowerCase()==app.consts.tenantName.coldWellBanker?"~/App/common/views/trainings/partials/"+app.consts.tenantName.coldWellBanker+"/details.cshtml":"~/App/common/views/trainings/partials/"+app.consts.tenantName.skymarkRealty+"/details.cshtml":k.showDeadTrainingPage?"~/App/common/views/trainings/partials/deadTrainingPage.cshtml":"~/App/common/views/trainings/partials/details.cshtml"};k.getIncludeByName=function(n){return abp.rootTemplatePath+"views/trainings/partials/"+n+".cshtml"};n.finishLoading=function(){$("#map").hide()};k.openMap=function(){return};k.getRegionalSetting=function(n){for(var i,t=0;t<e.destinationRegionalSettings.length;t++)if(e.destinationRegionalSettings[t].name==n)return e.destinationRegionalSettings[t].type=="ListStringSettingValueDto"||e.destinationRegionalSettings[t].type=="ListIntSettingValueDto"?e.destinationRegionalSettings[t].output.values:e.destinationRegionalSettings[t].output.value;throw new Error("Can not find region setting "+n);};k.hideSoftLead=k.getRegionalSetting("Hide Soft Lead Functionality on Regional Website");k.displayLicenseAndCompanyName=k.getRegionalSetting("Display License Number & Company Name on Office Profile");k.showFullOfficePhone=k.hideSoftLead;k.openAgentModal=function(n){v.location.href="/"+n+"?contact=true"};k.openModal=function(){var n=r.open({animation:!0,templateUrl:"~/App/common/views/trainings/modal/training-contact-modal-dialog.cshtml",controller:"common.views.trainings.modal.contact as vm",size:"sm",resolve:{office:function(){return k.office},officeAddressOutput:function(){return k.officeAddressOutput},trainingDetailsForContact:function(){return k.trainingDetailsForContact},trainingDisplayImage:function(){return k.training.displayImage?k.training.displayImage:k.office.defaultImage}}});n.result.then(function(n){console.log(n)})};k.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};k.processSoftLead=function(){k.showFullOfficePhone=!0;h.registerHit({tenantId:g,regionId:d,name:app.consts.hitsName.officeSoftLead,type:app.consts.hitsType.softLead,languageCode:abp.localization.currentLanguage.name,officeId:k.office.id})};k.processTraining=function(n){k.training=n;k.training.officeId>0&&k.training.venueUrl!=null&&k.training.venueUrl!=""&&!k.training.venueUrl.includes("http")&&(k.training.venueUrl="http://"+k.training.venueUrl);k.training.externalLink==null||k.training.externalLink==""||k.training.externalLink.includes("http")||(k.training.externalLink="http://"+k.training.externalLink);k.training.youTubeLink==null||k.training.youTubeLink==""||k.training.youTubeLink.includes("http")||(k.training.youTubeLink="https://"+k.training.youTubeLink);k.trainingDetailsForContact={trainingId:k.training.id,trainingSourceId:k.training.officeId,trainingTitle:k.training.title,trainingDate:k.training.dateRange+" "+k.training.timeRange,trainingUrl:k.training.url}};k.getSimpleUrl=function(n){return n.replace("http://","").replace("https://","")};k.getTraining=function(){b.getTrainingDetailsRegional({regionId:d,tenantId:g,id:k.trainingId,friendlyId:null}).success(function(n){n==undefined?k.showDeadTrainingPage=!0:(k.processTraining(n),k.processOffice(n))}).error(function(n){console.log(n);k.trainings=[]}).finally(function(){k.loading=!1})};k.init=function(n){k.showDeadTrainingPage=!1;k.trainingId=n;k.getTraining()}}])}(),function(){appModule.controller("common.views.trainings.index",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.training","appSession","mapService","openstreetmapService","abp.services.app.hit","$sce","helper","$timeout","$window","$anchorScroll","$cookies","QueryStringService","abp.services.app.lookupLists","$location",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){function g(){b.showDeadTrainingPage=!1;b.search=w.getFilters(b.search);b.setupParams();b.getTrainings(!0)}var b=this,k,d;b.trainings=[];window.prerenderReady=!1;b.loading=!0;k=e.region.id;d=e.region.tenantId;b.regionId=k;b.search={officeId:null,cityUid:null,curPage:null};b.totalCount=0;b.pageSize=app.consts.grid.defaultPageSize;b.iconLink=e.rootTemplatePath+"/images/icon-link.png";b.iconVideo=e.rootTemplatePath+"/images/icon-video.png";b.getInclude=function(){return angular.isUndefined(b.showDeadTrainingPage)?e.region.tenantName.toLowerCase()==app.consts.tenantName.kellerWilliams?"~/App/common/views/trainings/partials/"+app.consts.tenantName.kellerWilliams+"/index.cshtml":e.region.tenantName.toLowerCase()==app.consts.tenantName.coldWellBanker?"~/App/common/views/trainings/partials/"+app.consts.tenantName.coldWellBanker+"/index.cshtml":"~/App/common/views/trainings/partials/"+app.consts.tenantName.skymarkRealty+"/index.cshtml":b.showDeadTrainingPage?"~/App/common/views/trainings/partials/deadTrainingPage.cshtml":"~/App/common/views/trainings/partials/index.cshtml"};b.getIncludeByName=function(n){return abp.rootTemplatePath+"views/trainings/partials/"+n+".cshtml"};b.doFilter=function(n){l.doFilter(b.search,n)};b.getSimpleUrl=function(n){return n.replace("http://","").replace("https://","")};b.reset=function(){b.search.officeId=null;b.search.cityUid=null;b.search.curPage=null;b.getTrainings(!1)};b.getTrainings=function(n){b.loading=!0;angular.forEach(b.search,function(n,t){b.doFilter(t)});b.skipCount=b.search.curPage?(b.search.curPage-1)*b.pageSize:0;f.getTrainingsRegional({regionId:k,tenantId:d,isoLanguageCode:abp.localization.currentLanguage.name,officeId:b.search.officeId,cityUid:b.search.cityUid,maxResultCount:b.pageSize,skipCount:b.skipCount}).success(function(t){b.trainings=t.training.items;b.totalCount=t.training.totalCount;n&&(b.availableOffices=t.offices.items,b.availableCities=t.cities.items)}).error(function(n){console.log(n)}).finally(function(){b.loading=!1})};b.setupParams=function(){var n=window.location.search.split("&");angular.forEach(n,function(n){var t=n.split("=");angular.forEach(b.search,function(n,i){t[0]==i&&(b.search[i]=t[1])})})};g()}])}(),function(){appModule.controller("common.views.trainings.trainingContact",["$scope","$state","$stateParams","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office",function(){var n=this;n.training=null}])}(),function(){appModule.controller("common.views.trainings.modal.contact",["$scope","$uibModalInstance","office","officeAddressOutput","abp.services.app.contactForms","appSession","abp.services.app.hit","captchaKey","vcRecaptchaService","abp.services.app.captchaAttempt","trainingDetailsForContact","trainingDisplayImage",function(n,t,i,r,u,f,e,o,s,h,c,l){vm=this;vm.office=i;vm.officeAddressOutput=r;vm.trainingDetailsForContact=c;vm.trainingDisplayImage=l;vm.displayImage=vm.office&&vm.office.defaultImage?vm.office.defaultImage:vm.trainingDisplayImage;vm.success=null;vm.busy=!1;vm.checkboxVerbiage=app.localize("website.GDPR.FormCheckbox",f.region.tenantFullName);vm.captchaKey=o;vm.showFullOfficePhone=!1;var a;n.contact={officeId:i?i.id:0,regionId:f.destinationRegion.id,trainingId:vm.trainingDetailsForContact.trainingId,trainingTitle:vm.trainingDetailsForContact.trainingTitle,trainingDate:vm.trainingDetailsForContact.trainingDate,trainingUrl:vm.trainingDetailsForContact.trainingUrl};vm.close=function(){t.dismiss("cancel")};h.displayCaptcha(f.region.id).success(function(n){vm.displayCaptcha=n});n.setCaptchaWidgetId=function(){a=___grecaptcha_cfg.count-1};vm.submit=function(){if(vm.displayCaptcha){if(s.getResponse(a)===""){abp.message.warn(app.localize("PleaseConfirmYouAreNotARobot"));return}n.contact.captcha=s.getResponse(a)}vm.busy=!0;u.sendMessageForTraining(n.contact).success(function(n){vm.success=n.result}).finally(function(){n.contact.name="";n.contact.email="";n.contact.phone="";n.contact.comments="";n.contactCreateForm.$setPristine();n.contactCreateForm.$setUntouched();vm.busy=!1})};vm.getPartialPhoneNumber=function(n){return n.length>5?n.substring(0,5):n};vm.processSoftLead=function(){vm.showFullOfficePhone=!0}}])}(),function(){appModule.controller("common.views.trainings.modal.trainingmap",["$scope","$uibModalInstance","training","address","appSession","helper",function(n,t,i,r,u,f){vm=this;console.log("Fix me: trainingmap.js");vm.center=new google.maps.LatLng(i.latitude,i.longitude);vm.address=r;vm.trainingImage=i.defaultImage;vm.phone=i.phone;vm.id=i.id;vm.title=i.title;vm.tenant=f.getDynamicImageByPathNameAndLevel("/map/pointer_1.png");vm.close=function(){t.close()}}])}(),function(){appModule.controller("common.views.videolar",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"videolar",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.dijital,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}(),function(){appModule.controller("common.views.why.index",["$scope","$state","$uibModal","$templateCache","abp.services.app.agent","abp.services.app.tenant","abp.services.app.session","uiGridConstants","abp.services.app.region","abp.services.app.office","abp.services.app.hit","appSession","helper",function(n,t,i,r,u,f,e,o,s,h,c,l){var a=this;a.page={name:"why",postingId:cmsData.postingId};c.registerHit({tenantId:l.region.tenantId,regionId:l.region.id,name:app.consts.hitsName.why,type:app.consts.hitsType.view,languageCode:abp.localization.currentLanguage.name})}])}();appModule.directive("featureTree",[function(){return{restrict:"E",template:'<div class="feature-tree"><\/div>',scope:{editData:"="},link:function(n,t){function c(){o&&i.jstree("destroy");o=!0;var t=_.map(n.editData.features,function(n){return{id:n.name,parent:n.parentName?n.parentName:"#",text:n.displayName,state:{opened:!0,selected:y(n.name)}}});i.on("ready.jstree",function(){u()}).on("redraw.jstree",function(){u()}).on("after_open.jstree",function(){u()}).on("create_node.jstree",function(){u()}).on("changed.jstree",function(n,t){var h,u,c,o,a;t.node&&(h=e,h||(e=!0),t.node.state.selected?(s(i.jstree("get_parent",t.node)),u=$.makeArray(i.jstree("get_children_dom",t.node)),i.jstree("select_node",u)):(u=$.makeArray(i.jstree("get_children_dom",t.node)),i.jstree("deselect_node",u)),h||(c=l(t.node.id),o=r(t.node.id),o&&(!o.inputType||o.inputType.name=="CHECKBOX")&&(a=i.jstree("is_checked",c)?"true":"false",f(t.node.id,a)),e=!1))}).jstree({core:{data:t},types:{"default":{icon:"fa fa-folder tree-item-icon-color icon-lg"},file:{icon:"fa fa-file tree-item-icon-color icon-lg"}},checkbox:{keep_selected_style:!1,three_state:!1,cascade:""},plugins:["checkbox","types"]})}function u(){i.find(".jstree-node").each(function(){var i=$(this),s=i.find(".jstree-anchor"),u=i.attr("id"),n=r(u),c=h(u)||"",e,t,o;if(n&&n.inputType&&n.inputType.name!="CHECKBOX")if(n.inputType.name=="SINGLE_LINE_STRING"){if(!i.find(".feature-tree-textbox").length){s.find(".jstree-checkbox").hide();e="text";n.inputType.validator&&n.inputType.validator.name=="NUMERIC"&&(e="number");t=$('<input class="feature-tree-textbox" type="'+e+'" />').val(c);e=="number"?(t.attr("min",n.inputType.validator.minValue),t.attr("max",n.inputType.validator.maxValue)):n.inputType.validator&&n.inputType.validator.name=="STRING"&&(n.inputType.validator.maxLength>0&&t.attr("maxlength",n.inputType.validator.maxLength),n.inputType.validator.minLength>0&&t.attr("required","required"),n.inputType.validator.regularExpression&&t.attr("pattern",n.inputType.validator.regularExpression));t.on("input propertychange paste",function(){a(u,t.val())?(f(u,t.val()),t.removeClass("feature-tree-textbox-invalid")):t.addClass("feature-tree-textbox-invalid")});t.appendTo(i)}}else n.inputType.name=="COMBOBOX"&&(i.find(".feature-tree-combobox").length||(s.find(".jstree-checkbox").hide(),o=$('<select class="feature-tree-combobox" />'),_.each(n.inputType.itemSource.items,function(n){$("<option><\/option>").attr("value",n.value).text(n.displayText).appendTo(o)}),o.val(c).on("change",function(){f(u,o.val())}).appendTo(i)))})}function l(n){return $("#"+n.replace(".","\\."))}function s(n){i.jstree("select_node",n,!0);var t=i.jstree("get_parent",n);t&&s(t)}function r(t){var i=_.find(n.editData.features,function(n){return n.name==t});return i||abp.log.warn("Could not find a feature by name: "+t),i}function h(t){var u=r(t),i;return u?(i=_.find(n.editData.featureValues,function(n){return n.name==t}),!i)?u.defaultValue:i.value:""}function a(n,t){var u=r(n),i,f,o,e;if(!u||!u.inputType||!u.inputType.validator)return!0;if(i=u.inputType.validator,i.name=="STRING"){if(t==undefined||t==null)return i.allowNull;if(typeof t!="string"||i.minLength>0&&t.length<i.minLength||i.maxLength>0&&t.length>i.maxLength)return!1;if(i.regularExpression)return new RegExp(i.regularExpression).test(t)}else if(i.name=="NUMERIC"&&((f=parseInt(t),isNaN(f))||(o=i.minValue,o>f)||(e=i.maxValue,e>0&&f>e)))return!1;return!0}function v(){return i.find(".jstree-node").each(function(){var t=$(this),u=t.attr("id"),n=r(u),e;n&&(!n.inputType||n.inputType.name=="CHECKBOX")&&(e=i.jstree("is_checked",t)?"true":"false",f(u,e))}),i.find(".feature-tree-textbox-invalid").length<=0}function f(t,i){var r=_.find(n.editData.featureValues,function(n){return n.name==t});r&&n.$root.safeApply(function(){r.value=i})}function y(n){var t=h(n);return t.toLowerCase()=="true"}var i=$(t).find(".feature-tree"),o=!1,e=!1;n.$watch("editData",function(){n.editData&&(n.editData.isValid=function(){return v()},c())})}}}]),function(){appModule.controller("host.views.editions.createOrEditModal",["$scope","$uibModalInstance","abp.services.app.edition","editionId",function(n,t,i,r){function f(){i.getEditionForEdit({id:r}).success(function(n){u.edition=n.edition;u.featureEditData={features:n.features,featureValues:n.featureValues}})}var u=this;u.saving=!1;u.edition=null;u.featureEditData=null;u.save=function(){if(!u.featureEditData.isValid()){abp.message.warn(app.localize("InvalidFeaturesWarning"));return}u.saving=!0;i.createOrUpdateEdition({edition:u.edition,featureValues:u.featureEditData.featureValues}).success(function(){abp.notify.info(app.localize("SavedSuccessfully"));t.close()}).finally(function(){u.saving=!1})};u.cancel=function(){t.dismiss()};f()}])}(),function(){appModule.controller("host.views.editions.index",["$scope","$uibModal","uiGridConstants","abp.services.app.edition",function(n,t,i,r){function f(n){var i=t.open({templateUrl:"~/App/host/views/editions/createOrEditModal.cshtml",controller:"host.views.editions.createOrEditModal as vm",backdrop:"static",resolve:{editionId:function(){return n}}});i.result.then(function(){u.getEditions()})}var u=this;n.$on("$viewContentLoaded",function(){App.initAjax()});u.loading=!1;u.permissions={create:abp.auth.hasPermission("Pages.Editions.Create"),edit:abp.auth.hasPermission("Pages.Editions.Edit"),"delete":abp.auth.hasPermission("Pages.Editions.Delete")};u.editionGridOptions={enableHorizontalScrollbar:i.scrollbars.WHEN_NEEDED,enableVerticalScrollbar:i.scrollbars.WHEN_NEEDED,appScopeProvider:u,columnDefs:[{name:app.localize("Actions"),width:120,cellTemplate:'<div class="ui-grid-cell-contents">  <div class="btn-group dropdown" uib-dropdown="">    <button class="btn btn-xs btn-primary blue" uib-dropdown-toggle="" aria-haspopup="true" aria-expanded="false"><i class="fa fa-cog"><\/i> '+app.localize("Actions")+' <span class="caret"><\/span><\/button>    <ul uib-dropdown-menu>      <li><a ng-if="grid.appScope.permissions.edit" ng-click="grid.appScope.editEdition(row.entity)">'+app.localize("Edit")+'<\/a><\/li>      <li><a ng-if="grid.appScope.permissions.delete" ng-click="grid.appScope.deleteEdition(row.entity)">'+app.localize("Delete")+"<\/a><\/li>    <\/ul>  <\/div><\/div>"},{name:app.localize("EditionName"),field:"displayName"},{name:app.localize("CreationTime"),field:"creationTime",cellFilter:"momentFormat: 'L'"}],data:[]};u.getEditions=function(){u.loading=!0;r.getEditions({}).success(function(n){u.editionGridOptions.data=n.items}).finally(function(){u.loading=!1})};u.createEdition=function(){f(null)};u.editEdition=function(n){f(n.id)};u.deleteEdition=function(n){abp.message.confirm(app.localize("EditionDeleteWarningMessage",n.displayName),function(t){t&&r.deleteEdition({id:n.id}).success(function(){u.getEditions();abp.notify.success(app.localize("SuccessfullyDeleted"))})})};u.getEditions()}])}(),function(){appModule.controller("host.views.maintenance.index",["$scope","$window","abp.services.app.caching","abp.services.app.webLog",function(n,t,i,r){function f(){var i=angular.element(t).height(),n=$(".full-height").height(),r=i-n,u=n+r;$(".full-height").css("height",u-350+"px")}var u=this;n.$on("$viewContentLoaded",function(){App.initAjax()});u.loading=!1;u.caches=null;u.logs="";u.getCaches=function(){u.loading=!0;i.getAllCaches().success(function(n){u.caches=n.items}).finally(function(){u.loading=!1})};u.clearCache=function(n){i.clearCache({id:n}).success(function(){abp.notify.success(app.localize("CacheSuccessfullyCleared"))})};u.clearAllCaches=function(){i.clearAllCaches().success(function(){abp.notify.success(app.localize("AllCachesSuccessfullyCleared"))})};u.getWebLogs=function(){r.getLatestWebLogs({}).success(function(n){u.logs=u.getFormattedLogs(n.latesWebLogLines);f()})};u.downloadWebLogs=function(){r.downloadWebLogs({}).success(function(n){app.downloadTempFile(n)})};u.getFormattedLogs=function(n){var t="";return angular.forEach(n,function(n){t+='<span class="log-line">'+_.escape(n).replace("DEBUG",'<span class="label label-default">DEBUG<\/span>').replace("INFO",'<span class="label label-info">INFO<\/span>').replace("WARN",'<span class="label label-warning">WARN<\/span>').replace("ERROR",'<span class="label label-danger">ERROR<\/span>').replace("FATAL",'<span class="label label-danger">FATAL<\/span>')+"<\/span>"}),t};angular.element(t).bind("resize",function(){f()});u.init=function(){u.getCaches();u.getWebLogs()};u.init()}])}(),function(){appModule.controller("host.views.settings.index",["$scope","appSession","abp.services.app.hostSettings","abp.services.app.commonLookup",function(n,t,i,r){var u=this;n.$on("$viewContentLoaded",function(){App.initAjax()});u.loading=!1;u.settings=null;u.editions=[];u.testEmailAddress=t.user.emailAddress;u.getSettings=function(){u.loading=!0;i.getAllSettings().success(function(n){u.settings=n}).finally(function(){u.loading=!1})};u.saveAll=function(){i.updateAllSettings(u.settings).success(function(){abp.notify.info(app.localize("SavedSuccessfully"))})};u.sendTestEmail=function(){i.sendTestEmail({emailAddress:u.testEmailAddress}).success(function(){abp.notify.info(app.localize("TestEmailSentSuccessfully"))})};u.getEditionValue=function(n){return n.value?parseInt(n.value):n.value};u.getEditions=function(){r.getEditionsForCombobox({}).success(function(n){u.editions=n.items;u.editions.unshift({value:null,displayText:app.localize("NotAssigned")})})};u.init=function(){u.getEditions();u.getSettings()};u.init()}])}(),function(){appModule.controller("host.views.tenants.createModal",["$scope","$uibModalInstance","abp.services.app.tenant","abp.services.app.commonLookup",function(n,t,i,r){var u=this;u.saving=!1;u.setRandomPassword=!0;u.editions=[];u.tenant={isActive:!0,shouldChangePasswordOnNextLogin:!0,sendActivationEmail:!0,editionId:0};u.getEditionValue=function(n){return parseInt(n.value)};u.save=function(){u.setRandomPassword&&(u.tenant.adminPassword=null);u.tenant.editionId==0&&(u.tenant.editionId=null);u.saving=!0;i.createTenant(u.tenant).success(function(){abp.notify.info(app.localize("SavedSuccessfully"));t.close()}).finally(function(){u.saving=!1})};u.cancel=function(){t.dismiss()};r.getEditionsForCombobox({}).success(function(n){u.editions=n.items;u.editions.unshift({value:"0",displayText:app.localize("NotAssigned")})})}])}(),function(){appModule.controller("host.views.tenants.editModal",["$scope","$uibModalInstance","abp.services.app.tenant","abp.services.app.commonLookup","tenantId",function(n,t,i,r,u){function e(){r.getEditionsForCombobox({}).success(function(n){f.editions=n.items;f.editions.unshift({value:"0",displayText:app.localize("NotAssigned")})});i.getTenantForEdit({id:u}).success(function(n){f.tenant=n;f.tenant.editionId=f.tenant.editionId||0})}var f=this;f.saving=!1;f.tenant=null;f.editions=[];f.save=function(){f.tenant.editionId==0&&(f.tenant.editionId=null);f.saving=!0;i.updateTenant(f.tenant).success(function(){abp.notify.info(app.localize("SavedSuccessfully"));t.close()}).finally(function(){f.saving=!1})};f.cancel=function(){t.dismiss()};f.getEditionValue=function(n){return parseInt(n.value)};e()}])}(),function(){appModule.controller("host.views.tenants.featuresModal",["$scope","$uibModalInstance","abp.services.app.tenant","tenant",function(n,t,i,r){function f(){i.getTenantFeaturesForEdit({id:u.tenant.id}).success(function(n){u.featureEditData=n})}var u=this;u.saving=!1;u.resettingFeatures=!1;u.tenant=r;u.featureEditData=null;u.resetFeatures=function(){u.resettingFeatures=!0;i.resetTenantSpecificFeatures({id:u.tenant.id}).success(function(){abp.notify.info(app.localize("ResetSuccessfully"));f()}).finally(function(){u.resettingFeatures=!1})};u.save=function(){if(!u.featureEditData.isValid()){abp.message.warn(app.localize("InvalidFeaturesWarning"));return}u.saving=!0;i.updateTenantFeatures({id:u.tenant.id,featureValues:u.featureEditData.featureValues}).success(function(){abp.notify.info(app.localize("SavedSuccessfully"));t.close()}).finally(function(){u.saving=!1})};u.cancel=function(){t.dismiss()};f()}])}(),function(){appModule.controller("host.views.tenants.index",["$scope","$stateParams","$uibModal","uiGridConstants","abp.services.app.tenant","abp.services.app.commonLookup","lookupModal",function(n,t,i,r,u,f,e){var o=this,s;n.$on("$viewContentLoaded",function(){App.initAjax()});o.loading=!1;o.filterText=t.filterText||null;o.permissions={create:abp.auth.hasPermission("Pages.Tenants.Create"),edit:abp.auth.hasPermission("Pages.Tenants.Edit"),changeFeatures:abp.auth.hasPermission("Pages.Tenants.ChangeFeatures"),impersonation:abp.auth.hasPermission("Pages.Tenants.Impersonation"),"delete":abp.auth.hasPermission("Pages.Tenants.Delete")};s={skipCount:0,maxResultCount:app.consts.grid.defaultPageSize,sorting:null};o.tenantGridOptions={enableHorizontalScrollbar:r.scrollbars.WHEN_NEEDED,enableVerticalScrollbar:r.scrollbars.WHEN_NEEDED,paginationPageSizes:app.consts.grid.defaultPageSizes,paginationPageSize:app.consts.grid.defaultPageSize,useExternalPagination:!0,useExternalSorting:!0,appScopeProvider:o,rowTemplate:'<div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'text-muted\': !row.entity.isActive }"  ui-grid-cell><\/div>',columnDefs:[{name:app.localize("Actions"),enableSorting:!1,width:200,cellTemplate:'<div class="ui-grid-cell-contents">  <div class="btn-group dropdown" uib-dropdown="">    <button class="btn btn-xs btn-primary blue" uib-dropdown-toggle="" aria-haspopup="true" aria-expanded="false"><i class="fa fa-cog"><\/i> '+app.localize("Actions")+' <span class="caret"><\/span><\/button>    <ul uib-dropdown-menu>      <li><a ng-if="grid.appScope.permissions.impersonation" ng-click="grid.appScope.impersonate(row.entity)">'+app.localize("LoginAsThisTenant")+'<\/a><\/li>      <li><a ng-if="grid.appScope.permissions.edit" ng-click="grid.appScope.editTenant(row.entity)">'+app.localize("Edit")+'<\/a><\/li>      <li><a ng-if="grid.appScope.permissions.changeFeatures" ng-click="grid.appScope.editFeatures(row.entity)">'+app.localize("Features")+'<\/a><\/li>      <li><a ng-if="grid.appScope.permissions.delete" ng-click="grid.appScope.deleteTenant(row.entity)">'+app.localize("Delete")+"<\/a><\/li>    <\/ul>  <\/div><\/div>"},{name:app.localize("TenancyCodeName"),field:"tenancyName"},{name:app.localize("Name"),field:"name"},{name:app.localize("Edition"),field:"editionDisplayName"},{name:app.localize("Active"),field:"isActive",maxWidth:100,cellTemplate:'<div class="ui-grid-cell-contents">  <span ng-show="row.entity.isActive" class="label label-success">'+app.localize("Yes")+'<\/span>  <span ng-show="!row.entity.isActive" class="label label-default">'+app.localize("No")+"<\/span><\/div>"},{name:app.localize("CreationTime"),field:"creationTime",cellFilter:"momentFormat: 'L'"}],onRegisterApi:function(t){n.gridApi=t;n.gridApi.core.on.sortChanged(n,function(n,t){s.sorting=t.length&&t[0].field?t[0].field+" "+t[0].sort.direction:null;o.getTenants()});t.pagination.on.paginationChanged(n,function(n,t){s.skipCount=(n-1)*t;s.maxResultCount=t;o.getTenants()})},data:[]};o.permissions.edit||o.permissions.delete||o.tenantGridOptions.columnDefs.shift();o.getTenants=function(){o.loading=!0;u.getTenants({skipCount:s.skipCount,maxResultCount:s.maxResultCount,sorting:s.sorting,filter:o.filterText}).success(function(n){o.tenantGridOptions.totalItems=n.totalCount;o.tenantGridOptions.data=n.items}).finally(function(){o.loading=!1})};o.impersonate=function(n){e.open({title:app.localize("SelectAUser"),serviceMethod:f.findUsers,extraFilters:{tenantId:n.id},callback:function(t){abp.ajax({url:abp.appPath+"Account/Impersonate",data:JSON.stringify({tenantId:n.id,userId:t.value})})}})};o.editTenant=function(n){var t=i.open({templateUrl:"/App/host/views/tenants/editModal.cshtml",controller:"host.views.tenants.editModal as vm",backdrop:"static",resolve:{tenantId:function(){return n.id}}});t.result.then(function(){o.getTenants()})};o.createTenant=function(){var n=i.open({templateUrl:"/App/host/views/tenants/createModal.cshtml",controller:"host.views.tenants.createModal as vm",backdrop:"static"});n.result.then(function(){o.getTenants()})};o.deleteTenant=function(n){abp.message.confirm(app.localize("TenantDeleteWarningMessage",n.tenancyName),function(t){t&&u.deleteTenant({id:n.id}).success(function(){o.getTenants();abp.notify.success(app.localize("SuccessfullyDeleted"))})})};o.editFeatures=function(n){i.open({templateUrl:"~/App/host/views/tenants/featuresModal.cshtml",controller:"host.views.tenants.featuresModal as vm",backdrop:"static",resolve:{tenant:function(){return n}}})};o.getTenants()}])}()