window.StudioRuntime=(function(){

const widgets={};

let started=false;

async function tick(){

const keys=
Object.keys(
widgets
);

if(
!keys.length
)
return;

try{

const r=
await fetch(

'/easychair/admin/studio/runtime?widgets='
+
encodeURIComponent(
keys.join(',')
)

);

const payload=
await r.json();

keys.forEach(

k=>{

if(
widgets[k]
&&
payload[k]
){

widgets[k](
payload[k]
);

}

}

);

}catch(e){

console.error(
e
);

}

}

function register(
id,
renderer
){

widgets[
id
]=renderer;

if(
!started
){

started=true;

tick();

setInterval(
tick,
30000
);

}

}

return{

register

};

})();
