1import{G as f,s as g,m as x,f as v,j as e}from"./index-P0N1Je5T.js";import{a as p}from"./applyDiceTheme-BySOrMaX.js";import{u as h,a as y}from"./useDiceTracking-D6dIIfs7.js";import"./index-BaR5SETf.js";import"./input-1tKBwIjz.js";import"./checkbox-wSZ1kz90.js";import"./progress-BO5nxn_Q.js";import"./AppleIntelligenceButton-BYIEZF3c.js";import"./mediaUtils-FkLO5AK0.js";import"./useFanSession-CbNndObm.js";const j="dice-event-card-payload";function b(t){return f({queryKey:[j,t],queryFn:async()=>{if(!t)return{exists:!1};const{data:i,error:r}=await g.rpc("get_dice_event_card",{p_dice_event_id:t});if(r)throw r;return i??{exists:!1}},enabled:!!t,staleTime:2*6e4,gcTime:5*6e4,retry:1})}function N(){const{diceEventId:t}=x(),i=v(),{data:r,isLoading:n,error:l}=b(t),{track:d}=h();if(y(t,"dice_event_card",!!(r!=null&&r.exists)),n)return e.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",style:{backgroundColor:"var(--dice-background)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--dice-muted)"},children:"Loadingâ¦"})});if(l||!(r!=null&&r.exists)||!r.gallery||!t)return e.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 text-center",style:{backgroundColor:"var(--dice-background)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--dice-muted)"},children:"Event gallery not found."})});const a=r.gallery,s=r.company,c=r.item_count??0,o=[a.date,a.location].filter(Boolean).join(" · "),m=c===1?"1 highlight":`${c} highlights`,u=()=>{s!=null&&s.id&&d({companyId:s.id,galleryId:a.id,diceEventId:t,linkType:"dice_event_card",linkUrl:`/dice/${t}`}),i(`/dice/${t}`)};return e.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",style:{...p(),backgroundColor:"var(--dice-background)",fontFamily:"var(--dice-font)"},children:e.jsxs("button",{type:"button",onClick:u,className:"group w-full max-w-sm rounded-lg overflow-hidden border text-left transition-transform focus:outline-none focus:ring-2 focus:ring-offset-2",style:{backgroundColor:"var(--dice-surface)",borderColor:"var(--dice-border)",borderRadius:"var(--dice-radius)",color:"var(--dice-text)","--tw-ring-color":"var(--dice-accent)"},children:[e.jsxs("div",{className:"relative aspect-[16/9] overflow-hidden",children:[a.cover_image_url?e.jsx("img",{src:a.cover_image_url,alt:a.title||"Gallery cover",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{backgroundColor:"var(--dice-border)"},children:e.jsx("span",{className:"text-sm",style:{color:"var(--dice-muted)"},children:"No cover"})}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
1parent to-transparent"}),e.jsxs("div",{className:"absolute bottom-3 left-3 right-3 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs font-medium rounded",style:{backgroundColor:"var(--dice-accent)",color:"var(--dice-accent-foreground)"},children:m}),(s==null?void 0:s.logo_url)&&e.jsx("img",{src:s.logo_url,alt:s.name||"Company logo",className:"h-6 max-w-[120px] object-contain drop-shadow"})]})]}),e.jsxs("div",{className:"p-4 space-y-1",children:[e.jsx("h3",{className:"font-semibold leading-tight",style:{color:"var(--dice-text)"},children:a.title||"Untitled gallery"}),o&&e.jsx("p",{className:"text-sm",style:{color:"var(--dice-muted)"},children:o}),e.jsx("p",{className:"text-sm font-medium pt-2",style:{color:"var(--dice-accent)"},children:"View gallery â"})]})]})})}function V(){return e.jsx(N,{})}export{V 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.