1import{am as U,r as a,j as e,af as h,C as p,i as f,k as j,l as b,m as N,B as y,w as v,y as L,F,I as w}from"./index-DhwrhnZy.js";import{L as C}from"./label-B8pEaVSp.js";function T(){const[d,r]=U("/meeting/:shortCode"),[s,E]=a.useState(null),[k,m]=a.useState(!0),[u,x]=a.useState(!1),[i,M]=a.useState(""),[l,S]=a.useState(""),[c,n]=a.useState(null);a.useEffect(()=>{if(!d||!(r!=null&&r.shortCode)){m(!1);return}async function t(){try{console.log("Fetching meeting for shortCode:",r.shortCode);const o=await fetch(`/api/public/meeting/${r.shortCode}`);if(o.ok){const g=await o.json();console.log("Meeting data:",g),E(g)}else console.error("Meeting not found, status:",o.status),n("Meeting not found or has expired")}catch(o){console.error("Error fetching meeting:",o),n("Unable to load meeting information")}finally{m(!1)}}t()},[d,r==null?void 0:r.shortCode]);const P=async()=>{if(!i.trim()){n("Please enter your name to join the meeting");return}x(!0),n(null);try{await fetch(`/api/public/meeting/${r==null?void 0:r.shortCode}/join`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,email:l})});let t;s.originalUrl.includes("/boom-dev")?t=new URL(s.originalUrl.replace("/boom-dev","/boom-control")):t=new URL(s.originalUrl),t.searchParams.set("participantName",i),l&&t.searchParams.set("participantEmail",l),window.location.href=t.toString()}catch(t){console.error("Error joining meeting:",t),n("Error joining meeting. Please try again."),x(!1)}};return k?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/[0.04] via-background to-blue-500/[0.04] flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(h,{className:"h-8 w-8 animate-spin mx-auto mb-4 text-primary"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading meeting information..."})]})}):c||!s?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-rose-500/[0.05] via-background to-amber-500/[0.04] flex items-center justify-center p-4",children:e.jsxs(p,{className:"w-full max-w-md border-border/60 shadow-md",children:[e.jsxs(f,{className:"text-center",children:[e.jsx(j,{className:"text-destructive tracking-tight",children:"Meeting Error"}),e.jsx(b,{className:"mt-2 leading-relaxed",children:c||"This meeting link is invalid or has expired."})]}),e.jsxs(N,{className:"text-center",children:[e.jsx("p",{className:"text-muted-foreground mb-5 leading-relaxed",children:"Please check your meeting link or contact the meeting host."}),e.jsx(y,{onClick:()=>window.location.href="/",variant:"outline",children:"Return to Home"})]})]})}):e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/[0.04] via-background to-blue-500/[0.04] flex items-center justify-center p-4 sm:p-6",children:e.jsxs(p,{className:"w-full max-w-md border-border/60 shadow-md",children:[e.jsxs(f,{className:"text-center pb-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(v,{className:"w-8 h-8 text-primary"})}),e.jsx(j,{className:"text-2xl sm:text-3xl font-semibold tracking-tight text-foreground",children:s.title}),e.jsx(b,{className:"text-muted-foreground mt-2 leading-relaxed",children:s.description})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-6 gap-y-2 text-sm text-muted-foreground bg-muted/40 border border-border/60 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4"}),e.jsxs("span",{children:["Hosted by ",s.hostName]})]}),s.duration&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"w-4 h-4"}),e.jsx("span",{children:s.duration})]})]})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"participantName",children:"Your Name *"}),e.jsx(w,{id:"participantName",type:"text",placeholder:"Enter your full name",value:i,onChange:t=>M(t.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"participantEmail",children:"Email (optional)"}),e.jsx(w,{id:"participantEmail",type:"email",placeholder:"[email protected]",value:l,onCh
1ange:t=>S(t.target.value)})]}),c&&e.jsx("div",{className:"bg-destructive/10 border border-destructive/20 rounded-lg p-3 text-destructive text-sm",children:c}),e.jsx(y,{onClick:P,disabled:u||!i.trim(),className:"w-full",children:u?e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"mr-2 h-4 w-4 animate-spin"}),"Joining Meeting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{className:"mr-2 h-4 w-4"}),"Join Meeting"]})}),e.jsx("div",{className:"text-center text-xs text-muted-foreground",children:"By joining, you agree to our meeting policies and terms of use."})]})]})})}export{T 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.