rdElement?A:t.keyboardElement;if(g){let e=e=>{let a,o="keydown"==e.type;switch(e.code){case"ArrowUp":a=1;break;case"ArrowDown":a=2;break;case"ArrowLeft":a=4;break;case"ArrowRight":a=8;break;case"KeyZ":a=16;break;case"KeyX":a=32;break;case"KeyA":a=64;break;case"KeyS":a=128;break;case"KeyR":o&&f(n,!0);break;case"F9":o&&A.toBlob((e=>{Q(e,".png")})),e.preventDefault();break;case"F10":o&&function(){if(r)return r.stop(),void(r=null);r=new MediaRecorder(A.captureStream(),{mimeType:"video/webm",videoBitsPerSecond:2