PageSourceSearch

https://assets.hiiker.app/vite/assets/TypesenseResponse-CgaS4DCT.js

js hiiker.app collected 2026-09-24 19:26:01 UTC 2,672 bytes, 2 lines download raw bytes

1import{a as j}from"./axios_client-7rBlZ4x9.js";import{p as C}from"./index-D1Fb0EBu.js";import{i as D}from"./index-BDyiCXYp.js";class f{constructor(t,r,e,n,u,o,i,c){this.facet_counts=t,this.found=r,this.hits=e,this.out_of=n,this.page=u,this.request_params=o,this.search_cutoff=i,this.search_time_ms=c}static async get(t="*",r=null,e=null,n=null,u=100,o={}){const i=j.create({headers:{"x-typesense-api-key":window.typesenseSearchApiKey,"Content-Type":"application/json"}});let c=this.createTypesensePostObject(e,t,r,n,u,o),y=await i.post(c.url,c.body);const p=o.collection||"hikes";let a={hits:y.data.results.filter(s=>s.hits).map(s=>s.hits).flat().map(s=>s!=null&&s.document?{...s,document:this.normaliseDocument(s.document,p)}:s)};return C(f,a)}static createTypesensePostObject(t,r,e=null,n=null,u=100,o={}){let i="";const c=o.collection||"hikes",y=o.queryBy&&o.queryBy.length>0?o.queryBy.join(","):"name,short_address,keywords",p=o.locationField||"location";if(t){const a=t.getNorthEast(),s=t.getSouthWest(),_=Math.abs(a.lat-s.lat)*.1,d=Math.abs(a.lng-s.lng)*.1,g=Math.min(90,a.lat+_),b=Math.max(-90,s.lat-_),x=a.lng+d,E=s.lng-d,w=[[b,E],[b,x],[g,x],[g,E]].map(([M,$])=>`${M}, ${$}`).join(", ");i=`${p}:(${w})`}if(e){const a=e.replace(/^&&+/,"").trim();a&&(i=i?`${i} && ${a}
1`:a)}const h=Math.max(1,n||1);return{url:"https://"+window.typesenseUrl+"/multi_search",body:{searches:[...Array(h).keys()].map(a=>a+1).map(a=>({collection:c,q:r,query_by:y,filter_by:i,per_page:`${u}`,page:a}))}}}static normaliseDocument(t,r){if(r!=="community_feed")return t;const e=typeof t.location=="string"?t.location:t.short_address;return{...t,id:t.id||`${t.item_type||"Community"}_${t.item_id||"0"}`,name:t.name||t.title||D.global.t("utils.typesense_response.community_activity"),short_address:t.short_address||e||"",static_map_url:t.static_map_url||t.static_map||"",location:t.location}}static locationCoordinates(t){return Array.isArray(t.location)?t.location:Array.isArray(t.geo_location)?t.geo_location:null}toGeoJson(){let t={};t.type="FeatureCollection";let r=this.hits.map(e=>{const n=f.locationCoordinates(e==null?void 0:e.document);return n?{type:"Feature",properties:e.document,geometry:{type:"Point",coordinates:[n[1],n[0]]}}:null}).filter(e=>e!==null);return t.features=r,t}}var m=(l=>(l.Easy="Easy",l.Medium="Medium",l.Difficult="Difficult",l.ExtraDifficult="Extra Difficult",l))(m||{});(l=>{function t(r){switch(r){case"Easy":return"Easy";case"Medium":return"Medium";case"Difficult":return"Difficult";case"Extra Difficult":return"Extra Difficult";default:return"Easy"}}l.fromString=t})(m||(m={}));export{m as D,f as T};
2//# sourceMappingURL=TypesenseResponse-CgaS4DCT.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.