1import{g as R,r,j as e,dH as Ee,L as H,b as Z,G as se,aS as _e,bW as He,ex as Fe,cU as We,aJ as te,bl as ye,aZ as Y,X as O,dB as Ae,a1 as W,ct as Ye,gi as Ge,bf as Je,i as Le,e as Qe,aD as re,aR as ie,ez as Ze,eA as Xe,aK as es}from"./vendor-BeA4siBz.js";import{u as pe,B as S,g as X,I as ee,C as oe,d as ce,n as Be,D as ss,h as ts,j as as,k as ls,l as rs,m as is,f as Te,q as $e}from"./index-C2NQ_9nj.js";import{T as je}from"./textarea-BzoSp81z.js";import{L as D}from"./label-BgiDwF3G.js";import{C as we}from"./checkbox-B1osEMLJ.js";const Ne={search:"",boatCategories:[],minPrice:"",maxPrice:"",vendorProviderTypes:[]};function ns(s){return s.search.trim()!==""||s.boatCategories.length>0||s.minPrice!==""||s.maxPrice!==""||s.vendorProviderTypes.length>0}function os(s,t){const l=new URLSearchParams;return s.search.trim()&&l.set("q",s.search.trim()),s.boatCategories.length&&l.set("cat",s.boatCategories.join(",")),s.minPrice&&l.set("minP",s.minPrice),s.maxPrice&&l.set("maxP",s.maxPrice),s.vendorProviderTypes.length&&l.set("vt",s.vendorProviderTypes.join(",")),t.showBoats||l.set("boats","0"),t.showVendors||l.set("vendors","0"),t.showMarinas||l.set("marinas","0"),t.showAnchorages||l.set("anc","0"),t.showAccessories&&l.set("acc","1"),l}function cs(s){const t=new URLSearchParams(s),l={search:t.get("q")||"",boatCategories:t.get("cat")?t.get("cat").split(",").filter(Boolean):[],minPrice:t.get("minP")||"",maxPrice:t.get("maxP")||"",vendorProviderTypes:t.get("vt")?t.get("vt").split(",").filter(Boolean):[]},i={showBoats:t.get("boats")!=="0",showVendors:t.get("vendors")!=="0",showMarinas:t.get("marinas")!=="0",showAnchorages:t.get("anc")!=="0",showAccessories:t.get("acc")==="1"};return{filters:l,visibility:i}}function ve(s){return s.search.trim()!==""||s.boatCategories.length>0||s.minPrice!==""||s.maxPrice!==""}function xs(s,t){const[l,i]=r.useState(s);return r.useEffect(()=>{const o=setTimeout(()=>i(s),t);return()=>clearTimeout(o)},[s,t]),l}function ds(s,t){const l=new URLSearchParams;s&&l.set("search",s),t.boatCategories.length&&l.set("category",t.boatCategories.join(",")),t.minPrice&&l.set("minPrice",t.minPrice),t.maxPrice&&l.set("maxPrice",t.maxPrice);const i=l.toString();return i?`?${i}`:""}function ms(s,t){const l=new URLSearchParams;s&&l.set("search",s),t.vendorProviderTypes.length&&l.set("providerType",t.vendorProviderTypes.join(","));const i=l.toString();return i?`?${i}`:""}function Re(s){if(!s)return null;const t=parseFloat(s);return isNaN(t)?null:t>=1e6?`$${(t/1e6).toFixed(1)}M`:t>=1e3?`$${(t/1e3).toFixed(0)}K`:`$${t.toFixed(0)}`}function hs(s){const[t,l]=r.useState(!1),[i,o]=r.useState(null);return r.useEffect(()=>{var w;if(!s){o("Google Maps API key not configured");return}if(o(null),(w=window.google)!=null&&w.maps){l(!0);return}const d="google-maps-marine";if(window.initMarineMap=()=>l(!0),document.getElementById(d)){const f=setInterval(()=>{var g;(g=window.google)!=null&&g.maps&&(l(!0),clearInterval(f))},100);return()=>clearInterval(f)}const u=document.createElement("script");return u.id=d,u.src=`https://maps.googleapis.com/maps/api/js?key=${s}&loading=async&callback=initMarineMap`,u.async=!0,u.defer=!0,u.onerror=()=>o("Failed to load Google Maps"),document.head.appendChild(u),()=>{window.initMarineMap=void 0}},[s]),{loaded:t,error:i}}function us({pos:s,children:t}){const l=r.useRef(null),[i,o]=r.useState({visibility:"hidden"});return r.useEffect(()=>{const d=l.current;if(!d)return;const u=d.offsetParent;if(!u)return;const w=()=>{const g=u.clientWidth,x=u.clientHeight,N=d.offsetWidth,y=d.offsetHeight,k=window.innerWidth<640;if(!s||k){o({left:Math.max(8,(g-N)/2),bottom:24,top:"auto",visibility:"visible"});return}const h=36,C=Math.min(Math.max(8,s.x-N/2),Math.max(8,g-N-8));let j;s.y-h-y>=8?j=s.y-h-y:j=Math.min(s.y+14,Math.max(8,x-y-8)),o({left:C,top:j,bottom:"auto",visibility:"visible"})};w();const f=new ResizeObserver(w);return f.observe(d),()=>f.disconnect()},[s]),e.jsx("div",{ref:l,className:"absolute z-50 w-72 max-w-[90vw]",style:i,children:t})}function ps({boat:s,onClose:t}){return e.jsx(oe,{className:"shadow-xl border-blue-200",children:e.jsxs(ce,{className:"p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[s.imageUrl?e.jsx("img",{src:s.imageUrl,alt:s.name,className:"w-16 h-16 object-cover rounded-lg flex-shrink-0"}):e.jsx("div",{className:"w-16 h-16 bg-blue-100 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(te,{className:"w-7 h-7 text-blue-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm text-slate-800 leading-tight line-clamp-2",children:s.name}),(s.boatMake||s.boatYear)&&e.jsx("p",{className:"text-xs text-slate-500",children:[s.boatYear,s.boatMake,s.boatModel].filter(
1Boolean).join(" ")}),s.price&&e.jsx("p",{className:"text-blue-700 font-bold text-sm mt-0.5",children:Re(s.price)}),s.location&&e.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-1 mt-0.5",children:[e.jsx(Y,{className:"w-3 h-3"}),s.location]})]}),e.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 flex-shrink-0",children:e.jsx(O,{className:"w-4 h-4"})})]}),e.jsx(H,{href:`/product/${s.id}`,children:e.jsxs(S,{size:"sm",className:"w-full mt-2 h-7 text-xs gap-1.5",children:[e.jsx(W,{className:"w-3 h-3"}),"View Listing"]})})]})})}function gs({boats:s,onClose:t}){var l;return e.jsx(oe,{className:"shadow-xl border-blue-200",children:e.jsxs(ce,{className:"p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("p",{className:"font-semibold text-sm text-slate-800 flex items-center gap-1.5",children:[e.jsx(te,{className:"w-4 h-4 text-blue-500"}),s.length," boats at this location"]}),e.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 flex-shrink-0",children:e.jsx(O,{className:"w-4 h-4"})})]}),((l=s[0])==null?void 0:l.location)&&e.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-1 mb-2",children:[e.jsx(Y,{className:"w-3 h-3"}),s[0].location]}),e.jsx("div",{className:"max-h-56 overflow-y-auto space-y-1.5 pr-1",children:s.map(i=>e.jsxs("a",{href:`/product/${i.id}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-1.5 rounded-lg hover:bg-blue-50 transition-colors group",children:[i.imageUrl?e.jsx("img",{src:i.imageUrl,alt:i.name,className:"w-11 h-11 object-cover rounded-md flex-shrink-0"}):e.jsx("div",{className:"w-11 h-11 bg-blue-100 rounded-md flex items-center justify-center flex-shrink-0",children:e.jsx(te,{className:"w-5 h-5 text-blue-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-slate-800 leading-tight line-clamp-2 group-hover:text-blue-700",children:i.name}),i.price&&e.jsx("p",{className:"text-blue-700 font-bold text-xs mt-0.5",children:Re(i.price)})]}),e.jsx(W,{className:"w-3.5 h-3.5 text-slate-300 group-hover:text-blue-500 flex-shrink-0"})]},i.id))})]})})}const bs={moorings:"Moorings",docks:"Docks & Lifts",trailers:"Boat Trailers",mooring_services:"Moorings",dock_sales_install:"Docks & Lifts",boat_trailer_dealer:"Boat Trailers",harbor_spot:"Harbor Spot",accessory_listing:"For Sale"};function fs({pin:s,onClose:t}){return e.jsx(oe,{className:"shadow-xl border-amber-200",children:e.jsxs(ce,{className:"p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[s.logo?e.jsx("img",{src:s.logo,alt:s.name,className:"w-12 h-12 object-cover rounded-lg flex-shrink-0"}):e.jsx("div",{className:"w-12 h-12 bg-amber-100 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(Z,{className:"w-6 h-6 text-amber-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm text-slate-800 leading-tight",children:s.name}),e.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[e.jsx(X,{variant:"secondary",className:"text-[10px] py-0 bg-amber-50 text-amber-700",children:bs[s.category]||s.category}),s.source==="spot"&&typeof s.availableUnits=="number"&&e.jsxs(X,{variant:"secondary",className:"text-[10px] py-0 bg-emerald-50 text-emerald-700",children:[s.availableUnits," available"]}),s.source==="listing"&&s.price!=null&&Number(s.price)>0&&e.jsxs(X,{variant:"secondary",className:"text-[10px] py-0 bg-emerald-50 text-emerald-700",children:["$",Number(s.price).toLocaleString()]})]}),s.location&&e.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-1 mt-0.5",children:[e.jsx(Y,{className:"w-3 h-3"}),s.location]})]}),e.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 flex-shrink-0",children:e.jsx(O,{className:"w-4 h-4"})})]}),s.source==="listing"&&s.url?e.jsx(H,{href:s.url,children:e.jsxs(S,{size:"sm",variant:"outline",className:"w-full mt-2 h-7 text-xs gap-1.5 border-amber-200 text-amber-700 hover:bg-amber-50",children:[e.jsx(W,{className:"w-3 h-3"}),"View Listing"]})}):s.source==="spot"?e.jsx(H,{href:"/harborspots",children:e.jsxs(S,{size:"sm",variant:"outline",className:"w-full mt-2 h-7 text-xs gap-1.5 border-amber-200 text-amber-700 hover:bg-amber-50",children:[e.jsx(W,{className:"w-3 h-3"}),"Harbor Spots"]})}):s.source==="claimed"&&s.slug?e.jsx(H,{href:`/store/${s.slug}`,children:e.jsxs(S,{size:"sm",variant:"outline",className:"w-full mt-2 h-7 text-xs gap-1.5 border-amber-200 text-amber-700 hover:bg-amber-50",children:[e.jsx(W,{className:"w-3 h-3"}),"Visit Store"]})}):e.jsx(H,{href:"/boat-accessories",children:e.jsxs(S,{size:"sm",variant:"outline",className:"w-full mt-2 h-7 text-xs gap-1.5 border-amber-200 text-amber-700 hover:bg-amber-50",children:[e.jsx(W,{className:"w-3 h-3"}),"Accessory Sourcing"]})})]})})}function js({vendor:s,onClose:t}){return e.jsx(oe,{className:"shadow-xl border-emerald-200",children:e.jsxs(ce,{className:"p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[s.logo?e.jsx("img",{src:s.logo,alt:s.name,className:"w-12 h-12 object-cover rounded-lg flex-shrink-0"}):e.jsx("div",{className:"w-12 h-12 bg-emerald-100 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(ye,{className:"w-6 h-6 text-emerald-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm text-slate-800 leading-tight",children:s.name}),s.providerType&&e.jsx(X,{variant:"secondary",className:"text-[10px] py-0 mt-0.5 bg-emerald-50 text-emerald-700",children:s.providerType}),s.location&&e.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-1 mt-0.5",children:[e.jsx(Y,{className:"w-3 h-3"}),s.location]})]}),e.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 flex-shrink-0",children:e.jsx(O,{className:"w-4 h-4"})})]}),e.jsx(H,{href:`/store/${s.slug}`,children:e.jsxs(S,{size:"sm",variant:"outline",className:"w-full mt-2 h-7 text-xs gap-1.5 border-emerald-200 text-emerald-700 hover:bg-emerald-50",children:[e.jsx(W,{className:"w-3 h-3"}),"Visit Store"]})})]})})}function ws({marina:s,onClose:t,onContribute:l,onSuggestPinFix:i}){const{user:o}=Be(),{toast:d}=pe(),{data:u=[]}=R({queryKey:["/api/maps/marinas",s.id,"community"],queryFn:async()=>{const x=await fetch(`/api/maps/marinas/${s.id}/community`,{credentials:"include"});if(!x.ok)throw new Error("Failed to load community info");return x.json()}}),w=u.flatMap(x=>x.photos).slice(0,8),f=u.filter(x=>x.description||x.amenities||x.tips).slice(0,3);function g(x){if(!o){d({title:"Sign in required",description:"Log in to contribute photos, details, or pin fixes."});return}x()}return e.jsx(oe,{className:"shadow-xl border-indigo-200 w-72",children:e.jsxs(ce,{className:"p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(Z,{className:"w-5 h-5 text-indigo-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm text-slate-800 leading-tight",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx(X,{variant:"secondary",className:`text-[10px] py-0 ${s.type==="marina"?"bg-indigo-50 text-indigo-700":"bg-purple-50 text-purple-700"}`,children:s.type==="marina"?"Marina":"Anchorage"}),e.jsx("span",{className:"text-xs text-slate-400",children:s.region})]}),s.description&&e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s.description})]}),e.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 flex-shrink-0",children:e.jsx(O,{className:"w-4 h-4"})})]}),w.length>0&&e.jsx("div",{className:"mt-2 flex gap-1.5 overflow-x-auto pb-1",children:w.map((x,N)=>e.jsx("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0",children:e.jsx("img",{src:x,alt:`${s.name} community photo`,className:"w-16 h-16 object-cover rounded-md border border-slate-200"})},N))}),f.length>0&&e.jsx("div",{className:"mt-2 space-y-1.5 max-h-36 overflow-y-auto pr-1",children:f.map(x=>e.jsxs("div",{className:"bg-slate-50 rounded-md p-2",children:[x.description&&e.jsx("p",{className:"text-xs text-slate-600",children:x.description}),x.amenities&&e.jsxs("p",{className:"text-xs text-slate-500 mt-1 flex items-start gap-1",children:[e.jsx(Ye,{className:"w-3 h-3 mt-0.5 flex-shrink-0 text-indigo-400"}),x.amenities]}),x.tips&&e.jsxs("p",{className:"text-xs text-slate-500 mt-1 flex items-start gap-1",children:[e.jsx(Ge,{className:"w-3 h-3 mt-0.5 flex-shrink-0 text-amber-400"}),x.tips]}),e.jsxs("p",{className:"text-[10px] text-slate-400 mt-1",children:["â ",x.contributor]})]},x.id))}),e.jsxs("div",{className:"flex gap-1.5 mt-2",children:[e.jsxs(S,{size:"sm",variant:"outline",className:"flex-1 h-7 text-xs gap-1 border-indigo-200 text-indigo-700 hover:bg-indigo-50",onClick:()=>g(()=>l(s)),children:[e.jsx(Je,{className:"w-3 h-3"}),"Add Photos & Info"]}),e.jsxs(S,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1 border-slate-200 text-slate-600 hover:bg-slate-50",onClick:()=>g(()=>i(s)),title:"Pin in the wrong spot? Suggest a fix",children:[e.jsx(Ae,{className:"w-3 h-3"}),"Fix Pin"]})]})]})})}function vs({marina:s,onClose:t}){const{toast:l}=pe(),[i,o]=r.useState(""),[d,u]=r.useState(""),[w,f]=r.useState(""),[g,x]=r.useState([]),[N,y]=r.useState(!1);async function k(){if(!i.trim()&&!d.trim()&&!w.trim()&&g.length===0){l({title:"Nothing to submit",description:"Add at least one photo or some details first.",variant:"destructive"});return}y(!0);try{const h=new FormData;h.append("description",i.trim()),h.append("amenities",d.trim()),h.append("tips",w.trim()),g.slice(0,6).forEac
1h(j=>h.append("photos",j));const C=await fetch(`/api/maps/marinas/${s.id}/contributions`,{method:"POST",credentials:"include",body:h});if(!C.ok){const j=await C.json().catch(()=>({}));throw new Error(j.message||"Submission failed")}l({title:"Thanks for contributing!",description:"Your submission is awaiting review by our team before it appears on the map."}),t()}catch(h){l({title:"Submission failed",description:h.message||"Please try again.",variant:"destructive"})}finally{y(!1)}}return e.jsx(ss,{open:!0,onOpenChange:h=>{h||t()},children:e.jsxs(ts,{className:"sm:max-w-md",children:[e.jsxs(as,{children:[e.jsxs(ls,{children:["Add Photos & Info â ",s.name]}),e.jsx(rs,{children:"Share what you know. Everything is reviewed by our team before it appears publicly."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(D,{className:"text-xs",children:"Photos (up to 6)"}),e.jsx(ee,{type:"file",accept:"image/*,.heic,.heif",multiple:!0,onChange:h=>x(Array.from(h.target.files||[]).filter(C=>C.type.startsWith("image/")||/\.(heic|heif)$/i.test(C.name)).slice(0,6)),className:"text-xs"}),g.length>0&&e.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[g.length," photo",g.length===1?"":"s"," selected"]})]}),e.jsxs("div",{children:[e.jsx(D,{className:"text-xs",children:"Description"}),e.jsx(je,{value:i,onChange:h=>o(h.target.value),rows:2,maxLength:2e3,placeholder:"What's this spot like?"})]}),e.jsxs("div",{children:[e.jsx(D,{className:"text-xs",children:"Amenities"}),e.jsx(je,{value:d,onChange:h=>u(h.target.value),rows:2,maxLength:1e3,placeholder:"Fuel dock, showers, provisioning, mooringsâ¦"})]}),e.jsxs("div",{children:[e.jsx(D,{className:"text-xs",children:"Local Tips"}),e.jsx(je,{value:w,onChange:h=>f(h.target.value),rows:2,maxLength:2e3,placeholder:"Best approach, holding, dinghy dock adviceâ¦"})]})]}),e.jsxs(is,{children:[e.jsx(S,{variant:"outline",onClick:t,children:"Cancel"}),e.jsxs(S,{onClick:k,disabled:N,className:"gap-2",children:[N&&e.jsx(se,{className:"w-4 h-4 animate-spin"}),"Submit for Review"]})]})]})})}function Ns({apiKey:s,boatGroups:t,vendorPins:l,marinaPins:i,accessoryPins:o,showBoats:d,showVendors:u,showMarinas:w,showAnchorages:f,showAccessories:g,onPinClick:x,selectedAnchor:N,onAnchorScreenPos:y,pinFixTarget:k,onPinFixMove:h}){const C=r.useRef(null),j=r.useRef(null),K=r.useRef([]),G=r.useRef(null),M=r.useRef(null),{loaded:P,error:U}=hs(s),J=r.useCallback(()=>{K.current.forEach(a=>a.setMap(null)),K.current=[]},[]),v=r.useCallback((a,p,L,B,z,T="circle",$)=>{if(!j.current||!window.google)return;const V=j.current,_=T==="pin"?{path:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z",fillColor:L,fillOpacity:1,strokeColor:"white",strokeWeight:1.5,scale:$&&$>1?1.9:1.6,anchor:new window.google.maps.Point(12,22),labelOrigin:new window.google.maps.Point(12,9)}:{path:window.google.maps.SymbolPath.CIRCLE,fillColor:L,fillOpacity:1,strokeColor:"white",strokeWeight:2,scale:9},b=new window.google.maps.Marker({position:{lat:a,lng:p},map:V,title:B,icon:_,zIndex:T==="pin"?1e3:1,label:$&&$>1?{text:String($),color:"white",fontSize:"11px",fontWeight:"bold"}:void 0});b.addListener("click",z),K.current.push(b)},[]);return r.useEffect(()=>{if(!P||!C.current||j.current)return;const a=new window.google.maps.Map(C.current,{center:{lat:18.35,lng:-65},zoom:8,mapTypeId:"hybrid",mapTypeControl:!1,fullscreenControl:!0,streetViewControl:!1,gestureHandling:"greedy"});j.current=a;const p=new window.google.maps.OverlayView;p.onAdd=()=>{},p.draw=()=>{},p.onRemove=()=>{},p.setMap(a),G.current=p,fetch("/api/maps/log-usage",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({surface:"map_load"})}).catch(()=>{})},[P]),r.useEffect(()=>{const a=j.current;if(!P||!a||!window.google)return;if(!N){y(null);return}const p=()=>{var $;const z=($=G.current)==null?void 0:$.getProjection();if(!z)return;const T=z.fromLatLngToContainerPixel(new window.google.maps.LatLng(N.lat,N.lng));T&&y({x:T.x,y:T.y})};p();const L=a.addListener("bounds_changed",p),B=a.addListener("idle",p);return()=>{L.remove(),B.remove()}},[P,N,y]),r.useEffect(()=>{!j.current||!window.google||(J(),d&&t.forEach(a=>{const p=a.boats.length>1?`${a.boats.length} boats here`:a.boats[0].name;v(a.lat,a.lng,"#2563eb",p,()=>x({type:"boats",data:a,lat:a.lat,lng:a.lng}),"pin",a.boats.length)}),u&&l.forEach(a=>v(a.lat,a.lng,"#059669",a.name,()=>x({type:"vendor",data:a,lat:a.lat,lng:a.lng}))),g&&o.forEach(a=>v(a.lat,a.lng,"#d97706",a.name,()=>x({type:"accessory",data:a,lat:a.lat,lng:a.lng}
1))),i.forEach(a=>{a.type==="marina"&&w?v(a.lat,a.lng,"#7c3aed",a.name,()=>x({type:"marina",data:a,lat:a.lat,lng:a.lng})):a.type==="anchorage"&&f&&v(a.lat,a.lng,"#9333ea",a.name,()=>x({type:"marina",data:a,lat:a.lat,lng:a.lng}))}))},[P,t,l,i,o,d,u,w,f,g,J,v,x]),r.useEffect(()=>{const a=j.current;if(!P||!a||!window.google||(M.current&&(M.current.setMap(null),M.current=null),!k))return;const p=new window.google.maps.Marker({position:{lat:k.lat,lng:k.lng},map:a,draggable:!0,zIndex:2e3,title:`Drag to the correct spot for ${k.name}`,icon:{path:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z",fillColor:"#f59e0b",fillOpacity:1,strokeColor:"white",strokeWeight:2,scale:2,anchor:new window.google.maps.Point(12,22)},animation:window.google.maps.Animation.BOUNCE});return setTimeout(()=>p.setAnimation(null),2100),p.addListener("dragend",()=>{const L=p.getPosition();L&&h({lat:L.lat(),lng:L.lng()})}),a.panTo({lat:k.lat,lng:k.lng}),a.getZoom()<14&&a.setZoom(14),M.current=p,()=>{p.setMap(null),M.current=null}},[P,k,h]),U?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full bg-slate-100 text-slate-500 gap-3",children:[e.jsx(Ee,{className:"w-12 h-12"}),e.jsx("p",{className:"text-sm",children:U})]}):P?e.jsx("div",{ref:C,className:"w-full h-full",style:{minHeight:0,height:"100%"}}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full bg-slate-100 text-slate-500 gap-3",children:[e.jsx(se,{className:"w-8 h-8 animate-spin text-blue-500"}),e.jsx("p",{className:"text-sm",children:"Loading 3D Marine Mapâ¦"})]})}const ys=[{key:"boats",label:"Boat Listings",color:"text-blue-400",icon:e.jsx(te,{className:"w-3.5 h-3.5"})},{key:"vendors",label:"Dealers",color:"text-emerald-400",icon:e.jsx(ye,{className:"w-3.5 h-3.5"})},{key:"marinas",label:"Marinas",color:"text-violet-400",icon:e.jsx(Z,{className:"w-3.5 h-3.5"})},{key:"anchorages",label:"Anchorages",color:"text-purple-400",icon:e.jsx(Y,{className:"w-3.5 h-3.5"})}];function ks({onSave:s,isSaving:t,onCancel:l}){const[i,o]=r.useState("");return e.jsxs("div",{className:"bg-slate-800 border border-slate-600 rounded-lg p-3 space-y-2",children:[e.jsx("p",{className:"text-slate-300 text-xs font-medium",children:"Name this preset"}),e.jsx(ee,{autoFocus:!0,placeholder:"e.g. Powerboats under $50K",value:i,onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&i.trim()&&s(i.trim())},className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-500 text-xs h-8 focus-visible:ring-blue-500",maxLength:60}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{size:"sm",onClick:()=>i.trim()&&s(i.trim()),disabled:!i.trim()||t,className:"flex-1 h-7 text-xs bg-blue-600 hover:bg-blue-700",children:t?e.jsx(se,{className:"w-3 h-3 animate-spin"}):"Save"}),e.jsx(S,{size:"sm",variant:"ghost",onClick:l,className:"h-7 text-xs text-slate-400 hover:text-white",children:"Cancel"})]})]})}function Cs({filters:s,onChange:t,boatCategories:l,vendorProviderTypes:i,boatCount:o,vendorCount:d,marinaCount:u,anchorageCount:w,showBoats:f,setShowBoats:g,showVendors:x,setShowVendors:N,showMarinas:y,setShowMarinas:k,showAnchorages:h,setShowAnchorages:C,showAccessories:j,onClose:K,onApplyPreset:G}){const{user:M}=Be(),{toast:P}=pe(),[U,J]=r.useState(!0),[v,a]=r.useState(!0),[p,L]=r.useState(!0),[B,z]=r.useState(!0),[T,$]=r.useState(!0),[V,_]=r.useState(!1),{data:b=[],isLoading:E}=R({queryKey:["/api/maps/presets"],enabled:!!M}),xe=Le({mutationFn:n=>Te("POST","/api/maps/presets",n),onSuccess:()=>{$e.invalidateQueries({queryKey:["/api/maps/presets"]}),_(!1),P({title:"Preset saved",description:"Your filter preset has been saved."})},onError:n=>{P({title:"Failed to save preset",description:(n==null?void 0:n.message)||"Please try again.",variant:"destructive"})}}),ae=Le({mutationFn:n=>Te("DELETE",`/api/maps/presets/${n}`),onSuccess:()=>{$e.invalidateQueries({queryKey:["/api/maps/presets"]})},onError:()=>{P({title:"Failed to delete preset",variant:"destructive"})}}),de={boats:{value:f,set:g,count:o},vendors:{value:x,set:N,count:d},marinas:{value:y,set:k,count:u},anchorages:{value:h,set:C,count:w}};function me(n){xe.mutate({name:n,filters:{...s,showBoats:f,showVendors:x,showMarinas:y,showAnchorages:h,showAccessories:j}})}return e.jsxs("div",{className:"absolute top-0 left-0 h-full w-72 bg-slate-900/95 backdrop-blur-sm z-40 flex flex-col shadow-2xl border-r border-slate-700",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-700",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4 text-blue-400"}),e.jsx("span",{className:"text-white font-semibold text-sm",children:"Search & Filter"})]}),e.jsx("button",{onClick:K,className:"text-slate-400 hover:text-white transition-colors",children:e.jsx(O,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-5",children:[e.jsxs("div",{children:[e.jsx(D,{className:"text-slate-300 text-xs font-medium mb-1.5 block",children:"Search"}),e.jsxs("div",{className:"relative",children:[e.jsx(Qe,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400"}),e.jsx(ee,{placeholder:"Name, make, model, locationâ¦",value:s.search,onChange:n=>t({...s,search:n.target.value}),className:"pl-8 bg-slate-800 border-slate-600 text-white placeholder:text-slate-500 text-sm h-8 focus-visible:ring-blue-500"}),s.search&&e.jsx("button",{onClick:()=>t({...s,search:""}),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-white",children:e.jsx(O,{className:"w-3 h-3"})})]})]}),e.jsxs("div",{children:[e.jsxs("button",{className:"flex items-center justify-between w-full mb-2",onClick:()=>J(n=>!n),children:[e.jsx(D,{className:"text-slate-300 text-xs font-medium cursor-pointer",children:"Listing Type"}),U?e.jsx(re,{className:"w-3.5 h-3.5 text-slate-400"}):e.jsx(ie,{className:"w-3.5 h-3.5 text-slate-400"})]}),U&&e.jsx("div",{className:"space-y-1.5",children:ys.map(({key:n,label:q,color:F,icon:he})=>{const A=de[n];return e.jsxs("label",{className:"flex items-center justify-between cursor-pointer group",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(we,{checked:A.value,onCheckedChange:le=>A.set(!!le),className:"border-slate-500 data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600"}),e.jsx("span",{className:`${F} flex items-center gap-1`,children:he}),e.jsx("span",{className:"text-slate-300 text-xs group-hover:text-white transition-colors",children:q})]}),e.jsx("span",{className:"text-slate-500 text-[10px]",children:A.count})]},n)})})]}),l.length>0&&e.jsxs("div",{children:[e.jsxs("button",{className:"flex items-center justify-between w-full mb-2",onClick:()=>a(n=>!n),children:[e.jsx(D,{className:"text-slate-300 text-xs font-medium cursor-pointer",children:"Boat Category"}),v?e.jsx(re,{className:"w-3.5 h-3.5 text-slate-400"}):e.jsx(ie,{className:"w-3.5 h-3.5 text-slate-400"})]}),v&&e.jsx("div",{className:"space-y-1.5 max-h-40 overflow-y-auto pr-1",children:l.map(n=>e.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[e.jsx(we,{checked:s.boatCategories.includes(n),onCheckedChange:()=>{const q=s.boatCategories.includes(n)?s.boatCategories.filter(F=>F!==n):[...s.boatCategories,n];t({...s,boatCategories:q})},className:"border-slate-500 data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600"}),e.jsx("span",{className:"text-slate-300 text-xs group-hover:text-white transition-colors capitalize",children:n})]},n))})]}),e.jsxs("div",{children:[e.jsxs("button",{className:"flex items-center justify-between w-full mb-2",onClick:()=>L(n=>!n),children:[e.jsx(D,{className:"text-slate-300 text-xs font-medium cursor-pointer",children:"Price Range"}),p?e.jsx(re,{className:"w-3.5 h-3.5 text-slate-400"}):e.jsx(ie,{className:"w-3.5 h-3.5 text-slate-400"})]}),p&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{type:"number",placeholder:"Min $",value:s.minPrice,onChange:n=>t({...s,minPrice:n.target.value}),className:"bg-slate-800 border-slate-600 text-white placeholder:text-slate-500 text-sm h-8 focus-visible:ring-blue-500",min:0}),e.jsx("span",{className:"text-slate-500 text-xs flex-shrink-0",children:"â"}),e.jsx(ee,{type:"number",placeholder:"Max $",value:s.maxPrice,onChange:n=>t({...s,maxPrice:n.target.value}),className:"bg-slate-800 border-slate-600 text-white placeholder:text-slate-500 text-sm h-8 focus-visible:ring-blue-500",min:0})]})]}),i.length>0&&e.jsxs("div",{children:[e.jsxs("button",{className:"flex items-center justify-between w-full mb-2",onClick:()=>z(n=>!n),children:[e.jsx(D,{className:"text-slate-300 text-xs font-medium cursor-pointer",children:"Dealer Type"}),B?e.jsx(re,{className:"w-3.5 h-3.5 text-slate-400"}):e.jsx(ie,{className:"w-3.5 h-3.5 text-slate-400"})]}),B&&e.jsx("div",{className:"space-y-1.5 max-h-36 overflow-y-auto pr-1",children:i.map(n=>e.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[e.jsx(we,{checked:s.vendorProviderTypes.includes(n),onCheckedChange:()=>{const q=s.vendorProviderTypes.includes(n)?s.vendorProviderTypes.filter(F=>F!==n):[...s.vendorProviderTypes,n];t({...s,vendorProviderTypes:q})},className:"border-slate-500 data-[state=checked]:bg-emerald-600 data-[state=checked]:border-emerald-600"}),e.jsx("span",{className:"text-slate-300 text-xs group-hover:text-white transition-colors capitalize",children:n})]},n))})]}),M&&e.jsxs("div",{children:[e.jsxs("button",{className:"flex items-center justify-between w-full mb-2",onClick:()=>$(n=>!n),children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Ze,{className:"w-3.5 h-3.5 text-blue-400"}),e.jsx(D,{className:"text-slate-300 text-xs font-medium cursor-pointer",children:"Saved Presets"})]}),T?e.jsx(re,{className:"w-3.5 h-3.5 text-slate-400"}):e.jsx(ie,{className:"w-3.5 h-3.5 text-slate-400"})]}),T&&e.jsxs("div",{className:"space-y-2",children:[V?e.jsx(ks,{onSave:me,isSaving:xe.isPending,onCancel:()=>_(!1)}):e.jsxs("button",{onClick:()=>_(!0),className:"flex items-center gap-1.5 text-blue-400 hover:text-blue-300 text-xs transition-colors w-full",children:[e.jsx(Xe,{className:"w-3.5 h-3.5"}),"Save current filters as preset"]}),E&&e.jsxs("div",{className:"flex items-center gap-1.5 text-slate-500 text-xs",children:[e.jsx(se,{className:"w-3 h-3 animate-spin"}),"Loadingâ¦"]}),!E&&b.length===0&&!V&&e.jsx("p",{className:"text-slate-500 text-xs",children:"No saved presets yet."}),b.map(n=>e.jsxs("div",{className:"flex items-center justify-between gap-1 group bg-slate-800 rounded-lg px-2.5 py-1.5",children:[e.jsx("button",{onClick:()=>G(n),className:"flex-1 text-left text-slate-300 text-xs hover:text-white transition-colors truncate",children:n.name}),e.jsx("button",{onClick:()=>ae.mutate(n.id),disabled:ae.isPending,className:"text-slate-600 hover:text-red-400 transition-colors flex-shrink-0 opacity-0 group-hover:opacity-100",children:e.jsx(es,{className:"w-3.5 h-3.5"})})]},n.id))]})]})]}),e.jsx("div",{className:"px-4 py-3 border-t border-slate-700",children:ns(s)&&e.jsx("button",{onClick:()=>t(Ne),className:"w-full text-xs text-blue-400 hover:text-blue-300 transition-colors text-center py-1",children:"Clear all filters"})})]})}function $s(){const{data:s}=R({queryKey:["/api/public/site-settings"]}),{data:t}=R({queryKey:["/api/config/google-maps-key"]}),{toast:l}=pe(),i=r.useMemo(()=>cs(window.location.search),[]),[o,d]=r.useState(i.filters),[u,w]=r.useState(i.visibility.showBoats),[f,g]=r.useState(i.visibility.showVendors),[x,N]=r.useState(i.visibility.showMarinas),[y,k]=r.useState(i.visibility.showAnchorages),[h,C]=r.useState(i.visibility.showAccessories),j=xs(o.search,350),K=r.useMemo(()=>ds(j,o),[j,o]),G=r.useMemo(()=>ms(j,o),[j,o]);r.useEffect(()=>{const m=os(o,{showBoats:u,showVendors:f,showMarinas:x,showAnchorages:y,showAccessories:h}),I=m.toString()?`?${m.toString()}`:"",ue=`${window.location.pathname}${I}`;window.history.replaceState(null,"",ue)},[o,u,f,x,y,h]);const[M,P]=r.useState(!1);function U(){navigator.clipboard.writeText(window.location.href).then(()=>{P(!0),l({title:"Link copied!",description:"Share this link to let others see the same filters."}),setTimeout(()=>P(!1),2e3)}
1).catch(()=>{l({title:"Could not copy link",variant:"destructive"})})}function J(c){const m=c.filters;d({search:m.search||"",boatCategories:m.boatCategories||[],minPrice:m.minPrice||"",maxPrice:m.maxPrice||"",vendorProviderTypes:m.vendorProviderTypes||[]}),w(m.showBoats!==!1),g(m.showVendors!==!1),N(m.showMarinas!==!1),k(m.showAnchorages!==!1),C(m.showAccessories===!0),l({title:`Preset applied: ${c.name}`})}const{data:v=[],isLoading:a}=R({queryKey:[`/api/maps/boat-pins${K}`]}),{data:p=[],isLoading:L}=R({queryKey:[`/api/maps/vendor-pins${G}`]}),{data:B=[],isLoading:z}=R({queryKey:["/api/maps/marinas"]}),{data:T=[]}=R({queryKey:["/api/maps/accessory-pins"],enabled:h}),{data:$=[]}=R({queryKey:["/api/maps/boat-categories"]}),{data:V=[]}=R({queryKey:["/api/maps/vendor-pins"]}),_=r.useMemo(()=>{const c=new Set;return V.forEach(m=>{m.providerType&&c.add(m.providerType)}),Array.from(c).sort()},[V]),[b,E]=r.useState(null),[xe,ae]=r.useState(null),[de,me]=r.useState(!1),[n,q]=r.useState(null),[F,he]=r.useState(null),[A,le]=r.useState(null),[ke,ge]=r.useState(""),[Ce,Pe]=r.useState(!1),De=r.useCallback(c=>{le(c)},[]);function Oe(c){E(null),he(c),le(null),ge("")}function be(){he(null),le(null),ge("")}
1async function ze(){if(!(!F||!A)){Pe(!0);try{const c=await fetch(`/api/maps/marinas/${F.id}/pin-corrections`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({lat:A.lat,lng:A.lng,note:ke.trim()})});if(!c.ok){const m=await c.json().catch(()=>({}));throw new Error(m.message||"Submission failed")}l({title:"Pin fix submitted",description:"Thanks! Our team will review the suggested position."}),be()}catch(c){l({title:"Could not submit pin fix",description:c.message||"Please try again.",variant:"destructive"})}finally{Pe(!1)}}}const qe=r.useMemo(()=>{const c=new Map;return v.forEach(m=>{const I=`${m.lat.toFixed(4)},${m.lng.toFixed(4)}`,ue=c.get(I);ue?ue.boats.push(m):c.set(I,{lat:m.lat,lng:m.lng,boats:[m]})}),Array.from(c.values())},[v]),Ie=r.useMemo(()=>b?{lat:b.lat,lng:b.lng}:null,[b]),Ke=r.useCallback(c=>{ae(null),E(c)},[]),Ue=(s==null?void 0:s.maps3dEnabled)!=="false",Ve=(t==null?void 0:t.apiKey)||"",Se=B.filter(c=>c.type==="marina").length,Me=B.filter(c=>c.type==="anchorage").length,fe=[o.search.trim()!=="",o.boatCategories.length>0,o.minPrice!==""||o.maxPrice!=="",o.vendorProviderTypes.length>0].filter(Boolean).length,Q=[];if(o.search.trim()&&Q.push({label:`"${o.search.trim()}"`,onRemove:()=>d(c=>({...c,search:""}))}),o.boatCategories.forEach(c=>Q.push({label:c,onRemove:()=>d(m=>({...m,boatCategories:m.boatCategories.filter(I=>I!==c)}))})),o.minPrice||o.maxPrice){const c=[o.minPrice?`$${parseInt(o.minPrice).toLocaleString()}`:"Any",o.maxPrice?`$${parseInt(o.maxPrice).toLocaleString()}`:"Any"].join(" â ");Q.push({label:c,onRemove:()=>d(m=>({...m,minPrice:"",maxPrice:""}))})}return o.vendorProviderTypes.forEach(c=>Q.push({label:c,onRemove:()=>d(m=>({...m,vendorProviderTypes:m.vendorProviderTypes.filter(I=>I!==c)}))})),Ue?e.jsxs("div",{className:"flex flex-col h-screen bg-slate-900",children:[e.jsxs("div",{className:"bg-slate-900 border-b border-slate-700 px-4 py-2.5 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:e.jsx(Z,{className:"w-4 h-4 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-white font-bold text-sm leading-tight",children:"Marine Map"}),e.jsx("p",{className:"text-slate-400 text-xs",children:"3D Coastal Explorer"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(a||L||z)&&e.jsx(se,{className:"w-4 h-4 animate-spin text-slate-400"}),e.jsxs("button",{onClick:U,title:"Copy filter link",className:`flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 transition-colors text-xs ${M?"bg-green-700 text-white":"bg-slate-800 hover:bg-slate-700 text-slate-300"}`,children:[M?e.jsx(_e,{className:"w-3.5 h-3.5"}):e.jsx(He,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:M?"Copied!":"Copy link"})]}),e.jsxs("button",{onClick:()=>me(c=>!c),className:`flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 transition-colors text-xs ${de||fe>0?"bg-blue-600 text-white":"bg-slate-800 hover:bg-slate-700 text-slate-300"}`,children:[e.jsx(Fe,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Filters"}),fe>0&&e.jsx("span",{className:"bg-white/20 rounded-full w-4 h-4 text-[10px] flex items-center justify-center font-bold",children:fe})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-800 rounded-lg px-2.5 py-1.5",children:[e.jsx(We,{className:"w-3.5 h-3.5 text-slate-400"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Layers"})]}),e.jsx(ne,{icon:e.jsx(te,{className:"w-3 h-3"}),label:`Boats (${v.length})`,color:"blue",checked:u,onCheckedChange:w,isEmpty:v.length===0&&ve(o)}),e.jsx(ne,{icon:e.jsx(ye,{className:"w-3 h-3"}),label:`Dealers (${p.length})`,color:"emerald",checked:f,onCheckedChange:g}),e.jsx(ne,{icon:e.jsx(Z,{className:"w-3 h-3"}),label:`Marinas (${Se})`,color:"violet",checked:x,onCheckedChange:N}),e.jsx(ne,{icon:e.jsx(Y,{className:"w-3 h-3"}),label:`Anchorages (${Me})`,color:"purple",checked:y,onCheckedChange:k}),e.jsx(ne,{icon:e.jsx(Z,{className:"w-3 h-3"}),label:h?`Moorings & Trailers (${T.length})`:"Moorings & Trailers",color:"amber",checked:h,onCheckedChange:C})]})]}),Q.length>0&&e.jsxs("div",{className:"bg-slate-800 border-b border-slate-700 px-4 py-2 flex items-center gap-2 flex-wrap flex-shrink-0",children:[e.jsx("span",{className:"text-slate-400 text-xs",children:"Active filters:"}),Q.map((c,m)=>e.jsxs(X,{variant:"secondary",className:"bg-blue-900/60 text-blue-200 border border-blue-700/50 text-xs gap-1 pr-1 pl-2",children:[c.label,e.jsx("button",{onClick:c.onRemove,className:"ml-0.5 text-blue-300 hover:text-white transition-colors",children:e.jsx(O,{className:"w-3 h-3"})})]},m)),e.jsx("button",{onClick:()=>d(Ne),className:"text-xs text-slate-400 hover:text-white transition-colors ml-1",children:"Clear all"}),!a&&u&&ve(o)&&e.jsx("span",{className:`ml-auto text-xs font-medium ${v.length===0?"text-amber-400":"text-slate-300"}`,children:v.length===0?"0 boats match":`${v.length} boat${v.length===1?"":"s"} found`})]}),e.jsxs("div",{className:"flex-1 relative overflow-hidden",children:[de&&e.jsx(Cs,{filters:o,onChange:d,boatCategories:$,vendorProviderTypes:_,boatCount:v.length,vendorCount:p.length,marinaCount:Se,anchorageCount:Me,showBoats:u,setShowBoats:w,showVendors:f,setShowVendors:g,showMarinas:x,setShowMarinas:N,showAnchorages:y,setShowAnchorages:k,showAccessories:h,onClose:()=>me(!1),onApplyPreset:J}),e.jsx(Ns,{apiKey:Ve,boatGroups:qe,vendorPins:p,marinaPins:B,accessoryPins:T,showBoats:u,showVendors:f,showMarinas:x,showAnchorages:y,showAccessories:h,onPinCl
1ick:Ke,selectedAnchor:Ie,onAnchorScreenPos:ae,pinFixTarget:F,onPinFixMove:De}),v.length===0&&u&&ve(o)&&!a&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:e.jsxs("div",{className:"bg-slate-900/90 backdrop-blur-sm border border-amber-500/40 rounded-2xl px-8 py-6 flex flex-col items-center gap-3 shadow-2xl pointer-events-auto max-w-xs text-center",children:[e.jsx("div",{className:"w-12 h-12 bg-amber-500/10 rounded-full flex items-center justify-center",children:e.jsx(te,{className:"w-6 h-6 text-amber-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold text-sm",children:"No boats found"}),e.jsx("p",{className:"text-slate-400 text-xs mt-1",children:"Your current filters didn't match any boat listings in this area."})]}),e.jsxs("button",{onClick:()=>d(Ne),className:"flex items-center gap-1.5 bg-blue-600 hover:bg-blue-500 text-white text-xs font-medium rounded-lg px-4 py-2 transition-colors",children:[e.jsx(O,{className:"w-3 h-3"}),"Clear filters"]})]})}),b&&e.jsxs(us,{pos:xe,children:[b.type==="boats"&&b.data.boats.length===1&&e.jsx(ps,{boat:b.data.boats[0],onClose:()=>E(null)}),b.type==="boats"&&b.data.boats.length>1&&e.jsx(gs,{boats:b.data.boats,onClose:()=>E(null)}),b.type==="vendor"&&e.jsx(js,{vendor:b.data,onClose:()=>E(null)}),b.type==="accessory"&&e.jsx(fs,{pin:b.data,onClose:()=>E(null)}),b.type==="marina"&&e.jsx(ws,{marina:b.data,onClose:()=>E(null),onContribute:c=>{E(null),q(c)},onSuggestPinFix:Oe})]}),n&&e.jsx(vs,{marina:n,onClose:()=>q(null)}),F&&e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-40 w-[min(92vw,28rem)]",children:e.jsxs("div",{className:"bg-slate-900/95 backdrop-blur-sm border border-amber-500/50 rounded-2xl p-4 shadow-2xl space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm font-semibold flex items-center gap-1.5",children:[e.jsx(Ae,{className:"w-4 h-4 text-amber-400"}),"Fix pin: ",F.name]}),e.jsx("p",{className:"text-slate-400 text-xs mt-0.5",children:A?`New spot: ${A.lat.toFixed(5)}, ${A.lng.toFixed(5)}`:"Drag the amber marker to the correct spot."})]}),e.jsx("button",{onClick:be,className:"text-slate-400 hover:text-white",children:e.jsx(O,{className:"w-4 h-4"})})]}),e.jsx(ee,{value:ke,onChange:c=>ge(c.target.value),maxLength:500,placeholder:"Optional note (e.g. 'entrance is on the east side')",className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500 text-xs h-8"}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(S,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:be,children:"Cancel"}),e.jsxs(S,{size:"sm",className:"h-8 text-xs gap-1.5 bg-amber-500 hover:bg-amber-600 text-slate-900",disabled:!A||Ce,onClick:ze,children:[Ce&&e.jsx(se,{className:"w-3.5 h-3.5 animate-spin"}),"Submit for Review"]})]})]})}),e.jsxs("div",{className:"absolute bottom-4 left-4 z-30 flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-900/80 backdrop-blur-sm rounded-lg px-2.5 py-1.5",children:[e.jsx(Y,{className:"w-3 h-3 text-blue-500 fill-blue-500"}),e.jsx("span",{className:"text-white text-[10px]",children:"Boat Listings"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-900/80 backdrop-blur-sm rounded-lg px-2.5 py-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500"}),e.jsx("span",{className:"text-white text-[10px]",children:"Vendor Stores"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-900/80 backdrop-blur-sm rounded-lg px-2.5 py-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-violet-500"}),e.jsx("span",{className:"text-white text-[10px]",children:"Marinas"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-900/80 backdrop-blur-sm rounded-lg px-2.5 py-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-purple-500"}),e.jsx("span",{className:"text-white text-[10px]",children:"Anchorages"})]})]})]})]}):e.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col items-center justify-center gap-4 p-6",children:[e.jsx("div",{className:"w-16 h-16 bg-blue-100 rounded-2xl flex items-center justify-center",children:e.jsx(Ee,{className:"w-8 h-8 text-blue-400"})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-800",children:"Marine Map Unavailable"}),e.jsx("p",{className:"text-slate-500 text-center max-w-md",children:"The 3D Marine Map feature is currently disabled. Please check back later or contact support."}),e.jsx(H,{href:"/",children:e.jsx(S,{variant:"outline",children:"Back to Home"})})]})}function ne({icon:s,label:t,color:l,checked:i,onCheckedChange:o,isEmpty:d}){const u={blue:"text-blue-400",emerald:"text-emerald-400",violet:"text-violet-400",purple:"text-purple-400",amber:"text-amber-400"};return e.jsxs("button",{onClick:()=>o(!i),className:`flex items-center gap-1.5 bg-slate-800 hover:bg-slate-700 rounded-lg px-2.5 py-1.5 transition-colors ${i?"ring-1 ring-slate-600":"opacity-60"} ${d&&i?"ring-1 ring-amber-500/60":""}`,children:[e.jsx("span",{className:d&&i?"text-amber-400":u[l]||"text-slate-400",children:s}),e.jsx("span",{className:`text-xs ${d&&i?"text-amber-300":"text-slate-300"}`,children:t})]})}
1export{$s as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.