1import{h as e,f as t,j as i}from"./react-vendor-DhhIj8It.js";import{M as r,T as o,Z as n,a as l,u as s,L as a}from"./maps-vendor-B8e6ulyx.js";import{W as d,Q as p,V as c,r as g,H as x,a as h,o as u}from"./index-M0heAm9j.js";import{F as b}from"./FloatingPanNav-DTJ5Uw3u.js";import"./vendor-B4feaYW4.js";import"./firebase-vendor-COzRcCni.js";function f({center:e,zoom:i}){const r=s();return t.useEffect(()=>{e&&r.setView(e,i||r.getZoom(),{animate:!0})},[e&&e[0],e&&e[1]]),null}function m(e){if(!e)return"";const t=Math.max(0,Math.round((Date.now()-e)/6e4));return t<1?"just now":t<60?`${t} min ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function v({items:e,curIdx:t,setIdx:s,current:d,isDark:p,height:c,full:g,onToggleFull:u,onOrder:b}){return i.jsxs("div",{className:p?"fs-map-dark":void 0,style:{position:g?"fixed":"relative",inset:g?0:void 0,zIndex:0,borderRadius:g?0:18,overflow:"hidden",border:g?"none":"1px solid rgba(255,255,255,0.12)",boxShadow:g?"none":"0 8px 30px rgba(0,0,0,0.28)",height:c},children:[i.jsxs(r,{center:d?[d.lat,d.lng]:[x,h],zoom:d?13:11,scrollWheelZoom:g,zoomControl:!1,style:{height:"100%",width:"100%",background:p?"#12100e":"#dfe3e6"},children:[i.jsx(o,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",subdomains:"abc"}),i.jsx(n,{position:"topright"}),d&&i.jsx(f,{center:[d.lat,d.lng],zoom:13}),e.map((e,r)=>{return i.jsx(l,{position:[e.lat,e.lng],zIndexOffset:r===t?1e3:0,icon:e._live?a.divIcon({className:"",html:'<div class="fs-pin-active" style="--c:#22c55e"><span class="fs-pin-ring"></span><span class="fs-pin-core" style="display:flex;align-items:center;justify-content:center;font-size:14px">ð</span></div>',iconSize:[34,34],iconAnchor:[17,17]}):(o=r===t,a.divIcon({className:"",html:`<div style="width:28px;height:28px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:${o?"#94a3b8":"#64748b"};border:2px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;opacity:${o?1:.82}"><span style="transform:rotate(45deg);font-size:13px">ð</span></div>`,iconSize:[28,28],iconAnchor:[14,28]})),eventHandlers:{click:()=>s(r)}},e.vendor_id||r);var o})]}),i.jsxs("div",{style:{position:"absolute",top:10,left:"50%",transform:"translateX(-50%)",zIndex:1e3,background:"rgba(20,17,15,0.72)",color:"#F7F2EA",fontSize:11.5,fontWeight:800,borderRadius:999,padding:"4px 12px",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",whiteSpace:"nowrap"},children:["ð ",e.length?e.length>1?`Trucks · ${t+1}/${e.length}`:"1 truck":"No trucks"]}),i.jsx("button",{onClick:u,"aria-label":g?"Exit full screen":"Full page view",style:{position:"absolute",top:8,left:8,zIndex:1e3,height:38,padding:"0 12px",borderRadius:11,border:"1px solid rgba(255,255,255,0.25)",cursor:"pointer",color:"#F7F2EA",fontSize:13,fontWeight:800,display:"flex",alignItems:"center",gap:6,background:"rgba(20,17,15,0.72)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 12px rgba(0,0,0,0.45)"},children:g?"â Close":"â¶ Full view"}),e.length>1&&[["left","â¹",-1],["right","âº",1]].map(([t,r,o])=>i.jsx("button",{"aria-label":o<0?"Previous truck":"Next truck",onClick:()=>s(t=>((e.length?Math.min(t,e.length-1):0)+o+e.length)%e.length),style:{position:"absolute",[t]:8,top:"44%",transform:"translateY(-50%)",zIndex:1e3,width:42,he
1ight:42,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.25)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:25,fontWeight:800,color:"#F7F2EA",paddingBottom:3,background:"rgba(20,17,15,0.72)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 12px rgba(0,0,0,0.45)"},children:r},t)),d&&i.jsxs("a",{href:d._href,onClick:e=>{e.preventDefault(),b(d)},style:{position:"absolute",left:10,right:10,bottom:10,zIndex:1e3,maxWidth:g?560:void 0,marginInline:g?"auto":void 0,textDecoration:"none",display:"flex",gap:10,alignItems:"center",padding:10,borderRadius:14,background:"rgba(20,17,15,0.9)",border:"1px solid "+(d._live?"#22c55e":"rgba(255,255,255,0.3)"),boxShadow:"0 8px 26px rgba(0,0,0,0.45)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[i.jsx("div",{style:{width:52,height:52,borderRadius:12,flexShrink:0,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.08)",fontSize:24},children:d.logo_url?i.jsx("img",{src:d.logo_url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):"ð"}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{margin:0,fontSize:10,fontWeight:900,color:d._live?"#4ade80":"#cbd5e1",letterSpacing:.4,textTransform:"uppercase"},children:d._live?"ð¢ Live now"+(d.updated_ms?" · "+m(d.updated_ms):""):"⪠Not serving now"}),i.jsx("p",{style:{margin:"1px 0 0",fontSize:15,fontWeight:800,color:"#F7F2EA",lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.name}),i.jsxs("p",{style:{margin:"2px 0 0",fontSize:11.5,color:"rgba(255,255,255,0.7)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[d.note||d.cuisine_type||"Food truck",d._dist<900?` · ${d._dist<10?d._dist.toFixed(1):Math.round(d._dist)} mi`:""]})]}),!d._placeholder&&i.jsx("span",{style:{flexShrink:0,fontSize:12,fontWeight:800,color:d._live?"#4ade80":"#cbd5e1",paddingRight:4},children:d._live?"Order â":"View â"})]})]})}function y(){const r=e(),{isDark:o}=d(),{userLocation:n}=p(),{tier:l}=c(),s="desktop"===l,[a,f]=t.useState(null),[m,y]=t.useState(0),[k,w]=t.useState(!1),[j,F]=t.useState(!1),S=t.useCallback(async()=>{F(!0);try{const e=await g.get("/api/food-trucks");f(Array.isArray(e)?e:[])}catch{f([])}finally{F(!1)}},[]);t.useEffect(()=>{S();const e=setInterval(S,6e4);return()=>clearInterval(e)},[S]),t.useEffect(()=>{if(!k)return;const e=document.body.style.overflow;document.body.style.overflow="hidden";const t=e=>{"Escape"===e.key&&w(!1)};return window.addEventListener("keydown",t),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t)}},[k]);const _=(null==n?void 0:n.lat)??x,z=(null==n?void 0:n.lng)??h,W=t.useMemo(()=>{const e=(a||[]).filter(e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng)).map(e=>({...e,_live:!!e.is_live,_href:"/menu/"+e.vendor_id,_dist:u(_,z,e.lat,e.lng)})).sort((e,t)=>t._live-e._live||e._dist-t._dist);return e.length?e:[{vendor_id:"none",name:"Food trucks",cuisine_type:"None live right now",lat:_,lng:z,_live:!1,_placeholder:!0,_href:"/trucks",_dist:0}]},[a,_,z]),I=t.useMemo(()=>(a||[]).filter(e=>!e.is_live).map(e=>({...e,_dist:Number.isFinite(e.lat)&&Number.isFinite(e.lng)?u(_,z,e.lat,e.lng):999})).sort((e,t)=>e._dist-t._dist),[a,_,z]),A=t.useMemo(()=>(a||[]).filter(e=>e.is_live).length,[a]);t.useEffect(()=>{y(0)},[a&&a.length]);const C=W.length?Math.min(m,W.length-1):0,E=W[C]||null,N=s?"clamp(440px, 62vh, 660px)":"tablet"===l?"clamp(400px, 58vh, 560px)":"clamp(340px, 52vh, 460px)",R={background:"rgba(30,27,25,0.55)",backdropFilter:"blur(18px)",WebkitBackdropFilter:"blur(18px)",border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 8px 28px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.09)",borderRadius:16},B={color:"#F7F2EA",textShadow:"0 1px 3px rgba(0,0,0,0.6)"},M=i.jsx(v,{items:W,curIdx:C,setIdx:y,current:E?{...E,_dist:E._dist}:null,isDark:o,height:k?"100vh":N,full:k,onToggleFull:()=>w(e=>!e),onOrder:e=>{e._placeholder||(w(!1),r("/menu/"+e.vendor_id))}});return k?i.jsx("div",{style:{position:"fixed",inset:0,zIndex:3e3,background:"#000"},children:M}):i.jsxs("div",{className:"page-enter",style:{maxWidth:s?"min(96vw, 980px)":"tablet"===l?"min(96vw, 720px)":560,margin:"0 auto",padding:"16px 14px 32px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10,marginBottom:14},children:[i.jsxs("div",{children:[i.jsx("h1",{style:{...B,fontSize:"clamp(22px,6vw,32px)",fontWeight:900,margin:0,lineHeight:1.1},children:"ð Food Truck Finder"}),i.jsx("p",{style:{color:"rgba(255,255,255,0.78)",fontSize:13.5,margin:"6px 0 0",lineHeight:1.5},children:null===a?"Finding trucks near youâ¦":A?i.jsxs(i.Fragment,{children:[i.jsxs("b",{style:{color:"#4ade80"},children:[A," truck",A>1?"s":""," live now"]})," â tap a pin to see the menu and order ahead."]}):"No trucks are serving right now. Check back around lunch or dinner!"})]}),i.jsxs("div",{style:{display:"flex",gap:8,flexShrink:0},children:[i.jsx("button",{onClick:()=>w(!0),"aria-label":"Full page view",style:{...R,height:40,padding:"0 12px",borderRadius:12,cursor:"pointer",color:"#F7F2EA",fontSize:13,fontWeight:800,display:"flex",alignItems:"center",gap:6},children:"â¶ Full view"}),i.jsx("button",{onClick:S,disabled:j,"aria-label":"Refresh",style:{...R,width:40,height:40,borderRadius:12,cursor:"pointer",color:"#F7F2EA",fontSize:17,display:"flex",alignItems:"center",justifyContent:"center",opacity:j?.5:1},children:"â»"})]})]}),i.jsx("div",{style:{marginBottom:18},children:M}),I.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,margin:"4px 2px 12px"},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#94a3b8",flexShrink:0}}),i.jsx("h2",{style:{...B,fontSize:16,fontWeight:900,margin:0},children:"Not serving right now"}),i.jsx("span",{style:{fontSize:12,color:"rgba(255,255,255,0.7)",fontWeight:700},children:I.length})]}),i.jsx("div",{style:{display:"grid",gap:12,gridTemplateColumns:s?"repeat(auto-fill, minmax(300px, 1fr))":"1fr"}
1,children:I.map((e,t)=>{const o=function(e){return(Array.isArray(null==e?void 0:e.brand_colors)?e.brand_colors.filter(Boolean):[])[0]||"#22c55e"}(e);return i.jsxs("button",{onClick:()=>r("/menu/"+e.vendor_id),style:{position:"relative",height:128,borderRadius:16,overflow:"hidden",cursor:"pointer",border:"1px solid rgba(255,255,255,0.12)",textAlign:"left",padding:0,boxShadow:"0 8px 26px rgba(0,0,0,0.3)"},children:[e.logo_url?i.jsx("img",{src:e.logo_url,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",filter:"saturate(0.85)"}}):i.jsx("div",{style:{position:"absolute",inset:0,background:`linear-gradient(135deg, ${o}, rgba(20,17,15,0.9))`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:44},children:"ð"}),i.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.85) 100%)"}}),i.jsx("span",{style:{position:"absolute",top:10,right:10,background:"rgba(0,0,0,0.55)",border:"1px solid rgba(255,255,255,0.28)",borderRadius:99,padding:"3px 9px",fontSize:10,fontWeight:800,color:"#e5e7eb",backdropFilter:"blur(6px)"},children:"⪠Not live"}),i.jsxs("div",{style:{position:"absolute",left:0,right:0,bottom:0,padding:"0 12px 12px"},children:[i.jsx("p",{style:{margin:0,fontSize:16,fontWeight:900,color:"#F7F2EA",textShadow:"0 1px 3px rgba(0,0,0,0.9)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),i.jsxs("p",{style:{margin:"2px 0 0",fontSize:11.5,color:"rgba(255,255,255,0.82)",textShadow:"0 1px 4px rgba(0,0,0,0.85)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.cuisine_type||"Food truck",e.address?` · ${String(e.address).split(",")[0]}`:""]})]})]},e.vendor_id||t)})})]}),null!==a&&0===(a||[]).length&&i.jsxs("div",{style:{...R,padding:"26px 20px",textAlign:"center",maxWidth:460,margin:"4px auto 0"},children:[i.jsx("div",{style:{fontSize:44,marginBottom:8},children:"ðð¤"}),i.jsx("p",{style:{...B,fontSize:16,fontWeight:800,margin:"0 0 6px"},children:"No trucks yet"}),i.jsx("p",{style:{color:"rgba(255,255,255,0.72)",fontSize:13,margin:"0 0 16px",lineHeight:1.55},children:"Food trucks appear here the moment they park and go live â usually around lunch and dinner. The map is centered on your area until then."}),i.jsx("button",{onClick:()=>r("/fleet?section=foodtrucks"),style:{background:"rgba(232,34,10,0.3)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",border:"1px solid rgba(255,120,90,0.5)",borderRadius:12,color:"#F7F2EA",fontWeight:800,fontSize:13.5,padding:"11px 20px",cursor:"pointer"},children:"Run a food truck? List yours â"})]}),i.jsx("p",{style:{textAlign:"center",color:"rgba(255,255,255,0.5)",fontSize:11,marginTop:20},children:"Locations update live while a truck is serving. Powered by Fusion Serve."}),i.jsx(b,{})]})}export{y 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.