1import{D as e,ct as t,ft as n,t as r}from"./router-compat-CeQjGU3x.js";import{t as i}from"./createClientRpc-OKbERbHm.js";import{t as a}from"./createServerFn-DWu-FUSf.js";import{n as o}from"./client-JFkwxGAg.js";import{i as s,n as c,r as l,t as u}from"./ClubBadge-CNhSJK0S.js";import{r as d,t as f}from"./OffSeasonNotice-CpHX3mFD.js";import{n as p,t as m}from"./Footer-BJzVT73V.js";import{n as h,t as g}from"./twitter-DmqzCUML.js";import{p as _}from"./index-CGxdDai2.js";import{i as v,n as y}from"./leagueTableUtils-w4txt7qj.js";import{n as b,t as x}from"./card-DCWQyiZx.js";import{t as S}from"./ArticleCard-CAc5p0Fp.js";import{a as C,r as w,t as T}from"./MatchesLeagueTable-BMuWgbzL.js";var E=_(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),D=_(`table-properties`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),O=n(t(),1),k=`/assets/hero-bg-01-C16Nacjl.jpg`,A=`/assets/hero-bg-03-DHWuw41I.jpg`,j=`/assets/hero-bg-04-aLUbwlBc.jpg`,M=`/assets/hero-bg-06-Dwwu2INJ.jpg`,N=e(),P=[k,A,j,M];function F(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}return t}var I=()=>{let[e,t]=(0,O.useState)(()=>[...Array(P.length).keys()]),[n,i]=(0,O.useState)(0),[a,o]=(0,O.useState)(!0);(0,O.useEffect)(()=>{t(F([...Array(P.length).keys()]))},[]);let s=(0,O.useCallback)(()=>{o(!1),setTimeout(()=>{i(t=>(t+1)%e.length),o(!0)},800)},[e.length]);return(0,O.useEffect)(()=>{let e=setInterval(s,6e3);return()=>clearInterval(e)},[s]),(0,N.jsxs)(`section`,{className:`relative h-[440px] md:h-[550px] overflow-hidden`,children:[(0,N.jsx)(`img`,{src:P[e[n]??0]??P[0],alt:`Scottish Football`,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-700 ease-in-out`,style:{opacity:+!!a}}),(0,N.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-t from-background via-background/60 to-transparent`}),(0,N.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,N.jsxs)(`div`,{className:`text-center animate-fade-in-up`,children:[(0,N.jsxs)(`h1`,{className:`text-4xl md:text-6xl lg:text-7xl font-heading font-black text-foreground uppercase tracking-tight`,children:[`The Staple Diet`,(0,N.jsx)(`br`,{}),(0,N.jsx)(`span`,{className:`text-primary`,children:`of Scottish Football`})]}),(0,N.jsx)(`p`,{className:`mt-4 text-[10px] text-muted-foreground max-w-xl mx-auto uppercase tracking-[0.3em]`,children:`Est 2003`}),(0,N.jsxs)(`div`,{className:`mt-6 flex items-center justify-center gap-4`,children:[(0,N.jsx)(`a`,{href:`https://forum.pieandbovril.com`,target:`_blank`,rel:`noopener noreferrer`,className:`w-36 text-center py-3 bg-primary text-primary-foreground font-semibold rounded-lg hover:opacity-90 transition-opacity`,children:`Visit Forum`}),(0,N.jsx)(r,{to:`/my-pnb`,className:`w-36 text-center py-3 border border-[#3399ef] text-foreground font-semibold rounded-lg hover:bg-secondary transition-colors`,children:`My P&B`})]})]})})]})},L=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20id='pie'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%23B4814A'%20d='M49.56%2049.698H14.222c-2.75%200-5.156-1.835-5.864-4.472L4.572%2031.125H59.21l-3.787%2014.101c-.708%202.637-3.114%204.472-5.863%204.472'%3e%3c/path%3e%3cpath%20fill='%23010202'%20d='M34.58%2049.698h14.98c2.75%200%205.156-1.834%205.864-4.472l3.786-14.101h-5.248l-3.567.577S51.84%2048.026%2034.58%2049.698'%20opacity='.3'%3e%3c/path%3e%3cpath%20fill='%23FBAE3A'%20d='M6.893%2025.625c3.797-6.541%2013.58-12.023%2025.05-12.023%2011.464%200%2021.244%205.478%2025.045%2012.015l-.01.004c3.187.223%205.703%202.86%205.703%206.081%200%203.368-2.75%206.098-6.144%206.098-3.392%200-6.143-2.73-6.143-6.098%200%203.368-2.75%206.098-6.143%206.098-3.394%200-6.144-2.73-6.144-6.098%200%203.368-2.75%206.098-6.143%206.098s-6.143-2.73-6.143-6.098c0%203.368-2.75%206.098-6.144%206.098-3.393%200-6.143-2.73-6.143-6.098%200%203.368-2.75%206.098-6.144%206.098-3.392%200-6.143-2.73-6.143-6.098%200-3.2%202.485-5.826%205.646-6.077'%3e%3c/path%3e%3cpath%20fill='%232E2E30'%20d='M31.964%2023.048a1.242%201.242%200%200%201-1.246-1.237v-2.767c0-.684.558-1.238%201.246-1.238s1.247.554%201.247%201.238v2.767c0%20.683-.559%201.237-1.247%201.237m-10.804%2
100c-.357%200-.71-.15-.956-.442a1.23%201.23%200%200%201%20.154-1.743l3.324-2.768a1.253%201.253%200%200%201%201.757.153%201.23%201.23%200%200%201-.154%201.744l-3.325%202.766c-.233.195-.518.29-.8.29m21.609%200c-.283%200-.567-.095-.8-.29l-3.325-2.766a1.23%201.23%200%200%201-.154-1.744%201.254%201.254%200%200%201%201.756-.153l3.325%202.768a1.23%201.23%200%200%201%20.154%201.743c-.246.291-.6.442-.956.442'%3e%3c/path%3e%3cpath%20fill='%23010202'%20d='M56.538%2037.8c3.392%200%206.143-2.73%206.143-6.097%200-3.22-2.516-5.86-5.704-6.083l.011-.003c-3.8-6.537-13.58-12.015-25.046-12.015%200%200%2018.363%204.637%2018.452%2018.1%200%203.368%202.75%206.098%206.144%206.098'%20opacity='.3'%3e%3c/path%3e%3cpath%20fill='%232E2E31'%20d='M56.537%2036.562c-2.7%200-4.896-2.18-4.896-4.86%200-.683-.558-1.237-1.247-1.237-.688%200-1.247.554-1.247%201.237%200%202.68-2.196%204.86-4.896%204.86-2.7%200-4.897-2.18-4.897-4.86%200-.683-.559-1.237-1.247-1.237-.688%200-1.247.554-1.247%201.237%200%202.68-2.196%204.86-4.895%204.86-2.7%200-4.898-2.18-4.898-4.86%200-.683-.558-1.237-1.246-1.237-.689%200-1.247.554-1.247%201.237%200%202.68-2.197%204.86-4.897%204.86s-4.896-2.18-4.896-4.86c0-.683-.558-1.237-1.247-1.237-.688%200-1.246.554-1.246%201.237%200%202.68-2.197%204.86-4.898%204.86-2.7%200-4.896-2.18-4.896-4.86%200-2.515%201.976-4.644%204.499-4.844.409-.032.776-.262.98-.616%203.188-5.491%2012.049-11.403%2023.97-11.403%2011.814%200%2020.627%205.81%2023.885%2011.26.177.422.583.723%201.062.756%202.548.179%204.545%202.308%204.545%204.847%200%202.68-2.197%204.86-4.898%204.86m.93%202.41c.038-.004.074-.01.112-.016l-.112.017m-1.66.018-1.588%205.917c-.562%202.092-2.478%203.553-4.66%203.553H14.222a4.822%204.822%200%200%201-4.66-3.554L7.976%2039a7.398%207.398%2
100%200%200%205.558-3.225%207.4%207.4%200%200%200%206.143%203.262%207.405%207.405%200%200%200%206.144-3.262%207.404%207.404%200%200%200%206.144%203.262%207.402%207.402%200%200%200%206.142-3.262%207.405%207.405%200%200%200%206.144%203.262%207.402%207.402%200%200%200%206.143-3.262%207.403%207.403%200%200%200%206.143%203.262c-.247%200-.488-.022-.73-.046M6.24%2038.94c.06.01.117.02.177.027-.06-.008-.118-.018-.177-.027m57.69-7.237c0-3.603-2.666-6.66-6.185-7.236-4.518-7.153-15.01-12.101-25.802-12.101-10.797%200-21.291%204.95-25.807%2012.109C2.646%2025.07%200%2028.127%200%2031.702c0%203.334%202.254%206.149%205.327%207.038l1.826%206.804c.852%203.175%203.758%205.392%207.069%205.392h35.337c3.31%200%206.218-2.217%207.069-5.392l1.816-6.763c3.153-.838%205.484-3.69%205.484-7.08'%3e%3c/path%3e%3c/g%3e%3c/svg%3e`,R=e=>e.replace(/^<!\[CDATA\[/,``).replace(/\]\]>$/,``).trim(),z=({league:e})=>{let[t,n]=(0,O.useState)(!1);(0,O.useEffect)(()=>{n(!0)},[]);let{data:r,isLoading:i}=s({queryKey:[`forum-feed`,e],queryFn:async()=>{let{data:t,error:n}=await o.from(`forum_feed_items`).select(`*`).eq(`league`,e).order(`published_at`,{ascending:!1}).limit(5);if(n)throw n;return t},staleTime:36e5});return!t||i?(0,N.jsx)(C,{className:`h-32 w-full`}):!r||r.length===0?null:(0,N.jsx)(`div`,{children:r.map(e=>(0,N.jsxs)(`a`,{href:R(e.link),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-start gap-2 py-1.5 transition-colors hover:bg-muted/50 group`,children:[(0,N.jsx)(`img`,{src:L,alt:``,className:`h-3.5 w-3.5 shrink-0 mt-0.5`}),(0,N.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-snug group-hover:text-primary transition-colors`,children:e.title})]},e.id))})},B={Dunfermline:[`Dunfermline Ath.`,`Dunfermline Athletic`],"Greenock Morton":[`Morton`],Hamilton:[`Hamilton Academical`],"Inverness CT":[`Inverness Caledonian Thistle`],"Queen's Park":[`Queen's Park FC`],Spartans:[`The Spartans`]};function V(e){return B[e]?[e,...B[e]]:[e]}var H={HOME:{text:`Home`,color:`bg-green-600 text-white`},AWAY:{text:`Away`,color:`bg-red-600 text-white`},DRAW:{text:`Draw`,color:`bg-amber-500 text-white`}},U=({league:e})=>{let[t,n]=(0,O.useState)(null),{data:r,isLoading:i}=w([`2025-26`,`2026-27`],e);if(i||!r)return(0,N.jsx)(C,{className:`h-24 w-full`});let a=r.filter(e=>e.status===`completed`),o=r.filter(e=>e.status===`scheduled`);if(o.length===0)return(0,N.jsx)(f,{league:e,variant:`inline`});let s=new Date;s.setHours(0,0,0,0);let d=o.filter(e=>new Date(e.match_date)>=s);if(d.length===0)return(0,N.jsx)(f,{league:e,variant:`inline`});let p=[...d].sort((e,t)=>e.match_date.localeCompare(t.match_date)),m=new Date(p[0].match_date+`T12:00:00`),h=new Date(m);h.setDate(h.getDate()+3);let g=p.filter(e=>new Date(e.match_date+`T12:00:00`)<=h);if(g.length===0)return(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground text-center`,children:`No upcoming fixtures`});let _=y(a),b=0,x=0,S=0;for(let e of a)b+=e.home_score??0,x+=e.away_score??0,S++;let T=S>0?b/S:1.4,E=S>0?x/S:1.1,D=e=>{let t=a.filter(t=>e.includes(t.home_team)||e.includes(t.away_team)).sort((e,t)=>t.match_date.localeCompare(e.match_date)).slice(0,6);if(t.length===0)return{gfRate:0,gaRate:0};let n=0,r=0;for(let i of t){let t=e.includes(i.home_team);n+=t?i.home_score??0:i.away_score??0,r+=t?i.away_score??0:i.home_score??0}return{gfRate:n/t.length,gaRate:r/t.length}},k=(e,t)=>a.filter(n=>{let r=e.includes(n.home_team),i=e.includes(n.away_team),a=t.includes(n.home_team),o=t.includes(n.away_team);return r&&o||i&&a}).sort((e,t)=>e.match_date.localeCompare(t.match_date)),A=g.map(e=>{let t=v(e.home_team),n=v(e.away_team),r=_.find(e=>e.team===t),i=_.find(e=>e.team===n),a=V(t),o=V(n);if(!r||!i)return{homeTeam:t,awayTeam:n,outcome:`DRAW`,matchDate:e.match_date,kickoffTime:e.kickoff_time,homeDbNames:a,awayDbNames:o};let s=r.homeP||1,c=i.awayP||1,l=r.homeGF/s/(T||1),u=r.homeGA/s/(E||1),d=i.awayGF/c/(E||1),f=l*(i.awayGA/c/(T||1))*T,p=d*u*E,m=D(a),h=D(o),g=(T+E)/2||1;f*=1+(m.gfRate/g-1)*.15,p*=1+(h.gfRate/g-1)*.15;let y=k(a,o);if(y.length>0){let e=0,t=0;for(let n of y){let r=a.includes(n.home_team);e+=r?n.home_score??0:n.away_score??0,t+=r?n.away_score??0:n.home_score??0}f=f*.9+e/y.length*.1,p=p*.9+t/y.length*.1}let b=f-p,x;return x=b>.25?`HOME`:b<-.25?`AWAY`:`DRAW`,{homeTeam:t,awayTeam:n,outcome:x,matchDate:e.match_date,kickoffTime:e.kickoff_time,homeDbNames:a,awayDbNames:o}}).reduce((e,t)=>
1((e[t.matchDate]??=[]).push(t),e),{}),j=Object.keys(A).sort();return(0,N.jsx)(`div`,{className:`space-y-2`,children:j.map(e=>{let r=new Date(e+`T12:00:00`).toLocaleDateString(`en-GB`,{weekday:`short`,day:`numeric`,month:`short`}),i=[...A[e]??[]].sort((e,t)=>{let n=e.kickoffTime||``,r=t.kickoffTime||``;return n===r?e.homeTeam.localeCompare(t.homeTeam):n.localeCompare(r)});return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{className:`text-[10px] text-muted-foreground mb-1 block`,children:r}),(0,N.jsx)(`div`,{className:`space-y-1`,children:i.map((e,r)=>{let i=c[e.homeTeam],o=c[e.awayTeam],s=H[e.outcome],d=`${e.homeTeam}-${e.awayTeam}-${e.matchDate}`,f=t===d,p=k(e.homeDbNames,e.awayDbNames).slice(-10);return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`button`,{onClick:()=>n(f?null:d),className:`w-full flex items-center justify-between rounded-sm border border-border bg-muted/30 px-2 py-1.5 text-[11px] cursor-pointer hover:bg-muted/50 transition-colors`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0`,children:[i&&(0,N.jsx)(u,{src:i,clubName:e.homeTeam,className:`h-4 w-4 flex-shrink-0`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.homeTeam})]}),(0,N.jsx)(`span`,{className:`mx-1 flex-shrink-0 inline-flex items-center justify-center rounded-sm px-1.5 py-0.5 text-[9px] font-bold ${s.color}`,children:s.text}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0 justify-end`,children:[(0,N.jsx)(`span`,{className:`truncate text-right`,children:e.awayTeam}),o&&(0,N.jsx)(u,{src:o,clubName:e.awayTeam,className:`h-4 w-4 flex-shrink-0`})]}),(0,N.jsx)(l,{className:`ml-1 h-3 w-3 flex-shrink-0 text-muted-foreground transition-transform duration-200 ${f?`rotate-180`:``}`})]}),(0,N.jsx)(`div`,{className:`overflow-hidden transition-all duration-200 ${f?`max-h-96 opacity-100`:`max-h-0 opacity-0`}`,children:(0,N.jsxs)(`div`,{className:`px-1 pt-1.5 pb-1 space-y-2`,children:[p.length>0?(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-[9px] font-medium uppercase tracking-wider text-muted-foreground text-center mb-1`,children:`Previous meetings`}),(0,N.jsx)(`div`,{className:`space-y-1`,children:p.map((e,t)=>{let n=new Date(e.match_date+`T12:00:00`);return(0,N.jsxs)(`div`,{className:`flex items-center rounded-sm border border-border bg-muted/20 px-2 py-1 text-[10px]`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground w-12 shrink-0`,children:n.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`})}),(0,N.jsxs)(`span`,{className:`flex-1 min-w-0 grid grid-cols-[1fr_auto_1fr] items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:`text-right truncate`,children:v(e.home_team)}),(0,N.jsxs)(`span`,{className:`font-bold font-mono tabular-nums text-center w-9`,children:[e.home_score,` - `,e.away_score]}),(0,N.jsx)(`span`,{className:`text-left truncate`,children:v(e.away_team)})]})]},t)})})]}):(0,N.jsx)(`p`,{className:`text-[9px] text-muted-foreground text-center py-1`,children:`No previous meetings`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-[9px] font-medium uppercase tracking-wider text-muted-foreground text-center mb-1`,children:`Last 6`}),(0,N.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[{team:e.homeTeam,badge:i,dbNames:e.homeDbNames},{team:e.awayTeam,badge:o,dbNames:e.awayDbNames}].map((e,t)=>{let n=a.filter(t=>e.dbNames.includes(t.home_team)||e.dbNames.includes(t.away_team)).sort((e,t)=>t.match_date.localeCompare(e.match_date)).slice(0,6).map(t=>{let n=e.dbNames.includes(t.home_team),r=n?t.home_score:t.away_score,i=n?t.away_score:t.home_score,a=v(n?t.away_team:t.home_team),o=n?`H`:`A`,s=r>i?`W`:r<i?`L`:`D`;return{opp:a,score:`${r}-${i}`,venue:o,outcome:s}}),r=e=>e===`W`?`text-green-600 dark:text-green-400`:e===`L`?`text-red-600 dark:text-red-400`:`text-amber-600 dark:text-amber-400`;return(0,N.jsxs)(`div`,{className:`rounded-sm border border-border bg-muted/20 p-1.5`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-1 mb-1`,children:[e.badge&&(0,N.jsx)(u,{src:e.badge,clubName:e.team,className:`h-3 w-3`}),(0,N.jsx)(`span`,{className:`text-[9px] font-medium uppercase tracking-wider text-muted-foreground truncate`,children:e.team})]}),n.length===0?(0,N.jsx)(`p`,{className:`text-[9px] text-muted-foreground text-center italic`,children:`No results`}):(0,N.jsx)(`div`,{className:`space-y-0.5`,children:n.map((e,t)=>(0,N.jsxs)(`div`,{className:`flex items-center justify-between text-[9px] gap-1`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground w-2.5`,children:e.venue}),(0,N.jsx)(`span`,{className:`flex-1 truncate`,children:e.opp}),(0,N.jsx)(`span`,{className:`font-bold font-mono ${r(e.outcome)}`,children:e.score})]},t))})]},t)})})]})]})})]},r)})})]},e)})})},W=a({method:`GET`}).handler(i(`a537e4e06125a00c50cbff2c137509ad226dbcb94628063d4af7fee6b424ddad`)),G=()=>{let[e,t]=(0,O.useState)(null),{data:n=[],isLoading:r}=s({queryKey:[`youtube-feed-rss`],queryFn:async()=>await W(),staleTime:72e5});if(r)return(0,N.jsx)(C,{className:`h-64 w-full rounded-lg`});if(!n.length)return null;let i=e||n[0]?.id,a=n.filter(e=>e.id!==i);return(0,N.jsxs)(`div`,{className:`space-y-3`,children:[(0,N.jsx)(`div`,{className:`aspect-video w-full rounded-lg overflow-hidden bg-black`,children:(0,N.jsx)(`iframe`,{src:`https://www.youtube.com/embed/${i}?rel=0`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,className:`w-full h-full`})}
1),(0,N.jsx)(`div`,{className:`grid grid-cols-5 gap-2`,children:a.slice(0,5).map(e=>(0,N.jsxs)(`button`,{onClick:()=>t(e.id),className:`group relative rounded-sm overflow-hidden aspect-video bg-muted`,children:[(0,N.jsx)(`img`,{src:e.thumbnail,alt:e.title,className:`w-full h-full object-cover`,loading:`lazy`}),(0,N.jsx)(`div`,{className:`absolute inset-0 bg-black/40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,N.jsx)(E,{className:`h-4 w-4 text-white fill-white`})})]},e.id))})]})},K=[{label:`Premiership`,league:`Premiership`,forumLeague:`Premiership`},{label:`Championship`,league:`Championship`,forumLeague:`Championship`},{label:`League 1`,league:`League One`,forumLeague:`League 1`},{label:`League 2`,league:`League Two`,forumLeague:`League 2`}],q=()=>{let{data:e=[]}=s({queryKey:[`articles`,`homepage-latest`],queryFn:async()=>{let{data:e,error:t}=await o.from(`articles`).select(`id, slug, title, date, image, excerpt, category, smartframe_embed`).eq(`category`,`Homepage`).eq(`published`,!0).order(`date`,{ascending:!1,nullsFirst:!1}).limit(6);if(t)throw t;return e}}),{data:t,isLoading:n}=s({queryKey:[`homepage-tweets`],queryFn:async()=>{let e=`${{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_SUPABASE_PROJECT_ID:`zvyxtoxrxllylopggtrz`,VITE_SUPABASE_PUBLISHABLE_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2eXh0b3hyeGxseWxvcGdndHJ6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI1MzMyMTYsImV4cCI6MjA4ODEwOTIxNn0.1h9ucWrREUbwbmr_nsTwNo8OJpCIblGwXzWR7P7GZ6g`,VITE_SUPABASE_URL:`https://zvyxtoxrxllylopggtrz.supabase.co`}.VITE_SUPABASE_URL}/functions/v1/fetch-tweets?username=pieandbov`,{data:t}=await o.auth.getSession(),n=t.session?.access_token??{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_SUPABASE_PROJECT_ID:`zvyxtoxrxllylopggtrz`,VITE_SUPABASE_PUBLISHABLE_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2eXh0b3hyeGxseWxvcGdndHJ6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI1MzMyMTYsImV4cCI6MjA4ODEwOTIxNn0.1h9ucWrREUbwbmr_nsTwNo8OJpCIblGwXzWR7P7GZ6g`,VITE_SUPABASE_URL:`https://zvyxtoxrxllylopggtrz.supabase.co`}.VITE_SUPABASE_PUBLISHABLE_KEY,r=await fetch(e,{headers:{Authorization:`Bearer ${n}`,apikey:{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_SUPABASE_PROJECT_ID:`zvyxtoxrxllylopggtrz`,VITE_SUPABASE_PUBLISHABLE_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2eXh0b3hyeGxseWxvcGdndHJ6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI1MzMyMTYsImV4cCI6MjA4ODEwOTIxNn0.1h9ucWrREUbwbmr_nsTwNo8OJpCIblGwXzWR7P7GZ6g`,VITE_SUPABASE_URL:`https://zvyxtoxrxllylopggtrz.supabase.co`}.VITE_SUPABASE_PUBLISHABLE_KEY}});if(!r.ok)throw Error(`Failed to fetch tweets`);return r.json()},staleTime:18e5}),r=(t?.tweets??[]).slice(0,4);return(0,N.jsxs)(`div`,{className:`min-h-screen flex flex-col`,children:[(0,N.jsx)(p,{}),(0,N.jsx)(I,{}),(0,N.jsx)(`section`,{className:`py-8 bg-muted/30 border-y border-border`,children:(0,N.jsxs)(`div`,{className:`container`,children:[(0,N.jsxs)(`h2`,{className:`flex items-center justify-center gap-2 text-xl md:text-2xl font-heading font-black text-foreground uppercase mb-6`,children:[(0,N.jsx)(h,{className:`h-5 w-5 text-primary`}),`Forum `,(0,N.jsx)(`span`,{className:`text-primary`,children:`Latest`})]}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6`,children:K.map(e=>(0,N.jsxs)(`div`,{className:`rounded-xl border border-border bg-card shadow-xs overflow-hidden`,children:[(0,N.jsx)(`div`,{className:`px-4 pt-4 pb-2`,children:(0,N.jsx)(`h3`,{className:`text-xs font-heading font-black uppercase tracking-wider text-primary`,children:e.label})}),(0,N.jsx)(`div`,{className:`px-4 pb-4`,children:(0,N.jsx)(z,{league:e.forumLeague})})]},e.forumLeague))})]})}),(0,N.jsx)(`section`,{className:`py-8`,children:(0,N.jsx)(`div`,{className:`container`,children:(0,N.jsx)(G,{})})}),(0,N.jsx)(`section`,{className:`py-8 bg-muted/30 border-y border-border`,children:(0,N.jsxs)(`div`,{className:`container`,children:[(0,N.jsxs)(`h2`,{className:`flex items-center justify-center gap-2 text-xl md:text-2xl font-heading font-black text-foreground uppercase mb-6`,children:[(0,N.jsx)(d,{className:`h-5 w-5 text-primary`}),`P&B `,(0,N.jsx)(`span`,{className:`text-primary`,children:`Predictions`})]}),(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground text-center mb-4 italic`,children:`Based on home/away form, season record & head-to-head`}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6`,children:K.map(e=>(0,N.jsxs)(`div`,{className:`rounded-xl border border-border bg-card shadow-xs overflow-hidden`,children:[(0,N.jsx)(`div`,{className:`px-4 pt-4 pb-2`,children:(0,N.jsx)(`h3`,{className:`text-xs font-heading font-black uppercase tracking-wider text-primary`,children:e.label})}),(0,N.jsx)(`div`,{className:`px-4 pb-4`,children:(0,N.jsx)(U,{league:e.league})})]},`pred-${e.league}`))})]})}),(0,N.jsx)(`section`,{className:`py-8`,children:(0,N.jsxs)(`div`,{className:`container`,children:[(0,N.jsxs)(`h2`,{className:`flex items-center justify-center gap-2 text-xl md:text-2xl font-heading font-black text-foreground uppercase mb-6`,children:[(0,N.jsx)(D,{className:`h-5 w-5 text-primary`}),`Latest SPFL `,(0,N.jsx)(`span`,{className:`text-primary`,children:`League Tables`})]}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6`,children:K.map(e=>(0,N.jsxs)(`div`,{className:`rounded-xl border border-border bg-card shadow-xs overflow-hidden`,children:[(0,N.jsx)(`div`,{className:`px-4 pt-4 pb-2`,children:(0,N.jsx)(`h3`,{className:`text-xs font-heading font-black uppercase tracking-wider text-primary`,children:e.label})}),(0,N.jsx)(`div`,{className:`px-4 pb-4`,children:(0,N.jsx)(T,{league:e.league,minimal:!0})})]},e.league))})]})}),e.length>0&&(0,N.jsx)(`section`,{className:`py-12`,children:(0,N.jsxs)(`div`,{className:`container`,children:[(0,N.jsxs)(`h2`,{className:`text-2xl md:text-3xl font-heading font-black text-foreground uppercase mb-8`,children:[`Latest `,(0,N.jsx)(`span`,{className:`text-primary`,children:`Articles`})]}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6`,children:e.map(e=>(0,N.jsx)(S,{article:e},e.id))})]})}),(0,N.jsx)(`section`,{className:`py-8 bg-muted/30 border-y border-border`,children:(0,N.jsxs)(`div`,{className:`container`,children:[(0,N.jsxs)(`h2`,{className:`flex items-center justify-center gap-2 text-xl md:text-2xl font-heading font-black text-foreground uppercase mb-6`,children:[(0,N.jsx)(g,{className:`h-5 w-5 text-primary`}),`Latest `,(0,N.jsx)(`span`,{className:`text-primary`,children:`Tweets`})]}),n?(0,N.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6`,children:[...[,,,,]].map((e,t)=>(0,N.jsx)(C,{className:`h-48 w-full rounded-lg`},t))}):r.length>0?(0,N.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6`,children:r.map(e=>{let t=e.media?.length>0?e.media[0]:null;return(0,N.jsx)(`a`,{href:`https://x.com/pieandbov/status/${e.id}`,target:`_blank`,rel:`noopener noreferrer`,className:`block h-full`,children:(0,N.jsxs)(x,{className:`h-full hover:border-primary/50 transition-colors overflow-hidden`,children:[t?.url&&(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(`img`,{src:t.url,alt:``,className:`w-full h-40 object-cover`,loading:`lazy`}),(t.type===`video`||t.type===`animated_gif`)&&(0,N.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/30`,children:(0,N.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-primary flex items-center justify-center`,children:(0,N.jsx)(`svg`,{className:`w-4 h-4 text-primary-foreground ml-0.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,N.jsx)(`path`,{d:`M8 5v14l11-7z`})})})})]}),(0,N.jsxs)(b,{className:`p-4 flex flex-col justify-between flex-1`,children:[(0,N.jsx)(`p`,{className:`text-sm leading-relaxed line-clamp-4`,children:e.text}),(0,N.jsxs)(`div`,{className:`mt-3 flex items-center justify-between text-xs text-muted-foreground pt-2 border-t border-border`,children:[(0,N.jsx)(`span`,{children:new Date(e.created_at).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`})}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsxs)(`span`,{children:[`â»ï¸ `,e.retweets]}),(0,N.jsxs)(`span`,{children:[`â¤ï¸ `,e.likes]})]})]})]})]})},e.id)})}):null]})}),(0,N.jsx)(m,{})]})};export{q as component};
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.