import{g as z,_ as G}from"./Bl513c_1.js";import{L as K,v as Q,r as s,l as R,B as V,h as L,U as m,C as D,D as M,N as B,F as W,J as X,E as Y,f as v}from"./DPgXI4tH.js";import{u as Z}from"./BH8rPo4a.js";import{u as $}from"./DXqxfzbq.js";const j={class:"flex flex-col items-center justify-center flex-shrink-0 gap-4 lg:flex-row"},tt={class:"flex flex-col items-start gap-4 mt-2"},ut=K({name:"NextLiveMatchHero",__name:"index",async setup(at){let f,x;const{openPlayerModal:et}=Z(),i=([f,x]=Q(()=>$()),f=await f,x(),f),l=s(null),t=s(null),c=s(null),u=s(!0),n=s(),E=s(),F=s(),H=s(),p=R().public.club.features.streamline;V(()=>{J()});const J=()=>p?U():P(),P=()=>{if(t.value=i==null?void 0:i[0],!t.value)return u.value=!1,void(n.value="no-fixture");c.value=t.value.attributes.streamamgData.assetData,u.value=!1,n.value="other"},U=()=>{var a,r,e,o,b,d,y,I,g,A,O,S,T,_,w,N,k;if(t.value=i==null?void 0:i.find(h=>{var C;return(h.attributes.streamlineData.streamType==="match"||h.attributes.streamlineData.streamType==="other")&&((C=h.attributes)==null?void 0:C.type)==="streamline"}),!t.value)return u.value=!1,void(n.value="no-fixture");t.value.attributes.streamlineData.streamType=="match"?(l.value=(a=t.value.relationships)==null?void 0:a.match[0],c.value=t.value.attributes.streamlineData.assetData,E.value=(o=(e=(r=l.value)==null?void 0:r.attributes)==null?void 0:e.teamData)==null?void 0:o[0],F.value=(y=(d=(b=l.value)==null?void 0:b.attributes)==null?void 0:d.teamData)==null?void 0:y[1],H.value={name:(I=l.value)==null?void 0:I.competitionName,icons:(O=(A=(g=l.value)==null?void 0:g.attributes)==null?void 0:A.competitionCrests)==null?void 0:O.competitionIcons},u.value=!1,n.value="fixture"):((_=(T=(S=t.value)==null?void 0:S.attributes)==null?void 0:T.streamlineData)==null?void 0:_.streamType)=="other"&&(c.value=(k=(N=(w=t.value)==null?void 0:w.attributes)==null?void 0:N.streamlineData)==null?void 0:k.assetData,u.value=!1,n.value="other")};L(()=>{const a=m.now();let r,e;return p?(e=m.fromISO(t.value.attributes.startAt).minus({minutes:z()}),r=m.fromISO(t.value.attributes.finishAt)):(e=m.fromISO(t.value.attributes.offset),r=m.fromISO(t.value.attributes.finishAt)),a>e&&a<r});const q=L(()=>{var a;if(p)return(a=t.value.relationships)==null?void 0:a.streamline});return(a,r)=>{const e=G;return D(),M("div",null,[B("div",j,[B("div",tt,[(D(!0),M(W,null,X(v(c),(o,b)=>(D(),Y(e,{key:o.assetID,asset:o,relationships:v(q),"finish-at":v(t).attributes.finishAt,"start-at":v(t).attributes.startAt,offset:v(t).attributes.offset},null,8,["asset","relationships","finish-at","start-at","offset"]))),128))])])])}}});export{ut as _};