isomorfeus-asset-manager 0.14.22 → 0.14.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e208b674f5b5ed724db1be5c74054c92d4b2468faea3a30267f528f36c1bb9ce
4
- data.tar.gz: 03201b0049a608178c9a7d550749556de94ad9e9382eca635f18694ed5debd51
3
+ metadata.gz: 2550796d4ff2f2c815a485ed7ced24b825b0651d8838fb313271e41c9fdae488
4
+ data.tar.gz: 29442cda3c1a8b69d7063355e7e1b935faf73b127c1901b15b3195a635609e52
5
5
  SHA512:
6
- metadata.gz: ff78d031bde9dc60794d00abd392449f6acee64845d9ba5270749dcea6fbe89c680da79c5a46975db1ff16f6c036b525f330c1fd211fc0462f842cf29cdc102c
7
- data.tar.gz: 2088239fe557d25847360d8e5348d0052f72176384bd22492e1222569286a9c196f53284dd895c9ce46fdc93bc13c0faf045aa9bd7d72db4637c45d0a10c66d0
6
+ metadata.gz: 64906b53a385b158273ea7fa0b3b8affdd925ed5846e58cd855e57deae61473f44616d5a76c5bb8dc624453dac50c2803037c91e480385bdbd4bbfdd0b0d8588
7
+ data.tar.gz: 6a98c69a12f6a5918c8ac37243b2b206cc5672a6481bc71b20afa1a32e4bae15fee86bf521feeabcf3afb593bec597768b709b0217eba5d6d4b4eb59464b04ca
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.14.22'
3
+ VERSION = '0.14.25'
4
4
  end
5
5
  end
@@ -4,9 +4,9 @@
4
4
  "requires": true,
5
5
  "packages": {
6
6
  "node_modules/esbuild-wasm": {
7
- "version": "0.14.36",
8
- "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.36.tgz",
9
- "integrity": "sha512-tDMs2l397fd/pwLoIKb4uYfQayM5hMfUwVvCmzbFEU+zXedj15/Z/A8iD87cWHN1VD66REdgcGMt1BO6C7RnLw==",
7
+ "version": "0.14.49",
8
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.49.tgz",
9
+ "integrity": "sha512-5ddzZv8M3WI1fWZ5rEfK5cSA9swlWJcceKgqjKLLERC7FnlNW50kF7hxhpkyC0Z/4w7Xeyt3yUJ9QWNMDXLk2Q==",
10
10
  "bin": {
11
11
  "esbuild": "bin/esbuild"
12
12
  },
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Evan Wallace
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
Binary file
@@ -1,6 +1,6 @@
1
1
  export type Platform = 'browser' | 'node' | 'neutral';
2
2
  export type Format = 'iife' | 'cjs' | 'esm';
3
- export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
3
+ export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'copy' | 'default';
4
4
  export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
5
5
  export type Charset = 'ascii' | 'utf8';
6
6
  export type Drop = 'console' | 'debugger';
@@ -17,10 +17,12 @@ interface CommonOptions {
17
17
 
18
18
  /** Documentation: https://esbuild.github.io/api/#format */
19
19
  format?: Format;
20
- /** Documentation: https://esbuild.github.io/api/#globalName */
20
+ /** Documentation: https://esbuild.github.io/api/#global-name */
21
21
  globalName?: string;
22
22
  /** Documentation: https://esbuild.github.io/api/#target */
23
23
  target?: string | string[];
24
+ /** Documentation: https://esbuild.github.io/api/#supported */
25
+ supported?: Record<string, boolean>;
24
26
 
25
27
  /** Documentation: https://esbuild.github.io/api/#mangle-props */
26
28
  mangleProps?: RegExp;
@@ -67,6 +69,8 @@ interface CommonOptions {
67
69
  logLevel?: LogLevel;
68
70
  /** Documentation: https://esbuild.github.io/api/#log-limit */
69
71
  logLimit?: number;
72
+ /** Documentation: https://esbuild.github.io/api/#log-override */
73
+ logOverride?: Record<string, LogLevel>;
70
74
  }
71
75
 
72
76
  export interface BuildOptions extends CommonOptions {
@@ -92,7 +96,7 @@ export interface BuildOptions extends CommonOptions {
92
96
  loader?: { [ext: string]: Loader };
93
97
  /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
94
98
  resolveExtensions?: string[];
95
- /** Documentation: https://esbuild.github.io/api/#mainFields */
99
+ /** Documentation: https://esbuild.github.io/api/#main-fields */
96
100
  mainFields?: string[];
97
101
  /** Documentation: https://esbuild.github.io/api/#conditions */
98
102
  conditions?: string[];
@@ -146,6 +150,7 @@ export interface StdinOptions {
146
150
  }
147
151
 
148
152
  export interface Message {
153
+ id: string;
149
154
  pluginName: string;
150
155
  text: string;
151
156
  location: Location | null;
@@ -400,6 +405,7 @@ export interface OnLoadResult {
400
405
  }
401
406
 
402
407
  export interface PartialMessage {
408
+ id?: string;
403
409
  pluginName?: string;
404
410
  text?: string;
405
411
  location?: Partial<Location> | null;
@@ -303,6 +303,8 @@ function pushCommonFlags(flags, options, keys) {
303
303
  let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
304
304
  let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
305
305
  let define = getFlag(options, keys, "define", mustBeObject);
306
+ let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
307
+ let supported = getFlag(options, keys, "supported", mustBeObject);
306
308
  let pure = getFlag(options, keys, "pure", mustBeArray);
307
309
  let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
308
310
  if (legalComments)
@@ -357,6 +359,20 @@ function pushCommonFlags(flags, options, keys) {
357
359
  flags.push(`--define:${key}=${define[key]}`);
358
360
  }
359
361
  }
362
+ if (logOverride) {
363
+ for (let key in logOverride) {
364
+ if (key.indexOf("=") >= 0)
365
+ throw new Error(`Invalid log override: ${key}`);
366
+ flags.push(`--log-override:${key}=${logOverride[key]}`);
367
+ }
368
+ }
369
+ if (supported) {
370
+ for (let key in supported) {
371
+ if (key.indexOf("=") >= 0)
372
+ throw new Error(`Invalid supported: ${key}`);
373
+ flags.push(`--supported:${key}=${supported[key]}`);
374
+ }
375
+ }
360
376
  if (pure)
361
377
  for (let fn of pure)
362
378
  flags.push(`--pure:${fn}`);
@@ -731,8 +747,8 @@ function createChannel(streamIn) {
731
747
  if (isFirstPacket) {
732
748
  isFirstPacket = false;
733
749
  let binaryVersion = String.fromCharCode(...bytes);
734
- if (binaryVersion !== "0.14.36") {
735
- throw new Error(`Cannot start service: Host version "${"0.14.36"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
750
+ if (binaryVersion !== "0.14.49") {
751
+ throw new Error(`Cannot start service: Host version "${"0.14.49"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
736
752
  }
737
753
  return;
738
754
  }
@@ -1181,7 +1197,7 @@ function createChannel(streamIn) {
1181
1197
  callerRefs.unref();
1182
1198
  }
1183
1199
  };
1184
- let writeDefault = !streamIn.isBrowser;
1200
+ let writeDefault = !streamIn.isWriteUnavailable;
1185
1201
  let {
1186
1202
  entries,
1187
1203
  flags,
@@ -1241,7 +1257,7 @@ function createChannel(streamIn) {
1241
1257
  throw new Error("Cannot rebuild");
1242
1258
  sendRequest(refs, { command: "rebuild", key }, (error2, response2) => {
1243
1259
  if (error2) {
1244
- const message = { pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
1260
+ const message = { id: "", pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
1245
1261
  return callback2(failureErrorWithLog("Build failed", [message], []), null);
1246
1262
  }
1247
1263
  buildResponseToResult(response2, (error3, result3) => {
@@ -1309,8 +1325,8 @@ function createChannel(streamIn) {
1309
1325
  callback2(null, result);
1310
1326
  });
1311
1327
  };
1312
- if (write && streamIn.isBrowser)
1313
- throw new Error(`Cannot enable "write" in the browser`);
1328
+ if (write && streamIn.isWriteUnavailable)
1329
+ throw new Error(`The "write" option is unavailable in this environment`);
1314
1330
  if (incremental && streamIn.isSync)
1315
1331
  throw new Error(`Cannot use "incremental" with a synchronous build`);
1316
1332
  if (watch && streamIn.isSync)
@@ -1524,7 +1540,7 @@ function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
1524
1540
  location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
1525
1541
  } catch (e2) {
1526
1542
  }
1527
- return { pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
1543
+ return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
1528
1544
  }
1529
1545
  function parseStackLinesV8(streamIn, lines, ident) {
1530
1546
  let at = " at ";
@@ -1623,6 +1639,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
1623
1639
  let index = 0;
1624
1640
  for (const message of messages) {
1625
1641
  let keys = {};
1642
+ let id = getFlag(message, keys, "id", mustBeString);
1626
1643
  let pluginName = getFlag(message, keys, "pluginName", mustBeString);
1627
1644
  let text = getFlag(message, keys, "text", mustBeString);
1628
1645
  let location = getFlag(message, keys, "location", mustBeObjectOrNull);
@@ -1644,6 +1661,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
1644
1661
  }
1645
1662
  }
1646
1663
  messagesClone.push({
1664
+ id: id || "",
1647
1665
  pluginName: pluginName || fallbackPluginName,
1648
1666
  text: text || "",
1649
1667
  location: sanitizeLocation(location, where),
@@ -1677,7 +1695,7 @@ function convertOutputFiles({ path, contents }) {
1677
1695
  }
1678
1696
 
1679
1697
  // lib/npm/browser.ts
1680
- var version = "0.14.36";
1698
+ var version = "0.14.49";
1681
1699
  var build = (options) => ensureServiceIsRunning().build(options);
1682
1700
  var serve = () => {
1683
1701
  throw new Error(`The "serve" API only works in node`);
@@ -1733,7 +1751,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
1733
1751
  }
1734
1752
  let worker;
1735
1753
  if (useWorker) {
1736
- let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(() => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n }, getInt64(sp + 8) + 1));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.14.36"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1754
+ let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(() => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n }, getInt64(sp + 8) + 1));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.14.49"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1737
1755
  worker = new Worker(URL.createObjectURL(blob));
1738
1756
  } else {
1739
1757
  let onmessage = ((postMessage) => {
@@ -2312,7 +2330,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
2312
2330
  callback(null, count);
2313
2331
  };
2314
2332
  let go = new globalThis.Go();
2315
- go.argv = ["", `--service=${"0.14.36"}`];
2333
+ go.argv = ["", `--service=${"0.14.49"}`];
2316
2334
  if (wasm instanceof WebAssembly.Module) {
2317
2335
  WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));
2318
2336
  } else {
@@ -2335,7 +2353,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
2335
2353
  worker.postMessage(bytes);
2336
2354
  },
2337
2355
  isSync: false,
2338
- isBrowser: true,
2356
+ isWriteUnavailable: true,
2339
2357
  esbuild: browser_exports
2340
2358
  });
2341
2359
  longLivedService = {
@@ -1,15 +1,15 @@
1
- var Ie=Object.defineProperty,rt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&qe(e,r,t[r]);if(We)for(var r of We(t))it.call(t,r)&&qe(e,r,t[r]);return e},De=(e,t)=>rt(e,nt(t));var st=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],enumerable:!0})};var Ae={};st(Ae,{analyzeMetafile:()=>St,analyzeMetafileSync:()=>Mt,build:()=>wt,buildSync:()=>xt,default:()=>Pt,formatMessages:()=>Ot,formatMessagesSync:()=>kt,initialize:()=>$t,serve:()=>vt,transform:()=>Rt,transformSync:()=>Et,version:()=>bt});function Fe(e){let t=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(fe(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let p of s)t(p)}else{let p=Object.keys(s);r.write8(6),r.write32(p.length);for(let i of p)r.write(fe(i)),t(s[i])}},r=new xe;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ne(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function ze(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ye(r.read());case 4:return r.read();case 5:{let f=r.read32(),l=[];for(let h=0;h<f;h++)l.push(t());return l}case 6:{let f=r.read32(),l={};for(let h=0;h<f;h++)l[ye(r.read())]=t();return l}default:throw new Error("Invalid packet")}},r=new xe(e),s=r.read32(),p=(s&1)===0;s>>>=1;let i=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:p,value:i}}var xe=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);Ne(this.buf,t,r)}write(t){let r=this._write(4+t.length);Ne(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return je(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},fe,ye;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;fe=r=>e.encode(r),ye=r=>t.decode(r)}else if(typeof Buffer!="undefined")fe=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},ye=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function je(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ne(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ke(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Me=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",m=e=>typeof e=="string"?null:"a string",$e=e=>e instanceof RegExp?null:"a RegExp object",Re=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Le=e=>typeof e=="function"?null:"a function",V=e=>Array.isArray(e)?null:"an array",de=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",ut=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",ft=e=>typeof e=="object"&&e!==null?null:"an array or an object",_e=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ye=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ct=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",dt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",pt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let p=e[r];if(t[r+""]=!0,p===void 0)return;let i=s(p);if(i!==null)throw new Error(`"${r}" must be ${i}`);return p}function Y(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Qe(e){let t=Object.create(null),r=n(e,t,"wasmURL",m),s=n(e,t,"wasmModule",ut),p=n(e,t,"worker",I);return Y(e,t,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:p}}function He(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let s=e[r];if(typeof s=="string"||s===!1)t[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Ce(e,t,r,s,p){let i=n(t,r,"color",I),f=n(t,r,"logLevel",m),l=n(t,r,"logLimit",Re);i!==void 0?e.push(`--color=${i}`):s&&e.push("--color=true"),e.push(`--log-level=${f||p}`),e.push(`--log-limit=${l||0}`)}function Ge(e,t,r){let s=n(t,r,"legalComments",m),p=n(t,r,"sourceRoot",m),i=n(t,r,"sourcesContent",I),f=n(t,r,"target",dt),l=n(t,r,"format",m),h=n(t,r,"globalName",m),O=n(t,r,"mangleProps",$e),N=n(t,r,"reserveProps",$e),k=n(t,r,"mangleQuoted",I),C=n(t,r,"minify",I),q=n(t,r,"minifySyntax",I),oe=n(t,r,"minifyWhitespace",I),re=n(t,r,"minifyIdentifiers",I),ne=n(t,r,"drop",V),le=n(t,r,"charset",m),ie=n(t,r,"treeShaking",I),pe=n(t,r,"ignoreAnnotations",I),ae=n(t,r,"jsx",m),ge=n(t,r,"jsxFactory",m),ue=n(t,r,"jsxFragment",m),me=n(t,r,"define",de),be=n(t,r,"pure",V),Se=n(t,r,"keepNames",I);if(s&&e.push(`--legal-comments=${s}`),p!==void 0&&e.push(`--source-root=${p}`),i!==void 0&&e.push(`--sources-content=${i}`),f&&(Array.isArray(f)?e.push(`--target=${Array.from(f).map(Ke).join(",")}`):e.push(`--target=${Ke(f)}`)),l&&e.push(`--format=${l}`),h&&e.push(`--global-name=${h}`),C&&e.push("--minify"),q&&e.push("--minify-syntax"),oe&&e.push("--minify-whitespace"),re&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),pe&&e.push("--ignore-annotations"),ne)for(let c of ne)e.push(`--drop:${c}`);if(O&&e.push(`--mangle-props=${O.source}`),N&&e.push(`--reserve-props=${N.source}`),k!==void 0&&e.push(`--mangle-quoted=${k}`),ae&&e.push(`--jsx=${ae}`),ge&&e.push(`--jsx-factory=${ge}`),ue&&e.push(`--jsx-fragment=${ue}`),me)for(let c in me){if(c.indexOf("=")>=0)throw new Error(`Invalid define: ${c}`);e.push(`--define:${c}=${me[c]}`)}if(be)for(let c of be)e.push(`--pure:${c}`);Se&&e.push("--keep-names")}function gt(e,t,r,s,p){var b;let i=[],f=[],l=Object.create(null),h=null,O=null,N=null;Ce(i,t,l,r,s),Ge(i,t,l);let k=n(t,l,"sourcemap",Ye),C=n(t,l,"bundle",I),q=n(t,l,"watch",at),oe=n(t,l,"splitting",I),re=n(t,l,"preserveSymlinks",I),ne=n(t,l,"metafile",I),le=n(t,l,"outfile",m),ie=n(t,l,"outdir",m),pe=n(t,l,"outbase",m),ae=n(t,l,"platform",m),ge=n(t,l,"tsconfig",m),ue=n(t,l,"resolveExtensions",V),me=n(t,l,"nodePaths",V),be=n(t,l,"mainFields",V),Se=n(t,l,"conditions",V),c=n(t,l,"external",V),u=n(t,l,"loader",de),o=n(t,l,"outExtension",de),d=n(t,l,"publicPath",m),F=n(t,l,"entryNames",m),B=n(t,l,"chunkNames",m),M=n(t,l,"assetNames",m),x=n(t,l,"inject",V),P=n(t,l,"banner",de),$=n(t,l,"footer",de),R=n(t,l,"entryPoints",ft),L=n(t,l,"absWorkingDir",m),S=n(t,l,"stdin",de),T=(b=n(t,l,"write",I))!=null?b:p,W=n(t,l,"allowOverwrite",I),ee=n(t,l,"incremental",I)===!0,E=n(t,l,"mangleCache",de);if(l.plugins=!0,Y(t,l,`in ${e}() call`),k&&i.push(`--sourcemap${k===!0?"":`=${k}`}`),C&&i.push("--bundle"),W&&i.push("--allow-overwrite"),q)if(i.push("--watch"),typeof q=="boolean")N={};else{let a=Object.create(null),v=n(q,a,"onRebuild",Le);Y(q,a,`on "watch" in ${e}() call`),N={onRebuild:v}}if(oe&&i.push("--splitting"),re&&i.push("--preserve-symlinks"),ne&&i.push("--metafile"),le&&i.push(`--outfile=${le}`),ie&&i.push(`--outdir=${ie}`),pe&&i.push(`--outbase=${pe}`),ae&&i.push(`--platform=${ae}`),ge&&i.push(`--tsconfig=${ge}`),ue){let a=[];for(let v of ue){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);a.push(v)}i.push(`--resolve-extensions=${a.join(",")}`)}if(d&&i.push(`--public-path=${d}`),F&&i.push(`--entry-names=${F}`),B&&i.push(`--chunk-names=${B}`),M&&i.push(`--asset-names=${M}`),be){let a=[];for(let v of be){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);a.push(v)}i.push(`--main-fields=${a.join(",")}`)}if(Se){let a=[];for(let v of Se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);a.push(v)}i.push(`--conditions=${a.join(",")}`)}if(c)for(let a of c)i.push(`--external:${a}`);if(P)for(let a in P){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);i.push(`--banner:${a}=${P[a]}`)}if($)for(let a in $){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);i.push(`--footer:${a}=${$[a]}`)}if(x)for(let a of x)i.push(`--inject:${a}`);if(u)for(let a in u){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);i.push(`--loader:${a}=${u[a]}`)}if(o)for(let a in o){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);i.push(`--out-extension:${a}=${o[a]}`)}if(R)if(Array.isArray(R))for(let a of R)f.push(["",a+""]);else for(let[a,v]of Object.entries(R))f.push([a+"",v+""]);if(S){let a=Object.create(null),v=n(S,a,"contents",m),U=n(S,a,"resolveDir",m),w=n(S,a,"sourcefile",m),g=n(S,a,"loader",m);Y(S,a,'in "stdin" object'),w&&i.push(`--sourcefile=${w}`),g&&i.push(`--loader=${g}`),U&&(O=U+""),h=v?v+"":""}let y=[];if(me)for(let a of me)a+="",y.push(a);return{entries:f,flags:i,write:T,stdinContents:h,stdinResolveDir:O,absWorkingDir:L,incremental:ee,nodePaths:y,watch:N,mangleCache:He(E)}}function mt(e,t,r,s){let p=[],i=Object.create(null);Ce(p,t,i,r,s),Ge(p,t,i);let f=n(t,i,"sourcemap",Ye),l=n(t,i,"tsconfigRaw",ct),h=n(t,i,"sourcefile",m),O=n(t,i,"loader",m),N=n(t,i,"banner",m),k=n(t,i,"footer",m),C=n(t,i,"mangleCache",de);return Y(t,i,`in ${e}() call`),f&&p.push(`--sourcemap=${f===!0?"external":f}`),l&&p.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),h&&p.push(`--sourcefile=${h}`),O&&p.push(`--loader=${O}`),N&&p.push(`--banner=${N}`),k&&p.push(`--footer=${k}`),{flags:p,mangleCache:He(C)}}function Xe(e){let t=new Map,r=new Map,s=new Map,p=new Map,i=null,f=0,l=0,h=new Uint8Array(16*1024),O=0,N=c=>{let u=O+c.length;if(u>h.length){let d=new Uint8Array(u*2);d.set(h),h=d}h.set(c,O),O+=c.length;let o=0;for(;o+4<=O;){let d=je(h,o);if(o+4+d>O)break;o+=4,ne(h.subarray(o,o+d)),o+=d}o>0&&(h.copyWithin(0,o,O),O-=o)},k=c=>{i={reason:c?": "+(c.message||c):""};let u="The service was stopped"+i.reason;for(let o of t.values())o(u,null);t.clear();for(let o of p.values())o.onWait(u);p.clear();for(let o of s.values())try{o(new Error(u),null)}catch(d){console.error(d)}s.clear()},C=(c,u,o)=>{if(i)return o("The service is no longer running"+i.reason,null);let d=f++;t.set(d,(F,B)=>{try{o(F,B)}finally{c&&c.unref()}}),c&&c.ref(),e.writeToStdin(Fe({id:d,isRequest:!0,value:u}))},q=(c,u)=>{if(i)throw new Error("The service is no longer running"+i.reason);e.writeToStdin(Fe({id:c,isRequest:!1,value:u}))},oe=async(c,u)=>{try{switch(u.command){case"ping":{q(c,{});break}case"on-start":{let o=r.get(u.key);o?q(c,await o(u)):q(c,{});break}case"on-resolve":{let o=r.get(u.key);o?q(c,await o(u)):q(c,{});break}case"on-load":{let o=r.get(u.key);o?q(c,await o(u)):q(c,{});break}case"serve-request":{let o=p.get(u.key);o&&o.onRequest&&o.onRequest(u.args),q(c,{});break}case"serve-wait":{let o=p.get(u.key);o&&o.onWait(u.error),q(c,{});break}case"watch-rebuild":{let o=s.get(u.key);try{o&&o(null,u.args)}catch(d){console.error(d)}q(c,{});break}default:throw new Error("Invalid command: "+u.command)}}catch(o){q(c,{errors:[we(o,e,null,void 0,"")]})}},re=!0,ne=c=>{if(re){re=!1;let o=String.fromCharCode(...c);if(o!=="0.14.36")throw new Error(`Cannot start service: Host version "0.14.36" does not match binary version ${JSON.stringify(o)}`);return}let u=ze(c);if(u.isRequest)oe(u.id,u.value);else{let o=t.get(u.id);t.delete(u.id),u.value.error?o(u.value.error,{}):o(null,u.value)}},le=async(c,u,o,d,F)=>{let B=[],M=[],x={},P={},$=0,R=0,L=[],S=!1;u=[...u];for(let E of u){let y={};if(typeof E!="object")throw new Error(`Plugin at index ${R} must be an object`);let b=n(E,y,"name",m);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let a=n(E,y,"setup",Le);if(typeof a!="function")throw new Error("Plugin is missing a setup function");Y(E,y,`on plugin ${JSON.stringify(b)}`);let v={name:b,onResolve:[],onLoad:[]};R++;let w=a({initialOptions:c,resolve:(g,D={})=>{if(!S)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof g!="string")throw new Error("The path to resolve must be a string");let A=Object.create(null),Q=n(D,A,"pluginName",m),z=n(D,A,"importer",m),_=n(D,A,"namespace",m),X=n(D,A,"resolveDir",m),H=n(D,A,"kind",m),j=n(D,A,"pluginData",Me);return Y(D,A,"in resolve() call"),new Promise((J,G)=>{let K={command:"resolve",path:g,key:o,pluginName:b};Q!=null&&(K.pluginName=Q),z!=null&&(K.importer=z),_!=null&&(K.namespace=_),X!=null&&(K.resolveDir=X),H!=null&&(K.kind=H),j!=null&&(K.pluginData=d.store(j)),C(F,K,(se,Z)=>{se!==null?G(new Error(se)):J({errors:ce(Z.errors,d),warnings:ce(Z.warnings,d),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:d.load(Z.pluginData)})})})},onStart(g){let D='This error came from the "onStart" callback registered here:',A=Ee(new Error(D),e,"onStart");B.push({name:b,callback:g,note:A})},onEnd(g){let D='This error came from the "onEnd" callback registered here:',A=Ee(new Error(D),e,"onEnd");M.push({name:b,callback:g,note:A})},onResolve(g,D){let A='This error came from the "onResolve" callback registered here:',Q=Ee(new Error(A),e,"onResolve"),z={},_=n(g,z,"filter",$e),X=n(g,z,"namespace",m);if(Y(g,z,`in onResolve() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onResolve() call is missing a filter");let H=$++;x[H]={name:b,callback:D,note:Q},v.onResolve.push({id:H,filter:_.source,namespace:X||""})},onLoad(g,D){let A='This error came from the "onLoad" callback registered here:',Q=Ee(new Error(A),e,"onLoad"),z={},_=n(g,z,"filter",$e),X=n(g,z,"namespace",m);if(Y(g,z,`in onLoad() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onLoad() call is missing a filter");let H=$++;P[H]={name:b,callback:D,note:Q},v.onLoad.push({id:H,filter:_.source,namespace:X||""})},esbuild:e.esbuild});w&&await w,L.push(v)}catch(a){return{ok:!1,error:a,pluginName:b}}}let T=async E=>{switch(E.command){case"on-start":{let y={errors:[],warnings:[]};return await Promise.all(B.map(async({name:b,callback:a,note:v})=>{try{let U=await a();if(U!=null){if(typeof U!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let w={},g=n(U,w,"errors",V),D=n(U,w,"warnings",V);Y(U,w,`from onStart() callback in plugin ${JSON.stringify(b)}`),g!=null&&y.errors.push(...he(g,"errors",d,b)),D!=null&&y.warnings.push(...he(D,"warnings",d,b))}}catch(U){y.errors.push(we(U,e,d,v&&v(),b))}})),y}case"on-resolve":{let y={},b="",a,v;for(let U of E.ids)try{({name:b,callback:a,note:v}=x[U]);let w=await a({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:d.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let g={},D=n(w,g,"pluginName",m),A=n(w,g,"path",m),Q=n(w,g,"namespace",m),z=n(w,g,"suffix",m),_=n(w,g,"external",I),X=n(w,g,"sideEffects",I),H=n(w,g,"pluginData",Me),j=n(w,g,"errors",V),J=n(w,g,"warnings",V),G=n(w,g,"watchFiles",V),K=n(w,g,"watchDirs",V);Y(w,g,`from onResolve() callback in plugin ${JSON.stringify(b)}`),y.id=U,D!=null&&(y.pluginName=D),A!=null&&(y.path=A),Q!=null&&(y.namespace=Q),z!=null&&(y.suffix=z),_!=null&&(y.external=_),X!=null&&(y.sideEffects=X),H!=null&&(y.pluginData=d.store(H)),j!=null&&(y.errors=he(j,"errors",d,b)),J!=null&&(y.warnings=he(J,"warnings",d,b)),G!=null&&(y.watchFiles=ke(G,"watchFiles")),K!=null&&(y.watchDirs=ke(K,"watchDirs"));break}}catch(w){return{id:U,errors:[we(w,e,d,v&&v(),b)]}}return y}case"on-load":{let y={},b="",a,v;for(let U of E.ids)try{({name:b,callback:a,note:v}=P[U]);let w=await a({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:d.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let g={},D=n(w,g,"pluginName",m),A=n(w,g,"contents",pt),Q=n(w,g,"resolveDir",m),z=n(w,g,"pluginData",Me),_=n(w,g,"loader",m),X=n(w,g,"errors",V),H=n(w,g,"warnings",V),j=n(w,g,"watchFiles",V),J=n(w,g,"watchDirs",V);Y(w,g,`from onLoad() callback in plugin ${JSON.stringify(b)}`),y.id=U,D!=null&&(y.pluginName=D),A instanceof Uint8Array?y.contents=A:A!=null&&(y.contents=fe(A)),Q!=null&&(y.resolveDir=Q),z!=null&&(y.pluginData=d.store(z)),_!=null&&(y.loader=_),X!=null&&(y.errors=he(X,"errors",d,b)),H!=null&&(y.warnings=he(H,"warnings",d,b)),j!=null&&(y.watchFiles=ke(j,"watchFiles")),J!=null&&(y.watchDirs=ke(J,"watchDirs"));break}}catch(w){return{id:U,errors:[we(w,e,d,v&&v(),b)]}}return y}default:throw new Error("Invalid command: "+E.command)}},W=(E,y,b)=>b();M.length>0&&(W=(E,y,b)=>{(async()=>{for(let{name:a,callback:v,note:U}of M)try{await v(E)}catch(w){E.errors.push(await new Promise(g=>y(w,a,U&&U(),g)))}})().then(b)}),S=!0;let ee=0;return{ok:!0,requestPlugins:L,runOnEndCallbacks:W,pluginRefs:{ref(){++ee===1&&r.set(o,T)},unref(){--ee===0&&r.delete(o)}}}},ie=(c,u,o,d)=>{let F={},B=n(u,F,"port",Re),M=n(u,F,"host",m),x=n(u,F,"servedir",m),P=n(u,F,"onRequest",Le),$,R=new Promise((L,S)=>{$=T=>{p.delete(d),T!==null?S(new Error(T)):L()}});return o.serve={},Y(u,F,"in serve() call"),B!==void 0&&(o.serve.port=B),M!==void 0&&(o.serve.host=M),x!==void 0&&(o.serve.servedir=x),p.set(d,{onRequest:P,onWait:$}),{wait:R,stop(){C(c,{command:"serve-stop",key:d},()=>{})}}},pe="warning",ae="silent",ge=c=>{let u=l++,o=Ve(),d,{refs:F,options:B,isTTY:M,callback:x}=c;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');d=R}}let P=(R,L,S,T)=>{let W=[];try{Ce(W,B,{},M,pe)}catch(E){}let ee=we(R,e,o,S,L);C(F,{command:"error",flags:W,error:ee},()=>{ee.detail=o.load(ee.detail),T(ee)})},$=(R,L)=>{P(R,L,void 0,S=>{x(ve("Build failed",[S],[]),null)})};if(d&&d.length>0){if(e.isSync)return $(new Error("Cannot use plugins in synchronous API calls"),"");le(B,d,u,o,F).then(R=>{if(!R.ok)$(R.error,R.pluginName);else try{ue(De(Te({},c),{key:u,details:o,logPluginError:P,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(L){$(L,"")}},R=>$(R,""))}else try{ue(De(Te({},c),{key:u,details:o,logPluginError:P,requestPlugins:null,runOnEndCallbacks:(R,L,S)=>S(),pluginRefs:null}))}catch(R){$(R,"")}},ue=({callName:c,refs:u,serveOptions:o,options:d,isTTY:F,defaultWD:B,callback:M,key:x,details:P,logPluginError:$,requestPlugins:R,runOnEndCallbacks:L,pluginRefs:S})=>{let T={ref(){S&&S.ref(),u&&u.ref()},unref(){S&&S.unref(),u&&u.unref()}},W=!e.isBrowser,{entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:a,absWorkingDir:v,incremental:U,nodePaths:w,watch:g,mangleCache:D}=gt(c,d,F,pe,W),A={command:"build",key:x,entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:a,absWorkingDir:v||B,incremental:U,nodePaths:w};R&&(A.plugins=R),D&&(A.mangleCache=D);let Q=o&&ie(T,o,A,x),z,_,X=(j,J)=>{j.outputFiles&&(J.outputFiles=j.outputFiles.map(yt)),j.metafile&&(J.metafile=JSON.parse(j.metafile)),j.mangleCache&&(J.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(ye(j.writeToStdout).replace(/\n$/,""))},H=(j,J)=>{let G={errors:ce(j.errors,P),warnings:ce(j.warnings,P)};X(j,G),L(G,$,()=>{if(G.errors.length>0)return J(ve("Build failed",G.errors,G.warnings),null);if(j.rebuild){if(!z){let K=!1;z=()=>new Promise((se,Z)=>{if(K||i)throw new Error("Cannot rebuild");C(T,{command:"rebuild",key:x},(te,et)=>{if(te)return J(ve("Build failed",[{pluginName:"",text:te,location:null,notes:[],detail:void 0}],[]),null);H(et,(Be,tt)=>{Be?Z(Be):se(tt)})})}),T.ref(),z.dispose=()=>{K||(K=!0,C(T,{command:"rebuild-dispose",key:x},()=>{}),T.unref())}}G.rebuild=z}if(j.watch){if(!_){let K=!1;T.ref(),_=()=>{K||(K=!0,s.delete(x),C(T,{command:"watch-stop",key:x},()=>{}),T.unref())},g&&s.set(x,(se,Z)=>{if(se){g.onRebuild&&g.onRebuild(se,null);return}let te={errors:ce(Z.errors,P),warnings:ce(Z.warnings,P)};X(Z,te),L(te,$,()=>{if(te.errors.length>0){g.onRebuild&&g.onRebuild(ve("Build failed",te.errors,te.warnings),null);return}Z.rebuildID!==void 0&&(te.rebuild=z),te.stop=_,g.onRebuild&&g.onRebuild(null,te)})})}G.stop=_}J(null,G)})};if(y&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(U&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(g&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');C(T,A,(j,J)=>{if(j)return M(new Error(j),null);if(Q){let G=J,K=!1;T.ref();let se={port:G.port,host:G.host,wait:Q.wait,stop(){K||(K=!0,Q.stop(),T.unref())}};return T.ref(),Q.wait.then(T.unref,T.unref),M(null,se)}return H(J,M)})};return{readFromStdout:N,afterClose:k,service:{buildOrServe:ge,transform:({callName:c,refs:u,input:o,options:d,isTTY:F,fs:B,callback:M})=>{let x=Ve(),P=$=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:L}=mt(c,d,F,ae),S={command:"transform",flags:R,inputFS:$!==null,input:$!==null?$:o};L&&(S.mangleCache=L),C(u,S,(T,W)=>{if(T)return M(new Error(T),null);let ee=ce(W.errors,x),E=ce(W.warnings,x),y=1,b=()=>{if(--y===0){let a={warnings:E,code:W.code,map:W.map};W.mangleCache&&(a.mangleCache=W==null?void 0:W.mangleCache),M(null,a)}};if(ee.length>0)return M(ve("Transform failed",ee,E),null);W.codeFS&&(y++,B.readFile(W.code,(a,v)=>{a!==null?M(a,null):(W.code=v,b())})),W.mapFS&&(y++,B.readFile(W.map,(a,v)=>{a!==null?M(a,null):(W.map=v,b())})),b()})}catch(R){let L=[];try{Ce(L,d,{},F,ae)}catch(T){}let S=we(R,e,x,void 0,"");C(u,{command:"error",flags:L,error:S},()=>{S.detail=x.load(S.detail),M(ve("Transform failed",[S],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let $=P;P=()=>B.writeFile(o,$)}P(null)},formatMessages:({callName:c,refs:u,messages:o,options:d,callback:F})=>{let B=he(o,"messages",null,"");if(!d)throw new Error(`Missing second argument in ${c}() call`);let M={},x=n(d,M,"kind",m),P=n(d,M,"color",I),$=n(d,M,"terminalWidth",Re);if(Y(d,M,`in ${c}() call`),x===void 0)throw new Error(`Missing "kind" in ${c}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${c}() call`);let R={command:"format-msgs",messages:B,isWarning:x==="warning"};P!==void 0&&(R.color=P),$!==void 0&&(R.terminalWidth=$),C(u,R,(L,S)=>{if(L)return F(new Error(L),null);F(null,S.messages)})},analyzeMetafile:({callName:c,refs:u,metafile:o,options:d,callback:F})=>{d===void 0&&(d={});let B={},M=n(d,B,"color",I),x=n(d,B,"verbose",I);Y(d,B,`in ${c}() call`);let P={command:"analyze-metafile",metafile:o};M!==void 0&&(P.color=M),x!==void 0&&(P.verbose=x),C(u,P,($,R)=>{if($)return F(new Error($),null);F(null,R.result)})}}}}function Ve(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Ee(e,t,r){let s,p=!1;return()=>{if(p)return s;p=!0;try{let i=(e.stack+"").split(`
2
- `);i.splice(1,1);let f=Ze(t,i,r);if(f)return s={text:e.message,location:f},s}catch(i){}}}function we(e,t,r,s,p){let i="Internal error",f=null;try{i=(e&&e.message||e)+""}catch(l){}try{f=Ze(t,(e.stack+"").split(`
3
- `),"")}catch(l){}return{pluginName:p,text:i,location:f,notes:s?[s]:[],detail:r?r.store(e):-1}}function Ze(e,t,r){let s=" at ";if(e.readFileSync&&!t[0].startsWith(s)&&t[1].startsWith(s))for(let p=1;p<t.length;p++){let i=t[p];if(!!i.startsWith(s))for(i=i.slice(s.length);;){let f=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(f){i=f[1];continue}if(f=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),f){i=f[1];continue}if(f=/^(\S+):(\d+):(\d+)$/.exec(i),f){let l;try{l=e.readFileSync(f[1],"utf8")}catch(k){break}let h=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+f[2]-1]||"",O=+f[3]-1,N=h.slice(O,O+r.length)===r?r.length:0;return{file:f[1],namespace:"file",line:+f[2],column:fe(h.slice(0,O)).length,length:fe(h.slice(O,O+N)).length,lineText:h+`
1
+ var Ie=Object.defineProperty,rt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Be=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&qe(e,r,t[r]);if(We)for(var r of We(t))it.call(t,r)&&qe(e,r,t[r]);return e},De=(e,t)=>rt(e,nt(t));var st=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],enumerable:!0})};var Ae={};st(Ae,{analyzeMetafile:()=>St,analyzeMetafileSync:()=>$t,build:()=>wt,buildSync:()=>xt,default:()=>Pt,formatMessages:()=>Ot,formatMessagesSync:()=>kt,initialize:()=>Mt,serve:()=>vt,transform:()=>Rt,transformSync:()=>Et,version:()=>bt});function Fe(e){let t=o=>{if(o===null)r.write8(0);else if(typeof o=="boolean")r.write8(1),r.write8(+o);else if(typeof o=="number")r.write8(2),r.write32(o|0);else if(typeof o=="string")r.write8(3),r.write(de(o));else if(o instanceof Uint8Array)r.write8(4),r.write(o);else if(o instanceof Array){r.write8(5),r.write32(o.length);for(let d of o)t(d)}else{let d=Object.keys(o);r.write8(6),r.write32(d.length);for(let s of d)r.write(de(s)),t(o[s])}},r=new xe;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ne(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function ze(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return be(r.read());case 4:return r.read();case 5:{let f=r.read32(),i=[];for(let h=0;h<f;h++)i.push(t());return i}case 6:{let f=r.read32(),i={};for(let h=0;h<f;h++)i[be(r.read())]=t();return i}default:throw new Error("Invalid packet")}},r=new xe(e),o=r.read32(),d=(o&1)===0;o>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:o,isRequest:d,value:s}}var xe=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);Ne(this.buf,t,r)}write(t){let r=this._write(4+t.length);Ne(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return je(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),o=this._read(r.length);return r.set(this.buf.subarray(o,o+t)),r}},de,be;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;de=r=>e.encode(r),be=r=>t.decode(r)}else if(typeof Buffer!="undefined")de=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},be=e=>{let{buffer:t,byteOffset:r,byteLength:o}=e;return Buffer.from(t,r,o).toString()};else throw new Error("No UTF-8 codec found");function je(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ne(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ke(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var $e=()=>null,q=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",m=e=>typeof e=="string"?null:"a string",Me=e=>e instanceof RegExp?null:"a RegExp object",Oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Ue=e=>typeof e=="function"?null:"a function",V=e=>Array.isArray(e)?null:"an array",ie=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",ut=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",ft=e=>typeof e=="object"&&e!==null?null:"an array or an object",_e=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ye=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ct=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",dt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",pt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,o){let d=e[r];if(t[r+""]=!0,d===void 0)return;let s=o(d);if(s!==null)throw new Error(`"${r}" must be ${s}`);return d}function Y(e,t,r){for(let o in e)if(!(o in t))throw new Error(`Invalid option ${r}: "${o}"`)}function Qe(e){let t=Object.create(null),r=n(e,t,"wasmURL",m),o=n(e,t,"wasmModule",ut),d=n(e,t,"worker",q);return Y(e,t,"in initialize() call"),{wasmURL:r,wasmModule:o,worker:d}}function He(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let o=e[r];if(typeof o=="string"||o===!1)t[r]=o;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Ce(e,t,r,o,d){let s=n(t,r,"color",q),f=n(t,r,"logLevel",m),i=n(t,r,"logLimit",Oe);s!==void 0?e.push(`--color=${s}`):o&&e.push("--color=true"),e.push(`--log-level=${f||d}`),e.push(`--log-limit=${i||0}`)}function Ge(e,t,r){let o=n(t,r,"legalComments",m),d=n(t,r,"sourceRoot",m),s=n(t,r,"sourcesContent",q),f=n(t,r,"target",dt),i=n(t,r,"format",m),h=n(t,r,"globalName",m),O=n(t,r,"mangleProps",Me),N=n(t,r,"reserveProps",Me),C=n(t,r,"mangleQuoted",q),k=n(t,r,"minify",q),z=n(t,r,"minifySyntax",q),ne=n(t,r,"minifyWhitespace",q),se=n(t,r,"minifyIdentifiers",q),le=n(t,r,"drop",V),te=n(t,r,"charset",m),oe=n(t,r,"treeShaking",q),ae=n(t,r,"ignoreAnnotations",q),fe=n(t,r,"jsx",m),ge=n(t,r,"jsxFactory",m),ce=n(t,r,"jsxFragment",m),me=n(t,r,"define",ie),ye=n(t,r,"logOverride",ie),he=n(t,r,"supported",ie),g=n(t,r,"pure",V),u=n(t,r,"keepNames",q);if(o&&e.push(`--legal-comments=${o}`),d!==void 0&&e.push(`--source-root=${d}`),s!==void 0&&e.push(`--sources-content=${s}`),f&&(Array.isArray(f)?e.push(`--target=${Array.from(f).map(Ke).join(",")}`):e.push(`--target=${Ke(f)}`)),i&&e.push(`--format=${i}`),h&&e.push(`--global-name=${h}`),k&&e.push("--minify"),z&&e.push("--minify-syntax"),ne&&e.push("--minify-whitespace"),se&&e.push("--minify-identifiers"),te&&e.push(`--charset=${te}`),oe!==void 0&&e.push(`--tree-shaking=${oe}`),ae&&e.push("--ignore-annotations"),le)for(let l of le)e.push(`--drop:${l}`);if(O&&e.push(`--mangle-props=${O.source}`),N&&e.push(`--reserve-props=${N.source}`),C!==void 0&&e.push(`--mangle-quoted=${C}`),fe&&e.push(`--jsx=${fe}`),ge&&e.push(`--jsx-factory=${ge}`),ce&&e.push(`--jsx-fragment=${ce}`),me)for(let l in me){if(l.indexOf("=")>=0)throw new Error(`Invalid define: ${l}`);e.push(`--define:${l}=${me[l]}`)}if(ye)for(let l in ye){if(l.indexOf("=")>=0)throw new Error(`Invalid log override: ${l}`);e.push(`--log-override:${l}=${ye[l]}`)}if(he)for(let l in he){if(l.indexOf("=")>=0)throw new Error(`Invalid supported: ${l}`);e.push(`--supported:${l}=${he[l]}`)}if(g)for(let l of g)e.push(`--pure:${l}`);u&&e.push("--keep-names")}function gt(e,t,r,o,d){var b;let s=[],f=[],i=Object.create(null),h=null,O=null,N=null;Ce(s,t,i,r,o),Ge(s,t,i);let C=n(t,i,"sourcemap",Ye),k=n(t,i,"bundle",q),z=n(t,i,"watch",at),ne=n(t,i,"splitting",q),se=n(t,i,"preserveSymlinks",q),le=n(t,i,"metafile",q),te=n(t,i,"outfile",m),oe=n(t,i,"outdir",m),ae=n(t,i,"outbase",m),fe=n(t,i,"platform",m),ge=n(t,i,"tsconfig",m),ce=n(t,i,"resolveExtensions",V),me=n(t,i,"nodePaths",V),ye=n(t,i,"mainFields",V),he=n(t,i,"conditions",V),g=n(t,i,"external",V),u=n(t,i,"loader",ie),l=n(t,i,"outExtension",ie),c=n(t,i,"publicPath",m),F=n(t,i,"entryNames",m),T=n(t,i,"chunkNames",m),$=n(t,i,"assetNames",m),x=n(t,i,"inject",V),P=n(t,i,"banner",ie),M=n(t,i,"footer",ie),R=n(t,i,"entryPoints",ft),U=n(t,i,"absWorkingDir",m),S=n(t,i,"stdin",ie),B=(b=n(t,i,"write",q))!=null?b:d,W=n(t,i,"allowOverwrite",q),ee=n(t,i,"incremental",q)===!0,E=n(t,i,"mangleCache",ie);if(i.plugins=!0,Y(t,i,`in ${e}() call`),C&&s.push(`--sourcemap${C===!0?"":`=${C}`}`),k&&s.push("--bundle"),W&&s.push("--allow-overwrite"),z)if(s.push("--watch"),typeof z=="boolean")N={};else{let a=Object.create(null),v=n(z,a,"onRebuild",Ue);Y(z,a,`on "watch" in ${e}() call`),N={onRebuild:v}}if(ne&&s.push("--splitting"),se&&s.push("--preserve-symlinks"),le&&s.push("--metafile"),te&&s.push(`--outfile=${te}`),oe&&s.push(`--outdir=${oe}`),ae&&s.push(`--outbase=${ae}`),fe&&s.push(`--platform=${fe}`),ge&&s.push(`--tsconfig=${ge}`),ce){let a=[];for(let v of ce){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);a.push(v)}s.push(`--resolve-extensions=${a.join(",")}`)}if(c&&s.push(`--public-path=${c}`),F&&s.push(`--entry-names=${F}`),T&&s.push(`--chunk-names=${T}`),$&&s.push(`--asset-names=${$}`),ye){let a=[];for(let v of ye){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);a.push(v)}s.push(`--main-fields=${a.join(",")}`)}if(he){let a=[];for(let v of he){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);a.push(v)}s.push(`--conditions=${a.join(",")}`)}if(g)for(let a of g)s.push(`--external:${a}`);if(P)for(let a in P){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);s.push(`--banner:${a}=${P[a]}`)}if(M)for(let a in M){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);s.push(`--footer:${a}=${M[a]}`)}if(x)for(let a of x)s.push(`--inject:${a}`);if(u)for(let a in u){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);s.push(`--loader:${a}=${u[a]}`)}if(l)for(let a in l){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);s.push(`--out-extension:${a}=${l[a]}`)}if(R)if(Array.isArray(R))for(let a of R)f.push(["",a+""]);else for(let[a,v]of Object.entries(R))f.push([a+"",v+""]);if(S){let a=Object.create(null),v=n(S,a,"contents",m),L=n(S,a,"resolveDir",m),w=n(S,a,"sourcefile",m),p=n(S,a,"loader",m);Y(S,a,'in "stdin" object'),w&&s.push(`--sourcefile=${w}`),p&&s.push(`--loader=${p}`),L&&(O=L+""),h=v?v+"":""}let y=[];if(me)for(let a of me)a+="",y.push(a);return{entries:f,flags:s,write:B,stdinContents:h,stdinResolveDir:O,absWorkingDir:U,incremental:ee,nodePaths:y,watch:N,mangleCache:He(E)}}function mt(e,t,r,o){let d=[],s=Object.create(null);Ce(d,t,s,r,o),Ge(d,t,s);let f=n(t,s,"sourcemap",Ye),i=n(t,s,"tsconfigRaw",ct),h=n(t,s,"sourcefile",m),O=n(t,s,"loader",m),N=n(t,s,"banner",m),C=n(t,s,"footer",m),k=n(t,s,"mangleCache",ie);return Y(t,s,`in ${e}() call`),f&&d.push(`--sourcemap=${f===!0?"external":f}`),i&&d.push(`--tsconfig-raw=${typeof i=="string"?i:JSON.stringify(i)}`),h&&d.push(`--sourcefile=${h}`),O&&d.push(`--loader=${O}`),N&&d.push(`--banner=${N}`),C&&d.push(`--footer=${C}`),{flags:d,mangleCache:He(k)}}function Xe(e){let t=new Map,r=new Map,o=new Map,d=new Map,s=null,f=0,i=0,h=new Uint8Array(16*1024),O=0,N=g=>{let u=O+g.length;if(u>h.length){let c=new Uint8Array(u*2);c.set(h),h=c}h.set(g,O),O+=g.length;let l=0;for(;l+4<=O;){let c=je(h,l);if(l+4+c>O)break;l+=4,le(h.subarray(l,l+c)),l+=c}l>0&&(h.copyWithin(0,l,O),O-=l)},C=g=>{s={reason:g?": "+(g.message||g):""};let u="The service was stopped"+s.reason;for(let l of t.values())l(u,null);t.clear();for(let l of d.values())l.onWait(u);d.clear();for(let l of o.values())try{l(new Error(u),null)}catch(c){console.error(c)}o.clear()},k=(g,u,l)=>{if(s)return l("The service is no longer running"+s.reason,null);let c=f++;t.set(c,(F,T)=>{try{l(F,T)}finally{g&&g.unref()}}),g&&g.ref(),e.writeToStdin(Fe({id:c,isRequest:!0,value:u}))},z=(g,u)=>{if(s)throw new Error("The service is no longer running"+s.reason);e.writeToStdin(Fe({id:g,isRequest:!1,value:u}))},ne=async(g,u)=>{try{switch(u.command){case"ping":{z(g,{});break}case"on-start":{let l=r.get(u.key);l?z(g,await l(u)):z(g,{});break}case"on-resolve":{let l=r.get(u.key);l?z(g,await l(u)):z(g,{});break}case"on-load":{let l=r.get(u.key);l?z(g,await l(u)):z(g,{});break}case"serve-request":{let l=d.get(u.key);l&&l.onRequest&&l.onRequest(u.args),z(g,{});break}case"serve-wait":{let l=d.get(u.key);l&&l.onWait(u.error),z(g,{});break}case"watch-rebuild":{let l=o.get(u.key);try{l&&l(null,u.args)}catch(c){console.error(c)}z(g,{});break}default:throw new Error("Invalid command: "+u.command)}}catch(l){z(g,{errors:[ve(l,e,null,void 0,"")]})}},se=!0,le=g=>{if(se){se=!1;let l=String.fromCharCode(...g);if(l!=="0.14.49")throw new Error(`Cannot start service: Host version "0.14.49" does not match binary version ${JSON.stringify(l)}`);return}let u=ze(g);if(u.isRequest)ne(u.id,u.value);else{let l=t.get(u.id);t.delete(u.id),u.value.error?l(u.value.error,{}):l(null,u.value)}},te=async(g,u,l,c,F)=>{let T=[],$=[],x={},P={},M=0,R=0,U=[],S=!1;u=[...u];for(let E of u){let y={};if(typeof E!="object")throw new Error(`Plugin at index ${R} must be an object`);let b=n(E,y,"name",m);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let a=n(E,y,"setup",Ue);if(typeof a!="function")throw new Error("Plugin is missing a setup function");Y(E,y,`on plugin ${JSON.stringify(b)}`);let v={name:b,onResolve:[],onLoad:[]};R++;let w=a({initialOptions:g,resolve:(p,D={})=>{if(!S)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof p!="string")throw new Error("The path to resolve must be a string");let A=Object.create(null),Q=n(D,A,"pluginName",m),I=n(D,A,"importer",m),_=n(D,A,"namespace",m),X=n(D,A,"resolveDir",m),H=n(D,A,"kind",m),j=n(D,A,"pluginData",$e);return Y(D,A,"in resolve() call"),new Promise((J,G)=>{let K={command:"resolve",path:p,key:l,pluginName:b};Q!=null&&(K.pluginName=Q),I!=null&&(K.importer=I),_!=null&&(K.namespace=_),X!=null&&(K.resolveDir=X),H!=null&&(K.kind=H),j!=null&&(K.pluginData=c.store(j)),k(F,K,(ue,Z)=>{ue!==null?G(new Error(ue)):J({errors:pe(Z.errors,c),warnings:pe(Z.warnings,c),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:c.load(Z.pluginData)})})})},onStart(p){let D='This error came from the "onStart" callback registered here:',A=Ee(new Error(D),e,"onStart");T.push({name:b,callback:p,note:A})},onEnd(p){let D='This error came from the "onEnd" callback registered here:',A=Ee(new Error(D),e,"onEnd");$.push({name:b,callback:p,note:A})},onResolve(p,D){let A='This error came from the "onResolve" callback registered here:',Q=Ee(new Error(A),e,"onResolve"),I={},_=n(p,I,"filter",Me),X=n(p,I,"namespace",m);if(Y(p,I,`in onResolve() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onResolve() call is missing a filter");let H=M++;x[H]={name:b,callback:D,note:Q},v.onResolve.push({id:H,filter:_.source,namespace:X||""})},onLoad(p,D){let A='This error came from the "onLoad" callback registered here:',Q=Ee(new Error(A),e,"onLoad"),I={},_=n(p,I,"filter",Me),X=n(p,I,"namespace",m);if(Y(p,I,`in onLoad() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onLoad() call is missing a filter");let H=M++;P[H]={name:b,callback:D,note:Q},v.onLoad.push({id:H,filter:_.source,namespace:X||""})},esbuild:e.esbuild});w&&await w,U.push(v)}catch(a){return{ok:!1,error:a,pluginName:b}}}let B=async E=>{switch(E.command){case"on-start":{let y={errors:[],warnings:[]};return await Promise.all(T.map(async({name:b,callback:a,note:v})=>{try{let L=await a();if(L!=null){if(typeof L!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let w={},p=n(L,w,"errors",V),D=n(L,w,"warnings",V);Y(L,w,`from onStart() callback in plugin ${JSON.stringify(b)}`),p!=null&&y.errors.push(...we(p,"errors",c,b)),D!=null&&y.warnings.push(...we(D,"warnings",c,b))}}catch(L){y.errors.push(ve(L,e,c,v&&v(),b))}})),y}case"on-resolve":{let y={},b="",a,v;for(let L of E.ids)try{({name:b,callback:a,note:v}=x[L]);let w=await a({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:c.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let p={},D=n(w,p,"pluginName",m),A=n(w,p,"path",m),Q=n(w,p,"namespace",m),I=n(w,p,"suffix",m),_=n(w,p,"external",q),X=n(w,p,"sideEffects",q),H=n(w,p,"pluginData",$e),j=n(w,p,"errors",V),J=n(w,p,"warnings",V),G=n(w,p,"watchFiles",V),K=n(w,p,"watchDirs",V);Y(w,p,`from onResolve() callback in plugin ${JSON.stringify(b)}`),y.id=L,D!=null&&(y.pluginName=D),A!=null&&(y.path=A),Q!=null&&(y.namespace=Q),I!=null&&(y.suffix=I),_!=null&&(y.external=_),X!=null&&(y.sideEffects=X),H!=null&&(y.pluginData=c.store(H)),j!=null&&(y.errors=we(j,"errors",c,b)),J!=null&&(y.warnings=we(J,"warnings",c,b)),G!=null&&(y.watchFiles=ke(G,"watchFiles")),K!=null&&(y.watchDirs=ke(K,"watchDirs"));break}}catch(w){return{id:L,errors:[ve(w,e,c,v&&v(),b)]}}return y}case"on-load":{let y={},b="",a,v;for(let L of E.ids)try{({name:b,callback:a,note:v}=P[L]);let w=await a({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:c.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let p={},D=n(w,p,"pluginName",m),A=n(w,p,"contents",pt),Q=n(w,p,"resolveDir",m),I=n(w,p,"pluginData",$e),_=n(w,p,"loader",m),X=n(w,p,"errors",V),H=n(w,p,"warnings",V),j=n(w,p,"watchFiles",V),J=n(w,p,"watchDirs",V);Y(w,p,`from onLoad() callback in plugin ${JSON.stringify(b)}`),y.id=L,D!=null&&(y.pluginName=D),A instanceof Uint8Array?y.contents=A:A!=null&&(y.contents=de(A)),Q!=null&&(y.resolveDir=Q),I!=null&&(y.pluginData=c.store(I)),_!=null&&(y.loader=_),X!=null&&(y.errors=we(X,"errors",c,b)),H!=null&&(y.warnings=we(H,"warnings",c,b)),j!=null&&(y.watchFiles=ke(j,"watchFiles")),J!=null&&(y.watchDirs=ke(J,"watchDirs"));break}}catch(w){return{id:L,errors:[ve(w,e,c,v&&v(),b)]}}return y}default:throw new Error("Invalid command: "+E.command)}},W=(E,y,b)=>b();$.length>0&&(W=(E,y,b)=>{(async()=>{for(let{name:a,callback:v,note:L}of $)try{await v(E)}catch(w){E.errors.push(await new Promise(p=>y(w,a,L&&L(),p)))}})().then(b)}),S=!0;let ee=0;return{ok:!0,requestPlugins:U,runOnEndCallbacks:W,pluginRefs:{ref(){++ee===1&&r.set(l,B)},unref(){--ee===0&&r.delete(l)}}}},oe=(g,u,l,c)=>{let F={},T=n(u,F,"port",Oe),$=n(u,F,"host",m),x=n(u,F,"servedir",m),P=n(u,F,"onRequest",Ue),M,R=new Promise((U,S)=>{M=B=>{d.delete(c),B!==null?S(new Error(B)):U()}});return l.serve={},Y(u,F,"in serve() call"),T!==void 0&&(l.serve.port=T),$!==void 0&&(l.serve.host=$),x!==void 0&&(l.serve.servedir=x),d.set(c,{onRequest:P,onWait:M}),{wait:R,stop(){k(g,{command:"serve-stop",key:c},()=>{})}}},ae="warning",fe="silent",ge=g=>{let u=i++,l=Ve(),c,{refs:F,options:T,isTTY:$,callback:x}=g;if(typeof T=="object"){let R=T.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');c=R}}let P=(R,U,S,B)=>{let W=[];try{Ce(W,T,{},$,ae)}catch(E){}let ee=ve(R,e,l,S,U);k(F,{command:"error",flags:W,error:ee},()=>{ee.detail=l.load(ee.detail),B(ee)})},M=(R,U)=>{P(R,U,void 0,S=>{x(Re("Build failed",[S],[]),null)})};if(c&&c.length>0){if(e.isSync)return M(new Error("Cannot use plugins in synchronous API calls"),"");te(T,c,u,l,F).then(R=>{if(!R.ok)M(R.error,R.pluginName);else try{ce(De(Be({},g),{key:u,details:l,logPluginError:P,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(U){M(U,"")}},R=>M(R,""))}else try{ce(De(Be({},g),{key:u,details:l,logPluginError:P,requestPlugins:null,runOnEndCallbacks:(R,U,S)=>S(),pluginRefs:null}))}catch(R){M(R,"")}},ce=({callName:g,refs:u,serveOptions:l,options:c,isTTY:F,defaultWD:T,callback:$,key:x,details:P,logPluginError:M,requestPlugins:R,runOnEndCallbacks:U,pluginRefs:S})=>{let B={ref(){S&&S.ref(),u&&u.ref()},unref(){S&&S.unref(),u&&u.unref()}},W=!e.isWriteUnavailable,{entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:a,absWorkingDir:v,incremental:L,nodePaths:w,watch:p,mangleCache:D}=gt(g,c,F,ae,W),A={command:"build",key:x,entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:a,absWorkingDir:v||T,incremental:L,nodePaths:w};R&&(A.plugins=R),D&&(A.mangleCache=D);let Q=l&&oe(B,l,A,x),I,_,X=(j,J)=>{j.outputFiles&&(J.outputFiles=j.outputFiles.map(yt)),j.metafile&&(J.metafile=JSON.parse(j.metafile)),j.mangleCache&&(J.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(be(j.writeToStdout).replace(/\n$/,""))},H=(j,J)=>{let G={errors:pe(j.errors,P),warnings:pe(j.warnings,P)};X(j,G),U(G,M,()=>{if(G.errors.length>0)return J(Re("Build failed",G.errors,G.warnings),null);if(j.rebuild){if(!I){let K=!1;I=()=>new Promise((ue,Z)=>{if(K||s)throw new Error("Cannot rebuild");k(B,{command:"rebuild",key:x},(re,et)=>{if(re)return J(Re("Build failed",[{id:"",pluginName:"",text:re,location:null,notes:[],detail:void 0}],[]),null);H(et,(Te,tt)=>{Te?Z(Te):ue(tt)})})}),B.ref(),I.dispose=()=>{K||(K=!0,k(B,{command:"rebuild-dispose",key:x},()=>{}),B.unref())}}G.rebuild=I}if(j.watch){if(!_){let K=!1;B.ref(),_=()=>{K||(K=!0,o.delete(x),k(B,{command:"watch-stop",key:x},()=>{}),B.unref())},p&&o.set(x,(ue,Z)=>{if(ue){p.onRebuild&&p.onRebuild(ue,null);return}let re={errors:pe(Z.errors,P),warnings:pe(Z.warnings,P)};X(Z,re),U(re,M,()=>{if(re.errors.length>0){p.onRebuild&&p.onRebuild(Re("Build failed",re.errors,re.warnings),null);return}Z.rebuildID!==void 0&&(re.rebuild=I),re.stop=_,p.onRebuild&&p.onRebuild(null,re)})})}G.stop=_}J(null,G)})};if(y&&e.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(L&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(p&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');k(B,A,(j,J)=>{if(j)return $(new Error(j),null);if(Q){let G=J,K=!1;B.ref();let ue={port:G.port,host:G.host,wait:Q.wait,stop(){K||(K=!0,Q.stop(),B.unref())}};return B.ref(),Q.wait.then(B.unref,B.unref),$(null,ue)}return H(J,$)})};return{readFromStdout:N,afterClose:C,service:{buildOrServe:ge,transform:({callName:g,refs:u,input:l,options:c,isTTY:F,fs:T,callback:$})=>{let x=Ve(),P=M=>{try{if(typeof l!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:U}=mt(g,c,F,fe),S={command:"transform",flags:R,inputFS:M!==null,input:M!==null?M:l};U&&(S.mangleCache=U),k(u,S,(B,W)=>{if(B)return $(new Error(B),null);let ee=pe(W.errors,x),E=pe(W.warnings,x),y=1,b=()=>{if(--y===0){let a={warnings:E,code:W.code,map:W.map};W.mangleCache&&(a.mangleCache=W==null?void 0:W.mangleCache),$(null,a)}};if(ee.length>0)return $(Re("Transform failed",ee,E),null);W.codeFS&&(y++,T.readFile(W.code,(a,v)=>{a!==null?$(a,null):(W.code=v,b())})),W.mapFS&&(y++,T.readFile(W.map,(a,v)=>{a!==null?$(a,null):(W.map=v,b())})),b()})}catch(R){let U=[];try{Ce(U,c,{},F,fe)}catch(B){}let S=ve(R,e,x,void 0,"");k(u,{command:"error",flags:U,error:S},()=>{S.detail=x.load(S.detail),$(Re("Transform failed",[S],[]),null)})}};if(typeof l=="string"&&l.length>1024*1024){let M=P;P=()=>T.writeFile(l,M)}P(null)},formatMessages:({callName:g,refs:u,messages:l,options:c,callback:F})=>{let T=we(l,"messages",null,"");if(!c)throw new Error(`Missing second argument in ${g}() call`);let $={},x=n(c,$,"kind",m),P=n(c,$,"color",q),M=n(c,$,"terminalWidth",Oe);if(Y(c,$,`in ${g}() call`),x===void 0)throw new Error(`Missing "kind" in ${g}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${g}() call`);let R={command:"format-msgs",messages:T,isWarning:x==="warning"};P!==void 0&&(R.color=P),M!==void 0&&(R.terminalWidth=M),k(u,R,(U,S)=>{if(U)return F(new Error(U),null);F(null,S.messages)})},analyzeMetafile:({callName:g,refs:u,metafile:l,options:c,callback:F})=>{c===void 0&&(c={});let T={},$=n(c,T,"color",q),x=n(c,T,"verbose",q);Y(c,T,`in ${g}() call`);let P={command:"analyze-metafile",metafile:l};$!==void 0&&(P.color=$),x!==void 0&&(P.verbose=x),k(u,P,(M,R)=>{if(M)return F(new Error(M),null);F(null,R.result)})}}}}function Ve(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let o=t++;return e.set(o,r),o}}}function Ee(e,t,r){let o,d=!1;return()=>{if(d)return o;d=!0;try{let s=(e.stack+"").split(`
2
+ `);s.splice(1,1);let f=Ze(t,s,r);if(f)return o={text:e.message,location:f},o}catch(s){}}}function ve(e,t,r,o,d){let s="Internal error",f=null;try{s=(e&&e.message||e)+""}catch(i){}try{f=Ze(t,(e.stack+"").split(`
3
+ `),"")}catch(i){}return{id:"",pluginName:d,text:s,location:f,notes:o?[o]:[],detail:r?r.store(e):-1}}function Ze(e,t,r){let o=" at ";if(e.readFileSync&&!t[0].startsWith(o)&&t[1].startsWith(o))for(let d=1;d<t.length;d++){let s=t[d];if(!!s.startsWith(o))for(s=s.slice(o.length);;){let f=/^(?:new |async )?\S+ \((.*)\)$/.exec(s);if(f){s=f[1];continue}if(f=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(s),f){s=f[1];continue}if(f=/^(\S+):(\d+):(\d+)$/.exec(s),f){let i;try{i=e.readFileSync(f[1],"utf8")}catch(C){break}let h=i.split(/\r\n|\r|\n|\u2028|\u2029/)[+f[2]-1]||"",O=+f[3]-1,N=h.slice(O,O+r.length)===r?r.length:0;return{file:f[1],namespace:"file",line:+f[2],column:de(h.slice(0,O)).length,length:de(h.slice(O,O+N)).length,lineText:h+`
4
4
  `+t.slice(1).join(`
5
- `),suggestion:""}}break}}return null}function ve(e,t,r){let s=5,p=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,s+1).map((f,l)=>{if(l===s)return`
5
+ `),suggestion:""}}break}}return null}function Re(e,t,r){let o=5,d=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,o+1).map((f,i)=>{if(i===o)return`
6
6
  ...`;if(!f.location)return`
7
- error: ${f.text}`;let{file:h,line:O,column:N}=f.location,k=f.pluginName?`[plugin: ${f.pluginName}] `:"";return`
8
- ${h}:${O}:${N}: ERROR: ${k}${f.text}`}).join(""),i=new Error(`${e}${p}`);return i.errors=t,i.warnings=r,i}function ce(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Je(e,t){if(e==null)return null;let r={},s=n(e,r,"file",m),p=n(e,r,"namespace",m),i=n(e,r,"line",Re),f=n(e,r,"column",Re),l=n(e,r,"length",Re),h=n(e,r,"lineText",m),O=n(e,r,"suggestion",m);return Y(e,r,t),{file:s||"",namespace:p||"",line:i||0,column:f||0,length:l||0,lineText:h||"",suggestion:O||""}}function he(e,t,r,s){let p=[],i=0;for(let f of e){let l={},h=n(f,l,"pluginName",m),O=n(f,l,"text",m),N=n(f,l,"location",_e),k=n(f,l,"notes",V),C=n(f,l,"detail",Me),q=`in element ${i} of "${t}"`;Y(f,l,q);let oe=[];if(k)for(let re of k){let ne={},le=n(re,ne,"text",m),ie=n(re,ne,"location",_e);Y(re,ne,q),oe.push({text:le||"",location:Je(ie,q)})}p.push({pluginName:h||s,text:O||"",location:Je(N,q),notes:oe,detail:r?r.store(C):-1}),i++}return p}function ke(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function yt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=ye(t)),r}}}var bt="0.14.36",wt=e=>Pe().build(e),vt=()=>{throw new Error('The "serve" API only works in node')},Rt=(e,t)=>Pe().transform(e,t),Ot=(e,t)=>Pe().formatMessages(e,t),St=(e,t)=>Pe().analyzeMetafile(e,t),xt=()=>{throw new Error('The "buildSync" API only works in node')},Et=()=>{throw new Error('The "transformSync" API only works in node')},kt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Mt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Oe,Ue,Pe=()=>{if(Ue)return Ue;throw Oe?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},$t=e=>{e=Qe(e||{});let t=e.wasmURL,r=e.wasmModule,s=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Oe)throw new Error('Cannot call "initialize" more than once');return Oe=Ct(t||"",r,s),Oe.catch(()=>{Oe=void 0}),Oe},Ct=async(e,t,r)=>{let s;if(t)s=t;else{let l=await fetch(e);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);s=await l.arrayBuffer()}let p;if(r){let l=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.36"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});p=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
7
+ error: ${f.text}`;let{file:h,line:O,column:N}=f.location,C=f.pluginName?`[plugin: ${f.pluginName}] `:"";return`
8
+ ${h}:${O}:${N}: ERROR: ${C}${f.text}`}).join(""),s=new Error(`${e}${d}`);return s.errors=t,s.warnings=r,s}function pe(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Je(e,t){if(e==null)return null;let r={},o=n(e,r,"file",m),d=n(e,r,"namespace",m),s=n(e,r,"line",Oe),f=n(e,r,"column",Oe),i=n(e,r,"length",Oe),h=n(e,r,"lineText",m),O=n(e,r,"suggestion",m);return Y(e,r,t),{file:o||"",namespace:d||"",line:s||0,column:f||0,length:i||0,lineText:h||"",suggestion:O||""}}function we(e,t,r,o){let d=[],s=0;for(let f of e){let i={},h=n(f,i,"id",m),O=n(f,i,"pluginName",m),N=n(f,i,"text",m),C=n(f,i,"location",_e),k=n(f,i,"notes",V),z=n(f,i,"detail",$e),ne=`in element ${s} of "${t}"`;Y(f,i,ne);let se=[];if(k)for(let le of k){let te={},oe=n(le,te,"text",m),ae=n(le,te,"location",_e);Y(le,te,ne),se.push({text:oe||"",location:Je(ae,ne)})}d.push({id:h||"",pluginName:O||o,text:N||"",location:Je(C,ne),notes:se,detail:r?r.store(z):-1}),s++}return d}function ke(e,t){let r=[];for(let o of e){if(typeof o!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(o)}return r}function yt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=be(t)),r}}}var bt="0.14.49",wt=e=>Pe().build(e),vt=()=>{throw new Error('The "serve" API only works in node')},Rt=(e,t)=>Pe().transform(e,t),Ot=(e,t)=>Pe().formatMessages(e,t),St=(e,t)=>Pe().analyzeMetafile(e,t),xt=()=>{throw new Error('The "buildSync" API only works in node')},Et=()=>{throw new Error('The "transformSync" API only works in node')},kt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},$t=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Se,Le,Pe=()=>{if(Le)return Le;throw Se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},Mt=e=>{e=Qe(e||{});let t=e.wasmURL,r=e.wasmModule,o=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Se)throw new Error('Cannot call "initialize" more than once');return Se=Ct(t||"",r,o),Se.catch(()=>{Se=void 0}),Se},Ct=async(e,t,r)=>{let o;if(t)o=t;else{let i=await fetch(e);if(!i.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);o=await i.arrayBuffer()}let d;if(r){let i=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.49"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});d=new Worker(URL.createObjectURL(i))}else{let i=(postMessage=>{
9
9
  // Copyright 2018 The Go Authors. All rights reserved.
10
10
  // Use of this source code is governed by a BSD-style
11
11
  // license that can be found in the LICENSE file.
12
12
  let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`
13
13
  `);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`
14
14
  `);d.length>1&&console.log(d.slice(0,-1).join(`
15
- `)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.36"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(h=>p.onmessage({data:h}));p={onmessage:null,postMessage:h=>setTimeout(()=>l({data:h})),terminate(){}}}p.postMessage(s),p.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:f}=Xe({writeToStdin(l){p.postMessage(l)},isSync:!1,isBrowser:!0,esbuild:Ae});Ue={build:l=>new Promise((h,O)=>f.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(N,k)=>N?O(N):h(k)})),transform:(l,h)=>new Promise((O,N)=>f.transform({callName:"transform",refs:null,input:l,options:h||{},isTTY:!1,fs:{readFile(k,C){C(new Error("Internal error"),null)},writeFile(k,C){C(null)}},callback:(k,C)=>k?N(k):O(C)})),formatMessages:(l,h)=>new Promise((O,N)=>f.formatMessages({callName:"formatMessages",refs:null,messages:l,options:h,callback:(k,C)=>k?N(k):O(C)})),analyzeMetafile:(l,h)=>new Promise((O,N)=>f.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:h,callback:(k,C)=>k?N(k):O(C)}))}},Pt=Ae;export{St as analyzeMetafile,Mt as analyzeMetafileSync,wt as build,xt as buildSync,Pt as default,Ot as formatMessages,kt as formatMessagesSync,$t as initialize,vt as serve,Rt as transform,Et as transformSync,bt as version};
15
+ `)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.49"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(h=>d.onmessage({data:h}));d={onmessage:null,postMessage:h=>setTimeout(()=>i({data:h})),terminate(){}}}d.postMessage(o),d.onmessage=({data:i})=>s(i);let{readFromStdout:s,service:f}=Xe({writeToStdin(i){d.postMessage(i)},isSync:!1,isWriteUnavailable:!0,esbuild:Ae});Le={build:i=>new Promise((h,O)=>f.buildOrServe({callName:"build",refs:null,serveOptions:null,options:i,isTTY:!1,defaultWD:"/",callback:(N,C)=>N?O(N):h(C)})),transform:(i,h)=>new Promise((O,N)=>f.transform({callName:"transform",refs:null,input:i,options:h||{},isTTY:!1,fs:{readFile(C,k){k(new Error("Internal error"),null)},writeFile(C,k){k(null)}},callback:(C,k)=>C?N(C):O(k)})),formatMessages:(i,h)=>new Promise((O,N)=>f.formatMessages({callName:"formatMessages",refs:null,messages:i,options:h,callback:(C,k)=>C?N(C):O(k)})),analyzeMetafile:(i,h)=>new Promise((O,N)=>f.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof i=="string"?i:JSON.stringify(i),options:h,callback:(C,k)=>C?N(C):O(k)}))}},Pt=Ae;export{St as analyzeMetafile,$t as analyzeMetafileSync,wt as build,xt as buildSync,Pt as default,Ot as formatMessages,kt as formatMessagesSync,Mt as initialize,vt as serve,Rt as transform,Et as transformSync,bt as version};