(module=>{
"use strict";var Ae=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var et=Object.prototype.hasOwnProperty;var tt=(e,t)=>{for(var n in t)Ae(e,n,{get:t[n],enumerable:!0})},nt=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ze(t))!et.call(e,a)&&a!==n&&Ae(e,a,{get:()=>t[a],enumerable:!(i=Xe(t,a))||i.enumerable});return e};var rt=e=>nt(Ae({},"__esModule",{value:!0}),e);var ne=(e,t,n)=>new Promise((i,a)=>{var l=o=>{try{s(n.next(o))}catch(p){a(p)}},f=o=>{try{s(n.throw(o))}catch(p){a(p)}},s=o=>o.done?i(o.value):Promise.resolve(o.value).then(l,f);s((n=n.apply(e,t)).next())});var $e={};tt($e,{analyzeMetafile:()=>Ot,analyzeMetafileSync:()=>Ct,build:()=>bt,buildSync:()=>St,context:()=>xt,default:()=>Ft,formatMessages:()=>Rt,formatMessagesSync:()=>kt,initialize:()=>At,stop:()=>$t,transform:()=>vt,transformSync:()=>Et,version:()=>wt});module.exports=rt($e);function Me(e){let t=i=>{if(i===null)n.write8(0);else if(typeof i=="boolean")n.write8(1),n.write8(+i);else if(typeof i=="number")n.write8(2),n.write32(i|0);else if(typeof i=="string")n.write8(3),n.write(Z(i));else if(i instanceof Uint8Array)n.write8(4),n.write(i);else if(i instanceof Array){n.write8(5),n.write32(i.length);for(let a of i)t(a)}else{let a=Object.keys(i);n.write8(6),n.write32(a.length);for(let l of a)n.write(Z(l)),t(i[l])}},n=new be;return n.write32(0),n.write32(e.id<<1|+!e.isRequest),t(e.value),Fe(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function Le(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return ue(n.read());case 4:return n.read();case 5:{let f=n.read32(),s=[];for(let o=0;o<f;o++)s.push(t());return s}case 6:{let f=n.read32(),s={};for(let o=0;o<f;o++)s[ue(n.read())]=t();return s}default:throw new Error("Invalid packet")}},n=new be(e),i=n.read32(),a=(i&1)===0;i>>>=1;let l=t();if(n.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:a,value:l}}var be=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let n=new Uint8Array((this.len+t)*2);n.set(this.buf),this.buf=n}return this.len+=t,this.len-t}write8(t){let n=this._write(1);this.buf[n]=t}write32(t){let n=this._write(4);Fe(this.buf,t,n)}write(t){let n=this._write(4+t.length);Fe(this.buf,t.length,n),this.buf.set(t,n+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return Be(this.buf,this._read(4))}read(){let t=this.read32(),n=new Uint8Array(t),i=this._read(n.length);return n.set(this.buf.subarray(i,i+t)),n}},Z,ue,De;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;Z=n=>e.encode(n),ue=n=>t.decode(n),De='new TextEncoder().encode("")'}else if(typeof Buffer!="undefined")Z=e=>Buffer.from(e),ue=e=>{let{buffer:t,byteOffset:n,byteLength:i}=e;return Buffer.from(t,n,i).toString()},De='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${De} 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 Be(e,t){return(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function Fe(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var oe=String.fromCharCode;function ee(e,t,n){let i=e[t],a=1,l=0;for(let f=0;f<t;f++)e[f]===10?(a++,l=0):l++;throw new SyntaxError(n||(t===e.length?"Unexpected end of input while parsing JSON":i>=32&&i<=126?`Unexpected character ${oe(i)} in JSON at position ${t} (line ${a}, column ${l})`:`Unexpected byte 0x${i.toString(16)} in JSON at position ${t} (line ${a}, column ${l})`))}function Ue(e){if(!(e instanceof Uint8Array))throw new Error("JSON input must be a Uint8Array");let t=[],n=[],i=[],a=e.length,l=null,f=0,s,o=0;for(;o<a;){let p=e[o++];if(p<=32)continue;let g;switch(f===2&&l===null&&p!==34&&p!==125&&ee(e,--o),p){case 116:{(e[o++]!==114||e[o++]!==117||e[o++]!==101)&&ee(e,--o),g=!0;break}case 102:{(e[o++]!==97||e[o++]!==108||e[o++]!==115||e[o++]!==101)&&ee(e,--o),g=!1;break}case 110:{(e[o++]!==117||e[o++]!==108||e[o++]!==108)&&ee(e,--o),g=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let y=o;for(g=oe(p),p=e[o];;){switch(p){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{g+=oe(p),p=e[++o];continue}}break}g=+g,isNaN(g)&&ee(e,--y,"Invalid number");break}case 34:{for(g="";o>=a&&ee(e,a),p=e[o++],p!==34;)if(p===92)switch(e[o++]){case 34:g+='"';break;case 47:g+="/";break;case 92:g+="\\";break;case 98:g+="\b";break;case 102:g+="\f";break;case 110:g+=`
`;break;case 114:g+="\r";break;case 116:g+="	";break;case 117:{let y=0;for(let U=0;U<4;U++)p=e[o++],y<<=4,p>=48&&p<=57?y|=p-48:p>=97&&p<=102?y|=p+-87:p>=65&&p<=70?y|=p+-55:ee(e,--o);g+=oe(y);break}default:ee(e,--o);break}else if(p<=127)g+=oe(p);else if((p&224)===192)g+=oe((p&31)<<6|e[o++]&63);else if((p&240)===224)g+=oe((p&15)<<12|(e[o++]&63)<<6|e[o++]&63);else if((p&248)==240){let y=(p&7)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63;y>65535&&(y-=65536,g+=oe(y>>10&1023|55296),y=56320|y&1023),g+=oe(y)}g[0];break}case 91:{g=[],t.push(l),n.push(s),i.push(f),l=null,s=g,f=1;continue}case 123:{g={},t.push(l),n.push(s),i.push(f),l=null,s=g,f=2;continue}case 93:{f!==1&&ee(e,--o),g=s,l=t.pop(),s=n.pop(),f=i.pop();break}case 125:{f!==2&&ee(e,--o),g=s,l=t.pop(),s=n.pop(),f=i.pop();break}default:ee(e,--o)}for(p=e[o];p<=32;)p=e[++o];switch(f){case 0:{if(o===a)return g;break}case 1:{if(s.push(g),p===44){o++;continue}if(p===93)continue;break}case 2:{if(l===null){if(l=g,p===58){o++;continue}}else{if(s[l]=g,l=null,p===44){o++;continue}if(p===125)continue}break}}break}ee(e,o)}var _=JSON.stringify,Pe="warning",Te="silent";function ge(e,t){let n=[];for(let i of e){if(Q(i,t),i.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${i}`);n.push(i)}return n.join(",")}var Re=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",b=e=>typeof e=="string"?null:"a string",Oe=e=>e instanceof RegExp?null:"a RegExp object",fe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",lt=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",qe=e=>typeof e=="function"?null:"a function",se=e=>Array.isArray(e)?null:"an array",Y=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",G=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",ot=e=>typeof e=="object"&&e!==null?null:"an array or an object",st=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",je=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ie=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",at=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",We=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",ze=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",ut=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let a=e[n];if(t[n+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${_(n)} must be ${l}`);return a}function K(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${_(i)}`)}function Ke(e){let t=Object.create(null),n=r(e,t,"wasmURL",ut),i=r(e,t,"wasmModule",st),a=r(e,t,"worker",I);return K(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:a}}function _e(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${_(n)} in mangle cache to map to either a string or false`)}}return t}function Ee(e,t,n,i,a){let l=r(t,n,"color",I),f=r(t,n,"logLevel",b),s=r(t,n,"logLimit",fe);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${f||a}`),e.push(`--log-limit=${s||0}`)}function Q(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+_(n):""} to be a string, got ${typeof e} instead`);return e}function Ve(e,t,n){let i=r(t,n,"legalComments",b),a=r(t,n,"sourceRoot",b),l=r(t,n,"sourcesContent",I),f=r(t,n,"target",We),s=r(t,n,"format",b),o=r(t,n,"globalName",b),p=r(t,n,"mangleProps",Oe),g=r(t,n,"reserveProps",Oe),y=r(t,n,"mangleQuoted",I),U=r(t,n,"minify",I),B=r(t,n,"minifySyntax",I),T=r(t,n,"minifyWhitespace",I),j=r(t,n,"minifyIdentifiers",I),k=r(t,n,"lineLimit",fe),z=r(t,n,"drop",Y),V=r(t,n,"dropLabels",Y),R=r(t,n,"charset",b),h=r(t,n,"treeShaking",I),m=r(t,n,"ignoreAnnotations",I),u=r(t,n,"jsx",b),O=r(t,n,"jsxFactory",b),E=r(t,n,"jsxFragment",b),A=r(t,n,"jsxImportSource",b),P=r(t,n,"jsxDev",I),c=r(t,n,"jsxSideEffects",I),d=r(t,n,"define",G),v=r(t,n,"logOverride",G),C=r(t,n,"supported",G),M=r(t,n,"pure",Y),$=r(t,n,"keepNames",I),S=r(t,n,"platform",b),D=r(t,n,"tsconfigRaw",at),q=r(t,n,"absPaths",Y);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),f&&e.push(`--target=${ge(Array.isArray(f)?f:[f],"target")}`),s&&e.push(`--format=${s}`),o&&e.push(`--global-name=${o}`),S&&e.push(`--platform=${S}`),D&&e.push(`--tsconfig-raw=${typeof D=="string"?D:JSON.stringify(D)}`),U&&e.push("--minify"),B&&e.push("--minify-syntax"),T&&e.push("--minify-whitespace"),j&&e.push("--minify-identifiers"),k&&e.push(`--line-limit=${k}`),R&&e.push(`--charset=${R}`),h!==void 0&&e.push(`--tree-shaking=${h}`),m&&e.push("--ignore-annotations"),z)for(let w of z)e.push(`--drop:${Q(w,"drop")}`);if(V&&e.push(`--drop-labels=${ge(V,"drop label")}`),q&&e.push(`--abs-paths=${ge(q,"abs paths")}`),p&&e.push(`--mangle-props=${Se(p)}`),g&&e.push(`--reserve-props=${Se(g)}`),y!==void 0&&e.push(`--mangle-quoted=${y}`),u&&e.push(`--jsx=${u}`),O&&e.push(`--jsx-factory=${O}`),E&&e.push(`--jsx-fragment=${E}`),A&&e.push(`--jsx-import-source=${A}`),P&&e.push("--jsx-dev"),c&&e.push("--jsx-side-effects"),d)for(let w in d){if(w.indexOf("=")>=0)throw new Error(`Invalid define: ${w}`);e.push(`--define:${w}=${Q(d[w],"define",w)}`)}if(v)for(let w in v){if(w.indexOf("=")>=0)throw new Error(`Invalid log override: ${w}`);e.push(`--log-override:${w}=${Q(v[w],"log override",w)}`)}if(C)for(let w in C){if(w.indexOf("=")>=0)throw new Error(`Invalid supported: ${w}`);let F=C[w];if(typeof F!="boolean")throw new Error(`Expected value for supported ${_(w)} to be a boolean, got ${typeof F} instead`);e.push(`--supported:${w}=${F}`)}if(M)for(let w of M)e.push(`--pure:${Q(w,"pure")}`);$&&e.push("--keep-names")}function ct(e,t,n,i,a){var re;let l=[],f=[],s=Object.create(null),o=null,p=null;Ee(l,t,s,n,i),Ve(l,t,s);let g=r(t,s,"sourcemap",Ie),y=r(t,s,"bundle",I),U=r(t,s,"splitting",I),B=r(t,s,"preserveSymlinks",I),T=r(t,s,"metafile",I),j=r(t,s,"outfile",b),k=r(t,s,"outdir",b),z=r(t,s,"outbase",b),V=r(t,s,"tsconfig",b),R=r(t,s,"resolveExtensions",Y),h=r(t,s,"nodePaths",Y),m=r(t,s,"mainFields",Y),u=r(t,s,"conditions",Y),O=r(t,s,"external",Y),E=r(t,s,"packages",b),A=r(t,s,"alias",G),P=r(t,s,"loader",G),c=r(t,s,"outExtension",G),d=r(t,s,"publicPath",b),v=r(t,s,"entryNames",b),C=r(t,s,"chunkNames",b),M=r(t,s,"assetNames",b),$=r(t,s,"inject",Y),S=r(t,s,"banner",G),D=r(t,s,"footer",G),q=r(t,s,"entryPoints",ot),w=r(t,s,"absWorkingDir",b),F=r(t,s,"stdin",G),N=(re=r(t,s,"write",I))!=null?re:a,L=r(t,s,"allowOverwrite",I),J=r(t,s,"mangleCache",G);if(s.plugins=!0,K(t,s,`in ${e}() call`),g&&l.push(`--sourcemap${g===!0?"":`=${g}`}`),y&&l.push("--bundle"),L&&l.push("--allow-overwrite"),U&&l.push("--splitting"),B&&l.push("--preserve-symlinks"),T&&l.push("--metafile"),j&&l.push(`--outfile=${j}`),k&&l.push(`--outdir=${k}`),z&&l.push(`--outbase=${z}`),V&&l.push(`--tsconfig=${V}`),E&&l.push(`--packages=${E}`),R&&l.push(`--resolve-extensions=${ge(R,"resolve extension")}`),d&&l.push(`--public-path=${d}`),v&&l.push(`--entry-names=${v}`),C&&l.push(`--chunk-names=${C}`),M&&l.push(`--asset-names=${M}`),m&&l.push(`--main-fields=${ge(m,"main field")}`),u&&l.push(`--conditions=${ge(u,"condition")}`),O)for(let x of O)l.push(`--external:${Q(x,"external")}`);if(A)for(let x in A){if(x.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${x}`);l.push(`--alias:${x}=${Q(A[x],"alias",x)}`)}if(S)for(let x in S){if(x.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${x}`);l.push(`--banner:${x}=${Q(S[x],"banner",x)}`)}if(D)for(let x in D){if(x.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${x}`);l.push(`--footer:${x}=${Q(D[x],"footer",x)}`)}if($)for(let x of $)l.push(`--inject:${Q(x,"inject")}`);if(P)for(let x in P){if(x.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${x}`);l.push(`--loader:${x}=${Q(P[x],"loader",x)}`)}if(c)for(let x in c){if(x.indexOf("=")>=0)throw new Error(`Invalid out extension: ${x}`);l.push(`--out-extension:${x}=${Q(c[x],"out extension",x)}`)}if(q)if(Array.isArray(q))for(let x=0,ie=q.length;x<ie;x++){let H=q[x];if(typeof H=="object"&&H!==null){let te=Object.create(null),le=r(H,te,"in",b),X=r(H,te,"out",b);if(K(H,te,"in entry point at index "+x),le===void 0)throw new Error('Missing property "in" for entry point at index '+x);if(X===void 0)throw new Error('Missing property "out" for entry point at index '+x);f.push([X,le])}else f.push(["",Q(H,"entry point at index "+x)])}else for(let x in q)f.push([x,Q(q[x],"entry point",x)]);if(F){let x=Object.create(null),ie=r(F,x,"contents",ze),H=r(F,x,"resolveDir",b),te=r(F,x,"sourcefile",b),le=r(F,x,"loader",b);K(F,x,'in "stdin" object'),te&&l.push(`--sourcefile=${te}`),le&&l.push(`--loader=${le}`),H&&(p=H),typeof ie=="string"?o=Z(ie):ie instanceof Uint8Array&&(o=ie)}let W=[];if(h)for(let x of h)x+="",W.push(x);return{entries:f,flags:l,write:N,stdinContents:o,stdinResolveDir:p,absWorkingDir:w,nodePaths:W,mangleCache:_e(J)}}function ft(e,t,n,i){let a=[],l=Object.create(null);Ee(a,t,l,n,i),Ve(a,t,l);let f=r(t,l,"sourcemap",Ie),s=r(t,l,"sourcefile",b),o=r(t,l,"loader",b),p=r(t,l,"banner",b),g=r(t,l,"footer",b),y=r(t,l,"mangleCache",G);return K(t,l,`in ${e}() call`),f&&a.push(`--sourcemap=${f===!0?"external":f}`),s&&a.push(`--sourcefile=${s}`),o&&a.push(`--loader=${o}`),p&&a.push(`--banner=${p}`),g&&a.push(`--footer=${g}`),{flags:a,mangleCache:_e(y)}}function Je(e){let t={},n={didClose:!1,reason:""},i={},a=0,l=0,f=new Uint8Array(16*1024),s=0,o=R=>{let h=s+R.length;if(h>f.length){let u=new Uint8Array(h*2);u.set(f),f=u}f.set(R,s),s+=R.length;let m=0;for(;m+4<=s;){let u=Be(f,m);if(m+4+u>s)break;m+=4,T(f.subarray(m,m+u)),m+=u}m>0&&(f.copyWithin(0,m,s),s-=m)},p=R=>{n.didClose=!0,R&&(n.reason=": "+(R.message||R));let h="The service was stopped"+n.reason;for(let m in i)i[m](h,null);i={}},g=(R,h,m)=>{if(n.didClose)return m("The service is no longer running"+n.reason,null);let u=a++;i[u]=(O,E)=>{try{m(O,E)}finally{R&&R.unref()}},R&&R.ref(),e.writeToStdin(Me({id:u,isRequest:!0,value:h}))},y=(R,h)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Me({id:R,isRequest:!1,value:h}))},U=(R,h)=>ne(null,null,function*(){try{if(h.command==="ping"){y(R,{});return}if(typeof h.key=="number"){let m=t[h.key];if(!m)return;let u=m[h.command];if(u){yield u(R,h);return}}throw new Error("Invalid command: "+h.command)}catch(m){let u=[ce(m,e,null,void 0,"")];try{y(R,{errors:u})}catch(O){}}}),B=!0,T=R=>{if(B){B=!1;let m=String.fromCharCode(...R);if(m!=="0.28.0")throw new Error(`Cannot start service: Host version "0.28.0" does not match binary version ${_(m)}`);return}let h=Le(R);if(h.isRequest)U(h.id,h.value);else{let m=i[h.id];delete i[h.id],h.value.error?m(h.value.error,{}):m(null,h.value)}};return{readFromStdout:o,afterClose:p,service:{buildOrContext:({callName:R,refs:h,options:m,isTTY:u,defaultWD:O,callback:E})=>{let A=0,P=l++,c={},d={ref(){++A===1&&h&&h.ref()},unref(){--A===0&&(delete t[P],h&&h.unref())}};t[P]=c,d.ref(),dt(R,P,g,y,d,e,c,m,u,O,(v,C)=>{try{E(v,C)}finally{d.unref()}})},transform:({callName:R,refs:h,input:m,options:u,isTTY:O,fs:E,callback:A})=>{let P=Qe(),c=d=>{try{if(typeof m!="string"&&!(m instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:v,mangleCache:C}=ft(R,u,O,Te),M={command:"transform",flags:v,inputFS:d!==null,input:d!==null?Z(d):typeof m=="string"?Z(m):m};C&&(M.mangleCache=C),g(h,M,($,S)=>{if($)return A(new Error($),null);let D=me(S.errors,P),q=me(S.warnings,P),w=1,F=()=>{if(--w===0){let N={warnings:q,code:S.code,map:S.map,mangleCache:void 0,legalComments:void 0};"legalComments"in S&&(N.legalComments=S==null?void 0:S.legalComments),S.mangleCache&&(N.mangleCache=S==null?void 0:S.mangleCache),A(null,N)}};if(D.length>0)return A(he("Transform failed",D,q),null);S.codeFS&&(w++,E.readFile(S.code,(N,L)=>{N!==null?A(N,null):(S.code=L,F())})),S.mapFS&&(w++,E.readFile(S.map,(N,L)=>{N!==null?A(N,null):(S.map=L,F())})),F()})}catch(v){let C=[];try{Ee(C,u,{},O,Te)}catch($){}let M=ce(v,e,P,void 0,"");g(h,{command:"error",flags:C,error:M},()=>{M.detail=P.load(M.detail),A(he("Transform failed",[M],[]),null)})}};if((typeof m=="string"||m instanceof Uint8Array)&&m.length>1024*1024){let d=c;c=()=>E.writeFile(m,d)}c(null)},formatMessages:({callName:R,refs:h,messages:m,options:u,callback:O})=>{if(!u)throw new Error(`Missing second argument in ${R}() call`);let E={},A=r(u,E,"kind",b),P=r(u,E,"color",I),c=r(u,E,"terminalWidth",fe);if(K(u,E,`in ${R}() call`),A===void 0)throw new Error(`Missing "kind" in ${R}() call`);if(A!=="error"&&A!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${R}() call`);let d={command:"format-msgs",messages:ae(m,"messages",null,"",c),isWarning:A==="warning"};P!==void 0&&(d.color=P),c!==void 0&&(d.terminalWidth=c),g(h,d,(v,C)=>{if(v)return O(new Error(v),null);O(null,C.messages)})},analyzeMetafile:({callName:R,refs:h,metafile:m,options:u,callback:O})=>{u===void 0&&(u={});let E={},A=r(u,E,"color",I),P=r(u,E,"verbose",I);K(u,E,`in ${R}() call`);let c={command:"analyze-metafile",metafile:m};A!==void 0&&(c.color=A),P!==void 0&&(c.verbose=P),g(h,c,(d,v)=>{if(d)return O(new Error(d),null);O(null,v.result)})}}}}function dt(e,t,n,i,a,l,f,s,o,p,g){let y=Qe(),U=e==="context",B=(k,z)=>{let V=[];try{Ee(V,s,{},o,Pe)}catch(h){}let R=ce(k,l,y,void 0,z);n(a,{command:"error",flags:V,error:R},()=>{R.detail=y.load(R.detail),g(he(U?"Context failed":"Build failed",[R],[]),null)})},T;if(typeof s=="object"){let k=s.plugins;if(k!==void 0){if(!Array.isArray(k))return B(new Error('"plugins" must be an array'),"");T=k}}if(T&&T.length>0){if(l.isSync)return B(new Error("Cannot use plugins in synchronous API calls"),"");pt(t,n,i,a,l,f,s,T,y).then(k=>{if(!k.ok)return B(k.error,k.pluginName);try{j(k.requestPlugins,k.runOnEndCallbacks,k.scheduleOnDisposeCallbacks)}catch(z){B(z,"")}},k=>B(k,""));return}try{j(null,(k,z)=>z([],[]),()=>{})}catch(k){B(k,"")}function j(k,z,V){let R=l.hasFS,{entries:h,flags:m,write:u,stdinContents:O,stdinResolveDir:E,absWorkingDir:A,nodePaths:P,mangleCache:c}=ct(e,s,o,Pe,R);if(u&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let d={command:"build",key:t,entries:h,flags:m,write:u,stdinContents:O,stdinResolveDir:E,absWorkingDir:A||p,nodePaths:P,context:U};k&&(d.plugins=k),c&&(d.mangleCache=c);let v=($,S)=>{let D={errors:me($.errors,y),warnings:me($.warnings,y),outputFiles:void 0,metafile:void 0,mangleCache:void 0},q=D.errors.slice(),w=D.warnings.slice();$.outputFiles&&(D.outputFiles=$.outputFiles.map(mt)),$.metafile&&$.metafile.length&&(D.metafile=yt($.metafile)),$.mangleCache&&(D.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(ue($.writeToStdout).replace(/\n$/,"")),z(D,(F,N)=>{if(q.length>0||F.length>0){let L=he("Build failed",q.concat(F),w.concat(N));return S(L,null,F,N)}S(null,D,F,N)})},C,M;U&&(f["on-end"]=($,S)=>new Promise(D=>{v(S,(q,w,F,N)=>{let L={errors:F,warnings:N};M&&M(q,w),C=void 0,M=void 0,i($,L),D()})})),n(a,d,($,S)=>{if($)return g(new Error($),null);if(!U)return v(S,(w,F)=>(V(),g(w,F)));if(S.errors.length>0)return g(he("Context failed",S.errors,S.warnings),null);let D=!1,q={rebuild:()=>(C||(C=new Promise((w,F)=>{let N;M=(J,W)=>{N||(N=()=>J?F(J):w(W))};let L=()=>{n(a,{command:"rebuild",key:t},(W,re)=>{W?F(new Error(W)):N?N():L()})};L()})),C),watch:(w={})=>new Promise((F,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');let L={},J=r(w,L,"delay",fe);K(w,L,"in watch() call");let W={command:"watch",key:t};J&&(W.delay=J),n(a,W,re=>{re?N(new Error(re)):F(void 0)})}),serve:(w={})=>new Promise((F,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let L={},J=r(w,L,"port",lt),W=r(w,L,"host",b),re=r(w,L,"servedir",b),x=r(w,L,"keyfile",b),ie=r(w,L,"certfile",b),H=r(w,L,"fallback",b),te=r(w,L,"cors",G),le=r(w,L,"onRequest",qe);K(w,L,"in serve() call");let X={command:"serve",key:t,onRequest:!!le};if(J!==void 0&&(X.port=J),W!==void 0&&(X.host=W),re!==void 0&&(X.servedir=re),x!==void 0&&(X.keyfile=x),ie!==void 0&&(X.certfile=ie),H!==void 0&&(X.fallback=H),te){let ye={},pe=r(te,ye,"origin",We);K(te,ye,'on "cors" object'),Array.isArray(pe)?X.corsOrigin=pe:pe!==void 0&&(X.corsOrigin=[pe])}n(a,X,(ye,pe)=>{if(ye)return N(new Error(ye));le&&(f["serve-request"]=(Ge,He)=>{le(He.args),i(Ge,{})}),F(pe)})}),cancel:()=>new Promise(w=>{if(D)return w();n(a,{command:"cancel",key:t},()=>{w()})}),dispose:()=>new Promise(w=>{if(D)return w();D=!0,n(a,{command:"dispose",key:t},()=>{w(),V(),a.unref()})})};a.ref(),g(null,q)})}}var pt=(e,t,n,i,a,l,f,s,o)=>ne(null,null,function*(){let p=[],g=[],y={},U={},B=[],T=0,j=0,k=[],z=!1;s=[...s];for(let h of s){let m={};if(typeof h!="object")throw new Error(`Plugin at index ${j} must be an object`);let u=r(h,m,"name",b);if(typeof u!="string"||u==="")throw new Error(`Plugin at index ${j} is missing a name`);try{let O=r(h,m,"setup",qe);if(typeof O!="function")throw new Error("Plugin is missing a setup function");K(h,m,`on plugin ${_(u)}`);let E={name:u,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};j++;let P=O({initialOptions:f,resolve:(c,d={})=>{if(!z)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let v=Object.create(null),C=r(d,v,"pluginName",b),M=r(d,v,"importer",b),$=r(d,v,"namespace",b),S=r(d,v,"resolveDir",b),D=r(d,v,"kind",b),q=r(d,v,"pluginData",Re),w=r(d,v,"with",G);return K(d,v,"in resolve() call"),new Promise((F,N)=>{let L={command:"resolve",path:c,key:e,pluginName:u};if(C!=null&&(L.pluginName=C),M!=null&&(L.importer=M),$!=null&&(L.namespace=$),S!=null&&(L.resolveDir=S),D!=null)L.kind=D;else throw new Error('Must specify "kind" when calling "resolve"');q!=null&&(L.pluginData=o.store(q)),w!=null&&(L.with=gt(w,"with")),t(i,L,(J,W)=>{J!==null?N(new Error(J)):F({errors:me(W.errors,o),warnings:me(W.warnings,o),path:W.path,external:W.external,sideEffects:W.sideEffects,namespace:W.namespace,suffix:W.suffix,pluginData:o.load(W.pluginData)})})})},onStart(c){let d='This error came from the "onStart" callback registered here:',v=xe(new Error(d),a,"onStart");p.push({name:u,callback:c,note:v}),E.onStart=!0},onEnd(c){let d='This error came from the "onEnd" callback registered here:',v=xe(new Error(d),a,"onEnd");g.push({name:u,callback:c,note:v}),E.onEnd=!0},onResolve(c,d){let v='This error came from the "onResolve" callback registered here:',C=xe(new Error(v),a,"onResolve"),M={},$=r(c,M,"filter",Oe),S=r(c,M,"namespace",b);if(K(c,M,`in onResolve() call for plugin ${_(u)}`),$==null)throw new Error("onResolve() call is missing a filter");let D=T++;y[D]={name:u,callback:d,note:C},E.onResolve.push({id:D,filter:Se($),namespace:S||""})},onLoad(c,d){let v='This error came from the "onLoad" callback registered here:',C=xe(new Error(v),a,"onLoad"),M={},$=r(c,M,"filter",Oe),S=r(c,M,"namespace",b);if(K(c,M,`in onLoad() call for plugin ${_(u)}`),$==null)throw new Error("onLoad() call is missing a filter");let D=T++;U[D]={name:u,callback:d,note:C},E.onLoad.push({id:D,filter:Se($),namespace:S||""})},onDispose(c){B.push(c)},esbuild:a.esbuild});P&&(yield P),k.push(E)}catch(O){return{ok:!1,error:O,pluginName:u}}}l["on-start"]=(h,m)=>ne(null,null,function*(){o.clear();let u={errors:[],warnings:[]};yield Promise.all(p.map(P=>ne(null,[P],function*({name:O,callback:E,note:A}){try{let c=yield E();if(c!=null){if(typeof c!="object")throw new Error(`Expected onStart() callback in plugin ${_(O)} to return an object`);let d={},v=r(c,d,"errors",se),C=r(c,d,"warnings",se);K(c,d,`from onStart() callback in plugin ${_(O)}`),v!=null&&u.errors.push(...ae(v,"errors",o,O,void 0)),C!=null&&u.warnings.push(...ae(C,"warnings",o,O,void 0))}}catch(c){u.errors.push(ce(c,a,o,A&&A(),O))}}))),n(h,u)}),l["on-resolve"]=(h,m)=>ne(null,null,function*(){let u={},O="",E,A;for(let P of m.ids)try{({name:O,callback:E,note:A}=y[P]);let c=yield E({path:m.path,importer:m.importer,namespace:m.namespace,resolveDir:m.resolveDir,kind:m.kind,pluginData:o.load(m.pluginData),with:m.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${_(O)} to return an object`);let d={},v=r(c,d,"pluginName",b),C=r(c,d,"path",b),M=r(c,d,"namespace",b),$=r(c,d,"suffix",b),S=r(c,d,"external",I),D=r(c,d,"sideEffects",I),q=r(c,d,"pluginData",Re),w=r(c,d,"errors",se),F=r(c,d,"warnings",se),N=r(c,d,"watchFiles",Y),L=r(c,d,"watchDirs",Y);K(c,d,`from onResolve() callback in plugin ${_(O)}`),u.id=P,v!=null&&(u.pluginName=v),C!=null&&(u.path=C),M!=null&&(u.namespace=M),$!=null&&(u.suffix=$),S!=null&&(u.external=S),D!=null&&(u.sideEffects=D),q!=null&&(u.pluginData=o.store(q)),w!=null&&(u.errors=ae(w,"errors",o,O,void 0)),F!=null&&(u.warnings=ae(F,"warnings",o,O,void 0)),N!=null&&(u.watchFiles=ve(N,"watchFiles")),L!=null&&(u.watchDirs=ve(L,"watchDirs"));break}}catch(c){u={id:P,errors:[ce(c,a,o,A&&A(),O)]};break}n(h,u)}),l["on-load"]=(h,m)=>ne(null,null,function*(){let u={},O="",E,A;for(let P of m.ids)try{({name:O,callback:E,note:A}=U[P]);let c=yield E({path:m.path,namespace:m.namespace,suffix:m.suffix,pluginData:o.load(m.pluginData),with:m.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${_(O)} to return an object`);let d={},v=r(c,d,"pluginName",b),C=r(c,d,"contents",ze),M=r(c,d,"resolveDir",b),$=r(c,d,"pluginData",Re),S=r(c,d,"loader",b),D=r(c,d,"errors",se),q=r(c,d,"warnings",se),w=r(c,d,"watchFiles",Y),F=r(c,d,"watchDirs",Y);K(c,d,`from onLoad() callback in plugin ${_(O)}`),u.id=P,v!=null&&(u.pluginName=v),C instanceof Uint8Array?u.contents=C:C!=null&&(u.contents=Z(C)),M!=null&&(u.resolveDir=M),$!=null&&(u.pluginData=o.store($)),S!=null&&(u.loader=S),D!=null&&(u.errors=ae(D,"errors",o,O,void 0)),q!=null&&(u.warnings=ae(q,"warnings",o,O,void 0)),w!=null&&(u.watchFiles=ve(w,"watchFiles")),F!=null&&(u.watchDirs=ve(F,"watchDirs"));break}}catch(c){u={id:P,errors:[ce(c,a,o,A&&A(),O)]};break}n(h,u)});let V=(h,m)=>m([],[]);g.length>0&&(V=(h,m)=>{ne(null,null,function*(){let u=[],O=[];for(let{name:E,callback:A,note:P}of g){let c,d;try{let v=yield A(h);if(v!=null){if(typeof v!="object")throw new Error(`Expected onEnd() callback in plugin ${_(E)} to return an object`);let C={},M=r(v,C,"errors",se),$=r(v,C,"warnings",se);K(v,C,`from onEnd() callback in plugin ${_(E)}`),M!=null&&(c=ae(M,"errors",o,E,void 0)),$!=null&&(d=ae($,"warnings",o,E,void 0))}}catch(v){c=[ce(v,a,o,P&&P(),E)]}if(c){u.push(...c);try{h.errors.push(...c)}catch(v){}}if(d){O.push(...d);try{h.warnings.push(...d)}catch(v){}}}m(u,O)})});let R=()=>{for(let h of B)setTimeout(()=>h(),0)};return z=!0,{ok:!0,requestPlugins:k,runOnEndCallbacks:V,scheduleOnDisposeCallbacks:R}});function Qe(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function xe(e,t,n){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
`);l.splice(1,1);let f=Ye(t,l,n);if(f)return i={text:e.message,location:f},i}catch(l){}}}function ce(e,t,n,i,a){let l="Internal error",f=null;try{l=(e&&e.message||e)+""}catch(s){}try{f=Ye(t,(e.stack+"").split(`
`),"")}catch(s){}return{id:"",pluginName:a,text:l,location:f,notes:i?[i]:[],detail:n?n.store(e):-1}}function Ye(e,t,n){let i="    at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let a=1;a<t.length;a++){let l=t[a];if(l.startsWith(i))for(l=l.slice(i.length);;){let f=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(f){l=f[1];continue}if(f=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),f){l=f[1];continue}if(f=/^(\S+):(\d+):(\d+)$/.exec(l),f){let s;try{s=e.readFileSync(f[1],"utf8")}catch(y){break}let o=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+f[2]-1]||"",p=+f[3]-1,g=o.slice(p,p+n.length)===n?n.length:0;return{file:f[1],namespace:"file",line:+f[2],column:Z(o.slice(0,p)).length,length:Z(o.slice(p,p+g)).length,lineText:o+`
`+t.slice(1).join(`
`),suggestion:""}}break}}return null}function he(e,t,n){let i=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((l,f)=>{if(f===i)return`
...`;if(!l.location)return`
error: ${l.text}`;let{file:s,line:o,column:p}=l.location,g=l.pluginName?`[plugin: ${l.pluginName}] `:"";return`
${s}:${o}:${p}: ERROR: ${g}${l.text}`}).join("");let a=new Error(e);for(let[l,f]of[["errors",t],["warnings",n]])Object.defineProperty(a,l,{configurable:!0,enumerable:!0,get:()=>f,set:s=>Object.defineProperty(a,l,{configurable:!0,enumerable:!0,value:s})});return a}function me(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Ne(e,t,n){if(e==null)return null;let i={},a=r(e,i,"file",b),l=r(e,i,"namespace",b),f=r(e,i,"line",fe),s=r(e,i,"column",fe),o=r(e,i,"length",fe),p=r(e,i,"lineText",b),g=r(e,i,"suggestion",b);if(K(e,i,t),p){let y=p.slice(0,(s&&s>0?s:0)+(o&&o>0?o:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(y)&&!/\n/.test(p)&&(p=y)}return{file:a||"",namespace:l||"",line:f||0,column:s||0,length:o||0,lineText:p||"",suggestion:g||""}}function ae(e,t,n,i,a){let l=[],f=0;for(let s of e){let o={},p=r(s,o,"id",b),g=r(s,o,"pluginName",b),y=r(s,o,"text",b),U=r(s,o,"location",je),B=r(s,o,"notes",se),T=r(s,o,"detail",Re),j=`in element ${f} of "${t}"`;K(s,o,j);let k=[];if(B)for(let z of B){let V={},R=r(z,V,"text",b),h=r(z,V,"location",je);K(z,V,j),k.push({text:R||"",location:Ne(h,j,a)})}l.push({id:p||"",pluginName:g||i,text:y||"",location:Ne(U,j,a),notes:k,detail:n?n.store(T):-1}),f++}return l}function ve(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${_(t)} must be an array of strings`);n.push(i)}return n}function gt(e,t){let n=Object.create(null);for(let i in e){let a=e[i];if(typeof a!="string")throw new Error(`key ${_(i)} in object ${_(t)} must be a string`);n[i]=a}return n}function mt({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let a=this.contents;return(i===null||a!==t)&&(t=a,i=ue(a)),i}}}function Se(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}function yt(e){let t;try{t=ue(e)}catch(n){return Ue(e)}return JSON.parse(t)}var wt="0.28.0",bt=e=>we().build(e),xt=e=>we().context(e),vt=(e,t)=>we().transform(e,t),Rt=(e,t)=>we().formatMessages(e,t),Ot=(e,t)=>we().analyzeMetafile(e,t),St=()=>{throw new Error('The "buildSync" API only works in node')},Et=()=>{throw new Error('The "transformSync" API only works in node')},kt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Ct=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},$t=()=>(ke&&ke(),Promise.resolve()),de,ke,Ce,we=()=>{if(Ce)return Ce;throw de?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')},At=e=>{e=Ke(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(de)throw new Error('Cannot call "initialize" more than once');return de=Dt(t||"",n,i),de.catch(()=>{de=void 0}),de},Dt=(e,t,n)=>ne(null,null,function*(){let i,a,l=new Promise(y=>a=y);if(n){let y=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nvar _=(r,f,d)=>new Promise((a,i)=>{var s=c=>{try{o(d.next(c))}catch(u){i(u)}},n=c=>{try{o(d.throw(c))}catch(u){i(u)}},o=c=>c.done?a(c.value):Promise.resolve(c.value).then(s,n);o((d=d.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const a=new Error("not implemented");return a.code="ENOSYS",a};if(!globalThis.fs){let a="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(i,s){a+=d.decode(s);const n=a.lastIndexOf(`\n`);return n!=-1&&(console.log(a.substring(0,n)),a=a.substring(n+1)),s.length},write(i,s,n,o,c,u){if(n!==0||o!==s.length||c!==null){u(r());return}const m=this.writeSync(i,s);u(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,u){u(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(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.path||(globalThis.path={resolve(...a){return a.join("/")}}),!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");const f=new TextEncoder("utf-8"),d=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;const a=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(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 h=this._ids.get(e);h===void 0&&(h=this._idPool.pop(),h===void 0&&(h=this._values.length),this._values[h]=e,this._goRefCounts[h]=0,this._ids.set(e,h)),this._goRefCounts[h]++;let y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,h,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},u=t=>{const e=s(t+0),l=s(t+8),h=new Array(l);for(let y=0;y<l;y++)h[y]=n(e+y*8);return h},m=t=>{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=(t,e)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(t,e)),w=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e,callExport:g},gojs:{"runtime.wasmExit":t=>{t>>>=0;const 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;const e=s(t+8),l=s(t+16),h=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,h))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,a(t+8,(w+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();a(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const 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()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),h=u(t+32),y=Reflect.apply(l,e,h);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,a(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),a(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(a){return _(this,null,function*(){if(!(a instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=a,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 i=4096;const s=g=>{const w=i,t=f.encode(g+"\\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,i%8!==0&&(i+=8-i%8),w},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const u=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,u),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(a){const i=this;return function(){const s={id:a,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,a="";d.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){a+=f.decode(u);let m=a.split(`\n`);m.length>1&&console.log(m.slice(0,-1).join(`\n`)),a=m[m.length-1]}else throw new Error("Bad write");return u.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,u,m,g,w,t)=>{if(c!==0||m!==0||g!==u.length||w!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,u,m,g,w,t);return}let e=i[0],l=Math.max(0,Math.min(g,e.length-n));u.set(e.subarray(n,n+l),m),n+=l,n===e.length&&(i.shift(),n=0),t(null,l)};let o=new globalThis.Go;return o.argv=["","--service=0.28.0"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return _(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const a=yield d.arrayBuffer();return(yield WebAssembly.instantiate(a,f.importObject)).instance})}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(y))}else{let y=(postMessage=>{
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
var _=(r,f,d)=>new Promise((a,i)=>{var s=c=>{try{o(d.next(c))}catch(u){i(u)}},n=c=>{try{o(d.throw(c))}catch(u){i(u)}},o=c=>c.done?a(c.value):Promise.resolve(c.value).then(s,n);o((d=d.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const a=new Error("not implemented");return a.code="ENOSYS",a};if(!globalThis.fs){let a="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(i,s){a+=d.decode(s);const n=a.lastIndexOf(`
`);return n!=-1&&(console.log(a.substring(0,n)),a=a.substring(n+1)),s.length},write(i,s,n,o,c,u){if(n!==0||o!==s.length||c!==null){u(r());return}const m=this.writeSync(i,s);u(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,u){u(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(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.path||(globalThis.path={resolve(...a){return a.join("/")}}),!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");const f=new TextEncoder("utf-8"),d=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;const a=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(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 h=this._ids.get(e);h===void 0&&(h=this._idPool.pop(),h===void 0&&(h=this._values.length),this._values[h]=e,this._goRefCounts[h]=0,this._ids.set(e,h)),this._goRefCounts[h]++;let y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,h,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},u=t=>{const e=s(t+0),l=s(t+8),h=new Array(l);for(let y=0;y<l;y++)h[y]=n(e+y*8);return h},m=t=>{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=(t,e)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(t,e)),w=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e,callExport:g},gojs:{"runtime.wasmExit":t=>{t>>>=0;const 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;const e=s(t+8),l=s(t+16),h=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,h))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,a(t+8,(w+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();a(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const 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()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),h=u(t+32),y=Reflect.apply(l,e,h);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,a(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),a(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(a){return _(this,null,function*(){if(!(a instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=a,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 i=4096;const s=g=>{const w=i,t=f.encode(g+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,i%8!==0&&(i+=8-i%8),w},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const u=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,u),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(a){const i=this;return function(){const s={id:a,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,a="";d.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){a+=f.decode(u);let m=a.split(`
`);m.length>1&&console.log(m.slice(0,-1).join(`
`)),a=m[m.length-1]}else throw new Error("Bad write");return u.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,u,m,g,w,t)=>{if(c!==0||m!==0||g!==u.length||w!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,u,m,g,w,t);return}let e=i[0],l=Math.max(0,Math.min(g,e.length-n));u.set(e.subarray(n,n+l),m),n+=l,n===e.length&&(i.shift(),n=0),t(null,l)};let o=new globalThis.Go;return o.argv=["","--service=0.28.0"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return _(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const a=yield d.arrayBuffer();return(yield WebAssembly.instantiate(a,f.importObject)).instance})}return r=>onmessage(r);})(B=>i.onmessage({data:B})),U;i={onmessage:null,postMessage:B=>setTimeout(()=>{try{U=y({data:B})}catch(T){a(T)}}),terminate(){if(U)for(let B of U._scheduledTimeouts.values())clearTimeout(B)}}}let f,s,o=new Promise((y,U)=>{f=y,s=U});i.onmessage=({data:y})=>{i.onmessage=({data:U})=>p(U),y?s(y):f()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:p,service:g}=Je({writeToStdin(y){i.postMessage(y)},isSync:!1,hasFS:!1,esbuild:$e});yield o,ke=()=>{i.terminate(),de=void 0,ke=void 0,Ce=void 0},Ce={build:y=>new Promise((U,B)=>{l.then(B),g.buildOrContext({callName:"build",refs:null,options:y,isTTY:!1,defaultWD:"/",callback:(T,j)=>T?B(T):U(j)})}),context:y=>new Promise((U,B)=>{l.then(B),g.buildOrContext({callName:"context",refs:null,options:y,isTTY:!1,defaultWD:"/",callback:(T,j)=>T?B(T):U(j)})}),transform:(y,U)=>new Promise((B,T)=>{l.then(T),g.transform({callName:"transform",refs:null,input:y,options:U||{},isTTY:!1,fs:{readFile(j,k){k(new Error("Internal error"),null)},writeFile(j,k){k(null)}},callback:(j,k)=>j?T(j):B(k)})}),formatMessages:(y,U)=>new Promise((B,T)=>{l.then(T),g.formatMessages({callName:"formatMessages",refs:null,messages:y,options:U,callback:(j,k)=>j?T(j):B(k)})}),analyzeMetafile:(y,U)=>new Promise((B,T)=>{l.then(T),g.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof y=="string"?y:JSON.stringify(y),options:U,callback:(j,k)=>j?T(j):B(k)})})}}),Ft=$e;
})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
