@mapfirst.ai/react 0.0.8 → 0.0.9

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.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import g from"react";import{MapFirstCore as Le}from"@mapfirst.ai/core";import{useCallback as me,useState as pt}from"react";import{jsx as E,jsxs as Q}from"react/jsx-runtime";var V=({className:e,style:t})=>Q("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:[E("circle",{cx:"11",cy:"11",r:"8"}),E("path",{d:"m21 21-4.35-4.35"})]}),H=({className:e,style:t})=>Q("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:[E("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),q=({className:e,style:t})=>Q("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:[E("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),E("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),te=({className:e,style:t})=>E("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:E("polyline",{points:"9 18 15 12 9 6"})}),ge=({className:e,style:t})=>Q("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:[E("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),E("path",{d:"M2 17l10 5 10-5"}),E("path",{d:"M2 12l10 5 10-5"})]}),fe=({className:e,style:t,fill:o="none"})=>E("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:E("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"})});import pe from"react";import Ee from"react";import{jsx as K,jsxs as Be}from"react/jsx-runtime";var Me={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"},Ie={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"},Te={width:"17px",height:"17px"},re=({label:e,icon:t,remove:o,style:a})=>{let[i,p]=Ee.useState(!1);return Be("div",{style:{...Me,...a},children:[t&&K("span",{style:{display:"flex",alignItems:"center"},children:t}),K("span",{style:{whiteSpace:"nowrap"},children:e}),K("button",{style:{...Ie,backgroundColor:i?"#e5e5e5":"white"},onClick:o,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),"aria-label":"Remove filter",children:K(H,{style:Te})})]})};import{useState as he}from"react";import{useCallback as ye,useState as He}from"react";var Ne={"smartFilter.placeholder":"Search for hotels, restaurants, or attractions...","smartFilter.typingPrompt":"Type to search...","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"},De=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e),M=(e,t)=>{let[o,a]=He("en"),i=ye((u,c)=>{let n={...Ne,...e}[u]||u;return c&&Object.keys(c).forEach(s=>{n=n.replace(new RegExp(`{{${s}}}`,"g"),String(c[s]))}),n},[e]),p=ye((u,c)=>t?t(u,c):De(u,c),[t]);return{t:i,locale:o,setLocale:a,formatCurrency:p}};import{jsx as $,jsxs as ze}from"react/jsx-runtime";var Ae=e=>{let t=[],o=Math.floor(e),a=e%1!==0,i={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},p={...i,backgroundColor:"#03852e"},u={...i,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};for(let r=0;r<o;r+=1)t.push($("span",{style:p},`full-${r}`));a&&t.push($("span",{style:u},"half"));let c=Math.max(0,5-Math.ceil(e));for(let r=0;r<c;r+=1)t.push($("span",{style:i},`empty-${r}`));return t},Mt=(e,t)=>ze("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[$("span",{style:{display:"flex",gap:"1px",userSelect:"none"},children:Ae(e)})," ",t]}),ne=e=>e.toFixed(1),It=(e,t,o,a)=>`${a(e,o)} - ${a(t!=null?t:0,o)}`;import{jsx as N,jsxs as j}from"react/jsx-runtime";var We={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"},Oe={position:"absolute",top:"-8px",right:"-8px",padding:"2px",borderRadius:"50%",backgroundColor:"white",border:"1px solid #03852e",cursor:"pointer",transition:"background-color 0.2s"},_e={display:"flex",gap:"1px",userSelect:"none"},oe={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},Y={position:"absolute",top:0,height:"100%",cursor:"pointer",backgroundColor:"transparent",border:"none",padding:0},G=({rating:e,onChange:t,onRemove:o,star:a=!1})=>{let[i,p]=he(null),[u,c]=he(!1),{t:r}=M(),n=i!=null?i:e,s=f=>a&&f?f.toString():r("smartFilter.minRating.label",{value:ne(f)}),l=r("smartFilter.minRating.remove"),m=f=>r("smartFilter.minRating.setTo",{rating:ne(f)}),P=f=>{let S=f+1;return n>=S?"full":n>=S-.5?"half":"empty"},v=f=>{p(null),f!==e&&t(f)},C=f=>{var x;let S=f.relatedTarget;(!S||!((x=f.currentTarget.closest("[data-min-rating-chip]"))!=null&&x.contains(S)))&&p(null)};return j("div",{style:We,"data-min-rating-chip":!0,children:[j("div",{style:{display:"flex",alignItems:"center",gap:"4px"},onMouseLeave:()=>p(null),children:[N("div",{style:_e,children:Array.from({length:5}).map((f,S)=>{let x=P(S),h=S+1,k=h-.5;if(a)return j("div",{style:{position:"relative",width:"16px",height:"16px"},children:[N(fe,{fill:n>=h?"#03852e":"none",style:{width:"16px",height:"16px",pointerEvents:"none"}}),N("button",{type:"button",style:{...Y,left:0,width:"50%",borderRadius:"50% 0 0 50%"},onMouseEnter:()=>p(k),onFocus:()=>p(k),onBlur:C,onClick:()=>v(k),"aria-label":m(k),title:s(k)}),N("button",{type:"button",style:{...Y,left:"50%",width:"50%",borderRadius:"0 50% 50% 0"},onMouseEnter:()=>p(h),onFocus:()=>p(h),onBlur:C,onClick:()=>v(h),"aria-label":m(h),title:s(h)})]},S);let I=x==="full"?{...oe,backgroundColor:"#03852e"}:oe,A={...oe,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};return j("div",{style:{position:"relative",width:"12px",height:"12px"},children:[N("span",{style:x==="half"?A:I}),N("button",{type:"button",style:{...Y,left:0,width:"50%",borderRadius:"50% 0 0 50%",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>p(k),onFocus:()=>p(k),onBlur:C,onClick:()=>v(k),"aria-label":m(k),title:s(k)}),N("button",{type:"button",style:{...Y,left:"50%",width:"50%",borderRadius:"0 50% 50% 0",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>p(h),onFocus:()=>p(h),onBlur:C,onClick:()=>v(h),"aria-label":m(h),title:s(h)})]},S)})}),N("span",{style:{whiteSpace:"nowrap"},children:s(n)})]}),N("button",{style:{...Oe,backgroundColor:u?"#e5e5e5":"white"},onClick:o,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-label":l,title:l,children:N(H,{style:{width:"17px",height:"17px"}})})]})};import{useEffect as Ve,useState as U}from"react";import{Fragment as Ye,jsx as T,jsxs as ie}from"react/jsx-runtime";var 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"},Qe={position:"absolute",top:"-8px",right:"-8px",padding:"2px",borderRadius:"50%",backgroundColor:"white",border:"1px solid #03852e",cursor:"pointer",transition:"background-color 0.2s"},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"},be=({boundary:e,label:t,value:o,placeholder:a,currency:i,isOptional:p=!1,showRemoveButton:u=!1,removeLabel:c,editLabel:r,showAddWhenEmpty:n=!1,onCommit:s,onRemove:l})=>{let[m,P]=U(o!==void 0?String(o):""),[v,C]=U(!1),[f,S]=U(!1),[x,h]=U(!1),k=o!==void 0;Ve(()=>{P(o!==void 0?String(o):""),C(!1)},[o]);let I=()=>{P(o!==void 0?String(o):"")},A=()=>{if(m.trim()===""){if(p){s(void 0),P("");return}I();return}let y=Number(m);if(!Number.isFinite(y)){I();return}let B=Math.max(0,y);if(B===o){I();return}s(B)};return ie("div",{style:qe,children:[T("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:t}),v?T("input",{value:m,onChange:y=>{let B=y.target.value.replace(/[^\d]/g,"");P(B)},onBlur:()=>{A(),C(!1)},onKeyDown:y=>{if(y.key==="Enter"){y.preventDefault(),y.currentTarget.blur(),C(!1);return}if(y.key==="Escape"){y.preventDefault(),I(),y.currentTarget.blur(),C(!1);return}y.key.length===1&&/[0-9]/.test(y.key)||y.key==="Backspace"||y.key==="Delete"||y.key==="Tab"||y.key==="ArrowLeft"||y.key==="ArrowRight"||y.key==="Home"||y.key==="End"||y.preventDefault()},placeholder:a,inputMode:"numeric",pattern:"[0-9]*","aria-label":t,style:Ke,autoFocus:!0}):k?ie("span",{style:{fontSize:"16px"},children:[i,o]}):n?T("button",{type:"button",style:{fontSize:"16px",color:"#737373",cursor:"pointer",border:"none",backgroundColor:"transparent",padding:0},onClick:()=>C(!0),"aria-label":r,children:"+"}):T("span",{style:{fontSize:"16px",color:"#737373"},children:"-"}),(!n||n&&v)&&T("span",{style:{color:"#737373",fontSize:"12px"},children:i}),!v&&(!n||k)&&T("button",{type:"button",style:{...$e,backgroundColor:f?"#e5e5e5":"transparent"},"aria-label":r,title:r,onClick:()=>C(!0),onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:T(q,{})}),u&&T("button",{style:{...Qe,backgroundColor:x?"#e5e5e5":"white"},onClick:l,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),"aria-label":c,title:c,children:T(H,{style:{width:"17px",height:"17px"}})})]})},se=({priceRange:e,currency:t,onChange:o,onRemove:a})=>{let{t:i}=M(),p="Min",u="Max",c=i("smartFilter.priceRange.remove"),r=i("smartFilter.priceRange.edit"),n=(s,l)=>{let m={min:e.min,max:e.max};s==="min"?(m.min=l,l!==void 0&&e.max!==void 0&&l>e.max&&(m.max=l)):(m.max=l,l!==void 0&&e.min!==void 0&&l<e.min&&(m.min=l)),(m.min!==e.min||m.max!==e.max)&&o(m)};return ie(Ye,{children:[T(be,{boundary:"min",label:p,value:e.min,currency:t,editLabel:r,showRemoveButton:e.min!==void 0&&e.min!==0,onCommit:s=>n("min",s),onRemove:a}),T(be,{boundary:"max",label:u,value:e.max,currency:t,isOptional:!0,showRemoveButton:e.max!==void 0,removeLabel:c,editLabel:r,showAddWhenEmpty:!0,onCommit:s=>n("max",s),onRemove:a})]})};import je from"react";import{jsx as O,jsxs as Z}from"react/jsx-runtime";var 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"},Ue={position:"absolute",top:"-8px",right:"-8px",padding:"2px",borderRadius:"50%",backgroundColor:"white",border:"1px solid #03852e",cursor:"pointer",transition:"background-color 0.2s"},xe=[{value:"Cheap Eats",key:"cheapEats"},{value:"Mid Range",key:"midRange"},{value:"Fine Dining",key:"fineDining"}],ae=({values:e,onChange:t,onRemove:o})=>{let{t:a}=M(),[i,p]=je.useState(!1),u=a("smartFilter.restaurantPriceLevel.label"),c=a("smartFilter.restaurantPriceLevel.remove"),r=a("smartFilter.restaurantPriceLevel.none"),n=s=>{let{value:l,checked:m}=s.target,P=l,v=new Set(e);m?v.add(P):v.delete(P);let C=xe.filter(f=>v.has(f.value)).map(f=>f.value);t(C)};return Z("div",{style:Ge,children:[Z("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[O("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:u}),Z("div",{style:{display:"flex",gap:"12px"},children:[xe.map(s=>{let l=a(`smartFilter.restaurantPriceLevel.options.${s.key}`),m=`price-level-${s.key}`;return Z("label",{htmlFor:m,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",cursor:"pointer"},children:[O("input",{id:m,type:"checkbox",value:s.value,checked:e.includes(s.value),onChange:n,style:{accentColor:"#03852e",cursor:"pointer"}}),O("span",{children:l})]},s.value)}),e.length===0&&O("span",{style:{fontSize:"12px",color:"#737373"},children:r})]})]}),O("button",{style:{...Ue,backgroundColor:i?"#e5e5e5":"white"},onClick:o,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),"aria-label":c!=null?c:u,title:c!=null?c:u,children:O(H,{style:{width:"17px",height:"17px"}})})]})};import{useEffect as Ze,useRef as Xe,useState as X}from"react";import{jsx as z,jsxs as nt}from"react/jsx-runtime";var Je={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"},et={position:"absolute",top:"-8px",right:"-8px",padding:"2px",borderRadius:"50%",backgroundColor:"white",border:"1px solid #03852e",cursor:"pointer",transition:"background-color 0.2s"},tt={backgroundColor:"#ececec",borderRadius:"2px",padding:"2px 8px",outline:"none",fontSize:"16px",minWidth:"8ch",border:"none"},rt={padding:"4px",borderRadius:"50%",cursor:"pointer",transition:"background-color 0.2s",color:"#737373",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},le=({value:e,onChange:t,onRemove:o})=>{let a=Xe(null),[i,p]=X(e),[u,c]=X(!1),[r,n]=X(!1),[s,l]=X(!1),{t:m}=M(),P=m("smartFilter.transformedQuery.remove"),v=m("smartFilter.transformedQuery.edit");Ze(()=>{p(e),c(!1)},[e]);let C=()=>{let x=i.trim();if(!x.length){p(e);return}x!==e&&t(x)};return nt("div",{style:Je,children:[z(V,{style:{width:"16px",height:"16px",color:"#03852e"}}),u?z("input",{ref:a,value:i,onChange:x=>{p(x.target.value)},onBlur:()=>{C(),c(!1)},onKeyDown:x=>{if(x.key==="Enter"){x.preventDefault(),x.currentTarget.blur();return}if(x.key==="Escape"){x.preventDefault(),p(e),x.currentTarget.blur();return}},"aria-label":v,style:tt,autoFocus:!0}):z("span",{style:{fontSize:"16px"},children:e}),!u&&z("button",{type:"button",style:{...rt,backgroundColor:r?"#e5e5e5":"transparent"},"aria-label":v,title:v,onClick:()=>c(!0),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:z(q,{})}),z("button",{style:{...et,backgroundColor:s?"#e5e5e5":"white"},onClick:o,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-label":P,title:P,children:z(H,{style:{width:"17px",height:"17px"}})})]})};import{useCallback as Se,useEffect as ot,useRef as it,useState as ve}from"react";var ce=e=>{let t=it(null),[o,a]=ve(!0),[i,p]=ve(!0),u=Se(()=>{let r=t.current;if(!r){a(!0),p(!0);return}let{scrollLeft:n,scrollWidth:s,clientWidth:l}=r;a(n<=0),p(n+l>=s-1)},[]);ot(()=>{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 c=Se(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:i,scrollByDir:c}};import{jsx as w,jsxs as ke}from"react/jsx-runtime";var st={position:"relative",width:"100%"},at={display:"flex",gap:"8px",overflowX:"auto",alignItems:"center",width:"100%",scrollbarWidth:"none",msOverflowStyle:"none"},Ce={pointerEvents:"none",position:"absolute",top:0,bottom:0,width:"40px"},Pe={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"},ue=({filters:e,isPortrait:t,currency:o,minRatingSuffix:a,clearAllLabel:i,previousFiltersLabel:p,nextFiltersLabel:u,formatCurrency:c,onFilterChange:r,onResetFilters:n,onClearAll:s})=>{let{scrollerRef:l,atStart:m,atEnd:P,scrollByDir:v}=ce(e.length),{t:C}=M(),[f,S]=pe.useState(null),[x,h]=pe.useState(!1),[k,I]=pe.useState(!1),A={...at,padding:t?"8px 16px":"8px"};return ke("div",{style:st,children:[ke("div",{ref:l,style:{...A,WebkitOverflowScrolling:"touch"},children:[w("style",{children:`
1
+ import f from"react";import{MapFirstCore as we}from"@mapfirst.ai/core";import{useCallback as de,useState as it}from"react";import ce from"react";import Le from"react";import{jsx as E,jsxs as j}from"react/jsx-runtime";var V=({className:e,style:r})=>j("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",...r},children:[E("circle",{cx:"11",cy:"11",r:"8"}),E("path",{d:"m21 21-4.35-4.35"})]}),me=({className:e,style:r})=>j("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",...r},children:[E("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),q=({className:e,style:r})=>j("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",...r},children:[E("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),E("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),Z=({className:e,style:r})=>E("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",...r},children:E("polyline",{points:"9 18 15 12 9 6"})}),fe=({className:e,style:r,fill:o="none"})=>E("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",...r},children:E("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"})});import{jsx as ge}from"react/jsx-runtime";var Ee={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"},Me={width:"17px",height:"17px"},M=({onClick:e,style:r})=>{let[o,i]=Le.useState(!1);return ge("button",{style:{...Ee,backgroundColor:o?"#e5e5e5":"white",...r},onClick:e,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"aria-label":"Remove filter",children:ge(me,{style:Me})})};import{jsx as X,jsxs as Te}from"react/jsx-runtime";var Ie={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"},J=({label:e,icon:r,remove:o,style:i})=>Te("div",{style:{...Ie,...i},children:[r&&X("span",{style:{display:"flex",alignItems:"center"},children:r}),X("span",{style:{whiteSpace:"nowrap"},children:e}),X(M,{onClick:o})]});import{useState as Ae}from"react";import{useCallback as ye,useState as Be}from"react";var He={"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"},Ne=(e,r="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:r,minimumFractionDigits:0,maximumFractionDigits:0}).format(e),R=(e,r)=>{let[o,i]=Be("en"),a=ye((d,p)=>{let n={...He,...e}[d]||d;return p&&Object.keys(p).forEach(s=>{n=n.replace(new RegExp(`{{${s}}}`,"g"),String(p[s]))}),n},[e]),u=ye((d,p)=>r?r(d,p):Ne(d,p),[r]);return{t:a,locale:o,setLocale:i,formatCurrency:u}};import{jsx as Q,jsxs as ze}from"react/jsx-runtime";var De=e=>{let r=[],o=Math.floor(e),i=e%1!==0,a={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},u={...a,backgroundColor:"#03852e"},d={...a,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};for(let t=0;t<o;t+=1)r.push(Q("span",{style:u},`full-${t}`));i&&r.push(Q("span",{style:d},"half"));let p=Math.max(0,5-Math.ceil(e));for(let t=0;t<p;t+=1)r.push(Q("span",{style:a},`empty-${t}`));return r},Rt=(e,r)=>ze("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[Q("span",{style:{display:"flex",gap:"1px",userSelect:"none"},children:De(e)})," ",r]}),ee=e=>e.toFixed(1),wt=(e,r,o,i)=>`${i(e,o)} - ${i(r!=null?r:0,o)}`;import{jsx as T,jsxs as $}from"react/jsx-runtime";var Oe={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"},We={display:"flex",gap:"1px",userSelect:"none"},te={display:"block",width:"12px",height:"12px",borderRadius:"50%",border:"1px solid #03852e",pointerEvents:"none"},K={position:"absolute",top:0,height:"100%",cursor:"pointer",backgroundColor:"transparent",border:"none",padding:0},G=({rating:e,onChange:r,onRemove:o,star:i=!1})=>{let[a,u]=Ae(null),{t:d}=R(),p=a!=null?a:e,t=g=>i&&g?g.toString():d("smartFilter.minRating.label",{value:ee(g)}),n=d("smartFilter.minRating.remove"),s=g=>d("smartFilter.minRating.setTo",{rating:ee(g)}),c=g=>{let b=g+1;return p>=b?"full":p>=b-.5?"half":"empty"},m=g=>{u(null),g!==e&&r(g)},C=g=>{var y;let b=g.relatedTarget;(!b||!((y=g.currentTarget.closest("[data-min-rating-chip]"))!=null&&y.contains(b)))&&u(null)};return $("div",{style:Oe,"data-min-rating-chip":!0,children:[$("div",{style:{display:"flex",alignItems:"center",gap:"4px"},onMouseLeave:()=>u(null),children:[T("div",{style:We,children:Array.from({length:5}).map((g,b)=>{let y=c(b),h=b+1,v=h-.5;if(i)return $("div",{style:{position:"relative",width:"16px",height:"16px"},children:[T(fe,{fill:p>=h?"#03852e":"none",style:{width:"16px",height:"16px",pointerEvents:"none"}}),T("button",{type:"button",style:{...K,left:0,width:"50%",borderRadius:"50% 0 0 50%"},onMouseEnter:()=>u(v),onFocus:()=>u(v),onBlur:C,onClick:()=>m(v),"aria-label":s(v),title:t(v)}),T("button",{type:"button",style:{...K,left:"50%",width:"50%",borderRadius:"0 50% 50% 0"},onMouseEnter:()=>u(h),onFocus:()=>u(h),onBlur:C,onClick:()=>m(h),"aria-label":s(h),title:t(h)})]},b);let F=y==="full"?{...te,backgroundColor:"#03852e"}:te,H={...te,background:"linear-gradient(90deg, #03852e 50%, transparent 50%)"};return $("div",{style:{position:"relative",width:"12px",height:"12px"},children:[T("span",{style:y==="half"?H:F}),T("button",{type:"button",style:{...K,left:0,width:"50%",borderRadius:"50% 0 0 50%",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>u(v),onFocus:()=>u(v),onBlur:C,onClick:()=>m(v),"aria-label":s(v),title:t(v)}),T("button",{type:"button",style:{...K,left:"50%",width:"50%",borderRadius:"0 50% 50% 0",outline:"2px solid transparent",outlineOffset:"1px"},onMouseEnter:()=>u(h),onFocus:()=>u(h),onBlur:C,onClick:()=>m(h),"aria-label":s(h),title:t(h)})]},b)})}),T("span",{style:{whiteSpace:"nowrap"},children:t(p)})]}),T(M,{onClick:o})]})};import{useEffect as _e,useState as re}from"react";import{Fragment as Ke,jsx as I,jsxs as ne}from"react/jsx-runtime";var Ve={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"},qe={outline:"none",fontSize:"16px",backgroundColor:"transparent",borderRadius:"2px",padding:"2px 8px",width:"64px",textAlign:"center",border:"none"},Qe={padding:"4px",borderRadius:"50%",cursor:"pointer",transition:"background-color 0.2s",border:"none",backgroundColor:"transparent",color:"#737373",display:"flex",alignItems:"center",justifyContent:"center"},he=({boundary:e,label:r,value:o,placeholder:i,currency:a,isOptional:u=!1,showRemoveButton:d=!1,removeLabel:p,editLabel:t,showAddWhenEmpty:n=!1,onCommit:s,onRemove:c})=>{let[m,C]=re(o!==void 0?String(o):""),[g,b]=re(!1),[y,h]=re(!1),v=o!==void 0;_e(()=>{C(o!==void 0?String(o):""),b(!1)},[o]);let F=()=>{C(o!==void 0?String(o):"")},H=()=>{if(m.trim()===""){if(u){s(void 0),C("");return}F();return}let l=Number(m);if(!Number.isFinite(l)){F();return}let w=Math.max(0,l);if(w===o){F();return}s(w)};return ne("div",{style:Ve,children:[I("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:r}),g?I("input",{value:m,onChange:l=>{let w=l.target.value.replace(/[^\d]/g,"");C(w)},onBlur:()=>{H(),b(!1)},onKeyDown:l=>{if(l.key==="Enter"){l.preventDefault(),l.currentTarget.blur(),b(!1);return}if(l.key==="Escape"){l.preventDefault(),F(),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":r,style:qe,autoFocus:!0}):v?ne("span",{style:{fontSize:"16px"},children:[a,o]}):n?I("button",{type:"button",style:{fontSize:"16px",color:"#737373",cursor:"pointer",border:"none",backgroundColor:"transparent",padding:0},onClick:()=>b(!0),"aria-label":t,children:"+"}):I("span",{style:{fontSize:"16px",color:"#737373"},children:"-"}),(!n||n&&g)&&I("span",{style:{color:"#737373",fontSize:"12px"},children:a}),!g&&(!n||v)&&I("button",{type:"button",style:{...Qe,backgroundColor:y?"#e5e5e5":"transparent"},"aria-label":t,title:t,onClick:()=>b(!0),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:I(q,{})}),d&&I(M,{onClick:c})]})},oe=({priceRange:e,currency:r,onChange:o,onRemove:i})=>{let{t:a}=R(),u="Min",d="Max",p=a("smartFilter.priceRange.remove"),t=a("smartFilter.priceRange.edit"),n=(s,c)=>{let m={min:e.min,max:e.max};s==="min"?(m.min=c,c!==void 0&&e.max!==void 0&&c>e.max&&(m.max=c)):(m.max=c,c!==void 0&&e.min!==void 0&&c<e.min&&(m.min=c)),(m.min!==e.min||m.max!==e.max)&&o(m)};return ne(Ke,{children:[I(he,{boundary:"min",label:u,value:e.min,currency:r,editLabel:t,showRemoveButton:e.min!==void 0&&e.min!==0,onCommit:s=>n("min",s),onRemove:i}),I(he,{boundary:"max",label:d,value:e.max,currency:r,isOptional:!0,showRemoveButton:e.max!==void 0,removeLabel:p,editLabel:t,showAddWhenEmpty:!0,onCommit:s=>n("max",s),onRemove:i})]})};import{jsx as A,jsxs as U}from"react/jsx-runtime";var $e={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"},be=[{value:"Cheap Eats",key:"cheapEats"},{value:"Mid Range",key:"midRange"},{value:"Fine Dining",key:"fineDining"}],ie=({values:e,onChange:r,onRemove:o})=>{let{t:i}=R(),a=i("smartFilter.restaurantPriceLevel.label"),u=i("smartFilter.restaurantPriceLevel.remove"),d=i("smartFilter.restaurantPriceLevel.none"),p=t=>{let{value:n,checked:s}=t.target,c=n,m=new Set(e);s?m.add(c):m.delete(c);let C=be.filter(g=>m.has(g.value)).map(g=>g.value);r(C)};return U("div",{style:$e,children:[U("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[A("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},children:a}),U("div",{style:{display:"flex",gap:"12px"},children:[be.map(t=>{let n=i(`smartFilter.restaurantPriceLevel.options.${t.key}`),s=`price-level-${t.key}`;return U("label",{htmlFor:s,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",cursor:"pointer"},children:[A("input",{id:s,type:"checkbox",value:t.value,checked:e.includes(t.value),onChange:p,style:{accentColor:"#03852e",cursor:"pointer"}}),A("span",{children:n})]},t.value)}),e.length===0&&A("span",{style:{fontSize:"12px",color:"#737373"},children:d})]})]}),A(M,{onClick:o})]})};import{useEffect as Ge,useRef as Ue,useState as ae}from"react";import{jsx as D,jsxs as Xe}from"react/jsx-runtime";var 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:r,onRemove:o})=>{let i=Ue(null),[a,u]=ae(e),[d,p]=ae(!1),[t,n]=ae(!1),{t:s}=R(),c=s("smartFilter.transformedQuery.remove"),m=s("smartFilter.transformedQuery.edit");Ge(()=>{u(e),p(!1)},[e]);let C=()=>{let y=a.trim();if(!y.length){u(e);return}y!==e&&r(y)};return Xe("div",{style:Ye,children:[D(V,{style:{width:"16px",height:"16px",color:"#03852e"}}),d?D("input",{ref:i,value:a,onChange:y=>{u(y.target.value)},onBlur:()=>{C(),p(!1)},onKeyDown:y=>{if(y.key==="Enter"){y.preventDefault(),y.currentTarget.blur();return}if(y.key==="Escape"){y.preventDefault(),u(e),y.currentTarget.blur();return}},"aria-label":m,style:Ze,autoFocus:!0}):D("span",{style:{fontSize:"16px"},children:e}),!d&&D("button",{type:"button",style:{...je,backgroundColor:t?"#e5e5e5":"transparent"},"aria-label":m,title:m,onClick:()=>p(!0),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:D(q,{})}),D(M,{onClick:o})]})};import{useCallback as Se,useEffect as Je,useRef as et,useState as xe}from"react";var le=e=>{let r=et(null),[o,i]=xe(!0),[a,u]=xe(!0),d=Se(()=>{let t=r.current;if(!t){i(!0),u(!0);return}let{scrollLeft:n,scrollWidth:s,clientWidth:c}=t;i(n<=0),u(n+c>=s-1)},[]);Je(()=>{let t=r.current;if(d(),!t)return;let n=()=>d();return t.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",d),()=>{t.removeEventListener("scroll",n),window.removeEventListener("resize",d)}},[e,d]);let p=Se(t=>{let n=r.current;if(!n)return;let s=n.clientWidth*.7;n.scrollBy({left:t==="next"?s:-s,behavior:"smooth"})},[]);return{scrollerRef:r,atStart:o,atEnd:a,scrollByDir:p}};import{jsx as k,jsxs as Pe}from"react/jsx-runtime";var tt={position:"relative",width:"100%"},rt={display:"flex",gap:"8px",overflowX:"auto",alignItems:"center",width:"100%",scrollbarWidth:"none",msOverflowStyle:"none"},Ce={pointerEvents:"none",position:"absolute",top:0,bottom:0,width:"40px"},ve={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"},pe=({filters:e,isPortrait:r,currency:o,minRatingSuffix:i,clearAllLabel:a,previousFiltersLabel:u,nextFiltersLabel:d,formatCurrency:p,onFilterChange:t,onResetFilters:n,onClearAll:s})=>{let{scrollerRef:c,atStart:m,atEnd:C,scrollByDir:g}=le(e.length),{t:b}=R(),[y,h]=ce.useState(null),[v,F]=ce.useState(!1),[H,z]=ce.useState(!1),O={...rt,padding:r?"8px 16px":"8px"};return Pe("div",{style:tt,children:[Pe("div",{ref:c,style:{...O,WebkitOverflowScrolling:"touch"},children:[k("style",{children:`
2
2
  div::-webkit-scrollbar {
3
3
  display: none;
4
4
  }
5
- `}),w("button",{style:{flexShrink:0,backgroundColor:x?"#03a03e":"#03852e",borderRadius:"50%",padding:"8px",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s"},onClick:n,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:w(V,{style:{width:"20px",height:"20px",color:"white"}})}),e.map(d=>{var y,B,_;let W=()=>w(re,{label:d.label,icon:d.icon,remove:()=>{r(e.filter(b=>b.id!==d.id))}},d.id);if(d.type==="minRating"){let b=(y=d.numericValue)!=null?y:Number(d.value);return Number.isFinite(b)?w(G,{rating:b,onChange:R=>{let F=e.map(L=>L.id===d.id?{...L,numericValue:R,value:String(R)}:L);r(F)},onRemove:()=>void r(e.filter(R=>R.id!==d.id))},d.id):W()}if(d.type==="starRating"){let b=(B=d.numericValue)!=null?B:Number(d.value);return Number.isFinite(b)?w(G,{star:!0,rating:b,onChange:R=>{let F=e.map(L=>L.id===d.id?{...L,numericValue:R,value:String(R)}:L);r(F)},onRemove:()=>void r(e.filter(R=>R.id!==d.id))},d.id):W()}return d.type==="priceRange"&&d.priceRange?w(se,{priceRange:d.priceRange,currency:o,onChange:b=>{let R=e.map(F=>F.id===d.id?{...F,priceRange:b}:F);r(R)},onRemove:()=>void r(e.filter(b=>b.id!==d.id))},d.id):d.type==="transformed_query"?w(le,{value:d.value,onChange:b=>{let R=e.map(F=>F.id===d.id?{...F,value:b}:F);r(R)},onRemove:()=>void r(e.filter(b=>b.id!==d.id))},d.id):d.type==="selected_restaurant_price_levels"?w(ae,{values:(_=d.priceLevels)!=null?_:[],onChange:b=>{let R=e.map(F=>F.id===d.id?{...F,priceLevels:b}:F);r(R)},onRemove:()=>void r(e.filter(b=>b.id!==d.id))},d.id):W()}),w("button",{style:{flexShrink:0,padding:"4px 16px",borderRadius:"9999px",cursor:"pointer",fontSize:"14px",userSelect:"none",border:"none",backgroundColor:k?"#e5e5e5":"transparent",transition:"background-color 0.2s"},onClick:s,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),children:i})]}),!m&&w("div",{"aria-hidden":"true",style:{...Ce,left:0,background:"linear-gradient(to right, white, transparent)"}}),!P&&w("div",{"aria-hidden":"true",style:{...Ce,right:0,background:"linear-gradient(to left, white, transparent)"}}),!m&&w("button",{type:"button","aria-label":p,style:{...Pe,left:"4px",transform:"translateY(-50%) rotate(180deg)",backgroundColor:f==="prev"?"#e5e5e5":"white"},onClick:()=>v("prev"),onMouseEnter:()=>S("prev"),onMouseLeave:()=>S(null),children:w(te,{style:{width:"20px",height:"20px"}})}),!P&&w("button",{type:"button","aria-label":u,style:{...Pe,right:"4px",backgroundColor:f==="next"?"#e5e5e5":"white"},onClick:()=>v("next"),onMouseEnter:()=>S("next"),onMouseLeave:()=>S(null),children:w(te,{style:{width:"20px",height:"20px"}})})]})};import{useEffect as lt,useState as ct}from"react";var de=()=>{let[e,t]=ct(typeof window!="undefined"?window.innerHeight>window.innerWidth:!1);return lt(()=>{if(typeof window=="undefined")return;let o=()=>{t(window.innerHeight>window.innerWidth)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e};import{jsx as D,jsxs as Re}from"react/jsx-runtime";var ut={position:"relative",display:"flex",flexDirection:"column",gap:"8px",width:"100%"},dt={position:"relative",display:"flex",alignItems:"center",gap:"8px",width:"100%"},mt={position:"relative",display:"flex",alignItems:"center",flex:1,backgroundColor:"white",borderRadius:"24px",border:"1px solid #e5e5e5",padding:"12px 16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},gt={width:"20px",height:"20px",color:"#03852e",flexShrink:0},ft={flex:1,border:"none",outline:"none",fontSize:"16px",backgroundColor:"transparent",color:"#000"},yt={position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)"},ht={width:"20px",height:"20px",border:"2px solid #e5e5e5",borderTop:"2px solid #03852e",borderRadius:"50%",animation:"spin 1s linear infinite"},bt={position:"absolute",left:"48px",top:"50%",transform:"translateY(-50%)",color:"#737373",pointerEvents:"none",fontSize:"16px"},xt=({mapFirst:e,filters:t,value:o,isSearching:a=!1,placeholder:i,onSearch:p,onFilterChange:u,onValueChange:c,showTypingPrompt:r=!0,customTranslations:n,currency:s="USD",style:l,inputStyle:m,containerStyle:P})=>{let[v,C]=pt(""),f=o!==void 0?o:v,S=c||C,x=de(),{t:h,formatCurrency:k}=M(n),I=h("smartFilter.minRating.suffix"),A=i||h("smartFilter.placeholder"),d=h("smartFilter.typingPrompt"),W=h("smartFilter.nav.previous"),y=h("smartFilter.nav.next"),B=h("smartFilter.clearAll"),_=async L=>{L.preventDefault();let J=f.trim();if(!(!J||a))try{await p(J)}catch(ee){console.error("Search error:",ee)}},b=me(async(L,J)=>{if(!a)try{await u(L)}catch(ee){console.error("Filter change error:",ee)}},[a,u]),R=me(()=>{b([])},[b]),F=me(()=>{b([],!0),S("")},[b,S]);return Re("div",{style:{...ut,...P},children:[D("style",{children:`
5
+ `}),k("button",{style:{flexShrink:0,backgroundColor:v?"#03a03e":"#03852e",borderRadius:"50%",padding:"8px",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s"},onClick:n,onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:k(V,{style:{width:"20px",height:"20px",color:"white"}})}),e.map(l=>{var W,_,B;let w=()=>k(J,{label:l.label,icon:l.icon,remove:()=>{t(e.filter(S=>S.id!==l.id))}},l.id);if(l.type==="minRating"){let S=(W=l.numericValue)!=null?W:Number(l.value);return Number.isFinite(S)?k(G,{rating:S,onChange:P=>{let x=e.map(L=>L.id===l.id?{...L,numericValue:P,value:String(P)}:L);t(x)},onRemove:()=>void t(e.filter(P=>P.id!==l.id))},l.id):w()}if(l.type==="starRating"){let S=(_=l.numericValue)!=null?_:Number(l.value);return Number.isFinite(S)?k(G,{star:!0,rating:S,onChange:P=>{let x=e.map(L=>L.id===l.id?{...L,numericValue:P,value:String(P)}:L);t(x)},onRemove:()=>void t(e.filter(P=>P.id!==l.id))},l.id):w()}return l.type==="priceRange"&&l.priceRange?k(oe,{priceRange:l.priceRange,currency:o,onChange:S=>{let P=e.map(x=>x.id===l.id?{...x,priceRange:S}:x);t(P)},onRemove:()=>void t(e.filter(S=>S.id!==l.id))},l.id):l.type==="transformed_query"?k(se,{value:l.value,onChange:S=>{let P=e.map(x=>x.id===l.id?{...x,value:S}:x);t(P)},onRemove:()=>void t(e.filter(S=>S.id!==l.id))},l.id):l.type==="selected_restaurant_price_levels"?k(ie,{values:(B=l.priceLevels)!=null?B:[],onChange:S=>{let P=e.map(x=>x.id===l.id?{...x,priceLevels:S}:x);t(P)},onRemove:()=>void t(e.filter(S=>S.id!==l.id))},l.id):w()}),k("button",{style:{flexShrink:0,padding:"4px 16px",borderRadius:"9999px",cursor:"pointer",fontSize:"14px",userSelect:"none",border:"none",backgroundColor:H?"#e5e5e5":"transparent",transition:"background-color 0.2s"},onClick:s,onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:a})]}),!m&&k("div",{"aria-hidden":"true",style:{...Ce,left:0,background:"linear-gradient(to right, white, transparent)"}}),!C&&k("div",{"aria-hidden":"true",style:{...Ce,right:0,background:"linear-gradient(to left, white, transparent)"}}),!m&&k("button",{type:"button","aria-label":u,style:{...ve,left:"4px",transform:"translateY(-50%) rotate(180deg)",backgroundColor:y==="prev"?"#e5e5e5":"white"},onClick:()=>g("prev"),onMouseEnter:()=>h("prev"),onMouseLeave:()=>h(null),children:k(Z,{style:{width:"20px",height:"20px"}})}),!C&&k("button",{type:"button","aria-label":d,style:{...ve,right:"4px",backgroundColor:y==="next"?"#e5e5e5":"white"},onClick:()=>g("next"),onMouseEnter:()=>h("next"),onMouseLeave:()=>h(null),children:k(Z,{style:{width:"20px",height:"20px"}})})]})};import{useEffect as nt,useState as ot}from"react";var ue=()=>{let[e,r]=ot(typeof window!="undefined"?window.innerHeight>window.innerWidth:!1);return nt(()=>{if(typeof window=="undefined")return;let o=()=>{r(window.innerHeight>window.innerWidth)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e};import{jsx as N,jsxs as ke}from"react/jsx-runtime";var at={position:"relative",display:"flex",flexDirection:"column",gap:"8px",width:"100%"},st={position:"relative",display:"flex",alignItems:"center",gap:"8px",width:"100%"},lt={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)"},ct={flex:1,border:"none",outline:"none",fontSize:"16px",backgroundColor:"transparent",color:"#000",padding:"10px"},pt={position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)"},ut={width:"20px",height:"20px",border:"2px solid #e5e5e5",borderTop:"2px solid #03852e",borderRadius:"50%",animation:"spin 1s linear infinite"},dt={position:"absolute",padding:"10px",color:"#737373",pointerEvents:"none",fontSize:"16px"},mt=({mapFirst:e,filters:r,value:o,isSearching:i=!1,placeholder:a,onSearch:u,onFilterChange:d,onValueChange:p,showTypingPrompt:t=!0,customTranslations:n,currency:s="USD",style:c,inputStyle:m,containerStyle:C})=>{let[g,b]=it(""),y=o!==void 0?o:g,h=p||b,v=ue(),{t:F,formatCurrency:H}=R(n),z=F("smartFilter.minRating.suffix"),O=a||F("smartFilter.typingPrompt"),l=F("smartFilter.nav.previous"),w=F("smartFilter.nav.next"),W=F("smartFilter.clearAll"),_=async x=>{x.preventDefault();let L=y.trim();if(!(!L||i))try{await u(L)}catch(Y){console.error("Search error:",Y)}},B=de(async(x,L)=>{if(!i)try{await d(x)}catch(Y){console.error("Filter change error:",Y)}},[i,d]),S=de(()=>{B([])},[B]),P=de(()=>{B([],!0),h("")},[B,h]);return ke("div",{style:{...at,...C},children:[N("style",{children:`
6
6
  @keyframes spin {
7
7
  0% { transform: rotate(0deg); }
8
8
  100% { transform: rotate(360deg); }
9
9
  }
10
- `}),D("form",{onSubmit:_,style:{...dt,...l},children:Re("div",{style:mt,children:[D(ge,{style:gt}),D("input",{type:"text",value:f,onChange:L=>S(L.target.value),placeholder:A,disabled:a,style:{...ft,...m},autoComplete:"off","aria-label":"Smart search"}),r&&f.length===0&&!a&&D("span",{style:bt,children:d}),a&&D("div",{style:yt,children:D("div",{style:ht})})]})}),t.length>0&&D(ue,{filters:t,isPortrait:x,currency:s,minRatingSuffix:I,clearAllLabel:B,previousFiltersLabel:W,nextFiltersLabel:y,formatCurrency:k,onFilterChange:b,onResetFilters:R,onClearAll:F})]})};import{jsx as Fe,jsxs as we}from"react/jsx-runtime";function un(e){let t=g.useRef(null),[o,a]=g.useState(null),i=g.useRef(e);return g.useEffect(()=>{i.current=e}),g.useEffect(()=>{let p=i.current,u={adapter:null,...p,callbacks:{...p.callbacks,onPropertiesChange:r=>{var n,s;a(l=>l?{...l,properties:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onPropertiesChange)==null||s.call(n,r)},onSelectedPropertyChange:r=>{var n,s;a(l=>l?{...l,selectedPropertyId:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onSelectedPropertyChange)==null||s.call(n,r)},onPrimaryTypeChange:r=>{var n,s;a(l=>l?{...l,primary:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onPrimaryTypeChange)==null||s.call(n,r)},onFiltersChange:r=>{var n,s;a(l=>l?{...l,filters:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onFiltersChange)==null||s.call(n,r)},onBoundsChange:r=>{var n,s;a(l=>l?{...l,bounds:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onBoundsChange)==null||s.call(n,r)},onCenterChange:(r,n)=>{var s,l;a(m=>m?{...m,center:r,zoom:n}:null),(l=(s=i.current.callbacks)==null?void 0:s.onCenterChange)==null||l.call(s,r,n)},onZoomChange:r=>{var n,s;a(l=>l?{...l,zoom:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onZoomChange)==null||s.call(n,r)},onActiveLocationChange:r=>{var n,s;a(l=>l?{...l,activeLocation:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onActiveLocationChange)==null||s.call(n,r)},onLoadingStateChange:r=>{var n,s;a(l=>l?{...l,initialLoading:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onLoadingStateChange)==null||s.call(n,r)},onSearchingStateChange:r=>{var n,s;a(l=>l?{...l,isSearching:r}:null),(s=(n=i.current.callbacks)==null?void 0:n.onSearchingStateChange)==null||s.call(n,r)}}},c=new Le(u);return t.current=c,a(c.getState()),()=>{c.destroy(),t.current=null,a(null)}},[]),{mapFirst:t.current,state:o}}function dn(e){let[t,o]=g.useState([]);return g.useEffect(()=>{if(!e){o([]);return}o(e.getState().properties)},[e]),t}function mn(e){let[t,o]=g.useState(null);return g.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]),t}function gn(e){let[t,o]=g.useState("Accommodation");g.useEffect(()=>{if(!e){o("Accommodation");return}o(e.getState().primary)},[e]);let a=g.useCallback(i=>{e&&(e.setPrimaryType(i),o(i))},[e]);return[t,a]}function fn(e){let[t,o]=g.useState(null);g.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]);let a=g.useCallback(i=>{e&&e.setSelectedMarker(i)},[e]);return[t,a]}function yn({mapFirst:e,map:t,maplibregl:o,onMarkerClick:a}){let i=g.useRef(!1);g.useEffect(()=>{!e||!t||i.current||(e.attachMap(t,{platform:"maplibre",maplibregl:o,onMarkerClick:a}),i.current=!0)},[e,t,o,a])}function hn({mapFirst:e,map:t,google:o,onMarkerClick:a}){let i=g.useRef(!1);g.useEffect(()=>{!e||!t||i.current||(e.attachMap(t,{platform:"google",google:o,onMarkerClick:a}),i.current=!0)},[e,t,o,a])}function bn({mapFirst:e,map:t,mapboxgl:o,onMarkerClick:a}){let i=g.useRef(!1);g.useEffect(()=>{!e||!t||i.current||(e.attachMap(t,{platform:"mapbox",mapboxgl:o,onMarkerClick:a}),i.current=!0)},[e,t,o,a])}function xn(e){let t=g.useRef(null);return g.useEffect(()=>{if(!e)return;let o=new Le(e);return t.current=o,()=>{o.destroy(),t.current=null}},[e]),t}function Sn(e){let[t,o]=g.useState(!1),[a,i]=g.useState(null);return{search:g.useCallback(async u=>{if(!e){let c=new Error("MapFirst instance not available");throw i(c),c}o(!0),i(null);try{return await e.runPropertiesSearch({...u,onError:r=>{let n=r instanceof Error?r:new Error(String(r));i(n)}})}catch(c){let r=c instanceof Error?c:new Error(String(c));throw i(r),r}finally{o(!1)}},[e]),isLoading:t,error:a}}function vn(e){let[t,o]=g.useState(!1),[a,i]=g.useState(null);return{search:g.useCallback(async u=>{if(!e){let c=new Error("MapFirst instance not available");throw i(c),c}o(!0),i(null);try{return await e.runSmartFilterSearch({...u,onError:r=>{let n=r instanceof Error?r:new Error(String(r));i(n)}})}catch(c){let r=c instanceof Error?c:new Error(String(c));throw i(r),r}finally{o(!1)}},[e]),isLoading:t,error:a}}function Cn({markers:e}){return we("div",{style:{fontFamily:"sans-serif",fontSize:14},children:[Fe("strong",{children:"Markers"}),Fe("ul",{children:e.map(t=>{var o,a,i,p,u,c;return we("li",{children:[t.name," \u2014 ",(i=(a=(o=t.location)==null?void 0:o.lat)==null?void 0:a.toFixed(3))!=null?i:"n/a",","," ",(c=(u=(p=t.location)==null?void 0:p.lon)==null?void 0:u.toFixed(3))!=null?c:"n/a"]},String(t.tripadvisor_id))})})]})}export{ge as AiIcon,re as Chip,H as CloseIcon,q as EditIcon,ue as FilterChips,Cn as MarkerDebugList,G as MinRatingFilterChip,te as NextIcon,se as PriceRangeFilterChip,ae as RestaurantPriceLevelChip,V as SearchIcon,xt as SmartFilter,fe as StarIcon,le as TransformedQueryChip,Mt as createMinRatingFilterLabel,It as createPriceRangeFilterLabel,ne as formatRatingValue,Ae as renderStars,ce as useFilterScroll,hn as useGoogleMapsAttachment,de as useIsPortrait,xn as useMapFirst,un as useMapFirstCore,dn as useMapFirstProperties,mn as useMapFirstSelectedProperty,yn as useMapLibreAttachment,bn as useMapboxAttachment,gn as usePrimaryType,Sn as usePropertiesSearch,fn as useSelectedMarker,vn as useSmartFilterSearch,M as useTranslation};
10
+ `}),N("form",{onSubmit:_,style:{...st,...c},children:ke("div",{style:lt,children:[N("input",{type:"text",value:y,onChange:x=>h(x.target.value),disabled:i,style:{...ct,...m},autoComplete:"off","aria-label":"Smart search"}),t&&y.length===0&&!i&&N("span",{style:dt,children:O}),i&&N("div",{style:pt,children:N("div",{style:ut})})]})}),r.length>0&&N(pe,{filters:r,isPortrait:v,currency:s,minRatingSuffix:z,clearAllLabel:W,previousFiltersLabel:l,nextFiltersLabel:w,formatCurrency:H,onFilterChange:B,onResetFilters:S,onClearAll:P})]})};import{jsx as Fe,jsxs as Re}from"react/jsx-runtime";function on(e){let r=f.useRef(null),[o,i]=f.useState(null),a=f.useRef(e);return f.useEffect(()=>{a.current=e}),f.useEffect(()=>{let u=a.current,d={adapter:null,...u,callbacks:{...u.callbacks,onPropertiesChange:t=>{var n,s;i(c=>c?{...c,properties:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onPropertiesChange)==null||s.call(n,t)},onSelectedPropertyChange:t=>{var n,s;i(c=>c?{...c,selectedPropertyId:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onSelectedPropertyChange)==null||s.call(n,t)},onPrimaryTypeChange:t=>{var n,s;i(c=>c?{...c,primary:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onPrimaryTypeChange)==null||s.call(n,t)},onFiltersChange:t=>{var n,s;i(c=>c?{...c,filters:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onFiltersChange)==null||s.call(n,t)},onBoundsChange:t=>{var n,s;i(c=>c?{...c,bounds:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onBoundsChange)==null||s.call(n,t)},onCenterChange:(t,n)=>{var s,c;i(m=>m?{...m,center:t,zoom:n}:null),(c=(s=a.current.callbacks)==null?void 0:s.onCenterChange)==null||c.call(s,t,n)},onZoomChange:t=>{var n,s;i(c=>c?{...c,zoom:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onZoomChange)==null||s.call(n,t)},onActiveLocationChange:t=>{var n,s;i(c=>c?{...c,activeLocation:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onActiveLocationChange)==null||s.call(n,t)},onLoadingStateChange:t=>{var n,s;i(c=>c?{...c,initialLoading:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onLoadingStateChange)==null||s.call(n,t)},onSearchingStateChange:t=>{var n,s;i(c=>c?{...c,isSearching:t}:null),(s=(n=a.current.callbacks)==null?void 0:n.onSearchingStateChange)==null||s.call(n,t)}}},p=new we(d);return r.current=p,i(p.getState()),()=>{p.destroy(),r.current=null,i(null)}},[]),{mapFirst:r.current,state:o}}function an(e){let[r,o]=f.useState([]);return f.useEffect(()=>{if(!e){o([]);return}o(e.getState().properties)},[e]),r}function sn(e){let[r,o]=f.useState(null);return f.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]),r}function ln(e){let[r,o]=f.useState("Accommodation");f.useEffect(()=>{if(!e){o("Accommodation");return}o(e.getState().primary)},[e]);let i=f.useCallback(a=>{e&&(e.setPrimaryType(a),o(a))},[e]);return[r,i]}function cn(e){let[r,o]=f.useState(null);f.useEffect(()=>{if(!e){o(null);return}o(e.getState().selectedPropertyId)},[e]);let i=f.useCallback(a=>{e&&e.setSelectedMarker(a)},[e]);return[r,i]}function pn({mapFirst:e,map:r,maplibregl:o,onMarkerClick:i}){let a=f.useRef(!1);f.useEffect(()=>{!e||!r||a.current||(e.attachMap(r,{platform:"maplibre",maplibregl:o,onMarkerClick:i}),a.current=!0)},[e,r,o,i])}function un({mapFirst:e,map:r,google:o,onMarkerClick:i}){let a=f.useRef(!1);f.useEffect(()=>{!e||!r||a.current||(e.attachMap(r,{platform:"google",google:o,onMarkerClick:i}),a.current=!0)},[e,r,o,i])}function dn({mapFirst:e,map:r,mapboxgl:o,onMarkerClick:i}){let a=f.useRef(!1);f.useEffect(()=>{!e||!r||a.current||(e.attachMap(r,{platform:"mapbox",mapboxgl:o,onMarkerClick:i}),a.current=!0)},[e,r,o,i])}function mn(e){let r=f.useRef(null);return f.useEffect(()=>{if(!e)return;let o=new we(e);return r.current=o,()=>{o.destroy(),r.current=null}},[e]),r}function fn(e){let[r,o]=f.useState(!1),[i,a]=f.useState(null);return{search:f.useCallback(async d=>{if(!e){let p=new Error("MapFirst instance not available");throw a(p),p}o(!0),a(null);try{return await e.runPropertiesSearch({...d,onError:t=>{let n=t instanceof Error?t:new Error(String(t));a(n)}})}catch(p){let t=p instanceof Error?p:new Error(String(p));throw a(t),t}finally{o(!1)}},[e]),isLoading:r,error:i}}function gn(e){let[r,o]=f.useState(!1),[i,a]=f.useState(null);return{search:f.useCallback(async d=>{if(!e){let p=new Error("MapFirst instance not available");throw a(p),p}o(!0),a(null);try{return await e.runSmartFilterSearch({...d,onError:t=>{let n=t instanceof Error?t:new Error(String(t));a(n)}})}catch(p){let t=p instanceof Error?p:new Error(String(p));throw a(t),t}finally{o(!1)}},[e]),isLoading:r,error:i}}function yn({markers:e}){return Re("div",{style:{fontFamily:"sans-serif",fontSize:14},children:[Fe("strong",{children:"Markers"}),Fe("ul",{children:e.map(r=>{var o,i,a,u,d,p;return Re("li",{children:[r.name," \u2014 ",(a=(i=(o=r.location)==null?void 0:o.lat)==null?void 0:i.toFixed(3))!=null?a:"n/a",","," ",(p=(d=(u=r.location)==null?void 0:u.lon)==null?void 0:d.toFixed(3))!=null?p:"n/a"]},String(r.tripadvisor_id))})})]})}export{J as Chip,me as CloseIcon,q as EditIcon,pe as FilterChips,yn as MarkerDebugList,G as MinRatingFilterChip,Z as NextIcon,oe as PriceRangeFilterChip,ie as RestaurantPriceLevelChip,V as SearchIcon,mt as SmartFilter,fe as StarIcon,se as TransformedQueryChip,Rt as createMinRatingFilterLabel,wt as createPriceRangeFilterLabel,ee as formatRatingValue,De as renderStars,le as useFilterScroll,un as useGoogleMapsAttachment,ue as useIsPortrait,mn as useMapFirst,on as useMapFirstCore,an as useMapFirstProperties,sn as useMapFirstSelectedProperty,pn as useMapLibreAttachment,dn as useMapboxAttachment,ln as usePrimaryType,fn as usePropertiesSearch,cn as useSelectedMarker,gn as useSmartFilterSearch,R as useTranslation};
11
11
  //# sourceMappingURL=index.mjs.map