1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mapbox-gl-y3Ehrck1.js","assets/react-vendor-DG9jHnNQ.js","assets/maps-vyfcPMHi.js","assets/radix-B0zOOFBK.js","assets/tanstack-raftEBQU.js"])))=>i.map(i=>d[i]); 2import{j as e}from"./tanstack-raftEBQU.js";import{r}from"./react-vendor-DG9jHnNQ.js";import{b4 as ke,a$ as Ve,bm as Ze,ah as ge,p as w,q as I,b6 as Oe,bd as qe,aZ as ze,ag as S,af as B,w as He,i as L,aF as We,ak as Xe,aS as Ge,al as ve,a_ as Ye,F as Je,ai as Ke,d as Qe,bg as be}from"./index-CwEfLZlp.js";import{T as et}from"./textarea-u-nF7bwL.js";import{E as tt}from"./event-card-BKIgz8GE.js";import{T as st}from"./turnstile-widget-CFaUcQoA.js";import{g as at}from"./brand-y5J5nNhe.js";import{u as nt}from"./embed-C5tNPz78.js";import{r as rt,C as je,w as ye,O as A}from"./event-brand-CwzIYlKF.js";import{C as z}from"./circle-check-BHqhkodH.js";import{L as we}from"./link-2-CYZaaWG9.js";import{F as it}from"./facebook-wScnw2LL.js";import{C as Ne}from"./calendar-B8tRS6Pn.js";import{C as ot}from"./clock-BBumLuNC.js";import{V as lt}from"./video-DUEppNB8.js";import{T as ct}from"./trending-up-DqEPg851.js";import"./radix-B0zOOFBK.js";import"./charts-ycOWY838.js";import"./dnd-IADusAtS.js";import"./event-time-eRCId-qs.js";import"./pencil-BQDSAmsb.js";const dt=ke("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);const mt=ke("SquareParking",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 17V7h4a3 3 0 0 1 0 6H9",key:"1dfk2c"}]]),Ce="pk.eyJ1Ijoia251bWVyaWNrIiwiYSI6ImNtbzFzN2wyOTBiOG4yb3BzZHhtbTVtd3UifQ.TzkYKUto1Pj5_lhC_hoC9Q",ut="mapbox://styles/mapbox/streets-v12",ht=15,pt=12.5,Ie="br_event_geocode:";function xt(n){return{lat:Math.round(n.lat*100)/100,lng:Math.round(n.lng*100)/100}}function ft(n){try{const o=window.sessionStorage.getItem(Ie+n);if(!o)return null;const d=JSON.parse(o);if(typeof d?.lat=="number"&&typeof d?.lng=="number")return{lat:d.lat,lng:d.lng}}catch{}return null}function gt(n,o){try{window.sessionStorage.setItem(Ie+n,JSON.stringify(o))}catch{}}async function vt(n,o){const d=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(n)}.json?limit=1&country=US&access_token=${Ce}`,l=await fetch(d,{signal:o});if(!l.ok)return null;const a=(await l.json())?.features?.[0]?.center;if(!Array.isArray(a)||a.length<2)return null;const[x,f]=a;return typeof f!="number"||typeof x!="number"?null:{lat:f,lng:x}}function bt({lat:n,lng:o,address:d,approximate:l=!1,className:v}){const a=r.useRef(null),x=r.useRef(null),[f,T]=r.useState(null),[U,$]=r.useState(!1),g=(d??"").trim(),_=r.useMemo(()=>typeof n=="number"&&typeof o=="number"?{lat:n,lng:o}:f,[n,o,f]);r.useEffect(()=>{if(typeof n=="number"&&typeof o=="number"||!g)return;const b=ft(g);if(b){T(b);return}const m=new AbortController;let j=!1;return(async()=>{try{const p=await vt(g,m.signal);if(j)return;p?(gt(g,p),T(p)):$(!0)}catch(p){p?.name!=="AbortError"&&!j&&$(!0)}})(),()=>{j=!0,m.abort()}},[n,o,g]);const h=r.useMemo(()=>_?l?xt(_):_:null,[_,l]);return r.useEffect(()=>{if(!h||!a.current)return;let b=!1;if(!document.getElementById("mapbox-gl-css")){const m=document.createElement("link");m.id="mapbox-gl-css",m.rel="stylesheet",m.href="https://api.mapbox.com/mapbox-gl-js/v3.21.0/mapbox-gl.css",document.head.appendChild(m)}return Ve(()=>import("./mapbox-gl-y3Ehrck1.js").then(m=>m.m),__vite__mapDeps([0,1,2,3,4])).then(m=>{if(b||!a.current)return;const j=m.default??m;j.accessToken=Ce;const p=new j.Map({container:a.current,style:ut,center:[h.lng,h.lat],zoom:l?pt:ht,attributionControl:!0});p.addControl(new j.NavigationControl({showCompass:!1}),"top-right"),x.current=p,p.on("load",()=>{b||(l?(p.addSource("event-approx-area",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[h.lng,h.lat]}}}
2),p.addLayer({id:"event-approx-area-fill",type:"circle",source:"event-approx-area",paint:{"circle-color":"#0d9488","circle-opacity":.18,"circle-stroke-color":"#0d9488","circle-stroke-width":2,"circle-stroke-opacity":.55,"circle-radius":{stops:[[10,12],[12.5,48],[15,180]]}}})):new j.Marker({color:"#0d9488"}).setLngLat([h.lng,h.lat]).addTo(p))})}).catch(m=>{console.error("[event-map] Mapbox GL failed to load",m?.message??m),b||$(!0)}),()=>{b=!0;try{x.current?.remove()}catch{}x.current=null}},[h?.lat,h?.lng,l]),!g&&typeof n!="number"||U&&!h?null:e.jsx("div",{ref:a,className:v??"w-full h-64",role:"img","aria-label":l?"Approximate event area. The exact address is shared after you sign up.":`Map of the event location${g?`: ${g}`:""}`,"data-testid":"event-mapbox-map","data-approximate":l?"true":"false"})}const jt=["native_share","copy_link","email_share","facebook","twitter","admin_email"];function yt(n,o,d){try{const l=new Intl.DateTimeFormat("en-US",{timeZone:d,weekday:"long",month:"long",day:"numeric",year:"numeric"}),v=new Intl.DateTimeFormat("en-US",{timeZone:d,hour:"numeric",minute:"2-digit"}),a=new Intl.DateTimeFormat("en-US",{timeZone:d,hour:"numeric",minute:"2-digit",timeZoneName:"short"}),x=new Date(n),f=new Date(o);return l.format(x)===l.format(f)?`${l.format(x)} · ${v.format(x)} â ${a.format(f)}`:`${l.format(x)}, ${a.format(x)} â ${l.format(f)}, ${a.format(f)}`}catch{return""}}function wt(n,o){try{return new Intl.DateTimeFormat("en-US",{timeZone:o,weekday:"long",month:"long",day:"numeric"}).format(new Date(n))}catch{return""}}function Nt(n,o,d){try{const l=new Intl.DateTimeFormat("en-US",{timeZone:d,hour:"numeric",minute:"2-digit"}),v=new Intl.DateTimeFormat("en-US",{timeZone:d,hour:"numeric",minute:"2-digit",timeZoneName:"short"});return`${l.format(new Date(n))} â ${v.format(new Date(o))}`}catch{return""}}function kt(n,o,d){try{const l=new Intl.DateTimeFormat("en-US",{timeZone:d,hour:"numeric",minute:"2-digit"});return`${l.format(new Date(n))} â ${l.format(new Date(o))}`}catch{return""}}function Ct({className:n}){return e.jsx("svg",{className:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M18.9 2H22l-6.8 7.8L23 22h-6.6l-5.2-6.8L5.3 22H2.2l7.3-8.3L1.5 2h6.7l4.8 6.4L18.9 2Zm-1.1 18h1.8L7.3 3.9H5.4L17.8 20Z"})})}function Wt({campaignSlug:n,eventSlug:o}){const{toast:d}=Ze(),[l,v]=r.useState("loading"),[a,x]=r.useState(null),[f,T]=r.useState(""),[U,$]=r.useState(""),[g,_]=r.useState(""),[h,b]=r.useState(""),[m,j]=r.useState(""),[p,Se]=r.useState(!1),[F,D]=r.useState(""),[Te,H]=r.useState(!1),[W,X]=r.useState(null),[G,$e]=r.useState(""),[Y,J]=r.useState(!1),[N,_e]=r.useState(null),[Ee,K]=r.useState(!1),[M,Le]=r.useState(null),y=r.useMemo(()=>{try{const t=new URLSearchParams(window.location.search),c=t.get("share_medium");return{medium:c&&jt.includes(c)?c:null,context:t.get("share_context"),forceBanner:t.get("force_banner")==="true",inviteToken:/^[A-Za-z0-9_-]{8,32}$/.test(t.get("r")||"")?t.get("r"):null}}catch{return{medium:null,context:null,forceBanner:!1,inviteToken:null}}},[]);r.useEffect(()=>{if(!y.inviteToken)return;let t=!1;return(async()=>{try{const c=await fetch(`/api/public/campaigns/${encodeURIComponent(n)}/events/${encodeURIComponent(o)}/invite/${encodeURIComponent(y.inviteToken)}`);if(!c.ok||t)return;const u=await c.json();if(t)return;u.firstName&&T(C=>C||u.firstName),u.lastName&&$(C=>C||u.lastName),u.phone&&b(C=>C||u.phone),u.shiftId&&X(C=>C||u.shiftId)}catch{}})(),()=>{t=!0}},[n,o,y.inviteToken]),r.useEffect(()=>{let t=!1;return(async()=>{try{const c=await fetch(`/api/public/campaigns/${encodeURIComponent(n)}/events/${encodeURIComponent(o)}`);if(t)return;if(c.status===404){v("notfound");return}if(!c.ok){v("error");return}const u=await c.json();if(t)return;x(u),v("ready")}catch{t||v("error")}})(),()=>{t=!0}},[n,o]);const V=`br_event_share_banner_dismissed:${o}`;r.useEffect(()=>{try{window.sessionStorage.getItem(V)==="1"&&K(!0)}catch{}},[V]);const Ue=()=>{K(!0);try{window.sessionStorage.setItem(V,"1")}catch{}},i=r.useMemo(()=>rt(a?.campaign),[a?.campaign]),Me=nt(),s=a?.event,Q=a?.shifts??[],ee=a?.hosts??[],Z=a?.relatedEvents??[],P=!!s?.isFull,te="",se=a?.campaign?.rsvpCaptchaEnabled===!0&&te.length>0,ae=se&&!Te,ne=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(g.trim().toLowerCase()),re=h.replace(/\D/g,""),ie=re.length===0||re.length===10,oe=/^\d{5}$/.test(m.trim()),le=!Y&&f.trim().length>0&&U.trim().length>0&&ne&&ie&&oe&&(!ae||F.length>0),Pe=async()=>
2{if(!(!le||!s)){J(!0);try{const t=await fetch(`/api/public/campaigns/${encodeURIComponent(n)}/events/${encodeURIComponent(o)}/rsvp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({firstName:f.trim(),lastName:U.trim(),email:g.trim().toLowerCase(),phone:h.trim()||null,shiftId:W||null,notes:G.trim()||null,referredVia:y.medium??(y.inviteToken?"sms":null),inviteToken:y.inviteToken,wantsSms:p,captchaToken:F||null})});if(t.status===429){d({title:"Too many requests",description:"Please wait a moment and try again.",variant:"destructive"});return}if(t.status===404){v("notfound");return}const c=await t.json().catch(()=>({}));if(!t.ok){(c?.error==="captcha_required"||c?.error==="captcha_failed")&&D(""),d({title:"Could not RSVP",description:c?.message||"Please check your details and try again.",variant:"destructive"});return}if(_e(c?.status==="waitlist"?"waitlist":"confirmed"),s.addressVisibility==="after_rsvp"&&c?.rsvpId&&c?.detailsToken)try{const u=await fetch(`/api/public/rsvps/${encodeURIComponent(c.rsvpId)}/private-details?token=${encodeURIComponent(c.detailsToken)}`);u.ok&&Le(await u.json())}catch{}}catch{d({title:"Network error",description:"Please try again.",variant:"destructive"})}finally{J(!1)}}};if(l==="loading")return e.jsxs("div",{className:"min-h-screen bg-muted/40 flex items-center justify-center",role:"status","aria-live":"polite",children:[e.jsx(ge,{className:"h-8 w-8 animate-spin text-sky-600"}),e.jsx("span",{className:"sr-only",children:"Loading eventâ¦"})]});if(l==="notfound")return e.jsx("div",{className:"min-h-screen bg-muted/40 flex items-center justify-center p-4",children:e.jsx(w,{className:"max-w-sm w-full",children:e.jsxs(I,{className:"p-8 text-center",children:[e.jsx(je,{className:"h-10 w-10 mx-auto text-muted-foreground/40 mb-3"}),e.jsx("h1",{className:"text-lg font-bold mb-1",children:"Event not found"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This event isnât available. It may have ended, been unpublished, or the link may be incorrect."})]})})});if(l==="error"||!s||!a)return e.jsx("div",{className:"min-h-screen bg-muted/40 flex items-center justify-center p-4",children:e.jsx(w,{className:"max-w-sm w-full",children:e.jsxs(I,{className:"p-8 text-center",children:[e.jsx(je,{className:"h-10 w-10 mx-auto text-muted-foreground/40 mb-3"}),e.jsx("h1",{className:"text-lg font-bold mb-1",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"We couldnât load this event. Please try again shortly."})]})})});const k=s.addressVisibility==="after_rsvp"&&!M,R=M?.locationAddress??s.locationAddress,ce=M?.locationLat??s.locationLat,Be=M?.locationLng??s.locationLng,E=[s.locationName,R].filter(Boolean).join(", "),de=!k&&E?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(E)}`:null,me=!s.isVirtual&&(ce!=null||!!E),O=M?.parkingInstructions??null,ue=s.eventType?Oe(s.eventType):null,De=s.locationName||(k?"Location shared after sign-up":R?.split(` 3`)[0])||"Location to be announced",he=k&&s.locationName?"Exact address shared after you sign up":null,Re=!s.isVirtual&&(!!E||k)||!!O||!!s.hasParkingInstructions||P,pe=qe(`/e/${a.campaign.slug}/${s.slug}`),q=t=>`${pe}?share_medium=${t}`,Ae=!Ee&&!!y.medium&&(!!y.context||y.forceBanner),xe=async()=>{try{await navigator.clipboard.writeText(q("copy_link")),d({title:"Link copied"})}catch{d({title:"Could not copy the link",variant:"destructive"})}},fe=a.contactEmail?`mailto:${a.contactEmail}?subject=${encodeURIComponent(`Question about "${s.title}"`)}&body=${encodeURIComponent(`Hello ${a.campaign.name}, 4 5I have a question about: 6 7${s.title} 8${pe} 9 10`)}`:null,Fe=e.jsx(w,{className:"shadow-lg border-0","data-testid":"card-rsvp-form",children:e.jsxs(I,{className:"p-5 space-y-4",children:[e.jsx("h2",{className:"text-sm font-bold uppercase tracking-[0.14em]",children:"Sign up now"}),Q.length>0&&e.jsxs("fieldset",{className:"space-y-2",children:[e.jsxs("legend",{className:"text-sm font-medium mb-1 flex items-center gap-1.5",children:[e.jsx(ze,{className:"h-4 w-4"})," Choose a shift"]}),e.jsx("div",{className:"space-y-2",children:Q.map(t=>{const c=W===t.id,u=t.isFull;return e.jsx("button",{type:"button",role:"radio","aria-checked":c,disabled:u,onClick:()=>X(c?null:t.id),className:`w-full text-left p-3 rounded-xl border-2 transition-all ${c?"":"border-border hover:bg-muted/40"} ${u?"opacity-50 cursor-not-allowed":""}`,style:c?{backgroundColor:ye(i.accent,.1),borderColor:i.accent,color:i.ctaBackgroun
10d}:void 0,"data-testid":`shift-option-${t.id}`,children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm truncate",children:t.name}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[kt(t.startAt,t.endAt,s.timezone),t.role?` · ${t.role}`:""]})]}),e.jsx("div",{className:"shrink-0 text-right",children:t.isFull?e.jsx("span",{className:"text-[10px] font-semibold uppercase text-amber-700",children:"Full"}):c?e.jsx(z,{className:"h-5 w-5",style:{color:i.ctaBackground}}):t.remaining!=null?e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[t.remaining," left"]}):null})]})},t.id)})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(S,{htmlFor:"rsvp-first",children:["First name ",e.jsx("span",{className:"text-red-600","aria-hidden":"true",children:"*"})]}),e.jsx(B,{id:"rsvp-first",value:f,onChange:t=>T(t.target.value),required:!0,"aria-required":"true","data-testid":"input-rsvp-first"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(S,{htmlFor:"rsvp-last",children:["Last name ",e.jsx("span",{className:"text-red-600","aria-hidden":"true",children:"*"})]}),e.jsx(B,{id:"rsvp-last",value:U,onChange:t=>$(t.target.value),required:!0,"aria-required":"true","data-testid":"input-rsvp-last"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(S,{htmlFor:"rsvp-email",children:["Email ",e.jsx("span",{className:"text-red-600","aria-hidden":"true",children:"*"})]}),e.jsx(B,{id:"rsvp-email",type:"email",placeholder:"[email protected]",value:g,onChange:t=>_(t.target.value),required:!0,"aria-required":"true","data-testid":"input-rsvp-email"}),g.length>0&&!ne&&e.jsx("p",{className:"text-xs text-red-600",role:"alert",children:"Enter a valid email address."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Weâll email your confirmation and calendar invite."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:"rsvp-phone",children:"Mobile number (optional)"}),e.jsx(B,{id:"rsvp-phone",type:"tel",placeholder:"(555) 123-4567",value:h,onChange:t=>b(t.target.value),"data-testid":"input-rsvp-phone"}),h.length>0&&!ie&&e.jsx("p",{className:"text-xs text-red-600",role:"alert",children:"Enter a valid 10-digit US phone number, or leave blank."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(S,{htmlFor:"rsvp-zip",children:["ZIP code ",e.jsx("span",{className:"text-red-600","aria-hidden":"true",children:"*"})]}),e.jsx(B,{id:"rsvp-zip",inputMode:"numeric",maxLength:5,placeholder:"49684",value:m,onChange:t=>j(t.target.value.replace(/\D/g,"").slice(0,5)),required:!0,"aria-required":"true","data-testid":"input-rsvp-zip"}),m.length>0&&!oe&&e.jsx("p",{className:"text-xs text-red-600",role:"alert",children:"Enter a 5-digit ZIP code."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(He,{id:"rsvp-sms-optin",checked:p,onCheckedChange:t=>Se(t===!0),"data-testid":"checkbox-rsvp-sms-optin"}),e.jsxs(S,{htmlFor:"rsvp-sms-optin",className:"text-xs font-normal leading-snug text-muted-foreground",children:["I want to receive text messages from ",a.campaign.name," about how to stay involved."]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:"rsvp-notes",children:"Anything we should know? (optional)"}),e.jsx(et,{id:"rsvp-notes",rows:2,value:G,onChange:t=>$e(t.target.value),"data-testid":"input-rsvp-notes"})]}),se&&e.jsxs("div",{className:"space-y-1.5","data-testid":"rsvp-captcha",children:[e.jsx(st,{siteKey:te,onToken:t=>{H(!1),D(t)},onError:()=>D(""),onUnavailable:()=>{D(""),H(!0)}}),ae&&F.length===0&&e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Complete the verification above to continue."})]}),e.jsxs(L,{className:"w-full",size:"lg",style:{backgroundColor:i.ctaBackground,...A},onMouseEnter:t=>{t.currentTarget.style.backgroundColor=i.ctaBackgroundHover},onMouseLeave:t=>{t.currentTarget.style.backgroundColor=i.ctaBackground},disabled:!le,onClick:Pe,"data-testid":"button-rsvp-submit",children:[Y?e.jsx(ge,{className:"h-4 w-4 mr-1.5 animate-spin"}):e.jsx(z,{className:"h-4 w-4 mr-1.5"}),P?"Join the waitlist":"Attend"]}),e.jsx("p",{className:"text-[10px] text-center text-muted-foreground",children:"Powered by Blueroots"}),e.jsxs("p",{className:"text-[10px] text-center text-muted-foreground",children:["By signing up you agree to the"," ",e.jsx("a",{href:"https://www.blueroots.io/terms",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:"terms"})," ","and"," ",e.jsx("a",{href:"https://www.blueroots.io/privacy",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:"privacy policy"}),"."]}),e.jsx(We,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(L,{variant:"outline",className:"w-full",onClick:xe,"data-testid":"button-copy-invite-link",children:[e.jsx(we,{className:"h-4 w-4 mr-1.5"})," Copy invite link"]}),e.jsxs(L,{variant:"outline",className:"w-full",onClick:()=>window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(q("facebook"))}`,"_blank","noopener,noreferrer"),"data-testid":"button-share-facebook",children:[e.jsx(it,{className:"h-4 w-4 mr-1.5"})," Share on Facebook"]}),e.jsxs(L,{variant:"outline",className:"w-full",onClick:()=>window.open(`https://twitter.com/intent/tweet?text=${encodeURIComponent(s.title)}&url=${encodeURIComponent(q("twitter"))}`,"_blank","noopener,noreferrer"),"data-testid":"button-share-x",children:[e.jsx(Ct,{className:"h-3.5 w-3.5 mr-1.5"})," Share on X"]}),fe?e.jsxs("a",{href:fe,className:"block text-center text-xs text-muted-foreground underline underline-offset-2 pt-1","data-testid":"link-contact-organizer",children:[e.jsx(Xe,{className:"h-3.5 w-3.5 inline mr-1"})," Contact organizer"]}):null]})]})});return e.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-muted/40 to-background",children:[e.jsx(Ge,{}),Me?null:e.jsx("div",{className:"text-white",style:{backgroundColor:i.heroDeep,...A},"data-testid":"bar-campaign-identity",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 h-14 flex items-center gap-3",children:[i.logoUrl?e.jsx("img",{src:i.logoUrl,alt:a.campaign.name,className:"h-8 w-auto max-w-[150px] object-contain","data-testid":"img-campaign-logo"}):e.jsx("div",{className:"h-8 w-8 rounded-full flex items-center justify-center shrink-0",style:{backgroundColor:i.heroSurface},children:e.jsx(Ne,{className:"h-4 w-4"})}),e.jsx("p",{className:"text-sm font-semibold truncate",children:a.campaign.candidateName||a.campaign.name})]})}),e.jsx("header",{className:"text-white",style:{backgroundColor:i.hero,backgroundImage:`linear-gradient(135deg, ${i.heroDeep} 0%, ${i.hero} 55%, ${i.hero} 100%)`,...A},"data-testid":"header-public-event",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 pt-6 pb-12 md:pt-10 md:pb-16 grid gap-6 md:gap-8 md:grid-cols-2 md:items-center",children:[s.coverImageUrl?e.jsx("img",{src:s.coverImageUrl,alt:s.title,className:"w-full aspect-video object-cover rounded-2xl shadow-2xl",style:{boxShadow:"0 18px 40px -18px rgba(0,0,0,0.55)",border:`1px solid ${i.heroBorder}`},"data-testid":"img-event-cover"}):e.jsx("div",{className:"w-full aspect-video rounded-2xl flex items-center justify-center",style:{background:at.mist,border:`1px solid ${i.heroBorder}`},"data-testid":"placeholder-event-cover",children:e.jsx(Ne,{className:"h-10 w-10 text-white/80"})}),e.jsxs("div",{className:"min-w-0 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ue?e.jsx("span",{className:"rounded-full px-2.5 py-1 text-[11px] font-semibold uppercase tracking-[0.12em]",style:{backgroundColor:i.heroSurface,border:`1px solid ${i.heroBorder}`},"data-testid":"chip-event-type",children:ue}):null,P?e.jsx("span",{className:"rounded-full bg-amber-400 px-2.5 py-1 text-[11px] font-bold uppercase tracking-[0.12em] text-amber-950",style:{textShadow:"none"},"data-testid":"chip-event-full",children:"Waitlist"}):null]}),e.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-extrabold leading-[1.12] tracking-tight break-words",children:s.title}),e.jsxs("dl",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(ot,{className:"h-4 w-4 mt-0.5 shrink-0 opacity-90","aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("dt",{className:"sr-only",children:"When"}),e.jsxs("dd",{children:[e.jsx("span",{className:"font-semibold",children:wt(s.startAt,s.timezone)}),e.jsx("span",{className:"block text-white/85",children:Nt(s.startAt,s.endAt,s.timezone)}),e.jsx("span",{className:"sr-only",children:yt(s.startAt,s.endAt,s.timezone)})]})]})]}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[s.isVirtual?e.jsx(lt,{className:"h-4 w-4 mt-0.5 shrink-0 opacity-90","aria-hidden":"true"}):e.jsx(ve,{className:"h-4 w-4 mt-0.5 shrink-0 opacity-90","aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("dt",{className:"sr-only",children:"Where"}),e.jsxs("dd",{children:[e.jsx("span",{className:"font-semibold",children:s.isVirtual?"Virtual event":De}),!s.isVirtual&&he?e.jsx("span",{className:"block text-white/85",children:he}):null,s.isVirtual?e.jsx("span",{className:"block text-white/85",children:"Join link sent after you RSVP."}):null]})]})]})]}),e.jsxs("a",{href:"#rsvp",className:"md:hidden inline-flex items-center gap-1.5 rounded-xl px-4 py-2.5 text-sm font-bold bg-white shadow-sm",style:{color:i.ctaBackgroun
10d,textShadow:"none"},"data-testid":"link-hero-signup",children:[e.jsx(z,{className:"h-4 w-4"}),P?"Join the waitlist":"Sign up"]})]})]})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-4 -mt-6 pb-10",children:[Ae&&e.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-xl px-4 py-3 text-sm",style:{backgroundColor:ye(i.accent,.14),color:i.ctaBackground},role:"status","data-testid":"banner-native-share",children:[e.jsx(ct,{className:"h-4 w-4 mt-0.5 shrink-0"}),e.jsx("p",{className:"flex-1",children:"A friend picked this event. Get involved by signing up."}),e.jsx("button",{type:"button",onClick:Ue,"aria-label":"Dismiss",className:"shrink-0 opacity-70 hover:opacity-100","data-testid":"button-dismiss-share-banner",children:e.jsx(Ye,{className:"h-4 w-4"})})]}),N?e.jsx(w,{className:"shadow-lg border-0 max-w-lg mx-auto",children:e.jsxs(I,{className:"p-8 text-center space-y-4",role:"status","aria-live":"polite",children:[e.jsx("div",{className:`h-14 w-14 rounded-full flex items-center justify-center mx-auto ${N==="confirmed"?"":"bg-amber-500"}`,style:N==="confirmed"?{backgroundColor:i.ctaBackground}:void 0,children:N==="confirmed"?e.jsx(dt,{className:"h-7 w-7 text-white"}):e.jsx(Je,{className:"h-7 w-7 text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold",children:N==="confirmed"?"You're confirmed":"You're on the waitlist"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:N==="confirmed"?"We've emailed your confirmation and a calendar invite.":"This event is full. We've added you to the waitlist and will email you if a spot opens up."}),s.isVirtual&&N==="confirmed"&&e.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:"Your join link is in the confirmation email â itâs unique to you."})]}),e.jsx("div",{className:"pt-2",children:e.jsxs(L,{variant:"outline",size:"sm",onClick:xe,"data-testid":"button-copy-invite-link-confirmed",children:[e.jsx(we,{className:"h-4 w-4 mr-1.5"})," Copy invite link"]})})]})}):e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-8","data-testid":"public-rsvp-grid",children:[e.jsx("div",{className:"md:col-span-2 md:order-2",id:"rsvp",style:{scrollMarginTop:"1.5rem"},children:e.jsx("div",{className:"md:sticky md:top-6",children:Fe})}),e.jsxs("div",{className:"md:col-span-3 md:order-1 space-y-4",children:[Re&&e.jsx(w,{className:"shadow-sm border-0","data-testid":"card-event-logistics",children:e.jsxs(I,{className:"p-5 space-y-4",children:[!s.isVirtual&&(E||k)?e.jsxs("div",{className:"flex items-start gap-2.5 text-sm",children:[e.jsx(ve,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsxs("div",{children:[s.locationName&&e.jsx("p",{className:"font-bold",children:s.locationName}),R?e.jsx("p",{className:"text-muted-foreground whitespace-pre-line",children:R}):null,k?e.jsxs("span",{className:"mt-1 inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 text-xs text-muted-foreground","data-testid":"chip-address-after-rsvp",children:[e.jsx(Ke,{className:"h-3 w-3"}),"Exact address shared after you sign up"]}):null,e.jsxs("div",{className:"flex gap-3 mt-1",children:[me?e.jsx("a",{href:"#event-map",className:"underline underline-offset-2 text-xs",style:{color:i.ctaBackground},children:"Map"}):null,de?e.jsx("a",{href:de,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 text-xs",style:{color:i.ctaBackground},"data-testid":"link-event-directions",children:"Directions"}):e.jsx("span",{className:"text-xs text-muted-foreground","aria-disabled":"true","data-testid":"link-event-directions-disabled",children:"Directions after sign-up"})]})]})]}):null,O?e.jsxs("div",{className:"flex items-start gap-2.5 text-sm","data-testid":"block-parking-instructions",children:[e.jsx(mt,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold",children:"Parking"}),e.jsx("p",{className:"text-muted-foreground whitespace-pre-line",children:O})]})]}):s.hasParkingInstructions?e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"note-parking-after-rsvp",children:"Parking details are shared after you sign up."}):null,P&&e.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-200 px-3 py-2 text-xs text-amber-800",role:"alert",children:"This event is at capacity. You can still sign up â youâll be added to the waitlist."})]})}),s.description&&e.jsx(w,{className:"shadow-sm border-0",children:e.jsxs(I,{className:"p-5",children:[e.jsx("h2",{className:"text-base font-bold mb-2",children:"About this event"}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:s.description})]})}),ee.length>0&&e.jsx(w,{className:"shadow-sm border-0",children:e.jsxs(I,{className:"p-5",children:[e.jsx("h2",{className:"text-base font-bold mb-3",children:"Hosted by"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ee.map(t=>e.jsxs("div",{className:"rounded-lg border px-3 py-2","data-testid":"card-event-host",children:[e.jsx("p",{className:"text-sm font-semibold",children:t.name}),e.jsx(Qe,{variant:"secondary",className:"mt-1 capitalize text-[10px]",children:t.role})]},`${t.name}-${t.role}`))})]})}),me&&e.jsx(w,{className:"shadow-sm border-0 overflow-hidden",id:"event-map",children:e.jsx(bt,{lat:ce,lng:Be,address:E||null,approximate:k,className:"w-full h-64"})})]})]}),e.jsxs("section",{className:"mt-10","data-testid":"section-related-events",children:[e.jsx("h2",{className:"text-lg font-bold mb-3",children:Z.length>0?`More events from ${a.campaign.name}`:`More from ${a.campaign.name}`}),Z.length>0&&e.jsx("div",{className:"flex gap-4 overflow-x-auto pb-2 snap-x",children:Z.map(t=>e.jsx("div",{className:"min-w-[240px] max-w-[280px] snap-start",children:e.jsx(tt,{event:t,compact:!0,showShareButton:!1,onOpen:()=>{window.location.href=be(`/e/${a.campaign.slug}/${t.slug??""}`)}})},t.id))}),e.jsx("div",{className:"mt-3",children:e.jsx(L,{asChild:!0,className:"w-full sm:w-auto",style:{backgroundColor:i.ctaBackgroun
10d,...A},onMouseEnter:t=>{t.currentTarget.style.backgroundColor=i.ctaBackgroundHover},onMouseLeave:t=>{t.currentTarget.style.backgroundColor=i.ctaBackground},children:e.jsx("a",{href:be(`/c/${a.campaign.slug}/events`),"data-testid":"link-see-all-events",children:"See all upcoming events"})})})]})]})]})}export{Wt 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.