1import{ab as C,b4 as I,w as k,j as l,r as T,z as D,B,C as E,I as G}from"./index-BO6Ka_k5.js";import{T as U}from"./TeamForm-CdzLOhfO.js";import{b as $,t as w,r as z,a as A}from"./embedded-article-sections.tools-Bdvdlk7v.js";import{E as N}from"./EmbeddedSectionEmpty-ChKCwdKg.js";import{u as R,a as j}from"./ArticleHtmlRenderer-CQxpH-c-.js";import{u as q}from"./useEmbeddedSiteTeams-Bhz3obOy.js";import"./SeasonStats-BjV1nSC5.js";import"./TeamNameIcon-DlkAhuz7.js";import"./index-U3FaD8rQ.js";import"./legacy-style-scoping-DLBkiVNm.js";import"./useListAdSlots-C7nMdGEr.js";const x=C({name:"EmbeddedTeamFormSection",components:{TeamForm:U,EmbeddedSectionEmpty:N},setup(){const o=I(),{sectionConfig:d}=R(),{resolvedPayload:v}=j(),{embeddedSiteTeams:h}=q(),s=T([]),r=T(null);let i=0;const u=l(()=>A(v.value)),b=l(()=>{var t,m;const e=(t=u.value)==null?void 0:t.teamUuid,a=typeof((m=d.value)==null?void 0:m.teamUuid)=="string"?d.value.teamUuid.trim():"";return e||a});return k([u,b],async([e,a])=>{var F,S,p,_,g;const t=++i,m=(((F=e==null?void 0:e.playedGames)==null?void 0:F.length)??0)>0,c=(((p=(S=e==null?void 0:e.stats)==null?void 0:S.fieldStats)==null?void 0:p.length)??0)>0||(((g=(_=e==null?void 0:e.stats)==null?void 0:_.barFieldStats)==null?void 0:g.length)??0)>0;if(m&&c){s.value=[],r.value=null;return}if(m||(s.value=[]),c||(r.value=null),!!a)try{const f=[];m||f.push(o.getPlayedGamesByTeamId(a).then(n=>{if(t!==i)return;const P=(e==null?void 0:e.lastN)??5;s.value=((n==null?void 0:n.playedGames)??[]).slice(0,P)})),c||f.push(o.getSingleGameForm(a).then(n=>{t===i&&(r.value=(n==null?void 0:n.stats)??null)})),await Promise.all(f)}catch{t===i&&(m||(s.value=[]),c||(r.value=null))}},{immediate:!0}),{teamFormBind:l(()=>{const e=b.value;if(!e)return null;const a=u.value,t=$(a,s.value,r.value);if(!w(t))return null;const m=z(e,h.value,t.playedGames);return m?{teamInfo:m,formData:t}:null})}}});function y(o,d,v,h,s,r){const i=B("team-form"),u=B("embedded-section-empty");return o.teamFormBind?(E(),G(i,{key:0,"team-info":o.teamFormBind.teamInfo,"form-data":o.teamFormBind.formData},null,8,["team-info","form-data"])):(E(),G(u,{key:1}))}const ee=D(x,[["render",y]]);export{ee 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.