const fs=require("fs"),vm=require("vm");const c={console,window:{}};c.window=c;vm.createContext(c);vm.runInContext(fs.readFileSync(__dirname+"/data.js","utf8")+";globalThis.D=FOOTBALL_DATA;",c);vm.runInContext(fs.readFileSync(__dirname+"/tournaments.js","utf8")+";globalThis.T=FOOTBALL_TOURNAMENTS;",c);const D=c.D,T=c.T;function A(x,m){if(!x)throw Error(m)}const wc=T.find(x=>x.id==="worldcup"),eu=T.find(x=>x.id==="euro");A(wc.teams.length===48,"wc teams");A(new Set(wc.teams).size===48,"wc dup");let total=0;for(const id of wc.teams){const ps=D.players.filter(p=>p.clubId===id);A(ps.length===26,id+" "+ps.length);A(ps.filter(p=>p.pos==="GK").length>=3,id+" keepers");A(ps.every(p=>p.officialWorldCup2026),id+" official flag");total+=ps.length}A(total===1248,"total "+total);A(eu.teams.length===24,"euro 24");const barca=D.clubs.find(c=>c.id==="NT_ESP");A(barca&&D.players.filter(p=>p.clubId==="NT_ESP").some(p=>/Yamal/i.test(p.name)),"Spain Yamal");console.log(JSON.stringify({worldTeams:48,officialPlayers:1248,euroTeams:24,matched:847,created:401}));