1import{j as e,n as x}from"./index-DKqUnLwK.js";import{u as g,r as o,L as d}from"./vendor-B-P4X9mJ.js";import"./helmet-g13O2BcH.js";import"./i18n-CWLY-z3X.js";function f(r){const a=r.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|shorts\/))([a-zA-Z0-9_-]{11})/);return a?a[1]:null}function p({url:r,title:a}){const l=f(r);return l?e.jsx("div",{className:"relative w-full",style:{paddingBottom:"56.25%"},children:e.jsx("iframe",{className:"absolute inset-0 w-full h-full rounded-lg",src:`https://www.youtube.com/embed/${l}`,title:a||"Video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}):e.jsx("video",{className:"w-full rounded-lg",controls:!0,preload:"metadata",children:e.jsx("source",{src:r})})}function v(r){if(!r.event_date)return"";const a=new Date(r.event_date).toLocaleDateString();if(r.event_end_date){const l=new Date(r.event_end_date).toLocaleDateString();return`${a} - ${l}`}return a}function w(){const{slug:r,lang:a}=g(),l=a||"zh",[n,h]=o.useState(null),[u,m]=o.useState(!0),[c,s]=o.useState(null);return o.useEffect(()=>{(async()=>{if(!r){s("Event slug is missing"),m(!1);return}try{m(!0),s(null);const i=await x(r);i?h(i):s("Event not found")}catch{s("Failed to load event")}finally{m(!1)}})()},[r]),u?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-black mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"è¼å ¥ä¸..."})]})}):c||!n?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center py-16",children:[e.jsx("h1",{className:"text-2xl font-bold mb-4",children:"æ¾ä¸å°æ´»å"}),e.jsx("p",{className:"text-gray-600 mb-8",children:c}),e.jsx(d,{to:`/${l}/event`,className:"inline-block bg-black text-white px-6 py-3 rounded hover:bg-gray-800 transition-colors",children:"è¿åæ´»åå表"})]})}):e.jsx("div",{className:"min-h-screen",children:e.jsxs("article",{className:"max-w-3xl mx-auto px-4 pt-24 md:pt-20 pb-8",children:[n.cover_image&&e.jsx("div",{className:"mb-8",children:e.jsx("img",{src:n.cover_image,alt:n.title,className:"w-full h-auto rounded-lg object-cover max-h-[480px]"})}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-4 text-center leading-tight",children:n.title}),n.description&&e.jsx("p",{className:"text-gray-500 text-center text-lg mb-4",children:n.description}),e.jsxs("div",{className:"flex items-center justify-center gap-3 text-sm text-gray-400 mb-8",children:[n.event_date&&e.jsx("span",{children:v(n)}),n.location&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.location})]})]}),e.jsx("div",{className:"border-b border-gray-200 mb-8"}),n.content&&n.content.length>0&&e.jsx("div",{className:"space-y-8",children:n.content.map((t,i)=>e.jsxs("div",{children:[t.title&&e.jsx("h2",{className:"text-xl md:text-2xl font-bold mb-3",children:t.title}),t.layout==="video"&&t.content&&e.jsx(p,{url:t.content,title:t.title}),t.layout==="image"&&t.image&&e.jsx("img",{src:t.image,alt:t.title||"",className:"w-full rounded-lg"}),t.layout==="html"&&e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 2 .event-html h1 { font-size: 1.875rem; font-weight: 700; color: #111827; margin-top: 2.5rem; margin-bottom: 1rem; line-height: 1.3; } 3 .event-html h2 { font-size: 1.5rem; font-weight: 700; color: #111827; margin-top: 2rem; margin-bottom: 0.75rem; line-height: 1.3; } 4 .event-html h3 { font-size: 1.25rem; font-weight: 700; color: #111827; margin-top: 1.5rem; margin-bottom: 0.5rem; line-height: 1.4; } 5 .event-html p { color: #374151; line-height: 1.8; margin-bottom: 1rem; } 6 .event-html a { color: #2563eb; text-decoration: underline; } 7 .event-html img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1.5rem auto; display: block; } 8 .event-html blockquote { border-left: 4px solid #d1d5db; padding-left: 1rem; margin: 1.25rem 0; color: #4b5563; font-style: italic; } 9 .event-html ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; } 10 .event-html ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 1rem; } 11 .event-html li { margin-bottom: 0.25rem; color: #374151; line-height: 1.8; } 12 `}),e.jsx("div",{className:"event-html",dangerouslySetInnerHTML:{__html:t.content}})]}),t.layout!=="video"&&t.layout!=="image"&&t.layout!=="html"&&t.content&&e.jsx("p",{className:"text-gray-600 leading-relaxed",children:t.content})]},i))}),e.jsx("div",{className:"text-center mt-16",children:e.jsx(d,{to:`/${l}/event`,className:"inline-block bg-black text-white px-8 py-3 rounded hover:bg-gray-800 transition-colors",children:"è¿åæ´»åå表"})})]})})}export{w 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.