e,r){switch(!0){case r.isBlockDevice():return{filetype:1,rightsBase:ye,rightsInheriting:ye};case r.isCharacterDevice():return e!==void 0&&t.bindings.isTTY(e)?{filetype:2,rightsBase:cs,rightsInheriting:as}:{filetype:2,rightsBase:ye,rightsInheriting:ye};case r.isDirectory():return{filetype:3,rightsBase:Gr,rightsInheriting:bn};case r.isFIFO():return{filetype:6,rightsBase:ti,rightsInheriting:ye};case r.isFile():return{filetype:4,rightsBase:Qn,rightsInheriting:ls};case r.isSocket():return{filetype:6,rightsBase:ti,rightsInheriting:ye};case r.isSymbolicLink():return{filetype:7,rightsBase:T(0),rightsInheriting:T(0)};default:return{filetype:0,rightsBase:T(0),rightsInheriting:T(0)}}}var zr=function(t){function e(r){var n=t.call(this)||this;return n.errno=r,Object.setPrototypeOf(n,e.prototype),n}return Rr(e,t),e}(Error),oi=function(t){function e(r){var n=t.call(this,"WASI Exit error: "+r)||this;return n.code=r,Object.setPrototypeOf(n,e.prototype),n}return Rr(e,t),e}(Error),gs=function(t){function e(r){var n=t.call(this,"WASI Kill signal: "+r)||this;return n.signal=r,Object.setPrototypeOf(n,e.prototype),n}return Rr(e,t),e}(Error),si=function(){function t(e){function r(v){switch(v){case 1:return a.hrtime();case 0:return bt(Date.now());case 2:case 3:return a.hrtime()-vt;default:return null}}function n(v,E){if(v=ni(s,v),E!==T(0)&&(v.rights.base&E)===T(0))throw new zr(63);return v}function i(v,E){return s.refreshMemory(),Array.from({length:E},function(A,I){return I=v+8*I,A=s.view.getUint32(I,!0),I=s.view.getUint32(I+4,!0),new Uint8Array(s.memory.buffer,A,I)})}var o,s=this,l={};e&&e.preopens?l=e.preopens:e&&e.preopenDirectories&&(l=e.preopenDirectories);var y={};e&&e.env&&(y=e.env);var p=[];e&&e.args&&(p=e.args);var a=Jn;e&&e.bindings&&(a=e.bindings),this.view=this.memory=void 0,this.bindings=a,this.FD_MAP=new Map([[0,{real:0,filetype:2,rights:{base:ys,inheriting:T(0)},path:void 0}],[1,{real:1,filetype:2,rights:{base:ri,inheriting:T(0)},path:void 0}],[2,{real:2,filetype:2,rights:{base:ri,inheriting:T(0)},path:void 0}]]);var g=this.bindings.fs,m=this.bindings.path;try{for(var w=Ge(Object.entries(l)),O=w.next();!O.done;O=w.next()){var L=ze(O.value,2),ht=L[0],mt=L[1],lt=g.openSync(mt,g.constants.O_RDONLY),rt=Ve(this.FD_MAP.keys()).reverse()[0]+1;this.FD_MAP.set(rt,{real:lt,filetype:3,rights:{base:Gr,inheriting:bn},fakePath:ht,path:mt})}}catch(v){var qt={error:v}}finally{try{O&&!O.done&&(o=w.return)&&o.call(w)}finally{if(qt)throw qt.error}}var vt=a.hrtime();this.wasiImport={args_get:function(v,E){s.refreshMemory();var A=v,I=E;return p.forEach(function(k){s.view.setUint32(A,I,!0),A+=4,I+=z.from(s.memory.buffer).write(k+"\0",I)}),0},args_sizes_get:function(v,E){return s.refreshMemory(),s.view.setUint32(v,p.length,!0),v=p.reduce(function(A,I){return A+z.byteLength(I)+1},0),s.view.setUint32(E,v,!0),0},environ_get:function(v,E){s.refreshMemory();var A=v,I=E;return Object.entries(y).forEach(function(k){var P=ze(k,2);k=P[0],P=P[1],s.view.setUint32(A,I,!0),A+=4,I+=z.from(s.memory.buffer).write(k+"="+P+"\0",I)}),0},environ_sizes_get:function(v,E){s.refreshMemory();var A=Object.entries(y).map(function(k){return k=ze(k,2),k[0]+"="+k[1]+"\0"}),I=A.reduce(function(k,P){return k+z.byteLength(P)},0);return s.view.setUint32(v,A.length,!0),s.view.setUint32(E,I,!0),0},clock_res_get:function(v,E){switch(v){case 1:case 2:case 3:var A=T(1);break;case 0:A=T(1e3)}return s.view.setBigUint64(E,A),0},clock_time_get:function(v,E,A){return s.refreshMemory(),v=r(v),v===null?28:(s.view.setBigUint64(A,T(v),!0),0)},fd_advise:j(function(v){return n(v,pe),52}),fd_allocate:j(function(v){return n(v,rr),52}),fd_close:j(function(v){var E=n(v,T(0));return g.closeSync(E.real),s.FD_MAP.delete(v),0}),fd_datasync:j(function(v){return v=n(v,Zt),g.fdatasyncSync(v.real),0}),fd_fdstat_get:j(function(v,E){return v=n(v,T(0)),s.refreshMemory(),s.view.setUint8(E,v.filetype),s.view.setUint16(E+2,0,!0),s.view.setUint16(E+4,0,!0),s.view.setBigUint64(E+8,T(v.rights.base),!0),s.view.setBigUint64(E+8+8,T(v.rights.inheriting),!0),0}),fd_fdstat_set_flags:j(function(v){return n(v,ae),52}),fd_fdstat_set_rights:j(function(v,E,A){return v=n(v,T(0)),(v.rights.base|E)>v.rights.base||(v.rights.inheriting|A)>v.rights.inheriting?63:(v.rights.base=E,v.rights.inheriting=A,0)}),fd_filestat_get:j(function(v,E){v=n(v,Yt);var A=g.fstatSync(v.real);return s.refreshMemory(),s.view.setBigUint64(E,T(A.dev),!0),E+=8,s.view.setBigUint64(E,T(A.ino),!0),E+=8,s.view.setUint8(E,v.filetype),E+=8,s.view.setBigUint64(E,T(A.nlink),!0),E+=8,s.view.setBigUint64(E,T(A.size),!0),E+=8,s.view.setBigUint64(E,bt(A.atimeMs),!0),E+=8,s.view.setBigUint64(E,bt(A.mtimeMs),!0),s.view.setBigUint64(E+8,bt(A.ctimeMs),!0),0}),fd_filestat_set_size:j(function(v,E){return v=n(v,or),g.ftruncateSync(v.real,Number(E)),0}),fd_filestat_set_times:j(function(v,E,A,I){v=n(v,sr);var k=g.fstatSync(v.real),P=k.atime;k=k.mtime;var B=ge(r(0));return(I&3)===3||(I&12)===12?28:((I&1)===1?P=ge(E):(I&2)===2&&(P=B),(I&4)===4?k=ge(A):(I&8)===8&&(k=B),g.futimesSync(v.real,new Date(P),new Date(k)),0)}),fd_prestat_get:j(function(v,E){return v=n(v,T(0)),v.path?(s.refreshMemory(),s.view.setUint8(E,0),s.view.setUint32(E+4,z.byteLength(v.fakePath),!0),0):28}),fd_prestat_dir_name:j(function(v,E,A){return v=n(v,T(0)),v.path?(s.refreshMemory(),z.from(s.memory.buffer).write(v.fakePath,E,A,"utf8"),0):28}),fd_pwrite:j(function(v,E,A,I,k){var P=n(v,jt|ce),B=0;return i(E,A).forEach(function(F){for(var C=0;C<F.byteLength;)C+=g.writeSync(P.real,F,C,F.byteLength-C,Number(I)+B+C);B+=C}),s.view.setUint32(k,B,!0),0}),fd_write:j(function(v,E,A,I){var k=n(v,jt),P=0;return i(E,A).forEach(function(B){for(var F=0;F<B.byteLength;){var C=g.writeSync(k.real,B,F,B.byteLength-F,k.offset?Number(k.offset):null);k.offset&&(k.offset+=T(C)),F+=C}P+=F}),s.view.setUint32(I,P,!0),0}),fd_pread:j(function(v,E,A,I,k){var P;v=n(v,Mt|ce);var B=0;try{var F=Ge(i(E,A)),C=F.next();t:for(;!C.done;C=F.next()){var M=C.value;for(E=0;E<M.byteLength;){var x=M.byteLength-E,$=g.readSync(v.real,M,E,M.byteLength-E,Number(I)+B+E);if(E+=$,B+=$,$===0||$<x)break t}B+=E}}catch(J){var X={error:J}}finally{try{C&&!C.done&&(P=F.return)&&P.call(F)}finally{if(X)throw X.error}}return s.view.setUint32(k,B,!0),0}),fd_read:j(function(v,E,A,I){var k;v=n(v,Mt);var P=v.real===0,B=0;try{var F=Ge(i(E,A)),C=F.next();t:for(;!C.done;C=F.next()){var M=C.value;for(E=0;E<M.byteLength;){var x=M.byteLength-E,$=g.readSync(v.real,M,E,x,P||v.offset===void 0?null:Number(v.offset));if(P||(v.offset=(v.offset?v.offset:T(0))+T($)),E+=$,B+=$,$===0||$<x)break t}}}catch(J){var X={error:J}}finally{try{C&&!C.done&&(k=F.return)&&k.call(F)}finally{if(X)throw X.error}}return s.view.setUint32(I,B,!0),0}),fd_readdir:j(function(v,E,A,I,k){v=n(v,ir),s.refreshMemory();var P=g.readdirSync(v.path,{withFileTypes:!0}),B=E;for(I=Number(I);I<P.length;I+=1){var F=P[I],C=z.byteLength(F.name);if(E-B>A||(s.view.setBigUint64(E,T(I+1),!0),E+=8,E-B>A))break;var M=g.statSync(m.resolve(v.path,F.name));if(s.view.setBigUint64(E,T(M.ino),!0),E+=8,E-B>A||(s.view.setUint32(E,C,!0),E+=4,E-B>A))break;switch(!0){case M.isBlockDevice():M=1;break;case M.isCharacterDevice():M=2;break;case M.isDirectory():M=3;break;case M.isFIFO():M=6;break;case M.isFile():M=4;break;case M.isSocket():M=6;break;case M.isSymbolicLink():M=7;break;default:M=0}if(s.view.setUint8(E,M),E+=1,E+=3,E+C>=B+A)break;z.from(s.memory.buffer).write(F.name,E),E+=C}return s.view.setUint32(k,Math.min(E-B,A),!0),0}),fd_renumber:j(function(v,E){return n(v,T(0)),n(E,T(0)),g.closeSync(s.FD_MAP.get(v).real),s.FD_MAP.set(v,s.FD_MAP.get(E)),s.FD_MAP.delete(E),0}),fd_seek:j(function(v,E,A,I){switch(v=n(v,ce),s.refreshMemory(),A){case 1:v.offset=(v.offset?v.offset:T(0))+T(E);break;case 2:A=g.fstatSync(v.real).size,v.offset=T(A)+T(E);break;case 0:v.offset=T(E)}return s.view.setBigUint64(I,v.offset,!0),0}),fd_tell:j(function(v,E){return v=n(v,kr),s.refreshMemory(),v.offset||(v.offset=T(0)),s.view.setBigUint64(E,v.offset,!0),0}),fd_sync:j(function(v){return v=n(v,xt),g.fsyncSync(v.real),0}),path_create_directory:j(function(v,E,A){return v=n(v,Pr),v.path?(s.refreshMemory(),E=z.from(s.memory.buffer,E,A).toString(),g.mkdirSync(m.resolve(v.path,E)),0):28}),path_filestat_get:j(function(v,E,A,I,k){return v=n(v,Mr),v.path?(s.refreshMemory(),A=z.from(s.memory.buffer,A,I).toString(),A=g.statSync(m.resolve(v.path,A)),s.view.setBigUint64(k,T(A.dev),!0),k+=8,s.view.setBigUint64(k,T(A.ino),!0),k+=8,s.view.setUint8(k,ii(s,void 0,A).filetype),k+=8,s.view.setBigUint64(k,T(A.nlink),!0),k+=8,s.view.setBigUint64(k,T(A.size),!0),k+=8,s.view.setBigUint64(k,bt(A.atimeMs),!0),k+=8,s.view.setBigUint64(k,bt(A.mtimeMs),!0),s.view.setBigUint64(k+8,bt(A.ctimeMs),!0),0):28}),path_filestat_set_times:j(function(v,E,A,I,k,P,B){if(v=n(v,jr),!v.path)return 28;s.refreshMemory();var F=g.fstatSync(v.real);E=F.atime,F=F.mtime;var C=ge(r(0));return(B&3)===3||(B&12)===12?28:((B&1)===1?E=ge(k):(B&2)===2&&(E=C),(B&4)===4?F=ge(P):(B&8)===8&&(F=C),A=z.from(s.memory.buffer,A,I).toString(),g.utimesSync(m.resolve(v.path,A),new Date(E),new Date(F)),0)}),path_link:j(function(v,E,A,I,k,P,B){return v=n(v,Cr),k=n(k,Br),!v.path||!k.path?28:(s.refreshMemory(),A=z.from(s.memory.buffer,A,I).toString(),P=z.from(s.memory.buffer,P,B).toString(),g.linkSync(m.resolve(v.path,A),m.resolve(k.path,P)),0)}),path_open:j(function(v,E,A,I,k,P,B,F,C){E=n(v,nr),P=T(P),B=T(B),v=(P&(Mt|ir))!==T(0);var M=(P&(Zt|jt|rr|or))!==T(0);if(M&&v)var x=g.constants.O_RDWR;else v?x=g.constants.O_RDONLY:M&&(x=g.constants.O_WRONLY);if(v=P|nr,P|=B,(k&1)!==0&&(x|=g.constants.O_CREAT,v|=Lr),(k&2)!==0&&(x|=g.constants.O_DIRECTORY),(k&4)!==0&&(x|=g.constants.O_EXCL),(k&8)!==0&&(x|=g.constants.O_TRUNC,v|=xr),(F&1)!==0&&(x|=g.constants.O_APPEND),(F&2)!==0&&(x=g.constants.O_DSYNC?x|g.constants.O_DSYNC:x|g.constants.O_SYNC,P|=Zt),(F&4)!==0&&(x|=g.constants.O_NONBLOCK),(F&8)!==0&&(x=g.constants.O_RSYNC?x|g.constants.O_RSYNC:x|g.constants.O_SYNC,P|=xt),(F&16)!==0&&(x|=g.constants.O_SYNC,P|=xt),M&&(x&(g.constants.O_APPEND|g.constants.O_TRUNC))===0&&(P|=ce),s.refreshMemory(),A=z.from(s.memory.buffer,A,I).toString(),A=m.resolve(E.path,A),m.relative(E.path,A).startsWith(".."))return 76;try{var $=g.realpathSync(A);if(m.relative(E.path,$).startsWith(".."))return 76}catch(J){if(J.code==="ENOENT")$=A;else throw J}try{var X=g.statSync($).isDirectory()}catch{}return x=!M&&X?g.openSync($,g.constants.O_RDONLY):g.openSync($,x),X=Ve(s.FD_MAP.keys()).reverse()[0]+1,s.FD_MAP.set(X,{real:x,filetype:void 0,rights:{base:v,inheriting:P},path:$}),ni(s,X),s.view.setUint32(C,X,!0),0}),path_readlink:j(function(v,E,A,I,k,P){return v=n(v,Fr),v.path?(s.refreshMemory(),E=z.from(s.memory.buffer,E,A).toString(),E=m.resolve(v.path,E),E=g.readlinkSync(E),I=z.from(s.memory.buffer).write(E,I,k),s.view.setUint32(P,I,!0),0):28}),path_remove_directory:j(function(v,E,A){return v=n(v,Wr),v.path?(s.refreshMemory(),E=z.from(s.memory.buffer,E,A).toString(),g.rmdirSync(m.resolve(v.path,E)),0):28}),path_rename:j(function(v,E,A,I,k,P){return v=n(v,Ur),I=n(I,Dr),!v.path||!I.path?28:(s.refreshMemory(),E=z.from(s.memory.buffer,E,A).toString(),k=z.from(s.memory.buffer,k,P).toString(),g.renameSync(m.resolve(v.path,E),m.resolve(I.path,k)),0)}),path_symlink:j(function(v,E,A,I,k){return A=n(A,Yr),A.path?(s.refreshMemory(),v=z.from(s.memory.buffer,v,E).toString(),I=z.from(s.memory.buffer,I,k).toString(),g.symlinkSync(v,m.resolve(A.path,I)),0):28}),path_unlink_file:j(function(v,E,A){return v=n(v,$r),v.path?(s.refreshMemory(),E=z.from(s.memory.buffer,E,A).toString(),g.unlinkSync(m.resolve(v.path,E)),0):28}),poll_oneoff:function(v,E,A,I){var k=0,P=0;s.refreshMemory();for(var B=0;B<A;B+=1){var F=s.view.getBigUint64(v,!0);v+=8;var C=s.view.getUint8(v);switch(v+=1,C){case 0:v+=7,s.view.getBigUint64(v,!0),v+=8;var M=s.view.getUint32(v,!0);v+=4,v+=4,C=s.view.getBigUint64(v,!0),v+=8,s.view.getBigUint64(v,!0),v+=8;var x=s.view.getUint16(v,!0);v+=2,v+=6;var $=x===1;x=0,M=T(r(M)),M===null?x=28:(C=$?C:M+C,P=C>P?C:P),s.view.setBigUint64(E,F,!0),E+=8,s.view.setUint16(E,x,!0),E+=2,s.view.setUint8(E,0),E+=1,E+=5,k+=1;break;case 1:case 2:v+=3,s.view.getUint32(v,!0),v+=4,s.view.setBigUint64(E,F,!0),E+=8,s.view.setUint16(E,52,!0),E+=2,s.view.setUint8(E,C),E+=1,E+=5,k+=1;break;default:return 28}}for(s.view.setUint32(I,k,!0);a.hrtime()<P;);return 0},proc_exit:function(v){return a.exit(v),0},proc_raise:function(v){return v in ei?(a.kill(ei[v]),0):28},random_get:function(v,E){return s.refreshMemory(),a.randomFillSync(new Uint8Array(s.memory.buffer),v,E),0},sched_yield:function(){return 0},sock_recv:function(){return 52},sock_send:function(){return 52},sock_shutdown:function(){return 52}},e.traceSyscalls&&Object.keys(this.wasiImport).forEach(function(v){var E=s.wasiImport[v];s.wasiImport[v]=function(){for(var A=[],I=0;I<arguments.length;I++)A[I]=arguments[I];console.log("WASI: wasiImport called: "+v+" ("+A+")");try{var k=E.apply(void 0,Ve(A));return console.log("WASI:  => "+k),k}catch(P){throw console.log("Catched error: "+P),P}}})}return t.prototype.refreshMemory=function(){this.view&&this.view.buffer.byteLength!==0||(this.view=new qe(this.memory.buffer))},t.prototype.setMemory=function(e){this.memory=e},t.prototype.start=function(e){if(e=e.exports,e===null||typeof e!="object")throw Error("instance.exports must be an Object. Received "+e+".");var r=e.memory;if(!(r instanceof WebAssembly.Memory))throw Error("instance.exports.memory must be a WebAssembly.Memory. Recceived "+r+".");this.setMemory(r),e._start&&e._start()},t.prototype.getImportNamespace=function(e){var r,n=null;try{for(var i=Ge(WebAssembly.Module.imports(e)),o=i.next();!o.done;o=i.next()){var s=o.value;if(s.kind==="function"&&s.module.startsWith("wasi_")){if(!n)n=s.module;else if(n!==s.module)throw Error("Multiple namespaces detected.")}}}catch(y){var l={error:y}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(l)throw l.error}}return n},t.prototype.getImports=function(e){switch(this.getImportNamespace(e)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw Error("Can't detect a WASI namespace for the WebAssembly Module")}},t.defaultBindings=Jn,t}();function ds(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Vr,ui;function ms(){if(ui)return Vr;ui=1;function t(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function e(i,o){for(var s="",l=0,y=-1,p=0,a,g=0;g<=i.length;++g){if(g<i.length)a=i.charCodeAt(g);else{if(a===47)break;a=47}if(a===47){if(!(y===g-1||p===1))if(y!==g-1&&p===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",l=0):(s=s.slice(0,m),l=s.length-1-s.lastIndexOf("/")),y=g,p=0;continue}}else if(s.length===2||s.length===1){s="",l=0,y=g,p=0;continue}}o&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+i.slice(y+1,g):s=i.slice(y+1,g),l=g-y-1;y=g,p=0}else a===46&&p!==-1?++p:p=-1}return s}function r(i,o){var s=o.dir||o.root,l=o.base||(o.name||"")+(o.ext||"");return s?s===o.root?s+l:s+i+l:l}var n={resolve:function(){for(var o="",s=!1,l,y=arguments.length-1;y>=-1&&!s;y--){var p;y>=0?p=arguments[y]:(l===void 0&&(l=process.cwd()),p=l),t(p),p.length!==0&&(o=p+"/"+o,s=p.charCodeAt(0)===47)}return o=e(o,!s),s?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(t(o),o.length===0)return".";var s=o.charCodeAt(0)===47,l=o.charCodeAt(o.length-1)===47;return o=e(o,!s),o.length===0&&!s&&(o="."),o.length>0&&l&&(o+="/"),s?"/"+o:o},isAbsolute:function(o){return t(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,s=0;s<arguments.length;++s){var l=arguments[s];t(l),l.length>0&&(o===void 0?o=l:o+="/"+l)}return o===void 0?".":n.normalize(o)},relative:function(o,s){if(t(o),t(s),o===s||(o=n.resolve(o),s=n.resolve(s),o===s))return"";for(var l=1;l<o.length&&o.charCodeAt(l)===47;++l);for(var y=o.length,p=y-l,a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var g=s.length,m=g-a,w=p<m?p:m,O=-1,L=0;L<=w;++L){if(L===w){if(m>w){if(s.charCodeAt(a+L)===47)return s.slice(a+L+1);if(L===0)return s.slice(a+L)}else p>w&&(o.charCodeAt(l+L)===47?O=L:L===0&&(O=0));break}var ht=o.charCodeAt(l+L),mt=s.charCodeAt(a+L);if(ht!==mt)break;ht===47&&(O=L)}var lt="";for(L=l+O+1;L<=y;++L)(L===y||o.charCodeAt(L)===47)&&(lt.length===0?lt+="..":lt+="/..");return lt.length>0?lt+s.slice(a+O):(a+=O,s.charCodeAt(a)===47&&++a,s.slice(a))},_makeLong:function(o){return o},dirname:function(o){if(t(o),o.length===0)return".";for(var s=o.charCodeAt(0),l=s===47,y=-1,p=!0,a=o.length-1;a>=1;--a)if(s=o.charCodeAt(a),s===47){if(!p){y=a;break}}else p=!1;return y===-1?l?"/":".":l&&y===1?"//":o.slice(0,y)},basename:function(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');t(o);var l=0,y=-1,p=!0,a;if(s!==void 0&&s.length>0&&s.length<=o.length){if(s.length===o.length&&s===o)return"";var g=s.length-1,m=-1;for(a=o.length-1;a>=0;--a){var w=o.charCodeAt(a);if(w===47){if(!p){l=a+1;break}}else m===-1&&(p=!1,m=a+1),g>=0&&(w===s.charCodeAt(g)?--g===-1&&(y=a):(g=-1,y=m))}return l===y?y=m:y===-1&&(y=o.length),o.slice(l,y)}else{for(a=o.length-1;a>=0;--a)if(o.charCodeAt(a)===47){if(!p){l=a+1;break}}else y===-1&&(p=!1,y=a+1);return y===-1?"":o.slice(l,y)}},extname:function(o){t(o);for(var s=-1,l=0,y=-1,p=!0,a=0,g=o.length-1;g>=0;--g){var m=o.charCodeAt(g);if(m===47){if(!p){l=g+1;break}continue}y===-1&&(p=!1,y=g+1),m===46?s===-1?s=g:a!==1&&(a=1):s!==-1&&(a=-1)}return s===-1||y===-1||a===0||a===1&&s===y-1&&s===l+1?"":o.slice(s,y)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return r("/",o)},parse:function(o){t(o);var s={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return s;var l=o.charCodeAt(0),y=l===47,p;y?(s.root="/",p=1):p=0;for(var a=-1,g=0,m=-1,w=!0,O=o.length-1,L=0;O>=p;--O){if(l=o.charCodeAt(O),l===47){if(!w){g=O+1;break}continue}m===-1&&(w=!1,m=O+1),l===46?a===-1?a=O:L!==1&&(L=1):a!==-1&&(L=-1)}return a===-1||m===-1||L===0||L===1&&a===m-1&&a===g+1?m!==-1&&(g===0&&y?s.base=s.name=o.slice(1,m):s.base=s.name=o.slice(g,m)):(g===0&&y?(s.name=o.slice(1,a),s.base=o.slice(1,m)):(s.name=o.slice(g,a),s.base=o.slice(g,m)),s.ext=o.slice(a,m)),g>0?s.dir=o.slice(0,g-1):y&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,Vr=n,Vr}var vs=ms(),fi=ds(vs);class ws{constructor(e,r,n){this.wasmFs=e;const i=n.PWD||"/";this.wasi=new si({args:r,env:n,bindings:{...si.defaultBindings,fs:this.wasmFs.fs,path:fi},preopens:{"/":"/",".":i}}),this.imports={wasi_snapshot_preview1:this.wasi.wasiImport}}async runWasiEntry(e){const r=await this.loadWasm(e);this.wasi.start(r)}async loadWasm(e){const r=this.wasmFs.fs.readFileSync(e);if(r==null)throw"File not found";const i=(await WebAssembly.instantiate(r.buffer,this.imports)).instance;return i.exports.memory&&(this.memory=i.exports.memory,this.wasi.setMemory(this.memory)),i}}function Es(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(p){try{y(n.next(p))}catch(a){o(a)}}function l(p){try{y(n.throw(p))}catch(a){o(a)}}function y(p){p.done?i(p.value):new r(function(a){a(p.value)}).then(s,l)}y((n=n.apply(t,[])).next())})}function _s(t,e){function r(p){return function(a){return n([p,a])}}function n(p){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=0<l.length&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3]))i.label=p[1];else if(p[0]===6&&i.label<l[1])i.label=l[1],l=p;else if(l&&i.label<l[2])i.label=l[2],i.ops.push(p);else{l[2]&&i.ops.pop(),i.trys.pop();continue}}p=e.call(t,i)}catch(a){p=[6,a],s=0}finally{o=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},o,s,l,y;return y={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y}function qr(t){var e=typeof Symbol=="function"&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function Ss(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(e===void 0||0<e--)&&!(n=t.next()).done;)i.push(n.value)}catch(s){var o={error:s}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return i}function Rs(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ss(arguments[e]));return t}var H=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function et(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function b(t,e){return e={exports:{}},t(e,e.exports),e.exports}var U=b(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});et(U);var As=b(function(t,e){e.default=typeof BigInt=="function"?BigInt:function(){throw Error("BigInt is not supported in this environment.")}}),de=b(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=U.constants.S_IFMT,n=U.constants.S_IFDIR,i=U.constants.S_IFREG,o=U.constants.S_IFBLK,s=U.constants.S_IFCHR,l=U.constants.S_IFLNK,y=U.constants.S_IFIFO,p=U.constants.S_IFSOCK;t=function(){function a(){}return a.build=function(g,m){m===void 0&&(m=!1);var w=new a,O=g.gid,L=g.atime,ht=g.mtime,mt=g.ctime;return m=m?As.default:function(lt){return lt},w.uid=m(g.uid),w.gid=m(O),w.rdev=m(0),w.blksize=m(4096),w.ino=m(g.ino),w.size=m(g.getSize()),w.blocks=m(1),w.atime=L,w.mtime=ht,w.ctime=mt,w.birthtime=mt,w.atimeMs=m(L.getTime()),w.mtimeMs=m(ht.getTime()),O=m(mt.getTime()),w.ctimeMs=O,w.birthtimeMs=O,w.dev=m(0),w.mode=m(g.mode),w.nlink=m(g.nlink),w},a.prototype._checkModeProperty=function(g){return(Number(this.mode)&r)===g},a.prototype.isDirectory=function(){return this._checkModeProperty(n)},a.prototype.isFile=function(){return this._checkModeProperty(i)},a.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},a.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},a.prototype.isSymbolicLink=function(){return this._checkModeProperty(l)},a.prototype.isFIFO=function(){return this._checkModeProperty(y)},a.prototype.isSocket=function(){return this._checkModeProperty(p)},a}(),e.Stats=t,e.default=t});et(de);var te=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Rt=[],pt=[],Os=typeof Uint8Array<"u"?Uint8Array:Array,Kr=!1;function hi(){Kr=!0;for(var t=0;64>t;++t)Rt[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],pt["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;pt[45]=62,pt[95]=63}function Ts(t,e,r){for(var n=[],i=e;i<r;i+=3)e=(t[i]<<16)+(t[i+1]<<8)+t[i+2],n.push(Rt[e>>18&63]+Rt[e>>12&63]+Rt[e>>6&63]+Rt[e&63]);return n.join("")}function li(t){Kr||hi();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;o<s;o+=16383)i.push(Ts(t,o,o+16383>s?s:o+16383));return r===1?(t=t[e-1],n+=Rt[t>>2],n+=Rt[t<<4&63],n+="=="):r===2&&(t=(t[e-2]<<8)+t[e-1],n+=Rt[t>>10],n+=Rt[t>>4&63],n+=Rt[t<<2&63],n+="="),i.push(n),i.join("")}function ur(t,e,r,n,i){var o=8*i-n-1,s=(1<<o)-1,l=s>>1,y=-7;i=r?i-1:0;var p=r?-1:1,a=t[e+i];for(i+=p,r=a&(1<<-y)-1,a>>=-y,y+=o;0<y;r=256*r+t[e+i],i+=p,y-=8);for(o=r&(1<<-y)-1,r>>=-y,y+=n;0<y;o=256*o+t[e+i],i+=p,y-=8);if(r===0)r=1-l;else{if(r===s)return o?NaN:1/0*(a?-1:1);o+=Math.pow(2,n),r-=l}return(a?-1:1)*o*Math.pow(2,r-n)}function fr(t,e,r,n,i,o){var s,l=8*o-i-1,y=(1<<l)-1,p=y>>1,a=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var g=n?1:-1,m=0>e||e===0&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(e=isNaN(e)?1:0,n=y):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),e=1<=n+p?e+a/s:e+a*Math.pow(2,1-p),2<=e*s&&(n++,s/=2),n+p>=y?(e=0,n=y):1<=n+p?(e=(e*s-1)*Math.pow(2,i),n+=p):(e=e*Math.pow(2,p-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=e&255,o+=g,e/=256,i-=8);for(n=n<<i|e,l+=i;0<l;t[r+o]=n&255,o+=g,n/=256,l-=8);t[r+o-g]|=128*m}var Is={}.toString,ci=Array.isArray||function(t){return Is.call(t)=="[object Array]"};S.TYPED_ARRAY_SUPPORT=te.TYPED_ARRAY_SUPPORT!==void 0?te.TYPED_ARRAY_SUPPORT:!0;var Ns=S.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function Pt(t,e){if((S.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<e)throw new RangeError("Invalid typed array length");return S.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=S.prototype):(t===null&&(t=new S(e)),t.length=e),t}function S(t,e,r){if(!(S.TYPED_ARRAY_SUPPORT||this instanceof S))return new S(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw Error("If encoding is specified then the first argument must be a string");return Hr(this,t)}return ai(this,t,e,r)}S.poolSize=8192,S._augment=function(t){return t.__proto__=S.prototype,t};function ai(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');if(typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=r===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,r):new Uint8Array(e,r,n),S.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=S.prototype):t=Xr(t,e),t}if(typeof e=="string"){if(n=t,t=r,(typeof t!="string"||t==="")&&(t="utf8"),!S.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return r=yi(e,t)|0,n=Pt(n,r),e=n.write(e,t),e!==r&&(n=n.slice(0,e)),n}return ks(t,e)}S.from=function(t,e,r){return ai(null,t,e,r)},S.TYPED_ARRAY_SUPPORT&&(S.prototype.__proto__=Uint8Array.prototype,S.__proto__=Uint8Array);function pi(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}S.alloc=function(t,e,r){return pi(t),t=0>=t?Pt(null,t):e!==void 0?typeof r=="string"?Pt(null,t).fill(e,r):Pt(null,t).fill(e):Pt(null,t),t};function Hr(t,e){if(pi(e),t=Pt(t,0>e?0:Jr(e)|0),!S.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}S.allocUnsafe=function(t){return Hr(null,t)},S.allocUnsafeSlow=function(t){return Hr(null,t)};function Xr(t,e){var r=0>e.length?0:Jr(e.length)|0;t=Pt(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function ks(t,e){if(At(e)){var r=Jr(e.length)|0;return t=Pt(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return(r=typeof e.length!="number")||(r=e.length,r=r!==r),r?Pt(t,0):Xr(t,e);if(e.type==="Buffer"&&ci(e.data))return Xr(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Jr(t){if(t>=(S.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(S.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return t|0}S.isBuffer=Lt;function At(t){return!(t==null||!t._isBuffer)}S.compare=function(t,e){if(!At(t)||!At(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},S.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},S.concat=function(t,e){if(!ci(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return S.alloc(0);var r;if(e===void 0)for(r=e=0;r<t.length;++r)e+=t[r].length;e=S.allocUnsafe(e);var n=0;for(r=0;r<t.length;++r){var i=t[r];if(!At(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(e,n),n+=i.length}return e};function yi(t,e){if(At(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ar(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Ei(t).length;default:if(n)return ar(t).length;e=(""+e).toLowerCase(),n=!0}}S.byteLength=yi;function Ps(t,e,r){var n=!1;if((e===void 0||0>e)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),0>=r)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r<e;++r)t=n,n=this[r],n=16>n?"0"+n.toString(16):n.toString(16),n=t+n;return n;case"utf8":case"utf-8":return mi(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]&127);return t;case"latin1":case"binary":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]);return t;case"base64":return e=e===0&&r===this.length?li(this):li(this.slice(e,r)),e;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(e=this.slice(e,r),r="",t=0;t<e.length;t+=2)r+=String.fromCharCode(e[t]+256*e[t+1]);return r;default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}S.prototype._isBuffer=!0;function ee(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}S.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)ee(this,e,e+1);return this},S.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)ee(this,e,e+3),ee(this,e+1,e+2);return this},S.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)ee(this,e,e+7),ee(this,e+1,e+6),ee(this,e+2,e+5),ee(this,e+3,e+4);return this},S.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?mi(this,0,t):Ps.apply(this,arguments)},S.prototype.equals=function(t){if(!At(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:S.compare(this,t)===0},S.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(t+=" ... ")),"<Buffer "+t+">"},S.prototype.compare=function(t,e,r,n,i){if(!At(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;var o=i-n,s=r-e,l=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;e<l;++e)if(n[e]!==t[e]){o=n[e],s=t[e];break}return o<s?-1:s<o?1:0};function gi(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r)if(i)r=0;else return-1;if(typeof e=="string"&&(e=S.from(e,n)),At(e))return e.length===0?-1:di(t,e,r,n,i);if(typeof e=="number")return e&=255,S.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):di(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function di(t,e,r,n,i){function o(p,a){return s===1?p[a]:p.readUInt16BE(a*s)}var s=1,l=t.length,y=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(2>t.length||2>e.length)return-1;s=2,l/=2,y/=2,r/=2}if(i)for(n=-1;r<l;r++)if(o(t,r)===o(e,n===-1?0:r-n)){if(n===-1&&(n=r),r-n+1===y)return n*s}else n!==-1&&(r-=r-n),n=-1;else for(r+y>l&&(r=l-y);0<=r;r--){for(l=!0,n=0;n<y;n++)if(o(t,r+n)!==o(e,n)){l=!1;break}if(l)return r}return-1}S.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},S.prototype.indexOf=function(t,e,r){return gi(this,t,e,r,!0)},S.prototype.lastIndexOf=function(t,e,r){return gi(this,t,e,r,!1)},S.prototype.write=function(t,e,r,n){if(e===void 0)n="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")n=e,r=this.length,e=0;else if(isFinite(e))e|=0,isFinite(r)?(r|=0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((r===void 0||r>i)&&(r=i),0<t.length&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r),r>n&&(r=n)):r=n,n=t.length,n%2!==0)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n<r;++n){if(i=parseInt(t.substr(2*n,2),16),isNaN(i)){t=n;break t}this[e+n]=i}t=n}return t;case"utf8":case"utf-8":return ke(ar(t,this.length-e),this,e,r);case"ascii":return ke(wi(t),this,e,r);case"latin1":case"binary":return ke(wi(t),this,e,r);case"base64":return ke(Ei(t),this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=t,i=this.length-e;for(var o=[],s=0;s<n.length&&!(0>(i-=2));++s){var l=n.charCodeAt(s);t=l>>8,l%=256,o.push(l),o.push(t)}return ke(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function mi(t,e,r){r=Math.min(t.length,r);for(var n=[];e<r;){var i=t[e],o=null,s=239<i?4:223<i?3:191<i?2:1;if(e+s<=r)switch(s){case 1:128>i&&(o=i);break;case 2:var l=t[e+1];(l&192)===128&&(i=(i&31)<<6|l&63,127<i&&(o=i));break;case 3:l=t[e+1];var y=t[e+2];(l&192)===128&&(y&192)===128&&(i=(i&15)<<12|(l&63)<<6|y&63,2047<i&&(55296>i||57343<i)&&(o=i));break;case 4:l=t[e+1],y=t[e+2];var p=t[e+3];(l&192)===128&&(y&192)===128&&(p&192)===128&&(i=(i&15)<<18|(l&63)<<12|(y&63)<<6|p&63,65535<i&&1114112>i&&(o=i))}o===null?(o=65533,s=1):65535<o&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),e+=s}if(t=n.length,t<=vi)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e<t;)r+=String.fromCharCode.apply(String,n.slice(e,e+=vi));n=r}return n}var vi=4096;S.prototype.slice=function(t,e){var r=this.length;if(t=~~t,e=e===void 0?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),e<t&&(e=t),S.TYPED_ARRAY_SUPPORT)e=this.subarray(t,e),e.__proto__=S.prototype;else{r=e-t,e=new S(r,void 0);for(var n=0;n<r;++n)e[n]=this[n+t]}return e};function Q(t,e,r){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}S.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||Q(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r},S.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||Q(t,e,this.length),r=this[t+--e];for(var n=1;0<e&&(n*=256);)r+=this[t+--e]*n;return r},S.prototype.readUInt8=function(t,e){return e||Q(t,1,this.length),this[t]},S.prototype.readUInt16LE=function(t,e){return e||Q(t,2,this.length),this[t]|this[t+1]<<8},S.prototype.readUInt16BE=function(t,e){return e||Q(t,2,this.length),this[t]<<8|this[t+1]},S.prototype.readUInt32LE=function(t,e){return e||Q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},S.prototype.readUInt32BE=function(t,e){return e||Q(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},S.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||Q(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r>=128*n&&(r-=Math.pow(2,8*e)),r},S.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||Q(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0<r&&(n*=256);)i+=this[t+--r]*n;return i>=128*n&&(i-=Math.pow(2,8*e)),i},S.prototype.readInt8=function(t,e){return e||Q(t,1,this.length),this[t]&128?-1*(255-this[t]+1):this[t]},S.prototype.readInt16LE=function(t,e){return e||Q(t,2,this.length),t=this[t]|this[t+1]<<8,t&32768?t|4294901760:t},S.prototype.readInt16BE=function(t,e){return e||Q(t,2,this.length),t=this[t+1]|this[t]<<8,t&32768?t|4294901760:t},S.prototype.readInt32LE=function(t,e){return e||Q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},S.prototype.readInt32BE=function(t,e){return e||Q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},S.prototype.readFloatLE=function(t,e){return e||Q(t,4,this.length),ur(this,t,!0,23,4)},S.prototype.readFloatBE=function(t,e){return e||Q(t,4,this.length),ur(this,t,!1,23,4)},S.prototype.readDoubleLE=function(t,e){return e||Q(t,8,this.length),ur(this,t,!0,52,8)},S.prototype.readDoubleBE=function(t,e){return e||Q(t,8,this.length),ur(this,t,!1,52,8)};function it(t,e,r,n,i,o){if(!At(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}S.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||it(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=t&255;++i<r&&(n*=256);)this[e+i]=t/n&255;return e+r},S.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||it(this,t,e,r,Math.pow(2,8*r)-1,0),n=r-1;var i=1;for(this[e+n]=t&255;0<=--n&&(i*=256);)this[e+n]=t/i&255;return e+r},S.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,1,255,0),S.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};function hr(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}S.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):hr(this,t,e,!0),e+2},S.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):hr(this,t,e,!1),e+2};function lr(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}S.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):lr(this,t,e,!0),e+4},S.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):lr(this,t,e,!1),e+4},S.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||(n=Math.pow(2,8*r-1),it(this,t,e,r,n-1,-n)),n=0;var i=1,o=0;for(this[e]=t&255;++n<r&&(i*=256);)0>t&&o===0&&this[e+n-1]!==0&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},S.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||(n=Math.pow(2,8*r-1),it(this,t,e,r,n-1,-n)),n=r-1;var i=1,o=0;for(this[e+n]=t&255;0<=--n&&(i*=256);)0>t&&o===0&&this[e+n+1]!==0&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},S.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,1,127,-128),S.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=t&255,e+1},S.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):hr(this,t,e,!0),e+2},S.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):hr(this,t,e,!1),e+2},S.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,4,2147483647,-2147483648),S.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):lr(this,t,e,!0),e+4},S.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||it(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):lr(this,t,e,!1),e+4};function cr(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}S.prototype.writeFloatLE=function(t,e,r){return r||cr(this,t,e,4),fr(this,t,e,!0,23,4),e+4},S.prototype.writeFloatBE=function(t,e,r){return r||cr(this,t,e,4),fr(this,t,e,!1,23,4),e+4},S.prototype.writeDoubleLE=function(t,e,r){return r||cr(this,t,e,8),fr(this,t,e,!0,52,8),e+8},S.prototype.writeDoubleBE=function(t,e,r){return r||cr(this,t,e,8),fr(this,t,e,!1,52,8),e+8},S.prototype.copy=function(t,e,r,n){if(r||(r=0),n||n===0||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r||t.length===0||this.length===0)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&r<e&&e<n)for(n=i-1;0<=n;--n)t[n+e]=this[n+r];else if(1e3>i||!S.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},S.prototype.fill=function(t,e,r,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),t.length===1){var i=t.charCodeAt(0);256>i&&(t=i)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!S.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof t=="number"&&(t&=255);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=r===void 0?this.length:r>>>0,t||(t=0),typeof t=="number")for(n=e;n<r;++n)this[n]=t;else for(t=At(t)?t:ar(new S(t,n).toString()),i=t.length,n=0;n<r-e;++n)this[n+e]=t[n%i];return this};var Ls=/[^+\/0-9A-Za-z-_]/g;function ar(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(r=t.charCodeAt(s),55295<r&&57344>r){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}else if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(56320>r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,r&63|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(1114112>r){if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw Error("Invalid code point")}return o}function wi(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Ei(t){if(t=(t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(Ls,""),2>t.length)t="";else for(;t.length%4!==0;)t+="=";Kr||hi();var e=t.length;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var r=t[e-2]==="="?2:t[e-1]==="="?1:0,n=new Os(3*e/4-r),i=0<r?e-4:e,o=0;for(e=0;e<i;e+=4){var s=pt[t.charCodeAt(e)]<<18|pt[t.charCodeAt(e+1)]<<12|pt[t.charCodeAt(e+2)]<<6|pt[t.charCodeAt(e+3)];n[o++]=s>>16&255,n[o++]=s>>8&255,n[o++]=s&255}return r===2?(s=pt[t.charCodeAt(e)]<<2|pt[t.charCodeAt(e+1)]>>4,n[o++]=s&255):r===1&&(s=pt[t.charCodeAt(e)]<<10|pt[t.charCodeAt(e+1)]<<4|pt[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=s&255),n}function ke(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Lt(t){return t!=null&&(!!t._isBuffer||_i(t)||typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&_i(t.slice(0,0)))}function _i(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}var Pe=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Ns,Buffer:S,SlowBuffer:function(t){return+t!=t&&(t=0),S.alloc(+t)},isBuffer:Lt}),G=b(function(t,e){function r(i){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return new(Pe.Buffer.bind.apply(Pe.Buffer,n([void 0,i],o)))}var n=H&&H.__spreadArrays||function(){for(var i=0,o=0,s=arguments.length;o<s;o++)i+=arguments[o].length;i=Array(i);var l=0;for(o=0;o<s;o++)for(var y=arguments[o],p=0,a=y.length;p<a;p++,l++)i[l]=y[p];return i};Object.defineProperty(e,"__esModule",{value:!0}),e.Buffer=Pe.Buffer,e.bufferAllocUnsafe=Pe.Buffer.allocUnsafe||r,e.bufferFrom=Pe.Buffer.from||r});et(G);function Si(){throw Error("setTimeout has not been defined")}function Ri(){throw Error("clearTimeout has not been defined")}var Wt=Si,$t=Ri;typeof te.setTimeout=="function"&&(Wt=setTimeout),typeof te.clearTimeout=="function"&&($t=clearTimeout);function Ai(t){if(Wt===setTimeout)return setTimeout(t,0);if((Wt===Si||!Wt)&&setTimeout)return Wt=setTimeout,setTimeout(t,0);try{return Wt(t,0)}catch{try{return Wt.call(null,t,0)}catch{return Wt.call(this,t,0)}}}function Cs(t){if($t===clearTimeout)return clearTimeout(t);if(($t===Ri||!$t)&&clearTimeout)return $t=clearTimeout,clearTimeout(t);try{return $t(t)}catch{try{return $t.call(null,t)}catch{return $t.call(this,t)}}}var Ct=[],me=!1,re,pr=-1;function Bs(){me&&re&&(me=!1,re.length?Ct=re.concat(Ct):pr=-1,Ct.length&&Oi())}function Oi(){if(!me){var t=Ai(Bs);me=!0;for(var e=Ct.length;e;){for(re=Ct,Ct=[];++pr<e;)re&&re[pr].run();pr=-1,e=Ct.length}re=null,me=!1,Cs(t)}}function ut(t){var e=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ct.push(new Ti(t,e)),Ct.length!==1||me||Ai(Oi)}function Ti(t,e){this.fun=t,this.array=e}Ti.prototype.run=function(){this.fun.apply(null,this.array)};function ne(){}var ve=te.performance||{},Fs=ve.now||ve.mozNow||ve.msNow||ve.oNow||ve.webkitNow||function(){return new Date().getTime()},Us=new Date,we={nextTick:ut,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:ne,addListener:ne,once:ne,off:ne,removeListener:ne,removeAllListeners:ne,emit:ne,binding:function(){throw Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*Fs.call(ve),r=Math.floor(e);return e=Math.floor(e%1*1e9),t&&(r-=t[0],e-=t[1],0>e&&(r--,e+=1e9)),[r,e]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Us)/1e3}},Gt=typeof Object.create=="function"?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},Ds=/%[sdj%]/g;function Zr(t){if(!ie(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(Ot(arguments[r]));return e.join(" ")}r=1;var n=arguments,i=n.length;e=String(t).replace(Ds,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return s}});for(var o=n[r];r<i;o=n[++r])e=o!==null&&zt(o)?e+(" "+Ot(o)):e+(" "+o);return e}function Qr(t,e){if(Bt(te.process))return function(){return Qr(t,e).apply(this,arguments)};if(we.noDeprecation===!0)return t;var r=!1;return function(){if(!r){if(we.throwDeprecation)throw Error(e);we.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}}var yr={},br;function Ii(t){return Bt(br)&&(br=we.env.NODE_DEBUG||""),t=t.toUpperCase(),yr[t]||(new RegExp("\\b"+t+"\\b","i").test(br)?yr[t]=function(){var e=Zr.apply(null,arguments);console.error("%s %d: %s",t,0,e)}:yr[t]=function(){}),yr[t]}function Ot(t,e){var r={seen:[],stylize:xs};return 3<=arguments.length&&(r.depth=arguments[2]),4<=arguments.length&&(r.colors=arguments[3]),rn(e)?r.showHidden=e:e&&Pi(r,e),Bt(r.showHidden)&&(r.showHidden=!1),Bt(r.depth)&&(r.depth=2),Bt(r.colors)&&(r.colors=!1),Bt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ms),gr(r,t,r.depth)}Ot.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Ot.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ms(t,e){return(e=Ot.styles[e])?"\x1B["+Ot.colors[e][0]+"m"+t+"\x1B["+Ot.colors[e][1]+"m":t}function xs(t){return t}function js(t){var e={};return t.forEach(function(r){e[r]=!0}),e}function gr(t,e,r){if(t.customInspect&&e&&_e(e.inspect)&&e.inspect!==Ot&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return ie(n)||(n=gr(t,n,r)),n}if(n=Ys(t,e))return n;var i=Object.keys(e),o=js(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),Ce(e)&&(0<=i.indexOf("message")||0<=i.indexOf("description")))return tn(e);if(i.length===0){if(_e(e))return t.stylize("[Function"+(e.name?": "+e.name:"")+"]","special");if(Ee(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Le(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Ce(e))return tn(e)}n="";var s=!1,l=["{","}"];return Ni(e)&&(s=!0,l=["[","]"]),_e(e)&&(n=" [Function"+(e.name?": "+e.name:"")+"]"),Ee(e)&&(n=" "+RegExp.prototype.toString.call(e)),Le(e)&&(n=" "+Date.prototype.toUTCString.call(e)),Ce(e)&&(n=" "+tn(e)),i.length===0&&(!s||e.length==0)?l[0]+n+l[1]:0>r?Ee(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),i=s?Ws(t,e,r,o,i):i.map(function(y){return en(t,e,r,o,y,s)}),t.seen.pop(),$s(i,n,l))}function Ys(t,e){if(Bt(e))return t.stylize("undefined","undefined");if(ie(e))return e="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",t.stylize(e,"string");if(ki(e))return t.stylize(""+e,"number");if(rn(e))return t.stylize(""+e,"boolean");if(e===null)return t.stylize("null","null")}function tn(t){return"["+Error.prototype.toString.call(t)+"]"}function Ws(t,e,r,n,i){for(var o=[],s=0,l=e.length;s<l;++s)Object.prototype.hasOwnProperty.call(e,String(s))?o.push(en(t,e,r,n,String(s),!0)):o.push("");return i.forEach(function(y){y.match(/^\d+$/)||o.push(en(t,e,r,n,y,!0))}),o}function en(t,e,r,n,i,o){var s,l;if(e=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},e.get?l=e.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):e.set&&(l=t.stylize("[Setter]","special")),Object.prototype.hasOwnProperty.call(n,i)||(s="["+i+"]"),l||(0>t.seen.indexOf(e.value)?(l=r===null?gr(t,e.value,null):gr(t,e.value,r-1),-1<l.indexOf(`

[Showing last 50.0KB of line 15 (line is 0B). Full output: /tmp/pi-bash-acf55b2d6f57a90b.log]


我已经成功下载了 xcc 的完整资源：
1. wccfiles.zip (141KB) - 包含编译器、头文件和库
2. wasi_worker.js (182KB) - WASI 运行时

现在让我创建一个基于 xcc 的 C 编译器网页。我需要：
1. 将 wccfiles.zip 解压到网站目录
2. 创建 index.html 前端页面
3. 创建 nginx 配置

让我先创建目录结构并复制文件。

bash

mkdir -p /shumengya/www/c-wasm

# 复制 xcc 的文件
cp -r /tmp/xcc-files/usr /shumengya/www/c-wasm/
cp /tmp/xcc-files/wccfiles.zip /shumengya/www/c-wasm/
cp /tmp/xcc-files/wasi_worker.js /shumengya/www/c-wasm/

# 检查文件结构
ls -la /shumengya/www/c-wasm/
ls -la /shumengya/www/c-wasm/usr/bin/
ls -la /shumengya/www/c-wasm/usr/include/ | head -10


总计 340
drwxr-xr-x 3 root root   4096  6月11日 00:46 .
drwxr-xr-x 5 root root   4096  6月11日 00:46 ..
drwxr-xr-x 5 root root   4096  6月11日 00:46 usr
-rw-r--r-- 1 root root 185464  6月11日 00:46 wasi_worker.js
-rw-r--r-- 1 root root 144113  6月11日 00:46 wccfiles.zip
总计 300
drwxr-xr-x 2 root root   4096  6月11日 00:46 .
drwxr-xr-x 5 root root   4096  6月11日 00:46 ..
-rw-r--r-- 1 root root 298650  6月11日 00:46 cc
总计 116
drwxr-xr-x 3 root root 4096  6月11日 00:46 .
drwxr-xr-x 5 root root 4096  6月11日 00:46 ..
-rw-r--r-- 1 root root  156  6月11日 00:46 alloca.h
-rw-r--r-- 1 root root  232  6月11日 00:46 ar.h
-rw-r--r-- 1 root root  486  6月11日 00:46 assert.h
-rw-r--r-- 1 root root  296  6月11日 00:46 ctype.h
-rw-r--r-- 1 root root 2186  6月11日 00:46 errno.h
-rw-r--r-- 1 root root 1004  6月11日 00:46 fcntl.h
-rw-r--r-- 1 root root  788  6月11日 00:46 float.h


好的，我已经有了 xcc 的完整资源。现在我需要创建一个前端页面，使用 xcc 的编译器来编译和运行 C 代码。

让我创建一个简洁的 HTML 页面，使用 xcc 的 WASI worker 来编译和运行 C 代码。

我需要：
1. 创建一个 index.html 页面
2. 使用 xcc 的 wasi_worker.js 作为 Web Worker
3. 编译 C 代码并运行

让我先创建一个简单的 HTML 页面。

write

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>C 编译器</title>
  <link rel="preload" href="usr/bin/cc" as="fetch" crossorigin="anonymous">

正在加载 C 编译器...

首次加载约 141KB，可能需要几秒钟

C

C 编译器

        WebAssembly · xcc

      加载中

      <button class="btn btn-primary" id="runBtn" onclick="runCode()" disabled>
        运行
      </button>
      <button class="btn btn-secondary" onclick="clearCode()">清空</button>
      <button class="btn btn-secondary" onclick="resetOutput()">重置输出</button>

      <button class="btn btn-secondary" onclick="loadExample('hello')">Hello</button>
      <button class="btn btn-secondary" onclick="loadExample('var')">变量</button>
      <button class="btn btn-secondary" onclick="loadExample('func')">函数</button>
      <button class="btn btn-secondary" onclick="loadExample('loop')">循环</button>

C11

源代码

            <button class="panel-btn" onclick="loadExample('hello')">示例</button>

          <textarea class="code-editor" id="codeEditor" placeholder="// 在此输入 C 代码..." spellcheck="false">#include <stdio.h>

int main() {
    printf("Hello, C!\n");
    return 0;
}</textarea>

Tab 缩进 · Shift+Enter 运行

输出

            <button class="panel-btn" onclick="resetOutput()">清空</button>

            点击「运行」按钮编译并执行代码...


Successfully wrote 22489 bytes to /shumengya/www/c-wasm/index.html


我发现我创建的 HTML 页面中，解压 zip 的功能没有实现。我需要引入一个 zip 解析库，或者使用另一种方式。

让我重新思考这个方案。xcc 的 wasi_worker.js 已经非常复杂，它包含了完整的 WASI 运行时和 memfs。

最好的方案是：
1. 直接使用 xcc 的 wasi_worker.js 作为 Web Worker
2. 在 worker 中处理 zip 解压
3. 前端页面只需要发送命令

但 xcc 的 worker 文件已经包含了完整的逻辑，我需要理解它的 API。

让我查看 xcc 的 worker 文件，了解它的 API。

从之前的分析中，xcc 的 worker 文件使用了 `xu` 类，它有以下方法：
- `setEnv(envJson)` - 设置环境变量
- `writeFile(filePath, content)` - 写入文件
- `readFile(filePath)` - 读取文件
- `mkdir(filePath, option)` - 创建目录
- `chdir(filePath)` - 切换目录
- `runWasi(filePath, args)` - 运行 WASI 程序

worker 的初始化流程：
1. 设置环境变量
2. 创建目录
3. 下载并解压 wccfiles.zip
4. 写入文件到虚拟文件系统
5. 运行编译器

但我在 HTML 中需要实现 zip 解压功能。让我使用 JSZip 库来实现。

或者，我可以预先解压 zip 文件，将文件直接放在网站目录中，这样就不需要在前端解压了。

让我重新设计方案：
1. 预先解压 wccfiles.zip 到网站目录
2. 修改 worker 文件，使其能够直接从网站目录加载文件
3. 创建前端页面

这样更简单，不需要在前端解压 zip。

让我重新设计整个方案。

bash

# 重新设计：预先解压 zip 文件，修改 worker 以支持直接加载文件

# 解压 wccfiles.zip 到网站目录
cd /shumengya/www/c-wasm

# 检查已解压的文件
ls -la usr/bin/
ls -la usr/include/ | head -5
ls -la usr/lib/

# 查看 wccfiles.zip 的完整内容
unzip -l wccfiles.zip | head -20


总计 300
drwxr-xr-x 2 root root   4096  6月11日 00:46 .
drwxr-xr-x 5 root root   4096  6月11日 00:46 ..
-rw-r--r-- 1 root root 298650  6月11日 00:46 cc
总计 116
drwxr-xr-x 3 root root 4096  6月11日 00:46 .
drwxr-xr-x 5 root root 4096  6月11日 00:46 ..
-rw-r--r-- 1 root root  156  6月11日 00:46 alloca.h
-rw-r--r-- 1 root root  232  6月11日 00:46 ar.h
总计 80
drwxr-xr-x 2 root root  4096  6月11日 00:46 .
drwxr-xr-x 5 root root  4096  6月11日 00:46 ..
-rw-r--r-- 1 root root  1130  6月11日 00:46 wcrt0.a
-rw-r--r-- 1 root root 68578  6月11日 00:46 wlibc.a
Archive:  wccfiles.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2026-06-06 07:50   usr/
        0  2026-06-06 07:50   usr/bin/
   298650  2026-06-06 07:50   usr/bin/cc
        0  2026-06-06 07:50   usr/include/
        0  2026-06-06 07:50   usr/include/sys/
      209  2026-06-06 07:50   usr/include/sys/random.h
     4397  2026-06-06 07:50   usr/include/sys/stat.h
      105  2026-06-06 07:50   usr/include/sys/types.h
      156  2026-06-06 07:50   usr/include/alloca.h
      232  2026-06-06 07:50   usr/include/ar.h
      486  2026-06-06 07:50   usr/include/assert.h
      296  2026-06-06 07:50   usr/include/ctype.h
     2186  2026-06-06 07:50   usr/include/errno.h
     1004  2026-06-06 07:50   usr/include/fcntl.h
      788  2026-06-06 07:50   usr/include/float.h
       59  2026-06-06 07:50   usr/include/libgen.h
      779  2026-06-06 07:50   usr/include/inttypes.h


我已经解压了 wccfiles.zip 文件。现在让我创建一个更完整的前端页面，使用 xcc 的 WASI worker。

我需要修改 xcc 的 worker 文件，使其支持从网站目录直接加载文件，而不是从 zip 文件加载。

让我查看 xcc 的 worker 文件，找到加载文件的部分，然后修改它。

实际上，我可以创建一个更简单的方案：
1. 使用 xcc 的 worker 文件作为基础
2. 修改 worker 文件，使其支持从 URL 加载文件
3. 创建前端页面

让我先查看 worker 文件中的关键部分。

# 查看 xcc worker 文件中的关键部分
grep -n "wccfiles.zip\|fetch\|setUp\|fromJSON" /tmp/xcc-files/wasi_worker.js | head -20

# 查看 worker 文件中的加载逻辑
# 由于文件是 minified 的，我需要搜索特定的字符串
grep -n "wccfiles" /tmp/xcc-files/wasi_worker.js