'}
function makeBase(u){return u.slice(0,u.lastIndexOf('/')+1)}
function hideStatus(){if(status.classList.contains('hide'))return;status.classList.add('hide');setTimeout(()=>status.remove(),250)}
function showError(message){statusText.textContent=message||'Could not start this game.';status.querySelector('.status-icon').style.display='none';retry.style.display='inline-block'}
retry.onclick=()=>location.reload();
const startupTimer=setTimeout(hideStatus,3500);
async function load(){const p=new URLSearchParams(location.search).get('game');if(!p)throw Error('No game selected');const cached=read(RES+norm(p));let g={path:p,name:slug(p)},s=cached||fastKnown(g);if(!s)s=await ownEntry(g);if(!s){g=await metadata(p);s=fastKnown(g)||await ownEntry(g)||await externalEntry(g)}write(RES+norm(p),s);const u='(s.url||AITHER_GAMES+String(s.p).replace(/^games\//,'')),dir=makeBase(u),hk=HTML+u;statusText.textContent='Loading '+g.name+'…';let h=null,cachedHtml=read(hk);if(cachedHtml&&cachedHtml.h)h=cachedHtml.h;if(!h){const r=await fetch(u,{cache:'force-cache'});if(!r.ok)throw Error('CDN HTTP '+r.status);h=await r.text();write(hk,{h,t:Date.now()})}h=h.replace(/]*>/gi,'');const base='';h=/]*>/i.test(h)?h.replace(/]*)>/i,''+base):''+base+''+h+'';if(s.o==='bubbls'&&s.r==='UGS-Assets'&&/gdlite/i.test(s.p)){const mg=merger(dir+'Build/');const re=/