isomorfeus-asset-manager 0.16.4 → 0.18.0

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