Plugin Directory

Changeset 3335283


Ignore:
Timestamp:
07/28/2025 10:36:30 AM (7 months ago)
Author:
loftylisting
Message:

update code to trunk

Location:
lofty-idx/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • lofty-idx/trunk/assets/listing.js

    r3333213 r3335283  
    11import{u as x,d as he,h as G,g as we,o as Le,i as te,_ as J}from"./_plugin-vue_export-helper.bB-lvPOu.js";import{c as Ve}from"./module.CKjUdtPN.js";import{r as y,c as U,a as W,b as ke,o as d,d as _,w as se,e as a,t as S,u as c,f as q,g as h,h as H,F as $,n as ge,i as Oe,j as L,k as Ge,l as $e,m as Y,p as pe,q as R,v as Se,s as Pe,x as z,y as B,z as j,A as Ne,B as Ce,C as be,T as me,D as re,E as Me,G as De}from"./vendor.DSMCY3-_.js";import{i as je}from"./index.C_5yu3Gg.js";import{s as ze}from"./loading.BdqyMKJZ.js";import{m as Be,l as xe,_ as Je}from"./index.D1LZflJ-.js";import{g as Fe,f as Ze}from"./house-format.CGUVCimM.js";import{c as qe,v as Ke}from"./verify-email.CS8uhOrR.js";import{s as Te,c as We}from"./index.B6VbAP4g.js";import{c as He,_ as Ye,a as Qe}from"./mobileFilter.YOw-E2qB.js";import{_ as Ie}from"./index.Ca0KQw1k.js";import{P as Xe}from"./index.BPxU_3zo.js";import{_ as et}from"./index.BIsjoQ8l.js";import{p as tt}from"./standard.CXwndxZu.js";import{M as fe}from"./marker.IEnWk-Xb.js";import{d as Ue}from"./outsideclick.Bw_hMuzW.js";import{s as ot}from"./service.DFLbHlSk.js";import{u as _e}from"./user.B_wb9Yeq.js";import{l as st}from"./popup-trigger.Dcnct9fd.js";import{a as it}from"./auto-login.C1f3j8uL.js";import{a as at,s as nt}from"./popup-mls.BtxMjRiY.js";import"./date-format.BrUodQAJ.js";import"./index.B1jQkB8N.js";import"./index.DAwEVGKX.js";import"./number-format.CLdvQh6j.js";import"./google.COqmJ1I4.js";import"./index.CblVywxl.js";import"./useConfirm.DafTdZE0.js";const Re=x.getTimeZone(),ie={};function lt(t){const e={cancelList:null,cancelMap:null,module:t,hasMap:y(!0),showMap:y(!x.isMobile),featureListingName:y(""),listingType:U(()=>e.featureListingName.value&&!e.sold.value?"featured-listing":e.sold.value?"sold-listing":""),counts:y(0),totalPage:y(0),searchType:y("All"),listings:y([]),mlsList:W([]),listingSort:y("RELEVANCE"),currPage:y(1),pageSize:y(12),address:y(""),condition:W({}),uiConfig:W({}),sold:y(!1),map:y(null),zoom:y(14),mapSyncList:y(!1),rect:null,mapSyncType:y(""),mapPath:y(""),needMapPath:U(()=>["mapArea","polygon"].includes(e.mapSyncType.value)),mapRadius:y([]),polygonPath:y([]),markerData:W({aggregation:[],house:[],school:[],activeHouse:null,activeHouseKey:1}),showSchool:y(!1),schoolData:{},drawing:y(!1),geometry:y([]),shortCodeConfig:y({}),isShortCode:U(()=>!!e.shortCodeConfig.value.layout)},l={searchList:he(async function(){try{e.cancelList&&e.cancelList.cancel("search-list canceled due to new request."),e.cancelList=ke.CancelToken.source();const o={condition:JSON.stringify(n.formatCondition()),pageSize:e.pageSize.value,page:e.currPage.value,currPage:e.currPage.value,listingSort:e.listingSort.value,listingType:e.listingType.value,featureListingName:e.featureListingName.value,timeline:!0,mls_list_id:JSON.stringify(e.mlsList),uiConfig:JSON.stringify(e.uiConfig),timezone:Re};if(e.mapSyncList.value){let m=n.formatCondition();if(e.mapSyncType.value==="radius")m.location={mapRadius:e.mapRadius.value};else if(e.needMapPath.value&&(m.location={mapPath:e.mapPath.value},!e.mapPath.value))return;o.condition=JSON.stringify(m)}const s={action:"lofty_idx_api",data:o,cancelToken:e.cancelList.token},i=e.module.$(".lofty-listing"),u=ze(i);i.classList.add("lofty-empty-listing"),n.asyncListConditionToUrl(o),console.log("searchList");const g=await G.get("/search/realTimeListings",s);u(),i.innerHTML=g.data.html,e.totalPage.value=g.data.totalPage,e.counts.value=g.data.counts,e.listings.value=g.data.listings,e.searchType.value=g.data.searchType,i.classList.remove("lofty-empty-listing"),l.addCardEvents()}catch{}},300),searchMap:he(async function(){if(!(!e.showMap.value||!e.map.value||!Number.isInteger(e.zoom.value)))try{e.cancelMap&&e.cancelMap.cancel("search-map canceled due to new request."),e.cancelMap=ke.CancelToken.source(),e.mapSyncList.value&&e.needMapPath.value&&(await l.getMapPath(),e.currPage.value=1,l.searchList());const o={mobile:x.isMobile,mapSearch:!0,layoutType:"map",listingSort:e.listingSort.value,listingType:e.listingType.value,featureListingName:e.featureListingName.value,zoom:e.zoom.value,rect:n.getRect(),condition:JSON.stringify(n.formatCondition()),timezone:Re};n.formatLocation(o);const s={action:"lofty_idx_api",data:o,cancelToken:e.cancelMap.token};l.searchSchool(e.schoolData),n.asyncMapConditionToUrl(),console.log("searchMap");const i=await G.get("/search/realTimeListings",s);e.markerData.aggregation=n.dealAggregationData(i.data.aggregation||[]),e.markerData.house=n.dealHouseData(i.data.house||[]),e.markerData.activeHouse=null,e.markerData.activeHouseKey=Date.now()}catch{}},300),searchSchool:he(async function(o){if(e.showSchool.value){e.schoolData=o;const s={...o,condition:JSON.stringify(n.formatCondition()),zoom:e.zoom.value,rect:n.getRect(),mapSearch:!1,t:Date.now()};if(e.mapSyncList.value){let u=n.formatCondition();u.location={},s.condition=JSON.stringify(u),n.formatLocation(s)}e.markerData.school=[],console.log("searchSchool");const i=await G.get("/search/schools",{data:s});i&&i.data&&(e.markerData.school=i.data.map(u=>(u.key=`school-${u.latitude}${u.longitude}${Date.now()}`,u.lat=+u.latitude,u.lng=+u.longitude,u)))}},300),async getMapPath(){const o={data:{mapPointList:Be.getFormatBounds(e.map.value)}};e.mapSyncType.value==="polygon"&&(o.data.mapPointList=e.polygonPath.value);const s=await G.post("/search/mapPath",o);e.mapPath.value=s.data.regionId},removeMapTag(){console.log("removeMapTag"),e.mapSyncList.value=!1,e.mapSyncType.value="",e.mapPath.value=null,e.polygonPath.value=[],e.mapRadius.value=[]},addCardEvents(){const o=t.$all(".lofty-listing .lofty-house-item");Array.from(o).forEach(s=>{const i=s.querySelector(".collect-heart");i&&(i.onclick=()=>{const g=s.getAttribute("house-id"),m=i.classList.contains("lofty-icon-heart-fill");qe(g,m,()=>{m?(i.classList.remove("lofty-icon-heart-fill"),i.classList.add("lofty-icon-heart")):(i.classList.remove("lofty-icon-heart"),i.classList.add("lofty-icon-heart-fill"))})});const u=s.querySelector(".lofty-house-login-box");u&&(u.querySelector(".lofty-register")&&(u.querySelector(".lofty-register").onclick=()=>{Te(()=>{window.location.reload()},"","register")}),u.querySelector(".lofty-login")&&(u.querySelector(".lofty-login").onclick=()=>{Te(()=>{window.location.reload()},"","login")}),u.querySelector(".lofty-verify")&&(u.querySelector(".lofty-verify").onclick=()=>{Ke()}))})}},n={formatCondition(){let o={};for(let s in e.condition){let i=e.condition[s];e.uiConfig[s]&&e.uiConfig[s].sqft==="acre"&&(i=i.split(",").map(u=>+u?+u*43560:"").toString()),je(i)&&(o[s]=i)}if(e.address.value="",o.location&&e.mapSyncList.value===!1){const s=Object.values(o.location).reduce((i,u)=>i.concat(u),[]);s.length===1&&(e.address.value=s[0].split(",")[0])}return o},formatLocation(o){if(e.mapSyncType.value==="polygon"){let s=n.formatCondition();s.location={mapPath:e.mapPath.value},o.condition=JSON.stringify(s)}else if(e.mapSyncType.value==="radius"){let s=n.formatCondition();s.location={mapRadius:e.mapRadius.value},o.condition=JSON.stringify(s)}},asyncListConditionToUrl(o){if(e.isShortCode.value)return;let s=window.location.pathname,i=we();Object.entries(o).forEach(([u,g])=>{let m=g;typeof g=="object"&&(m=JSON.stringify(g)),(u==="uiConfig"||u==="condition")&&(m=encodeURIComponent(m)),m&&["currPage","pageSize","listingSort","listingType","uiConfig","condition","featureListingName"].includes(u)&&(i[u]=m),i.address=encodeURIComponent(e.address.value),document.querySelector(".lofty-is-shortcode")||(i.pageKey=e.sold.value?"sold_listing":"search")}),i.hideMap=e.showMap.value?0:1,s=s+"?"+Le(i),window.history.pushState(null,"",s)},asyncMapConditionToUrl(){if(e.isShortCode.value)return;let o=window.location.pathname,s=we();delete s.rect,delete s.polygonPath,delete s.mapRadius,s.zoom=e.zoom.value,s.condition&&(s.condition=encodeURIComponent(s.condition)),s.uiConfig&&(s.uiConfig=encodeURIComponent(s.uiConfig)),e.mapSyncList.value&&(e.mapSyncType.value==="mapArea"?s.rect=encodeURIComponent(n.getRect()):e.mapSyncType.value==="polygon"?s.polygonPath=encodeURIComponent(JSON.stringify(e.polygonPath.value)):e.mapSyncType.value==="radius"&&(s.mapRadius=encodeURIComponent(JSON.stringify(e.mapRadius.value)))),o=o+"?"+Le(s),window.history.pushState(null,"",o)},initConditionFromUrl(){var s,i;const o=we();if(o.currPage||o.condition){let u=o.condition?JSON.parse(decodeURIComponent(o.condition)):{},g=o.uiConfig?JSON.parse(decodeURIComponent(o.uiConfig)):{};(s=u.location)!=null&&s.mapPath&&delete u.location.mapPath,(i=u.location)!=null&&i.mapRadius&&delete u.location.mapRadius,o.rect?(e.rect=decodeURIComponent(o.rect),e.mapSyncType.value="mapArea",e.mapSyncList.value=!0):o.polygonPath?(e.polygonPath.value=JSON.parse(decodeURIComponent(o.polygonPath)),e.mapSyncType.value="polygon",e.mapSyncList.value=!0):o.mapRadius&&(e.mapSyncType.value="radius",e.mapRadius.value=JSON.parse(decodeURIComponent(o.mapRadius)),e.mapSyncList.value=!0),Object.keys(u).forEach(m=>{e.condition[m]=u[m]}),Object.keys(g).forEach(m=>{e.uiConfig[m]=g[m]}),e.address.value=decodeURIComponent(o.address||""),e.listingSort.value=o.listingSort||"RELEVANCE",e.currPage.value=+o.currPage||1,e.pageSize.value=+o.pageSize||12,e.zoom.value=+o.zoom||14,e.showMap.value=o.hideMap!=="1"}},dealAggregationData(o){return o.forEach(s=>{s.key=`key-${s.latitude}${s.longitude}${Date.now()}`,s.lat=+s.latitude,s.lng=+s.longitude,Array.isArray(s.bounds)&&(s.bounds=s.bounds.map(i=>({lat:i.latitude,lng:i.longitude})))}),o},dealHouseData(o){o=o.filter(u=>!Fe(u));function s(u){return u.reduce((g,m)=>{if(g===null)return m;let T=g.soldPrice||g.price;return(m.soldPrice||m.price)<T?m:g},null)}const i=xe.generateDataByLatlng(o);return i.forEach(u=>{const g=s(u.items);u.key=`key-${u.lat}${u.lng}${Date.now()}`,u.price=g.soldPrice||g.price,u.nodisclosureDes=g.nodisclosureDes,u.items.forEach(m=>Ze(m))}),i},getRect(){const o=e.map.value.getViewModel().getLookAtData().bounds.getBoundingBox();if(o)return`${o.getTop()},${o.getLeft()},${o.getBottom()},${o.getRight()}`},toggleMap(){e.showMap.value=!e.showMap.value,e.currPage.value=1,e.pageSize.value=e.showMap.value?12:24,n.toggleClass(),l.searchList()},toggleClass(){e.hasMap.value&&(e.showMap.value?(t.$(".lofty-result-listing").classList.add("has-map"),t.$("#lofty-map-container").classList.remove("lofty-hidden")):(t.$(".lofty-result-listing").classList.remove("has-map"),t.$("#lofty-map-container").classList.add("lofty-hidden")))}},r=t.getModuleData();return e.counts.value=r.counts||0,e.mlsList=W(r.mls_list),e.searchType.value=r.searchType,e.totalPage.value=r.totalPage||0,e.sold.value=r.sold,e.hasMap.value=r.hasMap,e.shortCodeConfig.value=r.shortcode_config||{},e.featureListingName.value=r.featureListingName||"",e.shortCodeConfig.value.layout||n.initConditionFromUrl(),l.searchList(),{...e,...l,formatCondition:n.formatCondition,formatLocation:n.formatLocation,getRect:n.getRect,toggleMap:n.toggleMap,toggleClass:n.toggleClass,dealHouseData:n.dealHouseData}}function rt(t){ie[t.id]=lt(t)}const ut={class:"lofty-show-more-name"},ct={key:0},dt={class:"lofty-more-panel"},ht={class:"lofty-more-filter-title"},pt={class:"lofty-more-filter-count"},gt={class:"lofty-group-name"},mt={class:"lofty-group-wrapper"},ft={class:"lofty-condition-label"},yt={__name:"moreFilter",props:{moreConfigs:{type:Array,required:!0},condition:Object,uiConfig:Object},setup(t){const e=t,l=U(()=>{const o=new Set;return e.moreConfigs.forEach(s=>{s.conditions.forEach(i=>{o.add(i.name)})}),o}),n=U(()=>{let o=0;for(let s in e.condition){const i=e.condition[s];if(je(i)&&l.value.has(s)&&(o++,typeof i=="string")){const u=i.split(",");u.length===2&&u.every(g=>!!g)&&o++}}return o});function r(){for(const o of l.value){const s=e.condition[o];Array.isArray(s)?e.condition[o]=[]:typeof s=="object"?e.condition[o]={}:typeof s=="boolean"?e.condition[o]=!1:typeof s=="string"&&(e.condition[o]="")}}return(o,s)=>(d(),_(Ie,{class:"lofty-more-box",right:0,menuStyle:{paddingRight:0},clickMenuClose:!1,"fit-width":!1},{menu:se(()=>[a("div",dt,[a("div",ht,[a("div",pt,S(c(n))+" Filters Applied",1),a("div",{class:"lofty-clear-filter",onClick:r},s[1]||(s[1]=[a("i",{class:"lofty_iconfont lofty-icon-reset"},null,-1),q(" Clear")]))]),(d(!0),h($,null,H(t.moreConfigs,i=>(d(),h("div",{class:"lofty-condition-group",key:i.name},[a("p",gt,S(i.nameText),1),a("div",mt,[(d(!0),h($,null,H(i.conditions,u=>(d(),h("div",{key:u.name,class:"lofty-condition-label-input",style:ge({width:u.inputType==="keyWord"?"100%":""})},[a("p",ft,[a("span",null,S(u.label),1)]),(d(),_(Oe(c(He)[u.inputType]),{modelValue:t.condition[u.name],"onUpdate:modelValue":g=>t.condition[u.name]=g,key:u.name,uiConfig:t.uiConfig,config:u},null,8,["modelValue","onUpdate:modelValue","uiConfig","config"]))],4))),128))])]))),128))])]),default:se(()=>[a("span",ut,[s[0]||(s[0]=q("More ")),c(n)?(d(),h("span",ct,"("+S(c(n))+")",1)):L("",!0)])]),_:1}))}},vt={class:"lofty-listing-search"},wt={key:1,class:"lofty-multi-filter"},St=["disabled"],Ct={class:"save-search-pop-container"},bt={class:"save-search-pop-content"},Lt={__name:"searchBar",props:{id:String},setup(t){const e=t,{counts:l,currPage:n,pageSize:r,searchList:o,condition:s,formatCondition:i,formatLocation:u,polygonPath:g,getRect:m,listingSort:T,uiConfig:F,sold:K,zoom:Q,address:oe,mapSyncList:ae,mapSyncType:E,removeMapTag:X,isShortCode:Z}=ie[e.id],[P,k,A,ne]=[y([]),y([]),y([]),y([])],ue=U(()=>{if(ae.value){if(E.value==="mapArea")return["Map Area"];if(E.value==="polygon")return["Polygon Search"];if(E.value==="radius")return["Radius Search"]}return[]}),ce=y({});async function ye(){const N={data:{isSold:K.value},headers:{}};Z.value||(N.headers.trackingpagekey=K.value?"sold_listing":"search");const w=await G.get("/search/center/conditions",N);w.data.configs.forEach(b=>{let M=null;b.conditions.forEach((O,ve)=>{O.name==="location"&&(M=ve,ce.value=O),O.inputType==="suggestion"&&!s[O.name]&&(s[O.name]={}),["multiSelect","singleSelect","keyWord"].includes(O.inputType)&&!s[O.name]&&(s[O.name]=[])}),M!==null&&b.conditions.splice(M,1)}),P.value=w.data.configs.filter(b=>b.conditions.length>0),ne.value=JSON.parse(JSON.stringify(P.value));let D=0;P.value.forEach(b=>{b.conditions.forEach(M=>{D<4&&["singleSelect","multiSelect","inputBox","checkBox"].includes(M.inputType)&&(k.value.push(M),D++)}),b.conditions=b.conditions.filter(M=>!k.value.some(O=>O.name===M.name)),b.conditions.length>0&&A.value.push(b)}),pe(s,()=>{n.value=1,o()})}const ee=Ge("popRef");function de(){We(()=>{ee.value.open()})}$e(()=>{ye()});const v=U(()=>Object.values(i()).length===0&&!E.value),p=y(""),f=y(7),C=[{label:"Instantly",value:0},{label:"Daily",value:1},{label:"Weekly",value:7},{label:"Biweekly",value:14},{label:"Monthly",value:28}];async function I(){let N=p.value.trim();if(N){const w={condition:i(),uiConfig:F,address:oe.value,listingSort:T.value,currPage:n.value,pageSize:r.value,zoom:Q.value,timezone:x.getTimeZone()};if(E.value==="polygon"&&(w.polygonPath=g.value),E.value==="mapArea"){const b=m(),M=b.split(",");w.rect=b;let O=[{lat:M[0],lng:M[1]},{lat:M[0],lng:M[3]},{lat:M[2],lng:M[3]},{lat:M[2],lng:M[1]}];O=O.map(ve=>JSON.stringify(ve)),w.condition.location={mapPath:O}}u(w);const D={saveName:N,searchCondition:JSON.stringify(w),mailFrequency:f.value};try{const b=await G.post("/wp-plugin/save-search/saveSearch",{data:D});b.status.code===0&&(p.value="",x.toast(b.data),ee.value.close())}catch(b){console.error("save-search/saveSearch",b)}}}function V(){ee.value.close()}return(N,w)=>(d(),h("div",vt,[Y(Ye,{class:"location-suggestion",modelValue:c(s).location,"onUpdate:modelValue":w[0]||(w[0]=D=>c(s).location=D),config:c(ce),"custom-tag":c(ue),onRemoveCustomTag:c(X)},null,8,["modelValue","config","custom-tag","onRemoveCustomTag"]),c(te)?(d(),_(Qe,{key:0,condition:c(s),mobileConfigs:c(ne),uiConfig:c(F),counts:c(l),onSaveSearch:de},null,8,["condition","mobileConfigs","uiConfig","counts"])):(d(),h("div",wt,[(d(!0),h($,null,H(c(k),D=>(d(),_(Oe(c(He)[D.inputType]),{modelValue:c(s)[D.name],"onUpdate:modelValue":b=>c(s)[D.name]=b,class:"lofty-filter-block","show-default-label":!0,"fit-width":!1,uiConfig:c(F),config:D,outSide:""},null,8,["modelValue","onUpdate:modelValue","uiConfig","config"]))),256)),c(A).length>0?(d(),_(yt,{key:0,class:"lofty-filter-block",moreConfigs:c(A),uiConfig:c(F),condition:c(s)},null,8,["moreConfigs","uiConfig","condition"])):L("",!0),c(K)?L("",!0):(d(),h("button",{key:1,class:"save-search lofty-btn",disabled:c(v),onClick:de},w[3]||(w[3]=[a("span",null,"Save Search",-1)]),8,St))])),Y(Xe,{ref_key:"popRef",ref:ee,class:"save-search-pop"},{default:se(()=>[a("div",Ct,[w[6]||(w[6]=a("div",{class:"title"},"SAVE THIS SEARCH",-1)),a("div",bt,[w[4]||(w[4]=a("div",{class:"label"},"Name This Search",-1)),R(a("input",{"onUpdate:modelValue":w[1]||(w[1]=D=>Pe(p)?p.value=D:null),placeholder:"Type Something"},null,512),[[Se,c(p)]]),w[5]||(w[5]=a("div",{class:"label mt20"},"Property Alert",-1)),Y(et,{class:"mt20",modelValue:c(f),"onUpdate:modelValue":w[2]||(w[2]=D=>Pe(f)?f.value=D:null),list:C},null,8,["modelValue"])]),a("div",{class:"save-search-footer"},[a("div",{class:"footer-cancel",onClick:V},"Cancel"),a("div",{class:"footer-save lofty-btn",onClick:I},"Save")])])]),_:1},512)]))}},kt={class:"lofty-listing-top"},Pt={key:0,class:"lofty-page-title"},Mt={key:1,class:"lofty-page-title"},Dt={key:0},Tt={key:0,class:"lofty-current-filter"},_t={key:1,class:"lofty-map-filter"},Rt={style:{margin:"0 10px"}},Et={class:"lofty-sort-list"},At=["onClick"],Ot={class:"lofty_iconfont lofty-icon-checked"},$t={class:"lofty-filter-name"},Nt={__name:"listingFilter",props:{id:String},setup(t){const e=t,{counts:l,listingSort:n,currPage:r,searchType:o,searchList:s,hasMap:i,showMap:u,address:g,sold:m,toggleMap:T,toggleClass:F}=ie[e.id],K=U(()=>l.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")),Q=U(()=>o.value==="sold"?l.value===1?"Sold Property Available":"Sold Properties Available":o.value==="For Rent"?l.value===1?"Property ForRent":"Properties For Rent":o.value==="For Sale"?l.value===1?"Property ForSale":"Properties For Sale":o.value==="neighborhood"?l.value===1?"Property AvailableNearby":"Properties AvailableNearby":"Properties Available"),oe=U(()=>m.value?E.value:ae.value),ae=y([{value:"RELEVANCE",label:"Default"},{value:"PRICE_DESC",label:"Price-High To Low"},{value:"PRICE_ASC",label:"Price-Low To High"},{value:"MLS_LIST_DATE_L_DESC",label:"Newest Listings"},{value:"BEDROOMS_DESC",label:"Beds (Most)"},{value:"BATHS_DESC",label:"Baths (Most)"},{value:"BUILT_YEAR_DESC",label:"Year Built (Newest)"},{value:"SQFT_DESC",label:"Square Feet (Biggest)"}]),E=y([{value:"RELEVANCE",label:"Default"},{value:"MLS_LIST_DATE_L_DESC",label:"Most Recent"},{value:"PRICE_DESC",label:"Price-Highest"},{value:"PRICE_ASC",label:"Price-Lowest"},{value:"BEDROOMS_DESC",label:"Beds (Most)"},{value:"BATHS_DESC",label:"Baths (Most)"},{value:"BUILT_YEAR_DESC",label:"Year Built (Newest)"}]),X=U(()=>{var P;return(P=oe.value.find(k=>k.value===n.value))==null?void 0:P.label});function Z(P){n.value!==P.value&&(n.value=P.value,r.value=1,s())}return $e(()=>{F()}),(P,k)=>R((d(),h("div",kt,[c(l)===0?(d(),h("p",Pt,"0 Properties")):(d(),h("p",Mt,[q(S(c(K))+" "+S(c(Q))+" ",1),c(g)?(d(),h("span",Dt," In "+S(c(g)),1)):L("",!0)])),Y(Ie,{class:"lofty-sort-filter",top:40,right:c(te)?"auto":0,left:c(te)?0:"auto","fit-width":!1,hideArrow:!0},{menu:se(()=>[a("ul",Et,[(d(!0),h($,null,H(c(oe),A=>(d(),h("li",{class:"lofty-filter-item",onClick:ne=>Z(A)},[q(S(A.label)+" ",1),R(a("i",Ot,null,512),[[z,c(n)===A.value]])],8,At))),256))])]),default:se(()=>[c(te)?(d(),h("span",Tt,[q(S(c(X))+" ",1),k[2]||(k[2]=a("i",{class:"lofty_iconfont lofty-icon-sort_04"},null,-1))])):(d(),h("span",_t,[k[3]||(k[3]=a("span",{style:{color:"#A8A8A8"}},"Sort by",-1)),a("span",Rt,S(c(X)),1),k[4]||(k[4]=a("i",{class:"lofty_iconfont lofty-icon-sort_04"},null,-1))]))]),_:1},8,["right","left"]),!c(te)&&c(i)?(d(),h("span",{key:2,class:"lofty-map-filter",onClick:k[0]||(k[0]=(...A)=>c(T)&&c(T)(...A))},[a("span",$t,S(c(u)?"Hide Map":"Show Map"),1),k[5]||(k[5]=a("i",{class:"lofty_iconfont lofty-icon-map_01"},null,-1))])):L("",!0),c(te)&&c(i)?(d(),h("div",{key:3,class:"lofty-map-mobile-btn",onClick:k[1]||(k[1]=(...A)=>c(T)&&c(T)(...A))},k[6]||(k[6]=[a("i",{class:"lofty_iconfont lofty-icon-map_01"},null,-1),a("span",null,"Map",-1)]))):L("",!0)],512)),[[z,!c(te)||!c(u)||!c(i)]])}},jt={__name:"listingPagination",props:{id:String},setup(t){const e=t,{currPage:l,totalPage:n,counts:r,searchList:o}=ie[e.id],s=i=>{l.value=i.page,o()};return(i,u)=>c(r)>1?(d(),_(tt,{key:0,totalPage:c(n),onPageChange:s,pageSize:24,noScroll:!0,pageNum:c(l)},null,8,["totalPage","pageNum"])):L("",!0)}},Bt={name:"Select",inject:["isMobile"],directives:{outSideClick:Ue},props:{value:{default:()=>({label:"1 Miles",value:1})},dataList:{type:Array,default:()=>[]}},data(){return{showList:!1}},methods:{changeSelect(t){this.$emit("change",t),this.showList=!1},switchDataList(){this.showList=!this.showList,this.$emit("closeSuggestion")},closeDataList(){this.showList=!1}},mounted(){this.isMobile?(this.$refs.switch.addEventListener("touchend",this.switchDataList),window.addEventListener("resize",this.closeDataList)):this.$refs.switch.addEventListener("click",this.switchDataList)},beforeDestroy(){this.isMobile&&window.removeEventListener("resize",this.closeDataList)}},Ht={class:"select-wrapper"},It={ref:"switch"},Ut={class:"label-txt"},Vt=["onClick"];function Gt(t,e,l,n,r,o){const s=Ne("out-side-click");return R((d(),h("div",Ht,[a("div",It,[a("span",Ut,S(l.value.label),1),a("span",{class:B(["lofty_iconfont lofty-icon-arrow-down",{up:r.showList}])},null,2)],512),R(a("div",{class:"data-list",id:"select-radius-list",onWheel:j(()=>{},["stop"]),onDrag:j(()=>{},["stop"]),onTouchmove:j(()=>{},["stop"]),onTouchstart:j(()=>{},["stop"]),onTouchend:j(()=>{},["stop"])},[a("ul",null,[(d(!0),h($,null,H(l.dataList,(i,u)=>(d(),h("li",{key:u,onClick:g=>o.changeSelect(i)},S(i.label),9,Vt))),128))])],544),[[z,r.showList]])])),[[s,()=>{r.showList=!1}]])}const zt=J(Bt,[["render",Gt]]);let le="";const xt={name:"radius-search",inject:["isMobile"],data(){return{location:le,suggestList:[],latlng:null,mileList:[1,1.5,2,2.5,3,3.5,4,4.5,5,10,15,20,25,30,50].map(t=>({value:t,label:t+(t>1?" miles":" mile")})),showSuggest:!1}},computed:{radiusValue(){return{value:this.radius,label:`${this.radius} ${this.radius>1?"miles":"mile"}`}}},props:{map:{type:Object},showRadiusOption:{type:Boolean},clearKey:{type:Number,default:1},radius:{type:Number,default:1}},components:{Select:zt},watch:{clearKey(){le=""}},methods:{searchSuggest:x.debounce(async function(t){const e={query:t.target.value,country:"usa",beginHighlight:encodeURIComponent("<mark>"),endHighlight:encodeURIComponent("</mark>"),maxresults:20},n=(await G.get("/search/home-j/here-api/autoSuggest",{data:e})).data.filter(o=>!!o.address.street),r=[];for(let o=0,s=0,i=n.length;s<5&&o<i;o++){let u=this.formatAddress(n[o]);u&&r.indexOf(u)===-1&&(r.push(u),s++)}this.suggestList=r,this.showSuggest=!0}),async changeLocation(t){le=t.replace(/<mark>|<\/mark>/g,""),this.location=le;let e=await ot.geocode(t.replace(/<mark>|<\/mark>/g,""),!0);this.latlng=e.center,this.$emit("submit",{location:this.latlng,radius:this.radiusValue.value}),this.showSuggest=!1},changeRadius(t){this.$emit("submit",{location:this.latlng,radius:t.value})},clearLocation(){le="",this.location="",this.showSuggest=!1},handleMutual(){this.$refs.select.showList=!1,this.showSuggest=!0},stopResizeEvent(t){return t&&t.preeventDefault?t.preeventDefault():window.event.returnValue=!1,!1},closeSuggestion(){this.showSuggest=!1},formatAddress(t){let e=t.address,l=this.getAddressItem(e,["houseNumber","street"])+this.getAddressItem(e,["city"]);return l?decodeURIComponent(l+this.getAddressItem(e,["state","postalCode"],!1)):null},getAddressItem(t,e,l){let n=[],r;for(let o=0,s=e.length;o<s;o++){let i=t[e[o]];i&&r!==i&&n.push(r=i)}return n.length?n.join(" ")+(l===!1?"":", "):""}},mounted(){this.isMobileSize&&window.addEventListener("resize",this.stopResizeEvent,!1)},beforeUnmount(){this.isMobile&&window.removeEventListener("resize",this.stopResizeEvent)}},Jt={class:"radius-search"},Ft={class:"position-wrapper"},Zt={class:"select-container"},qt={class:"key-search"},Kt={class:"autocomplete"},Wt=["onClick"],Yt=["innerHTML"];function Qt(t,e,l,n,r,o){const s=Ce("Select");return R((d(),h("div",Jt,[e[12]||(e[12]=a("div",{class:"radius-search-title"},"Radius",-1)),a("div",Ft,[a("div",Zt,[Y(s,{dataList:r.mileList,value:o.radiusValue,onChange:o.changeRadius,onCloseSuggestion:o.closeSuggestion,ref:"select"},null,8,["dataList","value","onChange","onCloseSuggestion"]),e[8]||(e[8]=a("span",{class:"select-tag"},"near",-1))]),a("div",qt,[e[9]||(e[9]=a("i",{class:"lofty_iconfont lofty-icon-search"},null,-1)),R(a("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=i=>r.location=i),onMousedown:e[1]||(e[1]=j(()=>{},["stop"])),onDblclick:e[2]||(e[2]=j(()=>{},["stop"])),onFocus:e[3]||(e[3]=j((...i)=>o.handleMutual&&o.handleMutual(...i),["stop"])),onTouchstart:e[4]||(e[4]=j((...i)=>o.handleMutual&&o.handleMutual(...i),["stop"])),onInput:e[5]||(e[5]=j((...i)=>o.searchSuggest&&o.searchSuggest(...i),["stop"])),placeholder:"Input a location to center the map",ref:"input",class:B({"show-clear-content":r.location})},null,34),[[Se,r.location]]),r.location?(d(),h("i",{key:0,class:"lofty_iconfont lofty-icon-close",onClick:e[6]||(e[6]=(...i)=>o.clearLocation&&o.clearLocation(...i))})):L("",!0)]),e[11]||(e[11]=a("div",{class:"arrow-style"},null,-1)),R(a("ul",Kt,[(d(!0),h($,null,H(r.suggestList,i=>(d(),h("li",{key:i,class:"item",onClick:u=>o.changeLocation(i)},[e[10]||(e[10]=a("i",{class:"lofty_iconfont lofty-icon-location_02"},null,-1)),a("span",{innerHTML:i},null,8,Yt)],8,Wt))),128))],512),[[z,r.suggestList.length>0&&r.showSuggest]]),a("span",{class:"lofty_iconfont lofty-icon-close",id:"close_radius_search_form",onClick:e[7]||(e[7]=j(i=>t.$emit("onClose"),["stop"]))})])],512)),[[z,l.showRadiusOption]])}const Xt=J(xt,[["render",Qt]]),eo=1609.344,to={mixins:[fe],inject:["isMobile"],props:{radius:{type:Number,default:1},clearKey:{type:Number,default:1}},components:{radiusOption:Xt},data(){return{showRadiusOption:!1,className:"search-radius"}},methods:{async initCircle(){this.circle&&this.map.removeObject(this.circle),this.circle=new window.H.map.Circle(this.data,this.radius*eo,{style:{strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",lineWidth:2,fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)"}}),this.circle.addEventListener("tap",()=>{this.showRadiusOption=!0}),this.circle.addEventListener("pointerenter",()=>{document.body.style.cursor="pointer"}),this.circle.addEventListener("pointerleave",()=>{document.body.style.cursor="default"}),this.map.addObject(this.circle),this.updateRadiusOption()},updateRadiusOption(){if(this.map&&this.circle){const t=this.map.getZoom(),e=this.circle.getBoundingBox();this.map.getViewModel().setLookAtData({bounds:e},!1);const l=this.map.getZoom(),n=3,r=Math.max(t-n,4),o=Math.min(t+n,20),s=Math.max(r,Math.min(l,o));this.map.getViewModel().setLookAtData({bounds:e,zoom:s},!0)}},updateCircle(t){const e={location:t.location||this.data,radius:t.radius||this.radius};this.$emit("updateCircle",e)},onOpen(){this.showRadiusOption=!0},onClose(){this.showRadiusOption=!1}},mounted(){this.showRadiusOption=!0,this.initCircle()},unmounted(){this.circle&&this.map.removeObject(this.circle)}};function oo(t,e,l,n,r,o){const s=Ce("radius-option");return t.parentDom?(d(),_(me,{key:0,to:t.parentDom},[a("div",be({class:"radius-center",onClick:e[0]||(e[0]=(...i)=>o.onOpen&&o.onOpen(...i)),onTouch:e[1]||(e[1]=(...i)=>o.onOpen&&o.onOpen(...i)),id:"open_radius_search_form"},t.$attrs),[Y(s,{showRadiusOption:r.showRadiusOption,map:t.map,radius:l.radius,clearKey:l.clearKey,onSubmit:o.updateCircle,onOnClose:o.onClose},null,8,["showRadiusOption","map","radius","clearKey","onSubmit","onOnClose"])],16)],8,["to"])):L("",!0)}const so=J(to,[["render",oo]]),io={name:"tip"},ao={class:"draw-tip"};function no(t,e,l,n,r,o){return d(),h("div",ao,[a("p",null,[e[1]||(e[1]=q("Click and drag to draw your search ")),a("span",{class:"cancel",onClick:e[0]||(e[0]=s=>t.$emit("cancel"))}," Cancel")])])}const lo=J(io,[["render",no]]),Ee=35,ro={inject:["store","isMobile","mapbox"],props:{map:Object,showPolygon:{type:Boolean,default:!0},showRadius:{type:Boolean,default:!0}},data(){return{path:[],lines:[],points:[],showTip:!1,drawing:!1,outPath:[],showSelectDraw:!1,showCircle:!1,location:null,circleRadius:1,timer:null,clearKey:1}},watch:{mapSyncType:{handler(t){this.map&&(t==="mapArea"||!t)&&this.clearDraw()}},outPath(){if(this.outPath&&this.outPath.length>0){let t=JSON.stringify(this.outPath);this.store.polygonPath.value=JSON.parse(t),this.store.mapSyncType.value="polygon",this.store.mapSyncList.value=!0,this.store.geometry.value=[],this.store.condition.location={}}else{if(this.mapSyncType==="mapArea")return;this.store.mapPath.value="",this.store.mapSyncType.value="",this.store.mapSyncList.value=!1,this.store.searchMap(),this.store.searchList()}}},computed:{mapSyncType(){return this.store.mapSyncType.value}},methods:{handleMouseenter(){this.isMobile||(clearTimeout(this.timer),this.showSelectDraw=!0)},handleMouseleave(){this.isMobile||(this.timer=setTimeout(()=>{this.showSelectDraw=!1},300))},handleClick(){this.isMobile&&(this.showSelectDraw=!this.showSelectDraw)},outsidetouchstart(){this.isMobile&&(this.showSelectDraw=!1)},startDraw(){this.store.drawing.value||(this.store.drawing.value=!0,this.showTip=!0,this.tapCb||(this.tapCb=t=>{var e=this.map.screenToGeo(t.currentPointer.viewportX,t.currentPointer.viewportY);this.addPoint(e)}),this.pointermoveThrottle||(this.pointermoveThrottle=x.throttle(t=>{var e=this.map.screenToGeo(t.currentPointer.viewportX,t.currentPointer.viewportY);this.hoverPoint(e)},200)),this.pointermoveCb||(this.pointermoveCb=t=>{this.pointermoveThrottle(t)}),this.createTip(),this.map.addEventListener("pointerdown",this.tapCb),this.map.addEventListener("pointermove",this.pointermoveCb))},endDraw(){this.store.drawing.value=!1,this.showTip=!0,this.tapCb&&this.map.removeEventListener("pointerdown",this.tapCb),this.pointermoveCb&&this.map.removeEventListener("pointermove",this.pointermoveCb),this.clearDashedLine(),this.destroyTip()},clearDraw(){this.path=[],this.outPath=[],this.endDraw(),this.stopListenDragPoint(),this.mainGroup&&(this.pointGroup&&this.mainGroup.removeObject(this.pointGroup),this.mapPolygon&&this.mainGroup.removeObject(this.mapPolygon),this.mapPolyline&&this.mainGroup.removeObject(this.mapPolyline),this.map.removeObject(this.mainGroup)),this.mainGroup=null,this.pointGroup=null,this.mapPolygon=null,this.mapPolyline=null,this.geoLineString=null,this.clearKey=Date.now(),setTimeout(()=>{this.showCircle=!1},100),this.showTip=!1,this.store.drawing.value=!1,this.mapSyncType!=="mapArea"&&this.store.removeMapTag(),this.destroyTip(),this.showSelectDraw=!1},addLineStringPoint(t){this.geoLineString||(this.geoLineString=new window.H.geo.LineString),this.geoLineString.pushLatLngAlt(t.lat,t.lng,0)},closeLineString(t){var e=t.toGeoJSON().coordinates[0];t.pushLatLngAlt(e[1],e[0],e[2]),this.geoLineString.isClosed=!0},initDraw(){this.pointGroup=new window.H.map.Group({visibility:!0}),this.mainGroup=new window.H.map.Group({volatility:!0,objects:[this.pointGroup]}),this.map.addObject(this.mainGroup)},drawPoint(t,e){var l=`<svg width="12" height="12" version="1.1" xmlns="http://www.w3.org/2000/svg">
    22            <circle stroke="#fff" fill="rgb(25,25,25)" stroke-width="2" cx="6" cy="6" r="5"/>
    3             </svg>`,n=new window.H.map.Marker(t,{icon:new window.H.map.Icon(l,{anchor:{x:6,y:6}})});n.draggable=!0,n.setData({index:e}),this.pointGroup.addObject(n)},drawLines(t){this.mapPolyline?this.mapPolyline.setGeometry(t):(this.mapPolyline=new window.H.map.Polyline(t,{style:{lineWidth:2,strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)"}}),this.mainGroup.addObject(this.mapPolyline))},drawPolygon(t){var e=new window.H.geo.Polygon(t);this.mapPolygon?this.mapPolygon.setGeometry(e):(this.mapPolygon=new window.H.map.Polygon(e,{style:{fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)",lineWidth:0}}),this.mainGroup.addObject(this.mapPolygon))},addPoint(t){var e=this.path.length;if(e===0&&this.initDraw(),e>=3&&this.closeToFirstPoint(t)){this.closePath();return}if(e>=Ee){x.toast(`Maximum support for ${Ee} strokes`);return}var l=this.path.length;this.path.push(t),this.addLineStringPoint(t),e++,this.drawPoint(t,l),e>=2&&(this.drawLines(this.geoLineString),e>=3&&this.drawPolygon(this.geoLineString))},closeToFirstPoint(t){var e=this.path,l=Be.distance(e[0],t),n=3e-6*Math.pow(2,22-this.map.getZoom());return l<n},drawDashedLine(t,e){var l=new window.H.geo.LineString;l.pushLatLngAlt(t.lat,t.lng,0),l.pushLatLngAlt(e.lat,e.lng,0),this.tempDashedline?this.tempDashedline.setGeometry(l):(this.tempDashedline=new window.H.map.Polyline(l,{style:{lineWidth:2,strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",lineDash:[2,4]}}),this.mainGroup.addObject(this.tempDashedline))},clearDashedLine(){this.tempDashedline&&setTimeout(()=>{this.mainGroup&&this.mainGroup.removeObject(this.tempDashedline),this.tempDashedline=null},210)},hoverPoint(t){var e=this.path.length;if(e>=1){e>=3&&this.closeToFirstPoint(t)&&(t=this.path[0]);var l=this.path[this.path.length-1];if(this.drawDashedLine(l,t),e>=2){this.geoLineString.pushLatLngAlt(t.lat,t.lng,0),this.drawPolygon(this.geoLineString);var n=this.geoLineString.getPointCount();this.geoLineString.removePoint(n-1)}}},closePath(){this.closeLineString(this.geoLineString),this.drawLines(this.geoLineString),this.outPath=this.path,this.endDraw(),this.listenDragPoint()},listenDragPoint(){this.pointGroup&&(this.pointerenterCb||(this.pointerenterCb=()=>{document.body.style.cursor="pointer"}),this.pointGroup.addEventListener("pointerenter",this.pointerenterCb,!0),this.pointerleaveCb||(this.pointerleaveCb=()=>{document.body.style.cursor="default"}),this.pointGroup.addEventListener("pointerleave",this.pointerleaveCb,!0),this.dragCb||(this.dragCb=t=>{var e=t.currentPointer,l=this.map.screenToGeo(e.viewportX,e.viewportY);t.target.setGeometry(l);var n=t.target.getData().index;if(this.geoLineString.removePoint(n),this.geoLineString.insertPoint(n,l),n===0&&this.geoLineString.isClosed){var r=this.geoLineString.getPointCount()-1;this.geoLineString.removePoint(r),this.geoLineString.pushPoint(l)}this.drawLines(this.geoLineString),this.drawPolygon(this.geoLineString),t.stopPropagation()}),this.pointGroup.addEventListener("drag",this.dragCb,!0),this.dragendCb||(this.dragendCb=t=>{var e=t.currentPointer,l=this.map.screenToGeo(e.viewportX,e.viewportY),n=t.target.getData().index;this.path.splice(n,1,l),this.outPath=[...this.path]}),this.pointGroup.addEventListener("dragend",this.dragendCb,!0))},stopListenDragPoint(){this.pointGroup&&(this.pointerenterCb&&this.pointGroup.removeEventListener("pointerenter",this.pointerenterCb,!0),this.pointerleaveCb&&this.pointGroup.removeEventListener("pointerleave",this.pointerleaveCb,!0),this.dragCb&&this.pointGroup.removeEventListener("drag",this.dragCb,!0),this.dragendCb&&this.pointGroup.removeEventListener("dragend",this.dragendCb,!0))},drawPath(t,e=!1){this.initDraw(),this.path=t,this.geoLineString=new window.H.geo.LineString,t.forEach((l,n)=>{this.geoLineString.pushLatLngAlt(l.lat,l.lng,0),this.drawPoint(l,n)}),this.closeLineString(this.geoLineString),this.drawLines(this.geoLineString),this.drawPolygon(this.geoLineString),this.listenDragPoint(),this.showTip=!0,e&&this.map.getViewModel().setLookAtData({bounds:this.geoLineString.getBoundingBox()},!0)},openDrawCircle({location:t,radius:e}){var r,o;(o=(r=this.map)==null?void 0:r.clearBoundary)==null||o.call(r),e=e||1,this.circleRadius=e,t=t||this.map.getCenter();let{lng:l,lat:n}=t;Object.prototype.toString.call(l)==="[object Function]"&&(l=l(),n=n()),this.location={lng:l,lat:n},this.map.setCenter(this.location),this.showCircle=!0,this.showTip=!0,this.store.mapRadius.value=this.formatBackendQuery({location:this.location,radius:e}),this.store.mapSyncType.value="radius",this.store.mapSyncList.value=!0,this.store.geometry.value=[],this.store.condition.location={}},createTip(){if(this.destroyTip(),this.mapbox){const t=this.mapbox.parentElement.querySelector("#tip");this.tipComp=re(lo,{onCancel:()=>{this.clearDraw()}}),this.tipComp.mount(t)}},destroyTip(){this.tipComp&&(this.tipComp.unmount(),this.tipComp=null)},updateCircle({location:t,radius:e}){this.map.setCenter(t),this.circleRadius=e,this.location=t,this.showCircle=!1,this.$nextTick(()=>{this.drawing=!1,this.showCircle=!0,this.showTip=!0,this.store.mapRadius.value=this.formatBackendQuery({location:this.location,radius:e}),this.store.searchMap(),this.store.searchList()})},formatBackendQuery({location:t,radius:e}){return[JSON.stringify({originPoint:t,radius:e,unit:"miles"})]}},mounted(){if(this.store.polygonPath.value.length>0&&this.drawPath(this.store.polygonPath.value,!0),this.store.mapRadius.value.length>0){let{originPoint:t,radius:e}=JSON.parse(this.store.mapRadius.value[0]);this.openDrawCircle({location:t,radius:e},!1)}},components:{circleSearch:so}},uo={class:"draw"},co={class:"btn-lofty"},ho={class:"select-item"};function po(t,e,l,n,r,o){const s=Ce("circle-search");return d(),h("div",uo,[a("div",co,[r.showTip?(d(),h("span",{key:1,class:"btn-lofty-txt clear",onClick:e[5]||(e[5]=(...i)=>o.clearDraw&&o.clearDraw(...i))},"Clear")):(d(),h("div",{key:0,class:B(["btn-lofty-select",{unfold:r.showSelectDraw}]),onMouseenter:e[2]||(e[2]=(...i)=>o.handleMouseenter&&o.handleMouseenter(...i)),onMouseleave:e[3]||(e[3]=(...i)=>o.handleMouseleave&&o.handleMouseleave(...i)),onClick:e[4]||(e[4]=(...i)=>o.handleClick&&o.handleClick(...i))},[e[7]||(e[7]=a("span",{class:"btn-lofty-txt"},"Draw",-1)),e[8]||(e[8]=a("span",{class:"lofty_iconfont lofty-icon-arrow-down"},null,-1)),R(a("div",ho,[l.showPolygon?(d(),h("p",{key:0,onClick:e[0]||(e[0]=(...i)=>o.startDraw&&o.startDraw(...i))},"Polygon")):L("",!0),l.showRadius?(d(),h("p",{key:1,onClick:e[1]||(e[1]=(...i)=>o.openDrawCircle&&o.openDrawCircle(...i))},"Radius")):L("",!0),e[6]||(e[6]=a("div",{class:"opacity"},null,-1))],512),[[z,r.showSelectDraw]])],34))]),r.showCircle?(d(),_(s,{key:0,map:l.map,clearKey:r.clearKey,data:r.location,radius:r.circleRadius,onUpdateCircle:o.updateCircle},null,8,["map","clearKey","data","radius","onUpdateCircle"])):L("",!0)])}const go=J(ro,[["render",po]]),mo={inject:["store","isMobile"],computed:{hideMapAreaButton(){return this.store.mapSyncList.value&&this.store.mapSyncType.value==="mapArea"}},methods:{handler(){this.store.mapSyncList.value=!0,this.store.mapSyncType.value="mapArea",this.store.condition.location={}},showList(){this.store.toggleMap()}}},fo={key:0,class:"lofty-search"},yo={key:1,class:"lofty-search"},vo={class:"split-line"};function wo(t,e,l,n,r,o){return o.isMobile?(d(),h("div",yo,[R(a("span",{class:"search-text",onClick:e[1]||(e[1]=(...s)=>o.handler&&o.handler(...s))},"Search this area",512),[[z,!o.hideMapAreaButton]]),R(a("span",vo,null,512),[[z,!o.hideMapAreaButton]]),a("span",{class:"change-grid",onClick:e[2]||(e[2]=(...s)=>o.showList&&o.showList(...s))},e[3]||(e[3]=[a("i",{class:"lofty_iconfont lofty-icon-grid-fill"},null,-1),a("span",null,"Grid",-1)]))])):R((d(),h("div",fo,[a("span",{class:"search-text",onClick:e[0]||(e[0]=(...s)=>o.handler&&o.handler(...s))},"Redo Search On Map Area")],512)),[[z,!o.hideMapAreaButton]])}const So=J(mo,[["render",wo]]),Co={inject:["store","isMobile"],data(){return{isPop:!1,rating:"0",schoolChecked:this.store.showSchool.value,level:W({elementary:{label:"Elementary",value:!0},middle:{label:"Middle",value:!0},high:{label:"High",value:!0}}),timer:null}},computed:{ratingText(){let t=this.rating;return t==="0"?"All":t+(t==="10"?"":"+")},schoolData(){return{admission:"public,private",level:Object.keys(this.level).filter(t=>this.level[t].value).join(","),rating:this.rating}}},watch:{schoolData:{handler:he(function(){this.searchSchool()},300)}},methods:{toggleSchool(t){const e=t.target.checked;this.store.showSchool.value=e,e?this.searchSchool():this.store.markerData.school=[]},searchSchool(){this.store.searchSchool(this.schoolData)},handleMouseenter(){this.isMobile||(clearTimeout(this.timer),this.isPop=!0)},handleMouseleave(){this.isMobile||(this.timer=setTimeout(()=>{this.isPop=!1},100))},handleClick(){this.isMobile&&(this.isPop=!this.isPop)},updateRangeStyle(){const t=100*+this.rating/10;this.$refs.range.style.background=`linear-gradient(to right, #191919 ${t}%, rgba(218, 218, 218, 0.5) ${t}%)`}},mounted(){this.updateRangeStyle()}},bo={class:"school"},Lo={class:"switch"},ko={class:"school"},Po=["onUpdate:modelValue","value"],Mo={class:"rating"},Do={class:"range"},To={class:"label"};function _o(t,e,l,n,r,o){return d(),h("div",bo,[a("div",{class:B(["school-btn",{unfold:r.isPop}]),onClick:e[0]||(e[0]=(...s)=>o.handleClick&&o.handleClick(...s)),onMouseenter:e[1]||(e[1]=(...s)=>o.handleMouseenter&&o.handleMouseenter(...s)),onMouseleave:e[2]||(e[2]=(...s)=>o.handleMouseleave&&o.handleMouseleave(...s))},e[9]||(e[9]=[a("span",{class:"btn-txt"},"School",-1),a("span",{class:"lofty_iconfont lofty-icon-arrow-down"},null,-1)]),34),R(a("div",{class:"pop-school-search",ref:"pop",onMouseenter:e[7]||(e[7]=(...s)=>o.handleMouseenter&&o.handleMouseenter(...s)),onMouseleave:e[8]||(e[8]=(...s)=>o.handleMouseleave&&o.handleMouseleave(...s))},[a("div",Lo,[a("label",null,[R(a("input",{type:"checkbox",name:"switch","onUpdate:modelValue":e[3]||(e[3]=s=>r.schoolChecked=s),onInput:e[4]||(e[4]=(...s)=>o.toggleSchool&&o.toggleSchool(...s))},null,544),[[Me,r.schoolChecked]]),a("span",{class:B(["lofty_iconfont lofty-icon-checked",{mobile:o.isMobile}])},null,2),e[10]||(e[10]=a("span",null,"Show Schools On Map",-1))])]),e[14]||(e[14]=a("div",{class:"divider"},null,-1)),a("div",ko,[(d(!0),h($,null,H(Object.keys(r.level),s=>(d(),h("label",{key:s},[R(a("input",{type:"checkbox",name:"level","onUpdate:modelValue":i=>r.level[s].value=i,value:s},null,8,Po),[[Me,r.level[s].value]]),a("span",{class:B(["lofty_iconfont lofty-icon-checked",{mobile:o.isMobile}])},null,2),q(" "+S(s),1)]))),128))]),e[15]||(e[15]=a("div",{class:"divider"},null,-1)),e[16]||(e[16]=a("p",{class:"rating-title"},"GreatSchools Rating",-1)),a("div",Mo,[a("div",Do,[e[12]||(e[12]=a("span",null,"Low",-1)),a("div",null,[R(a("input",{ref:"range",type:"range",name:"rating",min:"0",max:"10","onUpdate:modelValue":e[5]||(e[5]=s=>r.rating=s),onInput:e[6]||(e[6]=(...s)=>o.updateRangeStyle&&o.updateRangeStyle(...s))},null,544),[[Se,r.rating]]),e[11]||(e[11]=a("div",{class:"bar"},null,-1))]),e[13]||(e[13]=a("span",null,"High",-1))]),a("span",To,S(o.ratingText),1)])],544),[[z,r.isPop]])])}const Ro=J(Co,[["render",_o]]),Eo={mixins:[fe],data(){return{type:"house"}},computed:{houses(){return this.data.items},housesStatus(){return"house-status-"+(this.houses[0].listingStatus||"").toLowerCase()}}},Ao={key:0,class:"house-header"},Oo={class:"house-list"},$o=["href"],No={class:"house-top"},jo=["src"],Bo={class:"house-info"},Ho={key:0,class:"price"},Io={key:1,class:"price"},Uo={class:"info"},Vo={class:"addr"},Go={class:"house-bottom"},zo={class:"detail"},xo={key:0,class:"house-mls-id"},Jo=["src"];function Fo(t,e,l,n,r,o){return t.parentDom?(d(),_(me,{key:0,to:t.parentDom},[a("div",be({ref:"marker",class:["marker-house map-marker",{active:t.active===t.fmLatlng,hidden:t.data.destroyed}],onMouseenter:e[0]||(e[0]=(...s)=>t.onMouseEnter&&t.onMouseEnter(...s)),onMouseleave:e[1]||(e[1]=(...s)=>t.onMouseLeave&&t.onMouseLeave(...s)),onClick:e[2]||(e[2]=(...s)=>t.onClick&&t.onClick(...s)),onWheel:e[3]||(e[3]=j(()=>{},["stop"])),onMousewheel:e[4]||(e[4]=j(()=>{},["stop"]))},t.$attrs),[a("span",{class:B(["marker-shape",[{highlight:t.data.keepHighlight},o.housesStatus]])},[t.data.nodisclosureDes?(d(),h($,{key:0},[q("﹡﹡﹡﹡﹡")],64)):L("",!0),t.data.nodisclosureDes?L("",!0):(d(),h($,{key:1},[q(S(t.showPrice),1)],64))],2),a("div",{ref:"pop",class:B(["marker-pop",{multi:o.houses.length>1,bottom:t.popBottom}]),style:ge(t.popStyle)},[o.houses.length>1?(d(),h("div",Ao,[a("span",null,S(o.houses.length)+" units here ",1)])):L("",!0),a("ul",Oo,[(d(!0),h($,null,H(o.houses,s=>(d(),h("li",{class:"house-item",key:s.id},[a("a",{href:s.detailLink||s.detailUrl,target:"_blank",rel:"noopener noreferrer"},[a("div",No,[a("img",{class:"img-container",src:s.previewPicture,alt:""},null,8,jo),a("div",Bo,[s.nodisclosureDes?(d(),h("p",Io,S(s.nodisclosureDes),1)):(d(),h("p",Ho,S(s.soldDate?s.soldPrice:s.price),1)),a("div",Uo,[(d(!0),h($,null,H(s.basic,i=>(d(),h("span",{class:"desc-span",key:i.key},S(i.text),1))),128))]),a("p",Vo,S(s.streetAddress),1)])]),a("div",Go,[a("div",zo,[s.showMls?(d(),h("p",xo," Listing # "+S(s.mlsListingId),1)):L("",!0)]),s.mlsLogo?(d(),h("img",{key:0,class:"house-mls-logo",height:"18",src:s.mlsLogo,alt:"house mls logo"},null,8,Jo)):L("",!0)])],8,$o)]))),128))])],6)],16)],8,["to"])):L("",!0)}const Ae=J(Eo,[["render",Fo]]),Zo={emits:["update:active"],mixins:[fe],inject:["store"],directives:{outSideClick:Ue},data(){return{type:"school"}},methods:{pushLocation(){const{location:t}=this.store.condition;this.store.removeMapTag();const{keywordType:e,label:l}=this.data;t[e]?t[e].includes(l)===-1&&t[e].push(l):t[e]=[l]},touchstart(t){this.active||t.preventDefault(),this.onClick()},outClick(){this.active&&this.$emit("update:active","")}}},qo={class:"school-list"},Ko={class:"info"},Wo={class:"left"},Yo={class:"name"},Qo={class:"tip"},Xo={class:"right"};function es(t,e,l,n,r,o){const s=Ne("out-side-click");return t.parentDom?(d(),_(me,{key:0,to:t.parentDom},[a("div",{class:B(["marker-school map-marker",{active:t.active===t.fmLatlng}]),onMouseenter:e[1]||(e[1]=(...i)=>t.onMouseEnter&&t.onMouseEnter(...i)),onMouseleave:e[2]||(e[2]=(...i)=>t.onMouseLeave&&t.onMouseLeave(...i)),onTouchstart:e[3]||(e[3]=(...i)=>o.touchstart&&o.touchstart(...i))},[e[5]||(e[5]=a("i",{class:"lofty_iconfont lofty-icon-school2"},null,-1)),a("div",{ref:"pop",class:B(["marker-pop",{bottom:t.popBottom}]),style:ge(t.popStyle)},[a("span",{ref:"pointer",class:"pointer",style:ge(t.pointerStyle)},null,4),R((d(),h("ul",qo,[a("li",null,[a("div",Ko,[a("div",Wo,[a("p",Yo,S(t.data.name),1),a("span",Qo,S(t.data.type)+" · "+S(t.data.gradeRange),1)]),a("div",Xo,[a("div",{class:B({rating:!0,high:t.data.gsRating>9,middle:t.data.gsRating>=6&&t.data.gsRating<=9})},S(t.data.gsRating),3),e[4]||(e[4]=a("span",{class:"tip"},"Out of 10",-1))])]),a("div",{class:"link",onClick:e[0]||(e[0]=(...i)=>o.pushLocation&&o.pushLocation(...i))},"View Homes in This School Area")])])),[[s,o.outClick]])],6)],34)],8,["to"])):L("",!0)}const ts=J(Zo,[["render",es]]),os={mixins:[fe],data(){return{type:"aggre"}},methods:{showBoundary(){if(this.boundary&&!this.isMobile)this.boundary.setVisibility(!0);else{const t={strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)",lineWidth:2},e=new window.H.geo.LineString,l=[];this.data.bounds.forEach((o,s)=>{if(Array.isArray(o))if(s===0)o.forEach(i=>{e.pushPoint(i)});else{const i=new window.H.geo.LineString;o.forEach(u=>{i.pushPoint(u)}),l.push(i)}else e.pushPoint(o)});const r=new window.H.geo.Polygon(e,l);this.boundary=new window.H.map.Polygon(r,{style:t}),this.map.addObject(this.boundary),this.boundary.setVisibility(!0)}this.onMouseEnter()},hideBoundary(){this.boundary&&this.boundary.setVisibility(!1),this.onMouseLeave()},onClick(){const t=this.events&&this.events.click;t&&t.call(this),this.hideBoundary();let{lat:e,lng:l}=this.data,n=this.map.getZoom();this.isMobile?n+=1:n+=n<12?1.5:n<=16?1:.5;const r=this.map.getOptions().maxZoom||20;n=Math.min(n,r),this.map.getViewModel().setLookAtData({position:{lat:e,lng:l},zoom:n},!0)}},beforeUnmount(){this.boundary&&this.map&&this.map.removeObject(this.boundary)}},ss={class:"marker-shape"},is={class:"info"},as={class:"count"};function ns(t,e,l,n,r,o){return t.parentDom?(d(),_(me,{key:0,to:t.parentDom},[a("div",be({class:["marker-aggre map-marker",{active:t.active===t.fmLatlng}],onMouseenter:e[0]||(e[0]=(...s)=>o.showBoundary&&o.showBoundary(...s)),onMouseleave:e[1]||(e[1]=(...s)=>o.hideBoundary&&o.hideBoundary(...s)),onClick:e[2]||(e[2]=(...s)=>o.onClick&&o.onClick(...s))},t.$attrs),[a("div",ss,[a("div",is,[a("span",as,S(t.data.count),1)])])],16)],8,["to"])):L("",!0)}const ls=J(os,[["render",ns]]),rs={class:"marker-box aggre"},us={class:"marker-box house"},cs={class:"marker-box school"},ds={__name:"listingMap",props:{id:String},setup(t){const e=t,{module:l,zoom:n,map:r,sold:o,rect:s,geometry:i,drawing:u,searchMap:g,listings:m,markerData:T,mlsList:F,condition:K,showMap:Q,mapSyncType:oe,dealHouseData:ae}=ie[e.id],E=W({aggre:"",house:"",school:""});De("isMobile",x.isMobile),De("store",ie[e.id]);const X=y(!1),Z=W({lat:0,lng:0}),P={minZoom:4,maxZoom:20,zoom:n.value,center:{lat:40.00267,lng:-75.3057}};k();async function k(){const v=l.getModuleData().mapCenter;if(s){const p=s.split(",");P.center.lat=(+p[0]+ +p[2])/2,P.center.lng=(+p[1]+ +p[3])/2}else if(v)P.center.lng=+v.lng,P.center.lat=+v.lat,P.zoom=11,n.value=11;else{const p=await G.get("search/centerPoint");p.centerLatitude&&p.centerLongitude&&(P.center.lat=p.centerLatitude,P.center.lng=p.centerLongitude,n.value=p.zoom)}X.value=!0}const A=["city","zipCode","neighborhood"];function ne(){pe([K,Q],async()=>{if(!Q.value)return;const v=K.location||{};Object.keys(v).filter(f=>f!=="mapPath"&&f!=="mapRadius").length>0&&await ce(v),A.some(f=>!!v[f])?ye(v):i.value=[],g()},{immediate:!0})}pe(m,()=>{const v=l.$all(".lofty-listing .lofty-house-item");Array.from(v).forEach(p=>{p.onmouseenter=f=>{const C=f.target.getAttribute("house-id"),I=m.value.find(N=>String(N.id)===C),V=ae([JSON.parse(JSON.stringify(I))]);T.activeHouse=V[0],T.activeHouseKey=Date.now()}})}),pe(Q,v=>{if(v&&m.value[0]){const p=m.value[0];Z.lat=+p.latitude,Z.lng=+p.longitude}});const ue=y([]);async function ce(v){const p={mlsOrgIds:F};for(let C in v){let I=v[C];["streetAddress"].includes(C)&&(I=v[C].map(V=>V.split(",")[0])),p[C]=I.join(";")}const{data:f}=await G.post("search/listing/locationSearch",{data:p});if(f&&f.length===2){const[C,I,V,N]=[f[0].longitude,f[1].longitude,f[0].latitude,f[1].latitude],w=Math.min(C,I),D=Math.max(C,I),b=Math.min(V,N),M=Math.max(V,N);ue.value=[[w,b],[w,M],[D,M],[D,b]]}else f.length===1&&(Z.lat=f[0].latitude,Z.lng=f[0].longitude,n.value=18,r.value.setZoom(18))}async function ye(v){const p={};A.forEach(C=>{v[C]&&(p[C]=v[C].join(";"))});const f=await G.get("search/hj/getBoundary",{data:p});i.value=f.geometry}const ee=x.debounce(g,300);function de(v){r.value=v,v.addEventListener("dragend",()=>{["polygon","radius"].includes(oe.value)||ee()}),v.addEventListener("dbltap",p=>{let f=v.getZoom(),{viewportX:C,viewportY:I}=p.currentPointer,V=v.screenToGeo(C,I);const N=P.maxZoom||20,w=Math.min(f+1,N);v.getViewModel().setLookAtData({position:V,zoom:w},!0),g()}),v.addEventListener("mapviewchangeend",()=>{const p=Math.round(r.value.getZoom());n.value!==p&&(n.value=p,ee())}),ne()}return(v,p)=>c(X)?(d(),_(Je,{key:0,onInit:de,config:P,center:c(Z),boundary:c(ue),geometry:c(i),class:B({drawing:c(u)})},{default:se(()=>[Y(So,{class:"map-tool"}),c(o)?L("",!0):(d(),_(Ro,{key:0,class:"map-tool"})),Y(go,{class:B(["map-tool",{"draw-is-sold":c(o)}]),map:c(r)},null,8,["class","map"]),p[3]||(p[3]=a("div",{id:"tip"},null,-1)),a("div",rs,[(d(!0),h($,null,H(c(T).aggregation,f=>(d(),_(ls,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(E).aggre,"onUpdate:active":p[0]||(p[0]=C=>c(E).aggre=C)},null,8,["map","data","active"]))),128))]),a("div",us,[(d(!0),h($,null,H(c(T).house,f=>(d(),_(Ae,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(E).house,"onUpdate:active":p[1]||(p[1]=C=>c(E).house=C)},null,8,["map","data","active"]))),128)),c(T).activeHouse?(d(),_(Ae,{map:c(r),key:c(T).activeHouseKey,class:"map-marker active-house",data:c(T).activeHouse},null,8,["map","data"])):L("",!0)]),a("div",cs,[(d(!0),h($,null,H(c(T).school,f=>(d(),_(ts,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(E).school,"onUpdate:active":p[2]||(p[2]=C=>c(E).school=C)},null,8,["map","data","active"]))),128))])]),_:1},8,["center","boundary","geometry","class"])):L("",!0)}};it();at();_e.initState(()=>{var t,e;st(),(e=(t=_e.mlsList)==null?void 0:t.forEach)==null||e.call(t,l=>nt(l))});jQuery(".lofty-listing-page").ready(function(){const t=document.querySelectorAll(".lofty-listing-page");t.length>0&&t.forEach(e=>{const l=e.getAttribute("id"),n=Ve(l),{id:r,$:o}=n;rt(n);const s=n.getModuleData();re(Lt,{id:r}).mount(o("#lofty-listing-search")),re(Nt,{id:r}).mount(o("#lofty_filter_container")),re(jt,{id:r}).mount(o("#lofty_pagination_container")),s.hasMap&&re(ds,{id:r}).mount(o("#lofty-map-container"))})});
     3            </svg>`,n=new window.H.map.Marker(t,{icon:new window.H.map.Icon(l,{anchor:{x:6,y:6}})});n.draggable=!0,n.setData({index:e}),this.pointGroup.addObject(n)},drawLines(t){this.mapPolyline?this.mapPolyline.setGeometry(t):(this.mapPolyline=new window.H.map.Polyline(t,{style:{lineWidth:2,strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)"}}),this.mainGroup.addObject(this.mapPolyline))},drawPolygon(t){var e=new window.H.geo.Polygon(t);this.mapPolygon?this.mapPolygon.setGeometry(e):(this.mapPolygon=new window.H.map.Polygon(e,{style:{fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)",lineWidth:0}}),this.mainGroup.addObject(this.mapPolygon))},addPoint(t){var e=this.path.length;if(e===0&&this.initDraw(),e>=3&&this.closeToFirstPoint(t)){this.closePath();return}if(e>=Ee){x.toast(`Maximum support for ${Ee} strokes`);return}var l=this.path.length;this.path.push(t),this.addLineStringPoint(t),e++,this.drawPoint(t,l),e>=2&&(this.drawLines(this.geoLineString),e>=3&&this.drawPolygon(this.geoLineString))},closeToFirstPoint(t){var e=this.path,l=Be.distance(e[0],t),n=3e-6*Math.pow(2,22-this.map.getZoom());return l<n},drawDashedLine(t,e){var l=new window.H.geo.LineString;l.pushLatLngAlt(t.lat,t.lng,0),l.pushLatLngAlt(e.lat,e.lng,0),this.tempDashedline?this.tempDashedline.setGeometry(l):(this.tempDashedline=new window.H.map.Polyline(l,{style:{lineWidth:2,strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",lineDash:[2,4]}}),this.mainGroup.addObject(this.tempDashedline))},clearDashedLine(){this.tempDashedline&&setTimeout(()=>{this.mainGroup&&this.mainGroup.removeObject(this.tempDashedline),this.tempDashedline=null},210)},hoverPoint(t){var e=this.path.length;if(e>=1){e>=3&&this.closeToFirstPoint(t)&&(t=this.path[0]);var l=this.path[this.path.length-1];if(this.drawDashedLine(l,t),e>=2){this.geoLineString.pushLatLngAlt(t.lat,t.lng,0),this.drawPolygon(this.geoLineString);var n=this.geoLineString.getPointCount();this.geoLineString.removePoint(n-1)}}},closePath(){this.closeLineString(this.geoLineString),this.drawLines(this.geoLineString),this.outPath=this.path,this.endDraw(),this.listenDragPoint()},listenDragPoint(){this.pointGroup&&(this.pointerenterCb||(this.pointerenterCb=()=>{document.body.style.cursor="pointer"}),this.pointGroup.addEventListener("pointerenter",this.pointerenterCb,!0),this.pointerleaveCb||(this.pointerleaveCb=()=>{document.body.style.cursor="default"}),this.pointGroup.addEventListener("pointerleave",this.pointerleaveCb,!0),this.dragCb||(this.dragCb=t=>{var e=t.currentPointer,l=this.map.screenToGeo(e.viewportX,e.viewportY);t.target.setGeometry(l);var n=t.target.getData().index;if(this.geoLineString.removePoint(n),this.geoLineString.insertPoint(n,l),n===0&&this.geoLineString.isClosed){var r=this.geoLineString.getPointCount()-1;this.geoLineString.removePoint(r),this.geoLineString.pushPoint(l)}this.drawLines(this.geoLineString),this.drawPolygon(this.geoLineString),t.stopPropagation()}),this.pointGroup.addEventListener("drag",this.dragCb,!0),this.dragendCb||(this.dragendCb=t=>{var e=t.currentPointer,l=this.map.screenToGeo(e.viewportX,e.viewportY),n=t.target.getData().index;this.path.splice(n,1,l),this.outPath=[...this.path]}),this.pointGroup.addEventListener("dragend",this.dragendCb,!0))},stopListenDragPoint(){this.pointGroup&&(this.pointerenterCb&&this.pointGroup.removeEventListener("pointerenter",this.pointerenterCb,!0),this.pointerleaveCb&&this.pointGroup.removeEventListener("pointerleave",this.pointerleaveCb,!0),this.dragCb&&this.pointGroup.removeEventListener("drag",this.dragCb,!0),this.dragendCb&&this.pointGroup.removeEventListener("dragend",this.dragendCb,!0))},drawPath(t,e=!1){this.initDraw(),this.path=t,this.geoLineString=new window.H.geo.LineString,t.forEach((l,n)=>{this.geoLineString.pushLatLngAlt(l.lat,l.lng,0),this.drawPoint(l,n)}),this.closeLineString(this.geoLineString),this.drawLines(this.geoLineString),this.drawPolygon(this.geoLineString),this.listenDragPoint(),this.showTip=!0,e&&this.map.getViewModel().setLookAtData({bounds:this.geoLineString.getBoundingBox()},!0)},openDrawCircle({location:t,radius:e}){var r,o;(o=(r=this.map)==null?void 0:r.clearBoundary)==null||o.call(r),e=e||1,this.circleRadius=e,t=t||this.map.getCenter();let{lng:l,lat:n}=t;Object.prototype.toString.call(l)==="[object Function]"&&(l=l(),n=n()),this.location={lng:l,lat:n},this.map.setCenter(this.location),this.showCircle=!0,this.showTip=!0,this.store.mapRadius.value=this.formatBackendQuery({location:this.location,radius:e}),this.store.mapSyncType.value="radius",this.store.mapSyncList.value=!0,this.store.geometry.value=[],this.store.condition.location={}},createTip(){if(this.destroyTip(),this.mapbox){const t=this.mapbox.parentElement.querySelector("#tip");this.tipComp=re(lo,{onCancel:()=>{this.clearDraw()}}),this.tipComp.mount(t)}},destroyTip(){this.tipComp&&(this.tipComp.unmount(),this.tipComp=null)},updateCircle({location:t,radius:e}){this.map.setCenter(t),this.circleRadius=e,this.location=t,this.showCircle=!1,this.$nextTick(()=>{this.drawing=!1,this.showCircle=!0,this.showTip=!0,this.store.mapRadius.value=this.formatBackendQuery({location:this.location,radius:e}),this.store.searchMap(),this.store.searchList()})},formatBackendQuery({location:t,radius:e}){return[JSON.stringify({originPoint:t,radius:e,unit:"miles"})]}},mounted(){if(this.store.polygonPath.value.length>0&&this.drawPath(this.store.polygonPath.value,!0),this.store.mapRadius.value.length>0){let{originPoint:t,radius:e}=JSON.parse(this.store.mapRadius.value[0]);this.openDrawCircle({location:t,radius:e},!1)}},components:{circleSearch:so}},uo={class:"draw"},co={class:"btn-lofty"},ho={class:"select-item"};function po(t,e,l,n,r,o){const s=Ce("circle-search");return d(),h("div",uo,[a("div",co,[r.showTip?(d(),h("span",{key:1,class:"btn-lofty-txt clear",onClick:e[5]||(e[5]=(...i)=>o.clearDraw&&o.clearDraw(...i))},"Clear")):(d(),h("div",{key:0,class:B(["btn-lofty-select",{unfold:r.showSelectDraw}]),onMouseenter:e[2]||(e[2]=(...i)=>o.handleMouseenter&&o.handleMouseenter(...i)),onMouseleave:e[3]||(e[3]=(...i)=>o.handleMouseleave&&o.handleMouseleave(...i)),onClick:e[4]||(e[4]=(...i)=>o.handleClick&&o.handleClick(...i))},[e[7]||(e[7]=a("span",{class:"btn-lofty-txt"},"Draw",-1)),e[8]||(e[8]=a("span",{class:"lofty_iconfont lofty-icon-arrow-down"},null,-1)),R(a("div",ho,[l.showPolygon?(d(),h("p",{key:0,onClick:e[0]||(e[0]=(...i)=>o.startDraw&&o.startDraw(...i))},"Polygon")):L("",!0),l.showRadius?(d(),h("p",{key:1,onClick:e[1]||(e[1]=(...i)=>o.openDrawCircle&&o.openDrawCircle(...i))},"Radius")):L("",!0),e[6]||(e[6]=a("div",{class:"opacity"},null,-1))],512),[[z,r.showSelectDraw]])],34))]),r.showCircle?(d(),_(s,{key:0,map:l.map,clearKey:r.clearKey,data:r.location,radius:r.circleRadius,onUpdateCircle:o.updateCircle},null,8,["map","clearKey","data","radius","onUpdateCircle"])):L("",!0)])}const go=J(ro,[["render",po]]),mo={inject:["store","isMobile"],computed:{hideMapAreaButton(){return this.store.mapSyncList.value&&this.store.mapSyncType.value==="mapArea"}},methods:{handler(){this.store.mapSyncList.value=!0,this.store.mapSyncType.value="mapArea",this.store.condition.location={}},showList(){this.store.toggleMap()}}},fo={key:0,class:"lofty-search"},yo={key:1,class:"lofty-search"},vo={class:"split-line"};function wo(t,e,l,n,r,o){return o.isMobile?(d(),h("div",yo,[R(a("span",{class:"search-text",onClick:e[1]||(e[1]=(...s)=>o.handler&&o.handler(...s))},"Search this area",512),[[z,!o.hideMapAreaButton]]),R(a("span",vo,null,512),[[z,!o.hideMapAreaButton]]),a("span",{class:"change-grid",onClick:e[2]||(e[2]=(...s)=>o.showList&&o.showList(...s))},e[3]||(e[3]=[a("i",{class:"lofty_iconfont lofty-icon-grid-fill"},null,-1),a("span",null,"Grid",-1)]))])):R((d(),h("div",fo,[a("span",{class:"search-text",onClick:e[0]||(e[0]=(...s)=>o.handler&&o.handler(...s))},"Redo Search On Map Area")],512)),[[z,!o.hideMapAreaButton]])}const So=J(mo,[["render",wo]]),Co={inject:["store","isMobile"],data(){return{isPop:!1,rating:"0",schoolChecked:this.store.showSchool.value,level:W({elementary:{label:"Elementary",value:!0},middle:{label:"Middle",value:!0},high:{label:"High",value:!0}}),timer:null}},computed:{ratingText(){let t=this.rating;return t==="0"?"All":t+(t==="10"?"":"+")},schoolData(){return{admission:"public,private",level:Object.keys(this.level).filter(t=>this.level[t].value).join(","),rating:this.rating}}},watch:{schoolData:{handler:he(function(){this.searchSchool()},300)}},methods:{toggleSchool(t){const e=t.target.checked;this.store.showSchool.value=e,e?this.searchSchool():this.store.markerData.school=[]},searchSchool(){this.store.searchSchool(this.schoolData)},handleMouseenter(){this.isMobile||(clearTimeout(this.timer),this.isPop=!0)},handleMouseleave(){this.isMobile||(this.timer=setTimeout(()=>{this.isPop=!1},100))},handleClick(){this.isMobile&&(this.isPop=!this.isPop)},updateRangeStyle(){const t=100*+this.rating/10;this.$refs.range.style.background=`linear-gradient(to right, #191919 ${t}%, rgba(218, 218, 218, 0.5) ${t}%)`}},mounted(){this.updateRangeStyle()}},bo={class:"school"},Lo={class:"switch"},ko={class:"school"},Po=["onUpdate:modelValue","value"],Mo={class:"rating"},Do={class:"range"},To={class:"label"};function _o(t,e,l,n,r,o){return d(),h("div",bo,[a("div",{class:B(["school-btn",{unfold:r.isPop}]),onClick:e[0]||(e[0]=(...s)=>o.handleClick&&o.handleClick(...s)),onMouseenter:e[1]||(e[1]=(...s)=>o.handleMouseenter&&o.handleMouseenter(...s)),onMouseleave:e[2]||(e[2]=(...s)=>o.handleMouseleave&&o.handleMouseleave(...s))},e[9]||(e[9]=[a("span",{class:"btn-txt"},"School",-1),a("span",{class:"lofty_iconfont lofty-icon-arrow-down"},null,-1)]),34),R(a("div",{class:"pop-school-search",ref:"pop",onMouseenter:e[7]||(e[7]=(...s)=>o.handleMouseenter&&o.handleMouseenter(...s)),onMouseleave:e[8]||(e[8]=(...s)=>o.handleMouseleave&&o.handleMouseleave(...s))},[a("div",Lo,[a("label",null,[R(a("input",{type:"checkbox",name:"switch","onUpdate:modelValue":e[3]||(e[3]=s=>r.schoolChecked=s),onInput:e[4]||(e[4]=(...s)=>o.toggleSchool&&o.toggleSchool(...s))},null,544),[[Me,r.schoolChecked]]),a("span",{class:B(["lofty_iconfont lofty-icon-checked",{mobile:o.isMobile}])},null,2),e[10]||(e[10]=a("span",null,"Show Schools On Map",-1))])]),e[14]||(e[14]=a("div",{class:"divider"},null,-1)),a("div",ko,[(d(!0),h($,null,H(Object.keys(r.level),s=>(d(),h("label",{key:s},[R(a("input",{type:"checkbox",name:"level","onUpdate:modelValue":i=>r.level[s].value=i,value:s},null,8,Po),[[Me,r.level[s].value]]),a("span",{class:B(["lofty_iconfont lofty-icon-checked",{mobile:o.isMobile}])},null,2),q(" "+S(s),1)]))),128))]),e[15]||(e[15]=a("div",{class:"divider"},null,-1)),e[16]||(e[16]=a("p",{class:"rating-title"},"GreatSchools Rating",-1)),a("div",Mo,[a("div",Do,[e[12]||(e[12]=a("span",null,"Low",-1)),a("div",null,[R(a("input",{ref:"range",type:"range",name:"rating",min:"0",max:"10","onUpdate:modelValue":e[5]||(e[5]=s=>r.rating=s),onInput:e[6]||(e[6]=(...s)=>o.updateRangeStyle&&o.updateRangeStyle(...s))},null,544),[[Se,r.rating]]),e[11]||(e[11]=a("div",{class:"bar"},null,-1))]),e[13]||(e[13]=a("span",null,"High",-1))]),a("span",To,S(o.ratingText),1)])],544),[[z,r.isPop]])])}const Ro=J(Co,[["render",_o]]),Eo={mixins:[fe],data(){return{type:"house"}},computed:{houses(){return this.data.items},housesStatus(){return"house-status-"+(this.houses[0].listingStatus||"").toLowerCase()}}},Ao={key:0,class:"house-header"},Oo={class:"house-list"},$o=["href"],No={class:"house-top"},jo=["src"],Bo={class:"house-info"},Ho={key:0,class:"price"},Io={key:1,class:"price"},Uo={class:"info"},Vo={class:"addr"},Go={class:"house-bottom"},zo={class:"detail"},xo={key:0,class:"house-mls-id"},Jo=["src"];function Fo(t,e,l,n,r,o){return t.parentDom?(d(),_(me,{key:0,to:t.parentDom},[a("div",be({ref:"marker",class:["marker-house map-marker",{active:t.active===t.fmLatlng,hidden:t.data.destroyed}],onMouseenter:e[0]||(e[0]=(...s)=>t.onMouseEnter&&t.onMouseEnter(...s)),onMouseleave:e[1]||(e[1]=(...s)=>t.onMouseLeave&&t.onMouseLeave(...s)),onClick:e[2]||(e[2]=(...s)=>t.onClick&&t.onClick(...s)),onWheel:e[3]||(e[3]=j(()=>{},["stop"])),onMousewheel:e[4]||(e[4]=j(()=>{},["stop"]))},t.$attrs),[a("span",{class:B(["marker-shape",[{highlight:t.data.keepHighlight},o.housesStatus]])},[t.data.nodisclosureDes?(d(),h($,{key:0},[q("﹡﹡﹡﹡﹡")],64)):L("",!0),t.data.nodisclosureDes?L("",!0):(d(),h($,{key:1},[q(S(t.showPrice),1)],64))],2),a("div",{ref:"pop",class:B(["marker-pop",{multi:o.houses.length>1,bottom:t.popBottom}]),style:ge(t.popStyle)},[o.houses.length>1?(d(),h("div",Ao,[a("span",null,S(o.houses.length)+" units here ",1)])):L("",!0),a("ul",Oo,[(d(!0),h($,null,H(o.houses,s=>(d(),h("li",{class:"house-item",key:s.id},[a("a",{href:s.detailLink||s.detailUrl,target:"_blank",rel:"noopener noreferrer"},[a("div",No,[a("img",{class:"img-container",src:s.previewPicture,alt:""},null,8,jo),a("div",Bo,[s.nodisclosureDes?(d(),h("p",Io,S(s.nodisclosureDes),1)):(d(),h("p",Ho,S(s.soldDate?s.soldPrice:s.price),1)),a("div",Uo,[(d(!0),h($,null,H(s.basic,i=>(d(),h("span",{class:"desc-span",key:i.key},S(i.text),1))),128))]),a("p",Vo,S(s.streetAddress),1)])]),a("div",Go,[a("div",zo,[s.showMls?(d(),h("p",xo," Listing # "+S(s.mlsListingId),1)):L("",!0)]),s.mlsLogo?(d(),h("img",{key:0,class:"house-mls-logo",height:"18",src:s.mlsLogo,alt:"house mls logo"},null,8,Jo)):L("",!0)])],8,$o)]))),128))])],6)],16)],8,["to"])):L("",!0)}const Ae=J(Eo,[["render",Fo]]),Zo={emits:["update:active"],mixins:[fe],inject:["store"],directives:{outSideClick:Ue},data(){return{type:"school"}},methods:{pushLocation(){const{location:t}=this.store.condition;this.store.removeMapTag();const{keywordType:e,label:l}=this.data;t[e]?t[e].includes(l)===-1&&t[e].push(l):t[e]=[l]},touchstart(t){this.active||t.preventDefault(),this.onClick()},outClick(){this.active&&this.$emit("update:active","")}}},qo={class:"school-list"},Ko={class:"info"},Wo={class:"left"},Yo={class:"name"},Qo={class:"tip"},Xo={class:"right"};function es(t,e,l,n,r,o){const s=Ne("out-side-click");return t.parentDom?(d(),_(me,{key:0,to:t.parentDom},[a("div",{class:B(["marker-school map-marker",{active:t.active===t.fmLatlng}]),onMouseenter:e[1]||(e[1]=(...i)=>t.onMouseEnter&&t.onMouseEnter(...i)),onMouseleave:e[2]||(e[2]=(...i)=>t.onMouseLeave&&t.onMouseLeave(...i)),onTouchstart:e[3]||(e[3]=(...i)=>o.touchstart&&o.touchstart(...i))},[e[5]||(e[5]=a("i",{class:"lofty_iconfont lofty-icon-school2"},null,-1)),a("div",{ref:"pop",class:B(["marker-pop",{bottom:t.popBottom}]),style:ge(t.popStyle)},[a("span",{ref:"pointer",class:"pointer",style:ge(t.pointerStyle)},null,4),R((d(),h("ul",qo,[a("li",null,[a("div",Ko,[a("div",Wo,[a("p",Yo,S(t.data.name),1),a("span",Qo,S(t.data.type)+" · "+S(t.data.gradeRange),1)]),a("div",Xo,[a("div",{class:B({rating:!0,high:t.data.gsRating>9,middle:t.data.gsRating>=6&&t.data.gsRating<=9})},S(t.data.gsRating),3),e[4]||(e[4]=a("span",{class:"tip"},"Out of 10",-1))])]),a("div",{class:"link",onClick:e[0]||(e[0]=(...i)=>o.pushLocation&&o.pushLocation(...i))},"View Homes in This School Area")])])),[[s,o.outClick]])],6)],34)],8,["to"])):L("",!0)}const ts=J(Zo,[["render",es]]),os={mixins:[fe],data(){return{type:"aggre"}},methods:{showBoundary(){if(this.boundary&&!this.isMobile)this.boundary.setVisibility(!0);else{const t={strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)",lineWidth:2},e=new window.H.geo.LineString,l=[];this.data.bounds.forEach((o,s)=>{if(Array.isArray(o))if(s===0)o.forEach(i=>{e.pushPoint(i)});else{const i=new window.H.geo.LineString;o.forEach(u=>{i.pushPoint(u)}),l.push(i)}else e.pushPoint(o)});const r=new window.H.geo.Polygon(e,l);this.boundary=new window.H.map.Polygon(r,{style:t}),this.map.addObject(this.boundary),this.boundary.setVisibility(!0)}this.onMouseEnter()},hideBoundary(){this.boundary&&this.boundary.setVisibility(!1),this.onMouseLeave()},onClick(){const t=this.events&&this.events.click;t&&t.call(this),this.hideBoundary();let{lat:e,lng:l}=this.data,n=this.map.getZoom();this.isMobile?n+=2:n+=n<10?3:n<=16?2:1,this.map.getViewModel().setLookAtData({position:{lat:e,lng:l},zoom:n},!0)}},beforeUnmount(){this.boundary&&this.map&&this.map.removeObject(this.boundary)}},ss={class:"marker-shape"},is={class:"info"},as={class:"count"};function ns(t,e,l,n,r,o){return t.parentDom?(d(),_(me,{key:0,to:t.parentDom},[a("div",be({class:["marker-aggre map-marker",{active:t.active===t.fmLatlng}],onMouseenter:e[0]||(e[0]=(...s)=>o.showBoundary&&o.showBoundary(...s)),onMouseleave:e[1]||(e[1]=(...s)=>o.hideBoundary&&o.hideBoundary(...s)),onClick:e[2]||(e[2]=(...s)=>o.onClick&&o.onClick(...s))},t.$attrs),[a("div",ss,[a("div",is,[a("span",as,S(t.data.count),1)])])],16)],8,["to"])):L("",!0)}const ls=J(os,[["render",ns]]),rs={class:"marker-box aggre"},us={class:"marker-box house"},cs={class:"marker-box school"},ds={__name:"listingMap",props:{id:String},setup(t){const e=t,{module:l,zoom:n,map:r,sold:o,rect:s,geometry:i,drawing:u,searchMap:g,listings:m,markerData:T,mlsList:F,condition:K,showMap:Q,mapSyncType:oe,dealHouseData:ae}=ie[e.id],E=W({aggre:"",house:"",school:""});De("isMobile",x.isMobile),De("store",ie[e.id]);const X=y(!1),Z=W({lat:0,lng:0}),P={minZoom:4,maxZoom:20,zoom:n.value,center:{lat:40.00267,lng:-75.3057}};k();async function k(){const v=l.getModuleData().mapCenter;if(s){const p=s.split(",");P.center.lat=(+p[0]+ +p[2])/2,P.center.lng=(+p[1]+ +p[3])/2}else if(v)P.center.lng=+v.lng,P.center.lat=+v.lat,P.zoom=11,n.value=11;else{const p=await G.get("search/centerPoint");p.centerLatitude&&p.centerLongitude&&(P.center.lat=p.centerLatitude,P.center.lng=p.centerLongitude,n.value=p.zoom)}X.value=!0}const A=["city","zipCode","neighborhood"];function ne(){pe([K,Q],async()=>{if(!Q.value)return;const v=K.location||{};Object.keys(v).filter(f=>f!=="mapPath"&&f!=="mapRadius").length>0&&await ce(v),A.some(f=>!!v[f])?ye(v):i.value=[],g()},{immediate:!0})}pe(m,()=>{const v=l.$all(".lofty-listing .lofty-house-item");Array.from(v).forEach(p=>{p.onmouseenter=f=>{const C=f.target.getAttribute("house-id"),I=m.value.find(N=>String(N.id)===C),V=ae([JSON.parse(JSON.stringify(I))]);T.activeHouse=V[0],T.activeHouseKey=Date.now()}})}),pe(Q,v=>{if(v&&m.value[0]){const p=m.value[0];Z.lat=+p.latitude,Z.lng=+p.longitude}});const ue=y([]);async function ce(v){const p={mlsOrgIds:F};for(let C in v){let I=v[C];["streetAddress"].includes(C)&&(I=v[C].map(V=>V.split(",")[0])),p[C]=I.join(";")}const{data:f}=await G.post("search/listing/locationSearch",{data:p});if(f&&f.length===2){const[C,I,V,N]=[f[0].longitude,f[1].longitude,f[0].latitude,f[1].latitude],w=Math.min(C,I),D=Math.max(C,I),b=Math.min(V,N),M=Math.max(V,N);ue.value=[[w,b],[w,M],[D,M],[D,b]]}else f.length===1&&(Z.lat=f[0].latitude,Z.lng=f[0].longitude,n.value=18,r.value.setZoom(18))}async function ye(v){const p={};A.forEach(C=>{v[C]&&(p[C]=v[C].join(";"))});const f=await G.get("search/hj/getBoundary",{data:p});i.value=f.geometry}const ee=x.debounce(g,300);function de(v){r.value=v,v.addEventListener("dragend",()=>{["polygon","radius"].includes(oe.value)||ee()}),v.addEventListener("dbltap",p=>{let f=v.getZoom(),{viewportX:C,viewportY:I}=p.currentPointer,V=v.screenToGeo(C,I);const N=P.maxZoom||20,w=Math.min(f+1,N);v.getViewModel().setLookAtData({position:V,zoom:w},!0),g()}),v.addEventListener("mapviewchangeend",()=>{const p=Math.round(r.value.getZoom());n.value!==p&&(n.value=p,ee())}),ne()}return(v,p)=>c(X)?(d(),_(Je,{key:0,onInit:de,config:P,center:c(Z),boundary:c(ue),geometry:c(i),class:B({drawing:c(u)})},{default:se(()=>[Y(So,{class:"map-tool"}),c(o)?L("",!0):(d(),_(Ro,{key:0,class:"map-tool"})),Y(go,{class:B(["map-tool",{"draw-is-sold":c(o)}]),map:c(r)},null,8,["class","map"]),p[3]||(p[3]=a("div",{id:"tip"},null,-1)),a("div",rs,[(d(!0),h($,null,H(c(T).aggregation,f=>(d(),_(ls,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(E).aggre,"onUpdate:active":p[0]||(p[0]=C=>c(E).aggre=C)},null,8,["map","data","active"]))),128))]),a("div",us,[(d(!0),h($,null,H(c(T).house,f=>(d(),_(Ae,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(E).house,"onUpdate:active":p[1]||(p[1]=C=>c(E).house=C)},null,8,["map","data","active"]))),128)),c(T).activeHouse?(d(),_(Ae,{map:c(r),key:c(T).activeHouseKey,class:"map-marker active-house",data:c(T).activeHouse},null,8,["map","data"])):L("",!0)]),a("div",cs,[(d(!0),h($,null,H(c(T).school,f=>(d(),_(ts,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(E).school,"onUpdate:active":p[2]||(p[2]=C=>c(E).school=C)},null,8,["map","data","active"]))),128))])]),_:1},8,["center","boundary","geometry","class"])):L("",!0)}};it();at();_e.initState(()=>{var t,e;st(),(e=(t=_e.mlsList)==null?void 0:t.forEach)==null||e.call(t,l=>nt(l))});jQuery(".lofty-listing-page").ready(function(){const t=document.querySelectorAll(".lofty-listing-page");t.length>0&&t.forEach(e=>{const l=e.getAttribute("id"),n=Ve(l),{id:r,$:o}=n;rt(n);const s=n.getModuleData();re(Lt,{id:r}).mount(o("#lofty-listing-search")),re(Nt,{id:r}).mount(o("#lofty_filter_container")),re(jt,{id:r}).mount(o("#lofty_pagination_container")),s.hasMap&&re(ds,{id:r}).mount(o("#lofty-map-container"))})});
  • lofty-idx/trunk/lofty-idx.php

    r3333213 r3335283  
    55 * Description: A powerful WordPress plugin that integrates IDX/MLS property listings.
    66 * Author: loftylisting
    7  * Version: 1.5.6
     7 * Version: 1.5.7
    88 * License: GPLv2 or later
    99 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838define('LOFTY_API_PROXY', isset($_ENV['LOFTY_API_PROXY']) ? sanitize_url($_ENV['LOFTY_API_PROXY']) : 'https://lofty.com/wp-api/wp-plugin/');
    3939define('LOFTY_API_REFERRER', isset($_ENV['LOFTY_API_REFERRER']) ? sanitize_url($_ENV['LOFTY_API_REFERRER']) : '');
    40 define('LOFTY_BUILD_ID', isset($_ENV['LOFTY_BUILD_ID']) ? sanitize_text_field($_ENV['LOFTY_BUILD_ID']) : '1753318773190');
     40define('LOFTY_BUILD_ID', isset($_ENV['LOFTY_BUILD_ID']) ? sanitize_text_field($_ENV['LOFTY_BUILD_ID']) : '1753698974098');
    4141
    42 define('LOFTY_IDX_VERSION', '1.5.6');
     42define('LOFTY_IDX_VERSION', '1.5.7');
    4343
    4444define('LOFTY_IDX_PATH', plugin_dir_path(__FILE__));
  • lofty-idx/trunk/package.json

    r3333213 r3335283  
    22  "name": "lofty-idx-web",
    33  "private": true,
    4   "version": "1.5.6",
     4  "version": "1.5.7",
    55  "type": "module",
    66  "scripts": {
  • lofty-idx/trunk/readme.txt

    r3333213 r3335283  
    66Requires at least: 5.0
    77Tested up to: 6.7
    8 Stable tag: 1.5.6
     8Stable tag: 1.5.7
    99Requires PHP: 7.4
    1010License: GPLv2 or later
     
    149149= 1.5.6 =
    150150* Change key clear cache
     151
     152= 1.5.7 =
     153*  Fixed map search event
     154
  • lofty-idx/trunk/src/components/map-here/markers/aggre.vue

    r3333213 r3335283  
    8282      let { lat, lng } = this.data;
    8383      let zoom = this.map.getZoom();
    84      
    85       // 优化zoom递增逻辑,减少跳跃幅度
    8684      if (this.isMobile) {
    87         zoom += 1; // 从2改为1
     85        zoom += 2;
    8886      } else {
    89         zoom += zoom < 12 ? 1.5 : zoom <= 16 ? 1 : 0.5; // 减少递增幅度
     87        zoom += zoom < 10 ? 3 : zoom <= 16 ? 2 : 1;
    9088      }
    91      
    92       // 确保zoom不超过地图配置的最大值
    93       const maxZoom = this.map.getOptions().maxZoom || 20;
    94       zoom = Math.min(zoom, maxZoom);
    95      
    9689      this.map.getViewModel().setLookAtData(
    9790          { position: { lat, lng }, zoom },
Note: See TracChangeset for help on using the changeset viewer.