esbuild-wasm-no-blob
code:mod.js
function xe(t){let e=l=>{if(l===null)n.write8(0);else if(typeof l=="boolean")n.write8(1),n.write8(+l);else if(typeof l=="number")n.write8(2),n.write32(l|0);else if(typeof l=="string")n.write8(3),n.write(X(l));else if(l instanceof Uint8Array)n.write8(4),n.write(l);else if(l instanceof Array){n.write8(5),n.write32(l.length);for(let f of l)e(f)}else{let f=Object.keys(l);n.write8(6),n.write32(f.length);for(let i of f)n.write(X(i)),e(li)}},n=new fe;return n.write32(0),n.write32(t.id<<1|+!t.isRequest),e(t.value),ve(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function Ee(t){let e=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return oe(n.read());case 4:return n.read();case 5:{let m=n.read32(),s=[];for(let u=0;u<m;u++)s.push(e());return s}case 6:{let m=n.read32(),s={};for(let u=0;u<m;u++)soe(n.read())=e();return s}default:throw new Error("Invalid packet")}},n=new fe(t),l=n.read32(),f=(l&1)===0;l>>>=1;let i=e();if(n.ptr!==t.length)throw new Error("Invalid packet");return{id:l,isRequest:f,value:i}}var fe=class{constructor(e=new Uint8Array(1024)){this.buf=e;this.len=0;this.ptr=0}_write(e){if(this.len+e>this.buf.length){let n=new Uint8Array((this.len+e)*2);n.set(this.buf),this.buf=n}return this.len+=e,this.len-e}write8(e){let n=this._write(1);this.bufn=e}write32(e){let n=this._write(4);ve(this.buf,e,n)}write(e){let n=this._write(4+e.length);ve(this.buf,e.length,n),this.buf.set(e,n+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.bufthis._read(1)}read32(){return Re(this.buf,this._read(4))}read(){let e=this.read32(),n=new Uint8Array(e),l=this._read(n.length);return n.set(this.buf.subarray(l,l+e)),n}},X,oe,ke;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let t=new TextEncoder,e=new TextDecoder;X=n=>t.encode(n),oe=n=>e.decode(n),ke='new TextEncoder().encode("")'}else throw new Error("No UTF-8 codec found");if(!(X("")instanceof Uint8Array))throw new Error(`Invariant violation: "${ke} instanceof Uint8Array" is incorrectly false This indicates that your JavaScript environment is broken. You cannot use
esbuild in this environment because esbuild relies on this invariant. This
is not a problem with esbuild. You need to fix your environment instead.
);function Re(t,e){return t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24}function ve(t,e,n){t[n++]=e,t[n++]=e>>8,t[n++]=e>>16,t[n++]=e>>24}var ue="0.20.1";var Y=JSON.stringify,Se="warning",$e="silent";function Ce(t){if(_(t,"target"),t.indexOf(",")>=0)throw new Error(Invalid target: ${t});return t}var ge=()=>null,N=t=>typeof t=="boolean"?null:"a boolean",y=t=>typeof t=="string"?null:"a string",me=t=>t instanceof RegExp?null:"a RegExp object",le=t=>typeof t=="number"&&t===(t|0)?null:"an integer",Ae=t=>typeof t=="function"?null:"a function",I=t=>Array.isArray(t)?null:"an array",Z=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"an object",We=t=>typeof t=="object"&&t!==null?null:"an array or an object",Ve=t=>t instanceof WebAssembly.Module?null:"a WebAssembly.Module",Me=t=>typeof t=="object"&&!Array.isArray(t)?null:"an object or null",Pe=t=>typeof t=="string"||typeof t=="boolean"?null:"a string or a boolean",_e=t=>typeof t=="string"||typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"a string or an object",Ye=t=>typeof t=="string"||Array.isArray(t)?null:"a string or an array",De=t=>typeof t=="string"||t instanceof Uint8Array?null:"a string or a Uint8Array",Je=t=>typeof t=="string"||t instanceof URL?null:"a string or a URL";function r(t,e,n,l){let f=t[n];if(e[n+""]=!0,f===void 0)return;let i=l(f);if(i!==null)throw new Error(${Y(n)} must be ${i});return f}function K(t,e,n){for(let l in t)if(!(l in e))throw new Error(Invalid option ${n}: ${Y(l)})}function Te(t){let e=Object.create(null),n=r(t,e,"wasmModule",Ve),l=r(t,e,"workerURL",Je);return K(t,e,"in initialize() call"),{wasmModule:n,workerURL:l}}function je(t){let e;if(t!==void 0){e=Object.create(null);for(let n in t){let l=t[n];if(typeof l=="string"||l===!1)e[n]=l;else throw new Error(Expected ${Y(n)} in mangle cache to map to either a string or false)}}return e}function ye(t,e,n,l,f){let i=r(e,n,"color",N),m=r(e,n,"logLevel",y),s=r(e,n,"logLimit",le);i!==void 0?t.push(--color=${i}):l&&t.push("--color=true"),t.push(--log-level=${m||f}),t.push(--log-limit=${s||0})}function _(t,e,n){if(typeof t!="string")throw new Error(Expected value for ${e}${n!==void 0?" "+Y(n):""} to be a string, got ${typeof t} instead);return t}function Ue(t,e,n){let l=r(e,n,"legalComments",y),f=r(e,n,"sourceRoot",y),i=r(e,n,"sourcesContent",N),m=r(e,n,"target",Ye),s=r(e,n,"format",y),u=r(e,n,"globalName",y),E=r(e,n,"mangleProps",me),S=r(e,n,"reserveProps",me),T=r(e,n,"mangleQuoted",N),B=r(e,n,"minify",N),U=r(e,n,"minifySyntax",N),Q=r(e,n,"minifyWhitespace",N),J=r(e,n,"minifyIdentifiers",N),j=r(e,n,"lineLimit",le),z=r(e,n,"drop",I),W=r(e,n,"dropLabels",I),b=r(e,n,"charset",y),g=r(e,n,"treeShaking",N),d=r(e,n,"ignoreAnnotations",N),o=r(e,n,"jsx",y),v=r(e,n,"jsxFactory",y),x=r(e,n,"jsxFragment",y),C=r(e,n,"jsxImportSource",y),R=r(e,n,"jsxDev",N),a=r(e,n,"jsxSideEffects",N),c=r(e,n,"define",Z),h=r(e,n,"logOverride",Z),M=r(e,n,"supported",Z),A=r(e,n,"pure",I),$=r(e,n,"keepNames",N),O=r(e,n,"platform",y),F=r(e,n,"tsconfigRaw",_e);if(l&&t.push(--legal-comments=${l}),f!==void 0&&t.push(--source-root=${f}),i!==void 0&&t.push(--sources-content=${i}),m&&(Array.isArray(m)?t.push(--target=${Array.from(m).map(Ce).join(",")}):t.push(--target=${Ce(m)})),s&&t.push(--format=${s}),u&&t.push(--global-name=${u}),O&&t.push(--platform=${O}),F&&t.push(--tsconfig-raw=${typeof F=="string"?F:JSON.stringify(F)}),B&&t.push("--minify"),U&&t.push("--minify-syntax"),Q&&t.push("--minify-whitespace"),J&&t.push("--minify-identifiers"),j&&t.push(--line-limit=${j}),b&&t.push(--charset=${b}),g!==void 0&&t.push(--tree-shaking=${g}),d&&t.push("--ignore-annotations"),z)for(let w of z)t.push(--drop:${_(w,"drop")});if(W&&t.push(--drop-labels=${Array.from(W).map(w=>_(w,"dropLabels")).join(",")}),E&&t.push(--mangle-props=${E.source}),S&&t.push(--reserve-props=${S.source}),T!==void 0&&t.push(--mangle-quoted=${T}),o&&t.push(--jsx=${o}),v&&t.push(--jsx-factory=${v}),x&&t.push(--jsx-fragment=${x}),C&&t.push(--jsx-import-source=${C}),R&&t.push("--jsx-dev"),a&&t.push("--jsx-side-effects"),c)for(let w in c){if(w.indexOf("=")>=0)throw new Error(Invalid define: ${w});t.push(--define:${w}=${_(cw,"define",w)})}if(h)for(let w in h){if(w.indexOf("=")>=0)throw new Error(Invalid log override: ${w});t.push(--log-override:${w}=${_(hw,"log override",w)})}if(M)for(let w in M){if(w.indexOf("=")>=0)throw new Error(Invalid supported: ${w});let k=M[w];if(typeof k!="boolean")throw new Error(Expected value for supported ${Y(w)} to be a boolean, got ${typeof k} instead);t.push(--supported:${w}=${k})}if(A)for(let w of A)t.push(--pure:${_(w,"pure")});$&&t.push("--keep-names")}function Qe(t,e,n,l,f){let i=[],m=[],s=Object.create(null),u=null,E=null;ye(i,e,s,n,l),Ue(i,e,s);let S=r(e,s,"sourcemap",Pe),T=r(e,s,"bundle",N),B=r(e,s,"splitting",N),U=r(e,s,"preserveSymlinks",N),Q=r(e,s,"metafile",N),J=r(e,s,"outfile",y),j=r(e,s,"outdir",y),z=r(e,s,"outbase",y),W=r(e,s,"tsconfig",y),b=r(e,s,"resolveExtensions",I),g=r(e,s,"nodePaths",I),d=r(e,s,"mainFields",I),o=r(e,s,"conditions",I),v=r(e,s,"external",I),x=r(e,s,"packages",y),C=r(e,s,"alias",Z),R=r(e,s,"loader",Z),a=r(e,s,"outExtension",Z),c=r(e,s,"publicPath",y),h=r(e,s,"entryNames",y),M=r(e,s,"chunkNames",y),A=r(e,s,"assetNames",y),$=r(e,s,"inject",I),O=r(e,s,"banner",Z),F=r(e,s,"footer",Z),w=r(e,s,"entryPoints",We),k=r(e,s,"absWorkingDir",y),D=r(e,s,"stdin",Z),P=r(e,s,"write",N)??f,q=r(e,s,"allowOverwrite",N),V=r(e,s,"mangleCache",Z);if(s.plugins=!0,K(e,s,in ${t}() call),S&&i.push(--sourcemap${S===!0?"":=${S}}),T&&i.push("--bundle"),q&&i.push("--allow-overwrite"),B&&i.push("--splitting"),U&&i.push("--preserve-symlinks"),Q&&i.push("--metafile"),J&&i.push(--outfile=${J}),j&&i.push(--outdir=${j}),z&&i.push(--outbase=${z}),W&&i.push(--tsconfig=${W}),x&&i.push(--packages=${x}),b){let p=[];for(let L of b){if(_(L,"resolve extension"),L.indexOf(",")>=0)throw new Error(Invalid resolve extension: ${L});p.push(L)}i.push(--resolve-extensions=${p.join(",")})}if(c&&i.push(--public-path=${c}),h&&i.push(--entry-names=${h}),M&&i.push(--chunk-names=${M}),A&&i.push(--asset-names=${A}),d){let p=[];for(let L of d){if(_(L,"main field"),L.indexOf(",")>=0)throw new Error(Invalid main field: ${L});p.push(L)}i.push(--main-fields=${p.join(",")})}if(o){let p=[];for(let L of o){if(_(L,"condition"),L.indexOf(",")>=0)throw new Error(Invalid condition: ${L});p.push(L)}i.push(--conditions=${p.join(",")})}if(v)for(let p of v)i.push(--external:${_(p,"external")});if(C)for(let p in C){if(p.indexOf("=")>=0)throw new Error(Invalid package name in alias: ${p});i.push(--alias:${p}=${_(Cp,"alias",p)})}if(O)for(let p in O){if(p.indexOf("=")>=0)throw new Error(Invalid banner file type: ${p});i.push(--banner:${p}=${_(Op,"banner",p)})}if(F)for(let p in F){if(p.indexOf("=")>=0)throw new Error(Invalid footer file type: ${p});i.push(--footer:${p}=${_(Fp,"footer",p)})}if($)for(let p of $)i.push(--inject:${_(p,"inject")});if(R)for(let p in R){if(p.indexOf("=")>=0)throw new Error(Invalid loader extension: ${p});i.push(--loader:${p}=${_(Rp,"loader",p)})}if(a)for(let p in a){if(p.indexOf("=")>=0)throw new Error(Invalid out extension: ${p});i.push(--out-extension:${p}=${_(ap,"out extension",p)})}if(w)if(Array.isArray(w))for(let p=0,L=w.length;p<L;p++){let H=w[p];if(typeof H=="object"&&H!==null){let te=Object.create(null),ne=r(H,te,"in",y),ee=r(H,te,"out",y);if(K(H,te,"in entry point at index "+p),ne===void 0)throw new Error('Missing property "in" for entry point at index '+p);if(ee===void 0)throw new Error('Missing property "out" for entry point at index '+p);m.push([ee,ne])}else m.push(["",_(H,"entry point at index "+p)])}else for(let p in w)m.push([p,_(w[p],"entry point",p)]);if(D){let p=Object.create(null),L=r(D,p,"contents",De),H=r(D,p,"resolveDir",y),te=r(D,p,"sourcefile",y),ne=r(D,p,"loader",y);K(D,p,'in "stdin" object'),te&&i.push(--sourcefile=${te}),ne&&i.push(--loader=${ne}),H&&(E=H),typeof L=="string"?u=X(L):L instanceof Uint8Array&&(u=L)}let G=[];if(g)for(let p of g)p+="",G.push(p);return{entries:m,flags:i,write:P,stdinContents:u,stdinResolveDir:E,absWorkingDir:k,nodePaths:G,mangleCache:je(V)}}function Ge(t,e,n,l){let f=[],i=Object.create(null);ye(f,e,i,n,l),Ue(f,e,i);let m=r(e,i,"sourcemap",Pe),s=r(e,i,"sourcefile",y),u=r(e,i,"loader",y),E=r(e,i,"banner",y),S=r(e,i,"footer",y),T=r(e,i,"mangleCache",Z);return K(e,i,in ${t}() call),m&&f.push(--sourcemap=${m===!0?"external":m}),s&&f.push(--sourcefile=${s}),u&&f.push(--loader=${u}),E&&f.push(--banner=${E}),S&&f.push(--footer=${S}),{flags:f,mangleCache:je(T)}}function Be(t){let e={},n={didClose:!1,reason:""},l={},f=0,i=0,m=new Uint8Array(16*1024),s=0,u=b=>{let g=s+b.length;if(g>m.length){let o=new Uint8Array(g*2);o.set(m),m=o}m.set(b,s),s+=b.length;let d=0;for(;d+4<=s;){let o=Re(m,d);if(d+4+o>s)break;d+=4,Q(m.subarray(d,d+o)),d+=o}d>0&&(m.copyWithin(0,d,s),s-=d)},E=b=>{n.didClose=!0,b&&(n.reason=": "+(b.message||b));let g="The service was stopped"+n.reason;for(let d in l)l[d](g,null);l={}},S=(b,g,d)=>{if(n.didClose)return d("The service is no longer running"+n.reason,null);let o=f++;l[o]=(v,x)=>{try{d(v,x)}finally{b&&b.unref()}},b&&b.ref(),t.writeToStdin(xe({id:o,isRequest:!0,value:g}))},T=(b,g)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);t.writeToStdin(xe({id:b,isRequest:!1,value:g}))},B=async(b,g)=>{try{if(g.command==="ping"){T(b,{});return}if(typeof g.key=="number"){let d=e[g.key];if(!d)return;let o=d[g.command];if(o){await o(b,g);return}}throw new Error("Invalid command: "+g.command)}catch(d){let o=[ie(d,t,null,void 0,"")];try{T(b,{errors:o})}catch{}}},U=!0,Q=b=>{if(U){U=!1;let d=String.fromCharCode(...b);if(d!==ue)throw new Error(Cannot start service: Host version "${ue}" does not match binary version ${Y(d)});return}let g=Ee(b);if(g.isRequest)B(g.id,g.value);else{let d=l[g.id];delete l[g.id],g.value.error?d(g.value.error,{}):d(null,g.value)}};return{readFromStdout:u,afterClose:E,service:{buildOrContext:({callName:b,refs:g,options:d,isTTY:o,defaultWD:v,callback:x})=>{let C=0,R=i++,a={},c={ref(){++C===1&&g&&g.ref()},unref(){--C===0&&(delete e[R],g&&g.unref())}};e[R]=a,c.ref(),He(b,R,S,T,c,t,a,d,o,v,(h,M)=>{try{x(h,M)}finally{c.unref()}})},transform:({callName:b,refs:g,input:d,options:o,isTTY:v,fs:x,callback:C})=>{let R=qe(),a=c=>{try{if(typeof d!="string"&&!(d instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:M}=Ge(b,o,v,$e),A={command:"transform",flags:h,inputFS:c!==null,input:c!==null?X(c):typeof d=="string"?X(d):d};M&&(A.mangleCache=M),S(g,A,($,O)=>{if($)return C(new Error($),null);let F=ae(O.errors,R),w=ae(O.warnings,R),k=1,D=()=>{if(--k===0){let P={warnings:w,code:O.code,map:O.map,mangleCache:void 0,legalComments:void 0};"legalComments"in O&&(P.legalComments=O?.legalComments),O.mangleCache&&(P.mangleCache=O?.mangleCache),C(null,P)}};if(F.length>0)return C(ce("Transform failed",F,w),null);O.codeFS&&(k++,x.readFile(O.code,(P,q)=>{P!==null?C(P,null):(O.code=q,D())})),O.mapFS&&(k++,x.readFile(O.map,(P,q)=>{P!==null?C(P,null):(O.map=q,D())})),D()})}catch(h){let M=[];try{ye(M,o,{},v,$e)}catch{}let A=ie(h,t,R,void 0,"");S(g,{command:"error",flags:M,error:A},()=>{A.detail=R.load(A.detail),C(ce("Transform failed",[A],[]),null)})}};if((typeof d=="string"||d instanceof Uint8Array)&&d.length>1024*1024){let c=a;a=()=>x.writeFile(d,c)}a(null)},formatMessages:({callName:b,refs:g,messages:d,options:o,callback:v})=>{if(!o)throw new Error(Missing second argument in ${b}() call);let x={},C=r(o,x,"kind",y),R=r(o,x,"color",N),a=r(o,x,"terminalWidth",le);if(K(o,x,in ${b}() call),C===void 0)throw new Error(Missing "kind" in ${b}() call);if(C!=="error"&&C!=="warning")throw new Error(Expected "kind" to be "error" or "warning" in ${b}() call);let c={command:"format-msgs",messages:re(d,"messages",null,"",a),isWarning:C==="warning"};R!==void 0&&(c.color=R),a!==void 0&&(c.terminalWidth=a),S(g,c,(h,M)=>{if(h)return v(new Error(h),null);v(null,M.messages)})},analyzeMetafile:({callName:b,refs:g,metafile:d,options:o,callback:v})=>{o===void 0&&(o={});let x={},C=r(o,x,"color",N),R=r(o,x,"verbose",N);K(o,x,in ${b}() call);let a={command:"analyze-metafile",metafile:d};C!==void 0&&(a.color=C),R!==void 0&&(a.verbose=R),S(g,a,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function He(t,e,n,l,f,i,m,s,u,E,S){let T=qe(),B=t==="context",U=(j,z)=>{let W=[];try{ye(W,s,{},u,Se)}catch{}let b=ie(j,i,T,void 0,z);n(f,{command:"error",flags:W,error:b},()=>{b.detail=T.load(b.detail),S(ce(B?"Context failed":"Build failed",[b],[]),null)})},Q;if(typeof s=="object"){let j=s.plugins;if(j!==void 0){if(!Array.isArray(j))return U(new Error('"plugins" must be an array'),"");Q=j}}if(Q&&Q.length>0){if(i.isSync)return U(new Error("Cannot use plugins in synchronous API calls"),"");Xe(e,n,l,f,i,m,s,Q,T).then(j=>{if(!j.ok)return U(j.error,j.pluginName);try{J(j.requestPlugins,j.runOnEndCallbacks,j.scheduleOnDisposeCallbacks)}catch(z){U(z,"")}},j=>U(j,""));return}try{J(null,(j,z)=>z([],[]),()=>{})}catch(j){U(j,"")}function J(j,z,W){let b=i.hasFS,{entries:g,flags:d,write:o,stdinContents:v,stdinResolveDir:x,absWorkingDir:C,nodePaths:R,mangleCache:a}=Qe(t,s,u,Se,b);if(o&&!i.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:e,entries:g,flags:d,write:o,stdinContents:v,stdinResolveDir:x,absWorkingDir:C||E,nodePaths:R,context:B};j&&(c.plugins=j),a&&(c.mangleCache=a);let h=($,O)=>{let F={errors:ae($.errors,T),warnings:ae($.warnings,T),outputFiles:void 0,metafile:void 0,mangleCache:void 0},w=F.errors.slice(),k=F.warnings.slice();$.outputFiles&&(F.outputFiles=$.outputFiles.map(Ze)),$.metafile&&(F.metafile=JSON.parse($.metafile)),$.mangleCache&&(F.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(oe($.writeToStdout).replace(/\n$/,"")),z(F,(D,P)=>{if(w.length>0||D.length>0){let q=ce("Build failed",w.concat(D),k.concat(P));return O(q,null,D,P)}O(null,F,D,P)})},M,A;B&&(m["on-end"]=($,O)=>new Promise(F=>{h(O,(w,k,D,P)=>{let q={errors:D,warnings:P};A&&A(w,k),M=void 0,A=void 0,l($,q),F()})})),n(f,c,($,O)=>{if($)return S(new Error($),null);if(!B)return h(O,(k,D)=>(W(),S(k,D)));if(O.errors.length>0)return S(ce("Context failed",O.errors,O.warnings),null);let F=!1,w={rebuild:()=>(M||(M=new Promise((k,D)=>{let P;A=(V,G)=>{P||(P=()=>V?D(V):k(G))};let q=()=>{n(f,{command:"rebuild",key:e},(G,p)=>{G?D(new Error(G)):P?P():q()})};q()})),M),watch:(k={})=>new Promise((D,P)=>{if(!i.hasFS)throw new Error('Cannot use the "watch" API in this environment');K(k,{},"in watch() call"),n(f,{command:"watch",key:e},G=>{G?P(new Error(G)):D(void 0)})}),serve:(k={})=>new Promise((D,P)=>{if(!i.hasFS)throw new Error('Cannot use the "serve" API in this environment');let q={},V=r(k,q,"port",le),G=r(k,q,"host",y),p=r(k,q,"servedir",y),L=r(k,q,"keyfile",y),H=r(k,q,"certfile",y),te=r(k,q,"fallback",y),ne=r(k,q,"onRequest",Ae);K(k,q,"in serve() call");let ee={command:"serve",key:e,onRequest:!!ne};V!==void 0&&(ee.port=V),G!==void 0&&(ee.host=G),p!==void 0&&(ee.servedir=p),L!==void 0&&(ee.keyfile=L),H!==void 0&&(ee.certfile=H),te!==void 0&&(ee.fallback=te),n(f,ee,(Oe,Ne)=>{if(Oe)return P(new Error(Oe));ne&&(m["serve-request"]=(Ie,ze)=>{ne(ze.args),l(Ie,{})}),D(Ne)})}),cancel:()=>new Promise(k=>{if(F)return k();n(f,{command:"cancel",key:e},()=>{k()})}),dispose:()=>new Promise(k=>{if(F)return k();F=!0,n(f,{command:"dispose",key:e},()=>{k(),W(),f.unref()})})};f.ref(),S(null,w)})}}var Xe=async(t,e,n,l,f,i,m,s,u)=>{let E=[],S=[],T={},B={},U=[],Q=0,J=0,j=[],z=!1;s=[...s];for(let g of s){let d={};if(typeof g!="object")throw new Error(Plugin at index ${J} must be an object);let o=r(g,d,"name",y);if(typeof o!="string"||o==="")throw new Error(Plugin at index ${J} is missing a name);try{let v=r(g,d,"setup",Ae);if(typeof v!="function")throw new Error("Plugin is missing a setup function");K(g,d,on plugin ${Y(o)});let x={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};J++;let R=v({initialOptions:m,resolve:(a,c={})=>{if(!z)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof a!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),M=r(c,h,"pluginName",y),A=r(c,h,"importer",y),$=r(c,h,"namespace",y),O=r(c,h,"resolveDir",y),F=r(c,h,"kind",y),w=r(c,h,"pluginData",ge);return K(c,h,"in resolve() call"),new Promise((k,D)=>{let P={command:"resolve",path:a,key:t,pluginName:o};if(M!=null&&(P.pluginName=M),A!=null&&(P.importer=A),$!=null&&(P.namespace=$),O!=null&&(P.resolveDir=O),F!=null)P.kind=F;else throw new Error('Must specify "kind" when calling "resolve"');w!=null&&(P.pluginData=u.store(w)),e(l,P,(q,V)=>{q!==null?D(new Error(q)):k({errors:ae(V.errors,u),warnings:ae(V.warnings,u),path:V.path,external:V.external,sideEffects:V.sideEffects,namespace:V.namespace,suffix:V.suffix,pluginData:u.load(V.pluginData)})})})},onStart(a){let c='This error came from the "onStart" callback registered here:',h=de(new Error(c),f,"onStart");E.push({name:o,callback:a,note:h}),x.onStart=!0},onEnd(a){let c='This error came from the "onEnd" callback registered here:',h=de(new Error(c),f,"onEnd");S.push({name:o,callback:a,note:h}),x.onEnd=!0},onResolve(a,c){let h='This error came from the "onResolve" callback registered here:',M=de(new Error(h),f,"onResolve"),A={},$=r(a,A,"filter",me),O=r(a,A,"namespace",y);if(K(a,A,in onResolve() call for plugin ${Y(o)}),$==null)throw new Error("onResolve() call is missing a filter");let F=Q++;T[F]={name:o,callback:c,note:M},x.onResolve.push({id:F,filter:$.source,namespace:O||""})},onLoad(a,c){let h='This error came from the "onLoad" callback registered here:',M=de(new Error(h),f,"onLoad"),A={},$=r(a,A,"filter",me),O=r(a,A,"namespace",y);if(K(a,A,in onLoad() call for plugin ${Y(o)}),$==null)throw new Error("onLoad() call is missing a filter");let F=Q++;B[F]={name:o,callback:c,note:M},x.onLoad.push({id:F,filter:$.source,namespace:O||""})},onDispose(a){U.push(a)},esbuild:f.esbuild});R&&await R,j.push(x)}catch(v){return{ok:!1,error:v,pluginName:o}}}i["on-start"]=async(g,d)=>{let o={errors:[],warnings:[]};await Promise.all(E.map(async({name:v,callback:x,note:C})=>{try{let R=await x();if(R!=null){if(typeof R!="object")throw new Error(Expected onStart() callback in plugin ${Y(v)} to return an object);let a={},c=r(R,a,"errors",I),h=r(R,a,"warnings",I);K(R,a,from onStart() callback in plugin ${Y(v)}),c!=null&&o.errors.push(...re(c,"errors",u,v,void 0)),h!=null&&o.warnings.push(...re(h,"warnings",u,v,void 0))}}catch(R){o.errors.push(ie(R,f,u,C&&C(),v))}})),n(g,o)},i["on-resolve"]=async(g,d)=>{let o={},v="",x,C;for(let R of d.ids)try{({name:v,callback:x,note:C}=T[R]);let a=await x({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:u.load(d.pluginData)});if(a!=null){if(typeof a!="object")throw new Error(Expected onResolve() callback in plugin ${Y(v)} to return an object);let c={},h=r(a,c,"pluginName",y),M=r(a,c,"path",y),A=r(a,c,"namespace",y),$=r(a,c,"suffix",y),O=r(a,c,"external",N),F=r(a,c,"sideEffects",N),w=r(a,c,"pluginData",ge),k=r(a,c,"errors",I),D=r(a,c,"warnings",I),P=r(a,c,"watchFiles",I),q=r(a,c,"watchDirs",I);K(a,c,from onResolve() callback in plugin ${Y(v)}),o.id=R,h!=null&&(o.pluginName=h),M!=null&&(o.path=M),A!=null&&(o.namespace=A),$!=null&&(o.suffix=$),O!=null&&(o.external=O),F!=null&&(o.sideEffects=F),w!=null&&(o.pluginData=u.store(w)),k!=null&&(o.errors=re(k,"errors",u,v,void 0)),D!=null&&(o.warnings=re(D,"warnings",u,v,void 0)),P!=null&&(o.watchFiles=pe(P,"watchFiles")),q!=null&&(o.watchDirs=pe(q,"watchDirs"));break}}catch(a){o={id:R,errors:[ie(a,f,u,C&&C(),v)]};break}n(g,o)},i["on-load"]=async(g,d)=>{let o={},v="",x,C;for(let R of d.ids)try{({name:v,callback:x,note:C}=B[R]);let a=await x({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:u.load(d.pluginData),with:d.with});if(a!=null){if(typeof a!="object")throw new Error(Expected onLoad() callback in plugin ${Y(v)} to return an object);let c={},h=r(a,c,"pluginName",y),M=r(a,c,"contents",De),A=r(a,c,"resolveDir",y),$=r(a,c,"pluginData",ge),O=r(a,c,"loader",y),F=r(a,c,"errors",I),w=r(a,c,"warnings",I),k=r(a,c,"watchFiles",I),D=r(a,c,"watchDirs",I);K(a,c,from onLoad() callback in plugin ${Y(v)}),o.id=R,h!=null&&(o.pluginName=h),M instanceof Uint8Array?o.contents=M:M!=null&&(o.contents=X(M)),A!=null&&(o.resolveDir=A),$!=null&&(o.pluginData=u.store($)),O!=null&&(o.loader=O),F!=null&&(o.errors=re(F,"errors",u,v,void 0)),w!=null&&(o.warnings=re(w,"warnings",u,v,void 0)),k!=null&&(o.watchFiles=pe(k,"watchFiles")),D!=null&&(o.watchDirs=pe(D,"watchDirs"));break}}catch(a){o={id:R,errors:[ie(a,f,u,C&&C(),v)]};break}n(g,o)};let W=(g,d)=>d([],[]);S.length>0&&(W=(g,d)=>{(async()=>{let o=[],v=[];for(let{name:x,callback:C,note:R}of S){let a,c;try{let h=await C(g);if(h!=null){if(typeof h!="object")throw new Error(Expected onEnd() callback in plugin ${Y(x)} to return an object);let M={},A=r(h,M,"errors",I),$=r(h,M,"warnings",I);K(h,M,from onEnd() callback in plugin ${Y(x)}),A!=null&&(a=re(A,"errors",u,x,void 0)),$!=null&&(c=re($,"warnings",u,x,void 0))}}catch(h){a=[ie(h,f,u,R&&R(),x)]}if(a){o.push(...a);try{g.errors.push(...a)}catch{}}if(c){v.push(...c);try{g.warnings.push(...c)}catch{}}}d(o,v)})()});let b=()=>{for(let g of U)setTimeout(()=>g(),0)};return z=!0,{ok:!0,requestPlugins:j,runOnEndCallbacks:W,scheduleOnDisposeCallbacks:b}};function qe(){let t=new Map,e=0;return{load(n){return t.get(n)},store(n){if(n===void 0)return-1;let l=e++;return t.set(l,n),l}}}function de(t,e,n){let l,f=!1;return()=>{if(f)return l;f=!0;try{let i=(t.stack+"").split( );i.splice(1,1);let m=Le(e,i,n);if(m)return l={text:t.message,location:m},l}catch{}}}function ie(t,e,n,l,f){let i="Internal error",m=null;try{i=(t&&t.message||t)+""}catch{}try{m=Le(e,(t.stack+"").split(
),"")}catch{}return{id:"",pluginName:f,text:i,location:m,notes:l?[l]:[],detail:n?n.store(t):-1}}function Le(t,e,n){let l=" at ";if(t.readFileSync&&!e[0].startsWith(l)&&e[1].startsWith(l))for(let f=1;f<e.length;f++){let i=e[f];if(i.startsWith(l))for(i=i.slice(l.length);;){let m=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(m){i=m[1];continue}if(m=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),m){i=m[1];continue}if(m=/^(\S+):(\d+):(\d+)$/.exec(i),m){let s;try{s=t.readFileSync(m[1],"utf8")}catch{break}let u=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+m[2]-1]||"",E=+m[3]-1,S=u.slice(E,E+n.length)===n?n.length:0;return{file:m[1],namespace:"file",line:+m[2],column:X(u.slice(0,E)).length,length:X(u.slice(E,E+S)).length,lineText:u+
+e.slice(1).join(
),suggestion:""}}break}}return null}function ce(t,e,n){let l=5;t+=e.length<1?"": with ${e.length} error${e.length<2?"":"s"}:+e.slice(0,l+1).map((i,m)=>{if(m===l)return
...;if(!i.location)return
${s}:${u}:${E}: ERROR: ${S}${i.text}}).join("");let f=new Error(t);for(let[i,m]of[["errors",e],["warnings",n]])Object.defineProperty(f,i,{configurable:!0,enumerable:!0,get:()=>m,set:s=>Object.defineProperty(f,i,{configurable:!0,enumerable:!0,value:s})});return f}function ae(t,e){for(let n of t)n.detail=e.load(n.detail);return t}function Fe(t,e,n){if(t==null)return null;let l={},f=r(t,l,"file",y),i=r(t,l,"namespace",y),m=r(t,l,"line",le),s=r(t,l,"column",le),u=r(t,l,"length",le),E=r(t,l,"lineText",y),S=r(t,l,"suggestion",y);if(K(t,l,e),E){let T=E.slice(0,(s&&s>0?s:0)+(u&&u>0?u:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(T)&&!/\n/.test(E)&&(E=T)}return{file:f||"",namespace:i||"",line:m||0,column:s||0,length:u||0,lineText:E||"",suggestion:S||""}}function re(t,e,n,l,f){let i=[],m=0;for(let s of t){let u={},E=r(s,u,"id",y),S=r(s,u,"pluginName",y),T=r(s,u,"text",y),B=r(s,u,"location",Me),U=r(s,u,"notes",I),Q=r(s,u,"detail",ge),J=in element ${m} of "${e}";K(s,u,J);let j=[];if(U)for(let z of U){let W={},b=r(z,W,"text",y),g=r(z,W,"location",Me);K(z,W,J),j.push({text:b||"",location:Fe(g,J,f)})}i.push({id:E||"",pluginName:S||l,text:T||"",location:Fe(B,J,f),notes:j,detail:n?n.store(Q):-1}),m++}return i}function pe(t,e){let n=[];for(let l of t){if(typeof l!="string")throw new Error(${Y(e)} must be an array of strings`);n.push(l)}return n}function Ze({path:t,contents:e,hash:n}){let l=null;return{path:t,contents:e,hash:n,get text(){let f=this.contents;return(l===null||f!==e)&&(e=f,l=oe(f)),l}}}var tt=ue,nt=t=>we().build(t),rt=(t,e)=>we().transform(t,e),it=(t,e)=>we().formatMessages(t,e),lt=(t,e)=>we().analyzeMetafile(t,e),ft=()=>(he&&he(),Promise.resolve()),se,he,be,we=()=>{if(be)return be;throw se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},st=t=>{t=Te(t||{});let e=t.wasmModule,n=t.workerURL;if(!e)throw new Error('Must provide the "wasmModule" option');if(se)throw new Error('Cannot call "initialize" more than once');return se=ot(e,n),se.catch(()=>{se=void 0}),se},ot=async(t,e)=>{let n=new Worker(e.toString()),l,f,i=new Promise((u,E)=>{l=u,f=E});n.onmessage=({data:u})=>{n.onmessage=({data:E})=>m(E),u?f(u):l()},n.postMessage(t);let{readFromStdout:m,service:s}=Be({writeToStdin(u){n.postMessage(u)},isSync:!1,hasFS:!1,esbuild:{build:nt,transform:rt,formatMessages:it,analyzeMetafile:lt,version:tt,initialize:st}});await i,he=()=>{n.terminate(),se=void 0,he=void 0,be=void 0},be={build:u=>new Promise((E,S)=>s.buildOrContext({callName:"build",refs:null,options:u,isTTY:!1,defaultWD:"/",callback:(T,B)=>T?S(T):E(B)})),transform:(u,E)=>new Promise((S,T)=>s.transform({callName:"transform",refs:null,input:u,options:E||{},isTTY:!1,fs:{readFile(B,U){U(new Error("Internal error"),null)},writeFile(B,U){U(null)}},callback:(B,U)=>B?T(B):S(U)})),formatMessages:(u,E)=>new Promise((S,T)=>s.formatMessages({callName:"formatMessages",refs:null,messages:u,options:E,callback:(B,U)=>B?T(B):S(U)})),analyzeMetafile:(u,E)=>new Promise((S,T)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof u=="string"?u:JSON.stringify(u),options:E,callback:(B,U)=>B?T(B):S(U)}))}};export{lt as analyzeMetafile,nt as build,it as formatMessages,st as initialize,ft as stop,rt as transform,tt as version};
/** @license
* esbuild-wasm@v0.20.1
*
* MIT License
*
* Copyright (c) 2020 Evan Wallace
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
code:worker.js
(()=>{let r=()=>{let c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);let i=c.lastIndexOf(`
);return i!=-1&&(console.log(c.substring(0,i)),c=c.substring(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}let d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");let f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let c=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},n=t=>{let e=this.mem.getUint32(t+0,!0),o=this.mem.getInt32(t+4,!0);return e+o*4294967296},s=t=>{let e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;let o=this.mem.getUint32(t,!0);return this._values[o]},i=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let l=this._ids.get(e);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=e,this._goRefCounts[l]=0,this._ids.set(e,l)),this._goRefCounts[l]++;let m=0;switch(typeof e){case"object":e!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(t+4,2146959360|m,!0),this.mem.setUint32(t,l,!0)},a=t=>{let e=n(t+0),o=n(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,o)},h=t=>{let e=n(t+0),o=n(t+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(e+m*8);return l},u=t=>{let e=n(t+0),o=n(t+8);return g.decode(new DataView(this._inst.exports.mem.buffer,e,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":t=>{t>>>=0;let e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;let e=n(t+8),o=n(t+16),l=this.mem.getInt32(t+24,!0);fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,c(t+8,(d+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;let e=new Date().getTime();c(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;let e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(t+8)+1)),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;let e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(a(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;let e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){let o=this._values[e];this._values[e]=null,this._ids.delete(o),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,i(t+24,u(t+8))},"syscall/js.valueGet":t=>{t>>>=0;let e=Reflect.get(s(t+8),u(t+16));t=this._inst.exports.getsp()>>>0,i(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(s(t+8),u(t+16),s(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(s(t+8),u(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,i(t+24,Reflect.get(s(t+8),n(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(s(t+8),n(t+16),s(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{let e=s(t+8),o=Reflect.get(e,u(t+16)),l=h(t+32),m=Reflect.apply(o,e,l);t=this._inst.exports.getsp()>>>0,i(t+56,m),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,i(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{let e=s(t+8),o=h(t+16),l=Reflect.apply(e,void 0,o);t=this._inst.exports.getsp()>>>0,i(t+40,l),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,i(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{let e=s(t+8),o=h(t+16),l=Reflect.construct(e,o);t=this._inst.exports.getsp()>>>0,i(t+40,l),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,i(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,c(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;let e=f.encode(String(s(t+8)));i(t+16,e),c(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;let e=s(t+8);a(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,s(t+8)instanceof s(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;let e=a(t+8),o=s(t+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}let l=o.subarray(0,e.length);e.set(l),c(t+40,l.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;let e=s(t+8),o=a(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}let l=o.subarray(0,e.length);e.set(l),c(t+40,l.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096,s=t=>{let e=n,o=f.encode(t+"\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),e},i=this.argv.length,a=[];this.argv.forEach(t=>{a.push(s(t))}),a.push(0),Object.keys(this.env).sort().forEach(t=>{a.push(s(${t}=${this.envt}))}),a.push(0);let u=n;a.forEach(t=>{this.mem.setUint32(n,t,!0),this.mem.setUint32(n+4,0,!0),n+=8});let d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){let n=this;return function(){let s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})();onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split( );d.length>1&&console.log(d.slice(0,-1).join(
)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>(h.length>0&&(n.push(h),s&&s()),a),g.read=(h,u,d,t,e,o)=>{if(h!==0||d!==0||t!==u.length||e!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,t,e,o);return}let l=n[0],m=Math.max(0,Math.min(t,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;return a.argv=["","--service=0.20.1"],y(r,a).then(h=>{postMessage(null),a.run(h)},h=>{postMessage(h)}),a};async function y(r,f){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);let g=await fetch(r);if(!g.ok)throw new Error(Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(g.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(g,f.importObject)).instance;let c=await g.arrayBuffer();return(await WebAssembly.instantiate(c,f.importObject)).instance}
/** @license
* esbuild-wasm@0.20.1
*
* MIT License
*
* Copyright (c) 2020 Evan Wallace
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/