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