@mapfirst.ai/react 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as _mapfirst_ai_core from '@mapfirst.ai/core';
3
3
  import { PropertyType, PriceLevel, MapFirstCore, BaseMapFirstOptions, MapState, Property, MapLibreNamespace, GoogleMapsNamespace, MapboxNamespace, MapFirstOptions } from '@mapfirst.ai/core';
4
+ export { ApiFiltersResponse, convertToApiFilters, processApiFilters } from '@mapfirst.ai/core';
4
5
  import * as React$1 from 'react';
5
6
  import React__default, { FunctionComponent, CSSProperties, ReactNode } from 'react';
6
7
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as _mapfirst_ai_core from '@mapfirst.ai/core';
3
3
  import { PropertyType, PriceLevel, MapFirstCore, BaseMapFirstOptions, MapState, Property, MapLibreNamespace, GoogleMapsNamespace, MapboxNamespace, MapFirstOptions } from '@mapfirst.ai/core';
4
+ export { ApiFiltersResponse, convertToApiFilters, processApiFilters } from '@mapfirst.ai/core';
4
5
  import * as React$1 from 'react';
5
6
  import React__default, { FunctionComponent, CSSProperties, ReactNode } from 'react';
6
7
 
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var Le=Object.create;var J=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Ie=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Be=(e,t)=>{for(var o in t)J(e,o,{get:t[o],enumerable:!0})},Se=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Me(t))!Te.call(e,a)&&a!==o&&J(e,a,{get:()=>t[a],enumerable:!(i=Ee(t,a))||i.enumerable});return e};var me=(e,t,o)=>(o=e!=null?Le(Ie(e)):{},Se(t||!e||!e.__esModule?J(o,"default",{value:e,enumerable:!0}):o,e)),He=e=>Se(J({},"__esModule",{value:!0}),e);var St={};Be(St,{Chip:()=>te,CloseIcon:()=>fe,EditIcon:()=>G,FilterChips:()=>ce,MarkerDebugList:()=>bt,MinRatingFilterChip:()=>Y,NextIcon:()=>ee,PriceRangeFilterChip:()=>oe,RestaurantPriceLevelChip:()=>ie,SearchIcon:()=>$,SmartFilter:()=>we,StarIcon:()=>ge,TransformedQueryChip:()=>ae,createMinRatingFilterLabel:()=>We,createPriceRangeFilterLabel:()=>_e,formatRatingValue:()=>re,renderStars:()=>Ce,useFilterScroll:()=>se,useGoogleMapsAttachment:()=>dt,useIsPortrait:()=>ue,useMapFirst:()=>ft,useMapFirstBoundsSearch:()=>ht,useMapFirstCore:()=>at,useMapFirstProperties:()=>st,useMapFirstSelectedProperty:()=>lt,useMapLibreAttachment:()=>ut,useMapboxAttachment:()=>mt,usePrimaryType:()=>ct,usePropertiesSearch:()=>gt,useSelectedMarker:()=>pt,useSmartFilterSearch:()=>yt,useTranslation:()=>E});module.exports=He(St);var m=me(require("react")),be=require("@mapfirst.ai/core");var q=require("react");var le=me(require("react"));var xe=me(require("react"));var w=require("react/jsx-runtime"),$=({className:e,style:t})=>(0,w.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:[(0,w.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,w.jsx)("path",{d:"m21 21-4.35-4.35"})]}),fe=({className:e,style:t})=>(0,w.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:[(0,w.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,w.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),G=({className:e,style:t})=>(0,w.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:[(0,w.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,w.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),ee=({className:e,style:t})=>(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:(0,w.jsx)("polyline",{points:"9 18 15 12 9 6"})}),ge=({className:e,style:t,fill:o="none"})=>(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:o,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:(0,w.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})});var ye=require("react/jsx-runtime"),Ne={position:"absolute",top:"-8px",right:"-8px",padding:"2px",borderRadius:"50%",backgroundColor:"white",border:"1px solid #03852e",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s"},De={width:"17px",height:"17px"},H=({onClick:e,style:t})=>{let[o,i]=xe.default.useState(!1);return(0,ye.jsx)("button",{style:{...Ne,backgroundColor:o?"#e5e5e5":"white",...t},onClick:e,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"aria-label":"Remove filter",children:(0,ye.jsx)(fe,{style:De})})};var _=require("react/jsx-runtime"),ze={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"8px",flexShrink:0,height:"34px"},te=({label:e,icon:t,remove:o,style:i})=>(0,_.jsxs)("div",{style:{...ze,...i},children:[t&&(0,_.jsx)("span",{style:{display:"flex",alignItems:"center"},children:t}),(0,_.jsx)("span",{style:{whiteSpace:"nowrap"},children:e}),(0,_.jsx)(H,{onClick:o})]});var ve=require("react");var U=require("react"),Ae={"smartFilter.typingPrompt":"Search for hotels, restaurants, or attractions...","smartFilter.nav.previous":"Previous filters","smartFilter.nav.next":"Next filters","smartFilter.toast.locationRequired":"Please select a location first","smartFilter.clearAll":"Clear all","smartFilter.minRating.suffix":"+","smartFilter.minRating.label":"{{value}}+","smartFilter.minRating.remove":"Remove rating filter","smartFilter.minRating.setTo":"Set rating to {{rating}}","smartFilter.priceRange.label":"Price Range","smartFilter.priceRange.remove":"Remove price filter","smartFilter.priceRange.edit":"Edit price","smartFilter.transformedQuery.remove":"Remove search query","smartFilter.transformedQuery.edit":"Edit search query","smartFilter.restaurantPriceLevel.label":"Price Level","smartFilter.restaurantPriceLevel.remove":"Remove price level filter","smartFilter.restaurantPriceLevel.none":"Any","smartFilter.restaurantPriceLevel.options.cheapEats":"Cheap Eats","smartFilter.restaurantPriceLevel.options.midRange":"Mid Range","smartFilter.restaurantPriceLevel.options.fineDining":"Fine Dining"},Oe=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e),E=(e,t)=>{let[o,i]=(0,U.useState)("en"),a=(0,U.useCallback)((u,p)=>{let n={...Ae,...e}[u]||u;return p&&Object.keys(p).forEach(s=>{n=n.replace(new RegExp(`{{${s}}}`,"g"),String(p[s]))}),n},[e]),d=(0,U.useCallback)((u,p)=>t?t(u,p):Oe(u,p),[t]);return{t:a,locale:o,setLocale:i,formatCurrency:d}};var W=require("react/jsx-runtime"),Ce=e=>{let t=[],o=Math.floor(e),i=e%1!==0,a={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},d={...a,backgroundColor:"#03852e"},u={...a,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};for(let r=0;r<o;r+=1)t.push((0,W.jsx)("span",{style:d},`full-${r}`));i&&t.push((0,W.jsx)("span",{style:u},"half"));let p=Math.max(0,5-Math.ceil(e));for(let r=0;r<p;r+=1)t.push((0,W.jsx)("span",{style:a},`empty-${r}`));return t},We=(e,t)=>(0,W.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,W.jsx)("span",{style:{display:"flex",gap:"1px",userSelect:"none"},children:Ce(e)})," ",t]}),re=e=>e.toFixed(1),_e=(e,t,o,i)=>`${i(e,o)} - ${i(t!=null?t:0,o)}`;var L=require("react/jsx-runtime"),Ve={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",gap:"8px",alignItems:"center",justifyContent:"center",flexShrink:0,height:"34px"},qe={display:"flex",gap:"1px",userSelect:"none"},he={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},ne={position:"absolute",top:0,height:"100%",cursor:"pointer",backgroundColor:"transparent",border:"none",padding:0},Y=({rating:e,onChange:t,onRemove:o,star:i=!1})=>{let[a,d]=(0,ve.useState)(null),{t:u}=E(),p=a!=null?a:e,r=g=>i&&g?g.toString():u("smartFilter.minRating.label",{value:re(g)}),n=u("smartFilter.minRating.remove"),s=g=>u("smartFilter.minRating.setTo",{rating:re(g)}),c=g=>{let b=g+1;return p>=b?"full":p>=b-.5?"half":"empty"},f=g=>{d(null),g!==e&&t(g)},v=g=>{var y;let b=g.relatedTarget;(!b||!((y=g.currentTarget.closest("[data-min-rating-chip]"))!=null&&y.contains(b)))&&d(null)};return(0,L.jsxs)("div",{style:Ve,"data-min-rating-chip":!0,children:[(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},onMouseLeave:()=>d(null),children:[(0,L.jsx)("div",{style:qe,children:Array.from({length:5}).map((g,b)=>{let y=c(b),h=b+1,P=h-.5;if(i)return(0,L.jsxs)("div",{style:{position:"relative",width:"16px",height:"16px"},children:[(0,L.jsx)(ge,{fill:p>=h?"#03852e":"none",style:{width:"16px",height:"16px",pointerEvents:"none"}}),(0,L.jsx)("button",{type:"button",style:{...ne,left:0,width:"50%",borderRadius:"50% 0 0 50%"},onMouseEnter:()=>d(P),onFocus:()=>d(P),onBlur:v,onClick:()=>f(P),"aria-label":s(P),title:r(P)}),(0,L.jsx)("button",{type:"button",style:{...ne,left:"50%",width:"50%",borderRadius:"0 50% 50% 0"},onMouseEnter:()=>d(h),onFocus:()=>d(h),onBlur:v,onClick:()=>f(h),"aria-label":s(h),title:r(h)})]},b);let R=y==="full"?{...he,backgroundColor:"#03852e"}:he,O={...he,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};return(0,L.jsxs)("div",{style:{position:"relative",width:"12px",height:"12px"},children:[(0,L.jsx)("span",{style:y==="half"?O:R}),(0,L.jsx)("button",{type:"button",style:{...ne,left:0,width:"50%",borderRadius:"50% 0 0 50%",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>d(P),onFocus:()=>d(P),onBlur:v,onClick:()=>f(P),"aria-label":s(P),title:r(P)}),(0,L.jsx)("button",{type:"button",style:{...ne,left:"50%",width:"50%",borderRadius:"0 50% 50% 0",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>d(h),onFocus:()=>d(h),onBlur:v,onClick:()=>f(h),"aria-label":s(h),title:r(h)})]},b)})}),(0,L.jsx)("span",{style:{whiteSpace:"nowrap"},children:r(p)})]}),(0,L.jsx)(H,{onClick:o})]})};var V=require("react");var F=require("react/jsx-runtime"),Qe={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"8px",flexShrink:0,height:"34px"},Ke={outline:"none",fontSize:"16px",backgroundColor:"transparent",borderRadius:"2px",padding:"2px 8px",width:"64px",textAlign:"center",border:"none"},$e={padding:"4px",borderRadius:"50%",cursor:"pointer",transition:"background-color 0.2s",border:"none",backgroundColor:"transparent",color:"#737373",display:"flex",alignItems:"center",justifyContent:"center"},Pe=({boundary:e,label:t,value:o,placeholder:i,currency:a,isOptional:d=!1,showRemoveButton:u=!1,removeLabel:p,editLabel:r,showAddWhenEmpty:n=!1,onCommit:s,onRemove:c})=>{let[f,v]=(0,V.useState)(o!==void 0?String(o):""),[g,b]=(0,V.useState)(!1),[y,h]=(0,V.useState)(!1),P=o!==void 0;(0,V.useEffect)(()=>{v(o!==void 0?String(o):""),b(!1)},[o]);let R=()=>{v(o!==void 0?String(o):"")},O=()=>{if(f.trim()===""){if(d){s(void 0),v("");return}R();return}let l=Number(f);if(!Number.isFinite(l)){R();return}let M=Math.max(0,l);if(M===o){R();return}s(M)};return(0,F.jsxs)("div",{style:Qe,children:[(0,F.jsx)("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:t}),g?(0,F.jsx)("input",{value:f,onChange:l=>{let M=l.target.value.replace(/[^\d]/g,"");v(M)},onBlur:()=>{O(),b(!1)},onKeyDown:l=>{if(l.key==="Enter"){l.preventDefault(),l.currentTarget.blur(),b(!1);return}if(l.key==="Escape"){l.preventDefault(),R(),l.currentTarget.blur(),b(!1);return}l.key.length===1&&/[0-9]/.test(l.key)||l.key==="Backspace"||l.key==="Delete"||l.key==="Tab"||l.key==="ArrowLeft"||l.key==="ArrowRight"||l.key==="Home"||l.key==="End"||l.preventDefault()},placeholder:i,inputMode:"numeric",pattern:"[0-9]*","aria-label":t,style:Ke,autoFocus:!0}):P?(0,F.jsxs)("span",{style:{fontSize:"16px"},children:[a,o]}):n?(0,F.jsx)("button",{type:"button",style:{fontSize:"16px",color:"#737373",cursor:"pointer",border:"none",backgroundColor:"transparent",padding:0},onClick:()=>b(!0),"aria-label":r,children:"+"}):(0,F.jsx)("span",{style:{fontSize:"16px",color:"#737373"},children:"-"}),(!n||n&&g)&&(0,F.jsx)("span",{style:{color:"#737373",fontSize:"12px"},children:a}),!g&&(!n||P)&&(0,F.jsx)("button",{type:"button",style:{...$e,backgroundColor:y?"#e5e5e5":"transparent"},"aria-label":r,title:r,onClick:()=>b(!0),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:(0,F.jsx)(G,{})}),u&&(0,F.jsx)(H,{onClick:c})]})},oe=({priceRange:e,currency:t,onChange:o,onRemove:i})=>{let{t:a}=E(),d="Min",u="Max",p=a("smartFilter.priceRange.remove"),r=a("smartFilter.priceRange.edit"),n=(s,c)=>{let f={min:e.min,max:e.max};s==="min"?(f.min=c,c!==void 0&&e.max!==void 0&&c>e.max&&(f.max=c)):(f.max=c,c!==void 0&&e.min!==void 0&&c<e.min&&(f.min=c)),(f.min!==e.min||f.max!==e.max)&&o(f)};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Pe,{boundary:"min",label:d,value:e.min,currency:t,editLabel:r,showRemoveButton:e.min!==void 0&&e.min!==0,onCommit:s=>n("min",s),onRemove:i}),(0,F.jsx)(Pe,{boundary:"max",label:u,value:e.max,currency:t,isOptional:!0,showRemoveButton:e.max!==void 0,removeLabel:p,editLabel:r,showAddWhenEmpty:!0,onCommit:s=>n("max",s),onRemove:i})]})};var T=require("react/jsx-runtime"),Ge={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"16px",flexShrink:0,height:"34px"},ke=[{value:"Cheap Eats",key:"cheapEats"},{value:"Mid Range",key:"midRange"},{value:"Fine Dining",key:"fineDining"}],ie=({values:e,onChange:t,onRemove:o})=>{let{t:i}=E(),a=i("smartFilter.restaurantPriceLevel.label"),d=i("smartFilter.restaurantPriceLevel.remove"),u=i("smartFilter.restaurantPriceLevel.none"),p=r=>{let{value:n,checked:s}=r.target,c=n,f=new Set(e);s?f.add(c):f.delete(c);let v=ke.filter(g=>f.has(g.value)).map(g=>g.value);t(v)};return(0,T.jsxs)("div",{style:Ge,children:[(0,T.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[(0,T.jsx)("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:a}),(0,T.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[ke.map(r=>{let n=i(`smartFilter.restaurantPriceLevel.options.${r.key}`),s=`price-level-${r.key}`;return(0,T.jsxs)("label",{htmlFor:s,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",cursor:"pointer"},children:[(0,T.jsx)("input",{id:s,type:"checkbox",value:r.value,checked:e.includes(r.value),onChange:p,style:{accentColor:"#03852e",cursor:"pointer"}}),(0,T.jsx)("span",{children:n})]},r.value)}),e.length===0&&(0,T.jsx)("span",{style:{fontSize:"12px",color:"#737373"},children:u})]})]}),(0,T.jsx)(H,{onClick:o})]})};var A=require("react");var D=require("react/jsx-runtime"),Ue={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"8px",flexShrink:0,userSelect:"none",height:"34px"},Ye={backgroundColor:"#ececec",borderRadius:"2px",padding:"2px 8px",outline:"none",fontSize:"16px",minWidth:"8ch",border:"none"},Ze={padding:"4px",borderRadius:"50%",cursor:"pointer",transition:"background-color 0.2s",color:"#737373",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},ae=({value:e,onChange:t,onRemove:o})=>{let i=(0,A.useRef)(null),[a,d]=(0,A.useState)(e),[u,p]=(0,A.useState)(!1),[r,n]=(0,A.useState)(!1),{t:s}=E(),c=s("smartFilter.transformedQuery.remove"),f=s("smartFilter.transformedQuery.edit");(0,A.useEffect)(()=>{d(e),p(!1)},[e]);let v=()=>{let y=a.trim();if(!y.length){d(e);return}y!==e&&t(y)};return(0,D.jsxs)("div",{style:Ue,children:[(0,D.jsx)($,{style:{width:"16px",height:"16px",color:"#03852e"}}),u?(0,D.jsx)("input",{ref:i,value:a,onChange:y=>{d(y.target.value)},onBlur:()=>{v(),p(!1)},onKeyDown:y=>{if(y.key==="Enter"){y.preventDefault(),y.currentTarget.blur();return}if(y.key==="Escape"){y.preventDefault(),d(e),y.currentTarget.blur();return}},"aria-label":f,style:Ye,autoFocus:!0}):(0,D.jsx)("span",{style:{fontSize:"16px"},children:e}),!u&&(0,D.jsx)("button",{type:"button",style:{...Ze,backgroundColor:r?"#e5e5e5":"transparent"},"aria-label":f,title:f,onClick:()=>p(!0),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:(0,D.jsx)(G,{})}),(0,D.jsx)(H,{onClick:o})]})};var N=require("react"),se=e=>{let t=(0,N.useRef)(null),[o,i]=(0,N.useState)(!0),[a,d]=(0,N.useState)(!0),u=(0,N.useCallback)(()=>{let r=t.current;if(!r){i(!0),d(!0);return}let{scrollLeft:n,scrollWidth:s,clientWidth:c}=r;i(n<=0),d(n+c>=s-1)},[]);(0,N.useEffect)(()=>{let r=t.current;if(u(),!r)return;let n=()=>u();return r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",u),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",u)}},[e,u]);let p=(0,N.useCallback)(r=>{let n=t.current;if(!n)return;let s=n.clientWidth*.7;n.scrollBy({left:r==="next"?s:-s,behavior:"smooth"})},[]);return{scrollerRef:t,atStart:o,atEnd:a,scrollByDir:p}};var C=require("react/jsx-runtime"),je={position:"relative",width:"100%"},Xe={display:"flex",gap:"8px",overflowX:"auto",alignItems:"center",width:"100%",scrollbarWidth:"none",msOverflowStyle:"none"},Fe={pointerEvents:"none",position:"absolute",top:0,bottom:0,width:"40px"},Re={position:"absolute",top:"50%",transform:"translateY(-50%)",backgroundColor:"white",color:"#003c30",border:"1px solid #003c30",padding:"4px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",cursor:"pointer"},ce=({filters:e,isPortrait:t,currency:o,minRatingSuffix:i,clearAllLabel:a,previousFiltersLabel:d,nextFiltersLabel:u,formatCurrency:p,onFilterChange:r,onResetFilters:n,onClearAll:s})=>{let{scrollerRef:c,atStart:f,atEnd:v,scrollByDir:g}=se(e.length),{t:b}=E(),[y,h]=le.default.useState(null),[P,R]=le.default.useState(!1),[O,K]=le.default.useState(!1),Z={...Xe,padding:t?"8px 16px":"8px"};return(0,C.jsxs)("div",{style:je,children:[(0,C.jsxs)("div",{ref:c,style:{...Z,WebkitOverflowScrolling:"touch"},children:[(0,C.jsx)("style",{children:`
1
+ "use strict";var Ee=Object.create;var J=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Te=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var He=(e,t)=>{for(var o in t)J(e,o,{get:t[o],enumerable:!0})},xe=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ie(t))!Be.call(e,s)&&s!==o&&J(e,s,{get:()=>t[s],enumerable:!(i=Me(t,s))||i.enumerable});return e};var fe=(e,t,o)=>(o=e!=null?Ee(Te(e)):{},xe(t||!e||!e.__esModule?J(o,"default",{value:e,enumerable:!0}):o,e)),Ne=e=>xe(J({},"__esModule",{value:!0}),e);var xt={};He(xt,{Chip:()=>te,CloseIcon:()=>ge,EditIcon:()=>G,FilterChips:()=>ce,MarkerDebugList:()=>St,MinRatingFilterChip:()=>Y,NextIcon:()=>ee,PriceRangeFilterChip:()=>oe,RestaurantPriceLevelChip:()=>ie,SearchIcon:()=>$,SmartFilter:()=>Le,StarIcon:()=>ye,TransformedQueryChip:()=>se,convertToApiFilters:()=>de.convertToApiFilters,createMinRatingFilterLabel:()=>_e,createPriceRangeFilterLabel:()=>Ve,formatRatingValue:()=>re,processApiFilters:()=>de.processApiFilters,renderStars:()=>ve,useFilterScroll:()=>ae,useGoogleMapsAttachment:()=>mt,useIsPortrait:()=>ue,useMapFirst:()=>gt,useMapFirstBoundsSearch:()=>bt,useMapFirstCore:()=>at,useMapFirstProperties:()=>lt,useMapFirstSelectedProperty:()=>ct,useMapLibreAttachment:()=>dt,useMapboxAttachment:()=>ft,usePrimaryType:()=>pt,usePropertiesSearch:()=>yt,useSelectedMarker:()=>ut,useSmartFilterSearch:()=>ht,useTranslation:()=>E});module.exports=Ne(xt);var m=fe(require("react")),Se=require("@mapfirst.ai/core"),de=require("@mapfirst.ai/core");var q=require("react");var le=fe(require("react"));var Ce=fe(require("react"));var w=require("react/jsx-runtime"),$=({className:e,style:t})=>(0,w.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:[(0,w.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,w.jsx)("path",{d:"m21 21-4.35-4.35"})]}),ge=({className:e,style:t})=>(0,w.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:[(0,w.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,w.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),G=({className:e,style:t})=>(0,w.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:[(0,w.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,w.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),ee=({className:e,style:t})=>(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:(0,w.jsx)("polyline",{points:"9 18 15 12 9 6"})}),ye=({className:e,style:t,fill:o="none"})=>(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:o,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{width:"1em",height:"1em",...t},children:(0,w.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})});var he=require("react/jsx-runtime"),De={position:"absolute",top:"-8px",right:"-8px",padding:"2px",borderRadius:"50%",backgroundColor:"white",border:"1px solid #03852e",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s"},Ae={width:"17px",height:"17px"},H=({onClick:e,style:t})=>{let[o,i]=Ce.default.useState(!1);return(0,he.jsx)("button",{style:{...De,backgroundColor:o?"#e5e5e5":"white",...t},onClick:e,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"aria-label":"Remove filter",children:(0,he.jsx)(ge,{style:Ae})})};var _=require("react/jsx-runtime"),ze={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"8px",flexShrink:0,height:"34px"},te=({label:e,icon:t,remove:o,style:i})=>(0,_.jsxs)("div",{style:{...ze,...i},children:[t&&(0,_.jsx)("span",{style:{display:"flex",alignItems:"center"},children:t}),(0,_.jsx)("span",{style:{whiteSpace:"nowrap"},children:e}),(0,_.jsx)(H,{onClick:o})]});var Pe=require("react");var U=require("react"),Oe={"smartFilter.typingPrompt":"Search for hotels, restaurants, or attractions...","smartFilter.nav.previous":"Previous filters","smartFilter.nav.next":"Next filters","smartFilter.toast.locationRequired":"Please select a location first","smartFilter.clearAll":"Clear all","smartFilter.minRating.suffix":"+","smartFilter.minRating.label":"{{value}}+","smartFilter.minRating.remove":"Remove rating filter","smartFilter.minRating.setTo":"Set rating to {{rating}}","smartFilter.priceRange.label":"Price Range","smartFilter.priceRange.remove":"Remove price filter","smartFilter.priceRange.edit":"Edit price","smartFilter.transformedQuery.remove":"Remove search query","smartFilter.transformedQuery.edit":"Edit search query","smartFilter.restaurantPriceLevel.label":"Price Level","smartFilter.restaurantPriceLevel.remove":"Remove price level filter","smartFilter.restaurantPriceLevel.none":"Any","smartFilter.restaurantPriceLevel.options.cheapEats":"Cheap Eats","smartFilter.restaurantPriceLevel.options.midRange":"Mid Range","smartFilter.restaurantPriceLevel.options.fineDining":"Fine Dining"},We=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e),E=(e,t)=>{let[o,i]=(0,U.useState)("en"),s=(0,U.useCallback)((u,p)=>{let n={...Oe,...e}[u]||u;return p&&Object.keys(p).forEach(a=>{n=n.replace(new RegExp(`{{${a}}}`,"g"),String(p[a]))}),n},[e]),d=(0,U.useCallback)((u,p)=>t?t(u,p):We(u,p),[t]);return{t:s,locale:o,setLocale:i,formatCurrency:d}};var W=require("react/jsx-runtime"),ve=e=>{let t=[],o=Math.floor(e),i=e%1!==0,s={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},d={...s,backgroundColor:"#03852e"},u={...s,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};for(let r=0;r<o;r+=1)t.push((0,W.jsx)("span",{style:d},`full-${r}`));i&&t.push((0,W.jsx)("span",{style:u},"half"));let p=Math.max(0,5-Math.ceil(e));for(let r=0;r<p;r+=1)t.push((0,W.jsx)("span",{style:s},`empty-${r}`));return t},_e=(e,t)=>(0,W.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,W.jsx)("span",{style:{display:"flex",gap:"1px",userSelect:"none"},children:ve(e)})," ",t]}),re=e=>e.toFixed(1),Ve=(e,t,o,i)=>`${i(e,o)} - ${i(t!=null?t:0,o)}`;var L=require("react/jsx-runtime"),qe={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",gap:"8px",alignItems:"center",justifyContent:"center",flexShrink:0,height:"34px"},Qe={display:"flex",gap:"1px",userSelect:"none"},be={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},ne={position:"absolute",top:0,height:"100%",cursor:"pointer",backgroundColor:"transparent",border:"none",padding:0},Y=({rating:e,onChange:t,onRemove:o,star:i=!1})=>{let[s,d]=(0,Pe.useState)(null),{t:u}=E(),p=s!=null?s:e,r=g=>i&&g?g.toString():u("smartFilter.minRating.label",{value:re(g)}),n=u("smartFilter.minRating.remove"),a=g=>u("smartFilter.minRating.setTo",{rating:re(g)}),c=g=>{let b=g+1;return p>=b?"full":p>=b-.5?"half":"empty"},f=g=>{d(null),g!==e&&t(g)},v=g=>{var y;let b=g.relatedTarget;(!b||!((y=g.currentTarget.closest("[data-min-rating-chip]"))!=null&&y.contains(b)))&&d(null)};return(0,L.jsxs)("div",{style:qe,"data-min-rating-chip":!0,children:[(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},onMouseLeave:()=>d(null),children:[(0,L.jsx)("div",{style:Qe,children:Array.from({length:5}).map((g,b)=>{let y=c(b),h=b+1,P=h-.5;if(i)return(0,L.jsxs)("div",{style:{position:"relative",width:"16px",height:"16px"},children:[(0,L.jsx)(ye,{fill:p>=h?"#03852e":"none",style:{width:"16px",height:"16px",pointerEvents:"none"}}),(0,L.jsx)("button",{type:"button",style:{...ne,left:0,width:"50%",borderRadius:"50% 0 0 50%"},onMouseEnter:()=>d(P),onFocus:()=>d(P),onBlur:v,onClick:()=>f(P),"aria-label":a(P),title:r(P)}),(0,L.jsx)("button",{type:"button",style:{...ne,left:"50%",width:"50%",borderRadius:"0 50% 50% 0"},onMouseEnter:()=>d(h),onFocus:()=>d(h),onBlur:v,onClick:()=>f(h),"aria-label":a(h),title:r(h)})]},b);let R=y==="full"?{...be,backgroundColor:"#03852e"}:be,O={...be,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};return(0,L.jsxs)("div",{style:{position:"relative",width:"12px",height:"12px"},children:[(0,L.jsx)("span",{style:y==="half"?O:R}),(0,L.jsx)("button",{type:"button",style:{...ne,left:0,width:"50%",borderRadius:"50% 0 0 50%",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>d(P),onFocus:()=>d(P),onBlur:v,onClick:()=>f(P),"aria-label":a(P),title:r(P)}),(0,L.jsx)("button",{type:"button",style:{...ne,left:"50%",width:"50%",borderRadius:"0 50% 50% 0",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>d(h),onFocus:()=>d(h),onBlur:v,onClick:()=>f(h),"aria-label":a(h),title:r(h)})]},b)})}),(0,L.jsx)("span",{style:{whiteSpace:"nowrap"},children:r(p)})]}),(0,L.jsx)(H,{onClick:o})]})};var V=require("react");var F=require("react/jsx-runtime"),Ke={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"8px",flexShrink:0,height:"34px"},$e={outline:"none",fontSize:"16px",backgroundColor:"transparent",borderRadius:"2px",padding:"2px 8px",width:"64px",textAlign:"center",border:"none"},Ge={padding:"4px",borderRadius:"50%",cursor:"pointer",transition:"background-color 0.2s",border:"none",backgroundColor:"transparent",color:"#737373",display:"flex",alignItems:"center",justifyContent:"center"},ke=({boundary:e,label:t,value:o,placeholder:i,currency:s,isOptional:d=!1,showRemoveButton:u=!1,removeLabel:p,editLabel:r,showAddWhenEmpty:n=!1,onCommit:a,onRemove:c})=>{let[f,v]=(0,V.useState)(o!==void 0?String(o):""),[g,b]=(0,V.useState)(!1),[y,h]=(0,V.useState)(!1),P=o!==void 0;(0,V.useEffect)(()=>{v(o!==void 0?String(o):""),b(!1)},[o]);let R=()=>{v(o!==void 0?String(o):"")},O=()=>{if(f.trim()===""){if(d){a(void 0),v("");return}R();return}let l=Number(f);if(!Number.isFinite(l)){R();return}let M=Math.max(0,l);if(M===o){R();return}a(M)};return(0,F.jsxs)("div",{style:Ke,children:[(0,F.jsx)("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:t}),g?(0,F.jsx)("input",{value:f,onChange:l=>{let M=l.target.value.replace(/[^\d]/g,"");v(M)},onBlur:()=>{O(),b(!1)},onKeyDown:l=>{if(l.key==="Enter"){l.preventDefault(),l.currentTarget.blur(),b(!1);return}if(l.key==="Escape"){l.preventDefault(),R(),l.currentTarget.blur(),b(!1);return}l.key.length===1&&/[0-9]/.test(l.key)||l.key==="Backspace"||l.key==="Delete"||l.key==="Tab"||l.key==="ArrowLeft"||l.key==="ArrowRight"||l.key==="Home"||l.key==="End"||l.preventDefault()},placeholder:i,inputMode:"numeric",pattern:"[0-9]*","aria-label":t,style:$e,autoFocus:!0}):P?(0,F.jsxs)("span",{style:{fontSize:"16px"},children:[s,o]}):n?(0,F.jsx)("button",{type:"button",style:{fontSize:"16px",color:"#737373",cursor:"pointer",border:"none",backgroundColor:"transparent",padding:0},onClick:()=>b(!0),"aria-label":r,children:"+"}):(0,F.jsx)("span",{style:{fontSize:"16px",color:"#737373"},children:"-"}),(!n||n&&g)&&(0,F.jsx)("span",{style:{color:"#737373",fontSize:"12px"},children:s}),!g&&(!n||P)&&(0,F.jsx)("button",{type:"button",style:{...Ge,backgroundColor:y?"#e5e5e5":"transparent"},"aria-label":r,title:r,onClick:()=>b(!0),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:(0,F.jsx)(G,{})}),u&&(0,F.jsx)(H,{onClick:c})]})},oe=({priceRange:e,currency:t,onChange:o,onRemove:i})=>{let{t:s}=E(),d="Min",u="Max",p=s("smartFilter.priceRange.remove"),r=s("smartFilter.priceRange.edit"),n=(a,c)=>{let f={min:e.min,max:e.max};a==="min"?(f.min=c,c!==void 0&&e.max!==void 0&&c>e.max&&(f.max=c)):(f.max=c,c!==void 0&&e.min!==void 0&&c<e.min&&(f.min=c)),(f.min!==e.min||f.max!==e.max)&&o(f)};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ke,{boundary:"min",label:d,value:e.min,currency:t,editLabel:r,showRemoveButton:e.min!==void 0&&e.min!==0,onCommit:a=>n("min",a),onRemove:i}),(0,F.jsx)(ke,{boundary:"max",label:u,value:e.max,currency:t,isOptional:!0,showRemoveButton:e.max!==void 0,removeLabel:p,editLabel:r,showAddWhenEmpty:!0,onCommit:a=>n("max",a),onRemove:i})]})};var T=require("react/jsx-runtime"),Ue={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"16px",flexShrink:0,height:"34px"},Fe=[{value:"Cheap Eats",key:"cheapEats"},{value:"Mid Range",key:"midRange"},{value:"Fine Dining",key:"fineDining"}],ie=({values:e,onChange:t,onRemove:o})=>{let{t:i}=E(),s=i("smartFilter.restaurantPriceLevel.label"),d=i("smartFilter.restaurantPriceLevel.remove"),u=i("smartFilter.restaurantPriceLevel.none"),p=r=>{let{value:n,checked:a}=r.target,c=n,f=new Set(e);a?f.add(c):f.delete(c);let v=Fe.filter(g=>f.has(g.value)).map(g=>g.value);t(v)};return(0,T.jsxs)("div",{style:Ue,children:[(0,T.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[(0,T.jsx)("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:s}),(0,T.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[Fe.map(r=>{let n=i(`smartFilter.restaurantPriceLevel.options.${r.key}`),a=`price-level-${r.key}`;return(0,T.jsxs)("label",{htmlFor:a,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",cursor:"pointer"},children:[(0,T.jsx)("input",{id:a,type:"checkbox",value:r.value,checked:e.includes(r.value),onChange:p,style:{accentColor:"#03852e",cursor:"pointer"}}),(0,T.jsx)("span",{children:n})]},r.value)}),e.length===0&&(0,T.jsx)("span",{style:{fontSize:"12px",color:"#737373"},children:u})]})]}),(0,T.jsx)(H,{onClick:o})]})};var z=require("react");var D=require("react/jsx-runtime"),Ye={position:"relative",backgroundColor:"white",color:"black",fontSize:"14px",borderRadius:"9999px",padding:"0 16px",paddingRight:"20px",border:"1px solid #03852e",display:"flex",alignItems:"center",gap:"8px",flexShrink:0,userSelect:"none",height:"34px"},Ze={backgroundColor:"#ececec",borderRadius:"2px",padding:"2px 8px",outline:"none",fontSize:"16px",minWidth:"8ch",border:"none"},je={padding:"4px",borderRadius:"50%",cursor:"pointer",transition:"background-color 0.2s",color:"#737373",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},se=({value:e,onChange:t,onRemove:o})=>{let i=(0,z.useRef)(null),[s,d]=(0,z.useState)(e),[u,p]=(0,z.useState)(!1),[r,n]=(0,z.useState)(!1),{t:a}=E(),c=a("smartFilter.transformedQuery.remove"),f=a("smartFilter.transformedQuery.edit");(0,z.useEffect)(()=>{d(e),p(!1)},[e]);let v=()=>{let y=s.trim();if(!y.length){d(e);return}y!==e&&t(y)};return(0,D.jsxs)("div",{style:Ye,children:[(0,D.jsx)($,{style:{width:"16px",height:"16px",color:"#03852e"}}),u?(0,D.jsx)("input",{ref:i,value:s,onChange:y=>{d(y.target.value)},onBlur:()=>{v(),p(!1)},onKeyDown:y=>{if(y.key==="Enter"){y.preventDefault(),y.currentTarget.blur();return}if(y.key==="Escape"){y.preventDefault(),d(e),y.currentTarget.blur();return}},"aria-label":f,style:Ze,autoFocus:!0}):(0,D.jsx)("span",{style:{fontSize:"16px"},children:e}),!u&&(0,D.jsx)("button",{type:"button",style:{...je,backgroundColor:r?"#e5e5e5":"transparent"},"aria-label":f,title:f,onClick:()=>p(!0),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:(0,D.jsx)(G,{})}),(0,D.jsx)(H,{onClick:o})]})};var N=require("react"),ae=e=>{let t=(0,N.useRef)(null),[o,i]=(0,N.useState)(!0),[s,d]=(0,N.useState)(!0),u=(0,N.useCallback)(()=>{let r=t.current;if(!r){i(!0),d(!0);return}let{scrollLeft:n,scrollWidth:a,clientWidth:c}=r;i(n<=0),d(n+c>=a-1)},[]);(0,N.useEffect)(()=>{let r=t.current;if(u(),!r)return;let n=()=>u();return r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",u),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",u)}},[e,u]);let p=(0,N.useCallback)(r=>{let n=t.current;if(!n)return;let a=n.clientWidth*.7;n.scrollBy({left:r==="next"?a:-a,behavior:"smooth"})},[]);return{scrollerRef:t,atStart:o,atEnd:s,scrollByDir:p}};var C=require("react/jsx-runtime"),Xe={position:"relative",width:"100%"},Je={display:"flex",gap:"8px",overflowX:"auto",alignItems:"center",width:"100%",scrollbarWidth:"none",msOverflowStyle:"none"},Re={pointerEvents:"none",position:"absolute",top:0,bottom:0,width:"40px"},we={position:"absolute",top:"50%",transform:"translateY(-50%)",backgroundColor:"white",color:"#003c30",border:"1px solid #003c30",padding:"4px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",cursor:"pointer"},ce=({filters:e,isPortrait:t,currency:o,minRatingSuffix:i,clearAllLabel:s,previousFiltersLabel:d,nextFiltersLabel:u,formatCurrency:p,onFilterChange:r,onResetFilters:n,onClearAll:a})=>{let{scrollerRef:c,atStart:f,atEnd:v,scrollByDir:g}=ae(e.length),{t:b}=E(),[y,h]=le.default.useState(null),[P,R]=le.default.useState(!1),[O,K]=le.default.useState(!1),Z={...Je,padding:t?"8px 16px":"8px"};return(0,C.jsxs)("div",{style:Xe,children:[(0,C.jsxs)("div",{ref:c,style:{...Z,WebkitOverflowScrolling:"touch"},children:[(0,C.jsx)("style",{children:`
2
2
  div::-webkit-scrollbar {
3
3
  display: none;
4
4
  }
5
- `}),(0,C.jsx)("button",{style:{flexShrink:0,backgroundColor:P?"#03a03e":"#03852e",borderRadius:"50%",padding:"8px",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s"},onClick:n,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:(0,C.jsx)($,{style:{width:"20px",height:"20px",color:"white"}})}),e.map(l=>{var j,X,z;let M=()=>(0,C.jsx)(te,{label:l.label,icon:l.icon,remove:()=>{r(e.filter(S=>S.id!==l.id))}},l.id);if(l.type==="minRating"){let S=(j=l.numericValue)!=null?j:Number(l.value);return Number.isFinite(S)?(0,C.jsx)(Y,{rating:S,onChange:k=>{let x=e.map(I=>I.id===l.id?{...I,numericValue:k,value:String(k)}:I);r(x)},onRemove:()=>void r(e.filter(k=>k.id!==l.id))},l.id):M()}if(l.type==="starRating"){let S=(X=l.numericValue)!=null?X:Number(l.value);return Number.isFinite(S)?(0,C.jsx)(Y,{star:!0,rating:S,onChange:k=>{let x=e.map(I=>I.id===l.id?{...I,numericValue:k,value:String(k)}:I);r(x)},onRemove:()=>void r(e.filter(k=>k.id!==l.id))},l.id):M()}return l.type==="priceRange"&&l.priceRange?(0,C.jsx)(oe,{priceRange:l.priceRange,currency:o,onChange:S=>{let k=e.map(x=>x.id===l.id?{...x,priceRange:S}:x);r(k)},onRemove:()=>void r(e.filter(S=>S.id!==l.id))},l.id):l.type==="transformed_query"?(0,C.jsx)(ae,{value:l.value,onChange:S=>{let k=e.map(x=>x.id===l.id?{...x,value:S}:x);r(k)},onRemove:()=>void r(e.filter(S=>S.id!==l.id))},l.id):l.type==="selected_restaurant_price_levels"?(0,C.jsx)(ie,{values:(z=l.priceLevels)!=null?z:[],onChange:S=>{let k=e.map(x=>x.id===l.id?{...x,priceLevels:S}:x);r(k)},onRemove:()=>void r(e.filter(S=>S.id!==l.id))},l.id):M()}),(0,C.jsx)("button",{style:{flexShrink:0,padding:"4px 16px",borderRadius:"9999px",cursor:"pointer",fontSize:"14px",userSelect:"none",border:"none",backgroundColor:O?"#e5e5e5":"transparent",transition:"background-color 0.2s"},onClick:s,onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:a})]}),!f&&(0,C.jsx)("div",{"aria-hidden":"true",style:{...Fe,left:0,background:"linear-gradient(to right, white, transparent)"}}),!v&&(0,C.jsx)("div",{"aria-hidden":"true",style:{...Fe,right:0,background:"linear-gradient(to left, white, transparent)"}}),!f&&(0,C.jsx)("button",{type:"button","aria-label":d,style:{...Re,left:"4px",transform:"translateY(-50%) rotate(180deg)",backgroundColor:y==="prev"?"#e5e5e5":"white"},onClick:()=>g("prev"),onMouseEnter:()=>h("prev"),onMouseLeave:()=>h(null),children:(0,C.jsx)(ee,{style:{width:"20px",height:"20px"}})}),!v&&(0,C.jsx)("button",{type:"button","aria-label":u,style:{...Re,right:"4px",backgroundColor:y==="next"?"#e5e5e5":"white"},onClick:()=>g("next"),onMouseEnter:()=>h("next"),onMouseLeave:()=>h(null),children:(0,C.jsx)(ee,{style:{width:"20px",height:"20px"}})})]})};var pe=require("react"),ue=()=>{let[e,t]=(0,pe.useState)(typeof window!="undefined"?window.innerHeight>window.innerWidth:!1);return(0,pe.useEffect)(()=>{if(typeof window=="undefined")return;let o=()=>{t(window.innerHeight>window.innerWidth)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e};var B=require("react/jsx-runtime"),Je={position:"relative",display:"flex",flexDirection:"column",gap:"8px",width:"100%"},et={position:"relative",display:"flex",alignItems:"center",gap:"8px",width:"100%"},tt={position:"relative",display:"flex",alignItems:"center",flex:1,backgroundColor:"white",borderRadius:"24px",border:"1px solid #e5e5e5",padding:"0 16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},rt={flex:1,border:"none",outline:"none",fontSize:"16px",backgroundColor:"transparent",color:"#000",padding:"10px"},nt={position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)"},ot={width:"20px",height:"20px",border:"2px solid #e5e5e5",borderTop:"2px solid #03852e",borderRadius:"50%",animation:"spin 1s linear infinite"},it={position:"absolute",padding:"10px",color:"#737373",pointerEvents:"none",fontSize:"16px"},we=({mapFirst:e,filters:t,value:o,isSearching:i=!1,placeholder:a,onSearch:d,onFilterChange:u,onValueChange:p,showTypingPrompt:r=!0,customTranslations:n,currency:s="USD",style:c,inputStyle:f,containerStyle:v})=>{let[g,b]=(0,q.useState)(""),y=o!==void 0?o:g,h=p||b,P=ue(),{t:R,formatCurrency:O}=E(n),K=R("smartFilter.minRating.suffix"),Z=a||R("smartFilter.typingPrompt"),l=R("smartFilter.nav.previous"),M=R("smartFilter.nav.next"),j=R("smartFilter.clearAll"),X=async x=>{x.preventDefault();let I=y.trim();if(!(!I||i))try{await d(I)}catch(de){console.error("Search error:",de)}},z=(0,q.useCallback)(async(x,I)=>{if(!i)try{await u(x)}catch(de){console.error("Filter change error:",de)}},[i,u]),S=(0,q.useCallback)(()=>{z([])},[z]),k=(0,q.useCallback)(()=>{z([],!0),h("")},[z,h]);return(0,B.jsxs)("div",{style:{...Je,...v},children:[(0,B.jsx)("style",{children:`
5
+ `}),(0,C.jsx)("button",{style:{flexShrink:0,backgroundColor:P?"#03a03e":"#03852e",borderRadius:"50%",padding:"8px",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s"},onClick:n,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:(0,C.jsx)($,{style:{width:"20px",height:"20px",color:"white"}})}),e.map(l=>{var j,X,A;let M=()=>(0,C.jsx)(te,{label:l.label,icon:l.icon,remove:()=>{r(e.filter(S=>S.id!==l.id))}},l.id);if(l.type==="minRating"){let S=(j=l.numericValue)!=null?j:Number(l.value);return Number.isFinite(S)?(0,C.jsx)(Y,{rating:S,onChange:k=>{let x=e.map(I=>I.id===l.id?{...I,numericValue:k,value:String(k)}:I);r(x)},onRemove:()=>void r(e.filter(k=>k.id!==l.id))},l.id):M()}if(l.type==="starRating"){let S=(X=l.numericValue)!=null?X:Number(l.value);return Number.isFinite(S)?(0,C.jsx)(Y,{star:!0,rating:S,onChange:k=>{let x=e.map(I=>I.id===l.id?{...I,numericValue:k,value:String(k)}:I);r(x)},onRemove:()=>void r(e.filter(k=>k.id!==l.id))},l.id):M()}return l.type==="priceRange"&&l.priceRange?(0,C.jsx)(oe,{priceRange:l.priceRange,currency:o,onChange:S=>{let k=e.map(x=>x.id===l.id?{...x,priceRange:S}:x);r(k)},onRemove:()=>void r(e.filter(S=>S.id!==l.id))},l.id):l.type==="transformed_query"?(0,C.jsx)(se,{value:l.value,onChange:S=>{let k=e.map(x=>x.id===l.id?{...x,value:S}:x);r(k)},onRemove:()=>void r(e.filter(S=>S.id!==l.id))},l.id):l.type==="selected_restaurant_price_levels"?(0,C.jsx)(ie,{values:(A=l.priceLevels)!=null?A:[],onChange:S=>{let k=e.map(x=>x.id===l.id?{...x,priceLevels:S}:x);r(k)},onRemove:()=>void r(e.filter(S=>S.id!==l.id))},l.id):M()}),(0,C.jsx)("button",{style:{flexShrink:0,padding:"4px 16px",borderRadius:"9999px",cursor:"pointer",fontSize:"14px",userSelect:"none",border:"none",backgroundColor:O?"#e5e5e5":"transparent",transition:"background-color 0.2s"},onClick:a,onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:s})]}),!f&&(0,C.jsx)("div",{"aria-hidden":"true",style:{...Re,left:0,background:"linear-gradient(to right, white, transparent)"}}),!v&&(0,C.jsx)("div",{"aria-hidden":"true",style:{...Re,right:0,background:"linear-gradient(to left, white, transparent)"}}),!f&&(0,C.jsx)("button",{type:"button","aria-label":d,style:{...we,left:"4px",transform:"translateY(-50%) rotate(180deg)",backgroundColor:y==="prev"?"#e5e5e5":"white"},onClick:()=>g("prev"),onMouseEnter:()=>h("prev"),onMouseLeave:()=>h(null),children:(0,C.jsx)(ee,{style:{width:"20px",height:"20px"}})}),!v&&(0,C.jsx)("button",{type:"button","aria-label":u,style:{...we,right:"4px",backgroundColor:y==="next"?"#e5e5e5":"white"},onClick:()=>g("next"),onMouseEnter:()=>h("next"),onMouseLeave:()=>h(null),children:(0,C.jsx)(ee,{style:{width:"20px",height:"20px"}})})]})};var pe=require("react"),ue=()=>{let[e,t]=(0,pe.useState)(typeof window!="undefined"?window.innerHeight>window.innerWidth:!1);return(0,pe.useEffect)(()=>{if(typeof window=="undefined")return;let o=()=>{t(window.innerHeight>window.innerWidth)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e};var B=require("react/jsx-runtime"),et={position:"relative",display:"flex",flexDirection:"column",gap:"8px",width:"100%"},tt={position:"relative",display:"flex",alignItems:"center",gap:"8px",width:"100%"},rt={position:"relative",display:"flex",alignItems:"center",flex:1,backgroundColor:"white",borderRadius:"24px",border:"1px solid #e5e5e5",padding:"0 16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},nt={flex:1,border:"none",outline:"none",fontSize:"16px",backgroundColor:"transparent",color:"#000",padding:"10px"},ot={position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)"},it={width:"20px",height:"20px",border:"2px solid #e5e5e5",borderTop:"2px solid #03852e",borderRadius:"50%",animation:"spin 1s linear infinite"},st={position:"absolute",padding:"10px",color:"#737373",pointerEvents:"none",fontSize:"16px"},Le=({mapFirst:e,filters:t,value:o,isSearching:i=!1,placeholder:s,onSearch:d,onFilterChange:u,onValueChange:p,showTypingPrompt:r=!0,customTranslations:n,currency:a="USD",style:c,inputStyle:f,containerStyle:v})=>{let[g,b]=(0,q.useState)(""),y=o!==void 0?o:g,h=p||b,P=ue(),{t:R,formatCurrency:O}=E(n),K=R("smartFilter.minRating.suffix"),Z=s||R("smartFilter.typingPrompt"),l=R("smartFilter.nav.previous"),M=R("smartFilter.nav.next"),j=R("smartFilter.clearAll"),X=async x=>{x.preventDefault();let I=y.trim();if(!(!I||i))try{await d(I)}catch(me){console.error("Search error:",me)}},A=(0,q.useCallback)(async(x,I)=>{if(!i)try{await u(x)}catch(me){console.error("Filter change error:",me)}},[i,u]),S=(0,q.useCallback)(()=>{A([])},[A]),k=(0,q.useCallback)(()=>{A([],!0),h("")},[A,h]);return(0,B.jsxs)("div",{style:{...et,...v},children:[(0,B.jsx)("style",{children:`
6
6
  @keyframes spin {
7
7
  0% { transform: rotate(0deg); }
8
8
  100% { transform: rotate(360deg); }
9
9
  }
10
- `}),(0,B.jsx)("form",{onSubmit:X,style:{...et,...c},children:(0,B.jsxs)("div",{style:tt,children:[(0,B.jsx)("input",{type:"text",value:y,onChange:x=>h(x.target.value),disabled:i,style:{...rt,...f},autoComplete:"off","aria-label":"Smart search"}),r&&y.length===0&&!i&&(0,B.jsx)("span",{style:it,children:Z}),i&&(0,B.jsx)("div",{style:nt,children:(0,B.jsx)("div",{style:ot})})]})}),t.length>0&&(0,B.jsx)(ce,{filters:t,isPortrait:P,currency:s,minRatingSuffix:K,clearAllLabel:j,previousFiltersLabel:l,nextFiltersLabel:M,formatCurrency:O,onFilterChange:z,onResetFilters:S,onClearAll:k})]})};var Q=require("react/jsx-runtime");function at(e){let t=m.default.useRef(null),[o,i]=m.default.useState(null),a=m.default.useRef(e);return m.default.useEffect(()=>{a.current=e}),m.default.useEffect(()=>{let d=a.current,u={adapter:null,...d,callbacks:{...d.callbacks,onPropertiesChange:r=>{var n,s;i(c=>c?{...c,properties:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onPropertiesChange)==null||s.call(n,r)},onSelectedPropertyChange:r=>{var n,s;i(c=>c?{...c,selectedPropertyId:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onSelectedPropertyChange)==null||s.call(n,r)},onPrimaryTypeChange:r=>{var n,s;i(c=>c?{...c,primary:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onPrimaryTypeChange)==null||s.call(n,r)},onFiltersChange:r=>{var n,s;i(c=>c?{...c,filters:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onFiltersChange)==null||s.call(n,r)},onBoundsChange:r=>{var n,s;i(c=>c?{...c,bounds:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onBoundsChange)==null||s.call(n,r)},onPendingBoundsChange:r=>{var n,s;i(c=>c?{...c,pendingBounds:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onPendingBoundsChange)==null||s.call(n,r)},onCenterChange:(r,n)=>{var s,c;i(f=>f?{...f,center:r,zoom:n}:null),(c=(s=a.current.callbacks)==null?void 0:s.onCenterChange)==null||c.call(s,r,n)},onZoomChange:r=>{var n,s;i(c=>c?{...c,zoom:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onZoomChange)==null||s.call(n,r)},onActiveLocationChange:r=>{var n,s;i(c=>c?{...c,activeLocation:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onActiveLocationChange)==null||s.call(n,r)},onLoadingStateChange:r=>{var n,s;i(c=>c?{...c,initialLoading:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onLoadingStateChange)==null||s.call(n,r)},onSearchingStateChange:r=>{var n,s;i(c=>c?{...c,isSearching:r}:null),(s=(n=a.current.callbacks)==null?void 0:n.onSearchingStateChange)==null||s.call(n,r)}}},p=new be.MapFirstCore(u);return t.current=p,i(p.getState()),()=>{p.destroy(),t.current=null,i(null)}},[]),{mapFirst:t.current,state:o}}function st(e){let[t,o]=m.default.useState([]);return m.default.useEffect(()=>{if(!e){o([]);return}o(e.getState().properties)},[e]),t}function lt(e){let[t,o]=m.default.useState(null);return m.default.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]),t}function ct(e){let[t,o]=m.default.useState("Accommodation");m.default.useEffect(()=>{if(!e){o("Accommodation");return}o(e.getState().primary)},[e]);let i=m.default.useCallback(a=>{e&&(e.setPrimaryType(a),o(a))},[e]);return[t,i]}function pt(e){let[t,o]=m.default.useState(null);m.default.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]);let i=m.default.useCallback(a=>{e&&e.setSelectedMarker(a)},[e]);return[t,i]}function ut({mapFirst:e,map:t,maplibregl:o,onMarkerClick:i}){let a=m.default.useRef(!1);m.default.useEffect(()=>{!e||!t||a.current||(e.attachMap(t,{platform:"maplibre",maplibregl:o,onMarkerClick:i}),a.current=!0)},[e,t,o,i])}function dt({mapFirst:e,map:t,google:o,onMarkerClick:i}){let a=m.default.useRef(!1);m.default.useEffect(()=>{!e||!t||a.current||(e.attachMap(t,{platform:"google",google:o,onMarkerClick:i}),a.current=!0)},[e,t,o,i])}function mt({mapFirst:e,map:t,mapboxgl:o,onMarkerClick:i}){let a=m.default.useRef(!1);m.default.useEffect(()=>{!e||!t||a.current||(e.attachMap(t,{platform:"mapbox",mapboxgl:o,onMarkerClick:i}),a.current=!0)},[e,t,o,i])}function ft(e){let t=m.default.useRef(null);return m.default.useEffect(()=>{if(!e)return;let o=new be.MapFirstCore(e);return t.current=o,()=>{o.destroy(),t.current=null}},[e]),t}function gt(e){let[t,o]=m.default.useState(!1),[i,a]=m.default.useState(null);return{search:m.default.useCallback(async u=>{if(!e){let p=new Error("MapFirst instance not available");throw a(p),p}o(!0),a(null);try{return await e.runPropertiesSearch({...u,onError:r=>{let n=r instanceof Error?r:new Error(String(r));a(n)}})}catch(p){let r=p instanceof Error?p:new Error(String(p));throw a(r),r}finally{o(!1)}},[e]),isLoading:t,error:i}}function yt(e){let[t,o]=m.default.useState(!1),[i,a]=m.default.useState(null);return{search:m.default.useCallback(async u=>{if(!e){let p=new Error("MapFirst instance not available");throw a(p),p}o(!0),a(null);try{return await e.runSmartFilterSearch({...u,onError:r=>{let n=r instanceof Error?r:new Error(String(r));a(n)}})}catch(p){let r=p instanceof Error?p:new Error(String(p));throw a(r),r}finally{o(!1)}},[e]),isLoading:t,error:i}}function ht(e){let[t,o]=m.default.useState(!1),[i,a]=m.default.useState(null);return{performBoundsSearch:m.default.useCallback(async()=>{if(!e)return null;o(!0),a(null);try{return await e.performBoundsSearch()}catch(u){let p=u instanceof Error?u:new Error(String(u));throw a(p),p}finally{o(!1)}},[e]),isSearching:t,error:i}}function bt({markers:e}){return(0,Q.jsxs)("div",{style:{fontFamily:"sans-serif",fontSize:14},children:[(0,Q.jsx)("strong",{children:"Markers"}),(0,Q.jsx)("ul",{children:e.map(t=>{var o,i,a,d,u,p;return(0,Q.jsxs)("li",{children:[t.name," \u2014 ",(a=(i=(o=t.location)==null?void 0:o.lat)==null?void 0:i.toFixed(3))!=null?a:"n/a",","," ",(p=(u=(d=t.location)==null?void 0:d.lon)==null?void 0:u.toFixed(3))!=null?p:"n/a"]},String(t.tripadvisor_id))})})]})}0&&(module.exports={Chip,CloseIcon,EditIcon,FilterChips,MarkerDebugList,MinRatingFilterChip,NextIcon,PriceRangeFilterChip,RestaurantPriceLevelChip,SearchIcon,SmartFilter,StarIcon,TransformedQueryChip,createMinRatingFilterLabel,createPriceRangeFilterLabel,formatRatingValue,renderStars,useFilterScroll,useGoogleMapsAttachment,useIsPortrait,useMapFirst,useMapFirstBoundsSearch,useMapFirstCore,useMapFirstProperties,useMapFirstSelectedProperty,useMapLibreAttachment,useMapboxAttachment,usePrimaryType,usePropertiesSearch,useSelectedMarker,useSmartFilterSearch,useTranslation});
10
+ `}),(0,B.jsx)("form",{onSubmit:X,style:{...tt,...c},children:(0,B.jsxs)("div",{style:rt,children:[(0,B.jsx)("input",{type:"text",value:y,onChange:x=>h(x.target.value),disabled:i,style:{...nt,...f},autoComplete:"off","aria-label":"Smart search"}),r&&y.length===0&&!i&&(0,B.jsx)("span",{style:st,children:Z}),i&&(0,B.jsx)("div",{style:ot,children:(0,B.jsx)("div",{style:it})})]})}),t.length>0&&(0,B.jsx)(ce,{filters:t,isPortrait:P,currency:a,minRatingSuffix:K,clearAllLabel:j,previousFiltersLabel:l,nextFiltersLabel:M,formatCurrency:O,onFilterChange:A,onResetFilters:S,onClearAll:k})]})};var Q=require("react/jsx-runtime");function at(e){let t=m.default.useRef(null),[o,i]=m.default.useState(null),s=m.default.useRef(e);return m.default.useEffect(()=>{s.current=e}),m.default.useEffect(()=>{let d=s.current,u={adapter:null,...d,callbacks:{...d.callbacks,onPropertiesChange:r=>{var n,a;i(c=>c?{...c,properties:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onPropertiesChange)==null||a.call(n,r)},onSelectedPropertyChange:r=>{var n,a;i(c=>c?{...c,selectedPropertyId:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onSelectedPropertyChange)==null||a.call(n,r)},onPrimaryTypeChange:r=>{var n,a;i(c=>c?{...c,primary:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onPrimaryTypeChange)==null||a.call(n,r)},onFiltersChange:r=>{var n,a;i(c=>c?{...c,filters:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onFiltersChange)==null||a.call(n,r)},onBoundsChange:r=>{var n,a;i(c=>c?{...c,bounds:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onBoundsChange)==null||a.call(n,r)},onPendingBoundsChange:r=>{var n,a;i(c=>c?{...c,pendingBounds:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onPendingBoundsChange)==null||a.call(n,r)},onCenterChange:(r,n)=>{var a,c;i(f=>f?{...f,center:r,zoom:n}:null),(c=(a=s.current.callbacks)==null?void 0:a.onCenterChange)==null||c.call(a,r,n)},onZoomChange:r=>{var n,a;i(c=>c?{...c,zoom:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onZoomChange)==null||a.call(n,r)},onActiveLocationChange:r=>{var n,a;i(c=>c?{...c,activeLocation:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onActiveLocationChange)==null||a.call(n,r)},onLoadingStateChange:r=>{var n,a;i(c=>c?{...c,initialLoading:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onLoadingStateChange)==null||a.call(n,r)},onSearchingStateChange:r=>{var n,a;i(c=>c?{...c,isSearching:r}:null),(a=(n=s.current.callbacks)==null?void 0:n.onSearchingStateChange)==null||a.call(n,r)}}},p=new Se.MapFirstCore(u);return t.current=p,i(p.getState()),()=>{p.destroy(),t.current=null,i(null)}},[]),{mapFirst:t.current,state:o}}function lt(e){let[t,o]=m.default.useState([]);return m.default.useEffect(()=>{if(!e){o([]);return}o(e.getState().properties)},[e]),t}function ct(e){let[t,o]=m.default.useState(null);return m.default.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]),t}function pt(e){let[t,o]=m.default.useState("Accommodation");m.default.useEffect(()=>{if(!e){o("Accommodation");return}o(e.getState().primary)},[e]);let i=m.default.useCallback(s=>{e&&(e.setPrimaryType(s),o(s))},[e]);return[t,i]}function ut(e){let[t,o]=m.default.useState(null);m.default.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]);let i=m.default.useCallback(s=>{e&&e.setSelectedMarker(s)},[e]);return[t,i]}function dt({mapFirst:e,map:t,maplibregl:o,onMarkerClick:i}){let s=m.default.useRef(!1);m.default.useEffect(()=>{!e||!t||s.current||(e.attachMap(t,{platform:"maplibre",maplibregl:o,onMarkerClick:i}),s.current=!0)},[e,t,o,i])}function mt({mapFirst:e,map:t,google:o,onMarkerClick:i}){let s=m.default.useRef(!1);m.default.useEffect(()=>{!e||!t||s.current||(e.attachMap(t,{platform:"google",google:o,onMarkerClick:i}),s.current=!0)},[e,t,o,i])}function ft({mapFirst:e,map:t,mapboxgl:o,onMarkerClick:i}){let s=m.default.useRef(!1);m.default.useEffect(()=>{!e||!t||s.current||(e.attachMap(t,{platform:"mapbox",mapboxgl:o,onMarkerClick:i}),s.current=!0)},[e,t,o,i])}function gt(e){let t=m.default.useRef(null);return m.default.useEffect(()=>{if(!e)return;let o=new Se.MapFirstCore(e);return t.current=o,()=>{o.destroy(),t.current=null}},[e]),t}function yt(e){let[t,o]=m.default.useState(!1),[i,s]=m.default.useState(null);return{search:m.default.useCallback(async u=>{if(!e){let p=new Error("MapFirst instance not available");throw s(p),p}o(!0),s(null);try{return await e.runPropertiesSearch({...u,onError:r=>{let n=r instanceof Error?r:new Error(String(r));s(n)}})}catch(p){let r=p instanceof Error?p:new Error(String(p));throw s(r),r}finally{o(!1)}},[e]),isLoading:t,error:i}}function ht(e){let[t,o]=m.default.useState(!1),[i,s]=m.default.useState(null);return{search:m.default.useCallback(async u=>{if(!e){let p=new Error("MapFirst instance not available");throw s(p),p}o(!0),s(null);try{return await e.runSmartFilterSearch({...u,onError:r=>{let n=r instanceof Error?r:new Error(String(r));s(n)}})}catch(p){let r=p instanceof Error?p:new Error(String(p));throw s(r),r}finally{o(!1)}},[e]),isLoading:t,error:i}}function bt(e){let[t,o]=m.default.useState(!1),[i,s]=m.default.useState(null);return{performBoundsSearch:m.default.useCallback(async()=>{if(!e)return null;o(!0),s(null);try{return await e.performBoundsSearch()}catch(u){let p=u instanceof Error?u:new Error(String(u));throw s(p),p}finally{o(!1)}},[e]),isSearching:t,error:i}}function St({markers:e}){return(0,Q.jsxs)("div",{style:{fontFamily:"sans-serif",fontSize:14},children:[(0,Q.jsx)("strong",{children:"Markers"}),(0,Q.jsx)("ul",{children:e.map(t=>{var o,i,s,d,u,p;return(0,Q.jsxs)("li",{children:[t.name," \u2014 ",(s=(i=(o=t.location)==null?void 0:o.lat)==null?void 0:i.toFixed(3))!=null?s:"n/a",","," ",(p=(u=(d=t.location)==null?void 0:d.lon)==null?void 0:u.toFixed(3))!=null?p:"n/a"]},String(t.tripadvisor_id))})})]})}0&&(module.exports={Chip,CloseIcon,EditIcon,FilterChips,MarkerDebugList,MinRatingFilterChip,NextIcon,PriceRangeFilterChip,RestaurantPriceLevelChip,SearchIcon,SmartFilter,StarIcon,TransformedQueryChip,convertToApiFilters,createMinRatingFilterLabel,createPriceRangeFilterLabel,formatRatingValue,processApiFilters,renderStars,useFilterScroll,useGoogleMapsAttachment,useIsPortrait,useMapFirst,useMapFirstBoundsSearch,useMapFirstCore,useMapFirstProperties,useMapFirstSelectedProperty,useMapLibreAttachment,useMapboxAttachment,usePrimaryType,usePropertiesSearch,useSelectedMarker,useSmartFilterSearch,useTranslation});
11
11
  //# sourceMappingURL=index.js.map