1import{a as L,d as it,f as T}from"./chunk-DVEBFLUF.js";import{a as et}from"./chunk-WZGCHPLO.js";import{a as rt}from"./chunk-MHAWMB6U.js";import{a as V}from"./chunk-HW6JDVEM.js";import{a as X}from"./chunk-7GR4QK3H.js";import{a as tt}from"./chunk-4G7TLVZ5.js";import{a as Z,c as v}from"./chunk-CVSOAM5D.js";import{d as H}from"./chunk-TUMZ3SKI.js";import"./chunk-LYLFRCIE.js";import"./chunk-QPSWTSIM.js";import{a as at,d as B}from"./chunk-JT6ASDIM.js";import{i as Y,l as q,n as $}from"./chunk-LJVWLVVB.js";import"./chunk-DP76YC53.js";import{x as z}from"./chunk-SW2PCWOQ.js";import{$c as W,Bc as J,Cc as Q,Db as A,I as F,Jc as O,Mc as R,N as k,Qb as D,Vb as p,W as U,Wb as d,a as f,e as ot,gc as b,na as K,ob as C,pb as c,qc as u,rc as E,sa as N,sc as M,xa as G}from"./chunk-FFQH2GOQ.js";var l=ot(at());var st=(()=>{let r=class r{constructor(t){this.apiService=t}getSavedSearchesStats(t,e){return this.apiService.get("api/v1/saved-searches/".concat(t,"/stats"),e)}};r.\u0275fac=function(e){return new(e||r)(N(H))},r.\u0275prov=K({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();function lt(i,r){i&1&&(p(0,"div",0)(1,"div",1)(2,"span",2),u(3,"Loading..."),d()()())}function pt(i,r){if(i&1&&(p(0,"h2",4),u(1),d()),i&2){let a=b(4);C(),E(a.options==null?null:a.options.title)}}function dt(i,r){if(i&1&&(p(0,"h5",4),u(1),d()),i&2){let a=b(4);C(),E(a.options==null?null:a.options.title)}}function ut(i,r){if(i&1&&(A(0,pt,2,1,"h2",4)(1,dt,2,1,"h5",4),p(2,"div",3)(3,"div",5)(4,"div",6)(5,"div",7)(6,"div",8),u(7),d(),p(8,"div",9),u(9,"Homes Listed"),d()(),p(10,"div",7)(11,"div",8),u(12),d(),p(13,"div",9),u(14,"Avg. Days on Site"),d()(),p(15,"div",7)(16,"div",8),u(17),O(18,"currency"),d(),p(19,"div",9),u(20,"Avg. $ / Sq.Ft."),d()(),p(21,"div",7)(22,"div",8),u(23),O(24,"currency"),d(),p(25,"div",9),u(26,"Med. List Price"),d()()()()()),i&2){let a=b(3);D(a.isPropertyPage?1:0),C(7),E(a.stats.count),C(5),E(a.stats.avg_dom),C(5),M(" ",R(18,5,a.stats.avg_price_per_sq_ft,"USD","symbol","1.0-0")," "),C(6),M(" ",R(24,10,a.stats.avg_price,"USD","symbol","1.0-0")," ")}}function ht(i,r){if(i&1&&A(0,ut,27,15,"div",3),i&2){let a=b(2);D(a.stats?0:-1)}}function mt(i,r){if(i&1&&A(0,lt,4,0,"div",0)(1,ht,1,1),i&2){let a=b();D(a.loaders.loading?0:1)}}var Mt=(()=>{let r=class r{constructor(t,e,o,n,s,m,S,y,P,g,_,x){this.savedSearchService=t,this.metaService=e,this.priceFormatPipe=o,this.route=n,this.searchService=s,this.propertyService=m,this.cd=S,this.queryParamService=y,this.activatedRoute=P,this.loadingCoordinatorService=g,this.router=_,this.globalService=x,this.currentDate=new Date,this.isPropertyPage=!1,this.postDataKeys=Z,this.queryParams=null,this.previousUrl=null,this.subscriptions={pageSettings:null,url:null,currentProperties:null,reloadProperties:null},this.loaders={loading:!0},this.hideMarketStats=!1}ngOnInit(){this.checkIfPropertyPage(),this.routerSubscription=this.router.events.subscribe(t=>{t instanceof Y&&this.checkIfPropertyPage()}),this.subscriptions.currentProperties=this.propertyService.currentProperties.subscribe({next:t=>{t.length===0?this.hideMarketStats=!0:this.hideMarketStats=!1}}),this.subscriptions.reloadProperties=this.propertyService.reloadProperties.subscribe(()=>{this.getSearchStats()}),this.subscriptions.url=this.route.queryParams.pipe(k(),F(()=>{var e,o,n,s,m,S,y,P,g,_,x,I;let t=(e=this.router.url)==null?void 0:e.split("?")[0];return(t==null?void 0:t.search("/home/"))!==-1&&((m=(s=(n=(o=this.options)==null?void 0:o.search_params)==null?void 0:n.locations)==null?void 0:s[0])!=null&&m.city?t=(_="/".concat(v.urlFriendlyString((g=(P=(y=(S=this.options)==null?void 0:S.search_params)==null?void 0:y.locations)==null?void 0:P[0])==null?void 0:g.city)))==null?void 0:_.toLowerCase():t="/homes"),this.previousUrl==null?(this.previousUrl=t,!0):this.previousUrl!==t?(this.previousUrl=t,!1):!((I=(x=this.activatedRoute.snapshot.data)==null?void 0:x.response)!=null&&I.propertyDetailsResponse&&this.stats)})).subscribe(([t])=>{var s;if(this.queryParamService.getQueryParams()&&(0,l.isEqual)(t,this.queryParamService.getQueryParams())&&this.stats)return;let e=this.queryParams?(0,l.cloneDeep)(this.queryParams):null;if((0,l.isEqual)(e,t))return;let o=(0,l.omit)(t,"page"),n=e?(0,l.omit)(e,"page"):null;if(!(0,l.isEqual)(o,n)){if(this.queryParams=(0,l.cloneDeep)(t),t.search_id){(s=this.subscriptions.searchResult)==null||s.unsubscribe(),this.subscriptions.searchResult=this.searchService.searchResult.subscribe(m=>
1{m&&this.getSearchStats()});return}this.getSearchStats()}})}getSearchStats(){var S,y,P,g,_,x,I,w;if(!this.options)return;let t={};this.loaders.loading=!0;let e={};(P=(y=(S=this.searchService)==null?void 0:S.searchResult)==null?void 0:y.value)!=null&&P.search&&(e=f(f({},e),this.searchService.searchResult.value.search)),(g=this.options)!=null&&g.search_params&&(e=f(f({},e),v.formatKeywordGroups((0,l.cloneDeep)(this.options.search_params))));let o=(0,l.cloneDeep)(this.queryParams),n=this.searchParamsForPopularSearches();o!=null&&o.locations&&(o.locations=JSON.parse(o.locations)),e=f(f(f({},n),e),o),e=v.formatPropertyTypes(e);for(let[h,j]of Object.entries(this.postDataKeys))e[h]?(t[h]=v.tryParseJSON(e[h]),typeof v.tryParseJSON(e[h])=="string"&&Array.isArray(j)&&(t[h]=[v.tryParseJSON(e[h])])):t[h]=j;let s=this.formatSearchParameters(t);((_=this.globalService.closedPropertiesEnabled.value)!=null?_:!1)&&((I=(x=this.router.url)==null?void 0:x.split("?")[0])==null?void 0:I.endsWith("/sold"))?s.statuses=["Closed"]:this.globalService.includeClosedListings.value&&!Array.isArray(s.statuses)&&(s.statuses=[...(w=this.postDataKeys.statuses)!=null?w:[],"Closed"]),this.propertyService.searchStats(s).pipe(U(()=>{this.loaders.loading=!1,this.loadingCoordinatorService.markAsLoaded()})).subscribe({next:h=>{var j;this.cd.detectChanges(),this.stats=(j=h.body)==null?void 0:j.data.stats,this.setMetaTitle()},error:h=>{console.error(h)}})}formatSearchParameters(t){let e=(0,l.cloneDeep)(t),o=it;if(Array.isArray(e.statuses)){let s=[];t.statuses.forEach(m=>{o[m]&&(s=[...s,...o[m]])}),e.statuses=s}let n=e.foreclosures;return typeof n=="string"?e.foreclosures=[n.trim()]:Array.isArray(n)?e.foreclosures=n.filter(s=>!!s).map(s=>s.trim()):e.foreclosures=[],v.formatKeywordGroups(e),e}searchParamsForPopularSearches(){let t=this.route.snapshot.url.map(e=>e.path);return Object.keys(T).includes(t==null?void 0:t[1])?T[t[1]]:{}}setMetaTitle(){if(!this.stats)return;let t={COUNT:this.stats.count.toString(),AVG_PRICE:this.stats.avg_price!==void 0&&this.stats.avg_price!==null?this.priceFormatPipe.transform(this.stats.avg_price,!0):""};this.metaService.applyStatsPlaceholders(t)}ngOnDestroy(){this.routerSubscription&&this.routerSubscription.unsubscribe(),Object.values(this.subscriptions).forEach(t=>t==null?void 0:t.unsubscribe())}checkIfPropertyPage(){let t=this.router.url,e=/\/home\/[\w-]+-\d{5,}/;this.isPropertyPage=e.test(t)}};r.\u0275fac=function(e){return new(e||r)(c(st),c(rt),c(L),c(q),c(X),c(V),c(W),c(et),c(q),c(tt),c($),c(B))},r.\u0275cmp=G({type:r,selectors:[["app-property-stats-listing"]],inputs:{options:"options"},standalone:!0,features:[J([L]),Q],decls:1,vars:1,consts:[[1,"loader-container"],["role","status",1,"spinner-border","text-primary","loader-small"],[1,"visually-hidden"],[1,"card","mt-3","rounded-1","mb-0"],[1,"fw-semibold","lh-1","m-0","fs-20"],[1,"card-body","p-4","p-md-5"],[1,"row"],[1,"col"],[1,"stat-txt","fw-bold"],[1,"fs-13","text-secondary"]],template:function(e,o){e&1&&A(0,mt,2,1),e&2&&D(o.hideMarketStats?-1:0)},dependencies:[z],styles:[".loader-container[_ngcontent-%COMP%]{width:100%;min-height:200px;display:flex;justify-content:center;align-items:center}.stat-txt[_ngcontent-%COMP%]{font-size:20px}@media (min-width: 768px){.stat-txt[_ngcontent-%COMP%]{font-size:22px}}\n/*# sourceMappingURL=property-listing-stats.component-ZYVGA3LY.css.map */"]});let i=r;return i})();export{Mt as PropertyListingStatsComponent}; 2//# sourceMappingURL=chunk-7VFZONHH.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.