1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-jdqwVp6Y.js","assets/index-TtKZJC71.css"])))=>i.map(i=>d[i]); 2import{c as Pe,am as ee,an as Te,ao as Fe,F as Le,ap as Ae,o as Oe,r as i,q as ze,aq as se,j as e,t as Be,S as $e,v as Je,H as X,L as ae,m as f,ar as R,Z as be,as as W,l as k,I as Re,B as O,X as le,at as Qe,au as He,av as Ve,aw as Ze,ax as oe,Y as ie,f as j,a7 as Ue,C as Xe,ab as We,ac as Ye,ad as Ge,ae as qe,a5 as ye,ay as de,s as Ke}from"./index-jdqwVp6Y.js";import{E as ce,i as re}from"./EventCard-DiPLQlE6.js";import{u as es,P as ss}from"./PullToRefreshIndicator-BMuwjim-.js";import{P as me,a as xe,b as ue,C as he,s as ts,e as ge}from"./popover-DL-kr_1y.js";import{d as as,e as rs,a as ns}from"./endOfMonth-DYJrei1g.js";import{P as ls}from"./plus-CrSUaGRz.js";import{G as Ne}from"./globe-DH55KTO0.js";import{L as os}from"./list-D1TqFJOk.js";import{S as is}from"./search-BHwTnWPX.js";import{F as ds}from"./filter-A3MZevhi.js";import{s as cs}from"./subMonths-CC3j4DYS.js";import{C as ms}from"./chevron-left-NONfk743.js";import{P as ve}from"./pencil-HCT6qkin.js";import{g as xs}from"./getRoundingMethod-D0I6Z7xl.js";import{a as us}from"./subDays-CV9GR4b5.js";import{i as we}from"./isSameDay-DHKttEU5.js";import"./constructNow-CfgzThCz.js";import"./download-DAM6CfIN.js";import"./refresh-cw-1f7UJ1RW.js";/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const hs=Pe("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);function gs(s,a){const r=ee(s),l=ee(a),c=pe(r,l),u=Math.abs(Te(r,l));r.setDate(r.getDate()-c*u);const d=+(pe(r,l)===-c),y=c*(u-d);return y===0?0:y}function pe(s,a){const r=s.getFullYear()-a.getFullYear()||s.getMonth()-a.getMonth()||s.getDate()-a.getDate()||s.getHours()-a.getHours()||s.getMinutes()-a.getMinutes()||s.getSeconds()-a.getSeconds()||s.getMilliseconds()-a.getMilliseconds();return r<0?-1:r>0?1:r}function ps(s,a,r){const l=as(s,a)/Fe;return xs(r==null?void 0:r.roundingMethod)(l)}function fs(s){return ee(s).getDay()}function js(s){if(!s||re(s))return null;const a=new Date,r=gs(s,a),l=ps(s,a)%24;return{days:r,hours:l}}const Js=()=>{const{isAdmin:s,user:a}=Le(),{isBookmarked:r,toggle:l,bookmarkedIds:c}=Ae(),u=Oe(),[d,y]=i.useState(""),[E,z]=i.useState("all"),[N,B]=i.useState(),[v,$]=i.useState(),[m,h]=i.useState("list"),[b,S]=i.useState(new Date),[x,F]=i.useState(!1),[L,Q]=i.useState(!1),[J,P]=i.useState(""),ke=i.useRef(null),{data:o,isLoading:_}=ze({queryKey:["all_events"],queryFn:async()=>{const{data:t}=await Ke.from("events").select("*").is("deleted_at",null).order("start_date",{ascending:!0});return(t??[]).filter(n=>n.status!=="draft")}}),_e=i.useCallback(()=>u.invalidateQueries({queryKey:["all_events"]}),[u]),{pullDistance:De,isRefreshing:Me,progress:Ce}=es({onRefresh:_e}),I=i.useMemo(()=>(o==null?void 0:o.filter(t=>{const n=t.end_date||t.start_date;return n?new Date(n)>=new Date:!0}))??[],[o]),H=i.useMemo(()=>(o==null?void 0:o.filter(t=>{const n=t.end_date||t.start_date;return n?new Date(n)<new Date:!1}))??[],[o]),w=i.useMemo(()=>I.length?[...I].sort((t,n)=>{const D=t.start_date?new Date(t.start_date).getTime():1/0,M=n.start_date?new Date(n.start_date).getTime():1/0;return D-M})[0]:null,[I]),Y=i.useMemo(()=>I.filter(t=>t.id!==(w==null?void 0:w.id)),[I,w]),Se=js(w!=null&&w.start_date?new Date(w.start_date):null),V=i.useMemo(()=>{const t=o==null?void 0:o.map(n=>n.location).filter(n=>!!n);return[...new Set(t)].sort()},[o]),T=i.useMemo(()=>o?o.filter(t=>{var M,p;if(d){const C=d.toLowerCase();if(!(t.title.toLowerCase().includes(C)||((M=t.description)==null?void 0:M.toLowerCase().includes(C))||((p=t.location)==null?void 0:p.toLowerCase().includes(C))))return!1}if(E!=="all"&&t.location!==E)return!1;const n=t.start_date?new Date(t.start_date):null,D=t.end_date?new Date(t.end_date):n;return!(N&&D&&D<se(N)||v&&n&&n>rs(v))}):[],[o,d,E,N,v]),g=d||E!=="all"||N||v,A=i.useCallback(t=>!x||!t?t??[]:t.filter(n=>
7c.includes(n.id)),[x,c]),G=()=>{y(""),z("all"),B(void 0),$(void 0),P("")},ne=async t=>{var n;if(!(!t.trim()||t.trim().length<3)){Q(!0);try{const D=await fetch("https://htfyvuboevhaiozschxr.supabase.co/functions/v1/search-events",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imh0Znl2dWJvZXZoYWlvenNjaHhyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI5MTk0ODksImV4cCI6MjA4ODQ5NTQ4OX0.9thZRJoCSl1Zz_MEfSNdjPLlXfCXPIijgSskkChbA_k"},body:JSON.stringify({query:t,locations:V})}),M=await D.json();if(!D.ok){const{toast:C}=await de(async()=>{const{toast:Z}=await import("./index-jdqwVp6Y.js").then(Ee=>Ee.c7);return{toast:Z}},__vite__mapDeps([0,1]));C.error(M.error||"AI search failed");return}const p=M.filters;if((n=p.keywords)!=null&&n.length&&y(p.keywords.join(" ")),p.location){const C=V.find(Z=>Z.toLowerCase().includes(p.location.toLowerCase()));z(C??"all")}p.date_from&&B(new Date(p.date_from)),p.date_to&&$(new Date(p.date_to)),P(t)}catch(D){const{toast:M}=await de(async()=>{const{toast:p}=await import("./index-jdqwVp6Y.js").then(C=>C.c7);return{toast:p}},__vite__mapDeps([0,1]));M.error(D.message||"AI search failed")}finally{Q(!1)}}},q=i.useMemo(()=>T.filter(t=>{const n=t.end_date||t.start_date;return n?new Date(n)>=new Date:!0}),[T]),K=i.useMemo(()=>T.filter(t=>{const n=t.end_date||t.start_date;return n?new Date(n)<new Date:!1}),[T]),Ie=I.length>0?I.map(t=>({"@context":"https://schema.org","@type":"Event",name:t.title,description:t.description??void 0,startDate:t.start_date??void 0,endDate:t.end_date??void 0,location:t.location?{"@type":"Place",name:t.location}:void 0,url:t.external_url??void 0,image:t.image_url??void 0})):void 0;return e.jsxs(Be,{children:[e.jsx($e,{...Je.events(),canonical:`${window.location.origin}/events`,jsonLd:Ie??{"@context":"https://schema.org","@type":"CollectionPage",name:"Dental Events & Conferences",description:"Dental conferences, workshops, and community gatherings in Saudi Arabia.",url:`${window.location.origin}/events`}}),e.jsx(ss,{pullDistance:De,isRefreshing:Me,progress:Ce}),e.jsxs("section",{className:"relative overflow-hidden bg-gradient-to-br from-primary/8 via-background to-accent/10 border-b border-border/30",children:[e.jsx("div",{className:"absolute top-10 right-[15%] w-64 h-64 bg-primary/5 rounded-full blur-3xl pointer-events-none"}),e.jsx("div",{className:"absolute bottom-0 left-[10%] w-48 h-48 bg-gold/5 rounded-full blur-3xl pointer-events-none"}),e.jsxs("div",{className:"container mx-auto px-5 sm:px-6 py-14 md:py-20",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-primary/10 border border-primary/15 text-primary text-xs font-bold uppercase tracking-widest mb-5",children:[e.jsx(X,{className:"h-3.5 w-3.5"}),"Events & Conferences"]}),e.jsx("h1",{className:"text-3xl md:text-5xl font-bold tracking-tight mb-3 optical-align",children:"Dental Events"}),e.jsx("p",{className:"text-muted-foreground text-lg md:text-xl leading-relaxed max-w-xl",children:"Stay updated with the latest dental conferences, workshops, and community gatherings across Saudi Arabia and worldwide."})]}),s&&e.jsx(ae,{to:"/admin/events",className:"shrink-0 mt-2",children:e.jsxs(f,{size:"sm",children:[e.jsx(ls,{className:"h-4 w-4 mr-2"}),"New Event"]})})]}),!_&&o&&o.length>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-6 md:gap-10 mt-10 pt-8 border-t border-border/30",children:[e.jsx(U,{icon:e.jsx(R,{className:"h-4 w-4"}),value:I.length,label:"Upcoming",accent:!0}),e.jsx(U,{icon:e.jsx(be,{className:"h-4 w-4"}),value:H.length,label:"Past Events"}),e.jsx(U,{icon:e.jsx(W,{className:"h-4 w-4"}),value:V.length,label:"Locations"}),o.some(t=>t.external_url)&&e.jsx(U,{icon:e.jsx(Ne,{className:"h-4 w-4"}),value:o.filter(t=>t.external_url).length,label:"With Links"})]})]})]}),e.jsxs("div",{className:"container mx-auto px-5 sm:px-6 py-10 md:py-14",children:[!_&&o&&o.length>0&&e.jsxs("div",{className:"mb-10 rounded-xl border border-border/40 bg-card p-4 md:p-5",children:[e.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[e.jsxs("div",{className:"flex rounded-lg border border-border/40 overflow-hidden shrink-0 self-start",children:[e.jsxs("button",{onClick:()=>h("list"),className:k("px-3.5 min-h-[44px] flex items-center gap-1.5 text-xs font-medium transition-colors",m==="list"?"bg-primary text-primary-foreground":"bg-background text-muted-foreground hover:text-foreground"),children:[e.jsx(os,{className:"h-3.5 w-3.5"}),"List"]}),e.jsxs("button",{onClick:()=>h("calendar"),className:k("px-3.5 min-h-[44px] flex items-center gap-1.5 text-xs font-medium transition-colors",m==="calendar"?"bg-primary text-primary-foreground":"bg-background text-muted-foreground hover:text-foreground"),children:[e.jsx(hs,{className:"h-3.5 w-3.5"}),"Calendar"]})]}),e.jsxs("div",{className:"relative flex-1",children:[e.jsx(is,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Re,{ref:ke,placeholder:"Try 'implant courses in Riyadh next month'â¦",value:d,onChange:t=>{y(t.target.value),P("")},onKeyDown:t=>{t.key==="Enter"&&d.trim().length>=3&&ne(d)},className:"h-11 pl-9 pr-28 bg-background"}),e.jsx(f,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-9 px-3 gap-1.5 text-xs text-primary hover:text-primary",onClick:()=>ne(d),disabled:L||d.trim().length<3,children:L?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-3 w-3 rounded-full border-2 border-primary border-t-transparent animate-spin"})," Searchingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"h-3 w-3"})," AI Search"]})})]}),J&&e.jsx("div",{className:"basis-full md:basis-auto",children:e.jsxs(O,{variant:"secondary",className:"gap-1.5 text-xs",children:[e.jsx(X,{className:"h-3 w-3"}),'AI: "',J,'"',e.jsx("button",{onClick:()=>{G(),P("")},className:"ml-1 hover:text-foreground",children:e.jsx(le,{className:"h-3 w-3"})})]})}),e.jsxs(Qe,{value:E,onValueChange:z,children:[e.jsxs(He,{className:"w-full md:w-[200px] bg-background",children:[e.jsx(W,{className:"h-4 w-4 mr-2 text-muted-foreground shrink-0"}),e.jsx(Ve,{placeholder:"All Locations"})]}),e.jsxs(Ze,{children:[e.jsx(oe,{value:"all",children:"All Locations"}),V.map(t=>e.jsx(oe,{value:t,children:t},t))]})]}),e.jsxs(me,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs(f,{variant:"outline",className:k("w-full md:w-[160px] justify-start text-left font-normal bg-background",!N&&"text-muted-foreground"),children:[e.jsx(ie,{className:"h-4 w-4 mr-2 shrink-0"}),N?j(N,"MMM d, yyyy"):"From date"]})}),e.jsx(ue,{className:"w-auto p-0",align:"start",children:e.jsx(he,{mode:"single",selected:N,onSelect:B,initialFocus:!0,className:k("p-3 pointer-events-auto")})})]}),e.jsxs(me,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs(f,{variant:"outline",className:k("w-full md:w-[160px] justify-start text-left font-normal bg-background",!v&&"text-muted-foreground"),children:[e.jsx(ie,{className:"h-4 w-4 mr-2 shrink-0"}),v?j(v,"MMM d, yyyy"):"To date"]})}),e.jsx(ue,{className:"w-auto p-0",align:"start",children:e.jsx(he,{mode:"single",selected:v,onSelect:$,initialFocus:!0,className:k("p-3 pointer-events-auto")})})]}),a&&e.jsxs(f,{variant:x?"default":"outline",size:"sm",onClick:()=>F(!x),className:"shrink-0 self-center gap-1.5",children:[e.jsx(Ue,{className:k("h-4 w-4",x&&"fill-current")}),"Saved",c.length>0&&` (${c.length})`]}),(g||x)&&e.jsxs(f,{variant:"ghost",size:"sm",onClick:()=>{G(),F(!1)},className:"text-muted-foreground hover:text-foreground shrink-0 self-center",children:[e.jsx(le,{className:"h-4 w-4 mr-1"}),"Clear"]})]}),g&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:["Showing ",e.jsx("span",{className:"font-bold text-foreground",children:T.length})," of"," ",e.jsx("span",{className:"font-bold text-foreground",children:o.length})," events"]})]}),_&&e.jsxs("div",{className:"space-y-8",children:[e.jsx("div",{className:"rounded-2xl border border-border/40 bg-card overflow-hidden animate-pulse",children:e.jsxs("div",{className:"grid md:grid-cols-2",children:[e.jsx("div",{className:"aspect-[16/9] md:aspect-auto bg-muted/50"}),e.jsxs("div",{className:"p-8 space-y-4",children:[e.jsx("div",{className:"h-4 w-24 bg-muted/50 rounded"}),e.jsx("div",{className:"h-7 w-3/4 bg-muted/50 rounded"}),e.jsx("div",{className:"h-4 w-full bg-muted/50 rounded"}),e.jsx("div",{className:"h-4 w-2/3 bg-muted/50 rounded"})]})]})}),e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsxs("div",{className:"rounded-2xl border border-border/40 bg-card overflow-hidden animate-pulse",children:[e.jsx("div",{className:"aspect-[16/9] bg-muted/50"}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("div",{className:"h-4 w-32 bg-muted/50 rounded"}),e.jsx("div",{className:"h-5 w-3/4 bg-muted/50 rounded"}),e.jsx("div",{className:"h-4 w-full bg-muted/50 rounded"})]})]},t))})]}),!_&&m==="calendar"&&o&&o.length>0&&e.jsx(bs,{events:g?T:o,calendarMonth:b,onMonthChange:S,isAdmin:s}),m==="list"&&e.jsxs(e.Fragment,{children:[!_&&!g&&w&&e.jsx("section",{className:"mb-14","aria-label":"Featured event",children:e.jsx(Ns,{event:w,countdown:Se,isAdmin:s})}),!_&&A(g?q:Y).length>0&&e.jsxs("section",{className:"mb-14","aria-label":"Upcoming events",children:[e.jsx(fe,{title:g?"Upcoming Events":"More Upcoming Events",count:A(g?q:Y).length,live:!0}),e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:A(g?q:Y).map(t=>e.jsxs("div",{className:"relative group",children:[e.jsx(ce,{...t,isBookmarked:r(t.id),onToggleBookmark:a?l:void 0}),s&&e.jsx(te,{eventId:t.id})]},t.id))})]}),!_&&A(g?K:H).length>0&&e.jsxs("section",{"aria-label":"Past events",children:[e.jsx(fe,{title:"Past Events",count:A(g?K:H).length,muted:!0}
7),e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:A(g?K:H).map(t=>e.jsxs("div",{className:"relative group opacity-80 hover:opacity-100 transition-opacity",children:[e.jsx(ce,{...t,isBookmarked:r(t.id),onToggleBookmark:a?l:void 0}),s&&e.jsx(te,{eventId:t.id})]},t.id))})]})]}),!_&&g&&T.length===0&&e.jsxs("div",{className:"text-center py-20",children:[e.jsx("div",{className:"h-16 w-16 rounded-2xl bg-muted/30 flex items-center justify-center mx-auto mb-4 border border-border/30",children:e.jsx(ds,{className:"h-7 w-7 text-muted-foreground/30"})}),e.jsx("p",{className:"text-foreground font-bold",children:"No events match your filters"}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Try adjusting your search or date range."}),e.jsx(f,{variant:"outline",size:"sm",onClick:G,className:"mt-4",children:"Clear all filters"})]}),!_&&!g&&(!o||o.length===0)&&e.jsxs("div",{className:"text-center py-24",children:[e.jsx("div",{className:"h-20 w-20 rounded-2xl bg-primary/5 flex items-center justify-center mx-auto mb-5 border border-primary/10",children:e.jsx(R,{className:"h-9 w-9 text-primary/30"})}),e.jsx("p",{className:"text-foreground font-bold text-lg",children:"No events listed yet"}),e.jsx("p",{className:"text-muted-foreground text-sm mt-2 max-w-sm mx-auto",children:"Check back soon for upcoming dental conferences, workshops, and community gatherings."})]})]})]})};function bs({events:s,calendarMonth:a,onMonthChange:r,isAdmin:l}){const[c,u]=i.useState(null),d=ts(a),y=ns(a),E=ge({start:d,end:y}),z=fs(d),N=Array.from({length:z},(m,h)=>h),B=i.useMemo(()=>{const m=new Map;for(const h of s){const b=h.start_date?new Date(h.start_date):null,S=h.end_date?new Date(h.end_date):b;if(!b)continue;const x=b<d?d:b,F=S&&S>y?y:S||b,L=ge({start:se(x),end:se(F)});for(const Q of L){const J=j(Q,"yyyy-MM-dd"),P=m.get(J)||[];P.push(h),m.set(J,P)}}return m},[s,a]),v=new Date,$=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return e.jsxs("div",{className:"mb-14",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs(f,{variant:"ghost",size:"sm",onClick:()=>r(cs(a,1)),children:[e.jsx(ms,{className:"h-4 w-4 mr-1"}),"Prev"]}),e.jsx("h2",{className:"text-lg font-bold tracking-tight",children:j(a,"MMMM yyyy")}),e.jsxs(f,{variant:"ghost",size:"sm",onClick:()=>r(us(a,1)),children:["Next",e.jsx(Xe,{className:"h-4 w-4 ml-1"})]})]}),e.jsx("div",{className:"grid grid-cols-7 gap-px bg-border/30 rounded-t-xl overflow-hidden",children:$.map(m=>e.jsx("div",{className:"bg-muted/40 text-center py-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:m},m))}),e.jsxs("div",{className:"grid grid-cols-7 gap-px bg-border/30 rounded-b-xl overflow-hidden",children:[N.map(m=>e.jsx("div",{className:"bg-card min-h-[100px] md:min-h-[120px]"},`pad-${m}`)),E.map(m=>{const h=j(m,"yyyy-MM-dd"),b=B.get(h)||[],S=we(m,v);return e.jsxs("div",{className:k("bg-card min-h-[100px] md:min-h-[120px] p-1.5 md:p-2 relative transition-colors",S&&"bg-primary/5"),children:[e.jsx("span",{className:k("inline-flex items-center justify-center h-6 w-6 rounded-full text-xs font-bold",S?"bg-primary text-primary-foreground":"text-foreground"),children:j(m,"d")}),e.jsxs("div",{className:"mt-1 space-y-0.5",children:[b.slice(0,3).map((x,F)=>{const L=re(x.end_date?new Date(x.end_date):x.start_date?new Date(x.start_date):new Date);return e.jsx("button",{onClick:()=>u(x),className:k("block w-full text-left truncate text-[10px] md:text-xs font-medium rounded px-1.5 py-0.5 leading-tight cursor-pointer transition-colors",L?"bg-muted/60 text-muted-foreground hover:bg-muted":"bg-primary/10 text-primary hover:bg-primary/20"),title:x.title,children:x.title},`${x.id}-${F}`)}),b.length>3&&e.jsxs("span",{className:"block text-[10px] text-muted-foreground font-medium px-1.5",children:["+",b.length-3," more"]})]})]},h)})]}),e.jsx(ys,{event:c,onClose:()=>u(null),isAdmin:l})]})}function ys({event:s,onClose:a,isAdmin:r}){if(!s)return null;const l=s.start_date?new Date(s.start_date):null,c=s.end_date?new Date(s.end_date):null,u=re(c||l||new Date);return e.jsx(We,{open:!!s,onOpenChange:d=>!d&&a(),children:e.jsxs(Ye,{className:"sm:max-w-lg",children:[s.image_url&&e.jsxs("div",{className:"relative -mx-6 -mt-6 mb-4 aspect-[16/9] overflow-hidden rounded-t-lg",children:[e.jsx("img",{src:s.image_url,alt:s.title,className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/40 to-transparent"}),u&&e.jsx(O,{variant:"secondary",className:"absolute top-3 left-3 bg-muted/90 backdrop-blur-sm text-xs font-bold uppercase tracking-wider",children:"Past"})]}),e.jsxs(Ge,{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[!u&&!s.image_url&&e.jsx(O,{className:"bg-primary/10 text-primary border-primary/15 text-xs font-bold",children:"Upcoming"}),u&&!s.image_url&&e.jsx(O,{variant:"secondary",className:"text-xs font-bold",children:"Past"})]}),e.jsx(qe,{className:"text-xl font-bold tracking-tight leading-snug",children:s.title})]}
7),e.jsxs("div",{className:"space-y-4 mt-2",children:[l&&e.jsxs("div",{className:"flex items-center gap-2.5 text-sm",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(R,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium text-foreground",children:[j(l,"EEEE, MMMM d, yyyy"),c&&!we(l,c)&&e.jsxs("span",{className:"text-muted-foreground",children:[" ","â ",j(c,"MMMM d, yyyy")]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:j(l,"h:mm a")})]})]}),s.location&&e.jsxs("div",{className:"flex items-center gap-2.5 text-sm",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(W,{className:"h-4 w-4 text-primary"})}),e.jsx("p",{className:"font-medium text-foreground",children:s.location})]}),s.description&&e.jsx("div",{className:"pt-2 border-t border-border/30",children:e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.description})}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[s.external_url&&e.jsx("a",{href:s.external_url,target:"_blank",rel:"noopener noreferrer",className:"flex-1",children:e.jsxs(f,{className:"w-full gap-2",children:[e.jsx(Ne,{className:"h-4 w-4"}),"Visit Event",e.jsx(ye,{className:"h-3.5 w-3.5"})]})}),r&&e.jsx(ae,{to:`/admin/events?edit=${s.id}`,children:e.jsxs(f,{variant:"outline",size:"sm",className:"gap-1.5",children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),"Edit"]})})]})]})]})})}function U({icon:s,value:a,label:r,accent:l}){return e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:`h-9 w-9 rounded-xl flex items-center justify-center ${l?"bg-primary/10 text-primary":"bg-muted/60 text-muted-foreground"}`,children:s}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-bold leading-none tabular-nums text-foreground",children:a}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:r})]})]})}function fe({title:s,count:a,live:r,muted:l}){return e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsxs("h2",{className:`text-lg font-bold tracking-tight flex items-center gap-2 ${l?"text-muted-foreground":""}`,children:[r&&e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-green-500 animate-pulse"}),s]}),e.jsx(O,{variant:l?"outline":"secondary",className:`text-xs font-bold ${l?"text-muted-foreground":""}`,children:a})]})}function Ns({event:s,countdown:a,isAdmin:r}){const l=s.start_date?new Date(s.start_date):null,c=s.end_date?new Date(s.end_date):null,u=s.external_url?"a":"div",d=s.external_url?{href:s.external_url,target:"_blank",rel:"noopener noreferrer"}:{};return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsxs(O,{className:"bg-primary/10 text-primary border-primary/15 text-xs font-bold uppercase tracking-widest",children:[e.jsx(X,{className:"h-3 w-3 mr-1"}),"Next Event"]}),a&&e.jsxs("span",{className:"text-xs text-muted-foreground font-medium",children:["Starts in"," ",e.jsxs("span",{className:"font-bold text-foreground tabular-nums",children:[a.days,"d ",a.hours,"h"]})]})]}),e.jsx(u,{...d,className:"group block rounded-2xl border border-border/30 bg-card overflow-hidden transition-all duration-500 hover:border-primary/20 hover:shadow-premium",children:e.jsxs("div",{className:"grid md:grid-cols-[1.2fr_1fr]",children:[e.jsxs("div",{className:"relative aspect-[16/9] md:aspect-auto md:min-h-[320px] overflow-hidden bg-muted",children:[s.image_url?e.jsx("img",{src:s.image_url,alt:s.title,className:"absolute inset-0 w-full h-full object-cover transition-transform duration-700 ease-out group-hover:scale-[1.04]"}):e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/15 via-muted/40 to-accent/15 flex items-center justify-center",children:e.jsx(R,{className:"h-16 w-16 text-primary/15"})}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-transparent to-card/60 hidden md:block"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-card/40 to-transparent md:hidden"}),a&&e.jsxs("div",{className:"absolute bottom-4 left-4 md:hidden flex items-center gap-2 bg-background/80 backdrop-blur-md rounded-lg px-3 py-2 border border-border/40",children:[e.jsx(be,{className:"h-4 w-4 text-primary"}),e.jsxs("span",{className:"text-sm font-bold tabular-nums",children:[a.days,"d ",a.hours,"h"]})]})]}),e.jsxs("div",{className:"p-6 md:p-8 flex flex-col justify-center",children:[l&&e.jsxs("div",{className:"flex items-center gap-2 text-sm font-bold uppercase tracking-wider text-primary/80 mb-3",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx("span",{children:j(l,"MMMM d")}),c&&e.jsxs("span",{children:["â ",j(c,"MMMM d")]}),e.jsxs("span",{className:"text-muted-foreground font-medium",children:["· ",j(l,"yyyy")]})]}),e.jsx("h2",{className:"text-xl md:text-2xl font-bold tracking-tight leading-snug mb-3 group-hover:text-primary transition-colors duration-200",children:s.title}),s.description&&e.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4 line-clamp-3",children:s.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground mt-auto",children:[s.location&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(W,{className:"h-4 w-4 text-primary/50"}),s.location]}),s.external_url&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-primary font-bold text-xs uppercase tracking-wider ml-auto group-hover:gap-2 transition-all",children:["Learn More",e.jsx(ye,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})]}),a&&e.jsxs("div",{className:"hidden md:flex items-center gap-3 mt-6 pt-5 border-t border-border/30",children:[e.jsx(je,{value:a.days,label:"Days"}
7),e.jsx("span",{className:"text-muted-foreground/40 text-lg font-light",children:":"}),e.jsx(je,{value:a.hours,label:"Hours"}),e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:"until the event begins"})]})]})]})}),r&&e.jsx(te,{eventId:s.id,featured:!0})]})}function je({value:s,label:a}){return e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground leading-none",children:String(s).padStart(2,"0")}),e.jsx("p",{className:"text-[10px] uppercase tracking-widest text-muted-foreground mt-1",children:a})]})}function te({eventId:s,featured:a}){return e.jsx(ae,{to:`/admin/events?edit=${s}`,children:e.jsxs(f,{size:"sm",variant:"secondary",className:`absolute ${a?"top-5 right-5":"top-3 right-3"} opacity-0 group-hover:opacity-100 transition-opacity shadow-lg z-10`,children:[e.jsx(ve,{className:"h-3.5 w-3.5 mr-1"}),"Edit"]})})}export{Js 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.