@beff/aula-cli 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +1 -1
  2. package/dist/src/{chunk-SW5BNPAM.js → chunk-4C4BQTKI.js} +20 -24
  3. package/dist/src/{chunk-PSI7MMGP.js → chunk-A5KM5EYE.js} +43 -4
  4. package/dist/src/{chunk-D2BDOCX7.js → chunk-WE2U2UBP.js} +24 -7
  5. package/dist/src/{chunk-BMP6H3SZ.js → chunk-ZOSYUMKY.js} +6 -9
  6. package/dist/src/cli.js +8 -8
  7. package/dist/src/{commands-CEBO6WWE.js → commands-4LDW6L23.js} +4 -4
  8. package/dist/src/{problems-FFAR72WZ.js → problems-WGY5NWFQ.js} +3 -3
  9. package/dist/src/{run-DU2H6FZI.js → run-KXGYQUDF.js} +14 -9
  10. package/dist/src/{server-7AN6XCTF.js → server-PU2ZLWVN.js} +4 -3
  11. package/dist/web/app/assets/65d089fc/aula-method.js +1 -0
  12. package/dist/web/app/assets/65d089fc/aula.js +1 -0
  13. package/dist/web/app/assets/{build-worker.js → 65d089fc/build-worker.js} +8 -8
  14. package/dist/web/app/assets/65d089fc/index.js +52 -0
  15. package/dist/web/app/assets/__vite-browser-external-BcnWWh3P.js +1 -0
  16. package/dist/web/app/assets/{aula-voice-worker-DNzLI-en.js → aula-voice-worker-auUeqfk1.js} +10 -10
  17. package/dist/web/app/assets/{aula.core5-BmrvjVro.wasm → aula.core5-CdA2Cc_n.wasm} +0 -0
  18. package/dist/web/app/assets/{index-cL-Dm_aw.css → index-C_rGCAZR.css} +1 -1
  19. package/dist/web/app/assets/protocol-BucA_SVY.js +15 -0
  20. package/dist/web/app/assets/{src-B22P60S6.js → src-BV6xlpP7.js} +6 -6
  21. package/dist/web/app/index.html +4 -4
  22. package/package.json +2 -2
  23. package/dist/web/app/assets/__vite-browser-external-B6HdzU1j.js +0 -1
  24. package/dist/web/app/assets/aula-method.js +0 -1
  25. package/dist/web/app/assets/aula.js +0 -1
  26. package/dist/web/app/assets/index-D6yaOVRx.js +0 -53
  27. package/dist/web/app/assets/protocol-CDkth-6D.js +0 -15
@@ -1,17 +1,17 @@
1
- import{r as e,t}from"./rolldown-runtime-BLXQ4ufn.js";import{a as n,d as r,f as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,u as f}from"./protocol-CDkth-6D.js";import{v as p}from"./src-B22P60S6.js";var m=e(t(((e,t)=>{(e=>{var t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},o=(e,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of r(a))!i.call(e,c)&&c!==o&&t(e,c,{get:()=>a[c],enumerable:!(s=n(a,c))||s.enumerable});return e},s=e=>o(t({},`__esModule`,{value:!0}),e),c=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),l={};a(l,{analyzeMetafile:()=>be,analyzeMetafileSync:()=>we,build:()=>ge,buildSync:()=>xe,context:()=>_e,default:()=>je,formatMessages:()=>ye,formatMessagesSync:()=>Ce,initialize:()=>ke,stop:()=>Te,transform:()=>ve,transformSync:()=>Se,version:()=>he}),e.exports=s(l);function u(e){let t=e=>{if(e===null)n.write8(0);else if(typeof e==`boolean`)n.write8(1),n.write8(+e);else if(typeof e==`number`)n.write8(2),n.write32(e|0);else if(typeof e==`string`)n.write8(3),n.write(p(e));else if(e instanceof Uint8Array)n.write8(4),n.write(e);else if(e instanceof Array){n.write8(5),n.write32(e.length);for(let n of e)t(n)}else{let r=Object.keys(e);n.write8(6),n.write32(r.length);for(let i of r)n.write(p(i)),t(e[i])}},n=new f;return n.write32(0),n.write32(e.id<<1|!e.isRequest),t(e.value),_(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function d(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return m(n.read());case 4:return n.read();case 5:{let e=n.read32(),r=[];for(let n=0;n<e;n++)r.push(t());return r}case 6:{let e=n.read32(),r={};for(let i=0;i<e;i++)r[m(n.read())]=t();return r}default:throw Error(`Invalid packet`)}},n=new f(e),r=n.read32(),i=!(r&1);r>>>=1;let a=t();if(n.ptr!==e.length)throw Error(`Invalid packet`);return{id:r,isRequest:i,value:a}}var f=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 t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);_(this.buf,e,t)}write(e){let t=this._write(4+e.length);_(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw Error(`Invalid packet`);return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return g(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),n=this._read(t.length);return t.set(this.buf.subarray(n,n+e)),t}},p,m,h;if(typeof TextEncoder<`u`&&typeof TextDecoder<`u`){let e=new TextEncoder,t=new TextDecoder;p=t=>e.encode(t),m=e=>t.decode(e),h=`new TextEncoder().encode("")`}else if(typeof Buffer<`u`)p=e=>Buffer.from(e),m=e=>{let{buffer:t,byteOffset:n,byteLength:r}=e;return Buffer.from(t,n,r).toString()},h=`Buffer.from("")`;else throw Error(`No UTF-8 codec found`);if(!(p(``)instanceof Uint8Array))throw Error(`Invariant violation: "${h} instanceof Uint8Array" is incorrectly false
1
+ import{r as e,t}from"../rolldown-runtime-BLXQ4ufn.js";import{a as n,d as r,f as i,i as a,l as o,m as s,n as c,o as l,p as u,u as d}from"../protocol-BucA_SVY.js";var f=e(t(((e,t)=>{(e=>{var t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},o=(e,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of r(a))!i.call(e,c)&&c!==o&&t(e,c,{get:()=>a[c],enumerable:!(s=n(a,c))||s.enumerable});return e},s=e=>o(t({},`__esModule`,{value:!0}),e),c=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),l={};a(l,{analyzeMetafile:()=>be,analyzeMetafileSync:()=>we,build:()=>ge,buildSync:()=>xe,context:()=>_e,default:()=>je,formatMessages:()=>ye,formatMessagesSync:()=>Ce,initialize:()=>ke,stop:()=>Te,transform:()=>ve,transformSync:()=>Se,version:()=>he}),e.exports=s(l);function u(e){let t=e=>{if(e===null)n.write8(0);else if(typeof e==`boolean`)n.write8(1),n.write8(+e);else if(typeof e==`number`)n.write8(2),n.write32(e|0);else if(typeof e==`string`)n.write8(3),n.write(p(e));else if(e instanceof Uint8Array)n.write8(4),n.write(e);else if(e instanceof Array){n.write8(5),n.write32(e.length);for(let n of e)t(n)}else{let r=Object.keys(e);n.write8(6),n.write32(r.length);for(let i of r)n.write(p(i)),t(e[i])}},n=new f;return n.write32(0),n.write32(e.id<<1|!e.isRequest),t(e.value),_(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function d(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return m(n.read());case 4:return n.read();case 5:{let e=n.read32(),r=[];for(let n=0;n<e;n++)r.push(t());return r}case 6:{let e=n.read32(),r={};for(let i=0;i<e;i++)r[m(n.read())]=t();return r}default:throw Error(`Invalid packet`)}},n=new f(e),r=n.read32(),i=!(r&1);r>>>=1;let a=t();if(n.ptr!==e.length)throw Error(`Invalid packet`);return{id:r,isRequest:i,value:a}}var f=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 t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);_(this.buf,e,t)}write(e){let t=this._write(4+e.length);_(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw Error(`Invalid packet`);return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return g(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),n=this._read(t.length);return t.set(this.buf.subarray(n,n+e)),t}},p,m,h;if(typeof TextEncoder<`u`&&typeof TextDecoder<`u`){let e=new TextEncoder,t=new TextDecoder;p=t=>e.encode(t),m=e=>t.decode(e),h=`new TextEncoder().encode("")`}else if(typeof Buffer<`u`)p=e=>Buffer.from(e),m=e=>{let{buffer:t,byteOffset:n,byteLength:r}=e;return Buffer.from(t,n,r).toString()},h=`Buffer.from("")`;else throw Error(`No UTF-8 codec found`);if(!(p(``)instanceof Uint8Array))throw Error(`Invariant violation: "${h} instanceof Uint8Array" is incorrectly false
2
2
 
3
3
  This indicates that your JavaScript environment is broken. You cannot use
4
4
  esbuild in this environment because esbuild relies on this invariant. This
5
5
  is not a problem with esbuild. You need to fix your environment instead.
6
6
  `);function g(e,t){return(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function _(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var v=String.fromCharCode;function y(e,t,n){let r=e[t],i=1,a=0;for(let n=0;n<t;n++)e[n]===10?(i++,a=0):a++;throw SyntaxError(n||(t===e.length?`Unexpected end of input while parsing JSON`:r>=32&&r<=126?`Unexpected character ${v(r)} in JSON at position ${t} (line ${i}, column ${a})`:`Unexpected byte 0x${r.toString(16)} in JSON at position ${t} (line ${i}, column ${a})`))}function b(e){if(!(e instanceof Uint8Array))throw Error(`JSON input must be a Uint8Array`);let t=[],n=[],r=[],i=e.length,a=null,o=0,s,c=0;for(;c<i;){let l=e[c++];if(l<=32)continue;let u;switch(o===2&&a===null&&l!==34&&l!==125&&y(e,--c),l){case 116:(e[c++]!==114||e[c++]!==117||e[c++]!==101)&&y(e,--c),u=!0;break;case 102:(e[c++]!==97||e[c++]!==108||e[c++]!==115||e[c++]!==101)&&y(e,--c),u=!1;break;case 110:(e[c++]!==117||e[c++]!==108||e[c++]!==108)&&y(e,--c),u=null;break;case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let t=c;for(u=v(l),l=e[c];;){switch(l){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:u+=v(l),l=e[++c];continue}break}u=+u,isNaN(u)&&y(e,--t,`Invalid number`);break}case 34:for(u=``;c>=i&&y(e,i),l=e[c++],l!==34;)if(l===92)switch(e[c++]){case 34:u+=`"`;break;case 47:u+=`/`;break;case 92:u+=`\\`;break;case 98:u+=`\b`;break;case 102:u+=`\f`;break;case 110:u+=`
7
- `;break;case 114:u+=`\r`;break;case 116:u+=` `;break;case 117:{let t=0;for(let n=0;n<4;n++)l=e[c++],t<<=4,l>=48&&l<=57?t|=l-48:l>=97&&l<=102?t|=l+-87:l>=65&&l<=70?t|=l+-55:y(e,--c);u+=v(t);break}default:y(e,--c)}else if(l<=127)u+=v(l);else if((l&224)==192)u+=v((l&31)<<6|e[c++]&63);else if((l&240)==224)u+=v((l&15)<<12|(e[c++]&63)<<6|e[c++]&63);else if((l&248)==240){let t=(l&7)<<18|(e[c++]&63)<<12|(e[c++]&63)<<6|e[c++]&63;t>65535&&(t-=65536,u+=v(t>>10&1023|55296),t=56320|t&1023),u+=v(t)}u[0];break;case 91:u=[],t.push(a),n.push(s),r.push(o),a=null,s=u,o=1;continue;case 123:u={},t.push(a),n.push(s),r.push(o),a=null,s=u,o=2;continue;case 93:o!==1&&y(e,--c),u=s,a=t.pop(),s=n.pop(),o=r.pop();break;case 125:o!==2&&y(e,--c),u=s,a=t.pop(),s=n.pop(),o=r.pop();break;default:y(e,--c)}for(l=e[c];l<=32;)l=e[++c];switch(o){case 0:if(c===i)return u;break;case 1:if(s.push(u),l===44){c++;continue}if(l===93)continue;break;case 2:if(a===null){if(a=u,l===58){c++;continue}}else{if(s[a]=u,a=null,l===44){c++;continue}if(l===125)continue}}break}y(e,c)}var x=JSON.stringify,S=`warning`,C=`silent`;function w(e,t){let n=[];for(let r of e){if(H(r,t),r.indexOf(`,`)>=0)throw Error(`Invalid ${t}: ${r}`);n.push(r)}return n.join(`,`)}var T=()=>null,E=e=>typeof e==`boolean`?null:`a boolean`,D=e=>typeof e==`string`?null:`a string`,O=e=>e instanceof RegExp?null:`a RegExp object`,k=e=>typeof e==`number`&&e===(e|0)?null:`an integer`,A=e=>typeof e==`number`&&e===(e|0)&&e>=0&&e<=65535?null:`a valid port number`,j=e=>typeof e==`function`?null:`a function`,M=e=>Array.isArray(e)?null:`an array`,N=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)?null:`an array of strings`,P=e=>typeof e==`object`&&e&&!Array.isArray(e)?null:`an object`,ee=e=>typeof e==`object`&&e?null:`an array or an object`,F=e=>e instanceof WebAssembly.Module?null:`a WebAssembly.Module`,I=e=>typeof e==`object`&&!Array.isArray(e)?null:`an object or null`,L=e=>typeof e==`string`||typeof e==`boolean`?null:`a string or a boolean`,te=e=>typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)?null:`a string or an object`,R=e=>typeof e==`string`||Array.isArray(e)&&e.every(e=>typeof e==`string`)?null:`a string or an array of strings`,ne=e=>typeof e==`string`||e instanceof Uint8Array?null:`a string or a Uint8Array`,re=e=>typeof e==`string`||e instanceof URL?null:`a string or a URL`;function z(e,t,n,r){let i=e[n];if(t[n+``]=!0,i===void 0)return;let a=r(i);if(a!==null)throw Error(`${x(n)} must be ${a}`);return i}function B(e,t,n){for(let r in e)if(!(r in t))throw Error(`Invalid option ${n}: ${x(r)}`)}function V(e){let t=Object.create(null),n=z(e,t,`wasmURL`,re),r=z(e,t,`wasmModule`,F),i=z(e,t,`worker`,E);return B(e,t,`in initialize() call`),{wasmURL:n,wasmModule:r,worker:i}}function ie(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let r=e[n];if(typeof r==`string`||r===!1)t[n]=r;else throw Error(`Expected ${x(n)} in mangle cache to map to either a string or false`)}}return t}function ae(e,t,n,r,i){let a=z(t,n,`color`,E),o=z(t,n,`logLevel`,D),s=z(t,n,`logLimit`,k),c=z(t,n,`logStyle`,D);a===void 0?r&&e.push(`--color=true`):e.push(`--color=${a}`),e.push(`--log-level=${o||i}`),e.push(`--log-limit=${s||0}`),c&&e.push(`--log-style=${c}`)}function H(e,t,n){if(typeof e!=`string`)throw Error(`Expected value for ${t}${n===void 0?``:` `+x(n)} to be a string, got ${typeof e} instead`);return e}function oe(e,t,n){let r=z(t,n,`legalComments`,D),i=z(t,n,`sourceRoot`,D),a=z(t,n,`sourcesContent`,E),o=z(t,n,`target`,R),s=z(t,n,`format`,D),c=z(t,n,`globalName`,D),l=z(t,n,`mangleProps`,O),u=z(t,n,`reserveProps`,O),d=z(t,n,`mangleQuoted`,E),f=z(t,n,`minify`,E),p=z(t,n,`minifySyntax`,E),m=z(t,n,`minifyWhitespace`,E),h=z(t,n,`minifyIdentifiers`,E),g=z(t,n,`lineLimit`,k),_=z(t,n,`drop`,N),v=z(t,n,`dropLabels`,N),y=z(t,n,`charset`,D),b=z(t,n,`treeShaking`,E),S=z(t,n,`ignoreAnnotations`,E),C=z(t,n,`jsx`,D),T=z(t,n,`jsxFactory`,D),A=z(t,n,`jsxFragment`,D),j=z(t,n,`jsxImportSource`,D),M=z(t,n,`jsxDev`,E),ee=z(t,n,`jsxSideEffects`,E),F=z(t,n,`define`,P),I=z(t,n,`logOverride`,P),L=z(t,n,`supported`,P),ne=z(t,n,`pure`,N),re=z(t,n,`keepNames`,E),B=z(t,n,`platform`,D),V=z(t,n,`tsconfigRaw`,te),ie=z(t,n,`absPaths`,N);if(r&&e.push(`--legal-comments=${r}`),i!==void 0&&e.push(`--source-root=${i}`),a!==void 0&&e.push(`--sources-content=${a}`),o&&e.push(`--target=${w(Array.isArray(o)?o:[o],`target`)}`),s&&e.push(`--format=${s}`),c&&e.push(`--global-name=${c}`),B&&e.push(`--platform=${B}`),V&&e.push(`--tsconfig-raw=${typeof V==`string`?V:JSON.stringify(V)}`),f&&e.push(`--minify`),p&&e.push(`--minify-syntax`),m&&e.push(`--minify-whitespace`),h&&e.push(`--minify-identifiers`),g&&e.push(`--line-limit=${g}`),y&&e.push(`--charset=${y}`),b!==void 0&&e.push(`--tree-shaking=${b}`),S&&e.push(`--ignore-annotations`),_)for(let t of _)e.push(`--drop:${H(t,`drop`)}`);if(v&&e.push(`--drop-labels=${w(v,`drop label`)}`),ie&&e.push(`--abs-paths=${w(ie,`abs paths`)}`),l&&e.push(`--mangle-props=${Q(l)}`),u&&e.push(`--reserve-props=${Q(u)}`),d!==void 0&&e.push(`--mangle-quoted=${d}`),C&&e.push(`--jsx=${C}`),T&&e.push(`--jsx-factory=${T}`),A&&e.push(`--jsx-fragment=${A}`),j&&e.push(`--jsx-import-source=${j}`),M&&e.push(`--jsx-dev`),ee&&e.push(`--jsx-side-effects`),F)for(let t in F){if(t.indexOf(`=`)>=0)throw Error(`Invalid define: ${t}`);e.push(`--define:${t}=${H(F[t],`define`,t)}`)}if(I)for(let t in I){if(t.indexOf(`=`)>=0)throw Error(`Invalid log override: ${t}`);e.push(`--log-override:${t}=${H(I[t],`log override`,t)}`)}if(L)for(let t in L){if(t.indexOf(`=`)>=0)throw Error(`Invalid supported: ${t}`);let n=L[t];if(typeof n!=`boolean`)throw Error(`Expected value for supported ${x(t)} to be a boolean, got ${typeof n} instead`);e.push(`--supported:${t}=${n}`)}if(ne)for(let t of ne)e.push(`--pure:${H(t,`pure`)}`);re&&e.push(`--keep-names`)}function U(e,t,n,r,i){let a=[],o=[],s=Object.create(null),c=null,l=null;ae(a,t,s,n,r),oe(a,t,s);let u=z(t,s,`sourcemap`,L),d=z(t,s,`bundle`,E),f=z(t,s,`splitting`,E),m=z(t,s,`preserveSymlinks`,E),h=z(t,s,`metafile`,E),g=z(t,s,`outfile`,D),_=z(t,s,`outdir`,D),v=z(t,s,`outbase`,D),y=z(t,s,`tsconfig`,D),b=z(t,s,`resolveExtensions`,N),x=z(t,s,`nodePaths`,N),S=z(t,s,`mainFields`,N),C=z(t,s,`conditions`,N),T=z(t,s,`external`,N),O=z(t,s,`packages`,D),k=z(t,s,`alias`,P),A=z(t,s,`loader`,P),j=z(t,s,`outExtension`,P),M=z(t,s,`publicPath`,D),F=z(t,s,`entryNames`,D),I=z(t,s,`chunkNames`,D),te=z(t,s,`assetNames`,D),R=z(t,s,`inject`,N),re=z(t,s,`banner`,P),V=z(t,s,`footer`,P),U=z(t,s,`entryPoints`,ee),se=z(t,s,`absWorkingDir`,D),W=z(t,s,`stdin`,P),G=z(t,s,`write`,E)??i,ce=z(t,s,`allowOverwrite`,E),le=z(t,s,`mangleCache`,P);if(s.plugins=!0,B(t,s,`in ${e}() call`),u&&a.push(`--sourcemap${u===!0?``:`=${u}`}`),d&&a.push(`--bundle`),ce&&a.push(`--allow-overwrite`),f&&a.push(`--splitting`),m&&a.push(`--preserve-symlinks`),h&&a.push(`--metafile`),g&&a.push(`--outfile=${g}`),_&&a.push(`--outdir=${_}`),v&&a.push(`--outbase=${v}`),y&&a.push(`--tsconfig=${y}`),O&&a.push(`--packages=${O}`),b&&a.push(`--resolve-extensions=${w(b,`resolve extension`)}`),M&&a.push(`--public-path=${M}`),F&&a.push(`--entry-names=${F}`),I&&a.push(`--chunk-names=${I}`),te&&a.push(`--asset-names=${te}`),S&&a.push(`--main-fields=${w(S,`main field`)}`),C&&a.push(`--conditions=${w(C,`condition`)}`),T)for(let e of T)a.push(`--external:${H(e,`external`)}`);if(k)for(let e in k){if(e.indexOf(`=`)>=0)throw Error(`Invalid package name in alias: ${e}`);a.push(`--alias:${e}=${H(k[e],`alias`,e)}`)}if(re)for(let e in re){if(e.indexOf(`=`)>=0)throw Error(`Invalid banner file type: ${e}`);a.push(`--banner:${e}=${H(re[e],`banner`,e)}`)}if(V)for(let e in V){if(e.indexOf(`=`)>=0)throw Error(`Invalid footer file type: ${e}`);a.push(`--footer:${e}=${H(V[e],`footer`,e)}`)}if(R)for(let e of R)a.push(`--inject:${H(e,`inject`)}`);if(A)for(let e in A){if(e.indexOf(`=`)>=0)throw Error(`Invalid loader extension: ${e}`);a.push(`--loader:${e}=${H(A[e],`loader`,e)}`)}if(j)for(let e in j){if(e.indexOf(`=`)>=0)throw Error(`Invalid out extension: ${e}`);a.push(`--out-extension:${e}=${H(j[e],`out extension`,e)}`)}if(U){if(Array.isArray(U))for(let e=0,t=U.length;e<t;e++){let t=U[e];if(typeof t==`object`&&t){let n=Object.create(null),r=z(t,n,`in`,D),i=z(t,n,`out`,D);if(B(t,n,`in entry point at index `+e),r===void 0)throw Error(`Missing property "in" for entry point at index `+e);if(i===void 0)throw Error(`Missing property "out" for entry point at index `+e);o.push([i,r])}else o.push([``,H(t,`entry point at index `+e)])}else for(let e in U)o.push([e,H(U[e],`entry point`,e)])}if(W){let e=Object.create(null),t=z(W,e,`contents`,ne),n=z(W,e,`resolveDir`,D),r=z(W,e,`sourcefile`,D),i=z(W,e,`loader`,D);B(W,e,`in "stdin" object`),r&&a.push(`--sourcefile=${r}`),i&&a.push(`--loader=${i}`),n&&(l=n),typeof t==`string`?c=p(t):t instanceof Uint8Array&&(c=t)}let K=[];if(x)for(let e of x)e+=``,K.push(e);return{entries:o,flags:a,write:G,stdinContents:c,stdinResolveDir:l,absWorkingDir:se,nodePaths:K,mangleCache:ie(le)}}function se(e,t,n,r){let i=[],a=Object.create(null);ae(i,t,a,n,r),oe(i,t,a);let o=z(t,a,`sourcemap`,L),s=z(t,a,`sourcefile`,D),c=z(t,a,`loader`,D),l=z(t,a,`banner`,D),u=z(t,a,`footer`,D),d=z(t,a,`mangleCache`,P);return B(t,a,`in ${e}() call`),o&&i.push(`--sourcemap=${o===!0?`external`:o}`),s&&i.push(`--sourcefile=${s}`),c&&i.push(`--loader=${c}`),l&&i.push(`--banner=${l}`),u&&i.push(`--footer=${u}`),{flags:i,mangleCache:ie(d)}}function W(e){let t={},n={didClose:!1,reason:``},r={},i=0,a=0,o=new Uint8Array(16384),s=0,l=e=>{let t=s+e.length;if(t>o.length){let e=new Uint8Array(t*2);e.set(o),o=e}o.set(e,s),s+=e.length;let n=0;for(;n+4<=s;){let e=g(o,n);if(n+4+e>s)break;n+=4,y(o.subarray(n,n+e)),n+=e}n>0&&(o.copyWithin(0,n,s),s-=n)},f=e=>{n.didClose=!0,e&&(n.reason=`: `+(e.message||e));let t=`The service was stopped`+n.reason;for(let e in r)r[e](t,null);r={}},m=(t,a,o)=>{if(n.didClose)return o(`The service is no longer running`+n.reason,null);let s=i++;r[s]=(e,n)=>{try{o(e,n)}finally{t&&t.unref()}},t&&t.ref(),e.writeToStdin(u({id:s,isRequest:!0,value:a}))},h=(t,r)=>{if(n.didClose)throw Error(`The service is no longer running`+n.reason);e.writeToStdin(u({id:t,isRequest:!1,value:r}))},_=(n,r)=>c(null,null,function*(){try{if(r.command===`ping`){h(n,{});return}if(typeof r.key==`number`){let e=t[r.key];if(!e)return;let i=e[r.command];if(i){yield i(n,r);return}}throw Error(`Invalid command: `+r.command)}catch(t){let r=[q(t,e,null,void 0,``)];try{h(n,{errors:r})}catch{}}}),v=!0,y=e=>{if(v){v=!1;let t=String.fromCharCode(...e);if(t!==`0.28.2`)throw Error(`Cannot start service: Host version "0.28.2" does not match binary version ${x(t)}`);return}let t=d(e);if(t.isRequest)_(t.id,t.value);else{let e=r[t.id];delete r[t.id],t.value.error?e(t.value.error,{}):e(null,t.value)}};return{readFromStdout:l,afterClose:f,service:{buildOrContext:({callName:n,refs:r,options:i,isTTY:o,defaultWD:s,callback:c})=>{let l=0,u=a++,d={},f={ref(){++l===1&&r&&r.ref()},unref(){--l===0&&(delete t[u],r&&r.unref())}};t[u]=d,f.ref(),G(n,u,m,h,f,e,d,i,o,s,(e,t)=>{try{c(e,t)}finally{f.unref()}})},transform:({callName:t,refs:n,input:r,options:i,isTTY:a,fs:o,callback:s})=>{let c=le(),l=l=>{try{if(typeof r!=`string`&&!(r instanceof Uint8Array))throw Error(`The input to "transform" must be a string or a Uint8Array`);let{flags:e,mangleCache:u}=se(t,i,a,C),d={command:`transform`,flags:e,inputFS:l!==null,input:l===null?typeof r==`string`?p(r):r:p(l)};u&&(d.mangleCache=u),m(n,d,(e,t)=>{if(e)return s(Error(e),null);let n=Y(t.errors,c),r=Y(t.warnings,c),i=1,a=()=>{if(--i===0){let e={warnings:r,code:t.code,map:t.map,mangleCache:void 0,legalComments:void 0};`legalComments`in t&&(e.legalComments=t?.legalComments),t.mangleCache&&(e.mangleCache=t?.mangleCache),s(null,e)}};if(n.length>0)return s(J(`Transform failed`,n,r),null);t.codeFS&&(i++,o.readFile(t.code,(e,n)=>{e===null?(t.code=n,a()):s(e,null)})),t.mapFS&&(i++,o.readFile(t.map,(e,n)=>{e===null?(t.map=n,a()):s(e,null)})),a()})}catch(t){let r=[];try{ae(r,i,{},a,C)}catch{}let o=q(t,e,c,void 0,``);m(n,{command:`error`,flags:r,error:o},()=>{o.detail=c.load(o.detail),s(J(`Transform failed`,[o],[]),null)})}};if((typeof r==`string`||r instanceof Uint8Array)&&r.length>1048576){let e=l;l=()=>o.writeFile(r,e)}l(null)},formatMessages:({callName:e,refs:t,messages:n,options:r,callback:i})=>{if(!r)throw Error(`Missing second argument in ${e}() call`);let a={},o=z(r,a,`kind`,D),s=z(r,a,`color`,E),c=z(r,a,`terminalWidth`,k),l=z(r,a,`logStyle`,D);if(B(r,a,`in ${e}() call`),o===void 0)throw Error(`Missing "kind" in ${e}() call`);if(o!==`error`&&o!==`warning`)throw Error(`Expected "kind" to be "error" or "warning" in ${e}() call`);let u={command:`format-msgs`,messages:X(n,`messages`,null,``,c),isWarning:o===`warning`};s!==void 0&&(u.color=s),c!==void 0&&(u.terminalWidth=c),l!==void 0&&(u.logStyle=l),m(t,u,(e,t)=>{if(e)return i(Error(e),null);i(null,t.messages)})},analyzeMetafile:({callName:e,refs:t,metafile:n,options:r,callback:i})=>{r===void 0&&(r={});let a={},o=z(r,a,`color`,E),s=z(r,a,`verbose`,E);B(r,a,`in ${e}() call`);let c={command:`analyze-metafile`,metafile:n};o!==void 0&&(c.color=o),s!==void 0&&(c.verbose=s),m(t,c,(e,t)=>{if(e)return i(Error(e),null);i(null,t.result)})}}}}function G(e,t,n,r,i,a,o,s,c,l,u){let d=le(),f=e===`context`,p=(e,t)=>{let r=[];try{ae(r,s,{},c,S)}catch{}let o=q(e,a,d,void 0,t);n(i,{command:`error`,flags:r,error:o},()=>{o.detail=d.load(o.detail),u(J(f?`Context failed`:`Build failed`,[o],[]),null)})},h;if(typeof s==`object`){let e=s.plugins;if(e!==void 0){if(!Array.isArray(e))return p(Error(`"plugins" must be an array`),``);h=e}}if(h&&h.length>0){if(a.isSync)return p(Error(`Cannot use plugins in synchronous API calls`),``);ce(t,n,r,i,a,o,s,h,d).then(e=>{if(!e.ok)return p(e.error,e.pluginName);try{g(e.requestPlugins,e.runOnEndCallbacks,e.scheduleOnDisposeCallbacks)}catch(e){p(e,``)}},e=>p(e,``));return}try{g(null,(e,t)=>t([],[]),()=>{})}catch(e){p(e,``)}function g(p,h,g){let{entries:_,flags:v,write:y,stdinContents:b,stdinResolveDir:x,absWorkingDir:C,nodePaths:w,mangleCache:T}=U(e,s,c,S,a.hasFS);if(y&&!a.hasFS)throw Error(`The "write" option is unavailable in this environment`);let E={command:`build`,key:t,entries:_,flags:v,write:y,stdinContents:b,stdinResolveDir:x,absWorkingDir:C||l,nodePaths:w,context:f};p&&(E.plugins=p),T&&(E.mangleCache=T);let O=(e,t)=>{let n={errors:Y(e.errors,d),warnings:Y(e.warnings,d),outputFiles:void 0,metafile:void 0,mangleCache:void 0},r=n.errors.slice(),i=n.warnings.slice();e.outputFiles&&(n.outputFiles=e.outputFiles.map(pe)),e.metafile&&e.metafile.length&&(n.metafile=me(e.metafile)),e.mangleCache&&(n.mangleCache=e.mangleCache),e.writeToStdout!==void 0&&console.log(m(e.writeToStdout).replace(/\n$/,``)),h(n,(e,a)=>{if(r.length>0||e.length>0)return t(J(`Build failed`,r.concat(e),i.concat(a)),null,e,a);t(null,n,e,a)})},M,N;f&&(o[`on-end`]=(e,t)=>new Promise(n=>{O(t,(t,i,a,o)=>{let s={errors:a,warnings:o};N&&N(t,i),M=void 0,N=void 0,r(e,s),n()})})),n(i,E,(e,s)=>{if(e)return u(Error(e),null);if(!f)return O(s,(e,t)=>(g(),u(e,t)));if(s.errors.length>0)return u(J(`Context failed`,s.errors,s.warnings),null);let c=!1;i.ref(),u(null,{rebuild:()=>(M||=new Promise((e,r)=>{let a;N=(t,n)=>{a||=()=>t?r(t):e(n)};let o=()=>{n(i,{command:`rebuild`,key:t},(e,t)=>{e?r(Error(e)):a?a():o()})};o()}),M),watch:(e={})=>new Promise((r,o)=>{if(!a.hasFS)throw Error(`Cannot use the "watch" API in this environment`);let s={},c=z(e,s,`delay`,k);B(e,s,`in watch() call`);let l={command:`watch`,key:t};c&&(l.delay=c),n(i,l,e=>{e?o(Error(e)):r(void 0)})}),serve:(e={})=>new Promise((s,c)=>{if(!a.hasFS)throw Error(`Cannot use the "serve" API in this environment`);let l={},u=z(e,l,`port`,A),d=z(e,l,`host`,D),f=z(e,l,`servedir`,D),p=z(e,l,`keyfile`,D),m=z(e,l,`certfile`,D),h=z(e,l,`fallback`,D),g=z(e,l,`cors`,P),_=z(e,l,`onRequest`,j);B(e,l,`in serve() call`);let v={command:`serve`,key:t,onRequest:!!_};if(u!==void 0&&(v.port=u),d!==void 0&&(v.host=d),f!==void 0&&(v.servedir=f),p!==void 0&&(v.keyfile=p),m!==void 0&&(v.certfile=m),h!==void 0&&(v.fallback=h),g){let e={},t=z(g,e,`origin`,R);B(g,e,`on "cors" object`),Array.isArray(t)?v.corsOrigin=t:t!==void 0&&(v.corsOrigin=[t])}n(i,v,(e,t)=>{if(e)return c(Error(e));_&&(o[`serve-request`]=(e,t)=>{_(t.args),r(e,{})}),s(t)})}),cancel:()=>new Promise(e=>{if(c)return e();n(i,{command:`cancel`,key:t},()=>{e()})}),dispose:()=>new Promise(e=>{if(c)return e();c=!0,n(i,{command:`dispose`,key:t},()=>{e(),g(),i.unref()})})})})}}var ce=(e,t,n,r,i,a,o,s,l)=>c(null,null,function*(){let u=[],d=[],f={},m={},h=[],g=0,_=0,v=[],y=!1;s=[...s];for(let n of s){let a={};if(typeof n!=`object`)throw Error(`Plugin at index ${_} must be an object`);let s=z(n,a,`name`,D);if(typeof s!=`string`||s===``)throw Error(`Plugin at index ${_} is missing a name`);try{let c=z(n,a,`setup`,j);if(typeof c!=`function`)throw Error(`Plugin is missing a setup function`);B(n,a,`on plugin ${x(s)}`);let p={name:s,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};_++;let b=c({initialOptions:o,resolve:(n,i={})=>{if(!y)throw Error(`Cannot call "resolve" before plugin setup has completed`);if(typeof n!=`string`)throw Error(`The path to resolve must be a string`);let a=Object.create(null),o=z(i,a,`pluginName`,D),c=z(i,a,`importer`,D),u=z(i,a,`namespace`,D),d=z(i,a,`resolveDir`,D),f=z(i,a,`kind`,D),p=z(i,a,`pluginData`,T),m=z(i,a,`with`,P);return B(i,a,`in resolve() call`),new Promise((i,a)=>{let h={command:`resolve`,path:n,key:e,pluginName:s};if(o!=null&&(h.pluginName=o),c!=null&&(h.importer=c),u!=null&&(h.namespace=u),d!=null&&(h.resolveDir=d),f!=null)h.kind=f;else throw Error(`Must specify "kind" when calling "resolve"`);p!=null&&(h.pluginData=l.store(p)),m!=null&&(h.with=fe(m,`with`)),t(r,h,(e,t)=>{e===null?i({errors:Y(t.errors,l),warnings:Y(t.warnings,l),path:t.path,external:t.external,sideEffects:t.sideEffects,namespace:t.namespace,suffix:t.suffix,pluginData:l.load(t.pluginData)}):a(Error(e))})})},onStart(e){let t=K(Error(`This error came from the "onStart" callback registered here:`),i,`onStart`);u.push({name:s,callback:e,note:t}),p.onStart=!0},onEnd(e){let t=K(Error(`This error came from the "onEnd" callback registered here:`),i,`onEnd`);d.push({name:s,callback:e,note:t}),p.onEnd=!0},onResolve(e,t){let n=K(Error(`This error came from the "onResolve" callback registered here:`),i,`onResolve`),r={},a=z(e,r,`filter`,O),o=z(e,r,`namespace`,D);if(B(e,r,`in onResolve() call for plugin ${x(s)}`),a==null)throw Error(`onResolve() call is missing a filter`);let c=g++;f[c]={name:s,callback:t,note:n},p.onResolve.push({id:c,filter:Q(a),namespace:o||``})},onLoad(e,t){let n=K(Error(`This error came from the "onLoad" callback registered here:`),i,`onLoad`),r={},a=z(e,r,`filter`,O),o=z(e,r,`namespace`,D);if(B(e,r,`in onLoad() call for plugin ${x(s)}`),a==null)throw Error(`onLoad() call is missing a filter`);let c=g++;m[c]={name:s,callback:t,note:n},p.onLoad.push({id:c,filter:Q(a),namespace:o||``})},onDispose(e){h.push(e)},esbuild:i.esbuild});b&&(yield b),v.push(p)}catch(e){return{ok:!1,error:e,pluginName:s}}}a[`on-start`]=(e,t)=>c(null,null,function*(){l.clear();let t={errors:[],warnings:[]};yield Promise.all(u.map(e=>c(null,[e],function*({name:e,callback:n,note:r}){try{let r=yield n();if(r!=null){if(typeof r!=`object`)throw Error(`Expected onStart() callback in plugin ${x(e)} to return an object`);let n={},i=z(r,n,`errors`,M),a=z(r,n,`warnings`,M);B(r,n,`from onStart() callback in plugin ${x(e)}`),i!=null&&t.errors.push(...X(i,`errors`,l,e,void 0)),a!=null&&t.warnings.push(...X(a,`warnings`,l,e,void 0))}}catch(n){t.errors.push(q(n,i,l,r&&r(),e))}}))),n(e,t)}),a[`on-resolve`]=(e,t)=>c(null,null,function*(){let r={},a=``,o,s;for(let e of t.ids)try{({name:a,callback:o,note:s}=f[e]);let n=yield o({path:t.path,importer:t.importer,namespace:t.namespace,resolveDir:t.resolveDir,kind:t.kind,pluginData:l.load(t.pluginData),with:t.with});if(n!=null){if(typeof n!=`object`)throw Error(`Expected onResolve() callback in plugin ${x(a)} to return an object`);let t={},i=z(n,t,`pluginName`,D),o=z(n,t,`path`,D),s=z(n,t,`namespace`,D),c=z(n,t,`suffix`,D),u=z(n,t,`external`,E),d=z(n,t,`sideEffects`,E),f=z(n,t,`pluginData`,T),p=z(n,t,`errors`,M),m=z(n,t,`warnings`,M),h=z(n,t,`watchFiles`,N),g=z(n,t,`watchDirs`,N);B(n,t,`from onResolve() callback in plugin ${x(a)}`),r.id=e,i!=null&&(r.pluginName=i),o!=null&&(r.path=o),s!=null&&(r.namespace=s),c!=null&&(r.suffix=c),u!=null&&(r.external=u),d!=null&&(r.sideEffects=d),f!=null&&(r.pluginData=l.store(f)),p!=null&&(r.errors=X(p,`errors`,l,a,void 0)),m!=null&&(r.warnings=X(m,`warnings`,l,a,void 0)),h!=null&&(r.watchFiles=Z(h,`watchFiles`)),g!=null&&(r.watchDirs=Z(g,`watchDirs`));break}}catch(t){r={id:e,errors:[q(t,i,l,s&&s(),a)]};break}n(e,r)}),a[`on-load`]=(e,t)=>c(null,null,function*(){let r={},a=``,o,s;for(let e of t.ids)try{({name:a,callback:o,note:s}=m[e]);let n=yield o({path:t.path,namespace:t.namespace,suffix:t.suffix,pluginData:l.load(t.pluginData),with:t.with});if(n!=null){if(typeof n!=`object`)throw Error(`Expected onLoad() callback in plugin ${x(a)} to return an object`);let t={},i=z(n,t,`pluginName`,D),o=z(n,t,`contents`,ne),s=z(n,t,`resolveDir`,D),c=z(n,t,`pluginData`,T),u=z(n,t,`loader`,D),d=z(n,t,`errors`,M),f=z(n,t,`warnings`,M),m=z(n,t,`watchFiles`,N),h=z(n,t,`watchDirs`,N);B(n,t,`from onLoad() callback in plugin ${x(a)}`),r.id=e,i!=null&&(r.pluginName=i),o instanceof Uint8Array?r.contents=o:o!=null&&(r.contents=p(o)),s!=null&&(r.resolveDir=s),c!=null&&(r.pluginData=l.store(c)),u!=null&&(r.loader=u),d!=null&&(r.errors=X(d,`errors`,l,a,void 0)),f!=null&&(r.warnings=X(f,`warnings`,l,a,void 0)),m!=null&&(r.watchFiles=Z(m,`watchFiles`)),h!=null&&(r.watchDirs=Z(h,`watchDirs`));break}}catch(t){r={id:e,errors:[q(t,i,l,s&&s(),a)]};break}n(e,r)});let b=(e,t)=>t([],[]);return d.length>0&&(b=(e,t)=>{c(null,null,function*(){let n=[],r=[];for(let{name:t,callback:a,note:o}of d){let s,c;try{let n=yield a(e);if(n!=null){if(typeof n!=`object`)throw Error(`Expected onEnd() callback in plugin ${x(t)} to return an object`);let e={},r=z(n,e,`errors`,M),i=z(n,e,`warnings`,M);B(n,e,`from onEnd() callback in plugin ${x(t)}`),r!=null&&(s=X(r,`errors`,l,t,void 0)),i!=null&&(c=X(i,`warnings`,l,t,void 0))}}catch(e){s=[q(e,i,l,o&&o(),t)]}if(s){n.push(...s);try{e.errors.push(...s)}catch{}}if(c){r.push(...c);try{e.warnings.push(...c)}catch{}}}t(n,r)})}),y=!0,{ok:!0,requestPlugins:v,runOnEndCallbacks:b,scheduleOnDisposeCallbacks:()=>{for(let e of h)setTimeout(()=>e(),0)}}});function le(){let e=new Map,t=0;return{clear(){e.clear()},load(t){return e.get(t)},store(n){if(n===void 0)return-1;let r=t++;return e.set(r,n),r}}}function K(e,t,n){let r,i=!1;return()=>{if(i)return r;i=!0;try{let i=(e.stack+``).split(`
8
- `);i.splice(1,1);let a=ue(t,i,n);if(a)return r={text:e.message,location:a},r}catch{}}}function q(e,t,n,r,i){let a=`Internal error`,o=null;try{a=(e&&e.message||e)+``}catch{}try{o=ue(t,(e.stack+``).split(`
9
- `),``)}catch{}return{id:``,pluginName:i,text:a,location:o,notes:r?[r]:[],detail:n?n.store(e):-1}}function ue(e,t,n){let r=` at `;if(e.readFileSync&&!t[0].startsWith(r)&&t[1].startsWith(r))for(let i=1;i<t.length;i++){let a=t[i];if(a.startsWith(r))for(a=a.slice(7);;){let r=/^(?:new |async )?\S+ \((.*)\)$/.exec(a);if(r)a=r[1];else if(r=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(a),r)a=r[1];else{if(r=/^(\S+):(\d+):(\d+)$/.exec(a),r){let i;try{i=e.readFileSync(r[1],`utf8`)}catch{break}let a=i.split(/\r\n|\r|\n|\u2028|\u2029/)[r[2]-1]||``,o=r[3]-1,s=a.slice(o,o+n.length)===n?n.length:0;return{file:r[1],namespace:`file`,line:+r[2],column:p(a.slice(0,o)).length,length:p(a.slice(o,o+s)).length,lineText:a+`
7
+ `;break;case 114:u+=`\r`;break;case 116:u+=` `;break;case 117:{let t=0;for(let n=0;n<4;n++)l=e[c++],t<<=4,l>=48&&l<=57?t|=l-48:l>=97&&l<=102?t|=l+-87:l>=65&&l<=70?t|=l+-55:y(e,--c);u+=v(t);break}default:y(e,--c)}else if(l<=127)u+=v(l);else if((l&224)==192)u+=v((l&31)<<6|e[c++]&63);else if((l&240)==224)u+=v((l&15)<<12|(e[c++]&63)<<6|e[c++]&63);else if((l&248)==240){let t=(l&7)<<18|(e[c++]&63)<<12|(e[c++]&63)<<6|e[c++]&63;t>65535&&(t-=65536,u+=v(t>>10&1023|55296),t=56320|t&1023),u+=v(t)}u[0];break;case 91:u=[],t.push(a),n.push(s),r.push(o),a=null,s=u,o=1;continue;case 123:u={},t.push(a),n.push(s),r.push(o),a=null,s=u,o=2;continue;case 93:o!==1&&y(e,--c),u=s,a=t.pop(),s=n.pop(),o=r.pop();break;case 125:o!==2&&y(e,--c),u=s,a=t.pop(),s=n.pop(),o=r.pop();break;default:y(e,--c)}for(l=e[c];l<=32;)l=e[++c];switch(o){case 0:if(c===i)return u;break;case 1:if(s.push(u),l===44){c++;continue}if(l===93)continue;break;case 2:if(a===null){if(a=u,l===58){c++;continue}}else{if(s[a]=u,a=null,l===44){c++;continue}if(l===125)continue}}break}y(e,c)}var x=JSON.stringify,S=`warning`,C=`silent`;function w(e,t){let n=[];for(let r of e){if(U(r,t),r.indexOf(`,`)>=0)throw Error(`Invalid ${t}: ${r}`);n.push(r)}return n.join(`,`)}var T=()=>null,E=e=>typeof e==`boolean`?null:`a boolean`,D=e=>typeof e==`string`?null:`a string`,O=e=>e instanceof RegExp?null:`a RegExp object`,k=e=>typeof e==`number`&&e===(e|0)?null:`an integer`,A=e=>typeof e==`number`&&e===(e|0)&&e>=0&&e<=65535?null:`a valid port number`,j=e=>typeof e==`function`?null:`a function`,M=e=>Array.isArray(e)?null:`an array`,N=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)?null:`an array of strings`,P=e=>typeof e==`object`&&e&&!Array.isArray(e)?null:`an object`,ee=e=>typeof e==`object`&&e?null:`an array or an object`,F=e=>e instanceof WebAssembly.Module?null:`a WebAssembly.Module`,I=e=>typeof e==`object`&&!Array.isArray(e)?null:`an object or null`,L=e=>typeof e==`string`||typeof e==`boolean`?null:`a string or a boolean`,te=e=>typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)?null:`a string or an object`,ne=e=>typeof e==`string`||Array.isArray(e)&&e.every(e=>typeof e==`string`)?null:`a string or an array of strings`,re=e=>typeof e==`string`||e instanceof Uint8Array?null:`a string or a Uint8Array`,R=e=>typeof e==`string`||e instanceof URL?null:`a string or a URL`;function z(e,t,n,r){let i=e[n];if(t[n+``]=!0,i===void 0)return;let a=r(i);if(a!==null)throw Error(`${x(n)} must be ${a}`);return i}function B(e,t,n){for(let r in e)if(!(r in t))throw Error(`Invalid option ${n}: ${x(r)}`)}function V(e){let t=Object.create(null),n=z(e,t,`wasmURL`,R),r=z(e,t,`wasmModule`,F),i=z(e,t,`worker`,E);return B(e,t,`in initialize() call`),{wasmURL:n,wasmModule:r,worker:i}}function ie(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let r=e[n];if(typeof r==`string`||r===!1)t[n]=r;else throw Error(`Expected ${x(n)} in mangle cache to map to either a string or false`)}}return t}function H(e,t,n,r,i){let a=z(t,n,`color`,E),o=z(t,n,`logLevel`,D),s=z(t,n,`logLimit`,k),c=z(t,n,`logStyle`,D);a===void 0?r&&e.push(`--color=true`):e.push(`--color=${a}`),e.push(`--log-level=${o||i}`),e.push(`--log-limit=${s||0}`),c&&e.push(`--log-style=${c}`)}function U(e,t,n){if(typeof e!=`string`)throw Error(`Expected value for ${t}${n===void 0?``:` `+x(n)} to be a string, got ${typeof e} instead`);return e}function ae(e,t,n){let r=z(t,n,`legalComments`,D),i=z(t,n,`sourceRoot`,D),a=z(t,n,`sourcesContent`,E),o=z(t,n,`target`,ne),s=z(t,n,`format`,D),c=z(t,n,`globalName`,D),l=z(t,n,`mangleProps`,O),u=z(t,n,`reserveProps`,O),d=z(t,n,`mangleQuoted`,E),f=z(t,n,`minify`,E),p=z(t,n,`minifySyntax`,E),m=z(t,n,`minifyWhitespace`,E),h=z(t,n,`minifyIdentifiers`,E),g=z(t,n,`lineLimit`,k),_=z(t,n,`drop`,N),v=z(t,n,`dropLabels`,N),y=z(t,n,`charset`,D),b=z(t,n,`treeShaking`,E),S=z(t,n,`ignoreAnnotations`,E),C=z(t,n,`jsx`,D),T=z(t,n,`jsxFactory`,D),A=z(t,n,`jsxFragment`,D),j=z(t,n,`jsxImportSource`,D),M=z(t,n,`jsxDev`,E),ee=z(t,n,`jsxSideEffects`,E),F=z(t,n,`define`,P),I=z(t,n,`logOverride`,P),L=z(t,n,`supported`,P),re=z(t,n,`pure`,N),R=z(t,n,`keepNames`,E),B=z(t,n,`platform`,D),V=z(t,n,`tsconfigRaw`,te),ie=z(t,n,`absPaths`,N);if(r&&e.push(`--legal-comments=${r}`),i!==void 0&&e.push(`--source-root=${i}`),a!==void 0&&e.push(`--sources-content=${a}`),o&&e.push(`--target=${w(Array.isArray(o)?o:[o],`target`)}`),s&&e.push(`--format=${s}`),c&&e.push(`--global-name=${c}`),B&&e.push(`--platform=${B}`),V&&e.push(`--tsconfig-raw=${typeof V==`string`?V:JSON.stringify(V)}`),f&&e.push(`--minify`),p&&e.push(`--minify-syntax`),m&&e.push(`--minify-whitespace`),h&&e.push(`--minify-identifiers`),g&&e.push(`--line-limit=${g}`),y&&e.push(`--charset=${y}`),b!==void 0&&e.push(`--tree-shaking=${b}`),S&&e.push(`--ignore-annotations`),_)for(let t of _)e.push(`--drop:${U(t,`drop`)}`);if(v&&e.push(`--drop-labels=${w(v,`drop label`)}`),ie&&e.push(`--abs-paths=${w(ie,`abs paths`)}`),l&&e.push(`--mangle-props=${pe(l)}`),u&&e.push(`--reserve-props=${pe(u)}`),d!==void 0&&e.push(`--mangle-quoted=${d}`),C&&e.push(`--jsx=${C}`),T&&e.push(`--jsx-factory=${T}`),A&&e.push(`--jsx-fragment=${A}`),j&&e.push(`--jsx-import-source=${j}`),M&&e.push(`--jsx-dev`),ee&&e.push(`--jsx-side-effects`),F)for(let t in F){if(t.indexOf(`=`)>=0)throw Error(`Invalid define: ${t}`);e.push(`--define:${t}=${U(F[t],`define`,t)}`)}if(I)for(let t in I){if(t.indexOf(`=`)>=0)throw Error(`Invalid log override: ${t}`);e.push(`--log-override:${t}=${U(I[t],`log override`,t)}`)}if(L)for(let t in L){if(t.indexOf(`=`)>=0)throw Error(`Invalid supported: ${t}`);let n=L[t];if(typeof n!=`boolean`)throw Error(`Expected value for supported ${x(t)} to be a boolean, got ${typeof n} instead`);e.push(`--supported:${t}=${n}`)}if(re)for(let t of re)e.push(`--pure:${U(t,`pure`)}`);R&&e.push(`--keep-names`)}function W(e,t,n,r,i){let a=[],o=[],s=Object.create(null),c=null,l=null;H(a,t,s,n,r),ae(a,t,s);let u=z(t,s,`sourcemap`,L),d=z(t,s,`bundle`,E),f=z(t,s,`splitting`,E),m=z(t,s,`preserveSymlinks`,E),h=z(t,s,`metafile`,E),g=z(t,s,`outfile`,D),_=z(t,s,`outdir`,D),v=z(t,s,`outbase`,D),y=z(t,s,`tsconfig`,D),b=z(t,s,`resolveExtensions`,N),x=z(t,s,`nodePaths`,N),S=z(t,s,`mainFields`,N),C=z(t,s,`conditions`,N),T=z(t,s,`external`,N),O=z(t,s,`packages`,D),k=z(t,s,`alias`,P),A=z(t,s,`loader`,P),j=z(t,s,`outExtension`,P),M=z(t,s,`publicPath`,D),F=z(t,s,`entryNames`,D),I=z(t,s,`chunkNames`,D),te=z(t,s,`assetNames`,D),ne=z(t,s,`inject`,N),R=z(t,s,`banner`,P),V=z(t,s,`footer`,P),W=z(t,s,`entryPoints`,ee),G=z(t,s,`absWorkingDir`,D),K=z(t,s,`stdin`,P),oe=z(t,s,`write`,E)??i,se=z(t,s,`allowOverwrite`,E),ce=z(t,s,`mangleCache`,P);if(s.plugins=!0,B(t,s,`in ${e}() call`),u&&a.push(`--sourcemap${u===!0?``:`=${u}`}`),d&&a.push(`--bundle`),se&&a.push(`--allow-overwrite`),f&&a.push(`--splitting`),m&&a.push(`--preserve-symlinks`),h&&a.push(`--metafile`),g&&a.push(`--outfile=${g}`),_&&a.push(`--outdir=${_}`),v&&a.push(`--outbase=${v}`),y&&a.push(`--tsconfig=${y}`),O&&a.push(`--packages=${O}`),b&&a.push(`--resolve-extensions=${w(b,`resolve extension`)}`),M&&a.push(`--public-path=${M}`),F&&a.push(`--entry-names=${F}`),I&&a.push(`--chunk-names=${I}`),te&&a.push(`--asset-names=${te}`),S&&a.push(`--main-fields=${w(S,`main field`)}`),C&&a.push(`--conditions=${w(C,`condition`)}`),T)for(let e of T)a.push(`--external:${U(e,`external`)}`);if(k)for(let e in k){if(e.indexOf(`=`)>=0)throw Error(`Invalid package name in alias: ${e}`);a.push(`--alias:${e}=${U(k[e],`alias`,e)}`)}if(R)for(let e in R){if(e.indexOf(`=`)>=0)throw Error(`Invalid banner file type: ${e}`);a.push(`--banner:${e}=${U(R[e],`banner`,e)}`)}if(V)for(let e in V){if(e.indexOf(`=`)>=0)throw Error(`Invalid footer file type: ${e}`);a.push(`--footer:${e}=${U(V[e],`footer`,e)}`)}if(ne)for(let e of ne)a.push(`--inject:${U(e,`inject`)}`);if(A)for(let e in A){if(e.indexOf(`=`)>=0)throw Error(`Invalid loader extension: ${e}`);a.push(`--loader:${e}=${U(A[e],`loader`,e)}`)}if(j)for(let e in j){if(e.indexOf(`=`)>=0)throw Error(`Invalid out extension: ${e}`);a.push(`--out-extension:${e}=${U(j[e],`out extension`,e)}`)}if(W){if(Array.isArray(W))for(let e=0,t=W.length;e<t;e++){let t=W[e];if(typeof t==`object`&&t){let n=Object.create(null),r=z(t,n,`in`,D),i=z(t,n,`out`,D);if(B(t,n,`in entry point at index `+e),r===void 0)throw Error(`Missing property "in" for entry point at index `+e);if(i===void 0)throw Error(`Missing property "out" for entry point at index `+e);o.push([i,r])}else o.push([``,U(t,`entry point at index `+e)])}else for(let e in W)o.push([e,U(W[e],`entry point`,e)])}if(K){let e=Object.create(null),t=z(K,e,`contents`,re),n=z(K,e,`resolveDir`,D),r=z(K,e,`sourcefile`,D),i=z(K,e,`loader`,D);B(K,e,`in "stdin" object`),r&&a.push(`--sourcefile=${r}`),i&&a.push(`--loader=${i}`),n&&(l=n),typeof t==`string`?c=p(t):t instanceof Uint8Array&&(c=t)}let q=[];if(x)for(let e of x)e+=``,q.push(e);return{entries:o,flags:a,write:oe,stdinContents:c,stdinResolveDir:l,absWorkingDir:G,nodePaths:q,mangleCache:ie(ce)}}function G(e,t,n,r){let i=[],a=Object.create(null);H(i,t,a,n,r),ae(i,t,a);let o=z(t,a,`sourcemap`,L),s=z(t,a,`sourcefile`,D),c=z(t,a,`loader`,D),l=z(t,a,`banner`,D),u=z(t,a,`footer`,D),d=z(t,a,`mangleCache`,P);return B(t,a,`in ${e}() call`),o&&i.push(`--sourcemap=${o===!0?`external`:o}`),s&&i.push(`--sourcefile=${s}`),c&&i.push(`--loader=${c}`),l&&i.push(`--banner=${l}`),u&&i.push(`--footer=${u}`),{flags:i,mangleCache:ie(d)}}function K(e){let t={},n={didClose:!1,reason:``},r={},i=0,a=0,o=new Uint8Array(16384),s=0,l=e=>{let t=s+e.length;if(t>o.length){let e=new Uint8Array(t*2);e.set(o),o=e}o.set(e,s),s+=e.length;let n=0;for(;n+4<=s;){let e=g(o,n);if(n+4+e>s)break;n+=4,y(o.subarray(n,n+e)),n+=e}n>0&&(o.copyWithin(0,n,s),s-=n)},f=e=>{n.didClose=!0,e&&(n.reason=`: `+(e.message||e));let t=`The service was stopped`+n.reason;for(let e in r)r[e](t,null);r={}},m=(t,a,o)=>{if(n.didClose)return o(`The service is no longer running`+n.reason,null);let s=i++;r[s]=(e,n)=>{try{o(e,n)}finally{t&&t.unref()}},t&&t.ref(),e.writeToStdin(u({id:s,isRequest:!0,value:a}))},h=(t,r)=>{if(n.didClose)throw Error(`The service is no longer running`+n.reason);e.writeToStdin(u({id:t,isRequest:!1,value:r}))},_=(n,r)=>c(null,null,function*(){try{if(r.command===`ping`){h(n,{});return}if(typeof r.key==`number`){let e=t[r.key];if(!e)return;let i=e[r.command];if(i){yield i(n,r);return}}throw Error(`Invalid command: `+r.command)}catch(t){let r=[J(t,e,null,void 0,``)];try{h(n,{errors:r})}catch{}}}),v=!0,y=e=>{if(v){v=!1;let t=String.fromCharCode(...e);if(t!==`0.28.2`)throw Error(`Cannot start service: Host version "0.28.2" does not match binary version ${x(t)}`);return}let t=d(e);if(t.isRequest)_(t.id,t.value);else{let e=r[t.id];delete r[t.id],t.value.error?e(t.value.error,{}):e(null,t.value)}};return{readFromStdout:l,afterClose:f,service:{buildOrContext:({callName:n,refs:r,options:i,isTTY:o,defaultWD:s,callback:c})=>{let l=0,u=a++,d={},f={ref(){++l===1&&r&&r.ref()},unref(){--l===0&&(delete t[u],r&&r.unref())}};t[u]=d,f.ref(),oe(n,u,m,h,f,e,d,i,o,s,(e,t)=>{try{c(e,t)}finally{f.unref()}})},transform:({callName:t,refs:n,input:r,options:i,isTTY:a,fs:o,callback:s})=>{let c=ce(),l=l=>{try{if(typeof r!=`string`&&!(r instanceof Uint8Array))throw Error(`The input to "transform" must be a string or a Uint8Array`);let{flags:e,mangleCache:u}=G(t,i,a,C),d={command:`transform`,flags:e,inputFS:l!==null,input:l===null?typeof r==`string`?p(r):r:p(l)};u&&(d.mangleCache=u),m(n,d,(e,t)=>{if(e)return s(Error(e),null);let n=X(t.errors,c),r=X(t.warnings,c),i=1,a=()=>{if(--i===0){let e={warnings:r,code:t.code,map:t.map,mangleCache:void 0,legalComments:void 0};`legalComments`in t&&(e.legalComments=t?.legalComments),t.mangleCache&&(e.mangleCache=t?.mangleCache),s(null,e)}};if(n.length>0)return s(Y(`Transform failed`,n,r),null);t.codeFS&&(i++,o.readFile(t.code,(e,n)=>{e===null?(t.code=n,a()):s(e,null)})),t.mapFS&&(i++,o.readFile(t.map,(e,n)=>{e===null?(t.map=n,a()):s(e,null)})),a()})}catch(t){let r=[];try{H(r,i,{},a,C)}catch{}let o=J(t,e,c,void 0,``);m(n,{command:`error`,flags:r,error:o},()=>{o.detail=c.load(o.detail),s(Y(`Transform failed`,[o],[]),null)})}};if((typeof r==`string`||r instanceof Uint8Array)&&r.length>1048576){let e=l;l=()=>o.writeFile(r,e)}l(null)},formatMessages:({callName:e,refs:t,messages:n,options:r,callback:i})=>{if(!r)throw Error(`Missing second argument in ${e}() call`);let a={},o=z(r,a,`kind`,D),s=z(r,a,`color`,E),c=z(r,a,`terminalWidth`,k),l=z(r,a,`logStyle`,D);if(B(r,a,`in ${e}() call`),o===void 0)throw Error(`Missing "kind" in ${e}() call`);if(o!==`error`&&o!==`warning`)throw Error(`Expected "kind" to be "error" or "warning" in ${e}() call`);let u={command:`format-msgs`,messages:Z(n,`messages`,null,``,c),isWarning:o===`warning`};s!==void 0&&(u.color=s),c!==void 0&&(u.terminalWidth=c),l!==void 0&&(u.logStyle=l),m(t,u,(e,t)=>{if(e)return i(Error(e),null);i(null,t.messages)})},analyzeMetafile:({callName:e,refs:t,metafile:n,options:r,callback:i})=>{r===void 0&&(r={});let a={},o=z(r,a,`color`,E),s=z(r,a,`verbose`,E);B(r,a,`in ${e}() call`);let c={command:`analyze-metafile`,metafile:n};o!==void 0&&(c.color=o),s!==void 0&&(c.verbose=s),m(t,c,(e,t)=>{if(e)return i(Error(e),null);i(null,t.result)})}}}}function oe(e,t,n,r,i,a,o,s,c,l,u){let d=ce(),f=e===`context`,p=(e,t)=>{let r=[];try{H(r,s,{},c,S)}catch{}let o=J(e,a,d,void 0,t);n(i,{command:`error`,flags:r,error:o},()=>{o.detail=d.load(o.detail),u(Y(f?`Context failed`:`Build failed`,[o],[]),null)})},h;if(typeof s==`object`){let e=s.plugins;if(e!==void 0){if(!Array.isArray(e))return p(Error(`"plugins" must be an array`),``);h=e}}if(h&&h.length>0){if(a.isSync)return p(Error(`Cannot use plugins in synchronous API calls`),``);se(t,n,r,i,a,o,s,h,d).then(e=>{if(!e.ok)return p(e.error,e.pluginName);try{g(e.requestPlugins,e.runOnEndCallbacks,e.scheduleOnDisposeCallbacks)}catch(e){p(e,``)}},e=>p(e,``));return}try{g(null,(e,t)=>t([],[]),()=>{})}catch(e){p(e,``)}function g(p,h,g){let{entries:_,flags:v,write:y,stdinContents:b,stdinResolveDir:x,absWorkingDir:C,nodePaths:w,mangleCache:T}=W(e,s,c,S,a.hasFS);if(y&&!a.hasFS)throw Error(`The "write" option is unavailable in this environment`);let E={command:`build`,key:t,entries:_,flags:v,write:y,stdinContents:b,stdinResolveDir:x,absWorkingDir:C||l,nodePaths:w,context:f};p&&(E.plugins=p),T&&(E.mangleCache=T);let O=(e,t)=>{let n={errors:X(e.errors,d),warnings:X(e.warnings,d),outputFiles:void 0,metafile:void 0,mangleCache:void 0},r=n.errors.slice(),i=n.warnings.slice();e.outputFiles&&(n.outputFiles=e.outputFiles.map(fe)),e.metafile&&e.metafile.length&&(n.metafile=me(e.metafile)),e.mangleCache&&(n.mangleCache=e.mangleCache),e.writeToStdout!==void 0&&console.log(m(e.writeToStdout).replace(/\n$/,``)),h(n,(e,a)=>{if(r.length>0||e.length>0)return t(Y(`Build failed`,r.concat(e),i.concat(a)),null,e,a);t(null,n,e,a)})},M,N;f&&(o[`on-end`]=(e,t)=>new Promise(n=>{O(t,(t,i,a,o)=>{let s={errors:a,warnings:o};N&&N(t,i),M=void 0,N=void 0,r(e,s),n()})})),n(i,E,(e,s)=>{if(e)return u(Error(e),null);if(!f)return O(s,(e,t)=>(g(),u(e,t)));if(s.errors.length>0)return u(Y(`Context failed`,s.errors,s.warnings),null);let c=!1;i.ref(),u(null,{rebuild:()=>(M||=new Promise((e,r)=>{let a;N=(t,n)=>{a||=()=>t?r(t):e(n)};let o=()=>{n(i,{command:`rebuild`,key:t},(e,t)=>{e?r(Error(e)):a?a():o()})};o()}),M),watch:(e={})=>new Promise((r,o)=>{if(!a.hasFS)throw Error(`Cannot use the "watch" API in this environment`);let s={},c=z(e,s,`delay`,k);B(e,s,`in watch() call`);let l={command:`watch`,key:t};c&&(l.delay=c),n(i,l,e=>{e?o(Error(e)):r(void 0)})}),serve:(e={})=>new Promise((s,c)=>{if(!a.hasFS)throw Error(`Cannot use the "serve" API in this environment`);let l={},u=z(e,l,`port`,A),d=z(e,l,`host`,D),f=z(e,l,`servedir`,D),p=z(e,l,`keyfile`,D),m=z(e,l,`certfile`,D),h=z(e,l,`fallback`,D),g=z(e,l,`cors`,P),_=z(e,l,`onRequest`,j);B(e,l,`in serve() call`);let v={command:`serve`,key:t,onRequest:!!_};if(u!==void 0&&(v.port=u),d!==void 0&&(v.host=d),f!==void 0&&(v.servedir=f),p!==void 0&&(v.keyfile=p),m!==void 0&&(v.certfile=m),h!==void 0&&(v.fallback=h),g){let e={},t=z(g,e,`origin`,ne);B(g,e,`on "cors" object`),Array.isArray(t)?v.corsOrigin=t:t!==void 0&&(v.corsOrigin=[t])}n(i,v,(e,t)=>{if(e)return c(Error(e));_&&(o[`serve-request`]=(e,t)=>{_(t.args),r(e,{})}),s(t)})}),cancel:()=>new Promise(e=>{if(c)return e();n(i,{command:`cancel`,key:t},()=>{e()})}),dispose:()=>new Promise(e=>{if(c)return e();c=!0,n(i,{command:`dispose`,key:t},()=>{e(),g(),i.unref()})})})})}}var se=(e,t,n,r,i,a,o,s,l)=>c(null,null,function*(){let u=[],d=[],f={},m={},h=[],g=0,_=0,v=[],y=!1;s=[...s];for(let n of s){let a={};if(typeof n!=`object`)throw Error(`Plugin at index ${_} must be an object`);let s=z(n,a,`name`,D);if(typeof s!=`string`||s===``)throw Error(`Plugin at index ${_} is missing a name`);try{let c=z(n,a,`setup`,j);if(typeof c!=`function`)throw Error(`Plugin is missing a setup function`);B(n,a,`on plugin ${x(s)}`);let p={name:s,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};_++;let b=c({initialOptions:o,resolve:(n,i={})=>{if(!y)throw Error(`Cannot call "resolve" before plugin setup has completed`);if(typeof n!=`string`)throw Error(`The path to resolve must be a string`);let a=Object.create(null),o=z(i,a,`pluginName`,D),c=z(i,a,`importer`,D),u=z(i,a,`namespace`,D),d=z(i,a,`resolveDir`,D),f=z(i,a,`kind`,D),p=z(i,a,`pluginData`,T),m=z(i,a,`with`,P);return B(i,a,`in resolve() call`),new Promise((i,a)=>{let h={command:`resolve`,path:n,key:e,pluginName:s};if(o!=null&&(h.pluginName=o),c!=null&&(h.importer=c),u!=null&&(h.namespace=u),d!=null&&(h.resolveDir=d),f!=null)h.kind=f;else throw Error(`Must specify "kind" when calling "resolve"`);p!=null&&(h.pluginData=l.store(p)),m!=null&&(h.with=de(m,`with`)),t(r,h,(e,t)=>{e===null?i({errors:X(t.errors,l),warnings:X(t.warnings,l),path:t.path,external:t.external,sideEffects:t.sideEffects,namespace:t.namespace,suffix:t.suffix,pluginData:l.load(t.pluginData)}):a(Error(e))})})},onStart(e){let t=q(Error(`This error came from the "onStart" callback registered here:`),i,`onStart`);u.push({name:s,callback:e,note:t}),p.onStart=!0},onEnd(e){let t=q(Error(`This error came from the "onEnd" callback registered here:`),i,`onEnd`);d.push({name:s,callback:e,note:t}),p.onEnd=!0},onResolve(e,t){let n=q(Error(`This error came from the "onResolve" callback registered here:`),i,`onResolve`),r={},a=z(e,r,`filter`,O),o=z(e,r,`namespace`,D);if(B(e,r,`in onResolve() call for plugin ${x(s)}`),a==null)throw Error(`onResolve() call is missing a filter`);let c=g++;f[c]={name:s,callback:t,note:n},p.onResolve.push({id:c,filter:pe(a),namespace:o||``})},onLoad(e,t){let n=q(Error(`This error came from the "onLoad" callback registered here:`),i,`onLoad`),r={},a=z(e,r,`filter`,O),o=z(e,r,`namespace`,D);if(B(e,r,`in onLoad() call for plugin ${x(s)}`),a==null)throw Error(`onLoad() call is missing a filter`);let c=g++;m[c]={name:s,callback:t,note:n},p.onLoad.push({id:c,filter:pe(a),namespace:o||``})},onDispose(e){h.push(e)},esbuild:i.esbuild});b&&(yield b),v.push(p)}catch(e){return{ok:!1,error:e,pluginName:s}}}a[`on-start`]=(e,t)=>c(null,null,function*(){l.clear();let t={errors:[],warnings:[]};yield Promise.all(u.map(e=>c(null,[e],function*({name:e,callback:n,note:r}){try{let r=yield n();if(r!=null){if(typeof r!=`object`)throw Error(`Expected onStart() callback in plugin ${x(e)} to return an object`);let n={},i=z(r,n,`errors`,M),a=z(r,n,`warnings`,M);B(r,n,`from onStart() callback in plugin ${x(e)}`),i!=null&&t.errors.push(...Z(i,`errors`,l,e,void 0)),a!=null&&t.warnings.push(...Z(a,`warnings`,l,e,void 0))}}catch(n){t.errors.push(J(n,i,l,r&&r(),e))}}))),n(e,t)}),a[`on-resolve`]=(e,t)=>c(null,null,function*(){let r={},a=``,o,s;for(let e of t.ids)try{({name:a,callback:o,note:s}=f[e]);let n=yield o({path:t.path,importer:t.importer,namespace:t.namespace,resolveDir:t.resolveDir,kind:t.kind,pluginData:l.load(t.pluginData),with:t.with});if(n!=null){if(typeof n!=`object`)throw Error(`Expected onResolve() callback in plugin ${x(a)} to return an object`);let t={},i=z(n,t,`pluginName`,D),o=z(n,t,`path`,D),s=z(n,t,`namespace`,D),c=z(n,t,`suffix`,D),u=z(n,t,`external`,E),d=z(n,t,`sideEffects`,E),f=z(n,t,`pluginData`,T),p=z(n,t,`errors`,M),m=z(n,t,`warnings`,M),h=z(n,t,`watchFiles`,N),g=z(n,t,`watchDirs`,N);B(n,t,`from onResolve() callback in plugin ${x(a)}`),r.id=e,i!=null&&(r.pluginName=i),o!=null&&(r.path=o),s!=null&&(r.namespace=s),c!=null&&(r.suffix=c),u!=null&&(r.external=u),d!=null&&(r.sideEffects=d),f!=null&&(r.pluginData=l.store(f)),p!=null&&(r.errors=Z(p,`errors`,l,a,void 0)),m!=null&&(r.warnings=Z(m,`warnings`,l,a,void 0)),h!=null&&(r.watchFiles=Q(h,`watchFiles`)),g!=null&&(r.watchDirs=Q(g,`watchDirs`));break}}catch(t){r={id:e,errors:[J(t,i,l,s&&s(),a)]};break}n(e,r)}),a[`on-load`]=(e,t)=>c(null,null,function*(){let r={},a=``,o,s;for(let e of t.ids)try{({name:a,callback:o,note:s}=m[e]);let n=yield o({path:t.path,namespace:t.namespace,suffix:t.suffix,pluginData:l.load(t.pluginData),with:t.with});if(n!=null){if(typeof n!=`object`)throw Error(`Expected onLoad() callback in plugin ${x(a)} to return an object`);let t={},i=z(n,t,`pluginName`,D),o=z(n,t,`contents`,re),s=z(n,t,`resolveDir`,D),c=z(n,t,`pluginData`,T),u=z(n,t,`loader`,D),d=z(n,t,`errors`,M),f=z(n,t,`warnings`,M),m=z(n,t,`watchFiles`,N),h=z(n,t,`watchDirs`,N);B(n,t,`from onLoad() callback in plugin ${x(a)}`),r.id=e,i!=null&&(r.pluginName=i),o instanceof Uint8Array?r.contents=o:o!=null&&(r.contents=p(o)),s!=null&&(r.resolveDir=s),c!=null&&(r.pluginData=l.store(c)),u!=null&&(r.loader=u),d!=null&&(r.errors=Z(d,`errors`,l,a,void 0)),f!=null&&(r.warnings=Z(f,`warnings`,l,a,void 0)),m!=null&&(r.watchFiles=Q(m,`watchFiles`)),h!=null&&(r.watchDirs=Q(h,`watchDirs`));break}}catch(t){r={id:e,errors:[J(t,i,l,s&&s(),a)]};break}n(e,r)});let b=(e,t)=>t([],[]);return d.length>0&&(b=(e,t)=>{c(null,null,function*(){let n=[],r=[];for(let{name:t,callback:a,note:o}of d){let s,c;try{let n=yield a(e);if(n!=null){if(typeof n!=`object`)throw Error(`Expected onEnd() callback in plugin ${x(t)} to return an object`);let e={},r=z(n,e,`errors`,M),i=z(n,e,`warnings`,M);B(n,e,`from onEnd() callback in plugin ${x(t)}`),r!=null&&(s=Z(r,`errors`,l,t,void 0)),i!=null&&(c=Z(i,`warnings`,l,t,void 0))}}catch(e){s=[J(e,i,l,o&&o(),t)]}if(s){n.push(...s);try{e.errors.push(...s)}catch{}}if(c){r.push(...c);try{e.warnings.push(...c)}catch{}}}t(n,r)})}),y=!0,{ok:!0,requestPlugins:v,runOnEndCallbacks:b,scheduleOnDisposeCallbacks:()=>{for(let e of h)setTimeout(()=>e(),0)}}});function ce(){let e=new Map,t=0;return{clear(){e.clear()},load(t){return e.get(t)},store(n){if(n===void 0)return-1;let r=t++;return e.set(r,n),r}}}function q(e,t,n){let r,i=!1;return()=>{if(i)return r;i=!0;try{let i=(e.stack+``).split(`
8
+ `);i.splice(1,1);let a=le(t,i,n);if(a)return r={text:e.message,location:a},r}catch{}}}function J(e,t,n,r,i){let a=`Internal error`,o=null;try{a=(e&&e.message||e)+``}catch{}try{o=le(t,(e.stack+``).split(`
9
+ `),``)}catch{}return{id:``,pluginName:i,text:a,location:o,notes:r?[r]:[],detail:n?n.store(e):-1}}function le(e,t,n){let r=` at `;if(e.readFileSync&&!t[0].startsWith(r)&&t[1].startsWith(r))for(let i=1;i<t.length;i++){let a=t[i];if(a.startsWith(r))for(a=a.slice(7);;){let r=/^(?:new |async )?\S+ \((.*)\)$/.exec(a);if(r)a=r[1];else if(r=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(a),r)a=r[1];else{if(r=/^(\S+):(\d+):(\d+)$/.exec(a),r){let i;try{i=e.readFileSync(r[1],`utf8`)}catch{break}let a=i.split(/\r\n|\r|\n|\u2028|\u2029/)[r[2]-1]||``,o=r[3]-1,s=a.slice(o,o+n.length)===n?n.length:0;return{file:r[1],namespace:`file`,line:+r[2],column:p(a.slice(0,o)).length,length:p(a.slice(o,o+s)).length,lineText:a+`
10
10
  `+t.slice(1).join(`
11
- `),suggestion:``}}break}}}return null}function J(e,t,n){e+=t.length<1?``:` with ${t.length} error${t.length<2?``:`s`}:`+t.slice(0,6).map((e,t)=>{if(t===5)return`
11
+ `),suggestion:``}}break}}}return null}function Y(e,t,n){e+=t.length<1?``:` with ${t.length} error${t.length<2?``:`s`}:`+t.slice(0,6).map((e,t)=>{if(t===5)return`
12
12
  ...`;if(!e.location)return`
13
13
  error: ${e.text}`;let{file:n,line:r,column:i}=e.location;return`
14
- ${n}:${r}:${i}: ERROR: ${e.pluginName?`[plugin: ${e.pluginName}] `:``}${e.text}`}).join(``);let r=Error(e);for(let[e,i]of[[`errors`,t],[`warnings`,n]])Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:()=>i,set:t=>Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:t})});return r}function Y(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function de(e,t,n){if(e==null)return null;let r={},i=z(e,r,`file`,D),a=z(e,r,`namespace`,D),o=z(e,r,`line`,k),s=z(e,r,`column`,k),c=z(e,r,`length`,k),l=z(e,r,`lineText`,D),u=z(e,r,`suggestion`,D);if(B(e,r,t),l){let e=l.slice(0,(s&&s>0?s:0)+(c&&c>0?c:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(e)&&!/\n/.test(l)&&(l=e)}return{file:i||``,namespace:a||``,line:o||0,column:s||0,length:c||0,lineText:l||``,suggestion:u||``}}function X(e,t,n,r,i){let a=[],o=0;for(let s of e){let e={},c=z(s,e,`id`,D),l=z(s,e,`pluginName`,D),u=z(s,e,`text`,D),d=z(s,e,`location`,I),f=z(s,e,`notes`,M),p=z(s,e,`detail`,T),m=`in element ${o} of "${t}"`;B(s,e,m);let h=[];if(f)for(let e of f){let t={},n=z(e,t,`text`,D),r=z(e,t,`location`,I);B(e,t,m),h.push({text:n||``,location:de(r,m,i)})}a.push({id:c||``,pluginName:l||r,text:u||``,location:de(d,m,i),notes:h,detail:n?n.store(p):-1}),o++}return a}function Z(e,t){let n=[];for(let r of e){if(typeof r!=`string`)throw Error(`${x(t)} must be an array of strings`);n.push(r)}return n}function fe(e,t){let n=Object.create(null);for(let r in e){let i=e[r];if(typeof i!=`string`)throw Error(`key ${x(r)} in object ${x(t)} must be a string`);n[r]=i}return n}function pe({path:e,contents:t,hash:n}){let r=null;return{path:e,contents:t,hash:n,get text(){let e=this.contents;return(r===null||e!==t)&&(t=e,r=m(e)),r}}}function Q(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}function me(e){let t;try{t=m(e)}catch{return b(e)}return JSON.parse(t)}var he=`0.28.2`,ge=e=>Oe().build(e),_e=e=>Oe().context(e),ve=(e,t)=>Oe().transform(e,t),ye=(e,t)=>Oe().formatMessages(e,t),be=(e,t)=>Oe().analyzeMetafile(e,t),xe=()=>{throw Error(`The "buildSync" API only works in node`)},Se=()=>{throw Error(`The "transformSync" API only works in node`)},Ce=()=>{throw Error(`The "formatMessagesSync" API only works in node`)},we=()=>{throw Error(`The "analyzeMetafileSync" API only works in node`)},Te=()=>(Ee&&Ee(),Promise.resolve()),$,Ee,De,Oe=()=>{if(De)return De;throw Error($?`You need to wait for the promise returned from "initialize" to be resolved before calling this`:`You need to call "initialize" before calling this`)},ke=e=>{e=V(e||{});let t=e.wasmURL,n=e.wasmModule,r=e.worker!==!1;if(!t&&!n)throw Error(`Must provide either the "wasmURL" option or the "wasmModule" option`);if($)throw Error(`Cannot call "initialize" more than once`);return $=Ae(t||``,n,r),$.catch(()=>{$=void 0}),$},Ae=(e,t,n)=>c(null,null,function*(){let r,i,a=new Promise(e=>i=e);if(n){let e=new Blob([`onmessage=((postMessage) => {
14
+ ${n}:${r}:${i}: ERROR: ${e.pluginName?`[plugin: ${e.pluginName}] `:``}${e.text}`}).join(``);let r=Error(e);for(let[e,i]of[[`errors`,t],[`warnings`,n]])Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:()=>i,set:t=>Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:t})});return r}function X(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function ue(e,t,n){if(e==null)return null;let r={},i=z(e,r,`file`,D),a=z(e,r,`namespace`,D),o=z(e,r,`line`,k),s=z(e,r,`column`,k),c=z(e,r,`length`,k),l=z(e,r,`lineText`,D),u=z(e,r,`suggestion`,D);if(B(e,r,t),l){let e=l.slice(0,(s&&s>0?s:0)+(c&&c>0?c:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(e)&&!/\n/.test(l)&&(l=e)}return{file:i||``,namespace:a||``,line:o||0,column:s||0,length:c||0,lineText:l||``,suggestion:u||``}}function Z(e,t,n,r,i){let a=[],o=0;for(let s of e){let e={},c=z(s,e,`id`,D),l=z(s,e,`pluginName`,D),u=z(s,e,`text`,D),d=z(s,e,`location`,I),f=z(s,e,`notes`,M),p=z(s,e,`detail`,T),m=`in element ${o} of "${t}"`;B(s,e,m);let h=[];if(f)for(let e of f){let t={},n=z(e,t,`text`,D),r=z(e,t,`location`,I);B(e,t,m),h.push({text:n||``,location:ue(r,m,i)})}a.push({id:c||``,pluginName:l||r,text:u||``,location:ue(d,m,i),notes:h,detail:n?n.store(p):-1}),o++}return a}function Q(e,t){let n=[];for(let r of e){if(typeof r!=`string`)throw Error(`${x(t)} must be an array of strings`);n.push(r)}return n}function de(e,t){let n=Object.create(null);for(let r in e){let i=e[r];if(typeof i!=`string`)throw Error(`key ${x(r)} in object ${x(t)} must be a string`);n[r]=i}return n}function fe({path:e,contents:t,hash:n}){let r=null;return{path:e,contents:t,hash:n,get text(){let e=this.contents;return(r===null||e!==t)&&(t=e,r=m(e)),r}}}function pe(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}function me(e){let t;try{t=m(e)}catch{return b(e)}return JSON.parse(t)}var he=`0.28.2`,ge=e=>Oe().build(e),_e=e=>Oe().context(e),ve=(e,t)=>Oe().transform(e,t),ye=(e,t)=>Oe().formatMessages(e,t),be=(e,t)=>Oe().analyzeMetafile(e,t),xe=()=>{throw Error(`The "buildSync" API only works in node`)},Se=()=>{throw Error(`The "transformSync" API only works in node`)},Ce=()=>{throw Error(`The "formatMessagesSync" API only works in node`)},we=()=>{throw Error(`The "analyzeMetafileSync" API only works in node`)},Te=()=>(Ee&&Ee(),Promise.resolve()),$,Ee,De,Oe=()=>{if(De)return De;throw Error($?`You need to wait for the promise returned from "initialize" to be resolved before calling this`:`You need to call "initialize" before calling this`)},ke=e=>{e=V(e||{});let t=e.wasmURL,n=e.wasmModule,r=e.worker!==!1;if(!t&&!n)throw Error(`Must provide either the "wasmURL" option or the "wasmModule" option`);if($)throw Error(`Cannot call "initialize" more than once`);return $=Ae(t||``,n,r),$.catch(()=>{$=void 0}),$},Ae=(e,t,n)=>c(null,null,function*(){let r,i,a=new Promise(e=>i=e);if(n){let e=new Blob([`onmessage=((postMessage) => {
15
15
  // Copyright 2018 The Go Authors. All rights reserved.
16
16
  // Use of this source code is governed by a BSD-style
17
17
  // license that can be found in the LICENSE file.
@@ -692,5 +692,5 @@ ${n}:${r}:${i}: ERROR: ${e.pluginName?`[plugin: ${e.pluginName}] `:``}${e.text}`
692
692
  })(postMessage)`],{type:`text/javascript`});r=new Worker(URL.createObjectURL(e))}else{let e=(e=>{var t=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});let n,r={};for(let e=self;e;e=Object.getPrototypeOf(e))for(let t of Object.getOwnPropertyNames(e))t in r||Object.defineProperty(r,t,{get:()=>self[t]});(()=>{let e=()=>{let e=Error(`not implemented`);return e.code=`ENOSYS`,e};if(!r.fs){let t=``;r.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(e,n){t+=i.decode(n);let r=t.lastIndexOf(`
693
693
  `);return r!=-1&&(console.log(t.substring(0,r)),t=t.substring(r+1)),n.length},write(t,n,r,i,a,o){r!==0||i!==n.length||a!==null?o(e()):o(null,this.writeSync(t,n))},chmod(t,n,r){r(e())},chown(t,n,r,i){i(e())},close(t,n){n(e())},fchmod(t,n,r){r(e())},fchown(t,n,r,i){i(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,r){r(e())},lchown(t,n,r,i){i(e())},link(t,n,r){r(e())},lstat(t,n){n(e())},mkdir(t,n,r){r(e())},open(t,n,r,i){i(e())},read(t,n,r,i,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,r){r(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,r){r(e())},truncate(t,n,r){r(e())},unlink(t,n){n(e())},utimes(t,n,r,i){i(e())}}}if(r.process||={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}},r.path||={resolve(...e){return e.join(`/`)}},!r.crypto)throw Error(`globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)`);if(!r.performance)throw Error(`globalThis.performance is not available, polyfill required (performance.now only)`);if(!r.TextEncoder)throw Error(`globalThis.TextEncoder is not available, polyfill required`);if(!r.TextDecoder)throw Error(`globalThis.TextDecoder is not available, polyfill required`);let n=new TextEncoder(`utf-8`),i=new TextDecoder(`utf-8`);r.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;let e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},t=e=>this.mem.getUint32(e+0,!0)+this.mem.getInt32(e+4,!0)*4294967296,a=e=>{let t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;let n=this.mem.getUint32(e,!0);return this._values[n]},o=(e,t)=>{let n=0x7ff80000;if(typeof t==`number`&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,n,!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 r=this._ids.get(t);r===void 0&&(r=this._idPool.pop(),r===void 0&&(r=this._values.length),this._values[r]=t,this._goRefCounts[r]=0,this._ids.set(t,r)),this._goRefCounts[r]++;let i=0;switch(typeof t){case`object`:t!==null&&(i=1);break;case`string`:i=2;break;case`symbol`:i=3;break;case`function`:i=4}this.mem.setUint32(e+4,n|i,!0),this.mem.setUint32(e,r,!0)},s=e=>{let n=t(e+0),r=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,r)},c=e=>{let n=t(e+0),r=t(e+8),i=Array(r);for(let e=0;e<r;e++)i[e]=a(n+e*8);return i},l=e=>{let n=t(e+0),r=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,r))},u=(e,t)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(e,t)),d=Date.now()-performance.now();this.importObject={_gotest:{add:(e,t)=>e+t,callExport:u},gojs:{"runtime.wasmExit":e=>{e>>>=0;let 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;let n=t(e+8),i=t(e+16),a=this.mem.getInt32(e+24,!0);r.fs.writeSync(n,new Uint8Array(this._inst.exports.mem.buffer,i,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,e(t+8,(d+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;let n=new Date().getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;let n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn(`scheduleTimeoutEvent: missed timeout event`),this._resume()},t(e+8))),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(s(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;let t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){let e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,o(e+24,l(e+8))},"syscall/js.valueGet":e=>{e>>>=0;let t=Reflect.get(a(e+8),l(e+16));e=this._inst.exports.getsp()>>>0,o(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(a(e+8),l(e+16),a(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(a(e+8),l(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,o(e+24,Reflect.get(a(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(a(e+8),t(e+16),a(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{let t=a(e+8),n=Reflect.get(t,l(e+16)),r=c(e+32),i=Reflect.apply(n,t,r);e=this._inst.exports.getsp()>>>0,o(e+56,i),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,o(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{let t=a(e+8),n=c(e+16),r=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{let t=a(e+8),n=c(e+16),r=Reflect.construct(t,n);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,e(t+16,parseInt(a(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;let r=n.encode(String(a(t+8)));o(t+16,r),e(t+24,r.length)},"syscall/js.valueLoadString":e=>{e>>>=0;let t=a(e+8);s(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,+(a(e+8)instanceof a(e+16)))},"syscall/js.copyBytesToGo":t=>{t>>>=0;let n=s(t+8),r=a(t+32);if(!(r instanceof Uint8Array||r instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}let i=r.subarray(0,n.length);n.set(i),e(t+40,i.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;let n=a(t+8),r=s(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}let i=r.subarray(0,n.length);n.set(i),e(t+40,i.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}run(e){return t(this,null,function*(){if(!(e instanceof WebAssembly.Instance))throw Error(`Go.run: WebAssembly.Instance expected`);this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,r,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[r,5],[this,6]]),this._idPool=[],this.exited=!1;let t=4096,i=e=>{let r=t,i=n.encode(e+`\0`);return new Uint8Array(this.mem.buffer,t,i.length).set(i),t+=i.length,t%8!=0&&(t+=8-t%8),r},a=this.argv.length,o=[];this.argv.forEach(e=>{o.push(i(e))}),o.push(0),Object.keys(this.env).sort().forEach(e=>{o.push(i(`${e}=${this.env[e]}`))}),o.push(0);let s=t;if(o.forEach(e=>{this.mem.setUint32(t,e,!0),this.mem.setUint32(t+4,0,!0),t+=8}),t>=12288)throw Error(`total length of command line and environment variables exceeds limit`);this._inst.exports.run(a,s),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw Error(`Go program has already exited`);this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){let t=this;return function(){let n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}}})(),n=({data:t})=>{let a=new TextDecoder,o=r.fs,s=``;o.writeSync=(t,n)=>{if(t===1)e(n);else if(t===2){s+=a.decode(n);let e=s.split(`
694
694
  `);e.length>1&&console.log(e.slice(0,-1).join(`
695
- `)),s=e[e.length-1]}else throw Error(`Bad write`);return n.length};let c=[],l,u=0;n=({data:e})=>(e.length>0&&(c.push(e),l&&l()),d),o.read=(e,t,n,r,i,a)=>{if(e!==0||n!==0||r!==t.length||i!==null)throw Error(`Bad read`);if(c.length===0){l=()=>o.read(e,t,n,r,i,a);return}let s=c[0],d=Math.max(0,Math.min(r,s.length-u));t.set(s.subarray(u,u+d),n),u+=d,u===s.length&&(c.shift(),u=0),a(null,d)};let d=new r.Go;return d.argv=[``,`--service=0.28.2`],i(t,d).then(t=>{e(null),d.run(t)},t=>{e(t)}),d};function i(e,n){return t(this,null,function*(){if(e instanceof WebAssembly.Module)return WebAssembly.instantiate(e,n.importObject);let t=yield fetch(e);if(!t.ok)throw Error(`Failed to download ${JSON.stringify(e)}`);if(`instantiateStreaming`in WebAssembly&&/^application\/wasm($|;)/i.test(t.headers.get(`Content-Type`)||``))return(yield WebAssembly.instantiateStreaming(t,n.importObject)).instance;let r=yield t.arrayBuffer();return(yield WebAssembly.instantiate(r,n.importObject)).instance})}return e=>n(e)})(e=>r.onmessage({data:e})),t;r={onmessage:null,postMessage:n=>setTimeout(()=>{try{t=e({data:n})}catch(e){i(e)}}),terminate(){if(t)for(let e of t._scheduledTimeouts.values())clearTimeout(e)}}}let o,s,c=new Promise((e,t)=>{o=e,s=t});r.onmessage=({data:e})=>{r.onmessage=({data:e})=>u(e),e?s(e):o()},r.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:u,service:d}=W({writeToStdin(e){r.postMessage(e)},isSync:!1,hasFS:!1,esbuild:l});yield c,Ee=()=>{r.terminate(),$=void 0,Ee=void 0,De=void 0},De={build:e=>new Promise((t,n)=>{a.then(n),d.buildOrContext({callName:`build`,refs:null,options:e,isTTY:!1,defaultWD:`/`,callback:(e,r)=>e?n(e):t(r)})}),context:e=>new Promise((t,n)=>{a.then(n),d.buildOrContext({callName:`context`,refs:null,options:e,isTTY:!1,defaultWD:`/`,callback:(e,r)=>e?n(e):t(r)})}),transform:(e,t)=>new Promise((n,r)=>{a.then(r),d.transform({callName:`transform`,refs:null,input:e,options:t||{},isTTY:!1,fs:{readFile(e,t){t(Error(`Internal error`),null)},writeFile(e,t){t(null)}},callback:(e,t)=>e?r(e):n(t)})}),formatMessages:(e,t)=>new Promise((n,r)=>{a.then(r),d.formatMessages({callName:`formatMessages`,refs:null,messages:e,options:t,callback:(e,t)=>e?r(e):n(t)})}),analyzeMetafile:(e,t)=>new Promise((n,r)=>{a.then(r),d.analyzeMetafile({callName:`analyzeMetafile`,refs:null,metafile:typeof e==`string`?e:JSON.stringify(e),options:t,callback:(e,t)=>e?r(e):n(t)})})}}),je=l})(typeof t==`object`?t:{set exports(e){(typeof self<`u`?self:this).esbuild=e}})}))(),1),h=`/assets/esbuild-BaXVPFT2.wasm`,g=44,_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,v=new Uint8Array(64),y=new Uint8Array(128);for(let e=0;e<_.length;e++){let t=_.charCodeAt(e);v[e]=t,y[t]=e}function b(e){let t=0,n=0,r=0;do r=y[e.next()],t|=(r&31)<<n,n+=5;while(r&32);return t}function x(e){return e&1?-0x80000000|-(e>>>1):e>>>1}function S(e,t){return e.pos>=t?!1:e.peek()!==g}var C=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function w(e){let{length:t}=e,n=new C(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i+=x(b(n)),i<u&&(l=!1),u=i,S(n,e)?(a+=x(b(n)),o+=x(b(n)),s+=x(b(n)),S(n,e)?(c+=x(b(n)),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||T(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function T(e){e.sort(E)}function E(e,t){return e[0]-t[0]}var D=e(t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=i())})(n,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?(\[[^\]]+\]|[^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path=e.path===`/`?t.path:f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];t?(o=!1,t!==`.`&&(t===`..`?a?(o=!0,a--,i--):n&&(r[i++]=t):(r[i++]=t,a++))):o=!0}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))(),1);function O(e){if(!e)return``;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function k(e,t){let n=O(e),r=t?t+`/`:``;return e=>(0,D.default)(r+(e||``),n)}var A=0,j=1,M=2,N=3,P=4;function ee(e,t){let n=F(e,0);if(n===e.length)return e;t||(e=e.slice());for(let r=n;r<e.length;r=F(e,r+1))e[r]=L(e[r],t);return e}function F(e,t){for(let n=t;n<e.length;n++)if(!I(e[n]))return n;return e.length}function I(e){for(let t=1;t<e.length;t++)if(e[t][A]<e[t-1][A])return!1;return!0}function L(e,t){return t||(e=e.slice()),e.sort(te)}function te(e,t){return e[A]-t[A]}var R=!1;function ne(e,t,n,r){for(;n<=r;){let i=n+(r-n>>1),a=e[i][A]-t;if(a===0)return R=!0,i;a<0?n=i+1:r=i-1}return R=!1,n-1}function re(e,t,n){for(let r=n+1;r<e.length&&e[r][A]===t;n=r++);return n}function z(e,t,n){for(let r=n-1;r>=0&&e[r][A]===t;n=r--);return n}function B(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function V(e,t,n,r){let{lastKey:i,lastNeedle:a,lastIndex:o}=n,s=0,c=e.length-1;if(r===i){if(t===a)return R=o!==-1&&e[o][A]===t,o;t>=a?s=o===-1?0:o:c=o}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=ne(e,t,s,c)}function ie(e){return typeof e==`string`?JSON.parse(e):e}var ae="`line` must be greater than 0 (lines start at line 1)",H="`column` must be greater than or equal to 0 (columns start at column 0)",oe=class{constructor(e,t){let n=typeof e==`string`;if(!n&&e._decodedMemo)return e;let r=ie(e),{version:i,file:a,names:o,sourceRoot:s,sources:c,sourcesContent:l}=r;this.version=i,this.file=a,this.names=o||[],this.sourceRoot=s,this.sources=c,this.sourcesContent=l,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;let u=k(t,s);this.resolvedSources=c.map(u);let{mappings:d}=r;if(typeof d==`string`)this._encoded=d,this._decoded=void 0;else if(Array.isArray(d))this._encoded=void 0,this._decoded=ee(d,n);else if(r.sections)throw Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);else throw Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=B(),this._bySources=void 0,this._bySourceMemos=void 0}};function U(e){return e}function se(e){var t;return(t=U(e))._decoded||(t._decoded=w(U(e)._encoded))}function W(e,t){let{line:n,column:r,bias:i}=t;if(n--,n<0)throw Error(ae);if(r<0)throw Error(H);let a=se(e);if(n>=a.length)return G(null,null,null,null);let o=a[n],s=ce(o,U(e)._decodedMemo,n,r,i||1);if(s===-1)return G(null,null,null,null);let c=o[s];if(c.length===1)return G(null,null,null,null);let{names:l,resolvedSources:u}=e;return G(u[c[j]],c[M]+1,c[N],c.length===5?l[c[P]]:null)}function G(e,t,n,r){return{source:e,line:t,column:n,name:r}}function ce(e,t,n,r,i){let a=V(e,r,t,n);return R?a=(i===-1?re:z)(e,r,a):i===-1&&a++,a===-1||a===e.length?-1:a}var le=new Map;function K(e,t,n){le.set(e,{map:new oe(t),prefix:n})}function q(e,t,n){let r=le.get(e);if(!r)return{file:e,line:t,column:n};let i=W(r.map,{line:t,column:n-1});return i.source===null||i.line===null||i.column===null?{file:e,line:t,column:n}:{file:i.source.startsWith(r.prefix)?i.source.slice(r.prefix.length):i.source,line:i.line,column:i.column+1}}var ue=c(q),J=()=>void 0;function Y(e){let t=J,r=0,i=new Map;return e.then(e=>{e.addEventListener(`message`,r=>{let a=r.data;if(a.kind===`download`){t(a.step);return}if(a.kind===`error`)throw e.close(),new n(`the narrator stopped: ${a.message}`,a.stack);let o=i.get(a.id);i.delete(a.id),o?.({samples:a.samples,sampleRate:a.sampleRate,words:a.words})}),e.start()}),{speak:async(t,n)=>{let a=await e;return new Promise(e=>{let o=r++;i.set(o,e),a.postMessage({id:o,text:t,speed:n})})},time:async(e,t)=>{await p();let n=a([{text:e,spoken:e,kind:`paragraph`,leadIn:0,pause:0,speed:t}]);return{samples:n.endFrame,sampleRate:n.sampleRate,words:[]}},onDownload:e=>{t=e}}}function de(e){let t=0,n=new Map,i=r=>{let i=t++,{promise:a,resolve:o}=Promise.withResolvers();return n.set(i,o),e.post({kind:`files`,id:i,question:r},[]),a},a={name:async()=>{let e=await i({kind:`name`});if(e.kind!==`name`)throw Error(`the page answered ${e.kind} to a question of the name`);return e.name},read:async e=>{let t=await i({kind:`read`,path:e});if(t.kind!==`read`)throw Error(`the page answered ${t.kind} to a read of ${e}`);return t.text},list:async e=>{let t=await i({kind:`list`,folder:e});if(t.kind!==`list`)throw Error(`the page answered ${t.kind} to a list of ${e}`);return t.names}},c=async()=>{let t=await a.name();if(t===null)return{_tag:`Right`,right:[]};let n={name:()=>Promise.resolve(t),read:a.read,list:a.list};return f(n,r(ue),e.modules,await e.esbuild(),e.player)},u=Promise.withResolvers(),p=d(s.create({voice:Y(u.promise),workspace:{projects:c}})),m=[],h=(t,{chapters:n,...r})=>{let i=[],a=[];n.forEach((e,t)=>{if(e===m[t])return;if(!e){i.push([t,void 0]);return}let{animation:n,...r}=e,s=e.samples.slice();a.push(s.buffer),i.push([t,{...r,samples:s,lottie:o(n)}])}),m=n;let s={...r,errors:l(r.errors),warnings:l(r.warnings)};e.post({kind:`state`,watch:t,state:s,count:n.length,chapters:i},a)};return t=>{switch(t.kind){case`list`:p.build.list().then(n=>{let r=n._tag===`Left`?{_tag:`Left`,left:l(n.left)}:n;e.post({kind:`listed`,id:t.id,videos:r},[])});return;case`watch`:m=[],p.build.watch(t.name,{changed:e=>{h(t.watch,e)}});return;case`seek`:p.build.seek(t.name,t.seconds);return;case`refresh`:p.refresh(t.seconds);return;case`files`:{let e=n.get(t.id);n.delete(t.id),e?.(t.answer);return}case`narrator`:u.resolve(t.port);return}}}var X=(e,t=[])=>{self.postMessage(e,{transfer:t})},Z=e=>{let t=u(e,ue);X({kind:`error`,message:t.message,stack:t.stack.map(e=>` ${e}`).join(`
696
- `)})};self.addEventListener(`error`,e=>{e.preventDefault(),Z(e.error??Error(e.message))}),self.addEventListener(`unhandledrejection`,e=>{e.preventDefault(),Z(e.reason)});var fe={"@beff/aula":new URL(`./aula.js`,import.meta.url).href,"@beff/aula-method":new URL(`./aula-method.js`,import.meta.url).href},pe={load:async({code:e,map:t})=>{let n=URL.createObjectURL(new Blob([e],{type:`text/javascript`}));return K(n,t,i),{url:n,exports:await import(n)}}},Q=null,me=de({post:X,esbuild:async()=>(Q??=m.initialize({wasmURL:h,worker:!1}),await Q,m),modules:pe,player:fe});self.addEventListener(`message`,e=>{me(e.data)});
695
+ `)),s=e[e.length-1]}else throw Error(`Bad write`);return n.length};let c=[],l,u=0;n=({data:e})=>(e.length>0&&(c.push(e),l&&l()),d),o.read=(e,t,n,r,i,a)=>{if(e!==0||n!==0||r!==t.length||i!==null)throw Error(`Bad read`);if(c.length===0){l=()=>o.read(e,t,n,r,i,a);return}let s=c[0],d=Math.max(0,Math.min(r,s.length-u));t.set(s.subarray(u,u+d),n),u+=d,u===s.length&&(c.shift(),u=0),a(null,d)};let d=new r.Go;return d.argv=[``,`--service=0.28.2`],i(t,d).then(t=>{e(null),d.run(t)},t=>{e(t)}),d};function i(e,n){return t(this,null,function*(){if(e instanceof WebAssembly.Module)return WebAssembly.instantiate(e,n.importObject);let t=yield fetch(e);if(!t.ok)throw Error(`Failed to download ${JSON.stringify(e)}`);if(`instantiateStreaming`in WebAssembly&&/^application\/wasm($|;)/i.test(t.headers.get(`Content-Type`)||``))return(yield WebAssembly.instantiateStreaming(t,n.importObject)).instance;let r=yield t.arrayBuffer();return(yield WebAssembly.instantiate(r,n.importObject)).instance})}return e=>n(e)})(e=>r.onmessage({data:e})),t;r={onmessage:null,postMessage:n=>setTimeout(()=>{try{t=e({data:n})}catch(e){i(e)}}),terminate(){if(t)for(let e of t._scheduledTimeouts.values())clearTimeout(e)}}}let o,s,c=new Promise((e,t)=>{o=e,s=t});r.onmessage=({data:e})=>{r.onmessage=({data:e})=>u(e),e?s(e):o()},r.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:u,service:d}=K({writeToStdin(e){r.postMessage(e)},isSync:!1,hasFS:!1,esbuild:l});yield c,Ee=()=>{r.terminate(),$=void 0,Ee=void 0,De=void 0},De={build:e=>new Promise((t,n)=>{a.then(n),d.buildOrContext({callName:`build`,refs:null,options:e,isTTY:!1,defaultWD:`/`,callback:(e,r)=>e?n(e):t(r)})}),context:e=>new Promise((t,n)=>{a.then(n),d.buildOrContext({callName:`context`,refs:null,options:e,isTTY:!1,defaultWD:`/`,callback:(e,r)=>e?n(e):t(r)})}),transform:(e,t)=>new Promise((n,r)=>{a.then(r),d.transform({callName:`transform`,refs:null,input:e,options:t||{},isTTY:!1,fs:{readFile(e,t){t(Error(`Internal error`),null)},writeFile(e,t){t(null)}},callback:(e,t)=>e?r(e):n(t)})}),formatMessages:(e,t)=>new Promise((n,r)=>{a.then(r),d.formatMessages({callName:`formatMessages`,refs:null,messages:e,options:t,callback:(e,t)=>e?r(e):n(t)})}),analyzeMetafile:(e,t)=>new Promise((n,r)=>{a.then(r),d.analyzeMetafile({callName:`analyzeMetafile`,refs:null,metafile:typeof e==`string`?e:JSON.stringify(e),options:t,callback:(e,t)=>e?r(e):n(t)})})}}),je=l})(typeof t==`object`?t:{set exports(e){(typeof self<`u`?self:this).esbuild=e}})}))(),1),p=`/assets/esbuild-BaXVPFT2.wasm`,m=44,h=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,g=new Uint8Array(64),_=new Uint8Array(128);for(let e=0;e<h.length;e++){let t=h.charCodeAt(e);g[e]=t,_[t]=e}function v(e){let t=0,n=0,r=0;do r=_[e.next()],t|=(r&31)<<n,n+=5;while(r&32);return t}function y(e){return e&1?-0x80000000|-(e>>>1):e>>>1}function b(e,t){return e.pos>=t?!1:e.peek()!==m}var x=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function S(e){let{length:t}=e,n=new x(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i+=y(v(n)),i<u&&(l=!1),u=i,b(n,e)?(a+=y(v(n)),o+=y(v(n)),s+=y(v(n)),b(n,e)?(c+=y(v(n)),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||C(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function C(e){e.sort(w)}function w(e,t){return e[0]-t[0]}var T=e(t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=i())})(n,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?(\[[^\]]+\]|[^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path=e.path===`/`?t.path:f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];t?(o=!1,t!==`.`&&(t===`..`?a?(o=!0,a--,i--):n&&(r[i++]=t):(r[i++]=t,a++))):o=!0}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))(),1);function E(e){if(!e)return``;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function D(e,t){let n=E(e),r=t?t+`/`:``;return e=>(0,T.default)(r+(e||``),n)}var O=0,k=1,A=2,j=3,M=4;function N(e,t){let n=P(e,0);if(n===e.length)return e;t||(e=e.slice());for(let r=n;r<e.length;r=P(e,r+1))e[r]=F(e[r],t);return e}function P(e,t){for(let n=t;n<e.length;n++)if(!ee(e[n]))return n;return e.length}function ee(e){for(let t=1;t<e.length;t++)if(e[t][O]<e[t-1][O])return!1;return!0}function F(e,t){return t||(e=e.slice()),e.sort(I)}function I(e,t){return e[O]-t[O]}var L=!1;function te(e,t,n,r){for(;n<=r;){let i=n+(r-n>>1),a=e[i][O]-t;if(a===0)return L=!0,i;a<0?n=i+1:r=i-1}return L=!1,n-1}function ne(e,t,n){for(let r=n+1;r<e.length&&e[r][O]===t;n=r++);return n}function re(e,t,n){for(let r=n-1;r>=0&&e[r][O]===t;n=r--);return n}function R(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function z(e,t,n,r){let{lastKey:i,lastNeedle:a,lastIndex:o}=n,s=0,c=e.length-1;if(r===i){if(t===a)return L=o!==-1&&e[o][O]===t,o;t>=a?s=o===-1?0:o:c=o}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=te(e,t,s,c)}function B(e){return typeof e==`string`?JSON.parse(e):e}var V="`line` must be greater than 0 (lines start at line 1)",ie="`column` must be greater than or equal to 0 (columns start at column 0)",H=class{constructor(e,t){let n=typeof e==`string`;if(!n&&e._decodedMemo)return e;let r=B(e),{version:i,file:a,names:o,sourceRoot:s,sources:c,sourcesContent:l}=r;this.version=i,this.file=a,this.names=o||[],this.sourceRoot=s,this.sources=c,this.sourcesContent=l,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;let u=D(t,s);this.resolvedSources=c.map(u);let{mappings:d}=r;if(typeof d==`string`)this._encoded=d,this._decoded=void 0;else if(Array.isArray(d))this._encoded=void 0,this._decoded=N(d,n);else if(r.sections)throw Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);else throw Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=R(),this._bySources=void 0,this._bySourceMemos=void 0}};function U(e){return e}function ae(e){var t;return(t=U(e))._decoded||(t._decoded=S(U(e)._encoded))}function W(e,t){let{line:n,column:r,bias:i}=t;if(n--,n<0)throw Error(V);if(r<0)throw Error(ie);let a=ae(e);if(n>=a.length)return G(null,null,null,null);let o=a[n],s=K(o,U(e)._decodedMemo,n,r,i||1);if(s===-1)return G(null,null,null,null);let c=o[s];if(c.length===1)return G(null,null,null,null);let{names:l,resolvedSources:u}=e;return G(u[c[k]],c[A]+1,c[j],c.length===5?l[c[M]]:null)}function G(e,t,n,r){return{source:e,line:t,column:n,name:r}}function K(e,t,n,r,i){let a=z(e,r,t,n);return L?a=(i===-1?ne:re)(e,r,a):i===-1&&a++,a===-1||a===e.length?-1:a}var oe=new Map;function se(e,t,n){oe.set(e,{map:new H(t),prefix:n})}function ce(e,t,n){let r=oe.get(e);if(!r)return{file:e,line:t,column:n};let i=W(r.map,{line:t,column:n-1});return i.source===null||i.line===null||i.column===null?{file:e,line:t,column:n}:{file:i.source.startsWith(r.prefix)?i.source.slice(r.prefix.length):i.source,line:i.line,column:i.column+1}}var q=s(ce);function J(e){let t=0,r=new Map;e.then(e=>{e.addEventListener(`message`,t=>{let i=t.data;if(i.kind===`error`)throw e.close(),new n(`the narrator stopped: ${i.message}`,i.stack);let a=r.get(i.id);r.delete(i.id),a?.(i)}),e.start()});let i=async(n,i,a)=>{let o=await e;return new Promise(e=>{let s=t++;r.set(s,e),o.postMessage({id:s,kind:n,words:i,speed:a})})};return{speak:async(e,t)=>{let n=await i(`speak`,e,t);if(n.kind!==`speech`)throw Error(`the narrator answered ${n.kind} to a speech`);return{samples:n.samples,sampleRate:n.sampleRate,words:n.words}},time:async(e,t)=>{let n=await i(`time`,e,t);if(n.kind!==`timing`)throw Error(`the narrator answered ${n.kind} to a clock`);return{samples:n.samples,sampleRate:n.sampleRate,words:n.words}}}}function le(e){let t=0,n=new Map,i=r=>{let i=t++,{promise:a,resolve:o}=Promise.withResolvers();return n.set(i,o),e.post({kind:`files`,id:i,question:r},[]),a},s={name:async()=>{let e=await i({kind:`name`});if(e.kind!==`name`)throw Error(`the page answered ${e.kind} to a question of the name`);return e.name},read:async e=>{let t=await i({kind:`read`,path:e});if(t.kind!==`read`)throw Error(`the page answered ${t.kind} to a read of ${e}`);return t.text},list:async e=>{let t=await i({kind:`list`,folder:e});if(t.kind!==`list`)throw Error(`the page answered ${t.kind} to a list of ${e}`);return t.names}},l=async()=>{let t=await s.name();if(t===null)return{_tag:`Right`,right:[]};let n={name:()=>Promise.resolve(t),read:s.read,list:s.list};return d(n,r(q),e.modules,await e.esbuild(),e.player)},f=Promise.withResolvers(),p=u(o.create({voice:J(f.promise),workspace:{projects:l}})),m=[],h=(t,{chapters:n,...r})=>{let i=[],o=[],s=[];n.forEach((e,t)=>{let n=m[t];if(e===n)return;if(!e){i.push([t,void 0]);return}let r=n?.cues.map(e=>e.samples)??[];if(e.animation!==n?.animation){let{animation:n,cues:o,...s}=e,c=o.map(e=>{let t=e.samples?r.indexOf(e.samples):-1;return t===-1?null:t}),l=o.map(({at:e,length:t},n)=>({at:e,length:t,keep:c[n]??null}));i.push([t,{...s,lottie:a(n),cues:l}]),r=c.map(e=>e===null?void 0:r[e])}e.cues.forEach((e,n)=>{if(!e.samples||e.samples===r[n])return;let i=e.samples.slice();s.push(i.buffer),o.push({chapter:t,cue:n,samples:i})})}),m=n;let l={...r,errors:c(r.errors),warnings:c(r.warnings)};e.post({kind:`state`,watch:t,state:l,count:n.length,drawings:i,sounds:o},s)};return t=>{switch(t.kind){case`list`:p.build.list().then(n=>{let r=n._tag===`Left`?{_tag:`Left`,left:c(n.left)}:n;e.post({kind:`listed`,id:t.id,videos:r},[])});return;case`watch`:m=[],p.build.watch(t.name,{changed:e=>{h(t.watch,e)}});return;case`seek`:p.build.seek(t.name,t.seconds);return;case`halt`:p.halt();return;case`refresh`:p.refresh(t.seconds);return;case`files`:{let e=n.get(t.id);n.delete(t.id),e?.(t.answer);return}case`narrator`:f.resolve(t.port);return}}}var Y=(e,t=[])=>{self.postMessage(e,{transfer:t})},X=e=>{let t=l(e,q);Y({kind:`error`,message:t.message,stack:t.stack.map(e=>` ${e}`).join(`
696
+ `)})};self.addEventListener(`error`,e=>{e.preventDefault(),X(e.error??Error(e.message))}),self.addEventListener(`unhandledrejection`,e=>{e.preventDefault(),X(e.reason)});var ue={"@beff/aula":new URL(`./aula.js`,import.meta.url).href,"@beff/aula-method":new URL(`./aula-method.js`,import.meta.url).href},Z={load:async({code:e,map:t})=>{let n=URL.createObjectURL(new Blob([e],{type:`text/javascript`}));return se(n,t,i),{url:n,exports:await import(n)}}},Q=null,de=le({post:Y,esbuild:async()=>(Q??=(async()=>{let e=performance.now();await f.initialize({wasmURL:p,worker:!1}),console.log(`aula: esbuild loaded in ${((performance.now()-e)/1e3).toFixed(1)} s`)})(),await Q,f),modules:Z,player:ue});self.addEventListener(`message`,e=>{de(e.data)});