isomorfeus-asset-manager 0.15.10 → 0.15.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,17 +1,17 @@
1
1
  (module=>{
2
- "use strict";var ye=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var We=Object.prototype.hasOwnProperty;var qe=(t,e)=>{for(var r in e)ye(t,r,{get:e[r],enumerable:!0})},Ie=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Le(e))!We.call(t,a)&&a!==r&&ye(t,a,{get:()=>e[a],enumerable:!(s=je(e,a))||s.enumerable});return t};var ze=t=>Ie(ye({},"__esModule",{value:!0}),t);var H=(t,e,r)=>new Promise((s,a)=>{var i=d=>{try{l(r.next(d))}catch(R){a(R)}},u=d=>{try{l(r.throw(d))}catch(R){a(R)}},l=d=>d.done?s(d.value):Promise.resolve(d.value).then(i,u);l((r=r.apply(t,e)).next())});var me={};qe(me,{analyzeMetafile:()=>at,analyzeMetafileSync:()=>dt,build:()=>lt,buildSync:()=>ut,default:()=>mt,formatMessages:()=>st,formatMessagesSync:()=>ct,initialize:()=>pt,serve:()=>it,transform:()=>ot,transformSync:()=>ft,version:()=>nt});module.exports=ze(me);function be(t){let e=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(Q(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let a of s)e(a)}else{let a=Object.keys(s);r.write8(6),r.write32(a.length);for(let i of a)r.write(Q(i)),e(s[i])}},r=new ae;return r.write32(0),r.write32(t.id<<1|+!t.isRequest),e(t.value),he(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Se(t){let e=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ee(r.read());case 4:return r.read();case 5:{let u=r.read32(),l=[];for(let d=0;d<u;d++)l.push(e());return l}case 6:{let u=r.read32(),l={};for(let d=0;d<u;d++)l[ee(r.read())]=e();return l}default:throw new Error("Invalid packet")}},r=new ae(t),s=r.read32(),a=(s&1)===0;s>>>=1;let i=e();if(r.ptr!==t.length)throw new Error("Invalid packet");return{id:s,isRequest:a,value:i}}var ae=class{constructor(e=new Uint8Array(1024)){this.buf=e;this.len=0;this.ptr=0}_write(e){if(this.len+e>this.buf.length){let r=new Uint8Array((this.len+e)*2);r.set(this.buf),this.buf=r}return this.len+=e,this.len-e}write8(e){let r=this._write(1);this.buf[r]=e}write32(e){let r=this._write(4);he(this.buf,e,r)}write(e){let r=this._write(4+e.length);he(this.buf,e.length,r),this.buf.set(e,r+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return we(this.buf,this._read(4))}read(){let e=this.read32(),r=new Uint8Array(e),s=this._read(r.length);return r.set(this.buf.subarray(s,s+e)),r}},Q,ee;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let t=new TextEncoder,e=new TextDecoder;Q=r=>t.encode(r),ee=r=>e.decode(r)}else if(typeof Buffer!="undefined")Q=t=>{let e=Buffer.from(t);return e instanceof Uint8Array||(e=new Uint8Array(e)),e},ee=t=>{let{buffer:e,byteOffset:r,byteLength:s}=t;return Buffer.from(e,r,s).toString()};else throw new Error("No UTF-8 codec found");function we(t,e){return t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24}function he(t,e,r){t[r++]=e,t[r++]=e>>8,t[r++]=e>>16,t[r++]=e>>24}var Ee="warning",ke="silent";function $e(t){if(t+="",t.indexOf(",")>=0)throw new Error(`Invalid target: ${t}`);return t}var ce=()=>null,U=t=>typeof t=="boolean"?null:"a boolean",_e=t=>typeof t=="boolean"||typeof t=="object"&&!Array.isArray(t)?null:"a boolean or an object",h=t=>typeof t=="string"?null:"a string",de=t=>t instanceof RegExp?null:"a RegExp object",le=t=>typeof t=="number"&&t===(t|0)?null:"an integer",ve=t=>typeof t=="function"?null:"a function",q=t=>Array.isArray(t)?null:"an array",G=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"an object",Ve=t=>t instanceof WebAssembly.Module?null:"a WebAssembly.Module",Je=t=>typeof t=="object"&&t!==null?null:"an array or an object",Me=t=>typeof t=="object"&&!Array.isArray(t)?null:"an object or null",Ce=t=>typeof t=="string"||typeof t=="boolean"?null:"a string or a boolean",Ye=t=>typeof t=="string"||typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"a string or an object",Qe=t=>typeof t=="string"||Array.isArray(t)?null:"a string or an array",De=t=>typeof t=="string"||t instanceof Uint8Array?null:"a string or a Uint8Array";function n(t,e,r,s){let a=t[r];if(e[r+""]=!0,a===void 0)return;let i=s(a);if(i!==null)throw new Error(`"${r}" must be ${i}`);return a}function K(t,e,r){for(let s in t)if(!(s in e))throw new Error(`Invalid option ${r}: "${s}"`)}function Be(t){let e=Object.create(null),r=n(t,e,"wasmURL",h),s=n(t,e,"wasmModule",Ve),a=n(t,e,"worker",U);return K(t,e,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:a}}function Pe(t){let e;if(t!==void 0){e=Object.create(null);for(let r of Object.keys(t)){let s=t[r];if(typeof s=="string"||s===!1)e[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return e}function pe(t,e,r,s,a){let i=n(e,r,"color",U),u=n(e,r,"logLevel",h),l=n(e,r,"logLimit",le);i!==void 0?t.push(`--color=${i}`):s&&t.push("--color=true"),t.push(`--log-level=${u||a}`),t.push(`--log-limit=${l||0}`)}function Te(t,e,r){let s=n(e,r,"legalComments",h),a=n(e,r,"sourceRoot",h),i=n(e,r,"sourcesContent",U),u=n(e,r,"target",Qe),l=n(e,r,"format",h),d=n(e,r,"globalName",h),R=n(e,r,"mangleProps",de),E=n(e,r,"reserveProps",de),k=n(e,r,"mangleQuoted",U),B=n(e,r,"minify",U),F=n(e,r,"minifySyntax",U),N=n(e,r,"minifyWhitespace",U),I=n(e,r,"minifyIdentifiers",U),j=n(e,r,"drop",q),V=n(e,r,"charset",h),w=n(e,r,"treeShaking",U),p=n(e,r,"ignoreAnnotations",U),o=n(e,r,"jsx",h),c=n(e,r,"jsxFactory",h),y=n(e,r,"jsxFragment",h),x=n(e,r,"jsxImportSource",h),M=n(e,r,"jsxDev",U),f=n(e,r,"jsxSideEffects",U),g=n(e,r,"define",G),b=n(e,r,"logOverride",G),S=n(e,r,"supported",G),O=n(e,r,"pure",q),C=n(e,r,"keepNames",U),$=n(e,r,"platform",h);if(s&&t.push(`--legal-comments=${s}`),a!==void 0&&t.push(`--source-root=${a}`),i!==void 0&&t.push(`--sources-content=${i}`),u&&(Array.isArray(u)?t.push(`--target=${Array.from(u).map($e).join(",")}`):t.push(`--target=${$e(u)}`)),l&&t.push(`--format=${l}`),d&&t.push(`--global-name=${d}`),$&&t.push(`--platform=${$}`),B&&t.push("--minify"),F&&t.push("--minify-syntax"),N&&t.push("--minify-whitespace"),I&&t.push("--minify-identifiers"),V&&t.push(`--charset=${V}`),w!==void 0&&t.push(`--tree-shaking=${w}`),p&&t.push("--ignore-annotations"),j)for(let v of j)t.push(`--drop:${v}`);if(R&&t.push(`--mangle-props=${R.source}`),E&&t.push(`--reserve-props=${E.source}`),k!==void 0&&t.push(`--mangle-quoted=${k}`),o&&t.push(`--jsx=${o}`),c&&t.push(`--jsx-factory=${c}`),y&&t.push(`--jsx-fragment=${y}`),x&&t.push(`--jsx-import-source=${x}`),M&&t.push("--jsx-dev"),f&&t.push("--jsx-side-effects"),g)for(let v in g){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);t.push(`--define:${v}=${g[v]}`)}if(b)for(let v in b){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);t.push(`--log-override:${v}=${b[v]}`)}if(S)for(let v in S){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);t.push(`--supported:${v}=${S[v]}`)}if(O)for(let v of O)t.push(`--pure:${v}`);C&&t.push("--keep-names")}function He(t,e,r,s,a){var Y;let i=[],u=[],l=Object.create(null),d=null,R=null,E=null;pe(i,e,l,r,s),Te(i,e,l);let k=n(e,l,"sourcemap",Ce),B=n(e,l,"bundle",U),F=n(e,l,"watch",_e),N=n(e,l,"splitting",U),I=n(e,l,"preserveSymlinks",U),j=n(e,l,"metafile",U),V=n(e,l,"outfile",h),w=n(e,l,"outdir",h),p=n(e,l,"outbase",h),o=n(e,l,"tsconfig",h),c=n(e,l,"resolveExtensions",q),y=n(e,l,"nodePaths",q),x=n(e,l,"mainFields",q),M=n(e,l,"conditions",q),f=n(e,l,"external",q),g=n(e,l,"loader",G),b=n(e,l,"outExtension",G),S=n(e,l,"publicPath",h),O=n(e,l,"entryNames",h),C=n(e,l,"chunkNames",h),$=n(e,l,"assetNames",h),v=n(e,l,"inject",q),D=n(e,l,"banner",G),L=n(e,l,"footer",G),z=n(e,l,"entryPoints",Je),W=n(e,l,"absWorkingDir",h),A=n(e,l,"stdin",G),P=(Y=n(e,l,"write",U))!=null?Y:a,_=n(e,l,"allowOverwrite",U),J=n(e,l,"incremental",U)===!0,Z=n(e,l,"mangleCache",G);if(l.plugins=!0,K(e,l,`in ${t}() call`),k&&i.push(`--sourcemap${k===!0?"":`=${k}`}`),B&&i.push("--bundle"),_&&i.push("--allow-overwrite"),F)if(i.push("--watch"),typeof F=="boolean")E={};else{let m=Object.create(null),T=n(F,m,"onRebuild",ve);K(F,m,`on "watch" in ${t}() call`),E={onRebuild:T}}if(N&&i.push("--splitting"),I&&i.push("--preserve-symlinks"),j&&i.push("--metafile"),V&&i.push(`--outfile=${V}`),w&&i.push(`--outdir=${w}`),p&&i.push(`--outbase=${p}`),o&&i.push(`--tsconfig=${o}`),c){let m=[];for(let T of c){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${T}`);m.push(T)}i.push(`--resolve-extensions=${m.join(",")}`)}if(S&&i.push(`--public-path=${S}`),O&&i.push(`--entry-names=${O}`),C&&i.push(`--chunk-names=${C}`),$&&i.push(`--asset-names=${$}`),x){let m=[];for(let T of x){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid main field: ${T}`);m.push(T)}i.push(`--main-fields=${m.join(",")}`)}if(M){let m=[];for(let T of M){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid condition: ${T}`);m.push(T)}i.push(`--conditions=${m.join(",")}`)}if(f)for(let m of f)i.push(`--external:${m}`);if(D)for(let m in D){if(m.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${m}`);i.push(`--banner:${m}=${D[m]}`)}if(L)for(let m in L){if(m.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${m}`);i.push(`--footer:${m}=${L[m]}`)}if(v)for(let m of v)i.push(`--inject:${m}`);if(g)for(let m in g){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);i.push(`--loader:${m}=${g[m]}`)}if(b)for(let m in b){if(m.indexOf("=")>=0)throw new Error(`Invalid out extension: ${m}`);i.push(`--out-extension:${m}=${b[m]}`)}if(z)if(Array.isArray(z))for(let m of z)u.push(["",m+""]);else for(let[m,T]of Object.entries(z))u.push([m+"",T+""]);if(A){let m=Object.create(null),T=n(A,m,"contents",De),se=n(A,m,"resolveDir",h),Oe=n(A,m,"sourcefile",h),xe=n(A,m,"loader",h);K(A,m,'in "stdin" object'),Oe&&i.push(`--sourcefile=${Oe}`),xe&&i.push(`--loader=${xe}`),se&&(R=se+""),typeof T=="string"?d=Q(T):T instanceof Uint8Array&&(d=T)}let re=[];if(y)for(let m of y)m+="",re.push(m);return{entries:u,flags:i,write:P,stdinContents:d,stdinResolveDir:R,absWorkingDir:W,incremental:J,nodePaths:re,watch:E,mangleCache:Pe(Z)}}function Ge(t,e,r,s){let a=[],i=Object.create(null);pe(a,e,i,r,s),Te(a,e,i);let u=n(e,i,"sourcemap",Ce),l=n(e,i,"tsconfigRaw",Ye),d=n(e,i,"sourcefile",h),R=n(e,i,"loader",h),E=n(e,i,"banner",h),k=n(e,i,"footer",h),B=n(e,i,"mangleCache",G);return K(e,i,`in ${t}() call`),u&&a.push(`--sourcemap=${u===!0?"external":u}`),l&&a.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),d&&a.push(`--sourcefile=${d}`),R&&a.push(`--loader=${R}`),E&&a.push(`--banner=${E}`),k&&a.push(`--footer=${k}`),{flags:a,mangleCache:Pe(B)}}function Fe(t){let e={},r={didClose:!1,reason:""},s={},a=0,i=0,u=new Uint8Array(16*1024),l=0,d=p=>{let o=l+p.length;if(o>u.length){let y=new Uint8Array(o*2);y.set(u),u=y}u.set(p,l),l+=p.length;let c=0;for(;c+4<=l;){let y=we(u,c);if(c+4+y>l)break;c+=4,N(u.subarray(c,c+y)),c+=y}c>0&&(u.copyWithin(0,c,l),l-=c)},R=p=>{r.didClose=!0,p&&(r.reason=": "+(p.message||p));let o="The service was stopped"+r.reason;for(let c in s)s[c](o,null);s={}},E=(p,o,c)=>{if(r.didClose)return c("The service is no longer running"+r.reason,null);let y=a++;s[y]=(x,M)=>{try{c(x,M)}finally{p&&p.unref()}},p&&p.ref(),t.writeToStdin(be({id:y,isRequest:!0,value:o}))},k=(p,o)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);t.writeToStdin(be({id:p,isRequest:!1,value:o}))},B=(p,o)=>H(this,null,function*(){try{if(o.command==="ping"){k(p,{});return}if(typeof o.key=="number"){let c=e[o.key];if(c){let y=c[o.command];if(y){yield y(p,o);return}}}throw new Error("Invalid command: "+o.command)}catch(c){k(p,{errors:[ie(c,t,null,void 0,"")]})}}),F=!0,N=p=>{if(F){F=!1;let c=String.fromCharCode(...p);if(c!=="0.15.15")throw new Error(`Cannot start service: Host version "0.15.15" does not match binary version ${JSON.stringify(c)}`);return}let o=Se(p);if(o.isRequest)B(o.id,o.value);else{let c=s[o.id];delete s[o.id],o.value.error?c(o.value.error,{}):c(null,o.value)}};return{readFromStdout:d,afterClose:R,service:{buildOrServe:({callName:p,refs:o,serveOptions:c,options:y,isTTY:x,defaultWD:M,callback:f})=>{let g=0,b=i++,S={},O={ref(){++g===1&&o&&o.ref()},unref(){--g===0&&(delete e[b],o&&o.unref())}};e[b]=S,O.ref(),Xe(p,b,E,k,O,t,S,y,c,x,M,r,(C,$)=>{try{f(C,$)}finally{O.unref()}})},transform:({callName:p,refs:o,input:c,options:y,isTTY:x,fs:M,callback:f})=>{let g=Ue(),b=S=>{try{if(typeof c!="string"&&!(c instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:C}=Ge(p,y,x,ke),$={command:"transform",flags:O,inputFS:S!==null,input:S!==null?Q(S):typeof c=="string"?Q(c):c};C&&($.mangleCache=C),E(o,$,(v,D)=>{if(v)return f(new Error(v),null);let L=X(D.errors,g),z=X(D.warnings,g),W=1,A=()=>{if(--W===0){let P={warnings:z,code:D.code,map:D.map};D.mangleCache&&(P.mangleCache=D==null?void 0:D.mangleCache),f(null,P)}};if(L.length>0)return f(ne("Transform failed",L,z),null);D.codeFS&&(W++,M.readFile(D.code,(P,_)=>{P!==null?f(P,null):(D.code=_,A())})),D.mapFS&&(W++,M.readFile(D.map,(P,_)=>{P!==null?f(P,null):(D.map=_,A())})),A()})}catch(O){let C=[];try{pe(C,y,{},x,ke)}catch(v){}let $=ie(O,t,g,void 0,"");E(o,{command:"error",flags:C,error:$},()=>{$.detail=g.load($.detail),f(ne("Transform failed",[$],[]),null)})}};if((typeof c=="string"||c instanceof Uint8Array)&&c.length>1024*1024){let S=b;b=()=>M.writeFile(c,S)}b(null)},formatMessages:({callName:p,refs:o,messages:c,options:y,callback:x})=>{let M=te(c,"messages",null,"");if(!y)throw new Error(`Missing second argument in ${p}() call`);let f={},g=n(y,f,"kind",h),b=n(y,f,"color",U),S=n(y,f,"terminalWidth",le);if(K(y,f,`in ${p}() call`),g===void 0)throw new Error(`Missing "kind" in ${p}() call`);if(g!=="error"&&g!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${p}() call`);let O={command:"format-msgs",messages:M,isWarning:g==="warning"};b!==void 0&&(O.color=b),S!==void 0&&(O.terminalWidth=S),E(o,O,(C,$)=>{if(C)return x(new Error(C),null);x(null,$.messages)})},analyzeMetafile:({callName:p,refs:o,metafile:c,options:y,callback:x})=>{y===void 0&&(y={});let M={},f=n(y,M,"color",U),g=n(y,M,"verbose",U);K(y,M,`in ${p}() call`);let b={command:"analyze-metafile",metafile:c};f!==void 0&&(b.color=f),g!==void 0&&(b.verbose=g),E(o,b,(S,O)=>{if(S)return x(new Error(S),null);x(null,O.result)})}}}}function Xe(t,e,r,s,a,i,u,l,d,R,E,k,B){let F=Ue(),N=(w,p,o,c)=>{let y=[];try{pe(y,l,{},R,Ee)}catch(M){}let x=ie(w,i,F,o,p);r(a,{command:"error",flags:y,error:x},()=>{x.detail=F.load(x.detail),c(x)})},I=(w,p)=>{N(w,p,void 0,o=>{B(ne("Build failed",[o],[]),null)})},j;if(typeof l=="object"){let w=l.plugins;if(w!==void 0){if(!Array.isArray(w))throw new Error('"plugins" must be an array');j=w}}if(j&&j.length>0){if(i.isSync){I(new Error("Cannot use plugins in synchronous API calls"),"");return}et(e,r,s,a,i,u,l,j,F).then(w=>{if(!w.ok){I(w.error,w.pluginName);return}try{V(w.requestPlugins,w.runOnEndCallbacks)}catch(p){I(p,"")}},w=>I(w,""));return}try{V(null,(w,p,o)=>o())}catch(w){I(w,"")}function V(w,p){let o=!i.isWriteUnavailable,{entries:c,flags:y,write:x,stdinContents:M,stdinResolveDir:f,absWorkingDir:g,incremental:b,nodePaths:S,watch:O,mangleCache:C}=He(t,l,R,Ee,o),$={command:"build",key:e,entries:c,flags:y,write:x,stdinContents:M,stdinResolveDir:f,absWorkingDir:g||E,incremental:b,nodePaths:S};w&&($.plugins=w),C&&($.mangleCache=C);let v=d&&Ze(e,r,s,a,u,d,$),D,L,z=(A,P)=>{A.outputFiles&&(P.outputFiles=A.outputFiles.map(tt)),A.metafile&&(P.metafile=JSON.parse(A.metafile)),A.mangleCache&&(P.mangleCache=A.mangleCache),A.writeToStdout!==void 0&&console.log(ee(A.writeToStdout).replace(/\n$/,""))},W=(A,P)=>{let _={errors:X(A.errors,F),warnings:X(A.warnings,F)};z(A,_),p(_,N,()=>{if(_.errors.length>0)return P(ne("Build failed",_.errors,_.warnings),null);if(A.rebuild){if(!D){let J=!1;D=()=>new Promise((Z,re)=>{if(J||k.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:e},(Y,m)=>{if(Y)return P(ne("Build failed",[{id:"",pluginName:"",text:Y,location:null,notes:[],detail:void 0}],[]),null);W(m,(T,se)=>{T?re(T):Z(se)})})}),a.ref(),D.dispose=()=>{J||(J=!0,r(a,{command:"rebuild-dispose",key:e},()=>{}),a.unref())}}_.rebuild=D}if(A.watch){if(!L){let J=!1;a.ref(),L=()=>{J||(J=!0,delete u["watch-rebuild"],r(a,{command:"watch-stop",key:e},()=>{}),a.unref())},O&&(u["watch-rebuild"]=(Z,re)=>{try{let Y=re.args,m={errors:X(Y.errors,F),warnings:X(Y.warnings,F)};z(Y,m),p(m,N,()=>{if(m.errors.length>0){O.onRebuild&&O.onRebuild(ne("Build failed",m.errors,m.warnings),null);return}m.stop=L,O.onRebuild&&O.onRebuild(null,m)})}catch(Y){console.error(Y)}s(Z,{})})}_.stop=L}P(null,_)})};if(x&&i.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(b&&i.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(O&&i.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,$,(A,P)=>{if(A)return B(new Error(A),null);if(v){let _=P,J=!1;a.ref();let Z={port:_.port,host:_.host,wait:v.wait,stop(){J||(J=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,Z)}return W(P,B)})}}var Ze=(t,e,r,s,a,i,u)=>{let l={},d=n(i,l,"port",le),R=n(i,l,"host",h),E=n(i,l,"servedir",h),k=n(i,l,"onRequest",ve),B=new Promise((F,N)=>{a["serve-wait"]=(I,j)=>{j.error!==null?N(new Error(j.error)):F(),r(I,{})}});return u.serve={},K(i,l,"in serve() call"),d!==void 0&&(u.serve.port=d),R!==void 0&&(u.serve.host=R),E!==void 0&&(u.serve.servedir=E),a["serve-request"]=(F,N)=>{k&&k(N.args),r(F,{})},{wait:B,stop(){e(s,{command:"serve-stop",key:t},()=>{})}}},et=(t,e,r,s,a,i,u,l,d)=>H(void 0,null,function*(){let R=[],E=[],k={},B={},F=0,N=0,I=[],j=!1;l=[...l];for(let w of l){let p={};if(typeof w!="object")throw new Error(`Plugin at index ${N} must be an object`);let o=n(w,p,"name",h);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${N} is missing a name`);try{let c=n(w,p,"setup",ve);if(typeof c!="function")throw new Error("Plugin is missing a setup function");K(w,p,`on plugin ${JSON.stringify(o)}`);let y={name:o,onResolve:[],onLoad:[]};N++;let M=c({initialOptions:u,resolve:(f,g={})=>{if(!j)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof f!="string")throw new Error("The path to resolve must be a string");let b=Object.create(null),S=n(g,b,"pluginName",h),O=n(g,b,"importer",h),C=n(g,b,"namespace",h),$=n(g,b,"resolveDir",h),v=n(g,b,"kind",h),D=n(g,b,"pluginData",ce);return K(g,b,"in resolve() call"),new Promise((L,z)=>{let W={command:"resolve",path:f,key:t,pluginName:o};S!=null&&(W.pluginName=S),O!=null&&(W.importer=O),C!=null&&(W.namespace=C),$!=null&&(W.resolveDir=$),v!=null&&(W.kind=v),D!=null&&(W.pluginData=d.store(D)),e(s,W,(A,P)=>{A!==null?z(new Error(A)):L({errors:X(P.errors,d),warnings:X(P.warnings,d),path:P.path,external:P.external,sideEffects:P.sideEffects,namespace:P.namespace,suffix:P.suffix,pluginData:d.load(P.pluginData)})})})},onStart(f){let g='This error came from the "onStart" callback registered here:',b=ue(new Error(g),a,"onStart");R.push({name:o,callback:f,note:b})},onEnd(f){let g='This error came from the "onEnd" callback registered here:',b=ue(new Error(g),a,"onEnd");E.push({name:o,callback:f,note:b})},onResolve(f,g){let b='This error came from the "onResolve" callback registered here:',S=ue(new Error(b),a,"onResolve"),O={},C=n(f,O,"filter",de),$=n(f,O,"namespace",h);if(K(f,O,`in onResolve() call for plugin ${JSON.stringify(o)}`),C==null)throw new Error("onResolve() call is missing a filter");let v=F++;k[v]={name:o,callback:g,note:S},y.onResolve.push({id:v,filter:C.source,namespace:$||""})},onLoad(f,g){let b='This error came from the "onLoad" callback registered here:',S=ue(new Error(b),a,"onLoad"),O={},C=n(f,O,"filter",de),$=n(f,O,"namespace",h);if(K(f,O,`in onLoad() call for plugin ${JSON.stringify(o)}`),C==null)throw new Error("onLoad() call is missing a filter");let v=F++;B[v]={name:o,callback:g,note:S},y.onLoad.push({id:v,filter:C.source,namespace:$||""})},esbuild:a.esbuild});M&&(yield M),I.push(y)}catch(c){return{ok:!1,error:c,pluginName:o}}}i["on-start"]=(w,p)=>H(void 0,null,function*(){let o={errors:[],warnings:[]};yield Promise.all(R.map(M=>H(void 0,[M],function*({name:c,callback:y,note:x}){try{let f=yield y();if(f!=null){if(typeof f!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(c)} to return an object`);let g={},b=n(f,g,"errors",q),S=n(f,g,"warnings",q);K(f,g,`from onStart() callback in plugin ${JSON.stringify(c)}`),b!=null&&o.errors.push(...te(b,"errors",d,c)),S!=null&&o.warnings.push(...te(S,"warnings",d,c))}}catch(f){o.errors.push(ie(f,a,d,x&&x(),c))}}))),r(w,o)}),i["on-resolve"]=(w,p)=>H(void 0,null,function*(){let o={},c="",y,x;for(let M of p.ids)try{({name:c,callback:y,note:x}=k[M]);let f=yield y({path:p.path,importer:p.importer,namespace:p.namespace,resolveDir:p.resolveDir,kind:p.kind,pluginData:d.load(p.pluginData)});if(f!=null){if(typeof f!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(c)} to return an object`);let g={},b=n(f,g,"pluginName",h),S=n(f,g,"path",h),O=n(f,g,"namespace",h),C=n(f,g,"suffix",h),$=n(f,g,"external",U),v=n(f,g,"sideEffects",U),D=n(f,g,"pluginData",ce),L=n(f,g,"errors",q),z=n(f,g,"warnings",q),W=n(f,g,"watchFiles",q),A=n(f,g,"watchDirs",q);K(f,g,`from onResolve() callback in plugin ${JSON.stringify(c)}`),o.id=M,b!=null&&(o.pluginName=b),S!=null&&(o.path=S),O!=null&&(o.namespace=O),C!=null&&(o.suffix=C),$!=null&&(o.external=$),v!=null&&(o.sideEffects=v),D!=null&&(o.pluginData=d.store(D)),L!=null&&(o.errors=te(L,"errors",d,c)),z!=null&&(o.warnings=te(z,"warnings",d,c)),W!=null&&(o.watchFiles=fe(W,"watchFiles")),A!=null&&(o.watchDirs=fe(A,"watchDirs"));break}}catch(f){o={id:M,errors:[ie(f,a,d,x&&x(),c)]};break}r(w,o)}),i["on-load"]=(w,p)=>H(void 0,null,function*(){let o={},c="",y,x;for(let M of p.ids)try{({name:c,callback:y,note:x}=B[M]);let f=yield y({path:p.path,namespace:p.namespace,suffix:p.suffix,pluginData:d.load(p.pluginData)});if(f!=null){if(typeof f!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(c)} to return an object`);let g={},b=n(f,g,"pluginName",h),S=n(f,g,"contents",De),O=n(f,g,"resolveDir",h),C=n(f,g,"pluginData",ce),$=n(f,g,"loader",h),v=n(f,g,"errors",q),D=n(f,g,"warnings",q),L=n(f,g,"watchFiles",q),z=n(f,g,"watchDirs",q);K(f,g,`from onLoad() callback in plugin ${JSON.stringify(c)}`),o.id=M,b!=null&&(o.pluginName=b),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=Q(S)),O!=null&&(o.resolveDir=O),C!=null&&(o.pluginData=d.store(C)),$!=null&&(o.loader=$),v!=null&&(o.errors=te(v,"errors",d,c)),D!=null&&(o.warnings=te(D,"warnings",d,c)),L!=null&&(o.watchFiles=fe(L,"watchFiles")),z!=null&&(o.watchDirs=fe(z,"watchDirs"));break}}catch(f){o={id:M,errors:[ie(f,a,d,x&&x(),c)]};break}r(w,o)});let V=(w,p,o)=>o();return E.length>0&&(V=(w,p,o)=>{(()=>H(void 0,null,function*(){for(let{name:c,callback:y,note:x}of E)try{yield y(w)}catch(M){w.errors.push(yield new Promise(f=>p(M,c,x&&x(),f)))}}))().then(o)}),j=!0,{ok:!0,requestPlugins:I,runOnEndCallbacks:V}});function Ue(){let t=new Map,e=0;return{load(r){return t.get(r)},store(r){if(r===void 0)return-1;let s=e++;return t.set(s,r),s}}}function ue(t,e,r){let s,a=!1;return()=>{if(a)return s;a=!0;try{let i=(t.stack+"").split(`
3
- `);i.splice(1,1);let u=Ne(e,i,r);if(u)return s={text:t.message,location:u},s}catch(i){}}}function ie(t,e,r,s,a){let i="Internal error",u=null;try{i=(t&&t.message||t)+""}catch(l){}try{u=Ne(e,(t.stack+"").split(`
4
- `),"")}catch(l){}return{id:"",pluginName:a,text:i,location:u,notes:s?[s]:[],detail:r?r.store(t):-1}}function Ne(t,e,r){let s=" at ";if(t.readFileSync&&!e[0].startsWith(s)&&e[1].startsWith(s))for(let a=1;a<e.length;a++){let i=e[a];if(!!i.startsWith(s))for(i=i.slice(s.length);;){let u=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(u){i=u[1];continue}if(u=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),u){i=u[1];continue}if(u=/^(\S+):(\d+):(\d+)$/.exec(i),u){let l;try{l=t.readFileSync(u[1],"utf8")}catch(k){break}let d=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+u[2]-1]||"",R=+u[3]-1,E=d.slice(R,R+r.length)===r?r.length:0;return{file:u[1],namespace:"file",line:+u[2],column:Q(d.slice(0,R)).length,length:Q(d.slice(R,R+E)).length,lineText:d+`
2
+ "use strict";var ye=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var qe=Object.prototype.hasOwnProperty;var Ie=(t,e)=>{for(var r in e)ye(t,r,{get:e[r],enumerable:!0})},ze=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of We(e))!qe.call(t,a)&&a!==r&&ye(t,a,{get:()=>e[a],enumerable:!(i=Le(e,a))||i.enumerable});return t};var Ke=t=>ze(ye({},"__esModule",{value:!0}),t);var X=(t,e,r)=>new Promise((i,a)=>{var l=g=>{try{o(r.next(g))}catch(y){a(y)}},c=g=>{try{o(r.throw(g))}catch(y){a(y)}},o=g=>g.done?i(g.value):Promise.resolve(g.value).then(l,c);o((r=r.apply(t,e)).next())});var me={};Ie(me,{analyzeMetafile:()=>ft,analyzeMetafileSync:()=>gt,build:()=>st,buildSync:()=>ct,default:()=>ht,formatMessages:()=>ut,formatMessagesSync:()=>pt,initialize:()=>mt,serve:()=>ot,transform:()=>at,transformSync:()=>dt,version:()=>it});module.exports=Ke(me);function be(t){let e=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)e(a)}else{let a=Object.keys(i);r.write8(6),r.write32(a.length);for(let l of a)r.write(H(l)),e(i[l])}},r=new ae;return r.write32(0),r.write32(t.id<<1|+!t.isRequest),e(t.value),he(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Ee(t){let e=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return te(r.read());case 4:return r.read();case 5:{let c=r.read32(),o=[];for(let g=0;g<c;g++)o.push(e());return o}case 6:{let c=r.read32(),o={};for(let g=0;g<c;g++)o[te(r.read())]=e();return o}default:throw new Error("Invalid packet")}},r=new ae(t),i=r.read32(),a=(i&1)===0;i>>>=1;let l=e();if(r.ptr!==t.length)throw new Error("Invalid packet");return{id:i,isRequest:a,value:l}}var ae=class{constructor(e=new Uint8Array(1024)){this.buf=e;this.len=0;this.ptr=0}_write(e){if(this.len+e>this.buf.length){let r=new Uint8Array((this.len+e)*2);r.set(this.buf),this.buf=r}return this.len+=e,this.len-e}write8(e){let r=this._write(1);this.buf[r]=e}write32(e){let r=this._write(4);he(this.buf,e,r)}write(e){let r=this._write(4+e.length);he(this.buf,e.length,r),this.buf.set(e,r+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return we(this.buf,this._read(4))}read(){let e=this.read32(),r=new Uint8Array(e),i=this._read(r.length);return r.set(this.buf.subarray(i,i+e)),r}},H,te;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let t=new TextEncoder,e=new TextDecoder;H=r=>t.encode(r),te=r=>e.decode(r)}else if(typeof Buffer!="undefined")H=t=>{let e=Buffer.from(t);return e instanceof Uint8Array||(e=new Uint8Array(e)),e},te=t=>{let{buffer:e,byteOffset:r,byteLength:i}=t;return Buffer.from(e,r,i).toString()};else throw new Error("No UTF-8 codec found");function we(t,e){return t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24}function he(t,e,r){t[r++]=e,t[r++]=e>>8,t[r++]=e>>16,t[r++]=e>>24}var ke="warning",$e="silent";function Me(t){if(t+="",t.indexOf(",")>=0)throw new Error(`Invalid target: ${t}`);return t}var ce=()=>null,F=t=>typeof t=="boolean"?null:"a boolean",Ve=t=>typeof t=="boolean"||typeof t=="object"&&!Array.isArray(t)?null:"a boolean or an object",b=t=>typeof t=="string"?null:"a string",de=t=>t instanceof RegExp?null:"a RegExp object",le=t=>typeof t=="number"&&t===(t|0)?null:"an integer",ve=t=>typeof t=="function"?null:"a function",q=t=>Array.isArray(t)?null:"an array",G=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"an object",Je=t=>t instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ye=t=>typeof t=="object"&&t!==null?null:"an array or an object",Ae=t=>typeof t=="object"&&!Array.isArray(t)?null:"an object or null",De=t=>typeof t=="string"||typeof t=="boolean"?null:"a string or a boolean",Qe=t=>typeof t=="string"||typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"a string or an object",He=t=>typeof t=="string"||Array.isArray(t)?null:"a string or an array",Pe=t=>typeof t=="string"||t instanceof Uint8Array?null:"a string or a Uint8Array",Ge=t=>typeof t=="string"||t instanceof URL?null:"a string or a URL";function n(t,e,r,i){let a=t[r];if(e[r+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`"${r}" must be ${l}`);return a}function z(t,e,r){for(let i in t)if(!(i in e))throw new Error(`Invalid option ${r}: "${i}"`)}function Ue(t){let e=Object.create(null),r=n(t,e,"wasmURL",Ge),i=n(t,e,"wasmModule",Je),a=n(t,e,"worker",F);return z(t,e,"in initialize() call"),{wasmURL:r,wasmModule:i,worker:a}}function Be(t){let e;if(t!==void 0){e=Object.create(null);for(let r of Object.keys(t)){let i=t[r];if(typeof i=="string"||i===!1)e[r]=i;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return e}function pe(t,e,r,i,a){let l=n(e,r,"color",F),c=n(e,r,"logLevel",b),o=n(e,r,"logLimit",le);l!==void 0?t.push(`--color=${l}`):i&&t.push("--color=true"),t.push(`--log-level=${c||a}`),t.push(`--log-limit=${o||0}`)}function Te(t,e,r){let i=n(e,r,"legalComments",b),a=n(e,r,"sourceRoot",b),l=n(e,r,"sourcesContent",F),c=n(e,r,"target",He),o=n(e,r,"format",b),g=n(e,r,"globalName",b),y=n(e,r,"mangleProps",de),v=n(e,r,"reserveProps",de),A=n(e,r,"mangleQuoted",F),B=n(e,r,"minify",F),k=n(e,r,"minifySyntax",F),P=n(e,r,"minifyWhitespace",F),I=n(e,r,"minifyIdentifiers",F),L=n(e,r,"drop",q),V=n(e,r,"charset",b),R=n(e,r,"treeShaking",F),d=n(e,r,"ignoreAnnotations",F),s=n(e,r,"jsx",b),f=n(e,r,"jsxFactory",b),h=n(e,r,"jsxFragment",b),E=n(e,r,"jsxImportSource",b),C=n(e,r,"jsxDev",F),u=n(e,r,"jsxSideEffects",F),p=n(e,r,"define",G),w=n(e,r,"logOverride",G),S=n(e,r,"supported",G),x=n(e,r,"pure",q),D=n(e,r,"keepNames",F),$=n(e,r,"platform",b);if(i&&t.push(`--legal-comments=${i}`),a!==void 0&&t.push(`--source-root=${a}`),l!==void 0&&t.push(`--sources-content=${l}`),c&&(Array.isArray(c)?t.push(`--target=${Array.from(c).map(Me).join(",")}`):t.push(`--target=${Me(c)}`)),o&&t.push(`--format=${o}`),g&&t.push(`--global-name=${g}`),$&&t.push(`--platform=${$}`),B&&t.push("--minify"),k&&t.push("--minify-syntax"),P&&t.push("--minify-whitespace"),I&&t.push("--minify-identifiers"),V&&t.push(`--charset=${V}`),R!==void 0&&t.push(`--tree-shaking=${R}`),d&&t.push("--ignore-annotations"),L)for(let O of L)t.push(`--drop:${O}`);if(y&&t.push(`--mangle-props=${y.source}`),v&&t.push(`--reserve-props=${v.source}`),A!==void 0&&t.push(`--mangle-quoted=${A}`),s&&t.push(`--jsx=${s}`),f&&t.push(`--jsx-factory=${f}`),h&&t.push(`--jsx-fragment=${h}`),E&&t.push(`--jsx-import-source=${E}`),C&&t.push("--jsx-dev"),u&&t.push("--jsx-side-effects"),p)for(let O in p){if(O.indexOf("=")>=0)throw new Error(`Invalid define: ${O}`);t.push(`--define:${O}=${p[O]}`)}if(w)for(let O in w){if(O.indexOf("=")>=0)throw new Error(`Invalid log override: ${O}`);t.push(`--log-override:${O}=${w[O]}`)}if(S)for(let O in S){if(O.indexOf("=")>=0)throw new Error(`Invalid supported: ${O}`);t.push(`--supported:${O}=${S[O]}`)}if(x)for(let O of x)t.push(`--pure:${O}`);D&&t.push("--keep-names")}function Xe(t,e,r,i,a){var J;let l=[],c=[],o=Object.create(null),g=null,y=null,v=null;pe(l,e,o,r,i),Te(l,e,o);let A=n(e,o,"sourcemap",De),B=n(e,o,"bundle",F),k=n(e,o,"watch",Ve),P=n(e,o,"splitting",F),I=n(e,o,"preserveSymlinks",F),L=n(e,o,"metafile",F),V=n(e,o,"outfile",b),R=n(e,o,"outdir",b),d=n(e,o,"outbase",b),s=n(e,o,"tsconfig",b),f=n(e,o,"resolveExtensions",q),h=n(e,o,"nodePaths",q),E=n(e,o,"mainFields",q),C=n(e,o,"conditions",q),u=n(e,o,"external",q),p=n(e,o,"alias",G),w=n(e,o,"loader",G),S=n(e,o,"outExtension",G),x=n(e,o,"publicPath",b),D=n(e,o,"entryNames",b),$=n(e,o,"chunkNames",b),O=n(e,o,"assetNames",b),U=n(e,o,"inject",q),W=n(e,o,"banner",G),K=n(e,o,"footer",G),N=n(e,o,"entryPoints",Ye),T=n(e,o,"absWorkingDir",b),M=n(e,o,"stdin",G),_=(J=n(e,o,"write",F))!=null?J:a,Y=n(e,o,"allowOverwrite",F),ee=n(e,o,"incremental",F)===!0,oe=n(e,o,"mangleCache",G);if(o.plugins=!0,z(e,o,`in ${t}() call`),A&&l.push(`--sourcemap${A===!0?"":`=${A}`}`),B&&l.push("--bundle"),Y&&l.push("--allow-overwrite"),k)if(l.push("--watch"),typeof k=="boolean")v={};else{let m=Object.create(null),j=n(k,m,"onRebuild",ve);z(k,m,`on "watch" in ${t}() call`),v={onRebuild:j}}if(P&&l.push("--splitting"),I&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),V&&l.push(`--outfile=${V}`),R&&l.push(`--outdir=${R}`),d&&l.push(`--outbase=${d}`),s&&l.push(`--tsconfig=${s}`),f){let m=[];for(let j of f){if(j+="",j.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${j}`);m.push(j)}l.push(`--resolve-extensions=${m.join(",")}`)}if(x&&l.push(`--public-path=${x}`),D&&l.push(`--entry-names=${D}`),$&&l.push(`--chunk-names=${$}`),O&&l.push(`--asset-names=${O}`),E){let m=[];for(let j of E){if(j+="",j.indexOf(",")>=0)throw new Error(`Invalid main field: ${j}`);m.push(j)}l.push(`--main-fields=${m.join(",")}`)}if(C){let m=[];for(let j of C){if(j+="",j.indexOf(",")>=0)throw new Error(`Invalid condition: ${j}`);m.push(j)}l.push(`--conditions=${m.join(",")}`)}if(u)for(let m of u)l.push(`--external:${m}`);if(p)for(let m in p){if(m.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${m}`);l.push(`--alias:${m}=${p[m]}`)}if(W)for(let m in W){if(m.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${m}`);l.push(`--banner:${m}=${W[m]}`)}if(K)for(let m in K){if(m.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${m}`);l.push(`--footer:${m}=${K[m]}`)}if(U)for(let m of U)l.push(`--inject:${m}`);if(w)for(let m in w){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);l.push(`--loader:${m}=${w[m]}`)}if(S)for(let m in S){if(m.indexOf("=")>=0)throw new Error(`Invalid out extension: ${m}`);l.push(`--out-extension:${m}=${S[m]}`)}if(N)if(Array.isArray(N))for(let m of N)c.push(["",m+""]);else for(let[m,j]of Object.entries(N))c.push([m+"",j+""]);if(M){let m=Object.create(null),j=n(M,m,"contents",Pe),Oe=n(M,m,"resolveDir",b),xe=n(M,m,"sourcefile",b),Se=n(M,m,"loader",b);z(M,m,'in "stdin" object'),xe&&l.push(`--sourcefile=${xe}`),Se&&l.push(`--loader=${Se}`),Oe&&(y=Oe+""),typeof j=="string"?g=H(j):j instanceof Uint8Array&&(g=j)}let Q=[];if(h)for(let m of h)m+="",Q.push(m);return{entries:c,flags:l,write:_,stdinContents:g,stdinResolveDir:y,absWorkingDir:T,incremental:ee,nodePaths:Q,watch:v,mangleCache:Be(oe)}}function Ze(t,e,r,i){let a=[],l=Object.create(null);pe(a,e,l,r,i),Te(a,e,l);let c=n(e,l,"sourcemap",De),o=n(e,l,"tsconfigRaw",Qe),g=n(e,l,"sourcefile",b),y=n(e,l,"loader",b),v=n(e,l,"banner",b),A=n(e,l,"footer",b),B=n(e,l,"mangleCache",G);return z(e,l,`in ${t}() call`),c&&a.push(`--sourcemap=${c===!0?"external":c}`),o&&a.push(`--tsconfig-raw=${typeof o=="string"?o:JSON.stringify(o)}`),g&&a.push(`--sourcefile=${g}`),y&&a.push(`--loader=${y}`),v&&a.push(`--banner=${v}`),A&&a.push(`--footer=${A}`),{flags:a,mangleCache:Be(B)}}function je(t){let e={},r={didClose:!1,reason:""},i={},a=0,l=0,c=new Uint8Array(16*1024),o=0,g=d=>{let s=o+d.length;if(s>c.length){let h=new Uint8Array(s*2);h.set(c),c=h}c.set(d,o),o+=d.length;let f=0;for(;f+4<=o;){let h=we(c,f);if(f+4+h>o)break;f+=4,P(c.subarray(f,f+h)),f+=h}f>0&&(c.copyWithin(0,f,o),o-=f)},y=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let s="The service was stopped"+r.reason;for(let f in i)i[f](s,null);i={}},v=(d,s,f)=>{if(r.didClose)return f("The service is no longer running"+r.reason,null);let h=a++;i[h]=(E,C)=>{try{f(E,C)}finally{d&&d.unref()}},d&&d.ref(),t.writeToStdin(be({id:h,isRequest:!0,value:s}))},A=(d,s)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);t.writeToStdin(be({id:d,isRequest:!1,value:s}))},B=(d,s)=>X(this,null,function*(){try{if(s.command==="ping"){A(d,{});return}if(typeof s.key=="number"){let f=e[s.key];if(f){let h=f[s.command];if(h){yield h(d,s);return}}}throw new Error("Invalid command: "+s.command)}catch(f){A(d,{errors:[ie(f,t,null,void 0,"")]})}}),k=!0,P=d=>{if(k){k=!1;let f=String.fromCharCode(...d);if(f!=="0.15.18")throw new Error(`Cannot start service: Host version "0.15.18" does not match binary version ${JSON.stringify(f)}`);return}let s=Ee(d);if(s.isRequest)B(s.id,s.value);else{let f=i[s.id];delete i[s.id],s.value.error?f(s.value.error,{}):f(null,s.value)}};return{readFromStdout:g,afterClose:y,service:{buildOrServe:({callName:d,refs:s,serveOptions:f,options:h,isTTY:E,defaultWD:C,callback:u})=>{let p=0,w=l++,S={},x={ref(){++p===1&&s&&s.ref()},unref(){--p===0&&(delete e[w],s&&s.unref())}};e[w]=S,x.ref(),et(d,w,v,A,x,t,S,h,f,E,C,r,(D,$)=>{try{u(D,$)}finally{x.unref()}})},transform:({callName:d,refs:s,input:f,options:h,isTTY:E,fs:C,callback:u})=>{let p=Fe(),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:x,mangleCache:D}=Ze(d,h,E,$e),$={command:"transform",flags:x,inputFS:S!==null,input:S!==null?H(S):typeof f=="string"?H(f):f};D&&($.mangleCache=D),v(s,$,(O,U)=>{if(O)return u(new Error(O),null);let W=Z(U.errors,p),K=Z(U.warnings,p),N=1,T=()=>{if(--N===0){let M={warnings:K,code:U.code,map:U.map};U.mangleCache&&(M.mangleCache=U==null?void 0:U.mangleCache),u(null,M)}};if(W.length>0)return u(ne("Transform failed",W,K),null);U.codeFS&&(N++,C.readFile(U.code,(M,_)=>{M!==null?u(M,null):(U.code=_,T())})),U.mapFS&&(N++,C.readFile(U.map,(M,_)=>{M!==null?u(M,null):(U.map=_,T())})),T()})}catch(x){let D=[];try{pe(D,h,{},E,$e)}catch(O){}let $=ie(x,t,p,void 0,"");v(s,{command:"error",flags:D,error:$},()=>{$.detail=p.load($.detail),u(ne("Transform failed",[$],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let S=w;w=()=>C.writeFile(f,S)}w(null)},formatMessages:({callName:d,refs:s,messages:f,options:h,callback:E})=>{let C=re(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",le);if(z(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 x={command:"format-msgs",messages:C,isWarning:p==="warning"};w!==void 0&&(x.color=w),S!==void 0&&(x.terminalWidth=S),v(s,x,(D,$)=>{if(D)return E(new Error(D),null);E(null,$.messages)})},analyzeMetafile:({callName:d,refs:s,metafile:f,options:h,callback:E})=>{h===void 0&&(h={});let C={},u=n(h,C,"color",F),p=n(h,C,"verbose",F);z(h,C,`in ${d}() call`);let w={command:"analyze-metafile",metafile:f};u!==void 0&&(w.color=u),p!==void 0&&(w.verbose=p),v(s,w,(S,x)=>{if(S)return E(new Error(S),null);E(null,x.result)})}}}}function et(t,e,r,i,a,l,c,o,g,y,v,A,B){let k=Fe(),P=(R,d,s,f)=>{let h=[];try{pe(h,o,{},y,ke)}catch(C){}let E=ie(R,l,k,s,d);r(a,{command:"error",flags:h,error:E},()=>{E.detail=k.load(E.detail),f(E)})},I=(R,d)=>{P(R,d,void 0,s=>{B(ne("Build failed",[s],[]),null)})},L;if(typeof o=="object"){let R=o.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');L=R}}if(L&&L.length>0){if(l.isSync){I(new Error("Cannot use plugins in synchronous API calls"),"");return}rt(e,r,i,a,l,c,o,L,k).then(R=>{if(!R.ok){I(R.error,R.pluginName);return}try{V(R.requestPlugins,R.runOnEndCallbacks)}catch(d){I(d,"")}},R=>I(R,""));return}try{V(null,(R,d,s)=>s())}catch(R){I(R,"")}function V(R,d){let s=!l.isWriteUnavailable,{entries:f,flags:h,write:E,stdinContents:C,stdinResolveDir:u,absWorkingDir:p,incremental:w,nodePaths:S,watch:x,mangleCache:D}=Xe(t,o,y,ke,s),$={command:"build",key:e,entries:f,flags:h,write:E,stdinContents:C,stdinResolveDir:u,absWorkingDir:p||v,incremental:w,nodePaths:S};R&&($.plugins=R),D&&($.mangleCache=D);let O=g&&tt(e,r,i,a,c,g,$),U,W,K=(T,M)=>{T.outputFiles&&(M.outputFiles=T.outputFiles.map(nt)),T.metafile&&(M.metafile=JSON.parse(T.metafile)),T.mangleCache&&(M.mangleCache=T.mangleCache),T.writeToStdout!==void 0&&console.log(te(T.writeToStdout).replace(/\n$/,""))},N=(T,M)=>{let _={errors:Z(T.errors,k),warnings:Z(T.warnings,k)};K(T,_),d(_,P,()=>{if(_.errors.length>0)return M(ne("Build failed",_.errors,_.warnings),null);if(T.rebuild){if(!U){let Y=!1;U=()=>new Promise((ee,oe)=>{if(Y||A.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:e},(Q,J)=>{if(Q)return M(ne("Build failed",[{id:"",pluginName:"",text:Q,location:null,notes:[],detail:void 0}],[]),null);N(J,(m,j)=>{m?oe(m):ee(j)})})}),a.ref(),U.dispose=()=>{Y||(Y=!0,r(a,{command:"rebuild-dispose",key:e},()=>{}),a.unref())}}_.rebuild=U}if(T.watch){if(!W){let Y=!1;a.ref(),W=()=>{Y||(Y=!0,delete c["watch-rebuild"],r(a,{command:"watch-stop",key:e},()=>{}),a.unref())},x&&(c["watch-rebuild"]=(ee,oe)=>{try{let Q=oe.args,J={errors:Z(Q.errors,k),warnings:Z(Q.warnings,k)};K(Q,J),d(J,P,()=>{if(J.errors.length>0){x.onRebuild&&x.onRebuild(ne("Build failed",J.errors,J.warnings),null);return}J.stop=W,x.onRebuild&&x.onRebuild(null,J)})}catch(Q){console.error(Q)}i(ee,{})})}_.stop=W}M(null,_)})};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(x&&l.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,$,(T,M)=>{if(T)return B(new Error(T),null);if(O){let _=M,Y=!1;a.ref();let ee={port:_.port,host:_.host,wait:O.wait,stop(){Y||(Y=!0,O.stop(),a.unref())}};return a.ref(),O.wait.then(a.unref,a.unref),B(null,ee)}return N(M,B)})}}var tt=(t,e,r,i,a,l,c)=>{let o={},g=n(l,o,"port",le),y=n(l,o,"host",b),v=n(l,o,"servedir",b),A=n(l,o,"onRequest",ve),B=new Promise((k,P)=>{a["serve-wait"]=(I,L)=>{L.error!==null?P(new Error(L.error)):k(),r(I,{})}});return c.serve={},z(l,o,"in serve() call"),g!==void 0&&(c.serve.port=g),y!==void 0&&(c.serve.host=y),v!==void 0&&(c.serve.servedir=v),a["serve-request"]=(k,P)=>{A&&A(P.args),r(k,{})},{wait:B,stop(){e(i,{command:"serve-stop",key:t},()=>{})}}},rt=(t,e,r,i,a,l,c,o,g)=>X(void 0,null,function*(){let y=[],v=[],A={},B={},k=0,P=0,I=[],L=!1;o=[...o];for(let R of o){let d={};if(typeof R!="object")throw new Error(`Plugin at index ${P} must be an object`);let s=n(R,d,"name",b);if(typeof s!="string"||s==="")throw new Error(`Plugin at index ${P} is missing a name`);try{let f=n(R,d,"setup",ve);if(typeof f!="function")throw new Error("Plugin is missing a setup function");z(R,d,`on plugin ${JSON.stringify(s)}`);let h={name:s,onResolve:[],onLoad:[]};P++;let C=f({initialOptions:c,resolve:(u,p={})=>{if(!L)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),x=n(p,w,"importer",b),D=n(p,w,"namespace",b),$=n(p,w,"resolveDir",b),O=n(p,w,"kind",b),U=n(p,w,"pluginData",ce);return z(p,w,"in resolve() call"),new Promise((W,K)=>{let N={command:"resolve",path:u,key:t,pluginName:s};S!=null&&(N.pluginName=S),x!=null&&(N.importer=x),D!=null&&(N.namespace=D),$!=null&&(N.resolveDir=$),O!=null&&(N.kind=O),U!=null&&(N.pluginData=g.store(U)),e(i,N,(T,M)=>{T!==null?K(new Error(T)):W({errors:Z(M.errors,g),warnings:Z(M.warnings,g),path:M.path,external:M.external,sideEffects:M.sideEffects,namespace:M.namespace,suffix:M.suffix,pluginData:g.load(M.pluginData)})})})},onStart(u){let p='This error came from the "onStart" callback registered here:',w=ue(new Error(p),a,"onStart");y.push({name:s,callback:u,note:w})},onEnd(u){let p='This error came from the "onEnd" callback registered here:',w=ue(new Error(p),a,"onEnd");v.push({name:s,callback:u,note:w})},onResolve(u,p){let w='This error came from the "onResolve" callback registered here:',S=ue(new Error(w),a,"onResolve"),x={},D=n(u,x,"filter",de),$=n(u,x,"namespace",b);if(z(u,x,`in onResolve() call for plugin ${JSON.stringify(s)}`),D==null)throw new Error("onResolve() call is missing a filter");let O=k++;A[O]={name:s,callback:p,note:S},h.onResolve.push({id:O,filter:D.source,namespace:$||""})},onLoad(u,p){let w='This error came from the "onLoad" callback registered here:',S=ue(new Error(w),a,"onLoad"),x={},D=n(u,x,"filter",de),$=n(u,x,"namespace",b);if(z(u,x,`in onLoad() call for plugin ${JSON.stringify(s)}`),D==null)throw new Error("onLoad() call is missing a filter");let O=k++;B[O]={name:s,callback:p,note:S},h.onLoad.push({id:O,filter:D.source,namespace:$||""})},esbuild:a.esbuild});C&&(yield C),I.push(h)}catch(f){return{ok:!1,error:f,pluginName:s}}}l["on-start"]=(R,d)=>X(void 0,null,function*(){let s={errors:[],warnings:[]};yield Promise.all(y.map(C=>X(void 0,[C],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 ${JSON.stringify(f)} to return an object`);let p={},w=n(u,p,"errors",q),S=n(u,p,"warnings",q);z(u,p,`from onStart() callback in plugin ${JSON.stringify(f)}`),w!=null&&s.errors.push(...re(w,"errors",g,f)),S!=null&&s.warnings.push(...re(S,"warnings",g,f))}}catch(u){s.errors.push(ie(u,a,g,E&&E(),f))}}))),r(R,s)}),l["on-resolve"]=(R,d)=>X(void 0,null,function*(){let s={},f="",h,E;for(let C of d.ids)try{({name:f,callback:h,note:E}=A[C]);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 ${JSON.stringify(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"path",b),x=n(u,p,"namespace",b),D=n(u,p,"suffix",b),$=n(u,p,"external",F),O=n(u,p,"sideEffects",F),U=n(u,p,"pluginData",ce),W=n(u,p,"errors",q),K=n(u,p,"warnings",q),N=n(u,p,"watchFiles",q),T=n(u,p,"watchDirs",q);z(u,p,`from onResolve() callback in plugin ${JSON.stringify(f)}`),s.id=C,w!=null&&(s.pluginName=w),S!=null&&(s.path=S),x!=null&&(s.namespace=x),D!=null&&(s.suffix=D),$!=null&&(s.external=$),O!=null&&(s.sideEffects=O),U!=null&&(s.pluginData=g.store(U)),W!=null&&(s.errors=re(W,"errors",g,f)),K!=null&&(s.warnings=re(K,"warnings",g,f)),N!=null&&(s.watchFiles=fe(N,"watchFiles")),T!=null&&(s.watchDirs=fe(T,"watchDirs"));break}}catch(u){s={id:C,errors:[ie(u,a,g,E&&E(),f)]};break}r(R,s)}),l["on-load"]=(R,d)=>X(void 0,null,function*(){let s={},f="",h,E;for(let C of d.ids)try{({name:f,callback:h,note:E}=B[C]);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 ${JSON.stringify(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"contents",Pe),x=n(u,p,"resolveDir",b),D=n(u,p,"pluginData",ce),$=n(u,p,"loader",b),O=n(u,p,"errors",q),U=n(u,p,"warnings",q),W=n(u,p,"watchFiles",q),K=n(u,p,"watchDirs",q);z(u,p,`from onLoad() callback in plugin ${JSON.stringify(f)}`),s.id=C,w!=null&&(s.pluginName=w),S instanceof Uint8Array?s.contents=S:S!=null&&(s.contents=H(S)),x!=null&&(s.resolveDir=x),D!=null&&(s.pluginData=g.store(D)),$!=null&&(s.loader=$),O!=null&&(s.errors=re(O,"errors",g,f)),U!=null&&(s.warnings=re(U,"warnings",g,f)),W!=null&&(s.watchFiles=fe(W,"watchFiles")),K!=null&&(s.watchDirs=fe(K,"watchDirs"));break}}catch(u){s={id:C,errors:[ie(u,a,g,E&&E(),f)]};break}r(R,s)});let V=(R,d,s)=>s();return v.length>0&&(V=(R,d,s)=>{(()=>X(void 0,null,function*(){for(let{name:f,callback:h,note:E}of v)try{yield h(R)}catch(C){R.errors.push(yield new Promise(u=>d(C,f,E&&E(),u)))}}))().then(s)}),L=!0,{ok:!0,requestPlugins:I,runOnEndCallbacks:V}});function Fe(){let t=new Map,e=0;return{load(r){return t.get(r)},store(r){if(r===void 0)return-1;let i=e++;return t.set(i,r),i}}}function ue(t,e,r){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(t.stack+"").split(`
3
+ `);l.splice(1,1);let c=Ne(e,l,r);if(c)return i={text:t.message,location:c},i}catch(l){}}}function ie(t,e,r,i,a){let l="Internal error",c=null;try{l=(t&&t.message||t)+""}catch(o){}try{c=Ne(e,(t.stack+"").split(`
4
+ `),"")}catch(o){}return{id:"",pluginName:a,text:l,location:c,notes:i?[i]:[],detail:r?r.store(t):-1}}function Ne(t,e,r){let i=" at ";if(t.readFileSync&&!e[0].startsWith(i)&&e[1].startsWith(i))for(let a=1;a<e.length;a++){let l=e[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 o;try{o=t.readFileSync(c[1],"utf8")}catch(A){break}let g=o.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",y=+c[3]-1,v=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+v)).length,lineText:g+`
5
5
  `+e.slice(1).join(`
6
- `),suggestion:""}}break}}return null}function ne(t,e,r){let s=5,a=e.length<1?"":` with ${e.length} error${e.length<2?"":"s"}:`+e.slice(0,s+1).map((u,l)=>{if(l===s)return`
7
- ...`;if(!u.location)return`
8
- error: ${u.text}`;let{file:d,line:R,column:E}=u.location,k=u.pluginName?`[plugin: ${u.pluginName}] `:"";return`
9
- ${d}:${R}:${E}: ERROR: ${k}${u.text}`}).join(""),i=new Error(`${t}${a}`);return i.errors=e,i.warnings=r,i}function X(t,e){for(let r of t)r.detail=e.load(r.detail);return t}function Ae(t,e){if(t==null)return null;let r={},s=n(t,r,"file",h),a=n(t,r,"namespace",h),i=n(t,r,"line",le),u=n(t,r,"column",le),l=n(t,r,"length",le),d=n(t,r,"lineText",h),R=n(t,r,"suggestion",h);return K(t,r,e),{file:s||"",namespace:a||"",line:i||0,column:u||0,length:l||0,lineText:d||"",suggestion:R||""}}function te(t,e,r,s){let a=[],i=0;for(let u of t){let l={},d=n(u,l,"id",h),R=n(u,l,"pluginName",h),E=n(u,l,"text",h),k=n(u,l,"location",Me),B=n(u,l,"notes",q),F=n(u,l,"detail",ce),N=`in element ${i} of "${e}"`;K(u,l,N);let I=[];if(B)for(let j of B){let V={},w=n(j,V,"text",h),p=n(j,V,"location",Me);K(j,V,N),I.push({text:w||"",location:Ae(p,N)})}a.push({id:d||"",pluginName:R||s,text:E||"",location:Ae(k,N),notes:I,detail:r?r.store(F):-1}),i++}return a}function fe(t,e){let r=[];for(let s of t){if(typeof s!="string")throw new Error(`${JSON.stringify(e)} must be an array of strings`);r.push(s)}return r}function tt({path:t,contents:e}){let r=null;return{path:t,contents:e,get text(){let s=this.contents;return(r===null||s!==e)&&(e=s,r=ee(s)),r}}}var nt="0.15.15",lt=t=>ge().build(t),it=()=>{throw new Error('The "serve" API only works in node')},ot=(t,e)=>ge().transform(t,e),st=(t,e)=>ge().formatMessages(t,e),at=(t,e)=>ge().analyzeMetafile(t,e),ut=()=>{throw new Error('The "buildSync" API only works in node')},ft=()=>{throw new Error('The "transformSync" API only works in node')},ct=()=>{throw new Error('The "formatMessagesSync" API only works in node')},dt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},oe,Re,ge=()=>{if(Re)return Re;throw oe?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')},pt=t=>{t=Be(t||{});let e=t.wasmURL,r=t.wasmModule,s=t.worker!==!1;if(!e&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(oe)throw new Error('Cannot call "initialize" more than once');return oe=gt(e||"",r,s),oe.catch(()=>{oe=void 0}),oe},gt=(t,e,r)=>H(void 0,null,function*(){let s;if(e)s=e;else{let l=yield fetch(t);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(t)}`);s=yield l.arrayBuffer()}let a;if(r){let l=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,g,f)=>new Promise((h,n)=>{var s=c=>{try{l(f.next(c))}catch(u){n(u)}},i=c=>{try{l(f.throw(c))}catch(u){n(u)}},l=c=>c.done?h(c.value):Promise.resolve(c.value).then(s,i);l((f=f.apply(r,g)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let g of Object.getOwnPropertyNames(r))g in globalThis||Object.defineProperty(globalThis,g,{get:()=>self[g]});return(()=>{const r=()=>{const h=new Error("not implemented");return h.code="ENOSYS",h};if(!globalThis.fs){let h="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){h+=f.decode(s);const i=h.lastIndexOf(`\n`);return i!=-1&&(console.log(h.substr(0,i)),h=h.substr(i+1)),s.length},write(n,s,i,l,c,u){if(i!==0||l!==s.length||c!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},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,c,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 g=new TextEncoder("utf-8"),f=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 h=(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 m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!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)},c=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=s(t+m*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=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,h(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();h(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=c(e+32),m=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,i(e+56,m),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=c(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=c(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,h(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=g.encode(String(s(e+8)));i(e+16,t),h(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),h(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),h(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(h){return y(this,null,function*(){if(!(h instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=h,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=g.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 d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(h){const n=this;return function(){const s={id:h,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let g=new TextDecoder,f=globalThis.fs,h="";f.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){h+=g.decode(u);let d=h.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.15.15"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,l.importObject).then(c=>l.run(c)):WebAssembly.instantiate(r,l.importObject).then(({instance:c})=>l.run(c))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});a=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
6
+ `),suggestion:""}}break}}return null}function ne(t,e,r){let i=5,a=e.length<1?"":` with ${e.length} error${e.length<2?"":"s"}:`+e.slice(0,i+1).map((c,o)=>{if(o===i)return`
7
+ ...`;if(!c.location)return`
8
+ error: ${c.text}`;let{file:g,line:y,column:v}=c.location,A=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
9
+ ${g}:${y}:${v}: ERROR: ${A}${c.text}`}).join(""),l=new Error(`${t}${a}`);return l.errors=e,l.warnings=r,l}function Z(t,e){for(let r of t)r.detail=e.load(r.detail);return t}function Ce(t,e){if(t==null)return null;let r={},i=n(t,r,"file",b),a=n(t,r,"namespace",b),l=n(t,r,"line",le),c=n(t,r,"column",le),o=n(t,r,"length",le),g=n(t,r,"lineText",b),y=n(t,r,"suggestion",b);return z(t,r,e),{file:i||"",namespace:a||"",line:l||0,column:c||0,length:o||0,lineText:g||"",suggestion:y||""}}function re(t,e,r,i){let a=[],l=0;for(let c of t){let o={},g=n(c,o,"id",b),y=n(c,o,"pluginName",b),v=n(c,o,"text",b),A=n(c,o,"location",Ae),B=n(c,o,"notes",q),k=n(c,o,"detail",ce),P=`in element ${l} of "${e}"`;z(c,o,P);let I=[];if(B)for(let L of B){let V={},R=n(L,V,"text",b),d=n(L,V,"location",Ae);z(L,V,P),I.push({text:R||"",location:Ce(d,P)})}a.push({id:g||"",pluginName:y||i,text:v||"",location:Ce(A,P),notes:I,detail:r?r.store(k):-1}),l++}return a}function fe(t,e){let r=[];for(let i of t){if(typeof i!="string")throw new Error(`${JSON.stringify(e)} must be an array of strings`);r.push(i)}return r}function nt({path:t,contents:e}){let r=null;return{path:t,contents:e,get text(){let i=this.contents;return(r===null||i!==e)&&(e=i,r=te(i)),r}}}var it="0.15.18",st=t=>ge().build(t),ot=()=>{throw new Error('The "serve" API only works in node')},at=(t,e)=>ge().transform(t,e),ut=(t,e)=>ge().formatMessages(t,e),ft=(t,e)=>ge().analyzeMetafile(t,e),ct=()=>{throw new Error('The "buildSync" API only works in node')},dt=()=>{throw new Error('The "transformSync" API only works in node')},pt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},gt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},se,Re,ge=()=>{if(Re)return Re;throw se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},mt=t=>{t=Ue(t||{});let e=t.wasmURL,r=t.wasmModule,i=t.worker!==!1;if(!e&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(se)throw new Error('Cannot call "initialize" more than once');return se=yt(e||"",r,i),se.catch(()=>{se=void 0}),se},yt=(t,e,r)=>X(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.15.18"],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=>{
10
10
  // Copyright 2018 The Go Authors. All rights reserved.
11
11
  // Use of this source code is governed by a BSD-style
12
12
  // license that can be found in the LICENSE file.
13
- var y=(r,g,f)=>new Promise((h,n)=>{var s=c=>{try{l(f.next(c))}catch(u){n(u)}},i=c=>{try{l(f.throw(c))}catch(u){n(u)}},l=c=>c.done?h(c.value):Promise.resolve(c.value).then(s,i);l((f=f.apply(r,g)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let g of Object.getOwnPropertyNames(r))g in globalThis||Object.defineProperty(globalThis,g,{get:()=>self[g]});return(()=>{const r=()=>{const h=new Error("not implemented");return h.code="ENOSYS",h};if(!globalThis.fs){let h="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){h+=f.decode(s);const i=h.lastIndexOf(`
14
- `);return i!=-1&&(console.log(h.substr(0,i)),h=h.substr(i+1)),s.length},write(n,s,i,l,c,u){if(i!==0||l!==s.length||c!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},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,c,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 g=new TextEncoder("utf-8"),f=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 h=(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 m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!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)},c=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=s(t+m*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=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,h(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();h(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=c(e+32),m=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,i(e+56,m),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=c(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=c(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,h(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=g.encode(String(s(e+8)));i(e+16,t),h(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),h(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),h(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(h){return y(this,null,function*(){if(!(h instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=h,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=g.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 d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(h){const n=this;return function(){const s={id:h,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let g=new TextDecoder,f=globalThis.fs,h="";f.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){h+=g.decode(u);let d=h.split(`
15
- `);d.length>1&&console.log(d.slice(0,-1).join(`
16
- `)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.15.15"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,l.importObject).then(c=>l.run(c)):WebAssembly.instantiate(r,l.importObject).then(({instance:c})=>l.run(c))},r=>onmessage(r);})(d=>a.onmessage({data:d}));a={onmessage:null,postMessage:d=>setTimeout(()=>l({data:d})),terminate(){}}}a.postMessage(s),a.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:u}=Fe({writeToStdin(l){a.postMessage(l)},isSync:!1,isWriteUnavailable:!0,esbuild:me});Re={build:l=>new Promise((d,R)=>u.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(E,k)=>E?R(E):d(k)})),transform:(l,d)=>new Promise((R,E)=>u.transform({callName:"transform",refs:null,input:l,options:d||{},isTTY:!1,fs:{readFile(k,B){B(new Error("Internal error"),null)},writeFile(k,B){B(null)}},callback:(k,B)=>k?E(k):R(B)})),formatMessages:(l,d)=>new Promise((R,E)=>u.formatMessages({callName:"formatMessages",refs:null,messages:l,options:d,callback:(k,B)=>k?E(k):R(B)})),analyzeMetafile:(l,d)=>new Promise((R,E)=>u.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:d,callback:(k,B)=>k?E(k):R(B)}))}}),mt=me;
13
+ 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(`
14
+ `);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(`
15
+ `);g.length>1&&console.log(g.slice(0,-1).join(`
16
+ `)),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.15.18"],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(()=>y({data:v})),terminate(){}}}let a,l,c=new Promise((y,v)=>{a=y,l=v});i.onmessage=({data:y})=>{i.onmessage=({data:v})=>o(v),y?l(y):a()},i.postMessage(e||new URL(t,location.href).toString());let{readFromStdout:o,service:g}=je({writeToStdin(y){i.postMessage(y)},isSync:!1,isWriteUnavailable:!0,esbuild:me});yield c,Re={build:y=>new Promise((v,A)=>g.buildOrServe({callName:"build",refs:null,serveOptions:null,options:y,isTTY:!1,defaultWD:"/",callback:(B,k)=>B?A(B):v(k)})),transform:(y,v)=>new Promise((A,B)=>g.transform({callName:"transform",refs:null,input:y,options:v||{},isTTY:!1,fs:{readFile(k,P){P(new Error("Internal error"),null)},writeFile(k,P){P(null)}},callback:(k,P)=>k?B(k):A(P)})),formatMessages:(y,v)=>new Promise((A,B)=>g.formatMessages({callName:"formatMessages",refs:null,messages:y,options:v,callback:(k,P)=>k?B(k):A(P)})),analyzeMetafile:(y,v)=>new Promise((A,B)=>g.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof y=="string"?y:JSON.stringify(y),options:v,callback:(k,P)=>k?B(k):A(P)}))}}),ht=me;
17
17
  })(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
@@ -98,6 +98,8 @@ export interface BuildOptions extends CommonOptions {
98
98
  outbase?: string;
99
99
  /** Documentation: https://esbuild.github.io/api/#external */
100
100
  external?: string[];
101
+ /** Documentation: https://esbuild.github.io/api/#alias */
102
+ alias?: Record<string, string>;
101
103
  /** Documentation: https://esbuild.github.io/api/#loader */
102
104
  loader?: { [ext: string]: Loader };
103
105
  /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
@@ -586,7 +588,7 @@ export interface InitializeOptions {
586
588
  * The URL of the "esbuild.wasm" file. This must be provided when running
587
589
  * esbuild in the browser.
588
590
  */
589
- wasmURL?: string
591
+ wasmURL?: string | URL
590
592
 
591
593
  /**
592
594
  * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
@@ -224,6 +224,7 @@ var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value
224
224
  var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object";
225
225
  var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array";
226
226
  var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array";
227
+ var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL";
227
228
  function getFlag(object, keys, key, mustBeFn) {
228
229
  let value = object[key];
229
230
  keys[key + ""] = true;
@@ -243,7 +244,7 @@ function checkForInvalidFlags(object, keys, where) {
243
244
  }
244
245
  function validateInitializeOptions(options) {
245
246
  let keys = /* @__PURE__ */ Object.create(null);
246
- let wasmURL = getFlag(options, keys, "wasmURL", mustBeString);
247
+ let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL);
247
248
  let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule);
248
249
  let worker = getFlag(options, keys, "worker", mustBeBoolean);
249
250
  checkForInvalidFlags(options, keys, "in initialize() call");
@@ -414,6 +415,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
414
415
  let mainFields = getFlag(options, keys, "mainFields", mustBeArray);
415
416
  let conditions = getFlag(options, keys, "conditions", mustBeArray);
416
417
  let external = getFlag(options, keys, "external", mustBeArray);
418
+ let alias = getFlag(options, keys, "alias", mustBeObject);
417
419
  let loader = getFlag(options, keys, "loader", mustBeObject);
418
420
  let outExtension = getFlag(options, keys, "outExtension", mustBeObject);
419
421
  let publicPath = getFlag(options, keys, "publicPath", mustBeString);
@@ -504,6 +506,13 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
504
506
  if (external)
505
507
  for (let name of external)
506
508
  flags.push(`--external:${name}`);
509
+ if (alias) {
510
+ for (let old in alias) {
511
+ if (old.indexOf("=") >= 0)
512
+ throw new Error(`Invalid package name in alias: ${old}`);
513
+ flags.push(`--alias:${old}=${alias[old]}`);
514
+ }
515
+ }
507
516
  if (banner) {
508
517
  for (let type in banner) {
509
518
  if (type.indexOf("=") >= 0)
@@ -703,8 +712,8 @@ function createChannel(streamIn) {
703
712
  if (isFirstPacket) {
704
713
  isFirstPacket = false;
705
714
  let binaryVersion = String.fromCharCode(...bytes);
706
- if (binaryVersion !== "0.15.15") {
707
- throw new Error(`Cannot start service: Host version "${"0.15.15"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
715
+ if (binaryVersion !== "0.15.18") {
716
+ throw new Error(`Cannot start service: Host version "${"0.15.18"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
708
717
  }
709
718
  return;
710
719
  }
@@ -1678,7 +1687,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1678
1687
  }
1679
1688
  }
1680
1689
  var _a;
1681
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.15.15";
1690
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.15.18";
1682
1691
  var esbuildCommandAndArgs = () => {
1683
1692
  if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1684
1693
  throw new Error(
@@ -1745,7 +1754,7 @@ var fsAsync = {
1745
1754
  }
1746
1755
  }
1747
1756
  };
1748
- var version = "0.15.15";
1757
+ var version = "0.15.18";
1749
1758
  var build = (options) => ensureServiceIsRunning().build(options);
1750
1759
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1751
1760
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -1856,7 +1865,7 @@ var ensureServiceIsRunning = () => {
1856
1865
  if (longLivedService)
1857
1866
  return longLivedService;
1858
1867
  let [command, args] = esbuildCommandAndArgs();
1859
- let child = child_process.spawn(command, args.concat(`--service=${"0.15.15"}`, "--ping"), {
1868
+ let child = child_process.spawn(command, args.concat(`--service=${"0.15.18"}`, "--ping"), {
1860
1869
  windowsHide: true,
1861
1870
  stdio: ["pipe", "pipe", "inherit"],
1862
1871
  cwd: defaultWD
@@ -1970,7 +1979,7 @@ var runServiceSync = (callback) => {
1970
1979
  esbuild: node_exports
1971
1980
  });
1972
1981
  callback(service);
1973
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.15.15"}`), {
1982
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.15.18"}`), {
1974
1983
  cwd: defaultWD,
1975
1984
  windowsHide: true,
1976
1985
  input: stdin,
@@ -1986,7 +1995,7 @@ var workerThreadService = null;
1986
1995
  var startWorkerThreadService = (worker_threads2) => {
1987
1996
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
1988
1997
  let worker = new worker_threads2.Worker(__filename, {
1989
- workerData: { workerPort, defaultWD, esbuildVersion: "0.15.15" },
1998
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.15.18" },
1990
1999
  transferList: [workerPort],
1991
2000
  execArgv: []
1992
2001
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild-wasm",
3
- "version": "0.15.15",
3
+ "version": "0.15.18",
4
4
  "description": "The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "license": "MIT",
data/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/isomorfeus/isomorfeus-asset-manager",
6
6
  "dependencies": {
7
- "esbuild-wasm": "0.15.15"
7
+ "esbuild-wasm": "0.15.18"
8
8
  }
9
9
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-asset-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.10
4
+ version: 0.15.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-24 00:00:00.000000000 Z
11
+ date: 2022-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli