1import{r as N,b as g,j as e,L as l}from"./vendor-react-core-_0sZDOLQ.js";import{c as o,B as p,b as j}from"./index-j07E1qHv.js";import{I as b}from"./input-rti45mgP.js";import{C as w}from"./card-DHmBnTdH.js";import{B as v}from"./badge-BXqwvh8U.js";import{S as k}from"./skeleton-ClHfYp06.js";import{C as _}from"./CleanHero-B9_2ARuE.js";import{h as C}from"./vendor-utils-BRu4i-LD.js";import{T as n,a2 as L,Z as A,aN as S,e as D,bg as B}from"./vendor-lucide-Ddz0eB7N.js";import{m as T}from"./vendor-framer-motion-C1oRD-X5.js";import"./vendor-radix-CFmJ1img.js";import"./vendor-supabase-Ca6cp8v2.js";function O(){const[i,u]=N.useState(""),{data:y,isLoading:f}=g({queryKey:["ticketing-matches"],queryFn:()=>j.entities.Match.filter({status:"scheduled"}),initialData:[]}),{data:d}=g({queryKey:["tickets"],queryFn:()=>j.entities.Ticket.list(),initialData:[]}),m=y.filter(s=>{var r,t,x;const a=d.some(h=>h.match_id===s.id&&h.quantity_available>0),c=((r=s.home_team)==null?void 0:r.toLowerCase().includes(i.toLowerCase()))||((t=s.away_team)==null?void 0:t.toLowerCase().includes(i.toLowerCase()))||((x=s.competition)==null?void 0:x.toLowerCase().includes(i.toLowerCase()));return a&&c}).sort((s,a)=>new Date(s.match_date)-new Date(a.match_date));return e.jsxs("main",{className:"min-h-screen bg-gray-50",children:[e.jsx(_,{eyebrow:"Bilheteira Digital FAF",title:"Bilheteira Digital",description:"Compre bilhetes para todos os jogos de forma rápida e segura",icon:n}),e.jsx("section",{className:"py-8 bg-white border-b sticky top-20 z-30",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-xl mx-auto relative",children:[e.jsx(L,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),e.jsx(b,{placeholder:"Pesquisar jogos...",value:i,onChange:s=>u(s.target.value),className:"pl-10"})]})})}),e.jsx("section",{className:"py-12",children:e.jsx("div",{className:"container mx-auto px-4",children:f?e.jsx("div",{className:"space-y-6",children:[...Array(3)].map((s,a)=>e.jsx(k,{className:"h-64 rounded-xl"},a))}):m.length>0?e.jsx("div",{className:"space-y-6",children:m.map((s,a)=>{const c=d.filter(t=>t.match_id===s.id),r=Math.min(...c.map(t=>t.price));return e.jsx(T.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:a*.05},children:e.jsx(w,{className:"overflow-hidden hover:shadow-xl transition-shadow",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3",children:[e.jsxs("div",{className:"md:col-span-2 p-6",children:[e.jsx(v,{className:"mb-3 bg-red-100 text-red-700",children:s.competition}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[s.home_logo&&e.jsx("img",{src:s.home_logo,alt:s.home_team,loading:"lazy",decoding:"async",className:"w-12 h-12 object-contain"}),e.jsx("div",{children:e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:s.home_team})})]}),e.jsx("span",{className:"text-2xl font-bold text-gray-400",children:"vs"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"text-right",children:e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:s.away_team})}),s.away_logo&&e.jsx("img",{src:s.away_logo,alt:s.away_team,loading:"lazy",decoding:"async",className:"w-12 h-12 object-contain"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"}),C(s.match_date).format("DD/MM/YYYY HH:mm")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"}),s.venue]})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-red-50 to-yellow-50 p-6 flex flex-col justify-center items-center text-center border-l",children:[e.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"A partir de"}),e.jsxs("p",{className:"text-3xl font-bold text-red-600 mb-4",children:[r.toLocaleString("pt-AO")," Kz"]}),e.jsx(l,{to:o(`TicketDetail?matchId=${s.id}`),className:"w-full",children:e.jsxs(p,{className:"w-full bg-red-600 hover:bg-red-700",children:[e.jsx(n,{className:"w-4 h-4 mr-2"}),"Ver Bilhetes"]})})]})]})})},s.id)})}):e.jsxs("div",{className:"text-center py-20",children:[e.jsx(n,{className:"w-20 h-20 text-gray-300 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"Nenhum jogo disponÃvel"}),e.jsx("p",{className:"text-gray-600",children:"Não há bilhetes à venda no momento"})]})})}),e.jsxs("section",{className:"border-t border-gray-200",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2",children:[e.jsxs(l,{to:o("Shop"),className:"group flex items-center gap-3 justify-center py-4 bg-gray-900 text-white text-sm font-bold uppercase tracking-wide hover:bg-gray-800 transition-colors",children:[e.jsx(D,{className:"w-5 h-5"}),"Compra Online â Loja FAF"]}),e.jsxs(l,{to:o("AngolaPlus"),className:"group flex items-center gap-3 justify-center py-4 bg-faf-blue-dark text-white text-sm font-bold uppercase tracking-wide hover:bg-faf-blue transition-colors",children:[e.jsx(B,{className:"w-5 h-5"}),"Apoio ao Cliente"]})]}),e.jsx("div",{className:"bg-gradient-to-r from-red-600 to-yellow-500 py-8",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-6 text-white",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-black uppercase",children:"Acesso a descontos exclusivos na compra de bilhetes"}),e.jsx("p",{className:"text-white/90 text-sm mt-1",children:"Junte-se ao Angola+, o clube de fãs gratuito das Seleções Nacionais."})]}),e.jsx(l,{to:o("AngolaPlus"),children:e.jsx(p,{className:"bg-white text-red-600 hover:bg-gray-100 font-bold uppercase rounded-xl px-6 h-11",children:"Regista-te Já"})})]})})})]})]})}export{O 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.