let t=-1,e="x",n="",r="white",i=-1,o="";async function l(t){const e=`/r/blockhash/${t}`,n=await fetch(e);if(!n.ok){if(404===n.status)return null;throw new Error("Invalid response")}return await n.json()}function c(){return fetch("/r/blockheight").then((t=>{if(!t.ok)throw new Error("Invalid response");return t.json()})).catch((t=>{console.error("Error fetching block height:",t)}))}async function f(){const t=await c();t!=i&&(i=t,o=await l(i),currentAlignment=o.toLowerCase().charAt(o.length-1),r=currentAlignment==n?"#FF9900":"white",h=!0)}let h=!0;var a=document.getElementById("R"),u=a.getContext("2d"),s="ᚠᚢᚦᚨᚱᚲᚺᚹᚷᛞᛟᚾᛁᛏᛃᛒᛈᛖᛇᛗᛉᛚᛊᛜ",w="012345678889a9b9c9ddeeff",d=800;a.width=d+d/5,a.height=d+d/5,u.textAlign="center",u.textBaseline="middle",u.fillStyle="white",u.lineWidth=3,u.strokeStyle="white";var x=d/8,g=d/x,m=[];function y(){m=[];for(let t=0;t{u.fillText(t.rune,t.x+d/10+x/2,t.y+d/15+x/2)}))}function k(){u.font="bold 60px 'Courier New', Courier, monospace",u.fillStyle="white",u.fillText("RSIC",d/5,d+d/8),u.fillText(t,(d+d/5)/2,d+d/8),u.fillStyle=r,u.fillText(e,d+d/20,d+d/8),u.fillStyle="white"}function p(){m.forEach((t=>{t.rune=C()})),h=!0}function b(){setTimeout((()=>{p(),b(),f()}),1e3)}function A(){h&&(u.clearRect(0,0,a.width,a.height),S(),k(),h=!1),requestAnimationFrame(A)}function E(r,i){t=r,e=i,n=w.charAt(s.indexOf(e)),y(),b(),A()}