"use strict";(()=>{var e={};e.id=5071,e.ids=[5071],e.modules={20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46861:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>x,patchFetch:()=>v,requestAsyncStorage:()=>c,routeModule:()=>M,serverHooks:()=>f,staticGenerationAsyncStorage:()=>D});var s={};a.r(s),a.d(s,{GET:()=>h});var r=a(49303),i=a(88716),n=a(60670),o=a(87070);let u=process.env.API_FOOTBALL_KEY||"",p=process.env.API_FOOTBALL_URL||"https://v3.football.api-sports.io",l=new Map,d=["4-3-3","4-4-2","4-2-3-1","3-5-2","5-3-2","4-1-4-1","4-5-1"],m={"4-3-3":["G","D","D","D","D","M","M","M","F","F","F"],"4-4-2":["G","D","D","D","D","M","M","M","M","F","F"],"4-2-3-1":["G","D","D","D","D","M","M","M","M","M","F"],"3-5-2":["G","D","D","D","M","M","M","M","M","F","F"],"5-3-2":["G","D","D","D","D","D","M","M","M","F","F"],"4-1-4-1":["G","D","D","D","D","M","M","M","M","M","F"],"4-5-1":["G","D","D","D","D","M","M","M","M","M","F"]},g={G:"Kiper",D:"Bek",M:"Gelandang",F:"Penyerang"};async function h(e,{params:t}){let{id:a}=await t,{searchParams:s}=new URL(e.url),r=parseInt(s.get("homeId")||"1"),i=parseInt(s.get("awayId")||"2"),n=s.get("homeNama")||void 0,h=s.get("awayNama")||void 0,M=s.get("homeLogo")||void 0,c=s.get("awayLogo")||void 0,D=s.get("status")||"upcoming",f=l.get(a);if(f&&Date.now()-f.ts<9e5)return o.NextResponse.json({sukses:!0,data:f.data,dariCache:!0});if(u)try{let e=await fetch(`${p}/fixtures/lineups?fixture=${a}`,{headers:{"x-apisports-key":u},next:{revalidate:900}});if(e.ok){let t=(await e.json()).response||[];if(t.length>0)return l.set(a,{data:t,ts:Date.now()}),o.NextResponse.json({sukses:!0,data:t,dariCache:!1})}else console.warn(`Lineups API returned ${e.status} for fixture ${a}`)}catch(e){console.warn("Lineups API error:",e)}if(!("live"===D||"finished"===D))return o.NextResponse.json({sukses:!0,data:[],dariCache:!1,sumber:"unavailable"});let x=function(e,t,a,s,r,i,n){let o=e.split("").reduce((e,t)=>e+t.charCodeAt(0),0),u=e=>Math.abs(o*(e+1)*7919%100),p=d[u(1)%d.length],l=d[u(2)%d.length],h=m[p]||m["4-3-3"],M=m[l]||m["4-3-3"],c=(e,t,a,s)=>({startXI:e.map((e,r)=>({player:{id:100*t+r,name:`${g[e]||e} ${a} ${r+1}`,number:s[r],pos:e,grid:null}})),substitutes:Array.from({length:7},(e,r)=>{let i=["G","D","D","M","M","F","F"][r];return{player:{id:100*t+11+r,name:`Cadangan ${a} ${r+1}`,number:s[11+r]??12+r,pos:i,grid:null}}})}),D=Array.from({length:18},(e,t)=>t+1),f=Array.from({length:18},(e,t)=>t+1),x=c(h,t,s?.split(" ")[0]||"Kandang",D),v=c(M,a,r?.split(" ")[0]||"Tandang",f);return[{team:{id:t,name:s||`Tim ${t}`,logo:i||`https://media.api-sports.io/football/teams/${t}.png`},coach:{id:10*t,name:`Pelatih ${s?.split(" ")[0]||"Kandang"}`,photo:null},formation:p,startXI:x.startXI,substitutes:x.substitutes},{team:{id:a,name:r||`Tim ${a}`,logo:n||`https://media.api-sports.io/football/teams/${a}.png`},coach:{id:10*a,name:`Pelatih ${r?.split(" ")[0]||"Tandang"}`,photo:null},formation:l,startXI:v.startXI,substitutes:v.substitutes}]}(a,r,i,n,h,M,c);return l.set(a,{data:x,ts:Date.now()}),o.NextResponse.json({sukses:!0,data:x,dariCache:!1,sumber:"estimasi"})}let M=new r.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/fixtures/[id]/lineups/route",pathname:"/api/fixtures/[id]/lineups",filename:"route",bundlePath:"app/api/fixtures/[id]/lineups/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\fixtures\\[id]\\lineups\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:c,staticGenerationAsyncStorage:D,serverHooks:f}=M,x="/api/fixtures/[id]/lineups/route";function v(){return(0,n.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:D})}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),s=t.X(0,[9276,5972],()=>a(46861));module.exports=s})();