import{av as L,l as T,u as A,q as $,r as m,s as U,v as z,j as e,z as R,W as x,a4 as N,f as P,U as B,B as u,ao as F,g as I,a1 as O,K as M,b_ as _}from"./index-CHXls9zu.js";import{S as V}from"./separator-DsDUWjq3.js";import{g as W,d as H,e as Z,f as q}from"./service-oL2j9mvJ.js";import{A as J}from"./arrow-left-Bd_5kLEE.js";import{C as h}from"./calendar-C4cui3Vf.js";import{M as g}from"./map-pin-DsozTM_p.js";import{T as K}from"./tag-J9uKP5e6.js";import{D as G}from"./download-DFZOCkRl.js";import{S as Q}from"./share-2-7mw4yuls.js";import"./analytics-Bu8LxldC.js";function X({event:r}){const l={"@context":"https://schema.org","@type":"Event",name:r.name,description:r.description,startDate:r.startDate,endDate:r.endDate,eventStatus:"https://schema.org/EventScheduled",eventAttendanceMode:"https://schema.org/OfflineEventAttendanceMode",location:{"@type":"Place",name:r.venueName,address:{"@type":"PostalAddress",addressLocality:r.city,addressCountry:r.country}},organizer:{"@type":"Organization",name:r.organizer,url:r.websiteUrl},url:r.websiteUrl,image:r.imageUrl};return e.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(l)}})}function de(){const{slug:r}=L(),l=T(),{t:a,i18n:c}=A("events"),{currentLanguage:w,getLocalizedPath:p}=$(),[s,b]=m.useState(null),[j,y]=m.useState([]),[D,v]=m.useState(!0);U({pageName:`event_${r||"unknown"}`}),z({pageName:`event_${r||"unknown"}`}),m.useEffect(()=>{async function t(){if(!r)return;v(!0);const n=await H(r);if(!n){l(p("/events"));return}b(n),_(r,n.name);const o=await Z(n,3);y(o),v(!1)}t()},[r,l,p]);const d=t=>new Intl.DateTimeFormat(c.language,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(new Date(t)),E=(t,n)=>new Intl.DateTimeFormat(c.language,{hour:"numeric",minute:"2-digit",timeZone:n,timeZoneName:"short"}).format(new Date(t)),k=()=>{if(!s)return;const t=q(s),n=new Blob([t],{type:"text/calendar;charset=utf-8"}),o=URL.createObjectURL(n),i=document.createElement("a");i.href=o,i.download=`${s.slug}.ics`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)},C=async()=>{if(!s)return;const t={title:s.name,text:s.description||`${s.name} - ${s.city}, ${s.country}`,url:window.location.href};if(navigator.share)try{await navigator.share(t)}catch{}else await navigator.clipboard.writeText(window.location.href)},S={"north-america":a("regions.northAmerica","North America"),europe:a("regions.europe","Europe"),"asia-pacific":a("regions.asiaPacific","Asia Pacific"),"middle-east":a("regions.middleEast","Middle East"),"latin-america":a("regions.latinAmerica","Latin America"),africa:a("regions.africa","Africa")};if(D)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsx("div",{className:"pt-32 pb-16 max-w-4xl mx-auto px-4",children:e.jsxs("div",{className:"animate-pulse space-y-6",children:[e.jsx("div",{className:"h-8 bg-muted rounded w-1/4"}),e.jsx("div",{className:"h-12 bg-muted rounded w-3/4"}),e.jsx("div",{className:"h-6 bg-muted rounded w-1/2"}),e.jsx("div",{className:"h-64 bg-muted rounded"})]})})});if(!s)return null;const f=W(s.country);return e.jsxs(e.Fragment,{children:[e.jsx(R,{noindex:w!=="en",title:`${s.name} | Cendra Events`,description:s.description||`${s.name} in ${s.city}, ${s.country} - ${d(s.startDate)}`}),e.jsx(X,{event:s}),e.jsxs("section",{className:"relative pt-32 pb-16 md:pt-40 md:pb-24 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary-700 via-primary-600 to-primary-700"}),e.jsx("div",{className:"absolute inset-0 bg-[url('/noise.png')] opacity-[0.03]"}),e.jsxs("div",{className:"relative z-10 max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs(x,{to:"/events",className:"inline-flex items-center gap-2 text-white/70 hover:text-white mb-8 transition-colors",children:[e.jsx(J,{className:"w-4 h-4"}),a("detail.backToEvents","Back to events")]}),s.isVerified&&e.jsxs(N,{className:"mb-4 bg-success-600/20 text-success-400 border-success-600/30",children:[e.jsx(P,{className:"w-3 h-3 mr-1"}),a("verified","Verified Event")]}),e.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-white mb-6",children:s.name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-white/80",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{className:"w-5 h-5"}),e.jsx("span",{children:d(s.startDate)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"w-5 h-5"}),e.jsxs("span",{children:[s.city,", ",s.country]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"w-5 h-5"}),e.jsx("span",{children:s.organizer})]})]})]})]}),e.jsx("section",{className:"py-16 md:py-24 bg-background content-auto-lg",children:e.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"md:col-span-2 space-y-8",children:[s.description&&e.jsx("div",{className:"prose prose-lg dark:prose-invert max-w-none",children:e.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed",children:s.description})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-3 flex items-center gap-2",children:[e.jsx(K,{className:"w-4 h-4"}),a("detail.tags","Tags")]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.tags.map(t=>e.jsx(x,{to:`/events/tags/${t}`,children:e.jsx(N,{variant:"secondary",className:"hover:bg-primary/10 transition-colors",children:t.charAt(0).toUpperCase()+t.slice(1).replace("-"," ")})},t))})]}),e.jsx(V,{}),j.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:a("detail.relatedEvents","Related Events")}),e.jsx("div",{className:"grid gap-4",children:j.map(t=>e.jsxs(x,{to:`/events/${t.slug}`,className:"group block p-4 bg-card border border-border rounded-lg hover:border-primary/30 transition-colors",children:[e.jsx("h4",{className:"font-medium group-hover:text-primary transition-colors",children:t.name}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mt-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(h,{className:"w-3 h-3"}),new Intl.DateTimeFormat(c.language,{month:"short",day:"numeric"}).format(new Date(t.startDate))]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(g,{className:"w-3 h-3"}),t.city]})]})]},t.id))})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 space-y-4",children:[e.jsxs(u,{onClick:k,className:"w-full",size:"lg",children:[e.jsx(G,{className:"w-4 h-4 mr-2"}),a("detail.addToCalendar","Add to Calendar")]}),e.jsxs(u,{variant:"outline",onClick:()=>window.open(s.websiteUrl,"_blank"),className:"w-full",children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),a("detail.visitWebsite","Visit Website")]}),e.jsxs(u,{variant:"ghost",onClick:C,className:"w-full",children:[e.jsx(Q,{className:"w-4 h-4 mr-2"}),a("detail.share","Share Event")]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 space-y-4",children:[e.jsx("h3",{className:"font-semibold",children:a("detail.eventDetails","Event Details")}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(h,{className:"w-4 h-4 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:a("detail.dates","Dates")}),e.jsxs("div",{className:"text-muted-foreground",children:[d(s.startDate),e.jsx("br",{}),a("detail.to","to")," ",d(s.endDate)]})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(I,{className:"w-4 h-4 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:a("detail.time","Time")}),e.jsx("div",{className:"text-muted-foreground",children:E(s.startDate,s.timezone)})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(O,{className:"w-4 h-4 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:a("detail.venue","Venue")}),e.jsx("div",{className:"text-muted-foreground",children:s.venueName})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(g,{className:"w-4 h-4 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:a("detail.location","Location")}),e.jsxs("div",{className:"text-muted-foreground",children:[s.city,", ",s.country]}),e.jsxs(x,{to:`/events/regions/${f}`,className:"text-primary hover:underline text-xs",children:[S[f]," ",a("detail.events","events")," →"]})]})]})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:[a("detail.source","Source"),": ",s.sourceName,e.jsx("br",{}),a("detail.lastChecked","Last checked"),": ",new Intl.DateTimeFormat(c.language).format(new Date(s.lastCheckedAt))]})]})]})})}),e.jsx(M,{})]})}export{de as default};