@hpcc-js/wasm-graphviz
Version:
hpcc-js - WASM Graphviz
1 lines • 821 kB
JavaScript
function de(v){return Object.freeze(Object.keys(v))}var go=de({area:!0,class:!0,color:!0,colorscheme:!0,comment:!0,distortion:!0,fillcolor:!0,fixedsize:!0,fontcolor:!0,fontname:!0,fontsize:!0,gradientangle:!0,group:!0,height:!0,href:!0,id:!0,image:!0,imagepos:!0,imagescale:!0,label:!0,labelloc:!0,layer:!0,margin:!0,nojustify:!0,ordering:!0,orientation:!0,penwidth:!0,peripheries:!0,pin:!0,pos:!0,regular:!0,root:!0,samplepoints:!0,shape:!0,shapefile:!0,showboxes:!0,sides:!0,skew:!0,sortv:!0,style:!0,target:!0,tooltip:!0,URL:!0,width:!0,xlabel:!0,z:!0}),co=de({arrowhead:!0,arrowsize:!0,arrowtail:!0,class:!0,color:!0,colorscheme:!0,comment:!0,constraint:!0,decorate:!0,dir:!0,edgehref:!0,edgetarget:!0,edgetooltip:!0,edgeURL:!0,fillcolor:!0,fontcolor:!0,fontname:!0,fontsize:!0,headclip:!0,headhref:!0,headlabel:!0,headport:!0,headtarget:!0,headtooltip:!0,headURL:!0,href:!0,id:!0,label:!0,labelangle:!0,labeldistance:!0,labelfloat:!0,labelfontcolor:!0,labelfontname:!0,labelfontsize:!0,labelhref:!0,labeltarget:!0,labeltooltip:!0,labelURL:!0,layer:!0,len:!0,lhead:!0,ltail:!0,minlen:!0,nojustify:!0,penwidth:!0,pos:!0,radius:!0,samehead:!0,sametail:!0,showboxes:!0,style:!0,tailclip:!0,tailhref:!0,taillabel:!0,tailport:!0,tailtarget:!0,tailtooltip:!0,tailURL:!0,target:!0,tooltip:!0,URL:!0,weight:!0,xlabel:!0}),po=de({area:!0,bgcolor:!0,class:!0,cluster:!0,color:!0,colorscheme:!0,fillcolor:!0,fontcolor:!0,fontname:!0,fontsize:!0,gradientangle:!0,href:!0,id:!0,K:!0,label:!0,labeljust:!0,labelloc:!0,layer:!0,margin:!0,nojustify:!0,pencolor:!0,penwidth:!0,peripheries:!0,rank:!0,sortv:!0,style:!0,target:!0,tooltip:!0,URL:!0}),yo=de({_background:!0,beautify:!0,bgcolor:!0,center:!0,charset:!0,class:!0,clusterrank:!0,colorscheme:!0,comment:!0,compound:!0,concentrate:!0,Damping:!0,defaultdist:!0,dim:!0,dimen:!0,diredgeconstraints:!0,dpi:!0,epsilon:!0,esep:!0,fontcolor:!0,fontname:!0,fontnames:!0,fontpath:!0,fontsize:!0,forcelabels:!0,gradientangle:!0,href:!0,id:!0,imagepath:!0,inputscale:!0,K:!0,label:!0,label_scheme:!0,labeljust:!0,labelloc:!0,landscape:!0,layerlistsep:!0,layers:!0,layerselect:!0,layersep:!0,layout:!0,levels:!0,levelsgap:!0,linelength:!0,margin:!0,maxiter:!0,mclimit:!0,mindist:!0,mode:!0,model:!0,newrank:!0,nodesep:!0,nojustify:!0,normalize:!0,notranslate:!0,nslimit:!0,nslimit1:!0,oneblock:!0,ordering:!0,orientation:!0,outputorder:!0,overlap:!0,overlap_scaling:!0,overlap_shrink:!0,pack:!0,packmode:!0,pad:!0,page:!0,pagedir:!0,quantum:!0,rankdir:!0,ranksep:!0,ratio:!0,remincross:!0,repulsiveforce:!0,resolution:!0,root:!0,rotate:!0,rotation:!0,scale:!0,searchsize:!0,sep:!0,showboxes:!0,size:!0,smoothing:!0,sortv:!0,splines:!0,start:!0,style:!0,stylesheet:!0,target:!0,TBbalance:!0,tooltip:!0,truecolor:!0,URL:!0,viewport:!0,voro_margin:!0,xdotversion:!0});var Xi=ArrayBuffer,V=Uint8Array,he=Uint16Array,qi=Int16Array;var ve=Int32Array,Ie=function(v,o,u){if(V.prototype.slice)return V.prototype.slice.call(v,o,u);(o==null||o<0)&&(o=0),(u==null||u>v.length)&&(u=v.length);var d=new V(u-o);return d.set(v.subarray(o,u)),d},Zr=function(v,o,u,d){if(V.prototype.fill)return V.prototype.fill.call(v,o,u,d);for((u==null||u<0)&&(u=0),(d==null||d>v.length)&&(d=v.length);u<d;++u)v[u]=o;return v},Vi=function(v,o,u,d){if(V.prototype.copyWithin)return V.prototype.copyWithin.call(v,o,u,d);for((u==null||u<0)&&(u=0),(d==null||d>v.length)&&(d=v.length);u<d;)v[o++]=v[u++]};var ji=["invalid zstd data","window size too large (>2046MB)","invalid block type","FSE accuracy too high","match distance too far back","unexpected EOF"],j=function(v,o,u){var d=new Error(o||ji[v]);if(d.code=v,Error.captureStackTrace&&Error.captureStackTrace(d,j),!u)throw d;return d},bt=function(v,o,u){for(var d=0,f=0;d<u;++d)f|=v[o++]<<(d<<3);return f},ki=function(v,o){return(v[o]|v[o+1]<<8|v[o+2]<<16|v[o+3]<<24)>>>0},Ti=function(v,o){var u=v[0]|v[1]<<8|v[2]<<16;if(u==3126568&&v[3]==253){var d=v[4],f=d>>5&1,p=d>>2&1,y=d&3,b=d>>6;d&8&&j(0);var F=6-f,x=y==3?4:y,R=bt(v,F,x);F+=x;var P=b?1<<b:f,z=bt(v,F,P)+(b==1&&256),W=z;if(!f){var k=1<<10+(v[5]>>3);W=k+(k>>3)*(v[5]&7)}W>2145386496&&j(1);var K=new V((o==1?z||W:o?0:W)+12);return K[0]=1,K[4]=4,K[8]=8,{b:F+P,y:0,l:0,d:R,w:o&&o!=1?o:K.subarray(12),e:W,o:new ve(K.buffer,0,3),u:z,c:p,m:Math.min(131072,W)}}else if((u>>4|v[3]<<20)==25481893)return ki(v,4)+8;j(0)},Pr=function(v){for(var o=0;1<<o<=v;++o);return o-1},Jr=function(v,o,u){var d=(o<<3)+4,f=(v[o]&15)+5;f>u&&j(3);for(var p=1<<f,y=p,b=-1,F=-1,x=-1,R=p,P=new Xi(512+(p<<2)),z=new qi(P,0,256),W=new he(P,0,256),k=new he(P,512,p),K=512+(p<<1),$=new V(P,K,p),dr=new V(P,K+p);b<255&&y>0;){var T=Pr(y+1),Z=d>>3,mr=(1<<T+1)-1,J=(v[Z]|v[Z+1]<<8|v[Z+2]<<16)>>(d&7)&mr,M=(1<<T)-1,rr=mr-y-1,ar=J&M;if(ar<rr?(d+=T,J=ar):(d+=T+1,J>M&&(J-=rr)),z[++b]=--J,J==-1?(y+=J,$[--R]=b):y-=J,!J)do{var hr=d>>3;F=(v[hr]|v[hr+1]<<8)>>(d&7)&3,d+=2,b+=F}while(F==3)}(b>255||y)&&j(0);for(var nr=0,vr=(p>>1)+(p>>3)+3,fr=p-1,ur=0;ur<=b;++ur){var G=z[ur];if(G<1){W[ur]=-G;continue}for(x=0;x<G;++x){$[nr]=ur;do nr=nr+vr&fr;while(nr>=R)}}for(nr&&j(0),x=0;x<p;++x){var c=W[$[x]]++,C=dr[x]=f-Pr(c);k[x]=(c<<C)-p}return[d+7>>3,{b:f,s:$,n:dr,t:k}]},Zi=function(v,o){var u=0,d=-1,f=new V(292),p=v[o],y=f.subarray(0,256),b=f.subarray(256,268),F=new he(f.buffer,268);if(p<128){var x=Jr(v,o+1,6),R=x[0],P=x[1];o+=p;var z=R<<3,W=v[o];W||j(0);for(var k=0,K=0,$=P.b,dr=$,T=(++o<<3)-8+Pr(W);T-=$,!(T<z);){var Z=T>>3;if(k+=(v[Z]|v[Z+1]<<8)>>(T&7)&(1<<$)-1,y[++d]=P.s[k],T-=dr,T<z)break;Z=T>>3,K+=(v[Z]|v[Z+1]<<8)>>(T&7)&(1<<dr)-1,y[++d]=P.s[K],$=P.n[k],k=P.t[k],dr=P.n[K],K=P.t[K]}++d>255&&j(0)}else{for(d=p-127;u<d;u+=2){var mr=v[++o];y[u]=mr>>4,y[u+1]=mr&15}++o}var J=0;for(u=0;u<d;++u){var M=y[u];M>11&&j(0),J+=M&&1<<M-1}var rr=Pr(J)+1,ar=1<<rr,hr=ar-J;for(hr&hr-1&&j(0),y[d++]=Pr(hr)+1,u=0;u<d;++u){var M=y[u];++b[y[u]=M&&rr+1-M]}var nr=new V(ar<<1),vr=nr.subarray(0,ar),fr=nr.subarray(ar);for(F[rr]=0,u=rr;u>0;--u){var ur=F[u];Zr(fr,u,ur,F[u-1]=ur+b[u]*(1<<rr-u))}for(F[0]!=ar&&j(0),u=0;u<d;++u){var G=y[u];if(G){var c=F[G];Zr(vr,u,c,F[G]=c+(1<<rr-G))}}return[o,{n:fr,b:rr,s:vr}]},Ji=Jr(new V([81,16,99,140,49,198,24,99,12,33,196,24,99,102,102,134,70,146,4]),0,6)[1],Ai=Jr(new V([33,20,196,24,99,140,33,132,16,66,8,33,132,16,66,8,33,68,68,68,68,68,68,68,68,36,9]),0,6)[1],ro=Jr(new V([32,132,16,66,102,70,68,68,68,68,36,73,2]),0,5)[1],Bt=function(v,o){for(var u=v.length,d=new ve(u),f=0;f<u;++f)d[f]=o,o+=1<<v[f];return d},Le=new V(new ve([0,0,0,0,16843009,50528770,134678020,202050057,269422093]).buffer,0,36),eo=Bt(Le,0),Oe=new V(new ve([0,0,0,0,0,0,0,0,16843009,50528770,117769220,185207048,252579084,16]).buffer,0,53),to=Bt(Oe,3),Tr=function(v,o,u){var d=v.length,f=o.length,p=v[d-1],y=(1<<u.b)-1,b=-u.b;p||j(0);for(var F=0,x=u.b,R=(d<<3)-8+Pr(p)-x,P=-1;R>b&&P<f;){var z=R>>3,W=(v[z]|v[z+1]<<8|v[z+2]<<16)>>(R&7);F=(F<<x|W)&y,o[++P]=u.s[F],R-=x=u.n[F]}(R!=b||P+1!=f)&&j(0)},no=function(v,o,u){var d=6,f=o.length,p=f+3>>2,y=p<<1,b=p+y;Tr(v.subarray(d,d+=v[0]|v[1]<<8),o.subarray(0,p),u),Tr(v.subarray(d,d+=v[2]|v[3]<<8),o.subarray(p,y),u),Tr(v.subarray(d,d+=v[4]|v[5]<<8),o.subarray(y,b),u),Tr(v.subarray(d),o.subarray(b),u)},io=function(v,o,u){var d,f=o.b,p=v[f],y=p>>1&3;o.l=p&1;var b=p>>3|v[f+1]<<5|v[f+2]<<13,F=(f+=3)+b;if(y==1)return f>=v.length?void 0:(o.b=f+1,u?(Zr(u,v[f],o.y,o.y+=b),u):Zr(new V(b),v[f]));if(!(F>v.length)){if(y==0)return o.b=F,u?(u.set(v.subarray(f,F),o.y),o.y+=b,u):Ie(v,f,F);if(y==2){var x=v[f],R=x&3,P=x>>2&3,z=x>>4,W=0,k=0;R<2?P&1?z|=v[++f]<<4|(P&2&&v[++f]<<12):z=x>>3:(k=P,P<2?(z|=(v[++f]&63)<<4,W=v[f]>>6|v[++f]<<2):P==2?(z|=v[++f]<<4|(v[++f]&3)<<12,W=v[f]>>2|v[++f]<<6):(z|=v[++f]<<4|(v[++f]&63)<<12,W=v[f]>>6|v[++f]<<2|v[++f]<<10)),++f;var K=u?u.subarray(o.y,o.y+o.m):new V(o.m),$=K.length-z;if(R==0)K.set(v.subarray(f,f+=z),$);else if(R==1)Zr(K,v[f++],$);else{var dr=o.h;if(R==2){var T=Zi(v,f);W+=f-(f=T[0]),o.h=dr=T[1]}else dr||j(0);(k?no:Tr)(v.subarray(f,f+=W),K.subarray($),dr)}var Z=v[f++];if(Z){Z==255?Z=(v[f++]|v[f++]<<8)+32512:Z>127&&(Z=Z-128<<8|v[f++]);var mr=v[f++];mr&3&&j(0);for(var J=[Ai,ro,Ji],M=2;M>-1;--M){var rr=mr>>(M<<1)+2&3;if(rr==1){var ar=new V([0,0,v[f++]]);J[M]={s:ar.subarray(2,3),n:ar.subarray(0,1),t:new he(ar.buffer,0,1),b:0}}else rr==2?(d=Jr(v,f,9-(M&1)),f=d[0],J[M]=d[1]):rr==3&&(o.t||j(0),J[M]=o.t[M])}var hr=o.t=J,nr=hr[0],vr=hr[1],fr=hr[2],ur=v[F-1];ur||j(0);var G=(F<<3)-8+Pr(ur)-fr.b,c=G>>3,C=0,Mr=(v[c]|v[c+1]<<8)>>(G&7)&(1<<fr.b)-1;c=(G-=vr.b)>>3;var gr=(v[c]|v[c+1]<<8)>>(G&7)&(1<<vr.b)-1;c=(G-=nr.b)>>3;var _=(v[c]|v[c+1]<<8)>>(G&7)&(1<<nr.b)-1;for(++Z;--Z;){var er=fr.s[Mr],Sr=fr.n[Mr],Ir=nr.s[_],Fr=nr.n[_],L=vr.s[gr],tr=vr.n[gr];c=(G-=L)>>3;var Gr=1<<L,Er=Gr+((v[c]|v[c+1]<<8|v[c+2]<<16|v[c+3]<<24)>>>(G&7)&Gr-1);c=(G-=Oe[Ir])>>3;var cr=to[Ir]+((v[c]|v[c+1]<<8|v[c+2]<<16)>>(G&7)&(1<<Oe[Ir])-1);c=(G-=Le[er])>>3;var or=eo[er]+((v[c]|v[c+1]<<8|v[c+2]<<16)>>(G&7)&(1<<Le[er])-1);if(c=(G-=Sr)>>3,Mr=fr.t[Mr]+((v[c]|v[c+1]<<8)>>(G&7)&(1<<Sr)-1),c=(G-=Fr)>>3,_=nr.t[_]+((v[c]|v[c+1]<<8)>>(G&7)&(1<<Fr)-1),c=(G-=tr)>>3,gr=vr.t[gr]+((v[c]|v[c+1]<<8)>>(G&7)&(1<<tr)-1),Er>3)o.o[2]=o.o[1],o.o[1]=o.o[0],o.o[0]=Er-=3;else{var zr=Er-(or!=0);zr?(Er=zr==3?o.o[0]-1:o.o[zr],zr>1&&(o.o[2]=o.o[1]),o.o[1]=o.o[0],o.o[0]=Er):Er=o.o[0]}for(var M=0;M<or;++M)K[C+M]=K[$+M];C+=or,$+=or;var U=C-Er;if(U<0){var Lr=-U,Hr=o.e+U;Lr>cr&&(Lr=cr);for(var M=0;M<Lr;++M)K[C+M]=o.w[Hr+M];C+=Lr,cr-=Lr,U=0}for(var M=0;M<cr;++M)K[C+M]=K[U+M];C+=cr}if(C!=$)for(;$<K.length;)K[C++]=K[$++];else C=K.length;u?o.y+=C:K=Ie(K,0,C)}else if(u){if(o.y+=z,$)for(var M=0;M<z;++M)K[M]=K[$+M]}else $&&(K=Ie(K,$));return o.b=F,K}j(2)}},oo=function(v,o){if(v.length==1)return v[0];for(var u=new V(o),d=0,f=0;d<v.length;++d){var p=v[d];u.set(p,f),f+=p.length}return u};function Ft(v,o){for(var u=[],d=+!o,f=0,p=0;v.length;){var y=Ti(v,d||o);if(typeof y=="object"){for(d?(o=null,y.w.length==y.u&&(u.push(o=y.w),p+=y.u)):(u.push(o),y.e=0);!y.l;){var b=io(v,y,o);b||j(5),o?y.e=y.y:(u.push(b),p+=b.length,Vi(y.w,0,b.length),y.w.set(b,y.w.length-b.length))}f=y.b+y.c*4}else f=y;v=v.subarray(f)}return oo(u,p)}async function ao(v={}){var o=v,u=!1,d="./this.program",f=(r,e)=>{throw e},p='',y="";function b(r){return y+r}var F,x,R=console.log.bind(console),P=console.error.bind(console),z,W=!1,k,K=r=>r.startsWith("file://"),$=!1;function dr(){return le.buffer}function T(){if(!er?.buffer?.resizable){var r=dr();er=new Int8Array(r),gr=new Int16Array(r),o.HEAPU8=tr=new Uint8Array(r),Fr=new Uint16Array(r),_=new Int32Array(r),L=new Uint32Array(r),Sr=new Float32Array(r),Ir=new Float64Array(r)}}function Z(){}function mr(){$=!0,!o.noFSInit&&!i.initialized&&i.init(),_r.init(),kr.T(),i.ignorePermissions=!1}function J(){}function M(r){r=`Aborted(${r})`,P(r),W=!0,r+=". Build with -sASSERTIONS for more info.",$&&vt();var e=new WebAssembly.RuntimeError(r);throw e}var rr;let ar=()=>"";function hr(r){if(r==rr&&z)return new Uint8Array(z);if(x)return x(r);throw"both async and sync fetching of the wasm failed"}async function nr(r){if(!z)try{var e=await F(r);return new Uint8Array(e)}catch{}return hr(r)}async function vr(r,e){try{var t=await nr(r),n=await WebAssembly.instantiate(t,e);return n}catch(a){P(`failed to asynchronously prepare wasm: ${a}`),M(a)}}async function fr(r,e,t){if(!r&&!K(e))try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,t);return a}catch(s){P(`wasm streaming compile failed: ${s}`),P("falling back to ArrayBuffer instantiation")}return vr(e,t)}function ur(){var r={a:Ri};return r}async function G(){function r(s){return kr=s.exports,Qi(kr),T(),kr}function e(s){return r(s.instance)}var t=ur();rr??=ar();var n=await fr(z,rr,t),a=e(n);return a}var c,C;class Mr{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var gr,_,er,Sr,Ir,Fr,L,tr,Gr=globalThis.TextDecoder&&new TextDecoder,Er=(r,e,t,n)=>{var a=e+t;if(n)return a;for(;r[e]&&!(e>=a);)++e;return e},cr=(r,e=0,t,n)=>{var a=Er(r,e,t,n);if(a-e>16&&r.buffer&&Gr)return Gr.decode(r.subarray(e,a));for(var s="";e<a;){var l=r[e++];if(!(l&128)){s+=String.fromCharCode(l);continue}var h=r[e++]&63;if((l&224)==192){s+=String.fromCharCode((l&31)<<6|h);continue}var g=r[e++]&63;if((l&240)==224?l=(l&15)<<12|h<<6|g:l=(l&7)<<18|h<<12|g<<6|r[e++]&63,l<65536)s+=String.fromCharCode(l);else{var m=l-65536;s+=String.fromCharCode(55296|m>>10,56320|m&1023)}}return s},or=(r,e,t)=>r?cr(tr,r,e,t):"",zr=(r,e,t,n)=>M(`Assertion failed: ${or(r)}, at: `+[e?or(e):"unknown filename",t,n?or(n):"unknown function"]),U={isAbs:r=>r.charAt(0)==="/",splitPath:r=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return e.exec(r).slice(1)},normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var a=r[n];a==="."?r.splice(n,1):a===".."?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=U.isAbs(r),t=r.slice(-1)==="/";return r=U.normalizeArray(r.split("/").filter(n=>!!n),!e).join("/"),!r&&!e&&(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=U.splitPath(r),t=e[0],n=e[1];return!t&&!n?".":(n&&(n=n.slice(0,-1)),t+n)},basename:r=>r&&r.match(/([^\/]+|\/)\/*$/)[1],join:(...r)=>U.normalize(r.join("/")),join2:(r,e)=>U.normalize(r+"/"+e)},Lr=()=>r=>(crypto.getRandomValues(r),0),Hr=r=>(Hr=Lr())(r),Kr={resolve:(...r)=>{for(var e="",t=!1,n=r.length-1;n>=-1&&!t;n--){var a=n>=0?r[n]:i.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";e=a+"/"+e,t=U.isAbs(a)}return e=U.normalizeArray(e.split("/").filter(s=>!!s),!t).join("/"),(t?"/":"")+e||"."},relative:(r,e)=>{r=Kr.resolve(r).slice(1),e=Kr.resolve(e).slice(1);function t(m){for(var E=0;E<m.length&&m[E]==="";E++);for(var D=m.length-1;D>=0&&m[D]==="";D--);return E>D?[]:m.slice(E,D-E+1)}for(var n=t(r.split("/")),a=t(e.split("/")),s=Math.min(n.length,a.length),l=s,h=0;h<s;h++)if(n[h]!==a[h]){l=h;break}for(var g=[],h=l;h<n.length;h++)g.push("..");return g=g.concat(a.slice(l)),g.join("/")}},ce=[],Qr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},Ue=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,s=t+n-1,l=0;l<r.length;++l){var h=r.codePointAt(l);if(h<=127){if(t>=s)break;e[t++]=h}else if(h<=2047){if(t+1>=s)break;e[t++]=192|h>>6,e[t++]=128|h&63}else if(h<=65535){if(t+2>=s)break;e[t++]=224|h>>12,e[t++]=128|h>>6&63,e[t++]=128|h&63}else{if(t+3>=s)break;e[t++]=240|h>>18,e[t++]=128|h>>12&63,e[t++]=128|h>>6&63,e[t++]=128|h&63,l++}}return e[t]=0,t-a},pe=(r,e,t)=>{var n=t>0?t:Qr(r)+1,a=new Array(n),s=Ue(r,a,0,a.length);return e&&(a.length=s),a},It=()=>{if(!ce.length){var r=null;if(!r)return null;ce=pe(r,!0)}return ce.shift()},_r={ttys:[],init(){},shutdown(){},register(r,e){_r.ttys[r]={input:[],output:[],ops:e},i.registerDevice(r,_r.stream_ops)},stream_ops:{open(r){var e=_r.ttys[r.node.rdev];if(!e)throw new i.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,n,a){if(!r.tty||!r.tty.ops.get_char)throw new i.ErrnoError(60);for(var s=0,l=0;l<n;l++){var h;try{h=r.tty.ops.get_char(r.tty)}catch{throw new i.ErrnoError(29)}if(h===void 0&&s===0)throw new i.ErrnoError(6);if(h==null)break;s++,e[t+l]=h}return s&&(r.node.atime=Date.now()),s},write(r,e,t,n,a){if(!r.tty||!r.tty.ops.put_char)throw new i.ErrnoError(60);try{for(var s=0;s<n;s++)r.tty.ops.put_char(r.tty,e[t+s])}catch{throw new i.ErrnoError(29)}return n&&(r.node.mtime=r.node.ctime=Date.now()),s}},default_tty_ops:{get_char(r){return It()},put_char(r,e){e===null||e===10?(R(cr(r.output)),r.output=[]):e!=0&&r.output.push(e)},fsync(r){r.output?.length>0&&(R(cr(r.output)),r.output=[])},ioctl_tcgets(r){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(r,e,t){return 0},ioctl_tiocgwinsz(r){return[24,80]}},default_tty1_ops:{put_char(r,e){e===null||e===10?(P(cr(r.output)),r.output=[]):e!=0&&r.output.push(e)},fsync(r){r.output?.length>0&&(P(cr(r.output)),r.output=[])}}},Lt=(r,e)=>tr.fill(0,r,r+e),Ye=(r,e)=>Math.ceil(r/e)*e,Ne=r=>{r=Ye(r,65536);var e=dt(65536,r);return e&&Lt(e,r),e},I={ops_table:null,mount(r){return I.createNode(null,"/",16895,0)},createNode(r,e,t,n){if(i.isBlkdev(t)||i.isFIFO(t))throw new i.ErrnoError(63);I.ops_table||={dir:{node:{getattr:I.node_ops.getattr,setattr:I.node_ops.setattr,lookup:I.node_ops.lookup,mknod:I.node_ops.mknod,rename:I.node_ops.rename,unlink:I.node_ops.unlink,rmdir:I.node_ops.rmdir,readdir:I.node_ops.readdir,symlink:I.node_ops.symlink},stream:{llseek:I.stream_ops.llseek}},file:{node:{getattr:I.node_ops.getattr,setattr:I.node_ops.setattr},stream:{llseek:I.stream_ops.llseek,read:I.stream_ops.read,write:I.stream_ops.write,mmap:I.stream_ops.mmap,msync:I.stream_ops.msync}},link:{node:{getattr:I.node_ops.getattr,setattr:I.node_ops.setattr,readlink:I.node_ops.readlink},stream:{}},chrdev:{node:{getattr:I.node_ops.getattr,setattr:I.node_ops.setattr},stream:i.chrdev_stream_ops}};var a=i.createNode(r,e,t,n);return i.isDir(a.mode)?(a.node_ops=I.ops_table.dir.node,a.stream_ops=I.ops_table.dir.stream,a.contents={}):i.isFile(a.mode)?(a.node_ops=I.ops_table.file.node,a.stream_ops=I.ops_table.file.stream,a.usedBytes=0,a.contents=I.emptyFileContents??=new Uint8Array(0)):i.isLink(a.mode)?(a.node_ops=I.ops_table.link.node,a.stream_ops=I.ops_table.link.stream):i.isChrdev(a.mode)&&(a.node_ops=I.ops_table.chrdev.node,a.stream_ops=I.ops_table.chrdev.stream),a.atime=a.mtime=a.ctime=Date.now(),r&&(r.contents[e]=a,r.atime=r.mtime=r.ctime=a.atime),a},getFileDataAsTypedArray(r){return r.contents.subarray(0,r.usedBytes)},expandFileStorage(r,e){var t=r.contents.length;if(!(t>=e)){var n=1024*1024;e=Math.max(e,t*(t<n?2:1.125)>>>0),t&&(e=Math.max(e,256));var a=I.getFileDataAsTypedArray(r);r.contents=new Uint8Array(e),r.contents.set(a)}},resizeFileStorage(r,e){if(r.usedBytes!=e){var t=r.contents;r.contents=new Uint8Array(e),r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=i.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,i.isDir(r.mode)?e.size=4096:i.isFile(r.mode)?e.size=r.usedBytes:i.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.atime),e.mtime=new Date(r.mtime),e.ctime=new Date(r.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){for(let t of["mode","atime","mtime","ctime"])e[t]!=null&&(r[t]=e[t]);e.size!==void 0&&I.resizeFileStorage(r,e.size)},lookup(r,e){throw I.doesNotExistError||(I.doesNotExistError=new i.ErrnoError(44),I.doesNotExistError.stack="<generic error, no stack>"),I.doesNotExistError},mknod(r,e,t,n){return I.createNode(r,e,t,n)},rename(r,e,t){var n;try{n=i.lookupNode(e,t)}catch{}if(n){if(i.isDir(r.mode))for(var a in n.contents)throw new i.ErrnoError(55);i.hashRemoveNode(n)}delete r.parent.contents[r.name],e.contents[t]=r,r.name=t,e.ctime=e.mtime=r.parent.ctime=r.parent.mtime=Date.now()},unlink(r,e){delete r.contents[e],r.ctime=r.mtime=Date.now()},rmdir(r,e){var t=i.lookupNode(r,e);for(var n in t.contents)throw new i.ErrnoError(55);delete r.contents[e],r.ctime=r.mtime=Date.now()},readdir(r){return[".","..",...Object.keys(r.contents)]},symlink(r,e,t){var n=I.createNode(r,e,41471,0);return n.link=t,n},readlink(r){if(!i.isLink(r.mode))throw new i.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,n,a){var s=r.node.contents;if(a>=r.node.usedBytes)return 0;var l=Math.min(r.node.usedBytes-a,n);return e.set(s.subarray(a,a+l),t),l},write(r,e,t,n,a,s){if(e.buffer===er.buffer&&(s=!1),!n)return 0;var l=r.node;return l.mtime=l.ctime=Date.now(),s?(l.contents=e.subarray(t,t+n),l.usedBytes=n):l.usedBytes===0&&a===0?(l.contents=e.slice(t,t+n),l.usedBytes=n):(I.expandFileStorage(l,a+n),l.contents.set(e.subarray(t,t+n),a),l.usedBytes=Math.max(l.usedBytes,a+n)),n},llseek(r,e,t){var n=e;if(t===1?n+=r.position:t===2&&i.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new i.ErrnoError(28);return n},mmap(r,e,t,n,a){if(!i.isFile(r.node.mode))throw new i.ErrnoError(43);var s,l,h=r.node.contents;if(!(a&2)&&h.buffer===er.buffer)l=!1,s=h.byteOffset;else{if(l=!0,s=Ne(e),!s)throw new i.ErrnoError(48);h&&((t>0||t+e<h.length)&&(h.subarray?h=h.subarray(t,t+e):h=Array.prototype.slice.call(h,t,t+e)),er.set(h,s))}return{ptr:s,allocated:l}},msync(r,e,t,n,a){return I.stream_ops.write(r,e,0,n,t,!1),0}}},Ot=r=>{if(typeof r!="string")return r;var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=e[r];if(typeof t>"u")throw new Error(`Unknown file open mode: ${r}`);return t},We=r=>(typeof r=="string"&&(r=pe(r,!0)),r.subarray||(r=new Uint8Array(r)),r),ye=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},Pt=async r=>{var e=await F(r);return new Uint8Array(e)},zt=(...r)=>i.createDataFile(...r),Kt=r=>r,Se=null,Ut=async()=>Se,Rr=0,Ge=null,Yt=r=>{Rr--,Rr||Ge()},Nt=r=>{Rr||(Se=new Promise(e=>Ge=e)),Rr++},Wt=[],St=async(r,e)=>{typeof Browser<"u"&&Browser.init();for(var t of Wt)if(t.canHandle(e))return t.handle(r,e);return r},He=async(r,e,t,n,a,s,l,h)=>{var g=e?Kr.resolve(U.join2(r,e)):r,m=Kt(`cp ${g}`);Nt(m);try{var E=t;typeof t=="string"&&(E=await Pt(t)),E=await St(E,g),h?.(),s||zt(r,e,E,n,a,l)}finally{Yt(m)}},Gt=(r,e,t,n,a,s,l,h,g,m)=>{He(r,e,t,n,a,h,g,m).then(s).catch(l)},i={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,ErrnoError:class{name="ErrnoError";constructor(r){this.errno=r}},FSStream:class{shared={};get object(){return this.node}set object(r){this.node=r}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(r){this.shared.flags=r}get position(){return this.shared.position}set position(r){this.shared.position=r}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.id=i.nextInode++,this.name=e,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(r){r?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(r){r?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return i.isDir(this.mode)}get isDevice(){return i.isChrdev(this.mode)}addListener(r,e=!1){var t={cb:r,exclusive:e},n=this.listeners??=new Set;return n.add(t),{listeners:n,entry:t}}notifyListeners(r){if(this.listeners){var e;for(var t of this.listeners)t.exclusive?(e||=[]).push(t):t.cb(r);if(e){var n=(this.exclTurn||0)%e.length;this.exclTurn=n+1,e[n].cb(r)}}}},lookupPath(r,e={}){if(!r)throw new i.ErrnoError(44);e.follow_mount??=!0,U.isAbs(r)||(r=i.cwd()+"/"+r);r:for(var t=0;t<40;t++){for(var n=r.split("/").filter(m=>!!m),a=i.root,s="/",l=0;l<n.length;l++){var h=l===n.length-1;if(h&&e.parent)break;if(n[l]!=="."){if(n[l]===".."){if(s=U.dirname(s),i.isRoot(a)){r=s+"/"+n.slice(l+1).join("/"),t--;continue r}else a=a.parent;continue}s=U.join2(s,n[l]);try{a=i.lookupNode(a,n[l])}catch(m){if(m?.errno===44&&h&&e.noent_okay)return{path:s};throw m}if(i.isMountpoint(a)&&(!h||e.follow_mount)&&(a=a.mounted.root),i.isLink(a.mode)&&(!h||e.follow)){if(!a.node_ops.readlink)throw new i.ErrnoError(52);var g=a.node_ops.readlink(a);U.isAbs(g)||(g=U.dirname(s)+"/"+g),r=g+"/"+n.slice(l+1).join("/");continue r}}}return{path:s,node:a}}throw new i.ErrnoError(32)},getPath(r){for(var e;;){if(i.isRoot(r)){var t=r.mount.mountpoint;return e?t[t.length-1]!=="/"?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%i.nameTable.length},hashAddNode(r){var e=i.hashName(r.parent.id,r.name);r.name_next=i.nameTable[e],i.nameTable[e]=r},hashRemoveNode(r){var e=i.hashName(r.parent.id,r.name);if(i.nameTable[e]===r)i.nameTable[e]=r.name_next;else for(var t=i.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=i.mayLookup(r);if(t)throw new i.ErrnoError(t);for(var n=i.hashName(r.id,e),a=i.nameTable[n];a;a=a.name_next){var s=a.name;if(a.parent.id===r.id&&s===e)return a}return i.lookup(r,e)},createNode(r,e,t,n){var a=new i.FSNode(r,e,t,n);return i.hashAddNode(a),a},destroyNode(r){i.hashRemoveNode(r)},isRoot(r){return r===r.parent},isMountpoint(r){return!!r.mounted},isFile(r){return(r&61440)===32768},isDir(r){return(r&61440)===16384},isLink(r){return(r&61440)===40960},isChrdev(r){return(r&61440)===8192},isBlkdev(r){return(r&61440)===24576},isFIFO(r){return(r&61440)===4096},isSocket(r){return(r&49152)===49152},flagsToPermissionString(r){var e=["r","w","rw"][r&3];return r&512&&(e+="w"),e},nodePermissions(r,e){return i.ignorePermissions?0:e.includes("r")&&!(r.mode&292)||e.includes("w")&&!(r.mode&146)||e.includes("x")&&!(r.mode&73)?2:0},mayLookup(r){if(!i.isDir(r.mode))return 54;var e=i.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate(r,e){if(!i.isDir(r.mode))return 54;try{var t=i.lookupNode(r,e);return 20}catch{}return i.nodePermissions(r,"wx")},mayDelete(r,e,t){var n;try{n=i.lookupNode(r,e)}catch(s){return s.errno}var a=i.nodePermissions(r,"wx");if(a)return a;if(t){if(!i.isDir(n.mode))return 54;if(i.isRoot(n)||i.getPath(n)===i.cwd())return 10}else if(i.isDir(n.mode))return 31;return 0},mayOpen(r,e){if(!r)return 44;if(i.isLink(r.mode))return 32;var t=i.flagsToPermissionString(e);return i.isDir(r.mode)&&(t!=="r"||e&576)?31:i.nodePermissions(r,t)},checkOpExists(r,e){if(!r)throw new i.ErrnoError(e);return r},MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=i.MAX_OPEN_FDS;r++)if(!i.streams[r])return r;throw new i.ErrnoError(33)},getStreamChecked(r){var e=i.getStream(r);if(!e)throw new i.ErrnoError(8);return e},getStream:r=>i.streams[r],createStream(r,e=-1){return r=Object.assign(new i.FSStream,r),e==-1&&(e=i.nextfd()),r.fd=e,i.streams[e]=r,r},closeStream(r){i.streams[r]=null},dupStream(r,e=-1){var t=i.createStream(r,e);return t.stream_ops?.dup?.(t),t},doSetAttr(r,e,t){var n=r?.stream_ops.setattr,a=n?r:e;n??=e.node_ops.setattr,i.checkOpExists(n,63);try{n(a,t)}catch(s){throw s instanceof RangeError?new i.ErrnoError(22):s}},chrdev_stream_ops:{open(r){var e=i.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open?.(r)},llseek(){throw new i.ErrnoError(70)}},major:r=>r>>8,minor:r=>r&255,makedev:(r,e)=>r<<8|e,registerDevice(r,e){i.devices[r]={stream_ops:e}},getDevice:r=>i.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push(...n.mounts)}return e},syncfs(r,e){typeof r=="function"&&(e=r,r=!1),i.syncFSRequests++,i.syncFSRequests>1&&P(`warning: ${i.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=i.getMounts(i.root.mount),n=0;function a(h){return i.syncFSRequests--,e(h)}function s(h){if(h)return s.errored?void 0:(s.errored=!0,a(h));++n>=t.length&&a(null)}for(var l of t)l.type.syncfs?l.type.syncfs(l,r,s):s(null)},mount(r,e,t){var n=t==="/",a=!t,s;if(n&&i.root)throw new i.ErrnoError(10);if(!n&&!a){var l=i.lookupPath(t,{follow_mount:!1});if(t=l.path,s=l.node,i.isMountpoint(s))throw new i.ErrnoError(10);if(!i.isDir(s.mode))throw new i.ErrnoError(54)}var h={type:r,opts:e,mountpoint:t,mounts:[]},g=r.mount(h);return g.mount=h,h.root=g,n?i.root=g:s&&(s.mounted=h,s.mount&&s.mount.mounts.push(h)),g},unmount(r){var e=i.lookupPath(r,{follow_mount:!1});if(!i.isMountpoint(e.node))throw new i.ErrnoError(28);var t=e.node,n=t.mounted,a=i.getMounts(n);for(var[s,l]of Object.entries(i.nameTable))for(;l;){var h=l.name_next;a.includes(l.mount)&&i.destroyNode(l),l=h}t.mounted=null;var g=t.mount.mounts.indexOf(n);t.mount.mounts.splice(g,1)},lookup(r,e){return r.node_ops.lookup(r,e)},mknod(r,e,t){var n=i.lookupPath(r,{parent:!0}),a=n.node,s=U.basename(r);if(!s)throw new i.ErrnoError(28);if(s==="."||s==="..")throw new i.ErrnoError(20);var l=i.mayCreate(a,s);if(l)throw new i.ErrnoError(l);if(!a.node_ops.mknod)throw new i.ErrnoError(63);return a.node_ops.mknod(a,s,e,t)},statfs(r){return i.statfsNode(i.lookupPath(r,{follow:!0}).node)},statfsStream(r){return i.statfsNode(r.node)},statfsNode(r){var e={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:i.nextInode,ffree:i.nextInode-1,fsid:42,flags:2,namelen:255};return r.node_ops.statfs&&Object.assign(e,r.node_ops.statfs(r.mount.opts.root)),e},create(r,e=438){return e&=4095,e|=32768,i.mknod(r,e,0)},mkdir(r,e=511){return e&=1023,e|=16384,i.mknod(r,e,0)},mkdirTree(r,e){var t=r.split("/"),n="";for(var a of t)if(a){(n||U.isAbs(r))&&(n+="/"),n+=a;try{i.mkdir(n,e)}catch(s){if(s.errno!=20)throw s}}},mkdev(r,e,t){return typeof t>"u"&&(t=e,e=438),e|=8192,i.mknod(r,e,t)},symlink(r,e){if(!Kr.resolve(r))throw new i.ErrnoError(44);var t=i.lookupPath(e,{parent:!0}),n=t.node;if(!n)throw new i.ErrnoError(44);var a=U.basename(e),s=i.mayCreate(n,a);if(s)throw new i.ErrnoError(s);if(!n.node_ops.symlink)throw new i.ErrnoError(63);return n.node_ops.symlink(n,a,r)},link(r,e,t){var n=i.lookupPath(e,{parent:!0}),a=n.node;if(!a)throw new i.ErrnoError(44);var s=U.basename(e),l=i.mayCreate(a,s);if(l)throw new i.ErrnoError(l);if(!a.node_ops.link)throw new i.ErrnoError(34);return a.node_ops.link(a,s,r,t)},rename(r,e){var t=U.dirname(r),n=U.dirname(e),a=U.basename(r),s=U.basename(e),l,h,g;if(l=i.lookupPath(r,{parent:!0}),h=l.node,l=i.lookupPath(e,{parent:!0}),g=l.node,!h||!g)throw new i.ErrnoError(44);if(h.mount!==g.mount)throw new i.ErrnoError(75);var m=i.lookupNode(h,a),E=Kr.relative(r,n);if(E.charAt(0)!==".")throw new i.ErrnoError(28);if(E=Kr.relative(e,t),E.charAt(0)!==".")throw new i.ErrnoError(55);var D;try{D=i.lookupNode(g,s)}catch{}if(m!==D){var w=i.isDir(m.mode),B=i.mayDelete(h,a,w);if(B)throw new i.ErrnoError(B);if(B=D?i.mayDelete(g,s,w):i.mayCreate(g,s),B)throw new i.ErrnoError(B);if(!h.node_ops.rename)throw new i.ErrnoError(63);if(i.isMountpoint(m)||D&&i.isMountpoint(D))throw new i.ErrnoError(10);if(g!==h&&(B=i.nodePermissions(h,"w"),B))throw new i.ErrnoError(B);i.hashRemoveNode(m);try{h.node_ops.rename(m,g,s),m.parent=g}catch(O){throw O}finally{i.hashAddNode(m)}}},rmdir(r){var e=i.lookupPath(r,{parent:!0}),t=e.node,n=U.basename(r),a=i.lookupNode(t,n),s=i.mayDelete(t,n,!0);if(s)throw new i.ErrnoError(s);if(!t.node_ops.rmdir)throw new i.ErrnoError(63);if(i.isMountpoint(a))throw new i.ErrnoError(10);t.node_ops.rmdir(t,n),i.destroyNode(a)},readdir(r){var e=i.lookupPath(r,{follow:!0}),t=e.node,n=i.checkOpExists(t.node_ops.readdir,54);return n(t)},unlink(r){var e=i.lookupPath(r,{parent:!0}),t=e.node;if(!t)throw new i.ErrnoError(44);var n=U.basename(r),a=i.lookupNode(t,n),s=i.mayDelete(t,n,!1);if(s)throw new i.ErrnoError(s);if(!t.node_ops.unlink)throw new i.ErrnoError(63);if(i.isMountpoint(a))throw new i.ErrnoError(10);t.node_ops.unlink(t,n),i.destroyNode(a)},readlink(r){var e=i.lookupPath(r),t=e.node;if(!t)throw new i.ErrnoError(44);if(!t.node_ops.readlink)throw new i.ErrnoError(28);return t.node_ops.readlink(t)},stat(r,e){var t=i.lookupPath(r,{follow:!e}),n=t.node,a=i.checkOpExists(n.node_ops.getattr,63);return a(n)},fstat(r){var e=i.getStreamChecked(r),t=e.node,n=e.stream_ops.getattr,a=n?e:t;return n??=t.node_ops.getattr,i.checkOpExists(n,63),n(a)},lstat(r){return i.stat(r,!0)},doChmod(r,e,t,n){i.doSetAttr(r,e,{mode:t&4095|e.mode&-4096,ctime:Date.now(),dontFollow:n})},chmod(r,e,t){var n;if(typeof r=="string"){var a=i.lookupPath(r,{follow:!t});n=a.node}else n=r;i.doChmod(null,n,e,t)},lchmod(r,e){i.chmod(r,e,!0)},fchmod(r,e){var t=i.getStreamChecked(r);i.doChmod(t,t.node,e,!1)},doChown(r,e,t){i.doSetAttr(r,e,{timestamp:Date.now(),dontFollow:t})},chown(r,e,t,n){var a;if(typeof r=="string"){var s=i.lookupPath(r,{follow:!n});a=s.node}else a=r;i.doChown(null,a,n)},lchown(r,e,t){i.chown(r,e,t,!0)},fchown(r,e,t){var n=i.getStreamChecked(r);i.doChown(n,n.node,!1)},doTruncate(r,e,t){if(i.isDir(e.mode))throw new i.ErrnoError(31);if(!i.isFile(e.mode))throw new i.ErrnoError(28);var n=i.nodePermissions(e,"w");if(n)throw new i.ErrnoError(n);i.doSetAttr(r,e,{size:t,timestamp:Date.now()})},truncate(r,e){if(e<0)throw new i.ErrnoError(28);var t;if(typeof r=="string"){var n=i.lookupPath(r,{follow:!0});t=n.node}else t=r;i.doTruncate(null,t,e)},ftruncate(r,e){var t=i.getStreamChecked(r);if(e<0||(t.flags&2097155)===0)throw new i.ErrnoError(28);i.doTruncate(t,t.node,e)},utime(r,e,t,n){var a=i.lookupPath(r,{follow:!n});i.doSetAttr(null,a.node,{atime:e,mtime:t,dontFollow:n})},open(r,e,t=438){if(r==="")throw new i.ErrnoError(44);e=Ot(e),e&64?t=t&4095|32768:t=0;var n,a;if(typeof r=="object")n=r;else{a=r.endsWith("/");var s=i.lookupPath(r,{follow:!(e&131072),noent_okay:!0});n=s.node,r=s.path}var l=!1;if(e&64)if(n){if(e&128)throw new i.ErrnoError(20)}else{if(a)throw new i.ErrnoError(31);n=i.mknod(r,t|511,0),l=!0}if(!n)throw new i.ErrnoError(44);if(i.isChrdev(n.mode)&&(e&=-513),e&65536&&!i.isDir(n.mode))throw new i.ErrnoError(54);if(!l){var h=i.mayOpen(n,e);if(h)throw new i.ErrnoError(h)}e&512&&!l&&i.truncate(n,0),e&=-131713;var g=i.createStream({node:n,path:i.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return g.stream_ops.open&&g.stream_ops.open(g),l&&i.chmod(n,t&511),g},close(r){if(i.isClosed(r))throw new i.ErrnoError(8);r.getdents&&(r.getdents=null),r.node?.notifyListeners(32);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{i.closeStream(r.fd)}r.fd=null},isClosed(r){return r.fd===null},llseek(r,e,t){if(i.isClosed(r))throw new i.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new i.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new i.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,n,a){if(n<0||a<0)throw new i.ErrnoError(28);if(i.isClosed(r))throw new i.ErrnoError(8);if((r.flags&2097155)===1)throw new i.ErrnoError(8);if(i.isDir(r.node.mode))throw new i.ErrnoError(31);if(!r.stream_ops.read)throw new i.ErrnoError(28);var s=typeof a<"u";if(!s)a=r.position;else if(!r.seekable)throw new i.ErrnoError(70);var l=r.stream_ops.read(r,e,t,n,a);return s||(r.position+=l),l},write(r,e,t,n,a,s){if(n<0||a<0)throw new i.ErrnoError(28);if(i.isClosed(r))throw new i.ErrnoError(8);if((r.flags&2097155)===0)throw new i.ErrnoError(8);if(i.isDir(r.node.mode))throw new i.ErrnoError(31);if(!r.stream_ops.write)throw new i.ErrnoError(28);r.seekable&&r.flags&1024&&i.llseek(r,0,2);var l=typeof a<"u";if(!l)a=r.position;else if(!r.seekable)throw new i.ErrnoError(70);var h=r.stream_ops.write(r,e,t,n,a,s);return l||(r.position+=h),h},mmap(r,e,t,n,a){if((n&2)!==0&&(a&2)===0&&(r.flags&2097155)!==2)throw new i.ErrnoError(2);if((r.flags&2097155)===1)throw new i.ErrnoError(2);if(!r.stream_ops.mmap)throw new i.ErrnoError(43);if(!e)throw new i.ErrnoError(28);return r.stream_ops.mmap(r,e,t,n,a)},msync(r,e,t,n,a){return r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,a):0},ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new i.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){e.flags=e.flags??0,e.encoding=e.encoding??"binary",e.encoding!=="utf8"&&e.encoding!=="binary"&&M(`Invalid encoding type "${e.encoding}"`);var t=i.open(r,e.flags),n=i.stat(r),a=n.size,s=new Uint8Array(a);return i.read(t,s,0,a,0),e.encoding==="utf8"&&(s=cr(s)),i.close(t),s},writeFile(r,e,t={}){t.flags=t.flags??577;var n=i.open(r,t.flags,t.mode);e=We(e),i.write(n,e,0,e.byteLength,void 0,t.canOwn),i.close(n)},cwd:()=>i.currentPath,chdir(r){var e=i.lookupPath(r,{follow:!0});if(e.node===null)throw new i.ErrnoError(44);if(!i.isDir(e.node.mode))throw new i.ErrnoError(54);var t=i.nodePermissions(e.node,"x");if(t)throw new i.ErrnoError(t);i.currentPath=e.path},createDefaultDirectories(){i.mkdir("/tmp"),i.mkdir("/home"),i.mkdir("/home/web_user")},createDefaultDevices(){i.mkdir("/dev"),i.registerDevice(i.makedev(1,3),{read:()=>0,write:(n,a,s,l,h)=>l,llseek:()=>0}),i.mkdev("/dev/null",i.makedev(1,3)),_r.register(i.makedev(5,0),_r.default_tty_ops),_r.register(i.makedev(6,0),_r.default_tty1_ops),i.mkdev("/dev/tty",i.makedev(5,0)),i.mkdev("/dev/tty1",i.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(e===0&&(Hr(r),e=r.byteLength),r[--e]);i.createDevice("/dev","random",t),i.createDevice("/dev","urandom",t),i.mkdir("/dev/shm"),i.mkdir("/dev/shm/tmp")},createSpecialDirectories(){i.mkdir("/proc");var r=i.mkdir("/proc/self");i.mkdir("/proc/self/fd"),i.mount({mount(){var e=i.createNode(r,"fd",16895,73);return e.stream_ops={llseek:I.stream_ops.llseek},e.node_ops={lookup(t,n){var a=+n,s=i.getStreamChecked(a),l={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>s.path},id:a+1};return l.parent=l,l},readdir(){return Array.from(i.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},e}},{},"/proc/self/fd")},createStandardStreams(r,e,t){r?i.createDevice("/dev","stdin",r):i.symlink("/dev/tty","/dev/stdin"),e?i.createDevice("/dev","stdout",null,e):i.symlink("/dev/tty","/dev/stdout"),t?i.createDevice("/dev","stderr",null,t):i.symlink("/dev/tty1","/dev/stderr");var n=i.open("/dev/stdin",0),a=i.open("/dev/stdout",1),s=i.open("/dev/stderr",1)},staticInit(){i.nameTable=new Array(4096),i.mount(I,{},"/"),i.createDefaultDirectories(),i.createDefaultDevices(),i.createSpecialDirectories(),i.filesystems={MEMFS:I}},init(r,e,t){i.initialized=!0,i.createStandardStreams(r,e,t)},quit(){i.initialized=!1;for(var r of i.streams)r&&i.close(r)},findObject(r,e){var t=i.analyzePath(r,e);return t.exists?t.object:null},analyzePath(r,e){try{var t=i.lookupPath(r,{follow:!e});r=t.path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=i.lookupPath(r,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=U.basename(r),t=i.lookupPath(r,{follow:!e}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(a){n.error=a.errno}return n},createPath(r,e,t,n){r=typeof r=="string"?r:i.getPath(r);for(var a=e.split("/").reverse();a.length;){var s=a.pop();if(s){var l=U.join2(r,s);try{i.mkdir(l)}catch(h){if(h.errno!=20)throw h}r=l}}return l},createFile(r,e,t,n,a){var s=U.join2(typeof r=="string"?r:i.getPath(r),e),l=ye(n,a);return i.create(s,l)},createDataFile(r,e,t,n,a,s){var l=e;r&&(r=typeof r=="string"?r:i.getPath(r),l=e?U.join2(r,e):r);var h=ye(n,a),g=i.create(l,h);if(t){t=We(t),i.chmod(g,h|146);var m=i.open(g,577);i.write(m,t,0,t.length,0,s),i.close(m),i.chmod(g,h)}},createDevice(r,e,t,n){var a=U.join2(typeof r=="string"?r:i.getPath(r),e),s=ye(!!t,!!n);i.createDevice.major??=64;var l=i.makedev(i.createDevice.major++,0);return i.registerDevice(l,{open(h){h.seekable=!1},close(h){n?.buffer?.length&&n(10)},read(h,g,m,E,D){for(var w=0,B=0;B<E;B++){var O;try{O=t()}catch{throw new i.ErrnoError(29)}if(O===void 0&&w===0)throw new i.ErrnoError(6);if(O==null)break;w++,g[m+B]=O}return w&&(h.node.atime=Date.now()),w},write(h,g,m,E,D){for(var w=0;w<E;w++)try{n(g[m+w])}catch{throw new i.ErrnoError(29)}return E&&(h.node.mtime=h.node.ctime=Date.now()),w}}),i.mkdev(a,s,l)},forceLoadFile(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if(globalThis.XMLHttpRequest)M("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{r.contents=x(r.url)}catch{throw new i.ErrnoError(29)}},createLazyFile(r,e,t,n,a){class s{lengthKnown=!1;chunks=[];get(w){if(!(w>this.length-1||w<0)){var B=w%this.chunkSize,O=w/this.chunkSize|0;return this.getter(O)[B]}}setDataGetter(w){this.getter=w}cacheLength(){var w=new XMLHttpRequest;w.open("HEAD",t,!1),w.send(null),w.status>=200&&w.status<300||w.status===304||M("Couldn't load "+t+". Status: "+w.status);var B=Number(w.getResponseHeader("Content-length")),O,H=(O=w.getResponseHeader("Accept-Ranges"))&&O==="bytes",S=(O=w.getResponseHeader("Content-Encoding"))&&O==="gzip",Y=1024*1024;H||(Y=B);var A=(sr,ir)=>{sr>ir&&M(`invalid range (${sr}, ${ir}) or no bytes requested!`),ir>B-1&&M(`only ${B} bytes available! programmer error!`);var X=new XMLHttpRequest;return X.open("GET",t,!1),B!==Y&&X.setRequestHeader("Range","bytes="+sr+"-"+ir),X.responseType="arraybuffer",X.overrideMimeType&&X.overrideMimeType("text/plain; charset=x-user-defined"),X.send(null),X.status>=200&&X.status<300||X.status===304||M("Couldn't load "+t+". Status: "+X.status),X.response!==void 0?new Uint8Array(X.response||[]):pe(X.responseText??"",!0)},q=this;q.setDataGetter(sr=>{var ir=sr*Y,X=(sr+1)*Y-1;return X=Math.min(X,B-1),typeof q.chunks[sr]>"u"&&(q.chunks[sr]=A(ir,X)),typeof q.chunks[sr]>"u"&&M("doXHR failed!"),q.chunks[sr]}),(S||!B)&&(Y=B=1,B=this.getter(0).length,Y=B,R("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=B,this._chunkSize=Y,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){u||M("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var l=new s,h={isDevice:!1,contents:l}}else var h={isDevice:!1,url:t};var g=i.createFile(r,e,h,n,a);h.contents?g.contents=h.contents:h.url&&(g.contents=null,g.url=h.url),Object.defineProperties(g,{usedBytes:{get:function(){return this.contents.length}}});var m={};for(let[D,w]of Object.entries(g.stream_ops))m[D]=(...B)=>(i.forceLoadFile(g),w(...B));function E(D,w,B,O,H){var S=D.node.contents;if(H>=S.length)return 0;var Y=Math.min(S.length-H,O);if(S.slice)for(var A=0;A<Y;A++)w[B+A]=S[H+A];else for(var A=0;A<Y;A++)w[B+A]=S.get(H+A);return Y}return m.read=(D,w,B,O,H)=>(i.forceLoadFile(g),E(D,w,B,O,H)),m.mmap=(D,w,B,O,H)=>{i.forceLoadFile(g);var S=Ne(w);if(!S)throw new i.ErrnoError(48);return E(D,er,S,w,B),{ptr:S,allocated:!0}},g.stream_ops=m,g}},Q={currentUmask:18,calculateAt(r,e,t){if(U.isAbs(e))return e;var n;if(r===-100)n=i.cwd();else{var a=Q.getStreamFromFD(r);n=a.path}if(e.length==0){if(!t)throw new i.ErrnoError(44);return n}return n+"/"+e},writeStat(r,e){L[r>>2]=e.dev,L[r+4>>2]=e.mode,L[r+8>>2]=e.nlink,L[r+12>>2]=e.uid,L[r+16>>2]=e.gid,L[r+20>>2]=e.rdev,C=[e.size>>>0,(c=e.size,+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+24>>2]=C[0],_[r+28>>2]=C[1],_[r+32>>2]=4096,_[r+36>>2]=e.blocks;var t=e.atime.getTime(),n=e.mtime.getTime(),a=e.ctime.getTime();return C=[Math.floor(t/1e3)>>>0,(c=Math.floor(t/1e3),+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+40>>2]=C[0],_[r+44>>2]=C[1],L[r+48>>2]=t%1e3*1e3*1e3,C=[Math.floor(n/1e3)>>>0,(c=Math.floor(n/1e3),+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+56>>2]=C[0],_[r+60>>2]=C[1],L[r+64>>2]=n%1e3*1e3*1e3,C=[Math.floor(a/1e3)>>>0,(c=Math.floor(a/1e3),+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+72>>2]=C[0],_[r+76>>2]=C[1],L[r+80>>2]=a%1e3*1e3*1e3,C=[e.ino>>>0,(c=e.ino,+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+88>>2]=C[0],_[r+92>>2]=C[1],0},writeStatFs(r,e){L[r+4>>2]=e.bsize,L[r+60>>2]=e.bsize,C=[e.blocks>>>0,(c=e.blocks,+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+8>>2]=C[0],_[r+12>>2]=C[1],C=[e.bfree>>>0,(c=e.bfree,+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+16>>2]=C[0],_[r+20>>2]=C[1],C=[e.bavail>>>0,(c=e.bavail,+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+24>>2]=C[0],_[r+28>>2]=C[1],C=[e.files>>>0,(c=e.files,+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+32>>2]=C[0],_[r+36>>2]=C[1],C=[e.ffree>>>0,(c=e.ffree,+Math.abs(c)>=1?c>0?+Math.floor(c/4294967296)>>>0:~~+Math.ceil((c-+(~~c>>>0))/4294967296)>>>0:0)],_[r+40>>2]=C[0],_[r+44>>2]=C[1],L[r+48>>2]=e.fsid,L[r+64>>2]=e.flags,L[r+56>>2]=e.namelen},doMsync(r,e,t,n,a){if(!i.isFile(e.node.mode))throw new i.ErrnoError(43);if(n&2)return 0;var s=tr.subarray(r,r+t);i.msync(e,s,a,t,n)},getStreamFromFD(r){var e=i.getStreamChecked(r);return e},varargs:void 0,getStr(r){var e=or(r);return e}};function Ht(r,e,t,n){try{if(e=Q.getStr(e),e=Q.calculateAt(r,e),t&-8)return-28;var a=i.lookupPath(e,{follow:!0}),s=a.node;if(!s)return-44;var l="";return t&4&&(l+="r"),t&2&&(l+="w"),t&1&&(l+="x"),l&&i.nodePermissions(s,l)?-2:0}catch(h){if(typeof i>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}var re=()=>{var r=_[+Q.varargs>>2];return Q.varargs+=4,r},Ur=re;function Qt(r,e,t){Q.varargs=t;try{var n=Q.getStreamFromFD(r);switch(e){case 0:{var a=re();if(a<0)return-28;for(;i.streams[a];)a++;var s;return s=i.dupStream(n,a),s.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var a=re(),l=289792;return n.flags=n.flags&~l|a&l,0}case 12:{var a=Ur(),h=0;return gr[a+h>>1]=2,0}case 13:case 14:return 0}return-28}catch(g){if(typeof i>"u"||g.name!=="ErrnoError")throw g;return-g.errno}}function Rt(r,e){try{return Q.writeStat(e,i.fstat(r))}catch(t){if(typeof i>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function $t(r,e,t){Q.varargs=t;try{var n=Q.getStreamFromFD(r);switch(e){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var a=n.tty.ops.ioctl_tcgets(n),s=Ur();_[s>>2]=a.c_iflag||0,_[s+4>>2]=a.c_oflag||0,_[s+8>>2]=a.c_cflag||0,_[s+12>>2]=a.c_lflag||0;for(var l=0;l<32;l++)er[s+l+17]=a.c_cc[l]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var s=Ur(),h=_[s>>2],g=_[s+4>>2],m=_[s+8>>2],E=_[s+12>>2],D=[],l=0;l<32;l++)D.push(er[s+l+17]);return n.tty.ops.ioctl_tcsets(n.tty,e,{c_iflag:h,c_oflag:g,c_cflag:m,c_lflag:E,c_cc:D})}return 0}case 21519:{if(!n.tty)return-59;var s=Ur();return _[s>>2]=0,0}case 21520:return n.tty?-28:-59;case 21537:case 21531:{var s=Ur();return i.ioctl(n,e,s)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var w=n.tty.ops.ioctl_tiocgwinsz(n.tty),s=Ur();gr[s>>1]=w[0],gr[s+2>>1]=w[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(B){if(typeof i>"u"||B.name!=="ErrnoError")throw B;return-B.errno}}function Xt(r,e,t,n){Q.varargs=n;try{e=Q.getStr(e),e=Q.calculateAt(r,e);var a=n?re():0;return t&64&&(a&=~Q.currentUmask),i.open(e,t,a).fd}catch(s){if(typeof i>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}var Dr=(r,e,t)=>Ue(r,tr,e,t);function qt(r,e,t,n){try{if(e=Q.getStr(e),e=Q.calculateAt(r,e),n<=0)return-28;var a=i.readlink(e),s=Math.min(n,Qr(a)),l=er[t+s];return Dr(a,t,n+1),er[t+s]=l,s}catch(h){if(typeof i>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}function Vt(r){try{return r=Q.getStr(r),i.rmdir(r),0}catch(e){if(typeof i>"u"||e.name!=="ErrnoError")throw e;return-e.errno}}function jt(r,e,t){try{if(e=Q.getStr(e),e=Q.calculateAt(r,e),!t)i.unlink(e);else if(t===512)i.rmdir(e);else return-28;return 0}catch(n){if(typeof i>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}var Qe=()=>mt,kt=r=>{var e=r.getArg(Qe(),0);return pt(e)},Tt=()=>ct(),Zt=r=>ft(r),Re=r=>gt(r),Jt=r=>{var e=Tt(),t=Re(4),n=Re(4);yt(r,t,n);var a=L[t>>2],s=L[n>>2],l=or(a);yr(a);var h;return s&&(h=or(s),yr(s)),Zt(e),[l,h]},At=r=>{var e=kt(r);return Jt(e)},rn=r=>{var e=new WebAssembly.Exception(Qe(),[r],{traceStack:!0});throw e.message=At(e),e},en=()=>M(""),tn=(r,e,t,n,a)=>{},lr=r=>{for(var e="";;){var t=tr[r++];if(!t)return e;e+=String.fromCharCode(t)}},Yr={},Nr={},ee={},$r=class extends Error{constructor(e){super(e),this.name="BindingError"}},N=r=>{throw new $r(r)};function nn(r,e,t={}){var n=e.name;if(r||N(`type "${n}" must have a positive integer typeid pointer`),Nr.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;N(`Cannot register type '${n}' twice`)}if(Nr[r]=e,delete ee[r],Yr.hasOwnProperty(r)){var a=Yr[r];delete Yr[r],a.forEach(s=>s())}}function wr(r,e,t={}){return nn(r,e,t)}var on=(r,e,t,n)=>{e=lr(e),wr(r,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,s){return s?t:n},readValueFromPointer:function(a){return this.fromWireType(tr[a])},destructorFunction:null})},an=r=>({count:r.count,deleteScheduled:r.deleteScheduled,preservePointerOnDelete:r.preservePointerOnDelete,ptr:r.ptr,ptrType:r.ptrType,smartPtr:r.smartPtr,smartPtrType:r.smartPtrType}),me=r=>{function e(t){return t.$$.ptrType.registeredClass.name}N(e(r)+" instance already deleted")},Ee=!1,$e=r=>{},sn=r=>{r.smartPtr?r.smartPtrType.rawDestructor(r.smartPtr):r.ptrType.registeredClass.rawDestructor(r.ptr)},Xe=r=>{r.count.value-=1;var e=r.count.value===0;e&&sn(r)},Xr=r=>globalThis.FinalizationRegistry?(Ee=new FinalizationRegistry(e=>{Xe(e.$$)}),Xr=e=>{var t=e.$$,n=!!t.smartPtr;if(n){var a={$$:t};Ee.register(e,a,e)}return e},$e=e=>Ee.unregister(e),Xr(r)):(Xr=e=>e,r),te=[],un=()=>{for(;te.length;){var r=te.pop();r.$$.deleteScheduled=!1,r.delete()}},qe,ln=()=>{let r=ne.prototype;Object.assign(r,{isAliasOf(t){if(!(this instanceof ne)||!(t instanceof ne))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;t.$$=t.$$;for(var s=t.$$.ptrType.registeredClass,l=t.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;s.baseClass;)l=s.upcast(l),s=s.baseClass;return n===s&&a===l},clone(){if(this.$$.ptr||me(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Xr(Object.create(Object.getPrototypeOf(this),{$$:{value:an(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&N("Object already scheduled for deletion"),$e(this),Xe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&N("Object already scheduled for deletion"),