import{I as c,o as x,t as F}from"./chunk-ULPRULB6.js";import{$ as p,J as l,O as A,W as e,aa as m,g as _,l as I,m as h}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var y=[e.VK_DELETE,e.VK_ENTER,e.VK_RIGHT,e.VK_F7,e.VK_F1,e.VK_F3,e.VK_F5,e.VK_DOWN,e.VK_3,e.VK_W,e.VK_A,e.VK_4,e.VK_Z,e.VK_S,e.VK_E,e.VK_SHIFT,e.VK_5,e.VK_R,e.VK_D,e.VK_6,e.VK_C,e.VK_F,e.VK_T,e.VK_X,e.VK_7,e.VK_Y,e.VK_G,e.VK_8,e.VK_B,e.VK_H,e.VK_U,e.VK_V,e.VK_9,e.VK_I,e.VK_J,e.VK_0,e.VK_M,e.VK_K,e.VK_O,e.VK_N,null,e.VK_P,e.VK_L,e.VK_MINUS,e.VK_PERIOD,null,null,e.VK_COMMA,null,null,e.VK_SEMICOLON,e.VK_HOME,e.VK_SHIFT,e.VK_EQUALS,e.VK_TILDE,e.VK_SLASH,e.VK_1,e.VK_LEFT,e.VK_CONTROL,e.VK_2,e.VK_SPACE,e.VK_ALT,e.VK_Q,null],a=0,u=class{constructor(){this.regs=new Uint8Array(16);this.ina=0;this.inb=0}read(r){return this.regs[r]}write(r,t){this.regs[r]=t}input_a(){return this.ina&~this.regs[1]}input_b(){return this.inb&~this.regs[1]}output_a(){return this.regs[0]^255|this.regs[1]}output_b(){return this.regs[2]^255|this.regs[3]}},f=class extends x{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=4096;this.cpu=new F;this.ram=new Uint8Array(6144);this.rriot1=new u;this.rriot2=new u;this.digits=[];this.read=m([[5888,5951,15,r=>this.readIO_1(r)],[5952,6015,15,r=>this.readIO_2(r)],[0,6143,8191,r=>this.ram[r]],[6144,8191,2047,r=>this.bios[r]]],{gmask:8191});this.write=m([[5888,5951,15,(r,t)=>this.writeIO_1(r,t)],[5952,6015,15,(r,t)=>this.writeIO_2(r,t)],[0,6143,8191,(r,t)=>{this.ram[r]=t}]],{gmask:8191});this.bios=new I().decode(h(atob(B))),this.connectCPUMemoryBus(this)}readConst(r){return this.read(r)}readIO_1(r){return this.rriot1.read(r)}writeIO_1(r,t){this.rriot1.write(r,t)}readIO_2(r){switch(r&15){case 0:let t=0;for(let i=0;i<8;i++)(this.rriot2.regs[0]&1<>3,K=o&7;i&A.KeyDown?this.inputs[a+n]|=1<